Add scripts for installing wekan

This commit is contained in:
Manuel Thalmann 2024-11-22 01:54:50 +01:00
parent 244881ab45
commit 7687708ad3
3 changed files with 84 additions and 0 deletions

View file

@ -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

View file

@ -0,0 +1,4 @@
services:
wekan:
ports:
- 127.0.0.1:1337:8080

View file

@ -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