m/cup
1
0
mirror of https://github.com/sergi0g/cup.git synced 2025-11-08 05:03:49 -05:00

3 Commits

Author SHA1 Message Date
Sergio
c745a249f5 fix: hide version badge in web UI on small screens 2025-10-17 17:26:44 +03:00
Sergio
90af772dd7 chore: bump project version 2025-10-14 18:06:50 +03:00
makonde-on-git
6ab06db5cb feat: allow usage without a daemon (#142) 2025-10-14 18:05:11 +03:00
6 changed files with 22 additions and 4 deletions

View File

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

View File

@@ -70,7 +70,7 @@
},
"socket": {
"type": "string",
"description": "The path to the unix socket you would like Cup to use for communication with the Docker daemon. Useful if you're trying to use Cup with Podman.",
"description": "The path to the unix socket you would like Cup to use for communication with the Docker daemon. Useful if you're trying to use Cup with Podman. To disable use \"none\" as value.",
"minLength": 1
},
"servers": {

View File

@@ -23,7 +23,7 @@ For example, if using Podman, you might do
$ cup -s /run/user/1000/podman/podman.sock check
```
This option is also available in the configuration file and it's best to put it there.
This option is also available in the configuration file and it's best to put it there. If both are defined the CLI `-s` option takes precedence.
<Cards.Card
icon={<IconPlug />}
@@ -31,6 +31,8 @@ This option is also available in the configuration file and it's best to put it
href="/docs/configuration/socket"
/>
To disable Docker/Podman socket use "none" as value.
## Configuration file
Cup has an option to be configured from a configuration file named `cup.json`.

View File

@@ -17,3 +17,12 @@ You can also specify a TCP socket if you're using a remote Docker host or a [pro
// Other options
}
```
Or use the "none" value to disable any Docker/Podman query:
```jsonc
{
"socket": "none"
// Other options
}
```

View File

@@ -41,6 +41,9 @@ pub async fn get_images_from_docker_daemon(
ctx: &Context,
references: &Option<Vec<String>>,
) -> Vec<Image> {
if ctx.config.socket.as_deref() == Some("none") {
return vec![];
}
let client: Docker = create_docker_client(ctx.config.socket.as_deref());
let mut swarm_images = match client.list_services::<String>(None).await {
Ok(services) => services
@@ -96,6 +99,10 @@ pub async fn get_images_from_docker_daemon(
}
pub async fn get_in_use_images(ctx: &Context) -> Vec<String> {
if ctx.config.socket.as_deref() == Some("none") {
return vec![];
}
let client: Docker = create_docker_client(ctx.config.socket.as_deref());
let containers = match client

View File

@@ -4,7 +4,7 @@ import { theme } from "../theme";
export default function Badge({ from, to }: { from: string; to: string }) {
return (
<span
className={`inline-flex items-center rounded-full bg-${theme}-50 px-2 py-1 text-xs font-medium text-${theme}-700 ring-1 ring-inset ring-${theme}-700/10 dark:bg-${theme}-400/10 dark:text-${theme}-400 dark:ring-${theme}-400/30 break-keep`}
className={`hidden sm:block inline-flex items-center rounded-full bg-${theme}-50 px-2 py-1 text-xs font-medium text-${theme}-700 ring-1 ring-inset ring-${theme}-700/10 dark:bg-${theme}-400/10 dark:text-${theme}-400 dark:ring-${theme}-400/30 break-keep`}
>
{from}
<ArrowRight className="size-3" />