Skip to content

Commit

Permalink
Update docs with community requested changes and bump version
Browse files Browse the repository at this point in the history
  • Loading branch information
sergi0g committed Sep 9, 2024
1 parent 2c120ff commit 38bf187
Show file tree
Hide file tree
Showing 7 changed files with 103 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "cup"
version = "2.2.1"
version = "2.2.2"
edition = "2021"

[dependencies]
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions docs/pages/docs/_meta.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@
"usage": {
"title": "Usage"
},
"community-resources": {
"title": "Community Resources"
},
"nightly": {
"title": "Using the latest version"
}
Expand Down
23 changes: 23 additions & 0 deletions docs/pages/docs/community-resources/docker-compose.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Docker Compose

Many users find it useful to run Cup with Docker Compose, as it enables them to have it constantly running in the background and easily control it. Cup's lightweight resource usae makes it ideal for this use case.

There have been requests for an official Docker Compose file, but I believe you should customize it to your needs.

Here is an example of what I would use (by [@ioverho](https://github.com/ioverho)):

```yaml
services:
cup:
image: ghcr.io/sergi0g/cup:latest
container_name: cup # Optional
restart: unless-stopped
command: -c /config/cup.json serve
ports:
- 8000:8000
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- ./cup.json:/config/cup.json
```
This can be customized further of course, if you choose to use a different port, another config location, or would like to change something else. Have fun!
75 changes: 75 additions & 0 deletions docs/pages/docs/community-resources/homepage-widget.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
import Image from 'next/image';
import widget1 from '../../../assets/350767810-42eccc89-bdfd-426a-a113-653abe7483d8.png'
import widget2 from '../../../assets/358304960-e9f26767-51f7-4b5a-8b74-a5811019497b.jpeg'

# Homepage Widget

Some users have asked for a homepage widget.

## Docker Compose with the widget configured via labels:

```yaml
services:
cup:
image: ghcr.io/sergi0g/cup
container_name: cup
command: -c /config/cup.json serve -p 8000
volumes:
- ./config/cup.json:/config/cup.json
- /var/run/docker.sock:/var/run/docker.sock
ports:
- 8000:8000
restart: unless-stopped
labels:
homepage.group: Network
homepage.name: Cup
homepage.icon: /icons/cup-with-straw.png
homepage.href: http://myserver:8000
homepage.ping: http://myserver:8000
homepage.description: Checks for container updates
homepage.widget.type: customapi
homepage.widget.url: http://myserver:8000/json
homepage.widget.mappings[0].label: Monitoring
homepage.widget.mappings[0].field.metrics: monitored_images
homepage.widget.mappings[0].format: number
homepage.widget.mappings[1].label: Up to date
homepage.widget.mappings[1].field.metrics: up_to_date
homepage.widget.mappings[1].format: number
homepage.widget.mappings[2].label: Updates
homepage.widget.mappings[2].field.metrics: update_available
homepage.widget.mappings[2].format: number
```
Preview:
<Image src={widget1}/>
Credit: [@agrmohit](https://github.com/agrmohit)
## Widget in Homepage's config file format:
```yaml
widget:
type: customapi
url: http://<SERVER_IP>:9000/json
refreshInterval: 10000
method: GET
mappings:
- field:
metrics: monitored_images
label: Monitored images
format: number
- field:
metrics: up_to_date
label: Up to date
format: number
- field:
metrics: update_available
label: Available updates
format: number
- field:
metrics: unknown
label: Unknown
format: number
```
Preview:
<Image src={widget2}/>
Credit: [@remussamoila](https://github.com/remussamoila)

0 comments on commit 38bf187

Please sign in to comment.