This repository was archived by the owner on Apr 29, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +24
-8
lines changed Expand file tree Collapse file tree 2 files changed +24
-8
lines changed Original file line number Diff line number Diff line change 251251 psql_15 = makePostgres "15" ;
252252
253253 # Start a version of the server.
254- start-server = pkgs . runCommand "start-postgres-server" { } ''
255- mkdir -p $out/bin
256- substitute ${ ./tools/run-server.sh.in } $out/bin/start-postgres-server \
257- --subst-var-by 'PGSQL_DEFAULT_PORT' '${ pgsqlDefaultPort } ' \
258- --subst-var-by 'PSQL14_BINDIR' '${ basePackages . psql_14 . bin } ' \
259- --subst-var-by 'PSQL15_BINDIR' '${ basePackages . psql_15 . bin } '
260- chmod +x $out/bin/start-postgres-server
261- '' ;
254+ start-server =
255+ let
256+ configFile = ./tests/postgresql.conf.in ;
257+ getkeyScript = ./tests/util/pgsodium_getkey.sh ;
258+ in
259+ pkgs . runCommand "start-postgres-server" { } ''
260+ mkdir -p $out/bin
261+ substitute ${ ./tools/run-server.sh.in } $out/bin/start-postgres-server \
262+ --subst-var-by 'PGSQL_DEFAULT_PORT' '${ pgsqlDefaultPort } ' \
263+ --subst-var-by 'PSQL14_BINDIR' '${ basePackages . psql_14 . bin } ' \
264+ --subst-var-by 'PSQL15_BINDIR' '${ basePackages . psql_15 . bin } ' \
265+ --subst-var-by 'PSQL_CONF_FILE' '${ configFile } ' \
266+ --subst-var-by 'PGSODIUM_GETKEY' '${ getkeyScript } '
267+
268+ chmod +x $out/bin/start-postgres-server
269+ '' ;
262270
263271 # Start a version of the client.
264272 start-client = pkgs . runCommand "start-postgres-client" { } ''
Original file line number Diff line number Diff line change 1919
2020export PATH=$BINDIR /bin:$PATH
2121
22+ PSQL_CONF_FILE=@PSQL_CONF_FILE@
23+ PGSODIUM_GETKEY_SCRIPT=@PGSODIUM_GETKEY@
2224PORTNO=" ${2:-@ PGSQL_DEFAULT_PORT@ } "
2325DATDIR=$( mktemp -d)
2426mkdir -p " $DATDIR "
@@ -29,4 +31,10 @@ echo "NOTE: you are free to re-use this data directory at will"
2931echo
3032
3133initdb -D " $DATDIR " --locale=C
34+
35+ echo " NOTE: patching postgresql.conf files"
36+ sed \
37+ " s#@PGSODIUM_GETKEY_SCRIPT@#$PGSODIUM_GETKEY_SCRIPT #g" \
38+ $PSQL_CONF_FILE > " $DATDIR /postgresql.conf"
39+
3240exec postgres -p " $PORTNO " -D " $DATDIR " -k /tmp
You can’t perform that action at this time.
0 commit comments