37 lines
1.3 KiB
Fish
Executable file
37 lines
1.3 KiB
Fish
Executable file
#!/bin/env fish
|
|
begin
|
|
set -l dir (status dirname)
|
|
set -l source "$dir/docker-compose.core.secrets.yml"
|
|
source "$dir/../service.fish"
|
|
|
|
function installSW -V dir -V domain -V source
|
|
set -l root (getServiceRoot $argv)
|
|
set -l tmPW (nix-shell -p keepassxc --run "keepassxc-cli generate --length 32")
|
|
set -l sqlPW (nix-shell -p keepassxc --run "keepassxc-cli generate --length 32")
|
|
initializeServiceInstallation $argv
|
|
|
|
cp -rf "$dir"/{.dockerignore,docker-compose{.base,.secrets,.core{,.secrets}}.yml,parser.patch,tmforever-entrypoint.sh,trackmania.Dockerfile,xaseco-entrypoint.sh,xaseco.Dockerfile} "$root"
|
|
|
|
PW="$tmPW" yq "$(getServiceKey "tm").environment.TM_SUPERADMIN_PASSWORD = env(PW)" "$source" | \
|
|
PW="$sqlPW" yq "$(getServiceKey "db").environment.MYSQL_PASSWORD = env(PW)" | \
|
|
sudo tee "$root/$(basename "$source")" >/dev/null
|
|
|
|
installDockerService $argv
|
|
end
|
|
|
|
function configureSW -V dir
|
|
configureDockerService $argv
|
|
end
|
|
|
|
function getServiceServers
|
|
end
|
|
|
|
function getServiceLocations
|
|
end
|
|
|
|
function getBackupArgs
|
|
printf "%s\n" --hidden --no-ignore "^docker-compose\.(.*\.)\?.secrets.yml|data\$" (getServiceRoot $argv)
|
|
end
|
|
|
|
runInstaller --force $argv --name "tm-forever"
|
|
end
|