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

117 Commits
v3.0.2 ... v3

Author SHA1 Message Date
Sergio
5aeef51961 Update docs 2025-02-28 20:19:48 +02:00
Sergio
b015f67da4 Update links in docs 2025-02-28 19:59:48 +02:00
Sergio
0f0941b555 Add new docs pages 2025-02-28 19:58:02 +02:00
Sergio
fa2629bb4f Update docs 2025-02-28 19:37:48 +02:00
Sergio
e2cc245a50 Update Cup GIF 2025-02-28 19:14:31 +02:00
Sergio
ce26ba8926 Update screenshots 2025-02-28 18:29:45 +02:00
Sergio
f268edf021 Fix refresh button sizing 2025-02-28 18:19:35 +02:00
Sergio
b378e472d6 Update community resources to reflect API changes 2025-02-28 17:42:00 +02:00
Sergio
d841861752 Revert a dbg that was accidentally committed 2025-02-28 17:33:24 +02:00
Sergio
4caa117a4e Fix bugs in Liquid 2025-02-28 17:30:57 +02:00
Sergio
02c5d00e66 Remove caniuse-lite from package.json 2025-02-28 17:20:13 +02:00
Sergio
040513dfd7 Improve image component in web 2025-02-28 17:07:13 +02:00
Sergio
ad03004f33 Improve loading page in web 2025-02-28 16:50:29 +02:00
Sergio
becf647f07 Fix typo in docs 2025-02-27 22:00:19 +02:00
Sergio
c437316291 Update docs 2025-02-27 21:58:49 +02:00
Sergio
2461f3b94b Update docs 2025-02-27 21:57:57 +02:00
Sergio
dd64b62f4b Update docs 2025-02-27 21:57:34 +02:00
Sergio
d77871cd92 Update docs 2025-02-27 21:54:45 +02:00
Sergio
c3dd4d2462 Remove unused code from docs 2025-02-27 21:52:56 +02:00
Sergio
3cfa4771eb Probably a bad attempt at fixing a huge bug in multiple servers 2025-02-27 21:41:23 +02:00
Sergio
14f3f1d19b Update README.md 2025-02-27 21:21:22 +02:00
Sergio
94a65f204d re-redesign docs home page 2025-02-27 21:15:48 +02:00
Sergio
8d0da37e36 Fix more broken docs styles 2025-02-21 19:51:03 +02:00
Sergio
780d7a088d Fix eslint warnings in docs 2025-02-21 19:37:36 +02:00
Sergio
bcb9f63735 Fix broken styles 2025-02-21 19:33:30 +02:00
Sergio
4d691dd5fa Serialize current and local values to avoid having to recompute them when fetching API data. Also fixes the bug where the versions aren't displayed in the CLI output for remote servers 2025-02-21 17:09:00 +02:00
Sergio
685219ea62 Add option to refresh all servers 2025-02-21 17:05:32 +02:00
Sergio
756462cd7c Make local images collapsible 2025-02-21 16:35:15 +02:00
Sergio
f020ac0906 Fix clippy lint (this code has been there since... forever, why hasn't this been detected) 2025-02-21 16:02:03 +02:00
Sergio
4b03a48d88 Tiny web UI changes 2025-02-19 20:31:57 +02:00
Sergio
ba1cfac64b Add base path to docs (nothing changes, I just want to override it) 2025-02-18 18:06:19 +02:00
Sergio
05d4c7c630 I think you can guess 2025-02-18 17:47:14 +02:00
Sergio
cf22ec300f Fix a few more clippy lints 2025-02-18 16:58:25 +02:00
Sergio
5b428dbf67 Fix some clippy lints 2025-02-18 16:57:08 +02:00
Sergio
787a730ab5 Update colors 2025-02-15 16:08:55 +02:00
Sergio
925989fd80 Redesign UI a bit 2025-02-15 14:38:58 +02:00
Sergio
5656003058 Fix small bug in API 2025-02-15 13:02:33 +02:00
Sergio
f79d7ff03a Switch to Lucide Icons 2025-02-15 12:50:59 +02:00
Sergio
550fb955a3 Refactor logging, create context for passing around between functions instead of config 2025-02-14 19:24:35 +02:00
Sergio
6ae95bf83b Update API and improve CLI output 2025-02-14 18:28:18 +02:00
Sergio
2262df0355 Fix typo in homepage 2025-02-14 18:27:29 +02:00
Sergio
1beb7dc020 Add docs for multiple servers 2025-02-07 17:44:46 +02:00
Sergio
a0de565367 Update docs about JSON CLI output, fix small typo on homepage 2025-02-07 17:32:19 +02:00
Sergio
0314ef2f05 Add multiple server support to Liquid UI, CSS fixes 2025-02-07 17:25:06 +02:00
Sergio
f1c8a45122 Remove unused components in docs, fix errors, improve docs workflow 2025-02-02 15:00:41 +02:00
Sergio
ce3f8176f1 Skip deploying docs for branches other than main 2025-02-02 14:52:36 +02:00
Sergio
8b520182ed Update docs actions (attempt 1) 2025-02-02 14:48:40 +02:00
Sergio
e8fee79d20 Merge branch 'main' into v3 2025-02-02 14:45:37 +02:00
Sergio
24f160803a Add docs about integrations 2025-02-02 14:33:14 +02:00
Sergio
2ef77c9a55 Fix mobile dialog not taking screen width 2025-02-01 13:53:15 +02:00
Sergio
a5bbdd0e33 Upgrade docs 2025-02-01 13:41:21 +02:00
Sergio
b5aa0309ee Tiny improvement to version handling, add a new debug log 2025-02-01 10:28:17 +02:00
Sergio
4bbb53cd67 Show unknown when image tag does not exist 2025-01-15 17:09:19 +02:00
Sergio
3ac6fb57e9 Fix crash when checking a remote tag and it is the latest available 2025-01-15 16:44:26 +02:00
Sergio
ead74dadd6 Update docs
Some checks failed
Deploy github pages / build (push) Has been cancelled
Deploy github pages / deploy (push) Has been cancelled
2025-01-05 13:48:04 +02:00
Sergio
6e6afdb757 Update docs (#55) 2025-01-05 13:46:42 +02:00
Sergio
0c10134829 Fix #55 2025-01-05 13:42:15 +02:00
Sergio
c0c7f7c0e9 Finished basic functionality for multiple servers in the backend.
No special CLI or Liquid support yet and also no refresh support
2025-01-03 16:10:17 +02:00
Sergio
aeeffaccba Get updates from multiple servers (part one: get the data) 2025-01-02 20:11:31 +02:00
Sergio
a1711b7ac8 Fix workflows
Some checks failed
Deploy github pages / build (push) Has been cancelled
Deploy github pages / deploy (push) Has been cancelled
https://github.com/cross-rs/cross/issues/1561
2025-01-02 15:09:35 +02:00
Sergio
9d628e3ab2 Implement refresh schedule 2025-01-02 14:37:33 +02:00
Sergio
d3b18a6587 Update schema 2025-01-02 14:07:10 +02:00
Sergio
76a812f52f Update tailwind CSS safelist 2025-01-02 13:23:26 +02:00
Sergio
fe779c9c4e Probably meaningless change of some Option<&String>s to Option<&str>s 2025-01-02 13:00:32 +02:00
Sergio
84609d5189 Various small changes and optimizations related to timekeeping, logging and JSON handling. Binary size shrunk by 0.2 MB! 2025-01-02 12:48:35 +02:00
Sergio
ded441cf75 Add support for connecting with both unix and http docker sockets. Hasn't been tested yet. 2025-01-02 12:47:52 +02:00
Sergio
0a8295fff4 Improve semver version handling (decrease false positives)
Some checks are pending
Deploy github pages / build (push) Waiting to run
Deploy github pages / deploy (push) Blocked by required conditions
2025-01-01 15:25:49 +02:00
Sergio
9c8e6ccdea Work on liquid a bit, format code 2025-01-01 14:29:17 +02:00
Sergio
f1e1bcbf1c update docs 2025-01-01 12:51:19 +02:00
Sergio
31f7bfbbcb Start updating docs
Some checks failed
Deploy github pages / build (push) Has been cancelled
Deploy github pages / deploy (push) Has been cancelled
2024-12-20 21:20:50 +02:00
Sergio
15eb553e50 Update "try it out" command 2024-12-20 20:33:03 +02:00
Sergio
359147770f Create basic homepage and format docs 2024-12-20 19:24:22 +02:00
Sergio
0a4e302322 Maybe I shouldn't have removed that h-full 2024-12-20 18:26:27 +02:00
Sergio
5ed64c92fd Change statistic style on large screens 2024-12-20 18:20:28 +02:00
Sergio
6d08d75ac3 Make statistics grid smaller on mobile 2024-12-20 18:13:15 +02:00
Sergio
dc38b84e87 Bug fixes for the previous UI improvements (I tested properly this time) 2024-12-20 17:49:21 +02:00
Sergio
09b6880295 Various frontend improvements 2024-12-20 17:35:39 +02:00
Sergio
4f1075b2b2 Add error message to API response 2024-12-20 17:00:41 +02:00
Sergio
c84270603f Readd theme-color meta tag and make it work properly 2024-12-08 20:59:47 +02:00
Sergio
4aa28f2cc5 Remove incorrect theme-color meta property 2024-12-08 19:33:50 +02:00
Sergio
eadda5f776 Add servers option (no-op at the moment) 2024-12-07 17:18:36 +02:00
Sergio
622b156eed Add agent mode, fix config version bug 2024-12-07 17:08:34 +02:00
Sergio
dca19b5ae2 Whoops wrong server versioning 2024-12-07 17:02:21 +02:00
Sergio
f6ac43aac0 Change API versioning to match Cup version 2024-12-07 16:30:07 +02:00
Sergio
e5e60c4abc Add requirement for version key to new config 2024-12-07 16:28:06 +02:00
Sergio
33a72c8c0d Change config, add schema 2024-12-07 16:21:01 +02:00
Sergio
e544ef6ca5 Slightly optimize version regex 2024-12-06 17:47:31 +02:00
Sergio
afc34a0847 Update gitignore 2024-12-05 21:28:42 +02:00
Sergio
ce08e00bb4 Replace reference regex with homemade logic. Can we go faster? 2024-12-05 21:07:13 +02:00
Sergio
6a77b85141 Remove used async keyword from 2 functions in Image 2024-12-05 20:23:07 +02:00
Sergio
215e88ae0f Switch to serde for config parsing 2024-12-05 20:22:26 +02:00
Sergio
178acfb2f6 Add debug option to CLI 2024-12-05 18:13:53 +02:00
Sergio
59894343de Add error message when user doesn't specify command 2024-12-04 20:00:42 +02:00
Sergio
61bc60493f This is the last time I promise 2024-12-04 19:52:51 +02:00
Sergio
be7d55d126 Remove some more clone usage 2024-12-04 19:45:12 +02:00
Sergio
36a3a13c04 Remove some clone usage 2024-12-04 19:44:04 +02:00
Sergio
d85fadfb39 Test split 2024-11-21 19:26:17 +02:00
Sergio
0f95be26dc Remove usage of panic 2024-11-17 19:54:07 +02:00
Sergio
0b7e064980 Update sort_update_vec function, fix lints and enable testing in CI 2024-11-16 14:58:16 +02:00
Sergio
9e9bb78db7 Fix broken tests 2024-11-16 13:14:52 +02:00
Sergio
88d346b480 Support checking for version updates for images that aren't available locally 2024-11-16 13:05:46 +02:00
Sergio
4519c534a1 Move usage of get_images_from_docker_daemon to get_updates 2024-11-16 12:38:00 +02:00
Sergio
6b83f51749 Improve a little code section in registry.rs 2024-11-16 12:25:10 +02:00
Sergio
0c3f293fa8 Clippy 2024-11-15 13:31:42 +02:00
Sergio
d94abecf35 Nearly complete versioning support. Fixed old bugs where not all tags were fetched. 2024-11-15 13:21:30 +02:00
Sergio
c11b5e6432 OMG WE CAN DO SEMVER FOR THE CLI AND THE RESULTS LOOK CORRECT 2024-11-01 21:39:15 +02:00
Sergio
022dc0b2cb Merge branch 'main' into v3 2024-10-27 20:25:06 +02:00
Sergio
51609da4ff Merge remote-tracking branch 'origin/main' into v3 2024-10-27 18:15:47 +02:00
Sergio
3ed79e69bd Add semver regex and function to match tags (preparing to implement semver checking) 2024-10-27 18:09:26 +02:00
Sergio
078a51c4fa Fix CSS bug and tweak some stuff 2024-10-25 17:51:33 +03:00
Sergio
8d70d7ae4d Fixed CSS bugs, formatted code 2024-10-25 17:09:54 +03:00
Sergio
6d45409928 Add copy pull command button to image info 2024-10-25 16:59:42 +03:00
Sergio
bcfb9ef27a Update frontend 2024-10-25 16:26:28 +03:00
Sergio
5c4de36052 Add Content-Type header to API responses 2024-10-25 12:17:52 +03:00
Sergio
eda30229e2 Clippy 2024-10-25 12:13:25 +03:00
Sergio
8fd012efbe Added new full json API route and changed API routes 2024-10-25 12:12:59 +03:00
Sergio
8ab073d562 Changed how updates are managed after checking (preparing for the new API) 2024-10-25 11:32:59 +03:00
12 changed files with 542 additions and 797 deletions

View File

@@ -1,12 +0,0 @@
FROM --platform=$BUILDPLATFORM alpine AS builder
ARG TARGETARCH
ARG TARGETOS
COPY binaries/* /
RUN mv cup-$TARGETOS-$TARGETARCH cup
RUN chmod +x cup
FROM scratch
COPY --from=builder /cup /cup
ENTRYPOINT ["/cup"]

View File

@@ -1,51 +0,0 @@
name: Build Image
inputs:
tags:
description: "Docker image tags"
required: true
gh-token:
description: "Github token"
required: true
runs:
using: 'composite'
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Download binaries
uses: actions/download-artifact@v4
with:
path: .
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: |
ghcr.io/sergi0g/cup
tags: ${{ inputs.tags }}
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: sergi0g
password: ${{ inputs.gh-token }}
- name: Build and push image
uses: docker/build-push-action@v6
with:
context: .
file: ./.github/actions/build-image/Dockerfile
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ steps.meta.outputs.tags }}
cache-from: type=gha
cache-to: type=gha,mode=max

View File

@@ -36,7 +36,7 @@ jobs:
uses: actions/setup-node@v4
with:
node-version: 20
- name: Set up Bun
uses: oven-sh/setup-bun@v1
@@ -62,24 +62,38 @@ jobs:
cup-linux-arm64
build-image:
needs:
- get-tag
- build-binaries
needs: get-tag
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- uses: ./.github/actions/build-image
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
tags: |
${{ needs.get-tag.outputs.tag }}
gh-token: ${{ secrets.GITHUB_TOKEN }}
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push image
uses: docker/build-push-action@v6
with:
context: .
platforms: linux/amd64, linux/arm64
push: true
tags: ghcr.io/sergi0g/cup:${{ needs.get-tag.outputs.tag }}
cache-from: type=gha
cache-to: type=gha,mode=max
nightly-release:
runs-on: ubuntu-latest
needs:
- build-binaries
- build-image
needs: [build-binaries, get-tag]
steps:
- name: Download binaries
uses: actions/download-artifact@v4

View File

@@ -60,19 +60,34 @@ jobs:
cup-linux-arm64
build-image:
needs:
- get-tag
- build-binaries
needs: get-tag
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- uses: ./.github/actions/build-image
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
tags: |
${{ needs.get-tag.outputs.tag }}
latest
gh-token: ${{ secrets.GITHUB_TOKEN }}
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push image
uses: docker/build-push-action@v6
with:
context: .
platforms: linux/amd64, linux/arm64
push: true
tags: ghcr.io/sergi0g/cup:${{ needs.get-tag.outputs.tag }},ghcr.io/sergi0g/cup:latest
cache-from: type=gha
cache-to: type=gha,mode=max
release:
runs-on: ubuntu-latest
@@ -92,4 +107,4 @@ jobs:
prerelease: true
tag_name: ${{ needs.get-tag.outputs.tag }}
name: ${{ needs.get-tag.outputs.tag }}
files: binaries/*
files: binaries/*

1157
Cargo.lock generated

File diff suppressed because it is too large Load Diff

View File

@@ -1,15 +1,15 @@
[package]
name = "cup"
version = "3.0.2"
version = "3.0.0"
edition = "2021"
[dependencies]
clap = { version = "4.5.7", features = ["derive"] }
indicatif = { version = "0.17.8", optional = true }
tokio = { version = "1.38.0", features = ["macros", "rt-multi-thread"] }
xitca-web = { version = "0.6.2", optional = true }
xitca-web = { version = "0.5.0", optional = true }
liquid = { version = "0.26.6", optional = true }
bollard = "0.18.1"
bollard = "0.16.1"
once_cell = "1.19.0"
http-auth = { version = "0.1.9", default-features = false }
termsize = { version = "0.1.8", optional = true }
@@ -17,11 +17,11 @@ regex = { version = "1.10.5", default-features = false, features = ["perf"] }
chrono = { version = "0.4.38", default-features = false, features = ["std", "alloc", "clock"], optional = true }
reqwest = { version = "0.12.7", default-features = false, features = ["rustls-tls"] }
futures = "0.3.30"
reqwest-retry = "0.7.0"
reqwest-retry = "0.6.1"
reqwest-middleware = "0.3.3"
rustc-hash = "2.0.0"
http-link = "1.0.1"
itertools = "0.14.0"
itertools = "0.13.0"
serde_json = "1.0.133"
serde = "1.0.215"
tokio-cron-scheduler = { version = "0.13.0", default-features = false, optional = true }

View File

@@ -15,7 +15,7 @@ RUN ~/.bun/bin/bun install
RUN ~/.bun/bin/bun run build
### Build Cup ###
FROM rust:1-alpine AS build
FROM rust:1.80.1-alpine AS build
# Requirements
RUN apk add musl-dev

Binary file not shown.

View File

@@ -4,7 +4,7 @@
"private": true,
"scripts": {
"dev": "next dev",
"build": "next build && pagefind --site out --output-path out/_pagefind",
"build": "next build",
"start": "next start",
"lint": "next lint",
"fmt": "bun prettier --write ."
@@ -26,7 +26,6 @@
"@types/react-dom": "^19.0.3",
"eslint": "^9.18.0",
"eslint-config-next": "15.1.5",
"pagefind": "^1.3.0",
"postcss": "^8.5.1",
"prettier": "^3.4.2",
"prettier-plugin-tailwindcss": "^0.6.11",

View File

@@ -120,16 +120,6 @@ pub async fn get_updates(
.iter()
.map(|image| &image.parts.registry)
.unique()
.filter(|&registry| match ctx.config.registries.get(registry) {
Some(config) => {
if config.ignore {
false
} else {
true
}
}
None => true,
})
.collect::<Vec<&String>>();
// Create request client. All network requests share the same client for better performance.
@@ -148,7 +138,7 @@ pub async fn get_updates(
// Retrieve an authentication token (if required) for each registry.
let mut tokens: FxHashMap<&str, Option<String>> = FxHashMap::default();
for registry in registries.clone() {
for registry in registries {
let credentials = if let Some(registry_config) = ctx.config.registries.get(registry) {
&registry_config.authentication
} else {
@@ -173,11 +163,24 @@ pub async fn get_updates(
ctx.logger.debug(format!("Tokens: {:?}", tokens));
let ignored_registries = ctx
.config
.registries
.iter()
.filter_map(|(registry, registry_config)| {
if registry_config.ignore {
Some(registry)
} else {
None
}
})
.collect::<Vec<&String>>();
let mut handles = Vec::with_capacity(images.len());
// Loop through images check for updates
for image in &images {
let is_ignored = !registries.contains(&&image.parts.registry)
let is_ignored = ignored_registries.contains(&&image.parts.registry)
|| ctx
.config
.images

View File

@@ -95,10 +95,6 @@ impl Client {
let message = format!("{} {}: Connection timed out!", method, url);
self.ctx.logger.warn(&message);
Err(message)
} else if error.is_middleware() {
let message = format!("{} {}: Connection failed after 3 retries!", method, url);
self.ctx.logger.warn(&message);
Err(message)
} else {
error!(
"{} {}: Unexpected error: {}",

View File

@@ -16,7 +16,7 @@ pub fn split(reference: &str) -> (String, String, String) {
}
}
};
let splits = repository_and_tag.split('@').next().unwrap().split(':').collect::<Vec<&str>>();
let splits = repository_and_tag.split(':').collect::<Vec<&str>>();
let (repository, tag) = match splits.len() {
1 | 2 => {
let repository_components = splits[0].split('/').collect::<Vec<&str>>();
@@ -38,7 +38,7 @@ pub fn split(reference: &str) -> (String, String, String) {
};
(repository, tag)
}
_ => {dbg!(splits); panic!()},
_ => unreachable!(),
};
(registry.to_string(), repository, tag.to_string())
}