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

Provide access to database from external clients or configure pgadmin in server #962

Open
cdparra opened this issue Jul 16, 2020 · 4 comments

Comments

@cdparra
Copy link
Member

cdparra commented Jul 16, 2020

For better management and checking of issues, we would need a way to access the database.

@mitar
Copy link
Member

mitar commented Jul 16, 2020

I documented how this can be done using SSH on Slack already, copying it here:

export PGHOST="$(ssh -l admin <server> sudo docker inspect -f "'{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}'" denguechat_postgresdb)"
ssh -L 5432:$PGHOST:5432 -l admin <server> -N &
docker run --rm -d --network host -e PHPPGADMIN_HOST=localhost --name phppgadmin tozd/phppgadmin

And open phpPgAdmin at http://localhost/phppgadmin/.

There is no need to install anything anywhere.

Of course you have to have admin permissions to access the server.

@mitar mitar closed this as completed Jul 16, 2020
@mitar mitar reopened this Jul 18, 2020
@mitar
Copy link
Member

mitar commented Jul 18, 2020

I realized the above works well for those who have admin access, like @yolile. But maybe you want also access for others?

I also think that you have one PostgreSQL container per dengue chat? So it is not a shared instance with multiple projects? In this case what we could do is deploy a locked-down instance of phppgadmin which is configured to connect only to that container. We could even make it using our nginx reverse proxy so that it is available under https://<denguechat domain>/phppgadmin or something. So that it is clear that it is instance for that particular deployment of denguechat.

Then it i on you to coordinate how you distribute access to the database. You can even make non-admin users on the database with read-only access and things like that.

@cdparra
Copy link
Member Author

cdparra commented Aug 6, 2020

Just sent out an email and I think we do need this. not only for DengueChat, but also for AppCivist I would say. It's frequently good to access and study dat directly in the DB.

Also, denguechat has a redis instance we would be good to have an access to at least create backups.

@mitar
Copy link
Member

mitar commented Aug 6, 2020

Just sent out an email and I think we do need this. not only for DengueChat, but also for AppCivist I would say. It's frequently good to access and study dat directly in the DB.

Who should be accessing this? And how often? This is the main question here to see what is worth doing.

Also, denguechat has a redis instance we would be good to have an access to at least create backups.

Is redis running as a cache? Or as a storage? If it is just a cache you do not need backups. I hope you are not storing into redis things you want to store permanently? See here: https://stackoverflow.com/questions/25328317/does-redis-persist-data

I would suggest you always store data into a database only and use Redis only as a cache.

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

3 participants