diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml
index 2f04e68..874ae08 100644
--- a/.github/workflows/docker-publish.yml
+++ b/.github/workflows/docker-publish.yml
@@ -22,10 +22,11 @@ jobs:
OWNER=$(echo "${{ github.repository_owner }}" | tr '[:upper:]' '[:lower:]')
if [[ "$GITHUB_REF" == refs/tags/* ]]; then
VERSION=${GITHUB_REF#refs/tags/}
- echo "tags=ghcr.io/${OWNER}/s3proxy-python:${VERSION}" >> $GITHUB_OUTPUT
else
- echo "tags=ghcr.io/${OWNER}/s3proxy-python:latest" >> $GITHUB_OUTPUT
+ VERSION=latest
fi
+ echo "proxy=ghcr.io/${OWNER}/s3proxy-python:${VERSION}" >> $GITHUB_OUTPUT
+ echo "dashboard=ghcr.io/${OWNER}/s3proxy-dashboard:${VERSION}" >> $GITHUB_OUTPUT
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v4
@@ -37,12 +38,24 @@ jobs:
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- - name: Build and push Docker image
+ - name: Build and push proxy image
uses: docker/build-push-action@v7
with:
context: .
+ file: s3proxy/Dockerfile
push: true
- tags: ${{ steps.tags.outputs.tags }}
- cache-from: type=gha
- cache-to: type=gha,mode=max
+ tags: ${{ steps.tags.outputs.proxy }}
+ cache-from: type=gha,scope=proxy
+ cache-to: type=gha,mode=max,scope=proxy
+ platforms: linux/amd64,linux/arm64
+
+ - name: Build and push dashboard image
+ uses: docker/build-push-action@v7
+ with:
+ context: dashboard-frontend
+ file: dashboard-frontend/Dockerfile
+ push: true
+ tags: ${{ steps.tags.outputs.dashboard }}
+ cache-from: type=gha,scope=dashboard
+ cache-to: type=gha,mode=max,scope=dashboard
platforms: linux/amd64,linux/arm64
diff --git a/.github/workflows/helm-install-test.yml b/.github/workflows/helm-install-test.yml
index d25d257..f7d2e50 100644
--- a/.github/workflows/helm-install-test.yml
+++ b/.github/workflows/helm-install-test.yml
@@ -101,8 +101,11 @@ jobs:
--set redis.enabled=true \
--set redis.auth.enabled=true \
--set redis.auth.password=testredispassword123 \
- --set admin.enabled=true \
- --set admin.secret=test-admin-secret-for-ci \
+ --set dashboard.enabled=true \
+ --set dashboard.secret=test-dashboard-secret-for-ci \
+ --set dashboard.frontend.image.repository=ghcr.io/${OWNER}/s3proxy-dashboard \
+ --set dashboard.frontend.image.tag=latest \
+ --set dashboard.frontend.image.pullPolicy=Always \
--set frontproxy.enabled=true \
--set replicaCount=3 \
--set resources.limits.cpu=100m \
@@ -225,66 +228,74 @@ jobs:
echo "✓ All smoke tests passed!"
'
- - name: Verify admin dashboard
+ - name: Verify dashboard
run: |
set -euo pipefail
ENDPOINT="http://s3proxy-python:4433"
- BUCKET="admin-ci"
- KEY="admin-ci.txt"
+ BUCKET="dashboard-ci"
+ KEY="dashboard-ci.txt"
+
+ echo "=== Dashboard pod is ready ==="
+ kubectl wait --for=condition=ready pod \
+ -l app.kubernetes.io/component=dashboard -n s3proxy --timeout=120s
+ kubectl get pods -n s3proxy -l app.kubernetes.io/component=dashboard
echo "=== Upload an object through the proxy (so the dashboard has traffic) ==="
- kubectl run admin-ci-upload -n s3proxy --rm -i --restart=Never \
+ kubectl run dashboard-ci-upload -n s3proxy --rm -i --restart=Never \
--image=amazon/aws-cli:latest \
--env="AWS_ACCESS_KEY_ID=minioadmin" \
--env="AWS_SECRET_ACCESS_KEY=minioadmin" \
--env="AWS_DEFAULT_REGION=us-east-1" \
--command -- /bin/sh -c "
set -e
- echo 'admin dashboard ci object' > /tmp/o.txt
+ echo 'dashboard ci object' > /tmp/o.txt
aws --endpoint-url $ENDPOINT s3 mb s3://$BUCKET 2>/dev/null || true
aws --endpoint-url $ENDPOINT s3 cp /tmp/o.txt s3://$BUCKET/$KEY
aws --endpoint-url $ENDPOINT s3 cp s3://$BUCKET/$KEY /tmp/d.txt
- test \"\$(cat /tmp/d.txt)\" = 'admin dashboard ci object'
+ test \"\$(cat /tmp/d.txt)\" = 'dashboard ci object'
echo UPLOAD_OK
"
- echo "=== Port-forward the admin dashboard ==="
- kubectl port-forward svc/s3proxy-python 4433:4433 -n s3proxy &
+ # The dashboard is single-origin behind its own service: nginx serves the
+ # static SPA and reverse-proxies /dashboard/api to the proxy. Port-forward
+ # the dashboard service and exercise the whole thing through it.
+ echo "=== Port-forward the dashboard service ==="
+ kubectl port-forward svc/s3proxy-python-dashboard 18080:80 -n s3proxy &
PF_PID=$!
trap "kill $PF_PID 2>/dev/null || true" EXIT
- for i in $(seq 1 15); do curl -sf -o /dev/null http://localhost:4433/admin/login && break; sleep 1; done
+ BASE="http://localhost:18080/dashboard"
+ for i in $(seq 1 15); do curl -sf -o /dev/null "$BASE" && break; sleep 1; done
- echo "=== 1. Login page is served (unauthenticated) ==="
- curl -sf http://localhost:4433/admin/login | grep -q "Sign in to the admin dashboard"
- echo "✓ Login page served"
+ echo "=== 1. Static SPA shell is served ==="
+ curl -sf "$BASE" | grep -q "_app/" || { echo "✗ SPA shell not served at $BASE"; exit 1; }
+ curl -sf -o /dev/null "$BASE/login" # SPA fallback for the login route
+ echo "✓ SPA shell served"
- echo "=== 2. Auth is enforced ==="
- CODE=$(curl -s -o /dev/null -w '%{http_code}' http://localhost:4433/admin/api/status)
+ echo "=== 2. Auth is enforced (API reverse-proxied through the dashboard) ==="
+ CODE=$(curl -s -o /dev/null -w '%{http_code}' "$BASE/api/status")
[ "$CODE" = "401" ] || { echo "✗ status API without auth returned $CODE (expected 401)"; exit 1; }
# The AWS secret key must NOT work as a dashboard password (fallback removed).
- CODE=$(curl -s -o /dev/null -w '%{http_code}' -u minioadmin:minioadmin http://localhost:4433/admin/api/status)
- [ "$CODE" = "401" ] || { echo "✗ AWS creds accepted as admin login ($CODE) — fallback not removed"; exit 1; }
+ CODE=$(curl -s -o /dev/null -w '%{http_code}' -u minioadmin:minioadmin "$BASE/api/status")
+ [ "$CODE" = "401" ] || { echo "✗ AWS creds accepted as dashboard login ($CODE) — fallback not removed"; exit 1; }
echo "✓ Unauthenticated + AWS-cred requests rejected (401)"
- echo "=== 3. Dashboard + status API work with admin credentials (admin/admin) ==="
- CODE=$(curl -s -o /dev/null -w '%{http_code}' -u admin:admin http://localhost:4433/admin/)
- [ "$CODE" = "200" ] || { echo "✗ dashboard returned $CODE (expected 200)"; exit 1; }
- STATUS=$(curl -sf -u admin:admin http://localhost:4433/admin/api/status)
+ echo "=== 3. Status API works with dashboard credentials (admin/admin) ==="
+ STATUS=$(curl -sf -u admin:admin "$BASE/api/status")
echo "$STATUS" | grep -q '"status":"Running"' || { echo "✗ status not Running: $STATUS"; exit 1; }
- echo "✓ Dashboard + status API healthy"
+ echo "✓ Status API healthy"
echo "=== 4. Bucket listing API shows the uploaded object ==="
- BUCKETS=$(curl -sf -u admin:admin "http://localhost:4433/admin/api/buckets/$BUCKET")
+ BUCKETS=$(curl -sf -u admin:admin "$BASE/api/buckets/$BUCKET")
echo "$BUCKETS" | grep -q "\"$KEY\"" || { echo "✗ '$KEY' not in bucket listing: $BUCKETS"; exit 1; }
echo "✓ Bucket listing shows '$KEY'"
echo "=== 5. Object detail API reports encryption ==="
- OBJ=$(curl -sf -u admin:admin "http://localhost:4433/admin/api/objects/$BUCKET/$KEY")
+ OBJ=$(curl -sf -u admin:admin "$BASE/api/objects/$BUCKET/$KEY")
echo "$OBJ" | grep -q '"encrypted":true' || { echo "✗ object detail not encrypted: $OBJ"; exit 1; }
echo "✓ Object detail reports encrypted"
echo ""
- echo "✓ Admin dashboard verified end-to-end"
+ echo "✓ Dashboard verified end-to-end"
- name: Show logs on failure
if: failure()
diff --git a/README.md b/README.md
index 25c6820..369a1e3 100644
--- a/README.md
+++ b/README.md
@@ -129,7 +129,8 @@ A request signed by an access key with no configured KEK is rejected. Via Helm:
| `s3.region` | `us-east-1` | AWS region |
| `secrets.credentials` | `[]` | AWS credentials, each `{accessKey, secretKey, kek}` |
| `secrets.existingSecrets.enabled` | `false` | Use existing K8s secret |
-| `admin.secret` | `change-me` | Secret signing admin session cookies (when admin UI on) |
+| `dashboard.enabled` | `false` | Enable the dashboard API + its separate UI deployment |
+| `dashboard.secret` | `change-me` | Secret signing dashboard session cookies (when the dashboard is on) |
| `redis.enabled` | `true` | Deploy the bundled single Redis pod (transient upload state) |
| `frontproxy.enabled` | `false` | Bundled HAProxy for even load distribution (no external dependency) |
| `ingress.enabled` | `false` | Expose S3 outside the cluster via Ingress (requires `frontproxy.enabled`) |
diff --git a/chart/README.md b/chart/README.md
index 6c3970a..5bae5b7 100644
--- a/chart/README.md
+++ b/chart/README.md
@@ -27,20 +27,23 @@ helm install s3proxy oci://ghcr.io/serversidehannes/s3proxy-python/charts/s3prox
| `secrets.existingSecrets.enabled` | `false` | Use pre-created K8s secret |
| `secrets.existingSecrets.name` | `""` | Existing secret name |
| `secrets.existingSecrets.keys.credentials` | `S3PROXY_CREDENTIALS` | Credentials key name in existing secret |
-| `admin.enabled` | `false` | Enable the admin dashboard |
-| `admin.path` | `/admin` | URL path prefix for the dashboard |
-| `admin.username` | `admin` | Dashboard username (stored in the Secret; override in production) |
-| `admin.password` | `admin` | Dashboard password (stored in the Secret; override in production) |
-| `admin.secret` | `change-me` | Secret signing dashboard session cookies (override in production) |
-| `admin.existingSecret.name` | `""` | Pre-created secret holding admin credentials |
-| `admin.existingSecret.usernameKey` | `S3PROXY_ADMIN_USERNAME` | Username key in the existing secret |
-| `admin.existingSecret.passwordKey` | `S3PROXY_ADMIN_PASSWORD` | Password key in the existing secret |
-| `admin.existingSecret.secretKey` | `S3PROXY_ADMIN_SECRET` | Session-secret key in the existing secret |
-| `admin.ingress.enabled` | `false` | Dedicated Ingress for the dashboard (keep off unless intentionally exposing it) |
-| `admin.ingress.className` | `""` | Ingress class for the admin Ingress (set to your cluster's controller) |
-| `admin.ingress.host` | `""` | Hostname for the dashboard (required when enabled) |
-| `admin.ingress.annotations` | `{}` | Annotations (e.g. IP allowlist) for the admin Ingress |
-| `admin.ingress.tls` | `[]` | TLS config for the admin Ingress |
+| `dashboard.enabled` | `false` | Enable the dashboard |
+| `dashboard.path` | `/dashboard` | URL path prefix for the dashboard |
+| `dashboard.username` | `admin` | Dashboard username (stored in the Secret; override in production) |
+| `dashboard.password` | `admin` | Dashboard password (stored in the Secret; override in production) |
+| `dashboard.frontend.enabled` | `true` | Run the Svelte UI as its own Deployment (nginx serving the static build + reverse-proxying the API) |
+| `dashboard.frontend.image.repository` | `ghcr.io/serversidehannes/s3proxy-dashboard` | Dashboard UI image |
+| `dashboard.frontend.image.tag` | `latest` | Dashboard UI image tag |
+| `dashboard.frontend.replicaCount` | `1` | Dashboard UI replicas |
+| `dashboard.frontend.service.port` | `80` | Dashboard Service port |
+| `dashboard.existingSecret.name` | `""` | Pre-created secret holding dashboard credentials |
+| `dashboard.existingSecret.usernameKey` | `S3PROXY_DASHBOARD_USERNAME` | Username key in the existing secret |
+| `dashboard.existingSecret.passwordKey` | `S3PROXY_DASHBOARD_PASSWORD` | Password key in the existing secret |
+| `dashboard.ingress.enabled` | `false` | Dedicated Ingress for the dashboard (keep off unless intentionally exposing it) |
+| `dashboard.ingress.className` | `""` | Ingress class for the dashboard Ingress (set to your cluster's controller) |
+| `dashboard.ingress.host` | `""` | Hostname for the dashboard (required when enabled) |
+| `dashboard.ingress.annotations` | `{}` | Annotations (e.g. IP allowlist) for the dashboard Ingress |
+| `dashboard.ingress.tls` | `[]` | TLS config for the dashboard Ingress |
| `redis.enabled` | `true` | Deploy the bundled single Redis pod (transient upload state) |
| `redis.image.repository` | `redis` | Redis image (bump manually; not tracked by dependabot) |
| `redis.image.tag` | `7-alpine` | Redis image tag |
diff --git a/chart/templates/admin-ingress.yaml b/chart/templates/admin-ingress.yaml
deleted file mode 100644
index cdd575b..0000000
--- a/chart/templates/admin-ingress.yaml
+++ /dev/null
@@ -1,38 +0,0 @@
-{{- if and .Values.admin.enabled .Values.admin.ingress.enabled -}}
-{{- if not .Values.admin.ingress.host }}
-{{- fail "admin.ingress.enabled is true but admin.ingress.host is empty — set a hostname for the admin dashboard" }}
-{{- end }}
-apiVersion: networking.k8s.io/v1
-kind: Ingress
-metadata:
- name: {{ .Chart.Name }}-admin
- labels:
- {{- include "s3proxy.labels" . | nindent 4 }}
- {{- with .Values.admin.ingress.annotations }}
- annotations:
- {{- toYaml . | nindent 4 }}
- {{- end }}
-spec:
- ingressClassName: {{ .Values.admin.ingress.className }}
- {{- with .Values.admin.ingress.tls }}
- tls:
- {{- range . }}
- - hosts:
- {{- range .hosts }}
- - {{ . | quote }}
- {{- end }}
- secretName: {{ .secretName }}
- {{- end }}
- {{- end }}
- rules:
- - host: {{ .Values.admin.ingress.host | quote }}
- http:
- paths:
- - path: {{ .Values.admin.path }}
- pathType: Prefix
- backend:
- service:
- name: {{ .Chart.Name }}
- port:
- number: {{ .Values.service.port }}
-{{- end }}
diff --git a/chart/templates/dashboard/configmap.yaml b/chart/templates/dashboard/configmap.yaml
new file mode 100644
index 0000000..cc4c0cd
--- /dev/null
+++ b/chart/templates/dashboard/configmap.yaml
@@ -0,0 +1,55 @@
+{{- if and .Values.dashboard.enabled .Values.dashboard.frontend.enabled -}}
+{{- $base := .Values.dashboard.path | trimSuffix "/" -}}
+{{- $proxy := printf "http://%s.%s.svc.cluster.local:%v" .Chart.Name .Release.Namespace .Values.service.port -}}
+apiVersion: v1
+kind: ConfigMap
+metadata:
+ name: {{ .Chart.Name }}-dashboard-nginx
+ labels:
+ {{- include "s3proxy.labels" . | nindent 4 }}
+ app.kubernetes.io/component: dashboard
+data:
+ default.conf: |
+ # Serves the static dashboard under dashboard.path and reverse-proxies the API +
+ # auth endpoints to the proxy service, so the dashboard is single-origin: the
+ # SPA's relative /api fetches and the session cookie work whether reached via
+ # this pod directly (a single port-forward) or through the ingress.
+ server {
+ listen {{ .Values.dashboard.frontend.containerPort }};
+ server_name _;
+
+ root /usr/share/nginx/html;
+
+ # API + SSE and form auth (POST /api/login, GET /api/logout) all live in
+ # the proxy process. The /login page itself is the static SPA below.
+ location {{ $base }}/api/ {
+ proxy_pass {{ $proxy }};
+ proxy_http_version 1.1;
+ proxy_set_header Host $host;
+ proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
+ proxy_set_header X-Forwarded-Proto $scheme;
+ # SSE: stream events as they arrive rather than buffering.
+ proxy_buffering off;
+ proxy_cache off;
+ proxy_read_timeout 1h;
+ }
+
+ # Hashed, immutable build assets.
+ location {{ $base }}/_app/ {
+ alias /usr/share/nginx/html/_app/;
+ access_log off;
+ expires 1y;
+ add_header Cache-Control "public, immutable";
+ }
+
+ # Everything else under dashboard.path falls back to the SPA shell so client
+ # hash routing and the {{ $base }}/login page work on hard refresh.
+ location {{ $base }} {
+ try_files $uri /index.html;
+ }
+
+ location = / {
+ return 302 {{ $base }};
+ }
+ }
+{{- end }}
diff --git a/chart/templates/dashboard/deployment.yaml b/chart/templates/dashboard/deployment.yaml
new file mode 100644
index 0000000..c25baa9
--- /dev/null
+++ b/chart/templates/dashboard/deployment.yaml
@@ -0,0 +1,92 @@
+{{- if and .Values.dashboard.enabled .Values.dashboard.frontend.enabled -}}
+apiVersion: apps/v1
+kind: Deployment
+metadata:
+ name: {{ .Chart.Name }}-dashboard
+ labels:
+ {{- include "s3proxy.labels" . | nindent 4 }}
+ app.kubernetes.io/component: dashboard
+spec:
+ replicas: {{ .Values.dashboard.frontend.replicaCount }}
+ selector:
+ matchLabels:
+ {{- include "s3proxy.selectorLabels" . | nindent 6 }}
+ app.kubernetes.io/component: dashboard
+ template:
+ metadata:
+ labels:
+ {{- include "s3proxy.labels" . | nindent 8 }}
+ app.kubernetes.io/component: dashboard
+ annotations:
+ checksum/nginx: {{ include (print $.Template.BasePath "/dashboard/configmap.yaml") . | sha256sum }}
+ spec:
+ containers:
+ - name: dashboard
+ image: "{{ .Values.dashboard.frontend.image.repository }}:{{ .Values.dashboard.frontend.image.tag }}"
+ imagePullPolicy: {{ .Values.dashboard.frontend.image.pullPolicy }}
+ ports:
+ - name: http
+ containerPort: {{ .Values.dashboard.frontend.containerPort }}
+ protocol: TCP
+ volumeMounts:
+ - name: nginx-conf
+ mountPath: /etc/nginx/conf.d/default.conf
+ subPath: default.conf
+ readOnly: true
+ - name: nginx-cache
+ mountPath: /var/cache/nginx
+ - name: nginx-run
+ mountPath: /tmp
+ resources:
+ {{- toYaml .Values.dashboard.frontend.resources | nindent 12 }}
+ startupProbe:
+ httpGet:
+ path: {{ .Values.dashboard.path | trimSuffix "/" }}
+ port: http
+ initialDelaySeconds: 2
+ periodSeconds: 2
+ timeoutSeconds: 3
+ failureThreshold: 30
+ livenessProbe:
+ httpGet:
+ path: {{ .Values.dashboard.path | trimSuffix "/" }}
+ port: http
+ initialDelaySeconds: 5
+ periodSeconds: 10
+ timeoutSeconds: 5
+ failureThreshold: 3
+ readinessProbe:
+ httpGet:
+ path: {{ .Values.dashboard.path | trimSuffix "/" }}
+ port: http
+ initialDelaySeconds: 2
+ periodSeconds: 5
+ timeoutSeconds: 3
+ failureThreshold: 3
+ securityContext:
+ runAsNonRoot: true
+ runAsUser: 101
+ readOnlyRootFilesystem: true
+ allowPrivilegeEscalation: false
+ volumes:
+ - name: nginx-conf
+ configMap:
+ name: {{ .Chart.Name }}-dashboard-nginx
+ - name: nginx-cache
+ emptyDir: {}
+ - name: nginx-run
+ emptyDir: {}
+ terminationGracePeriodSeconds: 15
+ {{- with .Values.dashboard.frontend.nodeSelector }}
+ nodeSelector:
+ {{- toYaml . | nindent 8 }}
+ {{- end }}
+ {{- with .Values.dashboard.frontend.affinity }}
+ affinity:
+ {{- toYaml . | nindent 8 }}
+ {{- end }}
+ {{- with .Values.dashboard.frontend.tolerations }}
+ tolerations:
+ {{- toYaml . | nindent 8 }}
+ {{- end }}
+{{- end }}
diff --git a/chart/templates/dashboard/ingress.yaml b/chart/templates/dashboard/ingress.yaml
new file mode 100644
index 0000000..44e0363
--- /dev/null
+++ b/chart/templates/dashboard/ingress.yaml
@@ -0,0 +1,42 @@
+{{- if and .Values.dashboard.enabled .Values.dashboard.ingress.enabled -}}
+{{- if not .Values.dashboard.ingress.host }}
+{{- fail "dashboard.ingress.enabled is true but dashboard.ingress.host is empty — set a hostname for the dashboard" }}
+{{- end }}
+apiVersion: networking.k8s.io/v1
+kind: Ingress
+metadata:
+ name: {{ .Chart.Name }}-dashboard
+ labels:
+ {{- include "s3proxy.labels" . | nindent 4 }}
+ {{- with .Values.dashboard.ingress.annotations }}
+ annotations:
+ {{- toYaml . | nindent 4 }}
+ {{- end }}
+spec:
+ ingressClassName: {{ .Values.dashboard.ingress.className }}
+ {{- with .Values.dashboard.ingress.tls }}
+ tls:
+ {{- range . }}
+ - hosts:
+ {{- range .hosts }}
+ - {{ . | quote }}
+ {{- end }}
+ secretName: {{ .secretName }}
+ {{- end }}
+ {{- end }}
+ rules:
+ - host: {{ .Values.dashboard.ingress.host | quote }}
+ http:
+ paths:
+ # The whole dashboard.path goes to the dashboard Deployment. Its nginx serves
+ # the static UI and reverse-proxies dashboard.path/api (JSON + SSE) and the
+ # form-auth endpoints to the proxy service, so the dashboard is single
+ # origin behind one backend.
+ - path: {{ .Values.dashboard.path }}
+ pathType: Prefix
+ backend:
+ service:
+ name: {{ .Chart.Name }}-dashboard
+ port:
+ number: {{ .Values.dashboard.frontend.service.port }}
+{{- end }}
diff --git a/chart/templates/dashboard/service.yaml b/chart/templates/dashboard/service.yaml
new file mode 100644
index 0000000..6760291
--- /dev/null
+++ b/chart/templates/dashboard/service.yaml
@@ -0,0 +1,19 @@
+{{- if and .Values.dashboard.enabled .Values.dashboard.frontend.enabled -}}
+apiVersion: v1
+kind: Service
+metadata:
+ name: {{ .Chart.Name }}-dashboard
+ labels:
+ {{- include "s3proxy.labels" . | nindent 4 }}
+ app.kubernetes.io/component: dashboard
+spec:
+ type: ClusterIP
+ selector:
+ {{- include "s3proxy.selectorLabels" . | nindent 4 }}
+ app.kubernetes.io/component: dashboard
+ ports:
+ - name: http
+ port: {{ .Values.dashboard.frontend.service.port }}
+ targetPort: http
+ protocol: TCP
+{{- end }}
diff --git a/chart/templates/frontproxy-configmap.yaml b/chart/templates/frontproxy/configmap.yaml
similarity index 100%
rename from chart/templates/frontproxy-configmap.yaml
rename to chart/templates/frontproxy/configmap.yaml
diff --git a/chart/templates/frontproxy-deployment.yaml b/chart/templates/frontproxy/deployment.yaml
similarity index 97%
rename from chart/templates/frontproxy-deployment.yaml
rename to chart/templates/frontproxy/deployment.yaml
index be620d0..c57bde9 100644
--- a/chart/templates/frontproxy-deployment.yaml
+++ b/chart/templates/frontproxy/deployment.yaml
@@ -18,7 +18,7 @@ spec:
{{- include "s3proxy.labels" . | nindent 8 }}
app.kubernetes.io/component: frontproxy
annotations:
- checksum/config: {{ include (print $.Template.BasePath "/frontproxy-configmap.yaml") . | sha256sum }}
+ checksum/config: {{ include (print $.Template.BasePath "/frontproxy/configmap.yaml") . | sha256sum }}
spec:
containers:
- name: haproxy
diff --git a/chart/templates/frontproxy-pdb.yaml b/chart/templates/frontproxy/pdb.yaml
similarity index 100%
rename from chart/templates/frontproxy-pdb.yaml
rename to chart/templates/frontproxy/pdb.yaml
diff --git a/chart/templates/frontproxy-service.yaml b/chart/templates/frontproxy/service.yaml
similarity index 100%
rename from chart/templates/frontproxy-service.yaml
rename to chart/templates/frontproxy/service.yaml
diff --git a/chart/templates/configmap.yaml b/chart/templates/s3proxy/configmap.yaml
similarity index 85%
rename from chart/templates/configmap.yaml
rename to chart/templates/s3proxy/configmap.yaml
index 5a46ed7..4ed8a93 100644
--- a/chart/templates/configmap.yaml
+++ b/chart/templates/s3proxy/configmap.yaml
@@ -18,7 +18,7 @@ data:
{{- end }}
S3PROXY_REDIS_UPLOAD_TTL_HOURS: {{ .Values.externalRedis.uploadTtlHours | quote }}
S3PROXY_LOG_LEVEL: {{ .Values.logLevel | quote }}
- {{- if .Values.admin.enabled }}
- S3PROXY_ADMIN_UI: "true"
- S3PROXY_ADMIN_PATH: {{ .Values.admin.path | quote }}
+ {{- if .Values.dashboard.enabled }}
+ S3PROXY_DASHBOARD_UI: "true"
+ S3PROXY_DASHBOARD_PATH: {{ .Values.dashboard.path | quote }}
{{- end }}
diff --git a/chart/templates/deployment.yaml b/chart/templates/s3proxy/deployment.yaml
similarity index 78%
rename from chart/templates/deployment.yaml
rename to chart/templates/s3proxy/deployment.yaml
index cdb8d76..75f1699 100644
--- a/chart/templates/deployment.yaml
+++ b/chart/templates/s3proxy/deployment.yaml
@@ -30,17 +30,17 @@ spec:
- secretRef:
name: {{ printf "%s-secrets" .Chart.Name }}
{{- end }}
- {{- /* Admin creds need an explicit env block only when they are NOT already
- pulled in via the chart-secret envFrom above (i.e. an admin existingSecret
+ {{- /* Dashboard creds need an explicit env block only when they are NOT already
+ pulled in via the chart-secret envFrom above (i.e. an dashboard existingSecret
is set, or the app uses an existing secret so envFrom never fires). */ -}}
- {{- $adminFromChartSecret := and .Values.admin.enabled (not .Values.admin.existingSecret.name) (not .Values.secrets.existingSecrets.enabled) }}
- {{- $adminNeedsEnv := and .Values.admin.enabled (not $adminFromChartSecret) }}
+ {{- $dashboardFromChartSecret := and .Values.dashboard.enabled (not .Values.dashboard.existingSecret.name) (not .Values.secrets.existingSecrets.enabled) }}
+ {{- $dashboardNeedsEnv := and .Values.dashboard.enabled (not $dashboardFromChartSecret) }}
{{- /* Redis password is needed when the bundled Redis has auth on, or
external Redis is used with an existing secret. */ -}}
{{- $redisAuth := and .Values.redis.enabled .Values.redis.auth.enabled }}
{{- $extRedisAuth := and (not .Values.redis.enabled) .Values.externalRedis.existingSecret }}
{{- /* Determine if we need env section */ -}}
- {{- $needsEnv := or .Values.secrets.existingSecrets.enabled $adminNeedsEnv $redisAuth $extRedisAuth }}
+ {{- $needsEnv := or .Values.secrets.existingSecrets.enabled $dashboardNeedsEnv $redisAuth $extRedisAuth }}
{{- if $needsEnv }}
env:
{{- /* App secrets from existing secret */ -}}
@@ -51,24 +51,19 @@ spec:
name: {{ .Values.secrets.existingSecrets.name }}
key: {{ .Values.secrets.existingSecrets.keys.credentials }}
{{- end }}
- {{- /* Admin dashboard credentials (when not pulled via the chart-secret envFrom) */ -}}
- {{- if $adminNeedsEnv }}
- {{- $adminSecret := .Values.admin.existingSecret.name | default (printf "%s-secrets" .Chart.Name) }}
- - name: S3PROXY_ADMIN_USERNAME
+ {{- /* Dashboard credentials (when not pulled via the chart-secret envFrom) */ -}}
+ {{- if $dashboardNeedsEnv }}
+ {{- $dashboardSecret := .Values.dashboard.existingSecret.name | default (printf "%s-secrets" .Chart.Name) }}
+ - name: S3PROXY_DASHBOARD_USERNAME
valueFrom:
secretKeyRef:
- name: {{ $adminSecret }}
- key: {{ .Values.admin.existingSecret.usernameKey }}
- - name: S3PROXY_ADMIN_PASSWORD
+ name: {{ $dashboardSecret }}
+ key: {{ .Values.dashboard.existingSecret.usernameKey }}
+ - name: S3PROXY_DASHBOARD_PASSWORD
valueFrom:
secretKeyRef:
- name: {{ $adminSecret }}
- key: {{ .Values.admin.existingSecret.passwordKey }}
- - name: S3PROXY_ADMIN_SECRET
- valueFrom:
- secretKeyRef:
- name: {{ $adminSecret }}
- key: {{ .Values.admin.existingSecret.secretKey }}
+ name: {{ $dashboardSecret }}
+ key: {{ .Values.dashboard.existingSecret.passwordKey }}
{{- end }}
{{- /* Redis password from the bundled Redis secret */ -}}
{{- if $redisAuth }}
diff --git a/chart/templates/ingress.yaml b/chart/templates/s3proxy/ingress.yaml
similarity index 100%
rename from chart/templates/ingress.yaml
rename to chart/templates/s3proxy/ingress.yaml
diff --git a/chart/templates/pdb.yaml b/chart/templates/s3proxy/pdb.yaml
similarity index 100%
rename from chart/templates/pdb.yaml
rename to chart/templates/s3proxy/pdb.yaml
diff --git a/chart/templates/secret.yaml b/chart/templates/s3proxy/secret.yaml
similarity index 54%
rename from chart/templates/secret.yaml
rename to chart/templates/s3proxy/secret.yaml
index bf9f362..f48edea 100644
--- a/chart/templates/secret.yaml
+++ b/chart/templates/s3proxy/secret.yaml
@@ -1,9 +1,9 @@
{{- $createApp := not .Values.secrets.existingSecrets.enabled -}}
-{{- $createAdmin := and .Values.admin.enabled (not .Values.admin.existingSecret.name) -}}
-{{- if or $createApp $createAdmin }}
+{{- $createDashboard := and .Values.dashboard.enabled (not .Values.dashboard.existingSecret.name) -}}
+{{- if or $createApp $createDashboard }}
# Creating static secrets (provide via helm --set or secure values file, not hardcoded)
-# Secret keys created: S3PROXY_CREDENTIALS, and (when the admin dashboard is enabled)
-# S3PROXY_ADMIN_USERNAME / S3PROXY_ADMIN_PASSWORD / S3PROXY_ADMIN_SECRET
+# Secret keys created: S3PROXY_CREDENTIALS, and (when the dashboard is enabled)
+# S3PROXY_DASHBOARD_USERNAME / S3PROXY_DASHBOARD_PASSWORD
apiVersion: v1
kind: Secret
metadata:
@@ -19,9 +19,8 @@ stringData:
{{- end }}
S3PROXY_CREDENTIALS: {{ toJson $creds | quote }}
{{- end }}
- {{- if $createAdmin }}
- S3PROXY_ADMIN_USERNAME: {{ .Values.admin.username | quote }}
- S3PROXY_ADMIN_PASSWORD: {{ .Values.admin.password | quote }}
- S3PROXY_ADMIN_SECRET: {{ .Values.admin.secret | quote }}
+ {{- if $createDashboard }}
+ S3PROXY_DASHBOARD_USERNAME: {{ .Values.dashboard.username | quote }}
+ S3PROXY_DASHBOARD_PASSWORD: {{ .Values.dashboard.password | quote }}
{{- end }}
{{- end }}
diff --git a/chart/templates/service.yaml b/chart/templates/s3proxy/service.yaml
similarity index 100%
rename from chart/templates/service.yaml
rename to chart/templates/s3proxy/service.yaml
diff --git a/chart/values.yaml b/chart/values.yaml
index 5144e88..d4d85ef 100644
--- a/chart/values.yaml
+++ b/chart/values.yaml
@@ -77,33 +77,56 @@ secrets:
logLevel: "DEBUG"
-# Admin dashboard — served on the main service port at `admin.path`.
+# Dashboard. The proxy serves the dashboard API (JSON + SSE) and form auth under
+# `dashboard.path` when enabled. The UI itself is a Svelte static build served by
+# its own Deployment (`dashboard.frontend`); that pod's nginx reverse-proxies the
+# API + auth to the proxy, so the dashboard is single-origin behind one service.
# Credentials are stored in a Secret. Override username/password in production,
# or point existingSecret at your own Secret holding the credential keys below.
-admin:
+dashboard:
enabled: false
- path: "/admin"
+ path: "/dashboard"
username: "admin"
password: "admin"
- # Stable secret used to sign admin session cookies. Required when enabled.
- # Override in production; keep it stable so sessions survive pod restarts.
- secret: "change-me"
existingSecret:
name: ""
- usernameKey: "S3PROXY_ADMIN_USERNAME"
- passwordKey: "S3PROXY_ADMIN_PASSWORD"
- secretKey: "S3PROXY_ADMIN_SECRET"
+ usernameKey: "S3PROXY_DASHBOARD_USERNAME"
+ passwordKey: "S3PROXY_DASHBOARD_PASSWORD"
- # Optional dedicated Ingress for the dashboard. OFF by default — the admin UI
+ # Separate Deployment serving the Svelte dashboard (the static build from
+ # dashboard-frontend/), with an nginx that also reverse-proxies the API.
+ frontend:
+ enabled: true
+ replicaCount: 1
+ image:
+ repository: ghcr.io/serversidehannes/s3proxy-dashboard
+ tag: "latest"
+ pullPolicy: IfNotPresent
+ containerPort: 8080
+ service:
+ port: 80
+ resources:
+ requests:
+ cpu: "10m"
+ memory: "16Mi"
+ limits:
+ cpu: "100m"
+ memory: "64Mi"
+ nodeSelector: {}
+ affinity: {}
+ tolerations: []
+
+ # Optional dedicated Ingress for the dashboard. OFF by default — the dashboard
# should not be internet-facing unless you explicitly expose it (ideally behind
- # an internal ingress class, an IP allowlist, or VPN). Routes `admin.path` to the
- # proxy service. Set `className` to whatever ingress controller your cluster runs.
+ # an internal ingress class, an IP allowlist, or VPN). Routes `dashboard.path`
+ # to the dashboard Deployment. Set `className` to whatever ingress controller
+ # your cluster runs.
ingress:
enabled: false
className: ""
host: ""
annotations: {}
- tls: [] # e.g. [{ secretName: admin-tls, hosts: [admin.example.com] }]
+ tls: [] # e.g. [{ secretName: dashboard-tls, hosts: [dashboard.example.com] }]
resources:
requests:
diff --git a/dashboard-frontend/.dockerignore b/dashboard-frontend/.dockerignore
new file mode 100644
index 0000000..b99d829
--- /dev/null
+++ b/dashboard-frontend/.dockerignore
@@ -0,0 +1,7 @@
+node_modules
+build
+.svelte-kit
+.env
+.env.*
+.DS_Store
+README.md
diff --git a/dashboard-frontend/.gitignore b/dashboard-frontend/.gitignore
new file mode 100644
index 0000000..0ee87f3
--- /dev/null
+++ b/dashboard-frontend/.gitignore
@@ -0,0 +1,7 @@
+node_modules
+/build
+/.svelte-kit
+.env
+.env.*
+!.env.example
+.DS_Store
diff --git a/dashboard-frontend/Dockerfile b/dashboard-frontend/Dockerfile
new file mode 100644
index 0000000..59a095a
--- /dev/null
+++ b/dashboard-frontend/Dockerfile
@@ -0,0 +1,25 @@
+# Build the SvelteKit static dashboard, then serve it from nginx. The dashboard API
+# (JSON + SSE) and auth endpoints stay in the proxy process; the ingress routes
+# ${dashboard.path}/api and ${dashboard.path}/login|logout to the proxy and everything
+# else here, so the app uses same-origin relative URLs.
+
+FROM node:24-slim AS builder
+WORKDIR /app
+
+COPY package.json package-lock.json* ./
+RUN npm ci
+
+COPY . .
+# Base path must match the ingress mount (dashboard.path). Override at build time
+# if the chart is configured with a non-default dashboard.path.
+ARG DASHBOARD_BASE_PATH=/dashboard
+ENV DASHBOARD_BASE_PATH=${DASHBOARD_BASE_PATH}
+RUN npm run build
+
+
+# Unprivileged image: listens on 8080 and runs as a non-root user, so the pod
+# can set runAsNonRoot + readOnlyRootFilesystem.
+FROM nginxinc/nginx-unprivileged:1.27-alpine
+COPY --from=builder /app/build /usr/share/nginx/html
+COPY nginx.conf /etc/nginx/conf.d/default.conf
+EXPOSE 8080
diff --git a/dashboard-frontend/README.md b/dashboard-frontend/README.md
new file mode 100644
index 0000000..02b6511
--- /dev/null
+++ b/dashboard-frontend/README.md
@@ -0,0 +1,69 @@
+# S3 Encryption Proxy — Dashboard
+
+The admin dashboard, rewritten as a SvelteKit single-page app and deployed
+separately from the proxy data path (see issue #50). It consumes the proxy's
+existing JSON + SSE API (`/dashboard/api/*`) — the backend is the contract; this
+app does not reshape it.
+
+- **Framework**: SvelteKit + `adapter-static` (pure SPA, hash-based in-app
+ routing, no SSR).
+- **Charts**: [uPlot](https://github.com/leeoniya/uPlot) — small and fast for
+ the live time-series.
+- **Auth**: session cookie + Basic Auth, identical to the proxy's flow. The
+ login page posts to `/dashboard/api/login`.
+
+## Layout
+
+```
+src/
+ app.css design tokens + styles, ported 1:1 from the old UI
+ lib/
+ api.ts fetch wrappers (relative URLs, 401 -> login)
+ status.svelte.ts SSE feed + initial fetch
+ chart.ts uPlot wrapper matching the old chart look
+ route.ts hash-route parser (#, #logs, #metric=, #bucket=, ...)
+ format.ts number/time/byte formatting
+ components/ Header, Footer, Dashboard, MetricView, BucketView,
+ ObjectView, LogsView, MetricCard, Sparkline
+ routes/
+ +page.svelte the SPA shell + hash router
+ login/+page.svelte login page
+nginx.conf standalone serving config (chart overrides it)
+Dockerfile static build -> nginx
+```
+
+## Develop
+
+Point the dev server at a running proxy that has the dashboard enabled
+(`S3PROXY_DASHBOARD_UI=true`, a `S3PROXY_DASHBOARD_SECRET`, and credentials):
+
+```bash
+npm install
+PROXY_ORIGIN=http://localhost:4433 npm run dev
+```
+
+`vite.config.ts` proxies `/dashboard/api`, `/dashboard/login`, and
+`/dashboard/logout` to `PROXY_ORIGIN`, so the app uses the same relative URLs it
+uses in production.
+
+## Build
+
+```bash
+npm run build # -> build/ (static, base path baked in)
+npm run check # svelte-check
+```
+
+The base path defaults to `/dashboard` and must match `dashboard.path` in the
+Helm chart. Override at build time:
+
+```bash
+DASHBOARD_BASE_PATH=/ops/dash npm run build
+```
+
+## Deploy
+
+The Helm chart (`chart/`) builds this into the `s3proxy-dashboard` image and runs
+it as its own Deployment + Service. That pod's nginx serves the static build and
+reverse-proxies `dashboard.path/api` (JSON + SSE) and the auth endpoints to the
+proxy service — so the dashboard is single-origin behind one backend. Enable it
+with `--set dashboard.enabled=true` (and a stable `dashboard.secret`).
diff --git a/dashboard-frontend/nginx.conf b/dashboard-frontend/nginx.conf
new file mode 100644
index 0000000..631c813
--- /dev/null
+++ b/dashboard-frontend/nginx.conf
@@ -0,0 +1,31 @@
+# Baked default: serves the static dashboard under /dashboard with SPA fallback.
+# This is the fallback for running the image standalone. In the Helm chart this
+# file is replaced by a mounted ConfigMap that also reverse-proxies /dashboard/api
+# (JSON + SSE) and the auth endpoints to the proxy service, making the dashboard
+# single-origin. Standalone, point /dashboard/api at your proxy yourself (or use the
+# chart). dashboard.path is /dashboard here to match the build's baked-in base path.
+
+server {
+ listen 8080;
+ server_name _;
+
+ root /usr/share/nginx/html;
+
+ # Hashed, immutable build assets.
+ location /dashboard/_app/ {
+ alias /usr/share/nginx/html/_app/;
+ access_log off;
+ expires 1y;
+ add_header Cache-Control "public, immutable";
+ }
+
+ # Everything else under /dashboard falls back to the SPA shell so client-side
+ # hash routing (and the /dashboard/login page) works on hard refresh.
+ location /dashboard {
+ try_files $uri /index.html;
+ }
+
+ location = / {
+ return 302 /dashboard;
+ }
+}
diff --git a/dashboard-frontend/package-lock.json b/dashboard-frontend/package-lock.json
new file mode 100644
index 0000000..e9e25e1
--- /dev/null
+++ b/dashboard-frontend/package-lock.json
@@ -0,0 +1,1581 @@
+{
+ "name": "s3proxy-admin",
+ "version": "1.0.0",
+ "lockfileVersion": 3,
+ "requires": true,
+ "packages": {
+ "": {
+ "name": "s3proxy-admin",
+ "version": "1.0.0",
+ "dependencies": {
+ "uplot": "^1.6.31"
+ },
+ "devDependencies": {
+ "@sveltejs/adapter-static": "^3.0.6",
+ "@sveltejs/kit": "^2.8.0",
+ "@sveltejs/vite-plugin-svelte": "^4.0.0",
+ "@types/node": "^25.9.2",
+ "svelte": "^5.1.0",
+ "svelte-check": "^4.0.0",
+ "typescript": "^5.6.0",
+ "vite": "^5.4.0"
+ }
+ },
+ "node_modules/@esbuild/aix-ppc64": {
+ "version": "0.21.5",
+ "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.21.5.tgz",
+ "integrity": "sha512-1SDgH6ZSPTlggy1yI6+Dbkiz8xzpHJEVAlF/AM1tHPLsf5STom9rwtjE4hKAF20FfXXNTFqEYXyJNWh1GiZedQ==",
+ "cpu": [
+ "ppc64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "aix"
+ ],
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/@esbuild/android-arm": {
+ "version": "0.21.5",
+ "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.21.5.tgz",
+ "integrity": "sha512-vCPvzSjpPHEi1siZdlvAlsPxXl7WbOVUBBAowWug4rJHb68Ox8KualB+1ocNvT5fjv6wpkX6o/iEpbDrf68zcg==",
+ "cpu": [
+ "arm"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "android"
+ ],
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/@esbuild/android-arm64": {
+ "version": "0.21.5",
+ "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.21.5.tgz",
+ "integrity": "sha512-c0uX9VAUBQ7dTDCjq+wdyGLowMdtR/GoC2U5IYk/7D1H1JYC0qseD7+11iMP2mRLN9RcCMRcjC4YMclCzGwS/A==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "android"
+ ],
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/@esbuild/android-x64": {
+ "version": "0.21.5",
+ "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.21.5.tgz",
+ "integrity": "sha512-D7aPRUUNHRBwHxzxRvp856rjUHRFW1SdQATKXH2hqA0kAZb1hKmi02OpYRacl0TxIGz/ZmXWlbZgjwWYaCakTA==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "android"
+ ],
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/@esbuild/darwin-arm64": {
+ "version": "0.21.5",
+ "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.21.5.tgz",
+ "integrity": "sha512-DwqXqZyuk5AiWWf3UfLiRDJ5EDd49zg6O9wclZ7kUMv2WRFr4HKjXp/5t8JZ11QbQfUS6/cRCKGwYhtNAY88kQ==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "darwin"
+ ],
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/@esbuild/darwin-x64": {
+ "version": "0.21.5",
+ "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.21.5.tgz",
+ "integrity": "sha512-se/JjF8NlmKVG4kNIuyWMV/22ZaerB+qaSi5MdrXtd6R08kvs2qCN4C09miupktDitvh8jRFflwGFBQcxZRjbw==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "darwin"
+ ],
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/@esbuild/freebsd-arm64": {
+ "version": "0.21.5",
+ "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.21.5.tgz",
+ "integrity": "sha512-5JcRxxRDUJLX8JXp/wcBCy3pENnCgBR9bN6JsY4OmhfUtIHe3ZW0mawA7+RDAcMLrMIZaf03NlQiX9DGyB8h4g==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "freebsd"
+ ],
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/@esbuild/freebsd-x64": {
+ "version": "0.21.5",
+ "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.21.5.tgz",
+ "integrity": "sha512-J95kNBj1zkbMXtHVH29bBriQygMXqoVQOQYA+ISs0/2l3T9/kj42ow2mpqerRBxDJnmkUDCaQT/dfNXWX/ZZCQ==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "freebsd"
+ ],
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/@esbuild/linux-arm": {
+ "version": "0.21.5",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.21.5.tgz",
+ "integrity": "sha512-bPb5AHZtbeNGjCKVZ9UGqGwo8EUu4cLq68E95A53KlxAPRmUyYv2D6F0uUI65XisGOL1hBP5mTronbgo+0bFcA==",
+ "cpu": [
+ "arm"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/@esbuild/linux-arm64": {
+ "version": "0.21.5",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.21.5.tgz",
+ "integrity": "sha512-ibKvmyYzKsBeX8d8I7MH/TMfWDXBF3db4qM6sy+7re0YXya+K1cem3on9XgdT2EQGMu4hQyZhan7TeQ8XkGp4Q==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/@esbuild/linux-ia32": {
+ "version": "0.21.5",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.21.5.tgz",
+ "integrity": "sha512-YvjXDqLRqPDl2dvRODYmmhz4rPeVKYvppfGYKSNGdyZkA01046pLWyRKKI3ax8fbJoK5QbxblURkwK/MWY18Tg==",
+ "cpu": [
+ "ia32"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/@esbuild/linux-loong64": {
+ "version": "0.21.5",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.21.5.tgz",
+ "integrity": "sha512-uHf1BmMG8qEvzdrzAqg2SIG/02+4/DHB6a9Kbya0XDvwDEKCoC8ZRWI5JJvNdUjtciBGFQ5PuBlpEOXQj+JQSg==",
+ "cpu": [
+ "loong64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/@esbuild/linux-mips64el": {
+ "version": "0.21.5",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.21.5.tgz",
+ "integrity": "sha512-IajOmO+KJK23bj52dFSNCMsz1QP1DqM6cwLUv3W1QwyxkyIWecfafnI555fvSGqEKwjMXVLokcV5ygHW5b3Jbg==",
+ "cpu": [
+ "mips64el"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/@esbuild/linux-ppc64": {
+ "version": "0.21.5",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.21.5.tgz",
+ "integrity": "sha512-1hHV/Z4OEfMwpLO8rp7CvlhBDnjsC3CttJXIhBi+5Aj5r+MBvy4egg7wCbe//hSsT+RvDAG7s81tAvpL2XAE4w==",
+ "cpu": [
+ "ppc64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/@esbuild/linux-riscv64": {
+ "version": "0.21.5",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.21.5.tgz",
+ "integrity": "sha512-2HdXDMd9GMgTGrPWnJzP2ALSokE/0O5HhTUvWIbD3YdjME8JwvSCnNGBnTThKGEB91OZhzrJ4qIIxk/SBmyDDA==",
+ "cpu": [
+ "riscv64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/@esbuild/linux-s390x": {
+ "version": "0.21.5",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.21.5.tgz",
+ "integrity": "sha512-zus5sxzqBJD3eXxwvjN1yQkRepANgxE9lgOW2qLnmr8ikMTphkjgXu1HR01K4FJg8h1kEEDAqDcZQtbrRnB41A==",
+ "cpu": [
+ "s390x"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/@esbuild/linux-x64": {
+ "version": "0.21.5",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.21.5.tgz",
+ "integrity": "sha512-1rYdTpyv03iycF1+BhzrzQJCdOuAOtaqHTWJZCWvijKD2N5Xu0TtVC8/+1faWqcP9iBCWOmjmhoH94dH82BxPQ==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/@esbuild/netbsd-x64": {
+ "version": "0.21.5",
+ "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.21.5.tgz",
+ "integrity": "sha512-Woi2MXzXjMULccIwMnLciyZH4nCIMpWQAs049KEeMvOcNADVxo0UBIQPfSmxB3CWKedngg7sWZdLvLczpe0tLg==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "netbsd"
+ ],
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/@esbuild/openbsd-x64": {
+ "version": "0.21.5",
+ "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.21.5.tgz",
+ "integrity": "sha512-HLNNw99xsvx12lFBUwoT8EVCsSvRNDVxNpjZ7bPn947b8gJPzeHWyNVhFsaerc0n3TsbOINvRP2byTZ5LKezow==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "openbsd"
+ ],
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/@esbuild/sunos-x64": {
+ "version": "0.21.5",
+ "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.21.5.tgz",
+ "integrity": "sha512-6+gjmFpfy0BHU5Tpptkuh8+uw3mnrvgs+dSPQXQOv3ekbordwnzTVEb4qnIvQcYXq6gzkyTnoZ9dZG+D4garKg==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "sunos"
+ ],
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/@esbuild/win32-arm64": {
+ "version": "0.21.5",
+ "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.21.5.tgz",
+ "integrity": "sha512-Z0gOTd75VvXqyq7nsl93zwahcTROgqvuAcYDUr+vOv8uHhNSKROyU961kgtCD1e95IqPKSQKH7tBTslnS3tA8A==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "win32"
+ ],
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/@esbuild/win32-ia32": {
+ "version": "0.21.5",
+ "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.21.5.tgz",
+ "integrity": "sha512-SWXFF1CL2RVNMaVs+BBClwtfZSvDgtL//G/smwAc5oVK/UPu2Gu9tIaRgFmYFFKrmg3SyAjSrElf0TiJ1v8fYA==",
+ "cpu": [
+ "ia32"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "win32"
+ ],
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/@esbuild/win32-x64": {
+ "version": "0.21.5",
+ "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.21.5.tgz",
+ "integrity": "sha512-tQd/1efJuzPC6rCFwEvLtci/xNFcTZknmXs98FYDfGE4wP9ClFV98nyKrzJKVPMhdDnjzLhdUyMX4PsQAPjwIw==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "win32"
+ ],
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/@jridgewell/gen-mapping": {
+ "version": "0.3.13",
+ "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.13.tgz",
+ "integrity": "sha512-2kkt/7niJ6MgEPxF0bYdQ6etZaA+fQvDcLKckhy1yIQOzaoKjBBjSj63/aLVjYE3qhRt5dvM+uUyfCg6UKCBbA==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@jridgewell/sourcemap-codec": "^1.5.0",
+ "@jridgewell/trace-mapping": "^0.3.24"
+ }
+ },
+ "node_modules/@jridgewell/remapping": {
+ "version": "2.3.5",
+ "resolved": "https://registry.npmjs.org/@jridgewell/remapping/-/remapping-2.3.5.tgz",
+ "integrity": "sha512-LI9u/+laYG4Ds1TDKSJW2YPrIlcVYOwi2fUC6xB43lueCjgxV4lffOCZCtYFiH6TNOX+tQKXx97T4IKHbhyHEQ==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@jridgewell/gen-mapping": "^0.3.5",
+ "@jridgewell/trace-mapping": "^0.3.24"
+ }
+ },
+ "node_modules/@jridgewell/resolve-uri": {
+ "version": "3.1.2",
+ "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz",
+ "integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=6.0.0"
+ }
+ },
+ "node_modules/@jridgewell/sourcemap-codec": {
+ "version": "1.5.5",
+ "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.5.tgz",
+ "integrity": "sha512-cYQ9310grqxueWbl+WuIUIaiUaDcj7WOq5fVhEljNVgRfOUhY9fy2zTvfoqWsnebh8Sl70VScFbICvJnLKB0Og==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/@jridgewell/trace-mapping": {
+ "version": "0.3.31",
+ "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.31.tgz",
+ "integrity": "sha512-zzNR+SdQSDJzc8joaeP8QQoCQr8NuYx2dIIytl1QeBEZHJ9uW6hebsrYgbz8hJwUQao3TWCMtmfV8Nu1twOLAw==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@jridgewell/resolve-uri": "^3.1.0",
+ "@jridgewell/sourcemap-codec": "^1.4.14"
+ }
+ },
+ "node_modules/@polka/url": {
+ "version": "1.0.0-next.29",
+ "resolved": "https://registry.npmjs.org/@polka/url/-/url-1.0.0-next.29.tgz",
+ "integrity": "sha512-wwQAWhWSuHaag8c4q/KN/vCoeOJYshAIvMQwD4GpSb3OiZklFfvAgmj0VCBBImRpuF/aFgIRzllXlVX93Jevww==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/@rollup/rollup-android-arm-eabi": {
+ "version": "4.61.1",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.61.1.tgz",
+ "integrity": "sha512-JnBB8MdXj45cajvTuO5FmPlvFVJRQgvrz1uSEl3NwqFnReAPGwb8EanbGi4z2nRaqLzjJSv5/JmycoTKlRZxHA==",
+ "cpu": [
+ "arm"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "android"
+ ]
+ },
+ "node_modules/@rollup/rollup-android-arm64": {
+ "version": "4.61.1",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.61.1.tgz",
+ "integrity": "sha512-Jx2g7iSjw4AOT0HDPHM9RV3GNjRXwybWtSFZiZAYUTjUwjVrYIwq3kBf+LnhqJlzXFAqTAh2F7IGI+O568exPw==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "android"
+ ]
+ },
+ "node_modules/@rollup/rollup-darwin-arm64": {
+ "version": "4.61.1",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.61.1.tgz",
+ "integrity": "sha512-0F1L/Z3Eqv8mT2n3dCpeO8GcTvHvVqkP5/t6DMsn0KzhYVcg+s7Ncl5DS8qjKYEeio6Az0Gt6nyBORay5qIlCA==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "darwin"
+ ]
+ },
+ "node_modules/@rollup/rollup-darwin-x64": {
+ "version": "4.61.1",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.61.1.tgz",
+ "integrity": "sha512-qLttcH871ujY4YcVfUSShhOw+CsoTatYz8gRbHO7Bb92QH059/P0y5do1KMs41fY0BpD2x4AJH/gID0zFiqVKQ==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "darwin"
+ ]
+ },
+ "node_modules/@rollup/rollup-freebsd-arm64": {
+ "version": "4.61.1",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-arm64/-/rollup-freebsd-arm64-4.61.1.tgz",
+ "integrity": "sha512-fUI4RapGE0Oh3mb8mgfvC1O2nU1RpDZUKnDQm3xB1Ipg7C2wTs5Kstz7G2uWK99a8S2yTMq8/P4uycwNa0nJyw==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "freebsd"
+ ]
+ },
+ "node_modules/@rollup/rollup-freebsd-x64": {
+ "version": "4.61.1",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-x64/-/rollup-freebsd-x64-4.61.1.tgz",
+ "integrity": "sha512-H5YrdvJaDtI/U9/emrD4b++xkvp3y/JvOe4rizHbxvkyMfRS/CiRYdji+Pl8D0brEaNFWUh1drQxgAGIl6Xudw==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "freebsd"
+ ]
+ },
+ "node_modules/@rollup/rollup-linux-arm-gnueabihf": {
+ "version": "4.61.1",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.61.1.tgz",
+ "integrity": "sha512-Q8CBCCQtDFrYtXoeUXSrnFXKOnyUhx6bz+SkL6A0E7V8kAiCJ5pamq1WtbfpVGhR5TSpXY6ak3avmDc5fHTyJA==",
+ "cpu": [
+ "arm"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ]
+ },
+ "node_modules/@rollup/rollup-linux-arm-musleabihf": {
+ "version": "4.61.1",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.61.1.tgz",
+ "integrity": "sha512-nwnhk1581l0FBVellGcVCAT0Oi06onEA3WB53sf01VO3I0UPBkMH9sXONYME2K0ovXcNayJfNtHfm6mpJElatQ==",
+ "cpu": [
+ "arm"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ]
+ },
+ "node_modules/@rollup/rollup-linux-arm64-gnu": {
+ "version": "4.61.1",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.61.1.tgz",
+ "integrity": "sha512-x5Xr49hwt3hdW75UOZm3395YwwzPyauktslv29KpWL/T+vVAzoT3azLcTWv0eMciBNrx+DYjH4paehHoLpPvpg==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ]
+ },
+ "node_modules/@rollup/rollup-linux-arm64-musl": {
+ "version": "4.61.1",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.61.1.tgz",
+ "integrity": "sha512-unMS3H73DpaoPyyEVPjGKleM/s0mkmsauTENpw4INQY8y4+IuLNjkueQ5QCtC0D3N38Y38yhAU8OoZ20S2Tm6w==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ]
+ },
+ "node_modules/@rollup/rollup-linux-loong64-gnu": {
+ "version": "4.61.1",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loong64-gnu/-/rollup-linux-loong64-gnu-4.61.1.tgz",
+ "integrity": "sha512-zNZzGRnAhwjFEYmvphJRV5XaQGjs62cCmeYYHUT//NbvEnHauw+I85nGG+SiVg5ld4GX8D1IbKIX+ozITQnhMQ==",
+ "cpu": [
+ "loong64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ]
+ },
+ "node_modules/@rollup/rollup-linux-loong64-musl": {
+ "version": "4.61.1",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loong64-musl/-/rollup-linux-loong64-musl-4.61.1.tgz",
+ "integrity": "sha512-LdpWGL8X209B2SIvWjqlc8VZgM6PKfontSerGepuldQmHYrAOtnMCXeJkxXGbC+PPZVOuu5czJo7fNV6aeW8rQ==",
+ "cpu": [
+ "loong64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ]
+ },
+ "node_modules/@rollup/rollup-linux-ppc64-gnu": {
+ "version": "4.61.1",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-ppc64-gnu/-/rollup-linux-ppc64-gnu-4.61.1.tgz",
+ "integrity": "sha512-EC5kTtNaNGOmbMGqar8dvJy6y/hg99GAwjfBz++pxZhQATXGcRjd6c5en5wcbru0vkRmiMGsQKdMJOOf6sza4g==",
+ "cpu": [
+ "ppc64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ]
+ },
+ "node_modules/@rollup/rollup-linux-ppc64-musl": {
+ "version": "4.61.1",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-ppc64-musl/-/rollup-linux-ppc64-musl-4.61.1.tgz",
+ "integrity": "sha512-8hiwp6D4acEcNK78I4rP0/XtS1sknWIAMJBPdR4l6zUtyTm5KiTDr5bXmWt4foY7nAN7AThDHgkLIEZOWKbzWw==",
+ "cpu": [
+ "ppc64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ]
+ },
+ "node_modules/@rollup/rollup-linux-riscv64-gnu": {
+ "version": "4.61.1",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.61.1.tgz",
+ "integrity": "sha512-10dh/h/BqA7DuMPWSxkR8uks18FRwnwOEqr5zOTEl+NOwP/OMzKX8OFR/Of9xxDA7D5qef1Nzar5WDD2kCCr1g==",
+ "cpu": [
+ "riscv64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ]
+ },
+ "node_modules/@rollup/rollup-linux-riscv64-musl": {
+ "version": "4.61.1",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-musl/-/rollup-linux-riscv64-musl-4.61.1.tgz",
+ "integrity": "sha512-YKJ5lg35DP17gcAOggnihe+APw9HLyj1Xn7gsmGumBJAUDa6NGXNixJzmkWLhcK9TOuuyQjdamzvJefkO7qHZQ==",
+ "cpu": [
+ "riscv64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ]
+ },
+ "node_modules/@rollup/rollup-linux-s390x-gnu": {
+ "version": "4.61.1",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.61.1.tgz",
+ "integrity": "sha512-Mlil5G2Jj6a7B3LWGctg+XPL9vdXYuzCtNXfxOQ0nPjc2m6ueUktocPGH9bnAM0bNRKb/bAWTujUU7IJQdQA+g==",
+ "cpu": [
+ "s390x"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ]
+ },
+ "node_modules/@rollup/rollup-linux-x64-gnu": {
+ "version": "4.61.1",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.61.1.tgz",
+ "integrity": "sha512-bVWIOIk6pV01p4CdUbPP7CJ/434z+OooYjDuFcR+44N35YvKUC66G8MGnvcWx5mWKW3g61J+t74l3Kj15Kwn2Q==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ]
+ },
+ "node_modules/@rollup/rollup-linux-x64-musl": {
+ "version": "4.61.1",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.61.1.tgz",
+ "integrity": "sha512-qy5pBvZbqNFheBz61R1rzsezjm0J7O2oNGoWtGoY89SZYLUfxAJTBAqDChqAIdB4rCiIbi9nF7yZ83GnNiLwSw==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ]
+ },
+ "node_modules/@rollup/rollup-openbsd-x64": {
+ "version": "4.61.1",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-openbsd-x64/-/rollup-openbsd-x64-4.61.1.tgz",
+ "integrity": "sha512-E83TXjI4zm0+5f2qO+UOudaCYIhYwpJ5jq6YCZNIZ+6CbfhKrkAGezeiASBL9ElxAxFsRS9ZhESv8mfnj6TKeg==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "openbsd"
+ ]
+ },
+ "node_modules/@rollup/rollup-openharmony-arm64": {
+ "version": "4.61.1",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-openharmony-arm64/-/rollup-openharmony-arm64-4.61.1.tgz",
+ "integrity": "sha512-fbWnKqVkjrJN38vNe3ahkbk6iejS/3b0Nt7EEtPpE6RBacZcGXNKbzfHN3GUUlXOPghUg0j6XUGrtjX9z1sIvA==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "openharmony"
+ ]
+ },
+ "node_modules/@rollup/rollup-win32-arm64-msvc": {
+ "version": "4.61.1",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.61.1.tgz",
+ "integrity": "sha512-ArMl38iVAbk0New1ogihQNY6iphLi4ZaRsa037gUzv5yeKPY8TD3Dmy4x2RNC1VztU/uqm+G+/RwFrSka3Oy2g==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "win32"
+ ]
+ },
+ "node_modules/@rollup/rollup-win32-ia32-msvc": {
+ "version": "4.61.1",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.61.1.tgz",
+ "integrity": "sha512-0mYtjHS9ucAbcATycCNK9IGBk/cCe/ma7EmSLGZdsxnOA8cjRIyU04wDpVAD9NiOfLUR9KTxdiO53uOkherqjQ==",
+ "cpu": [
+ "ia32"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "win32"
+ ]
+ },
+ "node_modules/@rollup/rollup-win32-x64-gnu": {
+ "version": "4.61.1",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-gnu/-/rollup-win32-x64-gnu-4.61.1.tgz",
+ "integrity": "sha512-gK1iCEPfpoSG9wfBihXxvBMi8ZfcWffYkEsC/Eih+iFENTaewvNcrEQ69lIOWYO5pePHKLHHO7nq5AILGO/HQQ==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "win32"
+ ]
+ },
+ "node_modules/@rollup/rollup-win32-x64-msvc": {
+ "version": "4.61.1",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.61.1.tgz",
+ "integrity": "sha512-X+zaP2x+j4RXGfbp/seSoRHWnPxzApilDszisZxbYH5C/jTxFhCtDNdPGZb9lJyYPs24wGxruPF7Y+sIXt9Gzw==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "win32"
+ ]
+ },
+ "node_modules/@standard-schema/spec": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/@standard-schema/spec/-/spec-1.1.0.tgz",
+ "integrity": "sha512-l2aFy5jALhniG5HgqrD6jXLi/rUWrKvqN/qJx6yoJsgKhblVd+iqqU4RCXavm/jPityDo5TCvKMnpjKnOriy0w==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/@sveltejs/acorn-typescript": {
+ "version": "1.0.10",
+ "resolved": "https://registry.npmjs.org/@sveltejs/acorn-typescript/-/acorn-typescript-1.0.10.tgz",
+ "integrity": "sha512-4WfKk68eTih+MiJD4fSbxN7E8kVBmTMPWHUPYjvl2N0rMs53YLTT8/YjKU5Dtnz5LqDjl7LEw4U7lXR2W3J5WA==",
+ "dev": true,
+ "license": "MIT",
+ "peerDependencies": {
+ "acorn": "^8.9.0"
+ }
+ },
+ "node_modules/@sveltejs/adapter-static": {
+ "version": "3.0.10",
+ "resolved": "https://registry.npmjs.org/@sveltejs/adapter-static/-/adapter-static-3.0.10.tgz",
+ "integrity": "sha512-7D9lYFWJmB7zxZyTE/qxjksvMqzMuYrrsyh1f4AlZqeZeACPRySjbC3aFiY55wb1tWUaKOQG9PVbm74JcN2Iew==",
+ "dev": true,
+ "license": "MIT",
+ "peerDependencies": {
+ "@sveltejs/kit": "^2.0.0"
+ }
+ },
+ "node_modules/@sveltejs/kit": {
+ "version": "2.64.0",
+ "resolved": "https://registry.npmjs.org/@sveltejs/kit/-/kit-2.64.0.tgz",
+ "integrity": "sha512-24MXA/xyugUqJd09DD4v4bLd4k7FaYhdBck/pTXiu3XFtDBcwXYpJc1SO1+lqdjkNBUo1r4eek5FS7cfzBQUmA==",
+ "dev": true,
+ "license": "MIT",
+ "peer": true,
+ "dependencies": {
+ "@standard-schema/spec": "^1.0.0",
+ "@sveltejs/acorn-typescript": "^1.0.9",
+ "@types/cookie": "^0.6.0",
+ "acorn": "^8.16.0",
+ "cookie": "^0.6.0",
+ "devalue": "^5.8.1",
+ "esm-env": "^1.2.2",
+ "kleur": "^4.1.5",
+ "magic-string": "^0.30.5",
+ "mrmime": "^2.0.0",
+ "set-cookie-parser": "^3.0.0",
+ "sirv": "^3.0.0"
+ },
+ "bin": {
+ "svelte-kit": "svelte-kit.js"
+ },
+ "engines": {
+ "node": ">=18.13"
+ },
+ "peerDependencies": {
+ "@opentelemetry/api": "^1.0.0",
+ "@sveltejs/vite-plugin-svelte": "^3.0.0 || ^4.0.0-next.1 || ^5.0.0 || ^6.0.0-next.0 || ^7.0.0",
+ "svelte": "^4.0.0 || ^5.0.0-next.0",
+ "typescript": "^5.3.3 || ^6.0.0",
+ "vite": "^5.0.3 || ^6.0.0 || ^7.0.0-beta.0 || ^8.0.0"
+ },
+ "peerDependenciesMeta": {
+ "@opentelemetry/api": {
+ "optional": true
+ },
+ "typescript": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/@sveltejs/load-config": {
+ "version": "0.1.1",
+ "resolved": "https://registry.npmjs.org/@sveltejs/load-config/-/load-config-0.1.1.tgz",
+ "integrity": "sha512-BXXm+VOH/9X4N7Dd1iZ2MqA1h7M+9i2noI8QYuLDY8QcN2WHYn7D/VK/+IJNfcAmRw7ACNJ538UT9GXIhnBTiA==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">= 18.0.0"
+ }
+ },
+ "node_modules/@sveltejs/vite-plugin-svelte": {
+ "version": "4.0.4",
+ "resolved": "https://registry.npmjs.org/@sveltejs/vite-plugin-svelte/-/vite-plugin-svelte-4.0.4.tgz",
+ "integrity": "sha512-0ba1RQ/PHen5FGpdSrW7Y3fAMQjrXantECALeOiOdBdzR5+5vPP6HVZRLmZaQL+W8m++o+haIAKq5qT+MiZ7VA==",
+ "dev": true,
+ "license": "MIT",
+ "peer": true,
+ "dependencies": {
+ "@sveltejs/vite-plugin-svelte-inspector": "^3.0.0-next.0||^3.0.0",
+ "debug": "^4.3.7",
+ "deepmerge": "^4.3.1",
+ "kleur": "^4.1.5",
+ "magic-string": "^0.30.12",
+ "vitefu": "^1.0.3"
+ },
+ "engines": {
+ "node": "^18.0.0 || ^20.0.0 || >=22"
+ },
+ "peerDependencies": {
+ "svelte": "^5.0.0-next.96 || ^5.0.0",
+ "vite": "^5.0.0"
+ }
+ },
+ "node_modules/@sveltejs/vite-plugin-svelte-inspector": {
+ "version": "3.0.1",
+ "resolved": "https://registry.npmjs.org/@sveltejs/vite-plugin-svelte-inspector/-/vite-plugin-svelte-inspector-3.0.1.tgz",
+ "integrity": "sha512-2CKypmj1sM4GE7HjllT7UKmo4Q6L5xFRd7VMGEWhYnZ+wc6AUVU01IBd7yUi6WnFndEwWoMNOd6e8UjoN0nbvQ==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "debug": "^4.3.7"
+ },
+ "engines": {
+ "node": "^18.0.0 || ^20.0.0 || >=22"
+ },
+ "peerDependencies": {
+ "@sveltejs/vite-plugin-svelte": "^4.0.0-next.0||^4.0.0",
+ "svelte": "^5.0.0-next.96 || ^5.0.0",
+ "vite": "^5.0.0"
+ }
+ },
+ "node_modules/@types/cookie": {
+ "version": "0.6.0",
+ "resolved": "https://registry.npmjs.org/@types/cookie/-/cookie-0.6.0.tgz",
+ "integrity": "sha512-4Kh9a6B2bQciAhf7FSuMRRkUWecJgJu9nPnx3yzpsfXX/c50REIqpHY4C82bXP90qrLtXtkDxTZosYO3UpOwlA==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/@types/estree": {
+ "version": "1.0.9",
+ "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.9.tgz",
+ "integrity": "sha512-GhdPgy1el4/ImP05X05Uw4cw2/M93BCUmnEvWZNStlCzEKME4Fkk+YpoA5OiHNQmoS7Cafb8Xa3Pya8m1Qrzeg==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/@types/node": {
+ "version": "25.9.2",
+ "resolved": "https://registry.npmjs.org/@types/node/-/node-25.9.2.tgz",
+ "integrity": "sha512-G05zqtJhcDLb8uslf5EjCxXg9G1KQxiV8OS0R26IC//Eoyitzqe8z37I7cqvnZlrlSfgocQRfSn/AHBZJJFyGw==",
+ "dev": true,
+ "license": "MIT",
+ "peer": true,
+ "dependencies": {
+ "undici-types": ">=7.24.0 <7.24.7"
+ }
+ },
+ "node_modules/@types/trusted-types": {
+ "version": "2.0.7",
+ "resolved": "https://registry.npmjs.org/@types/trusted-types/-/trusted-types-2.0.7.tgz",
+ "integrity": "sha512-ScaPdn1dQczgbl0QFTeTOmVHFULt394XJgOQNoyVhZ6r2vLnMLJfBPd53SB52T/3G36VI1/g2MZaX0cwDuXsfw==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/acorn": {
+ "version": "8.16.0",
+ "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.16.0.tgz",
+ "integrity": "sha512-UVJyE9MttOsBQIDKw1skb9nAwQuR5wuGD3+82K6JgJlm/Y+KI92oNsMNGZCYdDsVtRHSak0pcV5Dno5+4jh9sw==",
+ "dev": true,
+ "license": "MIT",
+ "peer": true,
+ "bin": {
+ "acorn": "bin/acorn"
+ },
+ "engines": {
+ "node": ">=0.4.0"
+ }
+ },
+ "node_modules/aria-query": {
+ "version": "5.3.1",
+ "resolved": "https://registry.npmjs.org/aria-query/-/aria-query-5.3.1.tgz",
+ "integrity": "sha512-Z/ZeOgVl7bcSYZ/u/rh0fOpvEpq//LZmdbkXyc7syVzjPAhfOa9ebsdTSjEBDU4vs5nC98Kfduj1uFo0qyET3g==",
+ "dev": true,
+ "license": "Apache-2.0",
+ "engines": {
+ "node": ">= 0.4"
+ }
+ },
+ "node_modules/axobject-query": {
+ "version": "4.1.0",
+ "resolved": "https://registry.npmjs.org/axobject-query/-/axobject-query-4.1.0.tgz",
+ "integrity": "sha512-qIj0G9wZbMGNLjLmg1PT6v2mE9AH2zlnADJD/2tC6E00hgmhUOfEB6greHPAfLRSufHqROIUTkw6E+M3lH0PTQ==",
+ "dev": true,
+ "license": "Apache-2.0",
+ "engines": {
+ "node": ">= 0.4"
+ }
+ },
+ "node_modules/chokidar": {
+ "version": "4.0.3",
+ "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-4.0.3.tgz",
+ "integrity": "sha512-Qgzu8kfBvo+cA4962jnP1KkS6Dop5NS6g7R5LFYJr4b8Ub94PPQXUksCw9PvXoeXPRRddRNC5C1JQUR2SMGtnA==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "readdirp": "^4.0.1"
+ },
+ "engines": {
+ "node": ">= 14.16.0"
+ },
+ "funding": {
+ "url": "https://paulmillr.com/funding/"
+ }
+ },
+ "node_modules/clsx": {
+ "version": "2.1.1",
+ "resolved": "https://registry.npmjs.org/clsx/-/clsx-2.1.1.tgz",
+ "integrity": "sha512-eYm0QWBtUrBWZWG0d386OGAw16Z995PiOVo2B7bjWSbHedGl5e0ZWaq65kOGgUSNesEIDkB9ISbTg/JK9dhCZA==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=6"
+ }
+ },
+ "node_modules/cookie": {
+ "version": "0.6.0",
+ "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.6.0.tgz",
+ "integrity": "sha512-U71cyTamuh1CRNCfpGY6to28lxvNwPG4Guz/EVjgf3Jmzv0vlDp1atT9eS5dDjMYHucpHbWns6Lwf3BKz6svdw==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">= 0.6"
+ }
+ },
+ "node_modules/debug": {
+ "version": "4.4.3",
+ "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz",
+ "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "ms": "^2.1.3"
+ },
+ "engines": {
+ "node": ">=6.0"
+ },
+ "peerDependenciesMeta": {
+ "supports-color": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/deepmerge": {
+ "version": "4.3.1",
+ "resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-4.3.1.tgz",
+ "integrity": "sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/devalue": {
+ "version": "5.8.1",
+ "resolved": "https://registry.npmjs.org/devalue/-/devalue-5.8.1.tgz",
+ "integrity": "sha512-4CXDYRBGqN+57wVJkuXBYmpAVUSg3L6JAQa/DFqm238G73E1wuyc/JhGQJzN7vUf/CMphYau2zXbfWzDR5aTEw==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/esbuild": {
+ "version": "0.21.5",
+ "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.21.5.tgz",
+ "integrity": "sha512-mg3OPMV4hXywwpoDxu3Qda5xCKQi+vCTZq8S9J/EpkhB2HzKXq4SNFZE3+NK93JYxc8VMSep+lOUSC/RVKaBqw==",
+ "dev": true,
+ "hasInstallScript": true,
+ "license": "MIT",
+ "bin": {
+ "esbuild": "bin/esbuild"
+ },
+ "engines": {
+ "node": ">=12"
+ },
+ "optionalDependencies": {
+ "@esbuild/aix-ppc64": "0.21.5",
+ "@esbuild/android-arm": "0.21.5",
+ "@esbuild/android-arm64": "0.21.5",
+ "@esbuild/android-x64": "0.21.5",
+ "@esbuild/darwin-arm64": "0.21.5",
+ "@esbuild/darwin-x64": "0.21.5",
+ "@esbuild/freebsd-arm64": "0.21.5",
+ "@esbuild/freebsd-x64": "0.21.5",
+ "@esbuild/linux-arm": "0.21.5",
+ "@esbuild/linux-arm64": "0.21.5",
+ "@esbuild/linux-ia32": "0.21.5",
+ "@esbuild/linux-loong64": "0.21.5",
+ "@esbuild/linux-mips64el": "0.21.5",
+ "@esbuild/linux-ppc64": "0.21.5",
+ "@esbuild/linux-riscv64": "0.21.5",
+ "@esbuild/linux-s390x": "0.21.5",
+ "@esbuild/linux-x64": "0.21.5",
+ "@esbuild/netbsd-x64": "0.21.5",
+ "@esbuild/openbsd-x64": "0.21.5",
+ "@esbuild/sunos-x64": "0.21.5",
+ "@esbuild/win32-arm64": "0.21.5",
+ "@esbuild/win32-ia32": "0.21.5",
+ "@esbuild/win32-x64": "0.21.5"
+ }
+ },
+ "node_modules/esm-env": {
+ "version": "1.2.2",
+ "resolved": "https://registry.npmjs.org/esm-env/-/esm-env-1.2.2.tgz",
+ "integrity": "sha512-Epxrv+Nr/CaL4ZcFGPJIYLWFom+YeV1DqMLHJoEd9SYRxNbaFruBwfEX/kkHUJf55j2+TUbmDcmuilbP1TmXHA==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/esrap": {
+ "version": "2.2.11",
+ "resolved": "https://registry.npmjs.org/esrap/-/esrap-2.2.11.tgz",
+ "integrity": "sha512-gPdx+I+BjYEinNMQaBXFjbaJVyoPMU4ZODg5mE+M4DqVG9VusAVHHjcBX+zqyITlI0DIARwDMMzZwAWj36dRoQ==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@jridgewell/sourcemap-codec": "^1.4.15"
+ },
+ "peerDependencies": {
+ "@typescript-eslint/types": "^8.2.0"
+ },
+ "peerDependenciesMeta": {
+ "@typescript-eslint/types": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/fdir": {
+ "version": "6.5.0",
+ "resolved": "https://registry.npmjs.org/fdir/-/fdir-6.5.0.tgz",
+ "integrity": "sha512-tIbYtZbucOs0BRGqPJkshJUYdL+SDH7dVM8gjy+ERp3WAUjLEFJE+02kanyHtwjWOnwrKYBiwAmM0p4kLJAnXg==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=12.0.0"
+ },
+ "peerDependencies": {
+ "picomatch": "^3 || ^4"
+ },
+ "peerDependenciesMeta": {
+ "picomatch": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/fsevents": {
+ "version": "2.3.3",
+ "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz",
+ "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==",
+ "dev": true,
+ "hasInstallScript": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "darwin"
+ ],
+ "engines": {
+ "node": "^8.16.0 || ^10.6.0 || >=11.0.0"
+ }
+ },
+ "node_modules/is-reference": {
+ "version": "3.0.3",
+ "resolved": "https://registry.npmjs.org/is-reference/-/is-reference-3.0.3.tgz",
+ "integrity": "sha512-ixkJoqQvAP88E6wLydLGGqCJsrFUnqoH6HnaczB8XmDH1oaWU+xxdptvikTgaEhtZ53Ky6YXiBuUI2WXLMCwjw==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@types/estree": "^1.0.6"
+ }
+ },
+ "node_modules/kleur": {
+ "version": "4.1.5",
+ "resolved": "https://registry.npmjs.org/kleur/-/kleur-4.1.5.tgz",
+ "integrity": "sha512-o+NO+8WrRiQEE4/7nwRJhN1HWpVmJm511pBHUxPLtp0BUISzlBplORYSmTclCnJvQq2tKu/sgl3xVpkc7ZWuQQ==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=6"
+ }
+ },
+ "node_modules/locate-character": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/locate-character/-/locate-character-3.0.0.tgz",
+ "integrity": "sha512-SW13ws7BjaeJ6p7Q6CO2nchbYEc3X3J6WrmTTDto7yMPqVSZTUyY5Tjbid+Ab8gLnATtygYtiDIJGQRRn2ZOiA==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/magic-string": {
+ "version": "0.30.21",
+ "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.21.tgz",
+ "integrity": "sha512-vd2F4YUyEXKGcLHoq+TEyCjxueSeHnFxyyjNp80yg0XV4vUhnDer/lvvlqM/arB5bXQN5K2/3oinyCRyx8T2CQ==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@jridgewell/sourcemap-codec": "^1.5.5"
+ }
+ },
+ "node_modules/mri": {
+ "version": "1.2.0",
+ "resolved": "https://registry.npmjs.org/mri/-/mri-1.2.0.tgz",
+ "integrity": "sha512-tzzskb3bG8LvYGFF/mDTpq3jpI6Q9wc3LEmBaghu+DdCssd1FakN7Bc0hVNmEyGq1bq3RgfkCb3cmQLpNPOroA==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=4"
+ }
+ },
+ "node_modules/mrmime": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/mrmime/-/mrmime-2.0.1.tgz",
+ "integrity": "sha512-Y3wQdFg2Va6etvQ5I82yUhGdsKrcYox6p7FfL1LbK2J4V01F9TGlepTIhnK24t7koZibmg82KGglhA1XK5IsLQ==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=10"
+ }
+ },
+ "node_modules/ms": {
+ "version": "2.1.3",
+ "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz",
+ "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/nanoid": {
+ "version": "3.3.12",
+ "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.12.tgz",
+ "integrity": "sha512-ZB9RH/39qpq5Vu6Y+NmUaFhQR6pp+M2Xt76XBnEwDaGcVAqhlvxrl3B2bKS5D3NH3QR76v3aSrKaF/Kiy7lEtQ==",
+ "dev": true,
+ "funding": [
+ {
+ "type": "github",
+ "url": "https://github.com/sponsors/ai"
+ }
+ ],
+ "license": "MIT",
+ "bin": {
+ "nanoid": "bin/nanoid.cjs"
+ },
+ "engines": {
+ "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1"
+ }
+ },
+ "node_modules/picocolors": {
+ "version": "1.1.1",
+ "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz",
+ "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==",
+ "dev": true,
+ "license": "ISC"
+ },
+ "node_modules/postcss": {
+ "version": "8.5.15",
+ "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.15.tgz",
+ "integrity": "sha512-FfR8sjd4em2T6fb3I2MwAJU7HWVMr9zba+enmQeeWFfCbm+UOC/0X4DS8XtpUTMwWMGbjKYP7xjfNekzyGmB3A==",
+ "dev": true,
+ "funding": [
+ {
+ "type": "opencollective",
+ "url": "https://opencollective.com/postcss/"
+ },
+ {
+ "type": "tidelift",
+ "url": "https://tidelift.com/funding/github/npm/postcss"
+ },
+ {
+ "type": "github",
+ "url": "https://github.com/sponsors/ai"
+ }
+ ],
+ "license": "MIT",
+ "dependencies": {
+ "nanoid": "^3.3.12",
+ "picocolors": "^1.1.1",
+ "source-map-js": "^1.2.1"
+ },
+ "engines": {
+ "node": "^10 || ^12 || >=14"
+ }
+ },
+ "node_modules/readdirp": {
+ "version": "4.1.2",
+ "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-4.1.2.tgz",
+ "integrity": "sha512-GDhwkLfywWL2s6vEjyhri+eXmfH6j1L7JE27WhqLeYzoh/A3DBaYGEj2H/HFZCn/kMfim73FXxEJTw06WtxQwg==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">= 14.18.0"
+ },
+ "funding": {
+ "type": "individual",
+ "url": "https://paulmillr.com/funding/"
+ }
+ },
+ "node_modules/rollup": {
+ "version": "4.61.1",
+ "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.61.1.tgz",
+ "integrity": "sha512-I4KW6iuRpuu2uHBLraZ1wNZe0DP7lnRha+VJ9tNaYVaVgKhW0aI3h4RYnoRPeql0flHm/Co55b7snEDcOfOJrA==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@types/estree": "1.0.9"
+ },
+ "bin": {
+ "rollup": "dist/bin/rollup"
+ },
+ "engines": {
+ "node": ">=18.0.0",
+ "npm": ">=8.0.0"
+ },
+ "optionalDependencies": {
+ "@rollup/rollup-android-arm-eabi": "4.61.1",
+ "@rollup/rollup-android-arm64": "4.61.1",
+ "@rollup/rollup-darwin-arm64": "4.61.1",
+ "@rollup/rollup-darwin-x64": "4.61.1",
+ "@rollup/rollup-freebsd-arm64": "4.61.1",
+ "@rollup/rollup-freebsd-x64": "4.61.1",
+ "@rollup/rollup-linux-arm-gnueabihf": "4.61.1",
+ "@rollup/rollup-linux-arm-musleabihf": "4.61.1",
+ "@rollup/rollup-linux-arm64-gnu": "4.61.1",
+ "@rollup/rollup-linux-arm64-musl": "4.61.1",
+ "@rollup/rollup-linux-loong64-gnu": "4.61.1",
+ "@rollup/rollup-linux-loong64-musl": "4.61.1",
+ "@rollup/rollup-linux-ppc64-gnu": "4.61.1",
+ "@rollup/rollup-linux-ppc64-musl": "4.61.1",
+ "@rollup/rollup-linux-riscv64-gnu": "4.61.1",
+ "@rollup/rollup-linux-riscv64-musl": "4.61.1",
+ "@rollup/rollup-linux-s390x-gnu": "4.61.1",
+ "@rollup/rollup-linux-x64-gnu": "4.61.1",
+ "@rollup/rollup-linux-x64-musl": "4.61.1",
+ "@rollup/rollup-openbsd-x64": "4.61.1",
+ "@rollup/rollup-openharmony-arm64": "4.61.1",
+ "@rollup/rollup-win32-arm64-msvc": "4.61.1",
+ "@rollup/rollup-win32-ia32-msvc": "4.61.1",
+ "@rollup/rollup-win32-x64-gnu": "4.61.1",
+ "@rollup/rollup-win32-x64-msvc": "4.61.1",
+ "fsevents": "~2.3.2"
+ }
+ },
+ "node_modules/sade": {
+ "version": "1.8.1",
+ "resolved": "https://registry.npmjs.org/sade/-/sade-1.8.1.tgz",
+ "integrity": "sha512-xal3CZX1Xlo/k4ApwCFrHVACi9fBqJ7V+mwhBsuf/1IOKbBy098Fex+Wa/5QMubw09pSZ/u8EY8PWgevJsXp1A==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "mri": "^1.1.0"
+ },
+ "engines": {
+ "node": ">=6"
+ }
+ },
+ "node_modules/set-cookie-parser": {
+ "version": "3.1.0",
+ "resolved": "https://registry.npmjs.org/set-cookie-parser/-/set-cookie-parser-3.1.0.tgz",
+ "integrity": "sha512-kjnC1DXBHcxaOaOXBHBeRtltsDG2nUiUni+jP92M9gYdW12rsmx92UsfpH7o5tDRs7I1ZZPSQJQGv3UaRfCiuw==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/sirv": {
+ "version": "3.0.2",
+ "resolved": "https://registry.npmjs.org/sirv/-/sirv-3.0.2.tgz",
+ "integrity": "sha512-2wcC/oGxHis/BoHkkPwldgiPSYcpZK3JU28WoMVv55yHJgcZ8rlXvuG9iZggz+sU1d4bRgIGASwyWqjxu3FM0g==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@polka/url": "^1.0.0-next.24",
+ "mrmime": "^2.0.0",
+ "totalist": "^3.0.0"
+ },
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/source-map-js": {
+ "version": "1.2.1",
+ "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.1.tgz",
+ "integrity": "sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==",
+ "dev": true,
+ "license": "BSD-3-Clause",
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/svelte": {
+ "version": "5.56.3",
+ "resolved": "https://registry.npmjs.org/svelte/-/svelte-5.56.3.tgz",
+ "integrity": "sha512-w7JvrM5IFl5cmfbY0TLik9o7mjRUJmRMhOR51tBPu708Gr/MjbGs7VnJnr/B0CaXeI4vtnOh7RKxDr0cwhMdDA==",
+ "dev": true,
+ "license": "MIT",
+ "peer": true,
+ "dependencies": {
+ "@jridgewell/remapping": "^2.3.4",
+ "@jridgewell/sourcemap-codec": "^1.5.0",
+ "@sveltejs/acorn-typescript": "^1.0.10",
+ "@types/estree": "^1.0.5",
+ "@types/trusted-types": "^2.0.7",
+ "acorn": "^8.12.1",
+ "aria-query": "5.3.1",
+ "axobject-query": "^4.1.0",
+ "clsx": "^2.1.1",
+ "devalue": "^5.8.1",
+ "esm-env": "^1.2.1",
+ "esrap": "^2.2.11",
+ "is-reference": "^3.0.3",
+ "locate-character": "^3.0.0",
+ "magic-string": "^0.30.11",
+ "zimmerframe": "^1.1.2"
+ },
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/svelte-check": {
+ "version": "4.6.0",
+ "resolved": "https://registry.npmjs.org/svelte-check/-/svelte-check-4.6.0.tgz",
+ "integrity": "sha512-KhVnDFDSid57mmZtHz8gfW8AAGylOZ0vPnOIzVmAL+urzwK8sBYXRss953gD8T0OdgAQ11mdWhE6uadmtOz8TQ==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@jridgewell/trace-mapping": "^0.3.25",
+ "@sveltejs/load-config": "0.1.1",
+ "chokidar": "^4.0.1",
+ "fdir": "^6.2.0",
+ "picocolors": "^1.0.0",
+ "sade": "^1.7.4"
+ },
+ "bin": {
+ "svelte-check": "bin/svelte-check"
+ },
+ "engines": {
+ "node": ">= 18.0.0"
+ },
+ "peerDependencies": {
+ "svelte": "^4.0.0 || ^5.0.0-next.0",
+ "typescript": ">=5.0.0"
+ }
+ },
+ "node_modules/totalist": {
+ "version": "3.0.1",
+ "resolved": "https://registry.npmjs.org/totalist/-/totalist-3.0.1.tgz",
+ "integrity": "sha512-sf4i37nQ2LBx4m3wB74y+ubopq6W/dIzXg0FDGjsYnZHVa1Da8FH853wlL2gtUhg+xJXjfk3kUZS3BRoQeoQBQ==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=6"
+ }
+ },
+ "node_modules/typescript": {
+ "version": "5.9.3",
+ "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.9.3.tgz",
+ "integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==",
+ "dev": true,
+ "license": "Apache-2.0",
+ "peer": true,
+ "bin": {
+ "tsc": "bin/tsc",
+ "tsserver": "bin/tsserver"
+ },
+ "engines": {
+ "node": ">=14.17"
+ }
+ },
+ "node_modules/undici-types": {
+ "version": "7.24.6",
+ "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-7.24.6.tgz",
+ "integrity": "sha512-WRNW+sJgj5OBN4/0JpHFqtqzhpbnV0GuB+OozA9gCL7a993SmU+1JBZCzLNxYsbMfIeDL+lTsphD5jN5N+n0zg==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/uplot": {
+ "version": "1.6.32",
+ "resolved": "https://registry.npmjs.org/uplot/-/uplot-1.6.32.tgz",
+ "integrity": "sha512-KIMVnG68zvu5XXUbC4LQEPnhwOxBuLyW1AHtpm6IKTXImkbLgkMy+jabjLgSLMasNuGGzQm/ep3tOkyTxpiQIw==",
+ "license": "MIT"
+ },
+ "node_modules/vite": {
+ "version": "5.4.21",
+ "resolved": "https://registry.npmjs.org/vite/-/vite-5.4.21.tgz",
+ "integrity": "sha512-o5a9xKjbtuhY6Bi5S3+HvbRERmouabWbyUcpXXUA1u+GNUKoROi9byOJ8M0nHbHYHkYICiMlqxkg1KkYmm25Sw==",
+ "dev": true,
+ "license": "MIT",
+ "peer": true,
+ "dependencies": {
+ "esbuild": "^0.21.3",
+ "postcss": "^8.4.43",
+ "rollup": "^4.20.0"
+ },
+ "bin": {
+ "vite": "bin/vite.js"
+ },
+ "engines": {
+ "node": "^18.0.0 || >=20.0.0"
+ },
+ "funding": {
+ "url": "https://github.com/vitejs/vite?sponsor=1"
+ },
+ "optionalDependencies": {
+ "fsevents": "~2.3.3"
+ },
+ "peerDependencies": {
+ "@types/node": "^18.0.0 || >=20.0.0",
+ "less": "*",
+ "lightningcss": "^1.21.0",
+ "sass": "*",
+ "sass-embedded": "*",
+ "stylus": "*",
+ "sugarss": "*",
+ "terser": "^5.4.0"
+ },
+ "peerDependenciesMeta": {
+ "@types/node": {
+ "optional": true
+ },
+ "less": {
+ "optional": true
+ },
+ "lightningcss": {
+ "optional": true
+ },
+ "sass": {
+ "optional": true
+ },
+ "sass-embedded": {
+ "optional": true
+ },
+ "stylus": {
+ "optional": true
+ },
+ "sugarss": {
+ "optional": true
+ },
+ "terser": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/vitefu": {
+ "version": "1.1.3",
+ "resolved": "https://registry.npmjs.org/vitefu/-/vitefu-1.1.3.tgz",
+ "integrity": "sha512-ub4okH7Z5KLjb6hDyjqrGXqWtWvoYdU3IGm/NorpgHncKoLTCfRIbvlhBm7r0YstIaQRYlp4yEbFqDcKSzXSSg==",
+ "dev": true,
+ "license": "MIT",
+ "workspaces": [
+ "tests/deps/*",
+ "tests/projects/*",
+ "tests/projects/workspace/packages/*"
+ ],
+ "peerDependencies": {
+ "vite": "^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0"
+ },
+ "peerDependenciesMeta": {
+ "vite": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/zimmerframe": {
+ "version": "1.1.4",
+ "resolved": "https://registry.npmjs.org/zimmerframe/-/zimmerframe-1.1.4.tgz",
+ "integrity": "sha512-B58NGBEoc8Y9MWWCQGl/gq9xBCe4IiKM0a2x7GZdQKOW5Exr8S1W24J6OgM1njK8xCRGvAJIL/MxXHf6SkmQKQ==",
+ "dev": true,
+ "license": "MIT"
+ }
+ }
+}
diff --git a/dashboard-frontend/package.json b/dashboard-frontend/package.json
new file mode 100644
index 0000000..f20753c
--- /dev/null
+++ b/dashboard-frontend/package.json
@@ -0,0 +1,25 @@
+{
+ "name": "s3proxy-dashboard",
+ "version": "1.0.0",
+ "private": true,
+ "type": "module",
+ "scripts": {
+ "dev": "vite dev",
+ "build": "vite build",
+ "preview": "vite preview",
+ "check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json"
+ },
+ "devDependencies": {
+ "@sveltejs/adapter-static": "^3.0.6",
+ "@sveltejs/kit": "^2.8.0",
+ "@sveltejs/vite-plugin-svelte": "^4.0.0",
+ "@types/node": "^25.9.2",
+ "svelte": "^5.1.0",
+ "svelte-check": "^4.0.0",
+ "typescript": "^5.6.0",
+ "vite": "^5.4.0"
+ },
+ "dependencies": {
+ "uplot": "^1.6.31"
+ }
+}
diff --git a/dashboard-frontend/src/app.css b/dashboard-frontend/src/app.css
new file mode 100644
index 0000000..9886925
--- /dev/null
+++ b/dashboard-frontend/src/app.css
@@ -0,0 +1,594 @@
+/* Ported verbatim from s3proxy/dashboard/templates.py (_SHARED_CSS + dashboard +
+ login styles) so the dashboard's appearance is unchanged by the rewrite. */
+
+:root {
+ --bg: #fafafa;
+ --surface: #ffffff;
+ --border: #e5e7eb;
+ --border-strong: #d1d5db;
+ --text: #111827;
+ --text-muted: #6b7280;
+ --text-subtle: #9ca3af;
+ --ok: #10b981;
+ --ok-bg: #ecfdf5;
+ --err: #ef4444;
+ --err-bg: #fef2f2;
+ --dark: #111827;
+ --icon-bg: #f3f4f6;
+ --accent: #2563eb;
+ --accent-soft: rgba(37, 99, 235, 0.12);
+ --accent-softer: rgba(37, 99, 235, 0.04);
+}
+* { box-sizing: border-box; }
+html, body {
+ margin: 0;
+ background: var(--bg);
+ color: var(--text);
+ font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI",
+ Helvetica, Arial, sans-serif;
+ font-size: 14px;
+ line-height: 1.4;
+ -webkit-font-smoothing: antialiased;
+}
+a { color: inherit; }
+.brand-mark {
+ width: 40px; height: 40px;
+ background: var(--dark);
+ border-radius: 10px;
+ display: flex; align-items: center; justify-content: center;
+ flex-shrink: 0;
+}
+.brand-mark svg { color: #fff; }
+.brand-name { font-size: 20px; font-weight: 600; letter-spacing: -0.01em; }
+.btn-dark {
+ background: #111827; color: #fff;
+ border: none; border-radius: 8px;
+ padding: 8px 14px; font-size: 13px; font-weight: 500;
+ cursor: pointer;
+}
+.btn-dark:hover { background: #1f2937; }
+.btn-dark:disabled { opacity: .6; cursor: not-allowed; }
+.btn-ghost {
+ background: transparent; color: var(--text);
+ border: 1px solid var(--border-strong);
+ border-radius: 8px; padding: 5px 10px;
+ font-size: 12px; cursor: pointer;
+ display: inline-flex; align-items: center; gap: 4px;
+}
+.btn-ghost:hover { background: var(--icon-bg); }
+
+/* ---- Login ---- */
+.login-page {
+ min-height: 100vh;
+ display: flex; align-items: center; justify-content: center;
+ padding: 24px;
+}
+.login-card {
+ width: 100%;
+ max-width: 380px;
+ background: var(--surface);
+ border: 1px solid var(--border);
+ border-radius: 12px;
+ padding: 28px;
+}
+.login-head {
+ display: flex; align-items: center; gap: 12px;
+ margin-bottom: 20px;
+}
+.login-title { font-size: 18px; font-weight: 600; }
+.login-subtitle { color: var(--text-muted); font-size: 13px; margin-top: 2px; }
+.field { margin-bottom: 14px; }
+.field label {
+ display: block; margin-bottom: 6px;
+ font-size: 12px; font-weight: 500;
+ color: var(--text-muted);
+ text-transform: uppercase;
+ letter-spacing: 0.04em;
+}
+.field input {
+ width: 100%;
+ padding: 10px 12px;
+ border: 1px solid var(--border-strong);
+ border-radius: 8px;
+ font-size: 14px;
+ background: #fff;
+ font-family: inherit;
+ color: var(--text);
+ transition: border-color .15s, box-shadow .15s;
+}
+.field input:focus {
+ outline: none;
+ border-color: var(--dark);
+ box-shadow: 0 0 0 3px rgba(17, 24, 39, 0.08);
+}
+.login-error {
+ background: var(--err-bg);
+ color: var(--err);
+ border: 1px solid rgba(239, 68, 68, 0.2);
+ border-radius: 8px;
+ padding: 8px 12px;
+ font-size: 13px;
+ margin-bottom: 14px;
+}
+.login-submit { width: 100%; margin-top: 6px; }
+
+/* ---- Page shell ---- */
+.page {
+ max-width: 1080px;
+ margin: 0 auto;
+ padding: 32px 24px 96px 24px;
+}
+.app-head {
+ display: flex; align-items: center; justify-content: space-between;
+ gap: 16px; padding-bottom: 20px;
+ border-bottom: 1px solid var(--border);
+ margin-bottom: 24px;
+}
+.brand { display: flex; align-items: center; gap: 12px; }
+.head-right { display: flex; align-items: center; gap: 14px; }
+.status-pill {
+ display: inline-flex; align-items: center; gap: 6px;
+ padding: 4px 10px;
+ border: 1px solid var(--ok);
+ border-radius: 999px;
+ color: var(--ok);
+ font-size: 13px; background: transparent;
+}
+.status-pill .dot {
+ width: 7px; height: 7px; border-radius: 50%;
+ background: var(--ok);
+}
+.uptime { color: var(--text-muted); font-size: 13px; }
+.head-user {
+ color: var(--text-muted); font-size: 12px;
+ border-left: 1px solid var(--border);
+ padding-left: 14px;
+}
+.head-user a {
+ color: var(--text); text-decoration: none; margin-left: 6px;
+}
+.head-user a:hover { text-decoration: underline; }
+
+/* ---- Cards ---- */
+.cards {
+ display: grid; grid-template-columns: repeat(4, 1fr);
+ gap: 16px; margin-bottom: 20px;
+}
+.card {
+ display: block;
+ background: var(--surface);
+ border: 1px solid var(--border);
+ border-radius: 10px;
+ padding: 18px;
+ cursor: pointer;
+ transition: border-color .15s, box-shadow .15s, transform .15s;
+ position: relative;
+ user-select: none;
+ text-decoration: none;
+ color: inherit;
+}
+.card:hover {
+ border-color: var(--border-strong);
+ transform: translateY(-1px);
+ box-shadow: 0 2px 8px rgba(17, 24, 39, 0.04);
+}
+.card-head {
+ display: flex; align-items: center; justify-content: space-between;
+ color: var(--text-muted); font-size: 13px;
+ margin-bottom: 10px;
+}
+.card-head-left { display: flex; align-items: center; gap: 10px; }
+.card-icon {
+ width: 30px; height: 30px;
+ background: var(--icon-bg);
+ border-radius: 8px;
+ display: flex; align-items: center; justify-content: center;
+ color: var(--text);
+}
+.card-chevron { color: var(--text-subtle); }
+.card:hover .card-chevron { color: var(--text); }
+.card-value {
+ font-size: 34px; font-weight: 600;
+ letter-spacing: -0.02em; line-height: 1.1;
+}
+.card-unit {
+ font-size: 16px; font-weight: 500;
+ color: var(--text-muted); margin-left: 4px;
+}
+.card-delta { margin-top: 6px; font-size: 12px; color: var(--text-muted); }
+.spark {
+ margin-top: 12px; width: 100%; height: 28px;
+ display: block; color: var(--text-subtle);
+}
+.chart-block {
+ display: flex; flex-direction: column;
+ gap: 10px;
+}
+.chart-header {
+ display: flex; align-items: baseline;
+ gap: 12px;
+}
+.chart-title {
+ font-size: 13px; font-weight: 500;
+ color: var(--text);
+}
+/* The title absorbs the slack on the left so the tab group + meta sit together
+ on the right; the meta has a reserved width so its changing text
+ (peak/latest) never reflows and shifts the tabs. */
+.chart-title { margin-right: auto; }
+.chart-subtle {
+ font-size: 12px; color: var(--text-muted);
+ font-variant-numeric: tabular-nums;
+ min-width: 200px;
+ text-align: right;
+ white-space: nowrap;
+}
+.range-tabs {
+ display: inline-flex; gap: 2px;
+ background: var(--surface-2, rgba(127, 127, 127, 0.08));
+ border: 1px solid var(--border);
+ border-radius: 8px; padding: 2px;
+}
+.range-tab {
+ border: 0; background: transparent; cursor: pointer;
+ font: inherit; font-size: 12px; color: var(--text-muted);
+ padding: 3px 10px; border-radius: 6px;
+}
+.range-tab:hover { color: var(--text); }
+.range-tab.active {
+ background: var(--accent, #2563eb); color: #fff;
+}
+.chart-wrap {
+ position: relative;
+ width: 100%;
+ height: 280px;
+ background: var(--surface);
+ border: 1px solid var(--border);
+ border-radius: 10px;
+ padding: 14px 14px 10px 14px;
+}
+.chart-wrap--big {
+ /* Fixed height (not aspect-ratio/auto): uPlot injects a canvas whose height
+ would otherwise feed back into an auto-sized box and make the chart grow on
+ every redraw. A deterministic height keeps repeated draws idempotent. */
+ height: 360px;
+ padding: 18px 18px 14px 18px;
+ overflow: hidden;
+}
+.chart-wrap--big .uplot,
+.chart-wrap--big canvas {
+ max-height: 100%;
+}
+.kv {
+ display: flex; justify-content: space-between;
+ padding: 9px 0;
+ font-size: 13px;
+ border-bottom: 1px solid var(--border);
+ gap: 10px; min-width: 0;
+}
+.kv:last-child { border-bottom: none; }
+.kv .k { color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; }
+.kv .v { font-variant-numeric: tabular-nums; flex-shrink: 0; }
+
+/* ---- Metric detail page ---- */
+.metric-head {
+ margin-bottom: 20px;
+}
+.metric-head-text { min-width: 0; }
+.metric-hero-label {
+ color: var(--text); font-size: 15px; font-weight: 600;
+ margin-bottom: 4px;
+}
+.metric-hero-value {
+ font-size: 40px; font-weight: 600;
+ letter-spacing: -0.02em; line-height: 1.05;
+}
+.metric-hero-value .card-unit { font-size: 18px; margin-left: 6px; }
+.metric-hero-delta {
+ color: var(--text-muted); font-size: 12px; margin-top: 6px;
+}
+.metric-grid {
+ display: grid;
+ grid-template-columns: minmax(0, 3fr) minmax(0, 0.9fr);
+ gap: 28px;
+ align-items: start;
+}
+.metric-chart-col { min-width: 0; }
+.metric-breakdown-col { min-width: 0; padding-top: 4px; }
+.breakdown-heading {
+ margin: 0 0 12px 0;
+ font-size: 13px; font-weight: 600;
+ color: var(--text);
+}
+.breakdown-bars {
+ display: flex; flex-direction: column;
+ gap: 10px;
+}
+.bb-row { display: flex; flex-direction: column; gap: 5px; }
+.bb-head {
+ display: flex; justify-content: space-between;
+ align-items: baseline; gap: 10px;
+ font-size: 13px;
+}
+.bb-label { color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
+.bb-value {
+ color: var(--text); font-variant-numeric: tabular-nums;
+ flex-shrink: 0;
+}
+.bb-percent {
+ color: var(--text-muted); font-size: 12px;
+ font-variant-numeric: tabular-nums;
+ margin-left: 6px;
+}
+.bb-track {
+ position: relative;
+ height: 6px;
+ background: var(--icon-bg);
+ border-radius: 3px;
+ overflow: hidden;
+}
+.bb-fill {
+ position: absolute; left: 0; top: 0; bottom: 0;
+ background: var(--dark);
+ border-radius: 3px;
+ transition: width .25s ease-out;
+}
+@media (max-width: 880px) {
+ .metric-grid { grid-template-columns: 1fr; gap: 20px; }
+}
+
+/* ---- Sections ---- */
+.section {
+ background: var(--surface);
+ border: 1px solid var(--border);
+ border-radius: 10px;
+ padding: 20px; margin-bottom: 20px;
+}
+.section-head {
+ display: flex; align-items: center; justify-content: space-between;
+ margin-bottom: 14px; gap: 12px;
+}
+.section-title { font-size: 16px; font-weight: 600; }
+.section-actions { display: flex; align-items: center; gap: 14px; }
+.live {
+ display: inline-flex; align-items: center; gap: 6px;
+ color: var(--text-muted); font-size: 13px;
+}
+.live .dot {
+ width: 7px; height: 7px; border-radius: 50%;
+ background: var(--ok); box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
+}
+.back-link {
+ display: inline-flex; align-items: center; gap: 6px;
+ color: var(--text); font-size: 13px;
+ text-decoration: none; cursor: pointer;
+}
+.back-link:hover { text-decoration: underline; }
+
+/* ---- Tables ---- */
+.scroll-x { width: 100%; overflow-x: auto; }
+table { width: 100%; border-collapse: collapse; }
+th, td {
+ text-align: left; padding: 10px 8px;
+ font-size: 13px; white-space: nowrap;
+}
+th {
+ color: var(--text-muted); font-weight: 500;
+ border-bottom: 1px solid var(--border);
+}
+td {
+ border-bottom: 1px solid var(--border);
+ color: var(--text);
+}
+tr:last-child td { border-bottom: none; }
+td.truncate {
+ max-width: 220px;
+ overflow: hidden; text-overflow: ellipsis;
+}
+.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
+/* Object-detail values: long keys/etags must wrap, overriding the table's nowrap. */
+.ov-value {
+ white-space: normal;
+ word-break: break-all;
+ overflow-wrap: anywhere;
+}
+.pill {
+ display: inline-block;
+ padding: 2px 10px; border-radius: 999px;
+ font-size: 12px; font-weight: 500;
+}
+.pill.ok { background: var(--ok-bg); color: var(--ok); }
+.pill.err { background: var(--err-bg); color: var(--err); }
+.enc-cell { display: inline-flex; align-items: center; gap: 6px; }
+.enc-cell.on { color: var(--ok); }
+.enc-cell.off { color: var(--text-muted); }
+.linkish {
+ color: var(--text); text-decoration: none;
+ border-bottom: 1px dashed var(--text-subtle);
+ cursor: pointer;
+}
+.linkish:hover {
+ border-bottom-color: var(--text);
+ color: #000;
+}
+
+.split {
+ display: grid; grid-template-columns: 1fr 1fr; gap: 20px;
+}
+
+/* ---- Detail views ---- */
+.detail-sub { color: var(--text-muted); font-size: 13px; margin-top: 2px; word-break: break-all; overflow-wrap: anywhere; }
+.empty-state {
+ color: var(--text-muted); font-size: 13px;
+ padding: 24px; text-align: center;
+}
+
+/* ---- Explorer (list-style) ---- */
+.crumbs {
+ display: flex; flex-wrap: wrap;
+ align-items: center; gap: 4px;
+ font-size: 13px;
+ margin: 4px 0 16px 0;
+ color: var(--text-muted);
+}
+.crumbs a {
+ color: var(--text);
+ text-decoration: none;
+ padding: 3px 8px;
+ border-radius: 6px;
+ cursor: pointer;
+}
+.crumbs a:hover { background: var(--icon-bg); }
+.crumbs .sep { color: var(--text-subtle); padding: 0 2px; }
+.crumbs .curr {
+ font-weight: 500; color: var(--text);
+ padding: 3px 8px;
+}
+
+.explorer { width: 100%; border-collapse: collapse; }
+.explorer th, .explorer td {
+ text-align: left; padding: 9px 10px;
+ font-size: 13px;
+ border-bottom: 1px solid var(--border);
+}
+.explorer th {
+ color: var(--text-muted); font-weight: 500;
+ background: #fafbfc; position: sticky; top: 0;
+}
+.explorer tr:last-child td { border-bottom: none; }
+.explorer tr.row { cursor: pointer; }
+.explorer tr.row:hover td { background: var(--icon-bg); }
+.explorer td.col-name {
+ display: flex; align-items: center; gap: 10px;
+ min-width: 0;
+}
+.explorer td.col-name a {
+ color: var(--text);
+ text-decoration: none;
+ overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
+ flex: 1; min-width: 0;
+}
+.explorer td.col-name a:hover { text-decoration: underline; }
+.explorer .row-icon {
+ width: 18px; height: 18px;
+ display: inline-flex; align-items: center; justify-content: center;
+ flex-shrink: 0;
+}
+.explorer .row-icon.folder { color: #eab308; }
+.explorer .row-icon.file { color: var(--text-subtle); }
+.explorer td.col-size,
+.explorer td.col-modified {
+ color: var(--text-muted);
+ font-variant-numeric: tabular-nums;
+ white-space: nowrap;
+}
+.explorer td.col-size { text-align: right; }
+
+/* ---- Logs view ---- */
+.logs-toolbar {
+ display: flex; flex-wrap: wrap;
+ gap: 8px; margin-bottom: 14px;
+ align-items: center;
+}
+.logs-toolbar input[type="search"],
+.logs-toolbar select {
+ padding: 7px 10px;
+ border: 1px solid var(--border-strong);
+ border-radius: 8px;
+ font-size: 13px;
+ background: #fff;
+ color: var(--text);
+ font-family: inherit;
+}
+.logs-toolbar input[type="search"] {
+ flex: 1 1 260px; min-width: 160px;
+}
+.logs-toolbar input[type="search"]:focus,
+.logs-toolbar select:focus {
+ outline: none;
+ border-color: var(--dark);
+ box-shadow: 0 0 0 3px rgba(17, 24, 39, 0.06);
+}
+.logs-count { color: var(--text-muted); font-size: 12px; margin-left: auto; }
+.logs-pager {
+ display: flex; align-items: center; justify-content: center;
+ gap: 14px; margin-top: 14px;
+}
+.pager-btn {
+ border: 1px solid var(--border); background: var(--surface);
+ color: var(--text); font: inherit; font-size: 13px;
+ padding: 5px 14px; border-radius: 7px; cursor: pointer;
+}
+.pager-btn:hover:not(:disabled) { border-color: var(--border-strong); }
+.pager-btn:disabled { opacity: 0.4; cursor: default; }
+.pager-status { color: var(--text-muted); font-size: 12px; font-variant-numeric: tabular-nums; }
+.pager-num {
+ border: 1px solid var(--border); background: var(--surface);
+ color: var(--text); font: inherit; font-size: 13px;
+ min-width: 30px; padding: 5px 8px; border-radius: 7px; cursor: pointer;
+ font-variant-numeric: tabular-nums;
+}
+.pager-num:hover { border-color: var(--border-strong); }
+.pager-num.active {
+ background: var(--accent); color: #fff; border-color: var(--accent);
+}
+.pager-gap { color: var(--text-subtle); padding: 0 2px; }
+.pager-jump {
+ display: inline-flex; align-items: center; gap: 6px;
+ color: var(--text-muted); font-size: 12px; margin-left: 8px;
+}
+.pager-jump input {
+ width: 56px; padding: 4px 6px;
+ border: 1px solid var(--border-strong); border-radius: 7px;
+ font: inherit; font-size: 13px; text-align: center;
+}
+.pager-jump input:focus { outline: none; border-color: var(--dark); }
+
+/* ---- Footer ---- */
+.footer {
+ position: fixed; left: 0; right: 0; bottom: 0;
+ border-top: 1px solid var(--border);
+ background: var(--surface);
+ padding: 10px 24px;
+ font-size: 12px; color: var(--text-muted);
+ display: flex; align-items: center; gap: 28px;
+}
+.footer .brand-mini { display: inline-flex; align-items: center; gap: 6px; }
+.footer .spacer { flex: 1; }
+
+@media (max-width: 880px) {
+ .cards { grid-template-columns: repeat(2, 1fr); }
+ .split { grid-template-columns: 1fr; }
+}
+@media (max-width: 520px) {
+ .cards { grid-template-columns: 1fr; }
+}
+
+/* ---- uPlot theming to match the old hand-rolled SVG chart ---- */
+.uplot, .uplot * { font-family: inherit; }
+.uplot .u-axis { color: var(--text-muted); }
+.u-tooltip {
+ position: absolute;
+ background: var(--dark);
+ color: #fff;
+ font-size: 12px;
+ padding: 7px 10px;
+ border-radius: 8px;
+ pointer-events: none;
+ transform: translate(-50%, calc(-100% - 10px));
+ white-space: nowrap;
+ display: none;
+ font-variant-numeric: tabular-nums;
+ box-shadow: 0 4px 14px rgba(17, 24, 39, 0.15);
+ z-index: 10;
+}
+.u-tooltip::after {
+ content: "";
+ position: absolute;
+ bottom: -4px; left: 50%;
+ transform: translateX(-50%) rotate(45deg);
+ width: 8px; height: 8px;
+ background: var(--dark);
+}
+.u-tooltip .tip-v { font-size: 14px; font-weight: 600; display: block; }
+.u-tooltip .tip-t { font-size: 11px; opacity: 0.7; display: block; margin-top: 2px; }
diff --git a/dashboard-frontend/src/app.d.ts b/dashboard-frontend/src/app.d.ts
new file mode 100644
index 0000000..a6911e5
--- /dev/null
+++ b/dashboard-frontend/src/app.d.ts
@@ -0,0 +1,5 @@
+declare global {
+ namespace App {}
+}
+
+export {};
diff --git a/dashboard-frontend/src/app.html b/dashboard-frontend/src/app.html
new file mode 100644
index 0000000..c5ef04b
--- /dev/null
+++ b/dashboard-frontend/src/app.html
@@ -0,0 +1,12 @@
+
+
+
+
+
+ S3 Encryption Proxy
+ %sveltekit.head%
+
+
+ %sveltekit.body%
+
+
diff --git a/dashboard-frontend/src/lib/api.ts b/dashboard-frontend/src/lib/api.ts
new file mode 100644
index 0000000..3db20ed
--- /dev/null
+++ b/dashboard-frontend/src/lib/api.ts
@@ -0,0 +1,83 @@
+import { base } from '$app/paths';
+import type {
+ BucketPayload,
+ LogsPayload,
+ ObjectDetail,
+ SeriesPayload,
+ StatusPayload
+} from './types';
+
+// All requests are same-origin under the dashboard base path. The ingress routes
+// `${base}/api/*` and `${base}/api/stream` to the proxy service, so relative
+// URLs + the session cookie work without CORS. A 401 means the session lapsed —
+// bounce to the login page, mirroring the old dashboard behaviour.
+
+const API = `${base}/api`;
+// The login page is served statically at ${base}/login, but the form POST and
+// logout hit the proxy under ${base}/api so the ingress's /api rule reaches it.
+export const LOGIN_URL = `${base}/login`;
+export const LOGIN_ACTION = `${API}/login`;
+export const LOGOUT_URL = `${API}/logout`;
+export const STREAM_URL = `${API}/stream`;
+
+class Unauthorized extends Error {}
+
+function toLogin(): never {
+ window.location.href = LOGIN_URL;
+ throw new Unauthorized();
+}
+
+async function getJSON(url: string): Promise {
+ const r = await fetch(url, { credentials: 'same-origin' });
+ if (r.status === 401) toLogin();
+ if (!r.ok) throw new Error(`HTTP ${r.status}`);
+ return (await r.json()) as T;
+}
+
+export function fetchStatus(): Promise {
+ return getJSON(`${API}/status`);
+}
+
+export function fetchSeries(metric: string, range: string): Promise {
+ const params = new URLSearchParams({ metric, range });
+ return getJSON(`${API}/series?${params}`);
+}
+
+export function fetchLogs(opts: {
+ q: string;
+ operation: string;
+ status: string;
+ limit: number;
+ offset: number;
+}): Promise {
+ const params = new URLSearchParams({
+ q: opts.q,
+ operation: opts.operation,
+ status: opts.status,
+ limit: String(opts.limit),
+ offset: String(opts.offset)
+ });
+ return getJSON(`${API}/logs?${params}`);
+}
+
+export function fetchBucket(
+ bucket: string,
+ prefix: string,
+ offset: number,
+ pageSize: number
+): Promise {
+ const params = new URLSearchParams({
+ prefix,
+ delimiter: '/',
+ offset: String(offset),
+ page_size: String(pageSize)
+ });
+ return getJSON(`${API}/buckets/${encodeURIComponent(bucket)}?${params}`);
+}
+
+export function fetchObject(bucket: string, object: string): Promise {
+ // Key segment is a {key:path} on the backend — encode the bucket, but keep the
+ // object's slashes intact (encodeURI, matching the old client).
+ const url = `${API}/objects/${encodeURIComponent(bucket)}/${encodeURI(object)}`;
+ return getJSON(url);
+}
diff --git a/dashboard-frontend/src/lib/chart.ts b/dashboard-frontend/src/lib/chart.ts
new file mode 100644
index 0000000..284d8ee
--- /dev/null
+++ b/dashboard-frontend/src/lib/chart.ts
@@ -0,0 +1,200 @@
+import uPlot from 'uplot';
+import { formatNumber, formatTime, niceTicks } from './format';
+
+// uPlot configuration that reproduces the previous hand-rolled SVG chart:
+// blue 2px line over a vertical blue-fade area fill, nice Y ticks, HH:MM:SS X
+// labels, and a dark value/time tooltip following the cursor.
+
+const ACCENT = '#2563eb';
+const AXIS_FONT = '13px -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Helvetica, Arial, sans-serif';
+const AXIS_COLOR = '#6b7280';
+const GRID_COLOR = '#eef0f3';
+
+function areaFill(u: uPlot): CanvasGradient | string {
+ const ctx = u.ctx;
+ const { top, height } = u.bbox;
+ const g = ctx.createLinearGradient(0, top, 0, top + height);
+ g.addColorStop(0, 'rgba(37,99,235,0.22)');
+ g.addColorStop(1, 'rgba(37,99,235,0)');
+ return g;
+}
+
+// A value formatter for the Y axis + tooltip. Returns a fully-formatted string
+// INCLUDING any unit (e.g. "2.5 GB" or "1.3k req"), so the chart never appends
+// a unit itself — that's what produced "1.3B GB".
+export type ValueFormat = (v: number) => string;
+
+export interface ChartHandle {
+ setData(times: number[], values: number[], format: ValueFormat): void;
+ resize(): void;
+ destroy(): void;
+}
+
+function tooltipPlugin(fmt: () => ValueFormat): uPlot.Plugin {
+ let tip: HTMLDivElement;
+ return {
+ hooks: {
+ init: (u) => {
+ tip = document.createElement('div');
+ tip.className = 'u-tooltip';
+ u.over.appendChild(tip);
+ u.over.addEventListener('mouseleave', () => (tip.style.display = 'none'));
+ },
+ setCursor: (u) => {
+ const idx = u.cursor.idx;
+ if (idx == null) {
+ tip.style.display = 'none';
+ return;
+ }
+ const t = u.data[0][idx];
+ const v = u.data[1][idx];
+ if (t == null || v == null) {
+ tip.style.display = 'none';
+ return;
+ }
+ const left = u.valToPos(t, 'x');
+ const top = u.valToPos(v, 'y');
+ tip.style.display = 'block';
+ tip.style.left = left + 'px';
+ tip.style.top = top + 'px';
+ tip.innerHTML =
+ `${fmt()(v)}` +
+ `${formatTime(t)}`;
+ }
+ }
+ };
+}
+
+export function createChart(el: HTMLElement): ChartHandle {
+ let chart: uPlot | null = null;
+ let format: ValueFormat = formatNumber;
+ // Y top is data-dependent; uPlot reads it through the scale range callback so
+ // we can update it on setData without recreating the chart.
+ let niceMax = 1;
+ let ticks: number[] = [0, 1];
+ // Time span (seconds) of the current series — drives X-label format so wide
+ // ranges (24h/7d) show day/hour instead of HH:MM:SS, which overlapped.
+ let spanSec = 3600;
+
+ // Format an epoch-seconds X tick based on the visible span.
+ function fmtX(t: number): string {
+ const d = new Date(t * 1000);
+ const p = (n: number) => String(n).padStart(2, '0');
+ if (spanSec > 36 * 3600) {
+ // multi-day: show "Jun 9" style
+ return d.toLocaleDateString(undefined, { month: 'short', day: 'numeric' });
+ }
+ if (spanSec > 3 * 3600) {
+ // several hours to ~1.5 days: show HH:MM
+ return `${p(d.getHours())}:${p(d.getMinutes())}`;
+ }
+ return `${p(d.getHours())}:${p(d.getMinutes())}:${p(d.getSeconds())}`;
+ }
+
+ function recomputeY(values: number[]) {
+ // Scale to the TRUE max (rounded up to a nice value) so the whole line is
+ // visible with headroom and the top gridline is a real, labelled tick.
+ const max = Math.max(...values, 1);
+ const r = niceTicks(max, 5);
+ niceMax = r.niceMax;
+ ticks = r.ticks;
+ }
+
+ function recomputeSpan(times: number[]) {
+ spanSec = times.length >= 2 ? Math.max(1, times[times.length - 1] - times[0]) : 3600;
+ }
+
+ // The container (.chart-wrap--big) has a fixed height + overflow:hidden, so
+ // reading clientWidth/clientHeight (content box, excludes padding) is stable
+ // and uPlot's injected canvas can't feed back into it — repeated setSize() is
+ // idempotent, which is what stops the chart growing on every redraw.
+ function measure(): { width: number; height: number } {
+ return {
+ width: Math.max(1, el.clientWidth),
+ height: Math.max(1, el.clientHeight)
+ };
+ }
+
+ function build(times: number[], values: number[]) {
+ recomputeY(values);
+ recomputeSpan(times);
+ const { width, height } = measure();
+
+ const opts: uPlot.Options = {
+ width,
+ height,
+ padding: [18, 20, 6, 12],
+ cursor: {
+ x: true,
+ y: false,
+ points: { size: 8, width: 2, stroke: ACCENT, fill: '#fff' }
+ },
+ legend: { show: false },
+ scales: {
+ x: { time: false },
+ // Read niceMax lazily so range tab switches update the top without a rebuild.
+ y: { range: () => [0, niceMax] }
+ },
+ axes: [
+ {
+ stroke: AXIS_COLOR,
+ grid: { show: false },
+ ticks: { show: true, stroke: '#d1d5db', size: 4 },
+ font: AXIS_FONT,
+ size: 34,
+ // Min px between ticks so labels never overlap (was the 24h/7d crowding).
+ space: 90,
+ values: (_u, vals) => vals.map((v) => fmtX(v))
+ },
+ {
+ stroke: AXIS_COLOR,
+ grid: { stroke: GRID_COLOR, width: 1 },
+ ticks: { show: false },
+ font: AXIS_FONT,
+ // Reserve enough left gutter that multi-digit/byte labels aren't clipped.
+ size: 64,
+ splits: () => ticks,
+ values: (_u, vals) => vals.map((v) => format(v))
+ }
+ ],
+ series: [
+ {},
+ {
+ stroke: ACCENT,
+ width: 2,
+ fill: areaFill,
+ points: { show: false }
+ }
+ ],
+ plugins: [tooltipPlugin(() => format)]
+ };
+ chart = new uPlot(opts, [times, values], el);
+ }
+
+ return {
+ setData(times, values, fmt) {
+ format = fmt;
+ recomputeSpan(times);
+ if (!chart) {
+ build(times, values);
+ return;
+ }
+ // Update in place — never destroy/recreate (recreating re-measured the
+ // container and grew the chart on every range click). setData + an
+ // explicit, deterministic size keep it stable.
+ recomputeY(values);
+ chart.setSize(measure());
+ chart.setData([times, values]);
+ },
+ // Reflow to the current container size (e.g. window resize) without changing data.
+ resize() {
+ if (chart) chart.setSize(measure());
+ },
+ destroy() {
+ if (chart) {
+ chart.destroy();
+ chart = null;
+ }
+ }
+ };
+}
diff --git a/dashboard-frontend/src/lib/components/BucketView.svelte b/dashboard-frontend/src/lib/components/BucketView.svelte
new file mode 100644
index 0000000..a6f5d64
--- /dev/null
+++ b/dashboard-frontend/src/lib/components/BucketView.svelte
@@ -0,0 +1,163 @@
+
+
+{#snippet pager()}
+ {#if data}
+
+ {/if}
+{/snippet}
+
+
+
+
+
← Back to dashboard
+
{bucket}
+
+ {#each crumbs as c, i}
+ {#if i > 0}
›{/if}
+ {#if c.current}
+
{c.label}
+ {:else}
+
{c.label}
+ {/if}
+ {/each}
+
+
{summary}
+
+
+ Live
+
+
+ {@render pager()}
+
+
+
+ | Name |
+ Encryption |
+ Size |
+ Last Modified |
+
+
+
+ {#if loading && !data}
+ | Loading… |
+ {:else if errorStatus != null}
+ | Failed to load: {errorStatus} |
+ {:else if data && data.folders.length + data.objects.length === 0}
+ | Empty folder. |
+ {:else if data}
+ {#each data.folders as f}
+ (location.hash = prefixHref(bucket, f.prefix).slice(1))}>
+ |
+ {@html FOLDER_ICON}
+ {(f.name || f.prefix) + '/'}
+ |
+ — |
+ — |
+ — |
+
+ {/each}
+ {#each data.objects as o}
+ (location.hash = objectHref(bucket, o.key).slice(1))}>
+ |
+ {@html FILE_ICON}
+ {o.name || o.key}
+ |
+
+ {#if o.encrypted === true}
+ {@html LOCK_ICON}Encrypted
+ {:else if o.encrypted === false}
+ Not Encrypted
+ {:else}
+ —
+ {/if}
+ |
+ {o.size_h || '—'} |
+ {formatIsoShort(o.last_modified)} |
+
+ {/each}
+ {/if}
+
+
+
diff --git a/dashboard-frontend/src/lib/components/Dashboard.svelte b/dashboard-frontend/src/lib/components/Dashboard.svelte
new file mode 100644
index 0000000..a25c570
--- /dev/null
+++ b/dashboard-frontend/src/lib/components/Dashboard.svelte
@@ -0,0 +1,128 @@
+
+
+
+
+
+
+
+
+
+
+
+
+ | Name |
+ Objects (seen) |
+ Size |
+
+
+
+ {#if buckets.length === 0}
+ | No buckets observed yet. |
+ {:else}
+ {#each buckets as b}
+
+ | {b.name} |
+ {b.objects} |
+ {b.size} |
+
+ {/each}
+ {/if}
+
+
+
+
+
+
+
+
+ | Key ID | Type | Status | Created |
+
+
+ {#each keys as k}
+
+ | {k.id} |
+ {k.type} |
+ {k.status} |
+ {k.created} |
+
+ {/each}
+
+
+
+
diff --git a/dashboard-frontend/src/lib/components/Footer.svelte b/dashboard-frontend/src/lib/components/Footer.svelte
new file mode 100644
index 0000000..711bc9c
--- /dev/null
+++ b/dashboard-frontend/src/lib/components/Footer.svelte
@@ -0,0 +1,22 @@
+
+
+
diff --git a/dashboard-frontend/src/lib/components/Header.svelte b/dashboard-frontend/src/lib/components/Header.svelte
new file mode 100644
index 0000000..aec8b76
--- /dev/null
+++ b/dashboard-frontend/src/lib/components/Header.svelte
@@ -0,0 +1,23 @@
+
+
+
diff --git a/dashboard-frontend/src/lib/components/LogsView.svelte b/dashboard-frontend/src/lib/components/LogsView.svelte
new file mode 100644
index 0000000..22e17a9
--- /dev/null
+++ b/dashboard-frontend/src/lib/components/LogsView.svelte
@@ -0,0 +1,152 @@
+
+
+
diff --git a/dashboard-frontend/src/lib/components/MetricCard.svelte b/dashboard-frontend/src/lib/components/MetricCard.svelte
new file mode 100644
index 0000000..1ba8b6b
--- /dev/null
+++ b/dashboard-frontend/src/lib/components/MetricCard.svelte
@@ -0,0 +1,38 @@
+
+
+
+
+
+ {@html icon}
+ {label}
+
+ {@html CHEVRON}
+
+
+ {card?.value ?? '—'}{card?.unit ?? ''}
+
+ {card?.detail || ' '}
+
+
diff --git a/dashboard-frontend/src/lib/components/MetricView.svelte b/dashboard-frontend/src/lib/components/MetricView.svelte
new file mode 100644
index 0000000..9e7060e
--- /dev/null
+++ b/dashboard-frontend/src/lib/components/MetricView.svelte
@@ -0,0 +1,169 @@
+
+
+← Back to dashboard
+
+
+
+
{label}
+
+ {card?.value ?? '—'}{unit}
+
+
{card?.detail || ' '}
+
+
+
+
+
+
{breakdownTitle}
+
+ {#if bars.length === 0}
+
Nothing to show yet.
+ {:else}
+ {#each bars as b}
+
+
+ {b.label}
+
+ {b.value}{#if b.showPct}{b.share.toFixed(1)}%{/if}
+
+
+
+
+ {/each}
+ {/if}
+
+
+
+
diff --git a/dashboard-frontend/src/lib/components/ObjectView.svelte b/dashboard-frontend/src/lib/components/ObjectView.svelte
new file mode 100644
index 0000000..ab80c9d
--- /dev/null
+++ b/dashboard-frontend/src/lib/components/ObjectView.svelte
@@ -0,0 +1,80 @@
+
+
+
+
+
+
← Back
+
{title}
+
{bucket} / {object}
+
+
+
+
+ {#if state_ === 'loading'}
+ | Loading… |
+ {:else if state_ === 'error'}
+ | Failed to load: {errorStatus} |
+ {:else if state_ === 'neterror'}
+ | Network error. |
+ {:else}
+ {#each rows as [k, v]}
+
+ | {k} |
+ {v} |
+
+ {/each}
+ {/if}
+
+
+
diff --git a/dashboard-frontend/src/lib/components/Pager.svelte b/dashboard-frontend/src/lib/components/Pager.svelte
new file mode 100644
index 0000000..40f68ce
--- /dev/null
+++ b/dashboard-frontend/src/lib/components/Pager.svelte
@@ -0,0 +1,110 @@
+
+
+{#if totalPages > 1}
+
+{/if}
+
+
diff --git a/dashboard-frontend/src/lib/components/Sparkline.svelte b/dashboard-frontend/src/lib/components/Sparkline.svelte
new file mode 100644
index 0000000..9701a3e
--- /dev/null
+++ b/dashboard-frontend/src/lib/components/Sparkline.svelte
@@ -0,0 +1,27 @@
+
+
+
diff --git a/dashboard-frontend/src/lib/format.ts b/dashboard-frontend/src/lib/format.ts
new file mode 100644
index 0000000..2e807f6
--- /dev/null
+++ b/dashboard-frontend/src/lib/format.ts
@@ -0,0 +1,85 @@
+// Number/time formatting ported verbatim from the inline dashboard JS so chart
+// axes, tooltips, and breakdown bars match the previous renderer exactly.
+
+export function formatNumber(v: number): string {
+ if (v >= 1e9) return (v / 1e9).toFixed(1) + 'B';
+ if (v >= 1e6) return (v / 1e6).toFixed(1) + 'M';
+ if (v >= 1e3) return (v / 1e3).toFixed(1) + 'k';
+ if (Math.abs(v) < 1 && v !== 0) return v.toFixed(2);
+ return Math.round(v).toString();
+}
+
+// Raw-byte formatter (B/KB/MB/GB/TB) — the bytes_* series are raw byte counts,
+// so they need byte units, not the count suffixes formatNumber() produces. The
+// returned string already includes its unit, so callers must not append one.
+export function formatBytes(v: number): string {
+ if (v <= 0) return '0 B';
+ const units = ['B', 'KB', 'MB', 'GB', 'TB', 'PB'];
+ const i = Math.min(units.length - 1, Math.floor(Math.log(v) / Math.log(1024)));
+ const n = v / Math.pow(1024, i);
+ return (i === 0 ? Math.round(n).toString() : n.toFixed(1)) + ' ' + units[i];
+}
+
+export function niceCeil(x: number): number {
+ if (x <= 0) return 1;
+ const exp = Math.floor(Math.log10(x));
+ const base = Math.pow(10, exp);
+ const norm = x / base;
+ let step: number;
+ if (norm <= 1) step = 1;
+ else if (norm <= 2) step = 2;
+ else if (norm <= 2.5) step = 2.5;
+ else if (norm <= 5) step = 5;
+ else step = 10;
+ return step * base;
+}
+
+export function niceTicks(maxV: number, target = 5): { ticks: number[]; niceMax: number } {
+ const niceMax = niceCeil(maxV);
+ const rawStep = niceMax / target;
+ const exp = Math.floor(Math.log10(rawStep || 1));
+ const base = Math.pow(10, exp);
+ const norm = rawStep / base;
+ let step: number;
+ if (norm <= 1) step = 1 * base;
+ else if (norm <= 2) step = 2 * base;
+ else if (norm <= 2.5) step = 2.5 * base;
+ else if (norm <= 5) step = 5 * base;
+ else step = 10 * base;
+ const ticks: number[] = [];
+ for (let v = 0; v <= niceMax + 1e-9; v += step) ticks.push(v);
+ return { ticks, niceMax };
+}
+
+export function formatTime(epochSeconds: number): string {
+ const d = new Date(epochSeconds * 1000);
+ const hh = String(d.getHours()).padStart(2, '0');
+ const mm = String(d.getMinutes()).padStart(2, '0');
+ const ss = String(d.getSeconds()).padStart(2, '0');
+ return `${hh}:${mm}:${ss}`;
+}
+
+export function formatIsoShort(iso?: string): string {
+ if (!iso) return '—';
+ try {
+ const d = new Date(iso);
+ return d.toLocaleString(undefined, {
+ year: 'numeric',
+ month: 'short',
+ day: '2-digit',
+ hour: '2-digit',
+ minute: '2-digit'
+ });
+ } catch {
+ return iso;
+ }
+}
+
+// Robust Y max: scale to p98 so a single early spike doesn't squash the series
+// flat. Matches the previous chart's behaviour.
+export function robustMax(vals: number[]): number {
+ const sorted = vals.slice().sort((a, b) => a - b);
+ const p98 = sorted[Math.min(sorted.length - 1, Math.floor(sorted.length * 0.98))] || 0;
+ const rawMax = Math.max(...vals, 1);
+ return Math.max(1, p98 > 0 ? p98 : rawMax);
+}
diff --git a/dashboard-frontend/src/lib/icons.ts b/dashboard-frontend/src/lib/icons.ts
new file mode 100644
index 0000000..24db9d5
--- /dev/null
+++ b/dashboard-frontend/src/lib/icons.ts
@@ -0,0 +1,34 @@
+// SVG markup copied verbatim from templates.py so glyphs render identically.
+
+export const LOCK_BRAND =
+ '';
+
+export const SHIELD =
+ '';
+
+export const REFRESH =
+ '';
+
+export const CHEVRON =
+ '';
+
+export const FOLDER_ICON =
+ '';
+
+export const FILE_ICON =
+ '';
+
+export const LOCK_ICON =
+ '';
+
+export const ICON_REQUESTS =
+ '';
+
+export const ICON_LOCK =
+ '';
+
+export const ICON_ERR =
+ '';
+
+export const ICON_BUCKET =
+ '';
diff --git a/dashboard-frontend/src/lib/route.ts b/dashboard-frontend/src/lib/route.ts
new file mode 100644
index 0000000..b8e0843
--- /dev/null
+++ b/dashboard-frontend/src/lib/route.ts
@@ -0,0 +1,54 @@
+// Hash routing ported verbatim from the inline dashboard JS:
+// #, #logs, #logs&q=..&op=..&status=..,
+// #metric=KEY, #bucket=X, #bucket=X&prefix=P/, #bucket=X&object=Y
+
+export type Route =
+ | { view: 'dashboard' }
+ | { view: 'logs'; q: string; op: string; status: string }
+ | { view: 'metric'; metric: string }
+ | { view: 'bucket'; bucket: string; prefix: string }
+ | { view: 'object'; bucket: string; object: string };
+
+export function parseHash(hash: string): Route {
+ const h = (hash || '').replace(/^#/, '');
+ if (!h) return { view: 'dashboard' };
+ if (h === 'logs' || h.startsWith('logs&') || h.startsWith('logs?')) {
+ const body = h.replace(/^logs[&?]?/, '');
+ const params = new URLSearchParams(body);
+ return {
+ view: 'logs',
+ q: params.get('q') || '',
+ op: params.get('op') || '',
+ status: params.get('status') || ''
+ };
+ }
+ if (h.startsWith('metric=')) {
+ const metric = h.substring('metric='.length);
+ // Only these metrics have a chart detail view. active_buckets was removed;
+ // anything unknown falls through to the dashboard.
+ if (metric === 'requests' || metric === 'data_encrypted' || metric === 'errors') {
+ return { view: 'metric', metric };
+ }
+ return { view: 'dashboard' };
+ }
+ const params = new URLSearchParams(h);
+ const bucket = params.get('bucket');
+ const object = params.get('object');
+ const prefix = params.get('prefix') || '';
+ if (bucket && object) return { view: 'object', bucket, object };
+ if (bucket) return { view: 'bucket', bucket, prefix };
+ return { view: 'dashboard' };
+}
+
+export function bucketHref(bucket: string): string {
+ return `#bucket=${encodeURIComponent(bucket)}`;
+}
+export function prefixHref(bucket: string, prefix: string): string {
+ return `#bucket=${encodeURIComponent(bucket)}&prefix=${encodeURIComponent(prefix)}`;
+}
+export function objectHref(bucket: string, object: string): string {
+ return `#bucket=${encodeURIComponent(bucket)}&object=${encodeURIComponent(object)}`;
+}
+export function metricHref(key: string): string {
+ return `#metric=${key}`;
+}
diff --git a/dashboard-frontend/src/lib/status.svelte.ts b/dashboard-frontend/src/lib/status.svelte.ts
new file mode 100644
index 0000000..dbdbee0
--- /dev/null
+++ b/dashboard-frontend/src/lib/status.svelte.ts
@@ -0,0 +1,72 @@
+import { fetchStatus, LOGIN_URL, STREAM_URL } from './api';
+import type { StatusPayload } from './types';
+
+// Live status feed. SSE pushes the full payload on change + heartbeats; we also
+// do one immediate fetch so the UI paints while the stream connects, exactly as
+// the old dashboard did. Backoff on stream error caps at 15s.
+
+class StatusFeed {
+ current = $state(null);
+ // 'pending' until the first status fetch resolves; 'ok' once authenticated.
+ // The page gates its chrome on this so an unauthenticated visit redirects to
+ // the login page instead of flashing an empty dashboard.
+ auth = $state<'pending' | 'ok'>('pending');
+
+ #es: EventSource | null = null;
+ #retry = 0;
+ #started = false;
+
+ start() {
+ if (this.#started) return;
+ this.#started = true;
+ void this.refresh();
+ this.#connect();
+ }
+
+ stop() {
+ this.#started = false;
+ if (this.#es) {
+ this.#es.close();
+ this.#es = null;
+ }
+ }
+
+ async refresh() {
+ try {
+ this.current = await fetchStatus();
+ this.auth = 'ok';
+ } catch {
+ // 401 has already navigated to the login page (see api.ts toLogin()).
+ // Transient errors are ignored — the SSE stream / next refresh retries.
+ }
+ }
+
+ #connect() {
+ if (this.#es) return;
+ try {
+ this.#es = new EventSource(STREAM_URL, { withCredentials: true });
+ } catch {
+ setTimeout(() => this.#connect(), 3000);
+ return;
+ }
+ this.#es.addEventListener('status', (e) => {
+ this.#retry = 0;
+ try {
+ this.current = JSON.parse((e as MessageEvent).data) as StatusPayload;
+ } catch {
+ /* ignore malformed frame */
+ }
+ });
+ this.#es.onerror = () => {
+ if (this.#es) {
+ this.#es.close();
+ this.#es = null;
+ }
+ const delay = Math.min(1000 * Math.pow(2, this.#retry++), 15000);
+ setTimeout(() => this.#connect(), delay);
+ };
+ }
+}
+
+export const statusFeed = new StatusFeed();
+export { LOGIN_URL };
diff --git a/dashboard-frontend/src/lib/types.ts b/dashboard-frontend/src/lib/types.ts
new file mode 100644
index 0000000..5269f95
--- /dev/null
+++ b/dashboard-frontend/src/lib/types.ts
@@ -0,0 +1,124 @@
+// Shapes mirror the JSON returned by s3proxy/dashboard/router.py + collectors.py.
+// The frontend consumes these as-is; the backend is the contract.
+
+export interface Card {
+ label: string;
+ value: string;
+ unit?: string;
+ detail?: string;
+ spark?: number[];
+ y_label?: string;
+ breakdown?: BreakdownItem[];
+}
+
+export interface BreakdownItem {
+ label: string;
+ value: string;
+ weight?: number;
+}
+
+export interface ActivityRow {
+ time: string;
+ time_relative?: string;
+ operation: string;
+ bucket: string;
+ object: string;
+ status: string;
+ size: string;
+ client_ip: string;
+ latency: string;
+}
+
+export interface BucketRow {
+ name: string;
+ objects: string;
+ size: string;
+}
+
+export interface KeyRow {
+ id: string;
+ type: string;
+ status: string;
+ created: string;
+}
+
+export interface StatusPayload {
+ header: { title: string; status: string; uptime: string };
+ cards: {
+ requests: Card;
+ data_encrypted: Card;
+ errors: Card;
+ active_buckets: Card;
+ [key: string]: Card;
+ };
+ activity: ActivityRow[];
+ buckets: BucketRow[];
+ keys: KeyRow[];
+ footer: {
+ version: string;
+ req_per_s: string | number;
+ throughput: string;
+ last_error: string;
+ };
+}
+
+export interface SeriesPayload {
+ spark: number[];
+ spark_times: number[];
+}
+
+export interface LogEntry {
+ time: string;
+ time_relative?: string;
+ operation: string;
+ bucket: string;
+ object: string;
+ status: string;
+ status_code: number;
+ size: string;
+ client_ip: string;
+ latency: string;
+}
+
+export interface LogsPayload {
+ entries: LogEntry[];
+ operations: string[];
+ total: number;
+ count: number;
+ offset: number;
+ has_more: boolean;
+}
+
+export interface BucketFolder {
+ name?: string;
+ prefix: string;
+}
+
+export interface BucketObject {
+ key: string;
+ name?: string;
+ encrypted: boolean | null;
+ size_h?: string;
+ last_modified?: string;
+}
+
+export interface BucketPayload {
+ folders: BucketFolder[];
+ objects: BucketObject[];
+ total_objects: number | null;
+ offset: number;
+ has_more: boolean;
+ is_truncated: boolean;
+}
+
+export interface ObjectDetail {
+ bucket: string;
+ key: string;
+ size_h: string;
+ content_type?: string;
+ etag?: string;
+ last_modified?: string;
+ encrypted: boolean;
+ encryption_source?: string;
+ metadata?: Record;
+}
diff --git a/dashboard-frontend/src/routes/+layout.svelte b/dashboard-frontend/src/routes/+layout.svelte
new file mode 100644
index 0000000..4a8492b
--- /dev/null
+++ b/dashboard-frontend/src/routes/+layout.svelte
@@ -0,0 +1,7 @@
+
+
+{@render children()}
diff --git a/dashboard-frontend/src/routes/+layout.ts b/dashboard-frontend/src/routes/+layout.ts
new file mode 100644
index 0000000..5a962f3
--- /dev/null
+++ b/dashboard-frontend/src/routes/+layout.ts
@@ -0,0 +1,5 @@
+// Pure SPA: the dashboard is driven by a live JSON/SSE API and uses hash-based
+// in-page routing, so there is nothing to prerender or server-render. Emit a
+// single index.html (via adapter-static fallback) and run everything client-side.
+export const ssr = false;
+export const prerender = false;
diff --git a/dashboard-frontend/src/routes/+page.svelte b/dashboard-frontend/src/routes/+page.svelte
new file mode 100644
index 0000000..8902bd4
--- /dev/null
+++ b/dashboard-frontend/src/routes/+page.svelte
@@ -0,0 +1,64 @@
+
+
+{#if authed}
+
+
+
+ {#if route.view === 'dashboard'}
+
+ {:else if route.view === 'metric'}
+ {#key route.metric}
+
+ {/key}
+ {:else if route.view === 'bucket'}
+ {#key route.bucket + '|' + route.prefix}
+
+ {/key}
+ {:else if route.view === 'object'}
+ {#key route.bucket + '|' + route.object}
+
+ {/key}
+ {:else if route.view === 'logs'}
+ {#key route.q + '|' + route.op + '|' + route.status}
+
+ {/key}
+ {/if}
+
+
+
+{/if}
diff --git a/dashboard-frontend/src/routes/login/+page.svelte b/dashboard-frontend/src/routes/login/+page.svelte
new file mode 100644
index 0000000..23c7809
--- /dev/null
+++ b/dashboard-frontend/src/routes/login/+page.svelte
@@ -0,0 +1,50 @@
+
+
+
+ Sign in · S3 Encryption Proxy
+
+
+
+
+
diff --git a/dashboard-frontend/svelte.config.js b/dashboard-frontend/svelte.config.js
new file mode 100644
index 0000000..b81f99d
--- /dev/null
+++ b/dashboard-frontend/svelte.config.js
@@ -0,0 +1,23 @@
+import adapter from '@sveltejs/adapter-static';
+import { vitePreprocess } from '@sveltejs/vite-plugin-svelte';
+
+/** @type {import('@sveltejs/kit').Config} */
+const config = {
+ preprocess: vitePreprocess(),
+ kit: {
+ adapter: adapter({
+ pages: 'build',
+ assets: 'build',
+ fallback: 'index.html',
+ precompress: false,
+ strict: true
+ }),
+ // The dashboard is mounted under dashboard.path (default /dashboard) by the ingress.
+ // Built assets are served from there, so the app base must match.
+ paths: {
+ base: process.env.DASHBOARD_BASE_PATH ?? '/dashboard'
+ }
+ }
+};
+
+export default config;
diff --git a/dashboard-frontend/tsconfig.json b/dashboard-frontend/tsconfig.json
new file mode 100644
index 0000000..9f7eaae
--- /dev/null
+++ b/dashboard-frontend/tsconfig.json
@@ -0,0 +1,15 @@
+{
+ "extends": "./.svelte-kit/tsconfig.json",
+ "compilerOptions": {
+ "allowJs": true,
+ "checkJs": true,
+ "esModuleInterop": true,
+ "forceConsistentCasingInFileNames": true,
+ "resolveJsonModule": true,
+ "skipLibCheck": true,
+ "sourceMap": true,
+ "strict": true,
+ "moduleResolution": "bundler",
+ "types": ["node"]
+ }
+}
diff --git a/dashboard-frontend/vite.config.ts b/dashboard-frontend/vite.config.ts
new file mode 100644
index 0000000..bc70c4d
--- /dev/null
+++ b/dashboard-frontend/vite.config.ts
@@ -0,0 +1,24 @@
+import { sveltekit } from '@sveltejs/kit/vite';
+import { defineConfig } from 'vite';
+
+export default defineConfig({
+ plugins: [sveltekit()],
+ server: {
+ // Local dev: proxy the dashboard API + SSE to a running proxy instance so the
+ // app can use same-origin relative URLs exactly as it does in production.
+ proxy: {
+ '/dashboard/api': {
+ target: process.env.PROXY_ORIGIN ?? 'http://localhost:8000',
+ changeOrigin: true
+ },
+ '/dashboard/login': {
+ target: process.env.PROXY_ORIGIN ?? 'http://localhost:8000',
+ changeOrigin: true
+ },
+ '/dashboard/logout': {
+ target: process.env.PROXY_ORIGIN ?? 'http://localhost:8000',
+ changeOrigin: true
+ }
+ }
+ }
+});
diff --git a/e2e/docker-compose.yml b/e2e/docker-compose.yml
index 664bf2d..229c9f1 100644
--- a/e2e/docker-compose.yml
+++ b/e2e/docker-compose.yml
@@ -18,9 +18,9 @@ services:
privileged: true
depends_on:
- registry
- # Publish the s3proxy admin panel to the host. After the cluster is up, the
+ # Publish the s3proxy dashboard to the host. After the cluster is up, the
# entrypoint runs `kubectl port-forward` (on 0.0.0.0) onto container :14433,
- # so the dashboard is reachable at http://localhost:14433/admin (admin/admin).
+ # so the dashboard is reachable at http://localhost:14433/dashboard (admin/admin).
ports:
- "14433:14433"
volumes:
@@ -60,9 +60,13 @@ services:
echo "=== Starting parallel prep (docker build + helm + kind cluster) ==="
# 1. Docker builds (background, parallel)
- docker build -t s3proxy:latest /repo &
+ docker build -t s3proxy:latest -f /repo/s3proxy/Dockerfile /repo &
BUILD_PID=$$!
+ # Dashboard image (Svelte static build served by nginx)
+ docker build -t s3proxy-dashboard:latest /repo/dashboard-frontend &
+ DASHBOARD_BUILD_PID=$$!
+
# Build esrally image with dependencies pre-installed (parallel)
# Pinned to 3.12 because yappi (esrally dep) has no 3.14 wheel yet
(
@@ -402,6 +406,8 @@ services:
echo "=== Waiting for docker builds ==="
wait $$BUILD_PID || { echo "s3proxy build failed"; exit 1; }
echo "✓ s3proxy build complete"
+ wait $$DASHBOARD_BUILD_PID || { echo "dashboard build failed"; exit 1; }
+ echo "✓ dashboard build complete"
wait $$ESRALLY_BUILD_PID || { echo "esrally build failed"; exit 1; }
echo "✓ esrally build complete"
wait $$MC_BUILD_PID || { echo "mc build failed"; exit 1; }
@@ -410,7 +416,7 @@ services:
# 4. Load locally built images into Kind (only custom images, rest uses registry cache)
echo "=== Loading locally built images into Kind ==="
- kind load docker-image s3proxy:latest esrally:latest mc:latest --name db-backup-test
+ kind load docker-image s3proxy:latest s3proxy-dashboard:latest esrally:latest mc:latest --name db-backup-test
echo "✓ Local images loaded"
kubectl create namespace s3proxy 2>/dev/null || true
@@ -446,11 +452,14 @@ services:
--set secrets.credentials[0].accessKey="minioadmin" \
--set secrets.credentials[0].secretKey="minioadmin" \
--set secrets.credentials[0].kek="$$ENCRYPT_KEY" \
- --set admin.secret="$$ENCRYPT_KEY" \
+ --set dashboard.secret="$$ENCRYPT_KEY" \
--set logLevel="DEBUG" \
--set performance.memoryLimitMb=64 \
--set frontproxy.enabled=true \
- --set admin.enabled=true \
+ --set dashboard.enabled=true \
+ --set dashboard.frontend.image.repository=s3proxy-dashboard \
+ --set dashboard.frontend.image.tag=latest \
+ --set dashboard.frontend.image.pullPolicy=IfNotPresent \
--set redis.enabled=true \
--set redis.auth.enabled=true \
--set redis.auth.password=testredispassword &
@@ -475,18 +484,19 @@ services:
kubectl get pods -n s3proxy
kubectl get svc -n s3proxy
- # Expose the s3proxy admin panel to the host. The container publishes
- # :14433; this self-healing forward maps it to the in-cluster service so
- # the dashboard is reachable at http://localhost:14433/admin on the host.
+ # Expose the s3proxy dashboard to the host. The dashboard is served
+ # by the dashboard Deployment's nginx, which also reverse-proxies the API +
+ # SSE to the proxy service — so a single forward to the dashboard service
+ # makes the whole dashboard reachable at http://localhost:14433/dashboard.
( while true; do
- kubectl port-forward -n s3proxy --address 0.0.0.0 svc/s3proxy-python 14433:4433 >/dev/null 2>&1 || true
+ kubectl port-forward -n s3proxy --address 0.0.0.0 svc/s3proxy-python-dashboard 14433:80 >/dev/null 2>&1 || true
sleep 2
done ) &
echo ""
echo "S3 Proxy endpoint for databases: http://s3proxy-python-frontproxy.s3proxy.svc.cluster.local:80"
echo "Direct MinIO (unencrypted): http://minio.minio.svc.cluster.local:9000"
- echo "Admin panel (host browser): http://localhost:14433/admin (login: admin / admin)"
+ echo "Dashboard (host browser): http://localhost:14433/dashboard (login: admin / admin)"
echo ""
echo "=========================================="
diff --git a/e2e/scripts/verify-encryption-k8s.sh b/e2e/scripts/verify-encryption-k8s.sh
index 4501785..a4fc31f 100755
--- a/e2e/scripts/verify-encryption-k8s.sh
+++ b/e2e/scripts/verify-encryption-k8s.sh
@@ -2,24 +2,24 @@
# Kubernetes wrapper for encryption verification
# Source this script and call: verify_encryption
-# Assert the admin dashboard reports a MULTIPART object as encrypted (issue #47
+# Assert the dashboard reports a MULTIPART object as encrypted (issue #47
# #6). Multipart objects keep their wrapped DEK in a sidecar, not an on-object
-# tag, so the admin API must consult the sidecar. The byte-level verify_encryption
+# tag, so the dashboard API must consult the sidecar. The byte-level verify_encryption
# above can't catch a mislabel in the dashboard — this closes that gap.
#
-# verify_admin_encryption
+# verify_dashboard_encryption
# Picks a real multipart backup object (ETag ending in "-") and asserts the
-# admin object-detail API returns "encrypted": true for it.
-verify_admin_encryption() {
+# dashboard object-detail API returns "encrypted": true for it.
+verify_dashboard_encryption() {
local BUCKET="$1"
local NAMESPACE="${2:-default}"
- echo "=== Admin Encryption-Status Check (multipart) ==="
+ echo "=== Dashboard Encryption-Status Check (multipart) ==="
# Find a multipart object via MinIO: a *-big-Data.db SSTable, which Scylla
# uploads as a multipart object (ETag ends in -). Skip sidecars.
local KEY
- KEY=$(kubectl run admin-enc-find --namespace minio --rm -i --restart=Never \
+ KEY=$(kubectl run dashboard-enc-find --namespace minio --rm -i --restart=Never \
--image=mc:latest --image-pull-policy=Never --command -- /bin/sh -c "
mc alias set m http://minio.minio.svc.cluster.local:9000 minioadmin minioadmin >/dev/null 2>&1
mc ls -r m/$BUCKET 2>/dev/null | awk '{print \$NF}' \
@@ -32,8 +32,8 @@ verify_admin_encryption() {
fi
echo "Multipart object: $KEY"
- # Query the admin object-detail API from inside an s3proxy pod (which has
- # Python + reaches its own admin API on localhost). The {key:path} route
+ # Query the dashboard object-detail API from inside an s3proxy pod (which has
+ # Python + reaches its own dashboard API on localhost). The {key:path} route
# takes the slashed key verbatim.
local POD
POD=$(kubectl get pod -n "$NAMESPACE" -l app.kubernetes.io/name=s3proxy-python \
@@ -42,18 +42,18 @@ verify_admin_encryption() {
RESP=$(kubectl exec -n "$NAMESPACE" "$POD" -- python -c "
import base64, json, urllib.request
key = '''$KEY'''
-url = 'http://localhost:4433/admin/api/objects/$BUCKET/' + key
+url = 'http://localhost:4433/dashboard/api/objects/$BUCKET/' + key
req = urllib.request.Request(url)
req.add_header('Authorization', 'Basic ' + base64.b64encode(b'admin:admin').decode())
print(urllib.request.urlopen(req, timeout=15).read().decode())
" 2>&1)
- echo "Admin response: $RESP"
+ echo "Dashboard response: $RESP"
if echo "$RESP" | grep -q '"encrypted": *true'; then
- echo "✓ Admin API reports multipart object encrypted"
+ echo "✓ Dashboard API reports multipart object encrypted"
return 0
fi
- echo "✗ Admin API reported multipart object as NOT encrypted"
+ echo "✗ Dashboard API reported multipart object as NOT encrypted"
return 1
}
diff --git a/e2e/scylla/test.sh b/e2e/scylla/test.sh
index 1ffb001..456e012 100755
--- a/e2e/scylla/test.sh
+++ b/e2e/scylla/test.sh
@@ -200,9 +200,9 @@ log_info "Backup snapshot tag: $SNAPSHOT_TAG"
# Verify encryption
verify_encryption "scylla-backups" "" "$NAMESPACE" || log_warn "Encryption check skipped"
-# Verify the admin dashboard correctly reports multipart backup objects as
+# Verify the dashboard correctly reports multipart backup objects as
# encrypted (issue #47 #6 — sidecar-aware detection).
-verify_admin_encryption "scylla-backups" "$NAMESPACE" || log_warn "Admin encryption check skipped"
+verify_dashboard_encryption "scylla-backups" "$NAMESPACE" || log_warn "Dashboard encryption check skipped"
# ============================================================================
# STEP 4: Delete cluster
diff --git a/pyproject.toml b/pyproject.toml
index a65dd38..ad685e6 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -70,10 +70,6 @@ target-version = "py314"
[tool.ruff.lint]
select = ["E", "F", "I", "N", "W", "UP", "B", "C4", "SIM"]
-[tool.ruff.lint.per-file-ignores]
-# Inline HTML/CSS/JS template has unavoidably long lines
-"s3proxy/admin/templates.py" = ["E501"]
-
[tool.pytest.ini_options]
asyncio_mode = "auto"
testpaths = ["tests"]
diff --git a/Dockerfile b/s3proxy/Dockerfile
similarity index 100%
rename from Dockerfile
rename to s3proxy/Dockerfile
diff --git a/s3proxy/admin/__init__.py b/s3proxy/admin/__init__.py
deleted file mode 100644
index 1534196..0000000
--- a/s3proxy/admin/__init__.py
+++ /dev/null
@@ -1,6 +0,0 @@
-"""Admin dashboard for S3Proxy."""
-
-from .collectors import record_request
-from .router import create_admin_router
-
-__all__ = ["create_admin_router", "record_request"]
diff --git a/s3proxy/admin/auth.py b/s3proxy/admin/auth.py
deleted file mode 100644
index eb54f48..0000000
--- a/s3proxy/admin/auth.py
+++ /dev/null
@@ -1,160 +0,0 @@
-"""Auth for admin dashboard — session cookies + Basic Auth fallback."""
-
-from __future__ import annotations
-
-import base64
-import binascii
-import hashlib
-import hmac
-import json
-import secrets
-import time
-from typing import TYPE_CHECKING
-
-from fastapi import Depends, HTTPException, Request, status
-from fastapi.responses import RedirectResponse
-from fastapi.security import HTTPBasic, HTTPBasicCredentials
-
-if TYPE_CHECKING:
- from ..config import Settings
-
-SESSION_COOKIE = "s3proxy_session"
-SESSION_TTL_SECONDS = 24 * 3600
-_BASIC_REALM = "S3Proxy Admin"
-
-
-class AdminCredentials:
- """Resolved admin credentials with session-signing key."""
-
- def __init__(self, settings: Settings, credentials_store: dict[str, str]):
- if not (settings.admin_username and settings.admin_password):
- raise RuntimeError(
- "Admin dashboard requires S3PROXY_ADMIN_USERNAME and S3PROXY_ADMIN_PASSWORD"
- )
- self.username = settings.admin_username
- self.password = settings.admin_password
- # Stable session-signing secret (survives pod restarts, shared across replicas).
- self.session_secret = settings.admin_session_secret
-
- def valid(self, username: str, password: str) -> bool:
- return secrets.compare_digest(username.encode(), self.username.encode()) and (
- secrets.compare_digest(password.encode(), self.password.encode())
- )
-
-
-# ---------------------------------------------------------------------------
-# Session cookie — base64(json({u, exp})) "." hex(hmac-sha256)
-# ---------------------------------------------------------------------------
-
-
-def _b64url_encode(data: bytes) -> str:
- return base64.urlsafe_b64encode(data).rstrip(b"=").decode("ascii")
-
-
-def _b64url_decode(s: str) -> bytes:
- padding = "=" * ((4 - len(s) % 4) % 4)
- return base64.urlsafe_b64decode(s + padding)
-
-
-def issue_session(username: str, secret: bytes, ttl: int = SESSION_TTL_SECONDS) -> str:
- payload = {"u": username, "e": int(time.time()) + ttl}
- body = _b64url_encode(json.dumps(payload, separators=(",", ":")).encode())
- mac = hmac.new(secret, body.encode(), hashlib.sha256).hexdigest()
- return f"{body}.{mac}"
-
-
-def verify_session(token: str, secret: bytes) -> str | None:
- if not token or "." not in token:
- return None
- body, _, mac = token.rpartition(".")
- try:
- expected = hmac.new(secret, body.encode(), hashlib.sha256).hexdigest()
- if not hmac.compare_digest(mac, expected):
- return None
- payload = json.loads(_b64url_decode(body))
- except ValueError, binascii.Error, json.JSONDecodeError:
- return None
- if int(payload.get("e", 0)) < int(time.time()):
- return None
- return str(payload.get("u", ""))
-
-
-# ---------------------------------------------------------------------------
-# Dependencies
-# ---------------------------------------------------------------------------
-
-
-_basic_security = HTTPBasic(realm=_BASIC_REALM, auto_error=False)
-_basic_dep = Depends(_basic_security)
-
-
-def _check_basic(creds: HTTPBasicCredentials | None, admin: AdminCredentials) -> str | None:
- if creds is None:
- return None
- return admin.username if admin.valid(creds.username, creds.password) else None
-
-
-def _check_cookie(request: Request, admin: AdminCredentials) -> str | None:
- token = request.cookies.get(SESSION_COOKIE)
- if not token:
- return None
- return verify_session(token, admin.session_secret)
-
-
-def make_verify_html(admin: AdminCredentials, login_url: str):
- """Auth dep for HTML routes — redirects to login_url if not logged in."""
-
- async def verify(
- request: Request,
- creds: HTTPBasicCredentials | None = _basic_dep,
- ) -> str:
- user = _check_cookie(request, admin) or _check_basic(creds, admin)
- if user:
- return user
- raise HTTPException(
- status_code=status.HTTP_303_SEE_OTHER,
- headers={"Location": login_url},
- )
-
- return verify
-
-
-def make_verify_api(admin: AdminCredentials):
- """Auth dep for JSON API routes — returns 401 if not logged in."""
-
- async def verify(
- request: Request,
- creds: HTTPBasicCredentials | None = _basic_dep,
- ) -> str:
- user = _check_cookie(request, admin) or _check_basic(creds, admin)
- if user:
- return user
- raise HTTPException(
- status_code=status.HTTP_401_UNAUTHORIZED,
- detail="Not authenticated",
- headers={"WWW-Authenticate": f'Basic realm="{_BASIC_REALM}"'},
- )
-
- return verify
-
-
-def set_session_cookie(response: RedirectResponse, token: str, secure: bool) -> None:
- response.set_cookie(
- SESSION_COOKIE,
- token,
- max_age=SESSION_TTL_SECONDS,
- httponly=True,
- samesite="strict",
- secure=secure,
- path="/",
- )
-
-
-def clear_session_cookie(response: RedirectResponse) -> None:
- response.delete_cookie(SESSION_COOKIE, path="/")
-
-
-# Backwards-compat helper for existing tests.
-def create_auth_dependency(settings: Settings, credentials_store: dict[str, str]):
- admin = AdminCredentials(settings, credentials_store)
- return make_verify_api(admin)
diff --git a/s3proxy/admin/templates.py b/s3proxy/admin/templates.py
deleted file mode 100644
index 21e11fb..0000000
--- a/s3proxy/admin/templates.py
+++ /dev/null
@@ -1,1927 +0,0 @@
-"""HTML templates for the admin dashboard — login + dashboard."""
-
-from __future__ import annotations
-
-from html import escape as _esc
-
-_SHARED_CSS = """
- :root {
- --bg: #fafafa;
- --surface: #ffffff;
- --border: #e5e7eb;
- --border-strong: #d1d5db;
- --text: #111827;
- --text-muted: #6b7280;
- --text-subtle: #9ca3af;
- --ok: #10b981;
- --ok-bg: #ecfdf5;
- --err: #ef4444;
- --err-bg: #fef2f2;
- --dark: #111827;
- --icon-bg: #f3f4f6;
- --accent: #2563eb;
- --accent-soft: rgba(37,99,235,0.12);
- --accent-softer: rgba(37,99,235,0.04);
- }
- * { box-sizing: border-box; }
- html, body {
- margin: 0;
- background: var(--bg);
- color: var(--text);
- font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI",
- Helvetica, Arial, sans-serif;
- font-size: 14px;
- line-height: 1.4;
- -webkit-font-smoothing: antialiased;
- }
- a { color: inherit; }
- .brand-mark {
- width: 40px; height: 40px;
- background: var(--dark);
- border-radius: 10px;
- display: flex; align-items: center; justify-content: center;
- flex-shrink: 0;
- }
- .brand-mark svg { color: #fff; }
- .brand-name { font-size: 20px; font-weight: 600; letter-spacing: -0.01em; }
- .btn-dark {
- background: #111827; color: #fff;
- border: none; border-radius: 8px;
- padding: 8px 14px; font-size: 13px; font-weight: 500;
- cursor: pointer;
- }
- .btn-dark:hover { background: #1f2937; }
- .btn-dark:disabled { opacity: .6; cursor: not-allowed; }
- .btn-ghost {
- background: transparent; color: var(--text);
- border: 1px solid var(--border-strong);
- border-radius: 8px; padding: 5px 10px;
- font-size: 12px; cursor: pointer;
- display: inline-flex; align-items: center; gap: 4px;
- }
- .btn-ghost:hover { background: var(--icon-bg); }
-"""
-
-
-_LOGIN_HTML = """
-
-
-
-
-Sign in · S3 Encryption Proxy
-
-
-
-
-
-
-
-
-"""
-
-
-_DASHBOARD_HTML = """
-
-
-
-
-S3 Encryption Proxy
-
-
-
-
-
-
-
-
-
-
-
S3 Encryption Proxy
-
-
-
Running
-
Uptime: —
-
Signed in · Logout
-
-
-
-
-
-
- __CARD_REQUESTS__
- __CARD_DATA__
- __CARD_ERRORS__
- __CARD_BUCKETS__
-
-
-
-
-
-
-
-
-
- | Name | Objects (seen) | Size |
-
-
- | No buckets observed yet. |
-
-
-
-
-
-
-
-
- | Key ID | Type | Status | Created |
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- | Name |
- Encryption |
- Size |
- Last Modified |
-
-
-
- | Loading… |
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-"""
-
-
-def _card_html(num: str, label: str, icon_svg: str, key: str) -> str:
- return f"""
-
-
-
- {icon_svg}
- {label}
-
-
-
- —
-
-
-
- """
-
-
-_ICON_REQUESTS = (
- ''
-)
-_ICON_LOCK = (
- ''
-)
-_ICON_ERR = (
- ''
-)
-_ICON_BUCKET = (
- ''
-)
-
-
-def render_dashboard(admin_path: str = "/admin") -> str:
- """Render the dashboard HTML with API URLs + logout link substituted."""
- prefix = admin_path.rstrip("/")
- html = _DASHBOARD_HTML
- html = html.replace("__SHARED_CSS__", _SHARED_CSS)
- html = html.replace("__STATUS_URL__", f"{prefix}/api/status")
- html = html.replace("__STREAM_URL__", f"{prefix}/api/stream")
- html = html.replace("__BUCKET_URL__", f"{prefix}/api/buckets")
- html = html.replace("__OBJECT_URL__", f"{prefix}/api/objects")
- html = html.replace("__LOGS_URL__", f"{prefix}/api/logs")
- html = html.replace("__SERIES_URL__", f"{prefix}/api/series")
- html = html.replace("__LOGIN_URL__", f"{prefix}/login")
- html = html.replace("__LOGOUT_URL__", f"{prefix}/logout")
- html = html.replace(
- "__CARD_REQUESTS__", _card_html("1", "Requests", _ICON_REQUESTS, "requests")
- )
- html = html.replace(
- "__CARD_DATA__", _card_html("2", "Data Encrypted", _ICON_LOCK, "data_encrypted")
- )
- html = html.replace("__CARD_ERRORS__", _card_html("3", "Errors", _ICON_ERR, "errors"))
- html = html.replace(
- "__CARD_BUCKETS__", _card_html("4", "Active Buckets", _ICON_BUCKET, "active_buckets")
- )
- return html
-
-
-def render_login(admin_path: str = "/admin", error: str | None = None) -> str:
- """Render the sign-in page."""
- prefix = admin_path.rstrip("/")
- error_block = (
- f'{_esc(_login_error_text(error))}
' if error else ""
- )
- html = _LOGIN_HTML
- html = html.replace("__SHARED_CSS__", _SHARED_CSS)
- html = html.replace("__LOGIN_ACTION__", f"{prefix}/login")
- html = html.replace("__ERROR_BLOCK__", error_block)
- return html
-
-
-def _login_error_text(err: str) -> str:
- mapping = {"1": "Invalid username or password."}
- return mapping.get(err, "Sign in failed. Please try again.")
diff --git a/s3proxy/app.py b/s3proxy/app.py
index e64a512..d0952ce 100644
--- a/s3proxy/app.py
+++ b/s3proxy/app.py
@@ -64,13 +64,19 @@ async def lifespan(app: FastAPI) -> AsyncIterator[None]:
ttl_seconds=settings.redis_upload_ttl_seconds,
)
- # Admin stats store — Redis-backed (cluster-wide) when Redis is
+ # Dashboard stats store — Redis-backed (cluster-wide) when Redis is
# configured, else per-pod in-memory. Mirrors create_state_store().
- from .admin.stats_store import create_stats_store, set_store
+ from .dashboard.stats_store import create_stats_store, set_store
stats_store = create_stats_store(settings)
set_store(stats_store) # used by the synchronous record_request path
+ if settings.dashboard_ui:
+ from .dashboard.auth import RedisSessionStore
+ from .state.redis import get_redis
+
+ app.state.session_store = RedisSessionStore(get_redis())
+
# Create handler and verifier with properly initialized manager
verifier = SigV4Verifier(credentials_store)
handler = S3ProxyHandler(settings, credentials_store, multipart_manager)
@@ -108,12 +114,12 @@ def create_app(settings: Settings | None = None) -> FastAPI:
_register_exception_handlers(app)
- if settings.admin_ui:
- from .admin import create_admin_router
+ if settings.dashboard_ui:
+ from .dashboard import create_dashboard_router
app.include_router(
- create_admin_router(settings, credentials_store),
- prefix=settings.admin_path,
+ create_dashboard_router(settings, credentials_store),
+ prefix=settings.dashboard_path,
)
_register_routes(app)
@@ -128,7 +134,7 @@ def _register_exception_handlers(app: FastAPI) -> None:
async def s3_exception_handler(request: Request, exc: HTTPException):
"""Return S3-compatible error response with request ID.
- Non-S3 exceptions that carry their own headers (e.g. admin auth 401 with
+ Non-S3 exceptions that carry their own headers (e.g. dashboard auth 401 with
WWW-Authenticate) are passed through so browsers can prompt for credentials.
"""
if not isinstance(exc, S3Error) and getattr(exc, "headers", None):
@@ -177,7 +183,7 @@ async def health():
@app.get("/favicon.ico")
async def favicon() -> Response:
# Silence browser favicon probes so they don't fall through to the
- # S3 catch-all and pollute the admin activity feed as a "bucket".
+ # S3 catch-all and pollute the dashboard activity feed as a "bucket".
return Response(status_code=204)
@app.get("/metrics")
diff --git a/s3proxy/config.py b/s3proxy/config.py
index 1c28435..dd0b8fb 100644
--- a/s3proxy/config.py
+++ b/s3proxy/config.py
@@ -1,7 +1,5 @@
"""Configuration management for S3Proxy."""
-import hashlib
-
from pydantic import BaseModel, Field, PrivateAttr
from pydantic_settings import BaseSettings, SettingsConfigDict
@@ -71,7 +69,7 @@ class Settings(BaseSettings):
default=24, description="TTL for upload state in Redis (hours)"
)
- # Admin stats store (Redis-backed cluster-wide dashboard state). Only used
+ # Dashboard stats store (Redis-backed cluster-wide dashboard state). Only used
# when Redis is configured; single-instance mode keeps per-pod in-memory.
request_log_cap: int = Field(
default=10000, description="Max request-log entries kept in the Redis capped list"
@@ -89,15 +87,16 @@ class Settings(BaseSettings):
# Logging
log_level: str = Field(default="INFO", description="Log level (DEBUG, INFO, WARNING, ERROR)")
- # Admin dashboard
- admin_ui: bool = Field(default=False, description="Enable the admin dashboard at admin_path")
- admin_path: str = Field(default="/admin", description="URL path prefix for the admin UI")
- admin_username: str = Field(default="", description="Admin dashboard username")
- admin_password: str = Field(default="", description="Admin dashboard password")
- admin_secret: str = Field(
- default="",
- description="Stable secret for signing admin session cookies (required when admin_ui)",
+ # Dashboard. The proxy serves the dashboard API + auth under dashboard_path;
+ # the UI is a Svelte static build served by its own deployment.
+ dashboard_ui: bool = Field(
+ default=False, description="Enable the dashboard API at dashboard_path"
+ )
+ dashboard_path: str = Field(
+ default="/dashboard", description="URL path prefix for the dashboard API"
)
+ dashboard_username: str = Field(default="", description="Dashboard username")
+ dashboard_password: str = Field(default="", description="Dashboard password")
# Cached KeyRing + credentials store (computed once in model_post_init).
_keyring: KeyRing = PrivateAttr()
@@ -113,14 +112,6 @@ def model_post_init(self, __context: object) -> None:
keys[entry.access_key] = derive_kek(entry.kek)
self._keyring = KeyRing(keys=keys)
- if self.admin_ui and not self.admin_secret:
- raise ValueError("S3PROXY_ADMIN_SECRET is required when the admin dashboard is enabled")
-
- @property
- def admin_session_secret(self) -> bytes:
- """Stable 32-byte secret for signing admin session cookies."""
- return hashlib.sha256(b"s3proxy-admin-session|" + self.admin_secret.encode()).digest()
-
@property
def keyring(self) -> KeyRing:
"""Get the KeyRing resolving per-access-key encryption keys."""
diff --git a/s3proxy/dashboard/__init__.py b/s3proxy/dashboard/__init__.py
new file mode 100644
index 0000000..06b9190
--- /dev/null
+++ b/s3proxy/dashboard/__init__.py
@@ -0,0 +1,6 @@
+"""Dashboard for S3Proxy."""
+
+from .collectors import record_request
+from .router import create_dashboard_router
+
+__all__ = ["create_dashboard_router", "record_request"]
diff --git a/s3proxy/dashboard/auth.py b/s3proxy/dashboard/auth.py
new file mode 100644
index 0000000..e73a872
--- /dev/null
+++ b/s3proxy/dashboard/auth.py
@@ -0,0 +1,129 @@
+"""Auth for dashboard — session cookies + Basic Auth fallback."""
+
+from __future__ import annotations
+
+import secrets
+from typing import TYPE_CHECKING
+
+from fastapi import Depends, HTTPException, Request, status
+from fastapi.responses import RedirectResponse
+from fastapi.security import HTTPBasic, HTTPBasicCredentials
+
+if TYPE_CHECKING:
+ from ..config import Settings
+
+SESSION_COOKIE = "s3proxy_session"
+SESSION_TTL_SECONDS = 24 * 3600
+_BASIC_REALM = "S3Proxy Dashboard"
+
+
+class RedisSessionStore:
+ """Redis-backed session store (HA / multi-replica mode)."""
+
+ _PREFIX = "s3proxy:session:"
+
+ def __init__(self, redis) -> None:
+ self._redis = redis
+
+ async def create(self, username: str, ttl: int = SESSION_TTL_SECONDS) -> str:
+ token = secrets.token_hex(32)
+ await self._redis.setex(f"{self._PREFIX}{token}", ttl, username.encode())
+ return token
+
+ async def get(self, token: str) -> str | None:
+ val = await self._redis.get(f"{self._PREFIX}{token}")
+ return val.decode() if val is not None else None
+
+ async def delete(self, token: str) -> None:
+ await self._redis.delete(f"{self._PREFIX}{token}")
+
+
+class DashboardCredentials:
+ """Resolved dashboard credentials."""
+
+ def __init__(self, settings: Settings, credentials_store: dict[str, str]):
+ if not (settings.dashboard_username and settings.dashboard_password):
+ raise RuntimeError(
+ "Dashboard requires S3PROXY_DASHBOARD_USERNAME and S3PROXY_DASHBOARD_PASSWORD"
+ )
+ self.username = settings.dashboard_username
+ self.password = settings.dashboard_password
+
+ def valid(self, username: str, password: str) -> bool:
+ return secrets.compare_digest(username.encode(), self.username.encode()) and (
+ secrets.compare_digest(password.encode(), self.password.encode())
+ )
+
+
+# ---------------------------------------------------------------------------
+# Dependencies
+# ---------------------------------------------------------------------------
+
+
+_basic_security = HTTPBasic(realm=_BASIC_REALM, auto_error=False)
+_basic_dep = Depends(_basic_security)
+
+
+def _check_basic(creds: HTTPBasicCredentials | None, dashboard: DashboardCredentials) -> str | None:
+ if creds is None:
+ return None
+ return dashboard.username if dashboard.valid(creds.username, creds.password) else None
+
+
+async def _check_cookie(request: Request, store) -> str | None:
+ token = request.cookies.get(SESSION_COOKIE)
+ if not token:
+ return None
+ return await store.get(token)
+
+
+def make_verify_api(dashboard: DashboardCredentials):
+ """Auth dep for JSON API routes — returns 401 if not logged in.
+
+ Only challenges with ``WWW-Authenticate: Basic`` when the caller is actually
+ doing Basic Auth (sent an ``Authorization`` header) — i.e. CLI/programmatic
+ clients like the e2e encryption check. Browser fetch/EventSource requests get
+ a plain 401 so the SPA can redirect to its own login page instead of the
+ browser popping up the native Basic Auth dialog.
+ """
+
+ async def verify(
+ request: Request,
+ creds: HTTPBasicCredentials | None = _basic_dep,
+ ) -> str:
+ store = request.app.state.session_store
+ user = await _check_cookie(request, store) or _check_basic(creds, dashboard)
+ if user:
+ return user
+ headers = {}
+ if request.headers.get("authorization"):
+ headers["WWW-Authenticate"] = f'Basic realm="{_BASIC_REALM}"'
+ raise HTTPException(
+ status_code=status.HTTP_401_UNAUTHORIZED,
+ detail="Not authenticated",
+ headers=headers,
+ )
+
+ return verify
+
+
+def set_session_cookie(response: RedirectResponse, token: str, secure: bool) -> None:
+ response.set_cookie(
+ SESSION_COOKIE,
+ token,
+ max_age=SESSION_TTL_SECONDS,
+ httponly=True,
+ samesite="strict",
+ secure=secure,
+ path="/",
+ )
+
+
+def clear_session_cookie(response: RedirectResponse) -> None:
+ response.delete_cookie(SESSION_COOKIE, path="/")
+
+
+# Backwards-compat helper for existing tests.
+def create_auth_dependency(settings: Settings, credentials_store: dict[str, str]):
+ dashboard = DashboardCredentials(settings, credentials_store)
+ return make_verify_api(dashboard)
diff --git a/s3proxy/admin/collectors.py b/s3proxy/dashboard/collectors.py
similarity index 99%
rename from s3proxy/admin/collectors.py
rename to s3proxy/dashboard/collectors.py
index ed4bddd..d23761d 100644
--- a/s3proxy/admin/collectors.py
+++ b/s3proxy/dashboard/collectors.py
@@ -1,4 +1,4 @@
-"""Data collectors for the admin dashboard."""
+"""Data collectors for the dashboard."""
from __future__ import annotations
@@ -549,7 +549,7 @@ async def list_bucket_objects(
# Per-object encryption status, the same check the object-detail view uses
# (on-object isec tag, else multipart sidecar). Run only on the current
- # page (≈page_size HEADs). These admin HEADs use this S3Client directly
+ # page (≈page_size HEADs). These dashboard HEADs use this S3Client directly
# (not the proxy), so they don't pollute the dashboard stats.
await _annotate_encryption(settings, client, bucket, objects)
diff --git a/s3proxy/admin/router.py b/s3proxy/dashboard/router.py
similarity index 76%
rename from s3proxy/admin/router.py
rename to s3proxy/dashboard/router.py
index 8c3ad8b..3004f71 100644
--- a/s3proxy/admin/router.py
+++ b/s3proxy/dashboard/router.py
@@ -1,4 +1,4 @@
-"""Admin dashboard router."""
+"""Dashboard router."""
from __future__ import annotations
@@ -9,14 +9,13 @@
from botocore.exceptions import ClientError
from fastapi import APIRouter, Depends, Form, HTTPException, Request, status
-from fastapi.responses import HTMLResponse, JSONResponse, RedirectResponse, StreamingResponse
+from fastapi.responses import JSONResponse, RedirectResponse, StreamingResponse
from .auth import (
- AdminCredentials,
+ SESSION_COOKIE,
+ DashboardCredentials,
clear_session_cookie,
- issue_session,
make_verify_api,
- make_verify_html,
set_session_cookie,
)
from .collectors import (
@@ -28,66 +27,54 @@
list_logs,
)
from .stats_store import DEFAULT_RANGE, RANGE_SPECS
-from .templates import render_dashboard, render_login
if TYPE_CHECKING:
from ..config import Settings
-def create_admin_router(
+def create_dashboard_router(
settings: Settings,
credentials_store: dict[str, str],
version: str = "1.0.0",
) -> APIRouter:
- """Build the admin dashboard router with session cookie + Basic Auth."""
- admin = AdminCredentials(settings, credentials_store)
- prefix = settings.admin_path.rstrip("/")
- login_url = f"{prefix}/login"
- verify_html = make_verify_html(admin, login_url)
- verify_api = make_verify_api(admin)
+ """Build the dashboard API router with session cookie + Basic Auth.
+
+ The dashboard UI is a Svelte static build served by its own deployment; the
+ proxy exposes only the JSON/SSE API plus form auth under ``{prefix}/api``.
+ That deployment's nginx serves the static UI and reverse-proxies
+ ``{prefix}/api`` here, so the login page is served statically and posts back
+ to ``{prefix}/api/login``.
+ """
+ dashboard = DashboardCredentials(settings, credentials_store)
+ prefix = settings.dashboard_path.rstrip("/")
+ verify_api = make_verify_api(dashboard)
cookie_secure = not settings.no_tls
router = APIRouter()
- # ---- Login / logout (unauthenticated) ------------------------------------
+ # ---- Auth (unauthenticated) ----------------------------------------------
- @router.get("/login", response_class=HTMLResponse)
- async def login_page(request: Request) -> HTMLResponse:
- error = request.query_params.get("error")
- return HTMLResponse(render_login(admin_path=settings.admin_path, error=error))
-
- @router.post("/login")
+ @router.post("/api/login")
async def login_submit(
- request: Request,
- username: str = Form(...),
- password: str = Form(...),
+ request: Request, username: str = Form(...), password: str = Form(...)
) -> RedirectResponse:
- if not admin.valid(username, password):
- dest = f"{settings.admin_path.rstrip('/')}/login?error=1"
+ if not dashboard.valid(username, password):
+ dest = f"{prefix}/login?error=1"
return RedirectResponse(dest, status_code=status.HTTP_303_SEE_OTHER)
- token = issue_session(username, admin.session_secret)
- response = RedirectResponse(
- settings.admin_path.rstrip("/") + "/",
- status_code=status.HTTP_303_SEE_OTHER,
- )
+ token = await request.app.state.session_store.create(username)
+ response = RedirectResponse(f"{prefix}/", status_code=status.HTTP_303_SEE_OTHER)
set_session_cookie(response, token, secure=cookie_secure)
return response
- @router.get("/logout")
- async def logout() -> RedirectResponse:
- response = RedirectResponse(
- settings.admin_path.rstrip("/") + "/login",
- status_code=status.HTTP_303_SEE_OTHER,
- )
+ @router.get("/api/logout")
+ async def logout(request: Request) -> RedirectResponse:
+ token = request.cookies.get(SESSION_COOKIE)
+ if token:
+ await request.app.state.session_store.delete(token)
+ response = RedirectResponse(f"{prefix}/login", status_code=status.HTTP_303_SEE_OTHER)
clear_session_cookie(response)
return response
- # ---- Authenticated routes ------------------------------------------------
-
- @router.get("/", response_class=HTMLResponse, dependencies=[Depends(verify_html)])
- async def dashboard() -> HTMLResponse:
- return HTMLResponse(render_dashboard(admin_path=settings.admin_path))
-
def _range(request: Request) -> str:
r = request.query_params.get("range", DEFAULT_RANGE)
return r if r in RANGE_SPECS else DEFAULT_RANGE
diff --git a/s3proxy/admin/stats_store.py b/s3proxy/dashboard/stats_store.py
similarity index 99%
rename from s3proxy/admin/stats_store.py
rename to s3proxy/dashboard/stats_store.py
index 490076c..322925a 100644
--- a/s3proxy/admin/stats_store.py
+++ b/s3proxy/dashboard/stats_store.py
@@ -1,4 +1,4 @@
-"""Stats store backends for the admin dashboard.
+"""Stats store backends for the dashboard.
Mirrors the Strategy Pattern in ``state/storage.py``: a ``StatsStore`` ABC with
an in-memory implementation (per-pod, the single-instance default) and a
@@ -311,7 +311,7 @@ async def record(self, sample: RequestSample) -> None:
pipe.expire(self._k("reqlog"), self._log_ttl)
# Per-request cluster-wide counters — incremented on every pod for
# every request, so the dashboard totals are correct regardless of
- # which pod serves the admin view (no per-pod Prometheus sampling).
+ # which pod serves the dashboard view (no per-pod Prometheus sampling).
c = self._k("counters")
pipe.hincrby(c, "requests", 1)
pipe.expire(c, self._stats_ttl)
diff --git a/s3proxy/request_handler.py b/s3proxy/request_handler.py
index 09f291f..6567e9d 100644
--- a/s3proxy/request_handler.py
+++ b/s3proxy/request_handler.py
@@ -13,7 +13,7 @@
from structlog.stdlib import BoundLogger
from . import concurrency, crypto
-from .admin import record_request
+from .dashboard import record_request
from .errors import S3Error, raise_for_client_error, raise_for_exception
from .handlers import S3ProxyHandler
from .metrics import (
@@ -33,17 +33,17 @@
STREAMING_PAYLOAD_PREFIX = "STREAMING-"
-def _is_admin_path(request: Request, path: str) -> bool:
- """True if the path targets the admin dashboard (so it's excluded from stats).
+def _is_dashboard_path(request: Request, path: str) -> bool:
+ """True if the path targets the dashboard (so it's excluded from stats).
- The admin router is mounted at settings.admin_path; requests there (including a
+ The dashboard router is mounted at settings.dashboard_path; requests there (including a
bare prefix with no trailing slash that misses the router and falls through to
the S3 catch-all) must not be recorded as proxied S3 traffic.
"""
settings = getattr(request.app.state, "settings", None)
- if settings is None or getattr(settings, "admin_ui", False) is not True:
+ if settings is None or getattr(settings, "dashboard_ui", False) is not True:
return False
- prefix = getattr(settings, "admin_path", "")
+ prefix = getattr(settings, "dashboard_path", "")
if not isinstance(prefix, str) or not prefix:
return False
prefix = prefix.rstrip("/")
@@ -134,6 +134,7 @@ async def handle_proxy_request(
path=path,
)
+ response = None
try:
response = await _handle_proxy_request_impl(request, handler, verifier)
if response is not None:
@@ -153,15 +154,18 @@ async def handle_proxy_request(
REQUEST_DURATION.labels(method=method, operation=operation).observe(duration)
try:
- size = int(request.headers.get("content-length", "0"))
+ if method == "GET" and response is not None:
+ size = int(response.headers.get("content-length", "0"))
+ else:
+ size = int(request.headers.get("content-length", "0"))
except ValueError:
size = 0
client_ip = request.client.host if request.client else ""
# Don't record dashboard requests in the dashboard's own stats. A bare
- # "/admin" (no trailing slash) doesn't match the mounted admin router and
+ # "/dashboard" (no trailing slash) doesn't match the mounted dashboard router and
# falls through to this S3 catch-all, where it would otherwise be logged
- # as a phantom "admin" bucket.
- if not _is_admin_path(request, path):
+ # as a phantom "dashboard" bucket.
+ if not _is_dashboard_path(request, path):
await record_request(method, path, operation, status_code, duration, size, client_ip)
if reserved_memory > 0:
diff --git a/tests/docker-compose.yml b/tests/docker-compose.yml
index 58a1b47..f39f02a 100644
--- a/tests/docker-compose.yml
+++ b/tests/docker-compose.yml
@@ -20,7 +20,7 @@ services:
profiles: ["oom"]
build:
context: ../
- dockerfile: Dockerfile
+ dockerfile: s3proxy/Dockerfile
container_name: s3proxy-test-server
mem_limit: 256m
ports:
diff --git a/tests/unit/test_admin_path_filter.py b/tests/unit/test_admin_path_filter.py
deleted file mode 100644
index 1b74be4..0000000
--- a/tests/unit/test_admin_path_filter.py
+++ /dev/null
@@ -1,58 +0,0 @@
-"""The S3 catch-all must not record admin-dashboard requests as proxied traffic.
-
-A bare ``/admin`` (no trailing slash) misses the mounted admin router and falls
-through to the S3 catch-all, where it would be logged as a phantom "admin"
-bucket. _is_admin_path filters those out.
-"""
-
-from __future__ import annotations
-
-from types import SimpleNamespace
-
-from s3proxy.config import Settings
-from s3proxy.request_handler import _is_admin_path
-
-
-def _req(settings: Settings):
- return SimpleNamespace(app=SimpleNamespace(state=SimpleNamespace(settings=settings)))
-
-
-def _settings(**kw) -> Settings:
- base = {
- "host": "http://localhost:9000",
- "admin_ui": True,
- "admin_username": "admin",
- "admin_password": "admin",
- "admin_secret": "s",
- "credentials": [{"access_key": "AK", "secret_key": "s", "kek": "k"}],
- }
- base.update(kw)
- return Settings(**base)
-
-
-def test_bare_admin_prefix_is_filtered() -> None:
- r = _req(_settings())
- assert _is_admin_path(r, "/admin") is True
- assert _is_admin_path(r, "/admin/") is True
- assert _is_admin_path(r, "/admin/api/status") is True
-
-
-def test_real_buckets_are_not_filtered() -> None:
- r = _req(_settings())
- assert _is_admin_path(r, "/scylla-backups/obj.bin") is False
- assert _is_admin_path(r, "/my-bucket") is False
- # A bucket literally named "admin-data" must not be swallowed by prefix match.
- assert _is_admin_path(r, "/admin-data/key") is False
-
-
-def test_custom_admin_path() -> None:
- r = _req(_settings(admin_path="/ops/dash"))
- assert _is_admin_path(r, "/ops/dash") is True
- assert _is_admin_path(r, "/ops/dash/login") is True
- assert _is_admin_path(r, "/admin") is False # not the configured prefix
-
-
-def test_not_filtered_when_admin_ui_disabled() -> None:
- # admin_secret not required when admin_ui is off
- r = _req(_settings(admin_ui=False, admin_secret=""))
- assert _is_admin_path(r, "/admin") is False
diff --git a/tests/unit/test_admin.py b/tests/unit/test_dashboard.py
similarity index 67%
rename from tests/unit/test_admin.py
rename to tests/unit/test_dashboard.py
index 175af96..ab34843 100644
--- a/tests/unit/test_admin.py
+++ b/tests/unit/test_dashboard.py
@@ -1,4 +1,4 @@
-"""Tests for the admin dashboard."""
+"""Tests for the dashboard."""
from __future__ import annotations
@@ -8,45 +8,43 @@
from fastapi.testclient import TestClient
from s3proxy import metrics
-from s3proxy.admin import collectors, record_request
-from s3proxy.admin.auth import AdminCredentials, create_auth_dependency
-from s3proxy.admin.router import create_admin_router
-from s3proxy.admin.stats_store import (
+from s3proxy.config import Settings
+from s3proxy.dashboard import collectors, record_request
+from s3proxy.dashboard.auth import DashboardCredentials, create_auth_dependency
+from s3proxy.dashboard.router import create_dashboard_router
+from s3proxy.dashboard.stats_store import (
MemoryStatsStore,
RedisStatsStore,
RequestSample,
bucket_series,
set_store,
)
-from s3proxy.admin.templates import render_dashboard
-from s3proxy.config import Settings
@pytest.fixture
-def admin_settings():
+def dashboard_settings():
return Settings(
host="http://localhost:9000",
- admin_ui=True,
- admin_username="admin",
- admin_password="secret",
- admin_secret="test-admin-secret",
+ dashboard_ui=True,
+ dashboard_username="creds",
+ dashboard_password="secret",
credentials=[{"access_key": "AKIA-TEST", "secret_key": "s", "kek": "k"}],
)
@pytest.fixture
-def mem_store(admin_settings):
+def mem_store(dashboard_settings):
"""A fresh per-pod in-memory store, registered as the global record target."""
- store = MemoryStatsStore(admin_settings)
+ store = MemoryStatsStore(dashboard_settings)
set_store(store)
yield store
set_store(None)
@pytest.fixture
-def redis_store(admin_settings, mock_redis):
+def redis_store(dashboard_settings, mock_redis):
"""A Redis-backed store on fakeredis, registered as the global target."""
- store = RedisStatsStore(mock_redis, admin_settings)
+ store = RedisStatsStore(mock_redis, dashboard_settings)
set_store(store)
yield store
set_store(None)
@@ -71,7 +69,7 @@ async def test_record_request_splits_bucket_and_key(mem_store) -> None:
assert e.client_ip == "10.0.0.1"
-async def test_collect_all_builds_expected_sections(admin_settings, mem_store) -> None:
+async def test_collect_all_builds_expected_sections(dashboard_settings, mem_store) -> None:
await record_request(
"PUT", "/customer-data/invoice.pdf", "PutObject", 200, 0.05, 2048, "10.0.0.1"
)
@@ -79,7 +77,7 @@ async def test_collect_all_builds_expected_sections(admin_settings, mem_store) -
start = time.monotonic() - 120 # 2 minutes
data = await collectors.collect_all(
- mem_store, admin_settings, start_time=start, version="9.9.9"
+ mem_store, dashboard_settings, start_time=start, version="9.9.9"
)
assert data["header"]["title"] == "S3 Encryption Proxy"
@@ -104,18 +102,18 @@ async def test_collect_all_builds_expected_sections(admin_settings, mem_store) -
assert data["footer"]["version"] == "9.9.9"
-async def test_activity_timestamp_is_absolute(admin_settings, mem_store) -> None:
+async def test_activity_timestamp_is_absolute(dashboard_settings, mem_store) -> None:
await record_request("GET", "/b/k", "GetObject", 200, 0.01, 1, "10.0.0.1")
- data = await collectors.collect_all(mem_store, admin_settings, start_time=time.monotonic())
+ data = await collectors.collect_all(mem_store, dashboard_settings, start_time=time.monotonic())
row = data["activity"][0]
# Absolute "YYYY-MM-DD HH:MM:SS" primary display; relative kept as a tooltip.
assert row["time"][:2] == "20" and row["time"][4] == "-" and ":" in row["time"]
assert row["time_relative"].endswith("ago")
-async def test_collector_does_not_crash_on_empty_metrics(admin_settings, mem_store) -> None:
+async def test_collector_does_not_crash_on_empty_metrics(dashboard_settings, mem_store) -> None:
"""collect_all must work even before any request has been recorded."""
- data = await collectors.collect_all(mem_store, admin_settings, start_time=time.monotonic())
+ data = await collectors.collect_all(mem_store, dashboard_settings, start_time=time.monotonic())
expected = f"{int(collectors._read_labeled_counter_sum(metrics.REQUEST_COUNT)):,}"
assert data["cards"]["requests"]["value"] == expected
assert data["activity"] == []
@@ -154,9 +152,9 @@ async def test_redis_store_records_and_paginates(redis_store) -> None:
assert page3["has_more"] is False
-async def test_redis_store_caps_the_log(admin_settings, mock_redis) -> None:
- admin_settings.request_log_cap = 5
- store = RedisStatsStore(mock_redis, admin_settings)
+async def test_redis_store_caps_the_log(dashboard_settings, mock_redis) -> None:
+ dashboard_settings.request_log_cap = 5
+ store = RedisStatsStore(mock_redis, dashboard_settings)
for i in range(20):
await store.record(
RequestSample(time.time(), "GET", "GetObject", "b", f"k{i}", 200, 1.0, 1, "ip")
@@ -164,7 +162,7 @@ async def test_redis_store_caps_the_log(admin_settings, mock_redis) -> None:
total = await mock_redis.llen("s3proxy:stats:reqlog")
assert total == 5
ttl = await mock_redis.ttl("s3proxy:stats:reqlog")
- assert 0 < ttl <= admin_settings.request_log_ttl_seconds
+ assert 0 < ttl <= dashboard_settings.request_log_ttl_seconds
async def test_redis_store_filter_pagination(redis_store) -> None:
@@ -199,14 +197,14 @@ def _sample(method="GET", status=200, size=0, dur_ms=10.0):
)
-async def test_redis_store_cluster_wide_aggregate(admin_settings, mock_redis) -> None:
+async def test_redis_store_cluster_wide_aggregate(dashboard_settings, mock_redis) -> None:
"""Counters are written per-request by record() so they sum across pods.
Two store instances on the same Redis simulate two replicas — the aggregate
must reflect both, regardless of which pod serves the dashboard.
"""
- pod_a = RedisStatsStore(mock_redis, admin_settings)
- pod_b = RedisStatsStore(mock_redis, admin_settings)
+ pod_a = RedisStatsStore(mock_redis, dashboard_settings)
+ pod_b = RedisStatsStore(mock_redis, dashboard_settings)
# pod A handles 7 GET + 3 PUT (one PUT errors 500), pod B handles 5 GET (one 404)
for _ in range(7):
@@ -229,9 +227,9 @@ async def test_redis_store_cluster_wide_aggregate(admin_settings, mock_redis) ->
assert agg.bytes_decrypted == 7 * 100 + 5 * 50
-async def test_redis_store_latency_is_cluster_wide(admin_settings, mock_redis) -> None:
- pod_a = RedisStatsStore(mock_redis, admin_settings)
- pod_b = RedisStatsStore(mock_redis, admin_settings)
+async def test_redis_store_latency_is_cluster_wide(dashboard_settings, mock_redis) -> None:
+ pod_a = RedisStatsStore(mock_redis, dashboard_settings)
+ pod_b = RedisStatsStore(mock_redis, dashboard_settings)
for _ in range(10):
await pod_a.record(_sample(dur_ms=5.0)) # 0.005s bucket
for _ in range(10):
@@ -293,82 +291,62 @@ async def test_redis_throughput_split_by_direction(redis_store) -> None:
# ---------------------------------------------------------------------------
-def test_render_dashboard_injects_api_url() -> None:
- html = render_dashboard(admin_path="/ops")
- assert '"/ops/api/status"' in html
- assert '"/ops/api/series"' in html
- assert "__API_URL__" not in html
- assert "__SERIES_URL__" not in html
-
-
def _make_app(settings: Settings, store=None):
from fastapi import FastAPI
app = FastAPI()
- router = create_admin_router(settings, credentials_store={}, version="1.2.3")
- app.include_router(router, prefix=settings.admin_path)
+ router = create_dashboard_router(settings, credentials_store={}, version="1.2.3")
+ app.include_router(router, prefix=settings.dashboard_path)
app.state.settings = settings
app.state.start_time = time.monotonic()
app.state.stats_store = store or MemoryStatsStore(settings)
- return app
-
+ from s3proxy.dashboard.auth import RedisSessionStore
+ from s3proxy.state.redis import get_redis
-def test_dashboard_redirects_to_login_without_auth(admin_settings) -> None:
- client = TestClient(_make_app(admin_settings), follow_redirects=False)
- r = client.get("/admin/")
- assert r.status_code == 303
- assert r.headers["location"].endswith("/admin/login")
-
-
-def test_dashboard_html_served_with_basic_auth(admin_settings) -> None:
- client = TestClient(_make_app(admin_settings))
- r = client.get("/admin/", auth=("admin", "secret"))
- assert r.status_code == 200
- assert "S3 Encryption Proxy" in r.text
- assert "Recent Activity" in r.text
+ app.state.session_store = RedisSessionStore(get_redis())
+ return app
-def test_login_page_renders(admin_settings) -> None:
- client = TestClient(_make_app(admin_settings))
- r = client.get("/admin/login")
- assert r.status_code == 200
- assert "Sign in to the admin dashboard" in r.text
+def test_status_api_redirects_unauthenticated_to_401(dashboard_settings) -> None:
+ client = TestClient(_make_app(dashboard_settings), follow_redirects=False)
+ r = client.get("/dashboard/api/status")
+ assert r.status_code == 401
-def test_login_post_sets_cookie_and_redirects(admin_settings) -> None:
- client = TestClient(_make_app(admin_settings), follow_redirects=False)
- r = client.post("/admin/login", data={"username": "admin", "password": "secret"})
+def test_login_post_sets_cookie_and_redirects(dashboard_settings) -> None:
+ client = TestClient(_make_app(dashboard_settings), follow_redirects=False)
+ r = client.post("/dashboard/api/login", data={"username": "creds", "password": "secret"})
assert r.status_code == 303
- assert r.headers["location"].endswith("/admin/")
+ assert r.headers["location"].endswith("/dashboard/")
assert "s3proxy_session=" in r.headers.get("set-cookie", "")
-def test_login_post_rejects_bad_credentials(admin_settings) -> None:
- client = TestClient(_make_app(admin_settings), follow_redirects=False)
- r = client.post("/admin/login", data={"username": "admin", "password": "wrong"})
+def test_login_post_rejects_bad_credentials(dashboard_settings) -> None:
+ client = TestClient(_make_app(dashboard_settings), follow_redirects=False)
+ r = client.post("/dashboard/api/login", data={"username": "creds", "password": "wrong"})
assert r.status_code == 303
assert "error=1" in r.headers["location"]
-def test_session_cookie_authenticates_dashboard(admin_settings) -> None:
- client = TestClient(_make_app(admin_settings), follow_redirects=False)
- r = client.post("/admin/login", data={"username": "admin", "password": "secret"})
+def test_session_cookie_authenticates_api(dashboard_settings) -> None:
+ client = TestClient(_make_app(dashboard_settings), follow_redirects=False)
+ r = client.post("/dashboard/api/login", data={"username": "creds", "password": "secret"})
cookie = r.headers["set-cookie"].split(";")[0]
- r2 = client.get("/admin/", headers={"Cookie": cookie})
+ r2 = client.get("/dashboard/api/status", headers={"Cookie": cookie})
assert r2.status_code == 200
-def test_logout_clears_cookie(admin_settings) -> None:
- client = TestClient(_make_app(admin_settings), follow_redirects=False)
- r = client.get("/admin/logout")
+def test_logout_clears_cookie(dashboard_settings) -> None:
+ client = TestClient(_make_app(dashboard_settings), follow_redirects=False)
+ r = client.get("/dashboard/api/logout")
assert r.status_code == 303
- assert r.headers["location"].endswith("/admin/login")
+ assert r.headers["location"].endswith("/dashboard/login")
assert "s3proxy_session=" in r.headers.get("set-cookie", "")
-def test_status_api_returns_expected_shape(admin_settings) -> None:
- client = TestClient(_make_app(admin_settings))
- r = client.get("/admin/api/status", auth=("admin", "secret"))
+def test_status_api_returns_expected_shape(dashboard_settings) -> None:
+ client = TestClient(_make_app(dashboard_settings))
+ r = client.get("/dashboard/api/status", auth=("creds", "secret"))
assert r.status_code == 200
payload = r.json()
assert payload["header"]["status"] == "Running"
@@ -378,9 +356,9 @@ def test_status_api_returns_expected_shape(admin_settings) -> None:
assert "breakdown" in payload["cards"][key]
-def test_series_api_returns_shape(admin_settings) -> None:
- client = TestClient(_make_app(admin_settings))
- r = client.get("/admin/api/series?metric=requests&range=3h", auth=("admin", "secret"))
+def test_series_api_returns_shape(dashboard_settings) -> None:
+ client = TestClient(_make_app(dashboard_settings))
+ r = client.get("/dashboard/api/series?metric=requests&range=3h", auth=("creds", "secret"))
assert r.status_code == 200
payload = r.json()
assert payload["metric"] == "requests"
@@ -388,9 +366,9 @@ def test_series_api_returns_shape(admin_settings) -> None:
assert "spark" in payload and "spark_times" in payload
-def test_throughput_api_returns_two_series(admin_settings) -> None:
- client = TestClient(_make_app(admin_settings))
- r = client.get("/admin/api/throughput?range=24h", auth=("admin", "secret"))
+def test_throughput_api_returns_two_series(dashboard_settings) -> None:
+ client = TestClient(_make_app(dashboard_settings))
+ r = client.get("/dashboard/api/throughput?range=24h", auth=("creds", "secret"))
assert r.status_code == 200
payload = r.json()
assert payload["range"] == "24h"
@@ -400,42 +378,40 @@ def test_throughput_api_returns_two_series(admin_settings) -> None:
assert "spark" in s and "spark_times" in s
-def test_logs_api_paginates(admin_settings) -> None:
- client = TestClient(_make_app(admin_settings))
- r = client.get("/admin/api/logs?limit=10&offset=0", auth=("admin", "secret"))
+def test_logs_api_paginates(dashboard_settings) -> None:
+ client = TestClient(_make_app(dashboard_settings))
+ r = client.get("/dashboard/api/logs?limit=10&offset=0", auth=("creds", "secret"))
assert r.status_code == 200
payload = r.json()
for key in ("entries", "count", "offset", "limit", "total", "has_more", "operations"):
assert key in payload
-def test_status_api_401_without_auth(admin_settings) -> None:
- client = TestClient(_make_app(admin_settings))
- r = client.get("/admin/api/status")
+def test_status_api_401_without_auth(dashboard_settings) -> None:
+ client = TestClient(_make_app(dashboard_settings))
+ r = client.get("/dashboard/api/status")
assert r.status_code == 401
def test_auth_uses_explicit_credentials_not_aws() -> None:
settings = Settings(
host="http://localhost:9000",
- admin_ui=True,
- admin_username="admin",
- admin_password="admin",
- admin_secret="test-admin-secret",
+ dashboard_ui=True,
+ dashboard_username="admin",
+ dashboard_password="admin",
)
- admin = AdminCredentials(settings, {"AKIAEXAMPLE": "secret-key"})
- assert admin.valid("admin", "admin")
+ creds = DashboardCredentials(settings, {"AKIAEXAMPLE": "secret-key"})
+ assert creds.valid("admin", "admin")
# The AWS access key / secret must NOT work as dashboard credentials.
- assert not admin.valid("AKIAEXAMPLE", "secret-key")
+ assert not creds.valid("AKIAEXAMPLE", "secret-key")
def test_auth_raises_when_credentials_blank() -> None:
settings = Settings(
host="http://localhost:9000",
- admin_ui=True,
- admin_username="",
- admin_password="",
- admin_secret="test-admin-secret",
+ dashboard_ui=True,
+ dashboard_username="",
+ dashboard_password="",
)
with pytest.raises(RuntimeError):
create_auth_dependency(settings, {})
diff --git a/tests/unit/test_admin_encryption.py b/tests/unit/test_dashboard_encryption.py
similarity index 92%
rename from tests/unit/test_admin_encryption.py
rename to tests/unit/test_dashboard_encryption.py
index 6877c5c..b256148 100644
--- a/tests/unit/test_admin_encryption.py
+++ b/tests/unit/test_dashboard_encryption.py
@@ -1,14 +1,14 @@
-"""Admin encryption-status detection (issue #47 #6).
+"""Dashboard encryption-status detection (issue #47 #6).
Multipart objects store the wrapped DEK in a sidecar object, not an on-object
``isec`` tag — the create-time metadata does not survive CompleteMultipartUpload.
-The admin dashboard must consult the sidecar before reporting "not encrypted".
+The dashboard must consult the sidecar before reporting "not encrypted".
"""
from __future__ import annotations
import s3proxy.client as client_mod
-from s3proxy.admin.collectors import _has_multipart_sidecar, list_bucket_objects
+from s3proxy.dashboard.collectors import _has_multipart_sidecar, list_bucket_objects
from s3proxy.state.metadata import save_multipart_metadata
from s3proxy.state.models import MultipartMetadata
@@ -45,7 +45,7 @@ async def test_sidecar_lookup_swallows_errors(mock_s3) -> None:
async def test_listing_annotates_per_object_encryption(mock_s3, settings) -> None:
"""list-style annotation: on-object tag, multipart sidecar, and plaintext."""
- from s3proxy.admin.collectors import _annotate_encryption
+ from s3proxy.dashboard.collectors import _annotate_encryption
# 1) single-PUT encrypted: on-object isec tag
await mock_s3.put_object(
diff --git a/tests/unit/test_dashboard_path_filter.py b/tests/unit/test_dashboard_path_filter.py
new file mode 100644
index 0000000..02ab31f
--- /dev/null
+++ b/tests/unit/test_dashboard_path_filter.py
@@ -0,0 +1,56 @@
+"""The S3 catch-all must not record dashboard requests as proxied traffic.
+
+A bare ``/dashboard`` (no trailing slash) misses the mounted dashboard router and
+falls through to the S3 catch-all, where it would be logged as a phantom
+"dashboard" bucket. _is_dashboard_path filters those out.
+"""
+
+from __future__ import annotations
+
+from types import SimpleNamespace
+
+from s3proxy.config import Settings
+from s3proxy.request_handler import _is_dashboard_path
+
+
+def _req(settings: Settings):
+ return SimpleNamespace(app=SimpleNamespace(state=SimpleNamespace(settings=settings)))
+
+
+def _settings(**kw) -> Settings:
+ base = {
+ "host": "http://localhost:9000",
+ "dashboard_ui": True,
+ "dashboard_username": "admin",
+ "dashboard_password": "admin",
+ "credentials": [{"access_key": "AK", "secret_key": "s", "kek": "k"}],
+ }
+ base.update(kw)
+ return Settings(**base)
+
+
+def test_bare_dashboard_prefix_is_filtered() -> None:
+ r = _req(_settings())
+ assert _is_dashboard_path(r, "/dashboard") is True
+ assert _is_dashboard_path(r, "/dashboard/") is True
+ assert _is_dashboard_path(r, "/dashboard/api/status") is True
+
+
+def test_real_buckets_are_not_filtered() -> None:
+ r = _req(_settings())
+ assert _is_dashboard_path(r, "/scylla-backups/obj.bin") is False
+ assert _is_dashboard_path(r, "/my-bucket") is False
+ # A bucket literally named "dashboard-data" must not be swallowed by prefix match.
+ assert _is_dashboard_path(r, "/dashboard-data/key") is False
+
+
+def test_custom_dashboard_path() -> None:
+ r = _req(_settings(dashboard_path="/ops/dash"))
+ assert _is_dashboard_path(r, "/ops/dash") is True
+ assert _is_dashboard_path(r, "/ops/dash/login") is True
+ assert _is_dashboard_path(r, "/dashboard") is False # not the configured prefix
+
+
+def test_not_filtered_when_dashboard_ui_disabled() -> None:
+ r = _req(_settings(dashboard_ui=False))
+ assert _is_dashboard_path(r, "/dashboard") is False
diff --git a/tests/unit/test_keyring.py b/tests/unit/test_keyring.py
index 0cbdee1..99b06c2 100644
--- a/tests/unit/test_keyring.py
+++ b/tests/unit/test_keyring.py
@@ -79,19 +79,3 @@ def test_unknown_access_key_rejected_at_encrypt(self):
s = Settings(credentials=[{"access_key": "AKIA-A", "secret_key": "s", "kek": "e"}])
with pytest.raises(KeyError):
s.keyring.key_for("AKIA-NOT-CONFIGURED")
-
-
-class TestAdminSecret:
- def test_admin_ui_requires_secret(self):
- with pytest.raises(ValidationError):
- Settings(admin_ui=True, admin_username="a", admin_password="b")
-
- def test_admin_session_secret_is_stable(self):
- a = Settings(
- admin_ui=True, admin_username="a", admin_password="b", admin_secret="sek"
- ).admin_session_secret
- b = Settings(
- admin_ui=True, admin_username="a", admin_password="b", admin_secret="sek"
- ).admin_session_secret
- assert a == b
- assert len(a) == 32