hosts/plover: update miscellaneous parts of the services

This commit is contained in:
Gabriel Arazas 2023-10-17 18:32:23 +08:00
parent e3bb442154
commit e6c4a20b83
No known key found for this signature in database
GPG Key ID: ADE0C41DAB221FCC
5 changed files with 9 additions and 10 deletions

View File

@ -177,17 +177,19 @@ in
domainZone' = zoneFile domain;
fqdnZone' = zoneFile fqdn;
secretPath = path: config.sops.secrets."dns/${path}".path;
rndc = lib.getExe' config.services.bind.package "rndc";
in
lib.mkAfter ''
[ -f '${domainZone'}' ] || {
# Install the domain zone.
{
install -Dm0600 '${domainZone}' '${domainZone'}'
replace-secret '#mailboxSecurityKey#' '${secretPath "${domain}/mailbox-security-key"}' '${domainZone'}'
replace-secret '#mailboxSecurityKeyRecord#' '${secretPath "${domain}/mailbox-security-key-record"}' '${domainZone'}'
#${rndc} sync "${domain}" IN external
}
[ -f '${fqdnZone'}' ] || {
install -Dm0600 '${fqdnZone}' '${fqdnZone'}'
}
# Install the internal DNS zones.
install -Dm0600 '${fqdnZone}' '${fqdnZone'}'
'';
serviceConfig = {

View File

@ -151,8 +151,7 @@ in
lib.mkMerge [
(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};"
${psql} -tAc "CREATE SCHEMA IF NOT EXISTS AUTHORIZATION ${giteaDatabaseUser};"
'')
(lib.mkAfter ''

View File

@ -10,9 +10,6 @@ let
vouchDomain = "vouch.${config.networking.domain}";
vouchSettings = config.services.vouch-proxy.instances."${vouchDomain}".settings;
certDir = file: "${config.security.acme.certs."${monitoringDomain}".directory}/${file}";
inherit (config.services.grafana) settings;
in
{
services.grafana = {

View File

@ -39,7 +39,7 @@ in
in
{
# Still doing the secure schema usage pattern.
search_path = "\"$user\"";
search_path = ''"$user"'';
ssl_cert_file = credsDir "cert.pem";
ssl_key_file = credsDir "key.pem";

View File

@ -162,6 +162,7 @@ in
services.nginx.upstreams."vaultwarden" = {
extraConfig = ''
zone services;
keepalive 2;
'';
servers = let
address = config.services.vaultwarden.config.ROCKET_ADDRESS;