diff --git a/apps/wiki-go/1.9.4/docker-compose.yml b/apps/wiki-go/1.9.4/docker-compose.yml index dc9b13cb5..e32fd9055 100644 --- a/apps/wiki-go/1.9.4/docker-compose.yml +++ b/apps/wiki-go/1.9.4/docker-compose.yml @@ -1,6 +1,6 @@ services: wiki-go: - image: "leomoonstudios/wiki-go:1.9.6" + image: "leomoonstudios/wiki-go:1.9.4" container_name: ${CONTAINER_NAME} restart: unless-stopped networks: diff --git a/apps/wiki-go/1.9.5/docker-compose.yml b/apps/wiki-go/1.9.5/docker-compose.yml index dc9b13cb5..9faf85118 100644 --- a/apps/wiki-go/1.9.5/docker-compose.yml +++ b/apps/wiki-go/1.9.5/docker-compose.yml @@ -1,6 +1,6 @@ services: wiki-go: - image: "leomoonstudios/wiki-go:1.9.6" + image: "leomoonstudios/wiki-go:1.9.5" container_name: ${CONTAINER_NAME} restart: unless-stopped networks: diff --git a/apps/wiki-go/1.9.6/.env.sample b/apps/wiki-go/1.9.6/.env.sample new file mode 100644 index 000000000..c64ab15b2 --- /dev/null +++ b/apps/wiki-go/1.9.6/.env.sample @@ -0,0 +1,3 @@ +CONTAINER_NAME=wiki-go-compose-check +PANEL_APP_BIND_ADDRESS=127.0.0.1 +PANEL_APP_PORT_HTTP=8080 diff --git a/apps/wiki-go/1.9.6/data.yml b/apps/wiki-go/1.9.6/data.yml new file mode 100644 index 000000000..f82702739 --- /dev/null +++ b/apps/wiki-go/1.9.6/data.yml @@ -0,0 +1,51 @@ +additionalProperties: + formFields: + - default: 127.0.0.1 + edit: true + envKey: PANEL_APP_BIND_ADDRESS + labelEn: Bind Address + labelZh: 绑定地址 + label: + en: Bind Address + zh: 绑定地址 + zh-Hant: 綁定位址 + ja: バインドアドレス + ko: 바인드 주소 + ru: Адрес привязки + ms: Alamat ikatan + pt-br: Endereco de vinculacao + required: true + type: text + - default: 8080 + edit: true + envKey: PANEL_APP_PORT_HTTP + labelEn: HTTP Port + labelZh: HTTP 端口 + label: + en: HTTP Port + zh: HTTP 端口 + zh-Hant: HTTP 連接埠 + ja: HTTP ポート + ko: HTTP 포트 + ru: Порт HTTP + ms: Port HTTP + pt-br: Porta HTTP + required: true + rule: paramPort + type: number + - default: Asia/Shanghai + edit: true + envKey: TZ + labelEn: Timezone + labelZh: 时区 + label: + en: Timezone + zh: 时区 + zh-Hant: 時區 + ja: タイムゾーン + ko: 시간대 + ru: Часовой пояс + ms: Zon waktu + pt-br: Fuso horário + required: true + type: text diff --git a/apps/wiki-go/1.9.6/default-config.yaml b/apps/wiki-go/1.9.6/default-config.yaml new file mode 100644 index 000000000..e1598cea8 --- /dev/null +++ b/apps/wiki-go/1.9.6/default-config.yaml @@ -0,0 +1,38 @@ +server: + host: "0.0.0.0" + port: 8080 + allow_insecure_cookies: true + ssl: false + ssl_cert: "" + ssl_key: "" +wiki: + root_dir: "data" + documents_dir: "documents" + title: "Wiki-Go" + owner: "wiki.example.com" + notice: "Copyright :::year::: All rights reserved." + timezone: "Asia/Shanghai" + private: false + disable_comments: false + disable_file_upload_checking: false + enable_link_embedding: false + hide_attachments: false + disable_content_max_width: false + always_open_children_in_sidebar: false + max_versions: 10 + max_upload_size: 10 + language: "en" + log_level: "info" +security: + passwordstrength: 14 + login_ban: + enabled: true + max_failures: 5 + window_seconds: 180 + initial_ban_seconds: 60 + max_ban_seconds: 86400 +users: + - username: admin + password: $2a$14$8ZJtOsMVd9moF06LVw84ae.71boNvc75VSjIoGBPhVbRV7gUbONTy + role: admin +access_rules: [] diff --git a/apps/wiki-go/1.9.6/docker-compose.yml b/apps/wiki-go/1.9.6/docker-compose.yml new file mode 100644 index 000000000..dc9b13cb5 --- /dev/null +++ b/apps/wiki-go/1.9.6/docker-compose.yml @@ -0,0 +1,32 @@ +services: + wiki-go: + image: "leomoonstudios/wiki-go:1.9.6" + container_name: ${CONTAINER_NAME} + restart: unless-stopped + networks: + - 1panel-network + ports: + - "${PANEL_APP_BIND_ADDRESS}:${PANEL_APP_PORT_HTTP}:8080/tcp" + environment: + - TZ=Asia/Shanghai + read_only: true + tmpfs: + - /tmp + cap_drop: + - ALL + security_opt: + - no-new-privileges:true + volumes: + - "./data:/wiki/data" + healthcheck: + test: ["CMD-SHELL", "curl -fsS http://127.0.0.1:8080/ >/dev/null || exit 1"] + interval: 10s + timeout: 5s + start_period: 30s + retries: 12 + labels: + createdBy: "Apps" + +networks: + 1panel-network: + external: true diff --git a/apps/wiki-go/1.9.6/scripts/init.sh b/apps/wiki-go/1.9.6/scripts/init.sh new file mode 100755 index 000000000..dd854c4f2 --- /dev/null +++ b/apps/wiki-go/1.9.6/scripts/init.sh @@ -0,0 +1,34 @@ +#!/usr/bin/env bash +set -euo pipefail + +ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd -P)" +DATA_DIR="$ROOT_DIR/data" +CONFIG_FILE="$DATA_DIR/config.yaml" +DEFAULT_CONFIG="$ROOT_DIR/default-config.yaml" + +fail() { + printf '%s\n' "$1" >&2 + exit 1 +} + +[[ ! -L "$DATA_DIR" ]] || fail "data must not be a symbolic link" +[[ ! -L "$CONFIG_FILE" ]] || fail "config.yaml must not be a symbolic link" +[[ -f "$DEFAULT_CONFIG" ]] || fail "$DEFAULT_CONFIG not found" + +install -d -m 0750 -- "$DATA_DIR" +resolved_data="$(realpath -e -- "$DATA_DIR")" +case "$resolved_data" in + "$ROOT_DIR"/*) ;; + *) fail "data resolves outside the application version directory" ;; +esac + +if [[ ! -e "$CONFIG_FILE" ]]; then + install -m 0640 -- "$DEFAULT_CONFIG" "$CONFIG_FILE" +fi +[[ -f "$CONFIG_FILE" ]] || fail "config.yaml must be a regular file" + +if [[ "$(id -u)" -eq 0 ]]; then + chown -R --no-dereference 1000:1000 "$DATA_DIR" +fi +chmod 0750 "$DATA_DIR" +chmod 0640 "$CONFIG_FILE" diff --git a/apps/wiki-go/1.9.6/scripts/uninstall.sh b/apps/wiki-go/1.9.6/scripts/uninstall.sh new file mode 100755 index 000000000..6e877466e --- /dev/null +++ b/apps/wiki-go/1.9.6/scripts/uninstall.sh @@ -0,0 +1,2 @@ +#!/usr/bin/env bash +set -euo pipefail diff --git a/apps/wiki-go/1.9.6/scripts/upgrade.sh b/apps/wiki-go/1.9.6/scripts/upgrade.sh new file mode 100755 index 000000000..5ec28d784 --- /dev/null +++ b/apps/wiki-go/1.9.6/scripts/upgrade.sh @@ -0,0 +1,5 @@ +#!/usr/bin/env bash +set -euo pipefail + +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd -P)" +exec "$SCRIPT_DIR/init.sh"