feat: add the frps and frpc roles and the relay host #42
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "feat/frps-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
inventory.ini: therelayhost atrelay.lan.host_vars/relay.yaml: the root login and the deploy key, plus the frp servertoken and the dashboard password, kept as vault values.
roles/frps: the frp server. The release archive of frp v0.72.0 is pinned andchecked by sha256 (the release ships the whole toolkit, so the role installs
frpsout of it), the configuration is/etc/frp/frps.yaml, and the serviceruns as a dedicated
frpaccount with a hardened unit. The dashboard isserved on port 80.
roles/frpc: the frp client. The same pinned archive, the client binary at/usr/local/bin/frpc, and thefrpc_configmapping rendered as YAML to/etc/frp/frpc.yaml. The rendered file is checked withfrpc verifybeforethe handler restarts the service, and the role requires
serverAddr, theserver token under
auth.method: token, and at least one proxy or visitor.playbooks/relay.yaml:bash,profile,sshandfrpsfor the host.Both roles are host-independent (
adr/role.md): addresses, secrets and thepublished proxies come from
host_vars. The two roles do not touch the samefiles, so they merge in either order.
Why
The relay host joins the inventory before it runs anything, so the role is in
place for the first converge. 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.
Verification
ansible-playbook playbooks/relay.yaml --syntax-checkpasses; both secretsdecrypt and resolve through
host_vars.frps verify -c frps.yaml→the configuration file ... syntax is ok.*:7000and127.0.0.1:7500;/api/serverinfoanswers 401 without the dashboardcredentials and 200 with them.
frpc verify -c frpc.yamlaccepts the rendered file.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 both units (it only reports thenot-yet-installed
/usr/local/bin/frpsand/usr/local/bin/frpc).feat: add the frps role and the sunduk hostto feat: add the frps and frpc roles and the relay host