Compare commits

...

35 Commits

Author SHA1 Message Date
4729fb7824 chore: publish 3.3.0+v7.91 release 2025-06-10 14:50:29 +02:00
eb951f1a1c chore: publish 3.2.0+v7.80 release 2025-02-04 23:43:44 +01:00
70331d393f remove stacksize and change main.js path for next release 2025-02-04 23:37:35 +01:00
2286535613 Update .drone.yml 2025-01-08 10:09:13 -08:00
2bd0920564 chore: publish 3.1.0+v7.61 release 2024-10-29 17:07:55 +01:00
66e3194385 update backupbot label 2024-10-24 15:44:19 +02:00
078fb53d4e chore: publish 3.0.0+v7.50 release 2024-07-09 15:18:43 +02:00
1d9317c231 update database 2024-07-09 15:11:34 +02:00
94cc1db80c chore: publish 2.2.0+v7.50 release 2024-07-06 00:46:32 +02:00
17b1b99c9f add writable path for database dumps 2024-07-05 19:46:28 +02:00
b167073868 add performonace optimization
https://github.com/wekan/wekan/issues/3585#issuecomment-1021522132
2024-07-05 19:45:42 +02:00
523aefdb4a add writable path for attachments/avatars 2024-07-05 19:39:47 +02:00
4b71066eda add wekan branding 2024-05-15 14:20:21 +02:00
f8d76d082b chore: publish 2.1.1+v7.30 release 2024-05-14 22:53:18 +02:00
41de881966 healthcheck checks for cpu overload 2024-05-14 22:31:50 +02:00
51b24791a4 add alakazam integration file alaconnect.yml 2024-05-13 17:41:05 +02:00
aa06f74560 add admin promotion to README 2024-02-13 17:06:16 +01:00
b1609c5ef4 Merge pull request 'chore: publish 2.1.0+v7.30 release' (#1) from simon/wekan:main into main
Reviewed-on: coop-cloud/wekan#1
2024-01-31 12:50:53 +00:00
98d595d287 chore: publish 2.1.0+v7.30 release 2024-01-30 14:59:18 +01:00
85c09e0fab chore: publish 2.0.0+v7.10 release 2023-10-25 18:00:05 +02:00
3wc
53a08095f2 chore: publish 1.0.0+v6.99 release 2023-09-23 20:46:23 +01:00
a9181c180e chore: publish 0.14.0+v6.99 release 2023-07-18 13:51:03 +02:00
bc3b7a4dba fix domain env 2023-07-10 00:43:59 +02:00
d7a3f874c9 chore: publish 0.13.2+v6.81 release 2023-06-26 17:57:44 +02:00
9b84875ea0 chore: formatting 2023-06-26 17:09:43 +02:00
16753c808a chore: point backup to a volume directory 2023-06-26 17:09:25 +02:00
16b48136e7 enable mongo logs 2023-06-26 17:09:10 +02:00
083310a964 fix: remove secret version from abra.sh 2023-06-23 11:42:39 +02:00
d3e1340e03 chore: publish 0.13.1+v6.81 release 2023-04-25 12:10:04 +02:00
28c8f7539a add auto update and timeout env 2023-04-18 18:22:54 +02:00
97a348ce29 add timeout 2023-04-13 20:36:16 +02:00
3d94108785 chore: publish 0.13.0+v6.81 release 2023-04-05 18:33:11 +02:00
3wc
a77f2c1ed9 Switch to self-hosted stack-ssh-deploy image [mass update] 2023-01-21 11:49:56 -08:00
3wc
a07ac5f0df Add drone configs / secrets [mass update] 2023-01-20 21:32:07 -08:00
3wc
f5b210f028 Add CI and catalogue generation [mass update] 2023-01-20 10:45:33 -08:00
10 changed files with 236 additions and 50 deletions

41
.drone.yml Normal file
View File

@ -0,0 +1,41 @@
---
kind: pipeline
name: deploy to swarm-test.autonomic.zone
steps:
- name: deployment
image: git.coopcloud.tech/coop-cloud/stack-ssh-deploy:latest
settings:
host: swarm-test.autonomic.zone
stack: wekan
generate_secrets: true
purge: true
deploy_key:
from_secret: drone_ssh_swarm_test
networks:
- proxy
environment:
DOMAIN: wekan.swarm-test.autonomic.zone
STACK_NAME: wekan
LETS_ENCRYPT_ENV: production
SECRET_OAUTH2_SECRET_VERSION: v1
ENTRYPOINT_VERSION: v2
SECRET_OAUTH2_SECRET_VERSION: v1
trigger:
branch:
- main
---
kind: pipeline
name: generate recipe catalogue
steps:
- name: release a new version
image: plugins/downstream
settings:
server: https://build.coopcloud.tech
token:
from_secret: drone_abra-bot_token
fork: true
repositories:
- toolshed/auto-recipes-catalogue-json
trigger:
event: tag

View File

@ -1,4 +1,7 @@
TYPE=wekan
TIMEOUT=300
ENABLE_AUTO_UPDATE=true
ENABLE_BACKUPS=true
LETS_ENCRYPT_ENV=production
SECRET_OAUTH2_SECRET_VERSION=v1
@ -7,8 +10,8 @@ COMPOSE_FILE="compose.yml"
# Set this to run mongodb in replicaset mode (needs initialisation!)
# COMPOSE_FILE="${COMPOSE_FILE}:compose.rs.yml"
DOMAIN=board.${DOMAIN}
ROOT_URL=https://board.${DOMAIN}
DOMAIN=wekan.example.com
ROOT_URL=https://wekan.example.com
DEBUG=false
@ -24,12 +27,15 @@ RICHER_CARD_COMMENT_EDITOR=false
# PASSWORD_LOGIN_ENABLED=false
# LOGO_IMG_URL=https://authentik.example.com/static/dist/assets/icons/icon_left_brand.svg
# LOGO_LINK_URL=https://authentik.example.com
### OAUTH2 ###
OAUTH2_ENABLED=false
# OAUTH2_LOGIN_STYLE=redirect
# OAUTH2_CLIENT_ID=wekan
# OAUTH2_SERVER_URL=https://sso.${DOMAIN}
# OAUTH2_SERVER_URL=https://authentik.example.com
# OAUTH2_AUTH_ENDPOINT=/application/o/authorize/
# OAUTH2_USERINFO_ENDPOINT=/application/o/userinfo/
# OAUTH2_TOKEN_ENDPOINT=/application/o/token/

View File

@ -38,4 +38,16 @@ after mongo conaintainer came up the first time run:
```
abra app run wekan.example.org db mongo
> rs.initiate()
```
```
## Promote user to admin
If using SSO, it might happen that there is no admin user. If so, you can fix it manually in the database:
```
$ abra app run <app-name> db bash
# mongo
> use wekan
> db.users.find({'username': '<your username>'})
> db.users.updateOne({'_id': '<_id from result above>'}, {$set: {'isAdmin': true}})
```

27
abra.sh
View File

@ -1,2 +1,25 @@
export SECRET_OAUTH2_SECRET_VERSION=v1
export ENTRYPOINT_VERSION=v2
export ENTRYPOINT_VERSION=v4
set_settings(){
mongosh wekan --eval '
db.settings.updateOne(
{},
{
$set: {
"disableForgotPassword": true,
"displayAuthenticationMethod" : false,
"disableRegistration" : true,
"customTopLeftCornerLogoImageUrl": "'$LOGO_IMG_URL'",
"customTopLeftCornerLogoLinkUrl": "'$LOGO_LINK_URL'",
}
}
)'
}
show_mongo_version (){
mongosh --eval 'db.adminCommand( { getParameter: 1, featureCompatibilityVersion: 1 } )'
}
update_mongo_version (){
mongosh --eval 'db.adminCommand( { setFeatureCompatibilityVersion: "5.0" } )'
}

20
alaconnect.yml Normal file
View File

@ -0,0 +1,20 @@
authentik:
env:
OAUTH2_ENABLED: "true"
OAUTH2_SERVER_URL: https://authentik.example.com
# TODO: set CLIENT_ID as secret
OAUTH2_CLIENT_ID: wekan
uncomment:
- OAUTH2_LOGIN_STYLE
- OAUTH2_AUTH_ENDPOINT
- OAUTH2_USERINFO_ENDPOINT
- OAUTH2_TOKEN_ENDPOINT
- OAUTH2_REQUEST_PERMISSIONS
- OAUTH2_ID_MAP
- OAUTH2_USERNAME_MAP
- OAUTH2_FULLNAME_MAP
- OAUTH2_EMAIL_MAP
- PROPAGATE_OIDC_DATA
- OIDC_REDIRECTION_ENABLED
shared_secrets:
wekan_secret: oauth2_secret

View File

@ -1,29 +1,33 @@
version: '3.8'
services:
db:
image: mongo:5.0
command: mongod --logpath /dev/null --oplogSize 128 --quiet
image: mongo:6.0
environment:
- LOGO_IMG_URL
- LOGO_LINK_URL
command: mongod --oplogSize 128 --quiet
volumes:
- wekan-db:/data/db
networks:
- internal
healthcheck:
test: echo 'db.runCommand("ping").ok' | mongo localhost:27017/test --quiet
test: echo 'db.runCommand("ping").ok' | mongosh localhost:27017/test --quiet
interval: 30s
timeout: 10s
retries: 10
start_period: 1m
deploy:
labels:
backupbot.backup: "true"
backupbot.backup.pre-hook: "mkdir /tmp/backup/ && mongodump --archive=/tmp/backup/wekan.db"
backupbot.backup.post-hook: "rm -rf /tmp/backup"
backupbot.backup.path: "/tmp/backup/"
backupbot.backup: "${ENABLE_BACKUPS:-true}"
backupbot.backup.pre-hook: "mongodump --archive=/data/db/wekan.db"
backupbot.backup.volumes.wekan-db.path: "wekan.db"
backupbot.restore.post-hook: 'mongorestore --drop --archive=/data/db/wekan.db'
app:
image: quay.io/wekan/wekan:v6.68
image: quay.io/wekan/wekan:v7.91
environment:
- MONGO_URL=mongodb://db:27017/wekan
- NODE_OPTIONS="--max_old_space_size=4096"
- DOMAIN
- ROOT_URL
- DEBUG
@ -32,7 +36,7 @@ services:
- WITH_API
- RICHER_CARD_COMMENT_EDITOR
- CORS
- CORS_ALLOW_HEADERS
- CORS_ALLOW_HEADERS
- CORS_EXPOSE_HEADERS
- PASSWORD_LOGIN_ENABLED
- OAUTH2_ENABLED
@ -51,22 +55,25 @@ services:
- DEFAULT_AUTHENTICATION_METHOD
- PROPAGATE_OIDC_DATA
- OIDC_REDIRECTION_ENABLED
- WRITABLE_PATH=/data
volumes:
- wekan-files:/data:rw
networks:
- internal
- proxy
- internal
- proxy
depends_on:
- db
healthcheck:
test: node /build/healthcheck.js # no curl for healthcheck in wekan container
test: bash /build/healthcheck.sh
interval: 30s
timeout: 10s
retries: 10
start_period: 1m
start_period: 3m
secrets:
- oauth2_secret
configs:
- source: healthcheck_js
target: /build/healthcheck.js
- source: healthcheck_sh
target: /build/healthcheck.sh
mode: 0555
- source: entrypoint
target: /home/wekan/app/docker-entrypoint.sh
@ -83,20 +90,22 @@ services:
- "traefik.http.routers.${STACK_NAME}.rule=Host(`${DOMAIN}`)"
- "traefik.http.routers.${STACK_NAME}.entrypoints=web-secure"
- "traefik.http.routers.${STACK_NAME}.tls.certresolver=${LETS_ENCRYPT_ENV}"
- "coop-cloud.${STACK_NAME}.version=0.12.0+v6.68"
- "coop-cloud.${STACK_NAME}.version=3.3.0+v7.91"
- "coop-cloud.${STACK_NAME}.timeout=${TIMEOUT:-120}"
volumes:
wekan-db:
wekan-files:
networks:
proxy:
external: true
internal:
configs:
healthcheck_js:
name: ${STACK_NAME}_healthcheck_js
file: healthcheck.js
healthcheck_sh:
name: ${STACK_NAME}_healthcheck_sh
file: healthcheck.sh
entrypoint:
name: ${STACK_NAME}_entrypoint_${ENTRYPOINT_VERSION}
file: entrypoint.sh.tmpl

View File

@ -25,4 +25,8 @@ file_env() {
}
file_env "OAUTH2_SECRET"
bash -c "ulimit -s 65500; exec node --stack-size=65500 /build/main.js"
# https://github.com/wekan/wekan/issues/3585#issuecomment-1021522132
#bash -c "ulimit -s 65500; exec node --stack-size=65500 /build/main.js"
# https://github.com/wekan/wekan/pull/5588
#bash -c "ulimit -n 65500; exec node /build/main.js"
bash -c "exec node /build/main.js"

View File

@ -1,23 +0,0 @@
const http = require('http');
const options = {
host: '0.0.0.0',
port: 8080,
timeout: 2000
};
const healthCheck = http.request(options, (res) => {
console.log(`HEALTHCHECK STATUS: ${res.statusCode}`);
if (res.statusCode == 200) {
process.exit(0);
}
else {
process.exit(1);
}
});
healthCheck.on('error', function (err) {
console.error('ERROR');
process.exit(1);
});
healthCheck.end();

87
healthcheck.sh Normal file
View File

@ -0,0 +1,87 @@
#!/bin/sh
printf "GET / HTTP/1.1\n\n" > /dev/tcp/127.0.0.1/8080
if [ $? != 0 ]; then
echo "Webservice not accessible"
exit 1
fi
CPU_USAGE_THRESHOLD=100.0
PID=$(pidof node)
if [ -z "$PID" ]; then
echo "Node.js process not running."
exit 1
fi
STATE_FILE="/tmp/cpu_usage_state_$PID"
# Function to get total CPU time
get_total_cpu_time() {
cat /proc/stat | grep '^cpu ' | awk '{sum=0; for(i=2;i<=NF;i++) sum += $i; print sum;}'
}
# Function to get process CPU time
get_process_cpu_time() {
cat /proc/$PID/stat | awk '{print $14+$15}' # Only user and system time
}
# Function to get the number of CPUs
get_cpu_count() {
grep -c '^processor' /proc/cpuinfo
}
# Main script
if [ -z "$PID" ]; then
echo "Usage: $0 <pid>"
exit 1
fi
# Check if the process directory exists
if [ ! -d "/proc/$PID" ]; then
echo "Process with PID $PID does not exist."
exit 1
fi
# Get current CPU times
current_total=$(get_total_cpu_time)
current_process=$(get_process_cpu_time $PID)
# Check for previous state
if [ -f "$STATE_FILE" ]; then
# Read previous state
read prev_total prev_process < "$STATE_FILE"
# Calculate the CPU usage
delta_total=$((current_total - prev_total))
delta_process=$((current_process - prev_process))
CPU_COUNT=$(get_cpu_count)
# Normalize CPU usage across all CPUs and calculate percentage
if [ $delta_total -gt 0 ]; then # To avoid division by zero
CPU_USAGE=$(awk -v delta_process="$delta_process" -v delta_total="$delta_total" -v cpu_count="$CPU_COUNT" \
'BEGIN {printf "%.2f", (delta_process / delta_total) * 100 * cpu_count}')
awk -v usage="$CPU_USAGE" -v threshold="$CPU_USAGE_THRESHOLD" '
BEGIN {
if (usage > threshold) {
print "High CPU usage: " usage "% (Threshold: " threshold "%)";
exit 1; # Exit with status 1 for high usage
} else {
print "CPU usage within limits: " usage "%";
exit 0; # Normal exit status
}
}'
EXIT_STATUS=$?
else
echo "No enough data to calculate CPU usage. Please try again."
fi
else
echo "No previous data found. Run the script later to get CPU usage."
fi
# Save current state
echo "$current_total $current_process" > "$STATE_FILE"
if [ $EXIT_STATUS -ne 0 ]; then
echo "Exiting due to high CPU usage."
exit $EXIT_STATUS
fi

7
release/3.0.0+v7.50 Normal file
View File

@ -0,0 +1,7 @@
Breaking Change: Update MongoDB from version 5.0 to 6.0.
========================================================
Before updating:
Run `abra app cmd <app_domaon> db show_mongo_version` to check if the featureCompatibilityVersion is above 5.0 !
Run `abra app cmd <app_domaon> db update_mongo_version` to set featureCompatibilityVersion to version 5.0