Skip to content

Commit 644aa96

Browse files
authored
Merge pull request #3 from sorphwer/feat/add-image-api
feat: add tag api
2 parents 7abc339 + 7902b75 commit 644aa96

File tree

39 files changed

+7897
-178
lines changed

39 files changed

+7897
-178
lines changed

.cursor/rules/api-rule.mdc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
description: next.js api design
3+
alwaysApply: false
4+
---
5+
Always follow https://google.aip.dev/general
6+
CRON API must have authentication.

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,6 @@
1515
[![Duplicated Lines (%)](https://sonarcloud.io/api/project_badges/measure?project=sorphwer_dify-helm-watchdog&metric=duplicated_lines_density)](https://sonarcloud.io/summary/new_code?id=sorphwer_dify-helm-watchdog)
1616

1717
[![Technical Debt](https://sonarcloud.io/api/project_badges/measure?project=sorphwer_dify-helm-watchdog&metric=sqale_index)](https://sonarcloud.io/summary/new_code?id=sorphwer_dify-helm-watchdog)
18+
19+
20+
Test CRON: curl -X POST http://localhost:3000/api/v1/cron -H 'secret: SECRET' -v

dify-helm-watchdog/README.md

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,19 @@ Cyber-dark dashboard that snapshots the [Dify Helm chart](https://langgenius.git
44

55
## Features
66

7-
- **Daily cron** via `/api/cron` (configured in `vercel.json`) keeps `cache.json`, `values.yaml`, and `docker-images.yaml` files fresh.
7+
- **Daily cron** via `/api/v1/cron` (configured in `vercel.json`) keeps `cache.json`, `values.yaml`, and `docker-images.yaml` files fresh.
88
- **Vercel Blob storage** persists cached artifacts; hashes are tracked in `cache.json` for quick diffing.
99
- **Cyber dark UI** with a left-hand version rail and dual copyable code panes powered by a shadcn-inspired `CodeBlock`.
10-
- **API endpoints**:
11-
- `GET /api/cron` – runs the synchronisation job (also accepts POST).
12-
- `GET /api/cache` – returns the latest cache payload for lightweight consumers.
10+
- **RESTful API** for programmatic access:
11+
- `GET /api/v1/versions` – list all cached Helm versions
12+
- `GET /api/v1/versions/latest` – get latest version info
13+
- `GET /api/v1/versions/{version}/images` – get image list (supports JSON/YAML format)
14+
- `GET /api/v1/versions/{version}/values` – download values.yaml
15+
- `GET /api/v1/versions/{version}/validation` – get image validation results
16+
- `POST /api/v1/cron` – runs the synchronisation job
17+
- `GET /api/v1/cache` – returns the latest cache payload (legacy endpoint)
18+
19+
📖 **[Full API Documentation](./docs/API.md)** | 🚀 **[Quick Start Guide](./docs/QUICKSTART.md)**
1320

1421
## Prerequisites
1522

@@ -38,7 +45,7 @@ Cyber-dark dashboard that snapshots the [Dify Helm chart](https://langgenius.git
3845

3946
4. Prime the cache (optional but recommended before visiting the UI):
4047
```bash
41-
curl -X POST http://localhost:3000/api/cron
48+
curl -X POST http://localhost:3000/api/v1/cron
4249
```
4350
Once complete, the UI at `http://localhost:3000` will show the latest versions and YAML snapshots.
4451

@@ -61,7 +68,7 @@ Cyber-dark dashboard that snapshots the [Dify Helm chart](https://langgenius.git
6168

6269
```
6370
┌────────────┐ ┌───────────────────────────┐ ┌─────────────────┐
64-
│ Vercel Cron│ ---> │ /api/cron (syncHelmData) │ ---> │ Vercel Blob │
71+
│ Vercel Cron│ ---> │ /api/v1/cron (syncHelmData) │ ---> │ Vercel Blob │
6572
└────────────┘ │ - fetch index.yaml │ │ cache.json │
6673
│ - extract values/images │ │ values/*.yaml │
6774
└───────────────────────────┘ │ images/*.yaml │

0 commit comments

Comments
 (0)