mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-06-10 19:55:41 +03:00
nixos/postgresql: escape initdbArgs
It doesn't look correct that this isn't the case already.
This commit is contained in:
parent
0e78dc369c
commit
11d1f8776c
3 changed files with 6 additions and 3 deletions
|
@ -569,6 +569,8 @@
|
|||
|
||||
- `restic` module now has an option for inhibiting system sleep while backups are running, defaulting to off (not inhibiting sleep), available as [`services.restic.backups.<name>.inhibitsSleep`](#opt-services.restic.backups._name_.inhibitsSleep).
|
||||
|
||||
- The arguments from [](#opt-services.postgresql.initdbArgs) now get shell-escaped.
|
||||
|
||||
- Support for *runner registration tokens* has been [deprecated](https://gitlab.com/gitlab-org/gitlab/-/issues/380872)
|
||||
in `gitlab-runner` 15.6 and is expected to be removed in `gitlab-runner` 18.0. Configuration of existing runners
|
||||
should be changed to using *runner authentication tokens* by configuring
|
||||
|
|
|
@ -187,7 +187,7 @@ $ nix-instantiate --eval -A postgresql_13.psqlSchema
|
|||
```
|
||||
For an upgrade, a script like this can be used to simplify the process:
|
||||
```nix
|
||||
{ config, pkgs, ... }:
|
||||
{ config, lib, pkgs, ... }:
|
||||
{
|
||||
environment.systemPackages = [
|
||||
(let
|
||||
|
@ -211,7 +211,7 @@ For an upgrade, a script like this can be used to simplify the process:
|
|||
|
||||
install -d -m 0700 -o postgres -g postgres "$NEWDATA"
|
||||
cd "$NEWDATA"
|
||||
sudo -u postgres $NEWBIN/initdb -D "$NEWDATA" ${builtins.concatStringsSep " " cfg.initdbArgs}
|
||||
sudo -u postgres $NEWBIN/initdb -D "$NEWDATA" ${lib.escapeShellArgs cfg.initdbArgs}
|
||||
|
||||
sudo -u postgres $NEWBIN/pg_upgrade \
|
||||
--old-datadir "$OLDDATA" --new-datadir "$NEWDATA" \
|
||||
|
|
|
@ -7,6 +7,7 @@ let
|
|||
concatStringsSep
|
||||
const
|
||||
elem
|
||||
escapeShellArgs
|
||||
filterAttrs
|
||||
isString
|
||||
literalExpression
|
||||
|
@ -545,7 +546,7 @@ in
|
|||
rm -f ${cfg.dataDir}/*.conf
|
||||
|
||||
# Initialise the database.
|
||||
initdb -U ${cfg.superUser} ${concatStringsSep " " cfg.initdbArgs}
|
||||
initdb -U ${cfg.superUser} ${escapeShellArgs cfg.initdbArgs}
|
||||
|
||||
# See postStart!
|
||||
touch "${cfg.dataDir}/.first_startup"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue