Skip to content

Commit d635162

Browse files
committed
fix: update pygeoapi configuration to use environment variable for PostgreSQL password
1 parent 2997de2 commit d635162

2 files changed

Lines changed: 4 additions & 7 deletions

File tree

core/pygeoapi-config.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ resources:
5151
port: {postgres_port}
5252
dbname: {postgres_db}
5353
user: {postgres_user}
54-
password: {postgres_password}
54+
password: ${{POSTGRES_PASSWORD}}
5555
search_path: [public]
5656
id_field: id
5757
table: location
@@ -74,7 +74,7 @@ resources:
7474
port: {postgres_port}
7575
dbname: {postgres_db}
7676
user: {postgres_user}
77-
password: {postgres_password}
77+
password: ${{POSTGRES_PASSWORD}}
7878
search_path: [public]
7979
id_field: id
8080
table: ogc_latest_depth_to_water_wells
@@ -97,7 +97,7 @@ resources:
9797
port: {postgres_port}
9898
dbname: {postgres_db}
9999
user: {postgres_user}
100-
password: {postgres_password}
100+
password: ${{POSTGRES_PASSWORD}}
101101
search_path: [public]
102102
id_field: id
103103
table: ogc_avg_tds_wells

core/pygeoapi.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,6 @@ def _thing_collections_block(
213213
port: str,
214214
dbname: str,
215215
user: str,
216-
password: str,
217216
) -> str:
218217
blocks = []
219218
for collection in THING_COLLECTIONS:
@@ -235,7 +234,7 @@ def _thing_collections_block(
235234
port: {port}
236235
dbname: {dbname}
237236
user: {user}
238-
password: {password}
237+
password: ${{POSTGRES_PASSWORD}}
239238
search_path: [public]
240239
id_field: id
241240
table: ogc_{collection["id"]}
@@ -255,13 +254,11 @@ def _write_config(path: Path) -> None:
255254
postgres_port=port,
256255
postgres_db=dbname,
257256
postgres_user=user,
258-
postgres_password="${POSTGRES_PASSWORD}",
259257
thing_collections_block=_thing_collections_block(
260258
host=host,
261259
port=port,
262260
dbname=dbname,
263261
user=user,
264-
password="${POSTGRES_PASSWORD}",
265262
),
266263
)
267264
path.write_text(config, encoding="utf-8")

0 commit comments

Comments
 (0)