mirror of
https://github.com/QYG2297248353/appstore-1panel.git
synced 2026-06-16 01:02:14 +08:00
完善配置
This commit is contained in:
@@ -1,33 +0,0 @@
|
|||||||
additionalProperties:
|
|
||||||
formFields:
|
|
||||||
- default: "host"
|
|
||||||
edit: true
|
|
||||||
envKey: NETWORK_MODE
|
|
||||||
labelZh: 网络模式
|
|
||||||
labelEn: Network mode
|
|
||||||
required: true
|
|
||||||
type: select
|
|
||||||
values:
|
|
||||||
- label: 主机网络模式
|
|
||||||
value: "host"
|
|
||||||
- label: 桥接网络模式
|
|
||||||
value: "bridge"
|
|
||||||
- label: 无网络模式
|
|
||||||
value: "none"
|
|
||||||
- label: 1panel-network
|
|
||||||
value: "1panel-network"
|
|
||||||
- default: "/home/lucky"
|
|
||||||
edit: true
|
|
||||||
envKey: LUCKY_ROOT_PATH
|
|
||||||
labelZh: 数据持久化路径
|
|
||||||
labelEn: Data persistence path
|
|
||||||
required: true
|
|
||||||
type: text
|
|
||||||
- default: 16601
|
|
||||||
edit: true
|
|
||||||
envKey: PANEL_APP_PORT_HTTP
|
|
||||||
labelZh: WebUI 端口
|
|
||||||
labelEn: WebUI port
|
|
||||||
required: true
|
|
||||||
rule: paramPort
|
|
||||||
type: number
|
|
||||||
@@ -1,23 +0,0 @@
|
|||||||
networks:
|
|
||||||
1panel-network:
|
|
||||||
external: true
|
|
||||||
|
|
||||||
services:
|
|
||||||
lucky:
|
|
||||||
image: gdy666/lucky:2.27.2
|
|
||||||
container_name: ${CONTAINER_NAME}
|
|
||||||
labels:
|
|
||||||
createdBy: "Apps"
|
|
||||||
restart: always
|
|
||||||
network_mode: ${NETWORK_MODE:-host}
|
|
||||||
ports:
|
|
||||||
- ${PANEL_APP_PORT_HTTP}:${PANEL_APP_PORT_HTTP}
|
|
||||||
env_file:
|
|
||||||
- ${GLOBAL_ENV_FILE:-/etc/1panel/envs/global.env}
|
|
||||||
- ${ENV_FILE:-/etc/1panel/envs/default.env}
|
|
||||||
volumes:
|
|
||||||
- ./run/start.sh:/goodluck/start.sh:ro
|
|
||||||
- ${LUCKY_ROOT_PATH}/data:/goodluck
|
|
||||||
environment:
|
|
||||||
- TZ=Asia/Shanghai
|
|
||||||
entrypoint: [ "/goodluck/start.sh" ]
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
# copyright© 2024 XinJiang Ms Studio
|
|
||||||
ENV_FILE=.env
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
# copyright© 2024 XinJiang Ms Studio
|
|
||||||
TZ=Asia/Shanghai
|
|
||||||
@@ -1,50 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
DEFAULT_PORT=16601
|
|
||||||
PORT_FILE="/goodluck/port"
|
|
||||||
WAIT_SECONDS=30
|
|
||||||
|
|
||||||
if [ -f "$PORT_FILE" ]; then
|
|
||||||
DETECT_PORT=$(cat "$PORT_FILE")
|
|
||||||
echo "Loaded last port: ${DETECT_PORT}"
|
|
||||||
else
|
|
||||||
DETECT_PORT=$DEFAULT_PORT
|
|
||||||
echo "No previous port found, using default port: ${DETECT_PORT}"
|
|
||||||
fi
|
|
||||||
|
|
||||||
/app/lucky -c /goodluck/lucky.conf -runInDocker &
|
|
||||||
MAIN_PID=$!
|
|
||||||
|
|
||||||
echo "Lucky main started with PID $MAIN_PID"
|
|
||||||
|
|
||||||
echo "Waiting for lucky to listen on port ${DETECT_PORT} (timeout ${WAIT_SECONDS}s)..."
|
|
||||||
SECONDS_WAITED=0
|
|
||||||
while ! nc -z 127.0.0.1 "${DETECT_PORT}" 2>/dev/null; do
|
|
||||||
sleep 1
|
|
||||||
SECONDS_WAITED=$((SECONDS_WAITED + 1))
|
|
||||||
|
|
||||||
if [ "$SECONDS_WAITED" -ge "$WAIT_SECONDS" ]; then
|
|
||||||
echo "Timeout waiting for port ${DETECT_PORT}, continue startup..."
|
|
||||||
break
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
|
|
||||||
if nc -z 127.0.0.1 "${DETECT_PORT}" 2>/dev/null; then
|
|
||||||
echo "Port ${DETECT_PORT} is up."
|
|
||||||
else
|
|
||||||
echo "Port ${DETECT_PORT} still not open, continuing anyway."
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "Running: /app/lucky -rSetHttpAdminPort=${PANEL_APP_PORT_HTTP}"
|
|
||||||
/app/lucky -rSetHttpAdminPort="${PANEL_APP_PORT_HTTP}"
|
|
||||||
|
|
||||||
echo "Running: /app/lucky -rSetHttpsAdminPort=${PANEL_APP_PORT_HTTP}"
|
|
||||||
/app/lucky -rSetHttpsAdminPort="${PANEL_APP_PORT_HTTP}"
|
|
||||||
|
|
||||||
DIR=$(dirname "$PORT_FILE")
|
|
||||||
mkdir -p "$DIR"
|
|
||||||
|
|
||||||
echo "${PANEL_APP_PORT_HTTP}" > "$PORT_FILE"
|
|
||||||
echo "Saved admin port ${PANEL_APP_PORT_HTTP} to ${PORT_FILE}"
|
|
||||||
|
|
||||||
wait $MAIN_PID
|
|
||||||
@@ -1,20 +0,0 @@
|
|||||||
#!/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
|
|
||||||
|
|
||||||
# setup-2 update start.sh permission
|
|
||||||
chmod +x ./run/start.sh
|
|
||||||
|
|
||||||
echo "Check Finish."
|
|
||||||
|
|
||||||
else
|
|
||||||
echo "Error: .env file not found."
|
|
||||||
fi
|
|
||||||
@@ -1,10 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
if [ -f .env ]; then
|
|
||||||
source .env
|
|
||||||
|
|
||||||
echo "Check Finish."
|
|
||||||
|
|
||||||
else
|
|
||||||
echo "Error: .env file not found."
|
|
||||||
fi
|
|
||||||
@@ -1,20 +0,0 @@
|
|||||||
#!/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
|
|
||||||
|
|
||||||
# setup-2 update start.sh permission
|
|
||||||
chmod +x ./run/start.sh
|
|
||||||
|
|
||||||
echo "Check Finish."
|
|
||||||
|
|
||||||
else
|
|
||||||
echo "Error: .env file not found."
|
|
||||||
fi
|
|
||||||
Reference in New Issue
Block a user