PortValhalla/scripts/Common/Software/docker/services/anki-sync/main.fish

30 lines
878 B
Fish
Raw Normal View History

#!/bin/env fish
begin
set -l dir (status dirname)
set -l source "$dir/docker-compose.secrets.yml"
source "$dir/../service.fish"
function installSW -V dir -V source
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" | \
2024-11-06 18:34:27 +00:00
sudo tee (getServiceSecretsConfig $argv) >/dev/null
installDockerService $argv
end
function configureSW -V dir
configureDockerService $argv
end
function getServiceConfigs
2024-11-07 02:31:48 +00:00
printf "%s\0" anki anki "" /
end
runInstaller --force $argv
end