├── .gitignore ├── luci-app-control-timewol ├── Makefile ├── luasrc │ ├── controller │ │ └── timewol.lua │ ├── model │ │ └── cbi │ │ │ └── timewol.lua │ └── view │ │ └── timewol │ │ ├── index.htm │ │ └── timewol.htm ├── po │ ├── zh-cn │ │ └── timewol.po │ └── zh_Hans └── root │ ├── etc │ ├── config │ │ └── timewol │ ├── init.d │ │ └── timewol │ └── uci-defaults │ │ └── luci-app-control-timewol │ └── usr │ └── share │ └── rpcd │ └── acl.d │ └── luci-app-control-timewol.json ├── luci-app-control-webrestriction ├── Makefile ├── luasrc │ ├── controller │ │ └── webrestriction.lua │ ├── model │ │ └── cbi │ │ │ └── webrestriction.lua │ └── view │ │ └── webrestriction │ │ ├── index.htm │ │ └── webrestriction.htm ├── po │ ├── zh-cn │ │ └── webrestriction.po │ └── zh_Hans └── root │ ├── etc │ ├── config │ │ └── webrestriction │ ├── init.d │ │ └── webrestriction │ └── uci-defaults │ │ └── luci-app-control-webrestriction │ └── usr │ └── share │ └── rpcd │ └── acl.d │ └── luci-app-control-webrestriction.json ├── luci-app-control-weburl ├── Makefile ├── luasrc │ ├── controller │ │ └── weburl.lua │ ├── model │ │ └── cbi │ │ │ └── weburl.lua │ └── view │ │ └── weburl │ │ ├── index.htm │ │ └── weburl.htm ├── po │ ├── zh-cn │ │ └── weburl.po │ └── zh_Hans └── root │ ├── etc │ ├── config │ │ └── weburl │ ├── init.d │ │ └── weburl │ └── uci-defaults │ │ └── luci-app-control-weburl │ └── usr │ └── share │ └── rpcd │ └── acl.d │ └── luci-app-control-weburl.json ├── luci-app-fileassistant ├── Makefile ├── htdocs │ └── luci-static │ │ └── resources │ │ └── fileassistant │ │ ├── fb.css │ │ ├── fb.js │ │ ├── file-icon.png │ │ ├── folder-icon.png │ │ └── link-icon.png └── luasrc │ ├── controller │ └── fileassistant.lua │ └── view │ └── fileassistant.htm ├── luci-app-filebrowser ├── Makefile ├── luasrc │ ├── controller │ │ └── filebrowser.lua │ ├── model │ │ └── cbi │ │ │ └── filebrowser │ │ │ ├── api.lua │ │ │ └── settings.lua │ └── view │ │ └── filebrowser │ │ ├── download.htm │ │ ├── log.htm │ │ └── status.htm ├── po │ ├── zh-cn │ │ └── filebrowser.po │ └── zh_Hans └── root │ ├── etc │ ├── config │ │ └── filebrowser │ ├── init.d │ │ └── filebrowser │ └── uci-defaults │ │ └── luci-app-filebrowser │ └── usr │ └── share │ └── rpcd │ └── acl.d │ └── luci-app-filebrowser.json ├── luci-app-guest-wifi ├── Makefile ├── luasrc │ ├── controller │ │ └── guest-wifi.lua │ └── model │ │ └── cbi │ │ └── guest-wifi.lua ├── po │ ├── zh-cn │ │ └── guest-wifi.po │ └── zh_Hans └── root │ ├── etc │ ├── config │ │ └── guest-wifi │ ├── init.d │ │ └── guest-wifi │ └── uci-defaults │ │ └── luci-app-guest-wifi │ └── usr │ └── share │ └── rpcd │ └── acl.d │ └── luci-app-guest-wifi.json ├── luci-app-ipsec-server ├── Makefile ├── luasrc │ ├── controller │ │ └── ipsec-server.lua │ ├── model │ │ └── cbi │ │ │ └── ipsec-server │ │ │ ├── l2tp_user.lua │ │ │ ├── online.lua │ │ │ ├── settings.lua │ │ │ └── users.lua │ └── view │ │ └── ipsec-server │ │ └── ipsec-server_status.htm ├── po │ ├── zh-cn │ │ └── ipsec-server.po │ └── zh_Hans └── root │ ├── etc │ ├── config │ │ └── luci-app-ipsec-server │ ├── init.d │ │ └── luci-app-ipsec-server │ └── uci-defaults │ │ └── luci-app-ipsec-server │ └── usr │ └── share │ ├── rpcd │ └── acl.d │ │ └── luci-app-ipsec-server.json │ └── xl2tpd │ ├── ip-down │ └── ip-up ├── luci-app-kodexplorer ├── LICENSE ├── Makefile ├── luasrc │ ├── controller │ │ └── kodexplorer.lua │ ├── model │ │ └── cbi │ │ │ └── kodexplorer │ │ │ ├── api.lua │ │ │ └── settings.lua │ └── view │ │ └── kodexplorer │ │ ├── status.htm │ │ └── version.htm ├── po │ ├── zh-cn │ │ └── kodexplorer.po │ └── zh_Hans └── root │ ├── etc │ ├── config │ │ └── kodexplorer │ ├── init.d │ │ └── kodexplorer │ ├── kodexplorer │ │ ├── nginx.conf.template │ │ ├── php-fpm.conf.template │ │ └── php.ini.template │ └── uci-defaults │ │ └── luci-kodexplorer │ └── usr │ └── share │ └── rpcd │ └── acl.d │ └── luci-app-kodexplorer.json ├── luci-app-nginx-pingos ├── Makefile ├── luasrc │ ├── controller │ │ └── pingos.lua │ ├── model │ │ └── cbi │ │ │ └── pingos.lua │ └── view │ │ └── pingos │ │ └── status.htm ├── modules │ ├── nginx-client-module │ │ ├── COPYRIGHT │ │ ├── config │ │ ├── ngx_client.c │ │ ├── ngx_client.h │ │ ├── ngx_http_client.c │ │ ├── ngx_http_client.h │ │ └── t │ │ │ ├── config │ │ │ ├── nginx.conf │ │ │ ├── ngx_client_stat_module.c │ │ │ ├── ngx_client_test_module.c │ │ │ ├── ngx_http_client_test_module.c │ │ │ └── tcpserver.go │ ├── nginx-multiport-module │ │ ├── COPYRIGHT │ │ ├── README.md │ │ ├── config │ │ ├── doc │ │ │ ├── ngx-http-broadcast-module.md │ │ │ └── ngx-stream-zone-module.md │ │ ├── ngx_event_multiport_module.c │ │ ├── ngx_http_broadcast_module.c │ │ ├── ngx_http_inner_proxy_module.c │ │ ├── ngx_multiport.h │ │ ├── ngx_multiport_misc.c │ │ ├── ngx_process_slot_module.c │ │ ├── ngx_stream_zone_module.c │ │ ├── ngx_stream_zone_module.h │ │ └── t │ │ │ ├── config │ │ │ ├── nginx.conf │ │ │ ├── ngx_multiport_test_module.c │ │ │ ├── ngx_stream_zone_test_module.c │ │ │ └── ngx_test_macro.h │ ├── nginx-rtmp-module │ │ ├── AUTHORS │ │ ├── LICENSE │ │ ├── config │ │ ├── dash │ │ │ ├── ngx_rtmp_dash_module.c │ │ │ ├── ngx_rtmp_mp4.c │ │ │ └── ngx_rtmp_mp4.h │ │ ├── hls │ │ │ ├── ngx_rtmp_hls_module.c │ │ │ ├── ngx_rtmp_mpegts.c │ │ │ └── ngx_rtmp_mpegts.h │ │ ├── http │ │ │ ├── ngx_http_flv_live_module.c │ │ │ ├── ngx_http_set_header.c │ │ │ └── ngx_http_set_header.h │ │ ├── mpegts │ │ │ ├── ngx_hls_http_module.c │ │ │ ├── ngx_hls_live_module.c │ │ │ ├── ngx_hls_live_module.h │ │ │ ├── ngx_mpegts_gop_module.c │ │ │ ├── ngx_mpegts_gop_module.h │ │ │ ├── ngx_mpegts_http_module.c │ │ │ ├── ngx_mpegts_live_module.c │ │ │ └── ngx_mpegts_live_module.h │ │ ├── ngx_live.c │ │ ├── ngx_live.h │ │ ├── ngx_live_record.c │ │ ├── ngx_live_record.h │ │ ├── ngx_live_relay.c │ │ ├── ngx_live_relay.h │ │ ├── ngx_live_relay_httpflv.c │ │ ├── ngx_live_relay_inner.c │ │ ├── ngx_live_relay_rtmp.c │ │ ├── ngx_live_relay_simple.c │ │ ├── ngx_live_relay_static.c │ │ ├── ngx_netcall.c │ │ ├── ngx_netcall.h │ │ ├── ngx_rtmp.c │ │ ├── ngx_rtmp.h │ │ ├── ngx_rtmp_access_module.c │ │ ├── ngx_rtmp_amf.c │ │ ├── ngx_rtmp_amf.h │ │ ├── ngx_rtmp_bandwidth.c │ │ ├── ngx_rtmp_bandwidth.h │ │ ├── ngx_rtmp_bitop.c │ │ ├── ngx_rtmp_bitop.h │ │ ├── ngx_rtmp_cmd_module.c │ │ ├── ngx_rtmp_cmd_module.h │ │ ├── ngx_rtmp_codec_module.c │ │ ├── ngx_rtmp_codec_module.h │ │ ├── ngx_rtmp_control_module.c │ │ ├── ngx_rtmp_core_module.c │ │ ├── ngx_rtmp_dynamic.c │ │ ├── ngx_rtmp_dynamic.h │ │ ├── ngx_rtmp_eval.c │ │ ├── ngx_rtmp_eval.h │ │ ├── ngx_rtmp_exec_module.c │ │ ├── ngx_rtmp_gop_module.c │ │ ├── ngx_rtmp_handler.c │ │ ├── ngx_rtmp_handshake.c │ │ ├── ngx_rtmp_init.c │ │ ├── ngx_rtmp_limit_module.c │ │ ├── ngx_rtmp_live_module.c │ │ ├── ngx_rtmp_live_module.h │ │ ├── ngx_rtmp_log_module.c │ │ ├── ngx_rtmp_monitor_module.c │ │ ├── ngx_rtmp_monitor_module.h │ │ ├── ngx_rtmp_notify_module.c │ │ ├── ngx_rtmp_notify_module.h │ │ ├── ngx_rtmp_proxy_protocol.c │ │ ├── ngx_rtmp_proxy_protocol.h │ │ ├── ngx_rtmp_receive.c │ │ ├── ngx_rtmp_record_module.c │ │ ├── ngx_rtmp_record_module.h │ │ ├── ngx_rtmp_send.c │ │ ├── ngx_rtmp_shared_module.c │ │ ├── ngx_rtmp_stat_module.c │ │ ├── ngx_rtmp_streams.h │ │ ├── ngx_rtmp_sys_stat_module.c │ │ ├── ngx_rtmp_variables.c │ │ ├── ngx_rtmp_variables.h │ │ └── ngx_rtmp_version.h │ ├── nginx-toolkit-module │ │ ├── COPYRIGHT │ │ ├── README.md │ │ ├── config │ │ ├── doc │ │ │ ├── ngx-dynamic-conf-module.md │ │ │ ├── ngx-dynamic-resolver-module.md │ │ │ ├── ngx-event-resolver-module.md │ │ │ ├── ngx-event-timer-module.md │ │ │ ├── ngx-map.md │ │ │ ├── ngx-poold.md │ │ │ ├── ngx-rbuf.md │ │ │ └── ngx-toolkit-misc.md │ │ ├── ngx_dynamic_conf.c │ │ ├── ngx_dynamic_conf.h │ │ ├── ngx_dynamic_resolver.c │ │ ├── ngx_dynamic_resolver.h │ │ ├── ngx_event_resolver.c │ │ ├── ngx_event_resolver.h │ │ ├── ngx_event_timer_module.c │ │ ├── ngx_event_timer_module.h │ │ ├── ngx_http_dynamic.c │ │ ├── ngx_http_dynamic.h │ │ ├── ngx_http_trace_module.c │ │ ├── ngx_map.c │ │ ├── ngx_map.h │ │ ├── ngx_poold.c │ │ ├── ngx_poold.h │ │ ├── ngx_rbuf.c │ │ ├── ngx_rbuf.h │ │ ├── ngx_timerd.c │ │ ├── ngx_timerd.h │ │ ├── ngx_toolkit_misc.c │ │ ├── ngx_toolkit_misc.h │ │ └── t │ │ │ ├── config │ │ │ ├── dns_install.sh │ │ │ ├── md5testfile │ │ │ ├── named.conf │ │ │ ├── nginx.conf │ │ │ ├── nginx_dynamic.conf │ │ │ ├── ngx_dynamic_conf_test_module.c │ │ │ ├── ngx_dynamic_resolver_test_module.c │ │ │ ├── ngx_event_resolver_test_module.c │ │ │ ├── ngx_event_timer_test_module.c │ │ │ ├── ngx_http_dynamic_test_module.c │ │ │ ├── ngx_map_test_module.c │ │ │ ├── ngx_poold_test_module.c │ │ │ ├── ngx_rbuf_test_module.c │ │ │ ├── ngx_test_macro.h │ │ │ ├── ngx_timerd_test_module.c │ │ │ ├── ngx_toolkit_misc_test_module.c │ │ │ ├── test.com.zone │ │ │ └── test1.com.zone │ └── nginx-ts-module │ │ ├── LICENSE │ │ ├── README.rst │ │ ├── config │ │ └── src │ │ ├── ngx_http_ts_module.c │ │ ├── ngx_stream_ts_module.c │ │ ├── ngx_ts_aac.c │ │ ├── ngx_ts_aac.h │ │ ├── ngx_ts_avc.c │ │ ├── ngx_ts_avc.h │ │ ├── ngx_ts_dash.c │ │ ├── ngx_ts_dash.h │ │ ├── ngx_ts_dash_mp4.c │ │ ├── ngx_ts_hls.c │ │ ├── ngx_ts_hls.h │ │ ├── ngx_ts_stream.c │ │ └── ngx_ts_stream.h ├── patches │ ├── 101-feature_test_fix.patch │ ├── 102-sizeof_test_fix.patch │ ├── 103-sys_nerr.patch │ ├── 104-endianness_fix.patch │ ├── 200-config.patch │ └── 201-ignore-invalid-options.patch ├── po │ ├── zh-cn │ │ └── pingos.po │ └── zh_Hans └── root │ ├── etc │ ├── config │ │ └── pingos │ ├── init.d │ │ └── pingos │ ├── pingos.template │ └── uci-defaults │ │ └── luci-app-nginx-pingos │ ├── resource │ ├── conf-template │ │ └── nginx.conf │ ├── crossdomain.xml │ └── stat.xsl │ └── usr │ └── share │ └── rpcd │ └── acl.d │ └── luci-app-nginx-pingos.json ├── luci-app-openvpn-client ├── Makefile ├── luasrc │ ├── controller │ │ └── openvpn-client.lua │ └── model │ │ └── cbi │ │ └── openvpn-client │ │ ├── client.lua │ │ └── settings.lua ├── po │ ├── zh-cn │ │ └── openvpn-client.po │ └── zh_Hans └── root │ ├── etc │ ├── config │ │ └── luci-app-openvpn-client │ ├── init.d │ │ └── luci-app-openvpn-client │ └── uci-defaults │ │ └── luci-app-openvpn-client │ └── usr │ └── share │ └── rpcd │ └── acl.d │ └── luci-app-openvpn-client.json ├── luci-app-openvpn-server ├── Makefile ├── luasrc │ ├── controller │ │ └── openvpn-server.lua │ ├── model │ │ └── cbi │ │ │ └── openvpn-server │ │ │ ├── log.lua │ │ │ ├── online.lua │ │ │ ├── settings.lua │ │ │ └── user.lua │ └── view │ │ └── openvpn-server │ │ ├── index.htm │ │ ├── log.htm │ │ └── status.htm ├── po │ ├── zh-cn │ │ └── openvpn-server.po │ └── zh_Hans └── root │ ├── etc │ ├── config │ │ └── luci-app-openvpn-server │ ├── init.d │ │ └── luci-app-openvpn-server │ └── uci-defaults │ │ └── luci-app-openvpn-server │ └── usr │ └── share │ ├── openvpn-server │ ├── ca.crt │ ├── dh.pem │ ├── script │ │ ├── auth_verify.sh │ │ ├── ca_renew.sh │ │ ├── client_connect.sh │ │ ├── client_disconnect.sh │ │ ├── down.sh │ │ ├── gen_client_config.sh │ │ └── up.sh │ ├── server.crt │ └── server.key │ └── rpcd │ └── acl.d │ └── luci-app-openvpn-server.json ├── luci-app-pppoe-relay ├── Makefile ├── luasrc │ ├── controller │ │ └── pppoe-relay.lua │ ├── model │ │ └── cbi │ │ │ └── pppoe-relay.lua │ └── view │ │ └── pppoe-relay │ │ ├── ajax.htm │ │ └── status.htm ├── po │ ├── zh-cn │ │ └── pppoe-relay.po │ └── zh_Hans └── root │ ├── etc │ ├── config │ │ └── pppoe-relay │ ├── init.d │ │ └── pppoe-relay │ └── uci-defaults │ │ └── luci-app-pppoe-relay │ └── usr │ └── share │ └── rpcd │ └── acl.d │ └── luci-app-pppoe-relay.json ├── luci-app-pppoe-server ├── Makefile ├── luasrc │ ├── controller │ │ └── pppoe-server.lua │ ├── model │ │ └── cbi │ │ │ └── pppoe-server │ │ │ ├── online.lua │ │ │ ├── settings.lua │ │ │ └── users.lua │ └── view │ │ └── pppoe-server │ │ ├── index.htm │ │ └── status.htm ├── po │ ├── zh-cn │ │ └── pppoe-server.po │ └── zh_Hans └── root │ ├── etc │ ├── config │ │ └── pppoe-server │ ├── init.d │ │ └── pppoe-server │ └── uci-defaults │ │ └── luci-app-pppoe-server │ └── usr │ └── share │ ├── pppoe-server │ ├── ip-down │ └── ip-up │ └── rpcd │ └── acl.d │ └── luci-app-pppoe-server.json ├── luci-app-pptp-server ├── Makefile ├── luasrc │ ├── controller │ │ └── pptpd.lua │ ├── model │ │ └── cbi │ │ │ └── pptpd │ │ │ ├── online.lua │ │ │ ├── settings.lua │ │ │ ├── user.lua │ │ │ └── users.lua │ └── view │ │ └── pptpd │ │ ├── index.htm │ │ └── status.htm ├── po │ ├── zh-cn │ │ └── pptpd.po │ └── zh_Hans └── root │ ├── etc │ ├── config │ │ └── luci-app-pptp-server │ ├── init.d │ │ └── luci-app-pptp-server │ └── uci-defaults │ │ └── luci-app-pptp-server │ └── usr │ └── share │ ├── pptpd │ ├── ip-down │ └── ip-up │ └── rpcd │ └── acl.d │ └── luci-app-pptp-server.json ├── luci-app-ramfree ├── Makefile ├── luasrc │ └── controller │ │ └── release_ram.lua └── po │ ├── zh-cn │ └── release_ram.po │ └── zh_Hans ├── luci-app-socat ├── Makefile ├── luasrc │ ├── controller │ │ └── socat.lua │ ├── model │ │ └── cbi │ │ │ └── socat │ │ │ ├── config.lua │ │ │ └── index.lua │ └── view │ │ └── socat │ │ ├── list_status.htm │ │ └── status.htm ├── po │ ├── zh-cn │ │ └── socat.po │ └── zh_Hans └── root │ ├── etc │ ├── config │ │ └── socat │ ├── init.d │ │ └── luci_socat │ └── uci-defaults │ │ └── luci-app-socat │ └── usr │ └── share │ └── rpcd │ └── acl.d │ └── luci-app-socat.json ├── luci-app-softethervpn ├── Makefile ├── luasrc │ ├── controller │ │ └── softethervpn.lua │ ├── model │ │ └── cbi │ │ │ └── softethervpn.lua │ └── view │ │ └── softethervpn │ │ ├── index.htm │ │ └── status.htm ├── po │ ├── zh-cn │ │ └── softethervpn.po │ └── zh_Hans └── root │ ├── etc │ ├── config │ │ └── softethervpn │ ├── init.d │ │ └── softethervpn │ └── uci-defaults │ │ └── luci-app-softethervpn │ └── usr │ └── share │ └── rpcd │ └── acl.d │ └── luci-app-softethervpn.json ├── luci-app-ssr-mudb-server ├── LICENSE ├── Makefile ├── htdocs │ └── luci-static │ │ └── resources │ │ └── vue.min.js ├── luasrc │ ├── controller │ │ └── ssr_mudb_server.lua │ ├── model │ │ └── cbi │ │ │ └── ssr_mudb_server │ │ │ └── index.lua │ └── view │ │ └── ssr_mudb_server │ │ ├── status.htm │ │ ├── user.htm │ │ └── users.htm ├── po │ ├── zh-cn │ │ └── ssr_mudb_server.po │ └── zh_Hans └── root │ ├── etc │ ├── config │ │ ├── ssr_mudb_server │ │ └── ssr_mudb_server.json │ ├── init.d │ │ └── ssr_mudb_server │ └── uci-defaults │ │ └── luci-app-ssr-mudb-server │ └── usr │ └── share │ ├── rpcd │ └── acl.d │ │ └── luci-app-ssr-mudb-server.json │ └── ssr_mudb_server │ ├── .travis.yml │ ├── CHANGES │ ├── CONTRIBUTING.md │ ├── Dockerfile │ ├── MANIFEST.in │ ├── apiconfig.py │ ├── asyncmgr.py │ ├── clear_traffic_all_users.sh │ ├── config.json │ ├── configloader.py │ ├── db_transfer.py │ ├── firewall.lua │ ├── importloader.py │ ├── initcfg.bat │ ├── initcfg.sh │ ├── initmudbjson.sh │ ├── logrun.sh │ ├── mudb.json │ ├── mujson_mgr.py │ ├── mysql.json │ ├── run.sh │ ├── server.py │ ├── server_pool.py │ ├── setup.py │ ├── setup_cymysql.sh │ ├── shadowsocks │ ├── __init__.py │ ├── asyncdns.py │ ├── common.py │ ├── crypto │ │ ├── __init__.py │ │ ├── ctypes_libsodium.py │ │ ├── ctypes_openssl.py │ │ ├── openssl.py │ │ ├── rc4_md5.py │ │ ├── sodium.py │ │ ├── table.py │ │ └── util.py │ ├── daemon.py │ ├── encrypt.py │ ├── eventloop.py │ ├── local.py │ ├── logrun.sh │ ├── lru_cache.py │ ├── manager.py │ ├── obfs.py │ ├── obfsplugin │ │ ├── __init__.py │ │ ├── auth.py │ │ ├── auth_chain.py │ │ ├── http_simple.py │ │ ├── obfs_tls.py │ │ ├── plain.py │ │ └── verify.py │ ├── ordereddict.py │ ├── run.sh │ ├── server.py │ ├── shell.py │ ├── stop.sh │ ├── tail.sh │ ├── tcprelay.py │ ├── udprelay.py │ ├── user.py │ └── version.py │ ├── stop.sh │ ├── switchrule.py │ ├── tail.sh │ ├── tests │ ├── aes-cfb1.json │ ├── aes-cfb8.json │ ├── aes-ctr.json │ ├── aes.json │ ├── assert.sh │ ├── chacha20.json │ ├── client-multi-server-ip.json │ ├── coverage_server.py │ ├── fastopen.json │ ├── ipv6-client-side.json │ ├── ipv6.json │ ├── jenkins.sh │ ├── libsodium │ │ └── install.sh │ ├── nose_plugin.py │ ├── rc4-md5.json │ ├── salsa20-ctr.json │ ├── salsa20.json │ ├── server-multi-passwd-client-side.json │ ├── server-multi-passwd-table.json │ ├── server-multi-passwd.json │ ├── server-multi-ports.json │ ├── setup_tc.sh │ ├── socksify │ │ ├── install.sh │ │ └── socks.conf │ ├── table.json │ ├── test.py │ ├── test_command.sh │ ├── test_daemon.sh │ ├── test_large_file.sh │ ├── test_udp_src.py │ ├── test_udp_src.sh │ └── workers.json │ ├── user-config.json │ ├── userapiconfig.py │ ├── usermysql.json │ └── utils │ ├── README.md │ ├── autoban.py │ └── fail2ban │ └── shadowsocks.conf ├── luci-app-syncthing ├── Makefile ├── luasrc │ ├── controller │ │ └── syncthing.lua │ ├── model │ │ └── cbi │ │ │ └── syncthing.lua │ └── view │ │ └── syncthing │ │ └── syncthing_status.htm ├── po │ ├── zh-cn │ │ └── syncthing.po │ └── zh_Hans └── root │ ├── etc │ ├── config │ │ └── syncthing │ ├── init.d │ │ └── syncthing │ └── uci-defaults │ │ └── luci-syncthing │ └── usr │ └── share │ └── rpcd │ └── acl.d │ └── luci-app-syncthing.json ├── luci-app-timecontrol ├── Makefile ├── luasrc │ ├── controller │ │ └── timecontrol.lua │ ├── model │ │ └── cbi │ │ │ └── timecontrol.lua │ └── view │ │ └── timecontrol │ │ ├── index.htm │ │ └── timecontrol.htm ├── po │ ├── zh-cn │ │ └── timecontrol.po │ └── zh_Hans └── root │ ├── etc │ ├── config │ │ └── timecontrol │ ├── init.d │ │ └── timecontrol │ └── uci-defaults │ │ └── luci-app-timecontrol │ └── usr │ └── share │ └── rpcd │ └── acl.d │ └── luci-app-timecontrol.json ├── luci-app-verysync ├── Makefile ├── luasrc │ ├── controller │ │ └── verysync.lua │ ├── model │ │ └── cbi │ │ │ └── verysync.lua │ └── view │ │ └── verysync │ │ └── verysync_status.htm ├── po │ ├── zh-cn │ │ └── verysync.po │ └── zh_Hans └── root │ ├── etc │ ├── config │ │ └── verysync │ ├── init.d │ │ └── verysync │ └── uci-defaults │ │ └── luci-verysync │ └── usr │ └── share │ └── rpcd │ └── acl.d │ └── luci-app-verysync.json └── verysync └── Makefile /.gitignore: -------------------------------------------------------------------------------- 1 | zzz_test/ 2 | *~ 3 | *.bak -------------------------------------------------------------------------------- /luci-app-control-timewol/Makefile: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2016 Openwrt.org 2 | # 3 | # This is free software, licensed under the Apache License, Version 2.0 . 4 | # 5 | 6 | include $(TOPDIR)/rules.mk 7 | 8 | LUCI_TITLE:=LuCI support for Timewol 9 | LUCI_DEPENDS:=+etherwake 10 | LUCI_PKGARCH:=all 11 | PKG_VERSION:=1.1 12 | PKG_RELEASE:=1 13 | 14 | include $(TOPDIR)/feeds/luci/luci.mk 15 | 16 | # call BuildPackage - OpenWrt buildroot signature 17 | -------------------------------------------------------------------------------- /luci-app-control-timewol/luasrc/controller/timewol.lua: -------------------------------------------------------------------------------- 1 | module("luci.controller.timewol", package.seeall) 2 | 3 | function index() 4 | if not nixio.fs.access("/etc/config/timewol") then return end 5 | 6 | entry({"admin", "control"}, firstchild(), "Control", 44).dependent = false 7 | entry({"admin", "control", "timewol"}, cbi("timewol"), _("Timed Wakeup"), 95).dependent = true 8 | entry({"admin", "control", "timewol", "status"}, call("status")).leaf = true 9 | end 10 | 11 | function status() 12 | local e = {} 13 | e.status = luci.sys.call("cat /etc/crontabs/root | grep etherwake >/dev/null") == 0 14 | luci.http.prepare_content("application/json") 15 | luci.http.write_json(e) 16 | end 17 | -------------------------------------------------------------------------------- /luci-app-control-timewol/luasrc/model/cbi/timewol.lua: -------------------------------------------------------------------------------- 1 | local i = require "luci.sys" 2 | 3 | t = Map("timewol", translate("Timed network wake-up"), translate("Wake up your LAN device regularly")) 4 | 5 | e = t:section(TypedSection, "basic", translate("Basic setting")) 6 | e.anonymous = true 7 | 8 | o = e:option(Flag, "enable", translate("Enable")) 9 | o.rmempty = false 10 | 11 | e = t:section(TypedSection, "macclient", translate("Client setting")) 12 | e.template = "cbi/tblsection" 13 | e.anonymous = true 14 | e.addremove = true 15 | 16 | nolimit_mac = e:option(Value, "macaddr", translate("MAC Address")) 17 | nolimit_mac.rmempty = false 18 | i.net.mac_hints(function(e, t) nolimit_mac:value(e, "%s (%s)" % {e, t}) end) 19 | nolimit_eth = e:option(Value, "maceth", translate("Network interface")) 20 | nolimit_eth.rmempty = false 21 | for t, e in ipairs(i.net.devices()) do if e ~= "lo" then nolimit_eth:value(e) end end 22 | 23 | a = e:option(Value, "minute", translate("minutes")) 24 | a.optional = false 25 | 26 | a = e:option(Value, "hour", translate("hour")) 27 | a.optional = false 28 | 29 | a = e:option(Value, "day", translate("day")) 30 | a.optional = false 31 | 32 | a = e:option(Value, "month", translate("month")) 33 | a.optional = false 34 | 35 | a = e:option(Value, "weeks", translate("weeks")) 36 | a.optional = false 37 | 38 | return t 39 | -------------------------------------------------------------------------------- /luci-app-control-timewol/luasrc/view/timewol/index.htm: -------------------------------------------------------------------------------- 1 | <%# 2 | Copyright 2016 Chen RuiWei 3 | Licensed to the public under the Apache License 2.0. 4 | -%> 5 | 6 | <% include("cbi/map") %> 7 | 19 | -------------------------------------------------------------------------------- /luci-app-control-timewol/luasrc/view/timewol/timewol.htm: -------------------------------------------------------------------------------- 1 | <%+cbi/valueheader%> 2 | <%=pcdata(self:cfgvalue(section) or self.default or "")%> 3 | <%+cbi/valuefooter%> 4 | -------------------------------------------------------------------------------- /luci-app-control-timewol/po/zh-cn/timewol.po: -------------------------------------------------------------------------------- 1 | msgid "Control" 2 | msgstr "管控" 3 | 4 | msgid "Running Status" 5 | msgstr "运行状态" 6 | 7 | msgid "Collecting data..." 8 | msgstr "正在收集数据..." 9 | 10 | msgid "NOT RUNNING" 11 | msgstr "未运行" 12 | 13 | msgid "RUNNING" 14 | msgstr "运行中" 15 | 16 | msgid "Timed Wakeup" 17 | msgstr "定时唤醒" 18 | 19 | msgid "Timed network wake-up" 20 | msgstr "定时网络唤醒" 21 | 22 | msgid "Wake up your LAN device regularly" 23 | msgstr "定时唤醒你的局域网设备" 24 | 25 | msgid "Basic setting" 26 | msgstr "基本设置" 27 | 28 | msgid "Enable" 29 | msgstr "开启" 30 | 31 | msgid "Client setting" 32 | msgstr "客户端设置" 33 | 34 | msgid "MAC Address" 35 | msgstr "MAC 地址" 36 | 37 | msgid "Network interface" 38 | msgstr "网络接口" 39 | 40 | msgid "minutes" 41 | msgstr "分钟" 42 | 43 | msgid "hour" 44 | msgstr "小时" 45 | 46 | msgid "day" 47 | msgstr "日" 48 | 49 | msgid "month" 50 | msgstr "月" 51 | 52 | msgid "weeks" 53 | msgstr "星期" 54 | -------------------------------------------------------------------------------- /luci-app-control-timewol/po/zh_Hans: -------------------------------------------------------------------------------- 1 | zh-cn -------------------------------------------------------------------------------- /luci-app-control-timewol/root/etc/config/timewol: -------------------------------------------------------------------------------- 1 | 2 | config basic 3 | option enable '0' 4 | -------------------------------------------------------------------------------- /luci-app-control-timewol/root/etc/uci-defaults/luci-app-control-timewol: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | uci -q batch <<-EOF >/dev/null 4 | delete ucitrack.@timewol[-1] 5 | add ucitrack timewol 6 | set ucitrack.@timewol[-1].init=timewol 7 | commit ucitrack 8 | EOF 9 | 10 | rm -f /tmp/luci-indexcache 11 | exit 0 12 | -------------------------------------------------------------------------------- /luci-app-control-timewol/root/usr/share/rpcd/acl.d/luci-app-control-timewol.json: -------------------------------------------------------------------------------- 1 | { 2 | "luci-app-control-timewol": { 3 | "description": "Grant UCI access for luci-app-control-timewol", 4 | "read": { 5 | "uci": [ "timewol" ] 6 | }, 7 | "write": { 8 | "uci": [ "timewol" ] 9 | } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /luci-app-control-webrestriction/Makefile: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2016 Openwrt.org 2 | # 3 | # This is free software, licensed under the Apache License, Version 2.0 . 4 | # 5 | 6 | include $(TOPDIR)/rules.mk 7 | 8 | LUCI_TITLE:=LuCI support for Webrestriction 9 | LUCI_PKGARCH:=all 10 | PKG_VERSION:=1.1 11 | PKG_RELEASE:=1 12 | 13 | include $(TOPDIR)/feeds/luci/luci.mk 14 | 15 | # call BuildPackage - OpenWrt buildroot signature 16 | -------------------------------------------------------------------------------- /luci-app-control-webrestriction/luasrc/controller/webrestriction.lua: -------------------------------------------------------------------------------- 1 | module("luci.controller.webrestriction", package.seeall) 2 | 3 | function index() 4 | if not nixio.fs.access("/etc/config/webrestriction") then return end 5 | 6 | entry({"admin", "control"}, firstchild(), "Control", 44).dependent = false 7 | entry({"admin", "control", "webrestriction"}, cbi("webrestriction"), _("Access Control"), 11).dependent = true 8 | entry({"admin", "control", "webrestriction", "status"}, call("status")).leaf = true 9 | end 10 | 11 | function status() 12 | local e = {} 13 | e.status = luci.sys.call("iptables -L FORWARD | grep WEB_RESTRICTION >/dev/null") == 0 14 | luci.http.prepare_content("application/json") 15 | luci.http.write_json(e) 16 | end 17 | -------------------------------------------------------------------------------- /luci-app-control-webrestriction/luasrc/model/cbi/webrestriction.lua: -------------------------------------------------------------------------------- 1 | local o = require "luci.sys" 2 | 3 | a = Map("webrestriction", translate("Access Control"), translate("Use the blacklist or whitelist mode to control whether a client in the list can connect to the Internet.")) 4 | a.template = "webrestriction/index" 5 | 6 | e = a:section(TypedSection, "basic", translate("Running Status")) 7 | e.anonymous = true 8 | 9 | t = e:option(DummyValue, "webrestriction_status", translate("Running Status")) 10 | t.template = "webrestriction/webrestriction" 11 | t.value = translate("Collecting data...") 12 | 13 | e = a:section(TypedSection, "basic", translate("Global setting")) 14 | e.anonymous = true 15 | 16 | t = e:option(Flag, "enable", translate("Enable")) 17 | t.rmempty = false 18 | 19 | t = e:option(ListValue, "limit_type", translate("Limit mode")) 20 | t.default = "blacklist" 21 | t:value("whitelist", translate("Whitelist")) 22 | t:value("blacklist", translate("Blacklist")) 23 | 24 | e = a:section(TypedSection, "macbind", translate("List setting"), translate("In blacklist mode, the client in the list is prohibited from connecting to the Internet. In whitelist mode, only the clients in the list can connect to the Internet.")) 25 | e.template = "cbi/tblsection" 26 | e.anonymous = true 27 | e.addremove = true 28 | 29 | t = e:option(Flag, "enable", translate("Enable")) 30 | t.rmempty = false 31 | 32 | t = e:option(Value, "macaddr", translate("MAC Address")) 33 | t.rmempty = true 34 | 35 | o.net.mac_hints(function(e, a) t:value(e, "%s (%s)" % {e, a}) end) 36 | return a 37 | -------------------------------------------------------------------------------- /luci-app-control-webrestriction/luasrc/view/webrestriction/index.htm: -------------------------------------------------------------------------------- 1 | <%# 2 | Copyright 2016 Chen RuiWei 3 | Licensed to the public under the Apache License 2.0. 4 | -%> 5 | 6 | <% include("cbi/map") %> 7 | 19 | -------------------------------------------------------------------------------- /luci-app-control-webrestriction/luasrc/view/webrestriction/webrestriction.htm: -------------------------------------------------------------------------------- 1 | <%+cbi/valueheader%> 2 | <%=pcdata(self:cfgvalue(section) or self.default or "")%> 3 | <%+cbi/valuefooter%> 4 | -------------------------------------------------------------------------------- /luci-app-control-webrestriction/po/zh-cn/webrestriction.po: -------------------------------------------------------------------------------- 1 | msgid "Control" 2 | msgstr "管控" 3 | 4 | msgid "Running Status" 5 | msgstr "运行状态" 6 | 7 | msgid "Collecting data..." 8 | msgstr "正在收集数据..." 9 | 10 | msgid "NOT RUNNING" 11 | msgstr "未运行" 12 | 13 | msgid "RUNNING" 14 | msgstr "运行中" 15 | 16 | msgid "Access Control" 17 | msgstr "访问限制" 18 | 19 | msgid "Use the blacklist or whitelist mode to control whether a client in the list can connect to the Internet." 20 | msgstr "使用黑名单或者白名单模式控制列表中的客户端是否能够连接到互联网。" 21 | 22 | msgid "Global setting" 23 | msgstr "全局设置" 24 | 25 | msgid "Enable" 26 | msgstr "开启" 27 | 28 | msgid "Limit mode" 29 | msgstr "限制模式" 30 | 31 | msgid "Whitelist" 32 | msgstr "白名单" 33 | 34 | msgid "Blacklist" 35 | msgstr "黑名单" 36 | 37 | msgid "List setting" 38 | msgstr "名单设置" 39 | 40 | msgid "In blacklist mode, the client in the list is prohibited from connecting to the Internet. In whitelist mode, only the clients in the list can connect to the Internet." 41 | msgstr "如果是黑名单模式,列表中的客户端将被禁止连接到互联网;白名单模式表示仅有列表中的客户端可以连接到互联网。" 42 | 43 | msgid "MAC Address" 44 | msgstr "MAC 地址" 45 | -------------------------------------------------------------------------------- /luci-app-control-webrestriction/po/zh_Hans: -------------------------------------------------------------------------------- 1 | zh-cn -------------------------------------------------------------------------------- /luci-app-control-webrestriction/root/etc/config/webrestriction: -------------------------------------------------------------------------------- 1 | 2 | config basic 3 | option enable '0' 4 | option limit_type 'blacklist' 5 | 6 | -------------------------------------------------------------------------------- /luci-app-control-webrestriction/root/etc/uci-defaults/luci-app-control-webrestriction: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | uci -q batch <<-EOF >/dev/null 4 | delete ucitrack.@webrestriction[-1] 5 | add ucitrack webrestriction 6 | set ucitrack.@webrestriction[-1].init=webrestriction 7 | commit ucitrack 8 | EOF 9 | 10 | rm -f /tmp/luci-indexcache 11 | exit 0 12 | -------------------------------------------------------------------------------- /luci-app-control-webrestriction/root/usr/share/rpcd/acl.d/luci-app-control-webrestriction.json: -------------------------------------------------------------------------------- 1 | { 2 | "luci-app-control-webrestriction": { 3 | "description": "Grant UCI access for luci-app-control-webrestriction", 4 | "read": { 5 | "uci": [ "webrestriction" ] 6 | }, 7 | "write": { 8 | "uci": [ "webrestriction" ] 9 | } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /luci-app-control-weburl/Makefile: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2016 Openwrt.org 2 | # 3 | # This is free software, licensed under the Apache License, Version 2.0 . 4 | # 5 | 6 | include $(TOPDIR)/rules.mk 7 | 8 | LUCI_TITLE:=LuCI support for Weburl 9 | LUCI_DEPENDS:=+iptables-mod-filter +kmod-ipt-filter 10 | LUCI_PKGARCH:=all 11 | PKG_VERSION:=1.1 12 | PKG_RELEASE:=1 13 | 14 | include $(TOPDIR)/feeds/luci/luci.mk 15 | 16 | # call BuildPackage - OpenWrt buildroot signature 17 | -------------------------------------------------------------------------------- /luci-app-control-weburl/luasrc/controller/weburl.lua: -------------------------------------------------------------------------------- 1 | module("luci.controller.weburl", package.seeall) 2 | 3 | function index() 4 | if not nixio.fs.access("/etc/config/weburl") then return end 5 | 6 | entry({"admin", "control"}, firstchild(), "Control", 44).dependent = false 7 | entry({"admin", "control", "weburl"}, cbi("weburl"), _("URL Filter"), 12).dependent = true 8 | entry({"admin", "control", "weburl", "status"}, call("status")).leaf = true 9 | end 10 | 11 | function status() 12 | local e = {} 13 | e.status = luci.sys.call("iptables -L FORWARD | grep WEBURL >/dev/null") == 0 14 | luci.http.prepare_content("application/json") 15 | luci.http.write_json(e) 16 | end 17 | -------------------------------------------------------------------------------- /luci-app-control-weburl/luasrc/view/weburl/index.htm: -------------------------------------------------------------------------------- 1 | <%# 2 | Copyright 2016 Chen RuiWei 3 | Licensed to the public under the Apache License 2.0. 4 | -%> 5 | 6 | <% include("cbi/map") %> 7 | 19 | -------------------------------------------------------------------------------- /luci-app-control-weburl/luasrc/view/weburl/weburl.htm: -------------------------------------------------------------------------------- 1 | <%+cbi/valueheader%> 2 | <%=pcdata(self:cfgvalue(section) or self.default or "")%> 3 | <%+cbi/valuefooter%> 4 | -------------------------------------------------------------------------------- /luci-app-control-weburl/po/zh-cn/weburl.po: -------------------------------------------------------------------------------- 1 | msgid "Control" 2 | msgstr "管控" 3 | 4 | msgid "Running Status" 5 | msgstr "运行状态" 6 | 7 | msgid "Collecting data..." 8 | msgstr "正在收集数据..." 9 | 10 | msgid "NOT RUNNING" 11 | msgstr "未运行" 12 | 13 | msgid "RUNNING" 14 | msgstr "运行中" 15 | 16 | msgid "URL Filter" 17 | msgstr "网址过滤" 18 | 19 | msgid "Set keyword filtering here, can be any character in the URL, can filter such as video sites, QQ, thunder, Taobao..." 20 | msgstr "在这里设置关键词过滤,可以是URL里任意字符,可以过滤如视频网站、QQ、迅雷、淘宝。。。" 21 | 22 | msgid "Basic setting" 23 | msgstr "基本设置" 24 | 25 | msgid "In general, normal filtering works fine, but forced filtering uses more complex algorithms and leads to higher CPU usage." 26 | msgstr "一般来说普通过滤效果就很好了,强制过滤会使用更复杂的算法导致更高的CPU占用。" 27 | 28 | msgid "Enable" 29 | msgstr "启用" 30 | 31 | msgid "Forced filter" 32 | msgstr "强效过滤" 33 | 34 | msgid "Keyword setting" 35 | msgstr "关键词设置" 36 | 37 | msgid "MAC addresses do not filter out all clients. For example, only specified clients are filtered out. Filtering time is optional." 38 | msgstr "MAC不设置为全客户端过滤,如设置只过滤指定的客户端。过滤时间可不设置。" 39 | 40 | msgid "MAC Address" 41 | msgstr "MAC 地址" 42 | 43 | msgid "Start time" 44 | msgstr "开始时间" 45 | 46 | msgid "End time" 47 | msgstr "结束时间" 48 | 49 | msgid "Keyword" 50 | msgstr "关键字" 51 | -------------------------------------------------------------------------------- /luci-app-control-weburl/po/zh_Hans: -------------------------------------------------------------------------------- 1 | zh-cn -------------------------------------------------------------------------------- /luci-app-control-weburl/root/etc/config/weburl: -------------------------------------------------------------------------------- 1 | 2 | config basic 3 | option enable '0' 4 | option algos '0' 5 | 6 | config macbind 7 | option keyword 'qq.com' 8 | option enable '0' 9 | option macaddr '00:0C:29:C8:99:9E' 10 | 11 | config macbind 12 | option keyword 'taobao.com' 13 | option enable '0' 14 | 15 | config macbind 16 | option enable '0' 17 | option keyword 'youku.com' 18 | 19 | config macbind 20 | option enable '0' 21 | option keyword 'www' 22 | 23 | -------------------------------------------------------------------------------- /luci-app-control-weburl/root/etc/uci-defaults/luci-app-control-weburl: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | uci -q batch <<-EOF >/dev/null 4 | delete ucitrack.@weburl[-1] 5 | add ucitrack weburl 6 | set ucitrack.@weburl[-1].init=weburl 7 | commit ucitrack 8 | EOF 9 | 10 | rm -f /tmp/luci-indexcache 11 | exit 0 12 | -------------------------------------------------------------------------------- /luci-app-control-weburl/root/usr/share/rpcd/acl.d/luci-app-control-weburl.json: -------------------------------------------------------------------------------- 1 | { 2 | "luci-app-control-weburl": { 3 | "description": "Grant UCI access for luci-app-control-weburl", 4 | "read": { 5 | "uci": [ "weburl" ] 6 | }, 7 | "write": { 8 | "uci": [ "weburl" ] 9 | } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /luci-app-fileassistant/Makefile: -------------------------------------------------------------------------------- 1 | # From https://github.com/DarkDean89/luci-app-filebrowser 2 | # From https://github.com/stuarthua/oh-my-openwrt/tree/master/stuart/luci-app-fileassistant 3 | # This is free software, licensed under the Apache License, Version 2.0 . 4 | 5 | include $(TOPDIR)/rules.mk 6 | 7 | LUCI_TITLE:=LuCI support for Fileassistant 8 | LUCI_PKGARCH:=all 9 | PKG_VERSION:=1.0-5 10 | PKG_RELEASE:= 11 | 12 | include $(TOPDIR)/feeds/luci/luci.mk 13 | 14 | # call BuildPackage - OpenWrt buildroot signature -------------------------------------------------------------------------------- /luci-app-fileassistant/htdocs/luci-static/resources/fileassistant/file-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Lienol/openwrt-package/ced34df18c654df8cfda04193b2d1e7852678382/luci-app-fileassistant/htdocs/luci-static/resources/fileassistant/file-icon.png -------------------------------------------------------------------------------- /luci-app-fileassistant/htdocs/luci-static/resources/fileassistant/folder-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Lienol/openwrt-package/ced34df18c654df8cfda04193b2d1e7852678382/luci-app-fileassistant/htdocs/luci-static/resources/fileassistant/folder-icon.png -------------------------------------------------------------------------------- /luci-app-fileassistant/htdocs/luci-static/resources/fileassistant/link-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Lienol/openwrt-package/ced34df18c654df8cfda04193b2d1e7852678382/luci-app-fileassistant/htdocs/luci-static/resources/fileassistant/link-icon.png -------------------------------------------------------------------------------- /luci-app-fileassistant/luasrc/view/fileassistant.htm: -------------------------------------------------------------------------------- 1 | <%+header%> 2 | 3 | 4 |

文件助手

5 |
6 | 7 |
8 |
文件列表
9 | 10 | 11 |
12 |
13 | 14 | 15 |
16 |
17 |
18 | 19 | 20 | 21 | <%+footer%> 22 | -------------------------------------------------------------------------------- /luci-app-filebrowser/Makefile: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2018-2020 Lienol 2 | # 3 | # This is free software, licensed under the Apache License, Version 2.0 . 4 | # 5 | 6 | include $(TOPDIR)/rules.mk 7 | 8 | LUCI_TITLE:=LuCI support for FileBrowser 9 | LUCI_PKGARCH:=all 10 | PKG_VERSION:=1.1 11 | PKG_RELEASE:=1 12 | 13 | include $(TOPDIR)/feeds/luci/luci.mk 14 | 15 | # call BuildPackage - OpenWrt buildroot signature 16 | 17 | 18 | -------------------------------------------------------------------------------- /luci-app-filebrowser/luasrc/view/filebrowser/log.htm: -------------------------------------------------------------------------------- 1 | 25 |
26 | 27 | <%:Logs%> 28 | 29 | 30 | 31 |
-------------------------------------------------------------------------------- /luci-app-filebrowser/luasrc/view/filebrowser/status.htm: -------------------------------------------------------------------------------- 1 | <% 2 | local dsp = require "luci.dispatcher" 3 | -%> 4 | 5 |
6 | <%:Running Status%> 7 |
8 |
9 | 10 |
<%:Collecting data...%>
11 |
12 |
13 |
14 | 15 | -------------------------------------------------------------------------------- /luci-app-filebrowser/po/zh_Hans: -------------------------------------------------------------------------------- 1 | zh-cn -------------------------------------------------------------------------------- /luci-app-filebrowser/root/etc/config/filebrowser: -------------------------------------------------------------------------------- 1 | 2 | config global 3 | option port '8088' 4 | option root_path '/' 5 | option project_directory '/tmp' 6 | option enable '0' 7 | 8 | -------------------------------------------------------------------------------- /luci-app-filebrowser/root/etc/init.d/filebrowser: -------------------------------------------------------------------------------- 1 | #!/bin/sh /etc/rc.common 2 | # Copyright (C) 2018-2020 Lienol 3 | 4 | START=99 5 | 6 | LOG_PATH="/var/log/filebrowser.log" 7 | 8 | echolog() { 9 | echo -e "$(date "+%Y-%m-%d %H:%M:%S"): $1" >> $LOG_PATH 10 | } 11 | 12 | config_t_get() { 13 | local index=0 14 | [ -n "$4" ] && index=$4 15 | local ret=$(uci get filebrowser.@$1[$index].$2 2>/dev/null) 16 | echo ${ret:=$3} 17 | } 18 | start() { 19 | ENABLED=$(config_t_get global enable 0) 20 | [ "$ENABLED" = "0" ] && return 21 | PORT=$(config_t_get global port 8088) 22 | ROOT_PATH=$(config_t_get global root_path /) 23 | project_directory=$(config_t_get global project_directory /tmp) 24 | [ ! -f "$project_directory/filebrowser" ] && echolog "在$project_directory找不到FileBrowser主程序,请下载。" && exit 25 | export HOME="/root" 26 | $project_directory/filebrowser -a 0.0.0.0 -p $PORT -r $ROOT_PATH -d ${ROOT_PATH}filebrowser.db -l $LOG_PATH >/dev/null 2>&1 & 27 | } 28 | 29 | stop() { 30 | busybox ps -w | grep -v "grep" | grep "$project_directory/filebrowser -a 0.0.0.0" | awk '{print $1}' | xargs kill -9 >/dev/null 2>&1 & 31 | rm -rf $LOG_PATH 32 | } 33 | 34 | restart() { 35 | stop 36 | sleep 1 37 | start 38 | } -------------------------------------------------------------------------------- /luci-app-filebrowser/root/etc/uci-defaults/luci-app-filebrowser: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | uci -q batch <<-EOF >/dev/null 4 | delete ucitrack.@filebrowser[-1] 5 | add ucitrack filebrowser 6 | set ucitrack.@filebrowser[-1].init=filebrowser 7 | commit ucitrack 8 | EOF 9 | 10 | rm -f /tmp/luci-indexcache 11 | exit 0 12 | -------------------------------------------------------------------------------- /luci-app-filebrowser/root/usr/share/rpcd/acl.d/luci-app-filebrowser.json: -------------------------------------------------------------------------------- 1 | { 2 | "luci-app-filebrowser": { 3 | "description": "Grant UCI access for luci-app-filebrowser", 4 | "read": { 5 | "uci": [ "filebrowser" ] 6 | }, 7 | "write": { 8 | "uci": [ "filebrowser" ] 9 | } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /luci-app-guest-wifi/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2018 By-Ameng Openwrt.org 3 | # 4 | # This is free software, licensed under the Apache License, Version 2.0 . 5 | # 6 | 7 | include $(TOPDIR)/rules.mk 8 | 9 | LUCI_TITLE:=luci-app-guest-wifi 10 | LUCI_DEPENDS:= 11 | LUCI_PKGARCH:=all 12 | PKG_VERSION:=1.0 13 | PKG_RELEASE:=2 14 | 15 | include $(TOPDIR)/feeds/luci/luci.mk 16 | 17 | # call BuildPackage - OpenWrt buildroot signature 18 | -------------------------------------------------------------------------------- /luci-app-guest-wifi/luasrc/controller/guest-wifi.lua: -------------------------------------------------------------------------------- 1 | module("luci.controller.guest-wifi", package.seeall) 2 | 3 | function index() 4 | if not nixio.fs.access("/etc/config/guest-wifi") then 5 | return 6 | end 7 | entry({"admin","network","guest-wifi"}, cbi("guest-wifi"), translate("Guest-wifi"), 16) 8 | end 9 | -------------------------------------------------------------------------------- /luci-app-guest-wifi/po/zh_Hans: -------------------------------------------------------------------------------- 1 | zh-cn -------------------------------------------------------------------------------- /luci-app-guest-wifi/root/etc/config/guest-wifi: -------------------------------------------------------------------------------- 1 | 2 | config guest-wifi 3 | option enable '0' 4 | option wifi_name 'Guest-WiFi' 5 | option interface_name 'guest' 6 | option encryption 'psk2' 7 | option passwd 'guestnetwork' 8 | option interface_ip '192.168.4.1' 9 | option isolate '1' 10 | option start '50' 11 | option limit '200' 12 | option leasetime '1h' 13 | option device 'radio0' 14 | option create '0' 15 | -------------------------------------------------------------------------------- /luci-app-guest-wifi/root/etc/uci-defaults/luci-app-guest-wifi: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | uci -q batch <<-EOF >/dev/null 4 | delete ucitrack.@guest-wifi[-1] 5 | add ucitrack guest-wifi 6 | set ucitrack.@guest-wifi[-1].init=guest-wifi 7 | commit ucitrack 8 | EOF 9 | 10 | rm -f /tmp/luci-indexcache 11 | exit 0 12 | -------------------------------------------------------------------------------- /luci-app-guest-wifi/root/usr/share/rpcd/acl.d/luci-app-guest-wifi.json: -------------------------------------------------------------------------------- 1 | { 2 | "luci-app-guest-wifi": { 3 | "description": "Grant UCI access for luci-app-guest-wifi", 4 | "read": { 5 | "uci": [ "guest-wifi" ] 6 | }, 7 | "write": { 8 | "uci": [ "guest-wifi" ] 9 | } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /luci-app-ipsec-server/Makefile: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2018-2021 Lienol 2 | # 3 | # This is free software, licensed under the Apache License, Version 2.0 . 4 | # 5 | 6 | include $(TOPDIR)/rules.mk 7 | 8 | PKG_NAME:=luci-app-ipsec-server 9 | PKG_VERSION:=20211223 10 | PKG_RELEASE:=4 11 | 12 | PKG_MAINTAINER:=Lienol 13 | 14 | LUCI_TITLE:=LuCI support for IPSec VPN Server 15 | LUCI_DEPENDS:=+kmod-tun +luci-lib-jsonc +xl2tpd +strongswan \ 16 | +PACKAGE_strongswan:strongswan-mod-kernel-libipsec \ 17 | +PACKAGE_strongswan:strongswan-mod-openssl \ 18 | +PACKAGE_strongswan:strongswan-mod-xauth-generic \ 19 | +(PACKAGE_strongswan-mod-kdf||PACKAGE_strongswan-mod-openssl||PACKAGE_strongswan-mod-wolfssl):strongswan-minimal 20 | LUCI_PKGARCH:=all 21 | 22 | define Package/$(PKG_NAME)/conffiles 23 | /etc/config/luci-app-ipsec-server 24 | endef 25 | 26 | include $(TOPDIR)/feeds/luci/luci.mk 27 | 28 | # call BuildPackage - OpenWrt buildroot signature 29 | -------------------------------------------------------------------------------- /luci-app-ipsec-server/luasrc/controller/ipsec-server.lua: -------------------------------------------------------------------------------- 1 | -- Copyright 2018-2020 Lienol 2 | module("luci.controller.ipsec-server", package.seeall) 3 | 4 | function index() 5 | if not nixio.fs.access("/etc/config/luci-app-ipsec-server") then 6 | return 7 | end 8 | 9 | entry({"admin", "vpn"}, firstchild(), "VPN", 45).dependent = false 10 | entry({"admin", "vpn", "ipsec-server"}, alias("admin", "vpn", "ipsec-server", "settings"), _("IPSec VPN Server"), 49).dependent = false 11 | entry({"admin", "vpn", "ipsec-server", "settings"}, cbi("ipsec-server/settings"), _("General Settings"), 10).leaf = true 12 | entry({"admin", "vpn", "ipsec-server", "users"}, cbi("ipsec-server/users"), _("Users Manager"), 20).leaf = true 13 | entry({"admin", "vpn", "ipsec-server", "l2tp_user"}, cbi("ipsec-server/l2tp_user")).leaf = true 14 | entry({"admin", "vpn", "ipsec-server", "online"}, cbi("ipsec-server/online"), _("L2TP Online Users"), 30).leaf = true 15 | entry({"admin", "vpn", "ipsec-server", "status"}, call("act_status")).leaf = true 16 | end 17 | 18 | function act_status() 19 | local e = {} 20 | e["ipsec_status"] = luci.sys.call("/usr/bin/pgrep ipsec >/dev/null") == 0 21 | e["l2tp_status"] = luci.sys.call("top -bn1 | grep -v grep | grep '/var/etc/xl2tpd' >/dev/null") == 0 22 | luci.http.prepare_content("application/json") 23 | luci.http.write_json(e) 24 | end 25 | -------------------------------------------------------------------------------- /luci-app-ipsec-server/luasrc/model/cbi/ipsec-server/l2tp_user.lua: -------------------------------------------------------------------------------- 1 | local d = require "luci.dispatcher" 2 | local sys = require "luci.sys" 3 | 4 | m = Map("luci-app-ipsec-server", "L2TP/IPSec PSK " .. translate("Users Manager")) 5 | m.redirect = d.build_url("admin", "vpn", "ipsec-server", "users") 6 | 7 | if sys.call("command -v xl2tpd > /dev/null") == 0 then 8 | s = m:section(NamedSection, arg[1], "l2tp_users", "") 9 | s.addremove = false 10 | s.anonymous = true 11 | 12 | o = s:option(Flag, "enabled", translate("Enabled")) 13 | o.default = 1 14 | o.rmempty = false 15 | 16 | o = s:option(Value, "username", translate("Username")) 17 | o.placeholder = translate("Username") 18 | o.rmempty = false 19 | 20 | o = s:option(Value, "password", translate("Password")) 21 | o.placeholder = translate("Password") 22 | o.rmempty = false 23 | 24 | o = s:option(Value, "ipaddress", translate("IP address")) 25 | o.placeholder = translate("Automatically") 26 | o.datatype = "ip4addr" 27 | o.rmempty = true 28 | 29 | o = s:option(DynamicList, "routes", translate("Static Routes")) 30 | o.placeholder = "192.168.10.0/24" 31 | o.datatype = "ipmask4" 32 | o.rmempty = true 33 | end 34 | 35 | return m 36 | -------------------------------------------------------------------------------- /luci-app-ipsec-server/luasrc/view/ipsec-server/ipsec-server_status.htm: -------------------------------------------------------------------------------- 1 | <% include("cbi/map") %> 2 | 22 | -------------------------------------------------------------------------------- /luci-app-ipsec-server/po/zh_Hans: -------------------------------------------------------------------------------- 1 | zh-cn -------------------------------------------------------------------------------- /luci-app-ipsec-server/root/etc/config/luci-app-ipsec-server: -------------------------------------------------------------------------------- 1 | 2 | config service 'ipsec' 3 | option enabled '0' 4 | option secret 'ipsec' 5 | option clientip '192.168.100.10/24' 6 | 7 | 8 | -------------------------------------------------------------------------------- /luci-app-ipsec-server/root/etc/uci-defaults/luci-app-ipsec-server: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | uci -q batch <<-EOF >/dev/null 4 | delete firewall.luci_app_ipsec_server 5 | set firewall.luci_app_ipsec_server=include 6 | set firewall.luci_app_ipsec_server.type=script 7 | set firewall.luci_app_ipsec_server.path=/var/etc/ipsecvpn.include 8 | set firewall.luci_app_ipsec_server.reload=1 9 | EOF 10 | 11 | uci -q batch <<-EOF >/dev/null 12 | delete ucitrack.@luci-app-ipsec-server[-1] 13 | add ucitrack luci-app-ipsec-server 14 | set ucitrack.@luci-app-ipsec-server[-1].init=luci-app-ipsec-server 15 | commit ucitrack 16 | EOF 17 | 18 | /etc/init.d/ipsec disable 2>/dev/null 19 | /etc/init.d/ipsec stop 2>/dev/null 20 | /etc/init.d/xl2tpd disable 2>/dev/null 21 | /etc/init.d/xl2tpd stop 2>/dev/null 22 | rm -rf /tmp/luci-*cache 23 | exit 0 24 | -------------------------------------------------------------------------------- /luci-app-ipsec-server/root/usr/share/rpcd/acl.d/luci-app-ipsec-server.json: -------------------------------------------------------------------------------- 1 | { 2 | "luci-app-ipsec-server": { 3 | "description": "Grant UCI access for luci-app-ipsec-server", 4 | "read": { 5 | "uci": [ "luci-app-ipsec-server" ] 6 | }, 7 | "write": { 8 | "uci": [ "luci-app-ipsec-server" ] 9 | } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /luci-app-ipsec-server/root/usr/share/xl2tpd/ip-down: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | _LOGOUT_TIME="$(date "+%Y-%m-%d %H:%M:%S")" 4 | CONFIG="luci-app-ipsec-server" 5 | L2TP_PATH=/var/etc/xl2tpd 6 | L2TP_SESSION_PATH=${L2TP_PATH}/session 7 | 8 | _USERNAME=${PEERNAME} 9 | _IFACE=${1} 10 | _TTY=${2} 11 | _SPEED=${3} 12 | _LOCALIP=${4} 13 | _PEERIP=${5} 14 | _REMOTEIP=${6} 15 | _BYTES_SENT=${BYTES_SENT} 16 | _BYTES_RCVD=${BYTES_RCVD} 17 | _CONNECT_TIME=${CONNECT_TIME} 18 | 19 | rm -f ${L2TP_SESSION_PATH}/${_USERNAME}.${_IFACE} 20 | rm -f /var/run/${_IFACE}.pid 21 | 22 | #可根据退出的账号自定义脚本,如静态路由表,组网等。 23 | SCRIPT="/usr/share/xl2tpd/ip-down.d/${_USERNAME}" 24 | [ -s "$SCRIPT" ] && { 25 | [ ! -x "$SCRIPT" ] && chmod 0755 "$SCRIPT" 26 | "$SCRIPT" "$@" 27 | } 28 | -------------------------------------------------------------------------------- /luci-app-kodexplorer/Makefile: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2018-2022 Lienol 2 | # 3 | # This is free software, licensed under the GNU General Public License v3. 4 | # 5 | 6 | include $(TOPDIR)/rules.mk 7 | 8 | LUCI_TITLE:=LuCI support for KodExplorer 9 | LUCI_DEPENDS:=+nginx-ssl +unzip +zoneinfo-asia +php8 +php8-fastcgi +php8-fpm +php8-mod-curl +php8-mod-dom +php8-mod-gd +php8-mod-iconv +php8-mod-mbstring +php8-mod-opcache +php8-mod-session +php8-mod-zip +php8-mod-sqlite3 +php8-mod-pdo +php8-mod-pdo-sqlite +php8-mod-pdo-mysql +php8-mod-xml +php8-mod-xmlreader +php8-mod-xmlwriter 10 | LUCI_PKGARCH:=all 11 | PKG_VERSION:=20220109 12 | PKG_RELEASE:=1 13 | 14 | include $(TOPDIR)/feeds/luci/luci.mk 15 | 16 | # call BuildPackage - OpenWrt buildroot signature 17 | -------------------------------------------------------------------------------- /luci-app-kodexplorer/po/zh_Hans: -------------------------------------------------------------------------------- 1 | zh-cn -------------------------------------------------------------------------------- /luci-app-kodexplorer/root/etc/config/kodexplorer: -------------------------------------------------------------------------------- 1 | 2 | config global 3 | option port '8081' 4 | option upload_max_filesize '64M' 5 | list open_basedir '/' 6 | option https '0' 7 | option project_directory '/tmp/kodexplorer' 8 | option ipv6 '0' 9 | option memory_limit '64M' 10 | option enable '0' 11 | 12 | -------------------------------------------------------------------------------- /luci-app-kodexplorer/root/etc/kodexplorer/nginx.conf.template: -------------------------------------------------------------------------------- 1 | user root root; 2 | worker_processes auto; 3 | pid |PID|; 4 | events { 5 | worker_connections 1024; 6 | } 7 | http { 8 | include /etc/nginx/mime.types; 9 | sendfile on; 10 | keepalive_timeout 65; 11 | server { 12 | listen |PORT|; 13 | listen [::]:|PORT|; 14 | |ssl_certificate| 15 | |ssl_certificate_key| 16 | ssl_session_cache shared:SSL:1m; 17 | ssl_session_timeout 5m; 18 | ssl_ciphers HIGH:!aNULL:!MD5; 19 | ssl_prefer_server_ciphers on; 20 | server_name localhost; 21 | root |project_directory|; 22 | index index.html index.htm index.php; 23 | location ~ \.php(.*)$ { 24 | fastcgi_pass unix:|SOCK|; # 通过 Unix 套接字执行 PHP 25 | fastcgi_index index.php; 26 | fastcgi_split_path_info ^(.+\.php)(.*)$; 27 | fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; # 修复 Nginx fastcgi 漏洞 28 | fastcgi_param PATH_INFO $fastcgi_path_info; 29 | include /etc/nginx/fastcgi_params; 30 | client_max_body_size |upload_max_filesize|; 31 | client_body_temp_path |temp_path|; 32 | client_body_timeout 3600s; 33 | fastcgi_connect_timeout 3600s; 34 | fastcgi_send_timeout 3600s; 35 | fastcgi_read_timeout 3600s; 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /luci-app-kodexplorer/root/etc/kodexplorer/php-fpm.conf.template: -------------------------------------------------------------------------------- 1 | [global] 2 | pid = |PID| 3 | error_log = |ERROR_LOG| 4 | [www] 5 | user = root 6 | listen = |SOCK| 7 | listen.mode = 0666 8 | listen.allowed_clients = 127.0.0.1 9 | pm = dynamic 10 | pm.max_children = 5 11 | pm.start_servers = 2 12 | pm.min_spare_servers = 1 13 | pm.max_spare_servers = 3 14 | chdir = / 15 | -------------------------------------------------------------------------------- /luci-app-kodexplorer/root/etc/kodexplorer/php.ini.template: -------------------------------------------------------------------------------- 1 | [PHP] 2 | zend.ze1_compatibility_mode = Off 3 | engine = On 4 | precision = 12 5 | y2k_compliance = On 6 | output_buffering = Off 7 | zlib.output_compression = Off 8 | implicit_flush = Off 9 | unserialize_callback_func = 10 | serialize_precision = 100 11 | 12 | open_basedir = /tmp:|project_directory|:|open_basedir|:/usr/bin/ 13 | disable_functions = 14 | disable_classes = 15 | expose_php = On 16 | max_execution_time = 3600 17 | max_input_time = 3600 18 | memory_limit = |memory_limit| 19 | error_reporting = E_ALL & ~E_NOTICE & ~E_STRICT 20 | 21 | display_errors = On 22 | display_startup_errors = Off 23 | log_errors = Off 24 | ignore_repeated_errors = Off 25 | ignore_repeated_source = Off 26 | report_memleaks = On 27 | track_errors = Off 28 | 29 | variables_order = "EGPCS" 30 | request_order = "GP" 31 | register_globals = Off 32 | register_long_arrays = Off 33 | register_argc_argv = On 34 | auto_globals_jit = On 35 | post_max_size = |upload_max_filesize| 36 | magic_quotes_runtime = Off 37 | magic_quotes_sybase = Off 38 | auto_prepend_file = 39 | auto_append_file = 40 | default_mimetype = "text/html" 41 | 42 | ;doc_root = "/www" 43 | user_dir = 44 | extension_dir = "/usr/lib/php8" 45 | enable_dl = On 46 | cgi.fix_pathinfo=1 47 | 48 | file_uploads = On 49 | upload_tmp_dir = "/tmp" 50 | upload_max_filesize = |upload_max_filesize| 51 | max_file_uploads = 1000 52 | 53 | allow_url_fopen = On 54 | allow_url_include = Off 55 | default_socket_timeout = 60 56 | -------------------------------------------------------------------------------- /luci-app-kodexplorer/root/etc/uci-defaults/luci-kodexplorer: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | uci -q batch <<-EOF >/dev/null 4 | delete ucitrack.@kodexplorer[-1] 5 | add ucitrack kodexplorer 6 | set ucitrack.@kodexplorer[-1].init=kodexplorer 7 | commit ucitrack 8 | EOF 9 | 10 | /etc/init.d/php8-fpm stop 11 | /etc/init.d/php8-fpm disable 12 | rm -rf /tmp/luci-*cache 13 | exit 0 14 | -------------------------------------------------------------------------------- /luci-app-kodexplorer/root/usr/share/rpcd/acl.d/luci-app-kodexplorer.json: -------------------------------------------------------------------------------- 1 | { 2 | "luci-app-kodexplorer": { 3 | "description": "Grant UCI access for luci-app-kodexplorer", 4 | "read": { 5 | "uci": [ "kodexplorer" ] 6 | }, 7 | "write": { 8 | "uci": [ "kodexplorer" ] 9 | } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /luci-app-nginx-pingos/luasrc/controller/pingos.lua: -------------------------------------------------------------------------------- 1 | -- Copyright 2020 Lienol 2 | module("luci.controller.pingos", package.seeall) 3 | 4 | function index() 5 | if not nixio.fs.access("/etc/config/pingos") then return end 6 | 7 | entry({"admin", "nas"}, firstchild(), "NAS", 44).dependent = false 8 | entry({"admin", "nas", "pingos"}, cbi("pingos"), _("PingOS"), 3).dependent = true 9 | entry({"admin", "nas", "pingos", "status"}, call("act_status")).leaf = true 10 | end 11 | 12 | function act_status() 13 | local e = {} 14 | e.status = luci.sys.call("busybox ps -w | grep pingos | grep nginx | grep -v grep > /dev/null") == 0 15 | luci.http.prepare_content("application/json") 16 | luci.http.write_json(e) 17 | end 18 | -------------------------------------------------------------------------------- /luci-app-nginx-pingos/modules/nginx-client-module/COPYRIGHT: -------------------------------------------------------------------------------- 1 | Copyright (C) 2016-2020, by Jie Wu "AlexWoo" . 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions 6 | are met: 7 | 1. Redistributions of source code must retain the above copyright 8 | notice, this list of conditions and the following disclaimer. 9 | 2. Redistributions in binary form must reproduce the above copyright 10 | notice, this list of conditions and the following disclaimer in the 11 | documentation and/or other materials provided with the distribution. 12 | 13 | THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 14 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 15 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 16 | ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 17 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 18 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 19 | OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 20 | HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 21 | LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 22 | OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 23 | SUCH DAMAGE. 24 | 25 | -------------------------------------------------------------------------------- /luci-app-nginx-pingos/modules/nginx-client-module/config: -------------------------------------------------------------------------------- 1 | ngx_addon_name=ngx_client_module 2 | 3 | 4 | CORE_MODULES="$CORE_MODULES \ 5 | ngx_client_module \ 6 | ngx_http_client_module \ 7 | " 8 | 9 | NGX_ADDON_SRCS="$NGX_ADDON_SRCS \ 10 | $ngx_addon_dir/ngx_client.c \ 11 | $ngx_addon_dir/ngx_http_client.c \ 12 | " 13 | 14 | NGX_ADDON_DEPS="$NGX_ADDON_DEPS \ 15 | $ngx_addon_dir/ngx_client.h \ 16 | $ngx_addon_dir/ngx_http_client.h \ 17 | " 18 | 19 | CFLAGS="$CFLAGS -I $ngx_addon_dir" 20 | -------------------------------------------------------------------------------- /luci-app-nginx-pingos/modules/nginx-client-module/t/config: -------------------------------------------------------------------------------- 1 | ngx_addon_name=ngx_client_test_module 2 | 3 | HTTP_MODULES="$HTTP_MODULES \ 4 | ngx_client_test_module \ 5 | ngx_http_client_test_module \ 6 | ngx_client_stat_module \ 7 | " 8 | 9 | NGX_ADDON_SRCS="$NGX_ADDON_SRCS 10 | $ngx_addon_dir/ngx_client_test_module.c \ 11 | $ngx_addon_dir/ngx_http_client_test_module.c \ 12 | $ngx_addon_dir/ngx_client_stat_module.c \ 13 | " 14 | -------------------------------------------------------------------------------- /luci-app-nginx-pingos/modules/nginx-client-module/t/nginx.conf: -------------------------------------------------------------------------------- 1 | 2 | user root; 3 | worker_processes 4; 4 | 5 | #error_log logs/error.log; 6 | #error_log logs/error.log notice; 7 | error_log logs/error.log info; 8 | 9 | #pid logs/nginx.pid; 10 | 11 | events { 12 | worker_connections 1024; 13 | resolver 192.168.84.254; 14 | dynamic_refresh_interval 5m; 15 | } 16 | 17 | 18 | http { 19 | include mime.types; 20 | default_type application/octet-stream; 21 | 22 | #log_format main '$remote_addr - $remote_user [$time_local] "$request" ' 23 | # '$status $body_bytes_sent "$http_referer" ' 24 | # '"$http_user_agent" "$http_x_forwarded_for"'; 25 | 26 | #access_log logs/access.log main; 27 | 28 | sendfile on; 29 | #tcp_nopush on; 30 | 31 | #keepalive_timeout 0; 32 | keepalive_timeout 65; 33 | 34 | #gzip on; 35 | 36 | server { 37 | listen 80; 38 | server_name localhost; 39 | 40 | location / { 41 | root html; 42 | index index.html index.htm; 43 | } 44 | 45 | location /client_test { 46 | client_test; 47 | } 48 | 49 | location /http_client_test { 50 | http_client_test; 51 | } 52 | 53 | location /client_stat { 54 | client_stat; 55 | } 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /luci-app-nginx-pingos/modules/nginx-client-module/t/tcpserver.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "fmt" 5 | "net" 6 | ) 7 | 8 | func handleConnection(c net.Conn) { 9 | b := make([]byte, 4096) 10 | 11 | for { 12 | n, err := c.Read(b) 13 | if err != nil { 14 | fmt.Print("Read Error ", err) 15 | c.Close() 16 | return 17 | } 18 | 19 | fmt.Print("recv ", n, " data:", string(b)) 20 | 21 | c.Write(b[0:n]) 22 | } 23 | } 24 | 25 | func main() { 26 | ln, err := net.Listen("tcp", ":10000") 27 | if err != nil { 28 | fmt.Print("Listen Error ", err) 29 | return 30 | } 31 | 32 | for { 33 | conn, err := ln.Accept() 34 | if err != nil { 35 | fmt.Print("Accept Error ", err) 36 | continue 37 | } 38 | 39 | go handleConnection(conn) 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /luci-app-nginx-pingos/modules/nginx-multiport-module/COPYRIGHT: -------------------------------------------------------------------------------- 1 | Copyright (C) 2016-2020, by Jie Wu "AlexWoo" . 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions 6 | are met: 7 | 1. Redistributions of source code must retain the above copyright 8 | notice, this list of conditions and the following disclaimer. 9 | 2. Redistributions in binary form must reproduce the above copyright 10 | notice, this list of conditions and the following disclaimer in the 11 | documentation and/or other materials provided with the distribution. 12 | 13 | THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 14 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 15 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 16 | ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 17 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 18 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 19 | OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 20 | HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 21 | LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 22 | OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 23 | SUCH DAMAGE. 24 | 25 | -------------------------------------------------------------------------------- /luci-app-nginx-pingos/modules/nginx-multiport-module/config: -------------------------------------------------------------------------------- 1 | ngx_addon_name=ngx_multiport_module 2 | 3 | EVENT_MODULES="$EVENT_MODULES \ 4 | ngx_event_multiport_module \ 5 | " 6 | 7 | CORE_MODULES="$CORE_MODULES \ 8 | ngx_process_slot_module \ 9 | ngx_stream_zone_module \ 10 | " 11 | 12 | HTTP_FILTER_MODULES="$HTTP_FILTER_MODULES \ 13 | ngx_http_broadcast_module \ 14 | ngx_http_inner_proxy_module \ 15 | " 16 | 17 | NGX_ADDON_SRCS="$NGX_ADDON_SRCS \ 18 | $ngx_addon_dir/ngx_multiport_misc.c \ 19 | $ngx_addon_dir/ngx_event_multiport_module.c \ 20 | $ngx_addon_dir/ngx_process_slot_module.c \ 21 | $ngx_addon_dir/ngx_stream_zone_module.c \ 22 | $ngx_addon_dir/ngx_http_broadcast_module.c \ 23 | $ngx_addon_dir/ngx_http_inner_proxy_module.c \ 24 | " 25 | 26 | NGX_ADDON_DEPS="$NGX_ADDON_DEPS \ 27 | $ngx_addon_dir/ngx_multiport.h \ 28 | $ngx_addon_dir/ngx_stream_zone_module.h \ 29 | " 30 | 31 | CFLAGS="$CFLAGS -I $ngx_addon_dir" 32 | -------------------------------------------------------------------------------- /luci-app-nginx-pingos/modules/nginx-multiport-module/ngx_multiport.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) AlexWoo(Wu Jie) wj19840501@gmail.com 3 | */ 4 | 5 | 6 | #ifndef _NGX_MULTIPORT_H_INCLUDED_ 7 | #define _NGX_MULTIPORT_H_INCLUDED_ 8 | 9 | 10 | #include 11 | #include 12 | #include 13 | 14 | 15 | /* 16 | * return value: 17 | * NGX_OK for success, NGX_ERROR for failed 18 | * paras: 19 | * pool: pool for port memory alloc 20 | * port: process real listen port while process_slot is pslot 21 | * multiport: port configure for processes, format as below: 22 | * port only: port 23 | * IPv4: host:port host must be ipaddr of IPv4 or * 24 | * IPv6: [host]:port host must be ipaddr of IPv6 25 | * Unix: unix:/path 26 | * pslot: process_slot 27 | */ 28 | ngx_int_t ngx_multiport_get_port(ngx_pool_t *pool, ngx_str_t *port, 29 | ngx_str_t *multiport, ngx_int_t pslot); 30 | 31 | 32 | /* 33 | * return value: 34 | * ngx_process_slot for successd, NGX_ERROR for failed 35 | * paras: 36 | * wpid: worker process id, 0 to ccf->worker_processes - 1 37 | */ 38 | ngx_int_t ngx_multiport_get_slot(ngx_uint_t wpid); 39 | 40 | 41 | /* 42 | * return value: 43 | * NGX_OK : for successd 44 | * NGX_ERROR : for failed 45 | * NGX_DECLINED: for not configured or send inner proxy to self 46 | * paras: 47 | * r : http request for send inner request to sibling worker 48 | * pslot: sibling worker ngx_process_slot 49 | */ 50 | ngx_int_t ngx_http_inner_proxy_request(ngx_http_request_t *r, ngx_int_t pslot); 51 | 52 | 53 | #endif 54 | -------------------------------------------------------------------------------- /luci-app-nginx-pingos/modules/nginx-multiport-module/ngx_stream_zone_module.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) AlexWoo(Wu Jie) wj19840501@gmail.com 3 | */ 4 | 5 | 6 | #ifndef _NGX_STREAM_ZONE_MODULE_H_INCLUDED_ 7 | #define _NGX_STREAM_ZONE_MODULE_H_INCLUDED_ 8 | 9 | 10 | #include 11 | #include 12 | #include 13 | 14 | 15 | /* 16 | * return value: 17 | * process_slot for owner of stream, NGX_ERROR for error 18 | * name: 19 | * stream name 20 | */ 21 | ngx_int_t ngx_stream_zone_insert_stream(ngx_str_t *name); 22 | 23 | /* 24 | * name: 25 | * stream name 26 | */ 27 | void ngx_stream_zone_delete_stream(ngx_str_t *name); 28 | 29 | /* 30 | * return value: 31 | * chain of stream zone state for returning to http client 32 | * paras: 33 | * r: http request to query status of rbuf 34 | * detail: print stream detail in log 35 | */ 36 | ngx_chain_t *ngx_stream_zone_state(ngx_http_request_t *r, ngx_flag_t detail); 37 | 38 | 39 | #endif 40 | -------------------------------------------------------------------------------- /luci-app-nginx-pingos/modules/nginx-multiport-module/t/config: -------------------------------------------------------------------------------- 1 | ngx_addon_name=ngx_multiport_test_module 2 | 3 | HTTP_MODULES="$HTTP_MODULES \ 4 | ngx_stream_zone_test_module \ 5 | ngx_multiport_test_module \ 6 | " 7 | 8 | NGX_ADDON_SRCS="$NGX_ADDON_SRCS 9 | $ngx_addon_dir/ngx_stream_zone_test_module.c \ 10 | $ngx_addon_dir/ngx_multiport_test_module.c \ 11 | " 12 | 13 | -------------------------------------------------------------------------------- /luci-app-nginx-pingos/modules/nginx-multiport-module/t/ngx_test_macro.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) AlexWoo(Wu Jie) wj19840501@gmail.com 3 | */ 4 | 5 | 6 | #ifndef _NGX_TEST_MACRO_H_INCLUDE_ 7 | #define _NGX_TEST_MACRO_H_INCLUDE_ 8 | 9 | 10 | #include 11 | #include 12 | 13 | 14 | static ngx_int_t count = 0; 15 | static ngx_int_t pass = 0; 16 | 17 | #define NGX_TEST_INIT count = 0, pass = 0; 18 | 19 | #define NGX_TEST_ISOK(testcase) \ 20 | { \ 21 | ngx_int_t __ret = testcase; \ 22 | ++count; \ 23 | if (__ret) ++pass; \ 24 | ngx_log_error(NGX_LOG_INFO, ngx_cycle->log, 0, " TEST "#testcase"%s",\ 25 | (__ret ? " ...OK" : " ...ERROR")); \ 26 | } 27 | 28 | #define NGX_TEST_INT(di, si) \ 29 | (di == si) 30 | 31 | static ngx_inline ngx_int_t 32 | ngx_test_str(ngx_str_t *nstr, char *cstr) 33 | { 34 | size_t len; 35 | 36 | len = ngx_strlen(cstr); 37 | 38 | return (nstr->len == len && ngx_memcmp(nstr->data, cstr, len) == 0); 39 | } 40 | 41 | #endif 42 | -------------------------------------------------------------------------------- /luci-app-nginx-pingos/modules/nginx-rtmp-module/AUTHORS: -------------------------------------------------------------------------------- 1 | Project author: 2 | 3 | Roman Arutyunyan 4 | Moscow, Russia, Pingo 5 | 6 | Contacts: 7 | arut@qip.ru 8 | arutyunyan.roman@gmail.com 9 | cczjp89@gmail.com -------------------------------------------------------------------------------- /luci-app-nginx-pingos/modules/nginx-rtmp-module/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2012-2014, Roman Arutyunyan 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | 7 | 1. Redistributions of source code must retain the above copyright notice, this 8 | list of conditions and the following disclaimer. 9 | 2. Redistributions in binary form must reproduce the above copyright notice, 10 | this list of conditions and the following disclaimer in the documentation 11 | and/or other materials provided with the distribution. 12 | 13 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 14 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 15 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 16 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR 17 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 18 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 19 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 20 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 21 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 22 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 23 | -------------------------------------------------------------------------------- /luci-app-nginx-pingos/modules/nginx-rtmp-module/dash/ngx_rtmp_mp4.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | #ifndef _NGX_RTMP_MP4_H_INCLUDED_ 4 | #define _NGX_RTMP_MP4_H_INCLUDED_ 5 | 6 | 7 | #include 8 | #include 9 | #include 10 | 11 | 12 | #define NGX_RTMP_MP4_SAMPLE_SIZE 0x01 13 | #define NGX_RTMP_MP4_SAMPLE_DURATION 0x02 14 | #define NGX_RTMP_MP4_SAMPLE_DELAY 0x04 15 | #define NGX_RTMP_MP4_SAMPLE_KEY 0x08 16 | 17 | 18 | typedef struct { 19 | uint32_t size; 20 | uint32_t duration; 21 | uint32_t delay; 22 | uint32_t timestamp; 23 | unsigned key:1; 24 | } ngx_rtmp_mp4_sample_t; 25 | 26 | 27 | typedef enum { 28 | NGX_RTMP_MP4_FILETYPE_INIT, 29 | NGX_RTMP_MP4_FILETYPE_SEG 30 | } ngx_rtmp_mp4_file_type_t; 31 | 32 | 33 | typedef enum { 34 | NGX_RTMP_MP4_VIDEO_TRACK, 35 | NGX_RTMP_MP4_AUDIO_TRACK 36 | } ngx_rtmp_mp4_track_type_t; 37 | 38 | 39 | ngx_int_t ngx_rtmp_mp4_write_ftyp(ngx_buf_t *b); 40 | ngx_int_t ngx_rtmp_mp4_write_styp(ngx_buf_t *b); 41 | ngx_int_t ngx_rtmp_mp4_write_moov(ngx_rtmp_session_t *s, ngx_buf_t *b, 42 | ngx_rtmp_mp4_track_type_t ttype); 43 | ngx_int_t ngx_rtmp_mp4_write_moof(ngx_buf_t *b, uint32_t earliest_pres_time, 44 | uint32_t sample_count, ngx_rtmp_mp4_sample_t *samples, 45 | ngx_uint_t sample_mask, uint32_t index); 46 | ngx_int_t ngx_rtmp_mp4_write_sidx(ngx_buf_t *b, 47 | ngx_uint_t reference_size, uint32_t earliest_pres_time, 48 | uint32_t latest_pres_time); 49 | ngx_uint_t ngx_rtmp_mp4_write_mdat(ngx_buf_t *b, ngx_uint_t size); 50 | 51 | 52 | #endif /* _NGX_RTMP_MP4_H_INCLUDED_ */ 53 | -------------------------------------------------------------------------------- /luci-app-nginx-pingos/modules/nginx-rtmp-module/hls/ngx_rtmp_mpegts.h: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | * Copyright (C) Roman Arutyunyan 4 | */ 5 | 6 | 7 | #ifndef _NGX_RTMP_MPEGTS_H_INCLUDED_ 8 | #define _NGX_RTMP_MPEGTS_H_INCLUDED_ 9 | 10 | 11 | #include 12 | #include 13 | #include 14 | 15 | 16 | typedef struct ngx_rtmp_mpegts_file_s ngx_rtmp_mpegts_file_t; 17 | 18 | 19 | typedef ssize_t (*ngx_rtmp_mpegts_write_pt) (ngx_rtmp_mpegts_file_t *file, 20 | u_char *in, size_t in_size); 21 | 22 | 23 | struct ngx_rtmp_mpegts_file_s { 24 | ngx_fd_t fd; 25 | ngx_log_t *log; 26 | off_t file_size; 27 | unsigned encrypt:1; 28 | unsigned size:4; 29 | u_char buf[16]; 30 | u_char iv[16]; 31 | AES_KEY key; 32 | ngx_int_t acodec; 33 | ngx_int_t vcodec; 34 | ngx_buf_t wbuf; 35 | ngx_rtmp_mpegts_write_pt whandle; 36 | }; 37 | 38 | 39 | typedef struct { 40 | uint64_t pts; 41 | uint64_t dts; 42 | ngx_uint_t pid; 43 | ngx_uint_t sid; 44 | ngx_uint_t cc; 45 | unsigned key:1; 46 | } ngx_rtmp_mpegts_frame_t; 47 | 48 | 49 | ngx_int_t ngx_rtmp_mpegts_init_encryption(ngx_rtmp_mpegts_file_t *file, 50 | u_char *key, size_t key_len, uint64_t iv); 51 | ngx_int_t ngx_rtmp_mpegts_open_file(ngx_rtmp_mpegts_file_t *file, u_char *path, 52 | ngx_log_t *log); 53 | ngx_int_t ngx_rtmp_mpegts_close_file(ngx_rtmp_mpegts_file_t *file); 54 | ngx_int_t ngx_rtmp_mpegts_write_header(ngx_rtmp_mpegts_file_t *file); 55 | ngx_int_t ngx_rtmp_mpegts_write_frame(ngx_rtmp_mpegts_file_t *file, 56 | ngx_rtmp_mpegts_frame_t *f, ngx_buf_t *b); 57 | 58 | #endif /* _NGX_RTMP_MPEGTS_H_INCLUDED_ */ 59 | -------------------------------------------------------------------------------- /luci-app-nginx-pingos/modules/nginx-rtmp-module/http/ngx_http_set_header.h: -------------------------------------------------------------------------------- 1 | #ifndef _NGX_RTMP_HTTP_HEADER_OUT_H_INCLUDED_ 2 | #define _NGX_RTMP_HTTP_HEADER_OUT_H_INCLUDED_ 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | ngx_int_t ngx_http_set_header_out(ngx_http_request_t *r, 9 | ngx_str_t *key, ngx_str_t *value); 10 | 11 | #endif 12 | -------------------------------------------------------------------------------- /luci-app-nginx-pingos/modules/nginx-rtmp-module/mpegts/ngx_mpegts_gop_module.h: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | * Copyright (C) Pingo (cczjp89@gmail.com) 4 | */ 5 | 6 | #ifndef _NGX_MPEGTS_GOP_MODULE_H_INCLUDE_ 7 | #define _NGX_MPEGTS_GOP_MODULE_H_INCLUDE_ 8 | 9 | #include "ngx_rtmp.h" 10 | 11 | ngx_int_t 12 | ngx_mpegts_gop_cache(ngx_rtmp_session_t *s, ngx_mpegts_frame_t *frame); 13 | ngx_int_t 14 | ngx_mpegts_gop_link(ngx_rtmp_session_t *s, ngx_rtmp_session_t *ss, 15 | ngx_msec_t time_offset, ngx_msec_t duration); 16 | ngx_int_t 17 | ngx_mpegts_gop_send(ngx_rtmp_session_t *s, ngx_rtmp_session_t *ss); 18 | 19 | #endif 20 | -------------------------------------------------------------------------------- /luci-app-nginx-pingos/modules/nginx-rtmp-module/mpegts/ngx_mpegts_live_module.h: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | * Copyright (C) Pingo (cczjp89@gmail.com) 4 | */ 5 | 6 | #ifndef _NGX_RTMP_MPEGTS_MODULE_H 7 | #define _NGX_RTMP_MPEGTS_MODULE_H 8 | 9 | #include "ngx_rtmp.h" 10 | 11 | typedef ngx_int_t (*ngx_mpegts_video_pt)(ngx_rtmp_session_t *s, 12 | ngx_mpegts_frame_t *frame); 13 | typedef ngx_int_t (*ngx_mpegts_audio_pt)(ngx_rtmp_session_t *s, 14 | ngx_mpegts_frame_t *frame); 15 | 16 | extern ngx_mpegts_video_pt ngx_mpegts_video; 17 | extern ngx_mpegts_audio_pt ngx_mpegts_audio; 18 | 19 | ngx_int_t 20 | ngx_rtmp_mpegts_gen_pmt(ngx_int_t vcodec, ngx_int_t acodec, 21 | ngx_log_t *log, u_char *pmt); 22 | ngx_int_t 23 | ngx_mpegts_live_video_filter(ngx_rtmp_session_t *s, ngx_mpegts_frame_t *frame); 24 | ngx_int_t 25 | ngx_mpegts_live_audio_filter(ngx_rtmp_session_t *s, ngx_mpegts_frame_t *frame); 26 | 27 | extern u_char ngx_rtmp_mpegts_pat[]; 28 | 29 | #endif 30 | -------------------------------------------------------------------------------- /luci-app-nginx-pingos/modules/nginx-rtmp-module/ngx_live.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) AlexWoo(Wu Jie) wj19840501@gmail.com 3 | */ 4 | 5 | 6 | #ifndef _NGX_LIVE_H_INCLUDED_ 7 | #define _NGX_LIVE_H_INCLUDED_ 8 | 9 | 10 | #include "ngx_rtmp.h" 11 | 12 | 13 | typedef struct { 14 | size_t stream_buckets; 15 | size_t server_buckets; 16 | 17 | ngx_live_server_t **servers; 18 | 19 | ngx_live_server_t *free_server; 20 | ngx_live_stream_t *free_stream; 21 | 22 | ngx_uint_t alloc_server_count; 23 | ngx_uint_t free_server_count; 24 | 25 | ngx_uint_t alloc_stream_count; 26 | ngx_uint_t free_stream_count; 27 | 28 | ngx_pool_t *pool; 29 | } ngx_live_conf_t; 30 | 31 | 32 | extern ngx_module_t ngx_live_module; 33 | 34 | 35 | /* 36 | * paras: 37 | * r: http request to query status of rbuf 38 | */ 39 | ngx_chain_t *ngx_live_state(ngx_http_request_t *r); 40 | 41 | 42 | #endif 43 | -------------------------------------------------------------------------------- /luci-app-nginx-pingos/modules/nginx-rtmp-module/ngx_netcall.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) AlexWoo(Wu Jie) wj19840501@gmail.com 3 | */ 4 | 5 | 6 | #ifndef _NGX_NETCALL_H_INCLUDE_ 7 | #define _NGX_NETCALL_H_INCLUDE_ 8 | 9 | 10 | #include 11 | #include "ngx_http_client.h" 12 | 13 | 14 | #define NGX_NETCALL_MAX_URL_LEN 2048 15 | 16 | typedef struct ngx_netcall_ctx_s ngx_netcall_ctx_t; 17 | 18 | typedef void (* ngx_netcall_handler_pt)(ngx_netcall_ctx_t *ctx, ngx_int_t code); 19 | 20 | struct ngx_netcall_ctx_s { 21 | ngx_pool_t *pool; 22 | 23 | ngx_str_t url; 24 | 25 | ngx_uint_t idx; 26 | ngx_uint_t type; 27 | ngx_str_t groupid; 28 | ngx_uint_t stage; 29 | ngx_msec_t timeout; 30 | ngx_msec_t update; 31 | 32 | ngx_event_t ev; 33 | ngx_http_request_t *hcr; 34 | ngx_netcall_handler_pt handler; 35 | void *data; 36 | }; 37 | 38 | 39 | ngx_netcall_ctx_t *ngx_netcall_create_ctx(ngx_uint_t type, ngx_str_t *groupid, 40 | ngx_uint_t stage, ngx_msec_t timeout, ngx_msec_t update, ngx_uint_t idx); 41 | 42 | void ngx_netcall_create(ngx_netcall_ctx_t *nctx, ngx_log_t *log); 43 | void ngx_netcall_destroy(ngx_netcall_ctx_t *nctx); 44 | ngx_str_t *ngx_netcall_header(ngx_netcall_ctx_t *nctx, ngx_str_t *key); 45 | 46 | 47 | #endif 48 | -------------------------------------------------------------------------------- /luci-app-nginx-pingos/modules/nginx-rtmp-module/ngx_rtmp_bandwidth.c: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | * Copyright (C) Roman Arutyunyan 4 | */ 5 | 6 | 7 | #include 8 | #include 9 | #include "ngx_rtmp_bandwidth.h" 10 | 11 | 12 | void 13 | ngx_rtmp_update_bandwidth(ngx_rtmp_bandwidth_t *bw, uint32_t bytes) 14 | { 15 | if (ngx_cached_time->sec > bw->intl_end) { 16 | bw->bandwidth = ngx_cached_time->sec > 17 | bw->intl_end + NGX_RTMP_BANDWIDTH_INTERVAL 18 | ? 0 19 | : bw->intl_bytes / NGX_RTMP_BANDWIDTH_INTERVAL; 20 | bw->intl_bytes = 0; 21 | bw->intl_end = ngx_cached_time->sec + NGX_RTMP_BANDWIDTH_INTERVAL; 22 | } 23 | 24 | bw->bytes += bytes; 25 | bw->intl_bytes += bytes; 26 | } 27 | -------------------------------------------------------------------------------- /luci-app-nginx-pingos/modules/nginx-rtmp-module/ngx_rtmp_bandwidth.h: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | * Copyright (C) Roman Arutyunyan 4 | */ 5 | 6 | 7 | #ifndef _NGX_RTMP_BANDWIDTH_H_INCLUDED_ 8 | #define _NGX_RTMP_BANDWIDTH_H_INCLUDED_ 9 | 10 | 11 | #include 12 | #include 13 | 14 | 15 | /* Bandwidth update interval in seconds */ 16 | #define NGX_RTMP_BANDWIDTH_INTERVAL 10 17 | 18 | 19 | typedef struct { 20 | uint64_t bytes; 21 | uint64_t bandwidth; /* bytes/sec */ 22 | 23 | time_t intl_end; 24 | uint64_t intl_bytes; 25 | } ngx_rtmp_bandwidth_t; 26 | 27 | 28 | void ngx_rtmp_update_bandwidth(ngx_rtmp_bandwidth_t *bw, uint32_t bytes); 29 | 30 | 31 | #endif /* _NGX_RTMP_BANDWIDTH_H_INCLUDED_ */ 32 | -------------------------------------------------------------------------------- /luci-app-nginx-pingos/modules/nginx-rtmp-module/ngx_rtmp_bitop.c: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | * Copyright (C) Roman Arutyunyan 4 | */ 5 | 6 | 7 | #include 8 | #include 9 | #include "ngx_rtmp_bitop.h" 10 | 11 | 12 | void 13 | ngx_rtmp_bit_init_reader(ngx_rtmp_bit_reader_t *br, u_char *pos, u_char *last) 14 | { 15 | ngx_memzero(br, sizeof(ngx_rtmp_bit_reader_t)); 16 | 17 | br->pos = pos; 18 | br->last = last; 19 | } 20 | 21 | 22 | uint64_t 23 | ngx_rtmp_bit_read(ngx_rtmp_bit_reader_t *br, ngx_uint_t n) 24 | { 25 | uint64_t v; 26 | ngx_uint_t d; 27 | 28 | v = 0; 29 | 30 | while (n) { 31 | 32 | if (br->pos >= br->last) { 33 | br->err = 1; 34 | return 0; 35 | } 36 | 37 | d = (br->offs + n > 8 ? (ngx_uint_t) (8 - br->offs) : n); 38 | 39 | v <<= d; 40 | v += (*br->pos >> (8 - br->offs - d)) & ((u_char) 0xff >> (8 - d)); 41 | 42 | br->offs += d; 43 | n -= d; 44 | 45 | if (br->offs == 8) { 46 | br->pos++; 47 | br->offs = 0; 48 | } 49 | } 50 | 51 | return v; 52 | } 53 | 54 | 55 | uint64_t 56 | ngx_rtmp_bit_read_golomb(ngx_rtmp_bit_reader_t *br) 57 | { 58 | ngx_uint_t n; 59 | 60 | for (n = 0; ngx_rtmp_bit_read(br, 1) == 0 && !br->err; n++); 61 | 62 | return ((uint64_t) 1 << n) + ngx_rtmp_bit_read(br, n) - 1; 63 | } 64 | -------------------------------------------------------------------------------- /luci-app-nginx-pingos/modules/nginx-rtmp-module/ngx_rtmp_bitop.h: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | * Copyright (C) Roman Arutyunyan 4 | */ 5 | 6 | 7 | #ifndef _NGX_RTMP_BITOP_H_INCLUDED_ 8 | #define _NGX_RTMP_BITOP_H_INCLUDED_ 9 | 10 | 11 | #include 12 | #include 13 | 14 | 15 | typedef struct { 16 | u_char *pos; 17 | u_char *last; 18 | ngx_uint_t offs; 19 | ngx_uint_t err; 20 | } ngx_rtmp_bit_reader_t; 21 | 22 | 23 | void ngx_rtmp_bit_init_reader(ngx_rtmp_bit_reader_t *br, u_char *pos, 24 | u_char *last); 25 | uint64_t ngx_rtmp_bit_read(ngx_rtmp_bit_reader_t *br, ngx_uint_t n); 26 | uint64_t ngx_rtmp_bit_read_golomb(ngx_rtmp_bit_reader_t *br); 27 | 28 | 29 | #define ngx_rtmp_bit_read_err(br) ((br)->err) 30 | 31 | #define ngx_rtmp_bit_read_eof(br) ((br)->pos == (br)->last) 32 | 33 | #define ngx_rtmp_bit_read_8(br) \ 34 | ((uint8_t) ngx_rtmp_bit_read(br, 8)) 35 | 36 | #define ngx_rtmp_bit_read_16(br) \ 37 | ((uint16_t) ngx_rtmp_bit_read(br, 16)) 38 | 39 | #define ngx_rtmp_bit_read_32(br) \ 40 | ((uint32_t) ngx_rtmp_bit_read(br, 32)) 41 | 42 | #define ngx_rtmp_bit_read_64(br) \ 43 | ((uint64_t) ngx_rtmp_read(br, 64)) 44 | 45 | 46 | #endif /* _NGX_RTMP_BITOP_H_INCLUDED_ */ 47 | -------------------------------------------------------------------------------- /luci-app-nginx-pingos/modules/nginx-rtmp-module/ngx_rtmp_dynamic.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) AlexWoo(Wu Jie) wj19840501@gmail.com 3 | */ 4 | 5 | 6 | #ifndef _NGX_RTMP_DYNAMIC_H_INCLUDED_ 7 | #define _NGX_RTMP_DYNAMIC_H_INCLUDED_ 8 | 9 | 10 | #include 11 | #include 12 | #include "ngx_map.h" 13 | #include "ngx_dynamic_conf.h" 14 | #include "ngx_rtmp.h" 15 | 16 | 17 | typedef struct { 18 | void *(*create_main_conf)(ngx_conf_t *cf); 19 | char *(*init_main_conf)(ngx_conf_t *cf, void *conf); 20 | 21 | void *(*create_srv_conf)(ngx_conf_t *cf); 22 | char *(*init_srv_conf)(ngx_conf_t *cf, void *conf); 23 | 24 | void *(*create_app_conf)(ngx_conf_t *cf); 25 | char *(*init_app_conf)(ngx_conf_t *cf, void *conf); 26 | } ngx_rtmp_dynamic_module_t; 27 | 28 | 29 | void *ngx_rtmp_get_module_main_dconf(ngx_rtmp_session_t *s, ngx_module_t *m); 30 | void *ngx_rtmp_get_module_srv_dconf(ngx_rtmp_session_t *s, ngx_module_t *m); 31 | void *ngx_rtmp_get_module_app_dconf(ngx_rtmp_session_t *s, ngx_module_t *m); 32 | 33 | void ngx_rmtp_get_serverid_by_domain(ngx_str_t *serverid, ngx_str_t *domain); 34 | 35 | 36 | #endif 37 | -------------------------------------------------------------------------------- /luci-app-nginx-pingos/modules/nginx-rtmp-module/ngx_rtmp_eval.h: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | * Copyright (C) Roman Arutyunyan 4 | */ 5 | 6 | 7 | #ifndef _NGX_RTMP_EVAL_H_INCLUDED_ 8 | #define _NGX_RTMP_EVAL_H_INCLUDED_ 9 | 10 | 11 | #include 12 | #include 13 | #include "ngx_rtmp.h" 14 | 15 | 16 | typedef struct ngx_rtmp_eval_s ngx_rtmp_eval_t; 17 | 18 | 19 | typedef void (* ngx_rtmp_eval_pt)(void *ctx, ngx_rtmp_eval_t *e, 20 | ngx_str_t *ret); 21 | 22 | 23 | struct ngx_rtmp_eval_s { 24 | ngx_str_t name; 25 | ngx_rtmp_eval_pt handler; 26 | ngx_uint_t offset; 27 | }; 28 | 29 | 30 | #define ngx_rtmp_null_eval { ngx_null_string, NULL, 0 } 31 | 32 | 33 | /* standard session eval variables */ 34 | extern ngx_rtmp_eval_t ngx_rtmp_eval_session[]; 35 | 36 | 37 | ngx_int_t ngx_rtmp_eval(void *ctx, ngx_str_t *in, ngx_rtmp_eval_t **e, 38 | ngx_str_t *out, ngx_log_t *log); 39 | 40 | 41 | ngx_int_t ngx_rtmp_eval_streams(ngx_str_t *in); 42 | 43 | 44 | #endif /* _NGX_RTMP_EVAL_H_INCLUDED_ */ 45 | -------------------------------------------------------------------------------- /luci-app-nginx-pingos/modules/nginx-rtmp-module/ngx_rtmp_monitor_module.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) AlexWoo(Wu Jie) wj19840501@gmail.com 3 | */ 4 | 5 | 6 | #ifndef _NGX_RTMP_MONITOR_H_INCLUDED_ 7 | #define _NGX_RTMP_MONITOR_H_INCLUDED_ 8 | 9 | 10 | #include 11 | #include 12 | #include 13 | #include "ngx_rtmp.h" 14 | 15 | 16 | void ngx_rtmp_monitor_frame(ngx_rtmp_session_t *s, ngx_rtmp_header_t *h, 17 | ngx_chain_t *in, ngx_flag_t is_header, ngx_flag_t publishing); 18 | 19 | 20 | #endif 21 | -------------------------------------------------------------------------------- /luci-app-nginx-pingos/modules/nginx-rtmp-module/ngx_rtmp_notify_module.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) AlexWoo(Wu Jie) wj19840501@gmail.com 3 | * 4 | */ 5 | 6 | 7 | #ifndef _NGX_RTMP_OCLP_MODULE_H_INCLUDED_ 8 | #define _NGX_RTMP_OCLP_MODULE_H_INCLUDED_ 9 | 10 | 11 | #include "ngx_rtmp.h" 12 | #include "ngx_netcall.h" 13 | 14 | 15 | void ngx_rtmp_notify_stream_start(ngx_rtmp_session_t *s); 16 | void ngx_rtmp_notify_stream_done(ngx_rtmp_session_t *s); 17 | 18 | 19 | #endif 20 | -------------------------------------------------------------------------------- /luci-app-nginx-pingos/modules/nginx-rtmp-module/ngx_rtmp_proxy_protocol.h: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | * Copyright (C) Roman Arutyunyan 4 | */ 5 | 6 | 7 | #ifndef _NGX_RTMP_PROXY_PROTOCOL_H_INCLUDED_ 8 | #define _NGX_RTMP_PROXY_PROTOCOL_H_INCLUDED_ 9 | 10 | 11 | #include 12 | #include 13 | #include "ngx_rtmp.h" 14 | 15 | 16 | void ngx_rtmp_proxy_protocol(ngx_rtmp_session_t *c); 17 | 18 | 19 | #endif /* _NGX_RTMP_PROXY_PROTOCOL_H_INCLUDED_ */ 20 | -------------------------------------------------------------------------------- /luci-app-nginx-pingos/modules/nginx-rtmp-module/ngx_rtmp_streams.h: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | * Copyright (C) Roman Arutyunyan 4 | */ 5 | 6 | 7 | #ifndef _NGX_RTMP_STREAMS_H_INCLUDED_ 8 | #define _NGX_RTMP_STREAMS_H_INCLUDED_ 9 | 10 | 11 | #define NGX_RTMP_MSID 1 12 | 13 | #define NGX_RTMP_CSID_AMF_INI 3 14 | #define NGX_RTMP_CSID_AMF 5 15 | #define NGX_RTMP_CSID_AUDIO 6 16 | #define NGX_RTMP_CSID_VIDEO 7 17 | 18 | 19 | #endif /* _NGX_RTMP_STREAMS_H_INCLUDED_ */ 20 | -------------------------------------------------------------------------------- /luci-app-nginx-pingos/modules/nginx-rtmp-module/ngx_rtmp_version.h: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | * Copyright (C) Roman Arutyunyan 4 | */ 5 | 6 | 7 | #ifndef _NGX_RTMP_VERSION_H_INCLUDED_ 8 | #define _NGX_RTMP_VERSION_H_INCLUDED_ 9 | 10 | 11 | #define nginx_rtmp_version 1001004 12 | #define NGINX_RTMP_VERSION "1.1.4" 13 | 14 | 15 | #endif /* _NGX_RTMP_VERSION_H_INCLUDED_ */ 16 | -------------------------------------------------------------------------------- /luci-app-nginx-pingos/modules/nginx-toolkit-module/COPYRIGHT: -------------------------------------------------------------------------------- 1 | Copyright (C) 2016-2020, by Jie Wu "AlexWoo" . 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions 6 | are met: 7 | 1. Redistributions of source code must retain the above copyright 8 | notice, this list of conditions and the following disclaimer. 9 | 2. Redistributions in binary form must reproduce the above copyright 10 | notice, this list of conditions and the following disclaimer in the 11 | documentation and/or other materials provided with the distribution. 12 | 13 | THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 14 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 15 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 16 | ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 17 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 18 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 19 | OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 20 | HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 21 | LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 22 | OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 23 | SUCH DAMAGE. 24 | 25 | -------------------------------------------------------------------------------- /luci-app-nginx-pingos/modules/nginx-toolkit-module/README.md: -------------------------------------------------------------------------------- 1 | # Module nginx-toolkit-module 2 | --- 3 | ## Instructions 4 | 5 | Nginx event toolkit modules. It contains modules below, and will add more in the future. 6 | 7 | - [ngx-event-timer-module](doc/ngx-event-timer-module.md) 8 | 9 | Independent timer for nginx 10 | 11 | - [ngx-event-resolver-module](doc/ngx-event-resolver-module.md) 12 | 13 | Common resovler in event modules, just like http resolver, stream resolver in nginx, but can be used by http modules, stream modules and other modules 14 | 15 | - [ngx-dynamic-resolver-module](doc/ngx-dynamic-resolver-module.md) 16 | 17 | System will resolver domain in dynamic resolver every few seconds configured 18 | 19 | The module will return addr whose domain is resolved in dynamic resolver, otherwise, the module will add domain into dynamic resolver, resolv domain by event resolver, and call callback when resolved 20 | 21 | - [ngx-dynamic-conf-module](doc/ngx-dynamic-conf-module.md) 22 | 23 | System will reload conf when nginx dynamic config file change. Developer can use this module to reload file without reload nginx worker 24 | 25 | Now it support NGX\_CORE\_MODULE and NGX\_HTTP\_MODULE 26 | 27 | - [ngx-map](doc/ngx-map.md) 28 | 29 | A map implement use ngx\_rbtree 30 | 31 | - [ngx-rbuf](doc/ngx-rbuf.md) 32 | 33 | A recycled chainbuf for nginx 34 | 35 | - [ngx-toolkit-misc](doc/ngx-toolkit-misc.md) 36 | 37 | Misc toolkit functions 38 | -------------------------------------------------------------------------------- /luci-app-nginx-pingos/modules/nginx-toolkit-module/doc/ngx-poold.md: -------------------------------------------------------------------------------- 1 | # ngx-poold 2 | --- 3 | ## Instructions 4 | 5 | Pool debug for check whether pool is destroy or destroy twice 6 | 7 | ## API 8 | 9 | **NGX\_CREATE\_POOL** 10 | 11 | #define NGX_CREATE_POOL(size, log) 12 | 13 | Replace NGX\_CREATE\_POOL instead of ngx\_create\_pool, it will record position creating pool. must use with NGX\_DESTROY\_POOL 14 | 15 | **NGX\_DESTROY\_POOL** 16 | 17 | #define NGX_DESTROY_POOL(pool) 18 | 19 | Replace NGX\_DESTROY\_POOL instead of ngx\_destroy\_pool, it will delete info which NGX\_CREATE\_POOL add. If pool not register in record pool, the pool will not destroy, and log delete twice log and position call the NGX\_DESTROY\_POOL. -------------------------------------------------------------------------------- /luci-app-nginx-pingos/modules/nginx-toolkit-module/doc/ngx-rbuf.md: -------------------------------------------------------------------------------- 1 | # ngx-rbuf 2 | --- 3 | ## Instructions 4 | 5 | A recycled chainbuf for nginx 6 | 7 | ## API 8 | 9 | **header file** 10 | 11 | For using this API, You should include the header file as below: 12 | 13 | #include "ngx_rbuf.h" 14 | 15 | **ngx\_get\_chainbuf** 16 | 17 | ngx_chain_t *ngx_get_chainbuf(size_t size, ngx_flag_t alloc_rbuf); 18 | 19 | Interface for get a chain with buf, if alloc\_rbuf is set to 1, rbuf will alloc a buf with size set in paras; if alloc\_rbuf is set to 0, size is nonsense here. 20 | 21 | Notice, for recycled buf better memory manager, the size should be same for the same usage. Such as chunk size in nginx rtmp module. 22 | 23 | 24 | **ngx\_put\_chainbuf** 25 | 26 | void ngx_put_chainbuf(ngx_chain_t *cl); 27 | 28 | Interface for recycle chain with buf alloc from rbuf 29 | 30 | **ngx\_rbuf\_statee** 31 | 32 | ngx_chain_t *ngx_rbuf_state(ngx_http_request_t *r); 33 | 34 | Interface for query rbuf state, result: 35 | 36 | ngx_rbuf_nalloc_node: 1 37 | ngx_rbuf_nalloc_buf: 1 38 | ngx_rbuf_nfree_buf: 1 39 | ngx_rbuf_nalloc_chain: 3 40 | ngx_rbuf_nalloc_chain: 3 41 | -------------------------------------------------------------------------------- /luci-app-nginx-pingos/modules/nginx-toolkit-module/ngx_event_resolver.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) AlexWoo(Wu Jie) wj19840501@gmail.com 3 | */ 4 | 5 | 6 | 7 | #ifndef _NGX_EVENT_RESOLVER_H_INCLUDED_ 8 | #define _NGX_EVENT_RESOLVER_H_INCLUDED_ 9 | 10 | 11 | #include 12 | #include 13 | #include 14 | #include 15 | 16 | 17 | /* 18 | * paras: 19 | * data : user private data set in ngx_event_resolver_start_resolver 20 | * addrs : addrs resolv by DNS 21 | * naddrs: number of addrs resolv by DNS 22 | */ 23 | typedef void (* ngx_event_resolver_handler_pt)(void *data, 24 | ngx_resolver_addr_t *addrs, ngx_uint_t naddrs); 25 | 26 | 27 | /* 28 | * paras: 29 | * domain: domain for resolving 30 | * h : callback handler 31 | * data : data for callback 32 | */ 33 | void ngx_event_resolver_start_resolver(ngx_str_t *domain, 34 | ngx_event_resolver_handler_pt h, void *data); 35 | 36 | /* 37 | * paras: 38 | * r: http request to query status of event resolver 39 | */ 40 | ngx_chain_t *ngx_event_resolver_state(ngx_http_request_t *r); 41 | 42 | 43 | #endif 44 | -------------------------------------------------------------------------------- /luci-app-nginx-pingos/modules/nginx-toolkit-module/ngx_event_timer_module.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) AlexWoo(Wu Jie) wj19840501@gmail.com 3 | */ 4 | 5 | 6 | #ifndef _NGX_EVENT_TIMER_MODULE_H_INCLUDED_ 7 | #define _NGX_EVENT_TIMER_MODULE_H_INCLUDED_ 8 | 9 | 10 | #include 11 | #include 12 | #include 13 | #include 14 | 15 | 16 | typedef void (* ngx_timer_handler_pt)(void *data); 17 | 18 | /* 19 | * return value: 20 | * return timerid for successd, NGX_ERROR for failed 21 | * paras: 22 | * tv : timer interval to trigger handler 23 | * h : timer handler 24 | * data : data of h para 25 | */ 26 | ngx_int_t ngx_event_timer_add_timer(ngx_msec_t tv, 27 | ngx_timer_handler_pt h, void *data); 28 | 29 | /* 30 | * paras: 31 | * timerid: value return in ngx_timer_add_timer 32 | */ 33 | void ngx_event_timer_del_timer(ngx_uint_t timerid); 34 | 35 | /* 36 | * paras: 37 | * r: http request to query status of event timer 38 | */ 39 | ngx_chain_t *ngx_event_timer_state(ngx_http_request_t *r); 40 | 41 | 42 | #endif 43 | -------------------------------------------------------------------------------- /luci-app-nginx-pingos/modules/nginx-toolkit-module/ngx_http_dynamic.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) AlexWoo(Wu Jie) wj19840501@gmail.com 3 | */ 4 | 5 | 6 | #ifndef _NGX_HTTP_DYNAMIC_H_INCLUDED_ 7 | #define _NGX_HTTP_DYNAMIC_H_INCLUDED_ 8 | 9 | 10 | #include 11 | #include 12 | 13 | 14 | typedef struct { 15 | void *(*create_main_conf)(ngx_conf_t *cf); 16 | char *(*init_main_conf)(ngx_conf_t *cf, void *conf); 17 | 18 | void *(*create_srv_conf)(ngx_conf_t *cf); 19 | char *(*init_srv_conf)(ngx_conf_t *cf, void *conf); 20 | 21 | void *(*create_loc_conf)(ngx_conf_t *cf); 22 | char *(*init_loc_conf)(ngx_conf_t *cf, void *conf); 23 | } ngx_http_dynamic_module_t; 24 | 25 | 26 | void *ngx_http_get_module_main_dconf(ngx_http_request_t *r, ngx_module_t *m); 27 | void *ngx_http_get_module_srv_dconf(ngx_http_request_t *r, ngx_module_t *m); 28 | void *ngx_http_get_module_loc_dconf(ngx_http_request_t *r, ngx_module_t *m); 29 | 30 | 31 | #endif 32 | -------------------------------------------------------------------------------- /luci-app-nginx-pingos/modules/nginx-toolkit-module/ngx_poold.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) AlexWoo(Wu Jie) wj19840501@gmail.com 3 | */ 4 | 5 | 6 | #ifndef _NGX_POOL_DEBUG_H_INCLUDED_ 7 | #define _NGX_POOL_DEBUG_H_INCLUDED_ 8 | 9 | 10 | #include 11 | #include 12 | #include 13 | 14 | 15 | #define NGX_CREATE_POOL(size, log) \ 16 | ngx_create_pool_debug(size, log, __FILE__, __LINE__) 17 | 18 | #define NGX_DESTROY_POOL(pool) \ 19 | ngx_destroy_pool_debug(pool, __FILE__, __LINE__) 20 | 21 | 22 | /* 23 | * create pool and record where to create it for debugging 24 | * such as pool not destroy 25 | * 26 | * paras: 27 | * size: pool size for pool creating interface in raw ngx_create_pool 28 | * log: log for pool creating interface in raw ngx_create_pool 29 | * file: use __FILE__ for recording file 30 | * line: use __LINE__ for recording line 31 | * return: 32 | * pool for successd, NULL for failed 33 | */ 34 | ngx_pool_t *ngx_create_pool_debug(size_t size, ngx_log_t *log, 35 | char *file, int line); 36 | 37 | 38 | /* 39 | * destroy pool for debugging, use as pair for ngx_create_pool_debug 40 | * 41 | * paras: 42 | * pool: pool for pool destroying interface in ran ngx_destroy_pool 43 | * file: use __FILE__ for recording file 44 | * line: use __LINE__ for recording line 45 | */ 46 | void ngx_destroy_pool_debug(ngx_pool_t *pool, char *file, int line); 47 | 48 | 49 | /* 50 | * paras: 51 | * r: http request to query status of rbuf 52 | */ 53 | ngx_chain_t *ngx_poold_state(ngx_http_request_t *r, unsigned detail); 54 | 55 | 56 | #endif 57 | -------------------------------------------------------------------------------- /luci-app-nginx-pingos/modules/nginx-toolkit-module/t/dns_install.sh: -------------------------------------------------------------------------------- 1 | #! /bin/bash 2 | 3 | yum install -y bind bind-chroot bind-utils 4 | cp -f named.conf /etc/ 5 | cp -f test.com.zone /var/named/ 6 | chgrp named /etc/named.conf 7 | chgrp named /var/named/test.com.zone 8 | -------------------------------------------------------------------------------- /luci-app-nginx-pingos/modules/nginx-toolkit-module/t/md5testfile: -------------------------------------------------------------------------------- 1 | Copyright (C) 2016-2020, by Jie Wu "AlexWoo" . 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions 6 | are met: 7 | 1. Redistributions of source code must retain the above copyright 8 | notice, this list of conditions and the following disclaimer. 9 | 2. Redistributions in binary form must reproduce the above copyright 10 | notice, this list of conditions and the following disclaimer in the 11 | documentation and/or other materials provided with the distribution. 12 | 13 | THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 14 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 15 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 16 | ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 17 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 18 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 19 | OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 20 | HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 21 | LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 22 | OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 23 | SUCH DAMAGE. 24 | 25 | -------------------------------------------------------------------------------- /luci-app-nginx-pingos/modules/nginx-toolkit-module/t/named.conf: -------------------------------------------------------------------------------- 1 | options { 2 | directory "/var/named"; 3 | recursion no; 4 | }; 5 | 6 | logging { 7 | channel default_debug { 8 | file "data/named.run"; 9 | severity dynamic; 10 | }; 11 | }; 12 | 13 | zone "test.com." { 14 | type master; 15 | file "test.com.zone"; 16 | }; 17 | 18 | zone "test1.com." { 19 | type master; 20 | file "test1.com.zone"; 21 | }; 22 | 23 | include "/etc/named.rfc1912.zones"; 24 | include "/etc/named.root.key"; 25 | 26 | -------------------------------------------------------------------------------- /luci-app-nginx-pingos/modules/nginx-toolkit-module/t/ngx_test_macro.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) AlexWoo(Wu Jie) wj19840501@gmail.com 3 | */ 4 | 5 | 6 | #ifndef _NGX_TEST_MACRO_H_INCLUDE_ 7 | #define _NGX_TEST_MACRO_H_INCLUDE_ 8 | 9 | 10 | #include 11 | #include 12 | 13 | 14 | static ngx_int_t count = 0; 15 | static ngx_int_t pass = 0; 16 | 17 | #define NGX_TEST_INIT count = 0, pass = 0; 18 | 19 | #define NGX_TEST_ISOK(testcase) \ 20 | { \ 21 | ngx_int_t __ret = testcase; \ 22 | ++count; \ 23 | if (__ret) ++pass; \ 24 | ngx_log_error(NGX_LOG_INFO, ngx_cycle->log, 0, " TEST "#testcase"%s",\ 25 | (__ret ? " ...OK" : " ...ERROR")); \ 26 | } 27 | 28 | #define NGX_TEST_INT(di, si) \ 29 | (di == si) 30 | 31 | static ngx_inline ngx_int_t 32 | ngx_test_str(ngx_str_t *nstr, char *cstr) 33 | { 34 | size_t len; 35 | 36 | len = ngx_strlen(cstr); 37 | 38 | return (nstr->len == len && ngx_memcmp(nstr->data, cstr, len) == 0); 39 | } 40 | 41 | #endif 42 | -------------------------------------------------------------------------------- /luci-app-nginx-pingos/modules/nginx-toolkit-module/t/test.com.zone: -------------------------------------------------------------------------------- 1 | $TTL 3H 2 | @ IN SOA @ wj19840501.gmail.com. ( 3 | 0 ; serial 4 | 1D ; refresh 5 | 1H ; retry 6 | 1W ; expire 7 | 3H ; minimum 8 | ) 9 | 10 | @ IN NS dns 11 | dns IN A 192.168.84.254 12 | www IN A 1.1.1.1 13 | www IN A 1.1.1.2 14 | www IN A 1.1.1.3 15 | -------------------------------------------------------------------------------- /luci-app-nginx-pingos/modules/nginx-toolkit-module/t/test1.com.zone: -------------------------------------------------------------------------------- 1 | $TTL 3H 2 | @ IN SOA @ wj19840501.gmail.com. ( 3 | 0 ; serial 4 | 1D ; refresh 5 | 1H ; retry 6 | 1W ; expire 7 | 3H ; minimum 8 | ) 9 | 10 | @ IN NS dns 11 | dns IN A 192.168.84.254 12 | www IN A 1.1.1.4 13 | www IN A 1.1.1.5 14 | www IN A 1.1.1.6 15 | -------------------------------------------------------------------------------- /luci-app-nginx-pingos/modules/nginx-ts-module/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (C) 2017 Roman Arutyunyan 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | 7 | 1. Redistributions of source code must retain the above copyright notice, this 8 | list of conditions and the following disclaimer. 9 | 2. Redistributions in binary form must reproduce the above copyright notice, 10 | this list of conditions and the following disclaimer in the documentation 11 | and/or other materials provided with the distribution. 12 | 13 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 14 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 15 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 16 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR 17 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 18 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 19 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 20 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 21 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 22 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 23 | -------------------------------------------------------------------------------- /luci-app-nginx-pingos/modules/nginx-ts-module/config: -------------------------------------------------------------------------------- 1 | ngx_module_type=HTTP 2 | ngx_addon_name=ngx_http_ts_module 3 | ngx_module_name=ngx_http_ts_module 4 | ngx_module_incs= 5 | ngx_module_deps="$ngx_addon_dir/src/ngx_ts_stream.h \ 6 | $ngx_addon_dir/src/ngx_ts_hls.h \ 7 | $ngx_addon_dir/src/ngx_ts_dash.h \ 8 | $ngx_addon_dir/src/ngx_ts_avc.h \ 9 | $ngx_addon_dir/src/ngx_ts_aac.h" 10 | ngx_module_srcs="$ngx_addon_dir/src/ngx_http_ts_module.c \ 11 | $ngx_addon_dir/src/ngx_ts_stream.c \ 12 | $ngx_addon_dir/src/ngx_ts_hls.c \ 13 | $ngx_addon_dir/src/ngx_ts_dash.c \ 14 | $ngx_addon_dir/src/ngx_ts_dash_mp4.c \ 15 | $ngx_addon_dir/src/ngx_ts_avc.c \ 16 | $ngx_addon_dir/src/ngx_ts_aac.c" 17 | 18 | . auto/module 19 | -------------------------------------------------------------------------------- /luci-app-nginx-pingos/modules/nginx-ts-module/src/ngx_ts_aac.h: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | * Copyright (C) Roman Arutyunyan 4 | */ 5 | 6 | 7 | #include 8 | #include 9 | 10 | #include "ngx_ts_stream.h" 11 | 12 | 13 | #ifndef _NGX_TS_AAC_H_INCLUDED_ 14 | #define _NGX_TS_AAC_H_INCLUDED_ 15 | 16 | 17 | typedef struct { 18 | ngx_uint_t version; 19 | ngx_uint_t profile; 20 | ngx_uint_t freq_index; 21 | ngx_uint_t freq; 22 | ngx_uint_t chan; 23 | } ngx_ts_aac_params_t; 24 | 25 | 26 | ngx_ts_aac_params_t *ngx_ts_aac_decode_params(ngx_ts_stream_t *ts, u_char *adts, 27 | size_t adts_len); 28 | 29 | 30 | #endif /* _NGX_TS_AAC_H_INCLUDED_ */ 31 | -------------------------------------------------------------------------------- /luci-app-nginx-pingos/patches/102-sizeof_test_fix.patch: -------------------------------------------------------------------------------- 1 | --- a/auto/types/sizeof 2 | +++ b/auto/types/sizeof 3 | @@ -25,8 +25,14 @@ $NGX_INCLUDE_UNISTD_H 4 | $NGX_INCLUDE_INTTYPES_H 5 | $NGX_INCLUDE_AUTO_CONFIG_H 6 | 7 | +char object_code_block[] = { 8 | + '\n', 'e', '4', 'V', 'A', 9 | + '0', 'x', ('0' + sizeof($ngx_type)), 10 | + 'Y', '3', 'p', 'M', '\n' 11 | +}; 12 | + 13 | int main(void) { 14 | - printf("%d", (int) sizeof($ngx_type)); 15 | + printf("dummy use of object_code_block to avoid gc-section: %c", object_code_block[0]); 16 | return 0; 17 | } 18 | 19 | @@ -40,7 +46,7 @@ eval "$ngx_test >> $NGX_AUTOCONF_ERR 2>& 20 | 21 | 22 | if [ -x $NGX_AUTOTEST ]; then 23 | - ngx_size=`$NGX_AUTOTEST` 24 | + ngx_size=`sed -ne 's/^e4VA0x\(.\)Y3pM$/\1/p' < $NGX_AUTOTEST` 25 | echo " $ngx_size bytes" 26 | fi 27 | 28 | -------------------------------------------------------------------------------- /luci-app-nginx-pingos/patches/103-sys_nerr.patch: -------------------------------------------------------------------------------- 1 | --- a/src/os/unix/ngx_errno.c 2 | +++ b/src/os/unix/ngx_errno.c 3 | @@ -8,6 +8,9 @@ 4 | #include 5 | #include 6 | 7 | +#ifndef NGX_SYS_NERR 8 | +#define NGX_SYS_NERR 128 9 | +#endif 10 | 11 | /* 12 | * The strerror() messages are copied because: 13 | -------------------------------------------------------------------------------- /luci-app-nginx-pingos/patches/104-endianness_fix.patch: -------------------------------------------------------------------------------- 1 | diff --git a/auto/endianness b/auto/endianness 2 | index 1b552b6b..2b6f9ea4 100644 3 | --- a/auto/endianness 4 | +++ b/auto/endianness 5 | @@ -12,6 +12,16 @@ checking for system byte ordering 6 | 7 | END 8 | 9 | +if [ "${CONFIG_BIG_ENDIAN}" != "y" ]; then 10 | + echo " little endian" 11 | + have=NGX_HAVE_LITTLE_ENDIAN . auto/have 12 | +else 13 | + echo " big endian" 14 | +fi 15 | + 16 | +return 17 | + 18 | + 19 | 20 | cat << END > $NGX_AUTOTEST.c 21 | 22 | -------------------------------------------------------------------------------- /luci-app-nginx-pingos/patches/200-config.patch: -------------------------------------------------------------------------------- 1 | --- a/conf/nginx.conf 2 | +++ b/conf/nginx.conf 3 | @@ -1,5 +1,5 @@ 4 | 5 | -#user nobody; 6 | +user nobody nogroup; 7 | worker_processes 1; 8 | 9 | #error_log logs/error.log; 10 | @@ -16,7 +16,7 @@ events { 11 | 12 | http { 13 | include mime.types; 14 | - default_type application/octet-stream; 15 | + #default_type application/octet-stream; 16 | 17 | #log_format main '$remote_addr - $remote_user [$time_local] "$request" ' 18 | # '$status $body_bytes_sent "$http_referer" ' 19 | -------------------------------------------------------------------------------- /luci-app-nginx-pingos/patches/201-ignore-invalid-options.patch: -------------------------------------------------------------------------------- 1 | --- a/auto/options 2 | +++ b/auto/options 3 | @@ -396,8 +396,7 @@ $0: warning: the \"--with-sha1-asm\" opt 4 | --test-build-solaris-sendfilev) NGX_TEST_BUILD_SOLARIS_SENDFILEV=YES ;; 5 | 6 | *) 7 | - echo "$0: error: invalid option \"$option\"" 8 | - exit 1 9 | + echo "$0: error: ignoring invalid option \"$option\"" 10 | ;; 11 | esac 12 | done 13 | -------------------------------------------------------------------------------- /luci-app-nginx-pingos/po/zh-cn/pingos.po: -------------------------------------------------------------------------------- 1 | msgid "Running Status" 2 | msgstr "运行状态" 3 | 4 | msgid "Status" 5 | msgstr "状态" 6 | 7 | msgid "Collecting data..." 8 | msgstr "正在收集数据..." 9 | 10 | msgid "NOT RUNNING" 11 | msgstr "未运行" 12 | 13 | msgid "RUNNING" 14 | msgstr "运行中" 15 | 16 | msgid "If you need external network access, please open the port by yourself." 17 | msgstr "如需外网访问,请自行放行端口。" 18 | 19 | msgid "Global Settings" 20 | msgstr "全局设置" 21 | 22 | msgid "Edit Template" 23 | msgstr "编辑模板" 24 | 25 | msgid "Edit the template that is used for generating the %s configuration." 26 | msgstr "编辑生成 %s 的模板" 27 | 28 | msgid "This is the content of the file '%s'" 29 | msgstr "这是文件内容:%s" 30 | 31 | msgid "Values enclosed by pipe symbols ('|') should not be changed. They get their values from the '%s' tab." 32 | msgstr "由管道符(“|”)包围的值不应更改。它们将从 '%s' 标签中获取其值。" 33 | 34 | msgid "Listen IPv6" 35 | msgstr "监听IPv6" 36 | 37 | msgid "Record" 38 | msgstr "录像" 39 | 40 | msgid "Path" 41 | msgstr "路径" 42 | 43 | msgid "Stream name" 44 | msgstr "流名" 45 | -------------------------------------------------------------------------------- /luci-app-nginx-pingos/po/zh_Hans: -------------------------------------------------------------------------------- 1 | zh-cn -------------------------------------------------------------------------------- /luci-app-nginx-pingos/root/etc/config/pingos: -------------------------------------------------------------------------------- 1 | 2 | config global 3 | option enable '0' 4 | option ipv6 '0' 5 | option https '0' 6 | option ts_record '0' 7 | option flv_record '0' 8 | option http_port '18080' 9 | option rtmp_port '1935' 10 | option hls '1' 11 | option hls2 '1' 12 | -------------------------------------------------------------------------------- /luci-app-nginx-pingos/root/etc/uci-defaults/luci-app-nginx-pingos: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | uci -q batch <<-EOF >/dev/null 4 | delete ucitrack.@pingos[-1] 5 | add ucitrack pingos 6 | set ucitrack.@pingos[-1].init=pingos 7 | commit ucitrack 8 | EOF 9 | 10 | rm -rf /tmp/luci-*cache 11 | exit 0 12 | -------------------------------------------------------------------------------- /luci-app-nginx-pingos/root/resource/crossdomain.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /luci-app-nginx-pingos/root/usr/share/rpcd/acl.d/luci-app-nginx-pingos.json: -------------------------------------------------------------------------------- 1 | { 2 | "luci-app-nginx-pingos": { 3 | "description": "Grant UCI access for luci-app-nginx-pingos", 4 | "read": { 5 | "uci": [ "pingos" ] 6 | }, 7 | "write": { 8 | "uci": [ "pingos" ] 9 | } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /luci-app-openvpn-client/Makefile: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2021-2025 Lienol 2 | 3 | include $(TOPDIR)/rules.mk 4 | 5 | PKG_NAME:=luci-app-openvpn-client 6 | PKG_VERSION:=20250227 7 | PKG_RELEASE:=1 8 | 9 | LUCI_TITLE:=LuCI support for OpenVPN Client 10 | LUCI_DEPENDS:=+openvpn-openssl +kmod-tun 11 | LUCI_PKGARCH:=all 12 | 13 | include $(TOPDIR)/feeds/luci/luci.mk 14 | 15 | # call BuildPackage - OpenWrt buildroot signature 16 | -------------------------------------------------------------------------------- /luci-app-openvpn-client/luasrc/controller/openvpn-client.lua: -------------------------------------------------------------------------------- 1 | -- Copyright 2021-2025 Lienol 2 | module("luci.controller.openvpn-client", package.seeall) 3 | 4 | function index() 5 | if not nixio.fs.access("/etc/config/luci-app-openvpn-client") then return end 6 | 7 | entry({"admin", "vpn"}, firstchild(), "VPN", 45).dependent = false 8 | entry({"admin", "vpn", "openvpn-client"}, cbi("openvpn-client/settings"), _("OpenVPN Client"), 50).acl_depends = { "luci-app-openvpn-client" } 9 | entry({"admin", "vpn", "openvpn-client", "client"}, cbi("openvpn-client/client")).leaf = true 10 | 11 | entry({"admin", "vpn", "openvpn-client", "log"}, call("get_log")).leaf = true 12 | end 13 | 14 | function get_log() 15 | local fs = require "nixio.fs" 16 | local i18n = require "luci.i18n" 17 | local id = luci.http.formvalue("id") 18 | local log_file = "/tmp/etc/openvpn-client/" .. id .. "/openvpn.log" 19 | if fs.access(log_file) then 20 | local content = luci.sys.exec("cat ".. log_file) 21 | content = content:gsub("\n", "
") 22 | luci.http.write(content) 23 | else 24 | luci.http.write(string.format("", i18n.translate("Not log"))) 25 | end 26 | end -------------------------------------------------------------------------------- /luci-app-openvpn-client/po/zh-cn/openvpn-client.po: -------------------------------------------------------------------------------- 1 | msgid "OpenVPN Client" 2 | msgstr "OpenVPN 客户端" 3 | 4 | msgid "Client List" 5 | msgstr "客户端列表" 6 | 7 | msgid "Status" 8 | msgstr "状态" 9 | 10 | msgid "NOT RUNNING" 11 | msgstr "未运行" 12 | 13 | msgid "RUNNING" 14 | msgstr "运行中" 15 | 16 | msgid "Start/Stop" 17 | msgstr "启动/关闭" 18 | 19 | msgid "start" 20 | msgstr "启动" 21 | 22 | msgid "stop" 23 | msgstr "关闭" 24 | 25 | msgid "Log" 26 | msgstr "日志" 27 | 28 | msgid "Not log" 29 | msgstr "没有日志" 30 | 31 | msgid "Enabled" 32 | msgstr "启用" 33 | 34 | msgid "Server IP/Host" 35 | msgstr "服务器IP/域名" 36 | 37 | msgid "Port" 38 | msgstr "端口" 39 | 40 | msgid "Protocol" 41 | msgstr "协议" 42 | 43 | msgid "Type" 44 | msgstr "类型" 45 | 46 | msgid "LZO compression" 47 | msgstr "LZO 压缩" 48 | 49 | msgid "No pull route" 50 | msgstr "不拉取路由" 51 | 52 | msgid "Static Routes" 53 | msgstr "静态路由" 54 | 55 | msgid "Allow server access" 56 | msgstr "允许服务端访问" 57 | 58 | msgid "Auth" 59 | msgstr "身份认证" 60 | 61 | msgid "None" 62 | msgstr "无" 63 | 64 | msgid "User/Pass" 65 | msgstr "用户/密码" 66 | 67 | msgid "Username" 68 | msgstr "用户名" 69 | 70 | msgid "Password" 71 | msgstr "密码" 72 | 73 | msgid "Proxy" 74 | msgstr "代理" 75 | 76 | msgid "Proxy Server" 77 | msgstr "代理服务器" 78 | 79 | msgid "Proxy Port" 80 | msgstr "代理端口" 81 | 82 | msgid "Proxy Username" 83 | msgstr "代理用户名" 84 | 85 | msgid "Proxy Password" 86 | msgstr "代理密码" 87 | 88 | msgid "Extra Config" 89 | msgstr "额外配置" 90 | -------------------------------------------------------------------------------- /luci-app-openvpn-client/po/zh_Hans: -------------------------------------------------------------------------------- 1 | zh-cn -------------------------------------------------------------------------------- /luci-app-openvpn-client/root/etc/config/luci-app-openvpn-client: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Lienol/openwrt-package/ced34df18c654df8cfda04193b2d1e7852678382/luci-app-openvpn-client/root/etc/config/luci-app-openvpn-client -------------------------------------------------------------------------------- /luci-app-openvpn-client/root/etc/uci-defaults/luci-app-openvpn-client: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | uci -q batch <<-EOF >/dev/null 4 | delete firewall.openvpn_client 5 | set firewall.openvpn_client=include 6 | set firewall.openvpn_client.type=script 7 | set firewall.openvpn_client.path=/var/etc/luci-app-openvpn-client.include 8 | set firewall.openvpn_client.reload=1 9 | EOF 10 | 11 | rm -rf /tmp/luci-*cache 12 | exit 0 13 | -------------------------------------------------------------------------------- /luci-app-openvpn-client/root/usr/share/rpcd/acl.d/luci-app-openvpn-client.json: -------------------------------------------------------------------------------- 1 | { 2 | "luci-app-openvpn-client": { 3 | "description": "Grant UCI access for luci-app-openvpn-client", 4 | "read": { 5 | "uci": [ "luci-app-openvpn-client" ] 6 | }, 7 | "write": { 8 | "uci": [ "luci-app-openvpn-client" ] 9 | } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /luci-app-openvpn-server/Makefile: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2021-2025 Lienol 2 | 3 | include $(TOPDIR)/rules.mk 4 | 5 | PKG_NAME:=luci-app-openvpn-server 6 | PKG_VERSION:=20250227 7 | PKG_RELEASE:=1 8 | 9 | LUCI_TITLE:=LuCI support for OpenVPN Server 10 | LUCI_DEPENDS:=+openvpn-easy-rsa +openvpn-openssl +kmod-tun +@OPENVPN_openssl_ENABLE_MANAGEMENT 11 | LUCI_PKGARCH:=all 12 | 13 | define Package/$(PKG_NAME)/conffiles 14 | /etc/config/luci-app-openvpn 15 | /usr/share/openvpn-server/ca.crt 16 | /usr/share/openvpn-server/dh.pem 17 | /usr/share/openvpn-server/server.crt 18 | /usr/share/openvpn-server/server.key 19 | endef 20 | 21 | include $(TOPDIR)/feeds/luci/luci.mk 22 | 23 | # call BuildPackage - OpenWrt buildroot signature 24 | -------------------------------------------------------------------------------- /luci-app-openvpn-server/luasrc/model/cbi/openvpn-server/log.lua: -------------------------------------------------------------------------------- 1 | f = SimpleForm("luci-app-openvpn-server") 2 | f.reset = false 3 | f.submit = false 4 | f:append(Template("openvpn-server/log")) 5 | return f 6 | -------------------------------------------------------------------------------- /luci-app-openvpn-server/luasrc/model/cbi/openvpn-server/user.lua: -------------------------------------------------------------------------------- 1 | local d = require "luci.dispatcher" 2 | 3 | m = Map("luci-app-openvpn-server", translate("Users Manager")) 4 | m.redirect = d.build_url("admin", "vpn", "openvpn-server") 5 | 6 | s = m:section(NamedSection, arg[1], "users", "") 7 | s.addremove = false 8 | s.anonymous = true 9 | 10 | o = s:option(Flag, "enabled", translate("Enabled")) 11 | o.default = 1 12 | o.rmempty = false 13 | 14 | o = s:option(Value, "username", translate("Username")) 15 | o.placeholder = translate("Username") 16 | o.rmempty = false 17 | 18 | o = s:option(Value, "password", translate("Password")) 19 | o.placeholder = translate("Password") 20 | o.rmempty = false 21 | 22 | o = s:option(Value, "ipaddress", translate("IP address")) 23 | o.placeholder = translate("Automatically") 24 | o.datatype = "ip4addr" 25 | o.rmempty = true 26 | 27 | o = s:option(DynamicList, "routes", translate("Static Routes")) 28 | o.placeholder = "192.168.10.0/24" 29 | o.datatype = "ipmask4" 30 | o.rmempty = true 31 | 32 | return m 33 | -------------------------------------------------------------------------------- /luci-app-openvpn-server/luasrc/view/openvpn-server/index.htm: -------------------------------------------------------------------------------- 1 | <% include("cbi/map") %> 2 | 14 | -------------------------------------------------------------------------------- /luci-app-openvpn-server/luasrc/view/openvpn-server/log.htm: -------------------------------------------------------------------------------- 1 | 16 |
17 | 18 | 19 |
20 | -------------------------------------------------------------------------------- /luci-app-openvpn-server/luasrc/view/openvpn-server/status.htm: -------------------------------------------------------------------------------- 1 | <%+cbi/valueheader%> 2 | <%=pcdata(self:cfgvalue(section) or self.default or "")%> 3 | <%+cbi/valuefooter%> 4 | -------------------------------------------------------------------------------- /luci-app-openvpn-server/po/zh_Hans: -------------------------------------------------------------------------------- 1 | zh-cn -------------------------------------------------------------------------------- /luci-app-openvpn-server/root/etc/config/luci-app-openvpn-server: -------------------------------------------------------------------------------- 1 | 2 | config server 'server' 3 | option enabled '0' 4 | option port '1194' 5 | option proto 'tcp' 6 | option ipv6 '1' 7 | option ip_segment '172.30.1.0' 8 | option subnet_mask '255.255.255.0' 9 | option lzo '1' 10 | option ddns 'example.com' 11 | -------------------------------------------------------------------------------- /luci-app-openvpn-server/root/etc/uci-defaults/luci-app-openvpn-server: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | count=$(uci -q show firewall | grep "@forwarding" | grep "ovpn_server" | awk -F '.' '{print $2}' | awk -F '=' '{print $1}' | wc -l) 4 | for i in $(seq 1 $count); do 5 | id=$(uci -q show firewall | grep "@forwarding" | grep "ovpn_server" | awk -F '.' '{print $2}' | awk -F '=' '{print $1}' | head -n 1) 6 | uci -q delete firewall.${id} 7 | done 8 | uci -q commit firewall 9 | 10 | uci -q batch <<-EOF >/dev/null 11 | delete firewall.openvpn_server 12 | set firewall.openvpn_server=include 13 | set firewall.openvpn_server.type=script 14 | set firewall.openvpn_server.path=/var/etc/luci-app-openvpn-server.include 15 | set firewall.openvpn_server.reload=1 16 | 17 | delete firewall.ovpn_server 18 | set firewall.ovpn_server=zone 19 | set firewall.ovpn_server.name='ovpn_server' 20 | set firewall.ovpn_server.input='ACCEPT' 21 | set firewall.ovpn_server.forward='ACCEPT' 22 | set firewall.ovpn_server.output='ACCEPT' 23 | set firewall.ovpn_server.masq='1' 24 | set firewall.ovpn_server.network='ovpn_server' 25 | 26 | set firewall.lantoovpnserver=forwarding 27 | set firewall.lantoovpnserver.src='lan' 28 | set firewall.lantoovpnserver.dest='ovpn_server' 29 | commit firewall 30 | 31 | delete ucitrack.@luci-app-openvpn-server[-1] 32 | add ucitrack luci-app-openvpn-server 33 | set ucitrack.@luci-app-openvpn-server[-1].init=luci-app-openvpn-server 34 | commit ucitrack 35 | EOF 36 | 37 | rm -rf /tmp/luci-*cache 38 | exit 0 39 | -------------------------------------------------------------------------------- /luci-app-openvpn-server/root/usr/share/openvpn-server/ca.crt: -------------------------------------------------------------------------------- 1 | -----BEGIN CERTIFICATE----- 2 | MIIDMDCCAhigAwIBAgIUHzHVUf6zWR+xaWOv18at7DRzL6swDQYJKoZIhvcNAQEL 3 | BQAwDTELMAkGA1UEAwwCQ04wHhcNMjIwMTA1MDYwMjI1WhcNMzIwMTAzMDYwMjI1 4 | WjANMQswCQYDVQQDDAJDTjCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEB 5 | AMrTEKYdJv4jHg7aPDJlSJ5RZ+3ulWeuT68QtenN5GYyOS1CD5jfHSnRDJ6yEHv2 6 | WMB3IRNQZ1YkGLWoXUoxT/O+YAV88w+NXbp4eJCo/ponyjRmg/cbgMXowRN6F2qV 7 | ATK/2rSYsGbd/3e+cmTMm/yLkf2F4td80BrQoPjKmonm9CdkaDlREfpMhtb6a4dh 8 | iNX6DytR3E1p1ECmetbgXRJZht+VbXWCjeo0ee2JH6IBefDjYAIosXVxVCuDX8nZ 9 | 6kMQTSPNNSc4NqhdZDHUIV1oaDbgw/y2N7RZlQJyxr8gmVgn6UA+A+ZCdtFlhXht 10 | UWsxo0xfGkwwRBTgrlk71jECAwEAAaOBhzCBhDAdBgNVHQ4EFgQUW0+FUz3roIAA 11 | 0YShT7+Mk1GWT6QwSAYDVR0jBEEwP4AUW0+FUz3roIAA0YShT7+Mk1GWT6ShEaQP 12 | MA0xCzAJBgNVBAMMAkNOghQfMdVR/rNZH7FpY6/Xxq3sNHMvqzAMBgNVHRMEBTAD 13 | AQH/MAsGA1UdDwQEAwIBBjANBgkqhkiG9w0BAQsFAAOCAQEAXtTbVNTk9vgRF6Zt 14 | ZGitmpKtUa0Y2V665xRQPG9NB5Vr0vpUUXco9QA98TDzpVg/hyvdE+ipnfr51H9a 15 | U0aNgRyjWrVFcySp4WwEgXvC+AZuruuWgMMT1MWgY+3Cra9TJH63hc94hw4UyaSF 16 | t9WI47AaqfOaBktLo6RLzBtMvjL/mPLMlYhax7QJLlaiBHQCONE1hP/ys7lKqBV1 17 | qAWuCu6+JtZ/K6P/UeLq9gtBHCuaSN0Yz1tD5OFnurEvmxTaR8B5hR8iHf42l665 18 | dRnwFbMJ3Z4RNSRzyI/rKrLsx2WJ/LAz2OauJQ+qmvXcX43E8xqpuO5s8vGeuSdz 19 | G07FCA== 20 | -----END CERTIFICATE----- 21 | -------------------------------------------------------------------------------- /luci-app-openvpn-server/root/usr/share/openvpn-server/dh.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN DH PARAMETERS----- 2 | MIIBCAKCAQEAhTMnJHqVa/sjMTGpIOk4sZVGeP4f2uq6RZ4IurzpZObapvibTTWJ 3 | EfbRzAWLig7tBkF35lD3McoqBnOu1IOWU+6nHQPpsVXaMFAVnM2CiRf/lcDK5ZFX 4 | wm6kG9HYObV2ujXYeHG9kOaBh0dnmtrCp8HTrDNYtI+/BhCfbP9mmYonqQZGfoGt 5 | nZIQAPnmSly8BsjrvUVWmYcQmVBp4OppqXPfESYom13AYb6MdiE7Nbh4zrenmc0G 6 | Tczzvip+zJR1oMthwc74MK1Jlth+6szTAs19Y4oS9mLiK84lqbymFdJpOk2zHTVx 7 | 6VjVoP81RiJS1qwVh9uMikShTe7ym6L5cwIBAg== 8 | -----END DH PARAMETERS----- 9 | -------------------------------------------------------------------------------- /luci-app-openvpn-server/root/usr/share/openvpn-server/script/auth_verify.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | CONFIG="luci-app-openvpn-server" 4 | OVPN_PATH=/var/etc/openvpn-server 5 | LOG_FILE=${OVPN_PATH}/client.log 6 | AUTH_FILE=${OVPN_PATH}/auth 7 | TIME="$(date "+%Y-%m-%d %H:%M:%S")" 8 | 9 | IP=${untrusted_ip} 10 | 11 | CORRECT_PASSWORD=$(awk '!/^;/&&!/^#/&&$1=="'${username}'"{print $2;exit}' ${AUTH_FILE}) 12 | if [ "${CORRECT_PASSWORD}" = "" ]; then 13 | echo "${TIME}: ${username}/${IP} Fail authentication. input password=\"${password}\"." >> ${LOG_FILE} 14 | exit 1 15 | fi 16 | 17 | if [ "${password}" = "${CORRECT_PASSWORD}" ]; then 18 | echo "${TIME}: ${username}/${IP} Successful authentication." >> ${LOG_FILE} 19 | exit 0 20 | fi 21 | 22 | echo "${TIME}: ${username}/${IP} Fail authentication. input password=\"${password}\"." >> ${LOG_FILE} 23 | exit 1 24 | -------------------------------------------------------------------------------- /luci-app-openvpn-server/root/usr/share/openvpn-server/script/ca_renew.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | DIR=$(cd "$(dirname "$0")";pwd) 4 | LOCK_FILE=/var/lock/ca_renew.lock 5 | 6 | lock() { 7 | if [ -s ${LOCK_FILE} ]; then 8 | SPID=$(cat ${LOCK_FILE}) 9 | if [ -e /proc/${SPID}/status ]; then 10 | exit 1 11 | fi 12 | cat /dev/null > ${LOCK_FILE} 13 | fi 14 | echo $$ > ${LOCK_FILE} 15 | } 16 | 17 | unlock() { 18 | rm -rf ${LOCK_FILE} 19 | } 20 | 21 | lock 22 | cd /tmp 23 | echo yes | easyrsa init-pki 24 | echo CA | easyrsa build-ca nopass 25 | easyrsa gen-dh 26 | echo yes | easyrsa build-server-full server nopass 27 | cp -f /tmp/pki/dh.pem /usr/share/openvpn-server/dh.pem 28 | cp -f /tmp/pki/ca.crt /usr/share/openvpn-server/ca.crt 29 | cp -f /tmp/pki/issued/server.crt /usr/share/openvpn-server/server.crt 30 | cp -f /tmp/pki/private/server.key /usr/share/openvpn-server/server.key 31 | rm -rf /tmp/pki 32 | cd ${DIR} 33 | /etc/init.d/luci-app-openvpn-server restart 34 | unlock 35 | -------------------------------------------------------------------------------- /luci-app-openvpn-server/root/usr/share/openvpn-server/script/client_connect.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | CONFIG="luci-app-openvpn-server" 4 | OVPN_PATH=/var/etc/openvpn-server 5 | LOG_FILE=${OVPN_PATH}/client.log 6 | SESSION_PATH=${OVPN_PATH}/session 7 | TIME="$(date "+%Y-%m-%d %H:%M:%S")" 8 | 9 | mkdir -p ${SESSION_PATH} 10 | 11 | REMOTE_IP=${trusted_ip} 12 | [ -n "${trusted_ip6}" ] && REMOTE_IP=${trusted_ip6} 13 | 14 | cat <<-EOF > ${SESSION_PATH}/${common_name} 15 | { 16 | "common_name": "${common_name}", 17 | "time_ascii": "${time_ascii}", 18 | "trusted_ip": "${trusted_ip}", 19 | "trusted_ip6": "${trusted_ip6}", 20 | "trusted_port": "${trusted_port}", 21 | "ifconfig_pool_remote_ip": "${ifconfig_pool_remote_ip}", 22 | "time_ascii": "${time_ascii}", 23 | "remote_ip": "${REMOTE_IP}", 24 | "login_time": "${TIME}" 25 | } 26 | EOF 27 | 28 | echo "${TIME}: ${common_name}/${REMOTE_IP} online." >> ${LOG_FILE} 29 | 30 | cfgid=$(uci show ${CONFIG} | grep "@users" | grep "\.username='${common_name}'" | cut -d '.' -sf 2) 31 | [ -n "$cfgid" ] && { 32 | routes=$(uci -q get ${CONFIG}.${cfgid}.routes) 33 | [ -n "$routes" ] && { 34 | for route in ${routes}; do 35 | route add -net ${route} gw ${ifconfig_pool_remote_ip} >/dev/null 2>&1 36 | done 37 | #echo "${TIME}: ${common_name}/${REMOTE_IP} add route." >> ${LOG_FILE} 38 | } 39 | } 40 | 41 | #可根据登录的账号自定义脚本,如组网、日志、限速、权限等特殊待遇。 42 | SCRIPT="/usr/share/openvpn-server/script/client_connect/${common_name}" 43 | [ -s "$SCRIPT" ] && { 44 | [ ! -x "$SCRIPT" ] && chmod 0755 "$SCRIPT" 45 | "$SCRIPT" "$@" 46 | } 47 | exit 0 48 | -------------------------------------------------------------------------------- /luci-app-openvpn-server/root/usr/share/openvpn-server/script/client_disconnect.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | CONFIG="luci-app-openvpn-server" 4 | OVPN_PATH=/var/etc/openvpn-server 5 | LOG_FILE=${OVPN_PATH}/client.log 6 | SESSION_PATH=${OVPN_PATH}/session 7 | TIME="$(date "+%Y-%m-%d %H:%M:%S")" 8 | 9 | REMOTE_IP=${trusted_ip} 10 | [ -n "${trusted_ip6}" ] && REMOTE_IP=${trusted_ip6} 11 | 12 | rm -f ${SESSION_PATH}/${common_name} 13 | 14 | echo "${TIME}: ${common_name}/${REMOTE_IP} offline." >> ${LOG_FILE} 15 | 16 | cfgid=$(uci show ${CONFIG} | grep "@users" | grep "\.username='${common_name}'" | cut -d '.' -sf 2) 17 | [ -n "$cfgid" ] && { 18 | routes=$(uci -q get ${CONFIG}.${cfgid}.routes) 19 | [ -n "$routes" ] && { 20 | for route in ${routes}; do 21 | route del -net ${route} gw ${ifconfig_pool_remote_ip} >/dev/null 2>&1 22 | done 23 | #echo "${TIME}: ${common_name}/${REMOTE_IP} del route." >> ${LOG_FILE} 24 | } 25 | } 26 | 27 | #可根据退出的账号自定义脚本,如静态路由表,组网等。 28 | SCRIPT="/usr/share/openvpn-server/script/client_disconnect/${common_name}" 29 | [ -s "$SCRIPT" ] && { 30 | [ ! -x "$SCRIPT" ] && chmod 0755 "$SCRIPT" 31 | "$SCRIPT" "$@" 32 | } 33 | exit 0 34 | -------------------------------------------------------------------------------- /luci-app-openvpn-server/root/usr/share/openvpn-server/script/down.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | uci -q batch <<-EOF >/dev/null 4 | delete network.ovpn_server 5 | commit network 6 | EOF 7 | 8 | ifup ovpn_server >/dev/null 2>&1 9 | ifdown ovpn_server >/dev/null 2>&1 10 | -------------------------------------------------------------------------------- /luci-app-openvpn-server/root/usr/share/openvpn-server/script/gen_client_config.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | CONFIG="luci-app-openvpn-server" 4 | 5 | port=$(uci -q get ${CONFIG}.server.port || echo "1194") 6 | proto=$(uci -q get ${CONFIG}.server.proto || echo "udp") 7 | ddns=$(uci -q get ${CONFIG}.server.ddns || echo "example.com") 8 | 9 | cat <<-EOF > /tmp/openvpn.ovpn 10 | client 11 | dev tun 12 | proto ${proto} 13 | remote ${ddns} ${port} 14 | resolv-retry infinite 15 | nobind 16 | persist-key 17 | persist-tun 18 | auth-user-pass 19 | comp-lzo 20 | verb 3 21 | 22 | $(cat /usr/share/openvpn-server/ca.crt) 23 | 24 | EOF 25 | -------------------------------------------------------------------------------- /luci-app-openvpn-server/root/usr/share/openvpn-server/script/up.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | uci -q batch <<-EOF >/dev/null 4 | delete network.ovpn_server 5 | set network.ovpn_server=interface 6 | set network.ovpn_server.ifname="${dev}" 7 | set network.ovpn_server.device="${dev}" 8 | set network.ovpn_server.proto="static" 9 | set network.ovpn_server.ipaddr="${ifconfig_local}" 10 | set network.ovpn_server.netmask="${ifconfig_netmask}" 11 | commit network 12 | 13 | set firewall.ovpn_server.network="ovpn_server" 14 | commit firewall 15 | EOF 16 | 17 | ifdown ovpn_server >/dev/null 2>&1 18 | ifup ovpn_server >/dev/null 2>&1 19 | -------------------------------------------------------------------------------- /luci-app-openvpn-server/root/usr/share/rpcd/acl.d/luci-app-openvpn-server.json: -------------------------------------------------------------------------------- 1 | { 2 | "luci-app-openvpn-server": { 3 | "description": "Grant UCI access for luci-app-openvpn-server", 4 | "read": { 5 | "uci": [ "luci-app-openvpn-server" ] 6 | }, 7 | "write": { 8 | "uci": [ "luci-app-openvpn-server" ] 9 | } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /luci-app-pppoe-relay/Makefile: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2018-2020 Lienol 2 | # 3 | # This is free software, licensed under the Apache License, Version 2.0 . 4 | # 5 | 6 | include $(TOPDIR)/rules.mk 7 | 8 | LUCI_TITLE:=LuCI support for PPPoE Relay 9 | LUCI_DEPENDS:=+rp-pppoe-common +rp-pppoe-relay 10 | LUCI_PKGARCH:=all 11 | PKG_VERSION:=1 12 | PKG_RELEASE:=2-20200326 13 | 14 | include $(TOPDIR)/feeds/luci/luci.mk 15 | 16 | # call BuildPackage - OpenWrt buildroot signature 17 | -------------------------------------------------------------------------------- /luci-app-pppoe-relay/luasrc/controller/pppoe-relay.lua: -------------------------------------------------------------------------------- 1 | -- Copyright 2018-2019 Lienol 2 | module("luci.controller.pppoe-relay", package.seeall) 3 | local uci = require"luci.model.uci".cursor() 4 | 5 | function index() 6 | if not nixio.fs.access("/etc/config/pppoe-relay") then return end 7 | entry({"admin", "services", "pppoe-relay"}, cbi("pppoe-relay"), 8 | _("PPPoE Relay"), 2).dependent = true 9 | entry({"admin", "services", "pppoe-relay", "get_status"}, call("get_status")).leaf = 10 | true 11 | end 12 | 13 | function get_status() 14 | local json = {} 15 | json.status = false 16 | json.index = luci.http.formvalue("index") 17 | local section = luci.http.formvalue("section") 18 | local server_interface = uci:get("pppoe-relay", section, "server_interface") 19 | local client_interface = uci:get("pppoe-relay", section, "client_interface") 20 | if server_interface and client_interface then 21 | status = luci.sys.call("ps | grep '/usr/sbin/pppoe-relay -S " .. 22 | server_interface .. " -C " .. 23 | client_interface .. 24 | "' | grep -v 'grep' >/dev/null") 25 | if status == 0 then json.status = true end 26 | end 27 | luci.http.prepare_content("application/json") 28 | luci.http.write_json(json) 29 | end 30 | -------------------------------------------------------------------------------- /luci-app-pppoe-relay/luasrc/view/pppoe-relay/ajax.htm: -------------------------------------------------------------------------------- 1 | <% 2 | local dsp = require "luci.dispatcher" 3 | -%> 4 | 5 | -------------------------------------------------------------------------------- /luci-app-pppoe-relay/luasrc/view/pppoe-relay/status.htm: -------------------------------------------------------------------------------- 1 | <%+cbi/valueheader%> 2 | <%=pcdata(self:cfgvalue(section) or self.default or "")%> 3 | <%+cbi/valuefooter%> 4 | -------------------------------------------------------------------------------- /luci-app-pppoe-relay/po/zh-cn/pppoe-relay.po: -------------------------------------------------------------------------------- 1 | msgid "PPPoE Relay" 2 | msgstr "PPPoE 穿透" 3 | 4 | msgid "Opening the PPPoE relay allows devices in the Intranet to create a separate PPPoE connection that can cross NAT." 5 | msgstr "开启 PPPoE 中继允许内网中的设备创建一个可穿过 NAT 的独立 PPPoE 连接" 6 | 7 | msgid "Enable or disable the PPPoE Relay" 8 | msgstr "启用或禁用PPPoE穿透" 9 | 10 | msgid "Server Interface" 11 | msgstr "服务端接口" 12 | 13 | msgid "Specify the PPPoE server interface" 14 | msgstr "指定PPPoE服务器接口" 15 | 16 | msgid "Client Interface" 17 | msgstr "客户端接口" 18 | 19 | msgid "Specify the PPPoE client interface" 20 | msgstr "指定PPPoE客户端接口" 21 | 22 | msgid "Enabled" 23 | msgstr "启用" -------------------------------------------------------------------------------- /luci-app-pppoe-relay/po/zh_Hans: -------------------------------------------------------------------------------- 1 | zh-cn -------------------------------------------------------------------------------- /luci-app-pppoe-relay/root/etc/config/pppoe-relay: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /luci-app-pppoe-relay/root/etc/init.d/pppoe-relay: -------------------------------------------------------------------------------- 1 | #!/bin/sh /etc/rc.common 2 | # Copyright (C) 2018-2020 Lienol 3 | 4 | START=99 5 | 6 | CONFIG="pppoe-relay" 7 | 8 | setup_service() { 9 | config_get enabled $1 enabled 10 | [ "$enabled" -eq 0 ] && return 0 11 | config_get server_interface $1 server_interface 12 | config_get client_interface $1 client_interface 13 | [ -n "$server_interface" -a -n "$client_interface" ] && { 14 | is_run=$(ps | grep "/usr/sbin/pppoe-relay -S $server_interface -C $client_interface" | grep -v "grep") 15 | [ -z "$is_run" ] && /usr/sbin/pppoe-relay -S $server_interface -C $client_interface 16 | } 17 | } 18 | 19 | start() { 20 | config_load $CONFIG 21 | config_foreach setup_service service 22 | } 23 | 24 | stop() { 25 | killall -q -9 pppoe-relay 26 | } 27 | -------------------------------------------------------------------------------- /luci-app-pppoe-relay/root/etc/uci-defaults/luci-app-pppoe-relay: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | uci -q batch <<-EOF >/dev/null 4 | delete ucitrack.@pppoe-relay[-1] 5 | add ucitrack pppoe-relay 6 | set ucitrack.@pppoe-relay[-1].init=pppoe-relay 7 | commit ucitrack 8 | EOF 9 | 10 | rm -f /tmp/luci-indexcache 11 | exit 0 12 | -------------------------------------------------------------------------------- /luci-app-pppoe-relay/root/usr/share/rpcd/acl.d/luci-app-pppoe-relay.json: -------------------------------------------------------------------------------- 1 | { 2 | "luci-app-pppoe-relay": { 3 | "description": "Grant UCI access for luci-app-pppoe-relay", 4 | "read": { 5 | "uci": [ "pppoe-relay" ] 6 | }, 7 | "write": { 8 | "uci": [ "pppoe-relay" ] 9 | } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /luci-app-pppoe-server/Makefile: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2018-2021 Lienol 2 | # 3 | # This is free software, licensed under the Apache License, Version 2.0 . 4 | # 5 | 6 | include $(TOPDIR)/rules.mk 7 | 8 | LUCI_TITLE:=LuCI support for PPPoE Server 9 | LUCI_DEPENDS:=+rp-pppoe-common +rp-pppoe-server 10 | LUCI_PKGARCH:=all 11 | PKG_VERSION:=20211223 12 | PKG_RELEASE:=2 13 | 14 | define Package/luci-app-pppoe-server/preinst 15 | #!/bin/sh 16 | rm -rf $${IPKG_INSTROOT}/etc/config/pppoe-server >/dev/null 2>&1 17 | rm -rf $${IPKG_INSTROOT}/etc/init.d/pppoe-server >/dev/null 2>&1 18 | exit 0 19 | endef 20 | 21 | include $(TOPDIR)/feeds/luci/luci.mk 22 | 23 | # call BuildPackage - OpenWrt buildroot signature 24 | -------------------------------------------------------------------------------- /luci-app-pppoe-server/luasrc/controller/pppoe-server.lua: -------------------------------------------------------------------------------- 1 | -- Copyright 2018-2021 Lienol 2 | module("luci.controller.pppoe-server", package.seeall) 3 | 4 | function index() 5 | if not nixio.fs.access("/etc/config/pppoe-server") then return end 6 | 7 | entry({"admin", "services", "pppoe-server"}, alias("admin", "services", "pppoe-server", "settings"), _("PPPoE Server"), 3) 8 | entry({"admin", "services", "pppoe-server", "settings"}, cbi("pppoe-server/settings"), _("General Settings"), 10).leaf = true 9 | entry({"admin", "services", "pppoe-server", "users"}, cbi("pppoe-server/users"), _("Users Manager"), 20).leaf = true 10 | entry({"admin", "services", "pppoe-server", "online"}, cbi("pppoe-server/online"), _("Online Users"), 30).leaf = true 11 | entry({"admin", "services", "pppoe-server", "status"}, call("status")).leaf = true 12 | end 13 | 14 | function status() 15 | local e = {} 16 | e.status = luci.sys.call("pidof %s >/dev/null" % "pppoe-server") == 0 17 | luci.http.prepare_content("application/json") 18 | luci.http.write_json(e) 19 | end 20 | -------------------------------------------------------------------------------- /luci-app-pppoe-server/luasrc/model/cbi/pppoe-server/online.lua: -------------------------------------------------------------------------------- 1 | local o = require "luci.dispatcher" 2 | local fs = require "nixio.fs" 3 | local jsonc = require "luci.jsonc" 4 | 5 | local sessions = {} 6 | local session_path = "/var/etc/pppoe-server/session" 7 | if fs.access(session_path) then 8 | for filename in fs.dir(session_path) do 9 | local session_file = session_path .. "/" .. filename 10 | local file = io.open(session_file, "r") 11 | local t = jsonc.parse(file:read("*a")) 12 | if t then 13 | t.session_file = session_file 14 | sessions[#sessions + 1] = t 15 | end 16 | file:close() 17 | end 18 | end 19 | 20 | f = SimpleForm("processes", translate("PPPoE Server"), translate("The PPPoE server is a broadband access authentication server that prevents ARP spoofing.")) 21 | f.reset = false 22 | f.submit = false 23 | 24 | t = f:section(Table, sessions, translate("Online Users")) 25 | t:option(DummyValue, "username", translate("Username")) 26 | t:option(DummyValue, "interface", translate("Interface")) 27 | t:option(DummyValue, "ip", translate("Client IP")) 28 | t:option(DummyValue, "mac", translate("MAC address")) 29 | t:option(DummyValue, "login_time", translate("Login Time")) 30 | 31 | _kill = t:option(Button, "_kill", translate("Forced offline")) 32 | _kill.inputstyle = "reset" 33 | function _kill.write(t, s) 34 | luci.util.execi("rm -f " .. t.map:get(s, "session_file")) 35 | null, t.tag_error[t] = luci.sys.process.signal(t.map:get(s, "pid"), 9) 36 | luci.http.redirect(o.build_url("admin/services/pppoe-server/online")) 37 | end 38 | 39 | return f 40 | -------------------------------------------------------------------------------- /luci-app-pppoe-server/luasrc/model/cbi/pppoe-server/users.lua: -------------------------------------------------------------------------------- 1 | m = Map("pppoe-server", translate("PPPoE Server")) 2 | m.description = translate( 3 | "The PPPoE server is a broadband access authentication server that prevents ARP spoofing.") 4 | s = m:section(TypedSection, "user", translate("Users Manager")) 5 | s.addremove = true 6 | s.anonymous = true 7 | s.template = "cbi/tblsection" 8 | 9 | o = s:option(Flag, "enabled", translate("Enabled")) 10 | o.rmempty = false 11 | 12 | o = s:option(Value, "username", translate("User name")) 13 | o.placeholder = translate("User name") 14 | o.rmempty = true 15 | 16 | o = s:option(Value, "password", translate("Password")) 17 | o.rmempty = true 18 | 19 | o = s:option(Value, "ipaddress", translate("IP address")) 20 | o.placeholder = translate("Automatically") 21 | o.datatype = "ipaddr" 22 | o.rmempty = true 23 | function o.cfgvalue(e, t) 24 | value = e.map:get(t, "ipaddress") 25 | return value == "*" and "" or value 26 | end 27 | function o.remove(e, t) Value.write(e, t, "*") end 28 | return m 29 | -------------------------------------------------------------------------------- /luci-app-pppoe-server/luasrc/view/pppoe-server/index.htm: -------------------------------------------------------------------------------- 1 | <% include("cbi/map") %> 2 | 14 | -------------------------------------------------------------------------------- /luci-app-pppoe-server/luasrc/view/pppoe-server/status.htm: -------------------------------------------------------------------------------- 1 | <%+cbi/valueheader%> 2 | <%=pcdata(self:cfgvalue(section) or self.default or "")%> 3 | <%+cbi/valuefooter%> 4 | -------------------------------------------------------------------------------- /luci-app-pppoe-server/po/zh-cn/pppoe-server.po: -------------------------------------------------------------------------------- 1 | msgid "PPPoE Server" 2 | msgstr "PPPoE 服务器" 3 | 4 | msgid "The PPPoE server is a broadband access authentication server that prevents ARP spoofing." 5 | msgstr "PPPoE服务器是一个宽带接入认证服务器,可以防止ARP欺骗." 6 | 7 | msgid "Current Condition" 8 | msgstr "当前状态" 9 | 10 | msgid "General settings" 11 | msgstr "基本设置" 12 | 13 | msgid "Client Interface" 14 | msgstr "客户端接口" 15 | 16 | msgid "Listen in this interface" 17 | msgstr "监听客户端接口" 18 | 19 | msgid "Server IP" 20 | msgstr "服务器 IP 地址" 21 | 22 | msgid "PPPoE Server IP address.default: 10.0.1.1" 23 | msgstr "PPPoE 服务器远程地址。默认:10.0.1.1" 24 | 25 | msgid "Client IP" 26 | msgstr "客户端 IP 地址" 27 | 28 | msgid "PPPoE Client IP address.default: 10.0.1.100-254" 29 | msgstr "分配给客户端的 IP 地址范围。默认:10.0.1.100-254" 30 | 31 | msgid "Preferred DNS server" 32 | msgstr "首选 DNS 服务器" 33 | 34 | msgid "Alternate DNS server" 35 | msgstr "备用 DNS 服务器" 36 | 37 | msgid "Client upper limit" 38 | msgstr "客户端上限数" 39 | 40 | msgid "Specify how many clients can connect to the server simultaneously." 41 | msgstr "指定有多少客户端可以同时连接到服务器" 42 | 43 | msgid "Users Manager" 44 | msgstr "用户管理" 45 | 46 | msgid "Enabled" 47 | msgstr "启用" 48 | 49 | msgid "User name" 50 | msgstr "用户名" 51 | 52 | msgid "Password" 53 | msgstr "密码" 54 | 55 | msgid "IP address" 56 | msgstr "IP 地址" 57 | 58 | msgid "Automatically" 59 | msgstr "自动分配" 60 | 61 | msgid "Online Users" 62 | msgstr "在线用户" 63 | 64 | msgid "Login Time" 65 | msgstr "登录时间" 66 | 67 | msgid "Forced offline" 68 | msgstr "强制下线" 69 | 70 | msgid "NOT RUNNING" 71 | msgstr "未运行" 72 | 73 | msgid "RUNNING" 74 | msgstr "运行中" -------------------------------------------------------------------------------- /luci-app-pppoe-server/po/zh_Hans: -------------------------------------------------------------------------------- 1 | zh-cn -------------------------------------------------------------------------------- /luci-app-pppoe-server/root/etc/config/pppoe-server: -------------------------------------------------------------------------------- 1 | 2 | config service 3 | option client_interface 'br-lan' 4 | option localip '10.0.1.1' 5 | option remoteip '10.0.1.100-254' 6 | option count '50' 7 | option dns1 '223.5.5.5' 8 | option dns2 '119.29.29.29' 9 | option enabled '0' 10 | -------------------------------------------------------------------------------- /luci-app-pppoe-server/root/etc/uci-defaults/luci-app-pppoe-server: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | uci -q batch <<-EOF >/dev/null 4 | delete firewall.pppoe_server 5 | set firewall.pppoe_server=include 6 | set firewall.pppoe_server.type=script 7 | set firewall.pppoe_server.path=/var/etc/pppoe-server.include 8 | set firewall.pppoe_server.reload=1 9 | EOF 10 | 11 | uci -q batch <<-EOF >/dev/null 12 | delete ucitrack.@pppoe-server[-1] 13 | add ucitrack pppoe-server 14 | set ucitrack.@pppoe-server[-1].init=pppoe-server 15 | commit ucitrack 16 | EOF 17 | 18 | rm -rf /tmp/luci-*cache 19 | exit 0 20 | -------------------------------------------------------------------------------- /luci-app-pppoe-server/root/usr/share/pppoe-server/ip-down: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | _LOGOUT_TIME="$(date "+%Y-%m-%d %H:%M:%S")" 4 | CONFIG="pppoe-server" 5 | CONFIG_PATH=/var/etc/${CONFIG} 6 | SESSION_PATH=${CONFIG_PATH}/session 7 | 8 | _USERNAME=${PEERNAME} 9 | _IFACE=${1} 10 | _TTY=${2} 11 | _SPEED=${3} 12 | _LOCALIP=${4} 13 | _PEERIP=${5} 14 | _REMOTEIP=${6} 15 | _BYTES_SENT=${BYTES_SENT} 16 | _BYTES_RCVD=${BYTES_RCVD} 17 | _CONNECT_TIME=${CONNECT_TIME} 18 | 19 | rm -f ${SESSION_PATH}/${_USERNAME}.${_IFACE} 20 | rm -f /var/run/${_IFACE}.pid 21 | 22 | #可根据退出的账号自定义脚本,如静态路由表,组网等。 23 | SCRIPT="/usr/share/${CONFIG}/ip-down.d/${_USERNAME}" 24 | [ -s "$SCRIPT" ] && { 25 | [ ! -x "$SCRIPT" ] && chmod 0755 "$SCRIPT" 26 | "$SCRIPT" "$@" 27 | } 28 | -------------------------------------------------------------------------------- /luci-app-pppoe-server/root/usr/share/rpcd/acl.d/luci-app-pppoe-server.json: -------------------------------------------------------------------------------- 1 | { 2 | "luci-app-pppoe-server": { 3 | "description": "Grant UCI access for luci-app-pppoe-server", 4 | "read": { 5 | "uci": [ "pppoe-server" ] 6 | }, 7 | "write": { 8 | "uci": [ "pppoe-server" ] 9 | } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /luci-app-pptp-server/Makefile: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2018-2021 Lienol 2 | # 3 | # This is free software, licensed under the Apache License, Version 2.0 . 4 | # 5 | 6 | include $(TOPDIR)/rules.mk 7 | 8 | LUCI_TITLE:=LuCI support for PPTP VPN Server 9 | LUCI_DEPENDS:=+pptpd +kmod-mppe +ppp +luci-lib-jsonc 10 | LUCI_PKGARCH:=all 11 | PKG_VERSION:=20211223 12 | PKG_RELEASE:=2 13 | 14 | include $(TOPDIR)/feeds/luci/luci.mk 15 | 16 | # call BuildPackage - OpenWrt buildroot signature 17 | -------------------------------------------------------------------------------- /luci-app-pptp-server/luasrc/controller/pptpd.lua: -------------------------------------------------------------------------------- 1 | -- Copyright 2018-2020 Lienol 2 | module("luci.controller.pptpd", package.seeall) 3 | 4 | function index() 5 | if not nixio.fs.access("/etc/config/luci-app-pptp-server") then return end 6 | 7 | entry({"admin", "vpn"}, firstchild(), "VPN", 45).dependent = false 8 | entry({"admin", "vpn", "pptpd"}, alias("admin", "vpn", "pptpd", "settings"), _("PPTP VPN Server"), 48) 9 | entry({"admin", "vpn", "pptpd", "settings"}, cbi("pptpd/settings"), _("General Settings"), 10).leaf = true 10 | entry({"admin", "vpn", "pptpd", "users"}, cbi("pptpd/users"), _("Users Manager"), 20).leaf = true 11 | entry({"admin", "vpn", "pptpd", "user"}, cbi("pptpd/user")).leaf = true 12 | entry({"admin", "vpn", "pptpd", "online"}, cbi("pptpd/online"), _("Online Users"), 30).leaf = true 13 | entry({"admin", "vpn", "pptpd", "status"}, call("status")).leaf = true 14 | end 15 | 16 | function status() 17 | local e = {} 18 | e.status = luci.sys.call("pidof %s >/dev/null" % "pptpd") == 0 19 | luci.http.prepare_content("application/json") 20 | luci.http.write_json(e) 21 | end 22 | -------------------------------------------------------------------------------- /luci-app-pptp-server/luasrc/model/cbi/pptpd/settings.lua: -------------------------------------------------------------------------------- 1 | local s = require "luci.sys" 2 | local net = require"luci.model.network".init() 3 | local ifaces = s.net:devices() 4 | local m, s, o 5 | m = Map("luci-app-pptp-server", translate("PPTP VPN Server")) 6 | m.description = translate("Simple, quick and convenient PPTP VPN, universal across the platform") 7 | m.template = "pptpd/index" 8 | 9 | s = m:section(TypedSection, "service") 10 | s.anonymous = true 11 | 12 | o = s:option(DummyValue, "pptpd_status", translate("Current Condition")) 13 | o.template = "pptpd/status" 14 | o.value = translate("Collecting data...") 15 | 16 | o = s:option(Flag, "enabled", translate("Enabled")) 17 | o.rmempty = false 18 | 19 | o = s:option(Value, "localip", translate("Server IP"), translate("VPN Server IP address, it not required.")) 20 | o.datatype = "ipaddr" 21 | o.placeholder = translate("192.168.1.2") 22 | o.rmempty = true 23 | o.default = "192.168.1.2" 24 | 25 | o = s:option(Value, "remoteip", translate("Client IP"), translate("VPN Client IP address, it not required.")) 26 | o.placeholder = translate("192.168.1.10-20") 27 | o.rmempty = true 28 | o.default = "192.168.1.10-20" 29 | 30 | --[[ 31 | o = s:option(Value, "dns", translate("DNS IP address"), translate("This will be sent to the client, it not required.")) 32 | o.placeholder = translate("192.168.1.1") 33 | o.datatype = "ipaddr" 34 | o.rmempty = true 35 | o.default = "192.168.1.1" 36 | ]]-- 37 | 38 | o = s:option(Flag, "mppe", translate("Enable MPPE Encryption"), translate("Allows 128-bit encrypted connection.")) 39 | o.rmempty = false 40 | return m 41 | -------------------------------------------------------------------------------- /luci-app-pptp-server/luasrc/model/cbi/pptpd/user.lua: -------------------------------------------------------------------------------- 1 | local d = require "luci.dispatcher" 2 | 3 | m = Map("luci-app-pptp-server", translate("Users Manager")) 4 | m.redirect = d.build_url("admin", "vpn", "pptpd", "users") 5 | 6 | s = m:section(NamedSection, arg[1], "users", "") 7 | s.addremove = false 8 | s.anonymous = true 9 | 10 | o = s:option(Flag, "enabled", translate("Enabled")) 11 | o.default = 1 12 | o.rmempty = false 13 | 14 | o = s:option(Value, "username", translate("Username")) 15 | o.placeholder = translate("Username") 16 | o.rmempty = false 17 | 18 | o = s:option(Value, "password", translate("Password")) 19 | o.placeholder = translate("Password") 20 | o.rmempty = false 21 | 22 | o = s:option(Value, "ipaddress", translate("IP address")) 23 | o.placeholder = translate("Automatically") 24 | o.datatype = "ip4addr" 25 | o.rmempty = true 26 | 27 | o = s:option(DynamicList, "routes", translate("Static Routes")) 28 | o.placeholder = "192.168.10.0/24" 29 | o.datatype = "ipmask4" 30 | o.rmempty = true 31 | 32 | return m 33 | -------------------------------------------------------------------------------- /luci-app-pptp-server/luasrc/model/cbi/pptpd/users.lua: -------------------------------------------------------------------------------- 1 | local d = require "luci.dispatcher" 2 | 3 | m = Map("luci-app-pptp-server", translate("PPTP VPN Server")) 4 | m.description = translate("Simple, quick and convenient PPTP VPN, universal across the platform") 5 | 6 | s = m:section(TypedSection, "users", translate("Users Manager")) 7 | s.addremove = true 8 | s.anonymous = true 9 | s.template = "cbi/tblsection" 10 | s.extedit = d.build_url("admin", "vpn", "pptpd", "user", "%s") 11 | function s.create(e, t) 12 | t = TypedSection.create(e, t) 13 | luci.http.redirect(e.extedit:format(t)) 14 | end 15 | 16 | o = s:option(Flag, "enabled", translate("Enabled")) 17 | o.default = 1 18 | o.rmempty = false 19 | 20 | o = s:option(Value, "username", translate("Username")) 21 | o.placeholder = translate("Username") 22 | o.rmempty = false 23 | 24 | o = s:option(Value, "password", translate("Password")) 25 | o.placeholder = translate("Password") 26 | o.rmempty = false 27 | 28 | o = s:option(Value, "ipaddress", translate("IP address")) 29 | o.placeholder = translate("Automatically") 30 | o.datatype = "ip4addr" 31 | o.rmempty = true 32 | 33 | return m 34 | -------------------------------------------------------------------------------- /luci-app-pptp-server/luasrc/view/pptpd/index.htm: -------------------------------------------------------------------------------- 1 | <% include("cbi/map") %> 2 | 14 | -------------------------------------------------------------------------------- /luci-app-pptp-server/luasrc/view/pptpd/status.htm: -------------------------------------------------------------------------------- 1 | <%+cbi/valueheader%> 2 | <%=pcdata(self:cfgvalue(section) or self.default or "")%> 3 | <%+cbi/valuefooter%> 4 | -------------------------------------------------------------------------------- /luci-app-pptp-server/po/zh-cn/pptpd.po: -------------------------------------------------------------------------------- 1 | msgid "PPTP VPN Server" 2 | msgstr "PPTP VPN 服务器" 3 | 4 | msgid "Simple, quick and convenient PPTP VPN, universal across the platform" 5 | msgstr "简单快捷方便的PPTP VPN,全平台通用。" 6 | 7 | msgid "Current Condition" 8 | msgstr "当前状态" 9 | 10 | msgid "General settings" 11 | msgstr "基本设置" 12 | 13 | msgid "Enabled" 14 | msgstr "启用" 15 | 16 | msgid "Server IP" 17 | msgstr "服务器 IP 地址" 18 | 19 | msgid "VPN Server IP address, it not required." 20 | msgstr "VPN 服务器远程地址,留空将自动设置。" 21 | 22 | msgid "Client IP" 23 | msgstr "客户端 IP 地址" 24 | 25 | msgid "VPN Client IP address, it not required." 26 | msgstr "分配给客户端的 IP 地址范围,留空将自动设置。" 27 | 28 | msgid "Enable MPPE Encryption" 29 | msgstr "启用MPPE 加密" 30 | 31 | msgid "Allows 128-bit encrypted connection." 32 | msgstr "允许使用 128 位加密连接。" 33 | 34 | msgid "Users Manager" 35 | msgstr "用户管理" 36 | 37 | msgid "Username" 38 | msgstr "用户名" 39 | 40 | msgid "Password" 41 | msgstr "密码" 42 | 43 | msgid "IP address" 44 | msgstr "IP 地址" 45 | 46 | msgid "Automatically" 47 | msgstr "自动分配" 48 | 49 | msgid "Online Users" 50 | msgstr "在线用户" 51 | 52 | msgid "Login Time" 53 | msgstr "登录时间" 54 | 55 | msgid "Blacklist" 56 | msgstr "黑名单" 57 | 58 | msgid "Add to Blacklist" 59 | msgstr "加入黑名单" 60 | 61 | msgid "Remove from Blacklist" 62 | msgstr "移出黑名单" 63 | 64 | msgid "Forced offline" 65 | msgstr "强制下线" 66 | 67 | msgid "NOT RUNNING" 68 | msgstr "未运行" 69 | 70 | msgid "RUNNING" 71 | msgstr "运行中" -------------------------------------------------------------------------------- /luci-app-pptp-server/po/zh_Hans: -------------------------------------------------------------------------------- 1 | zh-cn -------------------------------------------------------------------------------- /luci-app-pptp-server/root/etc/config/luci-app-pptp-server: -------------------------------------------------------------------------------- 1 | 2 | config service 'pptpd' 3 | option mppe '1' 4 | option localip '192.168.2.1' 5 | option remoteip '192.168.2.10-20' 6 | option enabled '0' 7 | 8 | -------------------------------------------------------------------------------- /luci-app-pptp-server/root/etc/uci-defaults/luci-app-pptp-server: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | uci -q batch <<-EOF >/dev/null 4 | delete firewall.luci_app_pptp_server 5 | set firewall.luci_app_pptp_server=include 6 | set firewall.luci_app_pptp_server.type=script 7 | set firewall.luci_app_pptp_server.path=/var/etc/pptpd.include 8 | set firewall.luci_app_pptp_server.reload=1 9 | EOF 10 | 11 | uci -q batch <<-EOF >/dev/null 12 | delete ucitrack.@luci-app-pptp-server[-1] 13 | add ucitrack luci-app-pptp-server 14 | set ucitrack.@luci-app-pptp-server[-1].init=luci-app-pptp-server 15 | commit ucitrack 16 | EOF 17 | 18 | /etc/init.d/pptpd disable 2>/dev/null 19 | /etc/init.d/pptpd stop 2>/dev/null 20 | rm -rf /tmp/luci-*cache 21 | exit 0 22 | -------------------------------------------------------------------------------- /luci-app-pptp-server/root/usr/share/pptpd/ip-down: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | _LOGOUT_TIME="$(date "+%Y-%m-%d %H:%M:%S")" 4 | CONFIG="luci-app-pptp-server" 5 | PPTP_PATH=/var/etc/pptpd 6 | PPTP_SESSION_PATH=${PPTP_PATH}/session 7 | 8 | _USERNAME=${PEERNAME} 9 | _IFACE=${1} 10 | _TTY=${2} 11 | _SPEED=${3} 12 | _LOCALIP=${4} 13 | _PEERIP=${5} 14 | _REMOTEIP=${6} 15 | _BYTES_SENT=${BYTES_SENT} 16 | _BYTES_RCVD=${BYTES_RCVD} 17 | _CONNECT_TIME=${CONNECT_TIME} 18 | 19 | rm -f ${PPTP_SESSION_PATH}/${_USERNAME}.${_IFACE} 20 | rm -f /var/run/${_IFACE}.pid 21 | 22 | #可根据退出的账号自定义脚本,如静态路由表,组网等。 23 | SCRIPT="/usr/share/pptpd/ip-down.d/${_USERNAME}" 24 | [ -s "$SCRIPT" ] && { 25 | [ ! -x "$SCRIPT" ] && chmod 0755 "$SCRIPT" 26 | "$SCRIPT" "$@" 27 | } 28 | -------------------------------------------------------------------------------- /luci-app-pptp-server/root/usr/share/rpcd/acl.d/luci-app-pptp-server.json: -------------------------------------------------------------------------------- 1 | { 2 | "luci-app-pptp-server": { 3 | "description": "Grant UCI access for luci-app-pptp-server", 4 | "read": { 5 | "uci": [ "luci-app-pptp-server" ] 6 | }, 7 | "write": { 8 | "uci": [ "luci-app-pptp-server" ] 9 | } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /luci-app-ramfree/Makefile: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2018 Lienol 2 | # 3 | # This is free software, licensed under the Apache License, Version 2.0 . 4 | # 5 | 6 | include $(TOPDIR)/rules.mk 7 | 8 | LUCI_TITLE:=Add Release RAM Button 9 | LUCI_PKGARCH:=all 10 | PKG_VERSION:=1.0 11 | PKG_RELEASE:=1 12 | 13 | include $(TOPDIR)/feeds/luci/luci.mk 14 | 15 | # call BuildPackage - OpenWrt buildroot signature 16 | 17 | 18 | -------------------------------------------------------------------------------- /luci-app-ramfree/luasrc/controller/release_ram.lua: -------------------------------------------------------------------------------- 1 | module("luci.controller.release_ram",package.seeall) 2 | 3 | function index() 4 | entry({"admin","status","release_ram"}, call("release_ram"), _("Release Ram"), 9999) 5 | end 6 | function release_ram() 7 | luci.sys.call("sync && echo 3 > /proc/sys/vm/drop_caches") 8 | luci.http.redirect(luci.dispatcher.build_url("admin/status")) 9 | end 10 | -------------------------------------------------------------------------------- /luci-app-ramfree/po/zh-cn/release_ram.po: -------------------------------------------------------------------------------- 1 | msgid "Release Ram" 2 | msgstr "释放内存" 3 | -------------------------------------------------------------------------------- /luci-app-ramfree/po/zh_Hans: -------------------------------------------------------------------------------- 1 | zh-cn -------------------------------------------------------------------------------- /luci-app-socat/Makefile: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2020 Lienol 2 | # 3 | # This is free software, licensed under the GNU General Public License v3. 4 | # 5 | 6 | include $(TOPDIR)/rules.mk 7 | 8 | PKG_NAME:=luci-app-socat 9 | PKG_VERSION:=20230129 10 | PKG_RELEASE:=1 11 | 12 | PKG_MAINTAINER:=Lienol 13 | 14 | LUCI_TITLE:=LuCI support for Socat 15 | LUCI_DEPENDS:=+socat 16 | LUCI_PKGARCH:=all 17 | 18 | define Package/$(PKG_NAME)/conffiles 19 | /etc/config/socat 20 | endef 21 | 22 | include $(TOPDIR)/feeds/luci/luci.mk 23 | 24 | # call BuildPackage - OpenWrt buildroot signature 25 | -------------------------------------------------------------------------------- /luci-app-socat/luasrc/controller/socat.lua: -------------------------------------------------------------------------------- 1 | -- Copyright 2020 Lienol 2 | module("luci.controller.socat", package.seeall) 3 | 4 | function index() 5 | if not nixio.fs.access("/etc/config/socat") then 6 | return 7 | end 8 | 9 | entry({"admin", "network", "socat"}, alias("admin", "network", "socat", "index"), _("Socat"), 100).dependent = true 10 | entry({"admin", "network", "socat", "index"}, cbi("socat/index")).leaf = true 11 | entry({"admin", "network", "socat", "config"}, cbi("socat/config")).leaf = true 12 | entry({"admin", "network", "socat", "status"}, call("act_status")).leaf = true 13 | end 14 | 15 | function act_status() 16 | local e = {} 17 | e.index = luci.http.formvalue("index") 18 | e.status = luci.sys.call(string.format("busybox ps -w | grep -v 'grep' | grep '/var/etc/socat/%s' >/dev/null", luci.http.formvalue("id"))) == 0 19 | luci.http.prepare_content("application/json") 20 | luci.http.write_json(e) 21 | end 22 | -------------------------------------------------------------------------------- /luci-app-socat/luasrc/view/socat/list_status.htm: -------------------------------------------------------------------------------- 1 | 20 | -------------------------------------------------------------------------------- /luci-app-socat/luasrc/view/socat/status.htm: -------------------------------------------------------------------------------- 1 | <%+cbi/valueheader%> 2 | -- 3 | <%+cbi/valuefooter%> 4 | -------------------------------------------------------------------------------- /luci-app-socat/po/zh-cn/socat.po: -------------------------------------------------------------------------------- 1 | msgid "Socat" 2 | msgstr "Socat" 3 | 4 | msgid "Socat is a versatile networking tool named after 'Socket CAT', which can be regarded as an N-fold enhanced version of NetCat" 5 | msgstr "Socat 是 Linux 下的一个多功能的网络工具,名字来由是「Socket CAT」。其功能与有瑞士军刀之称的 Netcat 类似,可以看做是 Netcat 的加强版。" 6 | 7 | msgid "Socat Config" 8 | msgstr "Socat 配置" 9 | 10 | msgid "Status" 11 | msgstr "状态" 12 | 13 | msgid "Enabled" 14 | msgstr "启用" 15 | 16 | msgid "Remarks" 17 | msgstr "备注" 18 | 19 | msgid "Protocol" 20 | msgstr "协议" 21 | 22 | msgid "IPv6 Only" 23 | msgstr "仅IPv6" 24 | 25 | msgid "When checked, only IPv6 ports are listen for, otherwise IPv4 will also be listened for." 26 | msgstr "当勾选时,仅监听IPv6,否则将会同时监听IPv4。" 27 | 28 | msgid "Port Forwards" 29 | msgstr "端口转发" 30 | 31 | msgid "Listen Protocol" 32 | msgstr "监听协议" 33 | 34 | msgid "Listen port" 35 | msgstr "监听端口" 36 | 37 | msgid "Bind to a port local" 38 | msgstr "绑定到本地端口" 39 | 40 | msgid "Destination Protocol" 41 | msgstr "目标协议" 42 | 43 | msgid "Destination address" 44 | msgstr "目标地址" 45 | 46 | msgid "Destination port" 47 | msgstr "目标端口" 48 | 49 | msgid "Proxy" 50 | msgstr "代理" 51 | 52 | msgid "Proxy Server" 53 | msgstr "代理服务器" 54 | 55 | msgid "Proxy Port" 56 | msgstr "代理端口" 57 | 58 | msgid "Open firewall port" 59 | msgstr "打开防火墙端口" 60 | -------------------------------------------------------------------------------- /luci-app-socat/po/zh_Hans: -------------------------------------------------------------------------------- 1 | zh-cn -------------------------------------------------------------------------------- /luci-app-socat/root/etc/config/socat: -------------------------------------------------------------------------------- 1 | 2 | config global 'global' 3 | option enable '0' 4 | -------------------------------------------------------------------------------- /luci-app-socat/root/etc/uci-defaults/luci-app-socat: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | uci -q batch <<-EOF >/dev/null 4 | delete firewall.socat 5 | set firewall.socat=include 6 | set firewall.socat.type=script 7 | set firewall.socat.path=/var/etc/socat.include 8 | set firewall.socat.reload=1 9 | EOF 10 | 11 | uci -q batch <<-EOF >/dev/null 12 | delete ucitrack.@socat[-1] 13 | add ucitrack socat 14 | set ucitrack.@socat[-1].init=luci_socat 15 | commit ucitrack 16 | EOF 17 | 18 | rm -rf /tmp/luci-*cache 19 | exit 0 20 | -------------------------------------------------------------------------------- /luci-app-socat/root/usr/share/rpcd/acl.d/luci-app-socat.json: -------------------------------------------------------------------------------- 1 | { 2 | "luci-app-socat": { 3 | "description": "Grant UCI access for luci-app-socat", 4 | "read": { 5 | "uci": [ "socat" ] 6 | }, 7 | "write": { 8 | "uci": [ "socat" ] 9 | } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /luci-app-softethervpn/Makefile: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2018-2022 Lienol 2 | # 3 | # This is free software, licensed under the Apache License, Version 2.0 . 4 | # 5 | 6 | include $(TOPDIR)/rules.mk 7 | 8 | LUCI_TITLE:=LuCI support for SoftEtherVPN 9 | LUCI_DEPENDS:=+zlib +libpthread +librt +libreadline +libncurses +libiconv-full +kmod-tun +libopenssl +softethervpn-server 10 | LUCI_PKGARCH:=all 11 | PKG_VERSION:=20220102 12 | PKG_RELEASE:=1 13 | 14 | include $(TOPDIR)/feeds/luci/luci.mk 15 | 16 | # call BuildPackage - OpenWrt buildroot signature 17 | -------------------------------------------------------------------------------- /luci-app-softethervpn/luasrc/controller/softethervpn.lua: -------------------------------------------------------------------------------- 1 | module("luci.controller.softethervpn", package.seeall) 2 | 3 | function index() 4 | if not nixio.fs.access("/etc/config/softethervpn") then return end 5 | 6 | e = entry({"admin", "vpn", "softethervpn"}, cbi("softethervpn"), _("SoftEther VPN"), 80) 7 | e.dependent = true 8 | e.acl_depends = { "luci-app-softethervpn" } 9 | entry({"admin", "vpn", "softethervpn", "status"}, call("status")).leaf = true 10 | end 11 | 12 | function status() 13 | local e = {} 14 | e.status = luci.sys.call("pidof %s >/dev/null" % "vpnserver") == 0 15 | luci.http.prepare_content("application/json") 16 | luci.http.write_json(e) 17 | end 18 | -------------------------------------------------------------------------------- /luci-app-softethervpn/luasrc/view/softethervpn/index.htm: -------------------------------------------------------------------------------- 1 | <%# 2 | Copyright (C) 2018-2019 Lienol 3 | Licensed to the public under the Apache License 2.0. 4 | -%> 5 | 6 | <% include("cbi/map") %> 7 | 19 | -------------------------------------------------------------------------------- /luci-app-softethervpn/luasrc/view/softethervpn/status.htm: -------------------------------------------------------------------------------- 1 | <%+cbi/valueheader%> 2 | <%=pcdata(self:cfgvalue(section) or self.default or "")%> 3 | <%+cbi/valuefooter%> 4 | -------------------------------------------------------------------------------- /luci-app-softethervpn/po/zh-cn/softethervpn.po: -------------------------------------------------------------------------------- 1 | msgid "SoftEther VPN" 2 | msgstr "SoftEther VPN 服务器" 3 | 4 | msgid "SoftEther VPN is an open source, cross-platform, multi-protocol virtual private network solution developed by university of tsukuba graduate student Daiyuu Nobori for master's thesis.
can easily set up OpenVPN, IPsec, L2TP, ms-sstp, L2TPv3 and EtherIP servers on the router using the console." 5 | msgstr "SoftEther VPN是由筑波大学研究生Daiyuu Nobori因硕士论文开发的开源,跨平台,多重协定的虚拟私人网路方案。
使用控制台可以轻松在路由器上搭建OpenVPN, IPsec, L2TP, MS-SSTP, L2TPv3 和 EtherIP服务器。" 6 | 7 | msgid "Current Condition" 8 | msgstr "当前状态" 9 | 10 | msgid "Collecting data..." 11 | msgstr "收集数据..." 12 | 13 | msgid "Enabled" 14 | msgstr "启用" 15 | 16 | msgid "Console download" 17 | msgstr "控制台下载" 18 | -------------------------------------------------------------------------------- /luci-app-softethervpn/po/zh_Hans: -------------------------------------------------------------------------------- 1 | zh-cn -------------------------------------------------------------------------------- /luci-app-softethervpn/root/etc/config/softethervpn: -------------------------------------------------------------------------------- 1 | 2 | config softether 3 | option enabled '0' 4 | -------------------------------------------------------------------------------- /luci-app-softethervpn/root/etc/uci-defaults/luci-app-softethervpn: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | uci -q batch <<-EOF >/dev/null 4 | delete firewall.softethervpn 5 | set firewall.softethervpn=include 6 | set firewall.softethervpn.type=script 7 | set firewall.softethervpn.path=/var/etc/softethervpn.include 8 | set firewall.softethervpn.reload=1 9 | EOF 10 | 11 | uci -q batch <<-EOF >/dev/null 12 | delete ucitrack.@softethervpn[-1] 13 | add ucitrack softethervpn 14 | set ucitrack.@softethervpn[-1].init=softethervpn 15 | commit ucitrack 16 | EOF 17 | 18 | /etc/init.d/softethervpnserver stop 19 | /etc/init.d/softethervpnserver disable 20 | 21 | rm -rf /tmp/luci-*cache 22 | exit 0 23 | -------------------------------------------------------------------------------- /luci-app-softethervpn/root/usr/share/rpcd/acl.d/luci-app-softethervpn.json: -------------------------------------------------------------------------------- 1 | { 2 | "luci-app-softethervpn": { 3 | "description": "Grant UCI access for luci-app-softethervpn", 4 | "read": { 5 | "uci": [ "softethervpn" ] 6 | }, 7 | "write": { 8 | "uci": [ "softethervpn" ] 9 | } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /luci-app-ssr-mudb-server/Makefile: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2018-2020 Lienol 2 | # 3 | # This is free software, licensed under the GNU General Public License v3. 4 | # 5 | 6 | include $(TOPDIR)/rules.mk 7 | 8 | LUCI_TITLE:=LuCI support for SSR Mudb Server 9 | LUCI_DEPENDS:=+libsodium +luci-lib-jsonc +python3 10 | LUCI_PKGARCH:=all 11 | PKG_VERSION:=11 12 | PKG_DATE:=20211211 13 | 14 | include $(TOPDIR)/feeds/luci/luci.mk 15 | 16 | # call BuildPackage - OpenWrt buildroot signature 17 | -------------------------------------------------------------------------------- /luci-app-ssr-mudb-server/luasrc/view/ssr_mudb_server/status.htm: -------------------------------------------------------------------------------- 1 |
2 | 3 |
<%:Collecting data...%>
4 |
5 | 6 | 18 | -------------------------------------------------------------------------------- /luci-app-ssr-mudb-server/po/zh_Hans: -------------------------------------------------------------------------------- 1 | zh-cn -------------------------------------------------------------------------------- /luci-app-ssr-mudb-server/root/etc/config/ssr_mudb_server: -------------------------------------------------------------------------------- 1 | 2 | config global 3 | option auto_clear_transfer '0' 4 | option enable '0' 5 | -------------------------------------------------------------------------------- /luci-app-ssr-mudb-server/root/etc/config/ssr_mudb_server.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "u": 0, 4 | "method": "none", 5 | "user": "test", 6 | "enable": 1, 7 | "forbidden_port": "", 8 | "transfer_enable": 900727656415232, 9 | "passwd": "123456", 10 | "speed_limit_per_user": 0, 11 | "port": 50005, 12 | "d": 0, 13 | "protocol": "auth_chain_a", 14 | "obfs": "tls1.2_ticket_auth", 15 | "protocol_param": "10", 16 | "speed_limit_per_con": 0 17 | } 18 | ] -------------------------------------------------------------------------------- /luci-app-ssr-mudb-server/root/etc/uci-defaults/luci-app-ssr-mudb-server: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | uci -q batch <<-EOF >/dev/null 4 | delete firewall.ssr_mudb_server 5 | set firewall.ssr_mudb_server=include 6 | set firewall.ssr_mudb_server.type=script 7 | set firewall.ssr_mudb_server.path=/var/etc/ssr_mudb_server.include 8 | set firewall.ssr_mudb_server.reload=1 9 | EOF 10 | 11 | uci -q batch <<-EOF >/dev/null 12 | delete ucitrack.@ssr_mudb_server[-1] 13 | add ucitrack ssr_mudb_server 14 | set ucitrack.@ssr_mudb_server[-1].init=ssr_mudb_server 15 | commit ucitrack 16 | EOF 17 | 18 | chmod a+x /usr/share/ssr_mudb_server/* >/dev/null 2>&1 19 | cp -rf /usr/bin/python3 /usr/bin/python 20 | rm -rf /tmp/luci-*cache 21 | exit 0 22 | -------------------------------------------------------------------------------- /luci-app-ssr-mudb-server/root/usr/share/rpcd/acl.d/luci-app-ssr-mudb-server.json: -------------------------------------------------------------------------------- 1 | { 2 | "luci-app-ssr-mudb-server": { 3 | "description": "Grant UCI access for luci-app-ssr-mudb-server", 4 | "read": { 5 | "uci": [ "ssr_mudb_server" ] 6 | }, 7 | "write": { 8 | "uci": [ "ssr_mudb_server" ] 9 | } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /luci-app-ssr-mudb-server/root/usr/share/ssr_mudb_server/.travis.yml: -------------------------------------------------------------------------------- 1 | language: python 2 | python: 3 | - 2.6 4 | - 2.7 5 | - 3.3 6 | - 3.4 7 | cache: 8 | directories: 9 | - dante-1.4.0 10 | before_install: 11 | - sudo apt-get update -qq 12 | - sudo apt-get install -qq build-essential dnsutils iproute nginx bc 13 | - sudo dd if=/dev/urandom of=/usr/share/nginx/www/file bs=1M count=10 14 | - sudo sh -c "echo '127.0.0.1 localhost' > /etc/hosts" 15 | - sudo service nginx restart 16 | - pip install pep8 pyflakes nose coverage PySocks cymysql 17 | - sudo tests/socksify/install.sh 18 | - sudo tests/libsodium/install.sh 19 | - sudo tests/setup_tc.sh 20 | script: 21 | - tests/jenkins.sh 22 | -------------------------------------------------------------------------------- /luci-app-ssr-mudb-server/root/usr/share/ssr_mudb_server/CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | How to Contribute 2 | ================= 3 | 4 | Pull Requests 5 | ------------- 6 | 7 | 1. Pull requests are welcome. If you would like to add a large feature 8 | or make a significant change, make sure to open an issue to discuss with 9 | people first. 10 | 2. Follow PEP8. 11 | 3. Make sure to pass the unit tests. Write unit tests for new modules if 12 | needed. 13 | 14 | Issues 15 | ------ 16 | 17 | 1. Only bugs and feature requests are accepted here. 18 | 2. We'll only work on important features. If the feature you're asking only 19 | benefits a few people, you'd better implement the feature yourself and send us 20 | a pull request, or ask some of your friends to do so. 21 | 3. We don't answer questions of any other types here. Since very few people 22 | are watching the issue tracker here, you'll probably get no help from here. 23 | Read [Troubleshooting] and get help from forums or [mailing lists]. 24 | 4. Issues in languages other than English will be Google translated into English 25 | later. 26 | 27 | 28 | [Troubleshooting]: https://github.com/clowwindy/shadowsocks/wiki/Troubleshooting 29 | [mailing lists]: https://groups.google.com/forum/#!forum/shadowsocks 30 | -------------------------------------------------------------------------------- /luci-app-ssr-mudb-server/root/usr/share/ssr_mudb_server/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM alpine:3.6 2 | 3 | ENV SERVER_ADDR 0.0.0.0 4 | ENV SERVER_PORT 51348 5 | ENV PASSWORD psw 6 | ENV METHOD aes-128-ctr 7 | ENV PROTOCOL auth_aes128_md5 8 | ENV PROTOCOLPARAM 32 9 | ENV OBFS tls1.2_ticket_auth_compatible 10 | ENV TIMEOUT 300 11 | ENV DNS_ADDR 8.8.8.8 12 | ENV DNS_ADDR_2 8.8.4.4 13 | 14 | ARG BRANCH=manyuser 15 | ARG WORK=~ 16 | 17 | 18 | RUN apk --no-cache add python \ 19 | libsodium \ 20 | wget 21 | 22 | 23 | RUN mkdir -p $WORK && \ 24 | wget -qO- --no-check-certificate https://github.com/shadowsocksr/shadowsocksr/archive/$BRANCH.tar.gz | tar -xzf - -C $WORK 25 | 26 | 27 | WORKDIR $WORK/shadowsocksr-$BRANCH/shadowsocks 28 | 29 | 30 | EXPOSE $SERVER_PORT 31 | CMD python server.py -p $SERVER_PORT -k $PASSWORD -m $METHOD -O $PROTOCOL -o $OBFS -G $PROTOCOLPARAM 32 | -------------------------------------------------------------------------------- /luci-app-ssr-mudb-server/root/usr/share/ssr_mudb_server/MANIFEST.in: -------------------------------------------------------------------------------- 1 | recursive-include shadowsocks *.py 2 | include README.rst 3 | include LICENSE 4 | -------------------------------------------------------------------------------- /luci-app-ssr-mudb-server/root/usr/share/ssr_mudb_server/apiconfig.py: -------------------------------------------------------------------------------- 1 | # Config 2 | API_INTERFACE = 'sspanelv2' #mudbjson, sspanelv2, sspanelv3, sspanelv3ssr, glzjinmod, legendsockssr, muapiv2(not support) 3 | UPDATE_TIME = 60 4 | SERVER_PUB_ADDR = '127.0.0.1' # mujson_mgr need this to generate ssr link 5 | 6 | #mudb 7 | MUDB_FILE = '/etc/config/ssr_mudb_server.json' 8 | 9 | # Mysql 10 | MYSQL_CONFIG = 'usermysql.json' 11 | 12 | # API 13 | MUAPI_CONFIG = 'usermuapi.json' 14 | 15 | 16 | -------------------------------------------------------------------------------- /luci-app-ssr-mudb-server/root/usr/share/ssr_mudb_server/clear_traffic_all_users.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | cd /usr/share/ssr_mudb_server 4 | user_total=$(python3 mujson_mgr.py -l | wc -l) 5 | [ $user_total -eq 0 ] && echo -e "没有发现用户,请检查 !" && exit 1 6 | for i in $(seq 1 $user_total) 7 | do 8 | port=$(python3 mujson_mgr.py -l | sed -n ${i}p | awk '{print $4}') 9 | match_clear=$(python3 mujson_mgr.py -c -p "${port}") 10 | done 11 | exit 12 | -------------------------------------------------------------------------------- /luci-app-ssr-mudb-server/root/usr/share/ssr_mudb_server/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "server": "0.0.0.0", 3 | "server_ipv6": "::", 4 | "server_port": 8388, 5 | "local_address": "127.0.0.1", 6 | "local_port": 1080, 7 | 8 | "password": "m", 9 | "method": "aes-128-ctr", 10 | "protocol": "auth_aes128_md5", 11 | "protocol_param": "", 12 | "obfs": "tls1.2_ticket_auth_compatible", 13 | "obfs_param": "", 14 | "speed_limit_per_con": 0, 15 | "speed_limit_per_user": 0, 16 | 17 | "additional_ports" : {}, // only works under multi-user mode 18 | "additional_ports_only" : false, // only works under multi-user mode 19 | "timeout": 120, 20 | "udp_timeout": 60, 21 | "dns_ipv6": false, 22 | "connect_verbose_info": 0, 23 | "redirect": "", 24 | "fast_open": false 25 | } 26 | -------------------------------------------------------------------------------- /luci-app-ssr-mudb-server/root/usr/share/ssr_mudb_server/configloader.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | # -*- coding: UTF-8 -*- 3 | import importloader 4 | 5 | g_config = None 6 | 7 | def load_config(): 8 | global g_config 9 | g_config = importloader.loads(['userapiconfig', 'apiconfig']) 10 | 11 | def get_config(): 12 | return g_config 13 | 14 | load_config() 15 | 16 | -------------------------------------------------------------------------------- /luci-app-ssr-mudb-server/root/usr/share/ssr_mudb_server/firewall.lua: -------------------------------------------------------------------------------- 1 | #!/usr/bin/lua 2 | 3 | require 'luci.sys' 4 | local jsonc = require "luci.jsonc" 5 | 6 | local function get_config_path() 7 | return luci.sys.exec("echo -n $(cat /usr/share/ssr_mudb_server/userapiconfig.py | grep 'MUDB_FILE' | cut -d \"'\" -f 2)") 8 | end 9 | 10 | local function get_config_json() 11 | return luci.sys.exec("cat " .. get_config_path()) or "[]" 12 | end 13 | 14 | local json = jsonc.parse(get_config_json()) 15 | if json then 16 | for index = 1, table.maxn(json) do 17 | local o = json[index] 18 | if o.enable == 1 then 19 | luci.sys.call(string.format("iptables -A SSR_MUDB-SERVER -p tcp --dport %s -m comment --comment %s -j ACCEPT", o.port, o.user)) 20 | luci.sys.call(string.format("iptables -A SSR_MUDB-SERVER -p udp --dport %s -m comment --comment %s -j ACCEPT", o.port, o.user)) 21 | end 22 | end 23 | end -------------------------------------------------------------------------------- /luci-app-ssr-mudb-server/root/usr/share/ssr_mudb_server/importloader.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | # -*- coding: UTF-8 -*- 3 | 4 | def load(name): 5 | try: 6 | obj = __import__(name) 7 | reload(obj) 8 | return obj 9 | except: 10 | pass 11 | 12 | try: 13 | import importlib 14 | obj = importlib.__import__(name) 15 | importlib.reload(obj) 16 | return obj 17 | except: 18 | pass 19 | 20 | def loads(namelist): 21 | for name in namelist: 22 | obj = load(name) 23 | if obj is not None: 24 | return obj 25 | -------------------------------------------------------------------------------- /luci-app-ssr-mudb-server/root/usr/share/ssr_mudb_server/initcfg.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | If Not Exist "userapiconfig.py" Copy "apiconfig.py" "userapiconfig.py" 3 | If Not Exist "user-config.json" Copy "config.json" "user-config.json" 4 | If Not Exist "usermysql.json" Copy "mysql.json" "usermysql.json" 5 | -------------------------------------------------------------------------------- /luci-app-ssr-mudb-server/root/usr/share/ssr_mudb_server/initcfg.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | chmod +x *.sh 4 | chmod +x shadowsocks/*.sh 5 | cp -n apiconfig.py userapiconfig.py 6 | cp -n config.json user-config.json 7 | cp -n mysql.json usermysql.json 8 | 9 | -------------------------------------------------------------------------------- /luci-app-ssr-mudb-server/root/usr/share/ssr_mudb_server/initmudbjson.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | bash initcfg.sh 4 | sed -i "s/API_INTERFACE = .\+\?\#/API_INTERFACE = \'mudbjson\' \#/g" userapiconfig.py 5 | ip_addr=`ifconfig -a|grep inet|grep -v inet6|grep -v "127.0.0."|grep -v -e "192\.168\..[0-9]\+\.[0-9]\+"|grep -v -e "10\.[0-9]\+\.[0-9]\+\.[0-9]\+"|awk '{print $2}'|tr -d "addr:"` 6 | ip_count=`echo $ip_addr|grep -e "^[0-9]\+\.[0-9]\+\.[0-9]\+\.[0-9]\+$" -c` 7 | 8 | if [[ $ip_count == 1 ]]; then 9 | ip_addr=`ip a|grep inet|grep -v inet6|grep -v "127.0.0."|grep -v -e "192\.168\..[0-9]\+\.[0-9]\+"|grep -v -e "10\.[0-9]\+\.[0-9]\+\.[0-9]\+"|awk '{print $2}'` 10 | ip_addr=${ip_addr%/*} 11 | ip_count=`echo $ip_addr|grep -e "^[0-9]\+\.[0-9]\+\.[0-9]\+\.[0-9]\+$" -c` 12 | fi 13 | if [[ $ip_count == 1 ]]; then 14 | echo "server IP is "${ip_addr} 15 | sed -i "s/SERVER_PUB_ADDR = .\+/SERVER_PUB_ADDR = \'"${ip_addr}"\'/g" userapiconfig.py 16 | user_count=`python mujson_mgr.py -l|grep -c -e "[0-9]"` 17 | if [[ $user_count == 0 ]]; then 18 | port=`python -c 'import random;print(random.randint(10000, 65536))'` 19 | python mujson_mgr.py -a -p ${port} 20 | fi 21 | else 22 | echo "unable to detect server IP" 23 | fi 24 | 25 | -------------------------------------------------------------------------------- /luci-app-ssr-mudb-server/root/usr/share/ssr_mudb_server/logrun.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | cd `dirname $0` 3 | #python_ver=$(ls /usr/bin|grep -e "^python[23]\.[1-9]\+$"|tail -1) 4 | eval $(ps -ef | grep "[0-9] python server\\.py m" | awk '{print "kill "$2}') 5 | ulimit -n 512000 6 | nohup python server.py m >> ssserver.log 2>&1 & 7 | 8 | -------------------------------------------------------------------------------- /luci-app-ssr-mudb-server/root/usr/share/ssr_mudb_server/mudb.json: -------------------------------------------------------------------------------- 1 | [] -------------------------------------------------------------------------------- /luci-app-ssr-mudb-server/root/usr/share/ssr_mudb_server/mysql.json: -------------------------------------------------------------------------------- 1 | { 2 | "host": "127.0.0.1", 3 | "port": 3306, 4 | "user": "ss", 5 | "password": "pass", 6 | "db": "sspanel", 7 | "node_id": 0, 8 | "transfer_mul": 1.0, 9 | "ssl_enable": 0, 10 | "ssl_ca": "", 11 | "ssl_cert": "", 12 | "ssl_key": "" 13 | } 14 | -------------------------------------------------------------------------------- /luci-app-ssr-mudb-server/root/usr/share/ssr_mudb_server/run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | cd `dirname $0` 3 | #python_ver=$(ls /usr/bin|grep -e "^python[23]\.[1-9]\+$"|tail -1) 4 | eval $(ps -ef | grep "[0-9] python server\\.py m" | awk '{print "kill "$2}') 5 | ulimit -n 512000 6 | nohup python server.py m>> /dev/null 2>&1 & 7 | 8 | -------------------------------------------------------------------------------- /luci-app-ssr-mudb-server/root/usr/share/ssr_mudb_server/setup.py: -------------------------------------------------------------------------------- 1 | import codecs 2 | from setuptools import setup 3 | 4 | 5 | with codecs.open('README.rst', encoding='utf-8') as f: 6 | long_description = f.read() 7 | 8 | setup( 9 | name="shadowsocks", 10 | version="2.6.12", 11 | license='http://www.apache.org/licenses/LICENSE-2.0', 12 | description="A fast tunnel proxy that help you get through firewalls", 13 | author='clowwindy', 14 | author_email='clowwindy42@gmail.com', 15 | url='https://github.com/shadowsocks/shadowsocks', 16 | packages=['shadowsocks', 'shadowsocks.crypto', 'shadowsocks.obfsplugin'], 17 | package_data={ 18 | 'shadowsocks': ['README.rst', 'LICENSE'] 19 | }, 20 | install_requires=[], 21 | entry_points=""" 22 | [console_scripts] 23 | sslocal = shadowsocks.local:main 24 | ssserver = shadowsocks.server:main 25 | """, 26 | classifiers=[ 27 | 'License :: OSI Approved :: Apache Software License', 28 | 'Programming Language :: Python :: 2', 29 | 'Programming Language :: Python :: 2.6', 30 | 'Programming Language :: Python :: 2.7', 31 | 'Programming Language :: Python :: 3', 32 | 'Programming Language :: Python :: 3.3', 33 | 'Programming Language :: Python :: 3.4', 34 | 'Programming Language :: Python :: Implementation :: CPython', 35 | 'Programming Language :: Python :: Implementation :: PyPy', 36 | 'Topic :: Internet :: Proxy Servers', 37 | ], 38 | long_description=long_description, 39 | ) 40 | -------------------------------------------------------------------------------- /luci-app-ssr-mudb-server/root/usr/share/ssr_mudb_server/setup_cymysql.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | rm -rf CyMySQL 3 | rm -rf cymysql 4 | git clone https://github.com/nakagami/CyMySQL.git 5 | mv CyMySQL/cymysql ./ 6 | rm -rf CyMySQL 7 | -------------------------------------------------------------------------------- /luci-app-ssr-mudb-server/root/usr/share/ssr_mudb_server/shadowsocks/__init__.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | # 3 | # Copyright 2012-2015 clowwindy 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); you may 6 | # not use this file except in compliance with the License. You may obtain 7 | # a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 13 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 14 | # License for the specific language governing permissions and limitations 15 | # under the License. 16 | 17 | from __future__ import absolute_import, division, print_function, \ 18 | with_statement 19 | -------------------------------------------------------------------------------- /luci-app-ssr-mudb-server/root/usr/share/ssr_mudb_server/shadowsocks/crypto/__init__.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # 3 | # Copyright 2015 clowwindy 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); you may 6 | # not use this file except in compliance with the License. You may obtain 7 | # a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 13 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 14 | # License for the specific language governing permissions and limitations 15 | # under the License. 16 | 17 | from __future__ import absolute_import, division, print_function, \ 18 | with_statement 19 | -------------------------------------------------------------------------------- /luci-app-ssr-mudb-server/root/usr/share/ssr_mudb_server/shadowsocks/crypto/rc4_md5.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # 3 | # Copyright 2015 clowwindy 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); you may 6 | # not use this file except in compliance with the License. You may obtain 7 | # a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 13 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 14 | # License for the specific language governing permissions and limitations 15 | # under the License. 16 | 17 | from __future__ import absolute_import, division, print_function, \ 18 | with_statement 19 | 20 | import hashlib 21 | 22 | from shadowsocks.crypto import openssl 23 | 24 | __all__ = ['ciphers'] 25 | 26 | 27 | def create_cipher(alg, key, iv, op, key_as_bytes=0, d=None, salt=None, 28 | i=1, padding=1): 29 | md5 = hashlib.md5() 30 | md5.update(key) 31 | md5.update(iv) 32 | rc4_key = md5.digest() 33 | return openssl.OpenSSLCrypto(b'rc4', rc4_key, b'', op) 34 | 35 | 36 | ciphers = { 37 | 'rc4-md5': (16, 16, create_cipher), 38 | 'rc4-md5-6': (16, 6, create_cipher), 39 | } 40 | 41 | 42 | def test(): 43 | from shadowsocks.crypto import util 44 | 45 | cipher = create_cipher('rc4-md5', b'k' * 32, b'i' * 16, 1) 46 | decipher = create_cipher('rc4-md5', b'k' * 32, b'i' * 16, 0) 47 | 48 | util.run_cipher(cipher, decipher) 49 | 50 | 51 | if __name__ == '__main__': 52 | test() 53 | -------------------------------------------------------------------------------- /luci-app-ssr-mudb-server/root/usr/share/ssr_mudb_server/shadowsocks/logrun.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | cd `dirname $0` 3 | eval $(ps -ef | grep "[0-9] python server\\.py a" | awk '{print "kill "$2}') 4 | ulimit -n 512000 5 | nohup python server.py a >> ssserver.log 2>&1 & 6 | -------------------------------------------------------------------------------- /luci-app-ssr-mudb-server/root/usr/share/ssr_mudb_server/shadowsocks/obfsplugin/__init__.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # 3 | # Copyright 2015 clowwindy 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); you may 6 | # not use this file except in compliance with the License. You may obtain 7 | # a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 13 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 14 | # License for the specific language governing permissions and limitations 15 | # under the License. 16 | 17 | from __future__ import absolute_import, division, print_function, \ 18 | with_statement 19 | -------------------------------------------------------------------------------- /luci-app-ssr-mudb-server/root/usr/share/ssr_mudb_server/shadowsocks/run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | cd `dirname $0` 3 | eval $(ps -ef | grep "[0-9] python server\\.py a" | awk '{print "kill "$2}') 4 | ulimit -n 512000 5 | nohup python server.py a >> /dev/null 2>&1 & 6 | -------------------------------------------------------------------------------- /luci-app-ssr-mudb-server/root/usr/share/ssr_mudb_server/shadowsocks/stop.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | #python_ver=$(ls /usr/bin|grep -e "^python[23]\.[1-9]\+$"|tail -1) 4 | eval $(ps -ef | grep "[0-9] python server\\.py a" | awk '{print "kill "$2}') 5 | -------------------------------------------------------------------------------- /luci-app-ssr-mudb-server/root/usr/share/ssr_mudb_server/shadowsocks/tail.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | tail -f ssserver.log 4 | -------------------------------------------------------------------------------- /luci-app-ssr-mudb-server/root/usr/share/ssr_mudb_server/shadowsocks/version.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | # -*- coding: utf-8 -*- 3 | # 4 | # Copyright 2017 breakwa11 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); you may 7 | # not use this file except in compliance with the License. You may obtain 8 | # a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 14 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 15 | # License for the specific language governing permissions and limitations 16 | # under the License. 17 | 18 | def version(): 19 | return '3.4.0 2017-07-27' 20 | 21 | -------------------------------------------------------------------------------- /luci-app-ssr-mudb-server/root/usr/share/ssr_mudb_server/stop.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # python_ver=$(ls /usr/bin|grep -e "^python[23]\.[1-9]\+$"|tail -1) 4 | eval $(ps -ef | grep "[0-9] python server\\.py m" | awk '{print "kill "$2}') 5 | -------------------------------------------------------------------------------- /luci-app-ssr-mudb-server/root/usr/share/ssr_mudb_server/switchrule.py: -------------------------------------------------------------------------------- 1 | def getKeys(key_list): 2 | return key_list 3 | #return key_list + ['plan'] # append the column name 'plan' 4 | 5 | def isTurnOn(row): 6 | return True 7 | #return row['plan'] == 'B' # then judge here 8 | 9 | -------------------------------------------------------------------------------- /luci-app-ssr-mudb-server/root/usr/share/ssr_mudb_server/tail.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | cd `dirname $0` 3 | tail -f ssserver.log 4 | -------------------------------------------------------------------------------- /luci-app-ssr-mudb-server/root/usr/share/ssr_mudb_server/tests/aes-cfb1.json: -------------------------------------------------------------------------------- 1 | { 2 | "server":"127.0.0.1", 3 | "server_port":8388, 4 | "local_port":1081, 5 | "password":"aes_password", 6 | "timeout":60, 7 | "method":"aes-256-cfb1", 8 | "local_address":"127.0.0.1", 9 | "fast_open":false 10 | } 11 | -------------------------------------------------------------------------------- /luci-app-ssr-mudb-server/root/usr/share/ssr_mudb_server/tests/aes-cfb8.json: -------------------------------------------------------------------------------- 1 | { 2 | "server":"127.0.0.1", 3 | "server_port":8388, 4 | "local_port":1081, 5 | "password":"aes_password", 6 | "timeout":60, 7 | "method":"aes-256-cfb8", 8 | "local_address":"127.0.0.1", 9 | "fast_open":false 10 | } 11 | -------------------------------------------------------------------------------- /luci-app-ssr-mudb-server/root/usr/share/ssr_mudb_server/tests/aes-ctr.json: -------------------------------------------------------------------------------- 1 | { 2 | "server":"127.0.0.1", 3 | "server_port":8388, 4 | "local_port":1081, 5 | "password":"aes_password", 6 | "timeout":60, 7 | "method":"aes-256-ctr", 8 | "local_address":"127.0.0.1", 9 | "fast_open":false 10 | } 11 | -------------------------------------------------------------------------------- /luci-app-ssr-mudb-server/root/usr/share/ssr_mudb_server/tests/aes.json: -------------------------------------------------------------------------------- 1 | { 2 | "server":"127.0.0.1", 3 | "server_port":8388, 4 | "local_port":1081, 5 | "password":"aes_password", 6 | "timeout":60, 7 | "method":"aes-256-cfb", 8 | "local_address":"127.0.0.1", 9 | "fast_open":false 10 | } 11 | -------------------------------------------------------------------------------- /luci-app-ssr-mudb-server/root/usr/share/ssr_mudb_server/tests/chacha20.json: -------------------------------------------------------------------------------- 1 | { 2 | "server":"127.0.0.1", 3 | "server_port":8388, 4 | "local_port":1081, 5 | "password":"salsa20_password", 6 | "timeout":60, 7 | "method":"chacha20", 8 | "local_address":"127.0.0.1", 9 | "fast_open":false 10 | } 11 | -------------------------------------------------------------------------------- /luci-app-ssr-mudb-server/root/usr/share/ssr_mudb_server/tests/client-multi-server-ip.json: -------------------------------------------------------------------------------- 1 | { 2 | "server":["127.0.0.1", "127.0.0.1"], 3 | "server_port":8388, 4 | "local_port":1081, 5 | "password":"aes_password", 6 | "timeout":60, 7 | "method":"aes-256-cfb", 8 | "local_address":"127.0.0.1", 9 | "fast_open":false 10 | } 11 | -------------------------------------------------------------------------------- /luci-app-ssr-mudb-server/root/usr/share/ssr_mudb_server/tests/fastopen.json: -------------------------------------------------------------------------------- 1 | { 2 | "server":"127.0.0.1", 3 | "server_port":8388, 4 | "local_port":1081, 5 | "password":"fastopen_password", 6 | "timeout":60, 7 | "method":"aes-256-cfb", 8 | "local_address":"127.0.0.1", 9 | "fast_open":true 10 | } 11 | -------------------------------------------------------------------------------- /luci-app-ssr-mudb-server/root/usr/share/ssr_mudb_server/tests/ipv6-client-side.json: -------------------------------------------------------------------------------- 1 | { 2 | "server":"::1", 3 | "server_port":8388, 4 | "local_port":1081, 5 | "password":"aes_password", 6 | "timeout":60, 7 | "method":"aes-256-cfb", 8 | "local_address":"127.0.0.1", 9 | "fast_open":false 10 | } 11 | -------------------------------------------------------------------------------- /luci-app-ssr-mudb-server/root/usr/share/ssr_mudb_server/tests/ipv6.json: -------------------------------------------------------------------------------- 1 | { 2 | "server":"::", 3 | "server_port":8388, 4 | "local_port":1081, 5 | "password":"aes_password", 6 | "timeout":60, 7 | "method":"aes-256-cfb", 8 | "local_address":"127.0.0.1", 9 | "fast_open":false 10 | } 11 | -------------------------------------------------------------------------------- /luci-app-ssr-mudb-server/root/usr/share/ssr_mudb_server/tests/libsodium/install.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | if [ ! -d libsodium-1.0.1 ]; then 4 | wget https://github.com/jedisct1/libsodium/releases/download/1.0.1/libsodium-1.0.1.tar.gz || exit 1 5 | tar xf libsodium-1.0.1.tar.gz || exit 1 6 | fi 7 | pushd libsodium-1.0.1 8 | ./configure && make -j2 && make install || exit 1 9 | sudo ldconfig 10 | popd 11 | -------------------------------------------------------------------------------- /luci-app-ssr-mudb-server/root/usr/share/ssr_mudb_server/tests/nose_plugin.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # 3 | # Copyright 2015 clowwindy 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); you may 6 | # not use this file except in compliance with the License. You may obtain 7 | # a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 13 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 14 | # License for the specific language governing permissions and limitations 15 | # under the License. 16 | 17 | import nose 18 | from nose.plugins.base import Plugin 19 | 20 | 21 | class ExtensionPlugin(Plugin): 22 | 23 | name = "ExtensionPlugin" 24 | 25 | def options(self, parser, env): 26 | Plugin.options(self, parser, env) 27 | 28 | def configure(self, options, config): 29 | Plugin.configure(self, options, config) 30 | self.enabled = True 31 | 32 | def wantFile(self, file): 33 | return file.endswith('.py') 34 | 35 | def wantDirectory(self, directory): 36 | return True 37 | 38 | def wantModule(self, file): 39 | return True 40 | 41 | 42 | if __name__ == '__main__': 43 | nose.main(addplugins=[ExtensionPlugin()]) 44 | -------------------------------------------------------------------------------- /luci-app-ssr-mudb-server/root/usr/share/ssr_mudb_server/tests/rc4-md5.json: -------------------------------------------------------------------------------- 1 | { 2 | "server":"127.0.0.1", 3 | "server_port":8388, 4 | "local_port":1081, 5 | "password":"aes_password", 6 | "timeout":60, 7 | "method":"rc4-md5", 8 | "local_address":"127.0.0.1", 9 | "fast_open":false 10 | } 11 | -------------------------------------------------------------------------------- /luci-app-ssr-mudb-server/root/usr/share/ssr_mudb_server/tests/salsa20-ctr.json: -------------------------------------------------------------------------------- 1 | { 2 | "server":"127.0.0.1", 3 | "server_port":8388, 4 | "local_port":1081, 5 | "password":"salsa20_password", 6 | "timeout":60, 7 | "method":"salsa20-ctr", 8 | "local_address":"127.0.0.1", 9 | "fast_open":false 10 | } 11 | -------------------------------------------------------------------------------- /luci-app-ssr-mudb-server/root/usr/share/ssr_mudb_server/tests/salsa20.json: -------------------------------------------------------------------------------- 1 | { 2 | "server":"127.0.0.1", 3 | "server_port":8388, 4 | "local_port":1081, 5 | "password":"salsa20_password", 6 | "timeout":60, 7 | "method":"salsa20", 8 | "local_address":"127.0.0.1", 9 | "fast_open":false 10 | } 11 | -------------------------------------------------------------------------------- /luci-app-ssr-mudb-server/root/usr/share/ssr_mudb_server/tests/server-multi-passwd-client-side.json: -------------------------------------------------------------------------------- 1 | { 2 | "server": "127.0.0.1", 3 | "server_port": "8385", 4 | "local_port": 1081, 5 | "password": "foobar5", 6 | "timeout": 60, 7 | "method": "aes-256-cfb" 8 | } 9 | -------------------------------------------------------------------------------- /luci-app-ssr-mudb-server/root/usr/share/ssr_mudb_server/tests/server-multi-passwd-table.json: -------------------------------------------------------------------------------- 1 | { 2 | "server": "127.0.0.1", 3 | "server_port": 8384, 4 | "local_port": 1081, 5 | "password": "foobar4", 6 | "port_password": { 7 | "8381": "foobar1", 8 | "8382": "foobar2", 9 | "8383": "foobar3", 10 | "8384": "foobar4", 11 | "8385": "foobar5", 12 | "8386": "foobar6", 13 | "8387": "foobar7", 14 | "8388": "foobar8", 15 | "8389": "foobar9" 16 | }, 17 | "timeout": 60, 18 | "method": "table" 19 | } 20 | -------------------------------------------------------------------------------- /luci-app-ssr-mudb-server/root/usr/share/ssr_mudb_server/tests/server-multi-passwd.json: -------------------------------------------------------------------------------- 1 | { 2 | "server": "127.0.0.1", 3 | "local_port": 1081, 4 | "port_password": { 5 | "8381": "foobar1", 6 | "8382": "foobar2", 7 | "8383": "foobar3", 8 | "8384": "foobar4", 9 | "8385": "foobar5", 10 | "8386": "foobar6", 11 | "8387": "foobar7", 12 | "8388": "foobar8", 13 | "8389": "foobar9" 14 | }, 15 | "timeout": 60, 16 | "method": "aes-256-cfb" 17 | } 18 | -------------------------------------------------------------------------------- /luci-app-ssr-mudb-server/root/usr/share/ssr_mudb_server/tests/server-multi-ports.json: -------------------------------------------------------------------------------- 1 | { 2 | "server": "127.0.0.1", 3 | "server_port": [8384, 8345, 8346, 8347], 4 | "local_port": 1081, 5 | "password": "foobar4", 6 | "timeout": 60, 7 | "method": "aes-256-cfb" 8 | } 9 | -------------------------------------------------------------------------------- /luci-app-ssr-mudb-server/root/usr/share/ssr_mudb_server/tests/setup_tc.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | DEV=lo 4 | PORT=8388 5 | DELAY=100ms 6 | 7 | type tc 2> /dev/null && ( 8 | tc qdisc add dev $DEV root handle 1: htb 9 | tc class add dev $DEV parent 1: classid 1:1 htb rate 2mbps 10 | tc class add dev $DEV parent 1:1 classid 1:6 htb rate 2mbps ceil 1mbps prio 0 11 | tc filter add dev $DEV parent 1:0 prio 0 protocol ip handle 6 fw flowid 1:6 12 | 13 | tc filter add dev $DEV parent 1:0 protocol ip u32 match ip dport $PORT 0xffff flowid 1:6 14 | tc filter add dev $DEV parent 1:0 protocol ip u32 match ip sport $PORT 0xffff flowid 1:6 15 | 16 | tc qdisc show dev lo 17 | ) 18 | 19 | -------------------------------------------------------------------------------- /luci-app-ssr-mudb-server/root/usr/share/ssr_mudb_server/tests/socksify/install.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | if [ ! -d dante-1.4.0 ]; then 4 | wget http://www.inet.no/dante/files/dante-1.4.0.tar.gz || exit 1 5 | tar xf dante-1.4.0.tar.gz || exit 1 6 | fi 7 | pushd dante-1.4.0 8 | ./configure && make -j4 && make install || exit 1 9 | popd 10 | cp tests/socksify/socks.conf /etc/ || exit 1 11 | -------------------------------------------------------------------------------- /luci-app-ssr-mudb-server/root/usr/share/ssr_mudb_server/tests/socksify/socks.conf: -------------------------------------------------------------------------------- 1 | route { 2 | from: 0.0.0.0/0 to: 0.0.0.0/0 via: 127.0.0.1 port = 1081 3 | proxyprotocol: socks_v5 4 | method: none 5 | } -------------------------------------------------------------------------------- /luci-app-ssr-mudb-server/root/usr/share/ssr_mudb_server/tests/table.json: -------------------------------------------------------------------------------- 1 | { 2 | "server":"127.0.0.1", 3 | "server_port":8388, 4 | "local_port":1081, 5 | "password":"table_password", 6 | "timeout":60, 7 | "method":"table", 8 | "local_address":"127.0.0.1", 9 | "fast_open":false 10 | } 11 | -------------------------------------------------------------------------------- /luci-app-ssr-mudb-server/root/usr/share/ssr_mudb_server/tests/test_large_file.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | PYTHON="coverage run -p" 4 | URL=http://127.0.0.1/file 5 | 6 | mkdir -p tmp 7 | 8 | $PYTHON shadowsocks/local.py -c tests/aes.json & 9 | LOCAL=$! 10 | 11 | $PYTHON shadowsocks/server.py -c tests/aes.json --forbidden-ip "" & 12 | SERVER=$! 13 | 14 | sleep 3 15 | 16 | time curl -o tmp/expected $URL 17 | time curl -o tmp/result --socks5-hostname 127.0.0.1:1081 $URL 18 | 19 | kill -s SIGINT $LOCAL 20 | kill -s SIGINT $SERVER 21 | 22 | sleep 2 23 | 24 | diff tmp/expected tmp/result || exit 1 25 | -------------------------------------------------------------------------------- /luci-app-ssr-mudb-server/root/usr/share/ssr_mudb_server/tests/test_udp_src.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | PYTHON="coverage run -p" 4 | 5 | mkdir -p tmp 6 | 7 | $PYTHON shadowsocks/local.py -c tests/aes.json -v & 8 | LOCAL=$! 9 | 10 | $PYTHON shadowsocks/server.py -c tests/aes.json --forbidden-ip "" -v & 11 | SERVER=$! 12 | 13 | sleep 3 14 | 15 | python tests/test_udp_src.py 16 | r=$? 17 | 18 | kill -s SIGINT $LOCAL 19 | kill -s SIGINT $SERVER 20 | 21 | sleep 2 22 | 23 | exit $r 24 | -------------------------------------------------------------------------------- /luci-app-ssr-mudb-server/root/usr/share/ssr_mudb_server/tests/workers.json: -------------------------------------------------------------------------------- 1 | { 2 | "server":"127.0.0.1", 3 | "server_port":8388, 4 | "local_port":1081, 5 | "password":"workers_password", 6 | "timeout":60, 7 | "method":"aes-256-cfb", 8 | "local_address":"127.0.0.1", 9 | "workers": 4 10 | } 11 | -------------------------------------------------------------------------------- /luci-app-ssr-mudb-server/root/usr/share/ssr_mudb_server/user-config.json: -------------------------------------------------------------------------------- 1 | { 2 | "server": "0.0.0.0", 3 | "server_ipv6": "::", 4 | "server_port": 8388, 5 | "local_address": "127.0.0.1", 6 | "local_port": 1080, 7 | 8 | "password": "m", 9 | "method": "aes-128-ctr", 10 | "protocol": "auth_aes128_md5", 11 | "protocol_param": "", 12 | "obfs": "tls1.2_ticket_auth_compatible", 13 | "obfs_param": "", 14 | "speed_limit_per_con": 0, 15 | "speed_limit_per_user": 0, 16 | 17 | "additional_ports" : {}, 18 | "additional_ports_only" : false, 19 | "timeout": 120, 20 | "udp_timeout": 60, 21 | "dns_ipv6": false, 22 | "connect_verbose_info": 0, 23 | "redirect": "", 24 | "fast_open": false 25 | } 26 | -------------------------------------------------------------------------------- /luci-app-ssr-mudb-server/root/usr/share/ssr_mudb_server/userapiconfig.py: -------------------------------------------------------------------------------- 1 | # Config 2 | API_INTERFACE = 'mudbjson' #mudbjson, sspanelv2, sspanelv3, sspanelv3ssr, glzjinmod, legendsockssr, muapiv2(not support) 3 | UPDATE_TIME = 60 4 | SERVER_PUB_ADDR = '0.0.0.0' # mujson_mgr need this to generate ssr link 5 | 6 | #mudb 7 | MUDB_FILE = '/etc/config/ssr_mudb_server.json' 8 | 9 | # Mysql 10 | MYSQL_CONFIG = 'usermysql.json' 11 | 12 | # API 13 | MUAPI_CONFIG = 'usermuapi.json' 14 | 15 | 16 | -------------------------------------------------------------------------------- /luci-app-ssr-mudb-server/root/usr/share/ssr_mudb_server/usermysql.json: -------------------------------------------------------------------------------- 1 | { 2 | "host": "127.0.0.1", 3 | "port": 3306, 4 | "user": "ss", 5 | "password": "pass", 6 | "db": "sspanel", 7 | "node_id": 0, 8 | "transfer_mul": 1.0, 9 | "ssl_enable": 0, 10 | "ssl_ca": "", 11 | "ssl_cert": "", 12 | "ssl_key": "" 13 | } 14 | -------------------------------------------------------------------------------- /luci-app-ssr-mudb-server/root/usr/share/ssr_mudb_server/utils/README.md: -------------------------------------------------------------------------------- 1 | Useful Tools 2 | =========== 3 | 4 | autoban.py 5 | ---------- 6 | 7 | Automatically ban IPs that try to brute force crack the server. 8 | 9 | See https://github.com/shadowsocks/shadowsocks/wiki/Ban-Brute-Force-Crackers 10 | -------------------------------------------------------------------------------- /luci-app-ssr-mudb-server/root/usr/share/ssr_mudb_server/utils/fail2ban/shadowsocks.conf: -------------------------------------------------------------------------------- 1 | [Definition] 2 | 3 | _daemon = shadowsocks 4 | 5 | failregex = ^\s+ERROR\s+can not parse header when handling connection from :\d+$ 6 | -------------------------------------------------------------------------------- /luci-app-syncthing/Makefile: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2016 Openwrt.org 2 | # 3 | # This is free software, licensed under the Apache License, Version 2.0 . 4 | # 5 | 6 | include $(TOPDIR)/rules.mk 7 | 8 | LUCI_TITLE:=LuCI support for syncthing 9 | LUCI_DEPENDS:=+syncthing 10 | LUCI_PKGARCH:=all 11 | PKG_VERSION:=1.0 12 | PKG_RELEASE:=2 13 | 14 | include $(TOPDIR)/feeds/luci/luci.mk 15 | 16 | # call BuildPackage - OpenWrt buildroot signature 17 | 18 | -------------------------------------------------------------------------------- /luci-app-syncthing/luasrc/controller/syncthing.lua: -------------------------------------------------------------------------------- 1 | 2 | module("luci.controller.syncthing", package.seeall) 3 | 4 | function index() 5 | if not nixio.fs.access("/etc/config/syncthing") then 6 | return 7 | end 8 | 9 | entry({"admin", "nas"}, firstchild(), "NAS", 44).dependent = false 10 | entry({"admin", "nas", "syncthing"}, cbi("syncthing"), _("Syncthing"), 10).dependent = true 11 | entry({"admin","nas","syncthing","status"},call("act_status")).leaf=true 12 | end 13 | 14 | function act_status() 15 | local e={} 16 | e.running=luci.sys.call("pgrep syncthing >/dev/null")==0 17 | luci.http.prepare_content("application/json") 18 | luci.http.write_json(e) 19 | end 20 | -------------------------------------------------------------------------------- /luci-app-syncthing/luasrc/model/cbi/syncthing.lua: -------------------------------------------------------------------------------- 1 | -- Copyright 2008 Yanira 2 | -- Licensed to the public under the Apache License 2.0. 3 | 4 | require("nixio.fs") 5 | 6 | m = Map("syncthing", translate("SyncThing Synchronization Tool")) 7 | 8 | m:section(SimpleSection).template = "syncthing/syncthing_status" 9 | 10 | s = m:section(TypedSection, "setting", translate("Settings")) 11 | s.anonymous = true 12 | 13 | s:option(Flag, "enabled", translate("Enable")) 14 | 15 | s:option(Value, "port", translate("port")).default = 8384 16 | s.rmempty = true 17 | 18 | 19 | return m 20 | -------------------------------------------------------------------------------- /luci-app-syncthing/luasrc/view/syncthing/syncthing_status.htm: -------------------------------------------------------------------------------- 1 | 17 | 18 |
19 |

20 | <%:Collecting data...%> 21 |

22 |
23 | -------------------------------------------------------------------------------- /luci-app-syncthing/po/zh-cn/syncthing.po: -------------------------------------------------------------------------------- 1 | msgid "Syncthing" 2 | msgstr "储存同步" 3 | 4 | msgid "SyncThing Synchronization Tool" 5 | msgstr "syncthing同步工具" 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /luci-app-syncthing/po/zh_Hans: -------------------------------------------------------------------------------- 1 | zh-cn -------------------------------------------------------------------------------- /luci-app-syncthing/root/etc/config/syncthing: -------------------------------------------------------------------------------- 1 | 2 | config setting 'config' 3 | option enabled '0' 4 | option port '8384' 5 | -------------------------------------------------------------------------------- /luci-app-syncthing/root/etc/init.d/syncthing: -------------------------------------------------------------------------------- 1 | #!/bin/sh /etc/rc.common 2 | START=50 3 | 4 | run_syncthing() 5 | { 6 | local enabled 7 | config_get_bool enabled $1 enabled 8 | if [ $enabled = 1 ]; then 9 | local port 10 | config_get port $1 port 11 | state=`pgrep syncthing | wc -l` 12 | if [ $state = 0 ] ; then 13 | export HOME="/root" 14 | syncthing -gui-address="0.0.0.0:$port" -logfile="/var/log/syncthing.log" -no-browser >/dev/null & 15 | echo "启动中..." 16 | start=`pgrep syncthing | wc -l` 17 | if [ $start = 0 ] ; then 18 | echo "启动失败" 19 | else 20 | echo "启动成功" 21 | fi 22 | else 23 | echo "已在运行" 24 | fi 25 | fi 26 | } 27 | 28 | start() 29 | { 30 | config_load syncthing 31 | config_foreach run_syncthing setting 32 | } 33 | 34 | stop() 35 | { 36 | kill -9 `pgrep syncthing` 37 | stop=`pgrep syncthing | wc -l` 38 | if [ $stop = 0 ] ; then 39 | echo "已停止运行" 40 | else 41 | echo "未停止运行" 42 | fi 43 | } 44 | -------------------------------------------------------------------------------- /luci-app-syncthing/root/etc/uci-defaults/luci-syncthing: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | touch /etc/config/syncthing 3 | 4 | uci -q batch <<-EOF >/dev/null 5 | delete ucitrack.@syncthing[-1] 6 | add ucitrack syncthing 7 | set ucitrack.@syncthing[-1].exec='/etc/init.d/syncthing restart' 8 | commit ucitrack 9 | EOF 10 | # remove LuCI cache 11 | rm -f /tmp/luci* 12 | exit 0 13 | -------------------------------------------------------------------------------- /luci-app-syncthing/root/usr/share/rpcd/acl.d/luci-app-syncthing.json: -------------------------------------------------------------------------------- 1 | { 2 | "luci-app-syncthing": { 3 | "description": "Grant UCI access for luci-app-syncthing", 4 | "read": { 5 | "uci": [ "syncthing" ] 6 | }, 7 | "write": { 8 | "uci": [ "syncthing" ] 9 | } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /luci-app-timecontrol/Makefile: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2020 Lienol 2 | # 3 | # This is free software, licensed under the GNU General Public License v3. 4 | # 5 | 6 | include $(TOPDIR)/rules.mk 7 | 8 | LUCI_TITLE:=LuCI support for Time Control 9 | LUCI_PKGARCH:=all 10 | PKG_VERSION:=1.2 11 | PKG_RELEASE:=1 12 | 13 | include $(TOPDIR)/feeds/luci/luci.mk 14 | 15 | # call BuildPackage - OpenWrt buildroot signature 16 | -------------------------------------------------------------------------------- /luci-app-timecontrol/luasrc/controller/timecontrol.lua: -------------------------------------------------------------------------------- 1 | module("luci.controller.timecontrol", package.seeall) 2 | 3 | function index() 4 | if not nixio.fs.access("/etc/config/timecontrol") then return end 5 | 6 | entry({"admin", "control"}, firstchild(), "Control", 44).dependent = false 7 | entry({"admin", "control", "timecontrol"}, cbi("timecontrol"), _("Internet Time Control"), 10).dependent = 8 | true 9 | entry({"admin", "control", "timecontrol", "status"}, call("status")).leaf = true 10 | end 11 | 12 | function status() 13 | local e = {} 14 | e.status = luci.sys.call("iptables -L FORWARD | grep TIMECONTROL >/dev/null") == 0 15 | luci.http.prepare_content("application/json") 16 | luci.http.write_json(e) 17 | end 18 | -------------------------------------------------------------------------------- /luci-app-timecontrol/luasrc/model/cbi/timecontrol.lua: -------------------------------------------------------------------------------- 1 | local o = require "luci.sys" 2 | local a, t, e 3 | a = Map("timecontrol", translate("Internet Time Control")) 4 | a.template = "timecontrol/index" 5 | 6 | t = a:section(TypedSection, "basic") 7 | t.anonymous = true 8 | 9 | e = t:option(DummyValue, "timecontrol_status", translate("Status")) 10 | e.template = "timecontrol/timecontrol" 11 | e.value = translate("Collecting data...") 12 | 13 | e = t:option(Flag, "enable", translate("Enabled")) 14 | e.rmempty = false 15 | 16 | t = a:section(TypedSection, "macbind", translate("Client Settings")) 17 | t.template = "cbi/tblsection" 18 | t.anonymous = true 19 | t.addremove = true 20 | 21 | e = t:option(Flag, "enable", translate("Enabled")) 22 | e.rmempty = false 23 | 24 | e = t:option(Value, "macaddr", "MAC") 25 | e.rmempty = true 26 | o.net.mac_hints(function(t, a) e:value(t, "%s (%s)" % {t, a}) end) 27 | 28 | e = t:option(Value, "timeon", translate("No Internet start time")) 29 | e.default = "00:00" 30 | e.optional = false 31 | 32 | e = t:option(Value, "timeoff", translate("No Internet end time")) 33 | e.default = "23:59" 34 | e.optional = false 35 | 36 | e = t:option(Flag, "z1", translate("Monday")) 37 | e.rmempty = true 38 | 39 | e = t:option(Flag, "z2", translate("Tuesday")) 40 | e.rmempty = true 41 | 42 | e = t:option(Flag, "z3", translate("Wednesday")) 43 | e.rmempty = true 44 | 45 | e = t:option(Flag, "z4", translate("Thursday")) 46 | e.rmempty = true 47 | 48 | e = t:option(Flag, "z5", translate("Friday")) 49 | e.rmempty = true 50 | 51 | e = t:option(Flag, "z6", translate("Saturday")) 52 | e.rmempty = true 53 | 54 | e = t:option(Flag, "z7", translate("Sunday")) 55 | e.rmempty = true 56 | 57 | return a 58 | -------------------------------------------------------------------------------- /luci-app-timecontrol/luasrc/view/timecontrol/index.htm: -------------------------------------------------------------------------------- 1 | <% include("cbi/map") %> 2 | -------------------------------------------------------------------------------- /luci-app-timecontrol/luasrc/view/timecontrol/timecontrol.htm: -------------------------------------------------------------------------------- 1 | <%+cbi/valueheader%> 2 | <%=pcdata(self:cfgvalue(section) or self.default or "")%> 3 | <%+cbi/valuefooter%> -------------------------------------------------------------------------------- /luci-app-timecontrol/po/zh-cn/timecontrol.po: -------------------------------------------------------------------------------- 1 | msgid "Control" 2 | msgstr "管控" 3 | 4 | msgid "Internet Time Control" 5 | msgstr "上网时间控制" 6 | 7 | msgid "Status" 8 | msgstr "状态" 9 | 10 | msgid "Enabled" 11 | msgstr "启用" 12 | 13 | msgid "Client Settings" 14 | msgstr "客户端设置" 15 | 16 | msgid "No Internet start time" 17 | msgstr "禁止上网开始时间" 18 | 19 | msgid "No Internet end time" 20 | msgstr "取消禁止上网时间" 21 | 22 | msgid "Monday" 23 | msgstr "周一" 24 | 25 | msgid "Tuesday" 26 | msgstr "周二" 27 | 28 | msgid "Wednesday" 29 | msgstr "周三" 30 | 31 | msgid "Thursday" 32 | msgstr "周四" 33 | 34 | msgid "Friday" 35 | msgstr "周五" 36 | 37 | msgid "Saturday" 38 | msgstr "周六" 39 | 40 | msgid "Sunday" 41 | msgstr "周日" 42 | 43 | msgid "NOT RUNNING" 44 | msgstr "未运行" 45 | 46 | msgid "RUNNING" 47 | msgstr "运行中" 48 | -------------------------------------------------------------------------------- /luci-app-timecontrol/po/zh_Hans: -------------------------------------------------------------------------------- 1 | zh-cn -------------------------------------------------------------------------------- /luci-app-timecontrol/root/etc/config/timecontrol: -------------------------------------------------------------------------------- 1 | 2 | config basic 3 | option enable '0' 4 | -------------------------------------------------------------------------------- /luci-app-timecontrol/root/etc/uci-defaults/luci-app-timecontrol: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | uci -q batch <<-EOF >/dev/null 4 | delete firewall.timecontrol 5 | set firewall.timecontrol=include 6 | set firewall.timecontrol.type=script 7 | set firewall.timecontrol.path=/var/etc/timecontrol.include 8 | set firewall.timecontrol.reload=1 9 | EOF 10 | 11 | uci -q batch <<-EOF >/dev/null 12 | delete ucitrack.@timecontrol[-1] 13 | add ucitrack timecontrol 14 | set ucitrack.@timecontrol[-1].init=timecontrol 15 | commit ucitrack 16 | EOF 17 | 18 | rm -rf /tmp/luci-*cache 19 | exit 0 20 | -------------------------------------------------------------------------------- /luci-app-timecontrol/root/usr/share/rpcd/acl.d/luci-app-timecontrol.json: -------------------------------------------------------------------------------- 1 | { 2 | "luci-app-timecontrol": { 3 | "description": "Grant UCI access for luci-app-timecontrol", 4 | "read": { 5 | "uci": [ "timecontrol" ] 6 | }, 7 | "write": { 8 | "uci": [ "timecontrol" ] 9 | } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /luci-app-verysync/Makefile: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2016 Openwrt.org 2 | # 3 | # This is free software, licensed under the Apache License, Version 2.0 . 4 | # 5 | 6 | include $(TOPDIR)/rules.mk 7 | 8 | LUCI_TITLE:=LuCI support for Verysync 9 | LUCI_DEPENDS:=+verysync 10 | LUCI_PKGARCH:=all 11 | PKG_VERSION:=1.0 12 | PKG_RELEASE:=5 13 | 14 | include $(TOPDIR)/feeds/luci/luci.mk 15 | 16 | # call BuildPackage - OpenWrt buildroot signature 17 | -------------------------------------------------------------------------------- /luci-app-verysync/luasrc/controller/verysync.lua: -------------------------------------------------------------------------------- 1 | module("luci.controller.verysync", package.seeall) 2 | 3 | function index() 4 | if not nixio.fs.access("/etc/config/verysync") then 5 | return 6 | end 7 | 8 | entry({"admin", "nas", "verysync"}, cbi("verysync"), _("Verysync"), 10).dependent = true 9 | entry({"admin","nas","verysync","status"},call("act_status")).leaf=true 10 | end 11 | 12 | function act_status() 13 | local e={} 14 | e.running=luci.sys.call("pgrep verysync >/dev/null")==0 15 | luci.http.prepare_content("application/json") 16 | luci.http.write_json(e) 17 | end 18 | -------------------------------------------------------------------------------- /luci-app-verysync/luasrc/model/cbi/verysync.lua: -------------------------------------------------------------------------------- 1 | -- Copyright 2008 Yanira 2 | -- Copyright 2020 KFERMercer 3 | -- Licensed to the public under the Apache License 2.0. 4 | 5 | m = Map("verysync") 6 | m.title = translate("Verysync") 7 | m.description = translate("Simple and easy-to-use multi-platform file synchronization software, astonishing transmission speed is different from the greatest advantage of other products. Micro-force synchronization of intelligent P2P technology to accelerate synchronization, will split the file into several KB-only data synchronization, and the file will be AES encryption processing.") 8 | 9 | m:section(SimpleSection).template = "verysync/verysync_status" 10 | 11 | s = m:section(TypedSection, "verysync") 12 | s.addremove = false 13 | s.anonymous = true 14 | 15 | o = s:option(Flag, "enabled", translate("Enable")) 16 | o.rmempty = false 17 | 18 | o = s:option(Value, "port", translate("Port")) 19 | o.datatype = "port" 20 | o.placeholder = "8886" 21 | o.default = "8886" 22 | o.rmempty = false 23 | 24 | return m 25 | -------------------------------------------------------------------------------- /luci-app-verysync/luasrc/view/verysync/verysync_status.htm: -------------------------------------------------------------------------------- 1 | 23 | 24 |
25 |

26 | <%:Collecting data...%> 27 |

28 |
29 | -------------------------------------------------------------------------------- /luci-app-verysync/po/zh-cn/verysync.po: -------------------------------------------------------------------------------- 1 | msgid "Verysync" 2 | msgstr "微力同步" 3 | 4 | msgid "Simple and easy-to-use multi-platform file synchronization software, astonishing transmission speed is different from the greatest advantage of other products. Micro-force synchronization of intelligent P2P technology to accelerate synchronization, will split the file into several KB-only data synchronization, and the file will be AES encryption processing." 5 | msgstr "简单易用的多平台文件同步软件, 惊人的传输速度是不同于其他产品的最大优势. 微力同步的智能 P2P 加速同步技术会将文件分割成若干份仅 KB 的数据进行传输, 同时会使用 AES 加密处理." 6 | 7 | msgid "Open Verysync page" 8 | msgstr "打开微力同步页面" 9 | -------------------------------------------------------------------------------- /luci-app-verysync/po/zh_Hans: -------------------------------------------------------------------------------- 1 | zh-cn -------------------------------------------------------------------------------- /luci-app-verysync/root/etc/config/verysync: -------------------------------------------------------------------------------- 1 | 2 | config verysync 'config' 3 | -------------------------------------------------------------------------------- /luci-app-verysync/root/etc/init.d/verysync: -------------------------------------------------------------------------------- 1 | #!/bin/sh /etc/rc.common 2 | 3 | START=50 4 | STOP=10 5 | 6 | start() { 7 | local enabled="$(uci get verysync.config.enabled)" 8 | local port="$(uci get verysync.config.port)" 9 | stop 10 | [ "${enabled}" == "1" ] || exit 0 11 | export HOME="/root/" 12 | verysync -gui-address="0.0.0.0:${port}" -logfile="/var/log/verysync.log" -home="/etc/verysync/" -no-browser >/dev/null 2>&1 & 13 | } 14 | 15 | stop() { 16 | kill -9 `pgrep verysync` >/dev/null 2>&1 17 | } 18 | -------------------------------------------------------------------------------- /luci-app-verysync/root/etc/uci-defaults/luci-verysync: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | uci -q batch <<-EOF >/dev/null 4 | delete ucitrack.@verysync[-1] 5 | add ucitrack verysync 6 | set ucitrack.@verysync[-1].init=verysync 7 | commit ucitrack 8 | EOF 9 | 10 | rm -f /tmp/luci-indexcache 11 | exit 0 12 | -------------------------------------------------------------------------------- /luci-app-verysync/root/usr/share/rpcd/acl.d/luci-app-verysync.json: -------------------------------------------------------------------------------- 1 | { 2 | "luci-app-verysync": { 3 | "description": "Grant UCI access for luci-app-verysync", 4 | "read": { 5 | "uci": [ "verysync" ] 6 | }, 7 | "write": { 8 | "uci": [ "verysync" ] 9 | } 10 | } 11 | } 12 | --------------------------------------------------------------------------------