mirror of
https://github.com/kiddin9/op-packages.git
synced 2026-10-26 23:32:51 +08:00
🐶 Sync 2026-04-24 20:24:11
This commit is contained in:
1 parent
5a7f5b4f3b
commit
b043ff192c
20 files changed
+7141
-3650
No files matched your search
+8
-2
@@ -2,7 +2,7 @@ include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=teleproxy
|
||||
PKG_VERSION:=4.11.0
|
||||
PKG_RELEASE:=1
|
||||
PKG_RELEASE:=2
|
||||
|
||||
PKG_MAINTAINER:=Kosntantine Shevlakov <shevlakov@132lan.ru>
|
||||
PKG_LICENSE:=GPLv2
|
||||
@@ -27,9 +27,15 @@ define Package/$(PKG_NAME)
|
||||
endef
|
||||
|
||||
define Package/$(PKG_NAME)/install
|
||||
$(INSTALL_DIR) $(1)/usr/bin
|
||||
$(INSTALL_DIR) $(1)/usr/bin \
|
||||
$(1)/etc/config \
|
||||
$(1)/etc/init.d \
|
||||
$(1)/etc/uci-defaults
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/objs/bin/* \
|
||||
$(1)/usr/bin/
|
||||
$(INSTALL_BIN) ./files/$(PKG_NAME).init $(1)/etc/init.d/$(PKG_NAME)
|
||||
$(INSTALL_BIN) ./files/$(PKG_NAME).defaults $(1)/etc/uci-defaults/$(PKG_NAME)
|
||||
$(INSTALL_CONF) ./files/$(PKG_NAME).config $(1)/etc/config/$(PKG_NAME)
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,$(PKG_NAME)))
|
||||
@@ -0,0 +1,18 @@
|
||||
|
||||
# MTPROTO proxy server
|
||||
|
||||
teleproxy OpenWrt package
|
||||
|
||||
example config file
|
||||
|
||||
```
|
||||
config teleproxy 'default'
|
||||
option address '0.0.0.0' # listen ipaddr or '::' with ipv6
|
||||
option ipv6 '1' # Use IPv6 proto
|
||||
option port '8443' # proxy port
|
||||
option direct '1' # connect directly to Telegram DCs instead of through ME relays
|
||||
option aes_pwd 'file' # sets custom secret.conf file
|
||||
option socks 'addr:port' # route upstream DC connections through SOCKS5 proxy
|
||||
option socks_auth 'user:pass' # autentification on SOCKS5 upstream proxy
|
||||
option extra '--extra args' # exta args to run teleproxy. See "teleproxy --help".
|
||||
```
|
||||
@@ -0,0 +1,3 @@
|
||||
config teleproxy 'default'
|
||||
option port '4843'
|
||||
option direct '1'
|
||||
@@ -0,0 +1,7 @@
|
||||
#!/bin/sh
|
||||
# generate secret key
|
||||
if uci -q get teleproxy.default.secret >/dev/null || [ -z "$(uci get teleproxy.default.secret)" ]; then
|
||||
SECRET=$(dd if=/dev/urandom bs=16 count=1 2>/dev/null | hexdump -v -e '16/1 "%02x"')
|
||||
uci set teleproxy.default.secret="$SECRET"
|
||||
uci commit teleproxy
|
||||
fi
|
||||
Executable
+42
@@ -0,0 +1,42 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
|
||||
START=95
|
||||
NAME=teleproxy
|
||||
BIN=/usr/bin/${NAME}
|
||||
PID=/var/run/${NAME}.pid
|
||||
|
||||
load_config(){
|
||||
for v in ipv6 address port secret direct aes_pwd auth_socks socks extra; do
|
||||
config_get $v $1 $v
|
||||
done
|
||||
}
|
||||
|
||||
|
||||
start() {
|
||||
config_load teleproxy
|
||||
local ipv6 address port secret direct aes_pwd auth_socks socks extra
|
||||
config_foreach load_config
|
||||
[ $ipv6 ] && args="-6"
|
||||
[ $address ] && args="$args --address $address"
|
||||
[ $port ] && args="$args -H $port"
|
||||
[ $secret ] && args="$args -S $secret"
|
||||
[ $aes_pwd ] && args="$args --aes-pwd $aes-pwd"
|
||||
[ $socks ] && {
|
||||
[ $auth_socks ] && {
|
||||
args="$args --socks socks5://${auth_socks}@${socks}"
|
||||
} || {
|
||||
args="$args --socks socks5://$socks"
|
||||
}
|
||||
}
|
||||
[ "$extra" ] && args="$args $extra"
|
||||
[ "$direct" -ne "1" ] && {
|
||||
[ $relay ] && args="$args $relay"
|
||||
} || {
|
||||
args="$args --direct"
|
||||
}
|
||||
($BIN -u daemon $args) & > /dev/null 2>&1
|
||||
}
|
||||
|
||||
stop() {
|
||||
killall teleproxy
|
||||
}
|
||||
Reference in new issue
Block a user