summaryrefslogtreecommitdiffhomepage
path: root/applications
diff options
context:
space:
mode:
Diffstat (limited to 'applications')
-rw-r--r--applications/luci-app-tor/Makefile2
-rw-r--r--applications/luci-app-tor/htdocs/luci-static/resources/view/tor/tor.js36
-rw-r--r--applications/luci-app-tor/root/usr/share/luci/menu.d/luci-app-tor.json8
-rw-r--r--applications/luci-app-tor/root/usr/share/rpcd/acl.d/luci-app-tor.json5
4 files changed, 49 insertions, 2 deletions
diff --git a/applications/luci-app-tor/Makefile b/applications/luci-app-tor/Makefile
index caecd80534..47f2e03317 100644
--- a/applications/luci-app-tor/Makefile
+++ b/applications/luci-app-tor/Makefile
@@ -5,7 +5,7 @@ include $(TOPDIR)/rules.mk
LUCI_TITLE:=LuCI app to configure Tor
LUCI_DEPENDS:=+luci-base +tor +tor-hs
-PKG_VERSION:=1.0.0
+PKG_VERSION:=1.1.0
PKG_RELEASE:=1
PKG_MAINTAINER:=Sergey Ponomarev <stokito@gmail.com>
diff --git a/applications/luci-app-tor/htdocs/luci-static/resources/view/tor/tor.js b/applications/luci-app-tor/htdocs/luci-static/resources/view/tor/tor.js
new file mode 100644
index 0000000000..dde7ca75d3
--- /dev/null
+++ b/applications/luci-app-tor/htdocs/luci-static/resources/view/tor/tor.js
@@ -0,0 +1,36 @@
+'use strict';
+'require view';
+'require form';
+'require uci';
+
+
+return view.extend({
+ render: function () {
+ var m, s, o;
+
+ m = new form.Map('tor', _('Tor onion router'),
+ _('For further information <a %s>check the documentation</a>')
+ .format('href="https://openwrt.org/docs/guide-user/services/tor/client" target="_blank" rel="noreferrer"')
+ );
+
+ s = m.section(form.NamedSection, 'conf', 'tor');
+
+ o = s.option(form.DynamicList, 'tail_include', _('Include configs'));
+ o.datatype = 'list(string)';
+
+ o = s.option(form.FileUpload, '_custom_config', _('Custom config'));
+ o.default = '/etc/tor/torrc_custom';
+ o.root_directory = '/etc/tor/';
+ o.optional = true;
+ o.write = function(section_id, formvalue) {
+ let tail_include = uci.get('tor', section_id, 'tail_include');
+ if (!tail_include.includes(formvalue)) {
+ tail_include.push(formvalue);
+ return uci.set('tor', section_id, 'tail_include', tail_include);
+ }
+ };
+
+
+ return m.render();
+ },
+});
diff --git a/applications/luci-app-tor/root/usr/share/luci/menu.d/luci-app-tor.json b/applications/luci-app-tor/root/usr/share/luci/menu.d/luci-app-tor.json
index 19777f6bd0..0ea6d1c935 100644
--- a/applications/luci-app-tor/root/usr/share/luci/menu.d/luci-app-tor.json
+++ b/applications/luci-app-tor/root/usr/share/luci/menu.d/luci-app-tor.json
@@ -19,5 +19,13 @@
"type": "view",
"path": "tor/tor-hs"
}
+ },
+ "admin/services/tor/tor": {
+ "title": "Tor Onion router",
+ "order": 30,
+ "action": {
+ "type": "view",
+ "path": "tor/tor"
+ }
}
}
diff --git a/applications/luci-app-tor/root/usr/share/rpcd/acl.d/luci-app-tor.json b/applications/luci-app-tor/root/usr/share/rpcd/acl.d/luci-app-tor.json
index 0d109b1c98..8095a17fda 100644
--- a/applications/luci-app-tor/root/usr/share/rpcd/acl.d/luci-app-tor.json
+++ b/applications/luci-app-tor/root/usr/share/rpcd/acl.d/luci-app-tor.json
@@ -16,7 +16,10 @@
"uci": [
"tor",
"tor-hs"
- ]
+ ],
+ "file": {
+ "/etc/tor/*": [ "write" ]
+ }
}
}
}