Skip to content

Commit

Permalink
Improve documentation for more restrictive api key use
Browse files Browse the repository at this point in the history
I've added more details so only the least required amount of privileges are given to use this widget and also removed the `uptime` field which is non-functional and [I can't see a reference to it in the code](https://github.com/benphelps/homepage/blob/main/src/widgets/opnsense/component.jsx#L23-L26), so I think it was a leftover from a conversation [here.](gethomepage/homepage#730 (comment))
  • Loading branch information
arcoast authored and shamoon committed Mar 20, 2023
1 parent e6cb809 commit 18f33fa
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/pages/en/services/opnsense.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,16 @@ description: OPNSense Widget Configuration
layout: ../../../layouts/MainLayout.astro
---

API key / secret can be generated via the admin, see [the opnsense docs](https://docs.opnsense.org/development/how-tos/api.html#creating-keys).
The API key & secret can be generated via the webui, by creating a new user at `System/Access/Users` called `homepage-api`, ensuring `Generate a scrambled password to prevent local database logins for this user.` is checked, and then edit the effective privileges selecting `Diagnostics: System Activity` & `Status: Traffic Graph` only. Finally, create a new API key which will download an `apikey.txt` file with your key and secret in it. Paste the contents following the = symbol in both lines to the username and password fields below.

Allowed fields: `["uptime", "cpu", "memory", "wanUpload", "wanDownload"]`.
Allowed fields: `["cpu", "memory", "wanUpload", "wanDownload"]`.

```yaml
widget:
type: opnsense
url: http://opnsense.host.or.ip
username: apikey
password: apisecret
username: key
password: secret
```

*Added in v0.5.6*

0 comments on commit 18f33fa

Please sign in to comment.