diff --git a/scripts/Common/Software/docker/services/anki-sync/main.fish b/scripts/Common/Software/docker/services/anki-sync/main.fish index 100e69e4..c6545f9a 100644 --- a/scripts/Common/Software/docker/services/anki-sync/main.fish +++ b/scripts/Common/Software/docker/services/anki-sync/main.fish @@ -8,6 +8,7 @@ begin set -l pw (nix-shell -p keepassxc --run "keepassxc-cli generate --length 32") set -l userKey ".services.anki.environment.SYNC_USER1" set -l user (yq --raw-output "$userKey" "$source" | sed "s/:.*\$/:$pw/") + initializeServiceInstallation $argv sudo cp "$dir/docker-compose.yml" (getServiceRoot $argv) USER=$user yq "$userKey = env.USER" "$source" | \ diff --git a/scripts/Common/Software/docker/services/service.fish b/scripts/Common/Software/docker/services/service.fish index 9ba0aa68..aec1e1b2 100644 --- a/scripts/Common/Software/docker/services/service.fish +++ b/scripts/Common/Software/docker/services/service.fish @@ -28,6 +28,12 @@ begin echo ".services.$name.ports[0]" end + function initializeServiceInstallation -V nginxRoot + mkdir -p (getServiceRoot $argv) + mkdir -p "$nginxRoot" + mkdir -p (dirname (getServiceSecretsConfig $argv)) + end + function installDockerService -V dir -V nginxRoot -V portPattern set -l services (getServiceConfigs $argv | string split0) sudo cp (getServiceNginxConfigSource $argv) (__getServiceNginxConfig $argv) diff --git a/scripts/Common/Software/docker/services/vaultwarden/main.fish b/scripts/Common/Software/docker/services/vaultwarden/main.fish index 53b94da7..6465719f 100644 --- a/scripts/Common/Software/docker/services/vaultwarden/main.fish +++ b/scripts/Common/Software/docker/services/vaultwarden/main.fish @@ -8,6 +8,7 @@ begin set -l pw (nix-shell -p keepassxc --run "keepassxc-cli generate --length 32") set -l dbKey ".services.vaultwarden.environment.DATABASE_URL" set -l dbUrl (yq --raw-output "$dbKey" "$source" | sed "s/^\(.*:\/\/.*:\).*\(@.*\/.*\)\$/\1$pw\2/") + initializeServiceInstallation $argv sudo cp "$dir/docker-compose.yml" (getServiceRoot $argv) URL=$dbUrl yq "$dbKey = env.URL" "$source" | \