From 0815e5d540e25cd369fad4aaac1a3aaa4e0d6cae Mon Sep 17 00:00:00 2001 From: github-action update-app-version Date: Wed, 18 Nov 2026 20:29:04 +0000 Subject: [PATCH] Update app version [skip ci] --- .../4.1.3/docker-compose.yml | 2 +- .../4.1.5/docker-compose.yml | 2 +- apps/this-week-in-past/4.1.6/.env.sample | 6 + apps/this-week-in-past/4.1.6/data.yml | 105 +++++++++++++++++ .../4.1.6/docker-compose.yml | 24 ++++ apps/this-week-in-past/4.1.6/scripts/init.sh | 108 ++++++++++++++++++ .../4.1.6/scripts/uninstall.sh | 2 + .../4.1.6/scripts/upgrade.sh | 90 +++++++++++++++ 8 files changed, 337 insertions(+), 2 deletions(-) create mode 100644 apps/this-week-in-past/4.1.6/.env.sample create mode 100644 apps/this-week-in-past/4.1.6/data.yml create mode 100644 apps/this-week-in-past/4.1.6/docker-compose.yml create mode 100755 apps/this-week-in-past/4.1.6/scripts/init.sh create mode 100755 apps/this-week-in-past/4.1.6/scripts/uninstall.sh create mode 100755 apps/this-week-in-past/4.1.6/scripts/upgrade.sh diff --git a/apps/this-week-in-past/4.1.3/docker-compose.yml b/apps/this-week-in-past/4.1.3/docker-compose.yml index 1dc69702b..46528eb93 100644 --- a/apps/this-week-in-past/4.1.3/docker-compose.yml +++ b/apps/this-week-in-past/4.1.3/docker-compose.yml @@ -1,6 +1,6 @@ services: this-week-in-past: - image: "rouhim/this-week-in-past:4.1.6@sha256:dfce2f908fbc00935173eceed4babd442cfb3630152a274e245d45ab78eb5aaf" + image: "rouhim/this-week-in-past:4.1.3@sha256:c18ec7061e85962bb88e0b467caa446e2688c3ce2cc218eb9b99b1c1dc27d350" container_name: ${CONTAINER_NAME} restart: unless-stopped environment: diff --git a/apps/this-week-in-past/4.1.5/docker-compose.yml b/apps/this-week-in-past/4.1.5/docker-compose.yml index 1dc69702b..125b3c659 100644 --- a/apps/this-week-in-past/4.1.5/docker-compose.yml +++ b/apps/this-week-in-past/4.1.5/docker-compose.yml @@ -1,6 +1,6 @@ services: this-week-in-past: - image: "rouhim/this-week-in-past:4.1.6@sha256:dfce2f908fbc00935173eceed4babd442cfb3630152a274e245d45ab78eb5aaf" + image: "rouhim/this-week-in-past:4.1.5@sha256:989e84d91cefe8723022d6289481a430acc9a495dcb4ebd083839f9965ee6f95" container_name: ${CONTAINER_NAME} restart: unless-stopped environment: diff --git a/apps/this-week-in-past/4.1.6/.env.sample b/apps/this-week-in-past/4.1.6/.env.sample new file mode 100644 index 000000000..f6f717b9f --- /dev/null +++ b/apps/this-week-in-past/4.1.6/.env.sample @@ -0,0 +1,6 @@ +CONTAINER_NAME=this-week-in-past-compose-check +PANEL_APP_PORT_HTTP=40829 +PHOTO_LIBRARY_PATH=./data/photos +APP_DATA_DIR=./data/app +SLIDESHOW_INTERVAL=30 +RANDOM_SLIDESHOW=false diff --git a/apps/this-week-in-past/4.1.6/data.yml b/apps/this-week-in-past/4.1.6/data.yml new file mode 100644 index 000000000..c9fe7da6b --- /dev/null +++ b/apps/this-week-in-past/4.1.6/data.yml @@ -0,0 +1,105 @@ +additionalProperties: + formFields: + - default: 40829 + 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: ./data/photos + edit: true + envKey: PHOTO_LIBRARY_PATH + labelEn: Photo Library Directory + labelZh: 照片库目录 + label: + en: Photo Library Directory + zh: 照片库目录 + zh-Hant: 相片庫目錄 + ja: 写真ライブラリーディレクトリ + ko: 사진 라이브러리 디렉터리 + ru: Каталог фототеки + ms: Direktori Pustaka Foto + pt-br: Diretorio da biblioteca de fotos + required: true + type: text + - default: ./data/app + disabled: true + envKey: APP_DATA_DIR + labelEn: Application Data Directory + labelZh: 应用数据目录 + label: + en: Application Data Directory + zh: 应用数据目录 + zh-Hant: 應用程式資料目錄 + ja: アプリケーションデータディレクトリ + ko: 애플리케이션 데이터 디렉터리 + ru: Каталог данных приложения + ms: Direktori Data Aplikasi + pt-br: Diretorio de dados do aplicativo + required: true + type: text + edit: true + - default: 30 + edit: true + envKey: SLIDESHOW_INTERVAL + labelEn: Slideshow Interval (seconds) + labelZh: 幻灯片间隔(秒) + label: + en: Slideshow Interval (seconds) + zh: 幻灯片间隔(秒) + zh-Hant: 幻燈片間隔(秒) + ja: スライドショー間隔(秒) + ko: 슬라이드쇼 간격(초) + ru: Интервал слайд-шоу (секунды) + ms: Selang Tayangan Slaid (saat) + pt-br: Intervalo da apresentacao (segundos) + required: true + type: number + - default: 'false' + edit: true + envKey: RANDOM_SLIDESHOW + labelEn: Random Slideshow + labelZh: 随机幻灯片 + label: + en: Random Slideshow + zh: 随机幻灯片 + zh-Hant: 隨機幻燈片 + ja: ランダムスライドショー + ko: 무작위 슬라이드쇼 + ru: Случайное слайд-шоу + ms: Tayangan Slaid Rawak + pt-br: Apresentacao aleatoria + required: true + type: select + values: + - label: 'false' + value: 'false' + - label: 'true' + value: 'true' + - 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/this-week-in-past/4.1.6/docker-compose.yml b/apps/this-week-in-past/4.1.6/docker-compose.yml new file mode 100644 index 000000000..1dc69702b --- /dev/null +++ b/apps/this-week-in-past/4.1.6/docker-compose.yml @@ -0,0 +1,24 @@ +services: + this-week-in-past: + image: "rouhim/this-week-in-past:4.1.6@sha256:dfce2f908fbc00935173eceed4babd442cfb3630152a274e245d45ab78eb5aaf" + container_name: ${CONTAINER_NAME} + restart: unless-stopped + environment: + - RESOURCE_PATHS=/resources + - DATA_FOLDER=/data + - PORT=8080 + - SLIDESHOW_INTERVAL=${SLIDESHOW_INTERVAL} + - RANDOM_SLIDESHOW=${RANDOM_SLIDESHOW} + ports: + - "${PANEL_APP_PORT_HTTP}:8080" + volumes: + - "${PHOTO_LIBRARY_PATH}:/resources:ro" + - "${APP_DATA_DIR}:/data" + labels: + createdBy: "Apps" + networks: + - 1panel-network + +networks: + 1panel-network: + external: true diff --git a/apps/this-week-in-past/4.1.6/scripts/init.sh b/apps/this-week-in-past/4.1.6/scripts/init.sh new file mode 100755 index 000000000..c93633444 --- /dev/null +++ b/apps/this-week-in-past/4.1.6/scripts/init.sh @@ -0,0 +1,108 @@ +#!/usr/bin/env bash +set -euo pipefail +PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin +export PATH + +ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd -P)" +ENV_FILE="${ENV_FILE:-$ROOT_DIR/.env}" + +fail() { + printf '%s\n' "$1" >&2 + exit 1 +} + +read_env_value() { + local key="$1" + [[ -f "$ENV_FILE" ]] || return 0 + local value + value="$(sed -n "s/^${key}=//p" "$ENV_FILE" | tail -n 1)" + case "$value" in + \"*\") value="${value#\"}"; value="${value%\"}" ;; + \'*\') value="${value#\'}"; value="${value%\'}" ;; + esac + printf '%s\n' "$value" +} + +configured_value() { + local key="$1" + local default_value="$2" + local value + value="${!key:-}" + if [[ -z "$value" ]]; then + value="$(read_env_value "$key")" + fi + printf '%s\n' "${value:-$default_value}" +} + +resolve_app_path() { + local key="$1" + local raw="$2" + local clean candidate resolved current part + local -a parts=() + case "$raw" in + ""|/*|.|..|../*|*/../*|*/..) echo "unsafe ${key} path" >&2; return 1 ;; + esac + if [[ "$raw" =~ [[:cntrl:]] ]]; then + echo "unsafe ${key} path" >&2 + return 1 + fi + clean="${raw#./}" + [[ -n "$clean" ]] || { echo "unsafe ${key} path" >&2; return 1; } + command -v realpath >/dev/null 2>&1 || { echo "realpath is required" >&2; return 1; } + candidate="$ROOT_DIR/$clean" + resolved="$(realpath -m -- "$candidate")" || { echo "unsafe ${key} path" >&2; return 1; } + case "$resolved" in + "$ROOT_DIR"/*) ;; + *) echo "unsafe ${key} path" >&2; return 1 ;; + esac + current="$ROOT_DIR" + IFS='/' read -r -a parts <<< "$clean" + for part in "${parts[@]}"; do + [[ -z "$part" || "$part" == "." ]] && continue + current="$current/$part" + if [[ -L "$current" ]]; then + echo "unsafe ${key} path" >&2 + return 1 + fi + done + printf '%s\n' "$resolved" +} + +ensure_dir() { + local key="$1" + local default_value="$2" + local raw path + raw="$(configured_value "$key" "$default_value")" + path="$(resolve_app_path "$key" "$raw")" + mkdir -p -- "$path" + [[ "$(resolve_app_path "$key" "$raw")" == "$path" ]] || fail "unsafe ${key} path" + chmod 0750 "$path" + chown -R --no-dereference 1337:1337 "$path" +} + +ensure_photo_library() { + local raw path + raw="$(configured_value PHOTO_LIBRARY_PATH "./data/photos")" + case "$raw" in + ""|.|..|../*|*/../*|*/..) fail "unsafe PHOTO_LIBRARY_PATH path" ;; + esac + if [[ "$raw" =~ [[:cntrl:]] ]]; then + fail "unsafe PHOTO_LIBRARY_PATH path" + fi + + if [[ "$raw" == /* ]]; then + path="$raw" + else + path="$(realpath -m -- "$ROOT_DIR/$raw")" || fail "unsafe PHOTO_LIBRARY_PATH path" + fi + + if [[ "$raw" != /* && "$path" == "$ROOT_DIR/"* ]]; then + mkdir -p -- "$path" + return + fi + + [[ -d "$path" ]] || fail "PHOTO_LIBRARY_PATH must point to an existing directory" +} + +ensure_photo_library +ensure_dir "APP_DATA_DIR" "./data/app" diff --git a/apps/this-week-in-past/4.1.6/scripts/uninstall.sh b/apps/this-week-in-past/4.1.6/scripts/uninstall.sh new file mode 100755 index 000000000..6e877466e --- /dev/null +++ b/apps/this-week-in-past/4.1.6/scripts/uninstall.sh @@ -0,0 +1,2 @@ +#!/usr/bin/env bash +set -euo pipefail diff --git a/apps/this-week-in-past/4.1.6/scripts/upgrade.sh b/apps/this-week-in-past/4.1.6/scripts/upgrade.sh new file mode 100755 index 000000000..04e38d5e3 --- /dev/null +++ b/apps/this-week-in-past/4.1.6/scripts/upgrade.sh @@ -0,0 +1,90 @@ +#!/usr/bin/env bash +set -euo pipefail + +PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin +export PATH + +ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd -P)" +ENV_FILE="${ENV_FILE:-$ROOT_DIR/.env}" + +fail() { + printf '%s\n' "$1" >&2 + exit 1 +} + +read_env_value() { + local key="$1" + [[ -f "$ENV_FILE" ]] || return 0 + local value + value="$(sed -n "s/^${key}=//p" "$ENV_FILE" | tail -n 1)" + case "$value" in + \"*\") value="${value#\"}"; value="${value%\"}" ;; + \'*\') value="${value#\'}"; value="${value%\'}" ;; + esac + printf '%s\n' "$value" +} + +configured_value() { + local key="$1" + local default_value="$2" + local value + value="${!key:-}" + if [[ -z "$value" ]]; then + value="$(read_env_value "$key")" + fi + printf '%s\n' "${value:-$default_value}" +} + +resolve_app_path() { + local key="$1" + local raw="$2" + local clean candidate resolved current part + local -a parts=() + case "$raw" in + ""|/*|.|..|../*|*/../*|*/..) echo "unsafe ${key} path" >&2; return 1 ;; + esac + if [[ "$raw" =~ [[:cntrl:]] ]]; then + echo "unsafe ${key} path" >&2 + return 1 + fi + clean="${raw#./}" + [[ -n "$clean" ]] || { echo "unsafe ${key} path" >&2; return 1; } + command -v realpath >/dev/null 2>&1 || { echo "realpath is required" >&2; return 1; } + candidate="$ROOT_DIR/$clean" + resolved="$(realpath -m -- "$candidate")" || { echo "unsafe ${key} path" >&2; return 1; } + case "$resolved" in + "$ROOT_DIR"/*) ;; + *) echo "unsafe ${key} path" >&2; return 1 ;; + esac + current="$ROOT_DIR" + IFS='/' read -r -a parts <<< "$clean" + for part in "${parts[@]}"; do + [[ -z "$part" || "$part" == "." ]] && continue + current="$current/$part" + if [[ -L "$current" ]]; then + echo "unsafe ${key} path" >&2 + return 1 + fi + done + printf '%s\n' "$resolved" +} + +APP_DATA_DIR_VALUE="$(configured_value APP_DATA_DIR './data/app')" +DATA_DIR="$(resolve_app_path APP_DATA_DIR "$APP_DATA_DIR_VALUE")" + +cd -- "$DATA_DIR" || fail "unable to access application data directory" +[[ -f resources.db ]] || exit 0 +command -v sqlite3 >/dev/null 2>&1 || fail "sqlite3 is required to upgrade the application database" + +resource_table="$(sqlite3 -noheader resources.db "SELECT name FROM sqlite_master WHERE type='table' AND name='resources';")" +[[ "$resource_table" == "resources" ]] || exit 0 + +resource_columns="$(sqlite3 -noheader resources.db 'PRAGMA table_info(resources);')" +if ! printf '%s\n' "$resource_columns" | awk -F'|' '$2 == "taken" { found=1 } END { exit(found ? 0 : 1) }'; then + sqlite3 resources.db <<'SQL' +.timeout 30000 +BEGIN IMMEDIATE; +ALTER TABLE resources ADD COLUMN taken TEXT; +COMMIT; +SQL +fi