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()} + + + + + + + + + + + {#if loading && !data} + + {:else if errorStatus != null} + + {:else if data && data.folders.length + data.objects.length === 0} + + {:else if data} + {#each data.folders as f} + (location.hash = prefixHref(bucket, f.prefix).slice(1))}> + + + + + + {/each} + {#each data.objects as o} + (location.hash = objectHref(bucket, o.key).slice(1))}> + + + + + + {/each} + {/if} + +
NameEncryptionSizeLast Modified
Loading…
Failed to load: {errorStatus}
Empty folder.
+ {@html FOLDER_ICON} + {(f.name || f.prefix) + '/'} + ———
+ {@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)}
+
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 @@ + + +
+ + + +
+ +
+
+
Recent Activity
+
+ Live + View all logs → +
+
+
+ + + + + + + + + {#if activity.length === 0} + + {:else} + {#each activity as r} + {@const hasBucket = r.bucket && r.bucket !== '—'} + {@const hasObject = hasBucket && r.object && r.object !== '—'} + + + + + + + + + + + {/each} + {/if} + +
TimeOperationBucketObjectStatusSizeClient IPLatency
No requests yet — traffic will appear here.
{r.time}{r.operation} + {#if hasBucket} + {r.bucket} + {:else}{r.bucket}{/if} + + {#if hasObject} + {r.object} + {:else}{r.object}{/if} + {r.status}{r.size}{r.client_ip}{r.latency}
+
+
+ +
+
+
+
Buckets
+
+ + + + + + + + + + {#if buckets.length === 0} + + {:else} + {#each buckets as b} + + + + + + {/each} + {/if} + +
NameObjects (seen)Size
No buckets observed yet.
{b.name}{b.objects}{b.size}
+
+ +
+
+
Keys
+
+ + + + + + {#each keys as k} + + + + + + + {/each} + +
Key IDTypeStatusCreated
{k.id}{k.type}{k.status}{k.created}
+
+
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 @@ + + +
+ {@html SHIELD} Proxy Version: {version} + Requests: {rps} req/s + Throughput: {throughput} + Last error: {lastError} + + +
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 @@ + + +
+
+ + {title} +
+
+ {statusText} + Uptime: {uptime} + Signed in · Logout +
+
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 @@ + + +
+
+
+ ← Back to dashboard +
Request Logs
+
{subText}
+
+
+ Live +
+
+
+ + + + {countText} +
+ {#if data} + + {/if} +
+ + + + + + + + + {#if !data} + + {:else if data.entries.length === 0} + + {:else} + {#each data.entries as r} + {@const hasBucket = !!r.bucket} + {@const hasObject = hasBucket && !!r.object} + + + + + + + + + + + + {/each} + {/if} + +
TimeOperationBucketObjectStatusCodeSizeClient IPLatency
Loading…
No log entries match.
{r.time}{r.operation} + {#if hasBucket} + {r.bucket} + {:else}—{/if} + + {#if hasObject} + {r.object} + {:else}—{/if} + {r.status}{r.status_code}{r.size}{r.client_ip || '—'}{r.latency}
+
+
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 || ' '}
+
+
+
+
+
+ {chartTitle} + {#if isData} + + + + + {/if} + + {#each RANGES as r} + + {/each} + + {chartMeta || ' '} +
+
+
+
+

{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'} + + {:else if state_ === 'error'} + + {:else if state_ === 'neterror'} + + {:else} + {#each rows as [k, v]} + + + + + {/each} + {/if} + +
Loading…
Failed to load: {errorStatus}
Network error.
{k}{v}
+
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} +
+ +
+ {#each pages as p} + {#if p < 0} + … + {:else} + + {/if} + {/each} +
+ + + Go to + { + if (e.key === 'Enter') { + const v = Number((e.currentTarget as HTMLInputElement).value); + if (v) go(v); + } + }} /> + / {totalPages} ({from}–{to} of {total}) + +
+{/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 @@ + + + + {#if points} + + {/if} + 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} +
+ +