feat: add the frpc role #43
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "feat/frpc-role"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What changes
roles/frpc: the frp client, the counterpart of thefrpsrole. The releasearchive is pinned and checked by sha256 (the same archive as the server role),
the client binary goes to
/usr/local/bin/frpc, and the whole configuration isthe
frpc_configmapping rendered as YAML to/etc/frp/frpc.yaml, the way theserver role handles
frps_config.The rendered file is checked with
frpc verifybefore the handler restarts theservice, and the role refuses to run without
serverAddr, without the servertoken under
auth.method: token, and without at least oneproxiesorvisitorsentry — a client with neither does nothing.The unit runs the client as a dedicated
frpaccount with a hardened unit; theclient only dials out and listens on no port, so it needs no capability.
Why
The server role covers the relay; a declared client makes the other end of the
tunnel reproducible instead of a hand-written config on each host behind NAT.
Both roles stay host-independent (
adr/role.md): addresses, secrets and thepublished proxies come from
host_vars.This is a separate branch from the open server PR: the two roles do not touch
the same files, so they merge in either order.
Verification
frpc verify -c frpc.yamlaccepts the rendered file (syntax is ok).allowPorts: 33901-33999, a localHTTP server on
:33950, the rendered client config publishing it asremotePort: 33901withtransport.tls.enable: true. The client logged in,registered the proxy, and
curl http://127.0.0.1:33901/answered 200 throughthe tunnel; the dashboard reported one client.
systemd-analyze verifyaccepts the unit (it only reports the missing/usr/local/bin/frpc, which the role installs).--syntax-checkof a playbook that includes the role passes.Superseded by #42: the frpc role is now part of the combined frps/frpc PR.
Pull request closed