luci-app-uhttpd: some fixes because of the lua to javascript porting
authorAyushman Tripathi <ayushmantripathi7724@gmail.com>
Wed, 21 Jun 2023 13:44:19 +0000 (19:14 +0530)
committerFlorian Eckert <fe@dev.tdt.de>
Thu, 22 Jun 2023 14:02:29 +0000 (16:02 +0200)
* Fix menu path for uhttpd
* Add hint that files could only be uploaded to /etc/luci-uploads
* Rename not knowing enable_delete FileUpload option to enable_remove
* Update ACL list

Signed-off-by: Ayushman Tripathi <ayushmantripathi7724@gmail.com>
Improvement of the commit title and description
Signed-off-by: Florian Eckert <fe@dev.tdt.de>
applications/luci-app-uhttpd/htdocs/luci-static/resources/view/uhttpd/uhttpd.js
applications/luci-app-uhttpd/root/usr/share/luci/menu.d/luci-app-uhttpd.json
applications/luci-app-uhttpd/root/usr/share/rpcd/acl.d/luci-app-uhttpd.json

index db659f659b01ed15ba8f2b1c2e4c64fa8ca34c6d..3619e0835f734756e4148054ebf9255f53382b09 100644 (file)
@@ -103,13 +103,13 @@ return view.extend({
                rfc1918Filter.default = rfc1918Filter.enabled;
                rfc1918Filter.rmempty = false;
 
-               cert_file = ucs.taboption('general', form.FileUpload, 'cert', _('HTTPS Certificate (DER or PEM format)'));
+               cert_file = ucs.taboption('general', form.FileUpload, 'cert', _('HTTPS Certificate (DER or PEM format)'), _('Files can only be uploaded and saved to the /etc/luci-uploads directory.'));
                cert_file.root_directory = '/';
-               cert_file.enable_delete = false;
+               cert_file.enable_remove = false;
 
-               key_file = ucs.taboption('general', form.FileUpload, 'key', _('HTTPS Private Key (DER or PEM format)'));
+               key_file = ucs.taboption('general', form.FileUpload, 'key', _('HTTPS Private Key (DER or PEM format)'), _('Files can only be uploaded and saved to the /etc/luci-uploads directory.'));
                key_file.root_directory = '/';
-               key_file.enable_delete = false;
+               key_file.enable_remove = false;
 
                var removeOld = ucs.taboption('general', form.Button, 'remove_old', _('Remove old certificate and key'), _('uHTTPd will generate a new self-signed certificate using the configuration shown below.'));
                removeOld.inputstyle = 'remove';
index 03a97cb2e700f1563cc03d6d73184290e937f37f..e372a37d0fc8c22bb69963d2bce597f4a1b474a1 100644 (file)
@@ -3,7 +3,7 @@
                "title": "uHTTPd",
                "action": {
                        "type": "view",
-                       "path": "uhttpd"
+                       "path": "uhttpd/uhttpd"
                },
                "depends": {
                        "acl": [ "luci-app-uhttpd" ],
index ab946db77ad6981f20a89a319ce8675d6d4ed5e7..f03d0d1a458b921eb897e427275538d9bd9b51a4 100644 (file)
@@ -2,16 +2,18 @@
        "luci-app-uhttpd": {
                "description": "Grant UCI access for luci-app-uhttpd",
                "read": {
-                       "uci": [ "uhttpd" ],
+                       "uci": ["uhttpd"],
                        "file": {
-                               "/*": ["read"]
+                               "/*": ["read"],
+                               "/etc/init.d/uhttpd restart": ["exec"]
                        }
                },
                "write": {
-                       "uci": [ "uhttpd" ],
+                       "uci": ["uhttpd"],
                        "file": {
-                               "/*": ["write"],
-                               "/etc/init.d/uhttpd restart": ["exec"]
+                               "/etc/luci-uploads/*": ["write"],
+                               "/etc/uhttpd.key": ["write"],
+                               "/etc/uhttpd.crt": ["write"]
                        }
                }
        }