From 571cfa2231383c41a157f28c18dbc39160346fea Mon Sep 17 00:00:00 2001 From: russkinz <68681047+russkinz@users.noreply.github.com> Date: Wed, 28 Feb 2024 12:26:06 +1300 Subject: [PATCH] Update openwrt.md Update homepage.json detail to add a missing comma, add json formatting Add guidance on creating a crypt(5) password hash for improved security (suggested by OpenWRT community dev) Correct /etc/config/rpc to /etc/config/rpcd Remove additional (not required) permissions from rpcd --- docs/widgets/services/openwrt.md | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/docs/widgets/services/openwrt.md b/docs/widgets/services/openwrt.md index c1c3ee94d..7b82daec8 100644 --- a/docs/widgets/services/openwrt.md +++ b/docs/widgets/services/openwrt.md @@ -26,7 +26,7 @@ In order for homepage to access the OpenWRT RPC endpoints you will need to [crea Create an ACL named `homepage.json` in `/usr/share/rpcd/acl.d/`, the following permissions will suffice: -``` +```json { "homepage": { "description": "Homepage widget", @@ -34,21 +34,25 @@ Create an ACL named `homepage.json` in `/usr/share/rpcd/acl.d/`, the following p "ubus": { "network.interface.wan": ["status"], "network.interface.lan": ["status"], - "network.device": ["status"] + "network.device": ["status"], "system": ["info"] } }, } } ``` +Create a `crypt(5)` password hash using the following command in the OpenWRT shell: +```sh +uhttpd -m "" +``` -Then add a user that will use that ACL in `/etc/config/rpc`: +Then add a user that will use that ACL in `/etc/config/rpcd`: -```config login +``` +config login option username 'homepage' - option password '' + option password '' list read homepage - list write '*' ``` This username and password will be used in Homepage's services.yaml to grant access.