feat: frp 应用增加参数

This commit is contained in:
zhengkunwang223 2023-10-18 17:28:28 +08:00
parent 048e805efb
commit d914ff210d
8 changed files with 93 additions and 22 deletions

View File

@ -1,9 +1,34 @@
additionalProperties: additionalProperties:
formFields: formFields:
- default: 6000 - default: 127.0.0.1
disabled: true envKey: SERVER_ADDRESS
envKey: PANEL_APP_PORT_HTTP labelEn: Server Address
labelEn: Port labelZh: 服务端IP
labelZh: 端口 required: true
type: text
- default: 7000
envKey: SERVER_PORT
labelEn: Server Port
labelZh: 服务端端口
required: true required: true
type: number 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

View File

@ -1,9 +1,8 @@
serverAddr = "0.0.0.0" serverAddr = "0.0.0.0"
serverPort = 7000 serverPort = 7000
[[proxies]] webServer.addr = "0.0.0.0"
name = "ssh" webServer.port = 40001
type = "tcp" webServer.user = "admin"
localIP = "127.0.0.1" webServer.password = "password123456"
localPort = 22 webServer.pprofEnable = false
remotePort = 6001

View File

@ -3,9 +3,10 @@ services:
frpc: frpc:
container_name: ${CONTAINER_NAME} container_name: ${CONTAINER_NAME}
restart: always restart: always
network_mode: "host" network_mode: host
volumes: volumes:
- "./data/frpc.toml:/etc/frp/frpc.toml" - ./data/frpc.toml:/etc/frp/frpc.toml
image: "snowdreamtech/frpc:0.52.1" image: snowdreamtech/frpc:0.52.1
labels: labels:
createdBy: "Apps" createdBy: "Apps"

View File

@ -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

View File

@ -1,9 +1,28 @@
additionalProperties: additionalProperties:
formFields: formFields:
- default: 7000 - default: 7000
disabled: true envKey: PANEL_APP_PORT_SERVICE
envKey: PANEL_APP_PORT_HTTP labelEn: Service Port
labelEn: Port labelZh: 服务端口
labelZh: 端口
required: true required: true
type: number 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

View File

@ -1 +1,6 @@
bindPort = 7000 bindPort = 7000
webServer.addr = "0.0.0.0"
webServer.port = 7500
webServer.user = "admin"
webServer.password = "admin"

View File

@ -3,9 +3,9 @@ services:
frps: frps:
container_name: ${CONTAINER_NAME} container_name: ${CONTAINER_NAME}
restart: always restart: always
network_mode: "host" network_mode: host
volumes: volumes:
- "./data/frps.toml:/etc/frp/frps.toml" - ./data/frps.toml:/etc/frp/frps.toml
image: "snowdreamtech/frps:0.52.1" image: snowdreamtech/frps:0.52.1
labels: labels:
createdBy: "Apps" createdBy: "Apps"

View File

@ -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