From 9bdfd0bf0e8d863f09528642759f50989bda72e8 Mon Sep 17 00:00:00 2001 From: okxlin Date: Sat, 12 Aug 2023 19:20:42 +0800 Subject: [PATCH] =?UTF-8?q?feat:=E6=9B=B4=E6=96=B0=E9=95=BF=E4=BA=AD?= =?UTF-8?q?=E9=9B=B7=E6=B1=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/safeline/data.yml | 4 +- apps/safeline/newnet-2.6.0/.env.sample | 9 ++ apps/safeline/newnet-2.6.0/data.yml | 64 +++++++++ apps/safeline/newnet-2.6.0/docker-compose.yml | 123 ++++++++++++++++++ apps/safeline/newnet-latest/.env.sample | 9 ++ apps/safeline/newnet-latest/data.yml | 64 +++++++++ .../safeline/newnet-latest/docker-compose.yml | 123 ++++++++++++++++++ 7 files changed, 394 insertions(+), 2 deletions(-) create mode 100644 apps/safeline/newnet-2.6.0/.env.sample create mode 100644 apps/safeline/newnet-2.6.0/data.yml create mode 100644 apps/safeline/newnet-2.6.0/docker-compose.yml create mode 100644 apps/safeline/newnet-latest/.env.sample create mode 100644 apps/safeline/newnet-latest/data.yml create mode 100644 apps/safeline/newnet-latest/docker-compose.yml diff --git a/apps/safeline/data.yml b/apps/safeline/data.yml index 13dd5d37..1c60bbf1 100644 --- a/apps/safeline/data.yml +++ b/apps/safeline/data.yml @@ -1,4 +1,4 @@ -name: 雷池 +name: 雷池 safeline tags: - 工具 title: 一款足够简单、足够好用、足够强的免费 WAF @@ -6,7 +6,7 @@ type: 工具 description: 一款足够简单、足够好用、足够强的免费 WAF additionalProperties: key: safeline - name: 雷池 + name: 雷池 safeline tags: - Tool shortDescZh: 一款足够简单、足够好用、足够强的免费 WAF diff --git a/apps/safeline/newnet-2.6.0/.env.sample b/apps/safeline/newnet-2.6.0/.env.sample new file mode 100644 index 00000000..96bfbffa --- /dev/null +++ b/apps/safeline/newnet-2.6.0/.env.sample @@ -0,0 +1,9 @@ +CONTAINER_NAME="safeline" +PANEL_APP_PORT_HTTP="40080" +PANEL_APP_PORT_HTTP2="40081" +POSTGRES_PASSWORD="password_xxJdZD" +REDIS_HOST="redis" +REDIS_PASSWORD="" +REDIS_PORT="6379" +SAFELINE_DIR="./data" +SUBNET_PREFIX="169.254.0" \ No newline at end of file diff --git a/apps/safeline/newnet-2.6.0/data.yml b/apps/safeline/newnet-2.6.0/data.yml new file mode 100644 index 00000000..11e1b387 --- /dev/null +++ b/apps/safeline/newnet-2.6.0/data.yml @@ -0,0 +1,64 @@ +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_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: 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 + labelEn: Data storage folder + labelZh: 数据存放文件夹 + required: true + type: text + - default: 169.254.0 + edit: true + envKey: SUBNET_PREFIX + labelEn: Subnet prefix + labelZh: 子网前缀 + required: true + type: text \ No newline at end of file diff --git a/apps/safeline/newnet-2.6.0/docker-compose.yml b/apps/safeline/newnet-2.6.0/docker-compose.yml new file mode 100644 index 00000000..92e2a5b7 --- /dev/null +++ b/apps/safeline/newnet-2.6.0/docker-compose.yml @@ -0,0 +1,123 @@ +version: '3' +services: + safeline-postgres: + container_name: ${CONTAINER_NAME}-postgres + restart: always + networks: + 1panel-network: + safeline-ce: + ipv4_address: ${SUBNET_PREFIX}.2 + 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: + 1panel-network: + safeline-ce: + ipv4_address: ${SUBNET_PREFIX}.4 + image: chaitin/safeline-mgt-api:2.6.0 + 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://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 + cap_drop: + - net_raw + labels: + createdBy: Apps + + safeline-detector: + container_name: ${CONTAINER_NAME}-detector + restart: always + networks: + 1panel-network: + safeline-ce: + ipv4_address: ${SUBNET_PREFIX}.5 + image: chaitin/safeline-detector:2.6.0 + 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: + safeline-ce: + ipv4_address: ${SUBNET_PREFIX}.6 + image: chaitin/safeline-mario:2.6.0 + 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://safeline-ce:${POSTGRES_PASSWORD}@safeline-postgres/safeline-ce + - 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:2.6.0 + 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}.4:9002 + ulimits: + nofile: 131072 + network_mode: host + labels: + createdBy: Apps + +networks: + 1panel-network: + external: true + 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 diff --git a/apps/safeline/newnet-latest/.env.sample b/apps/safeline/newnet-latest/.env.sample new file mode 100644 index 00000000..96bfbffa --- /dev/null +++ b/apps/safeline/newnet-latest/.env.sample @@ -0,0 +1,9 @@ +CONTAINER_NAME="safeline" +PANEL_APP_PORT_HTTP="40080" +PANEL_APP_PORT_HTTP2="40081" +POSTGRES_PASSWORD="password_xxJdZD" +REDIS_HOST="redis" +REDIS_PASSWORD="" +REDIS_PORT="6379" +SAFELINE_DIR="./data" +SUBNET_PREFIX="169.254.0" \ No newline at end of file diff --git a/apps/safeline/newnet-latest/data.yml b/apps/safeline/newnet-latest/data.yml new file mode 100644 index 00000000..11e1b387 --- /dev/null +++ b/apps/safeline/newnet-latest/data.yml @@ -0,0 +1,64 @@ +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_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: 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 + labelEn: Data storage folder + labelZh: 数据存放文件夹 + required: true + type: text + - default: 169.254.0 + edit: true + envKey: SUBNET_PREFIX + labelEn: Subnet prefix + labelZh: 子网前缀 + required: true + type: text \ No newline at end of file diff --git a/apps/safeline/newnet-latest/docker-compose.yml b/apps/safeline/newnet-latest/docker-compose.yml new file mode 100644 index 00000000..810a4072 --- /dev/null +++ b/apps/safeline/newnet-latest/docker-compose.yml @@ -0,0 +1,123 @@ +version: '3' +services: + safeline-postgres: + container_name: ${CONTAINER_NAME}-postgres + restart: always + networks: + 1panel-network: + safeline-ce: + ipv4_address: ${SUBNET_PREFIX}.2 + 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: + 1panel-network: + safeline-ce: + ipv4_address: ${SUBNET_PREFIX}.4 + 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://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 + cap_drop: + - net_raw + labels: + createdBy: Apps + + safeline-detector: + container_name: ${CONTAINER_NAME}-detector + restart: always + networks: + 1panel-network: + safeline-ce: + ipv4_address: ${SUBNET_PREFIX}.5 + 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: + safeline-ce: + ipv4_address: ${SUBNET_PREFIX}.6 + 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://safeline-ce:${POSTGRES_PASSWORD}@safeline-postgres/safeline-ce + - 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}.4:9002 + ulimits: + nofile: 131072 + network_mode: host + labels: + createdBy: Apps + +networks: + 1panel-network: + external: true + 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