边缘网关 + Agent 的端口中继:Agent 主动连出到网关,把内网目标挂到网关端口上; 通过邀请链接按设备授权,可选审批,首次连接起计时,到期、闲置自动收回。 - portrelay-server:边缘网关(端口池、白名单与授权租约、邀请与授权网页) - portrelay-agent:Agent(yamux 隧道、本地 API 与网页面板、流量统计) - mac-native:SwiftUI 菜单栏 App
31 lines
869 B
Desktop File
31 lines
869 B
Desktop File
[Unit]
|
|
Description=PortRelay edge gateway
|
|
Documentation=https://github.com/DeepFal/PortRelay
|
|
After=network-online.target
|
|
Wants=network-online.target
|
|
|
|
[Service]
|
|
# PORTRELAY_TOKEN 等配置写在这里(权限 0600),参考 portrelay-server.env.example
|
|
EnvironmentFile=/etc/portrelay-server.env
|
|
ExecStart=/usr/local/bin/portrelay-server -listen :33000 -port-min 33000 -port-max 34000 -state /var/lib/portrelay/leases.json $PORTRELAY_ARGS
|
|
Restart=always
|
|
RestartSec=3
|
|
LimitNOFILE=65536
|
|
|
|
# 以临时系统用户运行,状态保存在 /var/lib/portrelay
|
|
DynamicUser=yes
|
|
StateDirectory=portrelay
|
|
NoNewPrivileges=yes
|
|
ProtectSystem=strict
|
|
ProtectHome=yes
|
|
PrivateTmp=yes
|
|
PrivateDevices=yes
|
|
ProtectKernelTunables=yes
|
|
ProtectKernelModules=yes
|
|
ProtectControlGroups=yes
|
|
RestrictAddressFamilies=AF_INET AF_INET6 AF_UNIX
|
|
LockPersonality=yes
|
|
|
|
[Install]
|
|
WantedBy=multi-user.target
|