mirror of
https://github.com/getnora-io/nora.git
synced 2026-04-12 09:10:32 +00:00
feat: add Docker image metadata support
- Store metadata (.meta.json) alongside manifests with: - push_timestamp, last_pulled, downloads counter - size_bytes, os, arch, variant - layers list with digest and size - Update metadata on manifest pull (increment downloads, update last_pulled) - Extract OS/arch from config blob on push - Extend UI API TagInfo with metadata fields - Add public_url config option for pull commands - Add Docker upstream proxy with auth support - Add raw repository support - Bump version to 0.2.12
This commit is contained in:
@@ -78,6 +78,7 @@ pub struct AppState {
|
||||
pub tokens: Option<TokenStore>,
|
||||
pub metrics: DashboardMetrics,
|
||||
pub activity: ActivityLog,
|
||||
pub docker_auth: registry::DockerAuth,
|
||||
}
|
||||
|
||||
#[tokio::main]
|
||||
@@ -241,6 +242,9 @@ async fn run_server(config: Config, storage: Storage) {
|
||||
let upload_limiter = rate_limit::upload_rate_limiter(&config.rate_limit);
|
||||
let general_limiter = rate_limit::general_rate_limiter(&config.rate_limit);
|
||||
|
||||
// Initialize Docker auth with proxy timeout
|
||||
let docker_auth = registry::DockerAuth::new(config.docker.proxy_timeout);
|
||||
|
||||
let state = Arc::new(AppState {
|
||||
storage,
|
||||
config,
|
||||
@@ -249,6 +253,7 @@ async fn run_server(config: Config, storage: Storage) {
|
||||
tokens,
|
||||
metrics: DashboardMetrics::new(),
|
||||
activity: ActivityLog::new(50),
|
||||
docker_auth,
|
||||
});
|
||||
|
||||
// Token routes with strict rate limiting (brute-force protection)
|
||||
@@ -261,6 +266,7 @@ async fn run_server(config: Config, storage: Storage) {
|
||||
.merge(registry::npm_routes())
|
||||
.merge(registry::cargo_routes())
|
||||
.merge(registry::pypi_routes())
|
||||
.merge(registry::raw_routes())
|
||||
.layer(upload_limiter);
|
||||
|
||||
// Routes WITHOUT rate limiting (health, metrics, UI)
|
||||
@@ -312,6 +318,7 @@ async fn run_server(config: Config, storage: Storage) {
|
||||
npm = "/npm/",
|
||||
cargo = "/cargo/",
|
||||
pypi = "/simple/",
|
||||
raw = "/raw/",
|
||||
"Available endpoints"
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user