Skip to content

Commit

Permalink
v9.9
Browse files Browse the repository at this point in the history
DietPi-Software | frp - switch from ini to toml configuration file
  • Loading branch information
Joulinar committed Nov 27, 2024
1 parent c2eebda commit d13e61c
Showing 1 changed file with 24 additions and 24 deletions.
48 changes: 24 additions & 24 deletions dietpi/dietpi-software
Original file line number Diff line number Diff line change
Expand Up @@ -6556,7 +6556,7 @@ StartLimitBurst=3
[Service]
User=frp
AmbientCapabilities=CAP_NET_BIND_SERVICE
ExecStart=/usr/local/bin/frps -c /etc/frp/frps.ini
ExecStart=/usr/local/bin/frps -c /etc/frp/frps.toml
Restart=on-failure
RestartSec=5s

Expand All @@ -6565,19 +6565,19 @@ WantedBy=multi-user.target
_EOF_
# Pre-create config file to turn on dashboard
token=$(openssl rand -hex 15)
[[ -f '/etc/frp/frps.ini' ]] || cat << _EOF_ > /etc/frp/frps.ini
[common]
bind_port = 7000
[[ -f '/etc/frp/frps.toml' ]] || cat << _EOF_ > /etc/frp/frps.toml
bindPort = 7000

dashboard_port = 7500
dashboard_user = admin
dashboard_pwd = $GLOBAL_PW
webServer.addr = "0.0.0.0"
webServer.port = 7500
webServer.user = "admin"
webServer.password = "$GLOBAL_PW"

authentication_method = token
token = $token
auth.method = "token"
auth.token = "$token"
_EOF_
G_EXEC chmod 0640 /etc/frp/frps.ini
G_EXEC chown root:frp /etc/frp/frps.ini
G_EXEC chmod 0640 /etc/frp/frps.toml
G_EXEC chown root:frp /etc/frp/frps.toml
aENABLE_SERVICES+=('frps')
fi

Expand All @@ -6594,8 +6594,8 @@ StartLimitBurst=3

[Service]
User=frp
ExecStart=/usr/local/bin/frpc -c /etc/frp/frpc.ini
ExecReload=/usr/local/bin/frpc reload -c /etc/frp/frpc.ini
ExecStart=/usr/local/bin/frpc -c /etc/frp/frpc.toml
ExecReload=/usr/local/bin/frpc reload -c /etc/frp/frpc.toml
Restart=on-failure
RestartSec=5s

Expand Down Expand Up @@ -6632,20 +6632,20 @@ _EOF_
fi

# Pre-create config file to turn on admin UI
[[ -f '/etc/frp/frpc.ini' ]] || cat << _EOF_ > /etc/frp/frpc.ini
[common]
server_addr = $server_addr
server_port = $server_port
[[ -f '/etc/frp/frpc.toml' ]] || cat << _EOF_ > /etc/frp/frpc.toml
serverAddr = "$server_addr"
serverPort = $server_port

admin_addr = 0.0.0.0
admin_port = 7400
admin_user = admin
admin_pwd = $GLOBAL_PW
webServer.addr = "0.0.0.0"
webServer.port = 7400
webServer.user = "admin"
webServer.password = "$GLOBAL_PW"

token = $token
auth.method = "token"
auth.token = "$token"
_EOF_
G_EXEC chmod 0660 /etc/frp/frpc.ini
G_EXEC chown root:frp /etc/frp/frpc.ini
G_EXEC chmod 0660 /etc/frp/frpc.toml
G_EXEC chown root:frp /etc/frp/frpc.toml
aENABLE_SERVICES+=('frpc')
fi

Expand Down

0 comments on commit d13e61c

Please sign in to comment.