Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

db password needed in every step of syncing data? #33

Open
bradfordcondon opened this issue May 12, 2019 · 1 comment
Open

db password needed in every step of syncing data? #33

bradfordcondon opened this issue May 12, 2019 · 1 comment

Comments

@bradfordcondon
Copy link
Contributor

when syncing the data, every step requires the db password.

Undefined variable: databases nd_genotypes.mview.sync.inc:156                                                     [notice]
       - Copying to file...
Command dispatch complete                                                                                         [notice]
Password for user postgres:
       - Copying it into the mview...

for now ill just pipe the password to the command 100x times or so, but is there some permission change i can make to bypass this?

@laceysanderson
Copy link
Member

The password prompt is due to permissions meant to protect your server. Specifically, from the PostgreSQL online documentation:

COPY naming a file or command is only allowed to database superusers, since it allows reading or writing any file that the server has privileges to access.

Since our use of the copy functionality is limited to tripal jobs which are run on the command-line they do not pose a risk to your server as they are currently implemented.

How to make sync'ing more automated

If your server is behind a firewall restricting all access to the application/database (e.g. local development site) then one option is to simply give you drupal user superuser access. However, if there is any way for someone from outside your organization to access either the Tripal site or the database, this is not recommended.

A safer way to get around the password prompt is through use of a .pgpass file or environmental variables as documented here. In both cases you must ensure it is available for the user running the Tripal job in order for it to be successful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants