Frp: 功能建议: 建议添加一键安装脚本(主要方便部署linux服务器)

Created on 23 Jan 2019  ·  18Comments  ·  Source: fatedier/frp

功能建议: 建议添加一键安装脚本(主要方便部署linux服务器)

todo

Most helpful comment

[Unit]
Description=Frp Server Daemon
After=syslog.target network.target
Wants=network.target

[Service]
Type=simple
ExecStart=/usr/bin/frps -c /etc/frps.ini
ExecStop=/usr/bin/killall frps

启动失败1分钟后再次启动

RestartSec=1min
KillMode=control-group

重启控制:总是重启

Restart=always

[Install]
WantedBy=multi-user.target

这个脚本放在# /etc/systemd/system/frps.service
然后 systemctl enable frps.service 即可
配置文件请自己搞掂。。每个人的需求都不同
@fatedier 这个systemctl配置应该足够简单通用了吧

All 18 comments

解压 设置权限 运行,这种还要一键脚本?

可以提供一些规范化的例如支持 systemctl 的配置,TODO

我觉着这个已经属于非常简单的东西了

可以像ss、v2ray写个sh脚本,安装、更新、重启、开机启动等服务,这样更容易上手

可以像SS,v2ray写个SH脚本,安装,更新,重启,开机启动等服务,这样更容易上手

使用supervisor来守护frps

sudo apt-get update

sudo apt-get install supervisor

vi /etc/supervisor/conf.d/frps.conf

[program:frps]
command = /root/frps/frps -c /root/frps/frps.ini # frps存放路径
autostart = true

重启supervisor

sudo systemctl restart supervisor

查看supervisor运行状态

sudo supervisorctl status

[Unit]
Description=Frp Server Daemon
After=syslog.target network.target
Wants=network.target

[Service]
Type=simple
ExecStart=/usr/bin/frps -c /etc/frps.ini
ExecStop=/usr/bin/killall frps

启动失败1分钟后再次启动

RestartSec=1min
KillMode=control-group

重启控制:总是重启

Restart=always

[Install]
WantedBy=multi-user.target

这个脚本放在# /etc/systemd/system/frps.service
然后 systemctl enable frps.service 即可
配置文件请自己搞掂。。每个人的需求都不同
@fatedier 这个systemctl配置应该足够简单通用了吧

Frps 一键安装脚本&管理脚本 for Linux,frp:v0.23.3 https://github.com/MvsCode/frp-onekey

为什么不考虑把软件推到 linux 发行版的官方仓库中

archlinux 的 AUR 上有人打了这个包
不过按规范这种应该算 bin 包

https://aur.archlinux.org/packages/frp/

目前 archlinuxcn 软件仓库中有一共有三个 frp 的包

最近准备合并成一个然后 split package

https://github.com/archlinuxcn/repo/issues/1083

@a-wing 不是很了解相关的东西,你能提供一些帮助?

话说日志的话

会在相关的服务管理程序提供的日志功能上吗

为什么不考虑把软件推到 linux 发行版的官方仓库中

archlinux 的 AUR 上有人打了这个包
不过按规范这种应该算 bin 包

https://aur.archlinux.org/packages/frp/

目前 archlinuxcn 软件仓库中有一共有三个 frp 的包

最近准备合并成一个然后 split package

archlinuxcn/repo#1083

frps.service 中
User=nobody
好像在ubuntu 下有问题 nobody 没有绑定80端口的权限

好像在ubuntu 下有问题 nobody 没有绑定80端口的权限

正常的发行版。 1024 以下的端口当然都不行。

特权端口 你自己用 nginxiptables 转一下。

好像在ubuntu 下有问题 nobody 没有绑定80端口的权限

正常的发行版。 1024 以下的端口当然都不行。

特权端口 你自己用 nginxiptables 转一下。

不过为什么要用 nobody 用户来启动 frp 呢?

话说为啥没有官方docker啊,去DockerHub逛了一圈,找了个xddxdd/frps两个月前更新的。。

客户端使用的时候一直是说[W] [service.go:82] login to server failed: session shutdown

服务器端[D] [service.go:304] Accept new mux stream error: invalid protocol version

一看服务器版本0.22,客户端版本0.26。。不得不自己FROM scratch做一个。。~为啥不能向后兼容~

已经封装了Docker镜像,支持amd64, arm32v6, arm32v7, arm64v8, i386。

frp

Docker Image packaging for Frp.

(amd64, arm32v6, arm32v7, arm64v8, i386)

Usage

start frps

docker run  --network host -d -v /etc/frp/frps.ini:/etc/frp/frps.ini --name frps snowdreamtech/frps

start frpc

docker run  --network host -d -v /etc/frp/frpc.ini:/etc/frp/frpc.ini --name frpc snowdreamtech/frpc

Quick reference

  • Where to file issues:

https://github.com/snowdreamtech/frp/issues

  • Maintained by:

snowdream sn0wdr1am@icloud.com

frpc:

amd64, arm32v6, arm32v7, arm64v8, i386

frps:

amd64, arm32v6, arm32v7, arm64v8, i386

  • Supported Tags:

Frps

Frpc

License

Apache 2.0

可以在这里提交相关的东西了

我是从google过来的,简单搜一下能搜到好多……给后来的人汇总一下。
没营养的: #1302 #902 #1474
一些解决方案: #1058 (本贴)
作者说明不维护service脚本(包括Dockerfile)的原因: https://github.com/fatedier/frp/pull/1291#issuecomment-502966225

建议加到项目FAQ里。


PS: 我平时用的Dockerfile,甚至不需要Alpine XD

FROM scratch
ARG ver=0.33.0
COPY ./frp_${ver}_linux_amd64/frps /frps
ENTRYPOINT ["/frps", "-c", "/frps.ini"]
Was this page helpful?
0 / 5 - 0 ratings

Related issues

AngryBaby picture AngryBaby  ·  3Comments

ssdphp picture ssdphp  ·  3Comments

fanmaomao picture fanmaomao  ·  3Comments

gao270615179 picture gao270615179  ·  3Comments

zhanghu663 picture zhanghu663  ·  4Comments