Skip to content

Commit 38aba37

Browse files
committedOct 12, 2024
version bumped to 0.4.0, docs update, open api spec
1 parent 02179bd commit 38aba37

14 files changed

+581
-193
lines changed
 

‎CHANGELOG

+34
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,37 @@
1+
# v0.4.0 - October 12, 2024
2+
3+
## Changed
4+
5+
- Bump `apexcharts` version from `3.50.0` to `3.53.0`.
6+
- Bump `htmx` version from `2.0.1` to `2.0.3`.
7+
- Bump server crate versions to latest.
8+
- Generalized HTTP error responses based on RFC9457/RFC7807.
9+
- JSON API returns HTTP 5xx error codes with problem details when daemon connection is lost.
10+
- Logger redacts `upsd_pass` config when server starts with `LOG_LEVEL=DEBUG`
11+
- Logging style is improved in general. No more `{:?}` dumps.
12+
- Remaining battery runtime shown in yMdhms date-time format instead of raw seconds.
13+
- UPS table elements are sorted by UPS name.
14+
- Voltage texts are vertically centered on the UI.
15+
- `health` probe returns HTTP 500 status code when daemon connection is lost.
16+
- `health` probe returns application/json response. Response contains basic info like last sync time, daemon status, and daemon host.
17+
18+
## Added
19+
20+
- Display UPS manufacturer and model information on UPS page.
21+
- `readiness` probe for Kubernetes deployments.
22+
- upsd_client logs upsd protocol messages when `LOG_LEVEL` is set to `TRACE`.
23+
- OpenAPI specification is added to docs.
24+
25+
## Fixed
26+
27+
- A single failing UPS driver distrupts other UPS devices' states.
28+
- Probe endpoints don't support CORS.
29+
- Server doesn't delete failing/disconnected UPS devices from both HTML and JSON responses.
30+
- Texts get overlap in table elements when screen size is too small.
31+
- UPS info page displays incorrect power unit for the apparent power values (ups.power).
32+
- On certain light themes, text colors blend with background and becomes unreadable.
33+
- upsd_client uses wrong error types when list commands fail.
34+
135
# v0.3.2 - September 29, 2024
236

337
## Fixed

‎README.md

+23-18
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,15 @@
22

33
Light weight web interface for [Network UPS Tools](https://networkupstools.org/).
44

5-
**Quickstart:**
5+
<div style="width: 100%; display: flex; justify-content: space-between; flex-direction: row; gap: 1rem;">
6+
7+
![DetailImage](docs/images/details.webp)
8+
9+
![ListImage](docs/images/home.webp)
10+
11+
</div>
12+
13+
## Quickstart
614

715
```shell
816
docker run -e UPSD_ADDR=10.0.0.1 -e UPSD_USER=test -e UPSD_PASS=strongpass -p 9000:9000 ghcr.io/superioone/nut_webgui:latest
@@ -19,13 +27,18 @@ docker run -e UPSD_ADDR=10.0.0.1 -e UPSD_USER=test -e UPSD_PASS=strongpass -p 90
1927
> In order to run `INSTCMD`, make sure the configured user has proper instcmds granted at `upsd.users`. See
2028
> man([upsd.users](https://networkupstools.org/docs/man/upsd.users.html)).
2129
30+
## Examples
31+
32+
- [Kubernetes with EndpointSlice](docs/kubernetes_example.md)
33+
- [Docker compose](docs/docker_compose.md)
34+
2235
## CPU architecture support
2336

2437
| Arch | Test Hardware | Notes |
2538
|--------------|-------------------------|------------------------------------------------------------------------------------------|
26-
| amd64 | AM4 | Works across all amd64 platforms. |
27-
| amd64-v3 | AM4 | Snake oil level optimizations with AVX. It mostly reduces response compression overhead. |
28-
| amd64-v4 | Not Tested | Snake oil level optimizations with AVX-512. |
39+
| amd64 | AM4 CPU | Works across all amd64 platforms. |
40+
| amd64-v3 | AM4 CPU | Snake oil level optimizations with AVX. It mostly reduces response compression overhead. |
41+
| amd64-v4 | Intel® SDE | Snake oil level optimizations with AVX-512. |
2942
| arm64 | Raspberry Pi 4 Model B | |
3043
| armv7 | Qemu emulation | |
3144
| armv6 | Qemu emulation | |
@@ -34,11 +47,6 @@ docker run -e UPSD_ADDR=10.0.0.1 -e UPSD_USER=test -e UPSD_PASS=strongpass -p 90
3447
> amd64 v3 and v4 variants require certain CPU feature flags to run. If you are a crackhead min-max enjoyer (like me), you can use `nut_webgui:latest-amd64-v3` and `nut_webgui:latest-amd64-v4` images.
3548
> See [x86-64 Microarchitecture levels](https://en.wikipedia.org/wiki/X86-64#Microarchitecture_levels) for more details.
3649
37-
![DetailImage](docs/images/details.webp)
38-
39-
![ListImage](docs/images/list.webp)
40-
41-
![INSTCMDImage](docs/images/inst_cmd.webp)
4250

4351
## Command-Line arguments
4452

@@ -67,18 +75,15 @@ docker run -e UPSD_ADDR=10.0.0.1 -e UPSD_USER=test -e UPSD_PASS=strongpass -p 90
6775

6876
## JSON data API
6977

70-
A simple JSON-based API is available for integration and automation purposes. For usage details
71-
see [JSON data API page.](./docs/json_api.md)
72-
73-
## Probes
78+
A simple JSON-based API is available for integration and automation purposes.
7479

75-
The server offers a basic health probe at the `/probes/health` endpoint. This can be used as liveness or readiness
76-
checks in your systems.
80+
OpenAPI 3.1.0 specification files: [json minimized](./docs/openapi3_spec.json) | [yaml](./docs/openapi3_spec.yaml)
7781

78-
## Examples
82+
## Probes
7983

80-
- [Kubernetes with EndpointSlice](docs/kubernetes_example.md)
81-
- [Docker compose](docs/docker_compose.md)
84+
nut_webgui has basic probe endpoints to check server health and readiness:
85+
- `/probes/health`
86+
- `/probes/readiness`
8287

8388
## Building from source and debugging
8489

‎client/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
},
66
"private": true,
77
"name": "nut_webgui-client",
8-
"version": "0.3.2",
8+
"version": "0.4.0",
99
"description": "Bundles all client side web components and dependencies.",
1010
"scripts": {
1111
"dev-js": "esbuild ./src/index.js --bundle --outdir=./dist/debug --target=firefox98,chrome86,safari15 --format=iife --watch=forever",

‎docs/images/details.webp

5.3 KB
Binary file not shown.

‎docs/images/home.webp

50.4 KB
Binary file not shown.

‎docs/images/inst_cmd.webp

-21.1 KB
Binary file not shown.

‎docs/images/list.webp

-8.25 KB
Binary file not shown.

‎docs/json_api.md

-151
This file was deleted.

‎docs/kubernetes_example.md

+14-4
Original file line numberDiff line numberDiff line change
@@ -92,21 +92,31 @@ spec:
9292
value: "20"
9393
resources:
9494
limits:
95-
memory: "128Mi"
95+
memory: "64Mi"
9696
requests:
97-
memory: "128Mi"
97+
memory: "32Mi" # You can go low as 4Mi. As example, single pod uses 2Mi memory for a user with 12 UPS devices.
9898
ports:
9999
- containerPort: 9000
100+
startupProbe:
101+
httpGet:
102+
path: /probes/readiness
103+
port: 9000
104+
initialDelaySeconds: 5
105+
failureThreshold: 15
106+
periodSeconds: 10
100107
livenessProbe:
101108
httpGet:
102109
path: /probes/health
103110
port: 9000
104111
initialDelaySeconds: 5
112+
failureThreshold: 3
105113
periodSeconds: 30
106114
readinessProbe:
107115
httpGet:
108-
path: /probes/health
116+
path: /probes/readiness
109117
port: 9000
110-
118+
initialDelaySeconds: 5
119+
failureThreshold: 3
120+
periodSeconds: 30
111121
```
112122

0 commit comments

Comments
 (0)