PortValhalla/scripts/Common/Software/docker/services/teamspeak/main.fish

45 lines
1.3 KiB
Fish
Raw Normal View History

2024-11-13 17:18:15 +00:00
#!/bin/env fish
begin
set -l dir (status dirname)
2024-11-27 01:54:44 +00:00
set -l source "$dir/docker-compose.overrides.yml"
2024-11-13 17:18:15 +00:00
source "$dir/../service.fish"
function installSW -V dir -V domain -V source
2024-11-29 00:13:58 +00:00
set -l service teamspeak
2024-11-13 17:18:15 +00:00
set -l pw (nix-shell -p keepassxc --run "keepassxc-cli generate --length 32")
2024-11-29 00:13:58 +00:00
set -l db TeamSpeak
2024-11-13 17:18:15 +00:00
set -l tsEnv "$(getServiceKey "$service").environment"
set -l dbEnv "$(getServiceKey db).environment"
initializeServiceInstallation $argv
cp "$dir/docker-compose.base.yml" (getServiceRoot $argv)
USER="$service" begin
2024-11-29 00:13:58 +00:00
yq "$tsEnv.TS3SERVER_DB_USER = env(USER)" "$source" |
yq "$dbEnv.MARIADB_USER = env(USER)"
2024-11-13 17:18:15 +00:00
end | \
2024-11-29 00:13:58 +00:00
PW="$pw" begin
yq "$tsEnv.TS3SERVER_DB_PASSWORD = env(PW)" |
yq "$dbEnv.MARIADB_PASSWORD = env(PW)"
2024-11-13 17:18:15 +00:00
end | \
2024-11-29 00:13:58 +00:00
DB="$db" begin
yq "$tsEnv.TS3SERVER_DB_NAME = env(DB)" |
yq "$dbEnv.MARIADB_DATABASE = env(DB)"
end |
2024-11-27 01:54:44 +00:00
sudo tee (getServiceOverrides $argv) >/dev/null
2024-11-13 17:18:15 +00:00
installDockerService $argv
end
function configureSW -V dir
configureDockerService $argv
end
function getServiceServers -V server
end
function getServiceLocations
end
runInstaller --force $argv
end