发布 Stash Box
Signed-off-by: Meng Sen <qyg2297248353@gmail.com>
This commit is contained in:
parent
13284528ba
commit
76bad09aa9
|
|
@ -1,28 +1,26 @@
|
||||||
additionalProperties:
|
additionalProperties:
|
||||||
formFields:
|
formFields:
|
||||||
- default: "/home/stash"
|
- child:
|
||||||
|
default: ""
|
||||||
|
envKey: PANEL_POSTGRES_SERVICE
|
||||||
|
required: true
|
||||||
|
type: service
|
||||||
|
default: postgresql
|
||||||
|
envKey: PANEL_POSTGRES_TYPE
|
||||||
|
labelZh: Postgres 服务 (前置检查)
|
||||||
|
labelEn: Postgres Service (Pre-check)
|
||||||
|
required: true
|
||||||
|
type: apps
|
||||||
|
values:
|
||||||
|
- label: PostgreSQL
|
||||||
|
value: postgresql
|
||||||
|
- default: "/home/stash-box"
|
||||||
edit: true
|
edit: true
|
||||||
envKey: STASH_ROOT_PATH
|
envKey: STASH_BOX_ROOT_PATH
|
||||||
labelZh: 数据持久化路径
|
labelZh: 数据持久化路径
|
||||||
labelEn: Data persistence path
|
labelEn: Data persistence path
|
||||||
required: true
|
required: true
|
||||||
type: text
|
type: text
|
||||||
- default: "host"
|
|
||||||
edit: true
|
|
||||||
envKey: NETWORK_MODE
|
|
||||||
labelEn: Drive path
|
|
||||||
labelZh: 网络模式
|
|
||||||
required: true
|
|
||||||
type: select
|
|
||||||
values:
|
|
||||||
- label: 主机网络模式
|
|
||||||
value: "host"
|
|
||||||
- label: 桥接网络模式
|
|
||||||
value: "bridge"
|
|
||||||
- label: 无网络模式
|
|
||||||
value: "none"
|
|
||||||
- label: 1panel-network
|
|
||||||
value: "1panel-network"
|
|
||||||
- default: 9999
|
- default: 9999
|
||||||
edit: true
|
edit: true
|
||||||
envKey: PANEL_APP_PORT_HTTP
|
envKey: PANEL_APP_PORT_HTTP
|
||||||
|
|
@ -31,27 +29,45 @@ additionalProperties:
|
||||||
required: true
|
required: true
|
||||||
rule: paramPort
|
rule: paramPort
|
||||||
type: number
|
type: number
|
||||||
- default: ""
|
- default: "127.0.0.1"
|
||||||
edit: true
|
edit: true
|
||||||
envKey: CUSTOM_MOUNT_DIRECTORY_1
|
envKey: POSTGRES_HOST
|
||||||
labelEn: Custom mount directory 1
|
labelZh: 数据库 主机地址
|
||||||
labelZh: 自定义挂载目录 1
|
labelEn: Database Host
|
||||||
required: false
|
required: true
|
||||||
|
type: text
|
||||||
|
- default: 5432
|
||||||
|
edit: true
|
||||||
|
envKey: POSTGRES_PORT
|
||||||
|
labelZh: 数据库 端口
|
||||||
|
labelEn: Database Port
|
||||||
|
required: true
|
||||||
|
rule: paramPort
|
||||||
|
type: number
|
||||||
|
- default: "stash-box"
|
||||||
|
edit: true
|
||||||
|
envKey: POSTGRES_NAME
|
||||||
|
labelZh: 数据库 名称
|
||||||
|
labelEn: Database Name
|
||||||
|
required: true
|
||||||
|
rule: paramCommon
|
||||||
|
type: text
|
||||||
|
- default: "stash-box"
|
||||||
|
edit: true
|
||||||
|
envKey: POSTGRES_USER
|
||||||
|
labelZh: 数据库 用户名
|
||||||
|
labelEn: Database Username
|
||||||
|
required: true
|
||||||
type: text
|
type: text
|
||||||
- default: ""
|
- default: ""
|
||||||
edit: true
|
edit: true
|
||||||
envKey: CUSTOM_MOUNT_DIRECTORY_2
|
envKey: POSTGRES_PASSWORD
|
||||||
labelEn: Custom mount directory 2
|
labelZh: 数据库 密码
|
||||||
labelZh: 自定义挂载目录 2
|
labelEn: Database Password
|
||||||
required: false
|
random: true
|
||||||
type: text
|
required: true
|
||||||
- default: ""
|
rule: paramComplexity
|
||||||
edit: true
|
type: password
|
||||||
envKey: CUSTOM_MOUNT_DIRECTORY_3
|
|
||||||
labelEn: Custom mount directory 3
|
|
||||||
labelZh: 自定义挂载目录 3
|
|
||||||
required: false
|
|
||||||
type: text
|
|
||||||
- default: ""
|
- default: ""
|
||||||
edit: true
|
edit: true
|
||||||
envKey: HTTP_PROXY
|
envKey: HTTP_PROXY
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,8 @@ services:
|
||||||
- traefik.http.routers.stash-box.tls.certresolver=stash-box
|
- traefik.http.routers.stash-box.tls.certresolver=stash-box
|
||||||
- traefik.port=9998
|
- traefik.port=9998
|
||||||
restart: always
|
restart: always
|
||||||
network_mode: ${NETWORK_MODE:-host}
|
networks:
|
||||||
|
- 1panel-network
|
||||||
ports:
|
ports:
|
||||||
- ${PANEL_APP_PORT_HTTP}:${PANEL_APP_PORT_HTTP}
|
- ${PANEL_APP_PORT_HTTP}:${PANEL_APP_PORT_HTTP}
|
||||||
env_file:
|
env_file:
|
||||||
|
|
@ -25,4 +26,8 @@ services:
|
||||||
max-file: "10"
|
max-file: "10"
|
||||||
max-size: "2m"
|
max-size: "2m"
|
||||||
volumes:
|
volumes:
|
||||||
- ${STASH_ROOT_PATH}/data:/root/.stash-box
|
- ${STASH_BOX_ROOT_PATH}/data:/root/.stash-box
|
||||||
|
environment:
|
||||||
|
- HTTPS_PROXY=${HTTP_PROXY}
|
||||||
|
- HTTP_PROXY=${HTTP_PROXY:-}
|
||||||
|
- NO_PROXY=${NO_PROXY:-}
|
||||||
|
|
|
||||||
|
|
@ -10,6 +10,13 @@ if [ -f .env ]; then
|
||||||
echo "ENV_FILE=${CURRENT_DIR}/.env" >> .env
|
echo "ENV_FILE=${CURRENT_DIR}/.env" >> .env
|
||||||
echo "GLOBAL_ENV_FILE=${CURRENT_DIR}/envs/global.env" >> .env
|
echo "GLOBAL_ENV_FILE=${CURRENT_DIR}/envs/global.env" >> .env
|
||||||
|
|
||||||
|
# setup-2 create stash-box-config.yml
|
||||||
|
mkdir -p "$STASH_BOX_ROOT_PATH"
|
||||||
|
mkdir -p "$STASH_BOX_ROOT_PATH/data"
|
||||||
|
if [ ! -f "$STASH_BOX_ROOT_PATH/data/stash-box-config.yml" ]; then
|
||||||
|
echo "database: ${POSTGRES_USER}:${POSTGRES_PASSWORD}@${POSTGRES_HOST}:${POSTGRES_PORT}/${POSTGRES_NAME}" > "$STASH_BOX_ROOT_PATH/data/stash-box-config.yml"
|
||||||
|
fi
|
||||||
|
|
||||||
echo "Check Finish."
|
echo "Check Finish."
|
||||||
|
|
||||||
else
|
else
|
||||||
|
|
|
||||||
|
|
@ -10,6 +10,13 @@ if [ -f .env ]; then
|
||||||
echo "ENV_FILE=${CURRENT_DIR}/.env" >> .env
|
echo "ENV_FILE=${CURRENT_DIR}/.env" >> .env
|
||||||
echo "GLOBAL_ENV_FILE=${CURRENT_DIR}/envs/global.env" >> .env
|
echo "GLOBAL_ENV_FILE=${CURRENT_DIR}/envs/global.env" >> .env
|
||||||
|
|
||||||
|
# setup-2 create stash-box-config.yml
|
||||||
|
mkdir -p "$STASH_BOX_ROOT_PATH"
|
||||||
|
mkdir -p "$STASH_BOX_ROOT_PATH/data"
|
||||||
|
if [ ! -f "$STASH_BOX_ROOT_PATH/data/stash-box-config.yml" ]; then
|
||||||
|
echo "database: ${POSTGRES_USER}:${POSTGRES_PASSWORD}@${POSTGRES_HOST}:${POSTGRES_PORT}/${POSTGRES_NAME}" > "$STASH_BOX_ROOT_PATH/data/stash-box-config.yml"
|
||||||
|
fi
|
||||||
|
|
||||||
echo "Check Finish."
|
echo "Check Finish."
|
||||||
|
|
||||||
else
|
else
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue