51 lines
1.5 KiB
Fish
Executable file
51 lines
1.5 KiB
Fish
Executable file
#!/bin/env fish
|
|
begin
|
|
set -l dir (status dirname)
|
|
set -l service wekan
|
|
set -l domain due ""
|
|
source "$dir/../service.fish"
|
|
|
|
function installSW -V dir -V service -V domain
|
|
set -l domain (getServiceDomain $domain)
|
|
set -l file "$dir/docker-compose.base.yml"
|
|
initializeServiceInstallation $argv
|
|
|
|
URL="https://$domain" yq "$(getServiceKey "$service").environment.DOMAIN = env(URL)" "$file" | \
|
|
sudo tee "$(getServiceRoot $argv)/$(basename "$file")" >/dev/null
|
|
|
|
sudo cp "$dir/docker-compose.secrets.yml" (getServiceRoot $argv)
|
|
installDockerService $argv
|
|
end
|
|
|
|
function configureSW -V dir -V service
|
|
set -l uid
|
|
set -l gid
|
|
set -l user "$service"
|
|
set -l root (getServiceRoot $argv)
|
|
set -l data "data/wekan"
|
|
configureDockerService $argv
|
|
|
|
and sudo useradd \
|
|
--system \
|
|
--shell /bin/false \
|
|
--comment 'Wekan server' \
|
|
--create-home \
|
|
"$user"
|
|
|
|
set uid (id -u "$user")
|
|
set gid (id -g "$user")
|
|
USER="$uid:$gid" yq -i "$(getServiceKey "$service").user = env(USER)" "$root/docker-compose.base.yml"
|
|
mkdir -p "$root/$data"
|
|
chown -R "$uid:$gid" "$root/$data"
|
|
end
|
|
|
|
function getServiceServers -V domain
|
|
printf "%s\0" $domain
|
|
end
|
|
|
|
function getServiceLocations -V service
|
|
printf "%s\0" "$service" /
|
|
end
|
|
|
|
runInstaller --force $argv
|
|
end
|