mirror of
https://github.com/DI0IK/homepage-plus.git
synced 2025-07-16 01:39:49 +00:00
Feature: OpenWRT service widget (#2782)
* Feat: OpenWRT widget implementation * Update proxy.js * fixes from review --------- Co-authored-by: shamoon <4887959+shamoon@users.noreply.github.com>
This commit is contained in:
parent
d20cdbb9ab
commit
86740c6d7b
10 changed files with 280 additions and 0 deletions
54
docs/widgets/services/openwrt.md
Normal file
54
docs/widgets/services/openwrt.md
Normal file
|
@ -0,0 +1,54 @@
|
|||
---
|
||||
title: OpenWRT
|
||||
description: OpenWRT widget configuration
|
||||
---
|
||||
|
||||
Learn more about [OpenWRT](https://openwrt.org/).
|
||||
|
||||
Provides information from OpenWRT
|
||||
|
||||
```yaml
|
||||
widget:
|
||||
type: openwrt
|
||||
url: http://host.or.ip
|
||||
username: homepage
|
||||
password: pass
|
||||
interfaceName: eth0 # optional
|
||||
```
|
||||
|
||||
## Interface
|
||||
|
||||
Setting `interfaceName` (e.g. eth0) will display information for that particular device, otherwise the widget will display general system info.
|
||||
|
||||
## Authorization
|
||||
|
||||
In order for homepage to access the OpenWRT RPC endpoints you will need to [create an ACL](https://openwrt.org/docs/techref/ubus#acls) and [new user](https://openwrt.org/docs/techref/ubus#authentication) in OpenWRT.
|
||||
|
||||
Create an ACL named `homepage.json` in `/usr/share/rpcd/acl.d/`, the following permissions will suffice:
|
||||
|
||||
```
|
||||
{
|
||||
"homepage": {
|
||||
"description": "Homepage widget",
|
||||
"read": {
|
||||
"ubus": {
|
||||
"network.interface.wan": ["status"],
|
||||
"network.interface.lan": ["status"],
|
||||
"network.device": ["status"]
|
||||
"system": ["info"]
|
||||
}
|
||||
},
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
Then add a user that will use that ACL in `/etc/config/rpc`:
|
||||
|
||||
```config login
|
||||
option username 'homepage'
|
||||
option password '<password>'
|
||||
list read homepage
|
||||
list write '*'
|
||||
```
|
||||
|
||||
This username and password will be used in Homepage's services.yaml to grant access.
|
Loading…
Add table
Add a link
Reference in a new issue