mirror of
https://github.com/kenzok8/small-package
synced 2025-09-18 18:51:16 +08:00
update 2023-01-25 19:47:58
This commit is contained in:
@ -1,83 +0,0 @@
|
||||
# SPDX-Identifier-License: GPL-3.0-only
|
||||
#
|
||||
# Copyright (C) 2021 ImmortalWrt.org
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=UnblockNeteaseMusic-Go
|
||||
PKG_VERSION:=0.2.13
|
||||
PKG_RELEASE:=$(AUTORELEASE)
|
||||
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
||||
PKG_SOURCE_URL:=https://codeload.github.com/cnsilvan/UnblockNeteaseMusic/tar.gz/$(PKG_VERSION)?
|
||||
PKG_HASH:=92201b7f04ab1015c806c672b98a29b97d0f137d9b60e6d35d279c2064ed86a4
|
||||
|
||||
PKG_LICENSE:=GPL-3.0
|
||||
PKG_LICENSE_FILE:=LICENSE
|
||||
PKG_MAINTAINER:=Tianling Shen <cnsztl@immortalwrt.org>
|
||||
|
||||
PKG_CONFIG_DEPENDS:= \
|
||||
CONFIG_UNBLOCKNETEASEMUSIC_GO_COMPRESS_GOPROXY \
|
||||
CONFIG_UNBLOCKNETEASEMUSIC_GO_COMPRESS_UPX
|
||||
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(firstword $(subst -, ,$(PKG_NAME)))-$(PKG_VERSION)
|
||||
PKG_BUILD_DEPENDS:=golang/host upx/host
|
||||
PKG_BUILD_PARALLEL:=1
|
||||
PKG_USE_MIPS16:=0
|
||||
|
||||
GO_PKG:=github.com/cnsilvan/UnblockNeteaseMusic
|
||||
GO_PKG_BUILD_PKG:=$$(GO_PKG)
|
||||
GO_PKG_LDFLAGS:=-s -w
|
||||
COMPILE_TIME:= $(shell TZ=UTC-8 date '+%Y-%m-%d %H:%M:%S')
|
||||
GO_PKG_LDFLAGS+= \
|
||||
-X '$(GO_PKG)/version.Version=$(PKG_VERSION)' \
|
||||
-X '$(GO_PKG)/version.BuildTime=$(COMPILE_TIME)' \
|
||||
-X '$(GO_PKG)/version.ExGoVersionInfo=$(GO_ARM) $(GO_MIPS)$(GO_MIPS64)'
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
include $(TOPDIR)/feeds/packages/lang/golang/golang-package.mk
|
||||
|
||||
define Package/UnblockNeteaseMusic-Go/config
|
||||
config UNBLOCKNETEASEMUSIC_GO_COMPRESS_GOPROXY
|
||||
bool "Compiling with GOPROXY proxy"
|
||||
default n
|
||||
|
||||
config UNBLOCKNETEASEMUSIC_GO_COMPRESS_UPX
|
||||
bool "Compress executable files with UPX"
|
||||
depends on !mips64
|
||||
default n
|
||||
endef
|
||||
|
||||
ifeq ($(CONFIG_UNBLOCKNETEASEMUSIC_GO_COMPRESS_GOPROXY),y)
|
||||
export GO111MODULE=on
|
||||
export GOPROXY=https://goproxy.io
|
||||
endif
|
||||
|
||||
define Package/UnblockNeteaseMusic-Go
|
||||
SECTION:=multimedia
|
||||
CATEGORY:=Multimedia
|
||||
TITLE:=Revive Netease Cloud Music (Golang)
|
||||
URL:=https://github.com/cnsilvan/UnblockNeteaseMusic
|
||||
DEPENDS:=$(GO_ARCH_DEPENDS)
|
||||
endef
|
||||
|
||||
define Build/Compile
|
||||
$(call GoPackage/Build/Compile)
|
||||
ifeq ($(CONFIG_UNBLOCKNETEASEMUSIC_GO_COMPRESS_UPX),y)
|
||||
$(STAGING_DIR_HOST)/bin/upx --lzma --best $(GO_PKG_BUILD_BIN_DIR)/UnblockNeteaseMusic
|
||||
endif
|
||||
endef
|
||||
|
||||
define Package/UnblockNeteaseMusic-Go/install
|
||||
$(call GoPackage/Package/Install/Bin,$(PKG_INSTALL_DIR))
|
||||
|
||||
$(INSTALL_DIR) $(1)/usr/bin
|
||||
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/UnblockNeteaseMusic $(1)/usr/bin/UnblockNeteaseMusic
|
||||
|
||||
$(INSTALL_DIR) $(1)/usr/share/UnblockNeteaseMusicGo
|
||||
$(CP) ./files/* $(1)/usr/share/UnblockNeteaseMusicGo/
|
||||
|
||||
endef
|
||||
|
||||
$(eval $(call GoBinPackage,UnblockNeteaseMusic-Go))
|
||||
$(eval $(call BuildPackage,UnblockNeteaseMusic-Go))
|
@ -1,14 +0,0 @@
|
||||
-----BEGIN CERTIFICATE-----
|
||||
MIICIjCCAaigAwIBAgIUTc9HQDej5hLCQ74u436a5yE4MDcwCgYIKoZIzj0EAwMw
|
||||
SDELMAkGA1UEBhMCQ04xJDAiBgNVBAMMG1VuYmxvY2tOZXRlYXNlTXVzaWMgUm9v
|
||||
dCBDQTETMBEGA1UECgwKMTcxNTE3MzMyOTAeFw0yMTA0MzAwNzIzMDJaFw0yNjA0
|
||||
MjkwNzIzMDJaMEgxCzAJBgNVBAYTAkNOMSQwIgYDVQQDDBtVbmJsb2NrTmV0ZWFz
|
||||
ZU11c2ljIFJvb3QgQ0ExEzARBgNVBAoMCjE3MTUxNzMzMjkwdjAQBgcqhkjOPQIB
|
||||
BgUrgQQAIgNiAASIyI7lYgGlq49qWtY1O2/XNDeowYf7W/Z+l7C14bphxAJ9jSDo
|
||||
tLwbFPWy5VPENc0rB0/yeHA2z7LU67POL2gGgp+17y7scLkkBk3Q7wRMETrtP44Z
|
||||
ITBstZ0wzVyyQEKjUzBRMB0GA1UdDgQWBBQ2F7+t8cPHJaWuCD8RHTSdLugKYzAf
|
||||
BgNVHSMEGDAWgBQ2F7+t8cPHJaWuCD8RHTSdLugKYzAPBgNVHRMBAf8EBTADAQH/
|
||||
MAoGCCqGSM49BAMDA2gAMGUCMQDqaRX2e01e0U+f0As/KUKDhmG5ElkK5CjYK9jk
|
||||
kXLNGFXJLGta6CDvjtMLBPc20qkCMBvDs+JnJKVBEJNZVsRBBs+v2YxNU/u2aYJa
|
||||
dMwXuFveSDWOS7mBeRztX/geEggiSw==
|
||||
-----END CERTIFICATE-----
|
@ -1,15 +0,0 @@
|
||||
-----BEGIN CERTIFICATE-----
|
||||
MIICRDCCAcqgAwIBAgIUeVqRrT2mHG5Mc8JD+ErphiAmlgkwCgYIKoZIzj0EAwMw
|
||||
SDELMAkGA1UEBhMCQ04xJDAiBgNVBAMMG1VuYmxvY2tOZXRlYXNlTXVzaWMgUm9v
|
||||
dCBDQTETMBEGA1UECgwKMTcxNTE3MzMyOTAeFw0yMTA0MzAwNzIzMDJaFw0yMjA0
|
||||
MzAwNzIzMDJaMHsxCzAJBgNVBAYTAkNOMREwDwYDVQQHDAhIYW5nemhvdTEsMCoG
|
||||
A1UECgwjTmV0RWFzZSAoSGFuZ3pob3UpIE5ldHdvcmsgQ28uLCBMdGQxETAPBgNV
|
||||
BAsMCElUIERlcHQuMRgwFgYDVQQDDA8qLm11c2ljLjE2My5jb20wdjAQBgcqhkjO
|
||||
PQIBBgUrgQQAIgNiAAQTPyU9RQ1pAFMLmozi+c4pEC1rrxAlPGwO9Em+qV+a5qLW
|
||||
gQjjsJeabMqJ/UQ7hDtdKVxWuXiAjMiDcXwL63I71MZKPTAEKXdCmNQwb4kXvRUn
|
||||
oOR4r7BMxEpGlf0CULWjQjBAMBMGA1UdJQQMMAoGCCsGAQUFBwMBMCkGA1UdEQQi
|
||||
MCCCDW11c2ljLjE2My5jb22CDyoubXVzaWMuMTYzLmNvbTAKBggqhkjOPQQDAwNo
|
||||
ADBlAjEAs5bdgnNP/DiK919RiWscC0kyuY0ugG1C8m8F2Yod4MI3oTyrkVcag21o
|
||||
NSzm802uAjBoPuKEbjjFP4ics0BQdICiVd6WCVAsE69FnlmqRteAJqxvdKGpVLi+
|
||||
Qi3arfomrrc=
|
||||
-----END CERTIFICATE-----
|
@ -1,9 +0,0 @@
|
||||
-----BEGIN EC PARAMETERS-----
|
||||
BgUrgQQAIg==
|
||||
-----END EC PARAMETERS-----
|
||||
-----BEGIN EC PRIVATE KEY-----
|
||||
MIGkAgEBBDBfW3twxGaQmMzP9p0/UU5EvHFVCbBw4piVFJ+pm/uFY6CKZkC5LGMa
|
||||
Uc9vn/KiewGgBwYFK4EEACKhZANiAAQTPyU9RQ1pAFMLmozi+c4pEC1rrxAlPGwO
|
||||
9Em+qV+a5qLWgQjjsJeabMqJ/UQ7hDtdKVxWuXiAjMiDcXwL63I71MZKPTAEKXdC
|
||||
mNQwb4kXvRUnoOR4r7BMxEpGlf0CULU=
|
||||
-----END EC PRIVATE KEY-----
|
@ -1,144 +0,0 @@
|
||||
From f4f5d11b578a1ab2c3d089bbe5453052b43892bb Mon Sep 17 00:00:00 2001
|
||||
From: tofuliang <tofuliang@gmail.com>
|
||||
Date: Mon, 24 Jan 2022 18:53:11 +0800
|
||||
Subject: [PATCH] fix block ad,add web traffic logs
|
||||
|
||||
---
|
||||
app.go | 1 +
|
||||
config/config.go | 1 +
|
||||
processor/processor.go | 55 +++++++++++++++++++++++++++++++++---------
|
||||
3 files changed, 45 insertions(+), 12 deletions(-)
|
||||
|
||||
diff --git a/app.go b/app.go
|
||||
index 73a6070..1018d75 100644
|
||||
--- a/app.go
|
||||
+++ b/app.go
|
||||
@@ -45,6 +45,7 @@ func main() {
|
||||
log.Println("EnableLocalVip=", *config.EnableLocalVip)
|
||||
log.Println("UnlockSoundEffects=", *config.UnlockSoundEffects)
|
||||
log.Println("QQCookieFile=", *config.QQCookieFile)
|
||||
+ log.Println("LogWebTraffic=", *config.LogWebTraffic)
|
||||
if host.InitHosts() == nil {
|
||||
//go func() {
|
||||
// // // terminal: $ go tool pprof -http=:8081 http://localhost:6060/debug/pprof/heap
|
||||
diff --git a/config/config.go b/config/config.go
|
||||
index 6c07873..a653cdf 100644
|
||||
--- a/config/config.go
|
||||
+++ b/config/config.go
|
||||
@@ -31,6 +31,7 @@ var (
|
||||
EnableLocalVip = flag.Bool("lv", false, "enable local vip")
|
||||
UnlockSoundEffects = flag.Bool("sef", false, "unlock SoundEffects")
|
||||
QQCookieFile = flag.String("qc", "./qq.cookie", "specify cookies file ,such as : \"qq.cookie\"")
|
||||
+ LogWebTraffic = flag.Bool("wl", false, "log request url and response")
|
||||
)
|
||||
|
||||
func ValidParams() bool {
|
||||
diff --git a/processor/processor.go b/processor/processor.go
|
||||
index 8d09dbf..d07b9d3 100644
|
||||
--- a/processor/processor.go
|
||||
+++ b/processor/processor.go
|
||||
@@ -6,14 +6,6 @@ import (
|
||||
"crypto/md5"
|
||||
"encoding/hex"
|
||||
"encoding/json"
|
||||
- "github.com/cnsilvan/UnblockNeteaseMusic/cache"
|
||||
- "github.com/cnsilvan/UnblockNeteaseMusic/common"
|
||||
- "github.com/cnsilvan/UnblockNeteaseMusic/config"
|
||||
- "github.com/cnsilvan/UnblockNeteaseMusic/network"
|
||||
- "github.com/cnsilvan/UnblockNeteaseMusic/processor/crypto"
|
||||
- "github.com/cnsilvan/UnblockNeteaseMusic/provider"
|
||||
- "github.com/cnsilvan/UnblockNeteaseMusic/utils"
|
||||
- "golang.org/x/text/width"
|
||||
"io"
|
||||
"io/ioutil"
|
||||
"log"
|
||||
@@ -22,6 +14,15 @@ import (
|
||||
"regexp"
|
||||
"strconv"
|
||||
"strings"
|
||||
+
|
||||
+ "github.com/cnsilvan/UnblockNeteaseMusic/cache"
|
||||
+ "github.com/cnsilvan/UnblockNeteaseMusic/common"
|
||||
+ "github.com/cnsilvan/UnblockNeteaseMusic/config"
|
||||
+ "github.com/cnsilvan/UnblockNeteaseMusic/network"
|
||||
+ "github.com/cnsilvan/UnblockNeteaseMusic/processor/crypto"
|
||||
+ "github.com/cnsilvan/UnblockNeteaseMusic/provider"
|
||||
+ "github.com/cnsilvan/UnblockNeteaseMusic/utils"
|
||||
+ "golang.org/x/text/width"
|
||||
)
|
||||
|
||||
var (
|
||||
@@ -188,6 +189,9 @@ func RequestAfter(request *http.Request, response *http.Response, netease *Netea
|
||||
if ok {
|
||||
code = codeN.String()
|
||||
}
|
||||
+
|
||||
+ logResponse(netease)
|
||||
+
|
||||
if strings.EqualFold(netease.Path, "/api/osx/version") {
|
||||
modified = disableUpdate(netease)
|
||||
} else if strings.Contains(netease.Path, "/usertool/sound/") {
|
||||
@@ -197,9 +201,24 @@ func RequestAfter(request *http.Request, response *http.Response, netease *Netea
|
||||
for key, resp := range netease.JsonBody {
|
||||
if strings.Contains(key, "/usertool/sound/") {
|
||||
modified = unblockSoundEffects(resp.(map[string]interface{}))
|
||||
- } else if *config.BlockAds && strings.Contains(netease.Path, "api/ad/") {
|
||||
+ } else if *config.BlockAds && strings.Contains(key, "api/ad/") {
|
||||
+ log.Println("block Ad has been triggered(" + key + ").")
|
||||
resp = &common.MapType{}
|
||||
modified = true
|
||||
+ } else if *config.BlockAds && strings.EqualFold(key, "/api/v2/banner/get") {
|
||||
+ newInfo := make(common.SliceType, 0)
|
||||
+ info := netease.JsonBody[key]
|
||||
+ for _, data := range info.(common.MapType)["banners"].(common.SliceType) {
|
||||
+ if banner, ok := data.(common.MapType); ok {
|
||||
+ if banner["adid"] == nil {
|
||||
+ newInfo = append(newInfo, banner)
|
||||
+ } else {
|
||||
+ log.Println("block banner Ad has been triggered.")
|
||||
+ modified = true
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+ info.(common.MapType)["banners"] = newInfo
|
||||
}
|
||||
}
|
||||
} else if !netease.Web && (code == "401" || code == "512") && strings.Contains(netease.Path, "manipulate") {
|
||||
@@ -220,7 +239,9 @@ func RequestAfter(request *http.Request, response *http.Response, netease *Netea
|
||||
// log.Println("NeedRepackage")
|
||||
modifiedJson, _ := json.Marshal(netease.JsonBody)
|
||||
// log.Println(netease)
|
||||
- // log.Println(string(modifiedJson))
|
||||
+ if *config.LogWebTraffic {
|
||||
+ log.Println("modified =>\n" + string(modifiedJson))
|
||||
+ }
|
||||
if netease.Encrypted {
|
||||
modifiedJson = crypto.AesEncryptECB(modifiedJson, []byte(aeskey))
|
||||
}
|
||||
@@ -258,14 +279,24 @@ func disableUpdate(netease *Netease) bool {
|
||||
if len(value.(common.SliceType)) > 0 {
|
||||
modified = true
|
||||
jsonBody["updateFiles"] = make(common.SliceType, 0)
|
||||
+ log.Println("disable update has been triggered.")
|
||||
}
|
||||
default:
|
||||
}
|
||||
}
|
||||
- // modifiedJson, _ := json.Marshal(jsonBody)
|
||||
- // log.Println(string(modifiedJson))
|
||||
return modified
|
||||
}
|
||||
+
|
||||
+func logResponse(netease *Netease) {
|
||||
+ if *config.LogWebTraffic {
|
||||
+ reqUrl := netease.Path
|
||||
+ jsonBody := netease.JsonBody
|
||||
+ modifiedJson, _ := json.Marshal(jsonBody)
|
||||
+ sep := "===================================\n"
|
||||
+ log.Println(sep + reqUrl + " => \n" + string(modifiedJson) + "\n")
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
func localVIP(netease *Netease) bool {
|
||||
if !*config.EnableLocalVip {
|
||||
return false
|
@ -1,29 +0,0 @@
|
||||
From 6c009953d357d1cc03478cf65fc05701fb1966d6 Mon Sep 17 00:00:00 2001
|
||||
From: ameansone <ameansone@outlook.com>
|
||||
Date: Sun, 5 Dec 2021 19:18:20 +0800
|
||||
Subject: [PATCH] fix(processor): avoid unnecessary decryption
|
||||
|
||||
---
|
||||
processor/processor.go | 8 ++++++--
|
||||
1 file changed, 6 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/processor/processor.go b/processor/processor.go
|
||||
index 8d09dbf..011571b 100644
|
||||
--- a/processor/processor.go
|
||||
+++ b/processor/processor.go
|
||||
@@ -177,9 +177,13 @@ func RequestAfter(request *http.Request, response *http.Response, netease *Netea
|
||||
if netease.Forward {
|
||||
aeskey = linuxApiKey
|
||||
}
|
||||
- decryptECBBytes, encrypted := crypto.AesDecryptECB(decryptECBBytes, []byte(aeskey))
|
||||
- netease.Encrypted = encrypted
|
||||
result := utils.ParseJson(decryptECBBytes)
|
||||
+ netease.Encrypted = false;
|
||||
+ if result == nil {
|
||||
+ decryptECBBytes, encrypted := crypto.AesDecryptECB(decryptECBBytes, []byte(aeskey))
|
||||
+ netease.Encrypted = encrypted
|
||||
+ result = utils.ParseJson(decryptECBBytes)
|
||||
+ }
|
||||
netease.JsonBody = result
|
||||
|
||||
modified := false
|
109
amule/Makefile
109
amule/Makefile
@ -1,109 +0,0 @@
|
||||
#
|
||||
# Copyright (C) 2007-2009 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:=aMule
|
||||
PKG_VERSION:=2.3.3
|
||||
PKG_RELEASE:=3
|
||||
PKG_REV=4b87b20
|
||||
|
||||
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-r$(PKG_REV).tar.bz2
|
||||
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=$(PKG_REV)
|
||||
PKG_SOURCE_URL:=https://github.com/amule-project/amule.git
|
||||
PKG_MIRROR_HASH:=102c4cb3dd2858db06fff19c5e2d0b65c6731b366f45df2adcd40fd0cd0fec47
|
||||
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
|
||||
PKG_BUILD_DEPENDS:=libgd libcryptopp
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
include $(INCLUDE_DIR)/nls.mk
|
||||
|
||||
define Package/amule/config
|
||||
config AMULE_CRYPTOPP_STATIC_LINKING
|
||||
bool "Link libcryptopp statically"
|
||||
default n
|
||||
endef
|
||||
|
||||
define Package/amule
|
||||
SUBMENU:=P2P
|
||||
SECTION:=net
|
||||
CATEGORY:=Network
|
||||
TITLE:=A multi-platform eMule-like ed2k client
|
||||
URL:=http://www.amule.org/
|
||||
DEPENDS:=+libpng +libpthread +libncurses +libreadline +libwxbase +libupnp +libbfd \
|
||||
$(ICONV_DEPENDS) $(INTL_DEPENDS) +!AMULE_CRYPTOPP_STATIC_LINKING:libcryptopp
|
||||
endef
|
||||
|
||||
CONFIGURE_ARGS+= \
|
||||
--disable-static \
|
||||
--disable-rpath \
|
||||
--with-gnu-ld \
|
||||
--disable-ccache \
|
||||
--disable-optimize \
|
||||
--disable-profile \
|
||||
--disable-monolithic \
|
||||
--enable-amule-daemon \
|
||||
--enable-amulecmd \
|
||||
--enable-webserver \
|
||||
--disable-amule-gui \
|
||||
--disable-cas \
|
||||
--disable-wxcas \
|
||||
--disable-ed2k \
|
||||
--disable-alc \
|
||||
--disable-alcc \
|
||||
--disable-fileview \
|
||||
--disable-plasmamule \
|
||||
--without-wxdebug \
|
||||
--enable-dlp \
|
||||
--enable-upnp \
|
||||
--with-zlib="$(STAGING_DIR)/usr" \
|
||||
--with-gdlib-prefix="$(STAGING_DIR)/usr" \
|
||||
--with-libpng-prefix="$(STAGING_DIR)/usr" \
|
||||
--with-wx-prefix="$(STAGING_DIR)/usr" \
|
||||
--with-crypto-prefix="$(STAGING_DIR)/usr" \
|
||||
--with-libiconv-prefix="$(ICONV_PREFIX)" \
|
||||
--with-libintl-prefix="$(INTL_PREFIX)" \
|
||||
--with-libupnp-prefix="$(STAGING_DIR)/usr" \
|
||||
--without-x \
|
||||
--disable-debug
|
||||
|
||||
TARGET_LDFLAGS += $(if $(ICONV_FULL),-liconv)
|
||||
|
||||
define Build/Configure
|
||||
cd $(PKG_BUILD_DIR) && sh ./autogen.sh
|
||||
$(call Build/Configure/Default)
|
||||
endef
|
||||
|
||||
ifeq ($(CONFIG_AMULE_CRYPTOPP_STATIC_LINKING),y)
|
||||
SED_CMD:=sed
|
||||
else
|
||||
SED_CMD:=true
|
||||
endif
|
||||
|
||||
define Build/Compile
|
||||
$(SED_CMD) -i 's;^CRYPTOPP_LIBS.*;CRYPTOPP_LIBS \= "$(STAGING_DIR)/usr/lib/libcryptopp.a";g' \
|
||||
$(PKG_BUILD_DIR)/src/Makefile
|
||||
$(MAKE) -C $(PKG_BUILD_DIR) \
|
||||
HOSTCC="$(HOSTCC)" \
|
||||
DESTDIR="$(PKG_INSTALL_DIR)" \
|
||||
all
|
||||
endef
|
||||
|
||||
define Package/amule/install
|
||||
$(INSTALL_DIR) $(1)/usr/bin
|
||||
$(INSTALL_DIR) $(1)/usr/share/amule/webserver
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/src/amule{cmd,d} $(1)/usr/bin/
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/src/webserver/src/amuleweb $(1)/usr/bin/
|
||||
$(CP) $(PKG_BUILD_DIR)/src/webserver/default $(1)/usr/share/amule/webserver
|
||||
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,amule))
|
@ -1,25 +0,0 @@
|
||||
From 46ecaeadff4c07b8fd98cf41e27605895328ce0a Mon Sep 17 00:00:00 2001
|
||||
From: W_Y_CPP <383152993@qq.com>
|
||||
Date: Thu, 2 Dec 2021 00:46:12 -0800
|
||||
Subject: [PATCH] fix API mismatch with crypto++ 6.0.0
|
||||
|
||||
---
|
||||
src/ClientCreditsList.cpp | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/ClientCreditsList.cpp b/src/ClientCreditsList.cpp
|
||||
index d61e8d4..b02e162 100644
|
||||
--- a/src/ClientCreditsList.cpp
|
||||
+++ b/src/ClientCreditsList.cpp
|
||||
@@ -312,7 +312,7 @@ void CClientCreditsList::InitalizeCrypting()
|
||||
// calculate and store public key
|
||||
CryptoPP::RSASSA_PKCS1v15_SHA_Verifier pubkey(*static_cast<CryptoPP::RSASSA_PKCS1v15_SHA_Signer *>(m_pSignkey));
|
||||
CryptoPP::ArraySink asink(m_abyMyPublicKey, 80);
|
||||
- pubkey.DEREncode(asink);
|
||||
+ pubkey.GetMaterial().Save(asink);
|
||||
m_nMyPublicKeyLen = asink.TotalPutLength();
|
||||
asink.MessageEnd();
|
||||
} catch (const CryptoPP::Exception& e) {
|
||||
--
|
||||
2.17.1
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,25 +0,0 @@
|
||||
From dcc605e06e106b05bc5e756eeeeb17abbc1a6e5c Mon Sep 17 00:00:00 2001
|
||||
From: W_Y_CPP <383152993@qq.com>
|
||||
Date: Wed, 1 Dec 2021 23:13:08 -0800
|
||||
Subject: [PATCH] fix set_terminate
|
||||
|
||||
---
|
||||
src/libs/common/MuleDebug.cpp | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/libs/common/MuleDebug.cpp b/src/libs/common/MuleDebug.cpp
|
||||
index 5d8d758..14206f9 100644
|
||||
--- a/src/libs/common/MuleDebug.cpp
|
||||
+++ b/src/libs/common/MuleDebug.cpp
|
||||
@@ -24,7 +24,7 @@
|
||||
//
|
||||
|
||||
#include <cstdlib> // Needed for std::abort()
|
||||
-
|
||||
+#include <exception>
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include "config.h" // Needed for HAVE_CXXABI and HAVE_EXECINFO
|
||||
#endif
|
||||
--
|
||||
2.17.1
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,23 +0,0 @@
|
||||
diff -Naur a/m4/libupnp.m4 b/m4/libupnp.m4
|
||||
--- a/m4/libupnp.m4 2016-10-06 19:01:54.000000000 +0800
|
||||
+++ b/m4/libupnp.m4 2016-10-11 07:36:39.198318574 +0800
|
||||
@@ -52,7 +52,6 @@
|
||||
[export PKG_CONFIG_PATH=$withval/lib/pkgconfig])
|
||||
|
||||
dnl Check for libupnp >= MIN_LIBUPNP_VERSION
|
||||
- AS_IF([test $cross_compiling = no], [
|
||||
AC_MSG_CHECKING([for libupnp version >= MIN_LIBUPNP_VERSION])
|
||||
AS_IF([test -n "$PKG_CONFIG"], [
|
||||
AS_IF([$PKG_CONFIG libupnp --exists], [
|
||||
@@ -79,11 +78,6 @@
|
||||
])
|
||||
AC_MSG_RESULT([$result$resultstr])
|
||||
libupnp_error="libupnp >= MIN_LIBUPNP_VERSION not found$resultstr"
|
||||
- ], [
|
||||
-dnl Currently cross-compilation with libupnp is not supported.
|
||||
- result=no
|
||||
- libupnp_error="cross compiling"
|
||||
- ])
|
||||
|
||||
dnl Execute the right action.
|
||||
AS_IF([test ${result:-no} = yes], [$2], [$3])
|
@ -1,78 +0,0 @@
|
||||
diff --git a/src/amule.h b/src/amule.h
|
||||
index f25702f..240c02d 100644
|
||||
--- a/src/amule.h
|
||||
+++ b/src/amule.h
|
||||
@@ -553,6 +553,13 @@ class CamuleDaemonApp : public CamuleApp
|
||||
int OnExit();
|
||||
|
||||
virtual int InitGui(bool geometry_enable, wxString &geometry_string);
|
||||
+ // The GTK wxApps sets its file name conversion properly
|
||||
+ // in wxApp::Initialize(), while wxAppConsole::Initialize()
|
||||
+ // does not, leaving wxConvFile being set to wxConvLibc. File
|
||||
+ // name conversion should be set otherwise amuled will abort to
|
||||
+ // handle non-ASCII file names which monolithic amule can handle.
|
||||
+ // This function are overrided to perform this.
|
||||
+ virtual bool Initialize(int& argc_, wxChar **argv_);
|
||||
|
||||
#ifdef AMULED_APPTRAITS
|
||||
struct sigaction m_oldSignalChildAction;
|
||||
diff --git a/src/amuled.cpp b/src/amuled.cpp
|
||||
index 486da59..86e1ff8 100644
|
||||
--- a/src/amuled.cpp
|
||||
+++ b/src/amuled.cpp
|
||||
@@ -704,6 +704,41 @@ int CamuleDaemonApp::InitGui(bool ,wxString &)
|
||||
return 0;
|
||||
}
|
||||
|
||||
+bool CamuleDaemonApp::Initialize(int& argc_, wxChar **argv_)
|
||||
+{
|
||||
+ if ( !wxAppConsole::Initialize(argc_, argv_) ) {
|
||||
+ return false;
|
||||
+ }
|
||||
+
|
||||
+#ifdef __UNIX__
|
||||
+ wxString encName;
|
||||
+#if wxUSE_INTL
|
||||
+ // if a non default locale is set,
|
||||
+ // assume that the user wants his
|
||||
+ // filenames in this locale too
|
||||
+ encName = wxLocale::GetSystemEncodingName().Upper();
|
||||
+
|
||||
+ // But don't consider ASCII in this case.
|
||||
+ if ( !encName.empty() ) {
|
||||
+ if ( encName == wxT("US-ASCII") ) {
|
||||
+ // This means US-ASCII when returned
|
||||
+ // from GetEncodingFromName().
|
||||
+ encName.clear();
|
||||
+ }
|
||||
+ }
|
||||
+#endif // wxUSE_INTL
|
||||
+
|
||||
+ // in this case, UTF-8 is used by default.
|
||||
+ if ( encName.empty() ) {
|
||||
+ encName = wxT("UTF-8");
|
||||
+ }
|
||||
+
|
||||
+ static wxConvBrokenFileNames fileconv(encName);
|
||||
+ wxConvFileName = &fileconv;
|
||||
+#endif // __UNIX__
|
||||
+
|
||||
+ return true;
|
||||
+}
|
||||
|
||||
int CamuleDaemonApp::OnExit()
|
||||
{
|
||||
diff --git a/src/libs/common/Path.cpp b/src/libs/common/Path.cpp
|
||||
index 28152a2..5efefd0 100644
|
||||
--- a/src/libs/common/Path.cpp
|
||||
+++ b/src/libs/common/Path.cpp
|
||||
@@ -229,7 +229,8 @@ CPath::CPath(const wxString& filename)
|
||||
}
|
||||
|
||||
wxCharBuffer fn = filename2char(filename);
|
||||
- if (fn.data()) {
|
||||
+ // add fn.length() for wx 3.x
|
||||
+ if (fn.data()) {
|
||||
// Filename is valid in the current locale. This means that
|
||||
// it either originated from a (wx)system-call, or from a
|
||||
// user with a properly setup system.
|
@ -1,174 +0,0 @@
|
||||
diff --git a/src/SearchList.cpp b/src/SearchList.cpp
|
||||
index 32b28e9..342a18f 100644
|
||||
--- a/src/SearchList.cpp
|
||||
+++ b/src/SearchList.cpp
|
||||
@@ -75,7 +75,7 @@ void ParsedSearchExpression(const CSearchExpr* pexpr)
|
||||
int iOpNot = 0;
|
||||
|
||||
for (unsigned int i = 0; i < pexpr->m_aExpr.GetCount(); i++) {
|
||||
- wxString str(pexpr->m_aExpr[i]);
|
||||
+ const wxString& str = pexpr->m_aExpr[i];
|
||||
if (str == SEARCHOPTOK_AND) {
|
||||
iOpAnd++;
|
||||
} else if (str == SEARCHOPTOK_OR) {
|
||||
@@ -108,6 +108,25 @@ void ParsedSearchExpression(const CSearchExpr* pexpr)
|
||||
|
||||
// optimize search expression, if no OR nor NOT specified
|
||||
if (iOpAnd > 0 && iOpOr == 0 && iOpNot == 0) {
|
||||
+ // figure out if we can use a better keyword than the one the user selected
|
||||
+ // for example most user will search like this "The oxymoronaccelerator 2", which would ask the node which indexes "the"
|
||||
+ // This causes higher traffic for such nodes and makes them a viable target to attackers, while the kad result should be
|
||||
+ // the same or even better if we ask the node which indexes the rare keyword "oxymoronaccelerator", so we try to rearrange
|
||||
+ // keywords and generally assume that the longer keywords are rarer
|
||||
+ if (/*thePrefs::GetRearrangeKadSearchKeywords() &&*/ !s_strCurKadKeyword.IsEmpty()) {
|
||||
+ for (unsigned int i = 0; i < pexpr->m_aExpr.GetCount(); i++) {
|
||||
+ if (pexpr->m_aExpr[i] != SEARCHOPTOK_AND) {
|
||||
+ if (pexpr->m_aExpr[i] != s_strCurKadKeyword
|
||||
+ && pexpr->m_aExpr[i].find_first_of(Kademlia::CSearchManager::GetInvalidKeywordChars()) == wxString::npos
|
||||
+ && pexpr->m_aExpr[i].Find('"') != 0 // no quoted expressions as keyword
|
||||
+ && pexpr->m_aExpr[i].length() >= 3
|
||||
+ && s_strCurKadKeyword.length() < pexpr->m_aExpr[i].length())
|
||||
+ {
|
||||
+ s_strCurKadKeyword = pexpr->m_aExpr[i];
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
wxString strAndTerms;
|
||||
for (unsigned int i = 0; i < pexpr->m_aExpr.GetCount(); i++) {
|
||||
if (pexpr->m_aExpr[i] != SEARCHOPTOK_AND) {
|
||||
@@ -285,7 +304,7 @@ void CSearchList::RemoveResults(long searchID)
|
||||
}
|
||||
|
||||
|
||||
-wxString CSearchList::StartNewSearch(uint32* searchID, SearchType type, const CSearchParams& params)
|
||||
+wxString CSearchList::StartNewSearch(uint32* searchID, SearchType type, CSearchParams& params)
|
||||
{
|
||||
// Check that we can actually perform the specified desired search.
|
||||
if ((type == KadSearch) && !Kademlia::CKademlia::IsRunning()) {
|
||||
@@ -306,6 +325,16 @@ wxString CSearchList::StartNewSearch(uint32* searchID, SearchType type, const CS
|
||||
m_resultType.Clear();
|
||||
}
|
||||
|
||||
+ if (type == KadSearch) {
|
||||
+ Kademlia::WordList words;
|
||||
+ Kademlia::CSearchManager::GetWords(params.searchString, &words);
|
||||
+ if (!words.empty()) {
|
||||
+ params.strKeyword = words.front();
|
||||
+ } else {
|
||||
+ return _("No keyword for Kad search - aborting");
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
bool supports64bit = type == KadSearch ? true : theApp->serverconnect->GetCurrentServer() != NULL && (theApp->serverconnect->GetCurrentServer()->GetTCPFlags() & SRV_TCPFLG_LARGEFILES);
|
||||
bool packetUsing64bit;
|
||||
|
||||
@@ -332,8 +361,7 @@ wxString CSearchList::StartNewSearch(uint32* searchID, SearchType type, const CS
|
||||
|
||||
// searchstring will get tokenized there
|
||||
// The tab must be created with the Kad search ID, so searchID is updated.
|
||||
- Kademlia::CSearch* search = Kademlia::CSearchManager::PrepareFindKeywords(
|
||||
- params.searchString, data->GetLength(), data->GetRawBuffer(), *searchID);
|
||||
+ Kademlia::CSearch* search = Kademlia::CSearchManager::PrepareFindKeywords(params.strKeyword, data->GetLength(), data->GetRawBuffer(), *searchID);
|
||||
|
||||
*searchID = search->GetSearchID();
|
||||
m_currentSearch = *searchID;
|
||||
@@ -632,7 +660,7 @@ void CSearchList::StopSearch(bool globalOnly)
|
||||
}
|
||||
|
||||
|
||||
-CSearchList::CMemFilePtr CSearchList::CreateSearchData(const CSearchParams& params, SearchType WXUNUSED(type), bool supports64bit, bool& packetUsing64bit)
|
||||
+CSearchList::CMemFilePtr CSearchList::CreateSearchData(CSearchParams& params, SearchType type, bool supports64bit, bool& packetUsing64bit)
|
||||
{
|
||||
// Count the number of used parameters
|
||||
unsigned int parametercount = 0;
|
||||
@@ -659,14 +687,16 @@ CSearchList::CMemFilePtr CSearchList::CreateSearchData(const CSearchParams& para
|
||||
_astrParserErrors.Empty();
|
||||
_SearchExpr.m_aExpr.Empty();
|
||||
|
||||
+ s_strCurKadKeyword.Clear();
|
||||
+ if (type == KadSearch) {
|
||||
+ wxASSERT( !params.strKeyword.IsEmpty() );
|
||||
+ s_strCurKadKeyword = params.strKeyword;
|
||||
+ }
|
||||
+
|
||||
LexInit(params.searchString);
|
||||
int iParseResult = yyparse();
|
||||
LexFree();
|
||||
|
||||
-#ifdef __DEBUG__
|
||||
- AddLogLineNS(CFormat(wxT("Search parsing result for \"%s\": %i"))
|
||||
- % params.searchString % iParseResult);
|
||||
-#endif
|
||||
if (_astrParserErrors.GetCount() > 0) {
|
||||
for (unsigned int i=0; i < _astrParserErrors.GetCount(); ++i) {
|
||||
AddLogLineNS(CFormat(wxT("Error %u: %s\n")) % i % _astrParserErrors[i]);
|
||||
@@ -681,21 +711,13 @@ CSearchList::CMemFilePtr CSearchList::CreateSearchData(const CSearchParams& para
|
||||
return CMemFilePtr(NULL);
|
||||
}
|
||||
|
||||
- #ifdef __DEBUG__
|
||||
- wxString mes(wxT("Search expression:"));
|
||||
- for (unsigned int i = 0; i < _SearchExpr.m_aExpr.GetCount(); i++) {
|
||||
- mes << wxT(" ") << _SearchExpr.m_aExpr[i];
|
||||
+ if (type == KadSearch && s_strCurKadKeyword != params.strKeyword) {
|
||||
+ AddDebugLogLineN(logSearch, CFormat(wxT("Keyword was rearranged, using '%s' instead of '%s'")) % s_strCurKadKeyword % params.strKeyword);
|
||||
+ params.strKeyword = s_strCurKadKeyword;
|
||||
}
|
||||
- AddLogLineNS(mes);
|
||||
- AddLogLineNS(CFormat(wxT("Expression count: %i")) % _SearchExpr.m_aExpr.GetCount());
|
||||
- #endif
|
||||
|
||||
parametercount += _SearchExpr.m_aExpr.GetCount();
|
||||
|
||||
- #ifdef __DEBUG__
|
||||
- AddLogLineNS(CFormat(wxT("Parameters: %i")) % parametercount);
|
||||
- #endif
|
||||
-
|
||||
/* Leave the unicode comment there, please... */
|
||||
CSearchExprTarget target(data.get(), true /*I assume everyone is unicoded */ ? utf8strRaw : utf8strNone, supports64bit, packetUsing64bit);
|
||||
|
||||
diff --git a/src/SearchList.h b/src/SearchList.h
|
||||
index 35b0fc6..6db7508 100644
|
||||
--- a/src/SearchList.h
|
||||
+++ b/src/SearchList.h
|
||||
@@ -64,6 +64,8 @@ class CSearchList : public wxEvtHandler
|
||||
|
||||
//! The actual string to search for.
|
||||
wxString searchString;
|
||||
+ //! The keyword selected for Kad search
|
||||
+ wxString strKeyword;
|
||||
//! The type of files to search for (may be empty), one of ED2KFTSTR_*
|
||||
wxString typeText;
|
||||
//! The filename extension. May be empty.
|
||||
@@ -90,7 +92,7 @@ class CSearchList : public wxEvtHandler
|
||||
* @param params The search parameters, see CSearchParams.
|
||||
* @return An empty string on success, otherwise an error-message.
|
||||
*/
|
||||
- wxString StartNewSearch(uint32* searchID, SearchType type, const CSearchParams& params);
|
||||
+ wxString StartNewSearch(uint32* searchID, SearchType type, CSearchParams& params);
|
||||
|
||||
/** Stops the current search (global or Kad), if any is in progress. */
|
||||
void StopSearch(bool globalOnly = false);
|
||||
@@ -189,7 +191,7 @@ class CSearchList : public wxEvtHandler
|
||||
typedef std::auto_ptr<CMemFile> CMemFilePtr;
|
||||
|
||||
/** Create a basic search-packet for the given search-type. */
|
||||
- CMemFilePtr CreateSearchData(const CSearchParams& params, SearchType type, bool supports64bit, bool& packetUsing64bit);
|
||||
+ CMemFilePtr CreateSearchData(CSearchParams& params, SearchType type, bool supports64bit, bool& packetUsing64bit);
|
||||
|
||||
|
||||
//! Timer used for global search intervals.
|
||||
diff --git a/src/kademlia/kademlia/SearchManager.cpp b/src/kademlia/kademlia/SearchManager.cpp
|
||||
index e7f25d4..f9ee924 100644
|
||||
--- a/src/kademlia/kademlia/SearchManager.cpp
|
||||
+++ b/src/kademlia/kademlia/SearchManager.cpp
|
||||
@@ -127,7 +127,7 @@ CSearch* CSearchManager::PrepareFindKeywords(const wxString& keyword, uint32_t s
|
||||
|
||||
wxString wstrKeyword = s->m_words.front();
|
||||
|
||||
- AddLogLineNS(CFormat(_("Keyword for search: %s")) % wstrKeyword);
|
||||
+ AddDebugLogLineN(logSearch, CFormat(wxT("Keyword for search: %s")) % wstrKeyword);
|
||||
|
||||
// Kry - I just decided to assume everyone is unicoded
|
||||
// GonoszTopi - seconded
|
@ -1,365 +0,0 @@
|
||||
diff -Naur a/m4/libupnp.m4 b/m4/libupnp.m4
|
||||
--- a/m4/libupnp.m4 2016-10-06 18:49:44.000000000 +0800
|
||||
+++ b/m4/libupnp.m4 2019-12-11 22:13:19.008225399 +0800
|
||||
@@ -45,11 +45,16 @@
|
||||
|
||||
dnl Test for --with-libupnp-prefix
|
||||
AC_ARG_WITH(
|
||||
- [libupnp-prefix],
|
||||
- [AS_HELP_STRING(
|
||||
+ [libupnp-prefix],[
|
||||
+ AS_HELP_STRING(
|
||||
[--with-libupnp-prefix=PREFIX],
|
||||
- [UPnP library location])],
|
||||
- [export PKG_CONFIG_PATH=$withval/lib/pkgconfig])
|
||||
+ [UPnP library location])],[
|
||||
+ AS_IF([test -d "$withval/lib64/pkgconfig"],[
|
||||
+ export PKG_CONFIG_PATH=$withval/lib64/pkgconfig
|
||||
+ ],[
|
||||
+ export PKG_CONFIG_PATH=$withval/lib/pkgconfig
|
||||
+ ])
|
||||
+ ])
|
||||
|
||||
dnl Check for libupnp >= MIN_LIBUPNP_VERSION
|
||||
AS_IF([test $cross_compiling = no], [
|
||||
diff -Naur a/src/UPnPBase.cpp b/src/UPnPBase.cpp
|
||||
--- a/src/UPnPBase.cpp 2016-10-06 18:49:44.000000000 +0800
|
||||
+++ b/src/UPnPBase.cpp 2019-12-11 22:15:04.536768532 +0800
|
||||
@@ -1127,7 +1127,11 @@
|
||||
|
||||
|
||||
// This function is static
|
||||
+#if UPNP_VERSION >= 10800
|
||||
+int CUPnPControlPoint::Callback(Upnp_EventType_e EventType, const void *Event, void * /*Cookie*/)
|
||||
+#else
|
||||
int CUPnPControlPoint::Callback(Upnp_EventType EventType, void *Event, void * /*Cookie*/)
|
||||
+#endif
|
||||
{
|
||||
std::ostringstream msg;
|
||||
std::ostringstream msg2;
|
||||
@@ -1149,24 +1153,47 @@
|
||||
msg2<< "UPNP_DISCOVERY_SEARCH_RESULT: ";
|
||||
// UPnP Discovery
|
||||
upnpDiscovery:
|
||||
+#if UPNP_VERSION >= 10800
|
||||
+ UpnpDiscovery *d_event = (UpnpDiscovery *)Event;
|
||||
+#else
|
||||
struct Upnp_Discovery *d_event = (struct Upnp_Discovery *)Event;
|
||||
+#endif
|
||||
IXML_Document *doc = NULL;
|
||||
+#if UPNP_VERSION >= 10800
|
||||
+ int errCode = UpnpDiscovery_get_ErrCode(d_event);
|
||||
+ if (errCode != UPNP_E_SUCCESS) {
|
||||
+ msg << UpnpGetErrorMessage(errCode) << ".";
|
||||
+#else
|
||||
int ret;
|
||||
if (d_event->ErrCode != UPNP_E_SUCCESS) {
|
||||
msg << UpnpGetErrorMessage(d_event->ErrCode) << ".";
|
||||
+#endif
|
||||
AddDebugLogLineC(logUPnP, msg);
|
||||
}
|
||||
// Get the XML tree device description in doc
|
||||
+#if UPNP_VERSION >= 10800
|
||||
+ const char *location = UpnpDiscovery_get_Location_cstr(d_event);
|
||||
+ int ret = UpnpDownloadXmlDoc(location, &doc);
|
||||
+#else
|
||||
ret = UpnpDownloadXmlDoc(d_event->Location, &doc);
|
||||
+#endif
|
||||
if (ret != UPNP_E_SUCCESS) {
|
||||
msg << "Error retrieving device description from " <<
|
||||
+#if UPNP_VERSION >= 10800
|
||||
+ location << ": " <<
|
||||
+#else
|
||||
d_event->Location << ": " <<
|
||||
+#endif
|
||||
UpnpGetErrorMessage(ret) <<
|
||||
"(" << ret << ").";
|
||||
AddDebugLogLineC(logUPnP, msg);
|
||||
} else {
|
||||
msg2 << "Retrieving device description from " <<
|
||||
+#if UPNP_VERSION >= 10800
|
||||
+ location << ".";
|
||||
+#else
|
||||
d_event->Location << ".";
|
||||
+#endif
|
||||
AddDebugLogLineN(logUPnP, msg2);
|
||||
}
|
||||
if (doc) {
|
||||
@@ -1194,8 +1221,14 @@
|
||||
AddDebugLogLineC(logUPnP, msg);
|
||||
}
|
||||
// Add the root device to our list
|
||||
+#if UPNP_VERSION >= 10800
|
||||
+ int expires = UpnpDiscovery_get_Expires(d_event);
|
||||
+ upnpCP->AddRootDevice(rootDevice, urlBase,
|
||||
+ location, expires);
|
||||
+#else
|
||||
upnpCP->AddRootDevice(rootDevice, urlBase,
|
||||
d_event->Location, d_event->Expires);
|
||||
+#endif
|
||||
}
|
||||
// Free the XML doc tree
|
||||
IXML::Document::Free(doc);
|
||||
@@ -1216,28 +1249,62 @@
|
||||
case UPNP_DISCOVERY_ADVERTISEMENT_BYEBYE: {
|
||||
//fprintf(stderr, "Callback: UPNP_DISCOVERY_ADVERTISEMENT_BYEBYE\n");
|
||||
// UPnP Device Removed
|
||||
+#if UPNP_VERSION >= 10800
|
||||
+ UpnpDiscovery *dab_event = (UpnpDiscovery *)Event;
|
||||
+ int errCode = UpnpDiscovery_get_ErrCode(dab_event);
|
||||
+ if (errCode != UPNP_E_SUCCESS) {
|
||||
+#else
|
||||
struct Upnp_Discovery *dab_event = (struct Upnp_Discovery *)Event;
|
||||
if (dab_event->ErrCode != UPNP_E_SUCCESS) {
|
||||
+#endif
|
||||
msg << "error(UPNP_DISCOVERY_ADVERTISEMENT_BYEBYE): " <<
|
||||
+#if UPNP_VERSION >= 10800
|
||||
+ UpnpGetErrorMessage(errCode) <<
|
||||
+#else
|
||||
UpnpGetErrorMessage(dab_event->ErrCode) <<
|
||||
+#endif
|
||||
".";
|
||||
AddDebugLogLineC(logUPnP, msg);
|
||||
}
|
||||
+#if UPNP_VERSION >= 10800
|
||||
+ std::string devType = UpnpDiscovery_get_DeviceType_cstr(dab_event);
|
||||
+#else
|
||||
std::string devType = dab_event->DeviceType;
|
||||
+#endif
|
||||
// Check for an InternetGatewayDevice and removes it from the list
|
||||
+
|
||||
std::transform(devType.begin(), devType.end(), devType.begin(), tolower);
|
||||
+
|
||||
if (stdStringIsEqualCI(devType, UPnP::Device::IGW)) {
|
||||
+#if UPNP_VERSION >= 10800
|
||||
+ const char *deviceID =
|
||||
+ UpnpDiscovery_get_DeviceID_cstr(dab_event);
|
||||
+ upnpCP->RemoveRootDevice(deviceID);
|
||||
+#else
|
||||
upnpCP->RemoveRootDevice(dab_event->DeviceId);
|
||||
+#endif
|
||||
}
|
||||
break;
|
||||
}
|
||||
case UPNP_EVENT_RECEIVED: {
|
||||
//fprintf(stderr, "Callback: UPNP_EVENT_RECEIVED\n");
|
||||
// Event reveived
|
||||
+#if UPNP_VERSION >= 10800
|
||||
+ UpnpEvent *e_event = (UpnpEvent *)Event;
|
||||
+ int eventKey = UpnpEvent_get_EventKey(e_event);
|
||||
+ IXML_Document *changedVariables =
|
||||
+ UpnpEvent_get_ChangedVariables(e_event);
|
||||
+ const std::string sid = UpnpEvent_get_SID_cstr(e_event);
|
||||
+#else
|
||||
struct Upnp_Event *e_event = (struct Upnp_Event *)Event;
|
||||
const std::string Sid = e_event->Sid;
|
||||
+#endif
|
||||
// Parses the event
|
||||
+#if UPNP_VERSION >= 10800
|
||||
+ upnpCP->OnEventReceived(sid, eventKey, changedVariables);
|
||||
+#else
|
||||
upnpCP->OnEventReceived(Sid, e_event->EventKey, e_event->ChangedVariables);
|
||||
+#endif
|
||||
break;
|
||||
}
|
||||
case UPNP_EVENT_SUBSCRIBE_COMPLETE:
|
||||
@@ -1252,24 +1319,42 @@
|
||||
//fprintf(stderr, "Callback: UPNP_EVENT_RENEWAL_COMPLETE\n");
|
||||
msg << "error(UPNP_EVENT_RENEWAL_COMPLETE): ";
|
||||
upnpEventRenewalComplete:
|
||||
+#if UPNP_VERSION >= 10800
|
||||
+ UpnpEventSubscribe *es_event = (UpnpEventSubscribe *)Event;
|
||||
+ int errCode = UpnpEventSubscribe_get_ErrCode(es_event);
|
||||
+ if (errCode != UPNP_E_SUCCESS) {
|
||||
+#else
|
||||
struct Upnp_Event_Subscribe *es_event =
|
||||
(struct Upnp_Event_Subscribe *)Event;
|
||||
if (es_event->ErrCode != UPNP_E_SUCCESS) {
|
||||
+#endif
|
||||
msg << "Error in Event Subscribe Callback";
|
||||
+#if UPNP_VERSION >= 10800
|
||||
+ UPnP::ProcessErrorMessage(msg.str(), errCode, NULL, NULL);
|
||||
+#else
|
||||
UPnP::ProcessErrorMessage(
|
||||
msg.str(), es_event->ErrCode, NULL, NULL);
|
||||
+#endif
|
||||
} else {
|
||||
#if 0
|
||||
+#if UPNP_VERSION >= 10800
|
||||
+
|
||||
+ const UpnpString *publisherUrl =
|
||||
+ UpnpEventSubscribe_get_PublisherUrl(es_event);
|
||||
+ const char *sid = UpnpEvent_get_SID_cstr(es_event);
|
||||
+ int timeOut = UpnpEvent_get_TimeOut(es_event);
|
||||
+ TvCtrlPointHandleSubscribeUpdate(
|
||||
+ publisherUrl, sid, timeOut);
|
||||
+#else
|
||||
TvCtrlPointHandleSubscribeUpdate(
|
||||
GET_UPNP_STRING(es_event->PublisherUrl),
|
||||
es_event->Sid,
|
||||
es_event->TimeOut );
|
||||
#endif
|
||||
+#endif
|
||||
}
|
||||
-
|
||||
break;
|
||||
}
|
||||
-
|
||||
case UPNP_EVENT_AUTORENEWAL_FAILED:
|
||||
//fprintf(stderr, "Callback: UPNP_EVENT_AUTORENEWAL_FAILED\n");
|
||||
msg << "error(UPNP_EVENT_AUTORENEWAL_FAILED): ";
|
||||
@@ -1280,29 +1365,56 @@
|
||||
msg << "error(UPNP_EVENT_SUBSCRIPTION_EXPIRED): ";
|
||||
msg2 << "UPNP_EVENT_SUBSCRIPTION_EXPIRED: ";
|
||||
upnpEventSubscriptionExpired:
|
||||
+#if UPNP_VERSION >= 10800
|
||||
+ UpnpEventSubscribe *es_event = (UpnpEventSubscribe *)Event;
|
||||
+#else
|
||||
struct Upnp_Event_Subscribe *es_event =
|
||||
(struct Upnp_Event_Subscribe *)Event;
|
||||
+#endif
|
||||
Upnp_SID newSID;
|
||||
memset(newSID, 0, sizeof(Upnp_SID));
|
||||
int TimeOut = 1801;
|
||||
+#if UPNP_VERSION >= 10800
|
||||
+ const char *publisherUrl =
|
||||
+ UpnpEventSubscribe_get_PublisherUrl_cstr(es_event);
|
||||
+#endif
|
||||
int ret = UpnpSubscribe(
|
||||
upnpCP->m_UPnPClientHandle,
|
||||
+#if UPNP_VERSION >= 10800
|
||||
+ publisherUrl,
|
||||
+#else
|
||||
GET_UPNP_STRING(es_event->PublisherUrl),
|
||||
+#endif
|
||||
&TimeOut,
|
||||
newSID);
|
||||
if (ret != UPNP_E_SUCCESS) {
|
||||
msg << "Error Subscribing to EventURL";
|
||||
+#if UPNP_VERSION >= 10800
|
||||
+ int errCode = UpnpEventSubscribe_get_ErrCode(es_event);
|
||||
+#endif
|
||||
UPnP::ProcessErrorMessage(
|
||||
+#if UPNP_VERSION >= 10800
|
||||
+ msg.str(), errCode, NULL, NULL);
|
||||
+#else
|
||||
msg.str(), es_event->ErrCode, NULL, NULL);
|
||||
+#endif
|
||||
} else {
|
||||
ServiceMap::iterator it =
|
||||
+#if UPNP_VERSION >= 10800
|
||||
+ upnpCP->m_ServiceMap.find(publisherUrl);
|
||||
+#else
|
||||
upnpCP->m_ServiceMap.find(GET_UPNP_STRING(es_event->PublisherUrl));
|
||||
+#endif
|
||||
if (it != upnpCP->m_ServiceMap.end()) {
|
||||
CUPnPService &service = *(it->second);
|
||||
service.SetTimeout(TimeOut);
|
||||
service.SetSID(newSID);
|
||||
msg2 << "Re-subscribed to EventURL '" <<
|
||||
+#if UPNP_VERSION >= 10800
|
||||
+ publisherUrl <<
|
||||
+#else
|
||||
GET_UPNP_STRING(es_event->PublisherUrl) <<
|
||||
+#endif
|
||||
"' with SID == '" <<
|
||||
newSID << "'.";
|
||||
AddDebugLogLineC(logUPnP, msg2);
|
||||
@@ -1321,17 +1433,34 @@
|
||||
case UPNP_CONTROL_ACTION_COMPLETE: {
|
||||
//fprintf(stderr, "Callback: UPNP_CONTROL_ACTION_COMPLETE\n");
|
||||
// This is here if we choose to do this asynchronously
|
||||
+#if UPNP_VERSION >= 10800
|
||||
+ UpnpActionComplete *a_event = (UpnpActionComplete *)Event;
|
||||
+ int errCode = UpnpActionComplete_get_ErrCode(a_event);
|
||||
+ IXML_Document *actionResult =
|
||||
+ UpnpActionComplete_get_ActionResult(a_event);
|
||||
+ if (errCode != UPNP_E_SUCCESS) {
|
||||
+#else
|
||||
struct Upnp_Action_Complete *a_event =
|
||||
(struct Upnp_Action_Complete *)Event;
|
||||
if (a_event->ErrCode != UPNP_E_SUCCESS) {
|
||||
+#endif
|
||||
UPnP::ProcessErrorMessage(
|
||||
"UpnpSendActionAsync",
|
||||
+#if UPNP_VERSION >= 10800
|
||||
+ errCode, NULL,
|
||||
+ actionResult);
|
||||
+#else
|
||||
a_event->ErrCode, NULL,
|
||||
a_event->ActionResult);
|
||||
+#endif
|
||||
} else {
|
||||
// Check the response document
|
||||
UPnP::ProcessActionResponse(
|
||||
+#if UPNP_VERSION >= 10800
|
||||
+ actionResult,
|
||||
+#else
|
||||
a_event->ActionResult,
|
||||
+#endif
|
||||
"<UpnpSendActionAsync>");
|
||||
}
|
||||
/* No need for any processing here, just print out results.
|
||||
@@ -1342,22 +1471,43 @@
|
||||
case UPNP_CONTROL_GET_VAR_COMPLETE: {
|
||||
//fprintf(stderr, "Callback: UPNP_CONTROL_GET_VAR_COMPLETE\n");
|
||||
msg << "error(UPNP_CONTROL_GET_VAR_COMPLETE): ";
|
||||
+#if UPNP_VERSION >= 10800
|
||||
+ UpnpStateVarComplete *sv_event = (UpnpStateVarComplete *)Event;
|
||||
+ int errCode = UpnpStateVarComplete_get_ErrCode(sv_event);
|
||||
+ if (errCode != UPNP_E_SUCCESS) {
|
||||
+#else
|
||||
struct Upnp_State_Var_Complete *sv_event =
|
||||
(struct Upnp_State_Var_Complete *)Event;
|
||||
if (sv_event->ErrCode != UPNP_E_SUCCESS) {
|
||||
+#endif
|
||||
msg << "m_UpnpGetServiceVarStatusAsync";
|
||||
UPnP::ProcessErrorMessage(
|
||||
+#if UPNP_VERSION >= 10800
|
||||
+ msg.str(), errCode, NULL, NULL);
|
||||
+#else
|
||||
msg.str(), sv_event->ErrCode, NULL, NULL);
|
||||
+#endif
|
||||
} else {
|
||||
#if 0
|
||||
// Warning: The use of UpnpGetServiceVarStatus and
|
||||
// UpnpGetServiceVarStatusAsync is deprecated by the
|
||||
// UPnP forum.
|
||||
+#if UPNP_VERSION >= 10800
|
||||
+ const char *ctrlUrl =
|
||||
+ UpnpStateVarComplete_get_CtrlUrl(sv_event);
|
||||
+ const char *stateVarName =
|
||||
+ UpnpStateVarComplete_get_StateVarName(sv_event);
|
||||
+ const DOMString currentVal =
|
||||
+ UpnpStateVarComplete_get_CurrentVal(sv_event);
|
||||
+ TvCtrlPointHandleGetVar(
|
||||
+ ctrlUrl, stateVarName, currentVal);
|
||||
+#else
|
||||
TvCtrlPointHandleGetVar(
|
||||
sv_event->CtrlUrl,
|
||||
sv_event->StateVarName,
|
||||
sv_event->CurrentVal );
|
||||
#endif
|
||||
+#endif
|
||||
}
|
||||
break;
|
||||
}
|
||||
diff -Naur a/src/UPnPBase.h b/src/UPnPBase.h
|
||||
--- a/src/UPnPBase.h 2016-10-06 18:49:44.000000000 +0800
|
||||
+++ b/src/UPnPBase.h 2019-12-11 22:16:28.165063153 +0800
|
||||
@@ -489,9 +489,15 @@
|
||||
|
||||
// Callback function
|
||||
static int Callback(
|
||||
+ #if UPNP_VERSION >= 10800
|
||||
+ Upnp_EventType_e EventType,
|
||||
+ const void *Event,
|
||||
+ void *Cookie);
|
||||
+ #else
|
||||
Upnp_EventType EventType,
|
||||
void* Event,
|
||||
void* Cookie);
|
||||
+ #endif
|
||||
|
||||
private:
|
||||
void OnEventReceived(
|
@ -1,19 +0,0 @@
|
||||
--- a/src/libs/common/MuleDebug.cpp 2016-10-06 18:49:44.000000000 +0800
|
||||
+++ b/src/libs/common/MuleDebug.cpp 2021-06-17 02:16:40.000000000 +0800
|
||||
@@ -268,14 +268,14 @@
|
||||
return;
|
||||
}
|
||||
|
||||
- bfd_vma vma = bfd_get_section_vma(abfd, section);
|
||||
+ bfd_vma vma = bfd_section_vma(section);
|
||||
|
||||
unsigned long address = (unsigned long)_address;
|
||||
if (address < vma) {
|
||||
return;
|
||||
}
|
||||
|
||||
- bfd_size_type size = bfd_section_size(abfd, section);
|
||||
+ bfd_size_type size = bfd_section_size(section);
|
||||
if (address > (vma + size)) {
|
||||
return;
|
||||
}
|
@ -1,16 +0,0 @@
|
||||
diff --git a/src/UPnPBase.cpp b/src/UPnPBase.cpp
|
||||
index 46ac7451e..dd244e5b0 100644
|
||||
--- a/src/UPnPBase.cpp
|
||||
+++ b/src/UPnPBase.cpp
|
||||
@@ -828,9 +828,9 @@
|
||||
int ret;
|
||||
char *ipAddress = NULL;
|
||||
unsigned short port = 0;
|
||||
- ret = UpnpInit(ipAddress, udpPort);
|
||||
+ ret = UpnpInit2(0, udpPort);
|
||||
if (ret != UPNP_E_SUCCESS) {
|
||||
- msg << "error(UpnpInit): Error code ";
|
||||
+ msg << "error(UpnpInit2): Error code ";
|
||||
goto error;
|
||||
}
|
||||
port = UpnpGetServerPort();
|
@ -1,55 +0,0 @@
|
||||
# SPDX-License-Identifier: GPL-3.0-only
|
||||
#
|
||||
# Copyright (C) 2022 ImmortalWrt.org
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=baidupcs-web
|
||||
PKG_VERSION:=3.7.4-nnew
|
||||
PKG_RELEASE:=$(AUTORELEASE)
|
||||
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
||||
PKG_SOURCE_URL:=https://codeload.github.com/Erope/BaiduPCS-Go/tar.gz/v$(PKG_VERSION)?
|
||||
PKG_HASH:=6efd1c5e4cf5cf876204bed246c70ea0212ad078d4eb7703d7f1179b39551d1d
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/BaiduPCS-Go-$(PKG_VERSION)
|
||||
|
||||
PKG_LICENSE:=Apache-2.0
|
||||
PKG_LICENSE_FILES:=LICENSE
|
||||
|
||||
PKG_BUILD_DEPENDS:=golang/host go-rice/host
|
||||
PKG_BUILD_PARALLEL:=1
|
||||
PKG_USE_MIPS16:=0
|
||||
|
||||
GO_PKG:=github.com/Erope/BaiduPCS-Go
|
||||
GO_PKG_LDFLAGS_X:=main.Version=v$(PKG_VERSION)
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
include $(TOPDIR)/feeds/packages/lang/golang/golang-package.mk
|
||||
|
||||
define Package/baidupcs-web
|
||||
SECTION:=net
|
||||
CATEGORY:=Network
|
||||
SUBMENU:=Download Manager
|
||||
TITLE:=A web controller for BaiduPCS-Go
|
||||
URL:=https://github.com/Erope/BaiduPCS-Go
|
||||
DEPENDS:=$(GO_ARCH_DEPENDS) +ca-bundle
|
||||
endef
|
||||
|
||||
define Build/Compile
|
||||
( \
|
||||
pushd "$(PKG_BUILD_DIR)/internal/pcsweb" ; \
|
||||
rice embed-go ; \
|
||||
popd ; \
|
||||
$(call GoPackage/Build/Compile) ; \
|
||||
)
|
||||
endef
|
||||
|
||||
define Package/baidupcs-web/install
|
||||
$(call GoPackage/Package/Install/Bin,$(PKG_INSTALL_DIR))
|
||||
|
||||
$(INSTALL_DIR) $(1)/usr/bin
|
||||
$(INSTALL_BIN) $(GO_PKG_BUILD_BIN_DIR)/BaiduPCS-Go $(1)/usr/bin/baidupcs-web
|
||||
endef
|
||||
|
||||
$(eval $(call GoBinPackage,baidupcs-web))
|
||||
$(eval $(call BuildPackage,baidupcs-web))
|
@ -1,47 +0,0 @@
|
||||
# SPDX-License-Identifier: GPL-3.0-only
|
||||
#
|
||||
# Copyright (C) 2021 ImmortalWrt.org
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=CloudflareSpeedTest
|
||||
PKG_VERSION:=2.1.0
|
||||
PKG_RELEASE:=$(AUTORELEASE)
|
||||
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
||||
PKG_SOURCE_URL:=https://codeload.github.com/XIU2/CloudflareSpeedTest/tar.gz/v$(PKG_VERSION)?
|
||||
PKG_HASH:=39a4e4a341330746a8bd0a07769663f08d2fcc9c216e52a8b5e40c3e03fe1b6f
|
||||
|
||||
PKG_LICENSE:=GPL-3.0-only
|
||||
PKG_LICENSE_FILE:=LICENSE
|
||||
PKG_MAINTAINER:=Tianling Shen <cnsztl@immortalwrt.org>
|
||||
|
||||
PKG_BUILD_DEPENDS:=golang/host
|
||||
PKG_BUILD_PARALLEL:=1
|
||||
PKG_USE_MIPS16:=0
|
||||
|
||||
GO_PKG:=CloudflareSpeedTest
|
||||
GO_PKG_LDFLAGS_X:=main.version=v$(PKG_VERSION)
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
include $(TOPDIR)/feeds/packages/lang/golang/golang-package.mk
|
||||
|
||||
define Package/cdnspeedtest
|
||||
SECTION:=net
|
||||
CATEGORY:=Network
|
||||
TITLE:=Getting the fastest ips to your network of CDN
|
||||
URL:=https://github.com/XIU2/CloudflareSpeedTest
|
||||
DEPENDS:=$(GO_ARCH_DEPENDS) +ca-bundle
|
||||
endef
|
||||
|
||||
define Package/cdnspeedtest/install
|
||||
$(call GoPackage/Package/Install/Bin,$(PKG_INSTALL_DIR))
|
||||
$(INSTALL_DIR) $(1)/usr/bin
|
||||
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/CloudflareSpeedTest $(1)/usr/bin/cdnspeedtest
|
||||
|
||||
$(INSTALL_DIR) $(1)/usr/share/CloudflareSpeedTest
|
||||
$(INSTALL_DATA) $(PKG_BUILD_DIR)/ip.txt $(1)/usr/share/CloudflareSpeedTest/
|
||||
$(INSTALL_DATA) $(PKG_BUILD_DIR)/ipv6.txt $(1)/usr/share/CloudflareSpeedTest/
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,cdnspeedtest))
|
@ -1,35 +0,0 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=cpulimit
|
||||
PKG_VERSION:=0.3.2
|
||||
PKG_RELEASE:=$(AUTORELEASE)
|
||||
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
||||
PKG_SOURCE_URL:=https://codeload.github.com/denji/cpulimit/tar.gz/$(PKG_VERSION)?
|
||||
PKG_HASH:=0c61d394407fdd0547b53e6435ecb817d2e3ba914b48aa9f48ccf42c8278d3a6
|
||||
|
||||
PKG_BUILD_PARALLEL:=1
|
||||
PKG_LICENSE_FILES:=LICENSE
|
||||
|
||||
MAKE_PATH:=src
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/cpulimit
|
||||
SECTION:=utils
|
||||
CATEGORY:=Utilities
|
||||
TITLE:=CPU usage limiter
|
||||
URL:=https://github.com/denji/cpulimit
|
||||
endef
|
||||
|
||||
define Package/cpulimit/description
|
||||
Cpulimit is a tool which limits the CPU usage of a process
|
||||
(expressed in percentage, not in CPU time).
|
||||
endef
|
||||
|
||||
define Package/cpulimit/install
|
||||
$(INSTALL_DIR) $(1)/usr/bin/
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/src/cpulimit $(1)/usr/bin/
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,cpulimit))
|
@ -1,61 +0,0 @@
|
||||
#
|
||||
# Copyright (C) 2021 ImmortalWrt
|
||||
# <https://immortalwrt.org>
|
||||
#
|
||||
# This is free software, licensed under the GNU General Public License v3.
|
||||
# See /LICENSE for more information.
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=dnsforwarder
|
||||
PKG_VERSION:=6.1.15
|
||||
PKG_RELEASE:=11
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://github.com/1715173329/dnsforwarder.git
|
||||
PKG_SOURCE_DATE:=2018-06-26
|
||||
PKG_SOURCE_VERSION:=587e61ae4d75dc976f538088b715a3c8ee26c144
|
||||
PKG_MIRROR_HASH:=7c141040ae384d254d90b3c3ee502d87330c9fdcd201ff29a669336a27b176d4
|
||||
|
||||
PKG_LICENSE:=GPL-3.0
|
||||
PKG_LICENSE_FILE:=LICENSE
|
||||
PKG_MAINTAINER:=Dennis <openwrt@tossp.com>
|
||||
|
||||
PKG_FIXUP:=autoreconf
|
||||
PKG_BUILD_PARALLEL:=1
|
||||
PKG_INSTALL:=1
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/dnsforwarder
|
||||
SECTION:=net
|
||||
CATEGORY:=Network
|
||||
TITLE:=A simple DNS forwarder
|
||||
URL:=https://github.com/holmium/dnsforwarder
|
||||
DEPENDS:=+coreutils +coreutils-base64 +dnsmasq-full +libpthread +wget-ssl
|
||||
endef
|
||||
|
||||
define Package/dnsforwarder/description
|
||||
Forwarding queries to customized domains (and their subdomains) to specified servers
|
||||
over a specified protocol (UDP or TCP). non-standard ports are supported.
|
||||
endef
|
||||
|
||||
CONFIGURE_ARGS+= --enable-downloader=wget
|
||||
|
||||
define Package/dnsforwarder/install
|
||||
$(INSTALL_DIR) $(1)/usr/bin
|
||||
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/dnsforwarder $(1)/usr/bin/dnsforwarder
|
||||
|
||||
$(INSTALL_DIR) $(1)/etc/config
|
||||
$(INSTALL_CONF) files/etc/config/dnsforwarder $(1)/etc/config/dnsforwarder
|
||||
$(INSTALL_DIR) $(1)/etc/init.d
|
||||
$(INSTALL_BIN) files/etc/init.d/dnsforwarder $(1)/etc/init.d/dnsforwarder
|
||||
|
||||
$(INSTALL_DIR) $(1)/etc/dnsforwarder
|
||||
$(INSTALL_CONF) files/etc/dnsforwarder/gfw.txt $(1)/etc/dnsforwarder/gfw.txt
|
||||
$(INSTALL_DIR) $(1)/usr/share/dnsforwarder
|
||||
$(INSTALL_BIN) files/usr/share/dnsforwarder/gfwlist.sh $(1)/usr/share/dnsforwarder/gfwlist.sh
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,dnsforwarder))
|
@ -1,79 +0,0 @@
|
||||
|
||||
config arguments
|
||||
option enabled '0'
|
||||
option addr '127.0.0.1:5053'
|
||||
|
||||
config config
|
||||
option cache 'true'
|
||||
option cache_size '102400'
|
||||
option cache_ignore 'false'
|
||||
option gfw 'true'
|
||||
list block_ip '74.125.127.102'
|
||||
list block_ip '74.125.155.102'
|
||||
list block_ip '74.125.39.102'
|
||||
list block_ip '74.125.39.113'
|
||||
list block_ip '209.85.229.138'
|
||||
list block_ip '128.121.126.139'
|
||||
list block_ip '159.106.121.75'
|
||||
list block_ip '169.132.13.103'
|
||||
list block_ip '192.67.198.6'
|
||||
list block_ip '202.106.1.2'
|
||||
list block_ip '202.181.7.85'
|
||||
list block_ip '203.161.230.171'
|
||||
list block_ip '203.98.7.65'
|
||||
list block_ip '207.12.88.98'
|
||||
list block_ip '208.56.31.43'
|
||||
list block_ip '209.145.54.50'
|
||||
list block_ip '209.220.30.174'
|
||||
list block_ip '209.36.73.33'
|
||||
list block_ip '211.94.66.147'
|
||||
list block_ip '213.169.251.35'
|
||||
list block_ip '216.221.188.182'
|
||||
list block_ip '216.234.179.13'
|
||||
list block_ip '243.185.187.39'
|
||||
list block_ip '37.61.54.158'
|
||||
list block_ip '4.36.66.178'
|
||||
list block_ip '46.82.174.68'
|
||||
list block_ip '59.24.3.173'
|
||||
list block_ip '64.33.88.161'
|
||||
list block_ip '64.33.99.47'
|
||||
list block_ip '64.66.163.251'
|
||||
list block_ip '65.104.202.252'
|
||||
list block_ip '65.160.219.113'
|
||||
list block_ip '66.45.252.237'
|
||||
list block_ip '69.55.52.253'
|
||||
list block_ip '72.14.205.104'
|
||||
list block_ip '72.14.205.99'
|
||||
list block_ip '78.16.49.15'
|
||||
list block_ip '8.7.198.45'
|
||||
list block_ip '93.46.8.89'
|
||||
list block_ip '37.61.54.158'
|
||||
list block_ip '243.185.187.39'
|
||||
list block_ip '190.93.247.4'
|
||||
list block_ip '190.93.246.4'
|
||||
list block_ip '190.93.245.4'
|
||||
list block_ip '190.93.244.4'
|
||||
list block_ip '65.49.2.178'
|
||||
list block_ip '189.163.17.5'
|
||||
list block_ip '23.89.5.60'
|
||||
list block_ip '49.2.123.56'
|
||||
list block_ip '54.76.135.1'
|
||||
list block_ip '77.4.7.92'
|
||||
list block_ip '118.5.49.6'
|
||||
list block_ip '159.24.3.173'
|
||||
list block_ip '188.5.4.96'
|
||||
list block_ip '197.4.4.12'
|
||||
list block_ip '220.250.64.24'
|
||||
list block_ip '243.185.187.30'
|
||||
list block_ip '249.129.46.48'
|
||||
list block_ip '253.157.14.165'
|
||||
option block_ipv6 'false'
|
||||
list cache_control 'tossp.com $orig'
|
||||
list cache_control '* fixed 3600'
|
||||
option log 'false'
|
||||
list udp_group '9.9.9.9,119.29.29.29,223.5.5.5,114.114.114.114 * on'
|
||||
option block_negative_resp 'true'
|
||||
list udp_local '0.0.0.0:5053'
|
||||
list udp_local '[::0]:5053'
|
||||
option domain_statistic 'false'
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,260 +0,0 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
|
||||
START=60
|
||||
|
||||
EXTRA_COMMANDS="makeconfig makegfwlist health"
|
||||
|
||||
CRON_FILE=/etc/crontabs/root
|
||||
PID_PATH=/var/run/dnsforwarder
|
||||
PID_FILE=${PID_PATH}/dns.pid
|
||||
DNSFORWARDER_CONF=/tmp/dnsforwarder.conf
|
||||
|
||||
add_cron()
|
||||
{
|
||||
sed -i '/dnsforwarder/d' $CRON_FILE
|
||||
echo '*/5 * * * * /etc/init.d/dnsforwarder health' >> $CRON_FILE
|
||||
echo '0 1 * * 0 /etc/init.d/dnsforwarder makegfwlist' >> $CRON_FILE
|
||||
crontab $CRON_FILE
|
||||
}
|
||||
|
||||
del_cron()
|
||||
{
|
||||
sed -i '/dnsforwarder/d' $CRON_FILE
|
||||
/etc/init.d/cron restart
|
||||
}
|
||||
|
||||
fixturboacc(){
|
||||
dns=$(uci get turboacc.config.dns_caching 2>/dev/null)
|
||||
if [ $dns -eq 1 ]; then
|
||||
uci set turboacc.config.dns_caching=0 && uci commit turboacc
|
||||
/etc/init.d/turboacc restart
|
||||
fi
|
||||
}
|
||||
|
||||
makelist() {
|
||||
[ -z "$2" ] && return
|
||||
local i
|
||||
local t="$1"; shift
|
||||
for i in "$@"
|
||||
do
|
||||
echo "$t $i"
|
||||
done
|
||||
}
|
||||
|
||||
health(){
|
||||
rm /var/log/dnsforwarder.log.* 2>/dev/null
|
||||
local pid=$(cat ${PID_FILE} 2>/dev/null)
|
||||
if [ -n "${pid}" -a -d /proc/$pid ]; then
|
||||
echo "[health] process exists ${pid}"
|
||||
else
|
||||
echo "[health] Dnsforwarder is not running ${pid}"
|
||||
start
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
makegfwlist(){
|
||||
local GFW_FILE='/etc/dnsforwarder/gfw.txt'
|
||||
local GFW_TMP_FILE='/tmp/dnsforwarder-gfw.old'
|
||||
local TSTIME=`date '+%Y-%m-%d %H:%M:%S'`
|
||||
touch ${GFW_TMP_FILE}
|
||||
cat /etc/config/gfw.list 2>/dev/null > /tmp/edf.ts
|
||||
cat /etc/dnsmasq.ssr/gfw_base.conf 2>/dev/null | awk -F '/' '{print $2}' | sed 's/^.//g' >> /tmp/edf.ts
|
||||
cat /etc/dnsmasq.ssr/gfw_list.conf 2>/dev/null | awk -F '/' '{print $2}' | sed 's/^.//g' >> /tmp/edf.ts
|
||||
sort /tmp/edf.ts | uniq > /tmp/edf.ts
|
||||
/usr/share/dnsforwarder/gfwlist.sh -i -l -o /tmp/dnsforwarder-gfw.tmp --extra-domain-file /tmp/edf.ts
|
||||
if [ $? != 0 ]; then
|
||||
echo 'Failed to fetch gfwlist'
|
||||
logger -t Failed to fetch gfwlist
|
||||
return 2
|
||||
fi
|
||||
local gfw=$(cat /tmp/dnsforwarder-gfw.tmp)
|
||||
echo "# GenerationAt TS_BUILD_TIME" > ${GFW_TMP_FILE}.new
|
||||
echo "protocol tcp" >> ${GFW_TMP_FILE}.new
|
||||
echo "server 8.8.8.8,8.8.4.4,1.1.1.1,1.0.0.1,208.67.222.222,208.67.220.220,209.244.0.3,209.244.0.4,8.26.56.26,8.20.247.20,156.154.70.1,156.154.71.1,199.85.126.10" >> ${GFW_TMP_FILE}.new
|
||||
echo -e 'proxy no\n\n\n' >> ${GFW_TMP_FILE}.new
|
||||
echo "${gfw}" >> ${GFW_TMP_FILE}.new
|
||||
if [ "`cat ${GFW_TMP_FILE}.new | md5sum`" == "`cat ${GFW_TMP_FILE} | md5sum`" ]; then
|
||||
printf "[\e[32m%s\e[0m]\n" "hold"
|
||||
else
|
||||
cp ${GFW_TMP_FILE}.new ${GFW_TMP_FILE}
|
||||
cp ${GFW_TMP_FILE} ${GFW_FILE}
|
||||
sed -i "s/TS_BUILD_TIME/${TSTIME}/g" ${GFW_FILE}
|
||||
printf "[\e[33m%s\e[0m]" "PID"
|
||||
restart
|
||||
fi
|
||||
}
|
||||
|
||||
makeconfig () {
|
||||
config_load dnsforwarder
|
||||
|
||||
local log=$(uci get dnsforwarder.@config[0].log 2>/dev/null)
|
||||
local log_size=$(uci get dnsforwarder.@config[0].log_size 2>/dev/null)
|
||||
|
||||
local gfw=$(uci get dnsforwarder.@config[0].gfw 2>/dev/null)
|
||||
|
||||
local udp_local=$(uci -d ',' get dnsforwarder.@config[0].udp_local 2>/dev/null)
|
||||
local udp_local_list=$(uci get dnsforwarder.@config[0].udp_local 2>/dev/null)
|
||||
local tcp_group=$(uci get dnsforwarder.@config[0].tcp_group 2>/dev/null)
|
||||
local udp_group=$(uci get dnsforwarder.@config[0].udp_group 2>/dev/null)
|
||||
local group_file=$(uci get dnsforwarder.@config[0].group_file 2>/dev/null)
|
||||
local block_ip=$(uci -d ',' get dnsforwarder.@config[0].block_ip 2>/dev/null)
|
||||
local ip_substituting=$(uci -d ',' get dnsforwarder.@config[0].ip_substituting 2>/dev/null)
|
||||
local block_negative_resp=$(uci get dnsforwarder.@config[0].block_negative_resp 2>/dev/null)
|
||||
local append_host=$(uci get dnsforwarder.@config[0].append_host 2>/dev/null)
|
||||
local block_ipv6=$(uci get dnsforwarder.@config[0].block_ipv6 2>/dev/null)
|
||||
|
||||
local cache=$(uci get dnsforwarder.@config[0].cache 2>/dev/null)
|
||||
local cache_size=$(uci get dnsforwarder.@config[0].cache_size 2>/dev/null)
|
||||
local cache_ignore=$(uci get dnsforwarder.@config[0].cache_ignore 2>/dev/null)
|
||||
local cache_control=$(uci get dnsforwarder.@config[0].cache_control 2>/dev/null)
|
||||
|
||||
local domain_statistic=$(uci get dnsforwarder.@config[0].domain_statistic 2>/dev/null)
|
||||
local udp_local_addr=$(uci get dnsforwarder.@arguments[0].addr 2>/dev/null)
|
||||
udp_local_addr=${udp_local_addr/:/#}
|
||||
|
||||
echo "LogOn ${log}" > $DNSFORWARDER_CONF
|
||||
if [ $log = "true" ]; then
|
||||
rm /var/log/dnsforwarder.log.* 2>/dev/null
|
||||
echo '' > /var/log/dnsforwarder.log
|
||||
echo "LogFileThresholdLength ${log_size}" >> $DNSFORWARDER_CONF
|
||||
echo "LogFileFolder /var/log" >> $DNSFORWARDER_CONF
|
||||
fi
|
||||
|
||||
[ -n "$udp_local" ] && echo "UDPLocal ${udp_local}" >> $DNSFORWARDER_CONF
|
||||
[ -n "$udp_local_addr" ] && eval "makelist 'server=' $udp_local_addr" > /tmp/dnsmasq.dnsforwarder.conf
|
||||
sed -i "s/ //g" /tmp/dnsmasq.dnsforwarder.conf
|
||||
|
||||
eval "makelist 'TCPGroup' $tcp_group" >> $DNSFORWARDER_CONF
|
||||
eval "makelist 'UDPGroup' $udp_group" >> $DNSFORWARDER_CONF
|
||||
eval "makelist 'GroupFile' $group_file" >> $DNSFORWARDER_CONF
|
||||
|
||||
if [ $gfw = "true" ]; then
|
||||
echo 'GroupFile /etc/dnsforwarder/gfw.txt' >> $DNSFORWARDER_CONF
|
||||
fi
|
||||
|
||||
echo "BlockIP ${block_ip}" >> $DNSFORWARDER_CONF
|
||||
eval "makelist 'IPSubstituting' $ip_substituting" >> $DNSFORWARDER_CONF
|
||||
echo "BlockNegativeResponse ${block_negative_resp}" >> $DNSFORWARDER_CONF
|
||||
eval "makelist 'AppendHosts' $append_host" >> $DNSFORWARDER_CONF
|
||||
echo "BlockIpv6WhenIpv4Exists ${block_ipv6}" >> $DNSFORWARDER_CONF
|
||||
|
||||
echo "UseCache ${cache}" >> $DNSFORWARDER_CONF
|
||||
if [ $cache = "true" ]; then
|
||||
echo "CacheSize ${cache_size}" >> $DNSFORWARDER_CONF
|
||||
echo "MemoryCache false" >> $DNSFORWARDER_CONF
|
||||
echo "CacheFile /tmp/dnsforwarder.cache" >> $DNSFORWARDER_CONF
|
||||
echo "IgnoreTTL ${cache_ignore}" >> $DNSFORWARDER_CONF
|
||||
eval "makelist 'CacheControl' $cache_control" >> $DNSFORWARDER_CONF
|
||||
echo "ReloadCache true" >> $DNSFORWARDER_CONF
|
||||
echo "OverwriteCache true" >> $DNSFORWARDER_CONF
|
||||
fi
|
||||
echo "DomainStatistic ${domain_statistic}" >> $DNSFORWARDER_CONF
|
||||
if [ $domain_statistic = "true" ]; then
|
||||
touch /tmp/dnsforwarder-statistic.html
|
||||
mkdir -p /root/.dnsforwarder
|
||||
rm /root/.dnsforwarder/statistic.html 2 > /dev/null
|
||||
ln -s /tmp/dnsforwarder-statistic.html /root/.dnsforwarder/statistic.html
|
||||
local domain_statistic_tag='<!-- TS DNSFORWARDER -->'
|
||||
echo "DomainStatisticTempletFile /tmp/dnsforwarder-statistic.html" >> $DNSFORWARDER_CONF
|
||||
echo "StatisticInsertionPosition ${domain_statistic_tag}" >> $DNSFORWARDER_CONF
|
||||
echo "StatisticUpdateInterval 60" >> $DNSFORWARDER_CONF
|
||||
echo "${domain_statistic_tag}" > /tmp/dnsforwarder-statistic.html
|
||||
fi
|
||||
}
|
||||
|
||||
start()
|
||||
{
|
||||
echo luci for dnsforwarder
|
||||
local vt_enabled=$(uci get dnsforwarder.@arguments[0].enabled 2>/dev/null)
|
||||
if [ $vt_enabled = 0 ]; then
|
||||
echo dnsforwarder is not enabled
|
||||
exit
|
||||
fi
|
||||
makeconfig
|
||||
fixturboacc
|
||||
dnsforwarder -f $DNSFORWARDER_CONF -d
|
||||
sleep 10
|
||||
mkdir -p ${PID_PATH}
|
||||
pid=$(ps | awk '$5 ~ /\[dnsforwarder\]/ {print $1}')
|
||||
echo "dnsforwarder running pid is ${pid}"
|
||||
logger -t The pid of dnsforwarder is ${PID_FILE} ${pid}
|
||||
echo ${pid} > ${PID_FILE}
|
||||
/etc/init.d/dnsforwarder enable
|
||||
local dnsmasq=$(uci get dnsforwarder.@arguments[0].dnsmasq 2>/dev/null)
|
||||
local addr=$(uci get dnsforwarder.@arguments[0].addr 2>/dev/null)
|
||||
[ -n "${addr}" ] && addr=${addr/:/#}
|
||||
|
||||
if [ "${dnsmasq}" = "1" ]; then
|
||||
uci delete dhcp.@dnsmasq[0].server 2>/dev/null
|
||||
# uci add_list dhcp.@dnsmasq[0].server=$addr
|
||||
uci delete dhcp.@dnsmasq[0].resolvfile 2>/dev/null
|
||||
uci set dhcp.@dnsmasq[0].noresolv=1
|
||||
uci set dhcp.@dnsmasq[0].serversfile=/tmp/dnsmasq.dnsforwarder.conf
|
||||
uci commit dhcp
|
||||
/etc/init.d/dnsmasq restart
|
||||
fi
|
||||
local dnsmasq_server_addr=$(uci get dhcp.@dnsmasq[0].server 2>/dev/null)
|
||||
if [ -n "${dnsmasq_server_addr}" ]; then
|
||||
uci set dhcp.@dnsmasq[0].noresolv=1
|
||||
uci commit dhcp
|
||||
/etc/init.d/dnsmasq restart
|
||||
fi
|
||||
add_cron
|
||||
}
|
||||
|
||||
stop()
|
||||
{
|
||||
del_cron
|
||||
logger -t stopping dnsforwarder
|
||||
local addr=$(uci get dnsforwarder.@arguments[0].addr 2>/dev/null)
|
||||
local dnsmasq=$(uci get dnsforwarder.@arguments[0].dnsmasq 2>/dev/null)
|
||||
addr=${addr/:/#}
|
||||
if [ "${dnsmasq}" = "1" ]; then
|
||||
uci del_list dhcp.@dnsmasq[0].server=$addr 2>/dev/null
|
||||
fi
|
||||
uci set dhcp.@dnsmasq[0].resolvfile=/tmp/resolv.conf.d/resolv.conf.auto 2>/dev/null
|
||||
uci delete dhcp.@dnsmasq[0].noresolv 2>/dev/null
|
||||
uci delete dhcp.@dnsmasq[0].serversfile 2>/dev/null
|
||||
uci commit dhcp
|
||||
/etc/init.d/dnsmasq restart
|
||||
[ -e ${PID_FILE} ] && {
|
||||
pid=$(cat ${PID_FILE})
|
||||
logger -t killing dnsforwarder pid ${pid}
|
||||
echo killing dnsforwarder pid ${pid}
|
||||
kill ${pid}
|
||||
rm -f ${PID_FILE}
|
||||
} || {
|
||||
logger -t Cannot find dnsforwarder pid file
|
||||
}
|
||||
}
|
||||
|
||||
restart()
|
||||
{
|
||||
pid=$(cat ${PID_FILE} 2>/dev/null)
|
||||
echo Dnsforwarder pid file is ${pid}
|
||||
[ -n "$pid" ] && {
|
||||
echo stopping pid ${pid}
|
||||
logger -t There is dnsforwarder pid ${pid}
|
||||
stop
|
||||
} || {
|
||||
logger -t Dnsforwarder is not running
|
||||
}
|
||||
sleep 7
|
||||
local vt_enabled=$(uci get dnsforwarder.@arguments[0].enabled 2>/dev/null)
|
||||
echo dnsforwarder status is ${vt_enabled}
|
||||
logger -t Dnsforwarder is initializing enabled is ${vt_enabled}
|
||||
if [ ${vt_enabled} = 1 ]; then
|
||||
[ -n "$pid" ] && {
|
||||
logger -t There is dnsforwarder pid ${pid}
|
||||
stop
|
||||
} || {
|
||||
logger -t Dnsforwarder is not running
|
||||
}
|
||||
|
||||
logger -t Restarting dnsforwarder
|
||||
start
|
||||
else
|
||||
/etc/init.d/dnsforwarder disable
|
||||
fi
|
||||
}
|
@ -1,313 +0,0 @@
|
||||
#/bin/sh
|
||||
|
||||
# Name: gfwlist2dnsmasq.sh
|
||||
# Desription: A shell script which convert gfwlist into dnsmasq rules.
|
||||
# Version: 0.8.0 (2017.12.25)
|
||||
# Author: Cokebar Chi
|
||||
# Website: https://github.com/cokebar
|
||||
|
||||
_green() {
|
||||
printf '\033[1;31;32m'
|
||||
printf -- "%b" "$1"
|
||||
printf '\033[0m'
|
||||
}
|
||||
|
||||
_red() {
|
||||
printf '\033[1;31;31m'
|
||||
printf -- "%b" "$1"
|
||||
printf '\033[0m'
|
||||
}
|
||||
|
||||
_yellow() {
|
||||
printf '\033[1;31;33m'
|
||||
printf -- "%b" "$1"
|
||||
printf '\033[0m'
|
||||
}
|
||||
|
||||
usage() {
|
||||
cat <<-EOF
|
||||
|
||||
Name: gfwlist2dnsmasq.sh
|
||||
Desription: A shell script which convert gfwlist into dnsmasq rules.
|
||||
Version: 0.8.0 (2017.12.25)
|
||||
Author: Cokebar Chi
|
||||
Website: https://github.com/cokebar
|
||||
|
||||
Usage: sh gfwlist2dnsmasq.sh [options] -o FILE
|
||||
Valid options are:
|
||||
-d, --dns <dns_ip>
|
||||
DNS IP address for the GfwList Domains (Default: 127.0.0.1)
|
||||
-p, --port <dns_port>
|
||||
DNS Port for the GfwList Domains (Default: 5353)
|
||||
-s, --ipset <ipset_name>
|
||||
Ipset name for the GfwList domains
|
||||
(If not given, ipset rules will not be generated.)
|
||||
-o, --output <FILE>
|
||||
/path/to/output_filename
|
||||
-i, --insecure
|
||||
Force bypass certificate validation (insecure)
|
||||
-l, --domain-list
|
||||
Convert Gfwlist into domain list instead of dnsmasq rules
|
||||
(If this option is set, DNS IP/Port & ipset are not needed)
|
||||
--exclude-domain-file <FILE>
|
||||
Delete specific domains in the result from a domain list text file
|
||||
Please put one domain per line
|
||||
--extra-domain-file <FILE>
|
||||
Include extra domains to the result from a domain list text file
|
||||
This file will be processed after the exclude-domain-file
|
||||
Please put one domain per line
|
||||
-h, --help
|
||||
Usage
|
||||
EOF
|
||||
exit $1
|
||||
}
|
||||
|
||||
clean_and_exit(){
|
||||
# Clean up temp files
|
||||
printf 'Cleaning up... '
|
||||
rm -rf $TMP_DIR
|
||||
_green 'Done\n\n'
|
||||
[ $1 -eq 0 ] && _green 'Job Finished.\n\n' || _red 'Exit with Error code '$1'.\n'
|
||||
exit $1
|
||||
}
|
||||
|
||||
check_depends(){
|
||||
which sed base64 curl >/dev/null
|
||||
if [ $? != 0 ]; then
|
||||
_red 'Error: Missing Dependency.\nPlease check whether you have the following binaries on you system:\nwhich, sed, base64, curl.\n'
|
||||
exit 3
|
||||
fi
|
||||
|
||||
SYS_KERNEL=`uname -s`
|
||||
if [ $SYS_KERNEL = "Darwin" -o $SYS_KERNEL = "FreeBSD" ]; then
|
||||
BASE64_DECODE='base64 -D'
|
||||
SED_ERES='sed -E'
|
||||
else
|
||||
BASE64_DECODE='base64 -d'
|
||||
SED_ERES='sed -r'
|
||||
fi
|
||||
}
|
||||
|
||||
get_args(){
|
||||
OUT_TYPE='DNSMASQ_RULES'
|
||||
DNS_IP='127.0.0.1'
|
||||
DNS_PORT='5353'
|
||||
IPSET_NAME=''
|
||||
FILE_FULLPATH=''
|
||||
CURL_EXTARG=''
|
||||
WITH_IPSET=0
|
||||
EXTRA_DOMAIN_FILE=''
|
||||
EXCLUDE_DOMAIN_FILE=''
|
||||
IPV4_PATTERN='^((2[0-4][0-9]|25[0-5]|[01]?[0-9][0-9]?)\.){3}(2[0-4][0-9]|25[0-5]|[01]?[0-9][0-9]?)$'
|
||||
IPV6_PATTERN='^((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])(\.(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])(\.(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])(\.(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])(\.(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])(\.(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])(\.(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])(\.(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])){3}))|:)))(%.+)?$'
|
||||
|
||||
while [ ${#} -gt 0 ]; do
|
||||
case "${1}" in
|
||||
--help | -h)
|
||||
usage 0
|
||||
;;
|
||||
--domain-list | -l)
|
||||
OUT_TYPE='DOMAIN_LIST'
|
||||
;;
|
||||
--insecure | -i)
|
||||
CURL_EXTARG='--insecure'
|
||||
;;
|
||||
--dns | -d)
|
||||
DNS_IP="$2"
|
||||
shift
|
||||
;;
|
||||
--port | -p)
|
||||
DNS_PORT="$2"
|
||||
shift
|
||||
;;
|
||||
--ipset | -s)
|
||||
IPSET_NAME="$2"
|
||||
shift
|
||||
;;
|
||||
--output | -o)
|
||||
OUT_FILE="$2"
|
||||
shift
|
||||
;;
|
||||
--extra-domain-file)
|
||||
EXTRA_DOMAIN_FILE="$2"
|
||||
shift
|
||||
;;
|
||||
--exclude-domain-file)
|
||||
EXCLUDE_DOMAIN_FILE="$2"
|
||||
shift
|
||||
;;
|
||||
*)
|
||||
_red "Invalid argument: $1"
|
||||
usage 1
|
||||
;;
|
||||
esac
|
||||
shift 1
|
||||
done
|
||||
|
||||
# Check path & file name
|
||||
if [ -z $OUT_FILE ]; then
|
||||
_red 'Error: Please specify the path to the output file(using -o/--output argument).\n'
|
||||
exit 1
|
||||
else
|
||||
if [ -z ${OUT_FILE##*/} ]; then
|
||||
_red 'Error: '$OUT_FILE' is a path, not a file.\n'
|
||||
exit 1
|
||||
else
|
||||
if [ ${OUT_FILE}a != ${OUT_FILE%/*}a ] && [ ! -d ${OUT_FILE%/*} ]; then
|
||||
_red 'Error: Folder do not exist: '${OUT_FILE%/*}'\n'
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ $OUT_TYPE = 'DNSMASQ_RULES' ]; then
|
||||
# Check DNS IP
|
||||
IPV4_TEST=$(echo $DNS_IP | grep -E $IPV4_PATTERN)
|
||||
IPV6_TEST=$(echo $DNS_IP | grep -E $IPV6_PATTERN)
|
||||
if [ "$IPV4_TEST" != "$DNS_IP" -a "$IPV6_TEST" != "$DNS_IP" ]; then
|
||||
_red 'Error: Please enter a valid DNS server IP address.\n'
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Check DNS port
|
||||
if [ $DNS_PORT -lt 1 -o $DNS_PORT -gt 65535 ]; then
|
||||
_red 'Error: Please enter a valid DNS server port.\n'
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Check ipset name
|
||||
if [ -z $IPSET_NAME ]; then
|
||||
WITH_IPSET=0
|
||||
else
|
||||
IPSET_TEST=$(echo $IPSET_NAME | grep -E '^\w+$')
|
||||
if [ "$IPSET_TEST" != "$IPSET_NAME" ]; then
|
||||
_red 'Error: Please enter a valid IP set name.\n'
|
||||
exit 1
|
||||
else
|
||||
WITH_IPSET=1
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ ! -z $EXTRA_DOMAIN_FILE ] && [ ! -f $EXTRA_DOMAIN_FILE ]; then
|
||||
_yellow 'WARNING:\nExtra domain file does not exist, ignored.\n\n'
|
||||
EXTRA_DOMAIN_FILE=''
|
||||
fi
|
||||
|
||||
if [ ! -z $EXCLUDE_DOMAIN_FILE ] && [ ! -f $EXCLUDE_DOMAIN_FILE ]; then
|
||||
_yellow 'WARNING:\nExclude domain file does not exist, ignored.\n\n'
|
||||
EXCLUDE_DOMAIN_FILE=''
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
|
||||
process(){
|
||||
# Set Global Var
|
||||
BASE_URL='https://github.com/gfwlist/gfwlist/raw/master/gfwlist.txt'
|
||||
TMP_DIR=`mktemp -d /tmp/gfwlist2dnsmasq.XXXXXX`
|
||||
BASE64_FILE="$TMP_DIR/base64.txt"
|
||||
GFWLIST_FILE="$TMP_DIR/gfwlist.txt"
|
||||
DOMAIN_TEMP_FILE="$TMP_DIR/gfwlist2domain.tmp"
|
||||
DOMAIN_FILE="$TMP_DIR/gfwlist2domain.txt"
|
||||
CONF_TMP_FILE="$TMP_DIR/gfwlist.conf.tmp"
|
||||
OUT_TMP_FILE="$TMP_DIR/gfwlist.out.tmp"
|
||||
|
||||
# Fetch GfwList and decode it into plain text
|
||||
printf 'Fetching GfwList... '
|
||||
local tscurl='curl -L --connect-timeout 5 -m 300 --retry 3 --retry-delay 1'
|
||||
$tscurl $CURL_EXTARG -o$BASE64_FILE $BASE_URL \
|
||||
|| $tscurl $CURL_EXTARG -o$BASE64_FILE https://gitlab.com/gfwlist/gfwlist/raw/master/gfwlist.txt \
|
||||
|| $tscurl $CURL_EXTARG -o$BASE64_FILE https://git.tuxfamily.org/gfwlist/gfwlist.git/plain/gfwlist.txt \
|
||||
|| $tscurl $CURL_EXTARG -o$BASE64_FILE https://pagure.io/gfwlist/raw/master/f/gfwlist.txt \
|
||||
|| $tscurl $CURL_EXTARG -o$BASE64_FILE http://repo.or.cz/gfwlist.git/blob_plain/HEAD:/gfwlist.txt \
|
||||
|| $tscurl $CURL_EXTARG -o$BASE64_FILE https://bitbucket.org/gfwlist/gfwlist/raw/HEAD/gfwlist.txt \
|
||||
|| $tscurl $CURL_EXTARG -o$BASE64_FILE $BASE_URL
|
||||
if [ $? != 0 ]; then
|
||||
_red '\nFailed to fetch gfwlist.txt. Please check your Internet connection.\n'
|
||||
clean_and_exit 2
|
||||
fi
|
||||
$BASE64_DECODE $BASE64_FILE > $GFWLIST_FILE || ( _red 'Failed to decode gfwlist.txt. Quit.\n'; clean_and_exit 2 )
|
||||
_green 'Done.\n\n'
|
||||
|
||||
# Convert
|
||||
IGNORE_PATTERN='^\!|\[|^@@|(https?://){0,1}[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+'
|
||||
HEAD_FILTER_PATTERN='s#^(\|\|?)?(https?://)?##g'
|
||||
TAIL_FILTER_PATTERN='s#/.*$|%2F.*$##g'
|
||||
DOMAIN_PATTERN='([a-zA-Z0-9][-a-zA-Z0-9]*(\.[a-zA-Z0-9][-a-zA-Z0-9]*)+)'
|
||||
HANDLE_WILDCARD_PATTERN='s#^(([a-zA-Z0-9]*\*[-a-zA-Z0-9]*)?(\.))?([a-zA-Z0-9][-a-zA-Z0-9]*(\.[a-zA-Z0-9][-a-zA-Z0-9]*)+)(\*)?#\4#g'
|
||||
|
||||
printf 'Converting GfwList to ' && _green $OUT_TYPE && printf ' ...\n'
|
||||
_yellow '\nWARNING:\nThe following lines in GfwList contain regex, and might be ignored:\n\n'
|
||||
cat $GFWLIST_FILE | grep -n '^/.*$'
|
||||
_yellow "\nThis script will try to convert some of the regex rules. But you should know this may not be a equivalent conversion.\nIf there's regex rules which this script do not deal with, you should add the domain manually to the list.\n\n"
|
||||
grep -vE $IGNORE_PATTERN $GFWLIST_FILE | $SED_ERES $HEAD_FILTER_PATTERN | $SED_ERES $TAIL_FILTER_PATTERN | grep -E $DOMAIN_PATTERN | $SED_ERES $HANDLE_WILDCARD_PATTERN > $DOMAIN_TEMP_FILE
|
||||
|
||||
printf 'google.com\ngoogle.ad\ngoogle.ae\ngoogle.com.af\ngoogle.com.ag\ngoogle.com.ai\ngoogle.al\ngoogle.am\ngoogle.co.ao\ngoogle.com.ar\ngoogle.as\ngoogle.at\ngoogle.com.au\ngoogle.az\ngoogle.ba\ngoogle.com.bd\ngoogle.be\ngoogle.bf\ngoogle.bg\ngoogle.com.bh\ngoogle.bi\ngoogle.bj\ngoogle.com.bn\ngoogle.com.bo\ngoogle.com.br\ngoogle.bs\ngoogle.bt\ngoogle.co.bw\ngoogle.by\ngoogle.com.bz\ngoogle.ca\ngoogle.cd\ngoogle.cf\ngoogle.cg\ngoogle.ch\ngoogle.ci\ngoogle.co.ck\ngoogle.cl\ngoogle.cm\ngoogle.cn\ngoogle.com.co\ngoogle.co.cr\ngoogle.com.cu\ngoogle.cv\ngoogle.com.cy\ngoogle.cz\ngoogle.de\ngoogle.dj\ngoogle.dk\ngoogle.dm\ngoogle.com.do\ngoogle.dz\ngoogle.com.ec\ngoogle.ee\ngoogle.com.eg\ngoogle.es\ngoogle.com.et\ngoogle.fi\ngoogle.com.fj\ngoogle.fm\ngoogle.fr\ngoogle.ga\ngoogle.ge\ngoogle.gg\ngoogle.com.gh\ngoogle.com.gi\ngoogle.gl\ngoogle.gm\ngoogle.gp\ngoogle.gr\ngoogle.com.gt\ngoogle.gy\ngoogle.com.hk\ngoogle.hn\ngoogle.hr\ngoogle.ht\ngoogle.hu\ngoogle.co.id\ngoogle.ie\ngoogle.co.il\ngoogle.im\ngoogle.co.in\ngoogle.iq\ngoogle.is\ngoogle.it\ngoogle.je\ngoogle.com.jm\ngoogle.jo\ngoogle.co.jp\ngoogle.co.ke\ngoogle.com.kh\ngoogle.ki\ngoogle.kg\ngoogle.co.kr\ngoogle.com.kw\ngoogle.kz\ngoogle.la\ngoogle.com.lb\ngoogle.li\ngoogle.lk\ngoogle.co.ls\ngoogle.lt\ngoogle.lu\ngoogle.lv\ngoogle.com.ly\ngoogle.co.ma\ngoogle.md\ngoogle.me\ngoogle.mg\ngoogle.mk\ngoogle.ml\ngoogle.com.mm\ngoogle.mn\ngoogle.ms\ngoogle.com.mt\ngoogle.mu\ngoogle.mv\ngoogle.mw\ngoogle.com.mx\ngoogle.com.my\ngoogle.co.mz\ngoogle.com.na\ngoogle.com.nf\ngoogle.com.ng\ngoogle.com.ni\ngoogle.ne\ngoogle.nl\ngoogle.no\ngoogle.com.np\ngoogle.nr\ngoogle.nu\ngoogle.co.nz\ngoogle.com.om\ngoogle.com.pa\ngoogle.com.pe\ngoogle.com.pg\ngoogle.com.ph\ngoogle.com.pk\ngoogle.pl\ngoogle.pn\ngoogle.com.pr\ngoogle.ps\ngoogle.pt\ngoogle.com.py\ngoogle.com.qa\ngoogle.ro\ngoogle.ru\ngoogle.rw\ngoogle.com.sa\ngoogle.com.sb\ngoogle.sc\ngoogle.se\ngoogle.com.sg\ngoogle.sh\ngoogle.si\ngoogle.sk\ngoogle.com.sl\ngoogle.sn\ngoogle.so\ngoogle.sm\ngoogle.sr\ngoogle.st\ngoogle.com.sv\ngoogle.td\ngoogle.tg\ngoogle.co.th\ngoogle.com.tj\ngoogle.tk\ngoogle.tl\ngoogle.tm\ngoogle.tn\ngoogle.to\ngoogle.com.tr\ngoogle.tt\ngoogle.com.tw\ngoogle.co.tz\ngoogle.com.ua\ngoogle.co.ug\ngoogle.co.uk\ngoogle.com.uy\ngoogle.co.uz\ngoogle.com.vc\ngoogle.co.ve\ngoogle.vg\ngoogle.co.vi\ngoogle.com.vn\ngoogle.vu\ngoogle.ws\ngoogle.rs\ngoogle.co.za\ngoogle.co.zm\ngoogle.co.zw\ngoogle.cat\n' >> $DOMAIN_TEMP_FILE
|
||||
printf 'Google search domains... ' && _green 'Added\n'
|
||||
|
||||
# Add blogspot domains
|
||||
printf 'blogspot.ca\nblogspot.co.uk\nblogspot.com\nblogspot.com.ar\nblogspot.com.au\nblogspot.com.br\nblogspot.com.by\nblogspot.com.co\nblogspot.com.cy\nblogspot.com.ee\nblogspot.com.eg\nblogspot.com.es\nblogspot.com.mt\nblogspot.com.ng\nblogspot.com.tr\nblogspot.com.uy\nblogspot.de\nblogspot.gr\nblogspot.in\nblogspot.mx\nblogspot.ch\nblogspot.fr\nblogspot.ie\nblogspot.it\nblogspot.pt\nblogspot.ro\nblogspot.sg\nblogspot.be\nblogspot.no\nblogspot.se\nblogspot.jp\nblogspot.in\nblogspot.ae\nblogspot.al\nblogspot.am\nblogspot.ba\nblogspot.bg\nblogspot.ch\nblogspot.cl\nblogspot.cz\nblogspot.dk\nblogspot.fi\nblogspot.gr\nblogspot.hk\nblogspot.hr\nblogspot.hu\nblogspot.ie\nblogspot.is\nblogspot.kr\nblogspot.li\nblogspot.lt\nblogspot.lu\nblogspot.md\nblogspot.mk\nblogspot.my\nblogspot.nl\nblogspot.no\nblogspot.pe\nblogspot.qa\nblogspot.ro\nblogspot.ru\nblogspot.se\nblogspot.sg\nblogspot.si\nblogspot.sk\nblogspot.sn\nblogspot.tw\nblogspot.ug\nblogspot.cat\n' >> $DOMAIN_TEMP_FILE
|
||||
printf 'Blogspot domains... ' && _green 'Added\n'
|
||||
|
||||
# Add twimg.edgesuite.net
|
||||
printf 'twimg.edgesuite.net\n' >> $DOMAIN_TEMP_FILE
|
||||
printf 'twimg.edgesuite.net... ' && _green 'Added\n'
|
||||
|
||||
# Delete exclude domains
|
||||
if [ ! -z $EXCLUDE_DOMAIN_FILE ]; then
|
||||
for line in $(cat $EXCLUDE_DOMAIN_FILE)
|
||||
do
|
||||
cat $DOMAIN_TEMP_FILE | grep -vF -f $EXCLUDE_DOMAIN_FILE > $DOMAIN_FILE
|
||||
done
|
||||
printf 'Domains in exclude domain file '$EXCLUDE_DOMAIN_FILE'... ' && _green 'Deleted\n'
|
||||
else
|
||||
cat $DOMAIN_TEMP_FILE > $DOMAIN_FILE
|
||||
fi
|
||||
|
||||
# Add extra domains
|
||||
if [ ! -z $EXTRA_DOMAIN_FILE ]; then
|
||||
cat $EXTRA_DOMAIN_FILE >> $DOMAIN_FILE
|
||||
printf 'Extra domain file '$EXTRA_DOMAIN_FILE'... ' && _green 'Added\n'
|
||||
fi
|
||||
|
||||
if [ $OUT_TYPE = 'DNSMASQ_RULES' ]; then
|
||||
# Convert domains into dnsmasq rules
|
||||
if [ $WITH_IPSET -eq 1 ]; then
|
||||
_green 'Ipset rules included.'
|
||||
sort -u $DOMAIN_FILE | $SED_ERES 's#(.+)#server=/\1/'$DNS_IP'\#'$DNS_PORT'\
|
||||
ipset=/\1/'$IPSET_NAME'#g' > $CONF_TMP_FILE
|
||||
else
|
||||
_green 'Ipset rules not included.'
|
||||
sort -u $DOMAIN_FILE | $SED_ERES 's#(.+)#server=/\1/'$DNS_IP'\#'$DNS_PORT'#g' > $CONF_TMP_FILE
|
||||
fi
|
||||
|
||||
# Generate output file
|
||||
echo '# dnsmasq rules generated by gfwlist' > $OUT_TMP_FILE
|
||||
echo "# Last Updated on $(date "+%Y-%m-%d %H:%M:%S")" >> $OUT_TMP_FILE
|
||||
echo '# ' >> $OUT_TMP_FILE
|
||||
cat $CONF_TMP_FILE >> $OUT_TMP_FILE
|
||||
cp $OUT_TMP_FILE $OUT_FILE
|
||||
else
|
||||
sort -u $DOMAIN_FILE > $OUT_TMP_FILE
|
||||
fi
|
||||
|
||||
cp $OUT_TMP_FILE $OUT_FILE
|
||||
printf '\nConverting GfwList to '$OUT_TYPE'... ' && _green 'Done\n\n'
|
||||
|
||||
# Clean up
|
||||
clean_and_exit 0
|
||||
}
|
||||
|
||||
main() {
|
||||
if [ -z "$1" ]; then
|
||||
usage 0
|
||||
else
|
||||
check_depends
|
||||
get_args "$@"
|
||||
_green '\nJob Started.\n\n'
|
||||
process
|
||||
fi
|
||||
}
|
||||
|
||||
main "$@"
|
@ -1,59 +0,0 @@
|
||||
# SPDX-License-Identifier: GPL-3.0-only
|
||||
#
|
||||
# Copyright (C) 2021 ImmortalWrt.org
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=dnsproxy
|
||||
PKG_VERSION:=0.46.5
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
||||
PKG_SOURCE_URL:=https://codeload.github.com/AdguardTeam/dnsproxy/tar.gz/v$(PKG_VERSION)?
|
||||
PKG_HASH:=604b7e78956ec6d6421807e30ff44d87d85f10203b3d68d397af34ca2013e696
|
||||
|
||||
PKG_MAINTAINER:=Tianling Shen <cnsztl@immortalwrt.org>
|
||||
PKG_LICENSE:=Apache-2.0
|
||||
PKG_LICENSE_FILES:=LICENSE
|
||||
|
||||
PKG_BUILD_DEPENDS:=golang/host
|
||||
PKG_BUILD_PARALLEL:=1
|
||||
PKG_USE_MIPS16:=0
|
||||
|
||||
GO_PKG:=github.com/AdguardTeam/dnsproxy
|
||||
GO_PKG_LDFLAGS_X:=main.VersionString=v$(PKG_VERSION)
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
include $(TOPDIR)/feeds/packages/lang/golang/golang-package.mk
|
||||
|
||||
define Package/dnsproxy
|
||||
SECTION:=net
|
||||
CATEGORY:=Network
|
||||
SUBMENU:=IP Addresses and Names
|
||||
TITLE:=Simple DNS proxy with DoH, DoT, DoQ and DNSCrypt support
|
||||
URL:=https://github.com/AdguardTeam/dnsproxy
|
||||
DEPENDS:=$(GO_ARCH_DEPENDS) +ca-bundle
|
||||
USERID:=dnsproxy=411:dnsproxy=411
|
||||
endef
|
||||
|
||||
define Package/dnsproxy/description
|
||||
A simple DNS proxy server that supports all existing DNS protocols including
|
||||
DNS-over-TLS, DNS-over-HTTPS, DNSCrypt, and DNS-over-QUIC.Moreover, it can
|
||||
work as a DNS-over-HTTPS, DNS-over-TLS or DNS-over-QUIC server.
|
||||
endef
|
||||
|
||||
define Package/dnsproxy/install
|
||||
$(call GoPackage/Package/Install/Bin,$(1))
|
||||
|
||||
$(INSTALL_DIR) $(1)/etc/config/
|
||||
$(INSTALL_CONF) $(CURDIR)/files/dnsproxy.config $(1)/etc/config/dnsproxy
|
||||
$(INSTALL_DIR) $(1)/etc/init.d/
|
||||
$(INSTALL_BIN) $(CURDIR)/files/dnsproxy.init $(1)/etc/init.d/dnsproxy
|
||||
endef
|
||||
|
||||
define Package/dnsproxy/conffiles
|
||||
/etc/config/dnsproxy
|
||||
endef
|
||||
|
||||
$(eval $(call GoBinPackage,dnsproxy))
|
||||
$(eval $(call BuildPackage,dnsproxy))
|
@ -1,41 +0,0 @@
|
||||
|
||||
# For documents, please see https://github.com/AdguardTeam/dnsproxy#usage
|
||||
|
||||
config dnsproxy 'global'
|
||||
option enabled '0'
|
||||
option listen_addr '127.0.0.1'
|
||||
option listen_port '5353'
|
||||
option log_file ''
|
||||
option all_servers '0'
|
||||
option fastest_addr '0'
|
||||
option insecure '0'
|
||||
option ipv6_disabled '0'
|
||||
option max_go_routines ''
|
||||
option rate_limit ''
|
||||
option refuse_any '0'
|
||||
option udp_buf_size ''
|
||||
option verbose '0'
|
||||
|
||||
config dnsproxy 'bogus_nxdomain'
|
||||
list ip_addr ''
|
||||
|
||||
config dnsproxy 'cache'
|
||||
option enabled '0'
|
||||
option cache_optimistic '0'
|
||||
option size '65535'
|
||||
option min_ttl ''
|
||||
option max_ttl ''
|
||||
|
||||
config dnsproxy 'dns64'
|
||||
option enabled '0'
|
||||
option dns64_prefix '64:ff9b::'
|
||||
|
||||
config dnsproxy 'edns'
|
||||
option enabled '0'
|
||||
option edns_addr ''
|
||||
|
||||
config dnsproxy 'servers'
|
||||
list bootstrap 'tls://8.8.8.8'
|
||||
list fallback 'tls://9.9.9.9'
|
||||
list upstream 'tls://1.1.1.1'
|
||||
|
@ -1,115 +0,0 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
# Copyright (C) 2021 Tianling Shen <cnsztl@immortalwrt.org>
|
||||
|
||||
USE_PROCD=1
|
||||
START=90
|
||||
|
||||
CONF="dnsproxy"
|
||||
PROG="/usr/bin/dnsproxy"
|
||||
|
||||
is_enabled() {
|
||||
local enabled
|
||||
config_get enabled "$1" "$2" "0"
|
||||
if [ "$enabled" -eq "1" ]; then
|
||||
return 0
|
||||
else
|
||||
return 1
|
||||
fi
|
||||
}
|
||||
|
||||
is_empty() {
|
||||
local empty
|
||||
config_get empty "$1" "$2" $3
|
||||
if [ -z "$empty" ]; then
|
||||
return 0
|
||||
else
|
||||
return 1
|
||||
fi
|
||||
}
|
||||
|
||||
append_param() {
|
||||
procd_append_param command "$1" $2
|
||||
}
|
||||
|
||||
append_param_arg() {
|
||||
local value
|
||||
config_get value "$1" "$2" $4
|
||||
[ -n "$value" ] && append_param "$3" "$value"
|
||||
}
|
||||
|
||||
append_param_bool() {
|
||||
is_enabled "$1" "$2" && append_param "--${2//_/-}"
|
||||
}
|
||||
|
||||
load_config_arg() {
|
||||
append_param_bool "$1" "all_servers"
|
||||
append_param_bool "$1" "fastest_addr"
|
||||
append_param_bool "$1" "insecure"
|
||||
append_param_bool "$1" "ipv6_disabled"
|
||||
append_param_bool "$1" "refuse_any"
|
||||
append_param_bool "$1" "verbose"
|
||||
}
|
||||
|
||||
load_config_list() {
|
||||
is_empty "bogus_nxdomain" "ip_addr" || config_list_foreach "bogus_nxdomain" "ip_addr" "append_param '--bogus-nxdomain'"
|
||||
|
||||
for i in "bootstrap" "fallback" "upstream"; do
|
||||
is_empty "servers" "$i" || config_list_foreach "servers" "$i" "append_param '--$i'"
|
||||
done
|
||||
}
|
||||
|
||||
load_config_param() {
|
||||
append_param_arg "global" "listen_addr" "--listen" "127.0.0.1"
|
||||
append_param_arg "global" "listen_port" "--port" "5353"
|
||||
append_param_arg "global" "log_file" "--output"
|
||||
append_param_arg "global" "max_go_routines" "--max-go-routines"
|
||||
append_param_arg "global" "rate_limit" "--ratelimit"
|
||||
append_param_arg "global" "udp_buf_size" "--udp-buf-size"
|
||||
|
||||
is_enabled "cache" "enabled" && {
|
||||
append_param "--cache"
|
||||
append_param_bool "cache" "cache_optimistic"
|
||||
append_param_arg "cache" "size" "--cache-size"
|
||||
append_param_arg "cache" "min_ttl" "--cache-min-ttl"
|
||||
append_param_arg "cache" "max_ttl" "--cache-max-ttl"
|
||||
}
|
||||
|
||||
is_enabled "dns64" "enabled" && {
|
||||
append_param "--dns64"
|
||||
append_param_arg "dns64" "dns64_prefix" "--dns64-prefix"
|
||||
}
|
||||
|
||||
is_enabled "edns" "enabled" && {
|
||||
append_param "--edns"
|
||||
append_param_arg "edns" "edns_addr" "--edns-addr"
|
||||
}
|
||||
}
|
||||
|
||||
start_service() {
|
||||
config_load "$CONF"
|
||||
|
||||
is_enabled "global" "enabled" || return 1
|
||||
|
||||
procd_open_instance "$CONF"
|
||||
procd_set_param command "$PROG"
|
||||
|
||||
load_config_arg "global"
|
||||
load_config_list
|
||||
load_config_param
|
||||
|
||||
procd_set_param respawn
|
||||
procd_set_param stdout 1
|
||||
procd_set_param stderr 1
|
||||
procd_set_param user dnsproxy
|
||||
|
||||
procd_close_instance
|
||||
}
|
||||
|
||||
reload_service() {
|
||||
stop
|
||||
start
|
||||
}
|
||||
|
||||
service_triggers() {
|
||||
procd_add_reload_trigger "$CONF"
|
||||
}
|
@ -1,3 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
dnsproxy --version | grep "$PKG_VERSION"
|
@ -1,68 +0,0 @@
|
||||
# SPDX-License-Identifier: GPL-3.0-only
|
||||
#
|
||||
# Copyright (C) 2021 ImmortalWrt.org
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=filebrowser
|
||||
PKG_VERSION:=2.21.1
|
||||
PKG_RELEASE:=$(AUTORELEASE)
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=b73d278
|
||||
PKG_SOURCE_URL:=https://github.com/filebrowser/filebrowser
|
||||
PKG_MIRROR_HASH:=66b9df31f98bec22715a7fe9ca73962c1e5a5c1b3bcfb99fd0ac1703118ee4c8
|
||||
|
||||
PKG_LICENSE:=Apache-2.0
|
||||
PKG_LICENSE_FILES:=LICENSE
|
||||
PKG_MAINTAINER:=CN_SZTL <cnsztl@immortalwrt.org>
|
||||
|
||||
PKG_BUILD_DEPENDS:=golang/host node/host
|
||||
PKG_BUILD_PARALLEL:=1
|
||||
PKG_USE_MIPS16:=0
|
||||
|
||||
GO_PKG:=github.com/filebrowser/filebrowser
|
||||
GO_PKG_LDFLAGS_X:= \
|
||||
$(GO_PKG)/v2/version.CommitSHA=$(PKG_SOURCE_VERSION) \
|
||||
$(GO_PKG)/v2/version.Version=v$(PKG_VERSION)
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
include $(TOPDIR)/feeds/packages/lang/golang/golang-package.mk
|
||||
|
||||
define Package/filebrowser
|
||||
SECTION:=utils
|
||||
CATEGORY:=Utilities
|
||||
TITLE:=Web File Browser
|
||||
URL:=https://github.com/filebrowser/filebrowser
|
||||
DEPENDS:=$(GO_ARCH_DEPENDS)
|
||||
endef
|
||||
|
||||
define Package/filebrowser/description
|
||||
filebrowser provides a file managing interface within a specified directory
|
||||
and it can be used to upload, delete, preview, rename and edit your files.
|
||||
It allows the creation of multiple users and each user can have its own directory.
|
||||
It can be used as a standalone app or as a middleware.
|
||||
endef
|
||||
|
||||
define Build/Compile
|
||||
( \
|
||||
pushd "$(PKG_BUILD_DIR)/frontend" ; \
|
||||
npm ci; \
|
||||
npm run lint ; \
|
||||
npm run build ; \
|
||||
popd ; \
|
||||
$(call GoPackage/Build/Compile) ; \
|
||||
)
|
||||
endef
|
||||
|
||||
define Package/filebrowser/install
|
||||
$(call GoPackage/Package/Install/Bin,$(1))
|
||||
|
||||
$(INSTALL_DIR) $(1)/etc/config
|
||||
$(INSTALL_CONF) $(CURDIR)/files/filebrowser.config $(1)/etc/config/filebrowser
|
||||
$(INSTALL_DIR) $(1)/etc/init.d
|
||||
$(INSTALL_BIN) $(CURDIR)/files/filebrowser.init $(1)/etc/init.d/filebrowser
|
||||
endef
|
||||
|
||||
$(eval $(call GoBinPackage,filebrowser))
|
||||
$(eval $(call BuildPackage,filebrowser))
|
@ -1,9 +0,0 @@
|
||||
|
||||
config filebrowser 'config'
|
||||
option addr_type 'lan'
|
||||
option db_dir '/etc'
|
||||
option db_name 'filebrowser.db'
|
||||
option enabled '0'
|
||||
option port '8989'
|
||||
option root_dir '/'
|
||||
|
@ -1,34 +0,0 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
# Copyright (C) 2021 ImmortalWrt
|
||||
|
||||
START=90
|
||||
STOP=10
|
||||
|
||||
addr_type="$(uci get filebrowser.config.addr_type)"
|
||||
db_dir="$(uci get filebrowser.config.db_dir)"
|
||||
[ "${db_dir}" == "/" ] || db_dir="${db_dir%*/}"
|
||||
db_name="$(uci get filebrowser.config.db_name| sed 's#/##g')"
|
||||
enabled="$(uci get filebrowser.config.enabled)"
|
||||
port="$(uci get filebrowser.config.port)"
|
||||
root_dir="$(uci get filebrowser.config.root_dir)"
|
||||
|
||||
if [ "${addr_type}" == "local" ];then
|
||||
addr="127.0.0.1"
|
||||
elif [ "${addr_type}" == "lan" ];then
|
||||
addr="$(uci get network.lan.ipaddr)"
|
||||
elif [ "${addr_type}" == "wan" ];then
|
||||
addr="0.0.0.0"
|
||||
fi
|
||||
|
||||
start() {
|
||||
stop
|
||||
[ "$enabled" == "1" ] || exit 0
|
||||
mkdir -p "${root_dir}"
|
||||
mkdir -p "${db_dir}"
|
||||
filebrowser -a "${addr}" -d "${db_dir}/${db_name}" -p "${port}" -r "${root_dir}" >/dev/null 2>&1 &
|
||||
}
|
||||
|
||||
stop() {
|
||||
echo "${db_dir}/${db_name}" > "/lib/upgrade/keep.d/filebrowser"
|
||||
killall -3 filebrowser >/dev/null 2>&1
|
||||
}
|
@ -1,50 +0,0 @@
|
||||
#
|
||||
# Copyright (C) 2020 coolsnowwolf@gmail.com
|
||||
#
|
||||
# This is free software, licensed under the GNU General Public License v2.
|
||||
# See /LICENSE for more information.
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=gmediarender
|
||||
PKG_VERSION:=2021-03-15
|
||||
PKG_RELEASE=$(PKG_SOURCE_VERSION)
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://github.com/hzeller/gmrender-resurrect.git
|
||||
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
|
||||
PKG_SOURCE_VERSION:=4ac7d8914dc089651ae9d6c421ecda8f4d0ab5e3
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=08e8e60b8734131acd5d667c40a9a7e9d8bc7e86f59b4972d177e653608a1215
|
||||
|
||||
PKG_FIXUP:=autoreconf
|
||||
PKG_INSTALL=1
|
||||
PKG_REMOVE_FILES:=autogen.sh aclocal.m4
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
include $(INCLUDE_DIR)/nls.mk
|
||||
|
||||
define Package/gmediarender
|
||||
SECTION:=multimedia
|
||||
CATEGORY:=Multimedia
|
||||
DEPENDS:= +gstreamer1 +libgstreamer1 +gstreamer1-libs +glib2 +libupnp
|
||||
TITLE:=A Headless UPnP Renderer
|
||||
endef
|
||||
|
||||
define Package/gmediarender/description
|
||||
gmediarender implements the server component that provides UPnP
|
||||
controllers a means to render media content (audio, video and images)
|
||||
from a UPnP media server.
|
||||
endef
|
||||
|
||||
CONFIGURE_ARGS+= \
|
||||
CFLAGS="$(TARGET_CFLAGS) -std=gnu99" --with-build-cc="$(HOSTCC)" \
|
||||
--prefix="\usr"
|
||||
|
||||
define Package/gmediarender/install
|
||||
$(INSTALL_DIR) $(1)/usr/sbin
|
||||
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/$(PKG_NAME) $(1)/usr/sbin/
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,gmediarender))
|
@ -1,55 +0,0 @@
|
||||
# SPDX-Identifier-License: GPL-3.0-only
|
||||
#
|
||||
# Copyright (C) 2021 ImmortalWrt.org
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=go-aliyundrive-webdav
|
||||
PKG_VERSION:=1.1.1
|
||||
PKG_RELEASE:=$(AUTORELEASE)
|
||||
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
||||
PKG_SOURCE_URL:=https://codeload.github.com/LinkLeong/go-aliyundrive-webdav/tar.gz/v$(PKG_VERSION)?
|
||||
PKG_HASH:=967472971586bc9c62d1579a780e52431eaf37e54f2fe1b180c9a52db2304874
|
||||
|
||||
PKG_LICENSE:=Apache-2.0
|
||||
PKG_LICENSE_FILE:=LICENSE
|
||||
PKG_MAINTAINER:=Tianling Shen <cnsztl@immortalwrt.org>
|
||||
|
||||
PKG_BUILD_DEPENDS:=golang/host
|
||||
PKG_BUILD_PARALLEL:=1
|
||||
PKG_USE_MIPS16:=0
|
||||
|
||||
GO_PKG:=go-aliyun-webdav
|
||||
GO_PKG_LDFLAGS_X:=main.Version=v$(PKG_VERSION)
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
include $(TOPDIR)/feeds/packages/lang/golang/golang-package.mk
|
||||
|
||||
define Package/go-aliyundrive-webdav
|
||||
SECTION:=net
|
||||
CATEGORY:=Network
|
||||
SUBMENU:=File Transfer
|
||||
TITLE:=A WebDav server for AliyunDrive
|
||||
URL:=https://github.com/LinkLeong/go-aliyundrive-webdav
|
||||
DEPENDS:=$(GO_ARCH_DEPENDS)
|
||||
endef
|
||||
|
||||
|
||||
define Package/go-aliyundrive-webdav/conffiles
|
||||
/etc/config/go-aliyundrive-webdav
|
||||
endef
|
||||
|
||||
define Package/go-aliyundrive-webdav/install
|
||||
$(call GoPackage/Package/Install/Bin,$(PKG_INSTALL_DIR))
|
||||
$(INSTALL_DIR) $(1)/usr/bin/
|
||||
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/go-aliyun-webdav $(1)/usr/bin/go-aliyundrive-webdav
|
||||
|
||||
$(INSTALL_DIR) $(1)/etc/config/
|
||||
$(INSTALL_CONF) $(CURDIR)/files/go-aliyundrive-webdav.config $(1)/etc/config/go-aliyundrive-webdav
|
||||
$(INSTALL_DIR) $(1)/etc/init.d/
|
||||
$(INSTALL_BIN) $(CURDIR)/files/go-aliyundrive-webdav.init $(1)/etc/init.d/go-aliyundrive-webdav
|
||||
endef
|
||||
|
||||
$(eval $(call GoBinPackage,go-aliyundrive-webdav))
|
||||
$(eval $(call BuildPackage,go-aliyundrive-webdav))
|
@ -1,23 +0,0 @@
|
||||
|
||||
|
||||
config go-aliyundrive-webdav 'config'
|
||||
option enabled '0'
|
||||
|
||||
# Listening port
|
||||
option port '8085'
|
||||
|
||||
# Refresh token
|
||||
option rt ''
|
||||
|
||||
# Mounting directory
|
||||
option path '/'
|
||||
|
||||
# Webdav auth username, default: admin
|
||||
option user 'admin'
|
||||
|
||||
# Webdav auth password, default: 123456
|
||||
option pwd '123456'
|
||||
|
||||
# Enable detailed logging
|
||||
option verbose '0'
|
||||
|
@ -1,50 +0,0 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
# Copyright (C) 2021 Tianling Shen <cnsztl@immortalwrt.org>
|
||||
|
||||
USE_PROCD=1
|
||||
START=99
|
||||
|
||||
CONF="go-aliyundrive-webdav"
|
||||
PROG="/usr/bin/go-aliyundrive-webdav"
|
||||
|
||||
start_service() {
|
||||
config_load "$CONF"
|
||||
|
||||
local enabled
|
||||
config_get_bool enabled "config" "enabled"
|
||||
[ "$enabled" -eq "1" ] || return 1
|
||||
|
||||
local port rt path user pwd verbose
|
||||
config_get port "config" "port"
|
||||
config_get rt "config" "rt"
|
||||
config_get path "config" "path"
|
||||
config_get user "config" "user"
|
||||
config_get pwd "config" "pwd"
|
||||
config_get_bool verbose "config" "verbose"
|
||||
|
||||
procd_open_instance "$CONF"
|
||||
|
||||
procd_set_param command "$PROG"
|
||||
|
||||
procd_append_param command "-rt" "$rt"
|
||||
procd_append_param command "-port" "$port"
|
||||
procd_append_param command "-path" "$path"
|
||||
procd_append_param command "-user" "$user"
|
||||
procd_append_param command "-pwd" "$pwd"
|
||||
[ "$verbose" -eq "0" ] || procd_append_param command "-v"
|
||||
|
||||
procd_set_param stdout 1
|
||||
procd_set_param stderr 1
|
||||
procd_set_param respawn
|
||||
|
||||
procd_close_instance
|
||||
}
|
||||
|
||||
reload_service() {
|
||||
stop
|
||||
start
|
||||
}
|
||||
|
||||
service_triggers() {
|
||||
procd_add_reload_trigger "go-aliyundrive-webdav"
|
||||
}
|
@ -1,47 +0,0 @@
|
||||
# SPDX-License-Identifier: GPL-3.0-only
|
||||
#
|
||||
# Copyright (C) 2021 ImmortalWrt.org
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=gost
|
||||
PKG_VERSION:=2.11.4
|
||||
PKG_RELEASE:=$(AUTORELEASE)
|
||||
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
||||
PKG_SOURCE_URL:=https://codeload.github.com/ginuerzh/gost/tar.gz/v$(PKG_VERSION)?
|
||||
PKG_HASH:=aa3211282fce695584795fac20da77a2ac68d3e08602118afb0747bd64c1eac4
|
||||
|
||||
PKG_LICENSE:=MIT
|
||||
PKG_LICENSE_FILE:=LICENSE
|
||||
PKG_MAINTAINER:=Tianling Shen <cnsztl@immortalwrt.org>
|
||||
|
||||
PKG_BUILD_DEPENDS:=golang/host
|
||||
PKG_BUILD_PARALLEL:=1
|
||||
PKG_USE_MIPS16:=0
|
||||
|
||||
GO_PKG:=github.com/ginuerzh/gost
|
||||
GO_PKG_BUILD_PKG:=github.com/ginuerzh/gost/cmd/gost
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
include $(TOPDIR)/feeds/packages/lang/golang/golang-package.mk
|
||||
|
||||
define Package/gost
|
||||
SECTION:=net
|
||||
CATEGORY:=Network
|
||||
TITLE:=GO Simple Tunnel
|
||||
URL:=https://github.com/ginuerzh/gost
|
||||
DEPENDS:=$(GO_ARCH_DEPENDS) +ca-bundle
|
||||
endef
|
||||
|
||||
define Package/gost/install
|
||||
$(call GoPackage/Package/Install/Bin,$(1))
|
||||
|
||||
$(INSTALL_DIR) $(1)/etc/config
|
||||
$(INSTALL_CONF) $(CURDIR)/files/gost.config $(1)/etc/config/gost
|
||||
$(INSTALL_DIR) $(1)/etc/init.d
|
||||
$(INSTALL_BIN) $(CURDIR)/files/gost.init $(1)/etc/init.d/gost
|
||||
endef
|
||||
|
||||
$(eval $(call GoBinPackage,gost))
|
||||
$(eval $(call BuildPackage,gost))
|
@ -1,5 +0,0 @@
|
||||
|
||||
config gost
|
||||
option enable '0'
|
||||
option run_command ''
|
||||
|
@ -1,41 +0,0 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
# Created By ImmortalWrt
|
||||
# https://github.com/immortalwrt
|
||||
|
||||
USE_PROCD=1
|
||||
|
||||
START=99
|
||||
GOST=/usr/bin/gost
|
||||
|
||||
start_service() {
|
||||
config_load "gost"
|
||||
config_foreach start_instance
|
||||
}
|
||||
|
||||
service_enabled() {
|
||||
config_get_bool enabled "$1" 'enable' 0
|
||||
[ $enabled -gt 0 ]
|
||||
}
|
||||
|
||||
start_instance() {
|
||||
if ! service_enabled "$1"; then
|
||||
return 1
|
||||
fi
|
||||
|
||||
config_get run_command "$1" 'run_command'
|
||||
|
||||
procd_open_instance
|
||||
procd_set_param command $GOST
|
||||
procd_append_param command $run_command
|
||||
procd_set_param file /etc/config/gost
|
||||
procd_close_instance
|
||||
}
|
||||
|
||||
reload_service() {
|
||||
stop
|
||||
start
|
||||
}
|
||||
|
||||
service_triggers() {
|
||||
procd_add_reload_trigger gost
|
||||
}
|
@ -1,51 +0,0 @@
|
||||
# SPDX-License-Identifier: GPL-3.0-only
|
||||
#
|
||||
# Copyright (C) 2021-2023 ImmortalWrt.org
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=gowebdav
|
||||
PKG_VERSION:=0.0.5
|
||||
PKG_RELEASE:=2
|
||||
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
||||
PKG_SOURCE_URL:=https://codeload.github.com/1715173329/gowebdav/tar.gz/v$(PKG_VERSION)?
|
||||
PKG_HASH:=ee0ac5a52a3b7a1e1c687b850c3f7b55e10bbdc88da0b6b1dd8b790fc53d10c6
|
||||
|
||||
PKG_MAINTAINER:=Tianling Shen <cnsztl@immortalwrt.org>
|
||||
|
||||
PKG_BUILD_DEPENDS:=golang/host
|
||||
PKG_BUILD_PARALLEL:=1
|
||||
PKG_USE_MIPS16:=0
|
||||
|
||||
GO_PKG:=github.com/1715173329/gowebdav
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
include $(TOPDIR)/feeds/packages/lang/golang/golang-package.mk
|
||||
|
||||
define Package/gowebdav
|
||||
SECTION:=net
|
||||
CATEGORY:=Network
|
||||
SUBMENU:=File Transfer
|
||||
TITLE:=A simple WebDav server written in Go
|
||||
URL:=https://github.com/1715173329/gowebdav
|
||||
DEPENDS:=$(GO_ARCH_DEPENDS)
|
||||
endef
|
||||
|
||||
define Package/gowebdav/conffiles
|
||||
/etc/config/gowebdav
|
||||
endef
|
||||
|
||||
define Package/gowebdav/install
|
||||
$(call GoPackage/Package/Install/Bin,$(1))
|
||||
|
||||
$(INSTALL_DIR) $(1)/etc/config
|
||||
$(INSTALL_CONF) $(CURDIR)/files/gowebdav.config $(1)/etc/config/gowebdav
|
||||
$(INSTALL_DIR) $(1)/etc/init.d
|
||||
$(INSTALL_BIN) $(CURDIR)/files/gowebdav.init $(1)/etc/init.d/gowebdav
|
||||
$(INSTALL_DIR) $(1)/etc/uci-defaults
|
||||
$(INSTALL_BIN) $(CURDIR)/files/gowebdav-migrate-config.sh $(1)/etc/uci-defaults/90-gowebdav-migrate-config
|
||||
endef
|
||||
|
||||
$(eval $(call GoBinPackage,gowebdav))
|
||||
$(eval $(call BuildPackage,gowebdav))
|
@ -1,24 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
. /lib/functions.sh
|
||||
|
||||
config_load "gowebdav"
|
||||
config_get enable "config" "enable"
|
||||
[ -z "$enable" ] || uci -q rename "gowebdav.config.enable"="enabled"
|
||||
|
||||
config_get root_dir "config" "root_dir"
|
||||
[ -z "$root_dir" ] || uci -q rename "gowebdav.config.root_dir"="mount_dir"
|
||||
|
||||
config_get allow_wan "config" "allow_wan"
|
||||
[ -z "$allow_wan" ] || uci -q rename "gowebdav.config.allow_wan"="public_access"
|
||||
|
||||
config_get enable_auth "config" "enable_auth"
|
||||
config_get username "config" "username"
|
||||
[ -z "$enable_auth" -a -n "$username" ] && uci -q set "gowebdav.config.enable_auth"="1"
|
||||
|
||||
config_get use_https "config" "use_https"
|
||||
[ -z "$use_https" ] || uci -q rename "gowebdav.config.use_https"="enable_https"
|
||||
|
||||
[ -z "$(uci -q changes "gowebdav")" ] || uci -q commit "gowebdav"
|
||||
|
||||
exit 0
|
@ -1,14 +0,0 @@
|
||||
|
||||
config gowebdav 'config'
|
||||
option enabled '0'
|
||||
option listen_port '6086'
|
||||
option mount_dir '/mnt'
|
||||
option read_only '0'
|
||||
option public_access '0'
|
||||
option enable_auth '0'
|
||||
option username ''
|
||||
option password ''
|
||||
option enable_https '0'
|
||||
option cert_cer ''
|
||||
option cert_key ''
|
||||
|
@ -1,97 +0,0 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
# Copyright (C) 2021-2023 ImmortalWrt.org
|
||||
|
||||
START=99
|
||||
USE_PROCD=1
|
||||
|
||||
CONF="gowebdav"
|
||||
PROG="/usr/bin/gowebdav"
|
||||
|
||||
start_service() {
|
||||
config_load "$CONF"
|
||||
|
||||
local enabled
|
||||
config_get_bool enabled "config" "enabled" "0"
|
||||
[ "$enabled" -eq "1" ] || return 1
|
||||
|
||||
local listen_port mount_dir read_only public_access
|
||||
local enable_auth username password
|
||||
local enable_https cert_cer cert_key
|
||||
|
||||
config_get listen_port "config" "listen_port" "6086"
|
||||
config_get mount_dir "config" "mount_dir" "/mnt"
|
||||
config_get_bool read_only "config" "read_only" "0"
|
||||
config_get_bool public_access "config" "public_access" "0"
|
||||
|
||||
config_get_bool enable_auth "config" "enable_auth" "0"
|
||||
config_get username "config" "username"
|
||||
config_get password "config" "password"
|
||||
|
||||
config_get_bool enable_https "config" "enable_https" "0"
|
||||
config_get cert_cer "config" "cert_cer"
|
||||
config_get cert_key "config" "cert_key"
|
||||
|
||||
[ -d "$mount_dir" ] || mkdir -p "$mount_dir"
|
||||
|
||||
procd_open_instance
|
||||
procd_set_param command "$PROG"
|
||||
procd_append_param command -dir "$mount_dir"
|
||||
procd_append_param command -http ":$listen_port"
|
||||
[ "$read_only" -eq "0" ] || procd_append_param command -read-only
|
||||
|
||||
if [ "$enable_auth" -eq "1" ]; then
|
||||
if [ -z "$username" ] || [ -z "$password" ]; then
|
||||
logger -p daemon.err -t "$CONF" "Authentication enabled with empty username or password!"
|
||||
return 1
|
||||
fi
|
||||
|
||||
procd_append_param command -user "$username"
|
||||
procd_append_param command -password "$password"
|
||||
fi
|
||||
|
||||
if [ "$enable_https" -eq "1" ]; then
|
||||
if [ -z "$cert_cer" ] || [ -z "$cert_key" ]; then
|
||||
logger -p daemon.err -t "$CONF" "HTTPS enabled with empty certificate!"
|
||||
return 1
|
||||
fi
|
||||
|
||||
procd_append_param command -https-mode
|
||||
procd_append_param command -https-cert-file "$cert_cer"
|
||||
procd_append_param command -https-key-file "$cert_key"
|
||||
fi
|
||||
|
||||
procd_set_param limits core="unlimited"
|
||||
procd_set_param limits nofile="1000000 1000000"
|
||||
procd_set_param respawn
|
||||
procd_set_param stdout 1
|
||||
procd_set_param stderr 1
|
||||
|
||||
if [ "$public_access" -eq "1" ]; then
|
||||
procd_open_data
|
||||
json_add_array firewall
|
||||
json_add_object ""
|
||||
json_add_string type rule
|
||||
json_add_string name "Allow-access-GoWebDav-at-$listen_port"
|
||||
json_add_string src "*"
|
||||
json_add_string dest_port "$listen_port"
|
||||
json_add_string proto tcp
|
||||
json_add_string target ACCEPT
|
||||
json_close_object
|
||||
json_close_array
|
||||
procd_close_data
|
||||
fi
|
||||
|
||||
procd_close_instance
|
||||
}
|
||||
|
||||
service_started() {
|
||||
procd_set_config_changed firewall
|
||||
}
|
||||
|
||||
service_stopped() {
|
||||
procd_set_config_changed firewall
|
||||
}
|
||||
|
||||
service_triggers() {
|
||||
procd_add_reload_trigger "$CONF"
|
||||
}
|
146
haproxy/Makefile
146
haproxy/Makefile
@ -1,146 +0,0 @@
|
||||
#
|
||||
# Copyright (C) 2010-2016 OpenWrt.org
|
||||
# Copyright (C) 2009-2016 Thomas Heil <heil@terminal-consulting.de>
|
||||
# Copyright (C) 2018 Christian Lachner <gladiac@gmail.com>
|
||||
#
|
||||
# This is free software, licensed under the GNU General Public License v2.
|
||||
# See /LICENSE for more information.
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=haproxy
|
||||
PKG_VERSION:=2.6.6
|
||||
PKG_RELEASE:=104
|
||||
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
||||
PKG_SOURCE_URL:=https://www.haproxy.org/download/2.6/src
|
||||
PKG_HASH:=d0c80c90c04ae79598b58b9749d53787f00f7b515175e7d8203f2796e6a6594d
|
||||
|
||||
PKG_MAINTAINER:=Thomas Heil <heil@terminal-consulting.de>, \
|
||||
Christian Lachner <gladiac@gmail.com>
|
||||
PKG_LICENSE:=GPL-2.0-only
|
||||
PKG_LICENSE_FILES:=LICENSE
|
||||
PKG_CPE_ID:=cpe:/a:haproxy:haproxy
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/haproxy/Default
|
||||
SUBMENU:=Web Servers/Proxies
|
||||
SECTION:=net
|
||||
CATEGORY:=Network
|
||||
TITLE:=TCP/HTTP Load Balancer
|
||||
URL:=https://www.haproxy.org/
|
||||
endef
|
||||
|
||||
define Package/haproxy/conffiles
|
||||
/etc/haproxy.cfg
|
||||
endef
|
||||
|
||||
Package/haproxy-nossl/conffiles = $(Package/haproxy/conffiles)
|
||||
|
||||
define Package/haproxy/Default/description
|
||||
Open source Reliable, High Performance TCP/HTTP Load Balancer.
|
||||
endef
|
||||
|
||||
define Package/haproxy
|
||||
$(call Package/haproxy/Default)
|
||||
TITLE+=with SSL support
|
||||
DEPENDS+= +libpcre +libltdl +zlib +libpthread +liblua5.3 +libopenssl +libncurses +libreadline +libatomic
|
||||
VARIANT:=ssl
|
||||
endef
|
||||
|
||||
define Package/haproxy/description
|
||||
$(call Package/haproxy/Default/description)
|
||||
This package is built with SSL and LUA support.
|
||||
endef
|
||||
|
||||
define Package/haproxy-nossl
|
||||
$(call Package/haproxy/Default)
|
||||
TITLE+=without SSL support
|
||||
VARIANT:=nossl
|
||||
DEPENDS+= +libpcre +libltdl +zlib +libpthread +liblua5.3 +libatomic
|
||||
CONFLICTS:=haproxy
|
||||
endef
|
||||
|
||||
define Package/haproxy-nossl/description
|
||||
$(call Package/haproxy/Default/description)
|
||||
This package is built without SSL support.
|
||||
endef
|
||||
|
||||
TARGET=linux-glibc
|
||||
ENABLE_LUA:=y
|
||||
|
||||
ifeq ($(CONFIG_USE_UCLIBC),y)
|
||||
ADDON+=USE_BACKTRACE=
|
||||
ADDON+=USE_LIBCRYPT=
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_USE_MUSL),y)
|
||||
TARGET=linux-musl
|
||||
endif
|
||||
|
||||
ifeq ($(BUILD_VARIANT),ssl)
|
||||
ADDON+=USE_OPENSSL=1
|
||||
ADDON+=ADDLIB="-lcrypto -lm"
|
||||
endif
|
||||
|
||||
define Build/Compile
|
||||
$(MAKE) TARGET=$(TARGET) -C $(PKG_BUILD_DIR) \
|
||||
DESTDIR="$(PKG_INSTALL_DIR)" \
|
||||
CC="$(TARGET_CC)" \
|
||||
PCREDIR="$(STAGING_DIR)/usr/" \
|
||||
USE_LUA=1 LUA_LIB_NAME="lua5.3" LUA_INC="$(STAGING_DIR)/usr/include/lua5.3" LUA_LIB="$(STAGING_DIR)/usr/lib" \
|
||||
SMALL_OPTS="-DBUFSIZE=16384 -DMAXREWRITE=1030 -DSYSTEM_MAXCONN=165530" \
|
||||
USE_ZLIB=1 USE_PCRE=1 USE_PCRE_JIT=1 USE_PTHREAD_PSHARED=1 USE_LIBATOMIC=1 USE_PROMEX=1 \
|
||||
VERSION="$(PKG_VERSION)" SUBVERS="-$(PKG_RELEASE)" \
|
||||
VERDATE="$(shell date -d @$(SOURCE_DATE_EPOCH) '+%Y/%m/%d')" IGNOREGIT=1 \
|
||||
$(ADDON) \
|
||||
CFLAGS="$(TARGET_CFLAGS) -fno-strict-aliasing -Wdeclaration-after-statement -Wno-unused-label -Wno-sign-compare -Wno-unused-parameter -Wno-clobbered -Wno-missing-field-initializers -Wno-cast-function-type -Wno-address-of-packed-member -Wtype-limits -Wshift-negative-value -Wshift-overflow=2 -Wduplicated-cond -Wnull-dereference -fwrapv -fasynchronous-unwind-tables -Wno-null-dereference" \
|
||||
LD="$(TARGET_CC)" \
|
||||
LDFLAGS="$(TARGET_LDFLAGS)"
|
||||
|
||||
$(MAKE_VARS) $(MAKE) -C $(PKG_BUILD_DIR) \
|
||||
DESTDIR="$(PKG_INSTALL_DIR)" \
|
||||
LD="$(TARGET_CC)" \
|
||||
LDFLAGS="$(TARGET_LDFLAGS)" \
|
||||
$(MAKE_FLAGS) \
|
||||
install
|
||||
|
||||
$(MAKE_VARS) $(MAKE) -C $(PKG_BUILD_DIR) \
|
||||
DESTDIR="$(PKG_INSTALL_DIR)" \
|
||||
CC="$(TARGET_CC)" \
|
||||
CFLAGS="$(TARGET_CFLAGS) -Wno-address-of-packed-member" \
|
||||
LDFLAGS="$(TARGET_LDFLAGS)" \
|
||||
admin/halog/halog
|
||||
endef
|
||||
|
||||
define Package/haproxy/install
|
||||
$(INSTALL_DIR) $(1)/usr/sbin
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/haproxy $(1)/usr/sbin/
|
||||
$(INSTALL_DIR) $(1)/etc
|
||||
$(INSTALL_CONF) ./files/haproxy.cfg $(1)/etc/
|
||||
$(INSTALL_DIR) $(1)/etc/init.d
|
||||
$(INSTALL_BIN) ./files/haproxy.init $(1)/etc/init.d/haproxy
|
||||
endef
|
||||
|
||||
Package/haproxy-nossl/install = $(Package/haproxy/install)
|
||||
|
||||
define Package/halog
|
||||
$(call Package/haproxy)
|
||||
TITLE+=halog
|
||||
DEPENDS:=haproxy
|
||||
endef
|
||||
|
||||
define Package/halog/description
|
||||
HAProxy Log Analyzer
|
||||
endef
|
||||
|
||||
define Package/halog/install
|
||||
$(INSTALL_DIR) $(1)/usr/bin
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/admin/halog/halog $(1)/usr/bin/
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,haproxy))
|
||||
$(eval $(call BuildPackage,halog))
|
||||
$(eval $(call BuildPackage,haproxy-nossl))
|
@ -1,107 +0,0 @@
|
||||
# Example configuration file for HAProxy 2.0, refer to the url below for
|
||||
# a full documentation and examples for configuration:
|
||||
# https://cbonte.github.io/haproxy-dconv/2.0/configuration.html
|
||||
|
||||
|
||||
# Global parameters
|
||||
global
|
||||
|
||||
# Log events to a remote syslog server at given address using the
|
||||
# specified facility and verbosity level. Multiple log options
|
||||
# are allowed.
|
||||
#log 10.0.0.1 daemon info
|
||||
|
||||
# Specifiy the maximum number of allowed connections.
|
||||
maxconn 32000
|
||||
|
||||
# Raise the ulimit for the maximum allowed number of open socket
|
||||
# descriptors per process. This is usually at least twice the
|
||||
# number of allowed connections (maxconn * 2 + nb_servers + 1) .
|
||||
ulimit-n 65535
|
||||
|
||||
# Drop privileges (setuid, setgid), default is "root" on OpenWrt.
|
||||
uid 0
|
||||
gid 0
|
||||
|
||||
# Perform chroot into the specified directory.
|
||||
#chroot /var/run/haproxy/
|
||||
|
||||
# Daemonize on startup
|
||||
daemon
|
||||
|
||||
nosplice
|
||||
# Enable debugging
|
||||
#debug
|
||||
|
||||
# Spawn given number of processes and distribute load among them,
|
||||
# used for multi-core environments or to circumvent per-process
|
||||
# limits like number of open file descriptors. Default is 1.
|
||||
#nbproc 2
|
||||
|
||||
# Default parameters
|
||||
defaults
|
||||
# Default timeouts
|
||||
timeout connect 5000ms
|
||||
timeout client 50000ms
|
||||
timeout server 50000ms
|
||||
|
||||
|
||||
# Example HTTP proxy listener
|
||||
listen my_http_proxy
|
||||
|
||||
# Bind to port 81 and 444 on all interfaces (0.0.0.0)
|
||||
bind :81,:444
|
||||
|
||||
# We're proxying HTTP here...
|
||||
mode http
|
||||
|
||||
# Simple HTTP round robin over two servers using the specified
|
||||
# source ip 192.168.1.1 .
|
||||
balance roundrobin
|
||||
server server01 192.168.1.10:80 source 192.168.1.1
|
||||
server server02 192.168.1.20:80 source 192.168.1.1
|
||||
|
||||
# Serve an internal statistics page on /stats:
|
||||
stats enable
|
||||
stats uri /stats
|
||||
|
||||
# Enable HTTP basic auth for the statistics:
|
||||
stats realm HA_Stats
|
||||
stats auth username:password
|
||||
|
||||
|
||||
# Example SMTP proxy listener
|
||||
listen my_smtp_proxy
|
||||
|
||||
# Disable this instance without commenting out the section.
|
||||
disabled
|
||||
|
||||
# Bind to port 26 and 588 on localhost
|
||||
bind 127.0.0.1:26,127.0.0.1:588
|
||||
|
||||
# This is a TCP proxy
|
||||
mode tcp
|
||||
|
||||
# Round robin load balancing over two servers on port 123 forcing
|
||||
# the address 192.168.1.1 and port 25 as source.
|
||||
balance roundrobin
|
||||
#use next line for transparent proxy, so the servers can see the
|
||||
#original ip-address and remove source keyword in server definition
|
||||
#source 0.0.0.0 usesrc clientip
|
||||
server server01 192.168.1.10:123 source 192.168.1.1:25
|
||||
server server02 192.168.1.20:123 source 192.168.1.1:25
|
||||
|
||||
|
||||
# Special health check listener for integration with external load
|
||||
# balancers.
|
||||
listen local_health_check
|
||||
|
||||
# Listen on port 60000
|
||||
bind :60000
|
||||
|
||||
# This is a health check
|
||||
mode health
|
||||
|
||||
# Enable HTTP-style responses: "HTTP/1.0 200 OK"
|
||||
# else just print "OK".
|
||||
#option httpchk
|
@ -1,28 +0,0 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
# Copyright (C) 2009-2019 OpenWrt.org
|
||||
|
||||
START=99
|
||||
STOP=80
|
||||
|
||||
USE_PROCD=1
|
||||
|
||||
HAPROXY_BIN="/usr/sbin/haproxy"
|
||||
HAPROXY_CONFIG="/etc/haproxy.cfg"
|
||||
|
||||
start_service() {
|
||||
procd_open_instance
|
||||
procd_set_param respawn
|
||||
procd_set_param file "$HAPROXY_CONFIG"
|
||||
procd_set_param reload_signal USR2
|
||||
procd_set_param command $HAPROXY_BIN -q -W -db -f "$HAPROXY_CONFIG"
|
||||
procd_close_instance
|
||||
}
|
||||
|
||||
service_triggers() {
|
||||
procd_add_raw_trigger acme.renew 5000 /etc/init.d/haproxy reload
|
||||
}
|
||||
|
||||
extra_command "check" "Check haproxy config"
|
||||
check() {
|
||||
$HAPROXY_BIN -c -q -V -f $HAPROXY_CONFIG
|
||||
}
|
@ -1,27 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
CLONEURL=https://git.haproxy.org/git/haproxy-2.6.git
|
||||
BASE_TAG=v2.6.6
|
||||
TMP_REPODIR=tmprepo
|
||||
PATCHESDIR=patches
|
||||
|
||||
if test -d "${TMP_REPODIR}"; then rm -rf "${TMP_REPODIR}"; fi
|
||||
|
||||
git clone "${CLONEURL}" "${TMP_REPODIR}"
|
||||
|
||||
printf "Cleaning patches\n"
|
||||
find ${PATCHESDIR} -type f -name "*.patch" -exec rm -f "{}" \;
|
||||
|
||||
i=0
|
||||
for cid in $(git -C "${TMP_REPODIR}" rev-list ${BASE_TAG}..HEAD | tac); do
|
||||
filename="$(printf "%03d" $i)-$(git -C "${TMP_REPODIR}" log --format=%s -n 1 "$cid" | sed -e"s/[()']//g" -e's/[^_a-zA-Z0-9+-]\+/-/g' -e's/-$//').patch"
|
||||
printf "Creating %s\n" "${filename}"
|
||||
git -C "${TMP_REPODIR}" show "$cid" > "${PATCHESDIR}/$filename"
|
||||
git add "${PATCHESDIR}/$filename"
|
||||
i=$((i+1))
|
||||
done
|
||||
|
||||
rm -rf "${TMP_REPODIR}"
|
||||
|
||||
printf "finished\n"
|
||||
|
@ -1,43 +0,0 @@
|
||||
# SPDX-License-Identifier: GPL-3.0-only
|
||||
#
|
||||
# Copyright (C) 2021 ImmortalWrt.org
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=jpcre2
|
||||
PKG_VERSION:=10.32.01
|
||||
PKG_RELEASE:=$(AUTORELEASE)
|
||||
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
||||
PKG_SOURCE_URL:=https://codeload.github.com/jpcre2/jpcre2/tar.gz/$(PKG_VERSION)?
|
||||
PKG_HASH:=668cbc6d2c0a065bb6abe8494d5a1bb3549a14cd956a44a2df9095045623ea47
|
||||
|
||||
PKG_LICENSE:=BSD 3-Clause
|
||||
PKG_LICENSE_FILES:=LICENSE
|
||||
PKG_MAINTAINER:=Tianling Shen <cnsztl@immortalwrt.org>
|
||||
|
||||
PKG_BUILD_DEPENDS:=pcre2
|
||||
PKG_BUILD_PARALLEL:=1
|
||||
PKG_INSTALL:=1
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/jpcre2
|
||||
SECTION:=lib
|
||||
CATEGORY:=Libraries
|
||||
TITLE:=C++ wrapper for PCRE2 Library
|
||||
URL:=https://github.com/jpcre2/jpcre2
|
||||
BUILDONLY:=1
|
||||
endef
|
||||
|
||||
define Package/jpcre2/description
|
||||
This provides some C++ wrapper classes/functions to perform regex
|
||||
operations such as regex match and regex replace.
|
||||
endef
|
||||
|
||||
define Build/InstallDev
|
||||
$(INSTALL_DIR) $(1)/usr/include
|
||||
$(CP) $(PKG_INSTALL_DIR)/usr/include/jpcre2.hpp $(1)/usr/include/jpcre2.hpp
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,jpcre2))
|
@ -1,46 +0,0 @@
|
||||
# SPDX-License-Identifier: GPL-3.0-only
|
||||
#
|
||||
# Copyright (C) 2021 ImmortalWrt.org
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=libcron
|
||||
PKG_RELEASE:=$(AUTORELEASE)
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://github.com/PerMalmberg/libcron.git
|
||||
PKG_SOURCE_DATE:=2022-08-27
|
||||
PKG_SOURCE_VERSION:=0dd9df49d7833a2d2119e4a6ff8282df58b12d5d
|
||||
PKG_MIRROR_HASH:=a18c8ea0aa53be72cb67389bcd841c6501ce9c48a2467452e94691aa741f319b
|
||||
|
||||
PKG_LICENSE:=MIT
|
||||
PKG_LICENSE_FILES:=LICENSE
|
||||
PKG_MAINTAINER:=Tianling Shen <cnsztl@immortalwrt.org>
|
||||
|
||||
PKG_BUILD_PARALLEL:=1
|
||||
CMAKE_INSTALL:=1
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
include $(INCLUDE_DIR)/cmake.mk
|
||||
|
||||
define Package/libcron
|
||||
SECTION:=lib
|
||||
CATEGORY:=Libraries
|
||||
URL:=https://github.com/PerMalmberg/libcron
|
||||
TITLE:=A C++ scheduling library using cron formatting
|
||||
DEPENDS:=+libstdcpp
|
||||
endef
|
||||
|
||||
define Package/libcron/description
|
||||
Libcron offers an easy to use API to add callbacks with corresponding
|
||||
cron-formatted strings.
|
||||
endef
|
||||
|
||||
CMAKE_OPTIONS+= -DBUILD_SHARED_LIBS=ON
|
||||
|
||||
define Package/libcron/install
|
||||
$(INSTALL_DIR) $(1)/usr/lib/
|
||||
$(CP) $(PKG_INSTALL_DIR)/usr/lib/liblibcron.so $(1)/usr/lib/
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,libcron))
|
@ -1,41 +0,0 @@
|
||||
#
|
||||
# Copyright (C) 2017-2019 Chen Minqiang <ptpt52@gmail.com>
|
||||
#
|
||||
# This is free software, licensed under the GNU General Public License v2.
|
||||
# See /LICENSE for more information.
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=lua-ipops
|
||||
PKG_VERSION:=0.0.1
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE_VERSION:=$(PKG_VERSION)-$(PKG_RELEASE)
|
||||
PKG_MAINTAINER:=Chen Minqiang <ptpt52@gmail.com>
|
||||
PKG_LICENSE:=GPL-2.0
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/lua-ipops
|
||||
CATEGORY:=X
|
||||
SUBMENU:=Libs
|
||||
DEPENDS:=
|
||||
PKGARCH:=all
|
||||
TITLE:=lua ipops lib
|
||||
endef
|
||||
|
||||
define Package/lua-ipops/install
|
||||
$(INSTALL_DIR) $(1)/usr/lib/lua
|
||||
$(INSTALL_DATA) ./src/ipops.lua $(1)/usr/lib/lua/ipops.lua
|
||||
endef
|
||||
|
||||
define Build/Prepare
|
||||
true
|
||||
endef
|
||||
|
||||
define Build/Compile
|
||||
true
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,lua-ipops))
|
@ -1,497 +0,0 @@
|
||||
local function _lshift(a, i)
|
||||
return math.floor(a * 2^i)
|
||||
end
|
||||
|
||||
local function _rshift(a, i)
|
||||
return math.floor(a / 2^i)
|
||||
end
|
||||
|
||||
local function _band(a, b)
|
||||
local r = 0
|
||||
for i = 0, 31 do
|
||||
if _rshift(a, 31 - i) % 0x2 == 1 and _rshift(b, 31 - i) % 0x2 == 1 then
|
||||
r = r * 2 + 1
|
||||
else
|
||||
r = r * 2
|
||||
end
|
||||
end
|
||||
return r
|
||||
end
|
||||
|
||||
local function _bor(a, b)
|
||||
local r = 0
|
||||
for i = 0, 31 do
|
||||
if _rshift(a, 31 - i) % 0x2 == 1 or _rshift(b, 31 - i) % 0x2 == 1 then
|
||||
r = r * 2 + 1
|
||||
else
|
||||
r = r * 2
|
||||
end
|
||||
end
|
||||
return r
|
||||
end
|
||||
|
||||
local function _bxor(a, b)
|
||||
local r = 0
|
||||
for i = 0, 31 do
|
||||
if _rshift(a, 31 - i) % 0x2 ~= _rshift(b, 31 - i) % 0x2 then
|
||||
r = r * 2 + 1
|
||||
else
|
||||
r = r * 2
|
||||
end
|
||||
end
|
||||
return r
|
||||
end
|
||||
|
||||
local function _bnot(a)
|
||||
local r = 0
|
||||
for i = 0, 31 do
|
||||
if _rshift(a, 31 - i) % 0x2 == 0x0 then
|
||||
r = r * 2 + 1
|
||||
else
|
||||
r = r * 2
|
||||
end
|
||||
end
|
||||
return r
|
||||
end
|
||||
|
||||
local function get_parts_as_number(str)
|
||||
local t = {}
|
||||
for part in string.gmatch(str, "%d+") do
|
||||
table.insert(t, tonumber(part, 10))
|
||||
end
|
||||
return t
|
||||
end
|
||||
|
||||
-- ipstr: a.b.c.d
|
||||
local function ipstr2int(ipstr)
|
||||
local ip = get_parts_as_number(ipstr)
|
||||
if #ip == 4 then
|
||||
return (((ip[1] * 0x100 + ip[2]) * 0x100 + ip[3]) * 0x100 + ip[4])
|
||||
end
|
||||
return 0
|
||||
end
|
||||
|
||||
local function int2ipstr(x)
|
||||
local a = _rshift(x, 24) % 0x100
|
||||
local b = _rshift(x, 16) % 0x100
|
||||
local c = _rshift(x, 8) % 0x100
|
||||
local d = _rshift(x, 0) % 0x100
|
||||
return string.format("%u.%u.%u.%u", a, b, c, d)
|
||||
end
|
||||
|
||||
-- cidr: n
|
||||
local function cidr2int(cidr)
|
||||
if cidr == 0 then return 0 end
|
||||
local x = 0
|
||||
for i = 0, cidr - 1 do
|
||||
x = x + _lshift(1, 31 - i)
|
||||
end
|
||||
return x
|
||||
end
|
||||
|
||||
local function int2cidr(x)
|
||||
for i = 0, 31 do
|
||||
if _band(x, _lshift(1, 31 - i)) == 0 then
|
||||
return i
|
||||
end
|
||||
end
|
||||
return 32
|
||||
end
|
||||
|
||||
local function cidr2maskstr(cidr)
|
||||
return int2ipstr(cidr2int(cidr))
|
||||
end
|
||||
|
||||
local function maskstr2cidr(maskstr)
|
||||
return int2cidr(ipstr2int(maskstr))
|
||||
end
|
||||
|
||||
-- ipaddr: a.b.c.d, a.b.c.d/cidr
|
||||
-- return ip_int, mask_int
|
||||
local function get_ip_and_mask(ipaddr)
|
||||
local n = get_parts_as_number(ipaddr)
|
||||
return (((n[1] * 256 + n[2]) * 256 + n[3]) * 256 + n[4]), cidr2int(n[5] or 32)
|
||||
end
|
||||
|
||||
-- return ip_str, mask_str
|
||||
local function get_ipstr_and_maskstr(ipaddr)
|
||||
local ip, mask = get_ip_and_mask(ipaddr)
|
||||
return int2ipstr(ip), int2ipstr(mask)
|
||||
end
|
||||
|
||||
-- netString: ipaddr, a.b.c.d-e.f.g.h, a.b.c.d/m1.m2.m3.m4
|
||||
-- return: range: [n1, n2] where n1 <= n2
|
||||
local function netString2range(netString)
|
||||
ip = get_parts_as_number(netString)
|
||||
if #ip == 4 then
|
||||
local i = (((ip[1] * 256 + ip[2]) * 256 + ip[3]) * 256 + ip[4])
|
||||
return {i, i}
|
||||
end
|
||||
|
||||
if #ip == 5 and ip[5] >= 0 and ip[5] <= 32 then
|
||||
local i = (((ip[1] * 256 + ip[2]) * 256 + ip[3]) * 256 + ip[4])
|
||||
local m = cidr2int(ip[5])
|
||||
local s = _band(i, m)
|
||||
local e = _bor(i, _bnot(m))
|
||||
return {s, e}
|
||||
end
|
||||
|
||||
if #ip == 8 then
|
||||
local i = (((ip[1] * 256 + ip[2]) * 256 + ip[3]) * 256 + ip[4])
|
||||
local m = (((ip[5] * 256 + ip[6]) * 256 + ip[7]) * 256 + ip[8])
|
||||
if netString:match('/') then
|
||||
local s = _band(i, m)
|
||||
local e = _bor(s, _bnot(m))
|
||||
if s <= e then
|
||||
return {s, e}
|
||||
end
|
||||
else
|
||||
if i <= m then
|
||||
return {i, m}
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
return nil
|
||||
end
|
||||
|
||||
local function range2netString(range)
|
||||
if range[1] <= range[2] then
|
||||
return int2ipstr(range[1]) .. "-" .. int2ipstr(range[2])
|
||||
end
|
||||
return nil
|
||||
end
|
||||
|
||||
-- rangeSet: [range, ...]
|
||||
local function rangeSet_add_range(rangeSet, range)
|
||||
rangeSet = rangeSet or {}
|
||||
if not range then
|
||||
return rangeSet
|
||||
end
|
||||
if #rangeSet == 0 then
|
||||
table.insert(rangeSet, range)
|
||||
return rangeSet
|
||||
end
|
||||
|
||||
local rangeSet_new = {}
|
||||
for _, r in ipairs(rangeSet) do
|
||||
if range[1] < r[1] then
|
||||
if range[2] < r[1] then
|
||||
if range[2] + 1 < r[1] then
|
||||
table.insert(rangeSet_new, range)
|
||||
range = r
|
||||
else -- range[2] == r[1]
|
||||
range = {range[1], r[2]}
|
||||
end
|
||||
elseif range[2] <= r[2] then
|
||||
range = {range[1], r[2]}
|
||||
end
|
||||
elseif range[1] <= r[2] then
|
||||
if range[2] <= r[2] then
|
||||
range = {r[1], r[2]}
|
||||
elseif range[2] > r[2] then
|
||||
range = {r[1], range[2]}
|
||||
end
|
||||
elseif range[1] == r[2] + 1 then
|
||||
range = {r[1], range[2]}
|
||||
else -- range[1] > r[2] + 1
|
||||
table.insert(rangeSet_new, r)
|
||||
end
|
||||
end
|
||||
table.insert(rangeSet_new, range)
|
||||
|
||||
return rangeSet_new
|
||||
end
|
||||
|
||||
local function rangeSet_del_range(rangeSet, range)
|
||||
rangeSet = rangeSet or {}
|
||||
if not range then
|
||||
return rangeSet
|
||||
end
|
||||
if #rangeSet == 0 then
|
||||
return rangeSet
|
||||
end
|
||||
|
||||
local rangeSet_new = {}
|
||||
for _, r in ipairs(rangeSet) do
|
||||
if r[2] < range[1] then
|
||||
table.insert(rangeSet_new, r)
|
||||
else --r[2] >= range[1]
|
||||
if r[1] < range[1] then
|
||||
table.insert(rangeSet_new, {r[1], range[1] - 1})
|
||||
--else --r[1] >= range[1]
|
||||
end
|
||||
if r[2] > range[2] then
|
||||
if r[1] > range[2] then
|
||||
table.insert(rangeSet_new, r)
|
||||
else --r[1] <= range[2]
|
||||
table.insert(rangeSet_new, {range[2] + 1, r[2]})
|
||||
end
|
||||
--else --r[2] == range[2]
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
return rangeSet_new
|
||||
end
|
||||
|
||||
local function rangeSet_sub_rangeSet(rangeSetA, rangeSetB)
|
||||
rangeSetA = rangeSetA or {}
|
||||
if #rangeSetA == 0 then
|
||||
return rangeSetA
|
||||
end
|
||||
for _, range in ipairs(rangeSetB) do
|
||||
rangeSetA = rangeSet_del_range(rangeSetA, range)
|
||||
end
|
||||
return rangeSetA
|
||||
end
|
||||
|
||||
local function range_in_rangeSet(range, rangeSet)
|
||||
for _, r in ipairs(rangeSet) do
|
||||
if range[1] >= r[1] and range[2] <= r[2] then
|
||||
return true
|
||||
end
|
||||
end
|
||||
return false
|
||||
end
|
||||
|
||||
local function rangeSet_in_rangeSet(rangeSetA, rangeSetB)
|
||||
rangeSetA = rangeSetA or {}
|
||||
if #rangeSetA == 0 then
|
||||
return true
|
||||
end
|
||||
for _, range in ipairs(rangeSetA) do
|
||||
if not range_in_rangeSet(range, rangeSetB) then
|
||||
return false
|
||||
end
|
||||
end
|
||||
return true
|
||||
end
|
||||
|
||||
-- netStringSet: [netString, ...]
|
||||
local function netStringSet2rangeSet(netStringSet)
|
||||
local rangeSet = {}
|
||||
for _, netString in ipairs(netStringSet) do
|
||||
rangeSet = rangeSet_add_range(rangeSet, netString2range(netString))
|
||||
end
|
||||
return rangeSet
|
||||
end
|
||||
|
||||
local function rangeSet2netStringSet(rangeSet)
|
||||
local netStringSet = {}
|
||||
for _, range in ipairs(rangeSet) do
|
||||
table.insert(netStringSet, string.format("%s-%s", int2ipstr(range[1]), int2ipstr(range[2])))
|
||||
end
|
||||
return netStringSet
|
||||
end
|
||||
|
||||
--ipcidr: a.b.c.d/cidr
|
||||
--ipcidrSet: [ipcidr, ...], yes it is a netStringSet
|
||||
local function rangeSet2ipcidrSet(rangeSet)
|
||||
local ipcidrSet = {}
|
||||
for _, range in ipairs(rangeSet) do
|
||||
while range[1] <= range[2] do
|
||||
for cidr = 0, 32 do
|
||||
local m = cidr2int(cidr)
|
||||
local s = _band(range[1], m)
|
||||
local e = _bor(s, _bnot(m))
|
||||
if s == range[1] and e <= range[2] then
|
||||
table.insert(ipcidrSet, int2ipstr(s) .. '/' .. cidr)
|
||||
range[1] = e + 1
|
||||
break
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
return ipcidrSet
|
||||
end
|
||||
|
||||
--[[DEBUG]]
|
||||
--[[
|
||||
local netStringSet = {
|
||||
"1.1.1.1-2.2.2.2",
|
||||
"192.168.0.0/16",
|
||||
"192.168.0.1-192.168.0.2",
|
||||
"192.168.255.254-192.169.0.100",
|
||||
"172.16.0.1-172.16.0.100",
|
||||
"172.168.0.0/255.255.0.0",
|
||||
"192.168.11.6/24",
|
||||
"192.168.0.1-192.168.0.22",
|
||||
"192.168.0.33-192.168.0.52",
|
||||
}
|
||||
|
||||
print("dump netStringSet")
|
||||
for _, netString in ipairs(netStringSet) do
|
||||
print(netString, range2netString(netString2range(netString)))
|
||||
end
|
||||
|
||||
print("netStringSet to rangeSet")
|
||||
local rangeSet = netStringSet2rangeSet(netStringSet)
|
||||
for _, r in ipairs(rangeSet) do
|
||||
print(r[1], r[2])
|
||||
end
|
||||
|
||||
print("rangeSet to netStringSet")
|
||||
netStringSet = rangeSet2netStringSet(rangeSet)
|
||||
for _, netString in ipairs(netStringSet) do
|
||||
print(netString)
|
||||
end
|
||||
|
||||
print("rangeSet to ipcidrSet")
|
||||
local ipcidrSet = rangeSet2ipcidrSet(rangeSet)
|
||||
for _, ipcidr in ipairs(ipcidrSet) do
|
||||
print(ipcidr)
|
||||
end
|
||||
|
||||
print("ipcidrSet to rangeSet")
|
||||
rangeSet = netStringSet2rangeSet(ipcidrSet)
|
||||
for _, r in ipairs(rangeSet) do
|
||||
print(r[1], r[2])
|
||||
end
|
||||
|
||||
print("rangeSet to netStringSet")
|
||||
netStringSet = rangeSet2netStringSet(rangeSet)
|
||||
for _, netString in ipairs(netStringSet) do
|
||||
print(netString)
|
||||
end
|
||||
|
||||
print("get_ipstr_and_maskstr")
|
||||
local ip, mask = get_ipstr_and_maskstr("1.2.3.4")
|
||||
print(ip, mask)
|
||||
]]
|
||||
|
||||
local __func__ = {
|
||||
ipstr2int = ipstr2int,
|
||||
int2ipstr = int2ipstr,
|
||||
cidr2int = cidr2int,
|
||||
int2cidr = int2cidr,
|
||||
cidr2maskstr = cidr2maskstr,
|
||||
maskstr2cidr = maskstr2cidr,
|
||||
get_ip_and_mask = get_ip_and_mask,
|
||||
get_ipstr_and_maskstr = get_ipstr_and_maskstr,
|
||||
|
||||
lshift = _lshift,
|
||||
rshift = _rshift,
|
||||
|
||||
b32and = _band,
|
||||
b32or = _bor,
|
||||
b32xor = _bxor,
|
||||
b32not = _bnot,
|
||||
|
||||
netString2range = netString2range,
|
||||
netStringSet2rangeSet = netStringSet2rangeSet,
|
||||
range2netString = range2netString,
|
||||
rangeSet2netStringSet = rangeSet2netStringSet,
|
||||
rangeSet2ipcidrSet = rangeSet2ipcidrSet,
|
||||
rangeSet_add_range = rangeSet_add_range,
|
||||
rangeSet_del_range = rangeSet_del_range,
|
||||
rangeSet_sub_rangeSet = rangeSet_sub_rangeSet,
|
||||
rangeSet_in_rangeSet = rangeSet_in_rangeSet,
|
||||
}
|
||||
|
||||
-- api for test_func
|
||||
-- argv = [ "netString,netString" ]
|
||||
-- return: exit code
|
||||
-- eg: lua ipops.lua netStrings2ipcidrStrings "1.2.3.4,192.168.1.0/24,192.168.100.100-192.168.200.222"
|
||||
local function netStrings2ipcidrStrings(argv)
|
||||
local rangeSet = {}
|
||||
local netString
|
||||
local netStrings = argv[1]
|
||||
if not netStrings then
|
||||
return -1
|
||||
end
|
||||
for netString in netStrings:gmatch("[^,]+") do
|
||||
rangeSet = rangeSet_add_range(rangeSet, netString2range(netString))
|
||||
end
|
||||
|
||||
local ipcidrSet = rangeSet2ipcidrSet(rangeSet)
|
||||
|
||||
print(table.concat(ipcidrSet, ','))
|
||||
|
||||
return 0
|
||||
end
|
||||
|
||||
-- eg: lua ipops.lua netStrings_sub_netStrings "0.0.0.0/0" "1.2.3.4,192.168.1.0/24,192.168.100.100-192.168.200.222"
|
||||
local function netStrings_sub_netStrings(argv)
|
||||
local netString
|
||||
local rangeSetA = {}
|
||||
local rangeSetB = {}
|
||||
local netStringsA, netStringsB = argv[1], argv[2]
|
||||
if not netStringsA or not netStringsB then
|
||||
return -1
|
||||
end
|
||||
for netString in netStringsA:gmatch("[^,]+") do
|
||||
rangeSetA = rangeSet_add_range(rangeSetA, netString2range(netString))
|
||||
end
|
||||
for netString in netStringsB:gmatch("[^,]+") do
|
||||
rangeSetB = rangeSet_add_range(rangeSetB, netString2range(netString))
|
||||
end
|
||||
|
||||
rangeSetA = rangeSet_sub_rangeSet(rangeSetA, rangeSetB)
|
||||
|
||||
local ipcidrSet = rangeSet2ipcidrSet(rangeSetA)
|
||||
|
||||
print(table.concat(ipcidrSet, ','))
|
||||
|
||||
return 0
|
||||
end
|
||||
|
||||
-- eg: lua ipops.lua netStrings_test_netStrings "192.168.15.0/24" "192.168.15.0/29"
|
||||
local function netStrings_test_netStrings(argv)
|
||||
local netString
|
||||
local rangeSetA = {}
|
||||
local rangeSetB = {}
|
||||
local netStringsA, netStringsB = argv[1], argv[2]
|
||||
if not netStringsA or not netStringsB then
|
||||
return -1
|
||||
end
|
||||
for netString in netStringsA:gmatch("[^,]+") do
|
||||
rangeSetA = rangeSet_add_range(rangeSetA, netString2range(netString))
|
||||
end
|
||||
for netString in netStringsB:gmatch("[^,]+") do
|
||||
rangeSetB = rangeSet_add_range(rangeSetB, netString2range(netString))
|
||||
end
|
||||
|
||||
if (rangeSet_in_rangeSet(rangeSetB, rangeSetA)) then
|
||||
return 0
|
||||
end
|
||||
|
||||
return 1
|
||||
end
|
||||
|
||||
local test_func = {
|
||||
netStrings2ipcidrStrings = {
|
||||
argc = 1,
|
||||
func = netStrings2ipcidrStrings
|
||||
},
|
||||
netStrings_sub_netStrings = {
|
||||
argc = 2,
|
||||
func = netStrings_sub_netStrings
|
||||
},
|
||||
netStrings_test_netStrings = {
|
||||
argc = 2;
|
||||
func = netStrings_test_netStrings
|
||||
}
|
||||
}
|
||||
|
||||
function test_main(...)
|
||||
if arg[1] and test_func[arg[1]] and test_func[arg[1]].func then
|
||||
local argc = test_func[arg[1]].argc or 0
|
||||
local func = test_func[arg[1]].func
|
||||
local argv = {}
|
||||
if argc > 0 then
|
||||
for i = 1, argc do
|
||||
table.insert(argv, arg[1 + i])
|
||||
end
|
||||
end
|
||||
return true, func(argv)
|
||||
end
|
||||
return false
|
||||
end
|
||||
|
||||
local test, ret = test_main(...)
|
||||
if test then
|
||||
os.exit(ret)
|
||||
end
|
||||
|
||||
return __func__
|
@ -1,80 +0,0 @@
|
||||
#
|
||||
# Copyright (C) 2017-2019 Chen Minqiang <ptpt52@gmail.com>
|
||||
#
|
||||
# This is free software, licensed under the GNU General Public License v3.
|
||||
# See /LICENSE for more information.
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=luci-app-macvlan
|
||||
PKG_VERSION:=1.0.0
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_LICENSE:=GPLv3
|
||||
PKG_LICENSE_FILES:=LICENSE
|
||||
PKG_MAINTAINER:=Chen Minqiang <ptpt52@gmail.com>
|
||||
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/luci-app-macvlan
|
||||
CATEGORY:=X
|
||||
SUBMENU:=Macvlan
|
||||
TITLE:=LuCI Support for macvlan
|
||||
PKGARCH:=all
|
||||
DEPENDS:=+kmod-macvlan +kmod-ipvlan +busybox +@BUSYBOX_CUSTOM +@BUSYBOX_CONFIG_VCONFIG
|
||||
endef
|
||||
|
||||
define Package/luci-app-macvlan/description
|
||||
LuCI Support for macvlan.
|
||||
endef
|
||||
|
||||
define Build/Prepare
|
||||
$(foreach po,$(wildcard ${CURDIR}/files/luci/i18n/*.po), \
|
||||
po2lmo $(po) $(PKG_BUILD_DIR)/$(patsubst %.po,%.lmo,$(notdir $(po)));)
|
||||
endef
|
||||
|
||||
define Build/Configure
|
||||
endef
|
||||
|
||||
define Build/Compile
|
||||
endef
|
||||
|
||||
define Package/luci-app-macvlan/postinst
|
||||
#!/bin/sh
|
||||
if [ -z "$${IPKG_INSTROOT}" ]; then
|
||||
rm -rf /tmp/luci-indexcache /tmp/luci-modulecache
|
||||
fi
|
||||
|
||||
if [ -z "$$IPKG_INSTROOT" ]; then
|
||||
( . /etc/uci-defaults/40_luci-app-macvlan )
|
||||
rm -f /etc/uci-defaults/40_luci-app-macvlan
|
||||
fi
|
||||
|
||||
exit 0
|
||||
endef
|
||||
|
||||
define Package/luci-app-macvlan/conffiles
|
||||
/etc/config/macvlan
|
||||
endef
|
||||
|
||||
define Package/luci-app-macvlan/install
|
||||
$(INSTALL_DIR) $(1)/usr/lib/lua/luci/i18n
|
||||
$(INSTALL_DATA) $(PKG_BUILD_DIR)/macvlan.*.lmo $(1)/usr/lib/lua/luci/i18n/
|
||||
$(INSTALL_DIR) $(1)/usr/lib/lua/luci/controller
|
||||
$(INSTALL_DATA) ./files/luci/controller/*.lua $(1)/usr/lib/lua/luci/controller/
|
||||
$(INSTALL_DIR) $(1)/usr/lib/lua/luci/model/cbi/macvlan
|
||||
$(INSTALL_DATA) ./files/luci/model/cbi/macvlan/*.lua $(1)/usr/lib/lua/luci/model/cbi/macvlan/
|
||||
$(INSTALL_DIR) $(1)/etc/config
|
||||
$(INSTALL_DATA) ./files/root/etc/config/macvlan $(1)/etc/config/macvlan
|
||||
$(INSTALL_DIR) $(1)/etc/init.d
|
||||
$(INSTALL_BIN) ./files/root/etc/init.d/macvlan $(1)/etc/init.d/macvlan
|
||||
$(INSTALL_DIR) $(1)/etc/uci-defaults
|
||||
$(INSTALL_DATA) ./files/root/etc/uci-defaults/40_luci-app-macvlan $(1)/etc/uci-defaults/40_luci-app-macvlan
|
||||
$(INSTALL_DIR) $(1)/usr/share/rpcd/acl.d
|
||||
$(INSTALL_DATA) ./root/usr/share/rpcd/acl.d/*.json $(1)/usr/share/rpcd/acl.d/
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,luci-app-macvlan))
|
@ -1,11 +0,0 @@
|
||||
-- Copyright (C) 2019 X-WRT <dev@x-wrt.com>
|
||||
|
||||
module("luci.controller.macvlan", package.seeall)
|
||||
|
||||
function index()
|
||||
local page
|
||||
|
||||
page = entry({"admin", "network", "macvlan"}, cbi("macvlan/macvlan"), _("Macvlan"))
|
||||
page.leaf = true
|
||||
page.acl_depends = { "luci-app-macvlan" }
|
||||
end
|
@ -1,14 +0,0 @@
|
||||
msgid ""
|
||||
msgstr "Content-Type: text/plain; charset=UTF-8\n"
|
||||
|
||||
msgid "Macvlan"
|
||||
msgstr "Macvlan"
|
||||
|
||||
msgid "Macvlan Settings"
|
||||
msgstr "Macvlan设置"
|
||||
|
||||
msgid "Interface"
|
||||
msgstr "网络接口"
|
||||
|
||||
msgid "Index"
|
||||
msgstr "序号"
|
@ -1,31 +0,0 @@
|
||||
-- Copyright (C) 2019 X-WRT <dev@x-wrt.com>
|
||||
|
||||
m = Map("macvlan", translate("Macvlan"))
|
||||
|
||||
s = m:section(TypedSection, "macvlan", translate("Macvlan Settings"))
|
||||
s.addremove = true
|
||||
s.anonymous = true
|
||||
s.template = "cbi/tblsection"
|
||||
|
||||
o = s:option(Value, "ifname", translate("Interface"))
|
||||
o.datatype = "string"
|
||||
o.rmempty = false
|
||||
|
||||
o = s:option(Value, "index", translate("Index"))
|
||||
o.datatype = "and(uinteger,min(0),max(255))"
|
||||
o.rmempty = false
|
||||
|
||||
o = s:option(ListValue, "type", translate("Type"))
|
||||
o:value("macvlan", translate("macvlan"))
|
||||
o:value("ipvlan", translate("ipvlan"))
|
||||
|
||||
o = s:option(ListValue, "mode", translate("Mode"))
|
||||
o:value("l2", translate("l2"))
|
||||
o:value("l3", translate("l3"))
|
||||
|
||||
o = s:option(ListValue, "flag", translate("Flag"))
|
||||
o:value("bridge", translate("bridge"))
|
||||
o:value("private", translate("private"))
|
||||
o:value("vepa", translate("vepa"))
|
||||
|
||||
return m
|
@ -1,74 +0,0 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
|
||||
START=19
|
||||
|
||||
MC=/tmp/macvlan_cleanup.sh
|
||||
|
||||
stop_macvlan() {
|
||||
local idx=0
|
||||
test -f $MC && {
|
||||
cat $MC | while read line; do
|
||||
echo "$idx#$line"
|
||||
idx=$((idx+1))
|
||||
done | sort -nr | while read line; do
|
||||
cmd=`echo "$line" | cut -d"#" -f2`
|
||||
$cmd
|
||||
done
|
||||
rm -f $MC
|
||||
}
|
||||
}
|
||||
|
||||
add_macvlan() {
|
||||
local cfg="$1"
|
||||
local ifname index type mode flag
|
||||
local mvname
|
||||
|
||||
config_get ifname "$cfg" ifname
|
||||
config_get index "$cfg" index
|
||||
config_get type "$cfg" type
|
||||
config_get mode "$cfg" mode
|
||||
config_get flag "$cfg" flag
|
||||
|
||||
test -n "$ifname" || return 1
|
||||
test -n "$index" || return 1
|
||||
test -n "$type" || return 1
|
||||
|
||||
mvname="${type}${index}${ifname}"
|
||||
|
||||
echo "$ifname" | grep -q "^[a-zA-Z].*\.[0-9]*$" && {
|
||||
ifn=`echo $ifname | cut -d"." -f 1`
|
||||
iid=`echo $ifname | cut -d"." -f 2`
|
||||
test -n "$ifn" && ifconfig $ifn >/dev/null 2>&1 || return 1
|
||||
ifconfig $ifn up 2>/dev/null
|
||||
vconfig set_name_type DEV_PLUS_VID_NO_PAD
|
||||
vconfig add $ifn $iid 2>/dev/null && echo ip link del $ifname >>$MC
|
||||
mvname="${type}${index}${ifn}t${iid}"
|
||||
}
|
||||
|
||||
ifconfig $ifname >/dev/null 2>&1 || return 1
|
||||
|
||||
ifconfig $ifname up 2>/dev/null
|
||||
if [ "${type}" = "macvlan" ]; then
|
||||
ip link add link $ifname $mvname type ${type} 2>/dev/null && echo ip link del $mvname >>$MC
|
||||
elif [ "${type}" = "ipvlan" ]; then
|
||||
case "$mode" in
|
||||
"l2")
|
||||
ip link add link $ifname $mvname type ${type} mode ${mode} ${flag} 2>/dev/null && echo ip link del $mvname >>$MC
|
||||
;;
|
||||
"l3")
|
||||
ip link add link $ifname $mvname type ${type} 2>/dev/null && echo ip link del $mvname >>$MC
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
}
|
||||
|
||||
start() {
|
||||
stop_macvlan
|
||||
echo -n >$MC
|
||||
config_load macvlan
|
||||
config_foreach add_macvlan macvlan
|
||||
}
|
||||
|
||||
stop() {
|
||||
stop_macvlan
|
||||
}
|
@ -1,10 +0,0 @@
|
||||
|
||||
uci -q batch <<-EOF >/dev/null
|
||||
delete ucitrack.@macvlan[-1]
|
||||
add ucitrack macvlan
|
||||
set ucitrack.@macvlan[-1].init=macvlan
|
||||
commit ucitrack
|
||||
EOF
|
||||
|
||||
rm -f /tmp/luci-indexcache
|
||||
exit 0
|
@ -1,11 +0,0 @@
|
||||
{
|
||||
"luci-app-macvlan": {
|
||||
"description": "Grant UCI access for luci-app-macvlan",
|
||||
"read": {
|
||||
"uci": [ "macvlan" ]
|
||||
},
|
||||
"write": {
|
||||
"uci": [ "macvlan" ]
|
||||
}
|
||||
}
|
||||
}
|
@ -1,16 +0,0 @@
|
||||
#
|
||||
# Copyright (C) 2018-2019 Ycarus (Yannick Chabanois) <ycarus@zugaina.org>
|
||||
#
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
LUCI_TITLE:=LuCI Mail Configuration
|
||||
LUCI_DEPENDS:=+msmtp-mta
|
||||
|
||||
PKG_LICENSE:=GPLv3
|
||||
|
||||
#include ../luci/luci.mk
|
||||
include $(TOPDIR)/feeds/luci/luci.mk
|
||||
|
||||
# call BuildPackage - OpenWrt buildroot signature
|
@ -1,6 +0,0 @@
|
||||
module("luci.controller.mail", package.seeall)
|
||||
|
||||
function index()
|
||||
entry({"admin", "services", "mail"}, alias("admin", "services", "mail", "index"), _("Mail settings"))
|
||||
entry({"admin", "services", "mail", "index"}, cbi("mail"))
|
||||
end
|
@ -1,44 +0,0 @@
|
||||
-- Copyright 2018 Ycarus (Yannick Chabanois) <ycarus@zugaina.org>
|
||||
-- Licensed to the public under the Apache License 2.0.
|
||||
|
||||
m = Map("mail", translate("Mail settings"), translate("Set mail settings for services that need to send mails."))
|
||||
|
||||
s = m:section(TypedSection, "smtp", translate("SMTP"))
|
||||
s.anonymous = true
|
||||
s.addremove = false
|
||||
|
||||
server = s:option(Value, "server", translate("Server"))
|
||||
server.datatype = "host"
|
||||
server.placeholder = "smtp.gmail.com"
|
||||
server.optional = false
|
||||
|
||||
port = s:option(Value, "port", translate("Port"))
|
||||
port.datatype = "port"
|
||||
port.optional = false
|
||||
port.rmempty = true
|
||||
port.default = "25"
|
||||
|
||||
tls = s:option(Flag, "tls", translate("TLS"))
|
||||
tls.rmempty = false
|
||||
|
||||
tls_starttls = s:option(Flag, "tls_starttls", translate("STARTTLS"))
|
||||
tls_starttls.rmempty = false
|
||||
|
||||
user = s:option(Value, "user", translate("Username"))
|
||||
user.rmempty = true
|
||||
|
||||
password = s:option(Value, "password", translate("Password"))
|
||||
password.password = true
|
||||
password.rmempty = true
|
||||
|
||||
from = s:option(Value, "from", translate("From"))
|
||||
from.optional = false
|
||||
from.rmempty = true
|
||||
from.placeholder = "myself@gmail.com"
|
||||
|
||||
to = s:option(Value, "to", translate("To"))
|
||||
to.optional = false
|
||||
to.rmempty = true
|
||||
to.placeholder = "myself@gmail.com"
|
||||
|
||||
return m
|
@ -1,64 +0,0 @@
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"PO-Revision-Date: 2020-08-14 08:04+0000\n"
|
||||
"Last-Translator: Andreas Dorfer <adorferen@gmail.com>\n"
|
||||
"Language-Team: German <http://weblate.openmptcprouter.com/projects/omr/"
|
||||
"luciapplicationsmail/de/>\n"
|
||||
"Language: de\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Plural-Forms: nplurals=2; plural=n != 1;\n"
|
||||
"X-Generator: Weblate 4.0.4\n"
|
||||
|
||||
#: luci-app-mail/root/usr/share/luci/menu.d/luci-app-mail.json:3
|
||||
msgid "E-Mail"
|
||||
msgstr ""
|
||||
|
||||
#: luci-app-mail/luasrc/model/cbi/mail.lua:34
|
||||
msgid "From"
|
||||
msgstr "Von"
|
||||
|
||||
#: luci-app-mail/root/usr/share/rpcd/acl.d/luci-app-mail.json:3
|
||||
msgid "Grant UCI access for luci-app-mail"
|
||||
msgstr ""
|
||||
|
||||
#: luci-app-mail/luasrc/controller/mail.lua:4
|
||||
#: luci-app-mail/luasrc/model/cbi/mail.lua:4
|
||||
msgid "Mail settings"
|
||||
msgstr "E-Mail-Einstellungen"
|
||||
|
||||
#: luci-app-mail/luasrc/model/cbi/mail.lua:30
|
||||
msgid "Password"
|
||||
msgstr "Schlüssel"
|
||||
|
||||
#: luci-app-mail/luasrc/model/cbi/mail.lua:15
|
||||
msgid "Port"
|
||||
msgstr "Port"
|
||||
|
||||
#: luci-app-mail/luasrc/model/cbi/mail.lua:6
|
||||
msgid "SMTP"
|
||||
msgstr "SMTP"
|
||||
|
||||
#: luci-app-mail/luasrc/model/cbi/mail.lua:24
|
||||
msgid "STARTTLS"
|
||||
msgstr "StartTLS"
|
||||
|
||||
#: luci-app-mail/luasrc/model/cbi/mail.lua:10
|
||||
msgid "Server"
|
||||
msgstr "Server"
|
||||
|
||||
#: luci-app-mail/luasrc/model/cbi/mail.lua:4
|
||||
msgid "Set mail settings for services that need to send mails."
|
||||
msgstr "Einstellungen für Dienste, die E-Mail versenden können sollen."
|
||||
|
||||
#: luci-app-mail/luasrc/model/cbi/mail.lua:21
|
||||
msgid "TLS"
|
||||
msgstr "TLS"
|
||||
|
||||
#: luci-app-mail/luasrc/model/cbi/mail.lua:39
|
||||
msgid "To"
|
||||
msgstr "An"
|
||||
|
||||
#: luci-app-mail/luasrc/model/cbi/mail.lua:27
|
||||
msgid "Username"
|
||||
msgstr "Benutzername"
|
@ -1,44 +0,0 @@
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"PO-Revision-Date: 2020-08-14 08:04+0000\n"
|
||||
"Last-Translator: Andreas Dorfer <adorferen@gmail.com>\n"
|
||||
"Language-Team: German <http://weblate.openmptcprouter.com/projects/omr/"
|
||||
"luciapplicationsmail/de/>\n"
|
||||
"Language: de\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Plural-Forms: nplurals=2; plural=n != 1;\n"
|
||||
"X-Generator: Weblate 4.0.4\n"
|
||||
|
||||
msgid "From"
|
||||
msgstr "Von"
|
||||
|
||||
msgid "Mail settings"
|
||||
msgstr "E-Mail-Einstellungen"
|
||||
|
||||
msgid "Password"
|
||||
msgstr "Schlüssel"
|
||||
|
||||
msgid "Port"
|
||||
msgstr "Port"
|
||||
|
||||
msgid "SMTP"
|
||||
msgstr "SMTP"
|
||||
|
||||
msgid "STARTTLS"
|
||||
msgstr "StartTLS"
|
||||
|
||||
msgid "Server"
|
||||
msgstr "Server"
|
||||
|
||||
msgid "Set mail settings for services that need to send mails."
|
||||
msgstr "Einstellungen für Dienste, die E-Mail versenden können sollen."
|
||||
|
||||
msgid "TLS"
|
||||
msgstr "TLS"
|
||||
|
||||
msgid "To"
|
||||
msgstr "An"
|
||||
|
||||
msgid "Username"
|
||||
msgstr "Benutzername"
|
@ -1,69 +0,0 @@
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: \n"
|
||||
"POT-Creation-Date: \n"
|
||||
"PO-Revision-Date: 2021-05-31 18:51+0000\n"
|
||||
"Last-Translator: Weblate Admin <contact@openmptcprouter.com>\n"
|
||||
"Language-Team: French <http://weblate.openmptcprouter.com/projects/omr/"
|
||||
"luciapplicationsmail/fr/>\n"
|
||||
"Language: fr\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Plural-Forms: nplurals=2; plural=n > 1;\n"
|
||||
"X-Generator: Weblate 4.6.1\n"
|
||||
|
||||
#: luci-app-mail/root/usr/share/luci/menu.d/luci-app-mail.json:3
|
||||
msgid "E-Mail"
|
||||
msgstr "E-Mail"
|
||||
|
||||
#: luci-app-mail/luasrc/model/cbi/mail.lua:34
|
||||
msgid "From"
|
||||
msgstr "De"
|
||||
|
||||
#: luci-app-mail/root/usr/share/rpcd/acl.d/luci-app-mail.json:3
|
||||
msgid "Grant UCI access for luci-app-mail"
|
||||
msgstr "Accorder l'accès UCI pour luci-app-mail"
|
||||
|
||||
#: luci-app-mail/luasrc/controller/mail.lua:4
|
||||
#: luci-app-mail/luasrc/model/cbi/mail.lua:4
|
||||
msgid "Mail settings"
|
||||
msgstr "Paramètres e-mail"
|
||||
|
||||
#: luci-app-mail/luasrc/model/cbi/mail.lua:30
|
||||
msgid "Password"
|
||||
msgstr "Mot de passe"
|
||||
|
||||
#: luci-app-mail/luasrc/model/cbi/mail.lua:15
|
||||
msgid "Port"
|
||||
msgstr "Port"
|
||||
|
||||
#: luci-app-mail/luasrc/model/cbi/mail.lua:6
|
||||
msgid "SMTP"
|
||||
msgstr "SMTP"
|
||||
|
||||
#: luci-app-mail/luasrc/model/cbi/mail.lua:24
|
||||
msgid "STARTTLS"
|
||||
msgstr "STARTTLS"
|
||||
|
||||
#: luci-app-mail/luasrc/model/cbi/mail.lua:10
|
||||
msgid "Server"
|
||||
msgstr "Serveur"
|
||||
|
||||
#: luci-app-mail/luasrc/model/cbi/mail.lua:4
|
||||
msgid "Set mail settings for services that need to send mails."
|
||||
msgstr ""
|
||||
"Définissez les paramètres de messagerie pour les services qui doivent "
|
||||
"envoyer des e-mails."
|
||||
|
||||
#: luci-app-mail/luasrc/model/cbi/mail.lua:21
|
||||
msgid "TLS"
|
||||
msgstr "TLS"
|
||||
|
||||
#: luci-app-mail/luasrc/model/cbi/mail.lua:39
|
||||
msgid "To"
|
||||
msgstr "À"
|
||||
|
||||
#: luci-app-mail/luasrc/model/cbi/mail.lua:27
|
||||
msgid "Username"
|
||||
msgstr "Nom d'utilisateur"
|
@ -1,49 +0,0 @@
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: \n"
|
||||
"POT-Creation-Date: \n"
|
||||
"PO-Revision-Date: 2020-08-03 12:39+0000\n"
|
||||
"Last-Translator: Weblate Admin <contact@openmptcprouter.com>\n"
|
||||
"Language-Team: French <http://weblate.openmptcprouter.com/projects/omr/"
|
||||
"luciapplicationsmail/fr/>\n"
|
||||
"Language: fr\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Plural-Forms: nplurals=2; plural=n > 1;\n"
|
||||
"X-Generator: Weblate 4.0.4\n"
|
||||
|
||||
msgid "From"
|
||||
msgstr "De"
|
||||
|
||||
msgid "Mail settings"
|
||||
msgstr "Paramètres e-mail"
|
||||
|
||||
msgid "Password"
|
||||
msgstr "Mot de passe"
|
||||
|
||||
msgid "Port"
|
||||
msgstr "Port"
|
||||
|
||||
msgid "SMTP"
|
||||
msgstr "SMTP"
|
||||
|
||||
msgid "STARTTLS"
|
||||
msgstr "STARTTLS"
|
||||
|
||||
msgid "Server"
|
||||
msgstr "Serveur"
|
||||
|
||||
msgid "Set mail settings for services that need to send mails."
|
||||
msgstr ""
|
||||
"Définissez les paramètres de messagerie pour les services qui doivent "
|
||||
"envoyer des e-mails."
|
||||
|
||||
msgid "TLS"
|
||||
msgstr "TLS"
|
||||
|
||||
msgid "To"
|
||||
msgstr "À"
|
||||
|
||||
msgid "Username"
|
||||
msgstr "Nom d'utilisateur"
|
@ -1,64 +0,0 @@
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"PO-Revision-Date: 2020-12-01 10:49+0000\n"
|
||||
"Last-Translator: Giuseppe Dipierro <giuseppe.dipierro@uania.com>\n"
|
||||
"Language-Team: Italian <http://weblate.openmptcprouter.com/projects/omr/"
|
||||
"luciapplicationsmail/it/>\n"
|
||||
"Language: it\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Plural-Forms: nplurals=2; plural=n != 1;\n"
|
||||
"X-Generator: Weblate 4.0.4\n"
|
||||
|
||||
#: luci-app-mail/root/usr/share/luci/menu.d/luci-app-mail.json:3
|
||||
msgid "E-Mail"
|
||||
msgstr ""
|
||||
|
||||
#: luci-app-mail/luasrc/model/cbi/mail.lua:34
|
||||
msgid "From"
|
||||
msgstr "Da"
|
||||
|
||||
#: luci-app-mail/root/usr/share/rpcd/acl.d/luci-app-mail.json:3
|
||||
msgid "Grant UCI access for luci-app-mail"
|
||||
msgstr ""
|
||||
|
||||
#: luci-app-mail/luasrc/controller/mail.lua:4
|
||||
#: luci-app-mail/luasrc/model/cbi/mail.lua:4
|
||||
msgid "Mail settings"
|
||||
msgstr "Configurazione mail"
|
||||
|
||||
#: luci-app-mail/luasrc/model/cbi/mail.lua:30
|
||||
msgid "Password"
|
||||
msgstr "Password"
|
||||
|
||||
#: luci-app-mail/luasrc/model/cbi/mail.lua:15
|
||||
msgid "Port"
|
||||
msgstr "Porta"
|
||||
|
||||
#: luci-app-mail/luasrc/model/cbi/mail.lua:6
|
||||
msgid "SMTP"
|
||||
msgstr "SMTP"
|
||||
|
||||
#: luci-app-mail/luasrc/model/cbi/mail.lua:24
|
||||
msgid "STARTTLS"
|
||||
msgstr "STARTTLS"
|
||||
|
||||
#: luci-app-mail/luasrc/model/cbi/mail.lua:10
|
||||
msgid "Server"
|
||||
msgstr "Server"
|
||||
|
||||
#: luci-app-mail/luasrc/model/cbi/mail.lua:4
|
||||
msgid "Set mail settings for services that need to send mails."
|
||||
msgstr "Configurazione del server mail da utilizzare per inviare alert."
|
||||
|
||||
#: luci-app-mail/luasrc/model/cbi/mail.lua:21
|
||||
msgid "TLS"
|
||||
msgstr "TLS"
|
||||
|
||||
#: luci-app-mail/luasrc/model/cbi/mail.lua:39
|
||||
msgid "To"
|
||||
msgstr "A"
|
||||
|
||||
#: luci-app-mail/luasrc/model/cbi/mail.lua:27
|
||||
msgid "Username"
|
||||
msgstr "Username"
|
@ -1,44 +0,0 @@
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"PO-Revision-Date: 2020-12-01 10:49+0000\n"
|
||||
"Last-Translator: Giuseppe Dipierro <giuseppe.dipierro@uania.com>\n"
|
||||
"Language-Team: Italian <http://weblate.openmptcprouter.com/projects/omr/"
|
||||
"luciapplicationsmail/it/>\n"
|
||||
"Language: it\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Plural-Forms: nplurals=2; plural=n != 1;\n"
|
||||
"X-Generator: Weblate 4.0.4\n"
|
||||
|
||||
msgid "From"
|
||||
msgstr "Da"
|
||||
|
||||
msgid "Mail settings"
|
||||
msgstr "Configurazione mail"
|
||||
|
||||
msgid "Password"
|
||||
msgstr "Password"
|
||||
|
||||
msgid "Port"
|
||||
msgstr "Porta"
|
||||
|
||||
msgid "SMTP"
|
||||
msgstr "SMTP"
|
||||
|
||||
msgid "STARTTLS"
|
||||
msgstr "STARTTLS"
|
||||
|
||||
msgid "Server"
|
||||
msgstr "Server"
|
||||
|
||||
msgid "Set mail settings for services that need to send mails."
|
||||
msgstr "Configurazione del server mail da utilizzare per inviare alert."
|
||||
|
||||
msgid "TLS"
|
||||
msgstr "TLS"
|
||||
|
||||
msgid "To"
|
||||
msgstr "A"
|
||||
|
||||
msgid "Username"
|
||||
msgstr "Username"
|
@ -1,66 +0,0 @@
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"PO-Revision-Date: 2020-08-21 20:21+0000\n"
|
||||
"Last-Translator: Quentin PAGÈS <githubou@quentino.fr>\n"
|
||||
"Language-Team: Occitan <http://weblate.openmptcprouter.com/projects/omr/"
|
||||
"luciapplicationsmail/oc/>\n"
|
||||
"Language: oc\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Plural-Forms: nplurals=2; plural=n > 1;\n"
|
||||
"X-Generator: Weblate 4.0.4\n"
|
||||
|
||||
#: luci-app-mail/root/usr/share/luci/menu.d/luci-app-mail.json:3
|
||||
msgid "E-Mail"
|
||||
msgstr ""
|
||||
|
||||
#: luci-app-mail/luasrc/model/cbi/mail.lua:34
|
||||
msgid "From"
|
||||
msgstr "De"
|
||||
|
||||
#: luci-app-mail/root/usr/share/rpcd/acl.d/luci-app-mail.json:3
|
||||
msgid "Grant UCI access for luci-app-mail"
|
||||
msgstr ""
|
||||
|
||||
#: luci-app-mail/luasrc/controller/mail.lua:4
|
||||
#: luci-app-mail/luasrc/model/cbi/mail.lua:4
|
||||
msgid "Mail settings"
|
||||
msgstr "Paramètres e-mail"
|
||||
|
||||
#: luci-app-mail/luasrc/model/cbi/mail.lua:30
|
||||
msgid "Password"
|
||||
msgstr "Senhal"
|
||||
|
||||
#: luci-app-mail/luasrc/model/cbi/mail.lua:15
|
||||
msgid "Port"
|
||||
msgstr "Pòrt"
|
||||
|
||||
#: luci-app-mail/luasrc/model/cbi/mail.lua:6
|
||||
msgid "SMTP"
|
||||
msgstr "SMTP"
|
||||
|
||||
#: luci-app-mail/luasrc/model/cbi/mail.lua:24
|
||||
msgid "STARTTLS"
|
||||
msgstr "STARTTLS"
|
||||
|
||||
#: luci-app-mail/luasrc/model/cbi/mail.lua:10
|
||||
msgid "Server"
|
||||
msgstr "Servidor"
|
||||
|
||||
#: luci-app-mail/luasrc/model/cbi/mail.lua:4
|
||||
msgid "Set mail settings for services that need to send mails."
|
||||
msgstr ""
|
||||
"Definissètz los paramètres de messatjariá pels servicis que devon enviar d’e-"
|
||||
"mails."
|
||||
|
||||
#: luci-app-mail/luasrc/model/cbi/mail.lua:21
|
||||
msgid "TLS"
|
||||
msgstr "TLS"
|
||||
|
||||
#: luci-app-mail/luasrc/model/cbi/mail.lua:39
|
||||
msgid "To"
|
||||
msgstr "A"
|
||||
|
||||
#: luci-app-mail/luasrc/model/cbi/mail.lua:27
|
||||
msgid "Username"
|
||||
msgstr "Nom d'utilizaire"
|
@ -1,46 +0,0 @@
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"PO-Revision-Date: 2020-08-21 20:21+0000\n"
|
||||
"Last-Translator: Quentin PAGÈS <githubou@quentino.fr>\n"
|
||||
"Language-Team: Occitan <http://weblate.openmptcprouter.com/projects/omr/"
|
||||
"luciapplicationsmail/oc/>\n"
|
||||
"Language: oc\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Plural-Forms: nplurals=2; plural=n > 1;\n"
|
||||
"X-Generator: Weblate 4.0.4\n"
|
||||
|
||||
msgid "From"
|
||||
msgstr "De"
|
||||
|
||||
msgid "Mail settings"
|
||||
msgstr "Paramètres e-mail"
|
||||
|
||||
msgid "Password"
|
||||
msgstr "Senhal"
|
||||
|
||||
msgid "Port"
|
||||
msgstr "Pòrt"
|
||||
|
||||
msgid "SMTP"
|
||||
msgstr "SMTP"
|
||||
|
||||
msgid "STARTTLS"
|
||||
msgstr "STARTTLS"
|
||||
|
||||
msgid "Server"
|
||||
msgstr "Servidor"
|
||||
|
||||
msgid "Set mail settings for services that need to send mails."
|
||||
msgstr ""
|
||||
"Definissètz los paramètres de messatjariá pels servicis que devon enviar d’e-"
|
||||
"mails."
|
||||
|
||||
msgid "TLS"
|
||||
msgstr "TLS"
|
||||
|
||||
msgid "To"
|
||||
msgstr "A"
|
||||
|
||||
msgid "Username"
|
||||
msgstr "Nom d'utilizaire"
|
@ -1,65 +0,0 @@
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"PO-Revision-Date: 2021-05-13 21:38+0000\n"
|
||||
"Last-Translator: Aleksandr Serdyukov <promolife@list.ru>\n"
|
||||
"Language-Team: Russian <http://weblate.openmptcprouter.com/projects/omr/"
|
||||
"luciapplicationsmail/ru/>\n"
|
||||
"Language: ru\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n"
|
||||
"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n"
|
||||
"X-Generator: Weblate 4.6.1\n"
|
||||
|
||||
#: luci-app-mail/root/usr/share/luci/menu.d/luci-app-mail.json:3
|
||||
msgid "E-Mail"
|
||||
msgstr "E-Mail"
|
||||
|
||||
#: luci-app-mail/luasrc/model/cbi/mail.lua:34
|
||||
msgid "From"
|
||||
msgstr "От"
|
||||
|
||||
#: luci-app-mail/root/usr/share/rpcd/acl.d/luci-app-mail.json:3
|
||||
msgid "Grant UCI access for luci-app-mail"
|
||||
msgstr "Полный UCI доступ для luci-app-mail"
|
||||
|
||||
#: luci-app-mail/luasrc/controller/mail.lua:4
|
||||
#: luci-app-mail/luasrc/model/cbi/mail.lua:4
|
||||
msgid "Mail settings"
|
||||
msgstr "Настройки почты"
|
||||
|
||||
#: luci-app-mail/luasrc/model/cbi/mail.lua:30
|
||||
msgid "Password"
|
||||
msgstr "Пароль"
|
||||
|
||||
#: luci-app-mail/luasrc/model/cbi/mail.lua:15
|
||||
msgid "Port"
|
||||
msgstr "Порт"
|
||||
|
||||
#: luci-app-mail/luasrc/model/cbi/mail.lua:6
|
||||
msgid "SMTP"
|
||||
msgstr "SMTP"
|
||||
|
||||
#: luci-app-mail/luasrc/model/cbi/mail.lua:24
|
||||
msgid "STARTTLS"
|
||||
msgstr "STARTTLS"
|
||||
|
||||
#: luci-app-mail/luasrc/model/cbi/mail.lua:10
|
||||
msgid "Server"
|
||||
msgstr "Сервер"
|
||||
|
||||
#: luci-app-mail/luasrc/model/cbi/mail.lua:4
|
||||
msgid "Set mail settings for services that need to send mails."
|
||||
msgstr "Выбор настроек почты для сервисов, которым нужно отправлять почту."
|
||||
|
||||
#: luci-app-mail/luasrc/model/cbi/mail.lua:21
|
||||
msgid "TLS"
|
||||
msgstr "TLS"
|
||||
|
||||
#: luci-app-mail/luasrc/model/cbi/mail.lua:39
|
||||
msgid "To"
|
||||
msgstr "Кому"
|
||||
|
||||
#: luci-app-mail/luasrc/model/cbi/mail.lua:27
|
||||
msgid "Username"
|
||||
msgstr "Имя пользователя"
|
@ -1,55 +0,0 @@
|
||||
msgid ""
|
||||
msgstr "Content-Type: text/plain; charset=UTF-8"
|
||||
|
||||
#: luci-app-mail/root/usr/share/luci/menu.d/luci-app-mail.json:3
|
||||
msgid "E-Mail"
|
||||
msgstr ""
|
||||
|
||||
#: luci-app-mail/luasrc/model/cbi/mail.lua:34
|
||||
msgid "From"
|
||||
msgstr ""
|
||||
|
||||
#: luci-app-mail/root/usr/share/rpcd/acl.d/luci-app-mail.json:3
|
||||
msgid "Grant UCI access for luci-app-mail"
|
||||
msgstr ""
|
||||
|
||||
#: luci-app-mail/luasrc/controller/mail.lua:4
|
||||
#: luci-app-mail/luasrc/model/cbi/mail.lua:4
|
||||
msgid "Mail settings"
|
||||
msgstr ""
|
||||
|
||||
#: luci-app-mail/luasrc/model/cbi/mail.lua:30
|
||||
msgid "Password"
|
||||
msgstr ""
|
||||
|
||||
#: luci-app-mail/luasrc/model/cbi/mail.lua:15
|
||||
msgid "Port"
|
||||
msgstr ""
|
||||
|
||||
#: luci-app-mail/luasrc/model/cbi/mail.lua:6
|
||||
msgid "SMTP"
|
||||
msgstr ""
|
||||
|
||||
#: luci-app-mail/luasrc/model/cbi/mail.lua:24
|
||||
msgid "STARTTLS"
|
||||
msgstr ""
|
||||
|
||||
#: luci-app-mail/luasrc/model/cbi/mail.lua:10
|
||||
msgid "Server"
|
||||
msgstr ""
|
||||
|
||||
#: luci-app-mail/luasrc/model/cbi/mail.lua:4
|
||||
msgid "Set mail settings for services that need to send mails."
|
||||
msgstr ""
|
||||
|
||||
#: luci-app-mail/luasrc/model/cbi/mail.lua:21
|
||||
msgid "TLS"
|
||||
msgstr ""
|
||||
|
||||
#: luci-app-mail/luasrc/model/cbi/mail.lua:39
|
||||
msgid "To"
|
||||
msgstr ""
|
||||
|
||||
#: luci-app-mail/luasrc/model/cbi/mail.lua:27
|
||||
msgid "Username"
|
||||
msgstr ""
|
@ -1 +0,0 @@
|
||||
zh_Hans
|
@ -1,64 +0,0 @@
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"PO-Revision-Date: 2021-05-13 21:38+0000\n"
|
||||
"Last-Translator: justbin <419989953@qq.com>\n"
|
||||
"Language-Team: Chinese (Simplified) <http://weblate.openmptcprouter.com/"
|
||||
"projects/omr/luciapplicationsmail/zh_Hans/>\n"
|
||||
"Language: zh_Hans\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Plural-Forms: nplurals=1; plural=0;\n"
|
||||
"X-Generator: Weblate 4.6.1\n"
|
||||
|
||||
#: luci-app-mail/root/usr/share/luci/menu.d/luci-app-mail.json:3
|
||||
msgid "E-Mail"
|
||||
msgstr "电子邮件"
|
||||
|
||||
#: luci-app-mail/luasrc/model/cbi/mail.lua:34
|
||||
msgid "From"
|
||||
msgstr "来自"
|
||||
|
||||
#: luci-app-mail/root/usr/share/rpcd/acl.d/luci-app-mail.json:3
|
||||
msgid "Grant UCI access for luci-app-mail"
|
||||
msgstr "授予luci-app-iperf UCI访问权限"
|
||||
|
||||
#: luci-app-mail/luasrc/controller/mail.lua:4
|
||||
#: luci-app-mail/luasrc/model/cbi/mail.lua:4
|
||||
msgid "Mail settings"
|
||||
msgstr "邮件设置"
|
||||
|
||||
#: luci-app-mail/luasrc/model/cbi/mail.lua:30
|
||||
msgid "Password"
|
||||
msgstr "密码"
|
||||
|
||||
#: luci-app-mail/luasrc/model/cbi/mail.lua:15
|
||||
msgid "Port"
|
||||
msgstr "端口"
|
||||
|
||||
#: luci-app-mail/luasrc/model/cbi/mail.lua:6
|
||||
msgid "SMTP"
|
||||
msgstr "SMTP设置"
|
||||
|
||||
#: luci-app-mail/luasrc/model/cbi/mail.lua:24
|
||||
msgid "STARTTLS"
|
||||
msgstr "STARTTLS设置"
|
||||
|
||||
#: luci-app-mail/luasrc/model/cbi/mail.lua:10
|
||||
msgid "Server"
|
||||
msgstr "服务器"
|
||||
|
||||
#: luci-app-mail/luasrc/model/cbi/mail.lua:4
|
||||
msgid "Set mail settings for services that need to send mails."
|
||||
msgstr "为需要发送邮件的服务设置邮件设置."
|
||||
|
||||
#: luci-app-mail/luasrc/model/cbi/mail.lua:21
|
||||
msgid "TLS"
|
||||
msgstr "证书"
|
||||
|
||||
#: luci-app-mail/luasrc/model/cbi/mail.lua:39
|
||||
msgid "To"
|
||||
msgstr "发送到"
|
||||
|
||||
#: luci-app-mail/luasrc/model/cbi/mail.lua:27
|
||||
msgid "Username"
|
||||
msgstr "账号"
|
@ -1,44 +0,0 @@
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"PO-Revision-Date: 2020-12-04 16:02+0000\n"
|
||||
"Last-Translator: antrouter <xinyangla@188.com>\n"
|
||||
"Language-Team: Chinese (Simplified) <http://weblate.openmptcprouter.com/"
|
||||
"projects/omr/luciapplicationsmail/zh_Hans/>\n"
|
||||
"Language: zh_Hans\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Plural-Forms: nplurals=1; plural=0;\n"
|
||||
"X-Generator: Weblate 4.0.4\n"
|
||||
|
||||
msgid "From"
|
||||
msgstr "来自"
|
||||
|
||||
msgid "Mail settings"
|
||||
msgstr "邮件设置"
|
||||
|
||||
msgid "Password"
|
||||
msgstr "密码"
|
||||
|
||||
msgid "Port"
|
||||
msgstr "端口"
|
||||
|
||||
msgid "SMTP"
|
||||
msgstr "SMTP设置"
|
||||
|
||||
msgid "STARTTLS"
|
||||
msgstr "STARTTLS设置"
|
||||
|
||||
msgid "Server"
|
||||
msgstr "服务器"
|
||||
|
||||
msgid "Set mail settings for services that need to send mails."
|
||||
msgstr "为需要发送邮件的服务设置邮件设置."
|
||||
|
||||
msgid "TLS"
|
||||
msgstr "证书"
|
||||
|
||||
msgid "To"
|
||||
msgstr "发送到"
|
||||
|
||||
msgid "Username"
|
||||
msgstr "账号"
|
@ -1 +0,0 @@
|
||||
config smtp 'default'
|
@ -1,64 +0,0 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
# Copyright (C) 2018 Ycarus (Yannick Chabanois) <ycarus@zugaina.org>
|
||||
|
||||
START=90
|
||||
STOP=10
|
||||
|
||||
USE_PROCD=1
|
||||
|
||||
validate_section() {
|
||||
uci_validate_section mail smtp "${1}" \
|
||||
'server:host' \
|
||||
'tls:bool:0' \
|
||||
'tls_starttls:bool:0' \
|
||||
'from:string' \
|
||||
'user:string' \
|
||||
'password:string' \
|
||||
'port:port:25'
|
||||
}
|
||||
|
||||
config_account() {
|
||||
local server tls tls_starttls from user password
|
||||
|
||||
validate_section "${1}" || {
|
||||
_err "validation failed"
|
||||
return 1
|
||||
}
|
||||
|
||||
cat > /tmp/msmtp.tmp <<-EOF
|
||||
account default
|
||||
host $server
|
||||
port $port
|
||||
EOF
|
||||
[ -n "$user" ] && [ -n "$password" ] && {
|
||||
cat >> /tmp/msmtp.tmp <<-EOF
|
||||
auth on
|
||||
user $user
|
||||
password $password
|
||||
EOF
|
||||
}
|
||||
[ -n "$from" ] && echo "from $from" >> /tmp/msmtp.tmp
|
||||
[ "$tls" = "1" ] && {
|
||||
cat >> /tmp/msmtp.tmp <<-EOF
|
||||
tls_trust_file /etc/ssl/certs/ca-certificates.crt
|
||||
tls on
|
||||
EOF
|
||||
} || {
|
||||
echo 'tls off' >> /tmp/msmtp.tmp
|
||||
}
|
||||
[ "$tls_starttls" = "1" ] && {
|
||||
echo 'tls_starttls on' >> /tmp/msmtp.tmp
|
||||
} || {
|
||||
echo 'tls_starttls off' >> /tmp/msmtp.tmp
|
||||
}
|
||||
}
|
||||
|
||||
start_service() {
|
||||
config_load mail
|
||||
config_foreach config_account smtp
|
||||
[ -f "/tmp/msmtp.tmp" ] && mv /tmp/msmtp.tmp /etc/msmtprc
|
||||
}
|
||||
|
||||
service_triggers() {
|
||||
procd_add_reload_trigger mail
|
||||
}
|
@ -1,8 +0,0 @@
|
||||
#!/bin/sh
|
||||
uci -q batch <<-EOF >/dev/null
|
||||
delete ucitrack.@mail[-1]
|
||||
add ucitrack mail
|
||||
set ucitrack.@mail[-1].init=mail
|
||||
commit ucitrack
|
||||
EOF
|
||||
exit 0
|
@ -1,13 +0,0 @@
|
||||
{
|
||||
"admin/services/mail": {
|
||||
"title": "E-Mail",
|
||||
"order": 90,
|
||||
"action": {
|
||||
"type": "cbi",
|
||||
"path": "mail"
|
||||
},
|
||||
"depends": {
|
||||
"acl": [ "luci-app-mail" ]
|
||||
}
|
||||
}
|
||||
}
|
@ -1,11 +0,0 @@
|
||||
{
|
||||
"luci-app-mail": {
|
||||
"description": "Grant UCI access for luci-app-mail",
|
||||
"read": {
|
||||
"uci": [ "mail" ]
|
||||
},
|
||||
"write": {
|
||||
"uci": [ "mail" ]
|
||||
}
|
||||
}
|
||||
}
|
@ -1,14 +0,0 @@
|
||||
# Copyright 2020 Wojciech Jowsa (wojciech.jowsa@gmail.com)
|
||||
# This is free software, licensed under the Apache License, Version 2.0
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
LUCI_TITLE:=Packet capture application
|
||||
LUCI_DEPENDS:=+luci-mod-admin-full +tcpdump +coreutils +coreutils-timeout
|
||||
|
||||
PKG_MAINTAINER:=Wojciech Jowsa <wojciech.jowsa@gmail.com>
|
||||
PKG_LICENSE:=Apache-2.0
|
||||
|
||||
include $(TOPDIR)/feeds/luci/luci.mk
|
||||
|
||||
# call BuildPackage - OpenWrt buildroot signatureet
|
@ -1,287 +0,0 @@
|
||||
'use strict';
|
||||
'require rpc';
|
||||
'require uci';
|
||||
'require ui';
|
||||
'require fs';
|
||||
'require form';
|
||||
'require network';
|
||||
'require tools.widgets as widgets';
|
||||
|
||||
var eventSource,
|
||||
captureFilePoll,
|
||||
hostName;
|
||||
|
||||
function stopTcpdump() {
|
||||
fs.exec("/usr/libexec/packet_capture_stop").then(function(replay) {
|
||||
if (eventSource)
|
||||
eventSource.close();
|
||||
}.bind(this)).catch(function(error) {
|
||||
console.log(error);
|
||||
});
|
||||
}
|
||||
|
||||
window.addEventListener('beforeunload', stopTcpdump);
|
||||
|
||||
var callLuciProcessList = rpc.declare({
|
||||
object: 'luci',
|
||||
method: 'getProcessList',
|
||||
expect: { result: [] }
|
||||
});
|
||||
|
||||
var callInitAction = rpc.declare({
|
||||
object: 'luci',
|
||||
method: 'setInitAction',
|
||||
params: [ 'name', 'action' ],
|
||||
expect: { result: false }
|
||||
});
|
||||
|
||||
function addOutput() {
|
||||
var tcpdumpOut = document.querySelectorAll('[id$="tcpdump_out"]')[0];
|
||||
if (tcpdumpOut)
|
||||
return;
|
||||
|
||||
var frameEl = E('div', {'class': 'cbi-value'});
|
||||
|
||||
frameEl.appendChild(E('textarea', {
|
||||
'id': 'tcpdump_out',
|
||||
'class': 'cbi-input-textarea',
|
||||
'readonly': '',
|
||||
'style': 'width:100%',
|
||||
'rows': 30,
|
||||
}));
|
||||
|
||||
frameEl.firstElementChild.style.fontFamily = 'monospace';
|
||||
|
||||
var downloadBtn = document.querySelectorAll('[id$="download_file"]')[0];
|
||||
if (downloadBtn)
|
||||
downloadBtn.parentNode.insertBefore(frameEl, downloadBtn.nextSibling);
|
||||
}
|
||||
|
||||
var downloadCaptureFile = function(ev) {
|
||||
var form = E('form', {
|
||||
method: 'post',
|
||||
action: '/cgi-bin/cgi-download',
|
||||
enctype: 'application/x-www-form-urlencoded'
|
||||
}, E('input', { type: 'hidden', name: 'sessionid', value: rpc.getSessionID()},
|
||||
E('input', { type: 'hidden', name: 'path', value: "/tmp/capture.pcap"},
|
||||
E('input', { type: 'hidden', name: 'filename', value: hostName + "-" + Date.now() + ".pcap"},
|
||||
E('input', { type: 'hidden', name: 'mimetype', value: 'application/vnd.tcpdump.pcap'}
|
||||
)))));
|
||||
|
||||
ev.currentTarget.parentNode.appendChild(form);
|
||||
form.submit();
|
||||
form.parentNode.removeChild(form);
|
||||
}
|
||||
|
||||
function subscribeTcpdump() {
|
||||
if (eventSource)
|
||||
eventSource.close();
|
||||
|
||||
eventSource = new EventSource('/ubus/subscribe/tcpdump' + '?' + rpc.getSessionID());
|
||||
eventSource.onerror = function(event) {
|
||||
eventSource.close();
|
||||
console.log(event);
|
||||
};
|
||||
|
||||
addOutput();
|
||||
var textOut = document.querySelectorAll('[id$="tcpdump_out"]')[0];
|
||||
textOut.value = "";
|
||||
eventSource.addEventListener("tcpdump.data", function(event) {
|
||||
textOut.value = textOut.value + "\n" + JSON.parse(event.data).data;
|
||||
});
|
||||
}
|
||||
|
||||
function updateButtons() {
|
||||
var tasks = [];
|
||||
tasks.push(fs.stat("/var/run/packet_capture.pid").then(L.bind(function(res) {
|
||||
var downloadBtn = document.querySelectorAll('[id$="download_file"]')[0];
|
||||
if (!downloadBtn)
|
||||
return;
|
||||
if (!eventSource || eventSource.readyState == 2)
|
||||
subscribeTcpdump();
|
||||
var textOut = document.querySelectorAll('[id$="tcpdump_out"]')[0];
|
||||
if (textOut)
|
||||
textOut.style.borderColor = "green";
|
||||
var startBtn = document.querySelectorAll('[id$="start_tcpdump"]')[0];
|
||||
if (startBtn)
|
||||
startBtn.hidden = true;
|
||||
var stopBtn = document.querySelectorAll('[id$="stop_tcpdump"]')[0];
|
||||
if (stopBtn)
|
||||
stopBtn.hidden = false;
|
||||
return;
|
||||
})).catch(function(error) {
|
||||
var textOut = document.querySelectorAll('[id$="tcpdump_out"]')[0];
|
||||
if (textOut)
|
||||
textOut.style.borderColor = "red";
|
||||
var startBtn = document.querySelectorAll('[id$="start_tcpdump"]')[0];
|
||||
if (startBtn)
|
||||
startBtn.hidden = false;
|
||||
var stopBtn = document.querySelectorAll('[id$="stop_tcpdump"]')[0];
|
||||
if (stopBtn)
|
||||
stopBtn.hidden = true;
|
||||
if (eventSource)
|
||||
eventSource.close();
|
||||
}));
|
||||
|
||||
return Promise.all(tasks);
|
||||
}
|
||||
|
||||
function updatePollCheckCaptureFileExists() {
|
||||
checkCaptureFileExists();
|
||||
L.Poll.remove(captureFilePoll);
|
||||
L.Poll.add(L.bind(checkCaptureFileExists, m),5);
|
||||
}
|
||||
|
||||
function checkCaptureFileExists() {
|
||||
var tasks = [];
|
||||
tasks.push(fs.stat("/tmp/capture.pcap").then(L.bind(function(res) {
|
||||
var downloadBtn = document.querySelector('[data-action="download"]');
|
||||
if (!downloadBtn)
|
||||
return;
|
||||
var downloadCheckBox = document.querySelectorAll('[data-widget-id$="file"]')[0].checked;
|
||||
if (!downloadCheckBox) {
|
||||
fs.remove("/tmp/capture.pcap").then(function(replay) {
|
||||
downloadBtn.disabled = true;;
|
||||
}.bind(this)).catch(function(error) {
|
||||
console.log(error);
|
||||
});
|
||||
} else {
|
||||
downloadBtn.disabled = false;
|
||||
}
|
||||
})).catch(function(error) {
|
||||
var downloadBtn = document.querySelector('[data-action="download"]');
|
||||
if (downloadBtn)
|
||||
downloadBtn.disabled = true;
|
||||
}));
|
||||
|
||||
return Promise.all(tasks);
|
||||
}
|
||||
|
||||
return L.view.extend({
|
||||
|
||||
load: function() {
|
||||
return Promise.all([
|
||||
uci.load('system')
|
||||
]);
|
||||
},
|
||||
|
||||
handleDownload: function(ev) {
|
||||
downloadCaptureFile(ev);
|
||||
},
|
||||
|
||||
render: function(processes) {
|
||||
var m, s, o;
|
||||
|
||||
hostName = uci.get('system', '@system[0]', 'hostname');
|
||||
|
||||
m = new form.Map('packet_capture', _('Packet Capture - Tcpdump'), _('Capture packets with tcpdump.'));
|
||||
s = m.section(form.TypedSection, 'tcpdump');
|
||||
s.anonymous = 1;
|
||||
|
||||
o = s.option(widgets.DeviceSelect, 'interface', _('Interface'), _(''));
|
||||
o.noaliases = true;
|
||||
o.modalonly = true;
|
||||
o.rmempty = false;
|
||||
o.filter = function(section_id, value) {
|
||||
return true;
|
||||
}
|
||||
|
||||
o = s.option(form.Value, 'filter', _('Filter'), _('Tcpdump filter like protocol, port etc.'));
|
||||
o.modalonly = false;
|
||||
o.datatype = 'and(minlength(1),maxlength(1024))';
|
||||
|
||||
o = s.option(form.Value, 'duration', _('Duration'), _('Duration of packet capturing in seconds.'));
|
||||
o.modalonly = false;
|
||||
o.datatype = 'range(1,4294967296)';
|
||||
|
||||
o = s.option(form.Value, 'packets', _('Packets'), _('Number of packets to be captured.'));
|
||||
o.modalonly = false;
|
||||
o.datatype = 'range(1,4294967296)';
|
||||
|
||||
o = s.option(form.Flag, 'domains', _('Resolve domains'), _("Convert host addresses to names."));
|
||||
|
||||
o = s.option(form.Flag, 'verbose', _('Verbose output'), _("Print the link-level header on each dump line."));
|
||||
|
||||
o = s.option(form.Flag, 'file', _('Save to file'), _("Save capture to pcap file."));
|
||||
|
||||
o = s.option(form.Button, 'start_tcpdump', _('Start tcpdump'), _(''));
|
||||
o.inputstyle = 'apply';
|
||||
o.onclick = ui.createHandlerFn(this, function(section_id, ev) {
|
||||
var downloadBtn = document.querySelector('[data-action="download"]');
|
||||
if (!downloadBtn)
|
||||
return;
|
||||
fs.remove("/tmp/capture.pcap").then(function(replay) {
|
||||
downloadBtn.disabled = true;;
|
||||
}.bind(this)).catch(function(error) {
|
||||
console.log(error);
|
||||
});
|
||||
|
||||
var iface = document.querySelectorAll('[id$="interface"]')[1].value,
|
||||
filter = document.querySelectorAll('[id$="filter"]')[2].value,
|
||||
packets = document.querySelectorAll('[id$="packets"]')[2].value,
|
||||
duration = document.querySelectorAll('[id$="duration"]')[2].value,
|
||||
verbose = document.querySelectorAll('[data-widget-id$="verbose"]')[0].checked,
|
||||
domains = document.querySelectorAll('[data-widget-id$="domains"]')[0].checked,
|
||||
file = document.querySelectorAll('[data-widget-id$="file"]')[0].checked
|
||||
|
||||
var args = {
|
||||
"interface": iface,
|
||||
"filter": filter,
|
||||
"packets": packets,
|
||||
"duration": duration,
|
||||
"verbose": verbose,
|
||||
"domains": domains,
|
||||
"file": file
|
||||
}
|
||||
|
||||
return fs.exec_direct('/usr/libexec/packet_capture_start', [JSON.stringify(args)]).then(function(replay) {
|
||||
var error_position = replay.search("error:");
|
||||
if (error_position != -1){
|
||||
ui.showModal(_(replay.substring(error_position + 6, replay.length)), [
|
||||
E('div', { 'class': 'right' }, [
|
||||
E('button', {
|
||||
'class': 'cbi-button cbi-button-negative important',
|
||||
'click': function(ev) {
|
||||
ui.hideModal();
|
||||
}
|
||||
}, _('Close')),
|
||||
])
|
||||
]);
|
||||
return;
|
||||
}
|
||||
rpc.list.apply(rpc).then(function(res) {
|
||||
for (var k in res) {
|
||||
if (res[k] == "tcpdump" )
|
||||
subscribeTcpdump()
|
||||
}
|
||||
}.bind(this));
|
||||
}.bind(this)).catch(function(error) {
|
||||
console.log(error);
|
||||
});
|
||||
});
|
||||
|
||||
o = s.option(form.Button, 'stop_tcpdump', _('Stop tcpdump'), _(''));
|
||||
o.inputstyle = 'apply';
|
||||
o.onclick = ui.createHandlerFn(this, function(section_id, ev) {
|
||||
if (!eventSource)
|
||||
return;
|
||||
return fs.exec("/usr/libexec/packet_capture_stop").then(function(replay) {
|
||||
eventSource.close();
|
||||
}.bind(this)).catch(function(error) {
|
||||
console.log(error);
|
||||
});
|
||||
});
|
||||
|
||||
o = s.option(form.Button, 'download_file', _('Download capture file'));
|
||||
o.inputstyle = 'action important';
|
||||
o.inputtitle = _('Download');
|
||||
o.data_action = 'download'
|
||||
o.onclick = this.handleDownload;
|
||||
|
||||
L.Poll.add(L.bind(updateButtons, m),1);
|
||||
captureFilePoll = L.bind(updatePollCheckCaptureFileExists, m);
|
||||
L.Poll.add(captureFilePoll,1);
|
||||
|
||||
return m.render();
|
||||
},
|
||||
});
|
@ -1,99 +0,0 @@
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"PO-Revision-Date: 2021-03-31 15:07+0000\n"
|
||||
"Last-Translator: Weblate Admin <contact@openmptcprouter.com>\n"
|
||||
"Language-Team: French <http://weblate.openmptcprouter.com/projects/omr/"
|
||||
"luciapplicationspacket-capture/fr/>\n"
|
||||
"Language: fr\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Plural-Forms: nplurals=2; plural=n > 1;\n"
|
||||
"X-Generator: Weblate 4.5.2\n"
|
||||
|
||||
#: luci-app-packet-capture/htdocs/luci-static/resources/view/packet_capture/tcpdump.js:177
|
||||
msgid "Capture packets with tcpdump."
|
||||
msgstr "Capturez des paquets avec tcpdump."
|
||||
|
||||
#: luci-app-packet-capture/htdocs/luci-static/resources/view/packet_capture/tcpdump.js:247
|
||||
msgid "Close"
|
||||
msgstr "Fermer"
|
||||
|
||||
#: luci-app-packet-capture/htdocs/luci-static/resources/view/packet_capture/tcpdump.js:201
|
||||
msgid "Convert host addresses to names."
|
||||
msgstr "Convertissez les adresses d'hôte en noms."
|
||||
|
||||
#: luci-app-packet-capture/htdocs/luci-static/resources/view/packet_capture/tcpdump.js:277
|
||||
msgid "Download"
|
||||
msgstr "Téléchargement"
|
||||
|
||||
#: luci-app-packet-capture/htdocs/luci-static/resources/view/packet_capture/tcpdump.js:275
|
||||
msgid "Download capture file"
|
||||
msgstr "Télécharger le fichier de capture"
|
||||
|
||||
#: luci-app-packet-capture/htdocs/luci-static/resources/view/packet_capture/tcpdump.js:193
|
||||
msgid "Duration"
|
||||
msgstr "Durée"
|
||||
|
||||
#: luci-app-packet-capture/htdocs/luci-static/resources/view/packet_capture/tcpdump.js:193
|
||||
msgid "Duration of packet capturing in seconds."
|
||||
msgstr "Durée de la capture des paquets en secondes."
|
||||
|
||||
#: luci-app-packet-capture/htdocs/luci-static/resources/view/packet_capture/tcpdump.js:189
|
||||
msgid "Filter"
|
||||
msgstr "Filtre"
|
||||
|
||||
#: luci-app-packet-capture/root/usr/share/rpcd/acl.d/luci-app-packet-capture.json:3
|
||||
msgid "Grant access to tcpdump ubus object"
|
||||
msgstr "Accorder l'accès à l'objet ubus tcpdump"
|
||||
|
||||
#: luci-app-packet-capture/htdocs/luci-static/resources/view/packet_capture/tcpdump.js:181
|
||||
msgid "Interface"
|
||||
msgstr "Interface"
|
||||
|
||||
#: luci-app-packet-capture/htdocs/luci-static/resources/view/packet_capture/tcpdump.js:197
|
||||
msgid "Number of packets to be captured."
|
||||
msgstr "Nombre de paquets à capturer."
|
||||
|
||||
#: luci-app-packet-capture/root/usr/share/luci/menu.d/luci-app-packet-capture.json:3
|
||||
msgid "Packet Capture"
|
||||
msgstr "Capture de paquets"
|
||||
|
||||
#: luci-app-packet-capture/htdocs/luci-static/resources/view/packet_capture/tcpdump.js:177
|
||||
msgid "Packet Capture - Tcpdump"
|
||||
msgstr "Capture de paquets - Tcpdump"
|
||||
|
||||
#: luci-app-packet-capture/htdocs/luci-static/resources/view/packet_capture/tcpdump.js:197
|
||||
msgid "Packets"
|
||||
msgstr "Paquets"
|
||||
|
||||
#: luci-app-packet-capture/htdocs/luci-static/resources/view/packet_capture/tcpdump.js:203
|
||||
msgid "Print the link-level header on each dump line."
|
||||
msgstr "Imprimez l'en-tête du lien sur chaque ligne de capture."
|
||||
|
||||
#: luci-app-packet-capture/htdocs/luci-static/resources/view/packet_capture/tcpdump.js:201
|
||||
msgid "Resolve domains"
|
||||
msgstr "Résoudre les domaines"
|
||||
|
||||
#: luci-app-packet-capture/htdocs/luci-static/resources/view/packet_capture/tcpdump.js:205
|
||||
msgid "Save capture to pcap file."
|
||||
msgstr "Enregistrez la capture dans le fichier pcap."
|
||||
|
||||
#: luci-app-packet-capture/htdocs/luci-static/resources/view/packet_capture/tcpdump.js:205
|
||||
msgid "Save to file"
|
||||
msgstr "Enregistrer dans un fichier"
|
||||
|
||||
#: luci-app-packet-capture/htdocs/luci-static/resources/view/packet_capture/tcpdump.js:207
|
||||
msgid "Start tcpdump"
|
||||
msgstr "Démarrez tcpdump"
|
||||
|
||||
#: luci-app-packet-capture/htdocs/luci-static/resources/view/packet_capture/tcpdump.js:263
|
||||
msgid "Stop tcpdump"
|
||||
msgstr "Arrêter tcpdump"
|
||||
|
||||
#: luci-app-packet-capture/htdocs/luci-static/resources/view/packet_capture/tcpdump.js:189
|
||||
msgid "Tcpdump filter like protocol, port etc."
|
||||
msgstr "Filtre pour tcpdump comme le protocole, le port, etc."
|
||||
|
||||
#: luci-app-packet-capture/htdocs/luci-static/resources/view/packet_capture/tcpdump.js:203
|
||||
msgid "Verbose output"
|
||||
msgstr "Sortie verbeuse"
|
@ -1,90 +0,0 @@
|
||||
msgid ""
|
||||
msgstr "Content-Type: text/plain; charset=UTF-8"
|
||||
|
||||
#: luci-app-packet-capture/htdocs/luci-static/resources/view/packet_capture/tcpdump.js:177
|
||||
msgid "Capture packets with tcpdump."
|
||||
msgstr ""
|
||||
|
||||
#: luci-app-packet-capture/htdocs/luci-static/resources/view/packet_capture/tcpdump.js:247
|
||||
msgid "Close"
|
||||
msgstr ""
|
||||
|
||||
#: luci-app-packet-capture/htdocs/luci-static/resources/view/packet_capture/tcpdump.js:201
|
||||
msgid "Convert host addresses to names."
|
||||
msgstr ""
|
||||
|
||||
#: luci-app-packet-capture/htdocs/luci-static/resources/view/packet_capture/tcpdump.js:277
|
||||
msgid "Download"
|
||||
msgstr ""
|
||||
|
||||
#: luci-app-packet-capture/htdocs/luci-static/resources/view/packet_capture/tcpdump.js:275
|
||||
msgid "Download capture file"
|
||||
msgstr ""
|
||||
|
||||
#: luci-app-packet-capture/htdocs/luci-static/resources/view/packet_capture/tcpdump.js:193
|
||||
msgid "Duration"
|
||||
msgstr ""
|
||||
|
||||
#: luci-app-packet-capture/htdocs/luci-static/resources/view/packet_capture/tcpdump.js:193
|
||||
msgid "Duration of packet capturing in seconds."
|
||||
msgstr ""
|
||||
|
||||
#: luci-app-packet-capture/htdocs/luci-static/resources/view/packet_capture/tcpdump.js:189
|
||||
msgid "Filter"
|
||||
msgstr ""
|
||||
|
||||
#: luci-app-packet-capture/root/usr/share/rpcd/acl.d/luci-app-packet-capture.json:3
|
||||
msgid "Grant access to tcpdump ubus object"
|
||||
msgstr ""
|
||||
|
||||
#: luci-app-packet-capture/htdocs/luci-static/resources/view/packet_capture/tcpdump.js:181
|
||||
msgid "Interface"
|
||||
msgstr ""
|
||||
|
||||
#: luci-app-packet-capture/htdocs/luci-static/resources/view/packet_capture/tcpdump.js:197
|
||||
msgid "Number of packets to be captured."
|
||||
msgstr ""
|
||||
|
||||
#: luci-app-packet-capture/root/usr/share/luci/menu.d/luci-app-packet-capture.json:3
|
||||
msgid "Packet Capture"
|
||||
msgstr ""
|
||||
|
||||
#: luci-app-packet-capture/htdocs/luci-static/resources/view/packet_capture/tcpdump.js:177
|
||||
msgid "Packet Capture - Tcpdump"
|
||||
msgstr ""
|
||||
|
||||
#: luci-app-packet-capture/htdocs/luci-static/resources/view/packet_capture/tcpdump.js:197
|
||||
msgid "Packets"
|
||||
msgstr ""
|
||||
|
||||
#: luci-app-packet-capture/htdocs/luci-static/resources/view/packet_capture/tcpdump.js:203
|
||||
msgid "Print the link-level header on each dump line."
|
||||
msgstr ""
|
||||
|
||||
#: luci-app-packet-capture/htdocs/luci-static/resources/view/packet_capture/tcpdump.js:201
|
||||
msgid "Resolve domains"
|
||||
msgstr ""
|
||||
|
||||
#: luci-app-packet-capture/htdocs/luci-static/resources/view/packet_capture/tcpdump.js:205
|
||||
msgid "Save capture to pcap file."
|
||||
msgstr ""
|
||||
|
||||
#: luci-app-packet-capture/htdocs/luci-static/resources/view/packet_capture/tcpdump.js:205
|
||||
msgid "Save to file"
|
||||
msgstr ""
|
||||
|
||||
#: luci-app-packet-capture/htdocs/luci-static/resources/view/packet_capture/tcpdump.js:207
|
||||
msgid "Start tcpdump"
|
||||
msgstr ""
|
||||
|
||||
#: luci-app-packet-capture/htdocs/luci-static/resources/view/packet_capture/tcpdump.js:263
|
||||
msgid "Stop tcpdump"
|
||||
msgstr ""
|
||||
|
||||
#: luci-app-packet-capture/htdocs/luci-static/resources/view/packet_capture/tcpdump.js:189
|
||||
msgid "Tcpdump filter like protocol, port etc."
|
||||
msgstr ""
|
||||
|
||||
#: luci-app-packet-capture/htdocs/luci-static/resources/view/packet_capture/tcpdump.js:203
|
||||
msgid "Verbose output"
|
||||
msgstr ""
|
@ -1 +0,0 @@
|
||||
zh_Hans
|
@ -1,99 +0,0 @@
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"PO-Revision-Date: 2021-04-30 16:03+0000\n"
|
||||
"Last-Translator: niergouge <1150108426@qq.com>\n"
|
||||
"Language-Team: Chinese (Simplified) <http://weblate.openmptcprouter.com/"
|
||||
"projects/omr/luciapplicationspacket-capture/zh_Hans/>\n"
|
||||
"Language: zh_Hans\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Plural-Forms: nplurals=1; plural=0;\n"
|
||||
"X-Generator: Weblate 4.5.2\n"
|
||||
|
||||
#: luci-app-packet-capture/htdocs/luci-static/resources/view/packet_capture/tcpdump.js:177
|
||||
msgid "Capture packets with tcpdump."
|
||||
msgstr "使用tcpdump捕获数据包。"
|
||||
|
||||
#: luci-app-packet-capture/htdocs/luci-static/resources/view/packet_capture/tcpdump.js:247
|
||||
msgid "Close"
|
||||
msgstr "关闭"
|
||||
|
||||
#: luci-app-packet-capture/htdocs/luci-static/resources/view/packet_capture/tcpdump.js:201
|
||||
msgid "Convert host addresses to names."
|
||||
msgstr "将主机地址转换为名称。"
|
||||
|
||||
#: luci-app-packet-capture/htdocs/luci-static/resources/view/packet_capture/tcpdump.js:277
|
||||
msgid "Download"
|
||||
msgstr "下载"
|
||||
|
||||
#: luci-app-packet-capture/htdocs/luci-static/resources/view/packet_capture/tcpdump.js:275
|
||||
msgid "Download capture file"
|
||||
msgstr "下载抓包文件"
|
||||
|
||||
#: luci-app-packet-capture/htdocs/luci-static/resources/view/packet_capture/tcpdump.js:193
|
||||
msgid "Duration"
|
||||
msgstr "持续时间"
|
||||
|
||||
#: luci-app-packet-capture/htdocs/luci-static/resources/view/packet_capture/tcpdump.js:193
|
||||
msgid "Duration of packet capturing in seconds."
|
||||
msgstr "抓包时间(以秒为单位)。"
|
||||
|
||||
#: luci-app-packet-capture/htdocs/luci-static/resources/view/packet_capture/tcpdump.js:189
|
||||
msgid "Filter"
|
||||
msgstr "过滤器"
|
||||
|
||||
#: luci-app-packet-capture/root/usr/share/rpcd/acl.d/luci-app-packet-capture.json:3
|
||||
msgid "Grant access to tcpdump ubus object"
|
||||
msgstr "授权访问tcpdump ubus对象"
|
||||
|
||||
#: luci-app-packet-capture/htdocs/luci-static/resources/view/packet_capture/tcpdump.js:181
|
||||
msgid "Interface"
|
||||
msgstr "接口"
|
||||
|
||||
#: luci-app-packet-capture/htdocs/luci-static/resources/view/packet_capture/tcpdump.js:197
|
||||
msgid "Number of packets to be captured."
|
||||
msgstr "需要抓包的个数。"
|
||||
|
||||
#: luci-app-packet-capture/root/usr/share/luci/menu.d/luci-app-packet-capture.json:3
|
||||
msgid "Packet Capture"
|
||||
msgstr "数据包捕获"
|
||||
|
||||
#: luci-app-packet-capture/htdocs/luci-static/resources/view/packet_capture/tcpdump.js:177
|
||||
msgid "Packet Capture - Tcpdump"
|
||||
msgstr "Tcpdump抓包"
|
||||
|
||||
#: luci-app-packet-capture/htdocs/luci-static/resources/view/packet_capture/tcpdump.js:197
|
||||
msgid "Packets"
|
||||
msgstr "包"
|
||||
|
||||
#: luci-app-packet-capture/htdocs/luci-static/resources/view/packet_capture/tcpdump.js:203
|
||||
msgid "Print the link-level header on each dump line."
|
||||
msgstr "打印每个转储行上的链接标题。"
|
||||
|
||||
#: luci-app-packet-capture/htdocs/luci-static/resources/view/packet_capture/tcpdump.js:201
|
||||
msgid "Resolve domains"
|
||||
msgstr "解决域"
|
||||
|
||||
#: luci-app-packet-capture/htdocs/luci-static/resources/view/packet_capture/tcpdump.js:205
|
||||
msgid "Save capture to pcap file."
|
||||
msgstr "保存捕获到pcap文件。"
|
||||
|
||||
#: luci-app-packet-capture/htdocs/luci-static/resources/view/packet_capture/tcpdump.js:205
|
||||
msgid "Save to file"
|
||||
msgstr "保存到文件"
|
||||
|
||||
#: luci-app-packet-capture/htdocs/luci-static/resources/view/packet_capture/tcpdump.js:207
|
||||
msgid "Start tcpdump"
|
||||
msgstr "开始tcp转存"
|
||||
|
||||
#: luci-app-packet-capture/htdocs/luci-static/resources/view/packet_capture/tcpdump.js:263
|
||||
msgid "Stop tcpdump"
|
||||
msgstr "停止tcp转存"
|
||||
|
||||
#: luci-app-packet-capture/htdocs/luci-static/resources/view/packet_capture/tcpdump.js:189
|
||||
msgid "Tcpdump filter like protocol, port etc."
|
||||
msgstr "Tcp转存过滤协议,端口等。"
|
||||
|
||||
#: luci-app-packet-capture/htdocs/luci-static/resources/view/packet_capture/tcpdump.js:203
|
||||
msgid "Verbose output"
|
||||
msgstr "详细输出"
|
@ -1 +0,0 @@
|
||||
config tcpdump
|
@ -1,64 +0,0 @@
|
||||
#!/usr/bin/env lua
|
||||
|
||||
local ubus = require "ubus"
|
||||
local fs = require "nixio.fs"
|
||||
|
||||
local conn = ubus.connect()
|
||||
if not conn then
|
||||
error("Failed to connect to ubus")
|
||||
return
|
||||
end
|
||||
|
||||
local args = "-n"
|
||||
local duration = ""
|
||||
|
||||
if arg[1] ~= nil then
|
||||
args = arg[1]
|
||||
if arg[2] ~= "" then
|
||||
duration = arg[2]
|
||||
end
|
||||
end
|
||||
|
||||
local filter = fs.stat("/tmp/tcpdump_filter")
|
||||
if filter then
|
||||
args = args .. " -F /tmp/tcpdump_filter"
|
||||
end
|
||||
|
||||
local ubus_objects = {
|
||||
tcpdump = {
|
||||
}
|
||||
}
|
||||
|
||||
conn:add( ubus_objects )
|
||||
|
||||
os.execute("sleep 1")
|
||||
|
||||
local command = "tcpdump -l " .. args .. " 2>&1"
|
||||
|
||||
if duration ~= "" then
|
||||
command = "timeout " .. duration .. " " .. command
|
||||
end
|
||||
|
||||
local pipe = io.popen(command)
|
||||
|
||||
for line in pipe:lines() do
|
||||
local params = {
|
||||
data = line
|
||||
}
|
||||
conn:notify(ubus_objects.tcpdump.__ubusobj, "tcpdump.data", params)
|
||||
end
|
||||
|
||||
local pcap = fs.stat("/tmp/capture.pcap0")
|
||||
if pcap then
|
||||
fs.move("/tmp/capture.pcap0","/tmp/capture.pcap")
|
||||
fs.remove("/tmp/capture.pcap1")
|
||||
end
|
||||
|
||||
if filter then
|
||||
fs.remove("/tmp/tcpdump_filter")
|
||||
end
|
||||
|
||||
conn:close()
|
||||
pipe:close()
|
||||
|
||||
fs.remove("/var/run/packet_capture.pid")
|
@ -1,69 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
. /usr/share/libubox/jshn.sh
|
||||
|
||||
PIDFILE="/var/run/packet_capture.pid"
|
||||
|
||||
if [ -f "$PIDFILE"];then
|
||||
echo "error: Packet capture is running"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
json_load "$1"
|
||||
json_get_var interface interface
|
||||
json_get_var filter filter
|
||||
json_get_var duration duration
|
||||
json_get_var packets packets
|
||||
json_get_var verbose verbose
|
||||
json_get_var domains domains
|
||||
json_get_var file file
|
||||
|
||||
args="-n"
|
||||
|
||||
if [ "$domains" == "1" ];then
|
||||
args=""
|
||||
fi
|
||||
|
||||
if [ -n "$interface" ];then
|
||||
ip a show "$interface" > /dev/null 2>&1
|
||||
if [ "$?" == "1" ]; then
|
||||
echo "error: Incorrect format of an interface"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
args="$args -i $interface"
|
||||
fi
|
||||
|
||||
if [ -n "$packets" ];then
|
||||
echo "$packets" | egrep '^[0-9]*$'
|
||||
if [ "$?" -eq 0 ];then
|
||||
args="$args -c $packets"
|
||||
else
|
||||
echo "error: Incorrect packets argument"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ "$verbose" == "1" ];then
|
||||
args="$args -e"
|
||||
fi
|
||||
|
||||
if [ "$file" == "1" ];then
|
||||
mem=$(awk '/MemTotal/ {print $2}' /proc/meminfo)
|
||||
args="$args -W 2 -C $((mem/(1024 * 10))) -w /tmp/capture.pcap -z /usr/libexec/packet_capture_stop"
|
||||
fi
|
||||
|
||||
if [ -n "$filter" ];then
|
||||
tcpdump -i lo -d "$filter" >/dev/null 2>/dev/null
|
||||
if [ $? -eq 1 ];then
|
||||
echo "error: Incorrect filter argument"
|
||||
exit 1
|
||||
fi
|
||||
echo "$filter" > /tmp/tcpdump_filter
|
||||
fi
|
||||
|
||||
(/usr/libexec/packet_capture "$args" "$duration")&
|
||||
|
||||
echo $! > /var/run/packet_capture.pid
|
||||
|
||||
exit 0
|
@ -1,9 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
pid=$(cat /var/run/packet_capture.pid)
|
||||
if [ -n "$pid" ] && grep -sq packet_capture "/proc/$pid/cmdline"; then
|
||||
ppid=$(pgrep -P $pid)
|
||||
kill -TERM $ppid
|
||||
fi
|
||||
|
||||
exit 0
|
@ -1,18 +0,0 @@
|
||||
{
|
||||
"admin/services/packet_capture": {
|
||||
"title": "Packet Capture",
|
||||
"order": 90,
|
||||
"action": {
|
||||
"type": "view",
|
||||
"path": "packet_capture/tcpdump"
|
||||
},
|
||||
"depends" : {
|
||||
"acl": [ "luci-app-packet-capture" ],
|
||||
"uci": { "packet_capture": true },
|
||||
"fs": { "/usr/libexec/packet_capture": "executable",
|
||||
"/usr/libexec/packet_capture_start": "executable",
|
||||
"/usr/libexec/packet_capture_stop": "executable"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -1,25 +0,0 @@
|
||||
{
|
||||
"luci-app-packet-capture": {
|
||||
"description": "Grant access to tcpdump ubus object",
|
||||
"read": {
|
||||
"cgi-io": [ "download", "exec" ],
|
||||
"ubus": {
|
||||
"tcpdump": [ "*" ],
|
||||
"luci": [ "getProcessList" ]
|
||||
},
|
||||
"uci": [ "packet_capture", "system" ],
|
||||
"file": {
|
||||
"/tmp/capture.pcap": [ "read" ]
|
||||
}
|
||||
},
|
||||
"write": {
|
||||
"uci": [ "packet_capture" ],
|
||||
"file": {
|
||||
"/usr/libexec/packet_capture_start": [ "exec" ],
|
||||
"/usr/libexec/packet_capture_stop": [ "exec" ],
|
||||
"/usr/libexec/packet_capture": [ "exec" ],
|
||||
"/tmp/capture.pcap": [ "write" ]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -1,15 +0,0 @@
|
||||
#
|
||||
# Copyright (C) 2018-2019 Ycarus (Yannick Chabanois) <ycarus@zugaina.org>
|
||||
#
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
LUCI_TITLE:=LuCI SNMPD Interface
|
||||
LUCI_DEPENDS:=+snmpd +snmptrapd +snmp-utils +snmp-mibs
|
||||
|
||||
PKG_LICENSE:=GPLv3
|
||||
|
||||
#include ../luci/luci.mk
|
||||
include $(TOPDIR)/feeds/luci/luci.mk
|
||||
# call BuildPackage - OpenWrt buildroot signature
|
@ -1,8 +0,0 @@
|
||||
local ucic = luci.model.uci.cursor()
|
||||
local dt = require "luci.cbi.datatypes"
|
||||
module("luci.controller.snmpd", package.seeall)
|
||||
|
||||
function index()
|
||||
entry({"admin", "network", "snmpd"}, alias("admin", "network", "snmpd", "index"), _("SNMPd"))
|
||||
entry({"admin", "network", "snmpd", "index"}, cbi("snmpd"))
|
||||
end
|
@ -1,141 +0,0 @@
|
||||
-- Copyright 2018 Ycarus (Yannick Chabanois) <ycarus@zugaina.org>
|
||||
-- Licensed to the public under the Apache License 2.0.
|
||||
|
||||
m = Map("snmpd", translate("SNMPd"), translate("SNMPd settings interface (Beta)"))
|
||||
|
||||
s = m:section(TypedSection, "snmpd", translate("General"))
|
||||
s.addremove = false
|
||||
|
||||
enabled = s:option(Flag, "enabled", translate("Enabled"))
|
||||
enabled.rmempty = false
|
||||
|
||||
network = s:option(Value, "network", translate("Networks"))
|
||||
network.template = "cbi/network_netlist"
|
||||
network.widget = "checkbox"
|
||||
network.rmempty = true
|
||||
network.cast = "string"
|
||||
network.nocreate = true
|
||||
|
||||
s = m:section(TypedSection, "system", translate("System"))
|
||||
s.addremove = false
|
||||
|
||||
sysLocation = s:option(Value, "sysLocation", translate("Location"))
|
||||
sysContact = s:option(Value, "sysContact", translate("Contact"))
|
||||
sysName = s:option(Value, "sysName", translate("Name"))
|
||||
--sysServices = s:option(Value, "sysServices", translate("Services"))
|
||||
--sysDescr = s:option(Value, "sysDescr", translate("Description"))
|
||||
--sysObjectID = s:option(Value, "sysObjectID", translate("ObjectID"))
|
||||
|
||||
s = m:section(TypedSection, "com2sec", translate("com2sec security"))
|
||||
s.addremove = true
|
||||
|
||||
secname = s:option(ListValue, "secname", translate("Server"))
|
||||
secname.optional = false
|
||||
secname:value("ro",translate("Read-only"))
|
||||
secname:value("rw",translate("Read-write"))
|
||||
|
||||
source = s:option(Value, "source", translate("Source"))
|
||||
source.datatype = "host"
|
||||
source.optional = false
|
||||
source.rmempty = false
|
||||
|
||||
community = s:option(Value, "community", translate("Community"))
|
||||
community.optional = false
|
||||
community.rmempty = false
|
||||
|
||||
--s = m:section(TypedSection, "com2sec6", translate("com2sec6"))
|
||||
--s.addremove = true
|
||||
|
||||
--secname = s:option(ListValue, "secname", translate("secname"))
|
||||
--secname.optional = false
|
||||
--secname:value("ro",translate("Read-only"))
|
||||
--secname:value("rw",translate("Read-write"))
|
||||
|
||||
--source = s:option(Value, "source", translate("Source"))
|
||||
--source.datatype = "host"
|
||||
--source.optional = false
|
||||
--source.rmempty = false
|
||||
|
||||
--community = s:option(Value, "community", translate("Community"))
|
||||
--community.optional = false
|
||||
--community.rmempty = false
|
||||
|
||||
s = m:section(TypedSection, "group", translate("Group"), translate("Groups help define access methods"))
|
||||
s.addremove = true
|
||||
s.anonymous = false
|
||||
|
||||
secname = s:option(ListValue, "secname", translate("secname"))
|
||||
secname.optional = false
|
||||
secname:value("ro",translate("Read-only"))
|
||||
secname:value("rw",translate("Read-write"))
|
||||
|
||||
group = s:option(Value, "group", translate("Group"))
|
||||
group.optional = false
|
||||
group.rmempty = false
|
||||
|
||||
version = s:option(ListValue, "version", translate("version"))
|
||||
version.optional = false
|
||||
version:value("v1","v1")
|
||||
version:value("v2c","v2c")
|
||||
version:value("usm","usm")
|
||||
|
||||
s = m:section(TypedSection, "access", translate("Access"))
|
||||
s.addremove = true
|
||||
s.anonymous = false
|
||||
|
||||
group = s:option(Value, "group", translate("Group"))
|
||||
group.optional = false
|
||||
group.rmempty = false
|
||||
|
||||
version = s:option(ListValue, "version", translate("version"))
|
||||
version.optional = false
|
||||
version:value("any",translate("any"))
|
||||
version:value("v1","v1")
|
||||
version:value("v2c","v2c")
|
||||
version:value("usm","usm")
|
||||
|
||||
context = s:option(ListValue, "context", translate("Context"))
|
||||
context.optional = false
|
||||
context:value("none","none")
|
||||
|
||||
level = s:option(ListValue, "level", translate("Level"))
|
||||
level.optional = false
|
||||
level:value("noauth",translate("noauth"))
|
||||
level:value("auth",translate("auth"))
|
||||
|
||||
read = s:option(ListValue, "read", translate("Read"))
|
||||
read.optional = false
|
||||
read:value("all","all")
|
||||
read:value("none","none")
|
||||
|
||||
write = s:option(ListValue, "write", translate("Write"))
|
||||
write.optional = false
|
||||
write:value("all","all")
|
||||
write:value("none","none")
|
||||
|
||||
notify = s:option(ListValue, "notify", translate("Notify"))
|
||||
notify.optional = false
|
||||
notify:value("all","all")
|
||||
notify:value("none","none")
|
||||
|
||||
--s = m:section(TypedSection, "engineid", translate("engineid"))
|
||||
--s.addremove = false
|
||||
--s.anonymous = true
|
||||
|
||||
--engineid = s:option(Value, "engineid", translate("engineid"))
|
||||
--engineidtype = s:option(ListValue, "engineidtype", translate("engineidtype"))
|
||||
--engineidtype:value("1",translate("IPv4"))
|
||||
--engineidtype:value("2",translate("IPv6"))
|
||||
--engineidtype:value("3",translate("MAC"))
|
||||
--engineidnic = s:option(Value, "engineidnic", translate("engineidnic"))
|
||||
|
||||
s = m:section(TypedSection, "exec", translate("Exec"))
|
||||
s.addremove = true
|
||||
s.anonymous = true
|
||||
|
||||
miboid = s:option(Value, "miboid", translate("ObjectID"))
|
||||
name = s:option(Value, "name", translate("Name"))
|
||||
prog = s:option(Value, "prog", translate("Program"))
|
||||
args = s:option(Value, "args", translate("Arguments"))
|
||||
|
||||
return m
|
@ -1,132 +0,0 @@
|
||||
<%+header%>
|
||||
|
||||
<script type="text/javascript" src="<%=resource%>/cbi.js?v=git-18.274.67584-38176e6" data-strings="{"path":{"resource":"\/luci-static\/resources","browser":"\/cgi-bin\/luci\/admin\/filebrowser"}}"></script>
|
||||
|
||||
<%
|
||||
local uci = require("luci.model.uci").cursor()
|
||||
local hosts = uci:get_list("dhcp", uci:get_first("dhcp","dnsmasq"), "ipset")
|
||||
local ips = uci:get_list("omr-bypass", "ips", "ip")
|
||||
local dpi = uci:get_list("omr-bypass", "dpi", "proto")
|
||||
local tmpfile = os.tmpname()
|
||||
local dpi_available_proto = luci.util.execi("cat /proc/net/xt_ndpi/proto | awk '{print $3}' | sort -u | head -n -1")
|
||||
local sys = require "luci.sys"
|
||||
local ifaces = sys.net:devices()
|
||||
local bypassif = uci:get("omr-bypass","defaults","ifname") or ""
|
||||
%>
|
||||
<% if stderr and #stderr > 0 then %><pre class="error"><%=pcdata(stderr)%></pre><% end %>
|
||||
<form class="inline" method="post" action="<%=url('admin/services/omr-bypass/add')%>">
|
||||
<div class="cbi-map">
|
||||
<h2 name="content"><%:SNMPd%></h2>
|
||||
<fieldset class="cbi-section">
|
||||
<legend><%:General%></legend>
|
||||
<div class="cbi-section-descr"></div>
|
||||
<div class="cbi-value">
|
||||
<label class="cbi-value-title"><%:Enabled%></label>
|
||||
<div class="cbi-value-field">
|
||||
<input type="checkbox" name="enabled" class="cbi-input-checkbox" value="1" <% if luci.model.uci.cursor():get("snmpd","general","enabled") == "1" then %>checked<% end %>>
|
||||
</div>
|
||||
</div>
|
||||
<div class="cbi-value">
|
||||
network
|
||||
</div>
|
||||
<div class="cbi-value" data-index="1" data-depends="[]"><label class="cbi-value-title" for="cbid.snmpd.cfg10e48a.sysLocation">Location</label>
|
||||
<div class="cbi-value-field">
|
||||
<input data-update="change" id="cbid.snmpd.cfg10e48a.sysLocation" name="cbid.snmpd.cfg10e48a.sysLocation" type="text" class="cbi-input-text" value="office" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="cbi-value" id="cbi-snmpd-cfg10e48a-sysContact" data-index="2" data-depends="[]"><label class="cbi-value-title" for="cbid.snmpd.cfg10e48a.sysContact">Contact</label>
|
||||
<div class="cbi-value-field">
|
||||
<input data-update="change" id="cbid.snmpd.cfg10e48a.sysContact" name="cbid.snmpd.cfg10e48a.sysContact" type="text" class="cbi-input-text" value="bofh@example.com" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="cbi-value" id="cbi-snmpd-cfg10e48a-sysName" data-index="3" data-depends="[]"><label class="cbi-value-title" for="cbid.snmpd.cfg10e48a.sysName">Nom</label>
|
||||
<div class="cbi-value-field">
|
||||
<input data-update="change" id="cbid.snmpd.cfg10e48a.sysName" name="cbid.snmpd.cfg10e48a.sysName" type="text" class="cbi-input-text" value="OpenMPTCProuter" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<h3><%:General%></h3>
|
||||
|
||||
<div class="cbi-section cbi-tblsection">
|
||||
<div class="cbi-section-descr"></div>
|
||||
<div class="table cbi-section-table">
|
||||
<div class="tr cbi-section-table-titles-anonymous">
|
||||
<div class="th cbi-section-table-cell" data-type="value"><%:Domain, IP or network%></div>
|
||||
<div class="th cbi-section-table-cell" data-type="value"><%:Output interface%></div>
|
||||
<div class="th cbi-section-table-cell cbi-section-actions"></div>
|
||||
</div>
|
||||
<div class="tr cbi-section-table-row" id="cbi-omr-bypass-cfg">
|
||||
<div class="td cbi-value-field" data-name="name" data-type="value" data-title="Domain">
|
||||
<div id="cbi-omr-bypass-cfg-domain" data-index="" data-depends="[]">
|
||||
<input data-update="change" id="cbid.omr.bypass.cfg.domain"" name="cbid.omr.bypass.cfg.domain" type="text" class="cbi-input-text" value="" data-optional="true" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="td cbi-value-field" data-name="interface" data-type="value" data-title="<%:Interface%>">
|
||||
<select class="cbi-input-select" data-update="change" id="cbid.omr.bypass.cfg.interface" name="cbid.omr.bypass.cfg.interface" size="1">
|
||||
<option id="cbid.omr.bypass.cfg.interface-all" value="all" data-index="1" data-depends="[]"><%:All%></option>
|
||||
<%
|
||||
for _, iface in ipairs(ifaces) do
|
||||
if not (iface == "lo" or iface:match("^ifb.*")) then
|
||||
%>
|
||||
<option value="<%=iface%>"><%=iface%></option>
|
||||
<%
|
||||
end
|
||||
end
|
||||
%>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="cbi-section-create cbi-tblsection-create">
|
||||
<input class="cbi-button cbi-button-add" type="submit" value="Add" name="cbi.cts.omr.bypass.domains" title="<%:Add%>" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="cbi-section cbi-tblsection" id="cbi-omr-bypass-proto">
|
||||
<h3><%:Protocols%></h3>
|
||||
<div class="cbi-section-descr"></div>
|
||||
<div class="table cbi-section-table">
|
||||
<div class="tr cbi-section-table-titles-anonymous">
|
||||
<div class="th cbi-section-table-cell" data-type="value"><%:Protocols%></div>
|
||||
<div class="th cbi-section-table-cell" data-type="value"><%:Output interface%></div>
|
||||
<div class="th cbi-section-table-cell cbi-section-actions"></div>
|
||||
</div>
|
||||
<div class="tr cbi-section-table-row" id="cbi-omr-bypass-cfg">
|
||||
<div class="td cbi-value-field" data-name="name" data-type="value" data-title="Domain">
|
||||
<%
|
||||
local allprt=""""
|
||||
local protos = {}
|
||||
for l in io.lines("/proc/net/xt_ndpi/proto") do
|
||||
local a,b,c,d = l:match('(%w+) (%w+)')
|
||||
if b ~= "2" and not string.match(b,"custom") then
|
||||
table.insert(protos,b)
|
||||
end
|
||||
end
|
||||
table.sort(protos)
|
||||
for _,b in ipairs(protos) do
|
||||
allprt=allprt .. ","" .. b .. """
|
||||
end
|
||||
%>
|
||||
<div data-prefix="cbid.omr.bypass.cfg.proto" data-browser-path="" data-dynlist="[[<%=allprt%>],[<%=allprt%>],null,false]">
|
||||
<div id="cbi-omr-bypass-cfg-proto" data-index="" data-depends="[]">
|
||||
<input data-update="change" id="cbid.omr.bypass.cfg.proto" name="cbid.omr.bypass.cfg.proto" type="text" class="cbi-input-text" value="" data-optional="true" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="td cbi-value-field" data-name="interface" data-type="value" data-title="<%:Interface%>">
|
||||
<select class="cbi-input-select" data-update="change" id="cbid.omr.bypass.cfg.interface" name="cbid.omr.bypass.cfg.interface" size="1">
|
||||
<option id="cbid.omr.bypass.cfg.interface-all" value="all" data-index="1" data-depends="[]"><%:All%></option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="cbi-section-create cbi-tblsection-create">
|
||||
<input class="cbi-button cbi-button-add" type="submit" value="Add" name="cbi.cts.omr.bypass.domains" title="<%:Add%>" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="cbi-page-actions">
|
||||
<input type="hidden" name="token" value="<%=token%>" />
|
||||
<button class="btn" type="submit">Submit</button>
|
||||
</div>
|
||||
</form>
|
||||
<script type="text/javascript">cbi_init();</script>
|
||||
<%+footer%>
|
@ -1,184 +0,0 @@
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"PO-Revision-Date: 2020-10-05 12:39+0000\n"
|
||||
"Last-Translator: Weblate Admin <contact@openmptcprouter.com>\n"
|
||||
"Language-Team: German <http://weblate.openmptcprouter.com/projects/omr/"
|
||||
"luciapplicationssnmpd/de/>\n"
|
||||
"Language: de\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Plural-Forms: nplurals=2; plural=n != 1;\n"
|
||||
"X-Generator: Weblate 4.0.4\n"
|
||||
|
||||
#: luci-app-snmpd/luasrc/model/cbi/snmpd.lua:82
|
||||
msgid "Access"
|
||||
msgstr "Zugriff"
|
||||
|
||||
#: luci-app-snmpd/luasrc/view/snmpd.htm:81
|
||||
#: luci-app-snmpd/luasrc/view/snmpd.htm:122
|
||||
msgid "Add"
|
||||
msgstr "Hinzufügen"
|
||||
|
||||
#: luci-app-snmpd/luasrc/view/snmpd.htm:66
|
||||
#: luci-app-snmpd/luasrc/view/snmpd.htm:116
|
||||
msgid "All"
|
||||
msgstr "alle"
|
||||
|
||||
#: luci-app-snmpd/luasrc/model/cbi/snmpd.lua:139
|
||||
msgid "Arguments"
|
||||
msgstr "Parameter"
|
||||
|
||||
#: luci-app-snmpd/luasrc/model/cbi/snmpd.lua:42
|
||||
msgid "Community"
|
||||
msgstr "Community"
|
||||
|
||||
#: luci-app-snmpd/luasrc/model/cbi/snmpd.lua:23
|
||||
msgid "Contact"
|
||||
msgstr "Kontakt"
|
||||
|
||||
#: luci-app-snmpd/luasrc/model/cbi/snmpd.lua:97
|
||||
msgid "Context"
|
||||
msgstr "Umgebung"
|
||||
|
||||
#: luci-app-snmpd/luasrc/view/snmpd.htm:54
|
||||
msgid "Domain, IP or network"
|
||||
msgstr "FQDN, IP-Adresse oder CIDR-Netzmaske"
|
||||
|
||||
#: luci-app-snmpd/luasrc/model/cbi/snmpd.lua:9
|
||||
#: luci-app-snmpd/luasrc/view/snmpd.htm:24
|
||||
msgid "Enabled"
|
||||
msgstr "Aktiv"
|
||||
|
||||
#: luci-app-snmpd/luasrc/model/cbi/snmpd.lua:132
|
||||
msgid "Exec"
|
||||
msgstr "Ausführung"
|
||||
|
||||
#: luci-app-snmpd/luasrc/model/cbi/snmpd.lua:6
|
||||
#: luci-app-snmpd/luasrc/view/snmpd.htm:21
|
||||
#: luci-app-snmpd/luasrc/view/snmpd.htm:48
|
||||
msgid "General"
|
||||
msgstr "Allgemein"
|
||||
|
||||
#: luci-app-snmpd/root/usr/share/rpcd/acl.d/luci-app-snmpd.json:3
|
||||
msgid "Grant UCI access for luci-app-snmpd"
|
||||
msgstr "UCI-Zugriff für luci-app-snmpd gewähren"
|
||||
|
||||
#: luci-app-snmpd/luasrc/model/cbi/snmpd.lua:63
|
||||
#: luci-app-snmpd/luasrc/model/cbi/snmpd.lua:72
|
||||
#: luci-app-snmpd/luasrc/model/cbi/snmpd.lua:86
|
||||
msgid "Group"
|
||||
msgstr "Gruppe"
|
||||
|
||||
#: luci-app-snmpd/luasrc/model/cbi/snmpd.lua:63
|
||||
msgid "Groups help define access methods"
|
||||
msgstr "Gruppen ermöglichen es, Zugriffsmethoden festzulegen"
|
||||
|
||||
#: luci-app-snmpd/luasrc/view/snmpd.htm:64
|
||||
#: luci-app-snmpd/luasrc/view/snmpd.htm:114
|
||||
msgid "Interface"
|
||||
msgstr "Schnittstelle"
|
||||
|
||||
#: luci-app-snmpd/luasrc/model/cbi/snmpd.lua:101
|
||||
msgid "Level"
|
||||
msgstr "Ebene"
|
||||
|
||||
#: luci-app-snmpd/luasrc/model/cbi/snmpd.lua:22
|
||||
msgid "Location"
|
||||
msgstr "Ort"
|
||||
|
||||
#: luci-app-snmpd/luasrc/model/cbi/snmpd.lua:24
|
||||
#: luci-app-snmpd/luasrc/model/cbi/snmpd.lua:137
|
||||
msgid "Name"
|
||||
msgstr "Name"
|
||||
|
||||
#: luci-app-snmpd/luasrc/model/cbi/snmpd.lua:12
|
||||
msgid "Networks"
|
||||
msgstr "Netzwerke"
|
||||
|
||||
#: luci-app-snmpd/luasrc/model/cbi/snmpd.lua:116
|
||||
msgid "Notify"
|
||||
msgstr "Benachrichten"
|
||||
|
||||
#: luci-app-snmpd/luasrc/model/cbi/snmpd.lua:136
|
||||
msgid "ObjectID"
|
||||
msgstr "Objekt-Identifikation"
|
||||
|
||||
#: luci-app-snmpd/luasrc/view/snmpd.htm:55
|
||||
#: luci-app-snmpd/luasrc/view/snmpd.htm:90
|
||||
msgid "Output interface"
|
||||
msgstr "Ausgabe-Anschluss"
|
||||
|
||||
#: luci-app-snmpd/luasrc/model/cbi/snmpd.lua:138
|
||||
msgid "Program"
|
||||
msgstr "Programm"
|
||||
|
||||
#: luci-app-snmpd/luasrc/view/snmpd.htm:85
|
||||
#: luci-app-snmpd/luasrc/view/snmpd.htm:89
|
||||
msgid "Protocols"
|
||||
msgstr "Protokolle"
|
||||
|
||||
#: luci-app-snmpd/luasrc/model/cbi/snmpd.lua:106
|
||||
msgid "Read"
|
||||
msgstr "Lesen"
|
||||
|
||||
#: luci-app-snmpd/luasrc/model/cbi/snmpd.lua:34
|
||||
#: luci-app-snmpd/luasrc/model/cbi/snmpd.lua:69
|
||||
msgid "Read-only"
|
||||
msgstr "Nur-Lesen"
|
||||
|
||||
#: luci-app-snmpd/luasrc/model/cbi/snmpd.lua:35
|
||||
#: luci-app-snmpd/luasrc/model/cbi/snmpd.lua:70
|
||||
msgid "Read-write"
|
||||
msgstr "Lesen/Schreiben"
|
||||
|
||||
#: luci-app-snmpd/luasrc/controller/snmpd.lua:6
|
||||
#: luci-app-snmpd/luasrc/model/cbi/snmpd.lua:4
|
||||
#: luci-app-snmpd/luasrc/view/snmpd.htm:19
|
||||
#: luci-app-snmpd/root/usr/share/luci/menu.d/luci-app-snmpd.json:3
|
||||
msgid "SNMPd"
|
||||
msgstr "SNMPd"
|
||||
|
||||
#: luci-app-snmpd/luasrc/model/cbi/snmpd.lua:4
|
||||
msgid "SNMPd settings interface (Beta)"
|
||||
msgstr "SNMPd Einstellungen (Beta)"
|
||||
|
||||
#: luci-app-snmpd/luasrc/model/cbi/snmpd.lua:32
|
||||
msgid "Server"
|
||||
msgstr "Server"
|
||||
|
||||
#: luci-app-snmpd/luasrc/model/cbi/snmpd.lua:37
|
||||
msgid "Source"
|
||||
msgstr "Quelle"
|
||||
|
||||
#: luci-app-snmpd/luasrc/model/cbi/snmpd.lua:19
|
||||
msgid "System"
|
||||
msgstr "System"
|
||||
|
||||
#: luci-app-snmpd/luasrc/model/cbi/snmpd.lua:111
|
||||
msgid "Write"
|
||||
msgstr "Schreiben"
|
||||
|
||||
#: luci-app-snmpd/luasrc/model/cbi/snmpd.lua:92
|
||||
msgid "any"
|
||||
msgstr "jede"
|
||||
|
||||
#: luci-app-snmpd/luasrc/model/cbi/snmpd.lua:104
|
||||
msgid "auth"
|
||||
msgstr "Authentifizierung"
|
||||
|
||||
#: luci-app-snmpd/luasrc/model/cbi/snmpd.lua:29
|
||||
msgid "com2sec security"
|
||||
msgstr "com2sec-Sicherheit"
|
||||
|
||||
#: luci-app-snmpd/luasrc/model/cbi/snmpd.lua:103
|
||||
msgid "noauth"
|
||||
msgstr "noauth/offen"
|
||||
|
||||
#: luci-app-snmpd/luasrc/model/cbi/snmpd.lua:67
|
||||
msgid "secname"
|
||||
msgstr "sec-Name"
|
||||
|
||||
#: luci-app-snmpd/luasrc/model/cbi/snmpd.lua:76
|
||||
#: luci-app-snmpd/luasrc/model/cbi/snmpd.lua:90
|
||||
msgid "version"
|
||||
msgstr "Version"
|
@ -1,184 +0,0 @@
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"PO-Revision-Date: 2022-02-19 07:53+0000\n"
|
||||
"Last-Translator: Weblate Admin <contact@openmptcprouter.com>\n"
|
||||
"Language-Team: French <http://weblate.openmptcprouter.com/projects/omr/"
|
||||
"luciapplicationssnmpd/fr/>\n"
|
||||
"Language: fr\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Plural-Forms: nplurals=2; plural=n > 1;\n"
|
||||
"X-Generator: Weblate 4.6.1\n"
|
||||
|
||||
#: luci-app-snmpd/luasrc/model/cbi/snmpd.lua:82
|
||||
msgid "Access"
|
||||
msgstr "Accès"
|
||||
|
||||
#: luci-app-snmpd/luasrc/view/snmpd.htm:81
|
||||
#: luci-app-snmpd/luasrc/view/snmpd.htm:122
|
||||
msgid "Add"
|
||||
msgstr "Ajouter"
|
||||
|
||||
#: luci-app-snmpd/luasrc/view/snmpd.htm:66
|
||||
#: luci-app-snmpd/luasrc/view/snmpd.htm:116
|
||||
msgid "All"
|
||||
msgstr "Tout"
|
||||
|
||||
#: luci-app-snmpd/luasrc/model/cbi/snmpd.lua:139
|
||||
msgid "Arguments"
|
||||
msgstr "Arguments"
|
||||
|
||||
#: luci-app-snmpd/luasrc/model/cbi/snmpd.lua:42
|
||||
msgid "Community"
|
||||
msgstr "Communauté"
|
||||
|
||||
#: luci-app-snmpd/luasrc/model/cbi/snmpd.lua:23
|
||||
msgid "Contact"
|
||||
msgstr "Contact"
|
||||
|
||||
#: luci-app-snmpd/luasrc/model/cbi/snmpd.lua:97
|
||||
msgid "Context"
|
||||
msgstr "Contexte"
|
||||
|
||||
#: luci-app-snmpd/luasrc/view/snmpd.htm:54
|
||||
msgid "Domain, IP or network"
|
||||
msgstr "Domaine, IP ou réseau"
|
||||
|
||||
#: luci-app-snmpd/luasrc/model/cbi/snmpd.lua:9
|
||||
#: luci-app-snmpd/luasrc/view/snmpd.htm:24
|
||||
msgid "Enabled"
|
||||
msgstr "Activer"
|
||||
|
||||
#: luci-app-snmpd/luasrc/model/cbi/snmpd.lua:132
|
||||
msgid "Exec"
|
||||
msgstr ""
|
||||
|
||||
#: luci-app-snmpd/luasrc/model/cbi/snmpd.lua:6
|
||||
#: luci-app-snmpd/luasrc/view/snmpd.htm:21
|
||||
#: luci-app-snmpd/luasrc/view/snmpd.htm:48
|
||||
msgid "General"
|
||||
msgstr "Général"
|
||||
|
||||
#: luci-app-snmpd/root/usr/share/rpcd/acl.d/luci-app-snmpd.json:3
|
||||
msgid "Grant UCI access for luci-app-snmpd"
|
||||
msgstr "Accorder l'accès UCI pour luci-app-snmpd"
|
||||
|
||||
#: luci-app-snmpd/luasrc/model/cbi/snmpd.lua:63
|
||||
#: luci-app-snmpd/luasrc/model/cbi/snmpd.lua:72
|
||||
#: luci-app-snmpd/luasrc/model/cbi/snmpd.lua:86
|
||||
msgid "Group"
|
||||
msgstr "Groupe"
|
||||
|
||||
#: luci-app-snmpd/luasrc/model/cbi/snmpd.lua:63
|
||||
msgid "Groups help define access methods"
|
||||
msgstr "Les groupes aident à définir les méthodes d'accès"
|
||||
|
||||
#: luci-app-snmpd/luasrc/view/snmpd.htm:64
|
||||
#: luci-app-snmpd/luasrc/view/snmpd.htm:114
|
||||
msgid "Interface"
|
||||
msgstr "Interface"
|
||||
|
||||
#: luci-app-snmpd/luasrc/model/cbi/snmpd.lua:101
|
||||
msgid "Level"
|
||||
msgstr "Niveau"
|
||||
|
||||
#: luci-app-snmpd/luasrc/model/cbi/snmpd.lua:22
|
||||
msgid "Location"
|
||||
msgstr "Localisation"
|
||||
|
||||
#: luci-app-snmpd/luasrc/model/cbi/snmpd.lua:24
|
||||
#: luci-app-snmpd/luasrc/model/cbi/snmpd.lua:137
|
||||
msgid "Name"
|
||||
msgstr "Nom"
|
||||
|
||||
#: luci-app-snmpd/luasrc/model/cbi/snmpd.lua:12
|
||||
msgid "Networks"
|
||||
msgstr "Réseaux"
|
||||
|
||||
#: luci-app-snmpd/luasrc/model/cbi/snmpd.lua:116
|
||||
msgid "Notify"
|
||||
msgstr "Notifier"
|
||||
|
||||
#: luci-app-snmpd/luasrc/model/cbi/snmpd.lua:136
|
||||
msgid "ObjectID"
|
||||
msgstr "ObjectID"
|
||||
|
||||
#: luci-app-snmpd/luasrc/view/snmpd.htm:55
|
||||
#: luci-app-snmpd/luasrc/view/snmpd.htm:90
|
||||
msgid "Output interface"
|
||||
msgstr "Interface de sortie"
|
||||
|
||||
#: luci-app-snmpd/luasrc/model/cbi/snmpd.lua:138
|
||||
msgid "Program"
|
||||
msgstr "Programme"
|
||||
|
||||
#: luci-app-snmpd/luasrc/view/snmpd.htm:85
|
||||
#: luci-app-snmpd/luasrc/view/snmpd.htm:89
|
||||
msgid "Protocols"
|
||||
msgstr "Protocoles"
|
||||
|
||||
#: luci-app-snmpd/luasrc/model/cbi/snmpd.lua:106
|
||||
msgid "Read"
|
||||
msgstr "Lecture"
|
||||
|
||||
#: luci-app-snmpd/luasrc/model/cbi/snmpd.lua:34
|
||||
#: luci-app-snmpd/luasrc/model/cbi/snmpd.lua:69
|
||||
msgid "Read-only"
|
||||
msgstr "Lecture Seule"
|
||||
|
||||
#: luci-app-snmpd/luasrc/model/cbi/snmpd.lua:35
|
||||
#: luci-app-snmpd/luasrc/model/cbi/snmpd.lua:70
|
||||
msgid "Read-write"
|
||||
msgstr "Lecture-écriture"
|
||||
|
||||
#: luci-app-snmpd/luasrc/controller/snmpd.lua:6
|
||||
#: luci-app-snmpd/luasrc/model/cbi/snmpd.lua:4
|
||||
#: luci-app-snmpd/luasrc/view/snmpd.htm:19
|
||||
#: luci-app-snmpd/root/usr/share/luci/menu.d/luci-app-snmpd.json:3
|
||||
msgid "SNMPd"
|
||||
msgstr "SNMPd"
|
||||
|
||||
#: luci-app-snmpd/luasrc/model/cbi/snmpd.lua:4
|
||||
msgid "SNMPd settings interface (Beta)"
|
||||
msgstr "Paramètres du protocole SNMPd (Beta)"
|
||||
|
||||
#: luci-app-snmpd/luasrc/model/cbi/snmpd.lua:32
|
||||
msgid "Server"
|
||||
msgstr "Serveur"
|
||||
|
||||
#: luci-app-snmpd/luasrc/model/cbi/snmpd.lua:37
|
||||
msgid "Source"
|
||||
msgstr "Source"
|
||||
|
||||
#: luci-app-snmpd/luasrc/model/cbi/snmpd.lua:19
|
||||
msgid "System"
|
||||
msgstr "Système"
|
||||
|
||||
#: luci-app-snmpd/luasrc/model/cbi/snmpd.lua:111
|
||||
msgid "Write"
|
||||
msgstr "Ecriture"
|
||||
|
||||
#: luci-app-snmpd/luasrc/model/cbi/snmpd.lua:92
|
||||
msgid "any"
|
||||
msgstr "Tout"
|
||||
|
||||
#: luci-app-snmpd/luasrc/model/cbi/snmpd.lua:104
|
||||
msgid "auth"
|
||||
msgstr "Authentification"
|
||||
|
||||
#: luci-app-snmpd/luasrc/model/cbi/snmpd.lua:29
|
||||
msgid "com2sec security"
|
||||
msgstr "com2sec security"
|
||||
|
||||
#: luci-app-snmpd/luasrc/model/cbi/snmpd.lua:103
|
||||
msgid "noauth"
|
||||
msgstr "pas d'authentification"
|
||||
|
||||
#: luci-app-snmpd/luasrc/model/cbi/snmpd.lua:67
|
||||
msgid "secname"
|
||||
msgstr ""
|
||||
|
||||
#: luci-app-snmpd/luasrc/model/cbi/snmpd.lua:76
|
||||
#: luci-app-snmpd/luasrc/model/cbi/snmpd.lua:90
|
||||
msgid "version"
|
||||
msgstr "version"
|
@ -1,184 +0,0 @@
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"PO-Revision-Date: 2022-02-21 21:14+0000\n"
|
||||
"Last-Translator: Deleted User <noreply+28@weblate.org>\n"
|
||||
"Language-Team: Italian <http://weblate.openmptcprouter.com/projects/omr/"
|
||||
"luciapplicationssnmpd/it/>\n"
|
||||
"Language: it\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Plural-Forms: nplurals=2; plural=n != 1;\n"
|
||||
"X-Generator: Weblate 4.10.1\n"
|
||||
|
||||
#: luci-app-snmpd/luasrc/model/cbi/snmpd.lua:82
|
||||
msgid "Access"
|
||||
msgstr "Accesso"
|
||||
|
||||
#: luci-app-snmpd/luasrc/view/snmpd.htm:81
|
||||
#: luci-app-snmpd/luasrc/view/snmpd.htm:122
|
||||
msgid "Add"
|
||||
msgstr "Aggiungi"
|
||||
|
||||
#: luci-app-snmpd/luasrc/view/snmpd.htm:66
|
||||
#: luci-app-snmpd/luasrc/view/snmpd.htm:116
|
||||
msgid "All"
|
||||
msgstr "Tutti"
|
||||
|
||||
#: luci-app-snmpd/luasrc/model/cbi/snmpd.lua:139
|
||||
msgid "Arguments"
|
||||
msgstr "Parametri"
|
||||
|
||||
#: luci-app-snmpd/luasrc/model/cbi/snmpd.lua:42
|
||||
msgid "Community"
|
||||
msgstr "Community"
|
||||
|
||||
#: luci-app-snmpd/luasrc/model/cbi/snmpd.lua:23
|
||||
msgid "Contact"
|
||||
msgstr "Contatto"
|
||||
|
||||
#: luci-app-snmpd/luasrc/model/cbi/snmpd.lua:97
|
||||
msgid "Context"
|
||||
msgstr "Contesto"
|
||||
|
||||
#: luci-app-snmpd/luasrc/view/snmpd.htm:54
|
||||
msgid "Domain, IP or network"
|
||||
msgstr "Dominio, IP o rete"
|
||||
|
||||
#: luci-app-snmpd/luasrc/model/cbi/snmpd.lua:9
|
||||
#: luci-app-snmpd/luasrc/view/snmpd.htm:24
|
||||
msgid "Enabled"
|
||||
msgstr "Abilitato"
|
||||
|
||||
#: luci-app-snmpd/luasrc/model/cbi/snmpd.lua:132
|
||||
msgid "Exec"
|
||||
msgstr "Esegui"
|
||||
|
||||
#: luci-app-snmpd/luasrc/model/cbi/snmpd.lua:6
|
||||
#: luci-app-snmpd/luasrc/view/snmpd.htm:21
|
||||
#: luci-app-snmpd/luasrc/view/snmpd.htm:48
|
||||
msgid "General"
|
||||
msgstr "Generale"
|
||||
|
||||
#: luci-app-snmpd/root/usr/share/rpcd/acl.d/luci-app-snmpd.json:3
|
||||
msgid "Grant UCI access for luci-app-snmpd"
|
||||
msgstr "Concedi l'accesso UCI per luci-app-snmpd"
|
||||
|
||||
#: luci-app-snmpd/luasrc/model/cbi/snmpd.lua:63
|
||||
#: luci-app-snmpd/luasrc/model/cbi/snmpd.lua:72
|
||||
#: luci-app-snmpd/luasrc/model/cbi/snmpd.lua:86
|
||||
msgid "Group"
|
||||
msgstr "Gruppo"
|
||||
|
||||
#: luci-app-snmpd/luasrc/model/cbi/snmpd.lua:63
|
||||
msgid "Groups help define access methods"
|
||||
msgstr "I gruppi aiutano a definire i metodi di accesso"
|
||||
|
||||
#: luci-app-snmpd/luasrc/view/snmpd.htm:64
|
||||
#: luci-app-snmpd/luasrc/view/snmpd.htm:114
|
||||
msgid "Interface"
|
||||
msgstr "Interfaccia"
|
||||
|
||||
#: luci-app-snmpd/luasrc/model/cbi/snmpd.lua:101
|
||||
msgid "Level"
|
||||
msgstr "Livello"
|
||||
|
||||
#: luci-app-snmpd/luasrc/model/cbi/snmpd.lua:22
|
||||
msgid "Location"
|
||||
msgstr "Sede"
|
||||
|
||||
#: luci-app-snmpd/luasrc/model/cbi/snmpd.lua:24
|
||||
#: luci-app-snmpd/luasrc/model/cbi/snmpd.lua:137
|
||||
msgid "Name"
|
||||
msgstr "Nome"
|
||||
|
||||
#: luci-app-snmpd/luasrc/model/cbi/snmpd.lua:12
|
||||
msgid "Networks"
|
||||
msgstr "Reti"
|
||||
|
||||
#: luci-app-snmpd/luasrc/model/cbi/snmpd.lua:116
|
||||
msgid "Notify"
|
||||
msgstr "Notificare"
|
||||
|
||||
#: luci-app-snmpd/luasrc/model/cbi/snmpd.lua:136
|
||||
msgid "ObjectID"
|
||||
msgstr ""
|
||||
|
||||
#: luci-app-snmpd/luasrc/view/snmpd.htm:55
|
||||
#: luci-app-snmpd/luasrc/view/snmpd.htm:90
|
||||
msgid "Output interface"
|
||||
msgstr "Interfaccia di output"
|
||||
|
||||
#: luci-app-snmpd/luasrc/model/cbi/snmpd.lua:138
|
||||
msgid "Program"
|
||||
msgstr "Programma"
|
||||
|
||||
#: luci-app-snmpd/luasrc/view/snmpd.htm:85
|
||||
#: luci-app-snmpd/luasrc/view/snmpd.htm:89
|
||||
msgid "Protocols"
|
||||
msgstr "Protocollo"
|
||||
|
||||
#: luci-app-snmpd/luasrc/model/cbi/snmpd.lua:106
|
||||
msgid "Read"
|
||||
msgstr "Leggi"
|
||||
|
||||
#: luci-app-snmpd/luasrc/model/cbi/snmpd.lua:34
|
||||
#: luci-app-snmpd/luasrc/model/cbi/snmpd.lua:69
|
||||
msgid "Read-only"
|
||||
msgstr "Sola lettura"
|
||||
|
||||
#: luci-app-snmpd/luasrc/model/cbi/snmpd.lua:35
|
||||
#: luci-app-snmpd/luasrc/model/cbi/snmpd.lua:70
|
||||
msgid "Read-write"
|
||||
msgstr "Leggi-Scrivi"
|
||||
|
||||
#: luci-app-snmpd/luasrc/controller/snmpd.lua:6
|
||||
#: luci-app-snmpd/luasrc/model/cbi/snmpd.lua:4
|
||||
#: luci-app-snmpd/luasrc/view/snmpd.htm:19
|
||||
#: luci-app-snmpd/root/usr/share/luci/menu.d/luci-app-snmpd.json:3
|
||||
msgid "SNMPd"
|
||||
msgstr ""
|
||||
|
||||
#: luci-app-snmpd/luasrc/model/cbi/snmpd.lua:4
|
||||
msgid "SNMPd settings interface (Beta)"
|
||||
msgstr "Interfaccia delle impostazioni SNMPd (Beta)"
|
||||
|
||||
#: luci-app-snmpd/luasrc/model/cbi/snmpd.lua:32
|
||||
msgid "Server"
|
||||
msgstr ""
|
||||
|
||||
#: luci-app-snmpd/luasrc/model/cbi/snmpd.lua:37
|
||||
msgid "Source"
|
||||
msgstr ""
|
||||
|
||||
#: luci-app-snmpd/luasrc/model/cbi/snmpd.lua:19
|
||||
msgid "System"
|
||||
msgstr "Sistema"
|
||||
|
||||
#: luci-app-snmpd/luasrc/model/cbi/snmpd.lua:111
|
||||
msgid "Write"
|
||||
msgstr "Scrittura"
|
||||
|
||||
#: luci-app-snmpd/luasrc/model/cbi/snmpd.lua:92
|
||||
msgid "any"
|
||||
msgstr "qualsiasi"
|
||||
|
||||
#: luci-app-snmpd/luasrc/model/cbi/snmpd.lua:104
|
||||
msgid "auth"
|
||||
msgstr ""
|
||||
|
||||
#: luci-app-snmpd/luasrc/model/cbi/snmpd.lua:29
|
||||
msgid "com2sec security"
|
||||
msgstr ""
|
||||
|
||||
#: luci-app-snmpd/luasrc/model/cbi/snmpd.lua:103
|
||||
msgid "noauth"
|
||||
msgstr ""
|
||||
|
||||
#: luci-app-snmpd/luasrc/model/cbi/snmpd.lua:67
|
||||
msgid "secname"
|
||||
msgstr ""
|
||||
|
||||
#: luci-app-snmpd/luasrc/model/cbi/snmpd.lua:76
|
||||
#: luci-app-snmpd/luasrc/model/cbi/snmpd.lua:90
|
||||
msgid "version"
|
||||
msgstr "versione"
|
@ -1,184 +0,0 @@
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"PO-Revision-Date: 2020-08-31 17:15+0000\n"
|
||||
"Last-Translator: Quentin PAGÈS <githubou@quentino.fr>\n"
|
||||
"Language-Team: Occitan <http://weblate.openmptcprouter.com/projects/omr/"
|
||||
"luciapplicationssnmpd/oc/>\n"
|
||||
"Language: oc\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Plural-Forms: nplurals=2; plural=n > 1;\n"
|
||||
"X-Generator: Weblate 4.0.4\n"
|
||||
|
||||
#: luci-app-snmpd/luasrc/model/cbi/snmpd.lua:82
|
||||
msgid "Access"
|
||||
msgstr "Accès"
|
||||
|
||||
#: luci-app-snmpd/luasrc/view/snmpd.htm:81
|
||||
#: luci-app-snmpd/luasrc/view/snmpd.htm:122
|
||||
msgid "Add"
|
||||
msgstr "Ajustar"
|
||||
|
||||
#: luci-app-snmpd/luasrc/view/snmpd.htm:66
|
||||
#: luci-app-snmpd/luasrc/view/snmpd.htm:116
|
||||
msgid "All"
|
||||
msgstr "Tot"
|
||||
|
||||
#: luci-app-snmpd/luasrc/model/cbi/snmpd.lua:139
|
||||
msgid "Arguments"
|
||||
msgstr "Arguments"
|
||||
|
||||
#: luci-app-snmpd/luasrc/model/cbi/snmpd.lua:42
|
||||
msgid "Community"
|
||||
msgstr "Comunautat"
|
||||
|
||||
#: luci-app-snmpd/luasrc/model/cbi/snmpd.lua:23
|
||||
msgid "Contact"
|
||||
msgstr "Contacte"
|
||||
|
||||
#: luci-app-snmpd/luasrc/model/cbi/snmpd.lua:97
|
||||
msgid "Context"
|
||||
msgstr "Contèxt"
|
||||
|
||||
#: luci-app-snmpd/luasrc/view/snmpd.htm:54
|
||||
msgid "Domain, IP or network"
|
||||
msgstr "Domeni, IP o ret"
|
||||
|
||||
#: luci-app-snmpd/luasrc/model/cbi/snmpd.lua:9
|
||||
#: luci-app-snmpd/luasrc/view/snmpd.htm:24
|
||||
msgid "Enabled"
|
||||
msgstr "Activat"
|
||||
|
||||
#: luci-app-snmpd/luasrc/model/cbi/snmpd.lua:132
|
||||
msgid "Exec"
|
||||
msgstr "Exec"
|
||||
|
||||
#: luci-app-snmpd/luasrc/model/cbi/snmpd.lua:6
|
||||
#: luci-app-snmpd/luasrc/view/snmpd.htm:21
|
||||
#: luci-app-snmpd/luasrc/view/snmpd.htm:48
|
||||
msgid "General"
|
||||
msgstr "General"
|
||||
|
||||
#: luci-app-snmpd/root/usr/share/rpcd/acl.d/luci-app-snmpd.json:3
|
||||
msgid "Grant UCI access for luci-app-snmpd"
|
||||
msgstr "Acordar l'accès UCI a luci-app-snmpd"
|
||||
|
||||
#: luci-app-snmpd/luasrc/model/cbi/snmpd.lua:63
|
||||
#: luci-app-snmpd/luasrc/model/cbi/snmpd.lua:72
|
||||
#: luci-app-snmpd/luasrc/model/cbi/snmpd.lua:86
|
||||
msgid "Group"
|
||||
msgstr "Grop"
|
||||
|
||||
#: luci-app-snmpd/luasrc/model/cbi/snmpd.lua:63
|
||||
msgid "Groups help define access methods"
|
||||
msgstr "Los grops ajudan a gerir los metòdes d'accès"
|
||||
|
||||
#: luci-app-snmpd/luasrc/view/snmpd.htm:64
|
||||
#: luci-app-snmpd/luasrc/view/snmpd.htm:114
|
||||
msgid "Interface"
|
||||
msgstr "Interfàcia"
|
||||
|
||||
#: luci-app-snmpd/luasrc/model/cbi/snmpd.lua:101
|
||||
msgid "Level"
|
||||
msgstr "Nivèl"
|
||||
|
||||
#: luci-app-snmpd/luasrc/model/cbi/snmpd.lua:22
|
||||
msgid "Location"
|
||||
msgstr "Emplaçament"
|
||||
|
||||
#: luci-app-snmpd/luasrc/model/cbi/snmpd.lua:24
|
||||
#: luci-app-snmpd/luasrc/model/cbi/snmpd.lua:137
|
||||
msgid "Name"
|
||||
msgstr "Nom"
|
||||
|
||||
#: luci-app-snmpd/luasrc/model/cbi/snmpd.lua:12
|
||||
msgid "Networks"
|
||||
msgstr "Rets"
|
||||
|
||||
#: luci-app-snmpd/luasrc/model/cbi/snmpd.lua:116
|
||||
msgid "Notify"
|
||||
msgstr "Notificar"
|
||||
|
||||
#: luci-app-snmpd/luasrc/model/cbi/snmpd.lua:136
|
||||
msgid "ObjectID"
|
||||
msgstr "ObjectID"
|
||||
|
||||
#: luci-app-snmpd/luasrc/view/snmpd.htm:55
|
||||
#: luci-app-snmpd/luasrc/view/snmpd.htm:90
|
||||
msgid "Output interface"
|
||||
msgstr "Interfàcia de sortida"
|
||||
|
||||
#: luci-app-snmpd/luasrc/model/cbi/snmpd.lua:138
|
||||
msgid "Program"
|
||||
msgstr "Programa"
|
||||
|
||||
#: luci-app-snmpd/luasrc/view/snmpd.htm:85
|
||||
#: luci-app-snmpd/luasrc/view/snmpd.htm:89
|
||||
msgid "Protocols"
|
||||
msgstr "Protocòls"
|
||||
|
||||
#: luci-app-snmpd/luasrc/model/cbi/snmpd.lua:106
|
||||
msgid "Read"
|
||||
msgstr "Lectura"
|
||||
|
||||
#: luci-app-snmpd/luasrc/model/cbi/snmpd.lua:34
|
||||
#: luci-app-snmpd/luasrc/model/cbi/snmpd.lua:69
|
||||
msgid "Read-only"
|
||||
msgstr "Lectura sola"
|
||||
|
||||
#: luci-app-snmpd/luasrc/model/cbi/snmpd.lua:35
|
||||
#: luci-app-snmpd/luasrc/model/cbi/snmpd.lua:70
|
||||
msgid "Read-write"
|
||||
msgstr "Lectura-escritura"
|
||||
|
||||
#: luci-app-snmpd/luasrc/controller/snmpd.lua:6
|
||||
#: luci-app-snmpd/luasrc/model/cbi/snmpd.lua:4
|
||||
#: luci-app-snmpd/luasrc/view/snmpd.htm:19
|
||||
#: luci-app-snmpd/root/usr/share/luci/menu.d/luci-app-snmpd.json:3
|
||||
msgid "SNMPd"
|
||||
msgstr "SNMPd"
|
||||
|
||||
#: luci-app-snmpd/luasrc/model/cbi/snmpd.lua:4
|
||||
msgid "SNMPd settings interface (Beta)"
|
||||
msgstr "Interfàcia de paramètres SNMPd (Beta)"
|
||||
|
||||
#: luci-app-snmpd/luasrc/model/cbi/snmpd.lua:32
|
||||
msgid "Server"
|
||||
msgstr "Servidor"
|
||||
|
||||
#: luci-app-snmpd/luasrc/model/cbi/snmpd.lua:37
|
||||
msgid "Source"
|
||||
msgstr "Font"
|
||||
|
||||
#: luci-app-snmpd/luasrc/model/cbi/snmpd.lua:19
|
||||
msgid "System"
|
||||
msgstr "Sistèma"
|
||||
|
||||
#: luci-app-snmpd/luasrc/model/cbi/snmpd.lua:111
|
||||
msgid "Write"
|
||||
msgstr "Escritura"
|
||||
|
||||
#: luci-app-snmpd/luasrc/model/cbi/snmpd.lua:92
|
||||
msgid "any"
|
||||
msgstr "Quin que siá"
|
||||
|
||||
#: luci-app-snmpd/luasrc/model/cbi/snmpd.lua:104
|
||||
msgid "auth"
|
||||
msgstr "auth"
|
||||
|
||||
#: luci-app-snmpd/luasrc/model/cbi/snmpd.lua:29
|
||||
msgid "com2sec security"
|
||||
msgstr "seguretat com2sec"
|
||||
|
||||
#: luci-app-snmpd/luasrc/model/cbi/snmpd.lua:103
|
||||
msgid "noauth"
|
||||
msgstr "noauth"
|
||||
|
||||
#: luci-app-snmpd/luasrc/model/cbi/snmpd.lua:67
|
||||
msgid "secname"
|
||||
msgstr "secname"
|
||||
|
||||
#: luci-app-snmpd/luasrc/model/cbi/snmpd.lua:76
|
||||
#: luci-app-snmpd/luasrc/model/cbi/snmpd.lua:90
|
||||
msgid "version"
|
||||
msgstr "version"
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user