setup frpc
This commit is contained in:
parent
efaa629254
commit
ec16a3c494
3 changed files with 27 additions and 0 deletions
|
@ -1,3 +1,4 @@
|
|||
{...}: {
|
||||
imports = [./frpc.nix];
|
||||
services.openssh.enable = true;
|
||||
}
|
||||
|
|
26
hosts/rico2/services/frpc.nix
Normal file
26
hosts/rico2/services/frpc.nix
Normal file
|
@ -0,0 +1,26 @@
|
|||
{pkgs, ...}: let
|
||||
frp_config = (import ../../../secrets.nix).frp_config;
|
||||
in {
|
||||
systemd.services.frpc = {
|
||||
enable = true;
|
||||
description = "FRP Client";
|
||||
wantedBy = ["multi-user.target"];
|
||||
requires = ["network.target"];
|
||||
path = [
|
||||
pkgs.frp
|
||||
];
|
||||
script = "frpc -c /etc/frp/frpc.ini";
|
||||
};
|
||||
environment.etc."frp/frpc.ini".text = ''
|
||||
[common]
|
||||
server_addr = "${frp_config.ip}"
|
||||
server_port = 7000
|
||||
authentication_method = token
|
||||
token = "${frp_config.token}"
|
||||
|
||||
[ssh.rico2]
|
||||
type = tcp
|
||||
local_port = 22
|
||||
remote_port = 6002
|
||||
'';
|
||||
}
|
BIN
secrets.nix
BIN
secrets.nix
Binary file not shown.
Loading…
Reference in a new issue