#!/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 overrides (getServiceOverrides $argv) initializeServiceInstallation $argv sudo cp "$dir/docker-compose.base.yml" (getServiceRoot $argv) URL="https://$domain" yq "$(getServiceKey "$service").environment.ROOT_URL = env(URL)" "$dir/$(basename "$overrides")" | \ sudo tee "$overrides" >/dev/null 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