新增版本

This commit is contained in:
ms
2026-01-26 10:41:15 +08:00
parent f11dbcd1f7
commit c7e4c69493
7 changed files with 184 additions and 0 deletions
+60
View File
@@ -0,0 +1,60 @@
additionalProperties:
formFields:
- default: "/home/rust-rec"
edit: true
envKey: RUST_REC_ROOT_PATH
labelZh: 应用持久化路径
labelEn: Data persistence path
required: true
type: text
- default: "/home/rust-rec"
edit: true
envKey: RUST_REC_DATA_ROOT_PATH
labelZh: 数据持久化路径
labelEn: Data persistence path
required: true
type: text
- default: 8088
edit: true
envKey: PANEL_APP_PORT_HTTP
labelZh: WebUI 端口
labelEn: WebUI port
required: true
rule: paramPort
type: number
- default: 8080
edit: true
envKey: PANEL_APP_PORT_API
labelZh: API 端口
labelEn: API port
required: true
rule: paramPort
type: number
- default: ""
edit: true
envKey: JWT_SECRET
labelZh: JWT 签名密钥
labelEn: JWT Secret
required: true
type: text
- default: ""
edit: true
envKey: SESSION_SECRET
labelZh: 会话密钥
labelEn: Session Secret
required: true
type: text
- default: ""
edit: true
envKey: HTTP_PROXY
labelZh: 网络代理
labelEn: Network Proxy
required: false
type: text
- default: "localhost,127.0.0.1,rust-srec-backend"
edit: true
envKey: NO_PROXY
labelZh: 忽略代理
labelEn: Ignore Proxy
required: true
type: text
+70
View File
@@ -0,0 +1,70 @@
networks:
1panel-network:
external: true
services:
rust-srec-backend:
image: ghcr.io/hua0512/rust-srec:v0.1.0
container_name: backend-${CONTAINER_NAME}
restart: always
networks:
- 1panel-network
ports:
- ${PANEL_APP_PORT_API}:8080
env_file:
- ${GLOBAL_ENV_FILE:-/etc/1panel/envs/global.env}
- ${ENV_FILE:-/etc/1panel/envs/default.env}
volumes:
- ${RUST_REC_DATA_ROOT_PATH}/data:/app/data
- ${RUST_REC_DATA_ROOT_PATH}/output:/app/output
- ${RUST_REC_ROOT_PATH}/config:/app/config
- ${RUST_REC_ROOT_PATH}/logs:/app/logs
- ${RUST_REC_ROOT_PATH}/tmp:/tmp
environment:
- TZ=Asia/Shanghai
- RUST_LOG=${RUST_LOG:-info}
- DATABASE_URL=${DATABASE_URL:-sqlite:///app/data/rust-srec.db}
- API_PORT=8080
- API_BIND_ADDRESS=0.0.0.0
- ACCESS_TOKEN_EXPIRATION_SECS=${ACCESS_TOKEN_EXPIRATION_SECS:-3600}
- REFRESH_TOKEN_EXPIRATION_SECS=${REFRESH_TOKEN_EXPIRATION_SECS:-604800}
- MIN_PASSWORD_LENGTH=${MIN_PASSWORD_LENGTH:-8}
- HTTP_PROXY=${HTTP_PROXY:-}
- HTTPS_PROXY=${HTTP_PROXY:-}
healthcheck:
test: [ "CMD", "curl", "-f", "http://localhost:8080/api/health/live" ]
interval: 30s
timeout: 10s
retries: 3
start_period: 10s
logging:
driver: "json-file"
options:
max-size: "100m"
max-file: "5"
rust-rec-frontend:
depends_on:
rust-srec-backend:
condition: service_healthy
image: ghcr.io/hua0512/rust-srec-frontend:v0.1.0
container_name: ${CONTAINER_NAME}
labels:
createdBy: "Apps"
restart: always
networks:
- 1panel-network
ports:
- ${PANEL_APP_PORT_HTTP}:80
env_file:
- ${GLOBAL_ENV_FILE:-/etc/1panel/envs/global.env}
- ${ENV_FILE:-/etc/1panel/envs/default.env}
environment:
- TZ=Asia/Shanghai
- BACKEND_URL=${BACKEND_URL:-http://rust-srec-backend:8080}
- COOKIE_SECURE=${COOKIE_SECURE:-}
logging:
driver: "json-file"
options:
max-size: "50m"
max-file: "3"
+8
View File
@@ -0,0 +1,8 @@
# copyright© 2024 XinJiang Ms Studio
ENV_FILE=.env
DATA_DIR=/app/data
CONFIG_DIR=/app/config
OUTPUT_DIR=/app/output
LOG_DIR=/app/logs
JWT_ISSUER=rust-srec
JWT_AUDIENCE=rust-srec-api
+2
View File
@@ -0,0 +1,2 @@
# copyright© 2024 XinJiang Ms Studio
TZ=Asia/Shanghai
+17
View File
@@ -0,0 +1,17 @@
#!/bin/bash
if [ -f .env ]; then
source .env
# setup-1 add default values
CURRENT_DIR=$(pwd)
sed -i '/^ENV_FILE=/d' .env
sed -i '/^GLOBAL_ENV_FILE=/d' .env
echo "ENV_FILE=${CURRENT_DIR}/.env" >> .env
echo "GLOBAL_ENV_FILE=${CURRENT_DIR}/envs/global.env" >> .env
echo "Check Finish."
else
echo "Error: .env file not found."
fi
+10
View File
@@ -0,0 +1,10 @@
#!/bin/bash
if [ -f .env ]; then
source .env
echo "Check Finish."
else
echo "Error: .env file not found."
fi
+17
View File
@@ -0,0 +1,17 @@
#!/bin/bash
if [ -f .env ]; then
source .env
# setup-1 add default values
CURRENT_DIR=$(pwd)
sed -i '/^ENV_FILE=/d' .env
sed -i '/^GLOBAL_ENV_FILE=/d' .env
echo "ENV_FILE=${CURRENT_DIR}/.env" >> .env
echo "GLOBAL_ENV_FILE=${CURRENT_DIR}/envs/global.env" >> .env
echo "Check Finish."
else
echo "Error: .env file not found."
fi