Skip to content

Commit bf0133c

Browse files
committed
refactor(postgres): 05-supautils -> supautils
1 parent b96ed46 commit bf0133c

File tree

10 files changed

+21
-21
lines changed

10 files changed

+21
-21
lines changed

Dockerfile-17

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ RUN \
183183
RUN sed -i 's/ timescaledb,//g;' "/etc/postgresql/postgresql.conf"
184184
#as of pg 16.4 + this db_user_namespace totally deprecated and will break the server if setting is present
185185
RUN sed -i 's/db_user_namespace = off/#db_user_namespace = off/g;' "/etc/postgresql/postgresql.conf"
186-
RUN sed -i 's/ timescaledb,//g; s/ plv8,//g' "/etc/postgresql-custom/conf.d/05-supautils.conf"
186+
RUN sed -i 's/ timescaledb,//g; s/ plv8,//g' "/etc/postgresql-custom/conf.d/supautils.conf"
187187

188188

189189

Dockerfile-orioledb-17

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ RUN \
183183
RUN sed -i 's/ timescaledb,//g;' "/etc/postgresql/postgresql.conf"
184184
#as of pg 16.4 + this db_user_namespace totally deprecated and will break the server if setting is present
185185
RUN sed -i 's/db_user_namespace = off/#db_user_namespace = off/g;' "/etc/postgresql/postgresql.conf"
186-
RUN sed -i 's/ timescaledb,//g; s/ plv8,//g; s/ postgis,//g; s/ pgrouting,//g' "/etc/postgresql-custom/conf.d/05-supautils.conf"
186+
RUN sed -i 's/ timescaledb,//g; s/ plv8,//g; s/ postgis,//g; s/ pgrouting,//g' "/etc/postgresql-custom/conf.d/supautils.conf"
187187
RUN sed -i 's/\(shared_preload_libraries.*\)'\''\(.*\)$/\1, orioledb'\''\2/' "/etc/postgresql/postgresql.conf"
188188
RUN echo "default_table_access_method = 'orioledb'" >> "/etc/postgresql/postgresql.conf"
189189

ansible/files/admin_api_scripts/pg_upgrade_scripts/initiate.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -515,7 +515,7 @@ EOF
515515
mkdir -p "$MOUNT_POINT/conf"
516516
cp -R /etc/postgresql-custom/* "$MOUNT_POINT/conf/"
517517
# removing supautils config as to allow the latest one provided by the latest image to be used
518-
rm -f "$MOUNT_POINT/conf/conf.d/05-supautils.conf" || true
518+
rm -f "$MOUNT_POINT/conf/conf.d/supautils.conf" || true
519519
rm -rf "$MOUNT_POINT/conf/extension-custom-scripts" || true
520520

521521
# removing wal-g config as to allow it to be explicitly enabled on the new instance

ansible/tasks/internal/supautils.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,10 @@
3232
target: install
3333
become: yes
3434

35-
- name: supautils - write custom 05-supautils.conf
35+
- name: supautils - write custom supautils.conf
3636
copy:
37-
src: "files/postgresql_config/conf.d/05-supautils.conf"
38-
dest: /etc/postgresql-custom/conf.d/05-supautils.conf
37+
src: "files/postgresql_config/conf.d/supautils.conf"
38+
dest: /etc/postgresql-custom/conf.d/supautils.conf
3939
mode: 0664
4040
owner: postgres
4141
group: postgres

ansible/tasks/setup-docker.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
# supautils
4545
- name: supautils - write custom supautils.conf
4646
ansible.builtin.copy:
47-
dest: '/etc/postgresql-custom/conf.d/05-supautils.conf'
47+
dest: '/etc/postgresql-custom/conf.d/supautils.conf'
4848
mode: '0664'
4949
group: 'postgres'
5050
owner: 'postgres'

ansible/tasks/setup-postgres.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@
212212
group: postgres
213213
when: nixpkg_mode
214214

215-
- name: Check psql_version and modify 05-supautils.conf and postgresql.conf if necessary
215+
- name: Check psql_version and modify supautils.conf and postgresql.conf if necessary
216216
block:
217217
- name: Check if psql_version is psql_orioledb
218218
set_fact:

ansible/tasks/stage2-setup-postgres.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# sudo -u postgres bash -c ". /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh && nix profile install nixpkgs#openjdk11"
55
# It was decided to leave pljava disabled at https://github.com/supabase/postgres/pull/690 therefore removing this task
66

7-
- name: Check psql_version and modify 05-supautils.conf and postgresql.conf if necessary
7+
- name: Check psql_version and modify supautils.conf and postgresql.conf if necessary
88
block:
99
- name: Check if psql_version is psql_orioledb-17
1010
set_fact:
@@ -26,11 +26,11 @@
2626
when: is_psql_oriole or is_psql_17 and stage2_nix
2727
become: yes
2828

29-
- name: Remove specified extensions from 05-supautils.conf if orioledb-17 or 17 build
29+
- name: Remove specified extensions from supautils.conf if orioledb-17 or 17 build
3030
ansible.builtin.command:
3131
cmd: >
3232
sed -i 's/ timescaledb,//g; s/ plv8,//g'
33-
/etc/postgresql-custom/conf.d/05-supautils.conf
33+
/etc/postgresql-custom/conf.d/supautils.conf
3434
when: is_psql_oriole or is_psql_17 and stage2_nix
3535
become: yes
3636

nix/packages/lib.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@
106106
cp -r ${paths.postgresqlExtensionCustomScriptsPath}/* $out/extension-custom-scripts/ || { echo "Failed to copy custom scripts"; exit 1; }
107107
108108
echo "Copy operation completed"
109-
chmod 644 $out/etc/postgresql-custom/conf.d/05-supautils.conf $out/etc/postgresql/postgresql.conf $out/etc/postgresql-custom/conf.d/logging.conf $out/etc/postgresql/pg_hba.conf
109+
chmod 644 $out/etc/postgresql-custom/conf.d/supautils.conf $out/etc/postgresql/postgresql.conf $out/etc/postgresql-custom/conf.d/logging.conf $out/etc/postgresql/pg_hba.conf
110110
111111
substitute ${../tools/run-server.sh.in} $out/bin/start-postgres-server \
112112
${

nix/tools/run-server.sh.in

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -221,11 +221,11 @@ mkdir -p "$DATDIR/extension-custom-scripts"
221221
cp -r "$EXTENSION_CUSTOM_SCRIPTS"/* "$DATDIR/extension-custom-scripts"
222222

223223
# Configure supautils
224-
sed "s|supautils.extension_custom_scripts_path = '/etc/postgresql-custom/extension-custom-scripts'|supautils.extension_custom_scripts_path = '$DATDIR/extension-custom-scripts'|" "$SUPAUTILS_CONFIG_FILE" > "$DATDIR/conf.d/05-supautils.conf"
224+
sed "s|supautils.extension_custom_scripts_path = '/etc/postgresql-custom/extension-custom-scripts'|supautils.extension_custom_scripts_path = '$DATDIR/extension-custom-scripts'|" "$SUPAUTILS_CONFIG_FILE" > "$DATDIR/conf.d/supautils.conf"
225225

226226
# Configure PostgreSQL
227227
sed -e "1i\\
228-
include = '$DATDIR/conf.d/05-supautils.conf'" \
228+
include = '$DATDIR/conf.d/supautils.conf'" \
229229
-e "\$a\\
230230
pgsodium.getkey_script = '$PGSODIUM_GETKEY_SCRIPT'" \
231231
-e "\$a\\
@@ -243,7 +243,7 @@ orioledb_config_items() {
243243
echo "non-macos oriole conf"
244244
sed -i 's/ timescaledb,//g;' "$DATDIR/postgresql.conf"
245245
sed -i 's/db_user_namespace = off/#db_user_namespace = off/g;' "$DATDIR/postgresql.conf"
246-
sed -i 's/ timescaledb,//g; s/ plv8,//g; s/ pgjwt,//g;' "$DATDIR/conf.d/05-supautils.conf"
246+
sed -i 's/ timescaledb,//g; s/ plv8,//g; s/ pgjwt,//g;' "$DATDIR/conf.d/supautils.conf"
247247
sed -i 's/\(shared_preload_libraries.*\)'\''\(.*\)$/\1, orioledb'\''\2/' "$DATDIR/postgresql.conf"
248248
echo "default_table_access_method = 'orioledb'" >> "$DATDIR/postgresql.conf"
249249
elif [[ "$1" = "orioledb-17" && "$CURRENT_SYSTEM" = "aarch64-darwin" ]]; then
@@ -255,22 +255,22 @@ orioledb_config_items() {
255255
perl -pi -e 's/ timescaledb,//g' "$DATDIR/postgresql.conf"
256256
perl -pi -e 's/db_user_namespace = off/#db_user_namespace = off/g' "$DATDIR/postgresql.conf"
257257

258-
perl -pi -e 's/ timescaledb,//g' "$DATDIR/conf.d/05-supautils.conf"
259-
perl -pi -e 's/ plv8,//g' "$DATDIR/conf.d/05-supautils.conf"
260-
perl -pi -e 's/ pgjwt,//g' "$DATDIR/conf.d/05-supautils.conf"
258+
perl -pi -e 's/ timescaledb,//g' "$DATDIR/conf.d/supautils.conf"
259+
perl -pi -e 's/ plv8,//g' "$DATDIR/conf.d/supautils.conf"
260+
perl -pi -e 's/ pgjwt,//g' "$DATDIR/conf.d/supautils.conf"
261261
perl -pi -e 's/(shared_preload_libraries\s*=\s*'\''.*?)'\''/\1, orioledb'\''/' "$DATDIR/postgresql.conf"
262262

263263
echo "default_table_access_method = 'orioledb'" >> "$DATDIR/postgresql.conf"
264264
elif [[ "$VERSION" == "17" && "$CURRENT_SYSTEM" != "aarch64-darwin" ]]; then
265265
echo "non-macos pg 17 conf"
266266
sed -i 's/ timescaledb,//g;' "$DATDIR/postgresql.conf"
267267
sed -i 's/db_user_namespace = off/#db_user_namespace = off/g;' "$DATDIR/postgresql.conf"
268-
sed -i 's/ timescaledb,//g; s/ plv8,//g;' "$DATDIR/conf.d/05-supautils.conf"
268+
sed -i 's/ timescaledb,//g; s/ plv8,//g;' "$DATDIR/conf.d/supautils.conf"
269269
elif [[ "$VERSION" == "17" && "$CURRENT_SYSTEM" = "aarch64-darwin" ]]; then
270270
perl -pi -e 's/db_user_namespace = off/#db_user_namespace = off/g;' "$DATDIR/postgresql.conf"
271271
perl -pi -e 's/ timescaledb,//g' "$DATDIR/postgresql.conf"
272-
perl -pi -e 's/ timescaledb,//g' "$DATDIR/conf.d/05-supautils.conf"
273-
perl -pi -e 's/ plv8,//g;' "$DATDIR/conf.d/05-supautils.conf"
272+
perl -pi -e 's/ timescaledb,//g' "$DATDIR/conf.d/supautils.conf"
273+
perl -pi -e 's/ plv8,//g;' "$DATDIR/conf.d/supautils.conf"
274274
fi
275275
}
276276

0 commit comments

Comments
 (0)