From e1a744b8230968b0a9b1c4f5221b3b76cf1753fe Mon Sep 17 00:00:00 2001 From: Manuel Thalmann Date: Fri, 22 Nov 2024 01:54:50 +0100 Subject: [PATCH] Add scripts for installing wekan --- .../services/wekan/docker-compose.base.yml | 29 +++++++++++ .../services/wekan/docker-compose.secrets.yml | 4 ++ .../Software/docker/services/wekan/main.fish | 51 +++++++++++++++++++ 3 files changed, 84 insertions(+) create mode 100644 scripts/Common/Software/docker/services/wekan/docker-compose.base.yml create mode 100644 scripts/Common/Software/docker/services/wekan/docker-compose.secrets.yml create mode 100755 scripts/Common/Software/docker/services/wekan/main.fish diff --git a/scripts/Common/Software/docker/services/wekan/docker-compose.base.yml b/scripts/Common/Software/docker/services/wekan/docker-compose.base.yml new file mode 100644 index 00000000..6c2659a9 --- /dev/null +++ b/scripts/Common/Software/docker/services/wekan/docker-compose.base.yml @@ -0,0 +1,29 @@ +services: + wekan: + image: wekanteam/wekan + restart: unless-stopped + depends_on: + - db + user: 1337:1337 + environment: + WRITABLE_PATH: /data + ROOT_URL: https://example.com + MONGO_URL: mongodb://db:27017/wekan + MONGO_OPLOG_URL: + WITH_API: "true" + RICHER_CARD_COMMENT_EDITOR: "true" + volumes: + - /etc/localtime:/etc/localtime:ro + - ./data/wekan:/data + db: + image: mongo + restart: unless-stopped + command: mongod --logpath /dev/null --oplogSize 128 --quiet + volumes: + - /etc/localtime:/etc/localtime:ro + - ./data/database:/data/db + bridge: + image: shenxn/protonmail-bridge + restart: unless-stopped + volumes: + - ./data/bridge:/root diff --git a/scripts/Common/Software/docker/services/wekan/docker-compose.secrets.yml b/scripts/Common/Software/docker/services/wekan/docker-compose.secrets.yml new file mode 100644 index 00000000..d9824c88 --- /dev/null +++ b/scripts/Common/Software/docker/services/wekan/docker-compose.secrets.yml @@ -0,0 +1,4 @@ +services: + wekan: + ports: + - 127.0.0.1:1337:8080 diff --git a/scripts/Common/Software/docker/services/wekan/main.fish b/scripts/Common/Software/docker/services/wekan/main.fish new file mode 100755 index 00000000..117ff193 --- /dev/null +++ b/scripts/Common/Software/docker/services/wekan/main.fish @@ -0,0 +1,51 @@ +#!/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