mirror of
https://github.com/kiddin9/op-packages.git
synced 2026-11-03 05:23:56 +08:00
🌴 Sync 2026-03-05 23:51:42
This commit is contained in:
1 parent
97c049ed0a
commit
0acff03804
14253 files changed
+3893239
No files matched your search
@@ -0,0 +1,15 @@
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
# Copyright (C) 2023 ImmortalWrt.org
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
LUCI_TITLE:=LuCI support for MicroSocks
|
||||
LUCI_DEPENDS:=+microsocks
|
||||
LUCI_PKGARCH:=all
|
||||
|
||||
PKG_MAINTAINER:=Tianling Shen <cnsztl@immortalwrt.org>
|
||||
|
||||
include $(TOPDIR)/feeds/luci/luci.mk
|
||||
|
||||
# call BuildPackage - OpenWrt buildroot signature
|
||||
@@ -0,0 +1,95 @@
|
||||
/* Copyright (C) 2023 ImmortalWrt.org */
|
||||
|
||||
'use strict';
|
||||
'require form';
|
||||
'require poll';
|
||||
'require rpc';
|
||||
'require uci';
|
||||
'require view';
|
||||
|
||||
const callServiceList = rpc.declare({
|
||||
object: 'service',
|
||||
method: 'list',
|
||||
params: ['name'],
|
||||
expect: { '': {} }
|
||||
});
|
||||
|
||||
function getServiceStatus() {
|
||||
return L.resolveDefault(callServiceList('microsocks'), {}).then(function(res) {
|
||||
let isRunning = false;
|
||||
try {
|
||||
isRunning = res['microsocks']['instances']['microsocks']['running'];
|
||||
} catch (e) { }
|
||||
return isRunning;
|
||||
});
|
||||
}
|
||||
|
||||
function renderStatus(isRunning) {
|
||||
let spanTemp = '<em><span style="color:%s"><strong>%s %s</strong></span></em>';
|
||||
let renderHTML;
|
||||
if (isRunning)
|
||||
renderHTML = spanTemp.format('green', _('MicroSocks'), _('RUNNING'));
|
||||
else
|
||||
renderHTML = spanTemp.format('red', _('MicroSocks'), _('NOT RUNNING'));
|
||||
|
||||
return renderHTML;
|
||||
}
|
||||
|
||||
return view.extend({
|
||||
render: function() {
|
||||
let m, s, o;
|
||||
|
||||
m = new form.Map('microsocks', _('MicroSocks'),
|
||||
_('MicroSocks - multithreaded, small, efficient SOCKS5 server.'));
|
||||
|
||||
s = m.section(form.TypedSection);
|
||||
s.anonymous = true;
|
||||
s.render = function() {
|
||||
poll.add(function() {
|
||||
return L.resolveDefault(getServiceStatus()).then(function(res) {
|
||||
let view = document.getElementById('service_status');
|
||||
view.innerHTML = renderStatus(res);
|
||||
});
|
||||
});
|
||||
|
||||
return E('div', { class: 'cbi-section', id: 'status_bar' }, [
|
||||
E('p', { id: 'service_status' }, _('Collecting data...'))
|
||||
]);
|
||||
}
|
||||
|
||||
s = m.section(form.NamedSection, 'config', 'microsocks');
|
||||
|
||||
o = s.option(form.Flag, 'enabled', _('Enable'));
|
||||
o.default = o.disabled;
|
||||
o.rmempty = false;
|
||||
|
||||
o = s.option(form.Value, 'bindaddr', _('Bind address'),
|
||||
_('Specifiy which ip outgoing connections are bound to.'));
|
||||
o.datatype = 'ipaddr';
|
||||
|
||||
o = s.option(form.Value, 'listenip', _('Listen address'));
|
||||
o.datatype = 'ipaddr';
|
||||
o.placeholder = '0.0.0.0';
|
||||
|
||||
o = s.option(form.Value, 'port', _('Listen port'));
|
||||
o.datatype = 'port';
|
||||
o.placeholder = '1080';
|
||||
|
||||
o = s.option(form.Value, 'user', _('Username'));
|
||||
|
||||
o = s.option(form.Value, 'password', _('Password'));
|
||||
o.password = true;
|
||||
o.rmempty = false;
|
||||
o.depends({'user': '', '!reverse': true});
|
||||
|
||||
o = s.option(form.Flag, 'auth_once', _('Auth once'),
|
||||
_('Once a specific ip address authed successfully with user/pass, it is added to a whitelist and may use the proxy without auth.'));
|
||||
o.default = o.disabled;
|
||||
o.depends({'user': '', '!reverse': true});
|
||||
|
||||
o = s.option(form.Flag, 'internet_access', _('Allow access from Internet'));
|
||||
o.default = o.disabled;
|
||||
|
||||
return m.render();
|
||||
}
|
||||
});
|
||||
@@ -0,0 +1,71 @@
|
||||
msgid ""
|
||||
msgstr "Content-Type: text/plain; charset=UTF-8"
|
||||
|
||||
#: applications/luci-app-microsocks/htdocs/luci-static/resources/view/microsocks.js:91
|
||||
msgid "Allow access from Internet"
|
||||
msgstr ""
|
||||
|
||||
#: applications/luci-app-microsocks/htdocs/luci-static/resources/view/microsocks.js:86
|
||||
msgid "Auth once"
|
||||
msgstr ""
|
||||
|
||||
#: applications/luci-app-microsocks/htdocs/luci-static/resources/view/microsocks.js:67
|
||||
msgid "Bind address"
|
||||
msgstr ""
|
||||
|
||||
#: applications/luci-app-microsocks/htdocs/luci-static/resources/view/microsocks.js:57
|
||||
msgid "Collecting data..."
|
||||
msgstr ""
|
||||
|
||||
#: applications/luci-app-microsocks/htdocs/luci-static/resources/view/microsocks.js:63
|
||||
msgid "Enable"
|
||||
msgstr ""
|
||||
|
||||
#: applications/luci-app-microsocks/root/usr/share/rpcd/acl.d/luci-app-microsocks.json:3
|
||||
msgid "Grant UCI access for luci-app-microsocks"
|
||||
msgstr ""
|
||||
|
||||
#: applications/luci-app-microsocks/htdocs/luci-static/resources/view/microsocks.js:71
|
||||
msgid "Listen address"
|
||||
msgstr ""
|
||||
|
||||
#: applications/luci-app-microsocks/htdocs/luci-static/resources/view/microsocks.js:75
|
||||
msgid "Listen port"
|
||||
msgstr ""
|
||||
|
||||
#: applications/luci-app-microsocks/htdocs/luci-static/resources/view/microsocks.js:31
|
||||
#: applications/luci-app-microsocks/htdocs/luci-static/resources/view/microsocks.js:33
|
||||
#: applications/luci-app-microsocks/htdocs/luci-static/resources/view/microsocks.js:43
|
||||
#: applications/luci-app-microsocks/root/usr/share/luci/menu.d/luci-app-microsocks.json:3
|
||||
msgid "MicroSocks"
|
||||
msgstr ""
|
||||
|
||||
#: applications/luci-app-microsocks/htdocs/luci-static/resources/view/microsocks.js:44
|
||||
msgid "MicroSocks - multithreaded, small, efficient SOCKS5 server."
|
||||
msgstr ""
|
||||
|
||||
#: applications/luci-app-microsocks/htdocs/luci-static/resources/view/microsocks.js:33
|
||||
msgid "NOT RUNNING"
|
||||
msgstr ""
|
||||
|
||||
#: applications/luci-app-microsocks/htdocs/luci-static/resources/view/microsocks.js:87
|
||||
msgid ""
|
||||
"Once a specific ip address authed successfully with user/pass, it is added "
|
||||
"to a whitelist and may use the proxy without auth."
|
||||
msgstr ""
|
||||
|
||||
#: applications/luci-app-microsocks/htdocs/luci-static/resources/view/microsocks.js:81
|
||||
msgid "Password"
|
||||
msgstr ""
|
||||
|
||||
#: applications/luci-app-microsocks/htdocs/luci-static/resources/view/microsocks.js:31
|
||||
msgid "RUNNING"
|
||||
msgstr ""
|
||||
|
||||
#: applications/luci-app-microsocks/htdocs/luci-static/resources/view/microsocks.js:68
|
||||
msgid "Specifiy which ip outgoing connections are bound to."
|
||||
msgstr ""
|
||||
|
||||
#: applications/luci-app-microsocks/htdocs/luci-static/resources/view/microsocks.js:79
|
||||
msgid "Username"
|
||||
msgstr ""
|
||||
Symlink
+1
@@ -0,0 +1 @@
|
||||
zh_Hans
|
||||
@@ -0,0 +1,78 @@
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Project-Id-Version: PACKAGE VERSION\n"
|
||||
"Last-Translator: Automatically generated\n"
|
||||
"Language-Team: none\n"
|
||||
"Language: zh_Hans\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
|
||||
#: applications/luci-app-microsocks/htdocs/luci-static/resources/view/microsocks.js:91
|
||||
msgid "Allow access from Internet"
|
||||
msgstr "允许从互联网访问"
|
||||
|
||||
#: applications/luci-app-microsocks/htdocs/luci-static/resources/view/microsocks.js:86
|
||||
msgid "Auth once"
|
||||
msgstr "单次认证"
|
||||
|
||||
#: applications/luci-app-microsocks/htdocs/luci-static/resources/view/microsocks.js:67
|
||||
msgid "Bind address"
|
||||
msgstr "绑定地址"
|
||||
|
||||
#: applications/luci-app-microsocks/htdocs/luci-static/resources/view/microsocks.js:57
|
||||
msgid "Collecting data..."
|
||||
msgstr "正在收集数据中..."
|
||||
|
||||
#: applications/luci-app-microsocks/htdocs/luci-static/resources/view/microsocks.js:63
|
||||
msgid "Enable"
|
||||
msgstr "启用"
|
||||
|
||||
#: applications/luci-app-microsocks/root/usr/share/rpcd/acl.d/luci-app-microsocks.json:3
|
||||
msgid "Grant UCI access for luci-app-microsocks"
|
||||
msgstr "授予 luci-app-microsocks 访问 UCI 配置的权限"
|
||||
|
||||
#: applications/luci-app-microsocks/htdocs/luci-static/resources/view/microsocks.js:71
|
||||
msgid "Listen address"
|
||||
msgstr "监听地址"
|
||||
|
||||
#: applications/luci-app-microsocks/htdocs/luci-static/resources/view/microsocks.js:75
|
||||
msgid "Listen port"
|
||||
msgstr "监听端口"
|
||||
|
||||
#: applications/luci-app-microsocks/htdocs/luci-static/resources/view/microsocks.js:31
|
||||
#: applications/luci-app-microsocks/htdocs/luci-static/resources/view/microsocks.js:33
|
||||
#: applications/luci-app-microsocks/htdocs/luci-static/resources/view/microsocks.js:43
|
||||
#: applications/luci-app-microsocks/root/usr/share/luci/menu.d/luci-app-microsocks.json:3
|
||||
msgid "MicroSocks"
|
||||
msgstr "MicroSocks"
|
||||
|
||||
#: applications/luci-app-microsocks/htdocs/luci-static/resources/view/microsocks.js:44
|
||||
msgid "MicroSocks - multithreaded, small, efficient SOCKS5 server."
|
||||
msgstr "MicroSocks - 多线程、小巧、高效的 SOCKS5 服务器。"
|
||||
|
||||
#: applications/luci-app-microsocks/htdocs/luci-static/resources/view/microsocks.js:33
|
||||
msgid "NOT RUNNING"
|
||||
msgstr "未运行"
|
||||
|
||||
#: applications/luci-app-microsocks/htdocs/luci-static/resources/view/microsocks.js:87
|
||||
msgid ""
|
||||
"Once a specific ip address authed successfully with user/pass, it is added "
|
||||
"to a whitelist and may use the proxy without auth."
|
||||
msgstr "一旦特定 IP 地址成功通过认证,它将被添加至白名单且后续不再要求认证。"
|
||||
|
||||
#: applications/luci-app-microsocks/htdocs/luci-static/resources/view/microsocks.js:81
|
||||
msgid "Password"
|
||||
msgstr "密码"
|
||||
|
||||
#: applications/luci-app-microsocks/htdocs/luci-static/resources/view/microsocks.js:31
|
||||
msgid "RUNNING"
|
||||
msgstr "运行中"
|
||||
|
||||
#: applications/luci-app-microsocks/htdocs/luci-static/resources/view/microsocks.js:68
|
||||
msgid "Specifiy which ip outgoing connections are bound to."
|
||||
msgstr "指定传出连接应该被绑定到哪个 IP。"
|
||||
|
||||
#: applications/luci-app-microsocks/htdocs/luci-static/resources/view/microsocks.js:79
|
||||
msgid "Username"
|
||||
msgstr "用户名"
|
||||
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"admin/services/microsocks": {
|
||||
"title": "MicroSocks",
|
||||
"action": {
|
||||
"type": "view",
|
||||
"path": "microsocks"
|
||||
},
|
||||
"depends": {
|
||||
"acl": [ "luci-app-microsocks" ],
|
||||
"uci": { "microsocks": true }
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
{
|
||||
"luci-app-microsocks": {
|
||||
"description": "Grant UCI access for luci-app-microsocks",
|
||||
"read": {
|
||||
"ubus": {
|
||||
"service": [ "list" ]
|
||||
},
|
||||
"uci": [ "microsocks" ]
|
||||
},
|
||||
"write": {
|
||||
"uci": [ "microsocks" ]
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user