File tree Expand file tree Collapse file tree 8 files changed +31
-11
lines changed Expand file tree Collapse file tree 8 files changed +31
-11
lines changed Original file line number Diff line number Diff line change @@ -173,6 +173,7 @@ COPY --from=groonga /tmp/groonga-plugins/plugins /usr/lib/groonga/plugins
173173COPY --chown=postgres:postgres ansible/files/postgresql_config/postgresql.conf.j2 /etc/postgresql/postgresql.conf
174174COPY --chown=postgres:postgres ansible/files/postgresql_config/pg_hba.conf.j2 /etc/postgresql/pg_hba.conf
175175COPY --chown=postgres:postgres ansible/files/postgresql_config/pg_ident.conf.j2 /etc/postgresql/pg_ident.conf
176+ COPY --chown=postgres:postgres ansible/files/postgresql_config/conf.d /etc/postgresql-custom/
176177COPY --chown=postgres:postgres ansible/files/postgresql_config/postgresql-stdout-log.conf /etc/postgresql/logging.conf
177178COPY --chown=postgres:postgres ansible/files/postgresql_config/supautils.conf.j2 /etc/postgresql-custom/supautils.conf
178179COPY --chown=postgres:postgres ansible/files/postgresql_extension_custom_scripts /etc/postgresql-custom/extension-custom-scripts
@@ -193,8 +194,8 @@ RUN sed -i \
193194 echo "vault.getkey_script= '/usr/lib/postgresql/bin/pgsodium_getkey.sh'" >> /etc/postgresql/postgresql.conf && \
194195 echo 'auto_explain.log_min_duration = 10s' >> /etc/postgresql/postgresql.conf && \
195196 usermod -aG postgres wal-g && \
196- mkdir -p /etc/postgresql-custom && \
197- chown postgres:postgres /etc/postgresql-custom
197+ mkdir -p /etc/postgresql-custom/conf.d && \
198+ chown -R postgres:postgres /etc/postgresql-custom
198199
199200# # Include schema migrations
200201COPY migrations/db /docker-entrypoint-initdb.d/
Original file line number Diff line number Diff line change @@ -178,6 +178,7 @@ COPY --from=groonga /tmp/groonga-plugins/plugins /usr/lib/groonga/plugins
178178COPY --chown=postgres:postgres ansible/files/postgresql_config/postgresql.conf.j2 /etc/postgresql/postgresql.conf
179179COPY --chown=postgres:postgres ansible/files/postgresql_config/pg_hba.conf.j2 /etc/postgresql/pg_hba.conf
180180COPY --chown=postgres:postgres ansible/files/postgresql_config/pg_ident.conf.j2 /etc/postgresql/pg_ident.conf
181+ COPY --chown=postgres:postgres ansible/files/postgresql_config/conf.d /etc/postgresql-custom/
181182COPY --chown=postgres:postgres ansible/files/postgresql_config/postgresql-stdout-log.conf /etc/postgresql/logging.conf
182183COPY --chown=postgres:postgres ansible/files/postgresql_config/supautils.conf.j2 /etc/postgresql-custom/supautils.conf
183184COPY --chown=postgres:postgres ansible/files/postgresql_extension_custom_scripts /etc/postgresql-custom/extension-custom-scripts
@@ -198,8 +199,8 @@ RUN sed -i \
198199 echo "vault.getkey_script= '/usr/lib/postgresql/bin/pgsodium_getkey.sh'" >> /etc/postgresql/postgresql.conf && \
199200 echo 'auto_explain.log_min_duration = 10s' >> /etc/postgresql/postgresql.conf && \
200201 usermod -aG postgres wal-g && \
201- mkdir -p /etc/postgresql-custom && \
202- chown postgres:postgres /etc/postgresql-custom
202+ mkdir -p /etc/postgresql-custom/conf.d && \
203+ chown -R postgres:postgres /etc/postgresql-custom
203204
204205 # Remove items from postgresql.conf
205206RUN sed -i 's/ timescaledb,//g;' "/etc/postgresql/postgresql.conf"
Original file line number Diff line number Diff line change @@ -178,6 +178,7 @@ COPY --from=groonga /tmp/groonga-plugins/plugins /usr/lib/groonga/plugins
178178COPY --chown=postgres:postgres ansible/files/postgresql_config/postgresql.conf.j2 /etc/postgresql/postgresql.conf
179179COPY --chown=postgres:postgres ansible/files/postgresql_config/pg_hba.conf.j2 /etc/postgresql/pg_hba.conf
180180COPY --chown=postgres:postgres ansible/files/postgresql_config/pg_ident.conf.j2 /etc/postgresql/pg_ident.conf
181+ COPY --chown=postgres:postgres ansible/files/postgresql_config/conf.d /etc/postgresql-custom/
181182COPY --chown=postgres:postgres ansible/files/postgresql_config/postgresql-stdout-log.conf /etc/postgresql/logging.conf
182183COPY --chown=postgres:postgres ansible/files/postgresql_config/supautils.conf.j2 /etc/postgresql-custom/supautils.conf
183184COPY --chown=postgres:postgres ansible/files/postgresql_extension_custom_scripts /etc/postgresql-custom/extension-custom-scripts
@@ -198,8 +199,8 @@ RUN sed -i \
198199 echo "vault.getkey_script= '/usr/lib/postgresql/bin/pgsodium_getkey.sh'" >> /etc/postgresql/postgresql.conf && \
199200 echo 'auto_explain.log_min_duration = 10s' >> /etc/postgresql/postgresql.conf && \
200201 usermod -aG postgres wal-g && \
201- mkdir -p /etc/postgresql-custom && \
202- chown postgres:postgres /etc/postgresql-custom
202+ mkdir -p /etc/postgresql-custom/conf.d && \
203+ chown -R postgres:postgres /etc/postgresql-custom
203204
204205 # Remove items from postgresql.conf
205206RUN sed -i 's/ timescaledb,//g;' "/etc/postgresql/postgresql.conf"
Original file line number Diff line number Diff line change @@ -750,8 +750,6 @@ jit_provider = 'llvmjit' # JIT library to use
750750# default postgresql.conf. Note that these are directives, not variable
751751# assignments, so they can usefully be given more than once.
752752
753- #include_dir = '...' # include files ending in '.conf' from
754- # a directory, e.g., 'conf.d'
755753#include_if_exists = '...' # include file only if it exists
756754#include = '...' # include file
757755
@@ -769,6 +767,7 @@ include = '/etc/postgresql-custom/read-replica.conf'
769767# supautils specific configurations
770768#include = '/etc/postgresql-custom/supautils.conf'
771769
770+ include_dir = '/etc/postgresql-custom/conf.d' # include files ending in '.conf' from a directory, e.g., 'conf.d'
772771#------------------------------------------------------------------------------
773772# CUSTOMIZED OPTIONS
774773#------------------------------------------------------------------------------
Original file line number Diff line number Diff line change @@ -10,9 +10,9 @@ postgres_major:
1010
1111# Full version strings for each major version
1212postgres_release :
13- postgresorioledb-17 : " 17.5.1.073-orioledb"
14- postgres17 : " 17.7.1.001"
15- postgres15 : " 15.14.1.052"
13+ postgresorioledb-17 : " 17.5.1.073-orioledb-INDATA253 "
14+ postgres17 : " 17.7.1.001-INDATA253 "
15+ postgres15 : " 15.14.1.052-INDATA253 "
1616
1717# Non Postgres Extensions
1818pgbouncer_release : 1.19.0
Original file line number Diff line number Diff line change 3636 name = "postgresql.conf" ;
3737 path = ../../ansible/files/postgresql_config/postgresql.conf.j2 ;
3838 } ;
39+ configConfDir = builtins . path {
40+ name = "conf.d" ;
41+ path = ../../ansible/files/postgresql_config/conf.d ;
42+ } ;
3943 supautilsConfigFile = builtins . path {
4044 name = "supautils.conf" ;
4145 path = ../../ansible/files/postgresql_config/supautils.conf.j2 ;
7276 else
7377 "${ pkgs . glibcLocales } /lib/locale/locale-archive" ;
7478
79+ postgresqlConfigBaseDir = builtins . path {
80+ name = "postgresql_config" ;
81+ path = ../../ansible/files/postgresql_config ;
82+ } ;
83+
7584 substitutions = {
7685 SHELL_PATH = "${ pkgs . bash } /bin/bash" ;
7786 PGSQL_DEFAULT_PORT = "${ defaults . port } " ;
7887 PGSQL_SUPERUSER = "${ defaults . superuser } " ;
7988 PSQL15_BINDIR = "${ psql_15 } " ;
8089 PSQL17_BINDIR = "${ psql_17 } " ;
8190 PSQL_CONF_FILE = "${ paths . pgconfigFile } " ;
91+ POSTGRESQL_CONFIG_DIR = "${ postgresqlConfigBaseDir } " ;
8292 PSQLORIOLEDB17_BINDIR = "${ psql_orioledb-17 } " ;
8393 PGSODIUM_GETKEY = "${ paths . getkeyScript } " ;
8494 READREPL_CONF_FILE = "${ paths . readReplicaConfigFile } " ;
Original file line number Diff line number Diff line change 215215echo " NOTE: patching postgresql.conf files"
216216cp " $PG_HBA_FILE " " $DATDIR /pg_hba.conf"
217217cp " $PG_IDENT_FILE " " $DATDIR /pg_ident.conf"
218+ # Copy entire conf.d directory from postgresql_config
219+ POSTGRESQL_CONFIG_DIR=" @POSTGRESQL_CONFIG_DIR@"
220+ cp -r " $POSTGRESQL_CONFIG_DIR /conf.d" " $DATDIR /"
221+
222+ # Make conf.d files writable (they're read-only from Nix store)
223+ chmod -R u+w " $DATDIR /conf.d"
224+
218225cp " $READREPL_CONFIG_FILE " " $DATDIR /read-replica.conf"
219226mkdir -p " $DATDIR /extension-custom-scripts"
220227cp -r " $EXTENSION_CUSTOM_SCRIPTS " /* " $DATDIR /extension-custom-scripts"
@@ -236,6 +243,7 @@ vault.getkey_script = '$PGSODIUM_GETKEY_SCRIPT'" \
236243-e " s|include = '/etc/postgresql-custom/read-replica.conf'|include = '$DATDIR /read-replica.conf'|" \
237244-e " \$ a\\
238245session_preload_libraries = 'supautils'" \
246+ -e " s|include_dir = '/etc/postgresql-custom/conf.d'|include_dir = '$DATDIR /conf.d'|" \
239247" $PSQL_CONF_FILE " > " $DATDIR /postgresql.conf"
240248
241249# Function to configure OrioleDB specific settings
You can’t perform that action at this time.
0 commit comments