mirror of
https://github.com/sergi0g/cup.git
synced 2025-11-18 09:53:43 -05:00
Add support for private registries/images
This commit is contained in:
@@ -1,7 +1,5 @@
|
||||
import Image from "next/image";
|
||||
import { Steps, Callout } from "nextra-theme-docs";
|
||||
import blue from "../../assets/blue_theme.png"
|
||||
import gray from "../../assets/gray_theme.png"
|
||||
import { Steps, Callout, Card, Cards } from "nextra-theme-docs";
|
||||
import { IconPaint, IconLockOpen, IconKey } from '@tabler/icons-react';
|
||||
|
||||
# Configuration
|
||||
|
||||
@@ -15,6 +13,8 @@ For example, if using Podman, you might do
|
||||
$ cup -s /run/user/1000/podman/podman.sock check
|
||||
```
|
||||
|
||||
This option will hopefully be moved to the configuration file soon.
|
||||
|
||||
## Configuration file
|
||||
|
||||
Cup has an option to be configured from a configuration file named `cup.json`.
|
||||
@@ -25,16 +25,23 @@ Create a `cup.json` file somewhere on your system. For binary installs, a path l
|
||||
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
|
||||
Follow the guides below (Theme and Authentication) to make your `cup.json`
|
||||
Follow the guides below to customize your `cup.json`
|
||||
|
||||
<Cards>
|
||||
<Card icon={<IconKey />} title="Authentication" href="/docs/configuration/authentication" />
|
||||
<Card icon={<IconLockOpen />} title="Insecure registries" href="/docs/configuration/insecure-registries" />
|
||||
<Card icon={<IconPaint />} title="Theme" href="/docs/configuration/theme" />
|
||||
</Cards>
|
||||
|
||||
Here's a full example:
|
||||
```json
|
||||
{
|
||||
authentication: {
|
||||
"authentication": {
|
||||
"ghcr.io": "<YOUR_TOKEN_HERE>",
|
||||
"registry-1.docker.io": "<YOUR_TOKEN_HERE>"
|
||||
},
|
||||
theme: "blue"
|
||||
"theme": "blue",
|
||||
"insecure_registries": ["localhost:5000", "my-insecure-registry.example.com"]
|
||||
}
|
||||
```
|
||||
|
||||
@@ -48,51 +55,4 @@ $ cup -c /home/sergio/.config/cup.json check
|
||||
```bash
|
||||
$ docker run -tv /var/run/docker.sock:/var/run/docker.sock -v /home/sergio/.config/cup.json:/config/cup.json ghcr.io/sergi0g/cup -c /config/cup.json serve
|
||||
```
|
||||
</Steps>
|
||||
|
||||
## Theme (server only)
|
||||
|
||||
Cup initially had a blue theme which looked like this:
|
||||
|
||||
<Image alt="Screenshot of blue theme" src={blue} />
|
||||
|
||||
This was replaced by a more neutral theme which is now the default:
|
||||
|
||||
<Image alt="Screenshot of neutral theme" src={gray} />
|
||||
|
||||
However, you can get the old theme back by adding the `theme` key to your `cup.json`
|
||||
Available values are `default` and `blue`.
|
||||
|
||||
Here's an example:
|
||||
|
||||
```json
|
||||
{
|
||||
"theme": "blue",
|
||||
// Other options
|
||||
}
|
||||
```
|
||||
|
||||
## Authentication
|
||||
|
||||
<Callout emoji="⛔">
|
||||
The features described in this section have not been implemented yet.
|
||||
</Callout>
|
||||
|
||||
Some registries (or specific images) may require you to be authenticated. For those, you can modify `cup.json` like this:
|
||||
|
||||
```json
|
||||
{
|
||||
"authentication": {
|
||||
"<YOUR_REGISTRY_DOMAIN_1>": "<YOUR_TOKEN_1>",
|
||||
"<YOUR_REGISTRY_DOMAIN_2>": "<YOUR_TOKEN_2>"
|
||||
// ...
|
||||
},
|
||||
// Other options
|
||||
}
|
||||
```
|
||||
|
||||
You can use any registry, like `ghcr.io`, `quay.io`, `gcr.io`, etc.
|
||||
|
||||
<Callout emoji="⚠️">
|
||||
For Docker Hub, use `registry-1.docker.io`
|
||||
</Callout>
|
||||
</Steps>
|
||||
22
docs/pages/docs/configuration/authentication.mdx
Normal file
22
docs/pages/docs/configuration/authentication.mdx
Normal file
@@ -0,0 +1,22 @@
|
||||
import { Callout } from 'nextra-theme-docs'
|
||||
|
||||
# Authentication
|
||||
|
||||
Some registries (or specific images) may require you to be authenticated. For those, you can modify `cup.json` like this:
|
||||
|
||||
```json
|
||||
{
|
||||
"authentication": {
|
||||
"<YOUR_REGISTRY_DOMAIN_1>": "<YOUR_TOKEN_1>",
|
||||
"<YOUR_REGISTRY_DOMAIN_2>": "<YOUR_TOKEN_2>"
|
||||
// ...
|
||||
},
|
||||
// Other options
|
||||
}
|
||||
```
|
||||
|
||||
You can use any registry, like `ghcr.io`, `quay.io`, `gcr.io`, etc.
|
||||
|
||||
<Callout emoji="⚠️">
|
||||
For Docker Hub, use `registry-1.docker.io`
|
||||
</Callout>
|
||||
20
docs/pages/docs/configuration/insecure-registries.mdx
Normal file
20
docs/pages/docs/configuration/insecure-registries.mdx
Normal file
@@ -0,0 +1,20 @@
|
||||
import { Callout } from 'nextra-theme-docs'
|
||||
|
||||
# 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.
|
||||
|
||||
To solve this problem, `cup.json` has an `"insecure_registries"` option which allows you to specify exceptions
|
||||
|
||||
Here's what it looks like:
|
||||
|
||||
```json
|
||||
{
|
||||
"insecure_registries": ["<INSECURE_REGISTRY_1>", "<INSECURE_REGISTRY_2>"],
|
||||
// Other options
|
||||
}
|
||||
```
|
||||
|
||||
<Callout emoji="⚠️">
|
||||
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 registry is running on port `5000`)
|
||||
</Callout>
|
||||
31
docs/pages/docs/configuration/theme.mdx
Normal file
31
docs/pages/docs/configuration/theme.mdx
Normal file
@@ -0,0 +1,31 @@
|
||||
import { Callout } from "nextra-theme-docs";
|
||||
import Image from "next/image";
|
||||
|
||||
import blue from "../../../assets/blue_theme.png";
|
||||
import gray from "../../../assets/gray_theme.png";
|
||||
|
||||
# Theme
|
||||
|
||||
<Callout emoji="⚠️">
|
||||
This configuration option is only for the server
|
||||
</Callout>
|
||||
|
||||
Cup initially had a blue theme which looked like this:
|
||||
|
||||
<Image alt="Screenshot of blue theme" src={blue} />
|
||||
|
||||
This was replaced by a more neutral theme which is now the default:
|
||||
|
||||
<Image alt="Screenshot of neutral theme" src={gray} />
|
||||
|
||||
However, you can get the old theme back by adding the `theme` key to your `cup.json`
|
||||
Available values are `default` and `blue`.
|
||||
|
||||
Here's an example:
|
||||
|
||||
```json
|
||||
{
|
||||
"theme": "blue",
|
||||
// Other options
|
||||
}
|
||||
```
|
||||
Reference in New Issue
Block a user