linz / gazetteer

New Zealand Gazetteer of official place names
http://www.linz.govt.nz/regulatory/place-names/find-name/new-zealand-gazetteer-official-geographic-names/new-zealand-gazetteer-search-place-names#zoom=0&lat=-41.14127&lon=172.5&layers=BTTT
Other
2 stars 2 forks source link

Dockerize gazzetteer db #64

Closed strk closed 4 years ago

strk commented 4 years ago

TODO:

palmerj commented 4 years ago

Wow I'm surprised there is a docker image for 8.4. What about PostGIS 1.5 (GEO 3.2, PROJ=4.6)?

strk commented 4 years ago

Eh, that part I'm going to find out next (or will build from source). The INSTALLATION file did not mention that requirement, I'm going to send some side-PRs to improve both documentation and installation scripts, would simplify this task

strk commented 4 years ago

Ok, PostGIS is built from source. Database schema is created. Only it does NOT currently include the gazetteer_web schema, should it @SPlanzer ?

strk commented 4 years ago

NOTE: as of 6a88e37 the database is created with 2 users gaz_web and gaz_web_dev both with password ********, which is unlikely what we want.

SPlanzer commented 4 years ago

Ok, PostGIS is built from source. Database schema is created. Only it does NOT currently include the gazetteer_web schema, should it @SPlanzer ?

Reading the dev notes

Schema...

gazetteer_web:  The tables accessed by the web application.  These are periodically updated by                     NZGB stuff using the publish data function in the administration tool.

Therefore to test the plugin's admin tools the gazetteer_web schema will be required

This can be added by including %psql -f gazetteer_web_schema.sql || exit 1 was added to src/install.sh prior to $psql -f gazetteer_grant.sql || exit 1 the gazetteer_web schema could also be incuded

https://github.com/linz/gazetteer/blob/615d7ed9ca3e40bb13900f75842425e5893b8274/src/sql/install.sh#L60-L62

SPlanzer commented 4 years ago

NOTE: as of 6a88e37 the database is created with 2 users gaz_web and gaz_web_dev both with password ****, which is unlikely what we want.

password set in following files

sql/Makefile:   PGPASSWORD=******** psql -h localhost -p 7432 -U gaz_web gazetteer
sql/gazetteer_roles.sql:CREATE USER gaz_web IN ROLE gaz_web_reader ENCRYPTED PASSWORD '********';
sql/gazetteer_roles.sql:CREATE USER gaz_web_dev IN ROLE gaz_web_reader, gaz_web_developer ENCRYPTED PASSWORD '********';

I will approve this for CI purposes. obviously this is not fine for prd deployment - prd deployment out of scope of this project

strk commented 4 years ago

Current problem is the circular dependency between scripts, as reported in https://github.com/linz/gazetteer/issues/69, which results in:

psql:gazetteer_grant.sql:295: ERROR: schema "gazetteer_web" does not exist

See: https://github.com/linz/gazetteer/pull/64/checks?check_run_id=518947034#step:4:7700

I'm marking that issue as a blocker for this

strk commented 4 years ago

I've rebased this PR on #72 to get that fix