fix(wakapi): add 2.18.2 while preserving 2.18.1

This commit is contained in:
okxlin
2026-10-18 21:56:23 +08:00
parent 05ceb2c426
commit da563b9f2c
8 changed files with 198 additions and 0 deletions
+6
View File
@@ -0,0 +1,6 @@
PANEL_APP_PORT_HTTP=3000
WAKAPI_PASSWORD_SALT=replace-with-a-random-32-character-salt
WAKAPI_INSECURE_COOKIES=true
WAKAPI_ALLOW_SIGNUP=true
APP_DATA_DIR=./data
CONTAINER_NAME=wakapi
+95
View File
@@ -0,0 +1,95 @@
additionalProperties:
formFields:
- default: 3000
edit: true
envKey: PANEL_APP_PORT_HTTP
labelEn: Web Port
labelZh: Web 端口
label:
en: Web Port
zh: Web 端口
zh-Hant: Web 連接埠
ja: Web ポート
ko: Web 포트
ru: Веб-порт
ms: Port Web
pt-br: Porta Web
required: true
rule: paramPort
type: number
- default: change-me
edit: true
envKey: WAKAPI_PASSWORD_SALT
labelEn: Password Salt
labelZh: 密码盐
label:
en: Password Salt
zh: 密码盐
zh-Hant: 密碼鹽
ja: パスワードソルト
ko: 비밀번호 솔트
ru: Соль паролей
ms: Garam kata laluan
pt-br: Sal de senha
random: true
required: true
rule: paramComplexity
type: password
- default: "true"
edit: true
envKey: WAKAPI_INSECURE_COOKIES
labelEn: Allow Insecure Cookies
labelZh: 允许非安全 Cookie
label:
en: Allow Insecure Cookies
zh: 允许非安全 Cookie
zh-Hant: 允許非安全 Cookie
ja: 非セキュア Cookie を許可
ko: 보안이 적용되지 않은 Cookie 허용
ru: Разрешить небезопасные cookie
ms: Benarkan kuki tidak selamat
pt-br: Permitir cookies inseguros
required: true
type: select
values:
- label: "true"
value: "true"
- label: "false"
value: "false"
- default: "true"
edit: true
envKey: WAKAPI_ALLOW_SIGNUP
labelEn: Allow Sign-up
labelZh: 允许注册
label:
en: Allow Sign-up
zh: 允许注册
zh-Hant: 允許註冊
ja: ユーザー登録を許可
ko: 회원가입 허용
ru: Разрешить регистрацию
ms: Benarkan pendaftaran
pt-br: Permitir cadastro
required: true
type: select
values:
- label: "true"
value: "true"
- label: "false"
value: "false"
- default: ./data
edit: true
envKey: APP_DATA_DIR
labelEn: Data Directory
labelZh: 数据目录
label:
en: Data Directory
zh: 数据目录
zh-Hant: 資料目錄
ja: データディレクトリ
ko: 데이터 디렉터리
ru: Каталог данных
ms: Direktori data
pt-br: Diretório de dados
required: true
type: text
View File
+30
View File
@@ -0,0 +1,30 @@
services:
wakapi:
image: "n1try/wakapi:2.18.2"
container_name: ${CONTAINER_NAME}
init: true
restart: unless-stopped
networks:
- 1panel-network
ports:
- "${PANEL_APP_PORT_HTTP}:3000"
environment:
- WAKAPI_DB_TYPE=sqlite3
- WAKAPI_DB_NAME=/data/wakapi.db
- WAKAPI_PASSWORD_SALT=${WAKAPI_PASSWORD_SALT}
- WAKAPI_INSECURE_COOKIES=${WAKAPI_INSECURE_COOKIES}
- WAKAPI_ALLOW_SIGNUP=${WAKAPI_ALLOW_SIGNUP}
volumes:
- "${APP_DATA_DIR}:/data"
healthcheck:
test: ["CMD", "/app/healthcheck"]
interval: 60s
timeout: 3s
start_period: 120s
retries: 3
labels:
createdBy: "Apps"
networks:
1panel-network:
external: true
View File
+62
View File
@@ -0,0 +1,62 @@
#!/usr/bin/env bash
set -euo pipefail
ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd -P)"
ENV_FILE="${ENV_FILE:-$ROOT_DIR/.env}"
APP_DATA_DIR_RAW="${APP_DATA_DIR:-}"
WAKAPI_UID=65532
WAKAPI_GID=65532
if [[ -z "$APP_DATA_DIR_RAW" && -f "$ENV_FILE" ]]; then
APP_DATA_DIR_RAW="$(grep '^APP_DATA_DIR=' "$ENV_FILE" | tail -n 1 | cut -d '=' -f 2- || true)"
fi
APP_DATA_DIR_RAW="${APP_DATA_DIR_RAW:-./data}"
case "$APP_DATA_DIR_RAW" in
\"*\")
APP_DATA_DIR_RAW="${APP_DATA_DIR_RAW#\"}"
APP_DATA_DIR_RAW="${APP_DATA_DIR_RAW%\"}"
;;
\'*\')
APP_DATA_DIR_RAW="${APP_DATA_DIR_RAW#\'}"
APP_DATA_DIR_RAW="${APP_DATA_DIR_RAW%\'}"
;;
esac
if [[ -z "$APP_DATA_DIR_RAW" ]]; then
echo "APP_DATA_DIR must not be empty" >&2
exit 1
fi
case "$APP_DATA_DIR_RAW" in
/*)
APP_DATA_DIR_ABS="$(realpath -m -- "$APP_DATA_DIR_RAW")"
APP_DATA_DIR_SCOPE="absolute"
;;
*)
APP_DATA_DIR_ABS="$(realpath -m -- "$ROOT_DIR/${APP_DATA_DIR_RAW#./}")"
case "$APP_DATA_DIR_ABS" in
"$ROOT_DIR"/*) ;;
*)
echo "Relative APP_DATA_DIR must stay inside the application directory" >&2
exit 1
;;
esac
APP_DATA_DIR_SCOPE="application"
;;
esac
DATA_DIR_EXISTED=false
[[ -d "$APP_DATA_DIR_ABS" ]] && DATA_DIR_EXISTED=true
mkdir -p "$APP_DATA_DIR_ABS"
if [[ "$APP_DATA_DIR_SCOPE" == "application" || "$DATA_DIR_EXISTED" == "false" ]]; then
chown -R "$WAKAPI_UID:$WAKAPI_GID" "$APP_DATA_DIR_ABS"
else
CURRENT_UID="$(stat -c '%u' "$APP_DATA_DIR_ABS")"
CURRENT_GID="$(stat -c '%g' "$APP_DATA_DIR_ABS")"
if [[ "$CURRENT_UID" != "$WAKAPI_UID" || "$CURRENT_GID" != "$WAKAPI_GID" ]]; then
echo "Existing absolute APP_DATA_DIR must be owned by ${WAKAPI_UID}:${WAKAPI_GID}" >&2
exit 1
fi
fi
+2
View File
@@ -0,0 +1,2 @@
#!/bin/bash
docker-compose down --volumes
+3
View File
@@ -0,0 +1,3 @@
#!/usr/bin/env bash
set -euo pipefail
exit 0