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

9 Commits

Author SHA1 Message Date
Sergio
efea81ef39 chore: bump project version 2025-04-10 19:22:19 +03:00
Pavel
d3cb5af225 Fix refresh button when using custom base url (#89) 2025-04-07 07:11:44 +03:00
Sergio
5904c2d2e2 fix: ignore version info when tags are equal
Even though some images had newer digests, they weren't being taken into
consideration when checking for updates. Should resolve #85 (further
testing needed to confirm).
2025-04-06 20:10:05 +03:00
Sergio
674bc3d614 fix: misaligned table columns in CLI
Reported in #85
2025-04-04 16:09:31 +03:00
Seow Alex
e4a07f9810 fix: use default registry for docker.io (#86) 2025-04-03 22:17:50 +03:00
dependabot[bot]
4e0f3c3eb9 chore(deps): bump next from 15.2.3 to 15.2.4 in /docs (#87)
Bumps [next](https://github.com/vercel/next.js) from 15.2.3 to 15.2.4.
- [Release notes](https://github.com/vercel/next.js/releases)
- [Changelog](https://github.com/vercel/next.js/blob/canary/release.js)
- [Commits](https://github.com/vercel/next.js/compare/v15.2.3...v15.2.4)

---
updated-dependencies:
- dependency-name: next
  dependency-version: 15.2.4
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-04-03 16:32:54 +03:00
Sergio
ba20dd3086 docs: mention seconds are required in cron pattern 2025-04-03 15:24:50 +03:00
Sergio
86d5b0465c chore: bump project version 2025-03-26 17:52:24 +02:00
Sergio
9d358ca6b2 fix: prevent wrapping text in badges 2025-03-26 17:51:21 +02:00
10 changed files with 17 additions and 15 deletions

2
Cargo.lock generated
View File

@@ -355,7 +355,7 @@ dependencies = [
[[package]]
name = "cup"
version = "3.2.1"
version = "3.2.3"
dependencies = [
"bollard",
"chrono",

View File

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

View File

@@ -36,7 +36,7 @@
},
"refresh_interval": {
"type": "string",
"description": "The interval at which Cup should check for updates. Must be a valid cron expression. Reference: https://github.com/Hexagon/croner-rust#pattern",
"description": "The interval at which Cup should check for updates. Must be a valid cron expression. Seconds are not optional. Reference: https://github.com/Hexagon/croner-rust#pattern",
"minLength": 11
},
"registries": {

View File

@@ -12,7 +12,7 @@
"dependencies": {
"@tabler/icons-react": "^3.29.0",
"geist": "^1.3.1",
"next": "15.2.3",
"next": "15.2.4",
"nextra": "^4.1.0",
"nextra-theme-docs": "^4.1.0",
"react": "^19.0.0",

View File

@@ -4,9 +4,9 @@ Cup can automatically refresh the results when running in server mode. Simply ad
```jsonc
{
"refresh_interval": "0 0,30 * * * *" // Check twice an hour
"refresh_interval": "0 */30 * * * *", // Check twice an hour
// Other options
}
```
You can use a cron expression to specify the refresh interval. The reference is [here](https://github.com/Hexagon/croner-rust#pattern)
You can use a cron expression to specify the refresh interval. Note that seconds are not optional. The reference is [here](https://github.com/Hexagon/croner-rust#pattern)

View File

@@ -182,10 +182,7 @@ pub async fn get_latest_tag(
));
get_latest_digest(
&Image {
version_info: Some(VersionInfo {
latest_remote_tag: Some(t.clone()),
..image.version_info.as_ref().unwrap().clone()
}),
version_info: None, // Overwrite previous version info, since it isn't useful anymore (equal tags means up to date and an image is truly up to date when its digests are up to date, and we'll be checking those anyway)
time_ms: image.time_ms + elapsed(start),
..image.clone()
},

View File

@@ -8,8 +8,12 @@ pub fn split(reference: &str) -> (String, String, String) {
0 => unreachable!(),
1 => (DEFAULT_REGISTRY, reference.to_string()),
_ => {
// Check if the image is from Docker Hub
if splits[0] == "docker.io" {
(DEFAULT_REGISTRY, splits[1..].join("/"))
// Check if we're looking at a domain
if splits[0] == "localhost" || splits[0].contains('.') || splits[0].contains(':') {
} else if splits[0] == "localhost" || splits[0].contains('.') || splits[0].contains(':')
{
(splits[0], splits[1..].join("/"))
} else {
(DEFAULT_REGISTRY, reference.to_string())
@@ -64,6 +68,7 @@ mod tests {
assert_eq!(split("localhost:1234/test" ), (String::from("localhost:1234" ), String::from("test" ), String::from("latest")));
assert_eq!(split("test:1234/idk" ), (String::from("test:1234" ), String::from("idk" ), String::from("latest")));
assert_eq!(split("alpine:3.7" ), (String::from(DEFAULT_REGISTRY ), String::from("library/alpine" ), String::from("3.7" )));
assert_eq!(split("docker.io/library/alpine" ), (String::from(DEFAULT_REGISTRY ), String::from("library/alpine" ), String::from("latest")));
assert_eq!(split("docker.example.com/examplerepo/alpine:3.7" ), (String::from("docker.example.com" ), String::from("examplerepo/alpine" ), String::from("3.7" )));
assert_eq!(split("docker.example.com/examplerepo/alpine/test2:3.7" ), (String::from("docker.example.com" ), String::from("examplerepo/alpine/test2" ), String::from("3.7" )));
assert_eq!(split("docker.example.com/examplerepo/alpine/test2/test3:3.7"), (String::from("docker.example.com" ), String::from("examplerepo/alpine/test2/test3"), String::from("3.7" )));

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`}
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`}
>
{from}
<ArrowRight className="size-3" />

View File

@@ -14,7 +14,7 @@ export default function RefreshButton() {
request.open(
"GET",
process.env.NODE_ENV === "production"
? "/api/v3/refresh"
? "./api/v3/refresh"
: `http://${window.location.hostname}:8000/api/v3/refresh`,
);
request.send();