mirror of
https://github.com/kenzok8/small-package
synced 2025-01-05 11:36:47 +08:00
update 2024-11-27 11:29:22
This commit is contained in:
parent
d897e8c076
commit
f69a3f8f13
69
frp/Makefile
Normal file
69
frp/Makefile
Normal file
@ -0,0 +1,69 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=frp
|
||||
PKG_VERSION:=0.51.3
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
||||
PKG_SOURCE_URL:=https://codeload.github.com/fatedier/frp/tar.gz/v${PKG_VERSION}?
|
||||
PKG_HASH:=83032399773901348c660d41c967530e794ab58172ccd070db89d5e50d915fef
|
||||
|
||||
PKG_MAINTAINER:=Richard Yu <yurichard3839@gmail.com>
|
||||
PKG_LICENSE:=Apache-2.0
|
||||
PKG_LICENSE_FILES:=LICENSE
|
||||
|
||||
PKG_BUILD_DEPENDS:=golang/host
|
||||
PKG_BUILD_PARALLEL:=1
|
||||
PKG_USE_MIPS16:=0
|
||||
PKG_BUILD_FLAGS:=no-mips16
|
||||
|
||||
GO_PKG:=github.com/fatedier/frp
|
||||
GO_PKG_BUILD_PKG:=github.com/fatedier/frp/cmd/...
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
include $(TOPDIR)/feeds/packages/lang/golang/golang-package.mk
|
||||
|
||||
define Package/frp/install
|
||||
$(INSTALL_DIR) $(1)/usr/bin/
|
||||
$(INSTALL_BIN) $(GO_PKG_BUILD_BIN_DIR)/$(2) $(1)/usr/bin/
|
||||
$(INSTALL_DIR) $(1)/etc/frp/$(2).d/
|
||||
$(INSTALL_DATA) $(PKG_BUILD_DIR)/conf/$(2)_full.ini $(1)/etc/frp/$(2).d/
|
||||
$(INSTALL_DIR) $(1)/etc/config/
|
||||
$(INSTALL_CONF) ./files/$(2).config $(1)/etc/config/$(2)
|
||||
$(INSTALL_DIR) $(1)/etc/init.d/
|
||||
$(INSTALL_BIN) ./files/$(2).init $(1)/etc/init.d/$(2)
|
||||
|
||||
if [ -r ./files/$(2).uci-defaults ]; then \
|
||||
$(INSTALL_DIR) $(1)/etc/uci-defaults; \
|
||||
$(INSTALL_DATA) ./files/$(2).uci-defaults $(1)/etc/uci-defaults/$(2); \
|
||||
fi
|
||||
endef
|
||||
|
||||
define Package/frp/template
|
||||
define Package/$(1)
|
||||
SECTION:=net
|
||||
CATEGORY:=Network
|
||||
SUBMENU:=Web Servers/Proxies
|
||||
TITLE:=$(1) - fast reverse proxy $(2)
|
||||
URL:=https://github.com/fatedier/frp
|
||||
DEPENDS:=$(GO_ARCH_DEPENDS)
|
||||
endef
|
||||
|
||||
define Package/$(1)/description
|
||||
$(1) is a fast reverse proxy $(2) to help you expose a local server behind
|
||||
a NAT or firewall to the internet.
|
||||
endef
|
||||
|
||||
define Package/$(1)/conffiles
|
||||
/etc/config/$(1)
|
||||
endef
|
||||
|
||||
define Package/$(1)/install
|
||||
$(call Package/frp/install,$$(1),$(1))
|
||||
endef
|
||||
endef
|
||||
|
||||
$(eval $(call Package/frp/template,frpc,client))
|
||||
$(eval $(call Package/frp/template,frps,server))
|
||||
$(eval $(call BuildPackage,frpc))
|
||||
$(eval $(call BuildPackage,frps))
|
23
frp/files/frpc.config
Normal file
23
frp/files/frpc.config
Normal file
@ -0,0 +1,23 @@
|
||||
config init
|
||||
option stdout 1
|
||||
option stderr 1
|
||||
option user frpc
|
||||
option group frpc
|
||||
option respawn 1
|
||||
# OS environments pass to frp for config file template, see
|
||||
# https://github.com/fatedier/frp#configuration-file-template
|
||||
# list env 'ENV_NAME=value'
|
||||
# Config files include in temporary config file.
|
||||
# list conf_inc '/etc/frp/frpc.d/frpc_full.ini'
|
||||
|
||||
config conf 'common'
|
||||
option server_addr 127.0.0.1
|
||||
option server_port 7000
|
||||
# List options with name="_" will be directly appended to config file
|
||||
# list _ '# Key-A=Value-A'
|
||||
|
||||
config conf 'ssh'
|
||||
option type tcp
|
||||
option local_ip 127.0.0.1
|
||||
option local_port 22
|
||||
option remote_port 6000
|
80
frp/files/frpc.init
Normal file
80
frp/files/frpc.init
Normal file
@ -0,0 +1,80 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
|
||||
START=99
|
||||
USE_PROCD=1
|
||||
|
||||
NAME=frpc
|
||||
PROG=/usr/bin/$NAME
|
||||
|
||||
_err() {
|
||||
echo "$*" >&2
|
||||
logger -p daemon.err -t "$NAME" "$*"
|
||||
}
|
||||
|
||||
config_cb() {
|
||||
[ $# -eq 0 ] && return
|
||||
|
||||
local type="$1"
|
||||
local name="$2"
|
||||
if [ "$type" = "conf" ]; then
|
||||
echo "[$name]" >> "$conf_file"
|
||||
option_cb() {
|
||||
local option="$1"
|
||||
local value="$2"
|
||||
[ "$option" = "name" ] && \
|
||||
sed -i "s/$CONFIG_SECTION/$value/g" "$conf_file" || \
|
||||
echo "$option = $value" >> "$conf_file";
|
||||
}
|
||||
list_cb() {
|
||||
local name="$1"
|
||||
local value="$2"
|
||||
[ "$name" = "_" ] && echo "$value" >> "$conf_file"
|
||||
}
|
||||
else
|
||||
[ "$type" = "init" ] && init_cfg="$name"
|
||||
option_cb() { return 0; }
|
||||
list_cb() { return 0; }
|
||||
fi
|
||||
}
|
||||
|
||||
service_triggers()
|
||||
{
|
||||
procd_add_reload_trigger "$NAME"
|
||||
}
|
||||
|
||||
start_service() {
|
||||
local init_cfg=" "
|
||||
local conf_file="/var/etc/$NAME.ini"
|
||||
|
||||
> "$conf_file"
|
||||
config_load "$NAME"
|
||||
|
||||
local stdout stderr user group respawn env conf_inc
|
||||
uci_validate_section "$NAME" init "$init_cfg" \
|
||||
'stdout:bool:1' \
|
||||
'stderr:bool:1' \
|
||||
'user:string' \
|
||||
'group:string' \
|
||||
'respawn:bool:1' \
|
||||
'env:list(string)' \
|
||||
'conf_inc:list(string)'
|
||||
|
||||
local err=$?
|
||||
[ $err -ne 0 ] && {
|
||||
_err "uci_validate_section returned $err"
|
||||
return 1
|
||||
}
|
||||
|
||||
[ -n "$conf_inc" ] && config_list_foreach "$init_cfg" conf_inc cat >> "$conf_file"
|
||||
|
||||
procd_open_instance
|
||||
procd_set_param command "$PROG" -c "$conf_file"
|
||||
procd_set_param file $conf_file
|
||||
procd_set_param stdout $stdout
|
||||
procd_set_param stderr $stderr
|
||||
[ -n "$user" ] && procd_set_param user "$user"
|
||||
[ -n "$group" ] && procd_set_param group "$group"
|
||||
[ $respawn -eq 1 ] && procd_set_param respawn
|
||||
[ -n "$env" ] && config_list_foreach "$init_cfg" env "procd_append_param env"
|
||||
procd_close_instance
|
||||
}
|
19
frp/files/frpc.uci-defaults
Normal file
19
frp/files/frpc.uci-defaults
Normal file
@ -0,0 +1,19 @@
|
||||
#!/bin/sh
|
||||
|
||||
. /lib/functions.sh
|
||||
|
||||
upgrade() {
|
||||
local section=$1
|
||||
local name
|
||||
[ "$section" != "common" ] || return 0
|
||||
config_get name $section name
|
||||
if [ -z "$name" ]; then
|
||||
uci_set frpc "$section" name "$section"
|
||||
uci_commit frpc
|
||||
fi
|
||||
}
|
||||
|
||||
config_load frpc
|
||||
config_foreach upgrade conf
|
||||
|
||||
exit 0
|
16
frp/files/frps.config
Normal file
16
frp/files/frps.config
Normal file
@ -0,0 +1,16 @@
|
||||
config init
|
||||
option stdout 1
|
||||
option stderr 1
|
||||
option user frps
|
||||
option group frps
|
||||
option respawn 1
|
||||
# OS environments pass to frp for config file template, see
|
||||
# https://github.com/fatedier/frp#configuration-file-template
|
||||
# list env 'ENV_NAME=value'
|
||||
# Config files include in temporary config file.
|
||||
# list conf_inc '/etc/frp/frps.d/frps_full.ini'
|
||||
|
||||
config conf 'common'
|
||||
option bind_port 7000
|
||||
# List options with name="_" will be directly appended to config file
|
||||
# list _ '# Key-A=Value-A'
|
78
frp/files/frps.init
Normal file
78
frp/files/frps.init
Normal file
@ -0,0 +1,78 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
|
||||
START=99
|
||||
USE_PROCD=1
|
||||
|
||||
NAME=frps
|
||||
PROG=/usr/bin/$NAME
|
||||
|
||||
_err() {
|
||||
echo "$*" >&2
|
||||
logger -p daemon.err -t "$NAME" "$*"
|
||||
}
|
||||
|
||||
config_cb() {
|
||||
[ $# -eq 0 ] && return
|
||||
|
||||
local type="$1"
|
||||
local name="$2"
|
||||
if [ "$type" = "conf" ]; then
|
||||
echo "[$name]" >> "$conf_file"
|
||||
option_cb() {
|
||||
local option="$1"
|
||||
local value="$2"
|
||||
echo "$option = $value" >> "$conf_file"
|
||||
}
|
||||
list_cb() {
|
||||
local name="$1"
|
||||
local value="$2"
|
||||
[ "$name" = "_" ] && echo "$value" >> "$conf_file"
|
||||
}
|
||||
else
|
||||
[ "$type" = "init" ] && init_cfg="$name"
|
||||
option_cb() { return 0; }
|
||||
list_cb() { return 0; }
|
||||
fi
|
||||
}
|
||||
|
||||
service_triggers()
|
||||
{
|
||||
procd_add_reload_trigger "$NAME"
|
||||
}
|
||||
|
||||
start_service() {
|
||||
local init_cfg=" "
|
||||
local conf_file="/var/etc/$NAME.ini"
|
||||
|
||||
> "$conf_file"
|
||||
config_load "$NAME"
|
||||
|
||||
local stdout stderr user group respawn env conf_inc
|
||||
uci_validate_section "$NAME" init "$init_cfg" \
|
||||
'stdout:bool:1' \
|
||||
'stderr:bool:1' \
|
||||
'user:string' \
|
||||
'group:string' \
|
||||
'respawn:bool:1' \
|
||||
'env:list(string)' \
|
||||
'conf_inc:list(string)'
|
||||
|
||||
local err=$?
|
||||
[ $err -ne 0 ] && {
|
||||
_err "uci_validate_section returned $err"
|
||||
return 1
|
||||
}
|
||||
|
||||
[ -n "$conf_inc" ] && config_list_foreach "$init_cfg" conf_inc cat >> "$conf_file"
|
||||
|
||||
procd_open_instance
|
||||
procd_set_param command "$PROG" -c "$conf_file"
|
||||
procd_set_param file $conf_file
|
||||
procd_set_param stdout $stdout
|
||||
procd_set_param stderr $stderr
|
||||
[ -n "$user" ] && procd_set_param user "$user"
|
||||
[ -n "$group" ] && procd_set_param group "$group"
|
||||
[ $respawn -eq 1 ] && procd_set_param respawn
|
||||
[ -n "$env" ] && config_list_foreach "$init_cfg" env "procd_append_param env"
|
||||
procd_close_instance
|
||||
}
|
3
frp/test.sh
Normal file
3
frp/test.sh
Normal file
@ -0,0 +1,3 @@
|
||||
#!/bin/sh
|
||||
|
||||
$1 -v 2>&1 | grep -F "$PKG_VERSION"
|
63
headscale/Makefile
Normal file
63
headscale/Makefile
Normal file
@ -0,0 +1,63 @@
|
||||
#
|
||||
# This is free software, licensed under the GNU General Public License v2.
|
||||
# See /LICENSE for more information.
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=headscale
|
||||
PKG_VERSION:=0.21.0
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
||||
PKG_SOURCE_URL:=https://codeload.github.com/juanfont/headscale/tar.gz/v$(PKG_VERSION)?
|
||||
PKG_HASH:=2afbdc038508cb694be496db9ba6b63bbc611b7038e8299e60eef0f1b227f12f
|
||||
|
||||
PKG_LICENSE:=BSD-3-clause
|
||||
PKG_LICENSE_FILES:=LICENSE
|
||||
|
||||
PKG_BUILD_DEPENDS:=golang/host
|
||||
PKG_BUILD_PARALLEL:=1
|
||||
PKG_USE_MIPS16:=0
|
||||
|
||||
GO_PKG:=github.com/juanfont/headscale
|
||||
GO_PKG_BUILD_PKG:=$(GO_PKG)/cmd/headscale
|
||||
GO_PKG_LDFLAGS:=-s -w
|
||||
GO_PKG_LDFLAGS+= \
|
||||
-X '$(GO_PKG_BUILD_PKG)/cli.Version=v$(PKG_VERSION)'
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
include $(TOPDIR)/feeds/packages/lang/golang/golang-package.mk
|
||||
|
||||
define Package/headscale
|
||||
SECTION:=net
|
||||
CATEGORY:=Network
|
||||
SUBMENU:=VPN
|
||||
TITLE:=A Tailscale control server
|
||||
URL:=https://github.com/juanfont/headscale
|
||||
DEPENDS:=$(GO_ARCH_DEPENDS)
|
||||
endef
|
||||
|
||||
define Package/headscale/description
|
||||
An open source, self-hosted implementation of the Tailscale control server.
|
||||
endef
|
||||
|
||||
define Package/headscale/conffiles
|
||||
/etc/headscale/config.yaml
|
||||
/etc/headscale/db.sqlite
|
||||
/etc/headscale/derp.yaml
|
||||
/etc/headscale/noise_private.key
|
||||
/etc/headscale/private.key
|
||||
endef
|
||||
|
||||
define Package/headscale/install
|
||||
$(call GoPackage/Package/Install/Bin,$(1))
|
||||
|
||||
$(INSTALL_DIR) $(1)/etc/headscale
|
||||
touch $(1)/etc/headscale/db.sqlite
|
||||
$(INSTALL_CONF) $(PKG_BUILD_DIR)/config-example.yaml $(1)/etc/headscale/config.yaml
|
||||
$(INSTALL_CONF) $(PKG_BUILD_DIR)/derp-example.yaml $(1)/etc/headscale/derp.yaml
|
||||
endef
|
||||
|
||||
$(eval $(call GoBinPackage,headscale))
|
||||
$(eval $(call BuildPackage,headscale))
|
@ -708,13 +708,21 @@ return baseclass.extend({
|
||||
return true;
|
||||
},
|
||||
|
||||
validateBase64Key: function(length, section_id, value) {
|
||||
/* Thanks to luci-proto-wireguard */
|
||||
if (value)
|
||||
if (value.length !== length || !value.match(/^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/) || value[length-1] !== '=')
|
||||
return _('Expecting: %s').format(_('valid base64 key with %d characters').format(length));
|
||||
|
||||
return true;
|
||||
},
|
||||
|
||||
validateShadowsocksPassword: function(self, encmode, section_id, value) {
|
||||
var length = self.shadowsocks_cipher_length[encmode];
|
||||
if (typeof length !== 'undefined') {
|
||||
length = Math.ceil(length/3)*4;
|
||||
if (encmode.match(/^2022-/)) {
|
||||
if (value.length !== length || !value.match(/^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/) || value[length-1] !== '=')
|
||||
return _('Expecting: %s').format(_('valid base64 key with %d characters').format(length));
|
||||
return self.validateBase64Key(length, section_id, value);
|
||||
} else {
|
||||
if (length === 0 && !value)
|
||||
return _('Expecting: %s').format(_('non-empty value'));
|
||||
|
@ -318,6 +318,71 @@ return view.extend({
|
||||
so.depends({type: /^(vmess|vless)$/});
|
||||
so.modalonly = true;
|
||||
|
||||
/* WireGuard fields */
|
||||
so = ss.taboption('field_general', form.Value, 'wireguard_ip', _('Local address'),
|
||||
_('The %s address used by local machine in the Wireguard network.').format('IPv4'));
|
||||
so.datatype = 'ip4addr(1)';
|
||||
so.rmempty = false;
|
||||
so.depends('type', 'wireguard');
|
||||
so.modalonly = true;
|
||||
|
||||
so = ss.taboption('field_general', form.Value, 'wireguard_ipv6', _('Local IPv6 address'),
|
||||
_('The %s address used by local machine in the Wireguard network.').format('IPv6'));
|
||||
so.datatype = 'ip6addr(1)';
|
||||
so.depends('type', 'wireguard');
|
||||
so.modalonly = true;
|
||||
|
||||
so = ss.taboption('field_general', form.Value, 'wireguard_private_key', _('Private key'),
|
||||
_('WireGuard requires base64-encoded private keys.'));
|
||||
so.password = true;
|
||||
so.validate = L.bind(hm.validateBase64Key, so, 44);
|
||||
so.rmempty = false;
|
||||
so.depends('type', 'wireguard');
|
||||
so.modalonly = true;
|
||||
|
||||
so = ss.taboption('field_general', form.Value, 'wireguard_peer_public_key', _('Peer pubkic key'),
|
||||
_('WireGuard peer public key.'));
|
||||
so.validate = L.bind(hm.validateBase64Key, so, 44);
|
||||
so.rmempty = false;
|
||||
so.depends('type', 'wireguard');
|
||||
so.modalonly = true;
|
||||
|
||||
so = ss.taboption('field_general', form.Value, 'wireguard_pre_shared_key', _('Pre-shared key'),
|
||||
_('WireGuard pre-shared key.'));
|
||||
so.password = true;
|
||||
so.validate = L.bind(hm.validateBase64Key, so, 44);
|
||||
so.depends('type', 'wireguard');
|
||||
so.modalonly = true;
|
||||
|
||||
so = ss.taboption('field_general', form.DynamicList, 'wireguard_allowed_ips', _('Allowed IPs'),
|
||||
_('Destination addresses allowed to be forwarded via Wireguard.'));
|
||||
so.datatype = 'cidr';
|
||||
so.placeholder = '0.0.0.0/0';
|
||||
so.depends('type', 'wireguard');
|
||||
so.modalonly = true;
|
||||
|
||||
so = ss.taboption('field_general', form.DynamicList, 'wireguard_reserved', _('Reserved field bytes'));
|
||||
so.datatype = 'integer';
|
||||
so.depends('type', 'wireguard');
|
||||
so.modalonly = true;
|
||||
|
||||
so = ss.taboption('field_general', form.Value, 'wireguard_mtu', _('MTU'));
|
||||
so.datatype = 'range(0,9000)';
|
||||
so.placeholder = '1408';
|
||||
so.depends('type', 'wireguard');
|
||||
so.modalonly = true;
|
||||
|
||||
so = ss.taboption('field_general', form.Flag, 'wireguard_remote_dns_resolve', _('Remote DNS resolve'),
|
||||
_('Force DNS remote resolution.'));
|
||||
so.default = so.disabled;
|
||||
so.depends('type', 'wireguard');
|
||||
so.modalonly = true;
|
||||
|
||||
so = ss.taboption('field_general', form.DynamicList, 'wireguard_dns', _('DNS server'));
|
||||
so.datatype = 'or(host, hostport)';
|
||||
so.depends('wireguard_remote_dns_resolve', '1');
|
||||
so.modalonly = true;
|
||||
|
||||
/* Plugin fields */
|
||||
so = ss.taboption('field_general', form.ListValue, 'plugin', _('Plugin'));
|
||||
so.value('', _('none'));
|
||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -440,12 +440,13 @@ uci.foreach(uciconf, ucinode, (cfg) => {
|
||||
["routing-mark"]: strToInt(cfg.routing_mark),
|
||||
["ip-version"]: cfg.ip_version,
|
||||
|
||||
/* HTTP / SOCKS / Shadowsocks / VMess / VLESS / Trojan / hysteria2 / TUIC / SSH */
|
||||
/* HTTP / SOCKS / Shadowsocks / VMess / VLESS / Trojan / hysteria2 / TUIC / SSH / WireGuard */
|
||||
username: cfg.username,
|
||||
uuid: cfg.vmess_uuid || cfg.uuid,
|
||||
cipher: cfg.vmess_chipher || cfg.shadowsocks_chipher,
|
||||
password: cfg.shadowsocks_password || cfg.password,
|
||||
headers: cfg.headers ? json(cfg.headers) : null,
|
||||
["private-key"]: cfg.wireguard_private_key || cfg.ssh_priv_key,
|
||||
|
||||
/* Hysteria / Hysteria2 */
|
||||
ports: isEmpty(cfg.hysteria_ports) ? null : join(',', cfg.hysteria_ports),
|
||||
@ -455,7 +456,6 @@ uci.foreach(uciconf, ucinode, (cfg) => {
|
||||
["obfs-password"]: cfg.hysteria_obfs_password,
|
||||
|
||||
/* SSH */
|
||||
["private-key"]: cfg.ssh_priv_key,
|
||||
["private-key-passphrase"]: cfg.ssh_priv_key_passphrase,
|
||||
["host-key-algorithms"]: cfg.ssh_host_key_algorithms,
|
||||
["host-key"]: cfg.ssh_host_key,
|
||||
@ -497,6 +497,17 @@ uci.foreach(uciconf, ucinode, (cfg) => {
|
||||
["authenticated-length"]: strToBool(cfg.vmess_authenticated_length),
|
||||
["packet-encoding"]: cfg.vmess_packet_encoding,
|
||||
|
||||
/* WireGuard */
|
||||
ip: cfg.wireguard_ip,
|
||||
ipv6: cfg.wireguard_ipv6,
|
||||
["public-key"]: cfg.wireguard_peer_public_key,
|
||||
["pre-shared-key"]: cfg.wireguard_pre_shared_key,
|
||||
["allowed-ips"]: cfg.wireguard_allowed_ips,
|
||||
reserved: cfg.wireguard_reserved,
|
||||
mtu: strToInt(cfg.wireguard_mtu),
|
||||
["remote-dns-resolve"]: strToBool(cfg.wireguard_remote_dns_resolve),
|
||||
dns: cfg.wireguard_dns,
|
||||
|
||||
/* Plugin fields */
|
||||
plugin: cfg.plugin,
|
||||
["plugin-opts"]: cfg.plugin ? {
|
||||
|
98
netatalk/Makefile
Normal file
98
netatalk/Makefile
Normal file
@ -0,0 +1,98 @@
|
||||
#
|
||||
# Copyright (C) 2009-2013 OpenWrt.org
|
||||
#
|
||||
# This is free software, licensed under the GNU General Public License v2.
|
||||
# See /LICENSE for more information.
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=netatalk
|
||||
PKG_VERSION:=3.1.12
|
||||
PKG_RELEASE:=3
|
||||
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
|
||||
PKG_SOURCE_URL:=@SF/netatalk
|
||||
PKG_HASH:=1560f83a3da41be97e0b70a96e2402159b8ddc631d38538360b14784beada5d1
|
||||
|
||||
PKG_BUILD_PARALLEL:=1
|
||||
PKG_INSTALL:=1
|
||||
PKG_FIXUP:=autoreconf
|
||||
|
||||
PKG_CPE_ID:=cpe:/a:netatalk:netatalk
|
||||
|
||||
PKG_BUILD_DEPENDS:=libevent2
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/netatalk
|
||||
SECTION:=net
|
||||
CATEGORY:=Network
|
||||
SUBMENU:=Filesystem
|
||||
DEPENDS:=+libattr +libdb47 +libgcrypt +libopenssl
|
||||
TITLE:=netatalk
|
||||
URL:=http://netatalk.sourceforge.net
|
||||
MAINTAINER:=Alexandru Ardelean <ardeleanalex@gmail.com>
|
||||
endef
|
||||
|
||||
define Package/netatalk/decription
|
||||
Netatalk is a freely-available Open Source AFP fileserver.
|
||||
It also provides a kernel level implementation of the AppleTalk
|
||||
Protocol Suite.
|
||||
endef
|
||||
|
||||
TARGET_CFLAGS += -std=gnu99
|
||||
|
||||
CONFIGURE_ARGS += \
|
||||
--disable-afs \
|
||||
--enable-hfs \
|
||||
--disable-debugging \
|
||||
--disable-shell-check \
|
||||
--disable-timelord \
|
||||
--disable-a2boot \
|
||||
--disable-cups \
|
||||
--disable-tcp-wrappers \
|
||||
--with-cnid-default-backend=dbd \
|
||||
--with-bdb="$(STAGING_DIR)/usr/" \
|
||||
--with-libevent=no \
|
||||
--with-libgcrypt-dir="$(STAGING_DIR)/usr" \
|
||||
--with-ssl-dir="$(STAGING_DIR)/usr" \
|
||||
--with-uams-path="/usr/lib/uams" \
|
||||
--without-acls \
|
||||
--without-kerberos \
|
||||
--without-mysql \
|
||||
--with-mysql-config=false \
|
||||
--without-pam \
|
||||
--disable-admin-group \
|
||||
--disable-srvloc \
|
||||
--disable-zeroconf \
|
||||
$(if $(CONFIG_SHADOW_PASSWORDS),--with-shadow,--without-shadow) \
|
||||
--without-dtrace \
|
||||
--without-ldap
|
||||
|
||||
define Package/netatalk/conffiles
|
||||
/etc/afp.conf
|
||||
/etc/extmap.conf
|
||||
/etc/netatalk/
|
||||
endef
|
||||
|
||||
define Package/netatalk/install
|
||||
$(INSTALL_DIR) $(1)/usr/bin
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(INSTALL_DIR) $(1)/usr/sbin
|
||||
$(INSTALL_DIR) $(1)/usr/lib/uams
|
||||
$(INSTALL_DIR) $(1)/etc/init.d
|
||||
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libatalk.so* $(1)/usr/lib
|
||||
$(CP) $(PKG_INSTALL_DIR)/usr/bin/dbd $(1)/usr/bin/
|
||||
$(CP) $(PKG_INSTALL_DIR)/usr/bin/ad $(1)/usr/bin/
|
||||
$(CP) $(PKG_INSTALL_DIR)/usr/bin/afppasswd $(1)/usr/bin/
|
||||
$(CP) $(PKG_INSTALL_DIR)/usr/sbin/afpd $(1)/usr/sbin/
|
||||
$(CP) $(PKG_INSTALL_DIR)/usr/sbin/cnid_dbd $(1)/usr/sbin/
|
||||
$(CP) $(PKG_INSTALL_DIR)/usr/sbin/cnid_metad $(1)/usr/sbin/
|
||||
$(CP) $(PKG_INSTALL_DIR)/usr/lib/uams/*.so $(1)/usr/lib/uams/
|
||||
$(INSTALL_DATA) $(PKG_INSTALL_DIR)/etc/afp.conf $(1)/etc/
|
||||
$(INSTALL_DATA) $(PKG_INSTALL_DIR)/etc/extmap.conf $(1)/etc/
|
||||
$(INSTALL_BIN) ./files/afpd.init $(1)/etc/init.d/afpd
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,netatalk))
|
23
netatalk/files/afpd.init
Normal file
23
netatalk/files/afpd.init
Normal file
@ -0,0 +1,23 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
# Copyright (C) 2010-2012 OpenWrt.org
|
||||
|
||||
START=80
|
||||
STOP=10
|
||||
|
||||
USE_PROCD=1
|
||||
|
||||
start_service() {
|
||||
mkdir -p /var/netatalk/CNID/
|
||||
|
||||
procd_open_instance
|
||||
procd_set_param command /usr/sbin/afpd -d -F /etc/afp.conf
|
||||
procd_set_param file /etc/afp.conf
|
||||
procd_set_param respawn
|
||||
procd_close_instance
|
||||
|
||||
procd_open_instance
|
||||
procd_set_param command /usr/sbin/cnid_metad -d
|
||||
procd_set_param respawn
|
||||
procd_close_instance
|
||||
}
|
||||
|
9
netatalk/patches/001-automake-compat.patch
Normal file
9
netatalk/patches/001-automake-compat.patch
Normal file
@ -0,0 +1,9 @@
|
||||
--- a/macros/iconv.m4
|
||||
+++ b/macros/iconv.m4
|
||||
@@ -115,6 +115,5 @@ int main() {
|
||||
|
||||
CFLAGS="$savedcflags"
|
||||
LDFLAGS="$savedldflags"
|
||||
- CPPFLAGS="$saved_CPPFLAGS"
|
||||
|
||||
])
|
26
netatalk/patches/002-ld_library_path.patch
Normal file
26
netatalk/patches/002-ld_library_path.patch
Normal file
@ -0,0 +1,26 @@
|
||||
--- a/macros/db3-check.m4
|
||||
+++ b/macros/db3-check.m4
|
||||
@@ -148,9 +148,9 @@ if test "x$bdb_required" = "xyes"; then
|
||||
dnl -- LD_LIBRARY_PATH on many platforms. This will be fairly
|
||||
dnl -- portable hopefully. Reference:
|
||||
dnl -- http://lists.gnu.org/archive/html/autoconf/2009-03/msg00040.html
|
||||
- eval export $shlibpath_var=$bdblibdir
|
||||
+# eval export $shlibpath_var=$bdblibdir
|
||||
NETATALK_BDB_TRY_LINK
|
||||
- eval export $shlibpath_var=$saved_shlibpath_var
|
||||
+# eval export $shlibpath_var=$saved_shlibpath_var
|
||||
|
||||
if test x"${atalk_cv_bdb_version}" = x"yes"; then
|
||||
BDB_CFLAGS="-I${bdbdir}/include${subdir}"
|
||||
@@ -177,9 +177,9 @@ if test "x$bdb_required" = "xyes"; then
|
||||
CPPFLAGS="-I${bdbdir}/include${subdir} $CPPFLAGS"
|
||||
LDFLAGS="-L$bdblibdir $LDFLAGS"
|
||||
|
||||
- eval export $shlibpath_var=$bdblibdir
|
||||
+# eval export $shlibpath_var=$bdblibdir
|
||||
NETATALK_BDB_TRY_LINK
|
||||
- eval export $shlibpath_var=$saved_shlibpath_var
|
||||
+# eval export $shlibpath_var=$saved_shlibpath_var
|
||||
|
||||
if test x"${atalk_cv_bdb_version}" = x"yes"; then
|
||||
BDB_CFLAGS="-I${bdbdir}/include${subdir}"
|
20
netatalk/patches/010-gcc10.patch
Normal file
20
netatalk/patches/010-gcc10.patch
Normal file
@ -0,0 +1,20 @@
|
||||
From 32df6e155ccfc83216321925273c3e75e631ebe6 Mon Sep 17 00:00:00 2001
|
||||
From: Andrew Bauer <zonexpertconsulting@outlook.com>
|
||||
Date: Wed, 22 Jan 2020 09:59:47 -0600
|
||||
Subject: [PATCH] fix ftbs multiple def of invalid_dircache_entries
|
||||
|
||||
---
|
||||
etc/afpd/directory.h | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
--- a/etc/afpd/directory.h
|
||||
+++ b/etc/afpd/directory.h
|
||||
@@ -91,7 +91,7 @@ struct maccess {
|
||||
#define AR_UWRITE (1<<2)
|
||||
#define AR_UOWN (1<<7)
|
||||
|
||||
-q_t *invalid_dircache_entries;
|
||||
+extern q_t *invalid_dircache_entries;
|
||||
|
||||
typedef int (*dir_loop)(struct dirent *, char *, void *);
|
||||
|
116
pgyvpn/Makefile
Normal file
116
pgyvpn/Makefile
Normal file
@ -0,0 +1,116 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
include $(INCLUDE_DIR)/target.mk
|
||||
|
||||
ifeq ($(ARCH),arm)
|
||||
ifneq ($(findstring $(CPU_SUBTYPE), neon neon-vfpv4 vfpv3),)
|
||||
PKG_ARCH_PGYYPN:=arm_$(CPU_TYPE)_$(CPU_SUBTYPE)-$(LIBC)-unknown
|
||||
else ifneq ($(findstring $(CPU_TYPE), cortex-a9),)
|
||||
PKG_ARCH_PGYYPN:=arm_cortex-a9-$(LIBC)-unknown
|
||||
else
|
||||
PKG_ARCH_PGYYPN:=arm_cortex-a7-$(LIBC)-unknown
|
||||
endif
|
||||
endif
|
||||
ifeq ($(ARCH),aarch64)
|
||||
ifneq ($(findstring $(CPU_TYPE), cortex-a53 cortex-a72),)
|
||||
PKG_ARCH_PGYYPN:=aarch64_$(CPU_TYPE)-$(LIBC)-unknown
|
||||
else
|
||||
PKG_ARCH_PGYYPN:=aarch64_generic-$(LIBC)-unknown
|
||||
endif
|
||||
endif
|
||||
ifeq ($(ARCH),mips)
|
||||
PKG_ARCH_PGYYPN:=mips_24kc-$(LIBC)-unknown
|
||||
endif
|
||||
ifeq ($(ARCH),mipsel)
|
||||
ifneq ($(findstring $(CPU_TYPE), 24kec 74kc 1004kc),)
|
||||
PKG_ARCH_PGYYPN:=$(ARCH)_$(CPU_TYPE)-$(LIBC)-unknown
|
||||
else
|
||||
PKG_ARCH_PGYYPN:=mipsel_24kc-$(LIBC)-unknown
|
||||
endif
|
||||
endif
|
||||
ifeq ($(BOARD),x86)
|
||||
ifeq ($(ARCH),x86_64)
|
||||
PKG_ARCH_PGYYPN:=x86_64-$(LIBC)-unknown
|
||||
else
|
||||
PKG_ARCH_PGYYPN:=i386_pentium-mmx-$(LIBC)-unknown
|
||||
endif
|
||||
endif
|
||||
|
||||
PKG_NAME:=pgyvpn
|
||||
PKG_VERSION:=3.1.0
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE:=pgyvpnsvr
|
||||
PKG_SOURCE_URL:=https://mirrors.oray.com/orayos/packages/$(PKG_NAME)/$(PKG_ARCH_PGYYPN)/$(PKG_VERSION)/bin
|
||||
PKG_HASH:=skip
|
||||
|
||||
PKG_FLAGS:=nonshared
|
||||
PKG_MAINTAINER:=Oray <developer@oray.com>
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/pgyvpn
|
||||
SECTION:=net
|
||||
CATEGORY:=Network
|
||||
SUBMENU:=VPN
|
||||
DEPENDS:=@(arm||aarch64||mips||mipsel||i386||x86_64) \
|
||||
+iptables +libc +libopenssl +librt \
|
||||
+libpthread +libstdcpp +kmod-tun
|
||||
TITLE:=PuGongYing VPN, Fast networking
|
||||
URL:=https://pgy.oray.com/
|
||||
endef
|
||||
|
||||
define Package/pgyvpn/description
|
||||
PuGongYing VPN is a product of Oray Company, support custom network, account security
|
||||
system, traffic monitoring, cloud application access, virtual serial port, etc.
|
||||
endef
|
||||
|
||||
define Download/extra
|
||||
FILE:=pgyvpn_oraysl
|
||||
URL:=$(PKG_SOURCE_URL)
|
||||
HASH:=skip
|
||||
endef
|
||||
$(eval $(call Download,extra))
|
||||
|
||||
define Build/Prepare
|
||||
mkdir -p $(PKG_BUILD_DIR)
|
||||
mv $(DL_DIR)/{pgyvpn_oraysl,pgyvpnsvr} $(PKG_BUILD_DIR)
|
||||
chmod +x $(PKG_BUILD_DIR)/{pgyvpn_oraysl,pgyvpnsvr}
|
||||
endef
|
||||
|
||||
define Build/Compile
|
||||
true
|
||||
endef
|
||||
|
||||
define Package/pgyvpn/install
|
||||
$(INSTALL_DIR) $(1)/etc/init.d
|
||||
$(INSTALL_DIR) $(1)/etc/config
|
||||
$(INSTALL_DIR) $(1)/etc/hotplug.d/iface
|
||||
$(INSTALL_DIR) $(1)/usr/sbin
|
||||
$(INSTALL_DIR) $(1)/usr/share/pgyvpn
|
||||
|
||||
$(CP) $(PKG_BUILD_DIR)/{pgyvpn_oraysl,pgyvpnsvr} $(1)/usr/sbin
|
||||
$(INSTALL_BIN) ./files/etc/init.d/* $(1)/etc/init.d
|
||||
$(INSTALL_CONF) ./files/etc/config/* $(1)/etc/config
|
||||
$(INSTALL_BIN) ./files/etc/hotplug.d/iface/* $(1)/etc/hotplug.d/iface
|
||||
$(INSTALL_BIN) ./files/usr/share/pgyvpn/* $(1)/usr/share/pgyvpn
|
||||
endef
|
||||
|
||||
define Package/pgyvpn/preinst
|
||||
#!/bin/sh
|
||||
[ -z "$${IPKG_INSTROOT}" ] && {
|
||||
pidof pgyvpnsvr > /dev/null && \
|
||||
test -f $${PKG_ROOT}etc/init.d/pgyvpn && \
|
||||
/etc/init.d/pgyvpn stop; true
|
||||
}
|
||||
exit 0
|
||||
endef
|
||||
|
||||
define Package/pgyvpn/postinst
|
||||
#!/bin/sh
|
||||
[ -z "$${IPKG_INSTROOT}" ] && {
|
||||
/etc/init.d/pgyvpn restart; true
|
||||
}
|
||||
exit 0
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,pgyvpn))
|
20
pgyvpn/files/etc/config/pgyvpn
Normal file
20
pgyvpn/files/etc/config/pgyvpn
Normal file
@ -0,0 +1,20 @@
|
||||
config base 'base'
|
||||
option filename '/usr/sbin/pgyvpnsvr'
|
||||
option check_route_conflict '1'
|
||||
option script_p2pinit '/usr/share/pgyvpn/p2pinit.sh'
|
||||
option script_vncinit '/usr/share/pgyvpn/vncinit.sh'
|
||||
option script_progress '/usr/share/pgyvpn/vpnprogress.sh'
|
||||
|
||||
config secure 'secure'
|
||||
option encrypt '0'
|
||||
|
||||
config log 'log'
|
||||
option path '/tmp/oray/pgyvpnsvr/log'
|
||||
option mask '7'
|
||||
|
||||
config oraysl 'oraysl'
|
||||
option filename '/usr/sbin/pgyvpn_oraysl'
|
||||
option logpath '/tmp/oray/pgyvpn_oraysl/log'
|
||||
option statusfilename '/tmp/oray/pgyvpn_oraysl/status'
|
||||
option pidfilename '/tmp/oray/pgyvpn_oraysl/pid'
|
||||
|
5
pgyvpn/files/etc/hotplug.d/iface/pgyvpn
Executable file
5
pgyvpn/files/etc/hotplug.d/iface/pgyvpn
Executable file
@ -0,0 +1,5 @@
|
||||
#!/bin/sh
|
||||
|
||||
[ "$INTERFACE" == "wan" -a "$ACTION" == "ifup" ] && {
|
||||
/etc/init.d/pgyvpn restart
|
||||
}
|
150
pgyvpn/files/etc/init.d/pgyvpn
Executable file
150
pgyvpn/files/etc/init.d/pgyvpn
Executable file
@ -0,0 +1,150 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
|
||||
. /lib/functions.sh
|
||||
|
||||
START=62
|
||||
STOP=62
|
||||
USE_PROCD=1
|
||||
|
||||
write_log()
|
||||
{
|
||||
echo $*
|
||||
logger -t pgyvpn "$*"
|
||||
}
|
||||
|
||||
start_service()
|
||||
{
|
||||
local res_def_path='/usr/share/pgyvpn'
|
||||
local pgyvpn_filename
|
||||
local username
|
||||
local password
|
||||
local check_route_conflict
|
||||
local log_path
|
||||
local log_mask
|
||||
local local_ip
|
||||
local local_mask
|
||||
local use_encrypt
|
||||
local script_p2pinit
|
||||
local script_vncinit
|
||||
local script_progress
|
||||
local oraysl_filename
|
||||
local oraysl_logpath
|
||||
local oraysl_statusfilename
|
||||
local oraysl_pidfilename
|
||||
local login_status
|
||||
local enable_status
|
||||
|
||||
#read uci config
|
||||
config_load pgyvpn
|
||||
config_get login_status base login_status
|
||||
config_get enable_status base enable_status
|
||||
|
||||
if [ -z $enable_status ] || [ "$enable_status" == "0" ]; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
config_get pgyvpn_filename base filename '/usr/sbin/pgyvpnsvr'
|
||||
config_get username base user ''
|
||||
config_get password base pwd ''
|
||||
config_get_bool check_route_conflict base check_route_conflict 0
|
||||
config_get log_path log path '/tmp/oray/pgyvpnsvr/log'
|
||||
config_get log_mask log mask '0x77'
|
||||
config_get_bool use_encrypt secure encrypt 0
|
||||
config_get script_p2pinit base script_p2pinit "$res_def_path/p2pinit.sh"
|
||||
config_get script_vncinit base script_vncinit "$res_def_path/vncinit.sh"
|
||||
config_get script_progress base script_progress "$res_def_path/vpnprogress.sh"
|
||||
config_get oraysl_filename oraysl filename '/usr/sbin/pgyvpn_oraysl'
|
||||
config_get oraysl_logpath oraysl logpath '/tmp/oray/pgyvpn_oraysl/log'
|
||||
config_get oraysl_statusfilename oraysl statusfilename '/tmp/oray/pgyvpn_oraysl/status'
|
||||
config_get oraysl_pidfilename oraysl pidfilename '/tmp/oray/pgyvpn_oraysl/pid'
|
||||
local_ip=$(uci get network.lan.ipaddr 2> /dev/null)
|
||||
local_mask=$(uci get network.lan.netmask 2> /dev/null)
|
||||
|
||||
local host_name=$(uci get system.@system[0].hostname 2> /dev/null)
|
||||
|
||||
#print config
|
||||
write_log "pgyvpn app filename is $pgyvpn_filename"
|
||||
write_log "username is $username"
|
||||
write_log "log path is $log_path"
|
||||
write_log "log mask is $log_mask"
|
||||
write_log "local ip is $local_ip"
|
||||
write_log "local mask is $local_mask"
|
||||
write_log "script for p2p init is $script_p2pinit"
|
||||
write_log "script for vnc init is $script_vncinit"
|
||||
write_log "script for progress is $script_progress"
|
||||
write_log "oraysl filename is $oraysl_filename"
|
||||
write_log "oraysl log path is $oraysl_logpath"
|
||||
write_log "oraysl status filename is $oraysl_statusfilename"
|
||||
write_log "oraysl pid filename is $oraysl_pidfilename"
|
||||
[ $use_encrypt -eq 1 ] && write_log 'use encrypt' || write_log 'no use encrypt'
|
||||
|
||||
#make app command args
|
||||
local cmd_arg=''
|
||||
local api_address="pgyapi.oray.net"
|
||||
cmd_arg="$cmd_arg --apiaddress $api_address --usehttps --rpc --autologinAsRpc"
|
||||
#cmd_arg="$cmd_arg --apiaddress $api_address --usehttps --autologinAsRpc"
|
||||
cmd_arg="$cmd_arg --logsize 4194304 --logpath $log_path --logmask $log_mask"
|
||||
cmd_arg="$cmd_arg --orayslpath $oraysl_filename --oraysllogpath $oraysl_logpath --orayslstatusfilename $oraysl_statusfilename --orayslpidfilename $oraysl_pidfilename"
|
||||
[ -n "$script_p2pinit" ] && cmd_arg="$cmd_arg -n $script_p2pinit"
|
||||
[ -n "$script_vncinit" ] && cmd_arg="$cmd_arg -C $script_vncinit"
|
||||
# [ -n "$script_progress" ] && cmd_arg="$cmd_arg -n $script_progress"
|
||||
[ -n "$script_progress" ] && cmd_arg="$cmd_arg -N $script_progress"
|
||||
[ -n "$local_ip" ] && cmd_arg="$cmd_arg --localip $local_ip"
|
||||
[ -n "$local_mask" ] && cmd_arg="$cmd_arg --localmask $local_mask"
|
||||
[ $use_encrypt -eq 1 ] && cmd_arg="$cmd_arg -r"
|
||||
[ $check_route_conflict -ne 0 ] && cmd_arg="$cmd_arg --vipmask 255.255.255.255"
|
||||
[ -n "$host_name" ] && cmd_arg="$cmd_arg --hostname $host_name"
|
||||
|
||||
#start app
|
||||
procd_open_instance
|
||||
procd_set_param command $pgyvpn_filename $cmd_arg
|
||||
[ -n "$username" ] && procd_append_param command --sn "$username"
|
||||
[ -n "$password" ] && procd_append_param command --pwd "$password"
|
||||
procd_set_param respawn
|
||||
procd_close_instance
|
||||
|
||||
}
|
||||
|
||||
stop_service()
|
||||
{
|
||||
#remove p2p firewall
|
||||
iptables -w -t filter -F oray_vpn_p2p 2> /dev/null
|
||||
while true;
|
||||
do
|
||||
iptables -w -t filter -D INPUT -j oray_vpn_p2p 2>/dev/null
|
||||
[ $? -ne 0 ] && break
|
||||
done
|
||||
iptables -w -t filter -X oray_vpn_p2p 2> /dev/null
|
||||
|
||||
#remove forward firewall
|
||||
iptables -w -t filter -F oray_vpn_vnc 2> /dev/null
|
||||
while true;
|
||||
do
|
||||
iptables -w -t filter -D INPUT -j oray_vpn_vnc 2>/dev/null
|
||||
[ $? -ne 0 ] && break
|
||||
done
|
||||
|
||||
while true;
|
||||
do
|
||||
iptables -w -t filter -D FORWARD -j oray_vpn_vnc 2>/dev/null
|
||||
[ $? -ne 0 ] && break
|
||||
done
|
||||
|
||||
while true;
|
||||
do
|
||||
iptables -w -t filter -D OUTPUT -j oray_vpn_vnc 2>/dev/null
|
||||
[ $? -ne 0 ] && break
|
||||
done
|
||||
iptables -w -t filter -X oray_vpn_vnc 2> /dev/null
|
||||
|
||||
#stop oraysl
|
||||
killall pgyvpn_oraysl 2> /dev/null
|
||||
|
||||
rm /tmp/pgyvpnsvr_mutex 2> /dev/null #delete mutex file
|
||||
rm /tmp/pgyvpnsvr_rpc_mutex 2> /dev/null #delete rpc mutex file
|
||||
|
||||
local oraysl_statusfilename
|
||||
config_load pgyvpn
|
||||
config_get oraysl_statusfilename oraysl statusfilename '/tmp/oray/pgyvpn_oraysl/status'
|
||||
rm oraysl_statusfilename 2> /dev/null #delete oraysl status file
|
||||
}
|
16
pgyvpn/files/usr/share/pgyvpn/p2pinit.sh
Executable file
16
pgyvpn/files/usr/share/pgyvpn/p2pinit.sh
Executable file
@ -0,0 +1,16 @@
|
||||
#!/bin/sh
|
||||
|
||||
#删除oray_vpn_p2p表
|
||||
iptables -w -t filter -F oray_vpn_p2p
|
||||
while true;
|
||||
do
|
||||
iptables -w -t filter -D INPUT -j oray_vpn_p2p 2>/dev/null
|
||||
[ $? -ne 0 ] && break
|
||||
done
|
||||
iptables -w -t filter -X oray_vpn_p2p
|
||||
|
||||
#建立oray_vpn_p2p表
|
||||
iptables -w -t filter -N oray_vpn_p2p
|
||||
iptables -w -t filter -I oray_vpn_p2p -p udp --dport $2 -j ACCEPT
|
||||
iptables -w -t filter -I oray_vpn_p2p -p udp --dport 1900 -j ACCEPT
|
||||
iptables -w -t filter -I INPUT 1 -j oray_vpn_p2p
|
31
pgyvpn/files/usr/share/pgyvpn/vncinit.sh
Executable file
31
pgyvpn/files/usr/share/pgyvpn/vncinit.sh
Executable file
@ -0,0 +1,31 @@
|
||||
#!/bin/sh
|
||||
|
||||
#删除oray_vpn_vnc表
|
||||
iptables -w -t filter -F oray_vpn_vnc
|
||||
while true;
|
||||
do
|
||||
iptables -w -t filter -D INPUT -j oray_vpn_vnc 2>/dev/null
|
||||
[ $? -ne 0 ] && break
|
||||
done
|
||||
|
||||
while true;
|
||||
do
|
||||
iptables -w -t filter -D FORWARD -j oray_vpn_vnc 2>/dev/null
|
||||
[ $? -ne 0 ] && break
|
||||
done
|
||||
|
||||
while true;
|
||||
do
|
||||
iptables -w -t filter -D OUTPUT -j oray_vpn_vnc 2>/dev/null
|
||||
[ $? -ne 0 ] && break
|
||||
done
|
||||
iptables -w -t filter -X oray_vpn_vnc
|
||||
|
||||
#建立oray_vpn_vnc表
|
||||
iptables -w -t filter -N oray_vpn_vnc
|
||||
iptables -w -t filter -I oray_vpn_vnc -i oray_vnc -o br-lan -j ACCEPT
|
||||
iptables -w -t filter -I oray_vpn_vnc -o oray_vnc -i br-lan -j ACCEPT
|
||||
iptables -w -t filter -I INPUT 1 -j oray_vpn_vnc
|
||||
iptables -w -t filter -I OUTPUT 1 -j oray_vpn_vnc
|
||||
iptables -w -t filter -I FORWARD 1 -j oray_vpn_vnc
|
||||
iptables -w -t filter -I oray_vpn_vnc -i oray_vnc -j ACCEPT
|
116
pgyvpn/files/usr/share/pgyvpn/vpnprogress.sh
Executable file
116
pgyvpn/files/usr/share/pgyvpn/vpnprogress.sh
Executable file
@ -0,0 +1,116 @@
|
||||
#!/bin/sh
|
||||
|
||||
progress="$1"
|
||||
|
||||
#connect status
|
||||
echo $progress >/tmp/orayboxvpn_connect_status
|
||||
|
||||
logger -t vpnprogress $progress
|
||||
|
||||
#99: 表示 链接中
|
||||
# 1: 表示 已组网
|
||||
# 0: 表示 未组网
|
||||
|
||||
# 显示登录页面
|
||||
#4 -1: 表示 账号错误
|
||||
#-2: 表示 帐号密码为空
|
||||
#6 -3: 表示 成员数不足
|
||||
#5 -4: 表示 登录失败
|
||||
#2 -5: 表示 服务过期
|
||||
#1026 -8: 表示 修改密码
|
||||
#7 -9: 表示 服务被禁
|
||||
#401 -10: 表示 授权被禁
|
||||
#-1 -11: 表示 登录故障 这个要区别一下登录失败(登录成功后断开)
|
||||
|
||||
|
||||
# 显示登录成功 未组网页面
|
||||
#-1 -6: 表示 移除网络
|
||||
#6 -7: 表示 状态关闭
|
||||
|
||||
# err_code=
|
||||
# vpn_status=
|
||||
# login_status=
|
||||
|
||||
if [ "$progress" == "connected" ] ;then ### 已组网
|
||||
vpn_status=1
|
||||
elif [ "$progress" == "tryconnect" ] ;then
|
||||
logger -t vpnprogress $progress
|
||||
elif [ "$progress" == "sn" ] ;then
|
||||
vpn_status=99
|
||||
uci set pgyvpn.base.login_status=1
|
||||
uci set pgyvpn.base.vpnid=$2
|
||||
uci set pgyvpn.base.vpnpwd=$3
|
||||
elif [ "$progress" == "login_err" ] ;then
|
||||
vpn_status=0
|
||||
err_code=$2
|
||||
if [ "$err_code" == "4" ] ;then
|
||||
err_code=-1
|
||||
elif [ "$err_code" == "6" ] ;then
|
||||
err_code=-3
|
||||
elif [ "$err_code" == "5" ] ;then
|
||||
err_code=-4
|
||||
elif [ "$err_code" == "2" ] ;then
|
||||
err_code=-5
|
||||
elif [ "$err_code" == "7" ] ;then
|
||||
err_code=-9
|
||||
elif [ "$err_code" == "401" ] ;then
|
||||
err_code=-10
|
||||
elif [ "$err_code" == "403" ] ;then
|
||||
err_code=-10
|
||||
elif [ "$err_code" == "-1" ] ;then
|
||||
err_code=-11
|
||||
fi
|
||||
### login failed can't disabled vpn service
|
||||
|
||||
if [ "$err_code" == "-11" ] ;then
|
||||
status=`uci get pgyvpn.base.login_status`
|
||||
logger -t errcode $status
|
||||
if [ "$status" != "1" ] ;then
|
||||
uci set pgyvpn.base.enable_status=0 ### 下回不启用
|
||||
/etc/init.d/pgyvpn stop > /dev/null
|
||||
fi
|
||||
elif [ "$err_code" != "-4" ] ;then
|
||||
uci set pgyvpn.base.enable_status=0 ### 下回不启用
|
||||
/etc/init.d/pgyvpn stop > /dev/null
|
||||
fi
|
||||
|
||||
|
||||
uci set pgyvpn.base.err_code=$err_code
|
||||
|
||||
elif [ "$progress" == "not_in_group" ] ;then ### 未组网
|
||||
## not_in_group is not a err
|
||||
vpn_status=0
|
||||
err_code=0
|
||||
uci set pgyvpn.base.login_status=1
|
||||
|
||||
elif [ "$progress" == "disconnected" ] ;then
|
||||
err_code=$2
|
||||
vpn_status=0
|
||||
if [ -n "$err_code" ] ;then
|
||||
vpn_status=0
|
||||
if [ "$err_code" == "-1" ] ;then
|
||||
err_code=-6
|
||||
elif [ "$err_code" == "6" ] ;then
|
||||
err_code=-7
|
||||
elif [ "$err_code" == "1026" ] ;then
|
||||
err_code=-8
|
||||
fi
|
||||
uci set pgyvpn.base.err_code=$err_code
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ -n "$vpn_status" ] ;then
|
||||
uci set pgyvpn.base.vpn_status=$vpn_status
|
||||
fi
|
||||
|
||||
if [ "$err_code" == "-5" ] || [ "$err_code" == "-9" ] || [ "$err_code" == "-8" ] ;then
|
||||
uci set pgyvpn.base.login_status=0
|
||||
uci set pgyvpn.base.enable_status=0
|
||||
fi
|
||||
|
||||
if [ "$vpn_status" == "1" ] || [ "$vpn_status" == "0" -a "$err_code" == "0" ] ;then
|
||||
uci set pgyvpn.base.login_status=1
|
||||
uci set pgyvpn.base.enable_status=1
|
||||
fi
|
||||
|
||||
uci commit
|
106
phtunnel/Makefile
Normal file
106
phtunnel/Makefile
Normal file
@ -0,0 +1,106 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
include $(INCLUDE_DIR)/target.mk
|
||||
|
||||
ifeq ($(ARCH),arm)
|
||||
ifneq ($(findstring $(CPU_SUBTYPE), neon neon-vfpv4 vfpv3),)
|
||||
PKG_ARCH_PHT:=arm_$(CPU_TYPE)_$(CPU_SUBTYPE)-$(LIBC)-unknown
|
||||
else ifneq ($(findstring $(CPU_TYPE), cortex-a9),)
|
||||
PKG_ARCH_PHT:=arm_cortex-a9-$(LIBC)-unknown
|
||||
else
|
||||
PKG_ARCH_PHT:=arm_cortex-a7-$(LIBC)-unknown
|
||||
endif
|
||||
endif
|
||||
ifeq ($(ARCH),aarch64)
|
||||
ifneq ($(findstring $(CPU_TYPE), cortex-a53 cortex-a72),)
|
||||
PKG_ARCH_PHT:=aarch64_$(CPU_TYPE)-$(LIBC)-unknown
|
||||
else
|
||||
PKG_ARCH_PHT:=aarch64_generic-$(LIBC)-unknown
|
||||
endif
|
||||
endif
|
||||
ifeq ($(ARCH),mips)
|
||||
PKG_ARCH_PHT:=mips_24kc-$(LIBC)-unknown
|
||||
endif
|
||||
ifeq ($(ARCH),mipsel)
|
||||
ifneq ($(findstring $(CPU_TYPE), 24kec 74kc 1004kc),)
|
||||
PKG_ARCH_PHT:=$(ARCH)_$(CPU_TYPE)-$(LIBC)-unknown
|
||||
else
|
||||
PKG_ARCH_PHT:=mipsel_24kc-$(LIBC)-unknown
|
||||
endif
|
||||
endif
|
||||
ifeq ($(BOARD),x86)
|
||||
ifeq ($(ARCH),x86_64)
|
||||
PKG_ARCH_PHT:=x86_64-$(LIBC)-unknown
|
||||
else ifeq ($(CPU_TYPE),pentium4)
|
||||
PKG_ARCH_PHT:=i386_pentium4-$(LIBC)-unknown
|
||||
else
|
||||
PKG_ARCH_PHT:=i386_pentium-mmx-$(LIBC)-unknown
|
||||
endif
|
||||
endif
|
||||
|
||||
PKG_NAME:=phtunnel
|
||||
PKG_VERSION:=1.0.0
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE:=phtunnel
|
||||
PKG_SOURCE_URL:=https://mirrors.oray.com/orayos/packages/$(PKG_NAME)/$(PKG_ARCH_PHT)/$(PKG_VERSION)/bin
|
||||
PKG_HASH:=skip
|
||||
|
||||
PKG_FLAGS:=nonshared
|
||||
PKG_MAINTAINER:=Oray <developer@oray.com>
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/phtunnel
|
||||
SECTION:=net
|
||||
CATEGORY:=Network
|
||||
SUBMENU:=Web Servers/Proxies
|
||||
DEPENDS:=@(arm||aarch64||mips||mipsel||i386||x86_64) \
|
||||
+libc +libpthread +librt
|
||||
TITLE:=HSK Intranet penetration
|
||||
URL:=https://hsk.oray.com/
|
||||
endef
|
||||
|
||||
define Package/phtunnel/description
|
||||
PHTunnel is the core component of HSK intranet penetration, which can easily implement high-performance
|
||||
reverse proxy applications, supports TCP, HTTP, HTTPS protocols, end-to-end TLS encrypted communication,
|
||||
black and white list anti-black verification, etc. Through PHTunnel, external network devices can easily
|
||||
penetrate various complex routes and firewalls to access devices on the internal network.
|
||||
endef
|
||||
|
||||
define Build/Prepare
|
||||
mkdir -p $(PKG_BUILD_DIR)
|
||||
mv $(DL_DIR)/$(PKG_SOURCE) $(PKG_BUILD_DIR)
|
||||
chmod +x $(PKG_BUILD_DIR)/$(PKG_SOURCE)
|
||||
endef
|
||||
|
||||
define Build/Compile
|
||||
true
|
||||
endef
|
||||
|
||||
define Package/phtunnel/conffiles
|
||||
/etc/phtunnel.json
|
||||
endef
|
||||
|
||||
define Package/phtunnel/install
|
||||
$(INSTALL_DIR) $(1)/etc/init.d
|
||||
$(INSTALL_DIR) $(1)/etc/config
|
||||
$(INSTALL_DIR) $(1)/etc/hotplug.d/iface
|
||||
$(INSTALL_DIR) $(1)/usr/sbin
|
||||
|
||||
$(CP) $(PKG_BUILD_DIR)/phtunnel $(1)/usr/sbin
|
||||
$(INSTALL_BIN) ./files/etc/init.d/* $(1)/etc/init.d
|
||||
$(INSTALL_CONF) ./files/etc/config/* $(1)/etc/config
|
||||
$(INSTALL_BIN) ./files/etc/hotplug.d/iface/* $(1)/etc/hotplug.d/iface
|
||||
endef
|
||||
|
||||
define Package/phtunnel/preinst
|
||||
#!/bin/sh
|
||||
[ -z "$${IPKG_INSTROOT}" ] && {
|
||||
pidof phtunnel > /dev/null && \
|
||||
test -f $${PKG_ROOT}etc/init.d/phtunnel && \
|
||||
/etc/init.d/phtunnel stop; true
|
||||
}
|
||||
exit 0
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,phtunnel))
|
6
phtunnel/files/etc/config/phtunnel
Normal file
6
phtunnel/files/etc/config/phtunnel
Normal file
@ -0,0 +1,6 @@
|
||||
config base 'base'
|
||||
option enabled '0'
|
||||
|
||||
config log 'log'
|
||||
option path '/var/log/phtunnel.log'
|
||||
|
6
phtunnel/files/etc/hotplug.d/iface/30-oray-phtunnel
Executable file
6
phtunnel/files/etc/hotplug.d/iface/30-oray-phtunnel
Executable file
@ -0,0 +1,6 @@
|
||||
#!/bin/sh
|
||||
|
||||
[ "$INTERFACE" == "wan" -a "$ACTION" == "ifup" ] && {
|
||||
logger -t oray 'wan interface up and phtunnel restart'
|
||||
/etc/init.d/phtunnel restart
|
||||
}
|
103
phtunnel/files/etc/init.d/phtunnel
Executable file
103
phtunnel/files/etc/init.d/phtunnel
Executable file
@ -0,0 +1,103 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
|
||||
. /lib/functions.sh
|
||||
|
||||
START=65
|
||||
STOP=65
|
||||
|
||||
USE_PROCD=1
|
||||
|
||||
#退出后清理
|
||||
exit_clean()
|
||||
{
|
||||
[ -f "$1" ] && rm $1
|
||||
[ -f "$2" ] && rm $2
|
||||
[ -f "$3" ] && rm $3
|
||||
}
|
||||
|
||||
start_service()
|
||||
{
|
||||
local enabled
|
||||
local config_file
|
||||
local log_path
|
||||
local app_id
|
||||
local app_key
|
||||
local server_addr
|
||||
local pid_file
|
||||
local device_info
|
||||
local cmd
|
||||
local log_dir_path
|
||||
|
||||
config_load phtunnel
|
||||
config_get enabled base enabled '0'
|
||||
[ "$enabled" == "0" ] && {
|
||||
echo 'phtunnel is not enabled'
|
||||
exit 1
|
||||
}
|
||||
|
||||
config_get config_file base config_file '/etc/phtunnel.json' #配置文件路径
|
||||
config_get app_id base app_id '' #appid
|
||||
config_get app_key base app_key '' #appkey
|
||||
config_get server_addr base server 'https://hsk-embed.oray.com' #服务器地址
|
||||
config_get pid_file base pid_file '/tmp/phtunnel.pid' #pid文件位置
|
||||
config_get log_path log path '/var/log/oraybox/phtunnel.log' #日志位置
|
||||
|
||||
echo 'now start phtunnel'
|
||||
|
||||
log_dir_path="${log_path%/*}"
|
||||
[ ! -d "$log_dir_path" ] && mkdir -p $log_dir_path
|
||||
|
||||
cmd="phtunnel -R 100 -c $config_file -l $log_path --rpc -p $pid_file"
|
||||
[ -n "$app_id" -a -n "$app_key" ] && cmd="$cmd --appid "$app_id" --appkey $app_key"
|
||||
[ -n "$server_addr" ] && cmd="$cmd -s $server_addr"
|
||||
[ -n "$dev_info" ] && cmd="$cmd --deviceinfo 'mem:32; usb:on; cpu:mipsel'"
|
||||
#echo $cmd
|
||||
|
||||
procd_open_instance
|
||||
procd_set_param command $cmd
|
||||
procd_set_param respawn
|
||||
procd_close_instance
|
||||
}
|
||||
|
||||
stop_service()
|
||||
{
|
||||
echo 'now stop phtunnel'
|
||||
|
||||
local enabled
|
||||
local config_file
|
||||
local pid_file
|
||||
local log_path
|
||||
config_load phtunnel
|
||||
config_get enabled base enabled '0'
|
||||
config_get config_file base config_file '/etc/phtunnel.json' #配置文件路径
|
||||
config_get pid_file base pid_file '/tmp/phtunnel.pid'
|
||||
config_get log_path log path '/var/log/oraybox/phtunnel.log'
|
||||
|
||||
#获取程序的pid
|
||||
local pid=$(cat "$pid_file" 2> /dev/null | grep 'pid=' | cut -d'=' -f2 2> /dev/null)
|
||||
[ -z "$pid" ] && {
|
||||
echo 'phtunnel pid is not found'
|
||||
exit_clean $pid_file $log_path
|
||||
return 0
|
||||
}
|
||||
|
||||
#如果enabled为0(禁用),则删除配置文件
|
||||
[ "$enabled" = "0" -a -f "$config_file" ] && rm $config_file
|
||||
|
||||
#kill程序
|
||||
kill "$pid" 2> /dev/null
|
||||
for i in $(seq 1 4)
|
||||
do
|
||||
[ -d "/proc/$pid" ] || {
|
||||
echo 'phtunnel processor is stopped'
|
||||
exit_clean $pid_file $log_path
|
||||
return 0
|
||||
}
|
||||
echo "phtunnel processor is still alive(pid is $pid), wait 1 second"
|
||||
sleep 1
|
||||
done
|
||||
|
||||
echo "phtunnel processor is still alive(pid is $pid), kill it"
|
||||
kill -9 $pid 2> /dev/null
|
||||
exit_clean $pid_file $log_path
|
||||
}
|
41
vlmcsd/Makefile
Normal file
41
vlmcsd/Makefile
Normal file
@ -0,0 +1,41 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=vlmcsd
|
||||
PKG_VERSION:=svn1113
|
||||
PKG_RELEASE:=3
|
||||
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
||||
PKG_SOURCE_URL:=https://codeload.github.com/Wind4/vlmcsd/tar.gz/$(PKG_VERSION)?
|
||||
PKG_HASH:=62f55c48f5de1249c2348ab6b96dabbe7e38899230954b0c8774efb01d9c42cc
|
||||
|
||||
PKG_LICENSE:=MIT
|
||||
PKG_LICENSE_FILES:=LICENSE
|
||||
PKG_MAINTAINER:=fuyumi <280604399@qq.com>
|
||||
|
||||
PKG_BUILD_PARALLEL:=1
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/vlmcsd
|
||||
SECTION:=net
|
||||
CATEGORY:=Network
|
||||
TITLE:=vlmcsd for OpenWRT
|
||||
URL:=http://forums.mydigitallife.info/threads/50234
|
||||
DEPENDS:=+libpthread
|
||||
endef
|
||||
|
||||
define Package/vlmcsd/description
|
||||
vlmcsd is a KMS Emulator in C.
|
||||
endef
|
||||
|
||||
MAKE_FLAGS += \
|
||||
-C $(PKG_BUILD_DIR)
|
||||
|
||||
define Package/vlmcsd/install
|
||||
$(INSTALL_DIR) $(1)/usr/bin
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/bin/vlmcsd $(1)/usr/bin/vlmcsd
|
||||
$(INSTALL_DIR) $(1)/etc/vlmcsd
|
||||
$(INSTALL_BIN) ./files/vlmcsd.ini $(1)/etc/vlmcsd/vlmcsd.ini
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,vlmcsd))
|
74
vlmcsd/files/vlmcsd.ini
Normal file
74
vlmcsd/files/vlmcsd.ini
Normal file
@ -0,0 +1,74 @@
|
||||
#ePID/HwId设置为Windows显式
|
||||
;Windows = 06401-00206-471-111111-03-1033-17763.0000-2822018 / 01 02 03 04 05 06 07 08
|
||||
|
||||
#ePID设置为Office2010(包含Visio和Project)显式
|
||||
;Office2010 = 06401-00096-199-222222-03-1033-17763.0000-2822018
|
||||
|
||||
#ePID/HwId设置为Office2013(包含Visio和Project)显式
|
||||
;Office2013 = 06401-00206-234-333333-03-1033-17763.0000-2822018 / 01 02 03 04 05 06 07 08
|
||||
|
||||
#ePID/HwId设置为Office2016(包含Visio和Project)显式
|
||||
;Office2016 = 06401-00206-437-444444-03-1033-17763.0000-2822018 / 01 02 03 04 05 06 07 08
|
||||
|
||||
#ePID/HwId设置为Office2019(包含Visio和Project)显式
|
||||
;Office2019 = 06401-00206-666-666666-03-1033-17763.0000-2822018 / 01 02 03 04 05 06 07 08
|
||||
|
||||
#ePID/HwId设置为Windows中国政府版 (Enterprise G/GN) 显式
|
||||
;WinChinaGov = 06401-03858-000-555555-03-1033-17763.0000-2822018 / 01 02 03 04 05 06 07 08
|
||||
|
||||
#使用自定义TCP端口
|
||||
;Port = 1688
|
||||
|
||||
#监听所有IPv4地址(默认端口1688)
|
||||
;Listen = 0.0.0.0:1688
|
||||
|
||||
#监听所有IPv6地址(默认端口1688)
|
||||
;Listen = [::]:1688
|
||||
|
||||
#程序启动时随机ePIDs(只有那些未显式指定的)
|
||||
;RandomizationLevel = 1
|
||||
|
||||
#在ePIDs中使用特定区域 (1033 = 美国英语),即使ePID是随机的
|
||||
;LCID = 1033
|
||||
|
||||
#设置最多4个同时工作(分叉进程或线程)
|
||||
;MaxWorkers = 4
|
||||
|
||||
#闲置30秒后断开用户
|
||||
;ConnectionTimeout = 30
|
||||
|
||||
#每次请求后立即断开客户端
|
||||
;DisconnectClientsImmediately = yes
|
||||
|
||||
#写一个pid文件(包含vlmcsd的进程ID的文件)
|
||||
;PidFile = /var/run/vlmcsd.pid
|
||||
|
||||
#写日志到/var/log/vlmcsd.log
|
||||
;LogFile = /var/log/vlmcsd.log
|
||||
|
||||
#创建详细日志
|
||||
;LogVerbose = true
|
||||
|
||||
#设置激活间隔2小时
|
||||
;ActivationInterval = 2h
|
||||
|
||||
#设置更新间隔7天
|
||||
;RenewalInterval = 7d
|
||||
|
||||
#运行程序的用户为vlmcsduser
|
||||
;user = vlmcsduser
|
||||
|
||||
#运行程序的组为vlmcsdgroup
|
||||
;group = vlmcsdgroup
|
||||
|
||||
#禁用或启用RPC的NDR64传输语法(默认启用)
|
||||
;UseNDR64 = true
|
||||
|
||||
#禁用或启用RPC的绑定时间特性协商(默认启用)
|
||||
;UseBTFN = true
|
||||
|
||||
#Windows 10/ Windows 11 KMS 安装激活密钥
|
||||
#Windows 10/11 Pro:W269N-WFGWX-YVC9B-4J6C9-T83GX
|
||||
#Windows 10/11 Enterprise:NPPR9-FWDCX-D2C8J-H872K-2YT43
|
||||
#Windows 10/11 Pro for Workstations:NRG8B-VKK3Q-CXVCJ-9G2XF-6Q84J
|
||||
|
37
vlmcsd/files/vlmcsd.init
Executable file
37
vlmcsd/files/vlmcsd.init
Executable file
@ -0,0 +1,37 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
# Copyright (c) 2011-2015 OpenWrt.org
|
||||
|
||||
START=90
|
||||
|
||||
start(){
|
||||
if [ ! -f "/tmp/vlmcsd.pid" ]; then
|
||||
/usr/bin/vlmcsd -i /etc/vlmcsd/vlmcsd.ini -p /tmp/vlmcsd.pid -L 0.0.0.0:1688
|
||||
iptables -D input_rule -p tcp --dport 1688 -j ACCEPT
|
||||
iptables -A input_rule -p tcp --dport 1688 -j ACCEPT
|
||||
sed -i '/## luci-app-vlmcsd/d' /etc/firewall.user
|
||||
echo "iptables -A input_rule -p tcp --dport 1688 -j ACCEPT ## luci-app-vlmcsd" >> /etc/firewall.user
|
||||
echo "KMS Server has started."
|
||||
else
|
||||
echo "KMS Server has already started."
|
||||
fi
|
||||
}
|
||||
|
||||
stop(){
|
||||
if [ ! -f "/tmp/vlmcsd.pid" ]; then
|
||||
echo "KMS Server is not running."
|
||||
else
|
||||
pid=`cat /tmp/vlmcsd.pid`
|
||||
kill $pid
|
||||
rm -f /tmp/vlmcsd.pid
|
||||
iptables -D input_rule -p tcp --dport 1688 -j ACCEPT
|
||||
sed -i '/## luci-app-vlmcsd/d' /etc/firewall.user
|
||||
echo "KMS Server has stopped."
|
||||
fi
|
||||
}
|
||||
|
||||
restart(){
|
||||
stop
|
||||
sleep 2
|
||||
start
|
||||
echo "KMS Server has restarted."
|
||||
}
|
Loading…
Reference in New Issue
Block a user