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

128 Commits

Author SHA1 Message Date
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
Sergio
547d418401 docs: fix incorrect compose example with environment variables 2025-09-28 21:49:35 +03:00
Sergio
54f00c6c61 add a full stop 2025-09-10 11:57:42 +03:00
Sergio
b55ddfd3ad reword README 2025-09-10 11:57:17 +03:00
Sergio
14887cb766 add notice 2025-09-10 11:24:24 +03:00
Sergio
b0d0a02182 docs: update example homepage widget to conform to latest config spec
Co-authored-by: Valdr687 <106614142+Valdr687@users.noreply.github.com>
2025-08-29 17:42:56 +03:00
Sergio
c351a38642 docs: update homepage widget example
Remove usage of non-default port 9000 and change server ip placeholder to hostname instead
2025-08-25 19:11:59 +03:00
Sergio
ebb7c18bca fix: include OCI image manifest MIME type in Accept header when
checking for a digest update

Closes #132
2025-08-11 13:01:53 +03:00
Sergio
b542f1bac5 chore: bump project version 2025-05-27 14:51:48 +03:00
Sergio
34ae9cb36f fix: ignore empty refresh interval 2025-05-27 14:51:48 +03:00
Sergio
e015afbaca chore: update project version in Cargo.lock
This should have happened automatically when Cargo.toml was updated
2025-05-27 14:51:13 +03:00
Sergio
6dc1030a3b chore: bump project version 2025-05-21 19:30:30 +03:00
Sergio
d2c1651761 docs: update automatic refresh docs to mention TZ configuration 2025-05-21 11:39:41 +03:00
Sergio
8b3cf73f65 docs: add docs for environment variables 2025-05-21 11:34:16 +03:00
Sergio
6d88036914 feat: add timezone support 2025-05-21 11:13:27 +03:00
Sergio
a06266264d refactor: avoid a clone if extra images are empty 2025-05-20 17:46:09 +03:00
Sergio
c260874459 feat: add support for configuring through environment variables 2025-05-20 17:03:36 +03:00
Sergio
3e42ac338a fix: errors in http.rs 2025-05-10 20:55:14 +03:00
Sergio
15784eb4f1 fix: errors in http.rs 2025-05-10 20:52:04 +03:00
Sergio
2623f52a20 fix: handle 502 gracefully
Fixes #104
2025-05-10 20:48:22 +03:00
Sergio
8a5b0555f7 feat: add new filters 2025-05-09 13:19:42 +03:00
Sergio
2e1b0945e0 chore: bump project version 2025-05-09 09:51:16 +03:00
Raphaël C.
c8229d7370 feat: add new filter for in use images to web ui 2025-05-08 20:54:26 +03:00
Sergio
4b3bf9bd8f chore: update gitignore 2025-05-02 19:54:14 +03:00
Sergio
3ac990abce fix: clippy lints 2025-05-02 19:54:14 +03:00
Raphaël Catarino
5ea924c5ad refactor: better data fetching (#100) 2025-05-02 19:12:19 +03:00
Raphaël Catarino
2ac036d353 refactor: remove node and use only bun (#101) 2025-04-26 13:13:30 +03:00
Seow Alex
80a295680d feat: add ability to ignore certain update types (#91) 2025-04-12 09:37:28 +03:00
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
Sergio
f886601185 fix: check extra references specified in config
Fixes #81
2025-03-26 16:57:33 +02:00
Sergio
806364f01d ci: fix incorrect nightly workflow 2025-03-25 16:44:10 +02:00
Sergio
d35759ec66 chore: bump project version 2025-03-25 15:44:10 +02:00
Sergio
ffefe1db38 fix: specify color scheme in the web UI
Fixes a bug when displaying dark mode in Chrome
2025-03-25 15:44:10 +02:00
dependabot[bot]
2f9efe22d4 chore(deps): bump next from 15.1.5 to 15.2.3 in /docs (#80)
Bumps [next](https://github.com/vercel/next.js) from 15.1.5 to 15.2.3.
- [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.1.5...v15.2.3)

---
updated-dependencies:
- dependency-name: next
  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-03-22 09:35:06 +02:00
Thomas McWork
bbfb3c63ea docs: add instructions to find the docker group id to the compose docs 2025-03-21 18:47:59 +02:00
Sergio
6800f1ae27 refactor: specify the exposed port in the CI Dockerfile 2025-03-21 18:38:37 +02:00
Thomas McWork
402d72c85b refactor: specify the exposed port in the Dockerfile 2025-03-21 18:36:52 +02:00
Sergio
4f54301467 docs: fix incorrect edit this page URL
Closes #79
2025-03-21 18:20:14 +02:00
Sergio
be99438123 refactor: search component 2025-03-21 18:17:05 +02:00
Sergio
71164417a0 style: format code 2025-03-21 16:55:28 +02:00
Sergio
59ca170592 refactor: fix lint error in web UI 2025-03-21 16:54:52 +02:00
Sergio
b37b7ed060 refactor: load web UI assets with a relative URL to allow for hosting under a different path.
Might fix #53.
2025-03-21 16:32:23 +02:00
Sergio
dd68c5097a feat: add badges to web UI to quickly show which version is running and which the user will upgrade to
This is an example of a bad, long commit message.
2025-03-21 15:57:49 +02:00
Sergio
5fbbba32f1 refactor: remove dbg and use a proper panic when parsing a reference 2025-03-19 19:28:31 +02:00
Sergio
b10af38df4 chore: format code 2025-03-19 19:24:19 +02:00
Sergio
77a07013a9 refactor: use array slices instead of vectors wherever possible 2025-03-19 19:20:29 +02:00
Sergio
ccf825df24 refactor: use Bytes to store constant blobs in the server
Might also improve performance.
2025-03-19 13:56:47 +02:00
Sergio
e26f941c59 chore: bump project version 2025-03-16 18:42:06 +02:00
Sergio
c411fc4bad fix: ignore invalid digests instead of panicking 2025-03-16 18:40:10 +02:00
Sergio
e965380133 fix: improve error handling in get_latest_tag when an image has no tags
This commit is mostly for debugging #68, but it's good to have more
error info just in case.
2025-03-16 18:33:19 +02:00
Sergio
ef849b624f fix: don't pass empty parameters when making auth request (#69) 2025-03-16 18:26:04 +02:00
Sergio
8db7e2e12b fix: improve error handling when scheduling automatic refresh 2025-03-15 12:28:39 +02:00
Sergio
54e1998032 docs: fix incorrect cron schedule example 2025-03-15 12:28:39 +02:00
Sergio
9f142ab81c fix: add error message when app fails to bind to port 2025-03-15 12:28:39 +02:00
Sergio
ffd4d6267c chore: update readme
forgot to add a link
2025-03-14 10:20:51 +02:00
Sergio
242029db22 chore: update readme 2025-03-14 10:15:38 +02:00
Sergio
b6562ef76f chore: bump project version 2025-03-13 17:16:22 +02:00
Sergio
846b24bf2d feat: add experimental docker swarm support 2025-03-13 17:09:20 +02:00
Sergio
d7f766f1f5 chore(readme): Add discord link 2025-03-11 17:15:11 +02:00
Sergio
60096792a9 chore(docs): update JSON API reference schema 2025-03-11 17:08:42 +02:00
Sergio
a599d4e084 feat: detect image url from label 2025-03-11 17:06:00 +02:00
Sergio
a5a1f12899 chore: remove unneeded file 2025-03-11 17:05:46 +02:00
Sergio
766a20ccac chore: add badges to readme 2025-03-11 16:32:59 +02:00
Sergio
fe66ba842a docs: add docs about refresh endpoint 2025-03-11 16:26:48 +02:00
Sergio
c06c20394f docs: add page about home assistant integration 2025-03-11 16:26:31 +02:00
Sergio
98dafb8ba4 chore: bump project version 2025-03-10 16:49:07 +02:00
Sergio
2addfca1b4 fix: code block component copying was working incorrectly (#62) 2025-03-10 16:47:47 +02:00
dependabot[bot]
e3b05923ae Bump ring from 0.17.11 to 0.17.13 (#60)
Bumps [ring](https://github.com/briansmith/ring) from 0.17.11 to 0.17.13.
- [Changelog](https://github.com/briansmith/ring/blob/main/RELEASES.md)
- [Commits](https://github.com/briansmith/ring/commits)

---
updated-dependencies:
- dependency-name: ring
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-03-07 19:26:28 +02:00
Sergio
aa4195f8d6 chore: bump project version 2025-03-07 18:25:00 +02:00
Sergio
1b94629c79 fix: overflowing image references in web UI 2025-03-07 18:01:32 +02:00
Sergio
8cd9cce94e chore: bump project version 2025-03-07 17:38:20 +02:00
Sergio
ddabd8c102 fix: strip hash when parsing image references 2025-03-07 17:37:56 +02:00
Sergio
0b0028ab6d Fix search in docs 2025-03-07 16:40:59 +02:00
Sergio
75509550b1 Fix CI Dockerfile 2025-03-03 11:35:58 +02:00
Sergio
9716d1a351 Fix CI Dockerfile 2025-03-03 11:30:09 +02:00
Sergio
d5a2556768 Fix CI workflows 2025-03-03 11:23:26 +02:00
Sergio
e7f1921620 I'm stupid 2025-03-03 11:14:16 +02:00
Sergio
7ea6ae6de5 Let's try again 2025-03-03 10:31:42 +02:00
Sergio
d7c2e6436c Fix CI workflows 2025-03-03 10:23:08 +02:00
Sergio
fde61ee07d Fix CI workflows 2025-03-03 10:18:11 +02:00
Sergio
c4de3961a0 Optimize CI for docker image 2025-03-03 10:05:18 +02:00
Sergio
404c574c2c Update Rust version in Dockerfile 2025-03-02 13:08:43 +02:00
Sergio
6d4df20f54 Ignore registries before retrieving auth tokens 2025-03-02 13:05:23 +02:00
Sergio
7b3745d095 Fix errors and revert reqwest-middleware to v0.3.3 2025-03-02 13:04:31 +02:00
Sergio
f9aa516da7 Update dependencies. Also fixes a security vulnerability in rustls 2025-03-02 12:45:29 +02:00
Sergio
0f9c5d1466 V3
Many many many changes, honestly just read the release notes
2025-02-28 20:43:49 +02:00
Kamil Essekkat
b12acba745 Add note about non-root with docker compose to docs (#56)
Some checks failed
Deploy github pages / build (push) Has been cancelled
Deploy github pages / deploy (push) Has been cancelled
2025-01-10 16:05:58 +02:00
James Bogosian
d26f57758a Fix typo in docs
Some checks failed
CI / build-binary (push) Has been cancelled
CI / build-image (push) Has been cancelled
Deploy github pages / build (push) Has been cancelled
Deploy github pages / deploy (push) Has been cancelled
2024-12-26 16:04:11 +02:00
dependabot[bot]
566b02ca4c Bump nanoid from 3.3.7 to 3.3.8 in /docs (#49)
Some checks failed
CI / build-binary (push) Has been cancelled
CI / build-image (push) Has been cancelled
Deploy github pages / build (push) Has been cancelled
Deploy github pages / deploy (push) Has been cancelled
Bumps [nanoid](https://github.com/ai/nanoid) from 3.3.7 to 3.3.8 due to a security vulnerability.

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-12-17 15:49:40 +02:00
Sergio
06b0d65b41 idk how to spell
Some checks failed
CI / build-binary (push) Has been cancelled
CI / build-image (push) Has been cancelled
2024-11-02 11:20:27 +02:00
Sergio
3772ec29eb Update nightly.yml
Some checks failed
CI / build-binary (push) Has been cancelled
CI / build-image (push) Has been cancelled
2024-10-27 20:24:52 +02:00
Sergio
018239632e Update nightly.yml
Some checks failed
CI / build-binary (push) Has been cancelled
CI / build-image (push) Has been cancelled
2024-10-25 17:03:05 +03:00
Sergio
186f44c65a Update nightly.yml 2024-10-25 16:34:36 +03:00
Sergio
e1eaf63f1c Update links to WUD since repo was moved
Some checks failed
CI / build-binary (push) Has been cancelled
CI / build-image (push) Has been cancelled
Deploy github pages / build (push) Has been cancelled
Deploy github pages / deploy (push) Has been cancelled
2024-10-23 16:11:25 +03:00
dependabot[bot]
e82e59de36 Bump mermaid from 10.9.1 to 10.9.3 in /docs (#43)
Some checks are pending
CI / build-binary (push) Waiting to run
CI / build-image (push) Waiting to run
Deploy github pages / build (push) Waiting to run
Deploy github pages / deploy (push) Blocked by required conditions
Bumps [mermaid](https://github.com/mermaid-js/mermaid) from 10.9.1 to 10.9.3.
- [Release notes](https://github.com/mermaid-js/mermaid/releases)
- [Changelog](https://github.com/mermaid-js/mermaid/blob/develop/CHANGELOG.md)
- [Commits](https://github.com/mermaid-js/mermaid/compare/v10.9.1...v10.9.3)

---
updated-dependencies:
- dependency-name: mermaid
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-10-22 21:34:19 +03:00
Sergio
cd0c6ee299 Update README.md
Some checks failed
CI / build-binary (push) Has been cancelled
CI / build-image (push) Has been cancelled
2024-10-17 20:41:06 +03:00
Sergio
3654f21bd3 Update bug_report.md
Some checks failed
CI / build-binary (push) Has been cancelled
CI / build-image (push) Has been cancelled
2024-10-12 16:07:44 +03:00
Sergio
f430d6bfb7 Update issue templates 2024-10-12 16:06:10 +03:00
Sergio
2bfb1b69db Update docs
Some checks failed
CI / build-binary (push) Waiting to run
CI / build-image (push) Waiting to run
Deploy github pages / build (push) Has been cancelled
Deploy github pages / deploy (push) Has been cancelled
2024-10-11 22:45:43 +03:00
dependabot[bot]
875fcce0d5 Bump micromatch from 4.0.7 to 4.0.8 in /docs (#33)
Bumps [micromatch](https://github.com/micromatch/micromatch) from 4.0.7 to 4.0.8.
- [Release notes](https://github.com/micromatch/micromatch/releases)
- [Changelog](https://github.com/micromatch/micromatch/blob/master/CHANGELOG.md)
- [Commits](https://github.com/micromatch/micromatch/compare/4.0.7...4.0.8)

---
updated-dependencies:
- dependency-name: micromatch
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-10-11 21:26:33 +03:00
dependabot[bot]
f40af342ec Bump next from 14.2.5 to 14.2.10 in /docs (#34)
Bumps [next](https://github.com/vercel/next.js) from 14.2.5 to 14.2.10.
- [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/v14.2.5...v14.2.10)

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-10-11 21:26:09 +03:00
Sergio
88885aa1dd Refactor (#32) 2024-10-11 21:22:39 +03:00
Sergio
5867cb375f Bump version
Some checks failed
CI / build-binary (push) Has been cancelled
CI / build-image (push) Has been cancelled
2024-09-24 17:20:34 +03:00
Sergio
65b2bece03 fix issue #30 with raw returning invalid json 2024-09-24 17:19:59 +03:00
Sergio
6b15d8dfad Docs changes
Some checks failed
CI / build-binary (push) Has been cancelled
CI / build-image (push) Has been cancelled
Deploy github pages / build (push) Has been cancelled
Deploy github pages / deploy (push) Has been cancelled
2024-09-17 17:00:31 +03:00
Sergio
5bf7269aca Better logging on server
Some checks are pending
CI / build-binary (push) Waiting to run
CI / build-image (push) Waiting to run
2024-09-16 17:42:02 +03:00
Sergio
0136850200 Fix CSS bug where statistics borders are invisible in static mode 2024-09-16 17:39:44 +03:00
Sergio
2afce016f3 Update README 2024-09-16 17:30:05 +03:00
Sergio
bc06c06cac Bump version and update README
Some checks are pending
CI / build-binary (push) Waiting to run
CI / build-image (push) Waiting to run
2024-09-15 20:26:02 +03:00
Sergio
bc86364e68 Fixed OpenSSL build errors on Alpine and changed the logging a bit 2024-09-15 20:21:13 +03:00
Sergio
663ca64cd7 Enable native-tls feature on reqwest so we can support alpine 2024-09-15 19:29:14 +03:00
Sergio
330b70752e Improve logging 2024-09-15 19:14:20 +03:00
Sergio
0c9ad61a4d Removed all threading and switched everything to async. >2x speedup 🚀 2024-09-15 18:47:00 +03:00
Sergio
38bf187a4a Update docs with community requested changes and bump version
Some checks failed
CI / build-binary (push) Has been cancelled
CI / build-image (push) Has been cancelled
Deploy github pages / build (push) Has been cancelled
Deploy github pages / deploy (push) Has been cancelled
2024-09-09 11:42:04 +03:00
Sergio
2c120ffaff Added search 2024-09-09 11:18:28 +03:00
Sergio
572ca8858a Added tooltips, centralized theme declaration, fixed some eslint errors
Some checks failed
CI / build-binary (push) Has been cancelled
CI / build-image (push) Has been cancelled
Deploy github pages / build (push) Has been cancelled
Deploy github pages / deploy (push) Has been cancelled
2024-09-07 18:57:57 +03:00
Sergio
2c4f2a1e05 Fix broken links in docs 2024-09-07 18:07:32 +03:00
Sergio
b4ef92fdcc Update version
Some checks are pending
CI / build-binary (push) Waiting to run
CI / build-image (push) Waiting to run
2024-09-07 11:23:05 +03:00
Sergio
6d1b5d339a Remove colon from last checked 2024-09-07 11:03:53 +03:00
163 changed files with 9505 additions and 6376 deletions

32
.github/ISSUE_TEMPLATE/bug_report.md vendored Normal file
View File

@@ -0,0 +1,32 @@
---
name: Bug report
about: Is something not working properly? Report it here.
title: "[BUG] <TITLE>"
labels: bug
assignees: ''
---
**Describe the bug**
A clear and concise description of what the bug is.
**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error
**Expected behavior**
A clear and concise description of what you expected to happen.
**Screenshots**
If applicable, add screenshots to help explain your problem.
**System info (please complete the following information):**
- OS: [e.g. Ubuntu]
- Docker daemon version: [Engine version in the output of `docker version`]
- Cup version: [Output of `cup --version`]
**Additional context**
Add any other info that you think may be useful here.

View File

@@ -0,0 +1,20 @@
---
name: Feature request
about: Suggest an idea for this project
title: "[FR] <TITLE>"
labels: enhancement
assignees: ''
---
**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
**Describe the solution you'd like**
A clear and concise description of what you want to happen.
**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.
**Additional context**
Add any other context or screenshots about the feature request here.

13
.github/actions/build-image/Dockerfile vendored Normal file
View File

@@ -0,0 +1,13 @@
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
EXPOSE 8000
ENTRYPOINT ["/cup"]

52
.github/actions/build-image/action.yml vendored Normal file
View File

@@ -0,0 +1,52 @@
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 }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max

View File

@@ -14,13 +14,8 @@ jobs:
- name: Set up Rust - name: Set up Rust
uses: actions-rust-lang/setup-rust-toolchain@v1 uses: actions-rust-lang/setup-rust-toolchain@v1
- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: 20
- name: Set up Bun - name: Set up Bun
uses: oven-sh/setup-bun@v1 uses: oven-sh/setup-bun@v2
- name: Install deps - name: Install deps
run: cd web && bun install run: cd web && bun install
@@ -28,6 +23,9 @@ jobs:
- name: Build - name: Build
run: ./build.sh cargo build --verbose run: ./build.sh cargo build --verbose
- name: Test
run: cargo test
build-image: build-image:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:

View File

@@ -2,7 +2,7 @@ name: Deploy github pages
on: on:
push: push:
paths: paths:
- "docs/**" - 'docs/**'
workflow_dispatch: workflow_dispatch:
jobs: jobs:
build: build:
@@ -13,22 +13,20 @@ jobs:
steps: steps:
- name: Checkout repository - name: Checkout repository
uses: actions/checkout@v4 uses: actions/checkout@v4
- uses: actions/setup-node@v4
with: with:
node-version: 20 fetch-depth: 0
- name: Setup pnpm - name: Set up Bun
uses: pnpm/action-setup@v4 uses: oven-sh/setup-bun@v2
with:
version: latest
- name: Install dependencies - name: Install dependencies
run: pnpm install run: bun install
- name: Build - name: Build
run: pnpm build run: bun run build
- name: Upload artifact - name: Upload artifact
uses: actions/upload-pages-artifact@v3 uses: actions/upload-pages-artifact@v3
with: with:
path: docs/out/ path: docs/out/
deploy: deploy:
if: ${{ github.ref == 'refs/heads/main' }}
needs: build needs: build
permissions: permissions:
pages: write pages: write
@@ -40,4 +38,4 @@ jobs:
steps: steps:
- name: Deploy to GitHub Pages - name: Deploy to GitHub Pages
id: deployment id: deployment
uses: actions/deploy-pages@v4 uses: actions/deploy-pages@v4

View File

@@ -3,6 +3,23 @@ on:
workflow_dispatch: workflow_dispatch:
jobs: jobs:
get-tag:
runs-on: ubuntu-latest
outputs:
tag: ${{ steps.tag.outputs.tag }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Get Docker image tag
id: tag
run: |
if [ "${GITHUB_REF_NAME}" == "main" ]; then
TAG="nightly"
else
TAG="${GITHUB_REF_NAME}-nightly"
fi
echo "Using tag $TAG"
echo "tag=$TAG" >> $GITHUB_OUTPUT
build-binaries: build-binaries:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
@@ -13,15 +30,10 @@ jobs:
uses: actions-rust-lang/setup-rust-toolchain@v1 uses: actions-rust-lang/setup-rust-toolchain@v1
- name: Install cross - name: Install cross
run: cargo install cross --git https://github.com/cross-rs/cross run: RUSTFLAGS="" cargo install cross --git https://github.com/cross-rs/cross
- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: 20
- name: Set up Bun - name: Set up Bun
uses: oven-sh/setup-bun@v1 uses: oven-sh/setup-bun@v2
- name: Install deps - name: Install deps
run: cd web && bun install run: cd web && bun install
@@ -45,37 +57,25 @@ jobs:
cup-linux-arm64 cup-linux-arm64
build-image: build-image:
needs:
- get-tag
- build-binaries
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v4 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: with:
registry: ghcr.io tags: |
username: ${{ github.repository_owner }} ${{ needs.get-tag.outputs.tag }}
password: ${{ secrets.GITHUB_TOKEN }} gh-token: ${{ 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:nightly
cache-from: type=gha
cache-to: type=gha,mode=max
nightly-release: nightly-release:
runs-on: ubuntu-latest runs-on: ubuntu-latest
needs: build-binaries needs:
- get-tag
- build-binaries
- build-image
steps: steps:
- name: Download binaries - name: Download binaries
uses: actions/download-artifact@v4 uses: actions/download-artifact@v4
@@ -86,6 +86,6 @@ jobs:
- uses: pyTooling/Actions/releaser@r0 - uses: pyTooling/Actions/releaser@r0
with: with:
token: ${{ secrets.GITHUB_TOKEN }} token: ${{ secrets.GITHUB_TOKEN }}
tag: nightly tag: ${{ needs.get-tag.outputs.tag }}
rm: true rm: true
files: binaries/* files: binaries/*

View File

@@ -28,15 +28,10 @@ jobs:
uses: actions-rust-lang/setup-rust-toolchain@v1 uses: actions-rust-lang/setup-rust-toolchain@v1
- name: Install cross - name: Install cross
run: cargo install cross --git https://github.com/cross-rs/cross run: RUSTFLAGS="" cargo install cross --git https://github.com/cross-rs/cross
- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: 20
- name: Set up Bun - name: Set up Bun
uses: oven-sh/setup-bun@v1 uses: oven-sh/setup-bun@v2
- name: Install deps - name: Install deps
run: cd web && bun install run: cd web && bun install
@@ -60,34 +55,19 @@ jobs:
cup-linux-arm64 cup-linux-arm64
build-image: build-image:
needs: get-tag needs:
- get-tag
- build-binaries
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v4 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: with:
registry: ghcr.io tags: |
username: ${{ github.repository_owner }} ${{ needs.get-tag.outputs.tag }}
password: ${{ secrets.GITHUB_TOKEN }} latest
gh-token: ${{ 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: release:
runs-on: ubuntu-latest runs-on: ubuntu-latest
@@ -107,4 +87,4 @@ jobs:
prerelease: true prerelease: true
tag_name: ${{ needs.get-tag.outputs.tag }} tag_name: ${{ needs.get-tag.outputs.tag }}
name: ${{ needs.get-tag.outputs.tag }} name: ${{ needs.get-tag.outputs.tag }}
files: binaries/* files: binaries/*

5
.gitignore vendored
View File

@@ -5,4 +5,7 @@
/src/static /src/static
# In case I accidentally commit mine... # In case I accidentally commit mine...
cup.json cup.json
# Profiling results don't need to be present in the repo
profile.json

View File

@@ -1 +0,0 @@
rust 1.79.0

51
CONTRIBUTING.md Normal file
View File

@@ -0,0 +1,51 @@
# Contributing
First of all, thanks for taking time to contribute to Cup! This guide will help you set up a development environment and make your first contribution.
## Setting up a development environment
Requirements:
- A computer running Linux
- Rust (usually installed from https://rustup.rs/)
- Bun 1+
1. Fork the repository. This is where you'll be pushing your changes before you create a pull request. Make sure to _create a new branch_ for your changes.
2. Clone your fork with `git clone https://github.com/<YOUR_USERNAME>/cup` (if you use SSH, `git clone git@github.com:<YOUR_USERNAME>/cup`) and open your editor
3. Switch to your newly created branch (e.g. if your branch is called `improve-logging`, run `git checkout improve-logging`)
4. Run `bun install` in `web/` and `./build.sh` to set up the frontend
You're ready to go!
## Project architecture
Cup can be run in 2 modes: CLI and server.
All CLI specific functionality is located in `src/formatting.rs` and some other files in functions prefixed with `#[cfg(feature = "cli")]`.
All server specific functionality is located in `src/server.rs` and `web/`.
## Important notes
- When making any changes, always make sure to write optimize your code for:
+ Performance: You should always benchmark Cup before making changes and after your changes to make sure there is none (or a very small) difference in time. Profiling old and new code is also good.
+ Readability: Include comments describing any new functions you create, give descriptive names to variables and when making a design decision or a compromise, ALWAYS include a comment explaining what you did and why.
- If you plan on developing the frontend without making backend changes, it is highly recommended to run `cup serve` in the background and start the frontend in development mode from `web/` with `bun dev`.
- If you make changes to the frontend, always remember to prefix your build command with the `build.sh` script which takes care of rebuilding the frontend. For example: `./build.sh cargo build -r`
- When adding new features to Cup (e.g. configuration options), make sure to update the documentation (located in `docs/`). Refer to other pages in the documentation, or to the [official docs](https://nextra.site) for any questions you may have. The docs use `pnpm` as their package manager.
- If you need help with finishing something (e.g. you've made some commits and need help with writing docs, you want some feedback about a design decision, etc.), you can open a draft PR and ask for help there.
## Submitting a PR
To have your changes included in Cup, you will need to create a pull request.
Before doing so, please make sure you have run `cargo clippy` and resolved all warnings related to your changes and have formatted your code with `cargo fmt`. This ensures Cup's codebase is consistent and uses good practices for code.
After you're done with that, commit your changes and push them to your branch.
Next, open your fork on Github and create a pull request. Make sure to include the changes you made, which issues it addresses (if any) and any other info you think is important.
Happy contributing!

1773
Cargo.lock generated

File diff suppressed because it is too large Load Diff

View File

@@ -1,27 +1,36 @@
[package] [package]
name = "cup" name = "cup"
version = "2.2.0" version = "3.4.3"
edition = "2021" edition = "2021"
[dependencies] [dependencies]
clap = { version = "4.5.7", features = ["derive"] } clap = { version = "4.5.7", features = ["derive"] }
indicatif = { version = "0.17.8", optional = true } indicatif = { version = "0.17.8", optional = true }
tokio = {version = "1.38.0", features = ["rt", "rt-multi-thread", "macros"]} tokio = { version = "1.38.0", features = ["macros", "rt-multi-thread"] }
ureq = { version = "2.9.7", features = ["tls"] } xitca-web = { version = "0.6.2", optional = true }
rayon = "1.10.0"
xitca-web = { version = "0.5.0", optional = true, features = ["logger"] }
liquid = { version = "0.26.6", optional = true } liquid = { version = "0.26.6", optional = true }
bollard = "0.16.1" bollard = "0.18.1"
once_cell = "1.19.0" once_cell = "1.19.0"
http-auth = { version = "0.1.9", features = [] } http-auth = { version = "0.1.9", default-features = false }
termsize = { version = "0.1.8", optional = true } termsize = { version = "0.1.8", optional = true }
regex = "1.10.5" regex = { version = "1.10.5", default-features = false, features = ["perf"] }
chrono = { version = "0.4.38", default-features = false, features = ["std", "alloc", "clock"], optional = true } chrono = { version = "0.4.38", default-features = false, features = ["std", "alloc", "clock"], optional = true }
json = "0.12.4" reqwest = { version = "0.12.7", default-features = false, features = ["rustls-tls"] }
futures = "0.3.30"
reqwest-retry = "0.7.0"
reqwest-middleware = "0.3.3"
rustc-hash = "2.0.0"
http-link = "1.0.1"
itertools = "0.14.0"
serde_json = "1.0.133"
serde = "1.0.215"
tokio-cron-scheduler = { version = "0.13.0", default-features = false, optional = true }
envy = "0.4.2"
chrono-tz = "0.10.3"
[features] [features]
default = ["server", "cli"] default = ["server", "cli"]
server = ["dep:xitca-web", "dep:liquid", "dep:chrono"] server = ["dep:xitca-web", "dep:liquid", "dep:chrono", "dep:tokio-cron-scheduler"]
cli = ["dep:indicatif", "dep:termsize"] cli = ["dep:indicatif", "dep:termsize"]
[profile.release] [profile.release]

View File

@@ -1,21 +1,21 @@
### Build UI ### ### Build UI ###
FROM node:20 AS web FROM oven/bun:1-alpine AS web
# Install bun # Copy package.json and lockfile from web
RUN curl -fsSL https://bun.sh/install | bash
# Copy web folder
COPY ./web /web
WORKDIR /web WORKDIR /web
COPY ./web/package.json ./web/bun.lock ./
# Install requirements # Install requirements
RUN ~/.bun/bin/bun install RUN bun install
# Copy web folder
COPY ./web .
# Build frontend # Build frontend
RUN ~/.bun/bin/bun run build RUN bun run build
### Build Cup ### ### Build Cup ###
FROM rust:1.80.1-alpine AS build FROM rust:1-alpine AS build
# Requirements # Requirements
RUN apk add musl-dev RUN apk add musl-dev
@@ -39,4 +39,5 @@ FROM scratch
# Copy binary # Copy binary
COPY --from=build /cup/target/release/cup /cup COPY --from=build /cup/target/release/cup /cup
ENTRYPOINT ["/cup"] EXPOSE 8000
ENTRYPOINT ["/cup"]

17
NOTICE.md Normal file
View File

@@ -0,0 +1,17 @@
Hello,
I have an important announcement to make.
### The situation
You may have noticed that the last few months Cup's development has stalled. I had very little time to work on it. Tomorrow, the 11th of September, 2025, I am starting my last year of school. It is very important to me to get into a good university, so I will be studying all day, with no time to work on my projects.
What this means for you is that the development of Cup is paused, at least until June 2026. That means no new features and no bugfixes. If Cup works fine for you and you're comfortable with not getting any updates (this does _not_ mean Cup is suddenly insecure by the way), you can keep using it. Otherwise, there are many alternatives you can look at, which are actively maintained and may provide the features you need.
### How you can help
If you're a Rust developer, I would really appreciate it if you could start contributing to Cup. There are a bunch of open issues that need to be worked on. I can find some time to review PRs. You can also fork the repository and do your own thing, if you prefer.
I've also left a few new features in the `v4` branch and a rewrite I started in `rewrite`, because I feel like the code is unmaintainable in its current state. I'd love it if someone could help work on that.
That's all I had to say. I'm sorry if I let you down, this was a really hard decision to make. I would like to thank all of you for your help and support, it really means a lot to me. I hope I can continue working on the project once I'm done with my final exams!

View File

@@ -1,34 +1,44 @@
# Cup 🥤 # Cup 🥤
![GitHub License](https://img.shields.io/github/license/sergi0g/cup)
![CI Status](https://img.shields.io/github/actions/workflow/status/sergi0g/cup/.github%2Fworkflows%2Fci.yml?label=CI)
![GitHub last commit](https://img.shields.io/github/last-commit/sergi0g/cup)
![GitHub Release](https://img.shields.io/github/v/release/sergi0g/cup)
![GitHub Issues or Pull Requests](https://img.shields.io/github/issues/sergi0g/cup)
[![Discord](https://img.shields.io/discord/1337705080518086658)](https://discord.gg/jmh5ctzwNG)
> [!IMPORTANT]
> There have been some important changes regarding Cup's development. Read more [here](./NOTICE.md).
Cup is the easiest way to check for container image updates. Cup is the easiest way to check for container image updates.
![Demo](screenshots/cup.gif)
## Screenshots
![Cup web in light mode](screenshots/web_light.png)
![Cup web in dark mode](screenshots/web_dark.png) ![Cup web in dark mode](screenshots/web_dark.png)
## Features _If you like this project and/or use Cup, please consider starring the project ⭐. It motivates me to continue working on it and improving it. Plus, you get updates for new releases!_
- Extremely fast. Cup takes full advantage of your CPU and is hightly optimized, resulting in lightning fast speed. On my test machine, it took ~6 seconds for 70 images. ## Screenshots 📷
![Cup web in light mode](screenshots/web_light.png)
![Cup's CLI](screenshots/cup.gif)
## Features ✨
- Extremely fast. Cup takes full advantage of your CPU and is hightly optimized, resulting in lightning fast speed. On my Raspberry Pi 5, it took 3.7 seconds for 58 images!
- Supports most registries, including Docker Hub, ghcr.io, Quay, lscr.io and even Gitea (or derivatives) - Supports most registries, including Docker Hub, ghcr.io, Quay, lscr.io and even Gitea (or derivatives)
- Doesn't exhaust any rate limits. This is the original reason I created Cup. It was inspired by [What's up docker?](https://github.com/fmartinou/whats-up-docker) which would always use it up. - Doesn't exhaust any rate limits. This is the original reason I created Cup. I feel that this feature is especially relevant now with [Docker Hub reducing its pull limits for unauthenticated users](https://docs.docker.com/docker-hub/usage/).
- Beautiful CLI and web interface for checking on your containers any time. - Beautiful CLI and web interface for checking on your containers any time.
- The binary is tiny! At the time of writing it's just 4.7 MB. No more pulling 100+ MB docker images for a such a simple program. - The binary is tiny! At the time of writing it's just 5.4 MB. No more pulling 100+ MB docker images for a such a simple program.
- JSON output for both the CLI and web interface so you can connect Cup to integrations. It's easy to parse and makes webhooks and pretty dashboards simple to set up! - JSON output for both the CLI and web interface so you can connect Cup to integrations. It's easy to parse and makes webhooks and pretty dashboards simple to set up!
## Documentation ## Documentation 📘
Take a look at https://sergi0g.github.io/cup/docs! Take a look at https://cup.sergi0g.dev/docs!
## Limitations ## Limitations
Cup is a work in progress. It might not have as many features as What's up Docker. If one of these features is really important for you, please consider using another tool. Cup is a work in progress. It might not have as many features as other alternatives. If one of these features is really important for you, please consider using another tool.
- ~~Cup currently doesn't support registries which use repositories without slashes. This includes Azure. This problem may sound a bit weird, but it's due to the regex that's used at the moment. This will (hopefully) be fixed in the future.~~ - Cup cannot directly trigger your integrations. If you want that to happen automatically, please use What's up Docker instead. Cup was created to be simple. The data is there, and it's up to you to retrieve it (e.g. by running `cup check -r` with a cronjob or periodically requesting the `/api/v3/json` url from the server).
- ~~Cup doesn't support private images. This is on the roadmap. Currently, it just returns unknown for those images.~~
- Cup cannot trigger your integrations. If you want that to happen automatically, please use What's up docker instead. Cup was created to be simple. The data is there, and it's up to you to retrieve it (e.g. by running `cup check -r` with a cronjob or periodically requesting the `/json` url from the server)
## Roadmap ## Roadmap
Take a sneak peek at what's coming up in future releases on the [roadmap](https://github.com/users/sergi0g/projects/2)! Take a sneak peek at what's coming up in future releases on the [roadmap](https://github.com/users/sergi0g/projects/2)!
@@ -44,14 +54,14 @@ Here are some ideas to get you started:
- Help optimize Cup and make it even better! - Help optimize Cup and make it even better!
- Add more features to the web UI - Add more features to the web UI
To contribute, fork the repository, make your changes and the submit a pull request. For more information, check the [docs](https://cup.sergi0g.dev/docs/contributing)!
## Support ## Support
If you have any questions about Cup, feel free to ask in the [discussions](https://github.com/sergi0g/cup/discussions)! If you have any questions about Cup, feel free to ask in the [discussions](https://github.com/sergi0g/cup/discussions)! You can also join our [discord server](https://discord.gg/jmh5ctzwNG).
If you find a bug, or want to propose a feature, search for it in the [issues](https://github.com/sergi0g/cup/issues). If there isn't already an open issue, please open one. If you find a bug, or want to propose a feature, search for it in the [issues](https://github.com/sergi0g/cup/issues). If there isn't already an open issue, please open one.
## Acknowledgements ## Acknowledgements
Thanks to [What's up Docker?](https://github.com/fmartinou/whats-up-docker) for inspiring this project. Thanks to [What's up Docker?](https://github.com/getwud/wud) for inspiring this project.

View File

@@ -1,7 +1,13 @@
#!/bin/sh #!/bin/sh
# Exit on error
set -e
# This is kind of like a shim that makes sure the frontend is rebuilt when running a build. For example you can run `./build.sh cargo build --release` # This is kind of like a shim that makes sure the frontend is rebuilt when running a build. For example you can run `./build.sh cargo build --release`
# Remove old files
rm -rf src/static
# Frontend # Frontend
cd web/ cd web/
@@ -11,6 +17,9 @@ bun run build
# Copy UI to src folder # Copy UI to src folder
cp -r dist/ ../src/static cp -r dist/ ../src/static
# Go back
cd ../
# Run command from argv # Run command from argv
$@ $@

97
cup.schema.json Normal file
View File

@@ -0,0 +1,97 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "https://raw.githubusercontent.com/sergi0g/cup/main/cup.schema.json",
"title": "Cup",
"description": "A schema for Cup's config file",
"type": "object",
"properties": {
"version": {
"type": "integer",
"minimum": 3,
"maximum": 3
},
"agent": {
"type": "boolean",
"description": "Whether or not to enable agent mode. When agent mode is enabled, the server only exposes the API and the web interface is unavailable."
},
"ignore_update_type": {
"type": "string",
"description": "The types of updates to ignore. Ignoring an update type also implies ignoring all update types less specific than it. For example, ignoring patch updates also implies ignoring major and minor updates.",
"enum": [
"none",
"major",
"minor",
"patch"
]
},
"images": {
"type": "object",
"description": "Configuration options for specific images",
"properties": {
"extra": {
"type": "array",
"description": "Extra image references you want Cup to check",
"minItems": 1
},
"exclude": {
"type": "array",
"description": "Image references that should be excluded from the check",
"minItems": 1,
"items": {
"type": "string",
"minLength": 1
}
}
}
},
"refresh_interval": {
"type": "string",
"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": {
"type": "object",
"description": "Configuration options for specific registries",
"additionalProperties": {
"authentication": {
"description": "An authentication token provided by the registry",
"type": "string",
"minLength": 1
},
"insecure": {
"description": "Whether Cup should connect to the registry insecurely (HTTP) or not. Enable this only if you really need to.",
"type": "boolean"
},
"ignore": {
"description": "Whether or not the registry should be ignored when running Cup",
"type": "boolean"
}
}
},
"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. To disable use \"none\" as value.",
"minLength": 1
},
"servers": {
"type": "object",
"description": "Additional servers to connect to and fetch update data from",
"additionalProperties": {
"type": "string",
"minLength": 1
},
"minProperties": 1
},
"theme": {
"type": "string",
"description": "The theme used by the web UI",
"enum": [
"default",
"blue"
]
}
},
"required": [
"version"
]
}

2
docs/.prettierignore Normal file
View File

@@ -0,0 +1,2 @@
.next
.node_modules

10
docs/.prettierrc Normal file
View File

@@ -0,0 +1,10 @@
{
"overrides": [
{
"files": "src/content/docs/integrations.mdx",
"options": {
"tabWidth": 4
}
}
]
}

View File

@@ -1 +0,0 @@
nodejs 21.6.2

View File

@@ -1 +1,37 @@
This is where Cup's documentation lives. It's created with [Nextra](https://nextra.site). # Cup Documentation
## Architecture
The docs are built with [Nextra](https://nextra.site). We use [Bun](https://bun.sh) as a package manager and Node.js as a runtime (Next.js and Bun don't play well together at the moment). Docs pages are written in [MDX](https://mdxjs.com) and any custom components are written in TypeScript with TSX.
## Development
Prerequisites:
- A recent Node.js version (22 recommended)
- [Bun](https://bun.sh)
```bash
git clone https://github.com/sergi0g/cup
cd cup/docs
bun install
```
You're ready to go!
## Scripts
The available scripts are:
- `bun dev` starts the development server. Note that making changes to MDX pages will probably require a full reload.
- `bun run build` creates a static production build, ready to be deployed.
- `bun lint` checks for errors in your code.
- `bun fmt` formats your code with Prettier, so it becomes... prettier.
## Contributing
Our documentation is always evolving, so, we constantly need to update this repository with new guides and configuration options. If you have any ideas of a guide or suggestions on how to improve them, feel free to open a pull request or create an issue. All contributions are welcome!
## License
The documentation is licensed under the MIT License. TL;DR — You are free to use, copy, modify, merge, publish, distribute, sublicense, and sell copies of the software. However, the software is provided "as is," without warranty of any kind. You must include the original license in all copies or substantial portions of the software.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 83 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 136 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 87 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 64 KiB

1661
docs/bun.lock Normal file

File diff suppressed because it is too large Load Diff

21
docs/eslint.config.mjs Normal file
View File

@@ -0,0 +1,21 @@
import { dirname } from "path";
import { fileURLToPath } from "url";
import { FlatCompat } from "@eslint/eslintrc";
const __filename = fileURLToPath(import.meta.url);
const __dirname = dirname(__filename);
const compat = new FlatCompat({
baseDirectory: __dirname,
});
const eslintConfig = [
...compat.extends("next/core-web-vitals", "next/typescript"),
{
rules: {
"import/no-anonymous-default-export": "off",
},
},
];
export default eslintConfig;

5
docs/next-env.d.ts vendored Normal file
View File

@@ -0,0 +1,5 @@
/// <reference types="next" />
/// <reference types="next/image-types/global" />
// NOTE: This file should not be edited
// see https://nextjs.org/docs/app/api-reference/config/typescript for more information.

View File

@@ -1,17 +0,0 @@
const withNextra = require("nextra")({
theme: "nextra-theme-docs",
themeConfig: "./theme.config.jsx",
});
module.exports = withNextra(
{
output: "export",
images: {
unoptimized: true
},
basePath: process.env.NODE_ENV == 'production' ? '/cup' : ''
}
);
// If you have other Next.js configurations, you can pass them as the parameter:
// module.exports = withNextra({ /* other next.js config */ })

20
docs/next.config.ts Normal file
View File

@@ -0,0 +1,20 @@
import nextra from "nextra";
const withNextra = nextra({
defaultShowCopyCode: true,
});
export default withNextra({
output: "export",
transpilePackages: ["geist"],
images: {
unoptimized: true,
remotePatterns: [
{
protocol: "https",
hostname: "raw.githubusercontent.com",
},
],
},
basePath: "",
});

View File

@@ -1,20 +1,36 @@
{ {
"name": "cup-docs",
"version": "0.1.0",
"private": true,
"scripts": { "scripts": {
"dev": "next", "dev": "next dev",
"build": "next build", "build": "next build && pagefind --site out --output-path out/_pagefind",
"start": "next start" "start": "next start",
"lint": "next lint",
"fmt": "bun prettier --write ."
}, },
"dependencies": { "dependencies": {
"@tabler/icons-react": "^3.11.0", "@tabler/icons-react": "^3.29.0",
"next": "^14.2.5", "geist": "^1.3.1",
"nextra": "^2.13.4", "next": "15.2.4",
"nextra-theme-docs": "^2.13.4", "nextra": "^4.1.0",
"react": "^18.3.1", "nextra-theme-docs": "^4.1.0",
"react-dom": "^18.3.1" "react": "^19.0.0",
"react-dom": "^19.0.0"
}, },
"devDependencies": { "devDependencies": {
"autoprefixer": "^10.4.19", "@eslint/eslintrc": "^3.2.0",
"postcss": "^8.4.39", "@tailwindcss/postcss": "^4.0.1",
"tailwindcss": "^3.4.5" "@types/bun": "^1.2.10",
"@types/react": "^19.0.7",
"@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",
"tailwindcss": "^4.0.1",
"typescript": "^5.7.3"
} }
} }

View File

@@ -1,10 +0,0 @@
import '../styles.css';
import 'nextra-theme-docs/style.css';
export default function App({ Component, pageProps }) {
return (
<main>
<Component {...pageProps} />
</main>
);
}

View File

@@ -1,13 +0,0 @@
{
"docs": {
"title": "Documentation",
"type": "page"
},
"about": {
"title": "About",
"type": "page",
"theme": {
"typesetting": "article"
}
}
}

View File

@@ -1,110 +0,0 @@
import Image from "next/image";
import old_cup from "../assets/old_cup.png"
import web_ui from "../assets/blue_theme.png"
# About
Cup is a small utility that checks for updates to Docker containers. The logic is simple: Cup checks the locally pulled images' digests against the latest ones in their registry. It then presents the results in a pretty interface. Here's the story:
## How it started
I got the basic idea for Cup a long time ago. I was looking at [Homepage's list of widgets](https://gethomepage.dev/latest/widgets/) when I discovered [What's Up Docker?](https://github.com/fmartinou/whats-up-docker) (referred to as WUD from now on).
According to the docs:
> What's up Docker ( aka WUD ) gets you notified when a new version of your Docker Container is available.
It supports the most common registries, has integrations with IFTTT, Slack, Telegram and other apps/services for notifications or triggering workflows and also has the option to automatically update containers, like [Watchtower](https://github.com/containrrr/watchtower).
I was managing my homelab myself at that time and the only way to check if I had updates was log in to the server and manually try to pull the images for *every single compose file*. WUD seemed to solve the problem nicely, so I decided to give it a try. I never used automatic updates or notifications, but I configured it and let it run.
After deploying it and setting up my reverse proxy, I was greeted with this dashboard:
<Image src="https://github.com/fmartinou/whats-up-docker/blob/master/docs/ui/ui.png?raw=true" alt="A screenshot of WUD's web UI, from the docs" />
It was working fine, but... the UI was not what I expected. It really reminds me of some really old Android app (I hope I didn't offend anyone). That was strike one. Nevertheless, I left it running. It was useful after all.
A few days later I was pulling some docker images, when I got this error message:
> You have reached your pull rate limit. You may increase the limit by authenticating and upgrading: https://www.docker.com/increase-rate-limits.
Wait a minute. What was that? I'd never encountered a message like this before. I thought "Weird. Maybe I pulled too many images today?". So I decided to finish those updates another day.
Next time I tried, same issue. "What the heck is happening?" I thought. The only change I'd made to my homelab at that time was installing WUD. So I stopped it. And that's where the problems ended.
The problem was clearly related to WUD, so I started trying to find what was going wrong. That was when I came upon [this page from Docker's documentation](https://docs.docker.com/docker-hub/download-rate-limit/). I noticed 2 things:
> A pull request is defined as up to two `GET` requests on registry manifest URLs (`/v2/*/manifests/*`)
> `HEAD` requests aren't counted.
There were also helpful instructions on how to check the rate limit:
```
sergio@desktop:~ $ TOKEN=$(curl "https://auth.docker.io/token?service=registry.docker.io&scope=repository:ratelimitpreview/test:pull" | jq -r .token)
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 5429 0 5429 0 0 7431 0 --:--:-- --:--:-- --:--:-- 7426
sergio@desktop:~ $ curl --head -H "Authorization: Bearer $TOKEN" https://registry-1.docker.io/v2/ratelimitpreview/test/manifests/latest
HTTP/1.1 200 OK
content-length: 2782
content-type: application/vnd.docker.distribution.manifest.v1+prettyjws
docker-content-digest: sha256:767a3815c34823b355bed31760d5fa3daca0aec2ce15b217c9cd83229e0e2020
docker-distribution-api-version: registry/2.0
etag: "sha256:767a3815c34823b355bed31760d5fa3daca0aec2ce15b217c9cd83229e0e2020"
date: Tue, 16 Jul 2024 12:13:17 GMT
strict-transport-security: max-age=31536000
ratelimit-limit: 100;w=21600
ratelimit-remaining: 100;w=21600
docker-ratelimit-source: <REDACTED>
```
The rate limit is there, just like in the docs, but do you see something else interesting? Look at this header: `docker-content-digest: sha256:767a3815c34823b355bed31760d5fa3daca0aec2ce15b217c9cd83229e0e2020`
This is an image's digest. Can we check for updates by making `HEAD` requests to Docker Hub?
The answer is yes:
```
$ set TOKEN $(curl -H "Accept: application/vnd.docker.distribution.manifest.list.v2+json" "https://auth.docker.io/token?service=registry.docker.io&scope=repository:library/busybox:pull" | jq -r .token)
$ curl --head -H "Authorization: Bearer $TOKEN" -H "Accept: application/vnd.docker.distribution.manifest.v2.list+json" https://registry-1.docker.io/v2/library/busybox/manifests/latest
HTTP/1.1 200 OK
content-length: 6761
content-type: application/vnd.oci.image.index.v1+json
docker-content-digest: sha256:9ae97d36d26566ff84e8893c64a6dc4fe8ca6d1144bf5b87b2b85a32def253c7
docker-distribution-api-version: registry/2.0
etag: "sha256:9ae97d36d26566ff84e8893c64a6dc4fe8ca6d1144bf5b87b2b85a32def253c7"
date: Tue, 16 Jul 2024 12:17:49 GMT
strict-transport-security: max-age=31536000
ratelimit-limit: 100;w=21600
ratelimit-remaining: 100;w=21600
docker-ratelimit-source: <REDACTED>
```
And then we can compare that with the digest of the image stored locally:
```
$ docker inspect busybox:latest | jq -r '.[0].RepoDigests[0]'
busybox@sha256:9ae97d36d26566ff84e8893c64a6dc4fe8ca6d1144bf5b87b2b85a32def253c7
```
Notice how the 2 digests are the same. We can check for image updates without using up the rate limit!
That's when I got the idea of writing a program to do this automatically.
## The birth of Cup
I initially intended to write a simple bash script but I chose not to for the following reasons:
- I wanted something more than a simple script. WUD has a web UI and support for so many integrations! I had to match that some way!
- Bash is slow and I was learning Rust at the time, so I wanted to practice (and make a proper project)
It started out as a small CLI that could either check a single image, or check all the images.
<Image src={old_cup} alt="The initial version of Cup" />
It also couldn't check for updates to images not from Docker Hub, lacked a web UI and generally had many limitations. But it proved it could be done, quickly and efficiently. The binary was just 5 MB and took about 5 seconds for ~90 images on my development machine. That's insane!
A few days later, I decided to completely rewrite it. I tried to write clean code, split it in files and fix every limitation from the previous version. I'm quite close. Here's what it looks like now:
<Image src="https://github.com/sergi0g/cup/blob/main/screenshots/cup.gif?raw=true" alt="Cup's old CLI" />
It also has a statically rendered web UI making it ideal for self hosting.
<Image src={web_ui} alt="Cup's web UI"/>
With some optimization (well ok, maybe a lot), the binary is 5 MB and that means I finally don't have to wait forever to pull the Docker image! Finally something that works nicely with my 1.5 MB/s internet connection! (Thank you powerline!)
Now go ahead and try it out!

View File

@@ -1,17 +0,0 @@
{
"index": {
"title": "Introduction"
},
"installation": {
"title": "Installation"
},
"configuration": {
"title": "Configuration"
},
"usage": {
"title": "Usage"
},
"nightly": {
"title": "Using the latest version"
}
}

View File

@@ -1,58 +0,0 @@
import { Steps, Callout, Card, Cards } from "nextra-theme-docs";
import { IconPaint, IconLockOpen, IconKey } from '@tabler/icons-react';
# Configuration
## Custom docker socket
Sometimes, there may be a need to specify a custom docker socket. Cup provides the `-s` option for this.
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`.
<Steps>
### Create the configuration file
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_
### Configure Cup from the configuration file
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": {
"ghcr.io": "<YOUR_TOKEN_HERE>",
"registry-1.docker.io": "<YOUR_TOKEN_HERE>"
},
"theme": "blue",
"insecure_registries": ["localhost:5000", "my-insecure-registry.example.com"]
}
```
### 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.
```bash
$ 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>

View File

@@ -1,22 +0,0 @@
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>

View File

@@ -1,20 +0,0 @@
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>

View File

@@ -1,31 +0,0 @@
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
}
```

View File

@@ -1,8 +0,0 @@
{
"docker": {
"title": "With Docker"
},
"binary": {
"title": "As a binary"
}
}

View File

@@ -1,11 +0,0 @@
import { IconServer, IconTerminal } from "@tabler/icons-react";
import { Cards, Card } from "nextra-theme-docs";
# Usage
You can use Cup in 2 different ways. As a CLI or as a server. You can learn more about each mode in its corresponding page
<Cards>
<Card icon={<IconTerminal />} title="CLI" href="/docs/usage/cli" />
<Card icon={<IconServer />} title="Server" href="/docs/usage/server" />
</Cards>

View File

@@ -1,73 +0,0 @@
import Image from "next/image";
import cup from "../../../assets/cup.gif";
# CLI
Cup's CLI provides the `cup check` command.
## Basic Usage
### Check for all updates
```ansi
$ cup check
nginx:alpine Update available
redis:7 Update available
redis:alpine Update available
...
centos:7 Up to date
mcr.microsoft.com/devcontainers/go:0-1.19-bullseye Up to date
rockylinux:9-minimal Up to date
rabbitmq:3.11.9-management Up to date
...
some/deleted:image Unknown
```
### Check for updates to a specific image
```
$ cup check node:latest
node:latest has an update available
```
## Enable icons
You can also enable icons if you have a [Nerd Font](https://nerdfonts.com) installed.
<Image src={cup} unoptimized />
## JSON output
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.
```
$ 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,...}}
```
Here is how it would look in Typescript:
```ts
type CupData = {
metrics: {
monitored_images: number,
up_to_date: number,
update_available: number,
unknown: number
},
images: {
[image: string]: boolean | null
}
}
```
## Usage with Docker
If you're using the Docker image, just replace all occurences of `cup` in the examples with `docker run -tv /var/run/docker.sock:/var/run/docker.sock ghcr.io/sergi0g/cup`.
For example, this:
```bash /check node:latest/
$ cup check node:latest
```
becomes:
```bash /check node:latest/
$ docker run -tv /var/run/docker.sock:/var/run/docker.sock ghcr.io/sergi0g/cup check node:latest
```

View File

@@ -1,53 +0,0 @@
import { Callout } from "nextra-theme-docs";
# Server
The server provides the `cup serve` command.
## Basic usage
```ansi
$ cup serve
2024-07-17T09:08:38.724922Z   INFO  xitca_server::net  :  Started Tcp listening on: Some(0.0.0.0:8000)
2024-07-17T09:08:38.725076Z   WARN  xitca_server::server::future  :  ServerFuture::wait is called from within tokio context. It would block current thread from handling async tasks
2024-07-17T09:08:38.725248Z   INFO  xitca_server::worker  :  Started xitca-server-worker-0
2024-07-17T09:08:38.725343Z   INFO  xitca_server::worker  :  Started xitca-server-worker-1
2024-07-17T09:08:38.725580Z   INFO  xitca_server::worker  :  Started xitca-server-worker-2
2024-07-17T09:08:38.725607Z   INFO  xitca_server::worker  :  Started xitca-server-worker-3
2024-07-17T09:08:41.390783Z   INFO  request  {  method  = GET uri  = / }  :  on_request  :  serving request
2024-07-17T09:08:41.390905Z   INFO  request  {  method  = GET uri  = / }  :  on_response  :  sending response
```
This will launch the server on port `8000`. To access it, visit `http://<YOUR_IP>:8000` (replace `<YOUR_IP>` with the IP address of the machine running Cup.)
<Callout>
The URL `http://<YOUR_IP>:8000/json` is also available for usage with integrations.
</Callout>
## Use a different port
Pass the `-p` argument with the port you want to use
```ansi
$ cup serve -p 9000
2024-07-17T09:08:38.724922Z   INFO  xitca_server::net  :  Started Tcp listening on: Some(0.0.0.0:9000)
2024-07-17T09:08:38.725076Z   WARN  xitca_server::server::future  :  ServerFuture::wait is called from within tokio context. It would block current thread from handling async tasks
2024-07-17T09:08:38.725248Z   INFO  xitca_server::worker  :  Started xitca-server-worker-0
2024-07-17T09:08:38.725343Z   INFO  xitca_server::worker  :  Started xitca-server-worker-1
2024-07-17T09:08:38.725580Z   INFO  xitca_server::worker  :  Started xitca-server-worker-2
2024-07-17T09:08:38.725607Z   INFO  xitca_server::worker  :  Started xitca-server-worker-3
2024-07-17T09:08:41.390783Z   INFO  request  {  method  = GET uri  = / }  :  on_request  :  serving request
2024-07-17T09:08:41.390905Z   INFO  request  {  method  = GET uri  = / }  :  on_response  :  sending response
```
## Usage with Docker
If you're using the Docker image, just replace all occurences of `cup` in the examples with `docker run -tv /var/run/docker.sock:/var/run/docker.sock -p <PORT>:<PORT> ghcr.io/sergi0g/cup`, where `<PORT>` is the port Cup will be using.
For example, this:
```bash /serve -p 9000/
$ cup serve -p 9000
```
becomes:
```bash /serve -p 9000/
$ docker run -tv /var/run/docker.sock:/var/run/docker.sock -p 9000:9000 ghcr.io/sergi0g/cup serve -p 9000
```

4089
docs/pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff

View File

@@ -1,6 +0,0 @@
module.exports = {
plugins: {
tailwindcss: {},
autoprefixer: {},
},
}

8
docs/postcss.config.mjs Normal file
View File

@@ -0,0 +1,8 @@
/** @type {import('postcss-load-config').Config} */
const config = {
plugins: {
"@tailwindcss/postcss": {},
},
};
export default config;

BIN
docs/public/cup-og.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 85 KiB

29
docs/public/favicon.svg Normal file
View File

@@ -0,0 +1,29 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 25.2.3, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" id="Layer_2" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 128 128" style="enable-background:new 0 0 128 128;" xml:space="preserve">
<path style="fill:#A6CFD6;" d="M65.12,17.55c-17.6-0.53-34.75,5.6-34.83,14.36c-0.04,5.2,1.37,18.6,3.62,48.68s2.25,33.58,3.5,34.95
c1.25,1.37,10.02,8.8,25.75,8.8s25.93-6.43,26.93-8.05c0.48-0.78,1.83-17.89,3.5-37.07c1.81-20.84,3.91-43.9,3.99-45.06
C97.82,30.66,94.2,18.43,65.12,17.55z"/>
<path style="fill:#DCEDF6;" d="M41.4,45.29c-0.12,0.62,1.23,24.16,2.32,27.94c1.99,6.92,9.29,7.38,10.23,4.16
c0.9-3.07-0.38-29.29-0.38-29.29s-3.66-0.3-6.43-0.84C44,46.63,41.4,45.29,41.4,45.29z"/>
<path style="fill:#6CA4AE;" d="M33.74,32.61c-0.26,8.83,20.02,12.28,30.19,12.22c13.56-0.09,29.48-4.29,29.8-11.7
S79.53,21.1,63.35,21.1C49.6,21.1,33.96,25.19,33.74,32.61z"/>
<path style="fill:#DC0D27;" d="M84.85,13.1c-0.58,0.64-9.67,30.75-9.67,30.75s2.01-0.33,4-0.79c2.63-0.61,3.76-1.06,3.76-1.06
s7.19-22.19,7.64-23.09c0.45-0.9,21.61-7.61,22.31-7.93c0.7-0.32,1.39-0.4,1.46-0.78c0.06-0.38-2.34-6.73-3.11-6.73
C110.47,3.47,86.08,11.74,84.85,13.1z"/>
<path style="fill:#8A1F0F;" d="M110.55,7.79c1.04,2.73,2.8,3.09,3.55,2.77c0.45-0.19,1.25-1.84,0.01-4.47
c-0.99-2.09-2.17-2.74-2.93-2.61C110.42,3.6,109.69,5.53,110.55,7.79z"/>
<g>
<path style="fill:#8A1F0F;" d="M91.94,18.34c-0.22,0-0.44-0.11-0.58-0.3l-3.99-5.77c-0.22-0.32-0.14-0.75,0.18-0.97
c0.32-0.22,0.76-0.14,0.97,0.18l3.99,5.77c0.22,0.32,0.14,0.75-0.18,0.97C92.21,18.3,92.07,18.34,91.94,18.34z"/>
</g>
<g>
<path style="fill:#8A1F0F;" d="M90.28,19.43c-0.18,0-0.35-0.07-0.49-0.2l-5.26-5.12c-0.28-0.27-0.28-0.71-0.01-0.99
c0.27-0.28,0.71-0.28,0.99-0.01l5.26,5.12c0.28,0.27,0.28,0.71,0.01,0.99C90.64,19.36,90.46,19.43,90.28,19.43z"/>
</g>
<g>
<path style="fill:#8A1F0F;" d="M89.35,21.22c-0.12,0-0.25-0.03-0.36-0.1l-5.6-3.39c-0.33-0.2-0.44-0.63-0.24-0.96
c0.2-0.33,0.63-0.44,0.96-0.24l5.6,3.39c0.33,0.2,0.44,0.63,0.24,0.96C89.82,21.1,89.59,21.22,89.35,21.22z"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 2.1 KiB

View File

@@ -0,0 +1,27 @@
import { generateStaticParamsFor, importPage } from "nextra/pages";
import { useMDXComponents } from "@/mdx-components";
export const generateStaticParams = generateStaticParamsFor("mdxPath");
interface Props {
params: Promise<{ mdxPath: string[] }>;
}
export async function generateMetadata(props: Props) {
const params = await props.params;
const { metadata } = await importPage(params.mdxPath);
return metadata;
}
/* eslint-disable-next-line */
const Wrapper = useMDXComponents({}).wrapper;
export default async function Page(props: Props) {
const params = await props.params;
const result = await importPage(params.mdxPath);
const { default: MDXContent, toc, metadata } = result;
return (
<Wrapper toc={toc} metadata={metadata}>
<MDXContent {...props} params={params} />
</Wrapper>
);
}

BIN
docs/src/app/apple-icon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 176 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 107 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 134 KiB

BIN
docs/src/app/assets/cup.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 163 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 94 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 90 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 252 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 254 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 124 KiB

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,23 @@
import { Icon as IconType } from "@tabler/icons-react";
export function Card({
name,
icon: Icon,
description,
}: {
name: string;
icon: IconType;
description: string;
}) {
return (
<div className="p-4 bg-white dark:bg-black group">
<Icon className="text-black size-7 group-hover:size-9 dark:text-white inline mr-2 transition-[width,height] duration-200" />
<span className="align-middle text-2xl font-bold text-black dark:text-white">
{name}
</span>
<p className="text-xl font-semibold text-neutral-500 dark:text-neutral-500">
{description}
</p>
</div>
);
}

View File

@@ -0,0 +1,33 @@
import React from "react";
import { clsx } from "clsx";
export function GradientText({
text,
innerClassName,
className,
blur,
}: {
text: string;
innerClassName: string;
className?: string;
blur: number;
}) {
return (
<div className={clsx("relative", className)}>
<p
className={clsx("bg-clip-text text-transparent w-fit", innerClassName)}
>
{text}
</p>
<p
className={clsx(
"pointer-events-none absolute top-0 hidden select-none bg-clip-text text-transparent dark:block",
innerClassName,
)}
style={{ filter: `blur(${blur}px)` }}
>
{text}
</p>
</div>
);
}

View File

@@ -0,0 +1,31 @@
import { useId } from "react";
const SIZE = 36;
export function GridPattern() {
const id = useId();
return (
<svg
aria-hidden="true"
className="pointer-events-none absolute inset-0 bottom-0 left-0 right-0 top-0 h-full w-full -z-10 bg-white stroke-neutral-200 dark:stroke-white/10 dark:bg-black"
>
<defs>
<pattern
id={id}
width={SIZE}
height={SIZE}
patternUnits="userSpaceOnUse"
x={-1}
y={-1}
>
<path
d={`M.5 ${SIZE}V.5H${SIZE}`}
fill="none"
/>
</pattern>
</defs>
<rect width="100%" height="100%" strokeWidth={0} fill={`url(#${id})`} />
</svg>
);
}

View File

@@ -0,0 +1,29 @@
"use client";
import { Head as NextraHead } from "nextra/components";
export function Head() {
return (
<NextraHead>
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
<link rel="icon" type="image/x-icon" href="/favicon.ico" />
<meta
name="theme-color"
media="(prefers-color-scheme: light)"
content="#ffffff"
/>
<meta
name="theme-color"
media="(prefers-color-scheme: dark)"
content="#111111"
/>
<meta
name="og:image"
content="https://raw.githubusercontent.com/sergi0g/cup/main/docs/public/cup-og.png"
/>
<meta name="twitter:card" content="summary_large_image" />
<meta name="twitter:site" content="https://cup.sergi0g.dev" />
<meta name="apple-mobile-web-app-title" content="Cup" />
</NextraHead>
);
}

View File

@@ -0,0 +1,57 @@
export default function Logo() {
return (
<svg
viewBox="0 0 128 128"
style={{ height: "calc(var(--nextra-navbar-height) * 0.6)" }}
>
<path
style={{ fill: "#A6CFD6" }}
d="M65.12,17.55c-17.6-0.53-34.75,5.6-34.83,14.36c-0.04,5.2,1.37,18.6,3.62,48.68s2.25,33.58,3.5,34.95
c1.25,1.37,10.02,8.8,25.75,8.8s25.93-6.43,26.93-8.05c0.48-0.78,1.83-17.89,3.5-37.07c1.81-20.84,3.91-43.9,3.99-45.06
C97.82,30.66,94.2,18.43,65.12,17.55z"
/>
<path
style={{ fill: "#DCEDF6" }}
d="M41.4,45.29c-0.12,0.62,1.23,24.16,2.32,27.94c1.99,6.92,9.29,7.38,10.23,4.16
c0.9-3.07-0.38-29.29-0.38-29.29s-3.66-0.3-6.43-0.84C44,46.63,41.4,45.29,41.4,45.29z"
/>
<path
style={{ fill: "#6CA4AE" }}
d="M33.74,32.61c-0.26,8.83,20.02,12.28,30.19,12.22c13.56-0.09,29.48-4.29,29.8-11.7
S79.53,21.1,63.35,21.1C49.6,21.1,33.96,25.19,33.74,32.61z"
/>
<path
style={{ fill: "#DC0D27" }}
d="M84.85,13.1c-0.58,0.64-9.67,30.75-9.67,30.75s2.01-0.33,4-0.79c2.63-0.61,3.76-1.06,3.76-1.06
s7.19-22.19,7.64-23.09c0.45-0.9,21.61-7.61,22.31-7.93c0.7-0.32,1.39-0.4,1.46-0.78c0.06-0.38-2.34-6.73-3.11-6.73
C110.47,3.47,86.08,11.74,84.85,13.1z"
/>
<path
style={{ fill: "#8A1F0F" }}
d="M110.55,7.79c1.04,2.73,2.8,3.09,3.55,2.77c0.45-0.19,1.25-1.84,0.01-4.47
c-0.99-2.09-2.17-2.74-2.93-2.61C110.42,3.6,109.69,5.53,110.55,7.79z"
/>
<g>
<path
style={{ fill: "#8A1F0F" }}
d="M91.94,18.34c-0.22,0-0.44-0.11-0.58-0.3l-3.99-5.77c-0.22-0.32-0.14-0.75,0.18-0.97
c0.32-0.22,0.76-0.14,0.97,0.18l3.99,5.77c0.22,0.32,0.14,0.75-0.18,0.97C92.21,18.3,92.07,18.34,91.94,18.34z"
/>
</g>
<g>
<path
style={{ fill: "#8A1F0F" }}
d="M90.28,19.43c-0.18,0-0.35-0.07-0.49-0.2l-5.26-5.12c-0.28-0.27-0.28-0.71-0.01-0.99
c0.27-0.28,0.71-0.28,0.99-0.01l5.26,5.12c0.28,0.27,0.28,0.71,0.01,0.99C90.64,19.36,90.46,19.43,90.28,19.43z"
/>
</g>
<g>
<path
style={{ fill: "#8A1F0F" }}
d="M89.35,21.22c-0.12,0-0.25-0.03-0.36-0.1l-5.6-3.39c-0.33-0.2-0.44-0.63-0.24-0.96
c0.2-0.33,0.63-0.44,0.96-0.24l5.6,3.39c0.33,0.2,0.44,0.63,0.24,0.96C89.82,21.1,89.59,21.22,89.35,21.22z"
/>
</g>
</svg>
);
}

View File

@@ -0,0 +1,116 @@
import React from "react";
import "./styles.css";
import { Browser } from "../Browser";
import { Card } from "../Card";
import {
IconAdjustments,
IconArrowRight,
IconBarrierBlockOff,
IconBolt,
IconFeather,
IconGitMerge,
IconPuzzle,
IconServer,
IconTerminal,
} from "@tabler/icons-react";
import { GitHubIcon } from "nextra/icons";
import { GridPattern } from "../GridPattern";
import { GradientText } from "../GradientText";
import Link from "next/link";
export default async function Home() {
return (
<>
<div className="relative home bg-radial-[ellipse_at_center] from-transparent from-20% to-white dark:to-black">
<GridPattern />
<div className="px-4 pt-16 pb-8 sm:pt-24 lg:px-8">
<div className="flex w-full flex-col items-center justify-between">
<div>
<h1 className="mx-auto max-w-2xl text-center text-6xl leading-none font-extrabold tracking-tighter text-black sm:text-7xl dark:text-white">
The easiest way to manage your
<GradientText
text="container updates."
className="mx-auto w-fit"
innerClassName="bg-linear-to-r/oklch from-blue-500 to-green-500"
blur={30}
/>
</h1>
<h3 className="mx-auto mt-6 max-w-3xl text-center text-xl leading-tight font-medium text-neutral-500 dark:text-neutral-400">
Cup is a small utility with a big impact. Simplify your
container management workflow with fast and efficient update
checking, a full-featured CLI and web interface, and more.
</h3>
</div>
<div className="mt-8 grid w-fit grid-cols-2 gap-4 *:flex *:items-center *:gap-2 *:rounded-lg *:px-3 *:py-2">
<Link
href="/docs"
className="hide-focus group h-full bg-black text-white dark:bg-white dark:text-black"
>
Get started
<IconArrowRight className="ml-auto mr-1 transition-transform duration-300 ease-out group-hover:translate-x-1 group-focus:translate-x-1 dark:!text-black" />
</Link>
<a
href="https://github.com/sergi0g/cup"
target="_blank"
className="hide-focus h-full bg-white dark:bg-black text-nowrap border border-black/15 transition-colors duration-200 ease-in-out hover:border-black/40 dark:border-white/15 hover:dark:border-white/40 hover:dark:shadow-sm focus:dark:border-white/30"
>
Star on GitHub
<GitHubIcon className="ml-auto size-4 md:size-5" />
</a>
</div>
</div>
</div>
<div className="py-10 flex translate-y-32 justify-center" id="hero">
<Browser />
</div>
</div>
<div className="bg-white dark:bg-black py-12 px-8 w-full">
<div className="flex h-full w-full items-center justify-center">
<div className="grid md:grid-cols-2 md:grid-rows-4 lg:grid-cols-4 lg:grid-rows-2 w-full max-w-7xl gap-px border border-transparent bg-black/10 dark:bg-white/10">
<Card
name="Built for speed."
icon={IconBolt}
description="Cup is written in Rust and every release goes through extensive profiling to squeeze out every last drop of performance."
/>
<Card
name="Configurable."
icon={IconAdjustments}
description="Make Cup yours with the extensive configuration options available. Customize and tailor it to your needs."
/>
<Card
name="Extend it."
icon={IconPuzzle}
description="JSON output enables you to connect Cup with your favorite integrations, build automations and more."
/>
<Card
name="CLI available."
icon={IconTerminal}
description="Do you like terminals? Cup has a CLI. Check for updates quickly without spinning up a server."
/>
<Card
name="Multiple servers."
icon={IconServer}
description="Run multiple Cup instances and effortlessly check on them through one web interface."
/>
<Card
name="Unstoppable."
icon={IconBarrierBlockOff}
description="Cup is designed to check for updates without using up any rate limits. 10 images per hour won't be a problem, even with 100 images."
/>
<Card
name="Lightweight."
icon={IconFeather}
description="No need for a powerful server and endless storage. The tiny 5.4 MB binary won't hog your CPU and memory."
/>
<Card
name="Open source."
icon={IconGitMerge}
description="All source code is publicly available in our GitHub repository. We're looking for contributors!"
/>
</div>
</div>
</div>
</>
);
}

View File

@@ -0,0 +1,26 @@
article:has(.home) {
padding-inline: 0;
padding-top: 0;
padding-bottom: 0;
}
article div.x\:mt-16:last-child:empty {
margin-top: 0;
}
#hero {
animation-name: hero;
animation-duration: 1500ms;
animation-delay: 500ms;
animation-timing-function: ease-in-out;
animation-fill-mode: forwards;
}
@keyframes hero {
from {
translate: 0 8rem;
}
to {
translate: 0 0;
}
}

BIN
docs/src/app/favicon.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

17
docs/src/app/globals.css Normal file
View File

@@ -0,0 +1,17 @@
@import "tailwindcss";
@variant dark (&:where(.dark, .dark *));
.nextra-card .tabler-icon:hover {
color: rgb(17 24 39 / var(--tw-text-opacity));
}
.nextra-card .tabler-icon {
color: rgb(55 65 81 / var(--tw-text-opacity));
}
.nextra-card .tabler-icon:is(.dark *) {
color: rgb(229 229 229 / var(--tw-text-opacity));
}
.nextra-card .tabler-icon:is(.dark *):hover {
color: rgb(250 250 250 / var(--tw-text-opacity));
}

55
docs/src/app/layout.tsx Normal file
View File

@@ -0,0 +1,55 @@
import type { Metadata } from "next";
import { Footer, Layout, Navbar, ThemeSwitch } from "nextra-theme-docs";
import { getPageMap } from "nextra/page-map";
import { GeistSans } from "geist/font/sans";
import "nextra-theme-docs/style.css";
import "./globals.css";
import { Head } from "./components/Head";
import Logo from "./components/Logo";
export const metadata: Metadata = {
title: "Cup",
description: "The easiest way to manage your container updates",
};
const logo = (
<div className="flex items-center">
<Logo />
<h1 className="ml-2 font-bold">Cup</h1>
</div>
);
const navbar = (
<Navbar logo={logo} projectLink="https://github.com/sergi0g/cup" chatLink="https://discord.gg/jmh5ctzwNG">
<ThemeSwitch lite className="cursor-pointer" />
</Navbar>
);
const footer = <Footer> </Footer>;
export default async function RootLayout({
children,
}: Readonly<{
children: React.ReactNode;
}>) {
return (
<html
lang="en"
dir="ltr"
suppressHydrationWarning
className={`${GeistSans.className} antialiased`}
>
<Head />
<body>
<Layout
navbar={navbar}
pageMap={await getPageMap()}
footer={footer}
docsRepositoryBase="https://github.com/sergi0g/cup/blob/main/docs"
>
<div>{children}</div>
</Layout>
</body>
</html>
);
}

22
docs/src/app/page.tsx Normal file
View File

@@ -0,0 +1,22 @@
import { useMDXComponents } from "@/mdx-components";
import { Heading, NextraMetadata } from "nextra";
import Home from "./components/pages/home";
/* eslint-disable-next-line */
const Wrapper = useMDXComponents({}).wrapper;
const toc: Heading[] = [];
export const metadata: NextraMetadata = {
title: "Cup - The easiest way to manage your container updates",
description: "Simple, fast, efficient Docker image update checking",
};
export default function Page() {
return (
// @ts-expect-error This component passes all extra props to the underlying component, but that possibility does not exist in the type declarations. A comment there indicates that passing extra props is intended functionality.
<Wrapper toc={toc} metadata={metadata} className={"x:mx-auto x:flex"}>
<Home />
</Wrapper>
);
}

17
docs/src/content/_meta.ts Normal file
View File

@@ -0,0 +1,17 @@
export default {
index: {
theme: {
sidebar: false,
toc: false,
breadcrumb: false,
pagination: false,
timestamp: false,
layout: "full",
},
display: "hidden",
},
docs: {
type: "page",
title: "Documentation",
},
};

View File

@@ -0,0 +1,5 @@
export default {
installation: {},
usage: {},
configuration: {},
};

View File

@@ -0,0 +1,49 @@
import { Callout } from "nextra/components";
# Docker Compose
Many users find it useful to run Cup with Docker Compose, as it enables them to have it constantly running in the background and easily control it. Cup's lightweight resource use makes it ideal for this use case.
There have been requests for an official Docker Compose file, but I believe you should customize it to your needs.
Here is an example of what I would use (by [@ioverho](https://github.com/ioverho)):
```yaml
services:
cup:
image: ghcr.io/sergi0g/cup:latest
container_name: cup # Optional
restart: unless-stopped
command: -c /config/cup.json serve
ports:
- 8000:8000
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- ./cup.json:/config/cup.json
```
If you don't have a config, you can use this instead:
```yaml
services:
cup:
image: ghcr.io/sergi0g/cup:latest
container_name: cup # Optional
restart: unless-stopped
command: serve
ports:
- 8000:8000
volumes:
- /var/run/docker.sock:/var/run/docker.sock
```
Cup can run with a non-root user, but needs to be in a docker group. Assuming user id of 1000 and `docker` group id of 999 you can add this to the `services.cup` key in the docker compose:
```yaml
user: "1000:999"
```
<Callout>
You can use the command `getent group docker | cut -d: -f3` to find the group id for the docker group.
</Callout>
The compose can be customized further of course, if you choose to use a different port, another config location, or would like to change something else. Have fun!

View File

@@ -0,0 +1,47 @@
import Image from "next/image";
import screenshot from "@/app/assets/ha-cup-component.png";
# Home Assistant integration
Many thanks to [@bastgau](https://github.com/bastgau) for creating this integration.
## About
The **HA Cup Component** integration for Home Assistant allows you to retrieve update statistics for Docker containers directly from your Home Assistant interface.
With this integration, you can easily track the status of your Docker containers and receive notifications when updates are available.
The following sensors are currently implemented:
<Image
src={screenshot}
alt="Screenshot of Home Assistant showing a card with update information provided by Cup"
/>
## Installation
### Via HACS
1. Open Home Assistant and go to HACS
2. Navigate to "Integrations" and click on "Add a custom repository".
3. Use https://github.com/bastgau/ha-cup-component as the URL
4. Search for "HA Cup Component" and install it.
5. Restart Home Assistant.
### One-click install
[![Open your Home Assistant instance and start setting up a new integration.](https://my.home-assistant.io/badges/config_flow_start.svg)](https://my.home-assistant.io/redirect/hacs_repository/?owner=bastgau&repository=ha-cup-component&category=Integration)
### Manual Installation
1. Download the integration files from the GitHub repository.
2. Place the integration folder in the custom_components directory of Home Assistant.
3. Restart Home Assistant.
## Support & Contributions
If you encounter any issues or wish to contribute to improving this integration, feel free to open an issue or a pull request in the [GitHub repository](https://github.com/bastgau/ha-cup-component).
Support the author:
[!["Buy Me A Coffee"](https://www.buymeacoffee.com/assets/img/custom_images/orange_img.png)](https://www.buymeacoffee.com/bastgau)

View File

@@ -0,0 +1,74 @@
import Image from "next/image";
import widget1 from "@/app/assets/350767810-42eccc89-bdfd-426a-a113-653abe7483d8.png";
import widget2 from "@/app/assets/358304960-e9f26767-51f7-4b5a-8b74-a5811019497b.jpeg";
# Homepage Widget
Some users have asked for a homepage widget.
## Docker Compose with the widget configured via labels:
```yaml
services:
cup:
image: ghcr.io/sergi0g/cup
container_name: cup
command: -c /config/cup.json serve -p 8000
volumes:
- ./config/cup.json:/config/cup.json
- /var/run/docker.sock:/var/run/docker.sock
ports:
- 8000:8000
restart: unless-stopped
labels:
homepage.group: Network
homepage.name: Cup
homepage.icon: /icons/cup-with-straw.png
homepage.href: http://myserver:8000
homepage.ping: http://myserver:8000
homepage.description: Checks for container updates
homepage.widget.type: customapi
homepage.widget.url: http://myserver:8000/api/v3/json
homepage.widget.mappings[0].label: Monitoring
homepage.widget.mappings[0].field.metrics: monitored_images
homepage.widget.mappings[0].format: number
homepage.widget.mappings[1].label: Up to date
homepage.widget.mappings[1].field.metrics: up_to_date
homepage.widget.mappings[1].format: number
homepage.widget.mappings[2].label: Updates
homepage.widget.mappings[2].field.metrics: updates_available
homepage.widget.mappings[2].format: number
```
Preview:
<Image src={widget1} />
Credit: [@agrmohit](https://github.com/agrmohit)
## Widget in Homepage's config file format:
```yaml
widget:
type: customapi
url: http://<SERVER_HOSTNAME>/api/v3/json
refreshInterval: 10000
method: GET
mappings:
- field: metrics.monitored_images
label: Monitored images
format: number
- field: metrics.up_to_date
label: Up to date
format: number
- field: metrics.updates_available
label: Available updates
format: number
- field: metrics.unknown
label: Unknown
format: number
```
Preview:
<Image src={widget2} />
Credit: [@remussamoila](https://github.com/remussamoila) and [@Valdr687](https://github.com/Valdr687)

View File

@@ -0,0 +1,12 @@
# Agent mode
If you'd like to have only the server API exposed without the dashboard, you can run Cup in agent mode.
Modify your config like this:
```jsonc
{
"agent": true
// Other options
}
```

View File

@@ -0,0 +1,26 @@
import { Callout } from "nextra/components";
# Authentication
Some registries (or specific images) may require you to be authenticated. For those, you can modify `cup.json` like this:
```jsonc
{
"registries": {
"<YOUR_REGISTRY_DOMAIN_1>": {
"authentication": "<YOUR_TOKEN_1>"
// Other options
},
"<YOUR_REGISTRY_DOMAIN_2>" {
"authentication": "<YOUR_TOKEN_2>"
// Other options
},
// ...
}
// 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>

View File

@@ -0,0 +1,18 @@
import { Callout } from "nextra/components";
# Automatic refresh
Cup can automatically refresh the results when running in server mode. Simply add this to your config:
```jsonc
{
"refresh_interval": "0 */30 * * * *", // Check twice an hour
// Other options
}
```
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).
<Callout>
If you use a schedule with absolute time (e.g. every day at 6 AM), make sure to set the `TZ` environment variable to your [timezone](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones#List).
</Callout>

View File

@@ -0,0 +1,22 @@
# Ignored registries
If you want to skip checking images from some registries, you can modify your config like this:
```jsonc
{
"registries": {
"<SOME_REGISTRY_DOMAIN_1>": {
"ignore": true
// Other options
},
"<SOME_REGISTRY_DOMAIN_2>" {
"ignore": false
// Other options
},
// ...
}
// Other options
}
```
This configuration option is a bit redundant, since you can achieve the same with [this option](/docs/configuration/include-exclude-images). It's recommended to use that.

View File

@@ -0,0 +1,23 @@
import { Callout } from "nextra/components";
# Ignored update types
To ignore certain update types, you can modify your config like this:
```jsonc
{
"ignore_update_type": "minor"
}
```
Available options are:
- `none`: Do not ignore any update types (default).
- `major`: Ignore major updates.
- `minor`: Ignore major and minor updates.
- `patch`: Ignore major, minor and patch updates.
<Callout emoji="⚠️">
Ignoring an update type also implies ignoring all update types less specific than it.
For example, ignoring patch updates also implies ignoring major and minor updates.
</Callout>

View File

@@ -0,0 +1,35 @@
# Include/Exclude images
If you want to exclude some images (e.g. because they have too many tags and take too long to check), you can add the following to your config:
```jsonc
{
"images": {
"exclude": [
"ghcr.io/immich-app/immich-machine-learning",
"postgres:15"
]
// ...
}
// Other options
}
```
For an image to be excluded, it must start with one of the strings you specify above. That means you could use `ghcr.io` to exclude all images from ghcr.io or `ghcr.io/sergi0g` to exclude all my images (why would you do that?).
If you want Cup to always check some extra images that aren't available locally, you can modify your config like this:
```jsonc
{
"images": {
"extra": [
"mysql:8.0",
"nextcloud:30"
]
// ...
}
// Other options
}
```
Note that you must specify images with version tags, otherwise Cup will exit with an error!

View File

@@ -0,0 +1,146 @@
---
asIndexPage: true
---
import { Steps, Callout, Cards } from "nextra/components";
import {
IconPaint,
IconLockOpen,
IconKey,
IconPlug,
IconServer,
} from "@tabler/icons-react";
# Configuration
## Custom docker socket
Sometimes, there may be a need to specify a custom docker socket. Cup provides the `-s` option for this.
For example, if using Podman, you might do
```bash
$ 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. If both are defined the CLI `-s` option takes precedence.
<Cards.Card
icon={<IconPlug />}
title="Custom Docker socket"
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`.
<Steps>
### Create the configuration file
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_
### Configure Cup from the configuration file
Follow the guides below to customize your `cup.json`
<Cards>
<Cards.Card
icon={<IconKey />}
title="Authentication"
href="/docs/configuration/authentication"
/>
<Cards.Card
icon={<IconLockOpen />}
title="Insecure registries"
href="/docs/configuration/insecure-registries"
/>
<Cards.Card
icon={<IconPaint />}
title="Theme"
href="/docs/configuration/theme"
/>
<Cards.Card
icon={<IconServer />}
title="Multiple servers"
href="/docs/configuration/servers"
/>
</Cards>
Here's a full example:
```json
{
"$schema": "https://raw.githubusercontent.com/sergi0g/cup/main/cup.schema.json",
"version": 3,
"images": {
"exclude": ["ghcr.io/immich-app/immich-machine-learning"],
"extra": ["ghcr.io/sergi0g/cup:v3.0.0"]
},
"registries": {
"myregistry.com": {
"authentication": "<YOUR_TOKEN_HERE>"
}
},
"servers": {
"Raspberry Pi": "https://server.local:8000"
},
"theme": "blue"
}
```
<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
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.
```bash
$ 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>
## Environment Variables
Want to make a quick change without editing your `config.json`? Cup also supports some configuration options from environment variables.
Here are the ones currently available:
- `CUP_AGENT` - Agent mode
- `CUP_IGNORE_UPDATE_TYPE` - Ignoring specific update types
- `CUP_REFRESH_INTERVAL` - Automatic refresh
- `CUP_SOCKET` - Socket
- `CUP_THEME` - Theme
Refer to the configuration page for more information on each of these.
Here's an example of a Docker Compose file using them:
```yaml
services:
cup:
image: ghcr.io/sergi0g/cup:latest
command: serve
ports:
- 8000:8000
environment:
CUP_AGENT: "true"
CUP_IGNORE_UPDATE_TYPE: major
CUP_REFRESH_INTERVAL: "0 */30 * * * *"
CUP_SOCKET: tcp://localhost:2375
CUP_THEME: blue
```
<Callout>
Heads up!
Any configuration option you set with environment variables **always** overrides anything in your `cup.json`.
</Callout>

View File

@@ -0,0 +1,32 @@
import { Callout } from "nextra/components";
# Insecure registries
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, you can specify exceptions in your `cup.json`.
Here's what it looks like:
```jsonc
{
"registries": {
"<INSECURE_REGISTRY_1>": {
"insecure": true
// Other options
},
"<INSECURE_REGISTRY_2>" {
"insecure": true
// Other options
},
// ...
}
// Other options
}
```
<Callout emoji="⚠️">
When configuring an insecure registry that doesn't run on port 80, don't
forget to specify the port (i.e. use `localhost:5000` instead of `localhost`
if your registry is running on port `5000`)
</Callout>

View File

@@ -0,0 +1,15 @@
# Multiple servers
Besides checking for local image updates, you might want to be able to view update stats for all your servers running Cup in a central place. If you choose to add more servers to your Cup configuration, Cup will retrieve the current list of updates from your other servers and it will be included in the results.
Just add something like this to your config:
```jsonc
{
"servers": {
"Cool server 1": "http://your-other-server-running-cup:8000",
"Other server": "http://and-another-one:9000"
}
// Other options
}
```

View File

@@ -0,0 +1,28 @@
# Custom socket
If you need to specify a custom Docker socket (e.g. because you're using Podman), you can use the `socket` option. Here's an example:
```jsonc
{
"socket": "/run/user/1000/podman/podman.sock"
// Other options
}
```
You can also specify a TCP socket if you're using a remote Docker host or a [proxy](https://github.com/Tecnativa/docker-socket-proxy):
```jsonc
{
"socket": "tcp://localhost:2375"
// Other options
}
```
Or use the "none" value to disable any Docker/Podman query:
```jsonc
{
"socket": "none"
// Other options
}
```

View File

@@ -0,0 +1,31 @@
import { Callout } from "nextra/components";
import Image from "next/image";
import blue from "@/app/assets/blue_theme.png";
import neutral from "@/app/assets/hero-dark.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={neutral} />
However, you can get the old theme back by adding the `theme` key to your `cup.json`
Available options are `default` and `blue`.
Here's an example:
```jsonc
{
"theme": "blue"
// Other options
}
```
Note that the difference between the 2 themes is almost impossible to perceive when your system is in light mode.

View File

@@ -0,0 +1,71 @@
import { Steps } from "nextra/components";
# Contributing
First of all, thanks for taking time to contribute to Cup! This guide will help you set up a development environment and make your first contribution.
## Setting up a development environment
Requirements:
- A computer running Linux
- Rust (usually installed from https://rustup.rs/)
- Node.js 22+ and Bun 1+
<Steps>
### Fork the repository
This is where you'll be pushing your changes before you create a pull request. Make sure to _create a new branch_ for your changes.
### Clone your fork
```bash
git clone https://github.com/<YOUR_USERNAME>/cup
```
If you use SSH:
```bash
git clone git@github.com:<YOUR_USERNAME>/cup`)
```
### Switch to your newly created branch (e.g. if your branch is called `improve-logging`, run `git checkout improve-logging`)
### Set up the frontend
```bash
$ cd web
$ bun install
$ cd ..
$ ./build.sh
```
</Steps>
You're ready to go!
## Project architecture
Cup can be run in 2 modes: CLI and server.
All CLI specific functionality is located in `src/formatting.rs` and some other files in functions prefixed with `#[cfg(feature = "cli")]`.
All server specific functionality is located in `src/server.rs` and `web/`.
## Important notes
- When making any changes, always make sure to write optimize your code for:
- Performance: You should always benchmark Cup before making changes and after your changes to make sure there is none (or a very small) difference in time. Profiling old and new code is also good.
- Readability: Include comments describing any new functions you create, give descriptive names to variables and when making a design decision or a compromise, ALWAYS include a comment explaining what you did and why.
- If you plan on developing the frontend without making backend changes, it is highly recommended to run `cup serve` in the background and start the frontend in development mode from `web/` with `bun dev`.
- If you make changes to the frontend, always remember to prefix your build command with the `build.sh` script which takes care of rebuilding the frontend. For example: `./build.sh cargo build -r`
- When adding new features to Cup (e.g. configuration options), make sure to update the documentation (located in `docs/`). Refer to other pages in the documentation, or to the [official docs](https://nextra.site) for any questions you may have. The docs use `pnpm` as their package manager.
- If you need help with finishing something (e.g. you've made some commits and need help with writing docs, you want some feedback about a design decision, etc.), you can open a draft PR and ask for help there.
## Submitting a PR
To have your changes included in Cup, you will need to create a pull request.
Before doing so, please make sure you have run `cargo clippy` and resolved all warnings related to your changes and have formatted your code with `cargo fmt`. This ensures Cup's codebase is consistent and uses good practices for code.
After you're done with that, commit your changes and push them to your branch.
Next, open your fork on Github and create a pull request. Make sure to include the changes you made, which issues it addresses (if any) and any other info you think is important.
Happy contributing!

View File

@@ -1,26 +1,34 @@
import Image from "next/image"; import Image from "next/image";
import cup from "../../assets/cup.gif"; import cup from "@/app/assets/cup.gif";
import { Cards, Card } from "nextra-theme-docs"; import { Cards } from "nextra/components";
import { IconBrandDocker, IconPackage } from "@tabler/icons-react"; import { IconBrandDocker, IconPackage } from "@tabler/icons-react";
# Introduction # Introduction
<Image src={cup} unoptimized /> <Image src={cup} alt="Animated GIF of Cup's CLI in action" unoptimized />
Cup is a lightweight alternative to [What's up Docker?](https://github.com/fmartinou/whats-up-docker) written in Rust. Cup is a lightweight alternative to [What's up Docker?](https://github.com/getwud/wud) written in Rust.
# Features ✨ # Features ✨
- 🚀 Extremely fast. Cup takes full advantage of your CPU and is hightly optimized, resulting in lightning fast speed. On my test machine, it took ~6 seconds for 70 images. - 🚀 Extremely fast. Cup takes full advantage of your CPU and is hightly optimized, resulting in lightning fast speed. On my Raspberry Pi 5, it took 3.7 seconds for 58 images!
- Supports most registries, including Docker Hub, ghcr.io, Quay, lscr.io and even Gitea (or derivatives) - Supports most registries, including Docker Hub, ghcr.io, Quay, lscr.io and even Gitea (or derivatives)
- Doesn't exhaust any rate limits. This is the original reason I created Cup. It was inspired by What's up docker? which would always use it up. - Doesn't exhaust any rate limits. This is the original reason I created Cup. It was inspired by [What's up docker?](https://github.com/getwud/wud) which would always use it up.
- Beautiful CLI and web interface for checking on your containers any time. - Beautiful CLI and web interface for checking on your containers any time.
- The binary is tiny! At the time of writing it's just 4.7 MB. No more pulling 100+ MB docker images for a such a simple program. - The binary is tiny! At the time of writing it's just 5.4 MB. No more pulling 100+ MB docker images for a such a simple program.
- JSON output for both the CLI and web interface so you can connect Cup to integrations. It's easy to parse and makes webhooks and pretty dashboards simple to set up! - JSON output for both the CLI and web interface so you can connect Cup to integrations. It's easy to parse and makes webhooks and pretty dashboards simple to set up!
# Installation # Installation
<Cards> <Cards>
<Card icon={<IconBrandDocker />} title="With Docker" href="/docs/installation/docker" /> <Cards.Card
<Card icon={<IconPackage />} title="As a binary" href="/docs/installation/binary" /> icon={<IconBrandDocker />}
title="With Docker"
href="/docs/installation/docker"
/>
<Cards.Card
icon={<IconPackage />}
title="As a binary"
href="/docs/installation/binary"
/>
</Cards> </Cards>

View File

@@ -0,0 +1,8 @@
export default {
docker: {
title: "With Docker",
},
binary: {
title: "As a binary",
},
};

View File

@@ -1,7 +1,8 @@
import { Callout, Card, Steps } from "nextra-theme-docs"; import { Callout, Cards, Steps } from "nextra/components";
import { IconFileDescription } from "@tabler/icons-react"; import { IconFileDescription } from "@tabler/icons-react";
# As a binary # As a binary
## Introduction ## Introduction
This guide will help you install Cup from a binary. This guide will help you install Cup from a binary.
@@ -13,6 +14,7 @@ This guide will help you install Cup from a binary.
Go to https://github.com/sergi0g/cup/releases/latest. Go to https://github.com/sergi0g/cup/releases/latest.
Depending on your system's architecture, choose the binary for your system. For example, for an `x86_64` machine, you should download `cup-x86_64-unknown-linux-musl` Depending on your system's architecture, choose the binary for your system. For example, for an `x86_64` machine, you should download `cup-x86_64-unknown-linux-musl`
<Callout> <Callout>
You can use the command `uname -i` to find this You can use the command `uname -i` to find this
</Callout> </Callout>
@@ -21,5 +23,6 @@ Move the binary you downloaded to a directory in your path. You can usually get
</Steps> </Steps>
That's it! Cup is ready to be used. Head over to the Usage page to get started. That's it! Cup is ready to be used. Head over to the Usage page to get started.
<br /> <br />
<Card icon={<IconFileDescription />} title="Usage" href="/docs/usage" /> <Cards.Card icon={<IconFileDescription />} title="Usage" href="/docs/usage" />

View File

@@ -1,7 +1,8 @@
import { Callout, Card } from "nextra-theme-docs"; import { Callout, Cards } from "nextra/components";
import { IconFileDescription } from "@tabler/icons-react"; import { IconFileDescription } from "@tabler/icons-react";
# With Docker # With Docker
## Introduction ## Introduction
This guide will help you install Cup as a Docker container. It is the easiest installation method and also makes updating Cup very easy. This guide will help you install Cup as a Docker container. It is the easiest installation method and also makes updating Cup very easy.
@@ -9,13 +10,18 @@ This guide will help you install Cup as a Docker container. It is the easiest in
## Installation ## Installation
To get started, open up a terminal and run the following command. To get started, open up a terminal and run the following command.
```bash ```bash
$ docker pull ghcr.io/sergi0g/cup $ docker pull ghcr.io/sergi0g/cup
``` ```
<Callout emoji="⚠️"> <Callout emoji="⚠️">
If you aren't in the `docker` group, please ensure you run all commands as a user who does. In most cases, you'll just need to prefix the `docker` commands with `sudo` If you aren't a member of the `docker` group, please ensure you run all
commands as a user who is. In most cases, you'll just need to prefix the
`docker` commands with `sudo`
</Callout> </Callout>
That's it! Cup is ready to be used. Head over to the Usage page to get started. That's it! Cup is ready to be used. Head over to the Usage page to get started.
<br /> <br />
<Card icon={<IconFileDescription />} title="Usage" href="/docs/usage" /> <Cards.Card icon={<IconFileDescription />} title="Usage" href="/docs/usage" />

View File

@@ -0,0 +1,84 @@
import { Callout, Cards } from "nextra/components";
import { IconServer, IconTerminal } from "@tabler/icons-react";
# Integrations
At the moment, Cup has no built-in integrations, but it provides an API for the server and JSON output for the CLI, which can enable you to connect Cup to your own integrations.
## JSON data
The data returned from the API or from the CLI is in JSON and looks like this:
```jsonc
{
// Statistics useful for displaying on dashboards.
// You could calculate these yourself based on the rest of the data,
// but they're provided for easier integration with other systems.
"metrics": {
"monitored_images": 5,
"up_to_date": 2,
"updates_available": 3,
"major_updates": 1,
"minor_updates": 0,
"patch_updates": 0,
"other_updates": 2,
"unknown": 0,
},
// A list of image objects with all related information.
"images": [
{
"reference": "ghcr.io/sergi0g/cup:latest",
"parts": {
// The information Cup extracted about the image from the reference. Mostly useful for debugging and the way the web interface works.
"registry": "ghcr.io",
"repository": "sergi0g/cup",
"tag": "latest",
},
"url": "https://github.com/sergi0g/cup", // The URL specified in the "org.opencontainers.image.url" label, otherwise null
"result": {
"has_update": true, // `true` when an image has an update of any kind, `false` when up to date and `null` when unknown.
"info": {
// `null` if up to date
"type": "digest", // Can also be `version` when Cup detects the tag contains a version.
// If `type` is "digest":
"local_digests": [
// A list of local digests present for the image
"sha256:b7168e5f6828cbbd3622fa19965007e4611cf42b5f3c603008377ffd45a4fe00",
],
"remote_digest": "sha256:170f1974d8fc8ca245bcfae5590bc326de347b19719972bf122400fb13dfa42c", // Latest digest available in the registry
// If `type` is "version":
"version_update_type": "major", // Loosely corresponds to SemVer versioning. Can also be `minor` or `patch`.
"new_tag": "v3.3.3", // The tag of the latest image.
},
"error": null, // If checking for the image fails, will be a string with an error message.
},
"time": 869, // Time in milliseconds it took to check for the update. Useful for debugging.
"server": "Lithium", // The name of the server which the image was checked for updates on. `null` if from the current machine.
},
],
}
```
<Callout emoji="⚠️">
Please keep in mind that the above may not always be up to date. New fields
may be added, or some types extended. If you notice that, just open an issue
and they'll be updated. Changes to the JSON data schema will _always_ happen
in a backwards-compatible way. In case backwards-incompatible changes are
made, these docs will be updated. For something more up-to-date, you can
take a look at https://github.com/sergi0g/cup/blob/main/web/src/types.ts
</Callout>
For retrieving the above data, refer to the CLI and server pages:
<Cards>
<Cards.Card icon={<IconTerminal />} title="CLI" href="/docs/usage/cli" />
<Cards.Card
icon={<IconServer />}
title="Server"
href="/docs/usage/server"
/>
</Cards>
## Refresh Cup
If you'd like to fetch the latest information, you can manually trigger a refresh by making a `GET` request to the `/api/v3/refresh` endpoint. Once the request completes, you can fetch the data as described above.

View File

@@ -1,4 +1,4 @@
import { Callout } from "nextra-theme-docs" import { Callout } from "nextra/components";
# Using the latest version # Using the latest version
@@ -9,7 +9,11 @@ However, it is only updated when a new release is created, so if you want the la
Cup's nightly version always contains the latest changes in the main branch. Cup's nightly version always contains the latest changes in the main branch.
<Callout emoji="⚠️"> <Callout emoji="⚠️">
There is no guarantee that the nightly version will always work. There may be breaking changes or a bad commit and it may not work properly. Install nightly only if you know what you are doing. These instructions will assume you have the technical know-how to follow them. If you do not, please use the stable release There is no guarantee that the nightly version will always work. There may be
breaking changes or a bad commit and it may not work properly. Install nightly
only if you know what you are doing. These instructions will assume you have
the technical know-how to follow them. If you do not, please use the stable
release!
</Callout> </Callout>
## With Docker ## With Docker
@@ -18,4 +22,4 @@ Instead of `ghcr.io/sergi0g/cup`, use `ghcr.io/sergi0g/cup:nightly`
## As a binary ## As a binary
Go to a [nightly workflow run](https://github.com/sergi0g/cup/actions/workflows/nightly.yml) and download the artifact for your system. Go to a [nightly workflow run](https://github.com/sergi0g/cup/actions/workflows/nightly.yml) and download the artifact for your system.

View File

@@ -0,0 +1,99 @@
import Image from "next/image";
import cup from "@/app/assets/cup.gif";
import { Callout } from "nextra/components";
# CLI
Cup's CLI provides the `cup check` command.
## Basic Usage
### Check for all updates
```ansi
$ cup check
✓ Done!
~ Local images
╭─────────────────────────────────────────┬──────────────────────────────────┬─────────╮
│Reference │Status │Time (ms)│
├─────────────────────────────────────────┼──────────────────────────────────┼─────────┤
│postgres:15-alpine │Major update (15 → 17) │788 │
│ghcr.io/immich-app/immich-server:v1.118.2│Minor update (1.118.2 → 1.127.0) │2294 │
│ollama/ollama:0.4.1 │Minor update (0.4.1 → 0.5.12) │533 │
│adguard/adguardhome:v0.107.52 │Patch update (0.107.52 → 0.107.57)│1738 │
│jc21/nginx-proxy-manager:latest │Up to date │583 │
│louislam/uptime-kuma:1 │Up to date │793 │
│moby/buildkit:buildx-stable-1 │Up to date │600 │
│tecnativa/docker-socket-proxy:latest │Up to date │564 │
│ubuntu:latest │Up to date │585 │
│wagoodman/dive:latest │Up to date │585 │
│rolebot:latest │Unknown │174 │
╰─────────────────────────────────────────┴──────────────────────────────────┴─────────╯
 INFO ✨ Checked 11 images in 8312ms
```
### Check for updates to specific images
```ansi
$ cup check node:latest
✓ Done!
~ Local images
╭───────────┬────────────────┬─────────╮
│Reference │Status │Time (ms)│
├───────────┼────────────────┼─────────┤
│node:latest│Update available│788 │
╰───────────┴────────────────┴─────────╯
 INFO ✨ Checked 1 images in 310ms
```
```ansi
$ cup check nextcloud:30 postgres:14 mysql:8.0
✓ Done!
~ Local images
╭────────────┬────────────────────────┬─────────╮
│Reference │Status │Time (ms)│
├────────────┼────────────────────────┼─────────┤
│postgres:14 │Major update (14 → 17) │195 │
│mysql:8.0 │Major update (8.0 → 9.2)│382 │
│nextcloud:30│Up to date │585 │
╰────────────┴────────────────────────┴─────────╯
 INFO ✨ Checked 3 images in 769ms
```
## Enable icons
You can also enable icons if you have a [Nerd Font](https://nerdfonts.com) installed.
<Image src={cup} alt="GIF of Cup's CLI" unoptimized />
## JSON output
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. Note that at the moment it does not match the detailed API the server provides.
```
$ cup check -r
{"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,...}}
```
<Callout emoji="⚠️">
When parsing Cup's output, capture only `stdout`, otherwise you might not get
valid JSON (if there are warnings)
</Callout>
## Usage with Docker
If you're using the Docker image, just replace all occurences of `cup` in the examples with `docker run -tv /var/run/docker.sock:/var/run/docker.sock ghcr.io/sergi0g/cup`.
For example, this:
```bash
$ cup check node:latest
```
becomes:
```bash
$ docker run -tv /var/run/docker.sock:/var/run/docker.sock ghcr.io/sergi0g/cup check node:latest
```

View File

@@ -0,0 +1,15 @@
---
asIndexPage: true
---
import { IconServer, IconTerminal } from "@tabler/icons-react";
import { Cards } from "nextra/components";
# Usage
You can use Cup in 2 different ways. As a CLI or as a server. You can learn more about each mode on its corresponding page
<Cards>
<Cards.Card icon={<IconTerminal />} title="CLI" href="/docs/usage/cli" />
<Cards.Card icon={<IconServer />} title="Server" href="/docs/usage/server" />
</Cards>

View File

@@ -0,0 +1,55 @@
import { Callout } from "nextra/components";
# Server
The server provides the `cup serve` command.
## Basic usage
```ansi
$ cup serve
 INFO Starting server, please wait...
 INFO ✨ Checked 8 images in 8862ms
 INFO Ready to start!
 HTTP GET / 200 in 0ms
 HTTP GET /assets/index.js 200 in 3ms
 HTTP GET /assets/index.css 200 in 0ms
 HTTP GET /api/v3/json 200 in 0ms
```
This will launch the server on port `8000`. To access it, visit `http://<YOUR_IP>:8000` (replace `<YOUR_IP>` with the IP address of the machine running Cup.)
<Callout>
The URL `http://<YOUR_IP>:8000/api/v3/json` is also available for usage with integrations.
</Callout>
## Use a different port
Pass the `-p` argument with the port you want to use
```ansi
$ cup serve -p 9000
 INFO Starting server, please wait...
 INFO ✨ Checked 8 images in 8862ms
 INFO Ready to start!
 HTTP GET / 200 in 0ms
 HTTP GET /assets/index.js 200 in 3ms
 HTTP GET /assets/index.css 200 in 0ms
 HTTP GET /api/v3/json 200 in 0ms
```
## Usage with Docker
If you're using the Docker image, just replace all occurences of `cup` in the examples with `docker run -tv /var/run/docker.sock:/var/run/docker.sock -p <PORT>:<PORT> ghcr.io/sergi0g/cup`, where `<PORT>` is the port Cup will be using.
For example, this:
```bash
$ cup serve -p 9000
```
becomes:
```bash
$ docker run -tv /var/run/docker.sock:/var/run/docker.sock -p 9000:9000 ghcr.io/sergi0g/cup serve -p 9000
```

View File

@@ -0,0 +1,13 @@
import { useMDXComponents as getThemeComponents } from "nextra-theme-docs";
import { MDXComponents } from "nextra/mdx-components";
// Get the default MDX components
const themeComponents = getThemeComponents();
// Merge components
export function useMDXComponents(components: MDXComponents) {
return {
...themeComponents,
...components,
};
}

View File

@@ -1,7 +0,0 @@
@tailwind base;
@tailwind components;
@tailwind utilities;
.tabler-icon {
color: rgb(250 250 250 / var(--tw-text-opacity)) !important
}

Some files were not shown because too many files have changed in this diff Show More