m/cup
1
0
mirror of https://github.com/sergi0g/cup.git synced 2025-11-17 01:23:39 -05:00

Start updating docs
Some checks failed
Deploy github pages / build (push) Has been cancelled
Deploy github pages / deploy (push) Has been cancelled

This commit is contained in:
Sergio
2024-12-20 21:20:50 +02:00
parent 15eb553e50
commit 31f7bfbbcb
10 changed files with 65 additions and 54 deletions

View File

@@ -57,7 +57,6 @@ export function Home() {
<div className="*:-0 mt-auto grid w-fit grid-cols-2 gap-4 *:flex *:items-center *:gap-2 *:rounded-lg *:px-3 *:py-2"> <div className="*:-0 mt-auto grid w-fit grid-cols-2 gap-4 *:flex *:items-center *:gap-2 *:rounded-lg *:px-3 *:py-2">
<a <a
href="/docs" href="/docs"
target="_blank"
className="hide-focus group h-full bg-black text-white dark:bg-white dark:text-black" className="hide-focus group h-full bg-black text-white dark:bg-white dark:text-black"
> >
Get started Get started

View File

@@ -20,8 +20,8 @@ class DocumentProMax extends Document {
sizes="180x180" sizes="180x180"
href="/apple-touch-icon.png" href="/apple-touch-icon.png"
/> />
<link rel="icon" type="image/svg+xml" href="favicon.svg" /> <link rel="icon" type="image/svg+xml" href="/favicon.svg" />
<link rel="icon" type="image/x-icon" href="favicon.ico" /> <link rel="icon" type="image/x-icon" href="/favicon.ico" />
<meta <meta
name="theme-color" name="theme-color"
media="(prefers-color-scheme: light)" media="(prefers-color-scheme: light)"

View File

@@ -5,7 +5,7 @@
}, },
"index": { "index": {
"type": "page", "type": "page",
"title": "Cup", "title": "Cup - The easiest way to manage your container updates",
"display": "hidden", "display": "hidden",
"theme": { "theme": {
"layout": "raw" "layout": "raw"

View File

@@ -28,7 +28,7 @@ services:
homepage.ping: http://myserver:8000 homepage.ping: http://myserver:8000
homepage.description: Checks for container updates homepage.description: Checks for container updates
homepage.widget.type: customapi homepage.widget.type: customapi
homepage.widget.url: http://myserver:8000/json homepage.widget.url: http://myserver:8000/api/v3/json
homepage.widget.mappings[0].label: Monitoring homepage.widget.mappings[0].label: Monitoring
homepage.widget.mappings[0].field.metrics: monitored_images homepage.widget.mappings[0].field.metrics: monitored_images
homepage.widget.mappings[0].format: number homepage.widget.mappings[0].format: number
@@ -51,7 +51,7 @@ Credit: [@agrmohit](https://github.com/agrmohit)
```yaml ```yaml
widget: widget:
type: customapi type: customapi
url: http://<SERVER_IP>:9000/json url: http://<SERVER_IP>:9000/api/v3/json
refreshInterval: 10000 refreshInterval: 10000
method: GET method: GET
mappings: mappings:

View File

@@ -33,7 +33,7 @@ Cup has an option to be configured from a configuration file named `cup.json`.
<Steps> <Steps>
### Create the configuration file ### Create the configuration file
Create a `cup.json` file somewhere on your system. For binary installs, a path like `~/.config/cup.json` is recommended. Create a `cup.json` file somewhere on your system. For binary installs, a path like `~/.config/cup.json` is recommended.
If you're running with Docker, you can create a `cup.json` in the directory you're running cup and mount it into the container. _In the next section you will need to use the path where you **mounted** the file_ If you're running with Docker, you can create a `cup.json` in the directory you're running Cup and mount it into the container. _In the next section you will need to use the path where you **mounted** the file_
### Configure Cup from the configuration file ### Configure Cup from the configuration file
@@ -66,6 +66,11 @@ Here's a full example:
} }
``` ```
<Callout>
If you want autocompletions and error checking for your editor, there is a JSON schema available.
Use it by adding a `"$schema": "https://raw.githubusercontent.com/sergi0g/cup/main/cup.schema.json"` entry in your `cup.json` file.
</Callout>
### Run Cup with the new configuration file ### Run Cup with the new configuration file
To let Cup know that you'd like it to use a custom configuration file, you can use the `-c` flag, followed by the _absolute_ path of the file. To let Cup know that you'd like it to use a custom configuration file, you can use the `-c` flag, followed by the _absolute_ path of the file.

View File

@@ -6,9 +6,15 @@ Some registries (or specific images) may require you to be authenticated. For th
```json ```json
{ {
"authentication": { "registries": {
"<YOUR_REGISTRY_DOMAIN_1>": "<YOUR_TOKEN_1>", "<YOUR_REGISTRY_DOMAIN_1>": {
"<YOUR_REGISTRY_DOMAIN_2>": "<YOUR_TOKEN_2>" "authentication": "<YOUR_TOKEN_1>"
// Other options
},
"<YOUR_REGISTRY_DOMAIN_2>" {
"authentication": "<YOUR_TOKEN_2>"
// Other options
},
// ... // ...
} }
// Other options // Other options

View File

@@ -2,21 +2,31 @@ import { Callout } from "nextra-theme-docs";
# Insecure registries # Insecure registries
For the best security, Cup only connects to registries over SSL (HTTPS) by default. However, for people running a local registry that haven't configured SSL, this may be a problem. For the best security, Cup only connects to registries over SSL (HTTPS) by default. However, for people running a local registry that doesn't support SSL, this may be a problem.
To solve this problem, `cup.json` has an `"insecure_registries"` option which allows you to specify exceptions To solve this problem, you can specify exceptions in your `cup.json`.
Here's what it looks like: Here's what it looks like:
```json ```json
{ {
"insecure_registries": ["<INSECURE_REGISTRY_1>", "<INSECURE_REGISTRY_2>"] "registries": {
"<INSECURE_REGISTRY_1>": {
"insecure": true
// Other options
},
"<INSECURE_REGISTRY_2>" {
"insecure": true
// Other options
},
// ...
}
// Other options // Other options
} }
``` ```
<Callout emoji="⚠️"> <Callout emoji="⚠️">
When configuring an insecure registry that doesn't run on port 80, don't When configuring an insecure registry that doesn't run on port 80, don't
forget to specify it (i.e. use `localhost:5000` instead of `localhost` if your forget to specify the port (i.e. use `localhost:5000` instead of `localhost` if your
registry is running on port `5000`) registry is running on port `5000`)
</Callout> </Callout>

View File

@@ -17,7 +17,7 @@ This was replaced by a more neutral theme which is now the default:
<Image alt="Screenshot of neutral theme" src={neutral} /> <Image alt="Screenshot of neutral theme" src={neutral} />
However, you can get the old theme back by adding the `theme` key to your `cup.json` However, you can get the old theme back by adding the `theme` key to your `cup.json`
Available values are `default` and `blue`. Available options are `default` and `blue`.
Here's an example: Here's an example:

View File

@@ -11,66 +11,53 @@ Cup's CLI provides the `cup check` command.
```ansi ```ansi
$ cup check $ cup check
nginx:alpine Update available 
redis:7 Update available mysql:8.0 Major update
node:20 Major update
postgres:16-alpine Major update
rust:1.80.1-alpine Minor update
redis:7.4.0 Patch update
nginx:alpine Update available
redis:alpine Update available redis:alpine Update available
... ubuntu:latest Update available
centos:7 Up to date node:iron Up to date
mcr.microsoft.com/devcontainers/go:0-1.19-bullseye Up to date 2fauth/2fauth:latest Up to date
rockylinux:9-minimal Up to date c1982/sdns:latest Up to date
rabbitmq:3.11.9-management Up to date registry.acme.com/acme-server:latest Unknown
... INFO ✨ Checked 58 images in 3772ms
some/deleted:image Unknown
[38:5:86mINFO ✨ Checked 58 images in 3772ms
``` ```
### Check for updates to specific images ### Check for updates to specific images
```ansi ```ansi
$ cup check node:latest $ cup check node:latest
node:latest Update available node:latest Update available
[38:5:86mINFO ✨ Checked 1 images in 1310ms INFO ✨ Checked 1 images in 1310ms
``` ```
```ansi ```ansi
$ cup check node:latest $ cup check nextcloud:30 postgres:14 mysql:8.0
nextcloud:30 Update available nextcloud:30 Update available
postgres:14 Update available postgres:14 Update available
mysql:8.0 Up to date mysql:8.0 Up to date
[38:5:86mINFO ✨ Checked 3 images in 1769ms INFO ✨ Checked 3 images in 1769ms
``` ```
## Enable icons ## Enable icons
You can also enable icons if you have a [Nerd Font](https://nerdfonts.com) installed. You can also enable icons if you have a [Nerd Font](https://nerdfonts.com) installed.
<Image src={cup} unoptimized /> <Image src={cup} alt="GIF of Cup's CLI" unoptimized />
## JSON output ## JSON output
When integrating Cup with other services (e.g. webhooks or a dashboard), you may find Cup's JSON output functionality useful. When integrating Cup with other services (e.g. webhooks or a dashboard), you may find Cup's JSON output functionality useful.
It provides some useful metrics (see [server](/docs/usage/server) for more information), along with a list of images and whether they have an update or not. It provides some useful metrics (see [server](/docs/usage/server) for more information), along with a list of images and whether they have an update or not. Note that at the moment it does not match the detailed API the server provides.
``` ```
$ cup check -r $ cup check -r
{"metrics":{"update_available":4,"monitored_images":25,"unknown":1,"up_to_date":20},"images":{"ghcr.io/immich-app/immich-server:v1.106.4":false,"portainer/portainer-ce:2.20.3-alpine":false,"ghcr.io/runtipi/runtipi:v3.4.1":false,...}} {"metrics":{"monitored_images":26,"up_to_date":2,"updates_available":23,"major_updates":8,"minor_updates":6,"patch_updates":2,"other_updates":7,"unknown":1},"images":{"ghcr.io/immich-app/immich-server:v1.106.4":false,"portainer/portainer-ce:2.20.3-alpine":false,"ghcr.io/runtipi/runtipi:v3.4.1":false,...}}
```
Here is how it would look in Typescript:
```ts
interface CupData {
metrics: {
monitored_images: number;
up_to_date: number;
update_available: number;
unknown: number;
};
images: {
[image: string]: boolean | null;
};
}
``` ```
## Usage with Docker ## Usage with Docker
@@ -79,12 +66,12 @@ If you're using the Docker image, just replace all occurences of `cup` in the ex
For example, this: For example, this:
```bash /check node:latest/ ```bash
$ cup check node:latest $ cup check node:latest
``` ```
becomes: becomes:
```bash /check node:latest/ ```bash
$ docker run -tv /var/run/docker.sock:/var/run/docker.sock ghcr.io/sergi0g/cup check node:latest $ docker run -tv /var/run/docker.sock:/var/run/docker.sock ghcr.io/sergi0g/cup check node:latest
``` ```

View File

@@ -10,6 +10,10 @@ export default {
return { return {
titleTemplate: "Cup %s", titleTemplate: "Cup %s",
}; };
} else {
return {
titleTemplate: "%s"
}
} }
}, },
head: () => { head: () => {