hosts/plover: add comments to various parts

This commit is contained in:
Gabriel Arazas 2023-02-08 18:03:20 +08:00
parent f75c04eaa9
commit 93355b3c67
No known key found for this signature in database
GPG Key ID: ADE0C41DAB221FCC
4 changed files with 8 additions and 1 deletions

View File

@ -25,6 +25,7 @@ in
# The primary DNS server that is completely hidden. # The primary DNS server that is completely hidden.
./modules/services/coredns.nix ./modules/services/coredns.nix
# The reverse proxy of choice.
./modules/services/nginx.nix ./modules/services/nginx.nix
# The database of choice which is used by most self-managed services on # The database of choice which is used by most self-managed services on

View File

@ -127,7 +127,11 @@ in
# Setting up Gitea for PostgreSQL secure schema usage. # Setting up Gitea for PostgreSQL secure schema usage.
systemd.services.gitea = { systemd.services.gitea = {
path = [ config.services.postgresql.package ]; path = [ config.services.postgresql.package ];
preStart = lib.mkAfter ''
# Gitea service module will have to set up certain things first which is
# why we have to go first.
preStart = lib.mkBefore ''
# Setting up the appropriate schema for PostgreSQL secure schema usage.
psql -tAc "SELECT 1 FROM information_schema.schemata WHERE schema_name='${giteaDatabaseUser}';" \ psql -tAc "SELECT 1 FROM information_schema.schemata WHERE schema_name='${giteaDatabaseUser}';" \
grep -q 1 || psql -tAc "CREATE SCHEMA IF NOT EXISTS AUTHORIZATION ${giteaDatabaseUser};" grep -q 1 || psql -tAc "CREATE SCHEMA IF NOT EXISTS AUTHORIZATION ${giteaDatabaseUser};"
''; '';

View File

@ -64,6 +64,7 @@ in
systemd.services.keycloak = { systemd.services.keycloak = {
path = [ config.services.postgresql.package ]; path = [ config.services.postgresql.package ];
preStart = lib.mkAfter '' preStart = lib.mkAfter ''
# Setting up the appropriate schema for PostgreSQL secure schema usage.
psql -tAc "SELECT 1 FROM information_schema.schemata WHERE schema_name='${keycloakUser}';" \ psql -tAc "SELECT 1 FROM information_schema.schemata WHERE schema_name='${keycloakUser}';" \
| grep -q 1 || psql -tAc "CREATE SCHEMA IF NOT EXISTS AUTHORIZATION ${keycloakUser};" | grep -q 1 || psql -tAc "CREATE SCHEMA IF NOT EXISTS AUTHORIZATION ${keycloakUser};"
''; '';

View File

@ -71,6 +71,7 @@ in
systemd.services.vaultwarden = { systemd.services.vaultwarden = {
path = [ config.services.postgresql.package ]; path = [ config.services.postgresql.package ];
preStart = lib.mkAfter '' preStart = lib.mkAfter ''
# Setting up the appropriate schema for PostgreSQL secure schema usage.
psql -tAc "SELECT 1 FROM information_schema.schemata WHERE schema_name='${vaultwardenUser}';" \ psql -tAc "SELECT 1 FROM information_schema.schemata WHERE schema_name='${vaultwardenUser}';" \
| grep -q 1 || psql -tAc "CREATE SCHEMA IF NOT EXISTS AUTHORIZATION ${vaultwardenUser};" | grep -q 1 || psql -tAc "CREATE SCHEMA IF NOT EXISTS AUTHORIZATION ${vaultwardenUser};"
''; '';