Specify the bind port directly

It's not a secret, and this will make it possible to use the
address/interface configured in the host configuration.
This commit is contained in:
Eli Ribble 2025-10-14 03:16:15 +00:00
parent 010cabfe14
commit d739394ae2
2 changed files with 8 additions and 3 deletions

View file

@ -4,7 +4,9 @@ let
group = "frps";
user = "frps";
in {
options.myModules.frps.enable = mkEnableOption "custom frps configuration";
options.myModules.frps = {
enable = mkEnableOption "custom frps configuration";
};
config = mkIf config.myModules.frps.enable {
environment = {
etc."frps.toml".source = "${configFiles}/frps/frps.toml";
@ -24,11 +26,15 @@ in {
systemd.services.frps = {
after=["network.target" "network-online.target"];
description="FRP server process";
environment = {
FRPS_BIND_PORT="7000";
FRPS_VHOST_HTTP_PORT="8000";
};
requires=["network-online.target"];
restartIfChanged = true;
stopIfChanged = true;
serviceConfig = {
EnvironmentFile="/var/run/secrets/frps-env";
EnvironmentFile = "/var/run/secrets/frps-env";
Type = "simple";
User = "${user}";
Group = "${group}";