From 7d26e601d5a3cc317d36decc89130fc805da37d1 Mon Sep 17 00:00:00 2001 From: pooneyy <85266337+pooneyy@users.noreply.github.com> Date: Thu, 10 Jul 2025 16:53:28 +0800 Subject: [PATCH] Update SafeLine to v9 (major) --- apps/safeline/9.0.0/.env.sample | 5 + apps/safeline/9.0.0/data.yml | 32 ++++++ apps/safeline/9.0.0/docker-compose.yml | 145 +++++++++++++++++++++++++ 3 files changed, 182 insertions(+) create mode 100644 apps/safeline/9.0.0/.env.sample create mode 100644 apps/safeline/9.0.0/data.yml create mode 100644 apps/safeline/9.0.0/docker-compose.yml diff --git a/apps/safeline/9.0.0/.env.sample b/apps/safeline/9.0.0/.env.sample new file mode 100644 index 000000000..b7379d9d2 --- /dev/null +++ b/apps/safeline/9.0.0/.env.sample @@ -0,0 +1,5 @@ +CONTAINER_NAME="safeline" +PANEL_APP_PORT_HTTP="40080" +POSTGRES_PASSWORD="password_xxJdZD" +SAFELINE_DIR="./data" +SUBNET_PREFIX="172.18.0" diff --git a/apps/safeline/9.0.0/data.yml b/apps/safeline/9.0.0/data.yml new file mode 100644 index 000000000..77b259caa --- /dev/null +++ b/apps/safeline/9.0.0/data.yml @@ -0,0 +1,32 @@ +additionalProperties: + formFields: + - default: "" + edit: true + envKey: POSTGRES_PASSWORD + labelEn: Postgres database User Password + labelZh: Postgres数据库密码 + required: true + rule: paramCommon + type: password + - default: 40080 + edit: true + envKey: PANEL_APP_PORT_HTTP + labelEn: Port + labelZh: 端口 + required: true + rule: paramPort + type: number + - default: ./data + edit: true + envKey: SAFELINE_DIR + labelEn: Data storage folder + labelZh: 数据存放文件夹 + required: true + type: text + - default: 172.18.0 + edit: true + envKey: SUBNET_PREFIX + labelEn: 1panel-network subnet prefix (Check the docker network to get it) + labelZh: 1panel-network 子网前缀 (查看docker网络获取) + required: true + type: text diff --git a/apps/safeline/9.0.0/docker-compose.yml b/apps/safeline/9.0.0/docker-compose.yml new file mode 100644 index 000000000..2fb593513 --- /dev/null +++ b/apps/safeline/9.0.0/docker-compose.yml @@ -0,0 +1,145 @@ +services: + safeline-mgt: + container_name: ${CONTAINER_NAME}-mgt + restart: always + networks: + 1panel-network: + ipv4_address: ${SUBNET_PREFIX}.234 + image: chaitin/safeline-mgt:9.0.0 + volumes: + - /etc/localtime:/etc/localtime:ro + - ${SAFELINE_DIR}/resources/mgt:/app/data + - ${SAFELINE_DIR}/logs/nginx:/app/log/nginx:z + - ${SAFELINE_DIR}/resources/sock:/app/sock + - /var/run:/app/run + ports: + - ${PANEL_APP_PORT_HTTP:-9443}:1443 + healthcheck: + test: curl -k -f https://localhost:1443/api/open/health + environment: + - MGT_PG=postgres://safeline-ce:${POSTGRES_PASSWORD}@safeline-pg/safeline-ce?sslmode=disable + logging: + options: + max-size: "100m" + max-file: "5" + depends_on: + - safeline-pg + - safeline-fvm + labels: + createdBy: Apps + + safeline-detector: + container_name: ${CONTAINER_NAME}-detector + restart: always + networks: + 1panel-network: + ipv4_address: ${SUBNET_PREFIX}.235 + image: chaitin/safeline-detector:9.0.0 + volumes: + - ${SAFELINE_DIR}/resources/detector:/resources/detector + - ${SAFELINE_DIR}/logs/detector:/logs/detector + - /etc/localtime:/etc/localtime:ro + environment: + - LOG_DIR=/logs/detector + labels: + createdBy: Apps + + safeline-tengine: + container_name: ${CONTAINER_NAME}-tengine + restart: always + image: chaitin/safeline-tengine:9.0.0 + volumes: + - /etc/localtime:/etc/localtime:ro + - /etc/resolv.conf:/etc/resolv.conf:ro + - ${SAFELINE_DIR}/resources/nginx:/etc/nginx + - ${SAFELINE_DIR}/resources/detector:/resources/detector + - ${SAFELINE_DIR}/resources/chaos:/resources/chaos + - ${SAFELINE_DIR}/logs/nginx:/var/log/nginx:z + - ${SAFELINE_DIR}/resources/cache:/usr/local/nginx/cache + - ${SAFELINE_DIR}/resources/sock:/app/sock + environment: + - TCD_MGT_API=https://${SUBNET_PREFIX}.234:1443/api/open/publish/server + - SNSERVER_ADDR=${SUBNET_PREFIX}.235:8000 + ulimits: + nofile: 131072 + network_mode: host + labels: + createdBy: Apps + + safeline-luigi: + container_name: ${CONTAINER_NAME}-luigi + restart: always + networks: + 1panel-network: + ipv4_address: ${SUBNET_PREFIX}.237 + image: chaitin/safeline-luigi:9.0.0 + volumes: + - /etc/localtime:/etc/localtime:ro + - ${SAFELINE_DIR}/resources/luigi:/app/data + environment: + - MGT_IP=${SUBNET_PREFIX}.234 + logging: + options: + max-size: "100m" + max-file: "5" + depends_on: + - safeline-detector + - safeline-mgt + labels: + createdBy: Apps + + safeline-fvm: + container_name: ${CONTAINER_NAME}-fvm + restart: always + networks: + 1panel-network: + ipv4_address: ${SUBNET_PREFIX}.238 + image: chaitin/safeline-fvm:9.0.0 + volumes: + - /etc/localtime:/etc/localtime:ro + logging: + options: + max-size: "100m" + max-file: "5" + labels: + createdBy: Apps + + safeline-pg: + container_name: ${CONTAINER_NAME}-pg + restart: always + networks: + 1panel-network: + ipv4_address: ${SUBNET_PREFIX}.232 + image: chaitin/safeline-postgres:15.2 + volumes: + - ${SAFELINE_DIR}/resources/postgres/data:/var/lib/postgresql/data + - /etc/localtime:/etc/localtime:ro + environment: + - POSTGRES_USER=safeline-ce + - POSTGRES_PASSWORD=${POSTGRES_PASSWORD} + command: [postgres, -c, max_connections=600] + healthcheck: + test: pg_isready -U safeline-ce -d safeline-ce + labels: + createdBy: Apps + + safeline-chaos: + container_name: ${CONTAINER_NAME}-chaos + restart: always + networks: + 1panel-network: + ipv4_address: ${SUBNET_PREFIX}.240 + image: chaitin/safeline-chaos:9.0.0 + logging: + options: + max-size: "100m" + max-file: "5" + volumes: + - ${SAFELINE_DIR}/resources/sock:/app/sock + - ${SAFELINE_DIR}/resources/chaos:/app/chaos + labels: + createdBy: Apps + +networks: + 1panel-network: + external: true \ No newline at end of file