Update app version [skip ci]

This commit is contained in:
github-action update-app-version
2026-11-14 02:31:31 +00:00
parent 2933b53cd9
commit 87f1018a09
8 changed files with 171 additions and 2 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
services:
codex2api:
image: "ghcr.io/james-6-23/codex2api:3.1.6@sha256:135df508eb7e5b959fdf0bb56c397ea98c902cbf2c983a5280123b1e600f5780"
image: "ghcr.io/james-6-23/codex2api:3.1.4@sha256:705cde823ad9a2d6ed4038b4ea844f63e6e9064dea6bd99f619fb8f2e5c6ae3e"
container_name: ${CONTAINER_NAME}
restart: always
security_opt:
+1 -1
View File
@@ -1,6 +1,6 @@
services:
codex2api:
image: "ghcr.io/james-6-23/codex2api:3.1.6@sha256:135df508eb7e5b959fdf0bb56c397ea98c902cbf2c983a5280123b1e600f5780"
image: "ghcr.io/james-6-23/codex2api:3.1.5@sha256:7e8ea88afd419af4d3515055559c124802c74c74a10f7eade8998b5a281ef2a0"
container_name: ${CONTAINER_NAME}
restart: always
security_opt:
+5
View File
@@ -0,0 +1,5 @@
CONTAINER_NAME=1Panel-localcodex2api
PANEL_APP_PORT_HTTP=40167
ADMIN_SECRET=replace-with-a-strong-random-admin-secret
TZ=Asia/Shanghai
APP_DATA_DIR=./data
+77
View File
@@ -0,0 +1,77 @@
additionalProperties:
formFields:
- default: 40167
edit: true
envKey: PANEL_APP_PORT_HTTP
labelEn: Web Port
labelZh: Web 端口
label:
en: Web Port
es-es: Puerto web
ja: Web ポート
ms: Port Web
pt-br: Porta web
ru: Веб-порт
ko: 웹 포트
zh-Hant: Web 連接埠
zh: Web 端口
tr: Web Portu
required: true
rule: paramPort
type: number
- default: codex2api
edit: true
envKey: ADMIN_SECRET
labelEn: Admin Secret
labelZh: 管理密钥
label:
en: Admin Secret
es-es: Secreto de administrador
ja: 管理者シークレット
ms: Rahsia Pentadbir
pt-br: Segredo do administrador
ru: Секрет администратора
ko: 관리자 비밀 키
zh-Hant: 管理密鑰
zh: 管理密钥
tr: Yönetici Sırrı
random: true
required: true
rule: paramComplexity
type: password
- default: Asia/Shanghai
edit: true
envKey: TZ
labelEn: Timezone
labelZh: 时区
label:
en: Timezone
es-es: Zona horaria
ja: タイムゾーン
ms: Zon waktu
pt-br: Fuso horário
ru: Часовой пояс
ko: 시간대
zh-Hant: 時區
zh: 时区
tr: Saat Dilimi
required: true
type: text
- default: ./data
edit: true
envKey: APP_DATA_DIR
labelEn: Data Directory
labelZh: 数据目录
label:
en: Data Directory
es-es: Directorio de datos
ja: データディレクトリ
ms: Direktori Data
pt-br: Diretório de dados
ru: Каталог данных
ko: 데이터 디렉터리
zh-Hant: 資料目錄
zh: 数据目录
tr: Veri Dizini
required: true
type: text
+37
View File
@@ -0,0 +1,37 @@
services:
codex2api:
image: "ghcr.io/james-6-23/codex2api:3.1.6@sha256:135df508eb7e5b959fdf0bb56c397ea98c902cbf2c983a5280123b1e600f5780"
container_name: ${CONTAINER_NAME}
restart: always
security_opt:
- no-new-privileges:true
networks:
- 1panel-network
ports:
- "${PANEL_APP_PORT_HTTP}:8080"
environment:
- CODEX_PORT=8080
- CODEX_BIND=0.0.0.0
- ADMIN_SECRET=${ADMIN_SECRET}
- CODEX_ALLOW_ANONYMOUS=false
- DATABASE_DRIVER=sqlite
- CACHE_DRIVER=memory
- DATABASE_PATH=/data/codex2api.db
- IMAGE_ASSET_DIR=/data/images
- LOG_DIR=/app/logs
- TZ=${TZ}
volumes:
- "${APP_DATA_DIR}/data:/data"
- "${APP_DATA_DIR}/logs:/app/logs"
healthcheck:
test: ["CMD-SHELL", "wget -q --spider http://127.0.0.1:8080/health"]
interval: 30s
timeout: 10s
retries: 5
start_period: 30s
labels:
createdBy: "Apps"
networks:
1panel-network:
external: true
+40
View File
@@ -0,0 +1,40 @@
#!/usr/bin/env bash
set -euo pipefail
ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd -P)"
ENV_FILE="${ENV_FILE:-${ROOT_DIR}/.env}"
read_env() {
local value
value="$(sed -n "s/^${1}=//p" "$ENV_FILE" | tail -n 1)"
if [[ ${#value} -ge 2 && "${value:0:1}" == "${value: -1}" && "${value:0:1}" =~ [\"\'] ]]; then
value="${value:1:${#value}-2}"
fi
printf '%s\n' "$value"
}
[[ -f "$ENV_FILE" && ! -L "$ENV_FILE" ]] || {
printf '%s\n' "$ENV_FILE must be a regular file" >&2
exit 1
}
DATA_DIR="$(read_env APP_DATA_DIR)"
DATA_DIR="${DATA_DIR:-./data}"
case "$DATA_DIR" in
/*) DATA_DIR="$(realpath -m -- "$DATA_DIR")" ;;
*)
DATA_DIR="$(realpath -m -- "${ROOT_DIR}/${DATA_DIR#./}")"
[[ "$DATA_DIR" == "$ROOT_DIR" || "$DATA_DIR" == "$ROOT_DIR/"* ]] || {
printf '%s\n' "Relative APP_DATA_DIR must stay inside the application directory" >&2
exit 1
}
;;
esac
[[ "$DATA_DIR" != / ]] || {
printf '%s\n' "APP_DATA_DIR must not be the filesystem root" >&2
exit 1
}
mkdir -p "$DATA_DIR/data" "$DATA_DIR/logs"
+5
View File
@@ -0,0 +1,5 @@
#!/usr/bin/env bash
set -euo pipefail
# 1Panel owns application data removal according to the user's uninstall choice.
exit 0
+5
View File
@@ -0,0 +1,5 @@
#!/usr/bin/env bash
set -euo pipefail
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd -P)"
"$SCRIPT_DIR/init.sh"