From d914ff210d0134f8e5bd554569bd9cbf7075024f Mon Sep 17 00:00:00 2001 From: zhengkunwang223 Date: Wed, 18 Oct 2023 17:28:28 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20frp=20=E5=BA=94=E7=94=A8=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/frpc/0.52.1/data.yml | 35 ++++++++++++++++++++++++----- apps/frpc/0.52.1/data/frpc.toml | 11 +++++---- apps/frpc/0.52.1/docker-compose.yml | 7 +++--- apps/frpc/0.52.1/script/init.sh | 11 +++++++++ apps/frps/0.52.1/data.yml | 27 ++++++++++++++++++---- apps/frps/0.52.1/data/frps.toml | 7 +++++- apps/frps/0.52.1/docker-compose.yml | 6 ++--- apps/frps/0.52.1/scripts/init.sh | 11 +++++++++ 8 files changed, 93 insertions(+), 22 deletions(-) create mode 100644 apps/frpc/0.52.1/script/init.sh create mode 100644 apps/frps/0.52.1/scripts/init.sh diff --git a/apps/frpc/0.52.1/data.yml b/apps/frpc/0.52.1/data.yml index 7bf7be4f..2c9a57aa 100644 --- a/apps/frpc/0.52.1/data.yml +++ b/apps/frpc/0.52.1/data.yml @@ -1,9 +1,34 @@ additionalProperties: formFields: - - default: 6000 - disabled: true - envKey: PANEL_APP_PORT_HTTP - labelEn: Port - labelZh: 端口 + - default: 127.0.0.1 + envKey: SERVER_ADDRESS + labelEn: Server Address + labelZh: 服务端IP + required: true + type: text + - default: 7000 + envKey: SERVER_PORT + labelEn: Server Port + labelZh: 服务端端口 required: true type: number + - default: 7400 + envKey: PANEL_APP_PORT_HTTP + labelEn: Dashboard Port + labelZh: Dashboard 端口 + required: true + type: number + - default: admin + envKey: USER_NAME + labelEn: Dashboard Username + labelZh: Dashboard 用户名 + required: true + type: text + - default: admin + envKey: PASSWORD + labelEn: Dashboard Password + labelZh: Dashboard 密码 + required: true + random: true + rule: paramComplexity + type: password \ No newline at end of file diff --git a/apps/frpc/0.52.1/data/frpc.toml b/apps/frpc/0.52.1/data/frpc.toml index 366bd33c..3d6f6806 100644 --- a/apps/frpc/0.52.1/data/frpc.toml +++ b/apps/frpc/0.52.1/data/frpc.toml @@ -1,9 +1,8 @@ serverAddr = "0.0.0.0" serverPort = 7000 -[[proxies]] -name = "ssh" -type = "tcp" -localIP = "127.0.0.1" -localPort = 22 -remotePort = 6001 +webServer.addr = "0.0.0.0" +webServer.port = 40001 +webServer.user = "admin" +webServer.password = "password123456" +webServer.pprofEnable = false diff --git a/apps/frpc/0.52.1/docker-compose.yml b/apps/frpc/0.52.1/docker-compose.yml index a5dfc7d9..219dcc11 100644 --- a/apps/frpc/0.52.1/docker-compose.yml +++ b/apps/frpc/0.52.1/docker-compose.yml @@ -3,9 +3,10 @@ services: frpc: container_name: ${CONTAINER_NAME} restart: always - network_mode: "host" + network_mode: host volumes: - - "./data/frpc.toml:/etc/frp/frpc.toml" - image: "snowdreamtech/frpc:0.52.1" + - ./data/frpc.toml:/etc/frp/frpc.toml + image: snowdreamtech/frpc:0.52.1 labels: createdBy: "Apps" + diff --git a/apps/frpc/0.52.1/script/init.sh b/apps/frpc/0.52.1/script/init.sh new file mode 100644 index 00000000..ae439481 --- /dev/null +++ b/apps/frpc/0.52.1/script/init.sh @@ -0,0 +1,11 @@ +#!/bin/bash + +source .env + +sed -i "s/serverAddr = \".*\"/serverAddr = \"${SERVER_ADDRESS}\"/" ./data/frpc.toml +sed -i "s/serverPort = .*$/serverPort = ${SERVER_PORT}/" ./data/frpc.toml +sed -i "s/webServer\.addr = \".*\"/webServer.addr = \"${SERVER_ADDRESS}\"/" ./data/frpc.toml +sed -i "s/webServer\.port = .*$/webServer.port = ${PANEL_APP_PORT_HTTP}/" ./data/frpc.toml +sed -i "s/webServer\.user = \".*\"/webServer.user = \"${USER_NAME}\"/" ./data/frpc.toml +sed -i "s/webServer\.password = \".*\"/webServer.password = \"${PASSWORD}\"/" ./data/frpc.toml + diff --git a/apps/frps/0.52.1/data.yml b/apps/frps/0.52.1/data.yml index 0c009dbc..92049d06 100644 --- a/apps/frps/0.52.1/data.yml +++ b/apps/frps/0.52.1/data.yml @@ -1,9 +1,28 @@ additionalProperties: formFields: - default: 7000 - disabled: true - envKey: PANEL_APP_PORT_HTTP - labelEn: Port - labelZh: 端口 + envKey: PANEL_APP_PORT_SERVICE + labelEn: Service Port + labelZh: 服务端口 required: true type: number + - default: 7500 + envKey: PANEL_APP_PORT_HTTP + labelEn: Dashboard Port + labelZh: Dashboard 端口 + required: true + type: number + - default: admin + envKey: USER_NAME + labelEn: Username + labelZh: 用户名 + required: true + type: text + - default: admin + envKey: PASSWORD + labelEn: Password + labelZh: 密码 + required: true + random: true + rule: paramComplexity + type: password \ No newline at end of file diff --git a/apps/frps/0.52.1/data/frps.toml b/apps/frps/0.52.1/data/frps.toml index 82957d82..1c23779b 100644 --- a/apps/frps/0.52.1/data/frps.toml +++ b/apps/frps/0.52.1/data/frps.toml @@ -1 +1,6 @@ -bindPort = 7000 \ No newline at end of file +bindPort = 7000 + +webServer.addr = "0.0.0.0" +webServer.port = 7500 +webServer.user = "admin" +webServer.password = "admin" \ No newline at end of file diff --git a/apps/frps/0.52.1/docker-compose.yml b/apps/frps/0.52.1/docker-compose.yml index b8bdbf78..048a1421 100644 --- a/apps/frps/0.52.1/docker-compose.yml +++ b/apps/frps/0.52.1/docker-compose.yml @@ -3,9 +3,9 @@ services: frps: container_name: ${CONTAINER_NAME} restart: always - network_mode: "host" + network_mode: host volumes: - - "./data/frps.toml:/etc/frp/frps.toml" - image: "snowdreamtech/frps:0.52.1" + - ./data/frps.toml:/etc/frp/frps.toml + image: snowdreamtech/frps:0.52.1 labels: createdBy: "Apps" diff --git a/apps/frps/0.52.1/scripts/init.sh b/apps/frps/0.52.1/scripts/init.sh new file mode 100644 index 00000000..0e4de58a --- /dev/null +++ b/apps/frps/0.52.1/scripts/init.sh @@ -0,0 +1,11 @@ +#!/bin/bash + +source ./.env + +sed -i "s/bindPort = .*$/bindPort = ${PANEL_APP_PORT_SERVICE}/" ./data/frps.toml +sed -i "s/webServer\.port = .*$/webServer.port = ${PANEL_APP_PORT_HTTP}/" ./data/frps.toml +sed -i "s/webServer\.user = \".*\"/webServer.user = \"${USER_NAME}\"/" ./data/frps.toml +sed -i "s/webServer\.password = \".*\"/webServer.password = \"${PASSWORD}\"/" ./data/frps.toml + + +