m/cup
1
0
mirror of https://github.com/sergi0g/cup.git synced 2025-11-17 09:33:38 -05:00

3 Commits

Author SHA1 Message Date
Sergio
b0d0a02182 docs: update example homepage widget to conform to latest config spec
Co-authored-by: Valdr687 <106614142+Valdr687@users.noreply.github.com>
2025-08-29 17:42:56 +03:00
Sergio
c351a38642 docs: update homepage widget example
Remove usage of non-default port 9000 and change server ip placeholder to hostname instead
2025-08-25 19:11:59 +03:00
Sergio
ebb7c18bca fix: include OCI image manifest MIME type in Accept header when
checking for a digest update

Closes #132
2025-08-11 13:01:53 +03:00
4 changed files with 9 additions and 14 deletions

2
Cargo.lock generated
View File

@@ -376,7 +376,7 @@ dependencies = [
[[package]]
name = "cup"
version = "3.4.1"
version = "3.4.2"
dependencies = [
"bollard",
"chrono",

View File

@@ -1,6 +1,6 @@
[package]
name = "cup"
version = "3.4.1"
version = "3.4.2"
edition = "2021"
[dependencies]

View File

@@ -51,29 +51,24 @@ Credit: [@agrmohit](https://github.com/agrmohit)
```yaml
widget:
type: customapi
url: http://<SERVER_IP>:9000/api/v3/json
url: http://<SERVER_HOSTNAME>/api/v3/json
refreshInterval: 10000
method: GET
mappings:
- field:
metrics: monitored_images
- field: metrics.monitored_images
label: Monitored images
format: number
- field:
metrics: up_to_date
- field: metrics.up_to_date
label: Up to date
format: number
- field:
metrics: updates_available
- field: metrics.updates_available
label: Available updates
format: number
- field:
metrics: unknown
- field: metrics.unknown
label: Unknown
format: number
```
Preview:
<Image src={widget2} />
Credit: [@remussamoila](https://github.com/remussamoila)
Credit: [@remussamoila](https://github.com/remussamoila) and [@Valdr687](https://github.com/Valdr687)

View File

@@ -58,7 +58,7 @@ pub async fn get_latest_digest(
protocol, &image.parts.registry, &image.parts.repository, &image.parts.tag
);
let authorization = to_bearer_string(&token);
let headers = [("Accept", Some("application/vnd.docker.distribution.manifest.list.v2+json, application/vnd.docker.distribution.manifest.v2+json, application/vnd.oci.image.index.v1+json")), ("Authorization", authorization.as_deref())];
let headers = [("Accept", Some("application/vnd.docker.distribution.manifest.list.v2+json, application/vnd.docker.distribution.manifest.v2+json, application/vnd.oci.image.index.v1+json, application/vnd.oci.image.manifest.v1+json")), ("Authorization", authorization.as_deref())];
let response = client.head(&url, &headers).await;
let time = start.elapsed().unwrap().as_millis() as u32;