From 7de69b92034c57860499a889a02107609e8be0f4 Mon Sep 17 00:00:00 2001 From: QYG2297248353 Date: Mon, 13 Jan 2025 06:28:51 +0000 Subject: [PATCH] Processed apps directory via GitHub Actions --- appstore/nodebb/3.12.2/.env | 12 ++++++++++ appstore/nodebb/3.12.2/conf/setup.json | 11 +++++++++ appstore/nodebb/3.12.2/data.yml | 28 +++++++++++++++++++++++ appstore/nodebb/3.12.2/docker-compose.yml | 10 +------- appstore/nodebb/3.12.2/scripts/init.sh | 26 +++++++++++++++++++++ appstore/nodebb/3.12.2/scripts/upgrade.sh | 14 ++++++++++++ dockge/nodebb/.env | 12 ++++++++++ dockge/nodebb/conf/setup.json | 11 +++++++++ dockge/nodebb/docker-compose.yml | 10 +------- 9 files changed, 116 insertions(+), 18 deletions(-) create mode 100644 appstore/nodebb/3.12.2/conf/setup.json create mode 100644 dockge/nodebb/conf/setup.json diff --git a/appstore/nodebb/3.12.2/.env b/appstore/nodebb/3.12.2/.env index 84c9ea774f33..c3aaae43825c 100644 --- a/appstore/nodebb/3.12.2/.env +++ b/appstore/nodebb/3.12.2/.env @@ -4,6 +4,18 @@ NODEBB_ROOT_PATH=/home/nodebb # WebUI 端口 [必填] PANEL_APP_PORT_HTTP=4567 +# 服务地址 [必填] +NODEBB_URL=http://127.0.0.1:4567 + +# 管理员用户名 [必填] +NODEBB_ADMIN_USERNAME= + +# 管理员密码 [必填] +NODEBB_ADMIN_PASSWORD= + +# 管理员邮箱 [必填] +NODEBB_ADMIN_EMAIL= + # 数据库类型 [必填] NODEBB_DB=postgres diff --git a/appstore/nodebb/3.12.2/conf/setup.json b/appstore/nodebb/3.12.2/conf/setup.json new file mode 100644 index 000000000000..e5efa16d89cc --- /dev/null +++ b/appstore/nodebb/3.12.2/conf/setup.json @@ -0,0 +1,11 @@ +{ + "defaults": { + "$NODEBB_DB": { + "host": "$NODEBB_DB_HOST", + "port": $NODEBB_DB_PORT, + "database": "$NODEBB_DB_NAME", + "username": "$NODEBB_DB_USER", + "password": "$NODEBB_DB_PASSWORD" + } + } +} diff --git a/appstore/nodebb/3.12.2/data.yml b/appstore/nodebb/3.12.2/data.yml index 327b59155595..a161316f7244 100644 --- a/appstore/nodebb/3.12.2/data.yml +++ b/appstore/nodebb/3.12.2/data.yml @@ -15,6 +15,34 @@ additionalProperties: required: true rule: paramPort type: number + - default: "http://127.0.0.1:4567" + edit: true + envKey: NODEBB_URL + labelZh: 服务地址 + labelEn: Service address + required: true + type: text + - default: "" + edit: true + envKey: NODEBB_ADMIN_USERNAME + labelZh: 管理员用户名 + labelEn: Admin Username + required: true + type: text + - default: "" + edit: true + envKey: NODEBB_ADMIN_PASSWORD + labelZh: 管理员密码 + labelEn: Admin Password + required: true + type: password + - default: "" + edit: true + envKey: NODEBB_ADMIN_EMAIL + labelZh: 管理员邮箱 + labelEn: Admin Email + required: true + type: text - default: "postgres" edit: true envKey: NODEBB_DB diff --git a/appstore/nodebb/3.12.2/docker-compose.yml b/appstore/nodebb/3.12.2/docker-compose.yml index 982164d12df4..430c01e62714 100644 --- a/appstore/nodebb/3.12.2/docker-compose.yml +++ b/appstore/nodebb/3.12.2/docker-compose.yml @@ -9,15 +9,6 @@ services: - .env environment: - TZ=Asia/Shanghai - - bind_address=0.0.0.0 - - port=4567 - - url=http://127.0.0.1:4567 - - database=${NODEBB_DB} - - ${NODEBB_DB}__host=${NODEBB_DB_HOST} - - ${NODEBB_DB}__port=${NODEBB_DB_PORT} - - ${NODEBB_DB}__database=${NODEBB_DB_NAME} - - ${NODEBB_DB}__username=${NODEBB_DB_USER} - - ${NODEBB_DB}__password=${NODEBB_DB_PASSWORD} image: ghcr.io/nodebb/nodebb:3.12.2 labels: createdBy: Apps @@ -31,3 +22,4 @@ services: - ${NODEBB_ROOT_PATH}/build:/usr/src/app/build - ${NODEBB_ROOT_PATH}/uploads:/usr/src/app/public/uploads - ${NODEBB_ROOT_PATH}/config:/opt/config + - ${NODEBB_ROOT_PATH}/setup.json:/usr/src/app/setup.json diff --git a/appstore/nodebb/3.12.2/scripts/init.sh b/appstore/nodebb/3.12.2/scripts/init.sh index 29d363274896..00b4605fb128 100644 --- a/appstore/nodebb/3.12.2/scripts/init.sh +++ b/appstore/nodebb/3.12.2/scripts/init.sh @@ -17,6 +17,32 @@ if [ -f .env ]; then mkdir -p "$NODEBB_ROOT_PATH/uploads" mkdir -p "$NODEBB_ROOT_PATH/config" + # setup-3 初始化参数配置 + if [ -z "$NODEBB_DB_NAME" ]; then + NODEBB_DB_NAME="nodebb" + fi + + if [ -z "$NODEBB_DB_USER" ]; then + NODEBB_DB_USER="" + fi + + if [ -z "$NODEBB_DB_PASSWORD" ]; then + NODEBB_DB_PASSWORD="" + fi + + SETUP_JSON_PATH="$NODEBB_ROOT_PATH/setup.json" + cp ./conf/setup.json "$SETUP_JSON_PATH" + sed -i " + s|\$NODEBB_DB_HOST|$NODEBB_DB_HOST|g; + s|\$NODEBB_DB_PORT|$NODEBB_DB_PORT|g; + s|\$NODEBB_DB_NAME|$NODEBB_DB_NAME|g; + s|\$NODEBB_DB_USER|$NODEBB_DB_USER|g; + s|\$NODEBB_DB_PASSWORD|$NODEBB_DB_PASSWORD|g; + s|\$NODEBB_DB|$NODEBB_DB|g + " "$SETUP_JSON_PATH" + + + # setup-4 update dir permissions chown -R 1001:1001 "$NODEBB_ROOT_PATH" chown -R 1001:1001 "$NODEBB_ROOT_PATH/node_modules" chown -R 1001:1001 "$NODEBB_ROOT_PATH/build" diff --git a/appstore/nodebb/3.12.2/scripts/upgrade.sh b/appstore/nodebb/3.12.2/scripts/upgrade.sh index 29d363274896..6cdcf17446e9 100644 --- a/appstore/nodebb/3.12.2/scripts/upgrade.sh +++ b/appstore/nodebb/3.12.2/scripts/upgrade.sh @@ -17,6 +17,20 @@ if [ -f .env ]; then mkdir -p "$NODEBB_ROOT_PATH/uploads" mkdir -p "$NODEBB_ROOT_PATH/config" + if [ ! -f "$NODEBB_ROOT_PATH/setup.json" ]; then + SETUP_JSON_PATH="$NODEBB_ROOT_PATH/setup.json" + cp ./conf/setup.json "$SETUP_JSON_PATH" + sed -i " + s|\$NODEBB_DB_HOST|$NODEBB_DB_HOST|g; + s|\$NODEBB_DB_PORT|$NODEBB_DB_PORT|g; + s|\$NODEBB_DB_NAME|$NODEBB_DB_NAME|g; + s|\$NODEBB_DB_USER|$NODEBB_DB_USER|g; + s|\$NODEBB_DB_PASSWORD|$NODEBB_DB_PASSWORD|g; + s|\$NODEBB_DB|$NODEBB_DB|g + " "$SETUP_JSON_PATH" + fi + + # setup-3 update dir permissions chown -R 1001:1001 "$NODEBB_ROOT_PATH" chown -R 1001:1001 "$NODEBB_ROOT_PATH/node_modules" chown -R 1001:1001 "$NODEBB_ROOT_PATH/build" diff --git a/dockge/nodebb/.env b/dockge/nodebb/.env index 84c9ea774f33..c3aaae43825c 100644 --- a/dockge/nodebb/.env +++ b/dockge/nodebb/.env @@ -4,6 +4,18 @@ NODEBB_ROOT_PATH=/home/nodebb # WebUI 端口 [必填] PANEL_APP_PORT_HTTP=4567 +# 服务地址 [必填] +NODEBB_URL=http://127.0.0.1:4567 + +# 管理员用户名 [必填] +NODEBB_ADMIN_USERNAME= + +# 管理员密码 [必填] +NODEBB_ADMIN_PASSWORD= + +# 管理员邮箱 [必填] +NODEBB_ADMIN_EMAIL= + # 数据库类型 [必填] NODEBB_DB=postgres diff --git a/dockge/nodebb/conf/setup.json b/dockge/nodebb/conf/setup.json new file mode 100644 index 000000000000..e5efa16d89cc --- /dev/null +++ b/dockge/nodebb/conf/setup.json @@ -0,0 +1,11 @@ +{ + "defaults": { + "$NODEBB_DB": { + "host": "$NODEBB_DB_HOST", + "port": $NODEBB_DB_PORT, + "database": "$NODEBB_DB_NAME", + "username": "$NODEBB_DB_USER", + "password": "$NODEBB_DB_PASSWORD" + } + } +} diff --git a/dockge/nodebb/docker-compose.yml b/dockge/nodebb/docker-compose.yml index 982164d12df4..430c01e62714 100644 --- a/dockge/nodebb/docker-compose.yml +++ b/dockge/nodebb/docker-compose.yml @@ -9,15 +9,6 @@ services: - .env environment: - TZ=Asia/Shanghai - - bind_address=0.0.0.0 - - port=4567 - - url=http://127.0.0.1:4567 - - database=${NODEBB_DB} - - ${NODEBB_DB}__host=${NODEBB_DB_HOST} - - ${NODEBB_DB}__port=${NODEBB_DB_PORT} - - ${NODEBB_DB}__database=${NODEBB_DB_NAME} - - ${NODEBB_DB}__username=${NODEBB_DB_USER} - - ${NODEBB_DB}__password=${NODEBB_DB_PASSWORD} image: ghcr.io/nodebb/nodebb:3.12.2 labels: createdBy: Apps @@ -31,3 +22,4 @@ services: - ${NODEBB_ROOT_PATH}/build:/usr/src/app/build - ${NODEBB_ROOT_PATH}/uploads:/usr/src/app/public/uploads - ${NODEBB_ROOT_PATH}/config:/opt/config + - ${NODEBB_ROOT_PATH}/setup.json:/usr/src/app/setup.json