From 93355b3c67830b3a3a57f7ef6b39f2b973c91cf8 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Wed, 8 Feb 2023 18:03:20 +0800 Subject: [PATCH] hosts/plover: add comments to various parts --- hosts/plover/default.nix | 1 + hosts/plover/modules/services/gitea.nix | 6 +++++- hosts/plover/modules/services/keycloak.nix | 1 + hosts/plover/modules/services/vaultwarden.nix | 1 + 4 files changed, 8 insertions(+), 1 deletion(-) diff --git a/hosts/plover/default.nix b/hosts/plover/default.nix index 426cbbfc..4865c38d 100644 --- a/hosts/plover/default.nix +++ b/hosts/plover/default.nix @@ -25,6 +25,7 @@ in # The primary DNS server that is completely hidden. ./modules/services/coredns.nix + # The reverse proxy of choice. ./modules/services/nginx.nix # The database of choice which is used by most self-managed services on diff --git a/hosts/plover/modules/services/gitea.nix b/hosts/plover/modules/services/gitea.nix index 82891b15..2b7d0107 100644 --- a/hosts/plover/modules/services/gitea.nix +++ b/hosts/plover/modules/services/gitea.nix @@ -127,7 +127,11 @@ in # Setting up Gitea for PostgreSQL secure schema usage. systemd.services.gitea = { 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}';" \ grep -q 1 || psql -tAc "CREATE SCHEMA IF NOT EXISTS AUTHORIZATION ${giteaDatabaseUser};" ''; diff --git a/hosts/plover/modules/services/keycloak.nix b/hosts/plover/modules/services/keycloak.nix index c834f127..62c41364 100644 --- a/hosts/plover/modules/services/keycloak.nix +++ b/hosts/plover/modules/services/keycloak.nix @@ -64,6 +64,7 @@ in systemd.services.keycloak = { path = [ config.services.postgresql.package ]; 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}';" \ | grep -q 1 || psql -tAc "CREATE SCHEMA IF NOT EXISTS AUTHORIZATION ${keycloakUser};" ''; diff --git a/hosts/plover/modules/services/vaultwarden.nix b/hosts/plover/modules/services/vaultwarden.nix index f2126057..c470fdd6 100644 --- a/hosts/plover/modules/services/vaultwarden.nix +++ b/hosts/plover/modules/services/vaultwarden.nix @@ -71,6 +71,7 @@ in systemd.services.vaultwarden = { path = [ config.services.postgresql.package ]; 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}';" \ | grep -q 1 || psql -tAc "CREATE SCHEMA IF NOT EXISTS AUTHORIZATION ${vaultwardenUser};" '';