Skip to content

fix: update frpc config#8548

Merged
wanghe-fit2cloud merged 1 commit into
1Panel-dev:devfrom
520svip:pr/frpc-20260711
Jul 12, 2026
Merged

fix: update frpc config#8548
wanghe-fit2cloud merged 1 commit into
1Panel-dev:devfrom
520svip:pr/frpc-20260711

Conversation

@520svip

@520svip 520svip commented Jul 11, 2026

Copy link
Copy Markdown
Contributor

SUMMARY

  • Add two form fields in apps/frpc/0.69.1/data.yml:
    • ENABLE_VIRTUAL_NET (select toggle: enable / disable, default disabled) — whether to enable frpc VirtualNet feature
    • VIRTUAL_NET_IP (text, default 10.0.0.1/24) — CIDR address for the virtual network interface
  • Add the commented-out VirtualNet config block in apps/frpc/0.69.1/data/frpc.toml:
    • # featureGates = { VirtualNet = true }
    • # virtualNet.address = "10.10.10.10/24"
  • Grant the capabilities required by VirtualNet to the frpc service in apps/frpc/0.69.1/docker-compose.yml:
    • cap_add: NET_ADMIN
    • devices: "/dev/net/tun:/dev/net/tun"
  • Add VirtualNet handling in apps/frpc/0.69.1/scripts/init.sh:
    • On the host side, run modprobe tun (silent, failure-tolerant) and check whether the /dev/net/tun character device exists, warning if missing
    • When ENABLE_VIRTUAL_NET=true: validate that VIRTUAL_NET_IP is non-empty and a valid CIDR (format IPv4/0-32 with each octet 0–255), then uncomment featureGates and virtualNet.address and write them into frpc.toml

VALIDATION

  • Verify the two new fields in data.yml render correctly in the 1Panel install / modify-parameters form (toggle + text input)
  • Verify the sed replacements in init.sh correctly uncomment the VirtualNet config block when enabled
  • Verify the cap_add and devices mapping syntax in docker-compose.yml is correct
  • Verify the modprobe tun and /dev/net/tun device-check logic executes normally as root on the host

NOTES

  • init.sh runs on the host as root during install / rebuild; modifying parameters and saving alone does not re-run this script — a rebuild is required for the config to take effect
  • VirtualNet depends on the host having the tun kernel module; on some minimal-kernel hosts it may need to be loaded manually
  • The VirtualNet config in data/frpc.toml is commented out by default and is only activated by init.sh when the switch is enabled

(cherry picked from commit 57c924b)
@wanghe-fit2cloud wanghe-fit2cloud merged commit f849fd4 into 1Panel-dev:dev Jul 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants