diff --git a/app-list.png b/app-list.png index a0bbaf75..4c5f034e 100644 Binary files a/app-list.png and b/app-list.png differ diff --git a/apps/safeline/2.4.0/.env.sample b/apps/safeline/2.4.0/.env.sample index 8e6b293b..e6562adb 100644 --- a/apps/safeline/2.4.0/.env.sample +++ b/apps/safeline/2.4.0/.env.sample @@ -1,10 +1,7 @@ CONTAINER_NAME="safeline" -MGT_PORT="40080" -POSTGRES_DB="safeline" -POSTGRES_HOST="postgres" +PANEL_APP_PORT_HTTP="40080" +PANEL_APP_PORT_HTTP2="40081" POSTGRES_PASSWORD="password_xxJdZD" -POSTGRES_PORT="5432" -POSTGRES_USER="postgresql" REDIS_HOST="redis" REDIS_PASSWORD="" REDIS_PORT="6379" diff --git a/apps/safeline/2.4.0/data.yml b/apps/safeline/2.4.0/data.yml index 29ec2c05..54485054 100644 --- a/apps/safeline/2.4.0/data.yml +++ b/apps/safeline/2.4.0/data.yml @@ -24,38 +24,6 @@ additionalProperties: required: true rule: paramCommon type: password - - default: "" - edit: true - envKey: POSTGRES_HOST - key: postgresql - labelEn: Postgres database Service - labelZh: Postgres数据库服务 - required: true - type: service - - default: "5432" - edit: true - envKey: POSTGRES_PORT - labelEn: Postgres database Service Port - labelZh: Postgres数据库服务端口 - required: true - rule: paramPort - type: number - - default: safeline - edit: true - envKey: POSTGRES_DB - labelEn: Postgres database Name - labelZh: Postgres数据库名 - required: true - rule: paramCommon - type: text - - default: "" - edit: true - envKey: POSTGRES_USER - labelEn: Postgres database User Name - labelZh: Postgres数据库用户名 - required: true - rule: paramCommon - type: text - default: "" edit: true envKey: POSTGRES_PASSWORD @@ -72,6 +40,14 @@ additionalProperties: required: true rule: paramPort type: number + - default: 40081 + edit: true + envKey: PANEL_APP_PORT_HTTP2 + labelEn: Detector Port + labelZh: Detector端口 + required: true + rule: paramPort + type: number - default: ./data edit: true envKey: SAFELINE_DIR @@ -79,8 +55,8 @@ additionalProperties: labelZh: 数据存放文件夹 required: true type: text - - default: 169.254.0 - edit: true + - default: 172.18.0 + edit: false envKey: SUBNET_PREFIX labelEn: Subnet prefix labelZh: 子网前缀 diff --git a/apps/safeline/2.4.0/docker-compose.yml b/apps/safeline/2.4.0/docker-compose.yml index 2927e156..10059a05 100644 --- a/apps/safeline/2.4.0/docker-compose.yml +++ b/apps/safeline/2.4.0/docker-compose.yml @@ -1,11 +1,30 @@ version: '3' services: + safeline-postgres: + container_name: ${CONTAINER_NAME}-postgres + restart: always + networks: + 1panel-network: + ipv4_address: ${SUBNET_PREFIX}.232 + image: postgres:15.3 + volumes: + - ${SAFELINE_DIR}/resources/postgres/data:/var/lib/postgresql/data + - /etc/localtime:/etc/localtime:ro + environment: + - POSTGRES_USER=safeline-ce + - POSTGRES_PASSWORD=${POSTGRES_PASSWORD} + cap_drop: + - net_raw + command: [postgres, -c, max_connections=200] + labels: + createdBy: Apps + safeline-management: container_name: ${CONTAINER_NAME}-mgt-api restart: always networks: - safeline-ce: - ipv4_address: ${SUBNET_PREFIX}.4 + 1panel-network: + ipv4_address: ${SUBNET_PREFIX}.234 image: chaitin/safeline-mgt-api:2.4.0 volumes: - ${SAFELINE_DIR}/resources/management:/resources/management @@ -17,7 +36,7 @@ services: environment: - MANAGEMENT_RESOURCES_DIR=/resources/management - NGINX_RESOURCES_DIR=/resources/nginx - - DATABASE_URL=postgres://${POSTGRES_USER}:${POSTGRES_PASSWORD}@${POSTGRES_HOST}:${POSTGRES_PORT}/${POSTGRES_DB} + - DATABASE_URL=postgres://safeline-ce:${POSTGRES_PASSWORD}@safeline-postgres/safeline-ce - MARIO_URL=http://safeline-mario:3335 - DETECTOR_URL=http://safeline-detector:8001 - MANAGEMENT_LOGS_DIR=/logs/management @@ -30,13 +49,15 @@ services: container_name: ${CONTAINER_NAME}-detector restart: always networks: - safeline-ce: - ipv4_address: ${SUBNET_PREFIX}.5 + 1panel-network: + ipv4_address: ${SUBNET_PREFIX}.235 image: chaitin/safeline-detector:2.4.0 volumes: - ${SAFELINE_DIR}/resources/detector:/resources/detector - ${SAFELINE_DIR}/logs/detector:/logs/detector - /etc/localtime:/etc/localtime:ro + ports: + - ${PANEL_APP_PORT_HTTP2}:8000 environment: - LOG_DIR=/logs/detector cap_drop: @@ -48,8 +69,8 @@ services: container_name: ${CONTAINER_NAME}-mario restart: always networks: - safeline-ce: - ipv4_address: ${SUBNET_PREFIX}.6 + 1panel-network: + ipv4_address: ${SUBNET_PREFIX}.236 image: chaitin/safeline-mario:2.4.0 volumes: - ${SAFELINE_DIR}/resources/mario:/resources/mario @@ -58,7 +79,7 @@ services: environment: - LOG_DIR=/logs/mario - GOGC=100 - - DATABASE_URL=postgres://${POSTGRES_USER}:${POSTGRES_PASSWORD}@${POSTGRES_HOST}:${POSTGRES_PORT}/${POSTGRES_DB} + - DATABASE_URL=postgres://safeline-ce:${POSTGRES_PASSWORD}@safeline-postgres/safeline-ce - REDIS_URL=redis://:${REDIS_PASSWORD}@${REDIS_HOST}:${REDIS_PORT}/0 cap_drop: - net_raw @@ -78,7 +99,7 @@ services: - ${SAFELINE_DIR}/resources/cache:/usr/local/nginx/cache - /etc/resolv.conf:/etc/resolv.conf environment: - - MGT_ADDR=${SUBNET_PREFIX}.4:9002 + - MGT_ADDR=${SUBNET_PREFIX}.234:9002 ulimits: nofile: 131072 network_mode: host @@ -86,13 +107,5 @@ services: createdBy: Apps networks: - safeline-ce: - name: safeline-ce - driver: bridge - ipam: - driver: default - config: - - gateway: ${SUBNET_PREFIX:?SUBNET_PREFIX required}.1 - subnet: ${SUBNET_PREFIX}.0/24 - driver_opts: - com.docker.network.bridge.name: safeline-ce \ No newline at end of file + 1panel-network: + external: true \ No newline at end of file diff --git a/apps/safeline/latest-1p-network-bug/.env.sample b/apps/safeline/latest-1p-network-bug/.env.sample deleted file mode 100644 index baa2be42..00000000 --- a/apps/safeline/latest-1p-network-bug/.env.sample +++ /dev/null @@ -1,12 +0,0 @@ -CONTAINER_NAME="safeline" -MGT_PORT="40080" -POSTGRES_DB="safeline" -POSTGRES_HOST="postgres" -POSTGRES_PASSWORD="password_xxJdZD" -POSTGRES_PORT="5432" -POSTGRES_USER="postgresql" -REDIS_HOST="redis" -REDIS_PASSWORD="" -REDIS_PORT="6379" -SAFELINE_DIR="./data" -SUBNET_PREFIX="172.18.0" diff --git a/apps/safeline/latest-1p-network-bug/data.yml b/apps/safeline/latest-1p-network-bug/data.yml deleted file mode 100644 index aadbb33f..00000000 --- a/apps/safeline/latest-1p-network-bug/data.yml +++ /dev/null @@ -1,88 +0,0 @@ -additionalProperties: - formFields: - - default: "" - edit: true - envKey: REDIS_HOST - key: redis - labelEn: Redis Service - labelZh: Redis服务 - required: true - type: service - - default: "6379" - edit: true - envKey: REDIS_PORT - labelEn: Redis Service Port - labelZh: Redis服务端口 - required: true - rule: paramPort - type: number - - default: "" - edit: true - envKey: REDIS_PASSWORD - labelEn: Redis Service Password - labelZh: Redis服务密码 - required: true - rule: paramCommon - type: password - - default: "" - edit: true - envKey: POSTGRES_HOST - key: postgresql - labelEn: Postgres database Service - labelZh: Postgres数据库服务 - required: true - type: service - - default: "5432" - edit: true - envKey: POSTGRES_PORT - labelEn: Postgres database Service Port - labelZh: Postgres数据库服务端口 - required: true - rule: paramPort - type: number - - default: safeline - edit: true - envKey: POSTGRES_DB - labelEn: Postgres database Name - labelZh: Postgres数据库名 - required: true - rule: paramCommon - type: text - - default: "" - edit: true - envKey: POSTGRES_USER - labelEn: Postgres database User Name - labelZh: Postgres数据库用户名 - required: true - rule: paramCommon - type: text - - 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: false - envKey: SUBNET_PREFIX - labelEn: Subnet prefix - labelZh: 子网前缀 - required: true - type: text diff --git a/apps/safeline/latest-1p-network-bug/docker-compose.yml b/apps/safeline/latest-1p-network-bug/docker-compose.yml deleted file mode 100644 index 169c01f6..00000000 --- a/apps/safeline/latest-1p-network-bug/docker-compose.yml +++ /dev/null @@ -1,90 +0,0 @@ -version: '3' -services: - safeline-management: - container_name: ${CONTAINER_NAME}-mgt-api - restart: always - networks: - 1panel-network: - ipv4_address: ${SUBNET_PREFIX}.234 - image: chaitin/safeline-mgt-api:latest - volumes: - - ${SAFELINE_DIR}/resources/management:/resources/management - - ${SAFELINE_DIR}/resources/nginx:/resources/nginx - - ${SAFELINE_DIR}/logs:/logs - - /etc/localtime:/etc/localtime:ro - ports: - - ${PANEL_APP_PORT_HTTP:-9443}:1443 - environment: - - MANAGEMENT_RESOURCES_DIR=/resources/management - - NGINX_RESOURCES_DIR=/resources/nginx - - DATABASE_URL=postgres://${POSTGRES_USER}:${POSTGRES_PASSWORD}@${POSTGRES_HOST}:${POSTGRES_PORT}/${POSTGRES_DB} - - MARIO_URL=http://safeline-mario:3335 - - DETECTOR_URL=http://safeline-detector:8001 - - MANAGEMENT_LOGS_DIR=/logs/management - cap_drop: - - net_raw - labels: - createdBy: Apps - - safeline-detector: - container_name: ${CONTAINER_NAME}-detector - restart: always - networks: - 1panel-network: - ipv4_address: ${SUBNET_PREFIX}.235 - image: chaitin/safeline-detector:latest - volumes: - - ${SAFELINE_DIR}/resources/detector:/resources/detector - - ${SAFELINE_DIR}/logs/detector:/logs/detector - - /etc/localtime:/etc/localtime:ro - environment: - - LOG_DIR=/logs/detector - cap_drop: - - net_raw - labels: - createdBy: Apps - - safeline-mario: - container_name: ${CONTAINER_NAME}-mario - restart: always - networks: - 1panel-network: - ipv4_address: ${SUBNET_PREFIX}.236 - image: chaitin/safeline-mario:latest - volumes: - - ${SAFELINE_DIR}/resources/mario:/resources/mario - - ${SAFELINE_DIR}/logs/mario:/logs/mario - - /etc/localtime:/etc/localtime:ro - environment: - - LOG_DIR=/logs/mario - - GOGC=100 - - DATABASE_URL=postgres://${POSTGRES_USER}:${POSTGRES_PASSWORD}@${POSTGRES_HOST}:${POSTGRES_PORT}/${POSTGRES_DB} - - REDIS_URL=redis://:${REDIS_PASSWORD}@${REDIS_HOST}:${REDIS_PORT}/0 - cap_drop: - - net_raw - labels: - createdBy: Apps - - safeline-tengine: - container_name: ${CONTAINER_NAME}-tengine - restart: always - image: chaitin/safeline-tengine:latest - volumes: - - ${SAFELINE_DIR}/resources/nginx:/etc/nginx - - ${SAFELINE_DIR}/resources/management:/resources/management - - ${SAFELINE_DIR}/resources/detector:/resources/detector - - ${SAFELINE_DIR}/logs/nginx:/var/log/nginx - - /etc/localtime:/etc/localtime:ro - - ${SAFELINE_DIR}/resources/cache:/usr/local/nginx/cache - - /etc/resolv.conf:/etc/resolv.conf - environment: - - MGT_ADDR=${SUBNET_PREFIX}.234:9002 - ulimits: - nofile: 131072 - network_mode: host - labels: - createdBy: Apps - -networks: - 1panel-network: - external: true \ No newline at end of file diff --git a/apps/safeline/latest/.env.sample b/apps/safeline/latest/.env.sample index 8e6b293b..e6562adb 100644 --- a/apps/safeline/latest/.env.sample +++ b/apps/safeline/latest/.env.sample @@ -1,10 +1,7 @@ CONTAINER_NAME="safeline" -MGT_PORT="40080" -POSTGRES_DB="safeline" -POSTGRES_HOST="postgres" +PANEL_APP_PORT_HTTP="40080" +PANEL_APP_PORT_HTTP2="40081" POSTGRES_PASSWORD="password_xxJdZD" -POSTGRES_PORT="5432" -POSTGRES_USER="postgresql" REDIS_HOST="redis" REDIS_PASSWORD="" REDIS_PORT="6379" diff --git a/apps/safeline/latest/data.yml b/apps/safeline/latest/data.yml index 29ec2c05..54485054 100644 --- a/apps/safeline/latest/data.yml +++ b/apps/safeline/latest/data.yml @@ -24,38 +24,6 @@ additionalProperties: required: true rule: paramCommon type: password - - default: "" - edit: true - envKey: POSTGRES_HOST - key: postgresql - labelEn: Postgres database Service - labelZh: Postgres数据库服务 - required: true - type: service - - default: "5432" - edit: true - envKey: POSTGRES_PORT - labelEn: Postgres database Service Port - labelZh: Postgres数据库服务端口 - required: true - rule: paramPort - type: number - - default: safeline - edit: true - envKey: POSTGRES_DB - labelEn: Postgres database Name - labelZh: Postgres数据库名 - required: true - rule: paramCommon - type: text - - default: "" - edit: true - envKey: POSTGRES_USER - labelEn: Postgres database User Name - labelZh: Postgres数据库用户名 - required: true - rule: paramCommon - type: text - default: "" edit: true envKey: POSTGRES_PASSWORD @@ -72,6 +40,14 @@ additionalProperties: required: true rule: paramPort type: number + - default: 40081 + edit: true + envKey: PANEL_APP_PORT_HTTP2 + labelEn: Detector Port + labelZh: Detector端口 + required: true + rule: paramPort + type: number - default: ./data edit: true envKey: SAFELINE_DIR @@ -79,8 +55,8 @@ additionalProperties: labelZh: 数据存放文件夹 required: true type: text - - default: 169.254.0 - edit: true + - default: 172.18.0 + edit: false envKey: SUBNET_PREFIX labelEn: Subnet prefix labelZh: 子网前缀 diff --git a/apps/safeline/latest/docker-compose.yml b/apps/safeline/latest/docker-compose.yml index 437fae37..01e403f9 100644 --- a/apps/safeline/latest/docker-compose.yml +++ b/apps/safeline/latest/docker-compose.yml @@ -1,11 +1,30 @@ version: '3' services: + safeline-postgres: + container_name: ${CONTAINER_NAME}-postgres + restart: always + networks: + 1panel-network: + ipv4_address: ${SUBNET_PREFIX}.232 + image: postgres:15.3 + volumes: + - ${SAFELINE_DIR}/resources/postgres/data:/var/lib/postgresql/data + - /etc/localtime:/etc/localtime:ro + environment: + - POSTGRES_USER=safeline-ce + - POSTGRES_PASSWORD=${POSTGRES_PASSWORD} + cap_drop: + - net_raw + command: [postgres, -c, max_connections=200] + labels: + createdBy: Apps + safeline-management: container_name: ${CONTAINER_NAME}-mgt-api restart: always networks: - safeline-ce: - ipv4_address: ${SUBNET_PREFIX}.4 + 1panel-network: + ipv4_address: ${SUBNET_PREFIX}.234 image: chaitin/safeline-mgt-api:latest volumes: - ${SAFELINE_DIR}/resources/management:/resources/management @@ -17,7 +36,7 @@ services: environment: - MANAGEMENT_RESOURCES_DIR=/resources/management - NGINX_RESOURCES_DIR=/resources/nginx - - DATABASE_URL=postgres://${POSTGRES_USER}:${POSTGRES_PASSWORD}@${POSTGRES_HOST}:${POSTGRES_PORT}/${POSTGRES_DB} + - DATABASE_URL=postgres://safeline-ce:${POSTGRES_PASSWORD}@safeline-postgres/safeline-ce - MARIO_URL=http://safeline-mario:3335 - DETECTOR_URL=http://safeline-detector:8001 - MANAGEMENT_LOGS_DIR=/logs/management @@ -30,13 +49,15 @@ services: container_name: ${CONTAINER_NAME}-detector restart: always networks: - safeline-ce: - ipv4_address: ${SUBNET_PREFIX}.5 + 1panel-network: + ipv4_address: ${SUBNET_PREFIX}.235 image: chaitin/safeline-detector:latest volumes: - ${SAFELINE_DIR}/resources/detector:/resources/detector - ${SAFELINE_DIR}/logs/detector:/logs/detector - /etc/localtime:/etc/localtime:ro + ports: + - ${PANEL_APP_PORT_HTTP2}:8000 environment: - LOG_DIR=/logs/detector cap_drop: @@ -48,8 +69,8 @@ services: container_name: ${CONTAINER_NAME}-mario restart: always networks: - safeline-ce: - ipv4_address: ${SUBNET_PREFIX}.6 + 1panel-network: + ipv4_address: ${SUBNET_PREFIX}.236 image: chaitin/safeline-mario:latest volumes: - ${SAFELINE_DIR}/resources/mario:/resources/mario @@ -58,7 +79,7 @@ services: environment: - LOG_DIR=/logs/mario - GOGC=100 - - DATABASE_URL=postgres://${POSTGRES_USER}:${POSTGRES_PASSWORD}@${POSTGRES_HOST}:${POSTGRES_PORT}/${POSTGRES_DB} + - DATABASE_URL=postgres://safeline-ce:${POSTGRES_PASSWORD}@safeline-postgres/safeline-ce - REDIS_URL=redis://:${REDIS_PASSWORD}@${REDIS_HOST}:${REDIS_PORT}/0 cap_drop: - net_raw @@ -78,7 +99,7 @@ services: - ${SAFELINE_DIR}/resources/cache:/usr/local/nginx/cache - /etc/resolv.conf:/etc/resolv.conf environment: - - MGT_ADDR=${SUBNET_PREFIX}.4:9002 + - MGT_ADDR=${SUBNET_PREFIX}.234:9002 ulimits: nofile: 131072 network_mode: host @@ -86,13 +107,5 @@ services: createdBy: Apps networks: - safeline-ce: - name: safeline-ce - driver: bridge - ipam: - driver: default - config: - - gateway: ${SUBNET_PREFIX:?SUBNET_PREFIX required}.1 - subnet: ${SUBNET_PREFIX}.0/24 - driver_opts: - com.docker.network.bridge.name: safeline-ce \ No newline at end of file + 1panel-network: + external: true \ No newline at end of file