hackoregon / civic-devops

Master collection point for issues, procedures, and code to manage the HackOregon Civic platform
MIT License
11 stars 4 forks source link

Create reusable script for enabling read-only database user #155

Open MikeTheCanuck opened 6 years ago

MikeTheCanuck commented 6 years ago

This procedure seems to be working well enough now: https://github.com/hackoregon/civic-devops/blob/master/docs/HOWTO-enable-readonly-database-user.md

And I'm going to have to re-run it every time I "restore" (aka DROP and CREATE) a database, which is time-consuming, tedious and makes me wonder if I've ever fat-fingered something (e.g #152 ).

It would be awesome to have a reusable script - I'd be happy with with either something I can run from psql or something from the SQL interface of PGAdmin.

nam20485 commented 6 years ago

There is a script in the backend repos under postgis_scripts, called 1_dbmake_user.sh. Ed made it, and borrowed it from his pet-containers repo to put in ours. That may or may not have some useful information.

@znmeb

On Sun, Jun 3, 2018, 7:29 PM Mike Lonergan notifications@github.com wrote:

This procedure seems to be working well enough now:

https://github.com/hackoregon/civic-devops/blob/master/docs/HOWTO-enable-readonly-database-user.md

And I'm going to have to re-run it every time I "restore" (aka DROP and CREATE) a database, which is time-consuming, tedious and makes me wonder if I've ever fat-fingered something (e.g #152 https://github.com/hackoregon/civic-devops/issues/152 ).

It would be awesome to have a reusable script - I'd be happy with with either something I can run from psql or something from the SQL interface of PGAdmin.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/hackoregon/civic-devops/issues/155, or mute the thread https://github.com/notifications/unsubscribe-auth/ABvqFPzzx7MFyzNKy6J_VUS0mhBSptYxks5t5JuagaJpZM4UYXQY .

MikeTheCanuck commented 6 years ago

I've assembled the bones of a working model here: https://github.com/hackoregon/civic-devops/pull/159

Untested so far, and is a brute-force method rather than anything reasonably elegant.

Remember: "working" first, then "good", and maybe later "fast".