Skip to content

Commit 721d8fe

Browse files
committed
fix: syntax
1 parent 2a6b9e0 commit 721d8fe

4 files changed

Lines changed: 17 additions & 17 deletions

File tree

ansible/tasks/setup-pgbouncer.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
comment: "PgBouncer user"
4949
groups: "postgres,ssl-cert"
5050
name: "pgbouncer"
51-
shell: "/usr/sbin/nolign"
51+
shell: "/usr/sbin/nologin"
5252
state: "present"
5353

5454
- name: Create PgBouncer directories if they do not exist
@@ -114,7 +114,6 @@
114114
- /etc/postgresql/pg_hba.conf
115115
- /etc/postgresql/pg_hba_users_public.conf
116116
- /etc/postgresql/pg_hba_public.conf
117-
- /etc/pgbouncer-custom/ssl-config.ini
118117
loop_control:
119118
loop_var: "pgbouncer_group_item"
120119

nix/checks.nix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,7 @@
163163
PGSODIUM_GETKEY = "${getkey-script}/bin/pgsodium-getkey";
164164
PGSQL_DEFAULT_PORT = pgPort;
165165
};
166+
version = majorVersion;
166167
};
167168

168169
getVersionArg =

nix/packages/lib.nix

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
version,
1818
}:
1919
let
20-
paths = {
20+
basePaths = {
2121
migrationsDir = builtins.path {
2222
name = "migrations";
2323
path = ../../migrations/db;
@@ -67,7 +67,7 @@
6767
path = ../tests/util/pgsodium_getkey.sh;
6868
};
6969
};
70-
// (
70+
extraPaths =
7171
if version == "15" then
7272
{
7373
pgHbaConfigFile = builtins.path {
@@ -89,8 +89,8 @@
8989
name = "pg_hba_public.conf";
9090
path = ../../ansible/files/postgresql_config/pg_hba_public.conf.j2;
9191
};
92-
}
93-
);
92+
};
93+
paths = basePaths // extraPaths;
9494

9595
localeArchive =
9696
if pkgs.stdenv.isDarwin then
@@ -155,8 +155,8 @@
155155
chmod 644 $out/etc/postgresql/pg_hba_users_public.conf
156156
''}
157157
${lib.optionalString (paths ? pgHbaPublicConfigFile) ''
158-
cp ${paths.pgHbaPublicConfigFile} $out/etc/postgresql/pg_hba_public.conf || { echo "Failed to copy pg_hba_public.conf"; exit 1; }
159-
chmod 644 $out/etc/postgresql/pg_hba_public.conf
158+
cp ${paths.pgHbaPublicConfigFile} $out/etc/postgresql/pg_hba_public.conf || { echo "Failed to copy pg_hba_public.conf"; exit 1; }
159+
chmod 644 $out/etc/postgresql/pg_hba_public.conf
160160
''}
161161
162162
cp ${paths.pgIdentConfigFile} $out/etc/postgresql/pg_ident.conf || { echo "Failed to copy pg_ident.conf"; exit 1; }

nix/tools/run-server.sh.in

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,10 @@ start_postgres() {
3434
# Start the server
3535
pg_ctl start -D "$DATDIR" -l "$LOG_FILE" \
3636
-o "--config-file=$DATDIR/postgresql.conf -p $PORTNO -k $DATDIR/tmp"
37-
37+
3838
# Give it a moment to write logs
3939
sleep 1
40-
40+
4141
# Check server status and logs
4242
if ! pg_ctl status -D "$DATDIR"; then
4343
echo "PostgreSQL failed to start. Full logs:"
@@ -192,7 +192,7 @@ export LC_CTYPE=en_US.UTF-8
192192
export KEY_FILE="$DATDIR/pgsodium.key"
193193
echo "KEY_FILE: $KEY_FILE"
194194
echo "KEY_FILE contents:"
195-
cat "$KEY_FILE"
195+
cat "$KEY_FILE"
196196

197197
echo "PGSODIUM_GETKEY_SCRIPT: $PGSODIUM_GETKEY_SCRIPT"
198198
echo "NOTE: using port $PORTNO for server"
@@ -218,7 +218,7 @@ if [ "$VERSION" = "15" ]; then
218218
else
219219
cp "${PG_HBA_FILE}" "$DATDIR/pg_hba.conf"
220220
# copy extra hba_*.conf files over
221-
extra_hba_files=( ${PG_HBA_FILE%pg_hba.conf}pg_hba*.conf* )
221+
extra_hba_files=( ${PG_HBA_FILE%pg_hba.conf}pg_hba_*.conf* )
222222
for f in "${extra_hba_files[@]}"; do
223223
base=$(basename "$f")
224224
cp "$f" "$DATDIR/${base%%.conf*}.conf"
@@ -270,16 +270,16 @@ orioledb_config_items() {
270270
# macOS specific configuration
271271
echo "macOS detected, applying macOS specific configuration"
272272
ls -la "$DATDIR"
273-
273+
274274
# Use perl instead of sed for macOS
275275
perl -pi -e 's/ timescaledb,//g' "$DATDIR/postgresql.conf"
276276
perl -pi -e 's/db_user_namespace = off/#db_user_namespace = off/g' "$DATDIR/postgresql.conf"
277-
277+
278278
perl -pi -e 's/ timescaledb,//g' "$DATDIR/supautils.conf"
279279
perl -pi -e 's/ plv8,//g' "$DATDIR/supautils.conf"
280280
perl -pi -e 's/ pgjwt,//g' "$DATDIR/supautils.conf"
281281
perl -pi -e 's/(shared_preload_libraries\s*=\s*'\''.*?)'\''/\1, orioledb'\''/' "$DATDIR/postgresql.conf"
282-
282+
283283
echo "default_table_access_method = 'orioledb'" >> "$DATDIR/postgresql.conf"
284284
elif [[ "$VERSION" == "17" && "$CURRENT_SYSTEM" != "aarch64-darwin" ]]; then
285285
echo "non-macos pg 17 conf"
@@ -307,7 +307,7 @@ export GRN_PLUGINS_DIR=$GROONGA/lib/groonga/plugins
307307

308308
# Start postgres
309309
mkdir -p "$DATDIR/tmp"
310-
chmod 1777 "$DATDIR/tmp"
310+
chmod 1777 "$DATDIR/tmp"
311311
start_postgres "daemon"
312312

313313
# Wait for PostgreSQL to start
@@ -387,6 +387,6 @@ stop_postgres
387387
# Step 4: Restart PostgreSQL in the foreground (with log output visible) or as a daemon
388388
if [ "$DAEMONIZE" = true ]; then
389389
start_postgres "daemon"
390-
else
390+
else
391391
start_postgres "foreground"
392392
fi

0 commit comments

Comments
 (0)