背景:
- 鉴于npc 0.26.10以及之前版本无法兼容群晖7.0上的docker,但nps又比其他内网穿透工具好用
- 所以手工部署npc,待未来兼容npc再容器化部署
一、客户端部署 npc 0.26.10(非docker)
/volume1/server/source/nps0.26.10
root@hh:/volume1/server/source/nps0.26.10# cp conf/npc.conf conf/npc.conf.init
root@hh:/volume1/server/source/nps0.26.10# touch /volume1/public/logs/npc.log
root@hh:/volume1/server/source/nps0.26.10# > conf/npc.conf
root@hh:/volume1/server/source/nps0.26.10# vim conf/npc.conf
server_addr=*:8024
conn_type=tcp
vkey=*
auto_reconnection=true
#max_conn=1000
#flow_limit=1000
#rate_limit=1000
#basic_username=11
#basic_password=3
#web_username=user
#web_password=123
#crypt=true
compress=true
log_level=4
log_path='/volume1/public/logs/npc.log'
启动服务
- 这里的vkey要在服务端控制台创建后,才有。
root@hh:/volume1/server/source/nps0.26.10# ./npc -server=***:8024 -vkey=*** -type=tcp &
二、服务端部署 0.26.10
停止fps
[root@VM-4-6-centos ~]# systemctl disable frps
[root@VM-4-6-centos ~]# systemctl stop frps
[root@VM-4-6-centos data]# mkdir -p /data/nps0.26.10
[root@VM-4-6-centos data]# cd /data/nps0.26.10/
[root@VM-4-6-centos nps0.26.10]# rz
[root@VM-4-6-centos nps0.26.10]# tar zxvf linux_amd64_server.tar.gz
配置修改
[root@VM-4-6-centos nps0.26.10]# cp conf/nps.conf conf/nps.conf.init
[root@VM-4-6-centos nps0.26.10]# vim conf/nps.conf
#注释 http代理部分(用不上这些功能)
#HTTP(S) proxy port, no startup if empty
http_proxy_ip=0.0.0.0
http_proxy_port=80
https_proxy_port=443
https_just_proxy=true
#default https certificate setting
https_default_cert_file=conf/server.pem
https_default_key_file=conf/server.key
# 根据情况修改
web_port = 8080
#取消注释
#log_path=nps.log
# 根据情况修改
web_password=***
启动服务、服务管理指令
[root@VM-4-6-centos nps0.26.10]# touch /data/nps0.26.10/nps.log
[root@VM-4-6-centos nps0.26.10]# ./nps reload
2021/11/29 17:16:53 reload fail
[1]+ 已杀死 ./nps
[root@VM-4-6-centos nps0.26.10]# ./nps
注册为服务
[root@VM-4-6-centos nps0.26.10]# ./nps install
2021/11/29 21:10:51 copy file ::/data/nps0.26.10/conf/clients.json to /etc/nps/conf/clients.json
2021/11/29 21:10:51 copy file ::/data/nps0.26.10/conf/hosts.json to /etc/nps/conf/hosts.json
2021/11/29 21:10:51 copy file ::/data/nps0.26.10/conf/nps.conf to /etc/nps/conf/nps.conf
2021/11/29 21:10:51 copy file ::/data/nps0.26.10/conf/nps.conf.init to /etc/nps/conf/nps.conf.init
2021/11/29 21:10:51 copy file ::/data/nps0.26.10/conf/server.key to /etc/nps/conf/server.key
2021/11/29 21:10:51 copy file ::/data/nps0.26.10/conf/server.pem to /etc/nps/conf/server.pem
2021/11/29 21:10:51 copy file ::/data/nps0.26.10/conf/tasks.json to /etc/nps/conf/tasks.json
2021/11/29 21:10:51 copy file ::/data/nps0.26.10/web/views/client/add.html to /etc/nps/web/views/client/add.html
2021/11/29 21:10:51 mkdir:/etc/nps/web/views/client/
2021/11/29 21:10:51 copy file ::/data/nps0.26.10/web/views/client/edit.html to /etc/nps/web/views/client/edit.html
2021/11/29 21:10:51 copy file ::/data/nps0.26.10/web/views/client/list.html to /etc/nps/web/views/client/list.html
2021/11/29 21:10:51 copy file ::/data/nps0.26.10/web/views/index/add.html to /etc/nps/web/views/index/add.html
2021/11/29 21:10:51 mkdir:/etc/nps/web/views/index/
2021/11/29 21:10:51 copy file ::/data/nps0.26.10/web/views/index/edit.html to /etc/nps/web/views/index/edit.html
2021/11/29 21:10:51 copy file ::/data/nps0.26.10/web/views/index/hadd.html to /etc/nps/web/views/index/hadd.html
2021/11/29 21:10:51 copy file ::/data/nps0.26.10/web/views/index/hedit.html to /etc/nps/web/views/index/hedit.html
2021/11/29 21:10:51 copy file ::/data/nps0.26.10/web/views/index/help.html to /etc/nps/web/views/index/help.html
2021/11/29 21:10:51 copy file ::/data/nps0.26.10/web/views/index/hlist.html to /etc/nps/web/views/index/hlist.html
2021/11/29 21:10:51 copy file ::/data/nps0.26.10/web/views/index/index.html to /etc/nps/web/views/index/index.html
2021/11/29 21:10:51 copy file ::/data/nps0.26.10/web/views/index/list.html to /etc/nps/web/views/index/list.html
2021/11/29 21:10:51 copy file ::/data/nps0.26.10/web/views/login/index.html to /etc/nps/web/views/login/index.html
2021/11/29 21:10:51 mkdir:/etc/nps/web/views/login/
2021/11/29 21:10:51 copy file ::/data/nps0.26.10/web/views/login/register.html to /etc/nps/web/views/login/register.html
2021/11/29 21:10:51 copy file ::/data/nps0.26.10/web/views/public/error.html to /etc/nps/web/views/public/error.html
2021/11/29 21:10:51 mkdir:/etc/nps/web/views/public/
2021/11/29 21:10:51 copy file ::/data/nps0.26.10/web/views/public/layout.html to /etc/nps/web/views/public/layout.html
2021/11/29 21:10:51 copy file ::/data/nps0.26.10/web/static/css/bootstrap-table.min.css to /etc/nps/web/static/css/bootstrap-table.min.css
2021/11/29 21:10:51 mkdir:/etc/nps/web/static/css/
2021/11/29 21:10:51 copy file ::/data/nps0.26.10/web/static/css/bootstrap.min.css to /etc/nps/web/static/css/bootstrap.min.css
2021/11/29 21:10:51 copy file ::/data/nps0.26.10/web/static/css/datatables.css to /etc/nps/web/static/css/datatables.css
2021/11/29 21:10:51 copy file ::/data/nps0.26.10/web/static/css/fontawesome.min.css to /etc/nps/web/static/css/fontawesome.min.css
2021/11/29 21:10:51 copy file ::/data/nps0.26.10/web/static/css/regular.min.css to /etc/nps/web/static/css/regular.min.css
2021/11/29 21:10:51 copy file ::/data/nps0.26.10/web/static/css/solid.min.css to /etc/nps/web/static/css/solid.min.css
2021/11/29 21:10:51 copy file ::/data/nps0.26.10/web/static/css/style.css to /etc/nps/web/static/css/style.css
2021/11/29 21:10:51 copy file ::/data/nps0.26.10/web/static/img/flag/en-US.png to /etc/nps/web/static/img/flag/en-US.png
2021/11/29 21:10:51 mkdir:/etc/nps/web/static/img/
2021/11/29 21:10:51 mkdir:/etc/nps/web/static/img/flag/
2021/11/29 21:10:51 copy file ::/data/nps0.26.10/web/static/img/flag/zh-CN.png to /etc/nps/web/static/img/flag/zh-CN.png
2021/11/29 21:10:51 copy file ::/data/nps0.26.10/web/static/js/bootstrap-table-locale-all.min.js to /etc/nps/web/static/js/bootstrap-table-locale-all.min.js
2021/11/29 21:10:51 mkdir:/etc/nps/web/static/js/
2021/11/29 21:10:51 copy file ::/data/nps0.26.10/web/static/js/bootstrap-table.min.js to /etc/nps/web/static/js/bootstrap-table.min.js
2021/11/29 21:10:51 copy file ::/data/nps0.26.10/web/static/js/bootstrap.min.js to /etc/nps/web/static/js/bootstrap.min.js
2021/11/29 21:10:51 copy file ::/data/nps0.26.10/web/static/js/echarts.min.js to /etc/nps/web/static/js/echarts.min.js
2021/11/29 21:10:51 copy file ::/data/nps0.26.10/web/static/js/fontawesome.min.js to /etc/nps/web/static/js/fontawesome.min.js
2021/11/29 21:10:51 copy file ::/data/nps0.26.10/web/static/js/inspinia.js to /etc/nps/web/static/js/inspinia.js
2021/11/29 21:10:51 copy file ::/data/nps0.26.10/web/static/js/jquery-3.4.1.min.js to /etc/nps/web/static/js/jquery-3.4.1.min.js
2021/11/29 21:10:51 copy file ::/data/nps0.26.10/web/static/js/language.js to /etc/nps/web/static/js/language.js
2021/11/29 21:10:51 copy file ::/data/nps0.26.10/web/static/js/popper.min.js to /etc/nps/web/static/js/popper.min.js
2021/11/29 21:10:51 copy file ::/data/nps0.26.10/web/static/page/error.html to /etc/nps/web/static/page/error.html
2021/11/29 21:10:51 mkdir:/etc/nps/web/static/page/
2021/11/29 21:10:51 copy file ::/data/nps0.26.10/web/static/page/languages.xml to /etc/nps/web/static/page/languages.xml
2021/11/29 21:10:51 copy file ::/data/nps0.26.10/web/static/webfonts/fa-solid-900.eot to /etc/nps/web/static/webfonts/fa-solid-900.eot
2021/11/29 21:10:51 mkdir:/etc/nps/web/static/webfonts/
2021/11/29 21:10:51 copy file ::/data/nps0.26.10/web/static/webfonts/fa-solid-900.svg to /etc/nps/web/static/webfonts/fa-solid-900.svg
2021/11/29 21:10:51 copy file ::/data/nps0.26.10/web/static/webfonts/fa-solid-900.ttf to /etc/nps/web/static/webfonts/fa-solid-900.ttf
2021/11/29 21:10:51 copy file ::/data/nps0.26.10/web/static/webfonts/fa-solid-900.woff to /etc/nps/web/static/webfonts/fa-solid-900.woff
2021/11/29 21:10:51 copy file ::/data/nps0.26.10/web/static/webfonts/fa-solid-900.woff2 to /etc/nps/web/static/webfonts/fa-solid-900.woff2
2021/11/29 21:10:51 install ok!
2021/11/29 21:10:51 Static files and configuration files in the current directory will be useless
2021/11/29 21:10:51 The new configuration file is located in /etc/nps you can edit them
2021/11/29 21:10:51 You can start with:
nps start|stop|restart|uninstall|update or nps-update update
anywhere!
访问管理台、以及创建客户端vkey
- http://*:38080 默认账号 amdin/123
- 服务端,增加客户端。生成vkey