diff --git a/.github/actions/build-e2e-images/action.yml b/.github/actions/build-e2e-images/action.yml index e2f889283..9b5ecb5fe 100644 --- a/.github/actions/build-e2e-images/action.yml +++ b/.github/actions/build-e2e-images/action.yml @@ -1,6 +1,6 @@ name: build e2e images description: > - Build the operator/api/agent/sentinel/capture-sidecar/telemetry-receiver/fakeoidc/mcp-server/audit-syslog-bridge/tunnel-frp + Build the operator/api/agent/sentinel/capture-sidecar/telemetry-receiver/fakeoidc/mcp-server/sftp/audit-syslog-bridge/tunnel-frp (+ gameprobe) images the kind e2e suites load into the cluster, tagged gameplane-test/:e2e exactly like make e2e-images, via buildx bake — then `docker save` all eleven into a single tar uploaded as an artifact @@ -19,7 +19,7 @@ runs: shell: bash run: ./hack/submodules.sh init - uses: docker/setup-buildx-action@d7f5e7f509e45cec5c76c4d5afdd7de93d0b3df5 # v4.1.0 - - name: bake e2e images (operator/api/agent/sentinel/capture-sidecar/telemetry-receiver/fakeoidc/mcp-server/audit-syslog-bridge/tunnel-frp) + - name: bake e2e images (operator/api/agent/sentinel/capture-sidecar/telemetry-receiver/fakeoidc/mcp-server/sftp/audit-syslog-bridge/tunnel-frp) uses: docker/bake-action@d3418bd7d0e9324001bca92fa8ba175ea7e6dc9b # v7.3.0 with: files: containers/docker-bake.hcl @@ -34,6 +34,7 @@ runs: e2e-telemetry-receiver.cache-from=type=gha,scope=e2e-telemetry-receiver-${{ inputs.arch }} e2e-fakeoidc.cache-from=type=gha,scope=e2e-fakeoidc-${{ inputs.arch }} e2e-mcp-server.cache-from=type=gha,scope=e2e-mcp-server-${{ inputs.arch }} + e2e-sftp.cache-from=type=gha,scope=e2e-sftp-${{ inputs.arch }} e2e-audit-syslog-bridge.cache-from=type=gha,scope=e2e-audit-syslog-bridge-${{ inputs.arch }} e2e-tunnel-frp.cache-from=type=gha,scope=e2e-tunnel-frp-${{ inputs.arch }} e2e-operator.cache-to=type=gha,mode=max,scope=e2e-operator-${{ inputs.arch }} @@ -44,6 +45,7 @@ runs: e2e-telemetry-receiver.cache-to=type=gha,mode=max,scope=e2e-telemetry-receiver-${{ inputs.arch }} e2e-fakeoidc.cache-to=type=gha,mode=max,scope=e2e-fakeoidc-${{ inputs.arch }} e2e-mcp-server.cache-to=type=gha,mode=max,scope=e2e-mcp-server-${{ inputs.arch }} + e2e-sftp.cache-to=type=gha,mode=max,scope=e2e-sftp-${{ inputs.arch }} e2e-audit-syslog-bridge.cache-to=type=gha,mode=max,scope=e2e-audit-syslog-bridge-${{ inputs.arch }} e2e-tunnel-frp.cache-to=type=gha,mode=max,scope=e2e-tunnel-frp-${{ inputs.arch }} - name: bake gameprobe image @@ -67,6 +69,7 @@ runs: gameplane-test/telemetry-receiver:e2e \ gameplane-test/fakeoidc:e2e \ gameplane-test/mcp-server:e2e \ + gameplane-test/sftp:e2e \ gameplane-test/audit-syslog-bridge:e2e \ gameplane-test/tunnel-frp:e2e \ gameplane-test/gameprobe:e2e \ diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 2fd47955e..c6e6ac179 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -238,6 +238,7 @@ jobs: - 'audit-syslog-bridge' - 'tunnel' - 'capture-sidecar' + - 'sftp' - 'hack/trivy-scan-images.sh' - 'hack/check-image-scan_test.sh' # Narrower than e2etree on purpose: this backs a job that only @@ -271,6 +272,7 @@ jobs: - 'audit-syslog-bridge' - 'tunnel' - 'capture-sidecar' + - 'sftp' - '.gitmodules' - 'hack/submodules.sh' - 'hack/check-submodule-freshness.sh' @@ -320,6 +322,7 @@ jobs: - 'audit-syslog-bridge' - 'tunnel' - 'capture-sidecar' + - 'sftp' - '.hadolint.yaml' - 'hack/check-hadolint_test.sh' - 'hack/testdata/hadolint/**' @@ -1238,6 +1241,8 @@ jobs: run: bash charts/gameplane/tests/monitoring-rules.sh - name: check MCP server RBAC scope run: bash charts/gameplane/tests/mcp-server-rbac.sh + - name: check SFTP endpoint renders + run: bash charts/gameplane/tests/sftp.sh standalone-compose: name: standalone Compose smoke @@ -1930,7 +1935,7 @@ jobs: # The arm64 job below uses the same steps/settings except for the # wake-hostport, network-isolation, management-placement, # backup-preparation, monitoring, recovery and standalone drills, which run once on amd64. - bucket: [operator, api-auth, api-roles, api-rbac, api-agent, api-mods, telemetry, optional-components, restricted-workloads, wake-hostport, network-isolation, management-placement, backup-preparation, monitoring, recovery, standalone] + bucket: [operator, api-auth, api-roles, api-rbac, api-agent, api-mods, telemetry, optional-components, restricted-workloads, wake-hostport, network-isolation, management-placement, backup-preparation, monitoring, recovery, standalone, sftp] arch: [amd64] include: - bucket: monitoring @@ -1998,6 +2003,10 @@ jobs: parallel: 1 test_timeout: 25m # Includes real projected-token rotation and node capture cleanup. job_timeout: 60 # Boots a kind cluster, installs the chart, runs the bucket's suite. + - bucket: sftp + parallel: 1 + test_timeout: 20m # chart enable, SFTP login, 32 MiB round trip, stopped-server and revocation checks + job_timeout: 60 # Boots a kind cluster, installs the chart, runs the bucket's suite. env: CLUSTER: gameplane-e2e CTX: kind-gameplane-e2e @@ -2929,7 +2938,7 @@ jobs: 'go-e2e-unit': (n) => n === 'go (test/e2e)', 'api-postgres': (n) => n === 'api (postgres)', 'e2e-buckets': (n) => n === 'e2e bucket coverage', - 'e2e-go': (n) => /^e2e (operator|api-auth|api-roles|api-rbac|api-agent|api-mods|telemetry|optional-components|restricted-workloads|wake-hostport|network-isolation|management-placement|backup-preparation|monitoring|recovery|standalone) \//.test(n) && n.includes('/ amd64 '), + 'e2e-go': (n) => /^e2e (operator|api-auth|api-roles|api-rbac|api-agent|api-mods|telemetry|optional-components|restricted-workloads|wake-hostport|network-isolation|management-placement|backup-preparation|monitoring|recovery|standalone|sftp) \//.test(n) && n.includes('/ amd64 '), 'e2e-go-arm64': (n) => /^e2e (operator|api-auth|api-roles|api-rbac|api-agent|api-mods|telemetry|optional-components|restricted-workloads) \//.test(n) && n.includes('/ arm64 '), 'e2e-multicluster': (n) => n.startsWith('e2e multicluster /') && n.includes('/ amd64 '), 'e2e-multicluster-arm64': (n) => n.startsWith('e2e multicluster /') && n.includes('/ arm64 '), @@ -3082,7 +3091,7 @@ jobs: const bucketSet = new Set(); for (const j of apiJobs) { const n = j.name || ''; - const m = n.match(/^e2e (operator|api-auth|api-roles|api-rbac|api-agent|api-mods|telemetry|optional-components|restricted-workloads|wake-hostport|network-isolation|management-placement|backup-preparation|monitoring|recovery|standalone) \//); + const m = n.match(/^e2e (operator|api-auth|api-roles|api-rbac|api-agent|api-mods|telemetry|optional-components|restricted-workloads|wake-hostport|network-isolation|management-placement|backup-preparation|monitoring|recovery|standalone|sftp) \//); const executionGated = m && ['wake-hostport', 'recovery', 'standalone'].includes(m[1]); if (m && !executionGated) bucketSet.add(m[1]); // Partial selection can complete these legs without running diff --git a/.github/workflows/devcontainers.yaml b/.github/workflows/devcontainers.yaml index 0c29eb1ea..2e73c45b1 100644 --- a/.github/workflows/devcontainers.yaml +++ b/.github/workflows/devcontainers.yaml @@ -25,6 +25,7 @@ on: - 'audit-syslog-bridge' - 'tunnel' - 'capture-sidecar' + - 'sftp' - 'web/package*.json' - '.github/workflows/devcontainers.yaml' push: @@ -44,6 +45,7 @@ on: - 'audit-syslog-bridge' - 'tunnel' - 'capture-sidecar' + - 'sftp' - 'web/package*.json' - '.github/workflows/devcontainers.yaml' diff --git a/.github/workflows/publish-edge.yaml b/.github/workflows/publish-edge.yaml index 9be21da5d..898b2e06c 100644 --- a/.github/workflows/publish-edge.yaml +++ b/.github/workflows/publish-edge.yaml @@ -6,7 +6,7 @@ name: publish-edge # version-pinned install path; this is the rolling "edge" channel. # # Images: ghcr.io//gameplane/{operator,api,web,agent,audit-syslog-bridge, -# telemetry-receiver,sentinel,capture-sidecar,mcp-server,tunnel-frp, +# telemetry-receiver,sentinel,capture-sidecar,mcp-server,sftp,tunnel-frp, # tunnel-tailscale,tunnel-playit}:edge # ...and an immutable :sha- tag for pinning a specific commit. # Consume with: helm install ... --set image.tag=edge @@ -16,7 +16,7 @@ on: branches: [master] # Only rebuild when something that lands in an image changes. Docs/chart # edits don't need a fresh image push. Every path here is a real `COPY` - # input of at least one of the 12 matrix images' Dockerfiles below (or a + # input of at least one of the 13 matrix images' Dockerfiles below (or a # transitive Go module dependency of one) — a path missing from this list # means a push that changes it publishes nothing to :edge until a later, # unrelated push happens to also touch a listed path. @@ -39,6 +39,8 @@ on: - "capture-sidecar/**" - "mcp-server" - "mcp-server/**" + - "sftp" + - "sftp/**" - "tunnel" - "tunnel/**" - "go.work" diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 7114c83e5..4c35cc97a 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -35,6 +35,7 @@ jobs: - component: sentinel - component: capture-sidecar - component: mcp-server + - component: sftp - component: tunnel-frp dockerfile: tunnel/Dockerfile.frp - component: tunnel-tailscale diff --git a/.gitmodules b/.gitmodules index 4defe8033..5d35589a6 100644 --- a/.gitmodules +++ b/.gitmodules @@ -26,3 +26,8 @@ url = https://github.com/GameplanePanel/capture-sidecar.git branch = main component = true +[submodule "sftp"] + path = sftp + url = https://github.com/GameplanePanel/sftp.git + branch = main + component = true diff --git a/AGENTS.md b/AGENTS.md index f9f6ad2b6..11e1b4a18 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -38,6 +38,7 @@ telemetry-receiver/ usage telemetry ingest sentinel/ wake-on-connect proxy for sleeping pods capture-sidecar/ SUBMODULE GameplanePanel/capture-sidecar (AF_PACKET BPF capture sidecar; own go.mod, not in go.work; image still built here) mcp-server/ SUBMODULE GameplanePanel/mcp (read-only MCP server; own go.mod, not in go.work; image still built here) +sftp/ SUBMODULE GameplanePanel/sftp (SFTP endpoint for game server files, spec 040; own go.mod, not in go.work; image still built here) tunnel/ SUBMODULE GameplanePanel/tunnel (relay client supervisor: frp, Tailscale, playit; own go.mod, not in go.work; image still built here) web/ React 19 + strict TS + Vite dashboard; src/{routes,components,lib,router,styles,test}/ modules/ SUBMODULE GameplanePanel/module (OCI game templates) @@ -53,7 +54,7 @@ go.work links all 12 Go modules (incl. test/e2e) Makefile canonical task runner ``` -After cloning: `git submodule update --init modules` (required for `make dev-up`) and `hack/submodules.sh init` (the split component submodules mcp-server, audit-syslog-bridge, tunnel, capture-sidecar; `make images`/`make dev-up` also init them on demand); add `git submodule update --init website` only when working on the website. +After cloning: `git submodule update --init modules` (required for `make dev-up`) and `hack/submodules.sh init` (the split component submodules mcp-server, audit-syslog-bridge, tunnel, capture-sidecar, sftp; `make images`/`make dev-up` also init them on demand); add `git submodule update --init website` only when working on the website. ## Commands (via Makefile; compile checks excepted, see rule 8) @@ -61,7 +62,7 @@ After cloning: `git submodule update --init modules` (required for `make dev-up` - **Build:** `make build` (all Go + web), `make build-go` (11 modules in GO_MODULES, all but test/e2e), `make build-web` (`npm ci && npm run build`), `make images`. - **Codegen:** `make generate` (deepcopy), `make manifests` (CRD/RBAC YAML, synced to `charts/gameplane/charts/gameplane-crds/crds/` and `charts/gameplane/crd-manifests/`), `make modules-push`, `make tidy`. - **Dev containers:** `make devcontainers` (regenerate every profile and the `website/` and `modules/` copies after editing `.devcontainer/versions.toml`, `.devcontainer/profiles.toml`, `.devcontainer/devcontainer-lock.json`, `.devcontainer/setup.sh` or a `system-deps.toml`), `make check-devcontainers` (drift check). Profile table: `docs/contributing.md`. -- **Tests (CI only — never run locally, see Rule 8):** `make test`, `make test-integration` (envtest operator+api), `make test-e2e` (~10–20 min), `make test-e2e-bucket BUCKET=(operator|api-auth|api-roles|api-rbac|api-agent|api-mods|ratelimit|bot-fast|bot-heavy|multicluster|upgrade|postgres-availability|postgres-pitr|postgres-ha|telemetry|capture-overhead|optional-components|restricted-workloads|wake-hostport|network-isolation|management-placement|backup-preparation|monitoring|recovery|standalone)`. +- **Tests (CI only — never run locally, see Rule 8):** `make test`, `make test-integration` (envtest operator+api), `make test-e2e` (~10–20 min), `make test-e2e-bucket BUCKET=(operator|api-auth|api-roles|api-rbac|api-agent|api-mods|ratelimit|bot-fast|bot-heavy|multicluster|upgrade|postgres-availability|postgres-pitr|postgres-ha|telemetry|capture-overhead|optional-components|restricted-workloads|wake-hostport|network-isolation|management-placement|backup-preparation|monitoring|recovery|standalone|sftp)`. - **E2E conventions:** register new tests in `test/e2e/buckets.sh`; `t.Parallel()` + unique names; guard shared resources (`ociPushMu` for module pushes, `ensureResticRepo(t)` for shared backup repos). Rate limits per cluster: IP burst 10 (5/min), user burst 6 (3/min) — cap an API bucket at ~7 admin logins. - **Lint:** `make lint` runs `check-doc-versions`, `check-links`, `check-features-sync`, `check-specs`, `check-telemetry-catalog`, `check-i18n`, `check-dev-load-images`, `check-coverage-gaps`, `check-devcontainers`, `test-up-registry`, `lint-go` and `lint-web`. diff --git a/Makefile b/Makefile index 52f190a75..47d071a65 100644 --- a/Makefile +++ b/Makefile @@ -326,7 +326,7 @@ lint-web: ## Run web linters # -------- images -------- # Standard-shaped images (Dockerfile path = /Dockerfile) -IMAGES := operator api web agent telemetry-receiver sentinel mcp-server capture-sidecar +IMAGES := operator api web agent telemetry-receiver sentinel mcp-server capture-sidecar sftp # The full set of image names `make images` builds, by their docker tag # names (not their Makefile target names — audit-syslog-bridge and the three diff --git a/README.md b/README.md index 7f5b14a26..45699adeb 100644 --- a/README.md +++ b/README.md @@ -170,6 +170,7 @@ legacy default for custom deployments. See [storage and recovery](docs/standalon | `audit-syslog-bridge/` | Go | Submodule (`GameplanePanel/audit-syslog-bridge`): HTTP-JSON to syslog relay [optional] for audit logging infrastructure. | | `telemetry-receiver/` | Go | Collector [optional] for anonymous daily usage reports. | | `mcp-server/` | Go | Submodule (`GameplanePanel/mcp`): strictly read-only Model Context Protocol server [optional] for AI tools. | +| `sftp/` | Go | Submodule (`GameplanePanel/sftp`): optional SFTP endpoint for game server files; every login and file operation goes through the Gameplane API. | ### Custom Resource Definitions (CRDs) @@ -210,6 +211,7 @@ Gameplane extends Kubernetes using custom resources under `gameplane.local/v1alp ├── audit-syslog-bridge/ # Submodule: optional syslog relay for audit logs ├── telemetry-receiver/ # Optional anonymous usage telemetry receiver ├── mcp-server/ # Submodule: optional read-only MCP server (GameplanePanel/mcp) +├── sftp/ # Submodule: optional SFTP endpoint for game server files (GameplanePanel/sftp) ├── charts/gameplane/ # Helm deployment chart ├── deploy/kind/ # Local dev environment bootstrap scripts ├── deploy/standalone/ # API + dashboard Docker Compose deployment @@ -273,7 +275,7 @@ Ed25519 key and do not have transparency log entries — verify them with Requires: Go 1.27+, Node 20+, Docker, kind, kubectl, helm, [oras](https://oras.land/docs/installation) (>= 1.2.0). -The game modules and the split components live in separate `GameplanePanel/*` repos, wired in here as submodules: `modules/` (`GameplanePanel/module`) and the component submodules `mcp-server/`, `audit-syslog-bridge/`, `tunnel/` and `capture-sidecar/` (`GameplanePanel/mcp`, `/audit-syslog-bridge`, `/tunnel`, `/capture-sidecar`). Clone with submodules (or initialize them after): +The game modules and the split components live in separate `GameplanePanel/*` repos, wired in here as submodules: `modules/` (`GameplanePanel/module`) and the component submodules `mcp-server/`, `audit-syslog-bridge/`, `tunnel/`, `capture-sidecar/` and `sftp/` (`GameplanePanel/mcp`, `/audit-syslog-bridge`, `/tunnel`, `/capture-sidecar`, `/sftp`). Clone with submodules (or initialize them after): ```sh git clone --recurse-submodules diff --git a/agent/cmd/files_only_test.go b/agent/cmd/files_only_test.go new file mode 100644 index 000000000..3ca2f50e7 --- /dev/null +++ b/agent/cmd/files_only_test.go @@ -0,0 +1,63 @@ +package main + +import ( + "context" + "net/http" + "net/http/httptest" + "testing" + + "github.com/go-chi/chi/v5" + + "github.com/GameplanePanel/gameplane/agent/internal/rcon" + "github.com/GameplanePanel/gameplane/agent/internal/status" +) + +// newTestRoutes builds the protected routes the way main does, with no +// game attached: RCON is disabled and no game log, mods or caps are declared. +func newTestRoutes(t *testing.T, filesOnly bool) http.Handler { + t.Helper() + transport := rcon.Disabled{} + r := chi.NewRouter() + protectedRoutes{ + dataRoot: t.TempDir(), + maxUploadBytes: 1 << 20, + rconClient: transport, + commands: rcon.NewCommands(transport), + gameName: "test-game", + statusSource: status.New(transport, nil), + filesOnly: filesOnly, + }.mount(r) + return r +} + +func serve(t *testing.T, h http.Handler, method, target string) int { + t.Helper() + rr := httptest.NewRecorder() + req := httptest.NewRequestWithContext(context.Background(), method, target, nil) + h.ServeHTTP(rr, req) + return rr.Code +} + +func TestFilesOnlyRouterServesOnlyFiles(t *testing.T) { + h := newTestRoutes(t, true) + + for _, target := range []string{"/console", "/players", "/mods", "/logs/tail", "/status", "/lifecycle", "/actions"} { + if code := serve(t, h, http.MethodGet, target); code != http.StatusNotFound { + t.Errorf("files-only GET %s code=%d, want 404", target, code) + } + } + if code := serve(t, h, http.MethodGet, "/files/stat?path=/"); code == http.StatusNotFound { + t.Errorf("files-only GET /files/stat code=404, want the file routes mounted") + } +} + +func TestFullRouterKeepsGameRoutes(t *testing.T) { + h := newTestRoutes(t, false) + + if code := serve(t, h, http.MethodGet, "/status"); code == http.StatusNotFound { + t.Errorf("full GET /status code=404, want the status route mounted") + } + if code := serve(t, h, http.MethodGet, "/files/stat?path=/"); code == http.StatusNotFound { + t.Errorf("full GET /files/stat code=404, want the file routes mounted") + } +} diff --git a/agent/cmd/main.go b/agent/cmd/main.go index 768b5df1c..48afe129c 100644 --- a/agent/cmd/main.go +++ b/agent/cmd/main.go @@ -42,26 +42,28 @@ var Version = "dev" // main is the entrypoint for the Gameplane sidecar agent process. func main() { var ( - addr string - metricsAddr string - dataRoot string - rconHost string - rconPort int - rconPassFile string - rconEnabled bool - rconProtocol string - gameLogPath string - certFile string - keyFile string - clientCAFile string - apiTokenFile string - serverName string - serverUID string - templateName string - gameName string - capsJSON string - cliPipe string - logLevel string + addr string + metricsAddr string + dataRoot string + rconHost string + rconPort int + rconPassFile string + rconEnabled bool + rconProtocol string + gameLogPath string + certFile string + keyFile string + clientCAFile string + apiTokenFile string + serverName string + serverUID string + templateName string + gameName string + capsJSON string + cliPipe string + logLevel string + maxUploadBytes int64 + filesOnly bool ) flag.StringVar(&addr, "addr", ":8090", "HTTP listen address") flag.StringVar(&metricsAddr, "metrics-addr", envOr("GAMEPLANE_METRICS_ADDR", ":9090"), @@ -96,6 +98,10 @@ func main() { "declared game capabilities (JSON, from GameTemplate spec.capabilities)") flag.StringVar(&logLevel, "log-level", envOr("GAMEPLANE_LOG_LEVEL", "info"), "log verbosity: debug, info, warn, or error") + flag.Int64Var(&maxUploadBytes, "max-upload-bytes", files.DefaultMaxUploadBytes, + "size limit in bytes for one /files/stream upload (Helm files.maxUploadSize)") + flag.BoolVar(&filesOnly, "files-only", false, + "serve only /files/*, /healthz and metrics (file-only pod for a stopped server)") flag.Parse() logger := slog.New(slog.NewJSONHandler(os.Stderr, &slog.HandlerOptions{Level: parseLogLevel(logLevel)})) @@ -184,57 +190,53 @@ func main() { // cert would also unlock. statusSource := status.New(rconClient, statusSpec) - mountProtected := func(protected chi.Router) { - - // Console/Logs open long-lived WebSockets and Mods installs can run - // well past a short request deadline (a large download bounded by - // its own HTTP client timeout, not the router's). None of these are - // ordinary bounded REST calls, so they're mounted without - // middleware.Timeout (F-103): applying a request-scoped deadline to - // them force-closes the socket / aborts the download every time the - // deadline elapses, regardless of whether the stream is still healthy. - logs.Mount(protected, dataRoot, gameLogPath) - console.Mount(protected, rconClient) - mods.Mount(protected, dataRoot, modsSpec) - files.Mount(protected, dataRoot) - - protected.Group(func(bounded chi.Router) { - bounded.Use(middleware.Timeout(30 * time.Second)) - players.Mount(bounded, rconClient, gameName, playerActions, dataRoot) - quiesce.Mount(bounded, commands, gameName, quiesceSpec) - lifecycle.Mount(bounded, rconClient, gameName, lifecycleSpec) - actions.Mount(bounded, rconClient, gameName, actionSpecs) - statusSource.Mount(bounded) - }) + routes := protectedRoutes{ + dataRoot: dataRoot, + gameLogPath: gameLogPath, + maxUploadBytes: maxUploadBytes, + rconClient: rconClient, + commands: commands, + gameName: gameName, + modsSpec: modsSpec, + playerActions: playerActions, + quiesceSpec: quiesceSpec, + lifecycleSpec: lifecycleSpec, + actionSpecs: actionSpecs, + statusSource: statusSource, + filesOnly: filesOnly, } r.Group(func(protected chi.Router) { protected.Use(authCheck.Middleware) - mountProtected(protected) + routes.mount(protected) }) r.Route("/v1/targets/{uid}", func(protected chi.Router) { protected.Use(authCheck.Middleware, target.Guard(serverUID)) - mountProtected(protected) + routes.mount(protected) }) - // Backups bind save-off/save-on to the process they prepared. The service - // may already route to a replacement pod, which must reject the old UID. - for _, version := range []string{"v1", "v2"} { - r.Route("/"+version+"/pods/{uid}", func(protected chi.Router) { - protected.Use(authCheck.Middleware, target.Guard(envOr("GAMEPLANE_POD_UID", "")), middleware.Timeout(30*time.Second)) - protected.Get("/identity", func(w http.ResponseWriter, _ *http.Request) { - if version == "v2" && flushOnly { - w.Header().Set("Gameplane-Backup-Mode", "flush-only") + // A file-only pod serves no game routes, so the pod-bound backup routes + // (quiesce, identity) are not mounted there either. + if !filesOnly { + // Backups bind save-off/save-on to the process they prepared. The service + // may already route to a replacement pod, which must reject the old UID. + for _, version := range []string{"v1", "v2"} { + r.Route("/"+version+"/pods/{uid}", func(protected chi.Router) { + protected.Use(authCheck.Middleware, target.Guard(envOr("GAMEPLANE_POD_UID", "")), middleware.Timeout(30*time.Second)) + protected.Get("/identity", func(w http.ResponseWriter, _ *http.Request) { + if version == "v2" && flushOnly { + w.Header().Set("Gameplane-Backup-Mode", "flush-only") + } + w.WriteHeader(http.StatusNoContent) + }) + if version == "v2" { + quiesce.MountVerified(protected, commands, gameName, quiesceSpec) + if flushOnly { + quiesce.MountMinecraftFlush(protected, commands) + } + } else { + quiesce.Mount(protected, commands, gameName, quiesceSpec) } - w.WriteHeader(http.StatusNoContent) }) - if version == "v2" { - quiesce.MountVerified(protected, commands, gameName, quiesceSpec) - if flushOnly { - quiesce.MountMinecraftFlush(protected, commands) - } - } else { - quiesce.Mount(protected, commands, gameName, quiesceSpec) - } - }) + } } srv := &http.Server{ @@ -261,39 +263,43 @@ func main() { }) go usageReader.MonitorDisk(ctx) - // Prometheus metrics for per-server resource usage and player counts. - // Registered with the default registry so promhttp.Handler() picks it up. - m := metrics.New() - prometheus.MustRegister(statusSource) - go statusSource.Run(ctx) + // A file-only pod runs next to a stopped game: it must not poll RCON, + // write status.agent or heartbeat for a server that is not running. + if !filesOnly { + // Prometheus metrics for per-server resource usage and player counts. + // Registered with the default registry so promhttp.Handler() picks it up. + m := metrics.New() + prometheus.MustRegister(statusSource) + go statusSource.Run(ctx) - // Resource usage: in proc mode (the operator shares the pod's PID - // namespace and sets GAMEPLANE_USAGE_PROC) the agent reports the game - // process's CPU/memory from /proc and uses the operator-supplied limits - // as the denominator; otherwise it falls back to its own cgroup. - go heartbeat.Run(ctx, heartbeat.Config{ - ServerName: serverName, - Template: templateName, - Game: gameName, - Version: Version, - RCON: rconClient, - Interval: 20 * time.Second, - PlayerList: func() *caps.PlayerList { - if playerActions != nil { - return playerActions.List - } - return nil - }(), - PlayerQuery: func() *caps.PlayerQuery { - if playerActions != nil { - return playerActions.Query - } - return nil - }(), - QueryHost: rconHost, - Usage: usageReader, - Metrics: m, - }) + // Resource usage: in proc mode (the operator shares the pod's PID + // namespace and sets GAMEPLANE_USAGE_PROC) the agent reports the game + // process's CPU/memory from /proc and uses the operator-supplied limits + // as the denominator; otherwise it falls back to its own cgroup. + go heartbeat.Run(ctx, heartbeat.Config{ + ServerName: serverName, + Template: templateName, + Game: gameName, + Version: Version, + RCON: rconClient, + Interval: 20 * time.Second, + PlayerList: func() *caps.PlayerList { + if playerActions != nil { + return playerActions.List + } + return nil + }(), + PlayerQuery: func() *caps.PlayerQuery { + if playerActions != nil { + return playerActions.Query + } + return nil + }(), + QueryHost: rconHost, + Usage: usageReader, + Metrics: m, + }) + } go func() { logger.Info("agent listening", "addr", addr, "tls", srv.TLSConfig != nil, "version", Version) @@ -344,6 +350,54 @@ func main() { } } +// protectedRoutes carries what the mTLS-protected control routes are built +// from. It exists so the same mounting code serves the full agent and the +// --files-only pod, and can be exercised by tests without running main. +type protectedRoutes struct { + dataRoot string + gameLogPath string + maxUploadBytes int64 + rconClient rcon.Executor + commands *rcon.Commands + gameName string + modsSpec *caps.Mods + playerActions *caps.PlayerActions + quiesceSpec *caps.Quiesce + lifecycleSpec *caps.Lifecycle + actionSpecs []caps.ServerAction + statusSource *status.Source + filesOnly bool +} + +// mount registers the protected routes on protected. A files-only pod stops +// after the file browser: console, logs, mods, players, quiesce, lifecycle, +// actions and status are not served there. +func (p protectedRoutes) mount(protected chi.Router) { + // Console/Logs open long-lived WebSockets and Mods installs can run + // well past a short request deadline (a large download bounded by + // its own HTTP client timeout, not the router's). None of these are + // ordinary bounded REST calls, so they're mounted without + // middleware.Timeout (F-103): applying a request-scoped deadline to + // them force-closes the socket / aborts the download every time the + // deadline elapses, regardless of whether the stream is still healthy. + files.Mount(protected, p.dataRoot, files.WithMaxUploadBytes(p.maxUploadBytes)) + if p.filesOnly { + return + } + logs.Mount(protected, p.dataRoot, p.gameLogPath) + console.Mount(protected, p.rconClient) + mods.Mount(protected, p.dataRoot, p.modsSpec) + + protected.Group(func(bounded chi.Router) { + bounded.Use(middleware.Timeout(30 * time.Second)) + players.Mount(bounded, p.rconClient, p.gameName, p.playerActions, p.dataRoot) + quiesce.Mount(bounded, p.commands, p.gameName, p.quiesceSpec) + lifecycle.Mount(bounded, p.rconClient, p.gameName, p.lifecycleSpec) + actions.Mount(bounded, p.rconClient, p.gameName, p.actionSpecs) + p.statusSource.Mount(bounded) + }) +} + // errTLSFlagsUnpaired reports that only one of --tls-cert / --tls-key was set. var errTLSFlagsUnpaired = errors.New("--tls-cert and --tls-key must both be set or both be empty") diff --git a/agent/internal/files/files.go b/agent/internal/files/files.go index 1e6e73b8e..9dbe8a94a 100644 --- a/agent/internal/files/files.go +++ b/agent/internal/files/files.go @@ -20,6 +20,7 @@ import ( "github.com/go-chi/chi/v5" "github.com/go-chi/chi/v5/middleware" + "golang.org/x/sys/unix" "github.com/GameplanePanel/gameplane/agent/internal/httpjson" ) @@ -39,6 +40,16 @@ var errDotfile = errors.New("dotfile access denied") // errFileExists is a client-safe conflict for create-only operations. var errFileExists = errors.New("file already exists") +// errNoSpace refuses a stream upload the volume cannot hold. +var errNoSpace = errors.New("not enough free space on the volume") + +// errBadRename refuses a rename the kernel rejects as invalid, such as moving +// a directory into itself. +var errBadRename = errors.New("invalid rename") + +// errBadOffset refuses a resume offset beyond the existing file's size. +var errBadOffset = errors.New("offset beyond existing file size") + // hasDotComponent reports whether the slash-separated relative path rel // (already stripped of its leading slash) has a dot-prefixed component. func hasDotComponent(rel string) bool { @@ -76,24 +87,52 @@ type handler struct { beforeOpen func(stage, dir, name string) // Test seam for a filesystem that refuses access-metadata restoration. preserveAccess func(*os.File, fileAccess) error + + // maxUploadBytes caps one /files/stream upload (offset prefix included). + maxUploadBytes int64 + // freeBytes is a test seam for the free-space check of /files/stream; + // nil uses statfs on the target directory. + freeBytes func(dirFD int) (uint64, error) +} + +// DefaultMaxUploadBytes is the /files/stream limit when no option sets one +// (Helm files.maxUploadSize, spec 040 OD-6). +const DefaultMaxUploadBytes int64 = 20 << 30 + +// Option configures Mount. +type Option func(*handler) + +// WithMaxUploadBytes sets the /files/stream size limit; n <= 0 keeps the default. +func WithMaxUploadBytes(n int64) Option { + return func(h *handler) { + if n > 0 { + h.maxUploadBytes = n + } + } } // Mount registers the file-browser HTTP handlers on the supplied router. -func Mount(r chi.Router, root string) { - h := &handler{root: filepath.Clean(root)} +func Mount(r chi.Router, root string, opts ...Option) { + h := &handler{root: filepath.Clean(root), maxUploadBytes: DefaultMaxUploadBytes} + for _, opt := range opts { + opt(h) + } r.Route("/files", func(r chi.Router) { // Transfers can legitimately outlive the ordinary operation timeout. r.Get("/download", h.download) r.Get("/archive", h.archive) r.Post("/archive", h.archive) r.Post("/upload", h.upload) + r.Put("/stream", h.stream) r.Group(func(bounded chi.Router) { bounded.Use(middleware.Timeout(30 * time.Second)) bounded.Get("/list", h.list) + bounded.Get("/stat", h.stat) bounded.Get("/read", h.read) bounded.Post("/write", h.write) bounded.Post("/create", h.create) bounded.Post("/mkdir", h.mkdir) + bounded.Post("/rename", h.rename) bounded.Delete("/delete", h.del) }) }) @@ -452,6 +491,12 @@ func httpErr(w http.ResponseWriter, err error) { http.Error(w, errFileExists.Error(), http.StatusConflict) case errors.Is(err, errPreserveAccess): http.Error(w, "cannot preserve existing file access; the file changed or the filesystem does not support its group/POSIX ACL permissions", http.StatusConflict) + case errors.Is(err, errNoSpace) || errors.Is(err, unix.ENOSPC): + http.Error(w, errNoSpace.Error(), http.StatusInsufficientStorage) + case errors.Is(err, errBadOffset): + http.Error(w, errBadOffset.Error(), http.StatusRequestedRangeNotSatisfiable) + case errors.Is(err, errBadRename): + http.Error(w, errBadRename.Error(), http.StatusBadRequest) case errors.Is(err, os.ErrNotExist): http.Error(w, "not found", http.StatusNotFound) case errors.Is(err, os.ErrPermission): diff --git a/agent/internal/files/rename_linux.go b/agent/internal/files/rename_linux.go new file mode 100644 index 000000000..4de84ce92 --- /dev/null +++ b/agent/internal/files/rename_linux.go @@ -0,0 +1,96 @@ +package files + +import ( + "encoding/json" + "errors" + "fmt" + "net/http" + + "golang.org/x/sys/unix" +) + +// renameBody is the /files/rename request body. +type renameBody struct { + From string `json:"from"` + To string `json:"to"` + Overwrite bool `json:"overwrite"` +} + +// rename moves one entry within the data root (spec 040 T006). +func (h *handler) rename(w http.ResponseWriter, req *http.Request) { + defer func() { _ = req.Body.Close() }() + var body renameBody + if err := json.NewDecoder(http.MaxBytesReader(w, req.Body, 64<<10)).Decode(&body); err != nil { + h.badRequest(w, err) + return + } + fromComps, err := h.components(body.From) + if err != nil { + h.fail(w, err) + return + } + toComps, err := h.components(body.To) + if err != nil { + h.fail(w, err) + return + } + if len(fromComps) == 0 || len(toComps) == 0 { + http.Error(w, "refusing to rename root", http.StatusBadRequest) + return + } + if err := h.renamePath(fromComps, toComps, body.Overwrite); err != nil { + h.fail(w, err) + return + } + w.WriteHeader(http.StatusNoContent) +} + +// renamePath renames the entry at from to the path to, both below the root, +// using renameat on descriptors from the rooted walk. A symlink is renamed as +// the link it is. With overwrite false the commit uses RENAME_NOREPLACE. +func (h *handler) renamePath(from, to []string, overwrite bool) error { + rootFD, err := openRoot(h.root) + if err != nil { + return err + } + defer closeFD(rootFD) + srcDir, srcName, err := h.locate(rootFD, from) + if err != nil { + return err + } + defer closeFD(srcDir) + dstDir, dstName, err := h.locate(rootFD, to) + if err != nil { + return err + } + defer closeFD(dstDir) + // The source must exist; a symlink is renamed as the link it is. + h.fire("stat", parentsOf(from), srcName) + var st unix.Stat_t + if err := unix.Fstatat(srcDir, srcName, &st, unix.AT_SYMLINK_NOFOLLOW); err != nil { + return fmt.Errorf("stat %q: %w", srcName, err) + } + h.fire("commit", parentsOf(to), dstName) + if overwrite { + err = unix.Renameat(srcDir, srcName, dstDir, dstName) + } else { + err = unix.Renameat2(srcDir, srcName, dstDir, dstName, unix.RENAME_NOREPLACE) + } + return renameError(srcName, err) +} + +// renameError maps a renameat result to the file API's client-safe errors: +// an existing (or non-empty directory) destination is a conflict, EINVAL +// (a directory moved into itself) is a bad request. +func renameError(name string, err error) error { + switch { + case err == nil: + return nil + case errors.Is(err, unix.EEXIST), errors.Is(err, unix.ENOTEMPTY): + return fmt.Errorf("rename %q: %w: %w", name, errFileExists, err) + case errors.Is(err, unix.EINVAL): + return fmt.Errorf("rename %q: %w: %w", name, errBadRename, err) + default: + return fmt.Errorf("rename %q: %w", name, err) + } +} diff --git a/agent/internal/files/rename_linux_test.go b/agent/internal/files/rename_linux_test.go new file mode 100644 index 000000000..925e59388 --- /dev/null +++ b/agent/internal/files/rename_linux_test.go @@ -0,0 +1,143 @@ +package files + +import ( + "encoding/json" + "net/http" + "net/http/httptest" + "os" + "path/filepath" + "strings" + "testing" +) + +// renameRequest builds the JSON body of POST /files/rename. +func renameRequest(t *testing.T, from, to string, overwrite bool) *strings.Reader { + t.Helper() + b, err := json.Marshal(renameBody{From: from, To: to, Overwrite: overwrite}) + if err != nil { + t.Fatalf("marshal rename body: %v", err) + } + return strings.NewReader(string(b)) +} + +func doRename(t *testing.T, h *handler, from, to string, overwrite bool) *httptest.ResponseRecorder { + t.Helper() + return serve(t, h.rename, http.MethodPost, "/files/rename", renameRequest(t, from, to, overwrite)) +} + +func TestRename_FileAcrossDirectories(t *testing.T) { + h, root, _ := raceHandler(t) + put(t, filepath.Join(root, "a", "src.txt"), "moved") + if err := os.Mkdir(filepath.Join(root, "b"), 0o755); err != nil { + t.Fatalf("mkdir: %v", err) + } + resp := doRename(t, h, "/a/src.txt", "/b/dst.txt", false) + if resp.Code != http.StatusNoContent { + t.Fatalf("status=%d, want 204", resp.Code) + } + got, err := os.ReadFile(filepath.Join(root, "b", "dst.txt")) + if err != nil || string(got) != "moved" { + t.Fatalf("dst content=%q err=%v", got, err) + } + if _, err := os.Lstat(filepath.Join(root, "a", "src.txt")); !os.IsNotExist(err) { + t.Fatalf("source still present: err=%v", err) + } +} + +func TestRename_NoOverwriteConflictKeepsBoth(t *testing.T) { + h, root, _ := raceHandler(t) + put(t, filepath.Join(root, "a.txt"), "A") + put(t, filepath.Join(root, "b.txt"), "B") + resp := doRename(t, h, "/a.txt", "/b.txt", false) + if resp.Code != http.StatusConflict { + t.Fatalf("status=%d, want 409", resp.Code) + } + if got, _ := os.ReadFile(filepath.Join(root, "a.txt")); string(got) != "A" { + t.Fatalf("a.txt changed: %q", got) + } + if got, _ := os.ReadFile(filepath.Join(root, "b.txt")); string(got) != "B" { + t.Fatalf("b.txt changed: %q", got) + } +} + +func TestRename_OverwriteReplaces(t *testing.T) { + h, root, _ := raceHandler(t) + put(t, filepath.Join(root, "a.txt"), "new") + put(t, filepath.Join(root, "b.txt"), "old") + resp := doRename(t, h, "/a.txt", "/b.txt", true) + if resp.Code != http.StatusNoContent { + t.Fatalf("status=%d, want 204", resp.Code) + } + if got, _ := os.ReadFile(filepath.Join(root, "b.txt")); string(got) != "new" { + t.Fatalf("b.txt content=%q, want new", got) + } + if _, err := os.Lstat(filepath.Join(root, "a.txt")); !os.IsNotExist(err) { + t.Fatalf("source still present: err=%v", err) + } +} + +func TestRename_RootRefused(t *testing.T) { + h, root, _ := raceHandler(t) + put(t, filepath.Join(root, "a.txt"), "A") + if resp := doRename(t, h, "/", "/x", false); resp.Code != http.StatusBadRequest { + t.Fatalf("from root: status=%d, want 400", resp.Code) + } + if resp := doRename(t, h, "/a.txt", "/", true); resp.Code != http.StatusBadRequest { + t.Fatalf("to root: status=%d, want 400", resp.Code) + } +} + +func TestRename_DotfileRefused(t *testing.T) { + h, root, _ := raceHandler(t) + put(t, filepath.Join(root, ".secret"), "s") + put(t, filepath.Join(root, "a.txt"), "A") + if resp := doRename(t, h, "/.secret", "/x.txt", false); resp.Code != http.StatusBadRequest { + t.Fatalf("dotfile source: status=%d, want 400", resp.Code) + } + if resp := doRename(t, h, "/a.txt", "/.hidden", false); resp.Code != http.StatusBadRequest { + t.Fatalf("dotfile destination: status=%d, want 400", resp.Code) + } +} + +func TestRename_MissingSourceNotFound(t *testing.T) { + h, _, _ := raceHandler(t) + if resp := doRename(t, h, "/nope.txt", "/x.txt", false); resp.Code != http.StatusNotFound { + t.Fatalf("status=%d, want 404", resp.Code) + } +} + +func TestRename_MissingDestinationParentNotFound(t *testing.T) { + h, root, _ := raceHandler(t) + put(t, filepath.Join(root, "a.txt"), "A") + if resp := doRename(t, h, "/a.txt", "/missing/x.txt", false); resp.Code != http.StatusNotFound { + t.Fatalf("status=%d, want 404", resp.Code) + } + if _, err := os.Lstat(filepath.Join(root, "a.txt")); err != nil { + t.Fatalf("source disturbed: %v", err) + } +} + +func TestRename_BadJSONRejected(t *testing.T) { + h, _, _ := raceHandler(t) + rr := serve(t, h.rename, http.MethodPost, "/files/rename", strings.NewReader("{not json")) + if rr.Code != http.StatusBadRequest { + t.Fatalf("status=%d, want 400", rr.Code) + } +} + +func TestRename_DestinationParentSwappedForSymlinkRejected(t *testing.T) { + h, root, outside := raceHandler(t) + put(t, filepath.Join(root, "src.txt"), "payload") + if err := os.Mkdir(filepath.Join(root, "dst"), 0o755); err != nil { + t.Fatalf("mkdir: %v", err) + } + raceAt(t, h, "open", "", "dst", 1, func() { + swapForSymlink(t, filepath.Join(root, "dst"), outside) + }) + rr := serve(t, h.rename, http.MethodPost, "/files/rename", renameRequest(t, "/src.txt", "/dst/moved.txt", false)) + assertRejected(t, rr) + assertOutsideUntouched(t, outside) + if got, err := os.ReadFile(filepath.Join(root, "src.txt")); err != nil || string(got) != "payload" { + t.Fatalf("source not left in place: got %q err=%v", got, err) + } +} diff --git a/agent/internal/files/rooted_linux.go b/agent/internal/files/rooted_linux.go index d39d741eb..4ad1d62fc 100644 --- a/agent/internal/files/rooted_linux.go +++ b/agent/internal/files/rooted_linux.go @@ -224,12 +224,12 @@ func (h *handler) walkDirs(rootFD int, comps []string, create, target bool) (int // locate opens the directory that holds the last component of comps and // returns it with that component's name. For the root itself (no components) // it returns the root directory and an empty name. -func (h *handler) locate(rootFD int, comps []string, create bool) (int, string, error) { +func (h *handler) locate(rootFD int, comps []string) (int, string, error) { if len(comps) == 0 { fd, err := h.walkDirs(rootFD, nil, false, false) return fd, "", err } - fd, err := h.walkDirs(rootFD, parentsOf(comps), create, false) + fd, err := h.walkDirs(rootFD, parentsOf(comps), false, false) return fd, comps[len(comps)-1], err } @@ -262,7 +262,7 @@ func (h *handler) listDir(comps []string) ([]Entry, error) { return nil, err } defer closeFD(rootFD) - parentFD, name, err := h.locate(rootFD, comps, false) + parentFD, name, err := h.locate(rootFD, comps) if err != nil { return nil, err } @@ -319,7 +319,7 @@ func (h *handler) openFile(comps []string) (*os.File, error) { return nil, err } defer closeFD(rootFD) - parentFD, name, err := h.locate(rootFD, comps, false) + parentFD, name, err := h.locate(rootFD, comps) if err != nil { return nil, err } @@ -506,7 +506,7 @@ func (h *handler) removePath(comps []string, recursive bool) error { return err } defer closeFD(rootFD) - parentFD, name, err := h.locate(rootFD, comps, false) + parentFD, name, err := h.locate(rootFD, comps) if err != nil { if errors.Is(err, os.ErrNotExist) { // A missing parent was a generic 400 before descriptors; keep it. diff --git a/agent/internal/files/stat.go b/agent/internal/files/stat.go new file mode 100644 index 000000000..bf6981afc --- /dev/null +++ b/agent/internal/files/stat.go @@ -0,0 +1,63 @@ +package files + +import ( + "fmt" + "net/http" + "time" + + "golang.org/x/sys/unix" + + "github.com/GameplanePanel/gameplane/agent/internal/httpjson" +) + +// stat returns the Entry for one path (spec 040 T005). A symlink at the final +// component is reported as itself (lstat), like /files/list; it is never followed. +func (h *handler) stat(w http.ResponseWriter, req *http.Request) { + comps, err := h.components(req.URL.Query().Get("path")) + if err != nil { + h.fail(w, err) + return + } + e, err := h.statEntry(comps) + if err != nil { + h.fail(w, err) + return + } + httpjson.Write(w, http.StatusOK, e) +} + +func (h *handler) statEntry(comps []string) (Entry, error) { + rootFD, err := openRoot(h.root) + if err != nil { + return Entry{}, err + } + defer closeFD(rootFD) + dirFD, name, err := h.locate(rootFD, comps) + if err != nil { + return Entry{}, err + } + defer closeFD(dirFD) + var st unix.Stat_t + if name == "" { + err = unix.Fstat(dirFD, &st) + } else { + h.fire("stat", parentsOf(comps), name) + err = unix.Fstatat(dirFD, name, &st, unix.AT_SYMLINK_NOFOLLOW) + } + if err != nil { + return Entry{}, fmt.Errorf("stat %q: %w", name, err) + } + mode := fileModeFromStat(st.Mode) + path := "/" + if name != "" { + path = entryPath(comps[:len(comps)-1], name) + } + return Entry{ + Name: name, + Path: path, + Size: st.Size, + Mode: mode.String(), + Dir: mode.IsDir(), + ModTime: time.Unix(st.Mtim.Unix()).UTC().Format(time.RFC3339), + }, nil +} diff --git a/agent/internal/files/stat_test.go b/agent/internal/files/stat_test.go new file mode 100644 index 000000000..389b6ace2 --- /dev/null +++ b/agent/internal/files/stat_test.go @@ -0,0 +1,111 @@ +package files + +import ( + "encoding/json" + "net/http" + "os" + "path/filepath" + "strings" + "testing" +) + +func statFor(t *testing.T, h *handler, target string) (int, Entry, string) { + t.Helper() + rr := serve(t, h.stat, http.MethodGet, target, nil) + var e Entry + if rr.Code == http.StatusOK { + if err := json.Unmarshal(rr.Body.Bytes(), &e); err != nil { + t.Fatalf("decode entry: %v (body %q)", err, rr.Body.String()) + } + } + return rr.Code, e, rr.Body.String() +} + +func TestStat_File(t *testing.T) { + h, root, _ := raceHandler(t) + put(t, filepath.Join(root, "a", "b.txt"), "hello") + code, e, body := statFor(t, h, "/files/stat?path=/a/b.txt") + if code != http.StatusOK { + t.Fatalf("status=%d body=%q, want 200", code, body) + } + if e.Name != "b.txt" || e.Path != "/a/b.txt" || e.Size != 5 || e.Dir { + t.Fatalf("entry=%+v, want file b.txt at /a/b.txt size 5 dir=false", e) + } +} + +func TestStat_Directory(t *testing.T) { + h, root, _ := raceHandler(t) + put(t, filepath.Join(root, "a", "b.txt"), "hello") + code, e, body := statFor(t, h, "/files/stat?path=/a") + if code != http.StatusOK { + t.Fatalf("status=%d body=%q, want 200", code, body) + } + if e.Name != "a" || e.Path != "/a" || !e.Dir { + t.Fatalf("entry=%+v, want directory a at /a", e) + } +} + +func TestStat_Root(t *testing.T) { + h, _, _ := raceHandler(t) + code, e, body := statFor(t, h, "/files/stat?path=/") + if code != http.StatusOK { + t.Fatalf("status=%d body=%q, want 200", code, body) + } + if e.Path != "/" || !e.Dir { + t.Fatalf("entry=%+v, want root with path / and dir=true", e) + } +} + +func TestStat_Missing(t *testing.T) { + h, root, _ := raceHandler(t) + put(t, filepath.Join(root, "a", "b.txt"), "hello") + for _, target := range []string{"/files/stat?path=/nope", "/files/stat?path=/nope/child"} { + if code, _, body := statFor(t, h, target); code != http.StatusNotFound { + t.Fatalf("%s: status=%d body=%q, want 404", target, code, body) + } + } +} + +func TestStat_DotfileRejected(t *testing.T) { + h, root, _ := raceHandler(t) + put(t, filepath.Join(root, ".env"), "secret") + if code, _, body := statFor(t, h, "/files/stat?path=/.env"); code != http.StatusBadRequest { + t.Fatalf("status=%d body=%q, want 400", code, body) + } +} + +func TestStat_DotDotEscapeRejected(t *testing.T) { + h, _, _ := raceHandler(t) + if code, _, body := statFor(t, h, "/files/stat?path=/../etc/passwd"); code != http.StatusBadRequest { + t.Fatalf("status=%d body=%q, want 400", code, body) + } +} + +func TestStat_SymlinkReportedNotFollowed(t *testing.T) { + h, root, _ := raceHandler(t) + put(t, filepath.Join(root, "a", "b.txt"), "hello") + if err := os.Symlink(filepath.Join(root, "a", "b.txt"), filepath.Join(root, "link")); err != nil { + t.Fatalf("symlink: %v", err) + } + code, e, body := statFor(t, h, "/files/stat?path=/link") + if code != http.StatusOK { + t.Fatalf("status=%d body=%q, want 200", code, body) + } + if e.Name != "link" || e.Dir || !strings.HasPrefix(e.Mode, "L") { + t.Fatalf("entry=%+v, want symlink link with mode starting L and dir=false", e) + } +} + +func TestStat_AncestorSwappedForSymlinkRejected(t *testing.T) { + h, root, outside := raceHandler(t) + if err := os.Mkdir(filepath.Join(root, "sub"), 0o755); err != nil { + t.Fatalf("mkdir: %v", err) + } + put(t, filepath.Join(root, "sub", "f.txt"), "inside") + raceAt(t, h, "open", "", "sub", 1, func() { + swapForSymlink(t, filepath.Join(root, "sub"), outside) + }) + rr := serve(t, h.stat, http.MethodGet, "/files/stat?path=/sub/f.txt", nil) + assertRejected(t, rr) + assertOutsideUntouched(t, outside) +} diff --git a/agent/internal/files/stream_linux.go b/agent/internal/files/stream_linux.go new file mode 100644 index 000000000..030b2312c --- /dev/null +++ b/agent/internal/files/stream_linux.go @@ -0,0 +1,135 @@ +package files + +import ( + "fmt" + "io" + "net/http" + "os" + "strconv" + + "golang.org/x/sys/unix" +) + +// stream stores a raw request body at path, optionally resuming after the +// first offset bytes of the existing file (spec 040 T007). It is PUT +// /files/stream?path=&offset=N. Like every write it goes through a temp file +// that is renamed over the target only once the body has been copied in full. +func (h *handler) stream(w http.ResponseWriter, req *http.Request) { + q := req.URL.Query() + comps, err := h.components(q.Get("path")) + if err != nil { + h.fail(w, err) + return + } + if len(comps) == 0 { + http.Error(w, "is a directory", http.StatusBadRequest) + return + } + var offset int64 + if s := q.Get("offset"); s != "" { + offset, err = strconv.ParseInt(s, 10, 64) + if err != nil || offset < 0 { + http.Error(w, "invalid offset", http.StatusBadRequest) + return + } + } + if offset > h.maxUploadBytes || (req.ContentLength > 0 && offset+req.ContentLength > h.maxUploadBytes) { + http.Error(w, "upload exceeds size limit", http.StatusRequestEntityTooLarge) + return + } + defer func() { _ = req.Body.Close() }() + body := http.MaxBytesReader(w, req.Body, h.maxUploadBytes-offset) + defer func() { _ = body.Close() }() + + err = h.storeStream(comps, offset, req.ContentLength, body) + if err != nil { + h.fail(w, err) + return + } + w.WriteHeader(http.StatusNoContent) +} + +// storeStream writes the file at comps: the first offset bytes of the existing +// file (when offset > 0), then the body. The offset prefix stays in the file +// until the commit, so the free-space check counts it as well as the body. +func (h *handler) storeStream(comps []string, offset, contentLength int64, body io.Reader) error { + rootFD, err := openRoot(h.root) + if err != nil { + return err + } + defer closeFD(rootFD) + parents := parentsOf(comps) + name := comps[len(comps)-1] + dirFD, err := h.walkDirs(rootFD, parents, true, false) + if err != nil { + return err + } + defer closeFD(dirFD) + + need := offset + if contentLength > 0 { + need += contentLength + } + free, err := h.free(dirFD) + if err != nil { + return err + } + // need is non-negative and at most maxUploadBytes (checked by stream). + if need > 0 && uint64(need) > free { + return errNoSpace + } + + return h.storeFile(dirFD, parents, name, ".stream-", storeReplace, func(dst io.Writer) error { + if offset > 0 { + if err := h.copyPrefix(dst, dirFD, parents, name, offset); err != nil { + return err + } + } + if _, err := io.Copy(dst, body); err != nil { + return fmt.Errorf("copy body %q: %w", name, err) + } + return nil + }) +} + +// copyPrefix copies the first n bytes of the existing regular file name in +// dirFD into dst. The file must be at least n bytes long. +func (h *handler) copyPrefix(dst io.Writer, dirFD int, parents []string, name string, n int64) error { + fd, err := h.openChild(dirFD, parents, name, fileFlags) + if err != nil { + return err + } + // openChild succeeded, so fd is a valid descriptor. + f := os.NewFile(uintptr(fd), name) + defer func() { _ = f.Close() }() + fi, err := f.Stat() + if err != nil { + return fmt.Errorf("stat %q: %w", name, err) + } + if !fi.Mode().IsRegular() { + return fmt.Errorf("%w: not a regular file", errBadPath) + } + if fi.Size() < n { + return errBadOffset + } + if _, err := io.CopyN(dst, f, n); err != nil { + return fmt.Errorf("copy prefix %q: %w", name, err) + } + return nil +} + +// free reports the bytes available to unprivileged writers on the volume that +// holds dirFD. nil h.freeBytes means statfs. +func (h *handler) free(dirFD int) (uint64, error) { + if h.freeBytes != nil { + return h.freeBytes(dirFD) + } + var s unix.Statfs_t + if err := unix.Fstatfs(dirFD, &s); err != nil { + return 0, fmt.Errorf("statfs: %w", err) + } + if s.Bsize <= 0 { + return 0, nil + } + return s.Bavail * uint64(s.Bsize), nil +} diff --git a/agent/internal/files/stream_linux_test.go b/agent/internal/files/stream_linux_test.go new file mode 100644 index 000000000..4f31a92f2 --- /dev/null +++ b/agent/internal/files/stream_linux_test.go @@ -0,0 +1,238 @@ +package files + +import ( + "errors" + "io" + "io/fs" + "net/http" + "net/http/httptest" + "os" + "path/filepath" + "strings" + "testing" +) + +// errStreamCancel stands in for a client that drops the connection mid-upload. +var errStreamCancel = errors.New("client canceled upload") + +// cancelAfter yields its data and then fails, like a dropped connection. +type cancelAfter struct{ data []byte } + +func (c *cancelAfter) Read(p []byte) (int, error) { + if len(c.data) == 0 { + return 0, errStreamCancel + } + n := copy(p, c.data) + c.data = c.data[n:] + return n, nil +} + +// assertNoStreamTemp fails when any ".stream-" temporary file remains under root. +func assertNoStreamTemp(t *testing.T, root string) { + t.Helper() + err := filepath.WalkDir(root, func(p string, d fs.DirEntry, err error) error { + if err != nil { + return err + } + if strings.HasPrefix(d.Name(), ".stream-") { + t.Fatalf("temporary file remains: %s", p) + } + return nil + }) + if err != nil { + t.Fatalf("walk %s: %v", root, err) + } +} + +func streamTo(t *testing.T, h *handler, target string, body io.Reader) *httptest.ResponseRecorder { + t.Helper() + return serve(t, h.stream, http.MethodPut, target, body) +} + +func TestStream_NewFileOverHTTP(t *testing.T) { + srvURL, root := newServer(t) + req, err := http.NewRequestWithContext(t.Context(), http.MethodPut, + srvURL+"/files/stream?path=/new.txt", strings.NewReader("streamed")) + if err != nil { + t.Fatalf("new request: %v", err) + } + resp, err := http.DefaultClient.Do(req) + if err != nil { + t.Fatalf("put: %v", err) + } + _ = resp.Body.Close() + if resp.StatusCode != http.StatusNoContent { + t.Fatalf("status=%d, want 204", resp.StatusCode) + } + got, err := os.ReadFile(filepath.Join(root, "new.txt")) + if err != nil || string(got) != "streamed" { + t.Fatalf("content=%q err=%v", got, err) + } + assertNoStreamTemp(t, root) +} + +func TestStream_OverwriteExisting(t *testing.T) { + h, root, _ := raceHandler(t) + h.maxUploadBytes = DefaultMaxUploadBytes + put(t, filepath.Join(root, "f.txt"), "old-content") + resp := streamTo(t, h, "/files/stream?path=/f.txt", strings.NewReader("new")) + if resp.Code != http.StatusNoContent { + t.Fatalf("status=%d, want 204", resp.Code) + } + if got, _ := os.ReadFile(filepath.Join(root, "f.txt")); string(got) != "new" { + t.Fatalf("content=%q, want new", got) + } + assertNoStreamTemp(t, root) +} + +func TestStream_ResumeAppendsAfterOffset(t *testing.T) { + h, root, _ := raceHandler(t) + h.maxUploadBytes = DefaultMaxUploadBytes + put(t, filepath.Join(root, "f.txt"), "abcdef") + resp := streamTo(t, h, "/files/stream?path=/f.txt&offset=3", strings.NewReader("XYZ")) + if resp.Code != http.StatusNoContent { + t.Fatalf("status=%d, want 204", resp.Code) + } + if got, _ := os.ReadFile(filepath.Join(root, "f.txt")); string(got) != "abcXYZ" { + t.Fatalf("content=%q, want abcXYZ", got) + } + assertNoStreamTemp(t, root) +} + +func TestStream_OffsetBeyondSizeRejected(t *testing.T) { + h, root, _ := raceHandler(t) + h.maxUploadBytes = DefaultMaxUploadBytes + put(t, filepath.Join(root, "f.txt"), "abc") + resp := streamTo(t, h, "/files/stream?path=/f.txt&offset=10", strings.NewReader("XYZ")) + if resp.Code != http.StatusRequestedRangeNotSatisfiable { + t.Fatalf("status=%d, want 416", resp.Code) + } + if got, _ := os.ReadFile(filepath.Join(root, "f.txt")); string(got) != "abc" { + t.Fatalf("existing file changed: %q", got) + } + assertNoStreamTemp(t, root) +} + +func TestStream_OffsetMissingFileNotFound(t *testing.T) { + h, root, _ := raceHandler(t) + h.maxUploadBytes = DefaultMaxUploadBytes + resp := streamTo(t, h, "/files/stream?path=/missing.txt&offset=2", strings.NewReader("XY")) + if resp.Code != http.StatusNotFound { + t.Fatalf("status=%d, want 404", resp.Code) + } + assertNoStreamTemp(t, root) +} + +func TestStream_InvalidOffsetRejected(t *testing.T) { + h, root, _ := raceHandler(t) + h.maxUploadBytes = DefaultMaxUploadBytes + for _, off := range []string{"-1", "abc"} { + resp := streamTo(t, h, "/files/stream?path=/f.txt&offset="+off, strings.NewReader("x")) + if resp.Code != http.StatusBadRequest { + t.Fatalf("offset=%s: status=%d, want 400", off, resp.Code) + } + } + assertNoStreamTemp(t, root) +} + +func TestStream_SizeLimitBody(t *testing.T) { + h, root, _ := raceHandler(t) + h.maxUploadBytes = 4 + put(t, filepath.Join(root, "f.txt"), "keep") + resp := streamTo(t, h, "/files/stream?path=/f.txt", strings.NewReader("12345")) + if resp.Code != http.StatusRequestEntityTooLarge { + t.Fatalf("status=%d, want 413", resp.Code) + } + if got, _ := os.ReadFile(filepath.Join(root, "f.txt")); string(got) != "keep" { + t.Fatalf("existing file changed: %q", got) + } + assertNoStreamTemp(t, root) +} + +func TestStream_SizeLimitCountsOffset(t *testing.T) { + h, root, _ := raceHandler(t) + h.maxUploadBytes = 4 + put(t, filepath.Join(root, "f.txt"), "abcdef") + resp := streamTo(t, h, "/files/stream?path=/f.txt&offset=3", strings.NewReader("XY")) + if resp.Code != http.StatusRequestEntityTooLarge { + t.Fatalf("status=%d, want 413", resp.Code) + } + assertNoStreamTemp(t, root) +} + +func TestStream_FreeSpaceRefusedBeforeWriting(t *testing.T) { + h, root, _ := raceHandler(t) + h.maxUploadBytes = DefaultMaxUploadBytes + h.freeBytes = func(int) (uint64, error) { return 2, nil } + resp := streamTo(t, h, "/files/stream?path=/new.txt", strings.NewReader("12345")) + if resp.Code != http.StatusInsufficientStorage { + t.Fatalf("status=%d, want 507", resp.Code) + } + if _, err := os.Lstat(filepath.Join(root, "new.txt")); !os.IsNotExist(err) { + t.Fatalf("file created despite refusal: err=%v", err) + } + assertNoStreamTemp(t, root) +} + +func TestStream_ClientCancelKeepsExistingFile(t *testing.T) { + h, root, _ := raceHandler(t) + h.maxUploadBytes = DefaultMaxUploadBytes + put(t, filepath.Join(root, "f.txt"), "original") + resp := streamTo(t, h, "/files/stream?path=/f.txt", &cancelAfter{data: []byte("abc")}) + if resp.Code < 400 { + t.Fatalf("status=%d, want an error status", resp.Code) + } + if got, _ := os.ReadFile(filepath.Join(root, "f.txt")); string(got) != "original" { + t.Fatalf("existing file changed after cancel: %q", got) + } + assertNoStreamTemp(t, root) +} + +func TestStream_DotfileRejected(t *testing.T) { + h, root, _ := raceHandler(t) + h.maxUploadBytes = DefaultMaxUploadBytes + resp := streamTo(t, h, "/files/stream?path=/.env", strings.NewReader("x")) + if resp.Code != http.StatusBadRequest { + t.Fatalf("status=%d, want 400", resp.Code) + } + assertNoStreamTemp(t, root) +} + +func TestStream_RootRejected(t *testing.T) { + h, _, _ := raceHandler(t) + h.maxUploadBytes = DefaultMaxUploadBytes + resp := streamTo(t, h, "/files/stream?path=/", strings.NewReader("x")) + if resp.Code != http.StatusBadRequest { + t.Fatalf("status=%d, want 400", resp.Code) + } +} + +func TestStream_SymlinkDestinationRefused(t *testing.T) { + h, root, outside := raceHandler(t) + h.maxUploadBytes = DefaultMaxUploadBytes + if err := os.Symlink(filepath.Join(outside, "secret.txt"), filepath.Join(root, "link.txt")); err != nil { + t.Fatalf("symlink: %v", err) + } + resp := streamTo(t, h, "/files/stream?path=/link.txt", strings.NewReader("pwned")) + if resp.Code != http.StatusBadRequest { + t.Fatalf("status=%d, want 400", resp.Code) + } + assertOutsideUntouched(t, outside) + assertNoStreamTemp(t, root) +} + +func TestStream_AncestorSwappedForSymlinkRejected(t *testing.T) { + h, root, outside := raceHandler(t) + h.maxUploadBytes = DefaultMaxUploadBytes + if err := os.Mkdir(filepath.Join(root, "sub"), 0o755); err != nil { + t.Fatalf("mkdir: %v", err) + } + raceAt(t, h, "open", "", "sub", 1, func() { + swapForSymlink(t, filepath.Join(root, "sub"), outside) + }) + resp := streamTo(t, h, "/files/stream?path=/sub/new.txt", strings.NewReader("payload")) + if resp.Code != http.StatusBadRequest { + t.Fatalf("status=%d, want 400", resp.Code) + } + assertOutsideUntouched(t, outside) +} diff --git a/agent/internal/files/stream_more_linux_test.go b/agent/internal/files/stream_more_linux_test.go new file mode 100644 index 000000000..558e5bcb7 --- /dev/null +++ b/agent/internal/files/stream_more_linux_test.go @@ -0,0 +1,143 @@ +package files + +import ( + "errors" + "net/http" + "net/http/httptest" + "os" + "path/filepath" + "strings" + "testing" + + "github.com/go-chi/chi/v5" +) + +func TestMountWithMaxUploadBytes(t *testing.T) { + for _, tc := range []struct { + name string + opt Option + want int + }{ + {"limit applies", WithMaxUploadBytes(4), http.StatusRequestEntityTooLarge}, + {"non-positive keeps default", WithMaxUploadBytes(0), http.StatusNoContent}, + } { + t.Run(tc.name, func(t *testing.T) { + root := resolvedTempDir(t) + r := chi.NewRouter() + Mount(r, root, tc.opt) + srv := httptest.NewServer(r) + t.Cleanup(srv.Close) + req, err := http.NewRequestWithContext(t.Context(), http.MethodPut, srv.URL+"/files/stream?path=/f.txt", strings.NewReader("12345")) + if err != nil { + t.Fatal(err) + } + resp, err := http.DefaultClient.Do(req) + if err != nil { + t.Fatal(err) + } + _ = resp.Body.Close() + if resp.StatusCode != tc.want { + t.Fatalf("status=%d, want %d", resp.StatusCode, tc.want) + } + }) + } +} + +func TestStream_ResumeSourceSwappedForDirectoryRejected(t *testing.T) { + h, root, _ := raceHandler(t) + h.maxUploadBytes = DefaultMaxUploadBytes + target := filepath.Join(root, "f.txt") + put(t, target, "abc") + // The destination check sees a regular file; it becomes a directory + // before the resume prefix is opened. + raceAt(t, h, "open", "", "f.txt", 1, func() { + if err := os.Remove(target); err != nil { + t.Fatal(err) + } + if err := os.Mkdir(target, 0o755); err != nil { + t.Fatal(err) + } + }) + resp := streamTo(t, h, "/files/stream?path=/f.txt&offset=1", strings.NewReader("x")) + if resp.Code != http.StatusBadRequest { + t.Fatalf("status=%d, want 400", resp.Code) + } + assertNoStreamTemp(t, root) +} + +func TestStream_FreeSpaceErrorFails(t *testing.T) { + h, root, _ := raceHandler(t) + h.maxUploadBytes = DefaultMaxUploadBytes + h.freeBytes = func(int) (uint64, error) { return 0, errors.New("statfs failed") } + resp := streamTo(t, h, "/files/stream?path=/f.txt", strings.NewReader("abc")) + if resp.Code != http.StatusInternalServerError { + t.Fatalf("status=%d, want 500", resp.Code) + } + if _, err := os.Stat(filepath.Join(root, "f.txt")); !os.IsNotExist(err) { + t.Fatalf("file written despite failed free-space check: %v", err) + } +} + +func TestFreeUsesStatfs(t *testing.T) { + h := &handler{root: resolvedTempDir(t)} + fd, err := openRoot(h.root) + if err != nil { + t.Fatal(err) + } + defer closeFD(fd) + if free, err := h.free(fd); err != nil || free == 0 { + t.Fatalf("free=%d err=%v, want space on the test volume", free, err) + } + if _, err := h.free(-1); err == nil { + t.Fatal("free on a bad descriptor succeeded") + } +} + +func TestRoutesFailWhenRootIsMissing(t *testing.T) { + h := &handler{root: filepath.Join(resolvedTempDir(t), "gone"), maxUploadBytes: DefaultMaxUploadBytes} + for name, rr := range map[string]*httptest.ResponseRecorder{ + "stat": serve(t, h.stat, http.MethodGet, "/files/stat?path=/a", nil), + "stream": serve(t, h.stream, http.MethodPut, "/files/stream?path=/a", strings.NewReader("x")), + "rename": serve(t, h.rename, http.MethodPost, "/files/rename", renameRequest(t, "/a", "/b", false)), + } { + if rr.Code != http.StatusNotFound { + t.Errorf("%s: status=%d, want 404", name, rr.Code) + } + } +} + +func TestRename_MissingSourceParentNotFound(t *testing.T) { + h, _, _ := raceHandler(t) + if resp := doRename(t, h, "/nope/a.txt", "/b.txt", false); resp.Code != http.StatusNotFound { + t.Fatalf("status=%d, want 404", resp.Code) + } +} + +func TestRename_DirectoryIntoItselfRejected(t *testing.T) { + h, root, _ := raceHandler(t) + if err := os.MkdirAll(filepath.Join(root, "d", "sub"), 0o755); err != nil { + t.Fatal(err) + } + resp := doRename(t, h, "/d", "/d/sub/d", false) + if resp.Code != http.StatusBadRequest { + t.Fatalf("status=%d, want 400", resp.Code) + } + if info, err := os.Stat(filepath.Join(root, "d", "sub")); err != nil || !info.IsDir() { + t.Fatalf("source tree changed: %v", err) + } +} + +func TestRename_DirectoryOverFileFails(t *testing.T) { + h, root, _ := raceHandler(t) + if err := os.Mkdir(filepath.Join(root, "d"), 0o755); err != nil { + t.Fatal(err) + } + put(t, filepath.Join(root, "f.txt"), "keep") + resp := doRename(t, h, "/d", "/f.txt", true) + if resp.Code < 400 { + t.Fatalf("status=%d, want an error", resp.Code) + } + if got, err := os.ReadFile(filepath.Join(root, "f.txt")); err != nil || string(got) != "keep" { + t.Fatalf("destination changed: %q %v", got, err) + } +} diff --git a/agent/internal/files/timeouts_test.go b/agent/internal/files/timeouts_test.go index 9e1db6fd0..d7d17bd2e 100644 --- a/agent/internal/files/timeouts_test.go +++ b/agent/internal/files/timeouts_test.go @@ -18,7 +18,7 @@ func TestFileRouteTimeouts(t *testing.T) { t.Run(method+route, func(t *testing.T) { handler := chi.Chain(middlewares...).Handler(http.HandlerFunc(func(_ http.ResponseWriter, req *http.Request) { deadline, bounded := req.Context().Deadline() - transfer := route == "/files/download" || route == "/files/upload" || route == "/files/archive" + transfer := route == "/files/download" || route == "/files/upload" || route == "/files/archive" || route == "/files/stream" if bounded == transfer { t.Fatalf("bounded=%t, transfer=%t", bounded, transfer) } diff --git a/agent/specs.md b/agent/specs.md index cd3e205b5..dd530184b 100644 --- a/agent/specs.md +++ b/agent/specs.md @@ -155,6 +155,8 @@ Mode: In-pod HTTP/HTTPS sidecar (runs as a container sidecar or as a pod share-p | `--capabilities` | `` | `GAMEPLANE_CAPABILITIES` | Declared game capabilities (JSON, from `GameTemplate.spec.capabilities`) | | `--log-level` | `info` (from env) | `GAMEPLANE_LOG_LEVEL` | Log verbosity: `debug`, `info`, `warn`, `error` | | `--cli-pipe` | `/var/run/gameplane/console.pipe` (from env) | `GAMEPLANE_CLI_PIPE` | Named FIFO pipe used by the `cli` RCON protocol to drive commands via container stdin/PTY | +| `--max-upload-bytes` | `21474836480` (20 GiB) | — | Size limit in bytes for one `/files/stream` upload, counting the resume offset plus the body (Helm `files.maxUploadSize`) | +| `--files-only` | `false` | — | Serve only `/files/*`, `/healthz` and metrics; console, logs, mods, players, RCON-backed routes, status, quiesce and the heartbeat are not started (see the file-only pod paragraph below) | Resource usage env vars (set by the operator): @@ -164,6 +166,8 @@ Resource usage env vars (set by the operator): | `GAMEPLANE_CPU_LIMIT_MILLICORES` | Game container's CPU limit (for usage percentage calculation) | | `GAMEPLANE_MEM_LIMIT_BYTES` | Game container's memory limit | +**File-only pod (`--files-only`, spec 040):** while a GameServer is stopped, the operator may run a short-lived pod `-files` whose agent is started with `--files-only`. That mode mounts only the file routes (`/files/*`), `/healthz` and the metrics listener, and runs no heartbeat, RCON polling or status writer, so it never patches `status.agent` of a server that is not running. The pod mounts the data volume, the agent TLS Secret and the active mod volume; it has no RCON password or mod-portal credentials and no service-account token. + ### Endpoint groups (from mounted routes in cmd/main.go; openapi.yaml documents a subset) **Outside the auth middleware, on the `--addr` control mux:** @@ -200,6 +204,9 @@ Resource usage env vars (set by the operator): | `/files/write` | POST | Overwrite or create file; query param `path`; raw body capped at 64 MiB. An oversized request returns 413 without changing an existing file or leaving a new file. | | `/files/create` | POST | Create only; query param `path`; raw body capped at 64 MiB. An oversized request returns 413 without publishing the file. Atomically refuses any existing final entry with 409 `file already exists`, including directories, symlinks and concurrent creators. Shares rooted traversal and 0644/no inherited access-ACL new-file policy; cleans temporary files on failure and fails closed if atomic no-replace is unsupported. Older agents return 404; clients must never fall back to `/files/write`. | | `/files/upload` | POST | Upload one or more files to a directory; query param `path`; body is `multipart/form-data` with `files[]`; returns HTTP 400 if the destination directory or a destination file name is, or is reached through, a symlink | +| `/files/stat` | GET | One `Entry` (`name, path, size, mode, dir, modTime`) for query param `path`; a symlink is reported as itself, never followed; 404 when missing; dotfiles 400. 30 s bounded group. | +| `/files/rename` | POST | Body `{from, to, overwrite}`; renames within the data root with `renameat` on descriptors from the rooted walk; refuses the root and dotfiles (400); `overwrite=false` uses `RENAME_NOREPLACE` and returns 409 on an existing destination; destination parent must exist (404). 30 s bounded group. | +| `/files/stream` | PUT | Raw body to query param `path`, optional `offset=N` (resume): the first N bytes of the existing file (N ≤ its size, else 416) are copied into a temp file in the target directory, then the body is appended; fsync and `renameat` commit on success; any error or client cancel removes the temp file and leaves an existing file unchanged. Limit `--max-upload-bytes` (default 20 GiB) counts offset + body (413); refuses with 507 before writing when offset + Content-Length exceeds the volume's free space. No request timeout (transfer route). Spec 040. | | `/files/mkdir` | POST | Create directory (recursive); query param `path` | | `/files/delete` | DELETE | Delete file or directory; query param `path`, optional `recursive` (boolean) | | `/logs/tail` | GET | Tail game log over WebSocket; query params `from` (enum: `start`, `end`, default `end`) and `tail` (optional positive integer, capped at 20000 lines and 4 MiB bytes; replays last N lines before following; no replay after rotation) | @@ -243,7 +250,7 @@ All endpoints on the `--addr` control mux, except `/healthz`, return `401 Unauth - **WebRcon dials through netguard**: `rcon/websocket.go`'s `ensureLocked()` method dials the Rust WebSocket using `netguard.IsAllowed()` dial policy for defense-in-depth, allowing loopback and private addresses (since game servers legitimately run inside the cluster) while blocking the ranges `netguard.IsAllowed` rejects (link-local, multicast, NAT64/6to4). - **WebRcon dial errors are redacted**: On dial failure, `ensureLocked()` strips the URL path (which carries the escaped password) from any `*url.Error` via `redactURLErr`. If the redacted message still contains the password in raw, path-escaped, or query-escaped form (`errorLeaksSecret`; passwords shorter than three characters are not checked), it returns a generic `connection failed` error without the original cause; otherwise it wraps the redacted error with `%w` so `errors.Is`/`errors.As` still work. - **Agent-created directories are 0755**: `files` (mkdir, upload and write ancestors) and `mods` (mods dir, archive extraction dirs) create directories 0o755, matching the 0o644 files, because the game container runs as a different uid and on templates without an fsGroup reaches the shared volume only through the "other" bits. The gosec G301 finding for these two files is scoped in `.golangci.yml`. -- **Partial uploads never linger, and never destroy an existing file**: `files.savePart` writes to a temp file in the destination directory and renames it over the final name only once the copy succeeds. A save that fails after the temp file is opened — a source read error, an `io.ErrUnexpectedEOF` from a truncated multipart body, or an over-the-limit part — removes only the temp file, so a client abort mid-upload can't leave a half-written file where a later `/files/read` or `/files/download` would serve it as complete, and can't delete a file that already existed at that name. +- **Partial uploads never linger, and never destroy an existing file**: `files.savePart` writes to a temp file in the destination directory and renames it over the final name only once the copy succeeds. A save that fails after the temp file is opened — a source read error, an `io.ErrUnexpectedEOF` from a truncated multipart body, or an over-the-limit part — removes only the temp file, so a client abort mid-upload can't leave a half-written file where a later `/files/read` or `/files/download` would serve it as complete, and can't delete a file that already existed at that name. `/files/stream` follows the same temp-and-rename rule, including resumed uploads. - **Symlink confinement on upload**: `files.savePart` confines the upload destination the same way as other file operations: an existing symlink at the destination name (pointing inside the root, outside it, or dangling) is rejected with HTTP 400 (`errLinkTraversal`, which wraps `errPathOutOfRoot`), leaving the symlink and its target untouched. Regular (non-symlink) files are overwritten by a successful upload through an atomic `renameat` in the same directory descriptor. - **Extracted mod files stay world-readable**: `mods.moduleFileMode` is `0o644`, not a tighter `0o600`, because the mods volume is shared with the game container, which runs as whatever uid its image needs — a different uid than the agent's own. At `0o600` the game process couldn't read its own mods. This is the rationale behind the `.golangci.yml` gosec G302 exclusion scoped to `agent/internal/mods/mods.go`. - **Resource usage is in-pod**: The `usage` package reads from `/proc` or cgroups; no external metrics pipeline required. Cgroup mode is a fallback for older clusters; proc mode (default in production) requires the operator to set `ShareProcessNamespace: true`. diff --git a/api/cmd/gateway.go b/api/cmd/gateway.go index f7cfe456f..9fa2c2d91 100644 --- a/api/cmd/gateway.go +++ b/api/cmd/gateway.go @@ -36,6 +36,7 @@ func runGateway(ctx context.Context, args []string) error { flags.Int64Var(&cfg.CaptureMaxRetentionSeconds, "capture-max-retention", 604800, "this site's maximum capture retention in seconds") flags.Int64Var(&cfg.CaptureDefaultMaxDurationSecs, "capture-default-max-duration", 300, "this site's default capture duration in seconds") flags.Int64Var(&cfg.CaptureDefaultMaxSizeBytes, "capture-default-max-size", 943718400, "this site's capture size ceiling in bytes") + flags.Int64Var(&cfg.FilesMaxUploadBytes, "files-max-upload-bytes", 20<<30, "maximum size of one file uploaded through files/stream in bytes") if err := flags.Parse(args); err != nil { return fmt.Errorf("gateway flags: %w", err) } diff --git a/api/cmd/main.go b/api/cmd/main.go index 1e4b28251..ea49aeec4 100644 --- a/api/cmd/main.go +++ b/api/cmd/main.go @@ -285,6 +285,14 @@ func main() { } authRegistry.AttachAuditWriteSyncFunc(auditor.WriteSync) sessions.AttachMCPAudit(auditor.WriteSync) + sessions.AttachSFTPAudit(auditor.WriteSync) + // Local SFTP endpoint (spec 040): the chart passes the service token its SFTP pod uses in + // this cluster. A seeding failure is logged, not fatal: the panel still starts. + if tok := os.Getenv("GAMEPLANE_SFTP_LOCAL_SERVICE_TOKEN"); tok != "" { + if err := sessions.SeedSFTPServiceToken(ctx, scope.DefaultCluster, tok); err != nil { + logger.Error("seed sftp service token", "err", err) + } + } // Notification delivery: watch CRD status transitions (server health, // backup/restore outcomes) and push matching events to the sinks @@ -371,7 +379,13 @@ func main() { }) // Public share link endpoints (unauthenticated, token-guessable) + // fileAccess decides which servers and file operations a caller may use. The route + // middleware, the SFTP listing and the rename body check all share it. It is declared + // before the public routes so the SFTP login routes (spec 040) can use it too. + fileAccess := rbac.NewFileAccess(reg, reg) handlers.MountPublicShares(r, reg, store, auth.ShareLimiter) + // SFTP login (spec 040): service-token routes outside the protected group. + handlers.MountSFTPLogin(r, sessions, store, fileAccess, auditor) // What the telemetry reporter and the admin preview both collect from. telemetryDeps := telemetry.Deps{ @@ -400,11 +414,12 @@ func main() { r.Group(func(p chi.Router) { p.Use(sessions.Authenticate) p.Use(sessions.MCPTokenGuard) + p.Use(sessions.SFTPSessionGuard) // A broad per-IP cap on writes keeps one authenticated client from // pegging the DB or k8s API. Reads go through unlimited (the main // bottleneck there is the dashboard's own polling). p.Use(mutationRateLimit) - p.Use(rbac.Middleware(reg)) + p.Use(rbac.MiddlewareWithFiles(reg, fileAccess)) if store.Driver == "postgres" { p.Use(sessions.RevalidateStreams(isStreamingRequest, 5*time.Second, rbac.StreamGrantValidator(reg))) } @@ -418,6 +433,7 @@ func main() { handlers.MountShareLinks(p, reg, store) handlers.MountOwnership(p, reg, store) handlers.MountUsers(p, store, sessions, reg) + handlers.MountSFTPServers(p, fileAccess) handlers.MountRolesWithHelm(p, store, helmPolicy) handlers.MountAudit(p, auditor) telemetrySettings := handlers.TelemetrySettings{Dest: telemetryDest, Interval: cfg.telemetryInterval, Deps: telemetryDeps} @@ -428,10 +444,25 @@ func main() { handlers.MountAuthProviderSecrets(p, k8s, credentialsNS) handlers.MountCluster(p, reg, store, Version, cfg.clusterOps, cfg.updateChannel) handlers.MountClusterActions(p, k8s, cfg.clusterOps, cfg.clusterExternalAddress) + // SFTP endpoint per cluster (spec 040, US4): the panel's own address comes from chart values and its + // host key fingerprint from the host key Secret; remote addresses are stored by PUT /clusters/{name}/sftp. + // The host key Secret is rendered in the release namespace, which is this pod's own namespace (not + // the credentials namespace, which may differ). + sftpMount := handlers.SFTPClusterMount{ + Sessions: sessions, + Kube: k8s, + PublicAddress: os.Getenv("GAMEPLANE_SFTP_PUBLIC_ADDRESS"), + HostKeySecret: envOr("GAMEPLANE_SFTP_HOST_KEY_SECRET", "gameplane-sftp-host-key"), + Namespace: cmp.Or(os.Getenv("GAMEPLANE_NAMESPACE"), cfg.namespace), + Enabled: os.Getenv("GAMEPLANE_SFTP_ENABLED") == "true", + Port: envOrInt("GAMEPLANE_SFTP_PORT", 2222), + } + // GET /users/me/sftp reports the panel's own endpoint (spec 040) only while SFTP is enabled. + handlers.SetSFTPEndpointSource(handlers.LocalSFTPEndpointSource(sftpMount, reg.DefaultID())) if cfg.remoteClusters { - handlers.MountClusters(p, reg, k8s, credentialsNS) + handlers.MountClustersWithSFTP(p, reg, k8s, credentialsNS, sftpMount) } else { - handlers.MountClusters(p, reg, nil, credentialsNS) + handlers.MountClustersWithSFTP(p, reg, nil, credentialsNS, sftpMount) } handlers.MountInstallation(p, store, cfg.standalone, Version) handlers.MountEvents(p, reg) @@ -475,7 +506,11 @@ func main() { } handlers.MountServerCapabilities(p, reg, ws.NewCaptureGatewayClient(reg, credentialsNS), captureConfig) handlers.MountCapture(p, reg, auditor, captureConfig, cfg.agentCABundle, cfg.agentClientCert, cfg.agentClientKey) - ws.MountWithPlayerNames(p, reg, cfg.agentCABundle, cfg.agentClientCert, cfg.agentClientKey, playerNames, ws.AgentGatewayOptions{Namespace: credentialsNS}) + ws.MountWithPlayerNames(p, reg, cfg.agentCABundle, cfg.agentClientCert, cfg.agentClientKey, playerNames, ws.AgentGatewayOptions{ + Namespace: credentialsNS, + Files: fileAccess, + MaxUploadBytes: cfg.filesMaxUploadBytes, + }) }) // Usage telemetry. Run returns at once when the resolved destination is @@ -641,6 +676,8 @@ type config struct { captureMaxRetentionSecs int64 captureDefaultMaxDurationS int captureDefaultMaxSizeBytes int64 + // filesMaxUploadBytes caps one files/stream upload (Helm files.maxUploadSize). + filesMaxUploadBytes int64 gameDataStorageClass string @@ -746,6 +783,8 @@ func (c *config) bindFlags(fs *flag.FlagSet) { c.captureMaxRetentionSecs = envOrInt64("GAMEPLANE_CAPTURE_MAX_RETENTION", 604800) fs.IntVar(&c.captureDefaultMaxDurationS, "capture-default-max-duration", envOrInt("GAMEPLANE_CAPTURE_DEFAULT_MAX_DURATION", 300), "default max capture duration in seconds") c.captureDefaultMaxSizeBytes = envOrInt64("GAMEPLANE_CAPTURE_DEFAULT_MAX_SIZE", 5368709120) + fs.Int64Var(&c.filesMaxUploadBytes, "files-max-upload-bytes", envOrInt64("GAMEPLANE_FILES_MAX_UPLOAD_BYTES", 20<<30), + "maximum size of one file uploaded through files/stream (bytes); Helm files.maxUploadSize") fs.BoolVar(&c.standalone, "standalone", envOr("GAMEPLANE_STANDALONE", "") == "true", "run without a local Kubernetes cluster") fs.BoolVar(&c.remoteClusters, "remote-clusters", true, "load remote cluster credentials and connect to registered clusters") fs.StringVar(&c.panelKeyFile, "panel-key-file", envOr("GAMEPLANE_PANEL_KEY_FILE", "/data/panel.key"), "persistent standalone credential encryption key file") @@ -916,15 +955,18 @@ func bodyLimit(maxBytes int64) func(http.Handler) http.Handler { // MaxBytesReader is authoritative (main.go's bodyLimit doc comment), so // leaving them capped at 1 MiB here makes the proxy's own 64 MiB // (httpProxy default, files/write) and 512 MiB (mods/upload) ceilings -// dead code — see F-075. +// dead code — see F-075. files/stream is exempt for the same reason; the +// proxy caps it itself at the configured files.maxUploadSize +// (MaxBytesReader in ws.httpProxyLimit). func isUploadPath(path string) bool { if !strings.HasPrefix(path, "/servers/") { return false } // /servers/{name}/files/upload, /servers/{name}/files/write, - // /servers/{name}/mods/upload + // /servers/{name}/files/stream, /servers/{name}/mods/upload return strings.HasSuffix(path, "/files/upload") || strings.HasSuffix(path, "/files/write") || + strings.HasSuffix(path, "/files/stream") || strings.HasSuffix(path, "/mods/upload") } @@ -956,6 +998,12 @@ func secureHeaders(next http.Handler) http.Handler { func mutationRateLimit(next http.Handler) http.Handler { mw := auth.MutationLimiter.Middleware(next) return http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) { + // SFTP session requests arrive from the SFTP pod's address, so they are limited per + // session by auth.SFTPSessionLimiter instead of this per-IP cap. + if _, ok := auth.SFTPCallerFromContext(req.Context()); ok { + next.ServeHTTP(w, req) + return + } switch req.Method { case http.MethodPost, http.MethodPut, http.MethodPatch, http.MethodDelete: mw.ServeHTTP(w, req) @@ -1040,5 +1088,9 @@ func isLargeTransferPath(method, path string) bool { strings.HasSuffix(path, "/mods/upload") || strings.HasSuffix(path, "/mods/install") } + if method == http.MethodPut && strings.HasPrefix(path, "/servers/") { + // files/stream streams one file body on req.Context() for as long as the client uploads. + return strings.HasSuffix(path, "/files/stream") + } return false } diff --git a/api/cmd/mounts_test.go b/api/cmd/mounts_test.go index 6f6a33216..c36347e07 100644 --- a/api/cmd/mounts_test.go +++ b/api/cmd/mounts_test.go @@ -18,7 +18,7 @@ import ( var homeClientMounts = []string{ "handlers.MountAuthProviderSecrets", "handlers.MountClusterActions", - "handlers.MountClusters", + "handlers.MountClustersWithSFTP", "handlers.MountNotifications", "handlers.MountRegistrySecrets", "handlers.MountRegistryShareWithOptions", diff --git a/api/internal/audit/audit.go b/api/internal/audit/audit.go index fc3a436b2..2fde19b59 100644 --- a/api/internal/audit/audit.go +++ b/api/internal/audit/audit.go @@ -180,7 +180,7 @@ func (s *WebhookSink) post(ctx context.Context, e Event) { } body, err := json.Marshal(webhookPayload{ TS: e.TS, Actor: e.Actor, Method: e.Method, Path: e.Path, - Target: e.Target, Status: e.Status, IP: e.IP, Reason: e.Reason, + Target: e.Target, Status: e.Status, IP: e.IP, Reason: e.Reason, Source: e.Source, }) if err != nil { webhookEvents.WithLabelValues("failed").Inc() @@ -225,6 +225,7 @@ type webhookPayload struct { Status int `json:"status"` IP string `json:"ip,omitempty"` Reason string `json:"reason,omitempty"` + Source string `json:"source,omitempty"` } // New returns an Auditor configured with options. @@ -335,9 +336,15 @@ func canonicalize(e Event) []byte { field(e.IP) // Only include Reason in the canonical form if it is non-empty. // Empty Reason must serialize identically to pre-migration rows (no Reason field at all). - if e.Reason != "" { + // Source (spec 040) is appended after the Reason slot. When Source is set the Reason + // slot is always written, even if empty ("0:"), so Reason="sftp" and Source="sftp" can + // never canonicalize to the same bytes. Rows without Source are unchanged. + if e.Reason != "" || e.Source != "" { field(e.Reason) } + if e.Source != "" { + field(e.Source) + } return buf.Bytes() } @@ -359,11 +366,24 @@ func computeHash(prevHash string, e Event) string { // // chainTransaction bounds local waiters and serializes PostgreSQL writers across API replicas. func (a *Auditor) insertChained(ctx context.Context, ts, actor, method, path, target, reason string, status int, ip string) error { + return a.insertChainedEvent(ctx, Event{TS: ts, Actor: actor, Method: method, Path: path, Target: target, Status: status, IP: ip, Reason: reason}) +} + +// insertChainedEvent is insertChained for a fully populated Event (including Source). +func (a *Auditor) insertChainedEvent(ctx context.Context, e Event) error { return a.chainTransaction(ctx, "insert", 2*time.Second, func(ctx context.Context, tx *sql.Tx) error { - return a.appendEvent(ctx, tx, Event{TS: ts, Actor: actor, Method: method, Path: path, Target: target, Status: status, IP: ip, Reason: reason}) + return a.appendEvent(ctx, tx, e) }) } +// nullIfEmpty binds an empty string as SQL NULL, so dashboard rows keep source NULL. +func nullIfEmpty(s string) any { + if s == "" { + return nil + } + return s +} + func (a *Auditor) appendEvent(ctx context.Context, tx *sql.Tx, e Event) error { prevHash, err := a.previousHash(ctx, tx) if err != nil { @@ -373,9 +393,9 @@ func (a *Auditor) appendEvent(ctx context.Context, tx *sql.Tx, e Event) error { hash := computeHash(prevHash, e) if _, err := tx.ExecContext(ctx, - `INSERT INTO audit_events(ts, actor, method, path, target, status, ip, reason, prev_hash, hash) - VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)`, - e.TS, e.Actor, e.Method, e.Path, e.Target, e.Status, e.IP, e.Reason, prevHash, hash, + `INSERT INTO audit_events(ts, actor, method, path, target, status, ip, reason, source, prev_hash, hash) + VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)`, + e.TS, e.Actor, e.Method, e.Path, e.Target, e.Status, e.IP, e.Reason, nullIfEmpty(e.Source), prevHash, hash, ); err != nil { return fmt.Errorf("insert audit event: %w", err) } @@ -487,7 +507,7 @@ func (a *Auditor) Verify(ctx context.Context) (VerifyResult, error) { } rows, err := tx.QueryContext(ctx, - `SELECT id, ts, actor, method, path, COALESCE(target,''), status, COALESCE(ip,''), COALESCE(reason,''), COALESCE(prev_hash,''), COALESCE(hash,'') + `SELECT id, ts, actor, method, path, COALESCE(target,''), status, COALESCE(ip,''), COALESCE(reason,''), COALESCE(source,''), COALESCE(prev_hash,''), COALESCE(hash,'') FROM audit_events WHERE id > ? AND hash IS NOT NULL AND hash <> '' ORDER BY id ASC`, afterID, @@ -501,7 +521,7 @@ func (a *Auditor) Verify(ctx context.Context) (VerifyResult, error) { for rows.Next() { var e Event var prevHash, hash string - if err := rows.Scan(&e.ID, &e.TS, &e.Actor, &e.Method, &e.Path, &e.Target, &e.Status, &e.IP, &e.Reason, &prevHash, &hash); err != nil { + if err := rows.Scan(&e.ID, &e.TS, &e.Actor, &e.Method, &e.Path, &e.Target, &e.Status, &e.IP, &e.Reason, &e.Source, &prevHash, &hash); err != nil { return VerifyResult{}, fmt.Errorf("scan audit row: %w", err) } checked++ @@ -637,7 +657,14 @@ func Middleware(a *Auditor) func(http.Handler) http.Handler { // context the audit middleware can't see, so this stays nil. actor = u.Username } + // source is "sftp" for requests authenticated by an SFTP session (spec 040). + // A handler may record a more specific target (SFTP file routes name the + // cluster, namespace, server and paths); dashboard rows keep the ?name= query. + source := holder.Source() target := req.URL.Query().Get("name") + if t := holder.Target(); t != "" { + target = t + } // Stamp once so the DB row, stdout line, and webhook payload all // agree on the event time. ts := time.Now().UTC().Format(time.RFC3339) @@ -671,23 +698,29 @@ func Middleware(a *Auditor) func(http.Handler) http.Handler { writeCtx, cancel = context.WithDeadline(writeCtx, deadline) defer cancel() } - _ = a.insertChained(writeCtx, ts, actor, req.Method, path, target, "", rw.status, clientIP) + ev := Event{ + TS: ts, Actor: actor, Method: req.Method, Path: path, + Target: target, Status: rw.status, IP: clientIP, Source: source, + } + if source == "" { + _ = a.insertChained(writeCtx, ts, actor, req.Method, path, target, "", rw.status, clientIP) + } else { + _ = a.insertChainedEvent(writeCtx, ev) + } if a.sink != nil { - a.sink.Info("audit", + attrs := []any{ "actor", actor, "method", req.Method, "path", path, - "target", target, "status", rw.status, "ip", clientIP) + "target", target, "status", rw.status, "ip", clientIP} + if source != "" { + attrs = append(attrs, "source", source) + } + a.sink.Info("audit", attrs...) } if a.webhook != nil { - a.webhook.Enqueue(Event{ - TS: ts, Actor: actor, Method: req.Method, Path: path, - Target: target, Status: rw.status, IP: clientIP, - }) + a.webhook.Enqueue(ev) } if a.s3 != nil { - a.s3.Enqueue(Event{ - TS: ts, Actor: actor, Method: req.Method, Path: path, - Target: target, Status: rw.status, IP: clientIP, - }) + a.s3.Enqueue(ev) } }) } @@ -714,6 +747,25 @@ func (a *Auditor) WriteSync(ctx context.Context, method, path, target, reason st if u := auth.UserFromContext(ctx); u != nil && u.Username != "" { actor = u.Username } + return a.writeSync(ctx, actor, method, path, target, reason, status) +} + +// WriteSyncAs is WriteSync with an explicit actor, for unauthenticated routes that still know who +// acted (the SFTP login names the account in the request body). Source is derived like WriteSync. +func (a *Auditor) WriteSyncAs(ctx context.Context, actor, method, path, target, reason string, status int) error { + if actor == "" { + actor = "anonymous" + } + return a.writeSync(ctx, actor, method, path, target, reason, status) +} + +// writeSync is the shared body of WriteSync and WriteSyncAs. A request whose context carries an +// SFTP caller (spec 040) is recorded with source "sftp"; every other row keeps source empty. +func (a *Auditor) writeSync(ctx context.Context, actor, method, path, target, reason string, status int) error { + source := "" + if _, ok := auth.SFTPCallerFromContext(ctx); ok { + source = "sftp" + } // Extract client IP from context (set by ClientIPFromXFF middleware). // WriteSync relies on the client IP already being in the context; records @@ -723,27 +775,29 @@ func (a *Auditor) WriteSync(ctx context.Context, method, path, target, reason st // Generate timestamp once so the audit row has a consistent time. ts := time.Now().UTC().Format(time.RFC3339) - if err := a.insertChained(ctx, ts, actor, method, path, target, reason, status, clientIP); err != nil { + ev := Event{ + TS: ts, Actor: actor, Method: method, Path: path, + Target: target, Status: status, IP: clientIP, Reason: reason, Source: source, + } + if err := a.insertChainedEvent(ctx, ev); err != nil { return fmt.Errorf("audit write: %w", err) } // Best-effort fan-out to external sinks (same as Middleware). if a.sink != nil { - a.sink.Info("audit", + attrs := []any{ "actor", actor, "method", method, "path", path, - "target", target, "status", status, "ip", clientIP, "reason", reason) + "target", target, "status", status, "ip", clientIP, "reason", reason} + if source != "" { + attrs = append(attrs, "source", source) + } + a.sink.Info("audit", attrs...) } if a.webhook != nil { - a.webhook.Enqueue(Event{ - TS: ts, Actor: actor, Method: method, Path: path, - Target: target, Status: status, IP: clientIP, Reason: reason, - }) + a.webhook.Enqueue(ev) } if a.s3 != nil { - a.s3.Enqueue(Event{ - TS: ts, Actor: actor, Method: method, Path: path, - Target: target, Status: status, IP: clientIP, Reason: reason, - }) + a.s3.Enqueue(ev) } return nil @@ -757,6 +811,12 @@ func shouldLog(req *http.Request) bool { switch { case req.URL.Path == "/healthz", req.URL.Path == "/metrics": return false + case req.URL.Path == "/sftp/v1/sessions/check": + // Endpoints poll this route every 30 seconds; it is not an audit event. + return false + case req.URL.Path == "/sftp/v1/sessions/end": + // Session housekeeping by the endpoint, like sessions/check. + return false case strings.HasPrefix(req.URL.Path, "/auth/oidc/"): // Login events are audited only on success via the session // creation path; OIDC callbacks themselves are too noisy. @@ -827,6 +887,8 @@ type Event struct { Status int `json:"status"` IP string `json:"ip,omitempty"` Reason string `json:"reason,omitempty"` + // Source is the request source: "sftp" for SFTP endpoint requests, empty for dashboard requests. + Source string `json:"source,omitempty"` } // Page returns the most recent events, oldest-first within the page. @@ -838,7 +900,7 @@ func (a *Auditor) Page(req *http.Request, limit int, before int64) ([]Event, err pageSize = DefaultAuditPageSize } rows, err := a.db.DB.QueryContext(req.Context(), - `SELECT id, ts, actor, method, path, COALESCE(target,''), status, COALESCE(ip,''), COALESCE(reason,'') + `SELECT id, ts, actor, method, path, COALESCE(target,''), status, COALESCE(ip,''), COALESCE(reason,''), COALESCE(source,'') FROM audit_events WHERE (? = 0 OR id < ?) ORDER BY id DESC @@ -851,7 +913,7 @@ func (a *Auditor) Page(req *http.Request, limit int, before int64) ([]Event, err out := make([]Event, 0, pageSize) for rows.Next() { var e Event - if err := rows.Scan(&e.ID, &e.TS, &e.Actor, &e.Method, &e.Path, &e.Target, &e.Status, &e.IP, &e.Reason); err != nil { + if err := rows.Scan(&e.ID, &e.TS, &e.Actor, &e.Method, &e.Path, &e.Target, &e.Status, &e.IP, &e.Reason, &e.Source); err != nil { return nil, err } out = append(out, e) @@ -890,7 +952,7 @@ func likeEscape(s string) string { func (a *Auditor) Stream(ctx context.Context, f StreamFilter, fn func(Event) error) error { actorPattern := "%" + likeEscape(strings.ToLower(f.Actor)) + "%" rows, err := a.db.DB.QueryContext(ctx, - `SELECT id, ts, actor, method, path, COALESCE(target,''), status, COALESCE(ip,''), COALESCE(reason,'') + `SELECT id, ts, actor, method, path, COALESCE(target,''), status, COALESCE(ip,''), COALESCE(reason,''), COALESCE(source,'') FROM audit_events WHERE (? = '' OR ts >= ?) AND (? = '' OR ts <= ?) AND (? = '' OR LOWER(actor) LIKE ? ESCAPE '\') @@ -908,7 +970,7 @@ func (a *Auditor) Stream(ctx context.Context, f StreamFilter, fn func(Event) err defer func() { _ = rows.Close() }() for rows.Next() { var e Event - if err := rows.Scan(&e.ID, &e.TS, &e.Actor, &e.Method, &e.Path, &e.Target, &e.Status, &e.IP, &e.Reason); err != nil { + if err := rows.Scan(&e.ID, &e.TS, &e.Actor, &e.Method, &e.Path, &e.Target, &e.Status, &e.IP, &e.Reason, &e.Source); err != nil { return err } if err := fn(e); err != nil { diff --git a/api/internal/audit/audit_sftp_sinks_test.go b/api/internal/audit/audit_sftp_sinks_test.go new file mode 100644 index 000000000..82dc9e3d4 --- /dev/null +++ b/api/internal/audit/audit_sftp_sinks_test.go @@ -0,0 +1,120 @@ +package audit + +import ( + "bytes" + "log/slog" + "net/http" + "net/http/httptest" + "strings" + "testing" + + "github.com/GameplanePanel/gameplane/api/internal/auth" +) + +// newSinkAuditor returns an Auditor with the stdout, webhook and S3 sinks attached (workers not started, +// so queued events stay readable on the sinks' channels). +func newSinkAuditor(t *testing.T) (*Auditor, *bytes.Buffer, *WebhookSink, *S3Sink) { + t.Helper() + var logs bytes.Buffer + logger := slog.New(slog.NewTextHandler(&logs, nil)) + hook := NewWebhookSink("http://127.0.0.1:1/hook", "") + s3, err := NewS3Sink(S3Config{Endpoint: "127.0.0.1:1", Bucket: "audit", AccessKey: "a", SecretKey: "s", Insecure: true}) + if err != nil { + t.Fatalf("NewS3Sink: %v", err) + } + a := New(newStore(t), WithStdoutSink(logger), WithWebhookSink(hook), WithS3Sink(s3)) + return a, &logs, hook, s3 +} + +func TestMiddlewareSFTPSourceReachesAllSinks(t *testing.T) { + a, logs, hook, s3 := newSinkAuditor(t) + h := Middleware(a)(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + auth.SetActor(r.Context(), "alice") + auth.SetSource(r.Context(), "sftp") + auth.SetAuditTarget(r.Context(), "local/gameplane-games/srv /world") + w.WriteHeader(http.StatusNoContent) + })) + rec := httptest.NewRecorder() + h.ServeHTTP(rec, httptest.NewRequestWithContext(t.Context(), http.MethodPut, "/servers/srv/files/stream", nil)) + if rec.Code != http.StatusNoContent { + t.Fatalf("status = %d", rec.Code) + } + if !strings.Contains(logs.String(), "source=sftp") { + t.Errorf("stdout sink line lacks source: %s", logs.String()) + } + for name, got := range map[string]Event{"webhook": <-hook.ch, "s3": <-s3.ch} { + if got.Source != "sftp" || got.Actor != "alice" || got.Target != "local/gameplane-games/srv /world" { + t.Errorf("%s event = %+v", name, got) + } + } + var source string + if err := a.db.DB.QueryRowContext(t.Context(), `SELECT source FROM audit_events`).Scan(&source); err != nil || source != "sftp" { + t.Errorf("stored source = %q, %v", source, err) + } +} + +func TestMiddlewareDashboardRowFansOutWithoutSource(t *testing.T) { + a, logs, hook, s3 := newSinkAuditor(t) + h := Middleware(a)(http.HandlerFunc(func(w http.ResponseWriter, _ *http.Request) { + w.WriteHeader(http.StatusOK) + })) + h.ServeHTTP(httptest.NewRecorder(), httptest.NewRequestWithContext(t.Context(), http.MethodPost, "/servers/srv/start", nil)) + if strings.Contains(logs.String(), "source=") { + t.Errorf("dashboard row logged a source: %s", logs.String()) + } + if got := <-hook.ch; got.Source != "" { + t.Errorf("webhook source = %q", got.Source) + } + if got := <-s3.ch; got.Source != "" { + t.Errorf("s3 source = %q", got.Source) + } +} + +func TestWriteSyncSFTPCallerFansOutToSinks(t *testing.T) { + a, logs, hook, s3 := newSinkAuditor(t) + ctx := auth.WithSFTPCaller(t.Context(), auth.SFTPCaller{Cluster: "local", SessionID: 3}) + if err := a.WriteSync(ctx, http.MethodPost, "/sftp/v1/login", "local", "", http.StatusOK); err != nil { + t.Fatalf("WriteSync: %v", err) + } + if !strings.Contains(logs.String(), "source=sftp") || !strings.Contains(logs.String(), "actor=anonymous") { + t.Errorf("stdout sink line = %s", logs.String()) + } + if got := <-hook.ch; got.Source != "sftp" || got.Actor != "anonymous" { + t.Errorf("webhook event = %+v", got) + } + if got := <-s3.ch; got.Source != "sftp" { + t.Errorf("s3 event = %+v", got) + } +} + +func TestWriteSyncAsNamesActorAndDefaultsAnonymous(t *testing.T) { + a, logs, hook, s3 := newSinkAuditor(t) + // No SFTP caller: the row keeps an empty source and the logger line omits it. + if err := a.WriteSyncAs(t.Context(), "bob", http.MethodPost, "/x", "t", "reason", http.StatusForbidden); err != nil { + t.Fatalf("WriteSyncAs: %v", err) + } + if err := a.WriteSyncAs(t.Context(), "", http.MethodPost, "/y", "t", "", http.StatusOK); err != nil { + t.Fatalf("WriteSyncAs anonymous: %v", err) + } + if strings.Contains(logs.String(), "source=") { + t.Errorf("non-SFTP rows logged a source: %s", logs.String()) + } + if got := <-hook.ch; got.Actor != "bob" || got.Reason != "reason" { + t.Errorf("first webhook event = %+v", got) + } + if got := <-hook.ch; got.Actor != "anonymous" { + t.Errorf("second webhook event = %+v", got) + } + <-s3.ch + <-s3.ch +} + +func TestWriteSyncReportsDatabaseFailure(t *testing.T) { + a := New(newStore(t)) + if err := a.db.DB.Close(); err != nil { + t.Fatalf("close: %v", err) + } + if err := a.WriteSync(t.Context(), http.MethodPost, "/x", "", "", http.StatusOK); err == nil { + t.Fatal("WriteSync on a closed database succeeded") + } +} diff --git a/api/internal/audit/audit_source_test.go b/api/internal/audit/audit_source_test.go new file mode 100644 index 000000000..fa571f657 --- /dev/null +++ b/api/internal/audit/audit_source_test.go @@ -0,0 +1,286 @@ +package audit + +import ( + "bytes" + "crypto/sha256" + "encoding/hex" + "fmt" + "io" + "net/http" + "net/http/httptest" + "strconv" + "strings" + "testing" + + "github.com/GameplanePanel/gameplane/api/internal/auth" + "github.com/GameplanePanel/gameplane/api/internal/db" +) + +// srcLegacyHash reproduces the hash rule for rows without a source (the rule before spec 040): +// each field as "len:value", Reason only when non-empty, chained after the previous hash. +func srcLegacyHash(prev string, e Event) string { + var buf bytes.Buffer + field := func(s string) { + fmt.Fprintf(&buf, "%d:", len(s)) + buf.WriteString(s) + } + for _, s := range []string{e.TS, e.Actor, e.Method, e.Path, e.Target, strconv.Itoa(e.Status), e.IP} { + field(s) + } + if e.Reason != "" { + field(e.Reason) + } + sum := sha256.New() + sum.Write([]byte(prev)) + sum.Write(buf.Bytes()) + return hex.EncodeToString(sum.Sum(nil)) +} + +func TestSourcelessRowsHashAsBefore(t *testing.T) { + cases := []Event{ + {TS: "2026-01-01T00:00:00Z", Actor: "alice", Method: "POST", Path: "/servers/a/start", Target: "a", Status: 202, IP: "10.0.0.1"}, + {TS: "2026-01-01T00:00:01Z", Actor: "bob", Method: "DELETE", Path: "/servers/a", Status: 403, IP: "10.0.0.2", Reason: "forbidden"}, + } + for _, e := range cases { + if got, want := computeHash("prev", e), srcLegacyHash("prev", e); got != want { + t.Errorf("hash of %+v = %s, want %s", e, got, want) + } + } +} + +func TestSourceIsHashedAndDistinctFromReason(t *testing.T) { + base := Event{TS: "2026-01-01T00:00:00Z", Actor: "alice", Method: "POST", Path: "/sftp/v1/login", Target: "local", Status: 200} + withReason := base + withReason.Reason = "sftp" + withSource := base + withSource.Source = "sftp" + if computeHash("", withReason) == computeHash("", withSource) { + t.Error("Reason=sftp and Source=sftp hash identically") + } + if computeHash("", base) == computeHash("", withSource) { + t.Error("a source does not change the hash") + } +} + +func TestSourceChainVerifies(t *testing.T) { + store := newStore(t) + a := New(store) + ctx := t.Context() + events := []Event{ + {TS: "2026-01-01T00:00:00Z", Actor: "alice", Method: "POST", Path: "/servers/a/files/write", Target: "local/gameplane-games/a /x", Status: 200, IP: "10.0.0.1"}, + {TS: "2026-01-01T00:00:01Z", Actor: "alice", Method: "PUT", Path: "/servers/a/files/stream", Target: "local/gameplane-games/a /y", Status: 200, IP: "10.0.0.2", Source: "sftp"}, + {TS: "2026-01-01T00:00:02Z", Actor: "bob", Method: "POST", Path: "/servers/a/start", Status: 500, IP: "10.0.0.3", Reason: "denied"}, + } + for _, e := range events { + if err := a.insertChainedEvent(ctx, e); err != nil { + t.Fatalf("insert %+v: %v", e, err) + } + } + res, err := a.Verify(ctx) + if err != nil || !res.OK || res.Checked != int64(len(events)) { + t.Fatalf("Verify = %+v, %v; want OK with %d rows", res, err, len(events)) + } + + ids := srcRowIDs(t, store) + if len(ids) != len(events) { + t.Fatalf("rows = %d, want %d", len(ids), len(events)) + } + var nulls int + if err := store.DB.QueryRowContext(ctx, `SELECT COUNT(*) FROM audit_events WHERE source IS NULL`).Scan(&nulls); err != nil { + t.Fatal(err) + } + if nulls != 2 { + t.Errorf("rows with NULL source = %d, want 2 (dashboard rows stay NULL)", nulls) + } + + // Rewriting a dashboard row's source must break the chain at that row. + if _, err := store.DB.ExecContext(ctx, `UPDATE audit_events SET source = 'sftp' WHERE id = ?`, ids[0]); err != nil { + t.Fatal(err) + } + res, err = a.Verify(ctx) + if err != nil || res.OK || res.FirstBadID != ids[0] { + t.Errorf("Verify after source tamper = %+v, %v; want break at row %d", res, err, ids[0]) + } +} + +func TestSourceReadBackFromPageAndStream(t *testing.T) { + store := newStore(t) + a := New(store) + ctx := t.Context() + if err := a.insertChainedEvent(ctx, Event{TS: "2026-01-01T00:00:00Z", Actor: "alice", Method: "POST", Path: "/a", Status: 200}); err != nil { + t.Fatal(err) + } + if err := a.insertChainedEvent(ctx, Event{TS: "2026-01-01T00:00:01Z", Actor: "alice", Method: "POST", Path: "/b", Status: 200, Source: "sftp"}); err != nil { + t.Fatal(err) + } + + req := httptest.NewRequestWithContext(ctx, http.MethodGet, "/admin/audit", nil) + page, err := a.Page(req, 10, 0) + if err != nil { + t.Fatal(err) + } + if got := sourcesOf(page); got != "|sftp" && got != "sftp|" { + t.Errorf("Page sources = %q", got) + } + + var streamed []Event + if err := a.Stream(ctx, StreamFilter{}, func(e Event) error { + streamed = append(streamed, e) + return nil + }); err != nil { + t.Fatal(err) + } + if len(streamed) != 2 || streamed[0].Source != "" || streamed[1].Source != "sftp" { + t.Errorf("Stream sources = %+v", streamed) + } +} + +func TestSourceInSinkPayloads(t *testing.T) { + e := Event{TS: "2026-01-01T00:00:00Z", Actor: "alice", Method: "POST", Path: "/sftp/v1/login", Status: 200, Source: "sftp"} + + var withSource bytes.Buffer + encodeEvent(&withSource, e) + if !strings.Contains(withSource.String(), `"source":"sftp"`) { + t.Errorf("S3 line = %s, want source", withSource.String()) + } + plain := e + plain.Source = "" + var without bytes.Buffer + encodeEvent(&without, plain) + if strings.Contains(without.String(), "source") { + t.Errorf("S3 line without source = %s", without.String()) + } + + var got string + srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + b, _ := io.ReadAll(r.Body) + got = string(b) + w.WriteHeader(http.StatusNoContent) + })) + defer srv.Close() + sink := NewWebhookSink(srv.URL, "") + sink.post(t.Context(), e) + if !strings.Contains(got, `"source":"sftp"`) { + t.Errorf("webhook body = %s, want source", got) + } + sink.post(t.Context(), plain) + if strings.Contains(got, "source") { + t.Errorf("webhook body without source = %s", got) + } +} + +func TestMiddlewareRecordsSourceAndTarget(t *testing.T) { + store := newStore(t) + a := New(store) + + sftpHandler := Middleware(a)(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + auth.SetSource(r.Context(), "sftp") + auth.SetAuditTarget(r.Context(), "local/gameplane-games/srv /data/world") + w.WriteHeader(http.StatusOK) + })) + req := httptest.NewRequestWithContext(t.Context(), http.MethodPost, "/servers/srv/files/write?name=ignored", nil) + req = req.WithContext(auth.WithUser(req.Context(), &auth.User{Username: "alice"})) + sftpHandler.ServeHTTP(httptest.NewRecorder(), req) + + dashboardHandler := Middleware(a)(http.HandlerFunc(func(w http.ResponseWriter, _ *http.Request) { + w.WriteHeader(http.StatusOK) + })) + req = httptest.NewRequestWithContext(t.Context(), http.MethodPost, "/servers/srv/files/write?name=ignored", nil) + req = req.WithContext(auth.WithUser(req.Context(), &auth.User{Username: "alice"})) + dashboardHandler.ServeHTTP(httptest.NewRecorder(), req) + + rows, err := store.DB.QueryContext(t.Context(), `SELECT actor, target, COALESCE(source,'') FROM audit_events ORDER BY id`) + if err != nil { + t.Fatal(err) + } + defer func() { _ = rows.Close() }() + type row struct{ actor, target, source string } + var got []row + for rows.Next() { + var r row + if err := rows.Scan(&r.actor, &r.target, &r.source); err != nil { + t.Fatal(err) + } + got = append(got, r) + } + if err := rows.Err(); err != nil { + t.Fatal(err) + } + want := []row{ + {"alice", "local/gameplane-games/srv /data/world", "sftp"}, + {"alice", "ignored", ""}, + } + if fmt.Sprint(got) != fmt.Sprint(want) { + t.Errorf("rows = %+v, want %+v", got, want) + } +} + +func TestWriteSyncAsDerivesSourceFromSFTPCaller(t *testing.T) { + store := newStore(t) + a := New(store) + sftpCtx := auth.WithSFTPCaller(t.Context(), auth.SFTPCaller{Cluster: "local", ServiceTokenID: 1}) + if err := a.WriteSyncAs(sftpCtx, "alice", http.MethodPost, "/sftp/v1/login", "local/gameplane-games/srv", "", http.StatusOK); err != nil { + t.Fatal(err) + } + if err := a.WriteSync(t.Context(), http.MethodPost, "/users/me/sftp/password", "", "", http.StatusOK); err != nil { + t.Fatal(err) + } + events := []Event{} + if err := a.Stream(t.Context(), StreamFilter{}, func(e Event) error { + events = append(events, e) + return nil + }); err != nil { + t.Fatal(err) + } + if len(events) != 2 { + t.Fatalf("events = %d, want 2", len(events)) + } + if events[0].Actor != "alice" || events[0].Source != "sftp" || events[0].Target != "local/gameplane-games/srv" { + t.Errorf("SFTP row = %+v", events[0]) + } + if events[1].Source != "" { + t.Errorf("dashboard WriteSync row source = %q, want empty", events[1].Source) + } +} + +func TestShouldLogSkipsSFTPSessionCheck(t *testing.T) { + check := httptest.NewRequestWithContext(t.Context(), http.MethodPost, "/sftp/v1/sessions/check", nil) + if shouldLog(check) { + t.Error("sessions/check is audited, want skipped") + } + write := httptest.NewRequestWithContext(t.Context(), http.MethodPost, "/servers/srv/files/write", nil) + if !shouldLog(write) { + t.Error("file write is not audited") + } +} + +// srcRowIDs returns the ids of every audit row, oldest first. +func srcRowIDs(t *testing.T, store *db.Store) []int64 { + t.Helper() + rows, err := store.DB.QueryContext(t.Context(), `SELECT id FROM audit_events ORDER BY id`) + if err != nil { + t.Fatal(err) + } + defer func() { _ = rows.Close() }() + var ids []int64 + for rows.Next() { + var id int64 + if err := rows.Scan(&id); err != nil { + t.Fatal(err) + } + ids = append(ids, id) + } + if err := rows.Err(); err != nil { + t.Fatal(err) + } + return ids +} + +// sourcesOf joins the Source of each event with "|" for a compact comparison. +func sourcesOf(events []Event) string { + parts := make([]string, 0, len(events)) + for _, e := range events { + parts = append(parts, e.Source) + } + return strings.Join(parts, "|") +} diff --git a/api/internal/audit/s3.go b/api/internal/audit/s3.go index 6bbdd1728..966a67c0d 100644 --- a/api/internal/audit/s3.go +++ b/api/internal/audit/s3.go @@ -260,6 +260,9 @@ func encodeEvent(buf *bytes.Buffer, e Event) { if e.Reason != "" { p["reason"] = e.Reason } + if e.Source != "" { + p["source"] = e.Source + } _ = json.NewEncoder(buf).Encode(p) } diff --git a/api/internal/auth/actor.go b/api/internal/auth/actor.go index 666437595..ecd76f826 100644 --- a/api/internal/auth/actor.go +++ b/api/internal/auth/actor.go @@ -13,7 +13,7 @@ import "context" // Set/Name run in the same goroutine sequentially (Authenticate sets // before the handler runs; audit reads after it returns), so no locking // is needed. -type ActorHolder struct{ name string } +type ActorHolder struct{ name, source, target string } // Set records the resolved username. A nil receiver is a no-op so callers // needn't check whether a holder is present. @@ -51,3 +51,44 @@ func actorHolderFrom(ctx context.Context) *ActorHolder { func SetActor(ctx context.Context, name string) { actorHolderFrom(ctx).Set(name) } + +// SetSource records the request source ("sftp" for SFTP endpoint requests). A nil receiver is a no-op. +func (h *ActorHolder) SetSource(source string) { + if h != nil { + h.source = source + } +} + +// Source returns the recorded request source, or "" if none was set. +func (h *ActorHolder) Source() string { + if h == nil { + return "" + } + return h.source +} + +// SetTarget records the audit target the request resolved to (for example "cluster/namespace/server path"). +// A nil receiver is a no-op. +func (h *ActorHolder) SetTarget(target string) { + if h != nil { + h.target = target + } +} + +// Target returns the recorded audit target, or "" if none was set. +func (h *ActorHolder) Target() string { + if h == nil { + return "" + } + return h.target +} + +// SetSource records the request source on the request's audit actor holder, if one is present. +func SetSource(ctx context.Context, source string) { + actorHolderFrom(ctx).SetSource(source) +} + +// SetAuditTarget records the audit target on the request's audit actor holder, if one is present. +func SetAuditTarget(ctx context.Context, target string) { + actorHolderFrom(ctx).SetTarget(target) +} diff --git a/api/internal/auth/sessions.go b/api/internal/auth/sessions.go index 2207f90b6..e3ec2c920 100644 --- a/api/internal/auth/sessions.go +++ b/api/internal/auth/sessions.go @@ -8,6 +8,7 @@ import ( "encoding/base64" "encoding/hex" "errors" + "fmt" "log/slog" "net/http" "reflect" @@ -62,6 +63,9 @@ type SessionStore struct { // mcpAuditFn records MCP token events; nil until AttachMCPAudit runs. mcpAuditFn func(ctx context.Context, method, path, target, reason string, status int) error + + // sftpAuditFn records SFTP refusals; nil until AttachSFTPAudit runs. + sftpAuditFn func(ctx context.Context, method, path, target, reason string, status int) error } // NewSessionStore returns a new SessionStore. @@ -145,10 +149,16 @@ func (s *SessionStore) DeleteForUser(ctx context.Context, userID int64) error { } // DeleteForUserWith deletes every session of userID through ex, so a caller -// can end sessions inside its own transaction. +// can end sessions inside its own transaction. It also revokes the user's SFTP +// sessions (spec 040), so a privilege change ends SFTP access as well. func (s *SessionStore) DeleteForUserWith(ctx context.Context, ex db.Execer, userID int64) error { - _, err := ex.ExecContext(ctx, `DELETE FROM sessions WHERE user_id = ?`, userID) - return err + if _, err := ex.ExecContext(ctx, `DELETE FROM sessions WHERE user_id = ?`, userID); err != nil { + return err + } + if err := s.RevokeSFTPSessions(ctx, ex, userID, ""); err != nil { + return fmt.Errorf("delete sessions: sftp: %w", err) + } + return nil } func (s *SessionStore) gcOnce(ctx context.Context) { @@ -171,6 +181,15 @@ func (s *SessionStore) gcOnce(ctx context.Context) { `DELETE FROM mcp_tokens WHERE expires_at < ? OR revoked_at < ?`, mcpCutoff, mcpCutoff); err != nil { slog.Warn("mcp token gc", "err", err) } + // SFTP sessions: drop rows an hour after they expired or were revoked (the 30 s session check + // treats a missing row as revoked). Revoked service tokens are kept 30 days like MCP tokens. + sftpCutoff := now.Add(-time.Hour).Format(time.RFC3339) + if _, err := s.db.DB.ExecContext(ctx, `DELETE FROM sftp_sessions WHERE expires_at < ? OR revoked_at < ?`, sftpCutoff, sftpCutoff); err != nil { + slog.Warn("sftp session gc", "err", err) + } + if _, err := s.db.DB.ExecContext(ctx, `DELETE FROM sftp_service_tokens WHERE revoked_at < ?`, mcpCutoff); err != nil { + slog.Warn("sftp service token gc", "err", err) + } } // Authenticate is the middleware wrapping all protected routes. @@ -184,6 +203,10 @@ func (s *SessionStore) Authenticate(next http.Handler) http.Handler { s.serveMCPToken(w, req, raw, next) return } + if raw, ok := bearerSFTPSession(req); ok { + s.serveSFTPSession(w, req, raw, next) + return + } httperr.WriteMessage(w, req, messages.New("server.common.unauthenticated", nil)) return } @@ -223,8 +246,8 @@ func (s *SessionStore) RevalidateStreams(isStream func(*http.Request) bool, inte return } initial := UserFromContext(req.Context()) - cookie, err := req.Cookie(sessionCookie) - if err != nil || initial == nil { + recheck, ok := s.streamRecheck(req) + if !ok || initial == nil { httperr.WriteMessage(w, req, messages.New("server.common.unauthenticated", nil)) return } @@ -239,8 +262,8 @@ func (s *SessionStore) RevalidateStreams(isStream func(*http.Request) bool, inte return case <-ticker.C: check, stop := context.WithTimeout(ctx, interval) - active, _, err := s.lookup(check, cookie.Value) - valid := err == nil && active.ID == initial.ID && active.Role == initial.Role && + active, found := recheck(check) + valid := found && active.ID == initial.ID && active.Role == initial.Role && reflect.DeepEqual(active.Perms, initial.Perms) && grantValid(check, active.ID) stop() if !valid { @@ -255,6 +278,36 @@ func (s *SessionStore) RevalidateStreams(isStream func(*http.Request) bool, inte } } +// streamRecheck returns the lookup RevalidateStreams repeats for a stream: the browser session cookie, +// or, for an SFTP session transfer, the bearer SFTP session token the request was authenticated with. +// SFTP requests carry no cookie, so their transfers are re-checked against the SFTP session row, which +// revocation, expiry and the owner's session epoch all reach. ok is false when the request carries +// neither credential. +func (s *SessionStore) streamRecheck(req *http.Request) (func(context.Context) (*User, bool), bool) { + if caller, isSFTP := SFTPCallerFromContext(req.Context()); isSFTP && caller.SessionID != 0 { + raw, ok := bearerSFTPSession(req) + if !ok { + return nil, false + } + sessionID := caller.SessionID + return func(ctx context.Context) (*User, bool) { + u, sess, err := s.LookupSFTPSessionToken(ctx, raw) + if err != nil || sess.ID != sessionID { + return nil, false + } + return u, true + }, true + } + cookie, err := req.Cookie(sessionCookie) + if err != nil { + return nil, false + } + return func(ctx context.Context) (*User, bool) { + u, _, err := s.lookup(ctx, cookie.Value) + return u, err == nil + }, true +} + func (s *SessionStore) lookup(ctx context.Context, token string) (*User, string, error) { digest := sessionDigest(token) var ( diff --git a/api/internal/auth/sessions_sftp_stream_test.go b/api/internal/auth/sessions_sftp_stream_test.go new file mode 100644 index 000000000..0a8825595 --- /dev/null +++ b/api/internal/auth/sessions_sftp_stream_test.go @@ -0,0 +1,106 @@ +package auth + +import ( + "context" + "net/http" + "net/http/httptest" + "testing" + "time" +) + +// sftpStreamRequest returns a transfer request authenticated the way serveSFTPSession leaves it: the +// SFTP bearer header, no session cookie, and the session's user and SFTP caller on the context. +func sftpStreamRequest(t *testing.T, s *SessionStore, raw string) *http.Request { + t.Helper() + u, sess, err := s.LookupSFTPSessionToken(context.Background(), raw) + if err != nil { + t.Fatalf("LookupSFTPSessionToken: %v", err) + } + req := httptest.NewRequestWithContext(context.Background(), http.MethodGet, "/servers/mc/files/download", nil) + req.Header.Set("Authorization", "Bearer "+raw) + ctx := WithSFTPCaller(WithUser(req.Context(), u), SFTPCaller{Cluster: "local", SessionID: sess.ID}) + return req.WithContext(ctx) +} + +func TestRevalidateStreams_SFTPCallerWithoutCookieStreams(t *testing.T) { + ctx := context.Background() + st := newAuthDB(t) + seedUser(t, st, "alice", "hunter2", "admin") + s := NewSessionStore(st) + raw, _, err := s.IssueSFTPSession(ctx, sftpUserID(t, s, "alice"), "local", "password", 0) + if err != nil { + t.Fatalf("IssueSFTPSession: %v", err) + } + + ranToEnd := false + handler := s.RevalidateStreams( + func(*http.Request) bool { return true }, + 10*time.Millisecond, + func(context.Context, int64) bool { return true }, + )(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + // Several revalidation ticks pass while the transfer runs; it must not be cancelled. + select { + case <-r.Context().Done(): + w.WriteHeader(http.StatusGatewayTimeout) + return + case <-time.After(150 * time.Millisecond): + } + ranToEnd = true + w.WriteHeader(http.StatusOK) + })) + + rec := httptest.NewRecorder() + handler.ServeHTTP(rec, sftpStreamRequest(t, s, raw)) + if !ranToEnd { + t.Fatalf("SFTP transfer was cancelled mid-stream (status %d)", rec.Code) + } + if rec.Code != http.StatusOK { + t.Fatalf("status = %d, want 200 for an SFTP transfer without a cookie", rec.Code) + } +} + +func TestRevalidateStreams_RevokedSFTPSessionCancelsStream(t *testing.T) { + ctx := context.Background() + st := newAuthDB(t) + seedUser(t, st, "alice", "hunter2", "admin") + s := NewSessionStore(st) + raw, _, err := s.IssueSFTPSession(ctx, sftpUserID(t, s, "alice"), "local", "password", 0) + if err != nil { + t.Fatalf("IssueSFTPSession: %v", err) + } + + started := make(chan struct{}) + cancelled := make(chan struct{}) + handler := s.RevalidateStreams( + func(*http.Request) bool { return true }, + 10*time.Millisecond, + func(context.Context, int64) bool { return true }, + )(http.HandlerFunc(func(_ http.ResponseWriter, r *http.Request) { + close(started) + <-r.Context().Done() + close(cancelled) + })) + + req := sftpStreamRequest(t, s, raw) + done := make(chan struct{}) + go func() { + defer close(done) + handler.ServeHTTP(httptest.NewRecorder(), req) + }() + + select { + case <-started: + case <-time.After(5 * time.Second): + t.Fatal("stream handler did not start") + } + if err := s.RevokeSFTPSessionToken(ctx, raw); err != nil { + t.Fatalf("RevokeSFTPSessionToken: %v", err) + } + + select { + case <-cancelled: + case <-time.After(5 * time.Second): + t.Fatal("revoking the SFTP session did not cancel the stream context") + } + <-done +} diff --git a/api/internal/auth/sftp.go b/api/internal/auth/sftp.go new file mode 100644 index 000000000..7ba88cc2e --- /dev/null +++ b/api/internal/auth/sftp.go @@ -0,0 +1,208 @@ +package auth + +import ( + "bytes" + "context" + "crypto/rand" + "crypto/rsa" + "database/sql" + "errors" + "fmt" + "math/big" + "strings" + "unicode/utf8" + + "golang.org/x/crypto/ssh" +) + +const ( + // SFTPPasswordMinLen is the shortest generated SFTP password length. + SFTPPasswordMinLen = 20 + // SFTPPasswordMaxLen is the longest generated SFTP password length. + SFTPPasswordMaxLen = 40 + sftpRSAMinBits = 3072 + maxSFTPKeyNameLen = 64 +) + +var ( + // ErrSFTPKeyInvalid is returned for a line that is not one valid authorized_keys public key. + ErrSFTPKeyInvalid = errors.New("sftp key: not a valid authorized_keys public key") + // ErrSFTPKeyType is returned for a key algorithm outside the supported set. + ErrSFTPKeyType = errors.New("sftp key: unsupported key type") + // ErrSFTPKeyWeak is returned for an RSA key with fewer than 3072 bits. + ErrSFTPKeyWeak = errors.New("sftp key: RSA keys must be at least 3072 bits") + // ErrSFTPKeyName is returned when a key name is empty or longer than 64 characters. + ErrSFTPKeyName = errors.New("sftp key: name must be 1 to 64 characters") + // ErrSFTPPasswordLen is returned when a requested password length is outside 20 to 40. + ErrSFTPPasswordLen = errors.New("sftp password: length must be 20 to 40") +) + +// ParsedSFTPKey is a validated, normalized public key. +type ParsedSFTPKey struct { + Normalized string + Fingerprint string + Type string +} + +// ParseSFTPPublicKey parses one authorized_keys line. It accepts ssh-ed25519, ecdsa-sha2-nistp256/384/521 +// and ssh-rsa with a modulus of at least 3072 bits; it rejects options (command=...), comments are dropped, +// multiple lines, DSA and sk-* keys. Normalized is " " (ssh.MarshalAuthorizedKey, trimmed); +// Fingerprint is ssh.FingerprintSHA256(key) ("SHA256:..."). +func ParseSFTPPublicKey(line string) (ParsedSFTPKey, error) { + line = strings.TrimSpace(line) + if line == "" || strings.ContainsAny(line, "\r\n") { + return ParsedSFTPKey{}, ErrSFTPKeyInvalid + } + pub, _, options, rest, err := ssh.ParseAuthorizedKey([]byte(line)) + if err != nil { + return ParsedSFTPKey{}, ErrSFTPKeyInvalid + } + if len(options) > 0 || len(bytes.TrimSpace(rest)) > 0 { + return ParsedSFTPKey{}, ErrSFTPKeyInvalid + } + switch pub.Type() { + case ssh.KeyAlgoED25519, ssh.KeyAlgoECDSA256, ssh.KeyAlgoECDSA384, ssh.KeyAlgoECDSA521: + case ssh.KeyAlgoRSA: + cpk, ok := pub.(ssh.CryptoPublicKey) + if !ok { + return ParsedSFTPKey{}, ErrSFTPKeyInvalid + } + rsaKey, ok := cpk.CryptoPublicKey().(*rsa.PublicKey) + if !ok { + return ParsedSFTPKey{}, ErrSFTPKeyInvalid + } + if rsaKey.N.BitLen() < sftpRSAMinBits { + return ParsedSFTPKey{}, ErrSFTPKeyWeak + } + default: + return ParsedSFTPKey{}, ErrSFTPKeyType + } + return ParsedSFTPKey{ + Normalized: strings.TrimSpace(string(ssh.MarshalAuthorizedKey(pub))), + Fingerprint: ssh.FingerprintSHA256(pub), + Type: pub.Type(), + }, nil +} + +// SFTPFingerprintForLogin returns the SHA256 fingerprint of a public key sent by the SFTP server at login. +// The same parse rules apply; the SFTP server already verified the client's signature. +func SFTPFingerprintForLogin(publicKeyLine string) (string, error) { + parsed, err := ParseSFTPPublicKey(publicKeyLine) + if err != nil { + return "", err + } + return parsed.Fingerprint, nil +} + +// GenerateSFTPPassword returns length characters drawn uniformly from the 94 printable ASCII +// characters '!'..'~' (space excluded), using crypto/rand. +func GenerateSFTPPassword(length int) (string, error) { + if length < SFTPPasswordMinLen || length > SFTPPasswordMaxLen { + return "", ErrSFTPPasswordLen + } + buf := make([]byte, length) + for i := range buf { + // rand.Int returns a value in [0, len(sftpPasswordAlphabet)), so indexing cannot go out of range. + n, err := rand.Int(rand.Reader, sftpPasswordAlphabetLen) + if err != nil { + return "", fmt.Errorf("generate sftp password: %w", err) + } + buf[i] = sftpPasswordAlphabet[n.Int64()] + } + return string(buf), nil +} + +// sftpPasswordAlphabet is the 94 printable ASCII characters '!'..'~' (space excluded), in code order. +var sftpPasswordAlphabet = func() string { + alphabet := make([]byte, 0, 94) + for c := byte('!'); c <= '~'; c++ { + alphabet = append(alphabet, c) + } + return string(alphabet) +}() + +// sftpPasswordAlphabetLen is the bound passed to rand.Int when drawing a password character. +var sftpPasswordAlphabetLen = big.NewInt(int64(len(sftpPasswordAlphabet))) + +// AddSFTPKey validates name (trimmed, 1 to 64 runes) and the key, then stores it for userID. +func (s *SessionStore) AddSFTPKey(ctx context.Context, userID int64, name, publicKeyLine string) (SFTPKey, error) { + name = strings.TrimSpace(name) + if n := utf8.RuneCountInString(name); n < 1 || n > maxSFTPKeyNameLen { + return SFTPKey{}, ErrSFTPKeyName + } + parsed, err := ParseSFTPPublicKey(publicKeyLine) + if err != nil { + return SFTPKey{}, err + } + return s.InsertSFTPKey(ctx, userID, name, parsed.Normalized, parsed.Fingerprint) +} + +// GenerateAndStoreSFTPPassword generates a password of the given length, hashes it with HashPassword, +// replaces the user's row (SetSFTPPassword, which revokes old password sessions) and returns the +// clear text exactly once. +func (s *SessionStore) GenerateAndStoreSFTPPassword(ctx context.Context, userID int64, length int) (string, error) { + pw, err := GenerateSFTPPassword(length) + if err != nil { + return "", err + } + hash, err := HashPassword(ctx, pw) + if err != nil { + return "", fmt.Errorf("sftp password: hash: %w", err) + } + if err := s.SetSFTPPassword(ctx, userID, hash, length); err != nil { + return "", err + } + return pw, nil +} + +// VerifySFTPPassword checks pw for username. It ALWAYS spends an argon2 verify (VerifyDummy when the +// user or the password row is missing). It returns the user's id and session_epoch, read in the same query. +func (s *SessionStore) VerifySFTPPassword(ctx context.Context, username, pw string) (userID, epoch int64, ok bool, err error) { + var ( + id int64 + ep int64 + hash sql.NullString + ) + err = s.db.DB.QueryRowContext(ctx, ` + SELECT u.id, u.session_epoch, p.hash + FROM users u LEFT JOIN sftp_passwords p ON p.user_id = u.id + WHERE u.username = ?`, username, + ).Scan(&id, &ep, &hash) + if errors.Is(err, sql.ErrNoRows) || (err == nil && !hash.Valid) { + VerifyDummy(ctx, pw) + return 0, 0, false, nil + } + if err != nil { + return 0, 0, false, fmt.Errorf("verify sftp password: %w", err) + } + good, err := VerifyPassword(ctx, pw, hash.String) + if err != nil { + return 0, 0, false, fmt.Errorf("verify sftp password: %w", err) + } + if !good { + return 0, 0, false, nil + } + return id, ep, true, nil +} + +// SFTPUserByName returns the user (with Perms loaded) and users.session_epoch. +// It returns sql.ErrNoRows for an unknown username. +func (s *SessionStore) SFTPUserByName(ctx context.Context, username string) (*User, int64, error) { + var ( + u User + ep int64 + ) + err := s.db.DB.QueryRowContext(ctx, + `SELECT id, username, display_name, email, role, session_epoch FROM users WHERE username = ?`, username, + ).Scan(&u.ID, &u.Username, &u.DisplayName, &u.Email, &u.Role, &ep) + if err != nil { + return nil, 0, err + } + perms, err := s.LoadPerms(ctx, u.ID) + if err != nil { + return nil, 0, fmt.Errorf("sftp user perms: %w", err) + } + u.Perms = perms + u.sessionEpoch = ep + return &u, ep, nil +} diff --git a/api/internal/auth/sftp_check_slide_test.go b/api/internal/auth/sftp_check_slide_test.go new file mode 100644 index 000000000..75d552cba --- /dev/null +++ b/api/internal/auth/sftp_check_slide_test.go @@ -0,0 +1,80 @@ +package auth + +import ( + "context" + "testing" + "time" +) + +// TestCheckSFTPSessions_LiveSessionSlides checks that a live session the endpoint asks about gets its +// expiry pushed out, so a long transfer does not outlive its session (FR-018). +func TestCheckSFTPSessions_LiveSessionSlides(t *testing.T) { + ctx := context.Background() + st := newAuthDB(t) + seedUser(t, st, "alice", "hunter2", "admin") + s := NewSessionStore(st) + token, _, err := s.IssueSFTPSession(ctx, sftpUserID(t, s, "alice"), "local", "password", 0) + if err != nil { + t.Fatalf("IssueSFTPSession: %v", err) + } + + // A session close to expiry, still live. + nearExpiry := time.Now().Add(30 * time.Second).UTC().Format(time.RFC3339) + if _, err := st.DB.ExecContext(ctx, `UPDATE sftp_sessions SET expires_at = ? WHERE digest = ?`, + nearExpiry, SFTPTokenDigest(token)); err != nil { + t.Fatalf("set near expiry: %v", err) + } + + revoked, err := s.CheckSFTPSessions(ctx, "local", []string{SFTPTokenDigest(token)}) + if err != nil { + t.Fatalf("CheckSFTPSessions: %v", err) + } + if len(revoked) != 0 { + t.Fatalf("live session reported as revoked: %v", revoked) + } + + var got string + if err := st.DB.QueryRowContext(ctx, `SELECT expires_at FROM sftp_sessions WHERE digest = ?`, + SFTPTokenDigest(token)).Scan(&got); err != nil { + t.Fatalf("read expiry: %v", err) + } + expires, err := parseSFTPTime(got) + if err != nil { + t.Fatalf("parse expiry %q: %v", got, err) + } + if !expires.After(time.Now().Add(sftpSessionTTL - time.Minute)) { + t.Fatalf("expiry after check = %s, want it slid to about now + %s", expires, sftpSessionTTL) + } + + // The session still authenticates after the slide. + if _, _, err := s.LookupSFTPSessionToken(ctx, token); err != nil { + t.Fatalf("lookup after slide: %v", err) + } +} + +// TestCheckSFTPSessions_RevokedSessionStillReported checks that a revoked session is reported, and +// that the check does not bring it back. +func TestCheckSFTPSessions_RevokedSessionStillReported(t *testing.T) { + ctx := context.Background() + st := newAuthDB(t) + seedUser(t, st, "alice", "hunter2", "admin") + s := NewSessionStore(st) + token, _, err := s.IssueSFTPSession(ctx, sftpUserID(t, s, "alice"), "local", "password", 0) + if err != nil { + t.Fatalf("IssueSFTPSession: %v", err) + } + if err := s.RevokeSFTPSessionToken(ctx, token); err != nil { + t.Fatalf("RevokeSFTPSessionToken: %v", err) + } + + revoked, err := s.CheckSFTPSessions(ctx, "local", []string{SFTPTokenDigest(token)}) + if err != nil { + t.Fatalf("CheckSFTPSessions: %v", err) + } + if len(revoked) != 1 || revoked[0] != SFTPTokenDigest(token) { + t.Fatalf("revoked digests = %v, want the revoked session's digest", revoked) + } + if _, _, err := s.LookupSFTPSessionToken(ctx, token); err == nil { + t.Fatal("revoked session authenticates after the check") + } +} diff --git a/api/internal/auth/sftp_endpoints.go b/api/internal/auth/sftp_endpoints.go new file mode 100644 index 000000000..ecc067f89 --- /dev/null +++ b/api/internal/auth/sftp_endpoints.go @@ -0,0 +1,69 @@ +package auth + +import ( + "context" + "database/sql" + "errors" + "fmt" + "time" +) + +// SFTPClusterEndpoint is the SFTP endpoint an admin registered for a remote cluster (spec 040, US4). +type SFTPClusterEndpoint struct { + Cluster string `json:"cluster"` + Address string `json:"address"` + HostKeyFingerprint string `json:"hostKeyFingerprint"` + UpdatedAt time.Time `json:"updatedAt"` +} + +// GetSFTPClusterEndpoint returns the registered endpoint of cluster. found is false when none is set. +func (s *SessionStore) GetSFTPClusterEndpoint(ctx context.Context, cluster string) (SFTPClusterEndpoint, bool, error) { + var ( + ep = SFTPClusterEndpoint{Cluster: cluster} + updatedAt string + ) + err := s.db.DB.QueryRowContext(ctx, + `SELECT address, host_key_fingerprint, updated_at FROM sftp_cluster_endpoints WHERE cluster = ?`, cluster, + ).Scan(&ep.Address, &ep.HostKeyFingerprint, &updatedAt) + if errors.Is(err, sql.ErrNoRows) { + return SFTPClusterEndpoint{}, false, nil + } + if err != nil { + return SFTPClusterEndpoint{}, false, fmt.Errorf("get sftp cluster endpoint: %w", err) + } + ep.UpdatedAt, err = time.Parse(time.RFC3339, updatedAt) + if err != nil { + return SFTPClusterEndpoint{}, false, fmt.Errorf("get sftp cluster endpoint: updated_at: %w", err) + } + return ep, true, nil +} + +// SetSFTPClusterEndpoint stores the endpoint of ep.Cluster, replacing any earlier one, in one transaction. +func (s *SessionStore) SetSFTPClusterEndpoint(ctx context.Context, ep SFTPClusterEndpoint) (SFTPClusterEndpoint, error) { + tx, err := s.db.DB.BeginTx(ctx, nil) + if err != nil { + return SFTPClusterEndpoint{}, fmt.Errorf("set sftp cluster endpoint: begin: %w", err) + } + defer func() { _ = tx.Rollback() }() + now := time.Now().UTC().Truncate(time.Second) + res, err := tx.ExecContext(ctx, + `UPDATE sftp_cluster_endpoints SET address = ?, host_key_fingerprint = ?, updated_at = ? WHERE cluster = ?`, + ep.Address, ep.HostKeyFingerprint, now.Format(time.RFC3339), ep.Cluster) + if err != nil { + return SFTPClusterEndpoint{}, fmt.Errorf("set sftp cluster endpoint: update: %w", err) + } + if n, err := res.RowsAffected(); err != nil { + return SFTPClusterEndpoint{}, fmt.Errorf("set sftp cluster endpoint: rows: %w", err) + } else if n == 0 { + if _, err := tx.ExecContext(ctx, + `INSERT INTO sftp_cluster_endpoints(cluster, address, host_key_fingerprint, updated_at) VALUES (?, ?, ?, ?)`, + ep.Cluster, ep.Address, ep.HostKeyFingerprint, now.Format(time.RFC3339)); err != nil { + return SFTPClusterEndpoint{}, fmt.Errorf("set sftp cluster endpoint: insert: %w", err) + } + } + if err := tx.Commit(); err != nil { + return SFTPClusterEndpoint{}, fmt.Errorf("set sftp cluster endpoint: commit: %w", err) + } + ep.UpdatedAt = now + return ep, nil +} diff --git a/api/internal/auth/sftp_guard.go b/api/internal/auth/sftp_guard.go new file mode 100644 index 000000000..6f6fa6957 --- /dev/null +++ b/api/internal/auth/sftp_guard.go @@ -0,0 +1,196 @@ +package auth + +import ( + "context" + "database/sql" + "errors" + "fmt" + "log/slog" + "net/http" + "regexp" + "strings" + + "github.com/GameplanePanel/gameplane/api/internal/httperr" + "github.com/GameplanePanel/gameplane/api/internal/messages" +) + +// SFTPCaller identifies a request made on behalf of the SFTP endpoint. SessionID is 0 for service-token requests. +type SFTPCaller struct { + Cluster string + SessionID int64 + ServiceTokenID int64 +} + +type sftpCallerKey struct{} + +// WithSFTPCaller returns a context carrying the SFTP caller that made the request. +func WithSFTPCaller(ctx context.Context, c SFTPCaller) context.Context { + return context.WithValue(ctx, sftpCallerKey{}, c) +} + +// SFTPCallerFromContext returns the SFTP caller of the request, if the request came from the SFTP endpoint. +func SFTPCallerFromContext(ctx context.Context) (SFTPCaller, bool) { + c, ok := ctx.Value(sftpCallerKey{}).(SFTPCaller) + return c, ok +} + +// SFTPTokenFailLimiter caps failed SFTP bearer lookups per client IP. Valid tokens are never throttled by it. +var SFTPTokenFailLimiter = namedBucket("sftp_token_fail_ip", 5.0/60.0, 10) + +// SFTPSessionLimiter caps requests per SFTP session id. SFTP traffic arrives from the SFTP pod's +// address, so the per-IP mutation limiter cannot tell its users apart. +var SFTPSessionLimiter = namedBucket("sftp_session", 100.0, 400) + +// RequestBudget exports the per-key budget check so handlers can key buckets on values other than +// the request IP (the SFTP login keys on the body's remoteAddr and username). It writes 429 or 503 itself. +func (t *TokenBucket) RequestBudget(w http.ResponseWriter, req *http.Request, key string) bool { + return t.requestBudget(w, req, key) +} + +// sftpSessionRoutes are the only routes a session token may call (contracts/api.md). Names are [^/:]+. +var sftpSessionRoutes = []struct { + method string + re *regexp.Regexp +}{ + {http.MethodGet, regexp.MustCompile(`^/sftp/v1/servers$`)}, + {http.MethodGet, regexp.MustCompile(`^/servers/[^/:]+/files/(list|stat|download)$`)}, + {http.MethodPost, regexp.MustCompile(`^/servers/[^/:]+/files/(mkdir|rename)$`)}, + {http.MethodDelete, regexp.MustCompile(`^/servers/[^/:]+/files/delete$`)}, + {http.MethodPut, regexp.MustCompile(`^/servers/[^/:]+/files/stream$`)}, +} + +// sftpRouteAllowed reports whether a session token may call method on path. +func sftpRouteAllowed(method, path string) bool { + for _, r := range sftpSessionRoutes { + if r.method == method && r.re.MatchString(path) { + return true + } + } + return false +} + +// bearerSFTPSession returns the SFTP session token in an "Authorization: Bearer" header, if it has that prefix. +func bearerSFTPSession(req *http.Request) (string, bool) { + return bearerWithPrefix(req, SFTPSessionTokenPrefix) +} + +// bearerSFTPService returns the SFTP service token in an "Authorization: Bearer" header, if it has that prefix. +func bearerSFTPService(req *http.Request) (string, bool) { + return bearerWithPrefix(req, SFTPServicePrefix) +} + +func bearerWithPrefix(req *http.Request, prefix string) (string, bool) { + h := req.Header.Get("Authorization") + if !strings.HasPrefix(h, "Bearer ") { + return "", false + } + tok := strings.TrimPrefix(h, "Bearer ") + if !strings.HasPrefix(tok, prefix) { + return "", false + } + return tok, true +} + +// AttachSFTPAudit installs the audit writer for SFTP refusals. It is called once at startup, after the +// auditor exists (auth cannot import audit). +func (s *SessionStore) AttachSFTPAudit(fn func(ctx context.Context, method, path, target, reason string, status int) error) { + s.sftpAuditFn = fn +} + +// sftpAudit records an SFTP event through the attached writer. It is a no-op when none is attached. +func (s *SessionStore) sftpAudit(ctx context.Context, req *http.Request, reason string, status int) { + if s.sftpAuditFn == nil { + return + } + if err := s.sftpAuditFn(context.WithoutCancel(ctx), req.Method, req.URL.Path, "", reason, status); err != nil { + slog.Warn("sftp audit", "reason", reason, "err", err) + } +} + +// serveSFTPSession authenticates a bearer session token and serves the request with the session's user +// as the actor, scoped to the session's cluster. Failures never reveal which check failed. +func (s *SessionStore) serveSFTPSession(w http.ResponseWriter, req *http.Request, raw string, next http.Handler) { + u, sess, err := s.LookupSFTPSessionToken(req.Context(), raw) + if err != nil { + if errors.Is(err, sql.ErrNoRows) || errors.Is(err, errSessionInvalid) || errors.Is(err, errSessionExpired) { + // Limit first so a flood of bad tokens cannot write unbounded audit rows. + if !SFTPTokenFailLimiter.Allow(mcpClientIP(req)) { + httperr.WriteMessage(w, req, messages.New("server.common.too_many_requests", nil)) + return + } + s.sftpAudit(req.Context(), req, "sftp-refused", http.StatusUnauthorized) + httperr.WriteMessage(w, req, messages.New("server.common.unauthenticated", nil)) + return + } + httperr.WriteMessage(w, req, messages.New("server.generic.503", nil)) + return + } + if !SFTPSessionLimiter.Allow(fmt.Sprint(sess.ID)) { + httperr.WriteMessage(w, req, messages.New("server.common.too_many_requests", nil)) + return + } + ctx := WithUser(req.Context(), u) + ctx = WithSFTPCaller(ctx, SFTPCaller{Cluster: sess.Cluster, SessionID: sess.ID}) + SetActor(req.Context(), u.Username) + SetSource(req.Context(), "sftp") + s.TouchSFTPCredential(ctx, sess.UserID, sess.Credential) + s.slideSFTPSession(ctx, sess.ID) + next.ServeHTTP(w, req.WithContext(ctx)) +} + +// SFTPSessionGuard limits SFTP session-token requests to sftpSessionRoutes and pins them to the +// session's cluster. Requests without an SFTP session caller pass through unchanged. +func (s *SessionStore) SFTPSessionGuard(next http.Handler) http.Handler { + return http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) { + caller, ok := SFTPCallerFromContext(req.Context()) + if !ok || caller.SessionID == 0 { + next.ServeHTTP(w, req) + return + } + if req.Header.Get("Upgrade") != "" || !sftpRouteAllowed(req.Method, req.URL.Path) { + s.sftpAudit(req.Context(), req, "sftp-refused", http.StatusForbidden) + httperr.WriteMessage(w, req, messages.New("server.forbidden", nil)) + return + } + // The cluster is never taken from the caller: whatever the request carries is overwritten. + q := req.URL.Query() + q.Set("cluster", caller.Cluster) + req.URL.RawQuery = q.Encode() + next.ServeHTTP(w, req) + }) +} + +// SFTPServiceAuth authenticates the SFTP endpoint's service token on /sftp/v1/login, +// /sftp/v1/sessions/check and /sftp/v1/sessions/end. Anything else is refused with the generic 401. +func (s *SessionStore) SFTPServiceAuth(next http.Handler) http.Handler { + return http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) { + var ( + id int64 + cluster string + err error + ) + if raw, ok := bearerSFTPService(req); ok { + id, cluster, err = s.AuthenticateSFTPService(req.Context(), raw) + } else { + err = sql.ErrNoRows + } + if err != nil { + if errors.Is(err, sql.ErrNoRows) { + // Limit first so a flood of bad tokens cannot write unbounded audit rows. + if !SFTPTokenFailLimiter.Allow(mcpClientIP(req)) { + httperr.WriteMessage(w, req, messages.New("server.common.too_many_requests", nil)) + return + } + s.sftpAudit(req.Context(), req, "sftp-refused", http.StatusUnauthorized) + httperr.WriteMessage(w, req, messages.New("server.common.unauthenticated", nil)) + return + } + httperr.WriteMessage(w, req, messages.New("server.generic.503", nil)) + return + } + ctx := WithSFTPCaller(req.Context(), SFTPCaller{Cluster: cluster, ServiceTokenID: id}) + SetSource(req.Context(), "sftp") + s.TouchSFTPServiceToken(ctx, id) + next.ServeHTTP(w, req.WithContext(ctx)) + }) +} diff --git a/api/internal/auth/sftp_guard_fault_test.go b/api/internal/auth/sftp_guard_fault_test.go new file mode 100644 index 000000000..687a13efe --- /dev/null +++ b/api/internal/auth/sftp_guard_fault_test.go @@ -0,0 +1,159 @@ +package auth + +import ( + "context" + "encoding/base64" + "fmt" + "net/http" + "net/http/httptest" + "strings" + "sync" + "testing" + + "golang.org/x/crypto/ssh" +) + +func sshMarshal(v any) []byte { return ssh.Marshal(v) } + +func sftpBase64(b []byte) string { return base64.StdEncoding.EncodeToString(b) } + +// sftpAuditRecorder collects SFTP audit calls. +type sftpAuditRecorder struct { + mu sync.Mutex + calls []string + err error +} + +func (r *sftpAuditRecorder) record(_ context.Context, method, path, _, reason string, status int) error { + r.mu.Lock() + defer r.mu.Unlock() + r.calls = append(r.calls, method+" "+path+" "+reason+" "+http.StatusText(status)) + return r.err +} + +func (r *sftpAuditRecorder) count() int { + r.mu.Lock() + defer r.mu.Unlock() + return len(r.calls) +} + +func sftpBadBearer(t *testing.T, path, addr string) *http.Request { + t.Helper() + req := bearerRequest(t, path, "gpsftp_"+strings.Repeat("z", sftpTokenBodyLen)) + req.RemoteAddr = addr + return req +} + +func TestSFTPGuard_RefusalIsAuditedAndAuditErrorsAreSwallowed(t *testing.T) { + s, _ := sftpFault(t.Context(), t) + rec := &sftpAuditRecorder{} + s.AttachSFTPAudit(rec.record) + + next := &okHandler{} + w := httptest.NewRecorder() + s.Authenticate(next).ServeHTTP(w, sftpBadBearer(t, "/servers/a/files/list", "192.0.2.10:4000")) + if next.called || w.Code != http.StatusUnauthorized || rec.count() != 1 { + t.Fatalf("called=%v code=%d audit calls=%d", next.called, w.Code, rec.count()) + } + + // A failing audit writer only logs: the client still gets the generic 401. + rec.err = context.DeadlineExceeded + w = httptest.NewRecorder() + s.Authenticate(next).ServeHTTP(w, sftpBadBearer(t, "/servers/a/files/list", "192.0.2.11:4000")) + if w.Code != http.StatusUnauthorized || rec.count() != 2 { + t.Fatalf("code=%d audit calls=%d", w.Code, rec.count()) + } +} + +func TestSFTPGuard_BadTokenFloodIsRateLimited(t *testing.T) { + s, _ := sftpFault(t.Context(), t) + next := &okHandler{} + limited := false + for i := 0; i < 20 && !limited; i++ { + w := httptest.NewRecorder() + s.Authenticate(next).ServeHTTP(w, sftpBadBearer(t, "/servers/a/files/list", "192.0.2.20:4000")) + if w.Code == http.StatusTooManyRequests { + limited = true + } + } + if !limited { + t.Fatal("bad session tokens from one address were never rate limited") + } + + limited = false + for i := 0; i < 20 && !limited; i++ { + req := bearerRequest(t, "/sftp/v1/login", "gpsftps_"+strings.Repeat("y", sftpTokenBodyLen)) + req.RemoteAddr = "192.0.2.21:4000" + w := httptest.NewRecorder() + s.SFTPServiceAuth(next).ServeHTTP(w, req) + if w.Code == http.StatusTooManyRequests { + limited = true + } + } + if !limited { + t.Fatal("bad service tokens from one address were never rate limited") + } + if next.called { + t.Fatal("next handler ran for a bad token") + } +} + +func TestSFTPGuard_ValidSessionPastItsBudgetIsRateLimited(t *testing.T) { + ctx := t.Context() + s, uid := sftpFault(t.Context(), t) + token, _, err := s.IssueSFTPSession(ctx, uid, "local", "password", 0) + if err != nil { + t.Fatalf("IssueSFTPSession: %v", err) + } + _, sess, err := s.LookupSFTPSessionToken(ctx, token) + if err != nil { + t.Fatalf("lookup: %v", err) + } + key := fmt.Sprint(sess.ID) + for i := 0; i < 1000; i++ { + SFTPSessionLimiter.Allow(key) + } + next := &okHandler{} + limited := false + for i := 0; i < 50 && !limited; i++ { + w := httptest.NewRecorder() + s.Authenticate(next).ServeHTTP(w, bearerRequest(t, "/servers/a/files/list", token)) + limited = w.Code == http.StatusTooManyRequests + } + if !limited { + t.Fatal("session over its request budget was never refused") + } +} + +func TestSFTPGuard_DatabaseFailureAnswers503(t *testing.T) { + ctx := t.Context() + s, uid := sftpFault(t.Context(), t) + token, _, err := s.IssueSFTPSession(ctx, uid, "local", "password", 0) + if err != nil { + t.Fatalf("IssueSFTPSession: %v", err) + } + // Loading the user's permissions fails after the session row matched. + mustExecSFTP(t.Context(), t, s, `DROP TABLE user_role_bindings`) + next := &okHandler{} + w := httptest.NewRecorder() + s.Authenticate(next).ServeHTTP(w, bearerRequest(t, "/servers/a/files/list", token)) + if next.called || w.Code != http.StatusServiceUnavailable { + t.Fatalf("session: called=%v code=%d, want 503", next.called, w.Code) + } + + s2, _ := sftpFault(t.Context(), t, sftpCloseDB) + w = httptest.NewRecorder() + req := bearerRequest(t, "/sftp/v1/login", "gpsftps_"+strings.Repeat("x", sftpTokenBodyLen)) + req.RemoteAddr = "192.0.2.30:4000" + s2.SFTPServiceAuth(next).ServeHTTP(w, req) + if next.called || w.Code != http.StatusServiceUnavailable { + t.Fatalf("service: called=%v code=%d, want 503", next.called, w.Code) + } +} + +func TestActorHolder_NilReceiverIsEmpty(t *testing.T) { + var h *ActorHolder + if h.Source() != "" || h.Target() != "" { + t.Fatalf("nil holder returned %q / %q", h.Source(), h.Target()) + } +} diff --git a/api/internal/auth/sftp_guard_test.go b/api/internal/auth/sftp_guard_test.go new file mode 100644 index 000000000..f8e11e3fa --- /dev/null +++ b/api/internal/auth/sftp_guard_test.go @@ -0,0 +1,219 @@ +package auth + +import ( + "context" + "io" + "net/http" + "net/http/httptest" + "testing" +) + +// okHandler records the request it saw and answers 200. +type okHandler struct { + called bool + cluster string + user string + caller SFTPCaller + hasUser bool + hasCall bool +} + +func (h *okHandler) ServeHTTP(w http.ResponseWriter, req *http.Request) { + h.called = true + h.cluster = req.URL.Query().Get("cluster") + if u := UserFromContext(req.Context()); u != nil { + h.user, h.hasUser = u.Username, true + } + h.caller, h.hasCall = SFTPCallerFromContext(req.Context()) + w.WriteHeader(http.StatusOK) +} + +func sessionCaller(ctx context.Context) context.Context { + return WithSFTPCaller(ctx, SFTPCaller{Cluster: "local", SessionID: 7}) +} + +func TestSFTPSessionGuard_AllowedRoutes(t *testing.T) { + s := NewSessionStore(nil) + cases := []struct{ method, path string }{ + {http.MethodGet, "/sftp/v1/servers"}, + {http.MethodGet, "/servers/a/files/list"}, + {http.MethodGet, "/servers/a/files/stat"}, + {http.MethodGet, "/servers/a/files/download"}, + {http.MethodPost, "/servers/a/files/mkdir"}, + {http.MethodPost, "/servers/a/files/rename"}, + {http.MethodDelete, "/servers/a/files/delete"}, + {http.MethodPut, "/servers/a/files/stream"}, + } + for _, c := range cases { + t.Run(c.method+" "+c.path, func(t *testing.T) { + next := &okHandler{} + h := s.SFTPSessionGuard(next) + req := httptest.NewRequestWithContext(t.Context(), c.method, c.path, nil).WithContext(sessionCaller(context.Background())) + rec := httptest.NewRecorder() + h.ServeHTTP(rec, req) + if !next.called || rec.Code != http.StatusOK { + t.Fatalf("allowed route refused: called=%v code=%d", next.called, rec.Code) + } + }) + } +} + +func TestSFTPSessionGuard_RefusedRoutes(t *testing.T) { + s := NewSessionStore(nil) + cases := []struct { + name, method, path string + upgrade bool + }{ + {"post list", http.MethodPost, "/servers/a/files/list", false}, + {"get delete", http.MethodGet, "/servers/a/files/delete", false}, + {"put mkdir", http.MethodPut, "/servers/a/files/mkdir", false}, + {"upload", http.MethodPost, "/servers/x/files/upload", false}, + {"archive get", http.MethodGet, "/servers/x/files/archive", false}, + {"archive post", http.MethodPost, "/servers/x/files/archive", false}, + {"users me", http.MethodGet, "/users/me", false}, + {"sftp login", http.MethodPost, "/sftp/v1/login", false}, + {"server action", http.MethodPost, "/servers/a:start", false}, + {"upgrade header", http.MethodGet, "/servers/a/files/list", true}, + } + for _, c := range cases { + t.Run(c.name, func(t *testing.T) { + next := &okHandler{} + h := s.SFTPSessionGuard(next) + req := httptest.NewRequestWithContext(t.Context(), c.method, c.path, nil).WithContext(sessionCaller(context.Background())) + if c.upgrade { + req.Header.Set("Upgrade", "websocket") + } + rec := httptest.NewRecorder() + h.ServeHTTP(rec, req) + if next.called || rec.Code != http.StatusForbidden { + t.Fatalf("refused request got through: called=%v code=%d", next.called, rec.Code) + } + }) + } +} + +func TestSFTPSessionGuard_ForcesCluster(t *testing.T) { + s := NewSessionStore(nil) + for _, target := range []string{"/servers/a/files/list", "/servers/a/files/list?cluster=other"} { + next := &okHandler{} + h := s.SFTPSessionGuard(next) + req := httptest.NewRequestWithContext(t.Context(), http.MethodGet, target, nil).WithContext(sessionCaller(context.Background())) + h.ServeHTTP(httptest.NewRecorder(), req) + if next.cluster != "local" { + t.Fatalf("%s: cluster = %q, want local", target, next.cluster) + } + } +} + +func TestSFTPSessionGuard_PassesOtherCallers(t *testing.T) { + s := NewSessionStore(nil) + cases := map[string]func(context.Context) context.Context{ + "no caller": func(ctx context.Context) context.Context { return ctx }, + "service token": func(ctx context.Context) context.Context { + return WithSFTPCaller(ctx, SFTPCaller{Cluster: "local", ServiceTokenID: 3}) + }, + } + for name, withCaller := range cases { + t.Run(name, func(t *testing.T) { + next := &okHandler{} + h := s.SFTPSessionGuard(next) + req := httptest.NewRequestWithContext(withCaller(t.Context()), http.MethodGet, "/users/me", nil) + rec := httptest.NewRecorder() + h.ServeHTTP(rec, req) + if !next.called || rec.Code != http.StatusOK { + t.Fatalf("request refused: called=%v code=%d", next.called, rec.Code) + } + }) + } +} + +func TestSFTPAuthenticate_SessionTokenAndFailures(t *testing.T) { + ctx := context.Background() + st := newAuthDB(t) + seedUser(t, st, "alice", "hunter2", "admin") + s := NewSessionStore(st) + alice := sftpUserID(t, s, "alice") + + revokedToken, _, err := s.IssueSFTPSession(ctx, alice, "local", "password", 0) + if err != nil { + t.Fatalf("IssueSFTPSession: %v", err) + } + if err := s.RevokeSFTPSessions(ctx, st.DB, alice, "password"); err != nil { + t.Fatalf("revoke: %v", err) + } + token, _, err := s.IssueSFTPSession(ctx, alice, "local", "password", 0) + if err != nil { + t.Fatalf("IssueSFTPSession: %v", err) + } + + okNext := &okHandler{} + req := bearerRequest(t, "/servers/a/files/list", token) + rec := httptest.NewRecorder() + s.Authenticate(okNext).ServeHTTP(rec, req) + if !okNext.called || okNext.user != "alice" || !okNext.hasCall || okNext.caller.Cluster != "local" || okNext.caller.SessionID == 0 { + t.Fatalf("valid session not served as alice: %+v", okNext) + } + + // Revoked, garbage and service-token bearers all get the same generic 401. + var want string + for i, bad := range []string{revokedToken, "gpsftp_garbage", "gpsftps_" + token[len(SFTPSessionTokenPrefix):]} { + next := &okHandler{} + rec := httptest.NewRecorder() + s.Authenticate(next).ServeHTTP(rec, bearerRequest(t, "/servers/a/files/list", bad)) + if next.called || rec.Code != http.StatusUnauthorized { + t.Fatalf("case %d: called=%v code=%d", i, next.called, rec.Code) + } + body, _ := io.ReadAll(rec.Body) + if i == 0 { + want = string(body) + } else if string(body) != want { + t.Fatalf("case %d body %q differs from %q", i, body, want) + } + } +} + +func TestSFTPServiceAuth_OnlyServiceTokens(t *testing.T) { + ctx := context.Background() + st := newAuthDB(t) + seedUser(t, st, "alice", "hunter2", "admin") + s := NewSessionStore(st) + alice := sftpUserID(t, s, "alice") + + _, svcRaw, err := s.CreateSFTPServiceToken(ctx, "local") + if err != nil { + t.Fatalf("CreateSFTPServiceToken: %v", err) + } + sessRaw, _, err := s.IssueSFTPSession(ctx, alice, "local", "password", 0) + if err != nil { + t.Fatalf("IssueSFTPSession: %v", err) + } + + next := &okHandler{} + rec := httptest.NewRecorder() + s.SFTPServiceAuth(next).ServeHTTP(rec, bearerRequest(t, "/sftp/v1/login", svcRaw)) + if !next.called || rec.Code != http.StatusOK || !next.hasCall || next.caller.Cluster != "local" || next.caller.ServiceTokenID == 0 { + t.Fatalf("service token refused: called=%v code=%d caller=%+v", next.called, rec.Code, next.caller) + } + + for name, auth := range map[string]string{"session token": sessRaw, "none": ""} { + t.Run(name, func(t *testing.T) { + next := &okHandler{} + rec := httptest.NewRecorder() + req := httptest.NewRequestWithContext(t.Context(), http.MethodPost, "/sftp/v1/login", nil) + if auth != "" { + req.Header.Set("Authorization", "Bearer "+auth) + } + s.SFTPServiceAuth(next).ServeHTTP(rec, req) + if next.called || rec.Code != http.StatusUnauthorized { + t.Fatalf("called=%v code=%d", next.called, rec.Code) + } + }) + } +} + +// bearerRequest builds a cookie-less request carrying a bearer token. +func bearerRequest(t *testing.T, path, token string) *http.Request { + req := httptest.NewRequestWithContext(t.Context(), http.MethodGet, path, nil) + req.Header.Set("Authorization", "Bearer "+token) + return req +} diff --git a/api/internal/auth/sftp_revoke.go b/api/internal/auth/sftp_revoke.go new file mode 100644 index 000000000..67fbe6a9f --- /dev/null +++ b/api/internal/auth/sftp_revoke.go @@ -0,0 +1,54 @@ +package auth + +import ( + "context" + "fmt" +) + +// SFTPMaxEndDigests bounds one EndSFTPSessions call. +const SFTPMaxEndDigests = sftpMaxCheckDigests + +// SFTPTokenDigest returns the stored digest of a raw gpsftp_ session token. It is the key +// CheckSFTPSessions takes, so callers can map digests back to the tokens they hold. +func SFTPTokenDigest(raw string) string { + return sessionDigest(raw) +} + +// RevokeSFTPSessionToken revokes the single session row of a raw gpsftp_ token. Login uses it when +// the success audit row cannot be written, so a token the caller never received cannot be used. +func (s *SessionStore) RevokeSFTPSessionToken(ctx context.Context, raw string) error { + if _, err := s.db.DB.ExecContext(ctx, + `UPDATE sftp_sessions SET revoked_at = ? WHERE digest = ? AND revoked_at IS NULL`, + sftpNow(), sessionDigest(raw)); err != nil { + return fmt.Errorf("revoke sftp session token: %w", err) + } + return nil +} + +// EndSFTPSessions revokes the live sessions among digests that were issued for cluster, in one +// transaction. Unknown, foreign-cluster and already revoked digests are ignored. +func (s *SessionStore) EndSFTPSessions(ctx context.Context, cluster string, digests []string) error { + if len(digests) == 0 { + return nil + } + if len(digests) > SFTPMaxEndDigests { + return fmt.Errorf("end sftp sessions: %d digests exceeds %d", len(digests), SFTPMaxEndDigests) + } + tx, err := s.db.DB.BeginTx(ctx, nil) + if err != nil { + return fmt.Errorf("end sftp sessions: %w", err) + } + defer func() { _ = tx.Rollback() }() + now := sftpNow() + for _, d := range digests { + if _, err := tx.ExecContext(ctx, + `UPDATE sftp_sessions SET revoked_at = ? WHERE digest = ? AND cluster = ? AND revoked_at IS NULL`, + now, d, cluster); err != nil { + return fmt.Errorf("end sftp sessions: %w", err) + } + } + if err := tx.Commit(); err != nil { + return fmt.Errorf("end sftp sessions: commit: %w", err) + } + return nil +} diff --git a/api/internal/auth/sftp_seed_test.go b/api/internal/auth/sftp_seed_test.go new file mode 100644 index 000000000..b3c0d630b --- /dev/null +++ b/api/internal/auth/sftp_seed_test.go @@ -0,0 +1,107 @@ +package auth + +import ( + "context" + "database/sql" + "errors" + "testing" +) + +// sftpSeedCount returns how many rows of sftp_service_tokens hold the digest of raw. +func sftpSeedCount(t *testing.T, s *SessionStore, raw string) int { + t.Helper() + var n int + if err := s.db.DB.QueryRowContext(context.Background(), + `SELECT COUNT(*) FROM sftp_service_tokens WHERE digest = ?`, sessionDigest(raw)).Scan(&n); err != nil { + t.Fatalf("count seeded token rows: %v", err) + } + return n +} + +func TestSeedSFTPServiceToken_IdempotentAndAuthenticates(t *testing.T) { + ctx := context.Background() + s := NewSessionStore(newAuthDB(t)) + raw := SFTPServicePrefix + "A1b2C3d4E5f6G7h8I9j0K1l2M3n4O5p6Q7r8S9t0U1v" + if !validSFTPToken(raw, SFTPServicePrefix) { + t.Fatalf("fixture token %q is not well formed", raw) + } + + for i := 0; i < 2; i++ { + if err := s.SeedSFTPServiceToken(ctx, "local", raw); err != nil { + t.Fatalf("SeedSFTPServiceToken pass %d: %v", i+1, err) + } + } + if n := sftpSeedCount(t, s, raw); n != 1 { + t.Fatalf("stored rows = %d, want 1 after two seeds", n) + } + id, cluster, err := s.AuthenticateSFTPService(ctx, raw) + if err != nil { + t.Fatalf("AuthenticateSFTPService after seed: %v", err) + } + if id == 0 || cluster != "local" { + t.Fatalf("authenticated as id=%d cluster=%q, want non-zero id in local", id, cluster) + } +} + +func TestSeedSFTPServiceToken_RejectsMalformed(t *testing.T) { + ctx := context.Background() + s := NewSessionStore(newAuthDB(t)) + for _, raw := range []string{"", "gpsftp_" + "A1b2C3d4E5f6G7h8I9j0K1l2M3n4O5p6Q7r8S9t0U1v", SFTPServicePrefix + "short"} { + err := s.SeedSFTPServiceToken(ctx, "local", raw) + if !errors.Is(err, errSFTPSeedFormat) { + t.Fatalf("SeedSFTPServiceToken(%q) error = %v, want errSFTPSeedFormat", raw, err) + } + } + var total int + if err := s.db.DB.QueryRowContext(ctx, `SELECT COUNT(*) FROM sftp_service_tokens`).Scan(&total); err != nil { + t.Fatalf("count tokens: %v", err) + } + if total != 0 { + t.Fatalf("malformed seeds stored %d rows, want 0", total) + } +} + +func TestSeedSFTPServiceToken_RevokedStaysRevoked(t *testing.T) { + ctx := context.Background() + s := NewSessionStore(newAuthDB(t)) + raw := SFTPServicePrefix + "A1b2C3d4E5f6G7h8I9j0K1l2M3n4O5p6Q7r8S9t0U1v" + if err := s.SeedSFTPServiceToken(ctx, "local", raw); err != nil { + t.Fatalf("seed: %v", err) + } + var id int64 + if err := s.db.DB.QueryRowContext(ctx, + `SELECT id FROM sftp_service_tokens WHERE digest = ?`, sessionDigest(raw)).Scan(&id); err != nil { + t.Fatalf("find seeded row: %v", err) + } + if err := s.RevokeSFTPServiceToken(ctx, "local", id); err != nil { + t.Fatalf("RevokeSFTPServiceToken: %v", err) + } + + // A restart re-runs the seed with the same chart token: it must not resurrect it. + if err := s.SeedSFTPServiceToken(ctx, "local", raw); err != nil { + t.Fatalf("re-seed after revoke: %v", err) + } + if _, _, err := s.AuthenticateSFTPService(ctx, raw); !errors.Is(err, sql.ErrNoRows) { + t.Fatalf("revoked seeded token authenticated, err = %v", err) + } + if n := sftpSeedCount(t, s, raw); n != 1 { + t.Fatalf("stored rows = %d, want 1", n) + } +} + +func TestSeedSFTPServiceToken_AtLimitLogsAndContinues(t *testing.T) { + ctx := context.Background() + s := NewSessionStore(newAuthDB(t)) + for i := 0; i < SFTPMaxActiveServiceTokens; i++ { + if _, _, err := s.CreateSFTPServiceToken(ctx, "local"); err != nil { + t.Fatalf("create token %d: %v", i+1, err) + } + } + raw := SFTPServicePrefix + "A1b2C3d4E5f6G7h8I9j0K1l2M3n4O5p6Q7r8S9t0U1v" + if err := s.SeedSFTPServiceToken(ctx, "local", raw); err != nil { + t.Fatalf("seed at the limit must not fail startup, got %v", err) + } + if _, _, err := s.AuthenticateSFTPService(ctx, raw); !errors.Is(err, sql.ErrNoRows) { + t.Fatalf("token stored past the limit, authenticate err = %v", err) + } +} diff --git a/api/internal/auth/sftp_service_token_sessions_test.go b/api/internal/auth/sftp_service_token_sessions_test.go new file mode 100644 index 000000000..a2ae8a4a5 --- /dev/null +++ b/api/internal/auth/sftp_service_token_sessions_test.go @@ -0,0 +1,141 @@ +package auth + +import ( + "context" + "database/sql" + "errors" + "testing" +) + +// sftpActiveServiceTokens counts the unrevoked service tokens of cluster. +func sftpActiveServiceTokens(t *testing.T, s *SessionStore, cluster string) int { + t.Helper() + var n int + if err := s.db.DB.QueryRowContext(context.Background(), + `SELECT COUNT(*) FROM sftp_service_tokens WHERE cluster = ? AND revoked_at IS NULL`, cluster).Scan(&n); err != nil { + t.Fatalf("count active service tokens: %v", err) + } + return n +} + +// TestRevokeSFTPServiceToken_EndsSessionsMintedThroughIt checks that revoking a service token ends the +// sessions minted through it, and only those. +func TestRevokeSFTPServiceToken_EndsSessionsMintedThroughIt(t *testing.T) { + ctx := context.Background() + st := newAuthDB(t) + seedUser(t, st, "alice", "hunter2", "admin") + s := NewSessionStore(st) + alice := sftpUserID(t, s, "alice") + + tok, _, err := s.CreateSFTPServiceToken(ctx, "local") + if err != nil { + t.Fatalf("CreateSFTPServiceToken: %v", err) + } + other, _, err := s.CreateSFTPServiceToken(ctx, "local") + if err != nil { + t.Fatalf("CreateSFTPServiceToken other: %v", err) + } + + minted, _, err := s.IssueSFTPSessionForToken(ctx, alice, "local", "password", 0, tok.ID) + if err != nil { + t.Fatalf("IssueSFTPSessionForToken: %v", err) + } + mintedOther, _, err := s.IssueSFTPSessionForToken(ctx, alice, "local", "password", 0, other.ID) + if err != nil { + t.Fatalf("IssueSFTPSessionForToken other: %v", err) + } + direct, _, err := s.IssueSFTPSession(ctx, alice, "local", "password", 0) + if err != nil { + t.Fatalf("IssueSFTPSession: %v", err) + } + + if err := s.RevokeSFTPServiceToken(ctx, "local", tok.ID); err != nil { + t.Fatalf("RevokeSFTPServiceToken: %v", err) + } + + if _, _, err := s.LookupSFTPSessionToken(ctx, minted); !errors.Is(err, sql.ErrNoRows) { + t.Fatalf("session minted through the revoked token still resolves, err = %v", err) + } + for name, raw := range map[string]string{"other token": mintedOther, "direct session": direct} { + if _, _, err := s.LookupSFTPSessionToken(ctx, raw); err != nil { + t.Fatalf("%s was ended by an unrelated revoke: %v", name, err) + } + } +} + +// TestSeedSFTPServiceToken_NewDigestReplacesPreviousSeed checks that a re-rendered seed secret replaces +// the earlier seeded token and ends its sessions, so the active count never includes both. +func TestSeedSFTPServiceToken_NewDigestReplacesPreviousSeed(t *testing.T) { + ctx := context.Background() + st := newAuthDB(t) + seedUser(t, st, "alice", "hunter2", "admin") + s := NewSessionStore(st) + alice := sftpUserID(t, s, "alice") + + first := SFTPServicePrefix + "A1b2C3d4E5f6G7h8I9j0K1l2M3n4O5p6Q7r8S9t0U1v" + second := SFTPServicePrefix + "Z9y8X7w6V5u4T3s2R1q0P9o8N7m6L5k4J3i2H1g0F9e" + if err := s.SeedSFTPServiceToken(ctx, "local", first); err != nil { + t.Fatalf("seed first: %v", err) + } + firstID, _, err := s.AuthenticateSFTPService(ctx, first) + if err != nil { + t.Fatalf("authenticate first seed: %v", err) + } + session, _, err := s.IssueSFTPSessionForToken(ctx, alice, "local", "password", 0, firstID) + if err != nil { + t.Fatalf("issue session through first seed: %v", err) + } + + if err := s.SeedSFTPServiceToken(ctx, "local", second); err != nil { + t.Fatalf("seed second: %v", err) + } + + if _, _, err := s.AuthenticateSFTPService(ctx, first); !errors.Is(err, sql.ErrNoRows) { + t.Fatalf("previous seed still authenticates, err = %v", err) + } + if _, _, err := s.LookupSFTPSessionToken(ctx, session); !errors.Is(err, sql.ErrNoRows) { + t.Fatalf("session of the previous seed still resolves, err = %v", err) + } + if _, _, err := s.AuthenticateSFTPService(ctx, second); err != nil { + t.Fatalf("new seed does not authenticate: %v", err) + } + if n := sftpActiveServiceTokens(t, s, "local"); n != 1 { + t.Fatalf("active service tokens = %d, want 1 after re-seed", n) + } + + // The replaced seed is revoked for good: re-seeding it does not bring it back. + if err := s.SeedSFTPServiceToken(ctx, "local", first); err != nil { + t.Fatalf("re-seed first: %v", err) + } + if _, _, err := s.AuthenticateSFTPService(ctx, first); !errors.Is(err, sql.ErrNoRows) { + t.Fatalf("replaced seed came back, err = %v", err) + } +} + +// TestSeedSFTPServiceToken_LeavesAdminTokensAlone checks that the replacement only touches seeded tokens: +// an admin-created token keeps working across a re-seed. +func TestSeedSFTPServiceToken_LeavesAdminTokensAlone(t *testing.T) { + ctx := context.Background() + st := newAuthDB(t) + s := NewSessionStore(st) + + admin, adminRaw, err := s.CreateSFTPServiceToken(ctx, "local") + if err != nil { + t.Fatalf("CreateSFTPServiceToken: %v", err) + } + seeded := SFTPServicePrefix + "A1b2C3d4E5f6G7h8I9j0K1l2M3n4O5p6Q7r8S9t0U1v" + if err := s.SeedSFTPServiceToken(ctx, "local", seeded); err != nil { + t.Fatalf("seed: %v", err) + } + next := SFTPServicePrefix + "Z9y8X7w6V5u4T3s2R1q0P9o8N7m6L5k4J3i2H1g0F9e" + if err := s.SeedSFTPServiceToken(ctx, "local", next); err != nil { + t.Fatalf("re-seed: %v", err) + } + + if id, _, err := s.AuthenticateSFTPService(ctx, adminRaw); err != nil || id != admin.ID { + t.Fatalf("admin token after re-seed: id=%d err=%v, want id %d", id, err, admin.ID) + } + if n := sftpActiveServiceTokens(t, s, "local"); n != 2 { + t.Fatalf("active service tokens = %d, want 2 (admin token and the new seed)", n) + } +} diff --git a/api/internal/auth/sftp_store.go b/api/internal/auth/sftp_store.go new file mode 100644 index 000000000..faf3f0d21 --- /dev/null +++ b/api/internal/auth/sftp_store.go @@ -0,0 +1,716 @@ +package auth + +import ( + "context" + "database/sql" + "errors" + "fmt" + "log/slog" + "strconv" + "strings" + "sync" + "time" + + "github.com/GameplanePanel/gameplane/api/internal/db" +) + +const ( + // SFTPMaxKeysPerUser is the number of SFTP public keys one user may register. + SFTPMaxKeysPerUser = 20 + // SFTPMaxActiveServiceTokens is the number of unrevoked SFTP service tokens one cluster may hold. + SFTPMaxActiveServiceTokens = 2 + sftpCredentialPassword = "password" // sftp_sessions.credential; keys use "key:" + sftpMaxCheckDigests = 500 +) + +var ( + // ErrSFTPNotFound is returned when an SFTP key, token or session does not exist. + ErrSFTPNotFound = errors.New("sftp: not found") + // ErrSFTPKeyLimit is returned when a user already holds SFTPMaxKeysPerUser keys. + ErrSFTPKeyLimit = errors.New("sftp: too many keys") + // ErrSFTPKeyNameInUse is returned when a user already has a key with the same name. + ErrSFTPKeyNameInUse = errors.New("sftp: key name already in use") + // ErrSFTPKeyDuplicate is returned when the same public key is already registered. + ErrSFTPKeyDuplicate = errors.New("sftp: key already registered") + // ErrSFTPServiceTokenLimit is returned when a cluster already holds SFTPMaxActiveServiceTokens tokens. + ErrSFTPServiceTokenLimit = errors.New("sftp: too many active service tokens") +) + +// SFTPKey is the listed view of an SFTP public key. +type SFTPKey struct { + ID int64 `json:"id"` + Name string `json:"name"` + PublicKey string `json:"publicKey"` + Fingerprint string `json:"fingerprint"` + CreatedAt time.Time `json:"createdAt"` + LastUsedAt *time.Time `json:"lastUsedAt"` +} + +// SFTPPasswordInfo is the display view of a user's SFTP password. The hash is never part of it. +type SFTPPasswordInfo struct { + Length int `json:"length"` + CreatedAt time.Time `json:"createdAt"` + LastUsedAt *time.Time `json:"lastUsedAt"` +} + +// SFTPServiceToken is the listed view of an SFTP service token. The secret is never part of it. +type SFTPServiceToken struct { + ID int64 `json:"id"` + Cluster string `json:"cluster"` + Prefix string `json:"prefix"` + CreatedAt time.Time `json:"createdAt"` + LastUsedAt *time.Time `json:"lastUsedAt"` + RevokedAt *time.Time `json:"revokedAt"` +} + +// SFTPSession is a stored SFTP session row. +type SFTPSession struct { + ID int64 + UserID int64 + Cluster string + Credential string + SessionEpoch int64 + ExpiresAt time.Time +} + +// sftpLastTouch records the last last_used_at write per SFTP credential key. +var sftpLastTouch sync.Map + +// sftpRowQuerier is satisfied by *sql.DB and *sql.Tx. +type sftpRowQuerier interface { + QueryRowContext(ctx context.Context, query string, args ...any) *sql.Row +} + +// newRandomID returns a random positive 53-bit integer for SFTP row ids. +func newRandomID() int64 { return newMCPTokenID() } + +// sftpNow returns the current time in the RFC 3339 UTC form the tables store. +func sftpNow() string { return time.Now().UTC().Format(time.RFC3339) } + +// parseSFTPTime parses a stored RFC 3339 timestamp. +func parseSFTPTime(v string) (time.Time, error) { + t, err := time.Parse(time.RFC3339, v) + if err != nil { + return time.Time{}, fmt.Errorf("parse sftp time: %w", err) + } + return t, nil +} + +// sftpExists reports whether the query, which must select one row, returns a row. +func sftpExists(ctx context.Context, q sftpRowQuerier, query string, args ...any) (bool, error) { + var one int + err := q.QueryRowContext(ctx, query, args...).Scan(&one) + if errors.Is(err, sql.ErrNoRows) { + return false, nil + } + if err != nil { + return false, err + } + return true, nil +} + +// sftpTouchDue reports whether a last_used_at write for key is due, at most once per lastUsedInterval. +func sftpTouchDue(key string) bool { + now := time.Now() + if v, ok := sftpLastTouch.Load(key); ok { + if last, isTime := v.(time.Time); isTime && now.Sub(last) < lastUsedInterval { + return false + } + } + sftpLastTouch.Store(key, now) + return true +} + +// InsertSFTPKey stores a normalized key for userID. One transaction checks the 20-key limit, +// the per-user name uniqueness and the global fingerprint uniqueness. +func (s *SessionStore) InsertSFTPKey(ctx context.Context, userID int64, name, publicKey, fingerprint string) (SFTPKey, error) { + tx, err := s.db.DB.BeginTx(ctx, nil) + if err != nil { + return SFTPKey{}, fmt.Errorf("insert sftp key: begin: %w", err) + } + defer func() { _ = tx.Rollback() }() + + var count int + if err := tx.QueryRowContext(ctx, `SELECT COUNT(*) FROM sftp_ssh_keys WHERE user_id = ?`, userID).Scan(&count); err != nil { + return SFTPKey{}, fmt.Errorf("insert sftp key: count: %w", err) + } + if count >= SFTPMaxKeysPerUser { + return SFTPKey{}, ErrSFTPKeyLimit + } + dup, err := sftpExists(ctx, tx, `SELECT 1 FROM sftp_ssh_keys WHERE fingerprint = ?`, fingerprint) + if err != nil { + return SFTPKey{}, fmt.Errorf("insert sftp key: fingerprint: %w", err) + } + if dup { + return SFTPKey{}, ErrSFTPKeyDuplicate + } + nameUsed, err := sftpExists(ctx, tx, `SELECT 1 FROM sftp_ssh_keys WHERE user_id = ? AND name = ?`, userID, name) + if err != nil { + return SFTPKey{}, fmt.Errorf("insert sftp key: name: %w", err) + } + if nameUsed { + return SFTPKey{}, ErrSFTPKeyNameInUse + } + + now := time.Now().UTC().Truncate(time.Second) + key := SFTPKey{ + ID: newRandomID(), + Name: name, + PublicKey: publicKey, + Fingerprint: fingerprint, + CreatedAt: now, + } + if _, err := tx.ExecContext(ctx, + `INSERT INTO sftp_ssh_keys(id, user_id, name, public_key, fingerprint, created_at) VALUES (?, ?, ?, ?, ?, ?)`, + key.ID, userID, name, publicKey, fingerprint, now.Format(time.RFC3339)); err != nil { + return SFTPKey{}, fmt.Errorf("insert sftp key: %w", err) + } + if err := tx.Commit(); err != nil { + return SFTPKey{}, fmt.Errorf("insert sftp key: commit: %w", err) + } + return key, nil +} + +// ListSFTPKeys returns userID's keys, newest first. +func (s *SessionStore) ListSFTPKeys(ctx context.Context, userID int64) ([]SFTPKey, error) { + rows, err := s.db.DB.QueryContext(ctx, + `SELECT id, name, public_key, fingerprint, created_at, last_used_at FROM sftp_ssh_keys WHERE user_id = ? ORDER BY created_at DESC, id DESC`, + userID) + if err != nil { + return nil, fmt.Errorf("list sftp keys: %w", err) + } + defer func() { _ = rows.Close() }() + out := []SFTPKey{} + for rows.Next() { + var ( + k SFTPKey + created string + lastUsed sql.NullString + ) + if err := rows.Scan(&k.ID, &k.Name, &k.PublicKey, &k.Fingerprint, &created, &lastUsed); err != nil { + return nil, fmt.Errorf("scan sftp key: %w", err) + } + if k.CreatedAt, err = parseSFTPTime(created); err != nil { + return nil, err + } + if k.LastUsedAt, err = parseOptionalTime(lastUsed); err != nil { + return nil, err + } + out = append(out, k) + } + if err := rows.Err(); err != nil { + return nil, fmt.Errorf("iterate sftp keys: %w", err) + } + return out, nil +} + +// DeleteSFTPKey removes a key owned by userID and, in the same transaction, revokes that +// user's sessions with credential "key:". ErrSFTPNotFound when no such key. +func (s *SessionStore) DeleteSFTPKey(ctx context.Context, userID, keyID int64) error { + tx, err := s.db.DB.BeginTx(ctx, nil) + if err != nil { + return fmt.Errorf("delete sftp key: begin: %w", err) + } + defer func() { _ = tx.Rollback() }() + + res, err := tx.ExecContext(ctx, `DELETE FROM sftp_ssh_keys WHERE id = ? AND user_id = ?`, keyID, userID) + if err != nil { + return fmt.Errorf("delete sftp key: %w", err) + } + n, err := res.RowsAffected() + if err != nil { + return fmt.Errorf("delete sftp key rows: %w", err) + } + if n == 0 { + return ErrSFTPNotFound + } + if err := s.RevokeSFTPSessions(ctx, tx, userID, fmt.Sprintf("key:%d", keyID)); err != nil { + return fmt.Errorf("delete sftp key: %w", err) + } + if err := tx.Commit(); err != nil { + return fmt.Errorf("delete sftp key: commit: %w", err) + } + return nil +} + +// FindSFTPKey resolves a fingerprint to its row (login by public key). +func (s *SessionStore) FindSFTPKey(ctx context.Context, fingerprint string) (userID, keyID int64, err error) { + err = s.db.DB.QueryRowContext(ctx, + `SELECT user_id, id FROM sftp_ssh_keys WHERE fingerprint = ?`, fingerprint, + ).Scan(&userID, &keyID) + if err != nil { + return 0, 0, fmt.Errorf("find sftp key: %w", err) + } + return userID, keyID, nil +} + +// SetSFTPPassword replaces userID's password row and revokes their "password" sessions, in one tx. +func (s *SessionStore) SetSFTPPassword(ctx context.Context, userID int64, hash string, length int) error { + tx, err := s.db.DB.BeginTx(ctx, nil) + if err != nil { + return fmt.Errorf("set sftp password: begin: %w", err) + } + defer func() { _ = tx.Rollback() }() + + if _, err := tx.ExecContext(ctx, + `INSERT INTO sftp_passwords(user_id, hash, length, created_at) VALUES (?, ?, ?, ?) ON CONFLICT (user_id) DO UPDATE SET hash = excluded.hash, length = excluded.length, created_at = excluded.created_at, last_used_at = NULL`, + userID, hash, length, sftpNow()); err != nil { + return fmt.Errorf("set sftp password: %w", err) + } + if err := s.RevokeSFTPSessions(ctx, tx, userID, sftpCredentialPassword); err != nil { + return fmt.Errorf("set sftp password: %w", err) + } + if err := tx.Commit(); err != nil { + return fmt.Errorf("set sftp password: commit: %w", err) + } + return nil +} + +// GetSFTPPasswordHash returns the stored hash. found=false when none. +func (s *SessionStore) GetSFTPPasswordHash(ctx context.Context, userID int64) (hash string, found bool, err error) { + err = s.db.DB.QueryRowContext(ctx, `SELECT hash FROM sftp_passwords WHERE user_id = ?`, userID).Scan(&hash) + if errors.Is(err, sql.ErrNoRows) { + return "", false, nil + } + if err != nil { + return "", false, fmt.Errorf("get sftp password hash: %w", err) + } + return hash, true, nil +} + +// GetSFTPPasswordInfo is the display view (no hash). +func (s *SessionStore) GetSFTPPasswordInfo(ctx context.Context, userID int64) (SFTPPasswordInfo, bool, error) { + var ( + info SFTPPasswordInfo + created string + lastUsed sql.NullString + ) + err := s.db.DB.QueryRowContext(ctx, + `SELECT length, created_at, last_used_at FROM sftp_passwords WHERE user_id = ?`, userID, + ).Scan(&info.Length, &created, &lastUsed) + if errors.Is(err, sql.ErrNoRows) { + return SFTPPasswordInfo{}, false, nil + } + if err != nil { + return SFTPPasswordInfo{}, false, fmt.Errorf("get sftp password info: %w", err) + } + if info.CreatedAt, err = parseSFTPTime(created); err != nil { + return SFTPPasswordInfo{}, false, err + } + if info.LastUsedAt, err = parseOptionalTime(lastUsed); err != nil { + return SFTPPasswordInfo{}, false, err + } + return info, true, nil +} + +// SFTPUsername returns the username of userID for the admin SFTP routes. The wrapped error is +// sql.ErrNoRows when no such user exists. +func (s *SessionStore) SFTPUsername(ctx context.Context, userID int64) (string, error) { + var name string + if err := s.db.DB.QueryRowContext(ctx, `SELECT username FROM users WHERE id = ?`, userID).Scan(&name); err != nil { + return "", fmt.Errorf("sftp username: %w", err) + } + return name, nil +} + +// DeleteSFTPPassword deletes the row and revokes "password" sessions. ErrSFTPNotFound if none. +func (s *SessionStore) DeleteSFTPPassword(ctx context.Context, userID int64) error { + tx, err := s.db.DB.BeginTx(ctx, nil) + if err != nil { + return fmt.Errorf("delete sftp password: begin: %w", err) + } + defer func() { _ = tx.Rollback() }() + + res, err := tx.ExecContext(ctx, `DELETE FROM sftp_passwords WHERE user_id = ?`, userID) + if err != nil { + return fmt.Errorf("delete sftp password: %w", err) + } + n, err := res.RowsAffected() + if err != nil { + return fmt.Errorf("delete sftp password rows: %w", err) + } + if n == 0 { + return ErrSFTPNotFound + } + if err := s.RevokeSFTPSessions(ctx, tx, userID, sftpCredentialPassword); err != nil { + return fmt.Errorf("delete sftp password: %w", err) + } + if err := tx.Commit(); err != nil { + return fmt.Errorf("delete sftp password: commit: %w", err) + } + return nil +} + +// RevokeSFTPSessions marks sessions revoked_at=now for userID; credential "" = all credentials. +// ex lets callers run it inside their own transaction (db.Execer). +func (s *SessionStore) RevokeSFTPSessions(ctx context.Context, ex db.Execer, userID int64, credential string) error { + query := `UPDATE sftp_sessions SET revoked_at = ? WHERE user_id = ? AND revoked_at IS NULL` + args := []any{sftpNow(), userID} + if credential != "" { + query += ` AND credential = ?` + args = append(args, credential) + } + if _, err := ex.ExecContext(ctx, query, args...); err != nil { + return fmt.Errorf("revoke sftp sessions: %w", err) + } + return nil +} + +// TouchSFTPCredential writes last_used_at on the key row or password row at most once a minute +// per credential (in-process sync.Map like mcpLastTouch, mcptokens.go:79). Errors are logged only. +func (s *SessionStore) TouchSFTPCredential(ctx context.Context, userID int64, credential string) { + if !sftpTouchDue(fmt.Sprintf("cred/%d/%s", userID, credential)) { + return + } + now := sftpNow() + var ( + query string + args []any + ) + if credential == sftpCredentialPassword { + query, args = `UPDATE sftp_passwords SET last_used_at = ? WHERE user_id = ?`, []any{now, userID} + } else if keyPart, ok := strings.CutPrefix(credential, "key:"); ok { + keyID, err := strconv.ParseInt(keyPart, 10, 64) + if err != nil { + slog.Warn("sftp touch credential", "err", err) + return + } + query, args = `UPDATE sftp_ssh_keys SET last_used_at = ? WHERE id = ? AND user_id = ?`, []any{now, keyID, userID} + } else { + return + } + if _, err := s.db.DB.ExecContext(ctx, query, args...); err != nil { + slog.Warn("sftp touch credential", "err", err) + } +} + +// InsertSFTPServiceToken stores a service token digest for cluster. The transaction refuses +// a third active token for the same cluster with ErrSFTPServiceTokenLimit. +func (s *SessionStore) InsertSFTPServiceToken(ctx context.Context, cluster, digest, prefix string) (SFTPServiceToken, error) { + return s.insertServiceToken(ctx, cluster, digest, prefix, false) +} + +// insertServiceToken is InsertSFTPServiceToken with the seeded flag. A seeded insert first revokes the +// cluster's earlier seeded tokens (and the sessions minted through them) in the same transaction, so a +// re-rendered chart secret replaces the previous seeded token instead of counting against the limit. +func (s *SessionStore) insertServiceToken(ctx context.Context, cluster, digest, prefix string, seeded bool) (SFTPServiceToken, error) { + tx, err := s.db.DB.BeginTx(ctx, nil) + if err != nil { + return SFTPServiceToken{}, fmt.Errorf("insert sftp service token: begin: %w", err) + } + defer func() { _ = tx.Rollback() }() + + if seeded { + if err := revokeSeededServiceTokensTx(ctx, tx, cluster, digest); err != nil { + return SFTPServiceToken{}, fmt.Errorf("insert sftp service token: %w", err) + } + } + seededFlag := 0 + if seeded { + seededFlag = 1 + } + + var active int + if err := tx.QueryRowContext(ctx, + `SELECT COUNT(*) FROM sftp_service_tokens WHERE cluster = ? AND revoked_at IS NULL`, cluster, + ).Scan(&active); err != nil { + return SFTPServiceToken{}, fmt.Errorf("insert sftp service token: count: %w", err) + } + if active >= SFTPMaxActiveServiceTokens { + return SFTPServiceToken{}, ErrSFTPServiceTokenLimit + } + now := time.Now().UTC().Truncate(time.Second) + tok := SFTPServiceToken{ + ID: newRandomID(), + Cluster: cluster, + Prefix: prefix, + CreatedAt: now, + } + if _, err := tx.ExecContext(ctx, + `INSERT INTO sftp_service_tokens(id, cluster, digest, prefix, created_at, seeded) VALUES (?, ?, ?, ?, ?, ?)`, + tok.ID, cluster, digest, prefix, now.Format(time.RFC3339), seededFlag); err != nil { + return SFTPServiceToken{}, fmt.Errorf("insert sftp service token: %w", err) + } + if err := tx.Commit(); err != nil { + return SFTPServiceToken{}, fmt.Errorf("insert sftp service token: commit: %w", err) + } + return tok, nil +} + +// ListSFTPServiceTokens returns the cluster's service tokens, newest first, revoked ones included +// until the sweeper drops them. +func (s *SessionStore) ListSFTPServiceTokens(ctx context.Context, cluster string) ([]SFTPServiceToken, error) { + rows, err := s.db.DB.QueryContext(ctx, + `SELECT id, cluster, prefix, created_at, last_used_at, revoked_at FROM sftp_service_tokens WHERE cluster = ? ORDER BY created_at DESC, id DESC`, + cluster) + if err != nil { + return nil, fmt.Errorf("list sftp service tokens: %w", err) + } + defer func() { _ = rows.Close() }() + out := []SFTPServiceToken{} + for rows.Next() { + var ( + t SFTPServiceToken + created string + lastUsed sql.NullString + revoked sql.NullString + ) + if err := rows.Scan(&t.ID, &t.Cluster, &t.Prefix, &created, &lastUsed, &revoked); err != nil { + return nil, fmt.Errorf("scan sftp service token: %w", err) + } + if t.CreatedAt, err = parseSFTPTime(created); err != nil { + return nil, err + } + if t.LastUsedAt, err = parseOptionalTime(lastUsed); err != nil { + return nil, err + } + if t.RevokedAt, err = parseOptionalTime(revoked); err != nil { + return nil, err + } + out = append(out, t) + } + if err := rows.Err(); err != nil { + return nil, fmt.Errorf("iterate sftp service tokens: %w", err) + } + return out, nil +} + +// RevokeSFTPServiceToken revokes an active service token of cluster. ErrSFTPNotFound otherwise. +// The sessions minted through the token are revoked in the same transaction. +func (s *SessionStore) RevokeSFTPServiceToken(ctx context.Context, cluster string, id int64) error { + tx, err := s.db.DB.BeginTx(ctx, nil) + if err != nil { + return fmt.Errorf("revoke sftp service token: begin: %w", err) + } + defer func() { _ = tx.Rollback() }() + + revoked, err := revokeServiceTokenTx(ctx, tx, cluster, id) + if err != nil { + return err + } + if !revoked { + return ErrSFTPNotFound + } + if err := tx.Commit(); err != nil { + return fmt.Errorf("revoke sftp service token: commit: %w", err) + } + return nil +} + +// revokeServiceTokenTx revokes the active token id of cluster and every unrevoked session minted through +// it, inside tx. It reports false when no active token matched. +func revokeServiceTokenTx(ctx context.Context, tx *sql.Tx, cluster string, id int64) (bool, error) { + res, err := tx.ExecContext(ctx, + `UPDATE sftp_service_tokens SET revoked_at = ? WHERE id = ? AND cluster = ? AND revoked_at IS NULL`, + sftpNow(), id, cluster) + if err != nil { + return false, fmt.Errorf("revoke sftp service token: %w", err) + } + n, err := res.RowsAffected() + if err != nil { + return false, fmt.Errorf("revoke sftp service token rows: %w", err) + } + if n == 0 { + return false, nil + } + if _, err := tx.ExecContext(ctx, + `UPDATE sftp_sessions SET revoked_at = ? WHERE service_token_id = ? AND revoked_at IS NULL`, + sftpNow(), id); err != nil { + return false, fmt.Errorf("revoke sftp service token sessions: %w", err) + } + return true, nil +} + +// revokeSeededServiceTokensTx revokes the active seeded tokens of cluster whose digest differs from +// keepDigest, with their sessions, inside tx. +func revokeSeededServiceTokensTx(ctx context.Context, tx *sql.Tx, cluster, keepDigest string) error { + rows, err := tx.QueryContext(ctx, + `SELECT id FROM sftp_service_tokens WHERE cluster = ? AND seeded = 1 AND revoked_at IS NULL AND digest <> ?`, + cluster, keepDigest) + if err != nil { + return fmt.Errorf("list seeded sftp service tokens: %w", err) + } + var ids []int64 + for rows.Next() { + var id int64 + if err := rows.Scan(&id); err != nil { + _ = rows.Close() + return fmt.Errorf("scan seeded sftp service token: %w", err) + } + ids = append(ids, id) + } + if err := rows.Err(); err != nil { + _ = rows.Close() + return fmt.Errorf("iterate seeded sftp service tokens: %w", err) + } + if err := rows.Close(); err != nil { + return fmt.Errorf("close seeded sftp service tokens: %w", err) + } + for _, id := range ids { + if _, err := revokeServiceTokenTx(ctx, tx, cluster, id); err != nil { + return err + } + } + return nil +} + +// LookupSFTPServiceToken resolves a token digest to its row. sql.ErrNoRows when unknown or revoked. +func (s *SessionStore) LookupSFTPServiceToken(ctx context.Context, digest string) (id int64, cluster string, err error) { + err = s.db.DB.QueryRowContext(ctx, + `SELECT id, cluster FROM sftp_service_tokens WHERE digest = ? AND revoked_at IS NULL`, digest, + ).Scan(&id, &cluster) + if err != nil { + return 0, "", fmt.Errorf("lookup sftp service token: %w", err) + } + return id, cluster, nil +} + +// TouchSFTPServiceToken writes last_used_at for a service token at most once a minute. +// Errors are logged only. +func (s *SessionStore) TouchSFTPServiceToken(ctx context.Context, id int64) { + if !sftpTouchDue(fmt.Sprintf("svc/%d", id)) { + return + } + if _, err := s.db.DB.ExecContext(ctx, + `UPDATE sftp_service_tokens SET last_used_at = ? WHERE id = ?`, sftpNow(), id); err != nil { + slog.Warn("sftp touch service token", "err", err) + } +} + +// InsertSFTPSession stores a session row (digest only) and returns its id. The session has no service token. +func (s *SessionStore) InsertSFTPSession(ctx context.Context, userID int64, cluster, credential, digest string, epoch int64, expires time.Time) (int64, error) { + return s.InsertSFTPSessionForToken(ctx, userID, cluster, credential, digest, epoch, expires, 0) +} + +// InsertSFTPSessionForToken is InsertSFTPSession for a session minted through service token +// serviceTokenID (0 for none). Revoking that token later ends the session. +func (s *SessionStore) InsertSFTPSessionForToken(ctx context.Context, userID int64, cluster, credential, digest string, epoch int64, expires time.Time, serviceTokenID int64) (int64, error) { + id := newRandomID() + tokenRef := sql.NullInt64{Int64: serviceTokenID, Valid: serviceTokenID != 0} + if _, err := s.db.DB.ExecContext(ctx, + `INSERT INTO sftp_sessions(id, user_id, cluster, credential, digest, session_epoch, expires_at, service_token_id) VALUES (?, ?, ?, ?, ?, ?, ?, ?)`, + id, userID, cluster, credential, digest, epoch, expires.UTC().Format(time.RFC3339), tokenRef); err != nil { + return 0, fmt.Errorf("insert sftp session: %w", err) + } + return id, nil +} + +// LookupSFTPSession joins users and requires revoked_at IS NULL, session_epoch = users.session_epoch +// and not expired. sql.ErrNoRows / errSessionExpired / errSessionInvalid like lookupMCPToken (mcptokens.go:294). +func (s *SessionStore) LookupSFTPSession(ctx context.Context, digest string) (*User, SFTPSession, error) { + var ( + u User + sess SFTPSession + expires string + ) + err := s.db.DB.QueryRowContext(ctx, ` + SELECT s.id, s.user_id, s.cluster, s.credential, s.session_epoch, s.expires_at, + u.username, u.display_name, u.email, u.role + FROM sftp_sessions s JOIN users u ON u.id = s.user_id + WHERE s.digest = ? AND s.revoked_at IS NULL AND s.session_epoch = u.session_epoch`, + digest, + ).Scan(&sess.ID, &sess.UserID, &sess.Cluster, &sess.Credential, &sess.SessionEpoch, &expires, + &u.Username, &u.DisplayName, &u.Email, &u.Role) + if err != nil { + return nil, SFTPSession{}, err + } + u.ID = sess.UserID + exp, perr := parseSFTPTime(expires) + if perr != nil { + slog.Warn("sftp session expires_at parse", "err", perr) + return nil, SFTPSession{}, errSessionInvalid + } + sess.ExpiresAt = exp + if time.Now().After(exp) { + return nil, SFTPSession{}, errSessionExpired + } + perms, err := s.LoadPerms(ctx, u.ID) + if err != nil { + return nil, SFTPSession{}, err + } + u.Perms = perms + return &u, sess, nil +} + +// SlideSFTPSession sets expires_at on a live session (RevokedAt must be NULL). Callers throttle to once a minute. +func (s *SessionStore) SlideSFTPSession(ctx context.Context, id int64, expires time.Time) error { + if _, err := s.db.DB.ExecContext(ctx, + `UPDATE sftp_sessions SET expires_at = ? WHERE id = ? AND revoked_at IS NULL`, + expires.UTC().Format(time.RFC3339), id); err != nil { + return fmt.Errorf("slide sftp session: %w", err) + } + return nil +} + +// CheckSFTPSessions returns the digests among digests (max 500) that are no longer valid for cluster: +// missing, other cluster, revoked, expired or epoch-mismatched. Build the IN list with "?" repeated. +func (s *SessionStore) CheckSFTPSessions(ctx context.Context, cluster string, digests []string) ([]string, error) { + revoked := []string{} + if len(digests) == 0 { + return revoked, nil + } + if len(digests) > sftpMaxCheckDigests { + return nil, fmt.Errorf("check sftp sessions: %d digests exceeds %d", len(digests), sftpMaxCheckDigests) + } + // One digest per query, all inside one transaction so the checks share a snapshot. + tx, err := s.db.DB.BeginTx(ctx, nil) + if err != nil { + return nil, fmt.Errorf("check sftp sessions: %w", err) + } + defer func() { _ = tx.Rollback() }() + now := time.Now() + for _, d := range digests { + live, err := sftpSessionLive(ctx, tx, cluster, d, now) + if err != nil { + return nil, err + } + if !live { + revoked = append(revoked, d) + continue + } + // The endpoint asks about the tokens of open connections only, so a live session that is + // checked is kept alive: one long transfer must not outlive its session (FR-018). + if _, err := tx.ExecContext(ctx, + `UPDATE sftp_sessions SET expires_at = ? WHERE digest = ? AND cluster = ? AND revoked_at IS NULL`, + time.Now().Add(sftpSessionTTL).UTC().Format(time.RFC3339), d, cluster); err != nil { + return nil, fmt.Errorf("check sftp sessions: slide: %w", err) + } + } + if err := tx.Commit(); err != nil { + return nil, fmt.Errorf("check sftp sessions: commit: %w", err) + } + return revoked, nil +} + +// sftpSessionLive reports whether digest names an unrevoked, unexpired session on cluster whose +// user's session_epoch still matches. +func sftpSessionLive(ctx context.Context, tx *sql.Tx, cluster, digest string, now time.Time) (bool, error) { + rows, err := tx.QueryContext(ctx, ` + SELECT s.expires_at + FROM sftp_sessions s JOIN users u ON u.id = s.user_id + WHERE s.cluster = ? AND s.revoked_at IS NULL AND s.session_epoch = u.session_epoch + AND s.digest = ?`, cluster, digest) + if err != nil { + return false, fmt.Errorf("check sftp sessions: %w", err) + } + defer func() { _ = rows.Close() }() + live := false + for rows.Next() { + var expires string + if err := rows.Scan(&expires); err != nil { + return false, fmt.Errorf("scan sftp session: %w", err) + } + exp, perr := parseSFTPTime(expires) + if perr != nil { + slog.Warn("sftp session expires_at parse", "err", perr) + continue + } + if now.Before(exp) { + live = true + } + } + if err := rows.Err(); err != nil { + return false, fmt.Errorf("iterate sftp sessions: %w", err) + } + return live, nil +} diff --git a/api/internal/auth/sftp_store_fault_test.go b/api/internal/auth/sftp_store_fault_test.go new file mode 100644 index 000000000..83c36b4da --- /dev/null +++ b/api/internal/auth/sftp_store_fault_test.go @@ -0,0 +1,553 @@ +package auth + +import ( + "context" + "database/sql" + "errors" + "fmt" + "strings" + "testing" + "time" + + "github.com/GameplanePanel/gameplane/api/internal/db" +) + +// sftpCloseDB is a pseudo-statement that closes the store's database, so every later query fails. +const sftpCloseDB = "CLOSE" + +// sftpFault returns a store with one user (alice) after applying stmts. "{uid}" in a statement is +// replaced by alice's id; sftpCloseDB closes the database. +func sftpFault(ctx context.Context, t *testing.T, stmts ...string) (*SessionStore, int64) { + t.Helper() + st, err := db.Open(ctx, "sqlite", ":memory:") + if err != nil { + t.Fatalf("open: %v", err) + } + t.Cleanup(func() { _ = st.Close() }) + if err := st.Migrate(ctx); err != nil { + t.Fatalf("migrate: %v", err) + } + SetFastHashParams(t) + hash, err := HashPassword(ctx, "hunter2") + if err != nil { + t.Fatalf("hash: %v", err) + } + if _, err := st.DB.ExecContext(ctx, + `INSERT INTO users(username, display_name, email, role, pw_hash) VALUES (?,?,?,?,?)`, + "alice", "alice", "alice@example.com", "admin", hash); err != nil { + t.Fatalf("insert user: %v", err) + } + s := NewSessionStore(st) + u, _, err := s.SFTPUserByName(ctx, "alice") + if err != nil { + t.Fatalf("SFTPUserByName: %v", err) + } + uid := u.ID + for _, q := range stmts { + if q == sftpCloseDB { + if err := st.DB.Close(); err != nil { + t.Fatalf("close db: %v", err) + } + continue + } + q = strings.ReplaceAll(q, "{uid}", fmt.Sprint(uid)) + if _, err := st.DB.ExecContext(ctx, q); err != nil { + t.Fatalf("setup %q: %v", q, err) + } + } + return s, uid +} + +const ( + sftpDropKeys = `DROP TABLE sftp_ssh_keys` + sftpDropPwds = `DROP TABLE sftp_passwords` + sftpDropTokens = `DROP TABLE sftp_service_tokens` + sftpDropSessions = `DROP TABLE sftp_sessions` + sftpKeyRow = `INSERT INTO sftp_ssh_keys(id, user_id, name, public_key, fingerprint, created_at) VALUES (11, {uid}, 'k', 'pk', 'fp', '2020-01-01T00:00:00Z')` + sftpKeyBadID = `INSERT INTO sftp_ssh_keys(id, user_id, name, public_key, fingerprint, created_at) VALUES ('abc', {uid}, 'k', 'pk', 'fp', '2020-01-01T00:00:00Z')` + sftpKeyBadCreate = `INSERT INTO sftp_ssh_keys(id, user_id, name, public_key, fingerprint, created_at) VALUES (11, {uid}, 'k', 'pk', 'fp', 'bad')` + sftpKeyBadUsed = `INSERT INTO sftp_ssh_keys(id, user_id, name, public_key, fingerprint, created_at, last_used_at) VALUES (11, {uid}, 'k', 'pk', 'fp', '2020-01-01T00:00:00Z', 'bad')` + sftpPwdRow = `INSERT INTO sftp_passwords(user_id, hash, length, created_at) VALUES ({uid}, 'not-a-hash', 20, '2020-01-01T00:00:00Z')` + sftpPwdBadCreate = `INSERT INTO sftp_passwords(user_id, hash, length, created_at) VALUES ({uid}, 'h', 20, 'bad')` + sftpPwdBadUsed = `INSERT INTO sftp_passwords(user_id, hash, length, created_at, last_used_at) VALUES ({uid}, 'h', 20, '2020-01-01T00:00:00Z', 'bad')` + sftpTokBadID = `INSERT INTO sftp_service_tokens(id, cluster, digest, prefix, created_at) VALUES ('abc', 'local', 'd', 'p', '2020-01-01T00:00:00Z')` + sftpTokBadCreate = `INSERT INTO sftp_service_tokens(id, cluster, digest, prefix, created_at) VALUES (5, 'local', 'd', 'p', 'bad')` + sftpTokBadUsed = `INSERT INTO sftp_service_tokens(id, cluster, digest, prefix, created_at, last_used_at) VALUES (5, 'local', 'd', 'p', '2020-01-01T00:00:00Z', 'bad')` + sftpTokBadRevoke = `INSERT INTO sftp_service_tokens(id, cluster, digest, prefix, created_at, revoked_at) VALUES (5, 'local', 'd', 'p', '2020-01-01T00:00:00Z', 'bad')` + sftpKeyInsertBoom = `CREATE TRIGGER sftp_key_boom BEFORE INSERT ON sftp_ssh_keys BEGIN SELECT RAISE(ABORT, 'boom'); END` + sftpTokInsertBoom = `CREATE TRIGGER sftp_tok_boom BEFORE INSERT ON sftp_service_tokens BEGIN SELECT RAISE(ABORT, 'boom'); END` +) + +func TestSFTPStore_DatabaseFailuresSurface(t *testing.T) { + cases := []struct { + name string + stmts []string + call func(ctx context.Context, s *SessionStore, uid int64) error + }{ + {"insert key begin", []string{sftpCloseDB}, func(ctx context.Context, s *SessionStore, uid int64) error { + _, err := s.InsertSFTPKey(ctx, uid, "n", "pk", "fp") + return err + }}, + {"insert key count", []string{sftpDropKeys}, func(ctx context.Context, s *SessionStore, uid int64) error { + _, err := s.InsertSFTPKey(ctx, uid, "n", "pk", "fp") + return err + }}, + {"insert key fingerprint query", []string{`ALTER TABLE sftp_ssh_keys RENAME COLUMN fingerprint TO fp`}, func(ctx context.Context, s *SessionStore, uid int64) error { + _, err := s.InsertSFTPKey(ctx, uid, "n", "pk", "fp") + return err + }}, + {"insert key name query", []string{`ALTER TABLE sftp_ssh_keys RENAME COLUMN name TO nm`}, func(ctx context.Context, s *SessionStore, uid int64) error { + _, err := s.InsertSFTPKey(ctx, uid, "n", "pk", "fp") + return err + }}, + {"insert key exec", []string{sftpKeyInsertBoom}, func(ctx context.Context, s *SessionStore, uid int64) error { + _, err := s.InsertSFTPKey(ctx, uid, "n", "pk", "fp") + return err + }}, + {"list keys query", []string{sftpCloseDB}, func(ctx context.Context, s *SessionStore, uid int64) error { + _, err := s.ListSFTPKeys(ctx, uid) + return err + }}, + {"list keys scan", []string{sftpKeyBadID}, func(ctx context.Context, s *SessionStore, uid int64) error { + _, err := s.ListSFTPKeys(ctx, uid) + return err + }}, + {"list keys created_at", []string{sftpKeyBadCreate}, func(ctx context.Context, s *SessionStore, uid int64) error { + _, err := s.ListSFTPKeys(ctx, uid) + return err + }}, + {"list keys last_used_at", []string{sftpKeyBadUsed}, func(ctx context.Context, s *SessionStore, uid int64) error { + _, err := s.ListSFTPKeys(ctx, uid) + return err + }}, + {"delete key begin", []string{sftpCloseDB}, func(ctx context.Context, s *SessionStore, uid int64) error { + return s.DeleteSFTPKey(ctx, uid, 11) + }}, + {"delete key exec", []string{sftpDropKeys}, func(ctx context.Context, s *SessionStore, uid int64) error { + return s.DeleteSFTPKey(ctx, uid, 11) + }}, + {"delete key revoke", []string{sftpKeyRow, sftpDropSessions}, func(ctx context.Context, s *SessionStore, uid int64) error { + return s.DeleteSFTPKey(ctx, uid, 11) + }}, + {"find key", []string{sftpCloseDB}, func(ctx context.Context, s *SessionStore, _ int64) error { + _, _, err := s.FindSFTPKey(ctx, "fp") + return err + }}, + {"set password begin", []string{sftpCloseDB}, func(ctx context.Context, s *SessionStore, uid int64) error { + return s.SetSFTPPassword(ctx, uid, "h", 20) + }}, + {"set password exec", []string{sftpDropPwds}, func(ctx context.Context, s *SessionStore, uid int64) error { + return s.SetSFTPPassword(ctx, uid, "h", 20) + }}, + {"set password revoke", []string{sftpDropSessions}, func(ctx context.Context, s *SessionStore, uid int64) error { + return s.SetSFTPPassword(ctx, uid, "h", 20) + }}, + {"password hash query", []string{sftpDropPwds}, func(ctx context.Context, s *SessionStore, uid int64) error { + _, _, err := s.GetSFTPPasswordHash(ctx, uid) + return err + }}, + {"password info query", []string{sftpDropPwds}, func(ctx context.Context, s *SessionStore, uid int64) error { + _, _, err := s.GetSFTPPasswordInfo(ctx, uid) + return err + }}, + {"password info created_at", []string{sftpPwdBadCreate}, func(ctx context.Context, s *SessionStore, uid int64) error { + _, _, err := s.GetSFTPPasswordInfo(ctx, uid) + return err + }}, + {"password info last_used_at", []string{sftpPwdBadUsed}, func(ctx context.Context, s *SessionStore, uid int64) error { + _, _, err := s.GetSFTPPasswordInfo(ctx, uid) + return err + }}, + {"delete password begin", []string{sftpCloseDB}, func(ctx context.Context, s *SessionStore, uid int64) error { + return s.DeleteSFTPPassword(ctx, uid) + }}, + {"delete password exec", []string{sftpDropPwds}, func(ctx context.Context, s *SessionStore, uid int64) error { + return s.DeleteSFTPPassword(ctx, uid) + }}, + {"delete password revoke", []string{sftpPwdRow, sftpDropSessions}, func(ctx context.Context, s *SessionStore, uid int64) error { + return s.DeleteSFTPPassword(ctx, uid) + }}, + {"revoke sessions exec", []string{sftpDropSessions}, func(ctx context.Context, s *SessionStore, uid int64) error { + return s.RevokeSFTPSessions(ctx, s.db.DB, uid, "password") + }}, + {"revoke session token exec", []string{sftpDropSessions}, func(ctx context.Context, s *SessionStore, _ int64) error { + return s.RevokeSFTPSessionToken(ctx, "gpsftp_"+strings.Repeat("a", sftpTokenBodyLen)) + }}, + {"delete user sessions revokes sftp", []string{sftpDropSessions}, func(ctx context.Context, s *SessionStore, uid int64) error { + return s.DeleteForUserWith(ctx, s.db.DB, uid) + }}, + {"insert token begin", []string{sftpCloseDB}, func(ctx context.Context, s *SessionStore, _ int64) error { + _, err := s.InsertSFTPServiceToken(ctx, "local", "d", "p") + return err + }}, + {"insert token count", []string{sftpDropTokens}, func(ctx context.Context, s *SessionStore, _ int64) error { + _, err := s.InsertSFTPServiceToken(ctx, "local", "d", "p") + return err + }}, + {"insert token exec", []string{sftpTokInsertBoom}, func(ctx context.Context, s *SessionStore, _ int64) error { + _, err := s.InsertSFTPServiceToken(ctx, "local", "d", "p") + return err + }}, + {"create token", []string{sftpDropTokens}, func(ctx context.Context, s *SessionStore, _ int64) error { + _, _, err := s.CreateSFTPServiceToken(ctx, "local") + return err + }}, + {"list tokens query", []string{sftpCloseDB}, func(ctx context.Context, s *SessionStore, _ int64) error { + _, err := s.ListSFTPServiceTokens(ctx, "local") + return err + }}, + {"list tokens scan", []string{sftpTokBadID}, func(ctx context.Context, s *SessionStore, _ int64) error { + _, err := s.ListSFTPServiceTokens(ctx, "local") + return err + }}, + {"list tokens created_at", []string{sftpTokBadCreate}, func(ctx context.Context, s *SessionStore, _ int64) error { + _, err := s.ListSFTPServiceTokens(ctx, "local") + return err + }}, + {"list tokens last_used_at", []string{sftpTokBadUsed}, func(ctx context.Context, s *SessionStore, _ int64) error { + _, err := s.ListSFTPServiceTokens(ctx, "local") + return err + }}, + {"list tokens revoked_at", []string{sftpTokBadRevoke}, func(ctx context.Context, s *SessionStore, _ int64) error { + _, err := s.ListSFTPServiceTokens(ctx, "local") + return err + }}, + {"revoke token exec", []string{sftpCloseDB}, func(ctx context.Context, s *SessionStore, _ int64) error { + return s.RevokeSFTPServiceToken(ctx, "local", 5) + }}, + {"lookup token", []string{sftpDropTokens}, func(ctx context.Context, s *SessionStore, _ int64) error { + _, _, err := s.LookupSFTPServiceToken(ctx, "d") + return err + }}, + {"authenticate service", []string{sftpDropTokens}, func(ctx context.Context, s *SessionStore, _ int64) error { + _, _, err := s.AuthenticateSFTPService(ctx, SFTPServicePrefix+strings.Repeat("a", sftpTokenBodyLen)) + return err + }}, + {"insert session", []string{sftpDropSessions}, func(ctx context.Context, s *SessionStore, uid int64) error { + _, err := s.InsertSFTPSession(ctx, uid, "local", "password", "d", 0, time.Now().Add(time.Hour)) + return err + }}, + {"issue session", []string{sftpDropSessions}, func(ctx context.Context, s *SessionStore, uid int64) error { + _, _, err := s.IssueSFTPSession(ctx, uid, "local", "password", 0) + return err + }}, + {"issue session empty credential", nil, func(ctx context.Context, s *SessionStore, uid int64) error { + _, _, err := s.IssueSFTPSession(ctx, uid, "local", "", 0) + return err + }}, + {"lookup session query", []string{sftpCloseDB}, func(ctx context.Context, s *SessionStore, _ int64) error { + _, _, err := s.LookupSFTPSession(ctx, "d") + return err + }}, + {"slide session exec", []string{sftpDropSessions}, func(ctx context.Context, s *SessionStore, _ int64) error { + return s.SlideSFTPSession(ctx, 1, time.Now()) + }}, + {"check sessions begin", []string{sftpCloseDB}, func(ctx context.Context, s *SessionStore, _ int64) error { + _, err := s.CheckSFTPSessions(ctx, "local", []string{"d"}) + return err + }}, + {"check sessions query", []string{sftpDropSessions}, func(ctx context.Context, s *SessionStore, _ int64) error { + _, err := s.CheckSFTPSessions(ctx, "local", []string{"d"}) + return err + }}, + {"check sessions too many", nil, func(ctx context.Context, s *SessionStore, _ int64) error { + _, err := s.CheckSFTPSessions(ctx, "local", make([]string, sftpMaxCheckDigests+1)) + return err + }}, + {"user by name perms", []string{`DROP TABLE user_role_bindings`}, func(ctx context.Context, s *SessionStore, _ int64) error { + _, _, err := s.SFTPUserByName(ctx, "alice") + return err + }}, + {"user by name unknown", nil, func(ctx context.Context, s *SessionStore, _ int64) error { + _, _, err := s.SFTPUserByName(ctx, "nobody") + if !errors.Is(err, sql.ErrNoRows) { + return fmt.Errorf("want sql.ErrNoRows, got %w", err) + } + return err + }}, + {"verify password query", []string{sftpCloseDB}, func(ctx context.Context, s *SessionStore, _ int64) error { + _, _, _, err := s.VerifySFTPPassword(ctx, "alice", "pw") + return err + }}, + {"verify password malformed hash", []string{sftpPwdRow}, func(ctx context.Context, s *SessionStore, _ int64) error { + _, _, _, err := s.VerifySFTPPassword(ctx, "alice", "pw") + return err + }}, + {"generate password store", []string{sftpCloseDB}, func(ctx context.Context, s *SessionStore, uid int64) error { + _, err := s.GenerateAndStoreSFTPPassword(ctx, uid, SFTPPasswordMinLen) + return err + }}, + {"generate password hash", nil, func(ctx context.Context, s *SessionStore, uid int64) error { + cancelled, cancel := context.WithCancel(ctx) + cancel() + _, err := s.GenerateAndStoreSFTPPassword(cancelled, uid, SFTPPasswordMinLen) + return err + }}, + } + for _, tc := range cases { + t.Run(tc.name, func(t *testing.T) { + s, uid := sftpFault(t.Context(), t, tc.stmts...) + if err := tc.call(t.Context(), s, uid); err == nil { + t.Fatal("call succeeded, want an error") + } + }) + } +} + +func TestSFTPStore_TouchCredential(t *testing.T) { + ctx := t.Context() + s, uid := sftpFault(t.Context(), t) + line, _ := sftpAuthorizedKey(t, "ed25519") + key, err := s.AddSFTPKey(ctx, uid, "laptop", line) + if err != nil { + t.Fatalf("AddSFTPKey: %v", err) + } + if _, err := s.GenerateAndStoreSFTPPassword(ctx, uid, SFTPPasswordMinLen); err != nil { + t.Fatalf("GenerateAndStoreSFTPPassword: %v", err) + } + keyCred := fmt.Sprintf("key:%d", key.ID) + for _, cred := range []string{keyCred, sftpCredentialPassword, "key:not-a-number", "mystery"} { + sftpLastTouch.Delete(fmt.Sprintf("cred/%d/%s", uid, cred)) + s.TouchSFTPCredential(ctx, uid, cred) + } + keys, err := s.ListSFTPKeys(ctx, uid) + if err != nil || len(keys) != 1 || keys[0].LastUsedAt == nil { + t.Fatalf("key last_used_at not written: %+v, %v", keys, err) + } + info, found, err := s.GetSFTPPasswordInfo(ctx, uid) + if err != nil || !found || info.LastUsedAt == nil { + t.Fatalf("password last_used_at not written: %+v found=%v err=%v", info, found, err) + } + + // A second touch inside the interval writes nothing. + if _, err := s.db.DB.ExecContext(ctx, `UPDATE sftp_ssh_keys SET last_used_at = NULL WHERE id = ?`, key.ID); err != nil { + t.Fatalf("reset: %v", err) + } + s.TouchSFTPCredential(ctx, uid, keyCred) + keys, err = s.ListSFTPKeys(ctx, uid) + if err != nil || keys[0].LastUsedAt != nil { + t.Fatalf("throttled touch wrote last_used_at: %+v, %v", keys, err) + } + + // A failing write is logged, never returned or panicked on. + if _, err := s.db.DB.ExecContext(ctx, sftpDropPwds); err != nil { + t.Fatalf("drop: %v", err) + } + sftpLastTouch.Delete(fmt.Sprintf("cred/%d/%s", uid, sftpCredentialPassword)) + s.TouchSFTPCredential(ctx, uid, sftpCredentialPassword) +} + +func TestSFTPStore_TouchServiceToken(t *testing.T) { + ctx := t.Context() + s, _ := sftpFault(t.Context(), t) + tok, _, err := s.CreateSFTPServiceToken(ctx, "local") + if err != nil { + t.Fatalf("CreateSFTPServiceToken: %v", err) + } + s.TouchSFTPServiceToken(ctx, tok.ID) + list, err := s.ListSFTPServiceTokens(ctx, "local") + if err != nil || len(list) != 1 || list[0].LastUsedAt == nil { + t.Fatalf("service token last_used_at not written: %+v, %v", list, err) + } + if _, err := s.db.DB.ExecContext(ctx, `UPDATE sftp_service_tokens SET last_used_at = NULL`); err != nil { + t.Fatalf("reset: %v", err) + } + s.TouchSFTPServiceToken(ctx, tok.ID) + if list, _ = s.ListSFTPServiceTokens(ctx, "local"); list[0].LastUsedAt != nil { + t.Fatal("throttled touch wrote last_used_at") + } + + // A failing write is logged only. + if _, err := s.db.DB.ExecContext(ctx, sftpDropTokens); err != nil { + t.Fatalf("drop: %v", err) + } + s.TouchSFTPServiceToken(ctx, tok.ID+1) +} + +func TestSFTPStore_ServiceTokenLimitAndRevokedLookup(t *testing.T) { + ctx := t.Context() + s, _ := sftpFault(t.Context(), t) + var first SFTPServiceToken + var firstRaw string + for i := 0; i < SFTPMaxActiveServiceTokens; i++ { + tok, raw, err := s.CreateSFTPServiceToken(ctx, "local") + if err != nil { + t.Fatalf("CreateSFTPServiceToken %d: %v", i, err) + } + if i == 0 { + first, firstRaw = tok, raw + } + } + if _, _, err := s.CreateSFTPServiceToken(ctx, "local"); !errors.Is(err, ErrSFTPServiceTokenLimit) { + t.Fatalf("third token error = %v, want ErrSFTPServiceTokenLimit", err) + } + // Another cluster has its own allowance. + if _, _, err := s.CreateSFTPServiceToken(ctx, "edge"); err != nil { + t.Fatalf("other cluster token: %v", err) + } + if err := s.RevokeSFTPServiceToken(ctx, "local", first.ID); err != nil { + t.Fatalf("RevokeSFTPServiceToken: %v", err) + } + if err := s.RevokeSFTPServiceToken(ctx, "local", first.ID); !errors.Is(err, ErrSFTPNotFound) { + t.Fatalf("second revoke error = %v, want ErrSFTPNotFound", err) + } + if _, _, err := s.AuthenticateSFTPService(ctx, firstRaw); !errors.Is(err, sql.ErrNoRows) { + t.Fatalf("revoked token error = %v, want sql.ErrNoRows", err) + } +} + +func TestSFTPStore_LookupSessionRejectsBadRows(t *testing.T) { + ctx := t.Context() + cases := []struct { + name string + mutate func(t *testing.T, s *SessionStore) + wantErr error + }{ + {"unparsable expiry", func(t *testing.T, s *SessionStore) { + t.Helper() + mustExecSFTP(t.Context(), t, s, `UPDATE sftp_sessions SET expires_at = 'junk'`) + }, errSessionInvalid}, + {"expired", func(t *testing.T, s *SessionStore) { + t.Helper() + mustExecSFTP(t.Context(), t, s, `UPDATE sftp_sessions SET expires_at = '2000-01-01T00:00:00Z'`) + }, errSessionExpired}, + {"revoked", func(t *testing.T, s *SessionStore) { + t.Helper() + mustExecSFTP(t.Context(), t, s, `UPDATE sftp_sessions SET revoked_at = '2020-01-01T00:00:00Z'`) + }, sql.ErrNoRows}, + {"epoch mismatch", func(t *testing.T, s *SessionStore) { + t.Helper() + mustExecSFTP(t.Context(), t, s, `UPDATE users SET session_epoch = session_epoch + 1`) + }, sql.ErrNoRows}, + } + for _, tc := range cases { + t.Run(tc.name, func(t *testing.T) { + s, uid := sftpFault(ctx, t) + token, _, err := s.IssueSFTPSession(ctx, uid, "local", "password", 0) + if err != nil { + t.Fatalf("IssueSFTPSession: %v", err) + } + tc.mutate(t, s) + if _, _, err := s.LookupSFTPSessionToken(ctx, token); !errors.Is(err, tc.wantErr) { + t.Fatalf("lookup error = %v, want %v", err, tc.wantErr) + } + }) + } + + t.Run("permission load failure", func(t *testing.T) { + s, uid := sftpFault(ctx, t) + token, _, err := s.IssueSFTPSession(ctx, uid, "local", "password", 0) + if err != nil { + t.Fatalf("IssueSFTPSession: %v", err) + } + mustExecSFTP(ctx, t, s, `DROP TABLE user_role_bindings`) + _, _, err = s.LookupSFTPSessionToken(ctx, token) + if err == nil || errors.Is(err, sql.ErrNoRows) || errors.Is(err, errSessionInvalid) || errors.Is(err, errSessionExpired) { + t.Fatalf("lookup error = %v, want an unclassified database error", err) + } + }) +} + +func mustExecSFTP(ctx context.Context, t *testing.T, s *SessionStore, q string) { + t.Helper() + if _, err := s.db.DB.ExecContext(ctx, q); err != nil { + t.Fatalf("exec %q: %v", q, err) + } +} + +func TestSFTPStore_CheckSessionsBatch(t *testing.T) { + ctx := t.Context() + s, uid := sftpFault(t.Context(), t) + + if got, err := s.CheckSFTPSessions(ctx, "local", nil); err != nil || len(got) != 0 { + t.Fatalf("empty batch = %v, %v", got, err) + } + + live, _, err := s.IssueSFTPSession(ctx, uid, "local", "password", 0) + if err != nil { + t.Fatalf("live: %v", err) + } + otherCluster, _, err := s.IssueSFTPSession(ctx, uid, "edge", "password", 0) + if err != nil { + t.Fatalf("other cluster: %v", err) + } + revoked, _, err := s.IssueSFTPSession(ctx, uid, "local", "key:1", 0) + if err != nil { + t.Fatalf("revoked: %v", err) + } + expired, _, err := s.IssueSFTPSession(ctx, uid, "local", "key:2", 0) + if err != nil { + t.Fatalf("expired: %v", err) + } + garbled, _, err := s.IssueSFTPSession(ctx, uid, "local", "key:3", 0) + if err != nil { + t.Fatalf("garbled: %v", err) + } + mustExecSFTP(t.Context(), t, s, fmt.Sprintf(`UPDATE sftp_sessions SET revoked_at = '2020-01-01T00:00:00Z' WHERE digest = '%s'`, SFTPTokenDigest(revoked))) + mustExecSFTP(t.Context(), t, s, fmt.Sprintf(`UPDATE sftp_sessions SET expires_at = '2000-01-01T00:00:00Z' WHERE digest = '%s'`, SFTPTokenDigest(expired))) + mustExecSFTP(t.Context(), t, s, fmt.Sprintf(`UPDATE sftp_sessions SET expires_at = 'junk' WHERE digest = '%s'`, SFTPTokenDigest(garbled))) + + digests := []string{ + SFTPTokenDigest(live), SFTPTokenDigest(otherCluster), SFTPTokenDigest(revoked), + SFTPTokenDigest(expired), SFTPTokenDigest(garbled), "unknown", + } + got, err := s.CheckSFTPSessions(ctx, "local", digests) + if err != nil { + t.Fatalf("CheckSFTPSessions: %v", err) + } + want := digests[1:] + if len(got) != len(want) { + t.Fatalf("invalid digests = %v, want %v", got, want) + } + for i := range want { + if got[i] != want[i] { + t.Fatalf("invalid digests = %v, want %v", got, want) + } + } +} + +func TestSFTPStore_RevokeAllCredentialsAndSessionToken(t *testing.T) { + ctx := t.Context() + s, uid := sftpFault(t.Context(), t) + a, _, err := s.IssueSFTPSession(ctx, uid, "local", "password", 0) + if err != nil { + t.Fatalf("a: %v", err) + } + b, _, err := s.IssueSFTPSession(ctx, uid, "local", "key:9", 0) + if err != nil { + t.Fatalf("b: %v", err) + } + if err := s.RevokeSFTPSessionToken(ctx, a); err != nil { + t.Fatalf("RevokeSFTPSessionToken: %v", err) + } + if _, _, err := s.LookupSFTPSessionToken(ctx, a); !errors.Is(err, sql.ErrNoRows) { + t.Fatalf("revoked session lookup = %v, want sql.ErrNoRows", err) + } + if _, _, err := s.LookupSFTPSessionToken(ctx, b); err != nil { + t.Fatalf("other session was revoked too: %v", err) + } + if err := s.DeleteForUserWith(ctx, s.db.DB, uid); err != nil { + t.Fatalf("DeleteForUserWith: %v", err) + } + if _, _, err := s.LookupSFTPSessionToken(ctx, b); !errors.Is(err, sql.ErrNoRows) { + t.Fatalf("session survived DeleteForUserWith: %v", err) + } +} + +func TestSFTPStore_SlideSessionLogsFailure(t *testing.T) { + s, _ := sftpFault(t.Context(), t, sftpDropSessions) + // Fresh id, so the once-a-minute throttle does not skip the write that fails. + s.slideSFTPSession(t.Context(), 987654321) +} + +func TestParseSFTPPublicKey_SecurityKeyTypeRefused(t *testing.T) { + wire := struct { + Name string + KeyBytes []byte + Application string + }{"sk-ssh-ed25519@openssh.com", make([]byte, 32), "ssh:"} + line := "sk-ssh-ed25519@openssh.com " + sftpBase64(sshMarshal(wire)) + if _, err := ParseSFTPPublicKey(line); !errors.Is(err, ErrSFTPKeyType) { + t.Fatalf("sk key error = %v, want ErrSFTPKeyType", err) + } +} diff --git a/api/internal/auth/sftp_test.go b/api/internal/auth/sftp_test.go new file mode 100644 index 000000000..fd3add7c6 --- /dev/null +++ b/api/internal/auth/sftp_test.go @@ -0,0 +1,465 @@ +package auth + +import ( + "context" + "crypto/ecdsa" + "crypto/ed25519" + "crypto/elliptic" + "crypto/rand" + "crypto/rsa" + "database/sql" + "errors" + "fmt" + "strings" + "testing" + "time" + + "golang.org/x/crypto/ssh" +) + +// sftpAuthorizedKey returns an authorized_keys line for a freshly generated key of the given kind. +func sftpAuthorizedKey(t *testing.T, kind string) (string, ssh.PublicKey) { + t.Helper() + var pub any + var err error + switch kind { + case "ed25519": + pub, _, err = ed25519.GenerateKey(rand.Reader) + case "p256": + var k *ecdsa.PrivateKey + k, err = ecdsa.GenerateKey(elliptic.P256(), rand.Reader) + if err == nil { + pub = &k.PublicKey + } + case "p384": + var k *ecdsa.PrivateKey + k, err = ecdsa.GenerateKey(elliptic.P384(), rand.Reader) + if err == nil { + pub = &k.PublicKey + } + case "p521": + var k *ecdsa.PrivateKey + k, err = ecdsa.GenerateKey(elliptic.P521(), rand.Reader) + if err == nil { + pub = &k.PublicKey + } + case "rsa3072", "rsa2048": + bits := 3072 + if kind == "rsa2048" { + bits = 2048 + } + var k *rsa.PrivateKey + k, err = rsa.GenerateKey(rand.Reader, bits) + if err == nil { + pub = &k.PublicKey + } + default: + t.Fatalf("unknown kind %q", kind) + } + if err != nil { + t.Fatalf("generate %s: %v", kind, err) + } + sshPub, err := ssh.NewPublicKey(pub) + if err != nil { + t.Fatalf("ssh public key: %v", err) + } + return strings.TrimSpace(string(ssh.MarshalAuthorizedKey(sshPub))), sshPub +} + +func TestParseSFTPPublicKey_Accepts(t *testing.T) { + for _, kind := range []string{"ed25519", "p256", "p384", "p521", "rsa3072"} { + t.Run(kind, func(t *testing.T) { + line, sshPub := sftpAuthorizedKey(t, kind) + parsed, err := ParseSFTPPublicKey(line + " laptop comment") + if err != nil { + t.Fatalf("ParseSFTPPublicKey: %v", err) + } + if parsed.Normalized != line { + t.Fatalf("normalized = %q, want comment-free %q", parsed.Normalized, line) + } + if parsed.Type != sshPub.Type() { + t.Fatalf("type = %q, want %q", parsed.Type, sshPub.Type()) + } + if !strings.HasPrefix(parsed.Fingerprint, "SHA256:") || parsed.Fingerprint != ssh.FingerprintSHA256(sshPub) { + t.Fatalf("fingerprint = %q", parsed.Fingerprint) + } + }) + } +} + +func TestParseSFTPPublicKey_Rejects(t *testing.T) { + ed, _ := sftpAuthorizedKey(t, "ed25519") + weak, _ := sftpAuthorizedKey(t, "rsa2048") + cases := map[string]string{ + "rsa 2048": weak, + "dsa": "ssh-dss AAAAB3NzaC1kc3MAAACBAOfH junk", + "sk key": "sk-ssh-ed25519@openssh.com AAAAGnNrLXNzaC1lZDI1NTE5QG9wZW5zc2guY29tAAAAIM junk", + "options": `command="/bin/sh" ` + ed, + "two lines": ed + "\n" + ed, + "garbage": "not a key at all", + "empty": " ", + } + for name, line := range cases { + t.Run(name, func(t *testing.T) { + if _, err := ParseSFTPPublicKey(line); err == nil { + t.Fatalf("ParseSFTPPublicKey accepted %q", name) + } + }) + } + if _, err := ParseSFTPPublicKey(weak); !errors.Is(err, ErrSFTPKeyWeak) { + t.Fatalf("rsa 2048 error = %v, want ErrSFTPKeyWeak", err) + } +} + +func TestSFTPFingerprintForLogin(t *testing.T) { + line, sshPub := sftpAuthorizedKey(t, "ed25519") + fp, err := SFTPFingerprintForLogin(line) + if err != nil { + t.Fatalf("SFTPFingerprintForLogin: %v", err) + } + if fp != ssh.FingerprintSHA256(sshPub) { + t.Fatalf("fingerprint = %q", fp) + } +} + +func TestGenerateSFTPPassword(t *testing.T) { + for _, n := range []int{SFTPPasswordMinLen, SFTPPasswordMaxLen} { + pw, err := GenerateSFTPPassword(n) + if err != nil || len(pw) != n { + t.Fatalf("GenerateSFTPPassword(%d) = %q, %v", n, pw, err) + } + } + for _, n := range []int{SFTPPasswordMinLen - 1, SFTPPasswordMaxLen + 1} { + if _, err := GenerateSFTPPassword(n); !errors.Is(err, ErrSFTPPasswordLen) { + t.Fatalf("GenerateSFTPPassword(%d) error = %v, want ErrSFTPPasswordLen", n, err) + } + } + seen := map[byte]bool{} + for i := 0; i < 500; i++ { + pw, err := GenerateSFTPPassword(SFTPPasswordMaxLen) + if err != nil { + t.Fatalf("GenerateSFTPPassword: %v", err) + } + for j := 0; j < len(pw); j++ { + if pw[j] < '!' || pw[j] > '~' { + t.Fatalf("password has non-printable or space byte %q", pw[j]) + } + seen[pw[j]] = true + } + } + if len(seen) != 94 { + t.Fatalf("saw %d distinct characters, want 94", len(seen)) + } +} + +// sftpUserID returns the id of a seeded user. +func sftpUserID(t *testing.T, s *SessionStore, username string) int64 { + t.Helper() + u, _, err := s.SFTPUserByName(context.Background(), username) + if err != nil { + t.Fatalf("SFTPUserByName(%s): %v", username, err) + } + return u.ID +} + +func TestSFTPKeys_AddListDelete(t *testing.T) { + ctx := context.Background() + st := newAuthDB(t) + seedUser(t, st, "alice", "hunter2", "admin") + seedUser(t, st, "bob", "hunter3", "admin") + s := NewSessionStore(st) + alice, bob := sftpUserID(t, s, "alice"), sftpUserID(t, s, "bob") + + line, _ := sftpAuthorizedKey(t, "ed25519") + key, err := s.AddSFTPKey(ctx, alice, " laptop ", line) + if err != nil { + t.Fatalf("AddSFTPKey: %v", err) + } + if key.Name != "laptop" || key.PublicKey != line { + t.Fatalf("stored key = %+v", key) + } + if _, err := s.AddSFTPKey(ctx, bob, "other", line); !errors.Is(err, ErrSFTPKeyDuplicate) { + t.Fatalf("same key for other user error = %v, want ErrSFTPKeyDuplicate", err) + } + if _, err := s.AddSFTPKey(ctx, alice, "laptop", mustKey(t)); !errors.Is(err, ErrSFTPKeyNameInUse) { + t.Fatalf("reused name error = %v, want ErrSFTPKeyNameInUse", err) + } + if _, err := s.AddSFTPKey(ctx, alice, " ", mustKey(t)); !errors.Is(err, ErrSFTPKeyName) { + t.Fatalf("empty name error = %v, want ErrSFTPKeyName", err) + } + if _, err := s.AddSFTPKey(ctx, alice, strings.Repeat("x", maxSFTPKeyNameLen+1), mustKey(t)); !errors.Is(err, ErrSFTPKeyName) { + t.Fatalf("long name error = %v, want ErrSFTPKeyName", err) + } + + keys, err := s.ListSFTPKeys(ctx, alice) + if err != nil || len(keys) != 1 { + t.Fatalf("ListSFTPKeys = %d keys, %v", len(keys), err) + } + + // Deleting a key revokes sessions that used it. + token, _, err := s.IssueSFTPSession(ctx, alice, "local", "key:"+fmt.Sprint(key.ID), 0) + if err != nil { + t.Fatalf("IssueSFTPSession: %v", err) + } + if err := s.DeleteSFTPKey(ctx, bob, key.ID); !errors.Is(err, ErrSFTPNotFound) { + t.Fatalf("delete other user's key error = %v, want ErrSFTPNotFound", err) + } + if err := s.DeleteSFTPKey(ctx, alice, key.ID); err != nil { + t.Fatalf("DeleteSFTPKey: %v", err) + } + if _, _, err := s.LookupSFTPSessionToken(ctx, token); err == nil { + t.Fatal("session of deleted key still valid") + } +} + +func TestSFTPKeys_Limit(t *testing.T) { + ctx := context.Background() + st := newAuthDB(t) + seedUser(t, st, "alice", "hunter2", "admin") + s := NewSessionStore(st) + alice := sftpUserID(t, s, "alice") + for i := 0; i < SFTPMaxKeysPerUser; i++ { + if _, err := s.AddSFTPKey(ctx, alice, "key"+fmt.Sprint(int64(i)), mustKey(t)); err != nil { + t.Fatalf("AddSFTPKey %d: %v", i, err) + } + } + if _, err := s.AddSFTPKey(ctx, alice, "one-more", mustKey(t)); !errors.Is(err, ErrSFTPKeyLimit) { + t.Fatalf("21st key error = %v, want ErrSFTPKeyLimit", err) + } +} + +func TestSFTPPassword_GenerateVerifyRegenerateRevoke(t *testing.T) { + ctx := context.Background() + st := newAuthDB(t) + seedUser(t, st, "alice", "hunter2", "admin") + s := NewSessionStore(st) + SetFastHashParams(t) + alice := sftpUserID(t, s, "alice") + + pw, err := s.GenerateAndStoreSFTPPassword(ctx, alice, SFTPPasswordMinLen) + if err != nil { + t.Fatalf("GenerateAndStoreSFTPPassword: %v", err) + } + hash, found, err := s.GetSFTPPasswordHash(ctx, alice) + if err != nil || !found || !strings.HasPrefix(hash, "$argon2id$") { + t.Fatalf("stored hash found=%v err=%v", found, err) + } + if strings.Contains(hash, pw) { + t.Fatal("hash contains the clear password") + } + if _, _, ok, err := s.VerifySFTPPassword(ctx, "alice", pw); err != nil || !ok { + t.Fatalf("VerifySFTPPassword(current) ok=%v err=%v", ok, err) + } + if _, _, ok, _ := s.VerifySFTPPassword(ctx, "alice", pw+"x"); ok { + t.Fatal("wrong password verified") + } + if _, _, ok, _ := s.VerifySFTPPassword(ctx, "nobody", pw); ok { + t.Fatal("unknown user verified") + } + + // Regenerating replaces the row: the old password stops working and only one row remains. + pw2, err := s.GenerateAndStoreSFTPPassword(ctx, alice, SFTPPasswordMinLen) + if err != nil { + t.Fatalf("regenerate: %v", err) + } + if _, _, ok, _ := s.VerifySFTPPassword(ctx, "alice", pw); ok { + t.Fatal("old password still verifies after regenerate") + } + if _, _, ok, err := s.VerifySFTPPassword(ctx, "alice", pw2); err != nil || !ok { + t.Fatalf("new password ok=%v err=%v", ok, err) + } + var rows int + if err := st.DB.QueryRowContext(ctx, `SELECT COUNT(*) FROM sftp_passwords WHERE user_id = ?`, alice).Scan(&rows); err != nil || rows != 1 { + t.Fatalf("password rows = %d, %v", rows, err) + } + + if err := s.DeleteSFTPPassword(ctx, alice); err != nil { + t.Fatalf("DeleteSFTPPassword: %v", err) + } + if _, _, ok, _ := s.VerifySFTPPassword(ctx, "alice", pw2); ok { + t.Fatal("password verifies after revoke") + } + if err := s.DeleteSFTPPassword(ctx, alice); !errors.Is(err, ErrSFTPNotFound) { + t.Fatalf("second delete error = %v, want ErrSFTPNotFound", err) + } +} + +func TestSFTPServiceTokens_FormatStorageLimitRevoke(t *testing.T) { + ctx := context.Background() + st := newAuthDB(t) + s := NewSessionStore(st) + + tok, raw, err := s.CreateSFTPServiceToken(ctx, "local") + if err != nil { + t.Fatalf("CreateSFTPServiceToken: %v", err) + } + if !strings.HasPrefix(raw, SFTPServicePrefix) || len(raw) != len(SFTPServicePrefix)+sftpTokenBodyLen { + t.Fatalf("token format = %q", raw) + } + var stored int + if err := st.DB.QueryRowContext(ctx, `SELECT COUNT(*) FROM sftp_service_tokens WHERE digest = ?`, raw).Scan(&stored); err != nil || stored != 0 { + t.Fatalf("raw token stored as digest: rows=%d err=%v", stored, err) + } + if err := st.DB.QueryRowContext(ctx, `SELECT COUNT(*) FROM sftp_service_tokens WHERE digest = ?`, sessionDigest(raw)).Scan(&stored); err != nil || stored != 1 { + t.Fatalf("digest not stored: rows=%d err=%v", stored, err) + } + id, cluster, err := s.AuthenticateSFTPService(ctx, raw) + if err != nil || id != tok.ID || cluster != "local" { + t.Fatalf("AuthenticateSFTPService = %d %q %v", id, cluster, err) + } + + if _, _, err := s.CreateSFTPServiceToken(ctx, "local"); err != nil { + t.Fatalf("second token: %v", err) + } + if _, _, err := s.CreateSFTPServiceToken(ctx, "local"); !errors.Is(err, ErrSFTPServiceTokenLimit) { + t.Fatalf("third token error = %v, want ErrSFTPServiceTokenLimit", err) + } + + if err := s.RevokeSFTPServiceToken(ctx, "local", tok.ID); err != nil { + t.Fatalf("RevokeSFTPServiceToken: %v", err) + } + if _, _, err := s.AuthenticateSFTPService(ctx, raw); !errors.Is(err, sql.ErrNoRows) { + t.Fatalf("revoked token error = %v, want sql.ErrNoRows", err) + } + if _, _, err := s.AuthenticateSFTPService(ctx, "gpsftps_short"); !errors.Is(err, sql.ErrNoRows) { + t.Fatalf("malformed token error = %v, want sql.ErrNoRows", err) + } +} + +func TestSFTPSessions_EpochRevokeAndCheck(t *testing.T) { + ctx := context.Background() + st := newAuthDB(t) + seedUser(t, st, "alice", "hunter2", "admin") + s := NewSessionStore(st) + alice := sftpUserID(t, s, "alice") + + token, expires, err := s.IssueSFTPSession(ctx, alice, "local", "password", 0) + if err != nil { + t.Fatalf("IssueSFTPSession: %v", err) + } + if !strings.HasPrefix(token, SFTPSessionTokenPrefix) || len(token) != len(SFTPSessionTokenPrefix)+sftpTokenBodyLen { + t.Fatalf("session token format = %q", token) + } + if d := time.Until(expires); d < 14*time.Minute || d > 15*time.Minute+time.Second { + t.Fatalf("expiry in %v, want about 15m", d) + } + u, sess, err := s.LookupSFTPSessionToken(ctx, token) + if err != nil || u.Username != "alice" || sess.Cluster != "local" { + t.Fatalf("LookupSFTPSessionToken = %v %+v", err, sess) + } + + missing, err := s.CheckSFTPSessions(ctx, "local", []string{sessionDigest(token), "nope"}) + if err != nil || len(missing) != 1 || missing[0] != "nope" { + t.Fatalf("CheckSFTPSessions(valid) = %v, %v", missing, err) + } + + // A password reset bumps users.session_epoch: the session is no longer valid. + if _, err := st.DB.ExecContext(ctx, `UPDATE users SET session_epoch = session_epoch + 1 WHERE id = ?`, alice); err != nil { + t.Fatalf("bump epoch: %v", err) + } + if _, _, err := s.LookupSFTPSessionToken(ctx, token); err == nil { + t.Fatal("session valid after epoch bump") + } + revoked, err := s.CheckSFTPSessions(ctx, "local", []string{sessionDigest(token)}) + if err != nil || len(revoked) != 1 { + t.Fatalf("CheckSFTPSessions(after bump) = %v, %v", revoked, err) + } +} + +func TestSFTPSessions_PasswordSessionsSurviveKeyDelete(t *testing.T) { + ctx := context.Background() + st := newAuthDB(t) + seedUser(t, st, "alice", "hunter2", "admin") + s := NewSessionStore(st) + alice := sftpUserID(t, s, "alice") + + key, err := s.AddSFTPKey(ctx, alice, "laptop", mustKey(t)) + if err != nil { + t.Fatalf("AddSFTPKey: %v", err) + } + keyToken, _, err := s.IssueSFTPSession(ctx, alice, "local", "key:"+fmt.Sprint(key.ID), 0) + if err != nil { + t.Fatalf("issue key session: %v", err) + } + pwToken, _, err := s.IssueSFTPSession(ctx, alice, "local", "password", 0) + if err != nil { + t.Fatalf("issue password session: %v", err) + } + if err := s.DeleteSFTPKey(ctx, alice, key.ID); err != nil { + t.Fatalf("DeleteSFTPKey: %v", err) + } + if _, _, err := s.LookupSFTPSessionToken(ctx, keyToken); err == nil { + t.Fatal("key session survived key delete") + } + if _, _, err := s.LookupSFTPSessionToken(ctx, pwToken); err != nil { + t.Fatalf("password session revoked by key delete: %v", err) + } + + // DeleteForUser (privilege change, user delete path) revokes every SFTP session. + if err := s.DeleteForUser(ctx, alice); err != nil { + t.Fatalf("DeleteForUser: %v", err) + } + if _, _, err := s.LookupSFTPSessionToken(ctx, pwToken); err == nil { + t.Fatal("password session survived DeleteForUser") + } +} + +func TestSFTPSessions_SlideThrottledAndGC(t *testing.T) { + ctx := context.Background() + st := newAuthDB(t) + seedUser(t, st, "alice", "hunter2", "admin") + s := NewSessionStore(st) + alice := sftpUserID(t, s, "alice") + + token, _, err := s.IssueSFTPSession(ctx, alice, "local", "password", 0) + if err != nil { + t.Fatalf("IssueSFTPSession: %v", err) + } + _, sess, err := s.LookupSFTPSessionToken(ctx, token) + if err != nil { + t.Fatalf("lookup: %v", err) + } + sentinel := "2099-01-01T00:00:00Z" + setExpiry := func() { + if _, err := st.DB.ExecContext(ctx, `UPDATE sftp_sessions SET expires_at = ? WHERE id = ?`, sentinel, sess.ID); err != nil { + t.Fatalf("set expiry: %v", err) + } + } + readExpiry := func() string { + var v string + if err := st.DB.QueryRowContext(ctx, `SELECT expires_at FROM sftp_sessions WHERE id = ?`, sess.ID).Scan(&v); err != nil { + t.Fatalf("read expiry: %v", err) + } + return v + } + + // First slide writes; a second slide inside the interval does not. + setExpiry() + sftpLastSlide.Delete(sess.ID) + s.slideSFTPSession(ctx, sess.ID) + if got := readExpiry(); got == sentinel { + t.Fatal("first slide did not write expires_at") + } + setExpiry() + s.slideSFTPSession(ctx, sess.ID) + if got := readExpiry(); got != sentinel { + t.Fatalf("slide within interval wrote expires_at = %q", got) + } + + // Expired and revoked rows are swept by the hourly GC. + if _, err := st.DB.ExecContext(ctx, `UPDATE sftp_sessions SET expires_at = ? WHERE id = ?`, "2000-01-01T00:00:00Z", sess.ID); err != nil { + t.Fatalf("expire: %v", err) + } + s.gcOnce(ctx) + var n int + if err := st.DB.QueryRowContext(ctx, `SELECT COUNT(*) FROM sftp_sessions WHERE id = ?`, sess.ID).Scan(&n); err != nil || n != 0 { + t.Fatalf("expired session rows after gc = %d, %v", n, err) + } +} + +// mustKey returns a fresh ed25519 authorized_keys line. +func mustKey(t *testing.T) string { + t.Helper() + line, _ := sftpAuthorizedKey(t, "ed25519") + return line +} diff --git a/api/internal/auth/sftp_tokens.go b/api/internal/auth/sftp_tokens.go new file mode 100644 index 000000000..962ebd86e --- /dev/null +++ b/api/internal/auth/sftp_tokens.go @@ -0,0 +1,144 @@ +package auth + +import ( + "context" + "crypto/rand" + "database/sql" + "encoding/base64" + "errors" + "fmt" + "log/slog" + "strings" + "sync" + "time" +) + +// SFTPServicePrefix starts every SFTP service token (the SFTP endpoint's bearer credential). +const SFTPServicePrefix = "gpsftps_" + +const ( + // SFTPSessionTokenPrefix starts every SFTP session token minted by /sftp/v1/login. + // Neither prefix is a prefix of the other ("gpsftps_" differs at index 6). + SFTPSessionTokenPrefix = "gpsftp_" + + sftpTokenRandomBytes = 32 + sftpTokenBodyLen = 43 // base64 raw URL encoding of 32 bytes + sftpSessionTTL = 15 * time.Minute + sftpSlideInterval = lastUsedInterval // at most one expiry write per session per minute + sftpTokenPrefixLen = 12 +) + +// sftpLastSlide records the last expiry slide per SFTP session id. +var sftpLastSlide sync.Map + +// newSFTPToken returns prefix followed by 32 random bytes in unpadded base64url (43 characters). +func newSFTPToken(prefix string) string { + raw := make([]byte, sftpTokenRandomBytes) + if _, err := rand.Read(raw); err != nil { + panic("crypto/rand: " + err.Error()) + } + return prefix + base64.RawURLEncoding.EncodeToString(raw) +} + +// validSFTPToken reports whether raw has the prefix and the fixed length of a generated token. +// It runs before any query, so malformed bearer values never reach the database. +func validSFTPToken(raw, prefix string) bool { + return strings.HasPrefix(raw, prefix) && len(raw) == len(prefix)+sftpTokenBodyLen +} + +// errSFTPSeedFormat is returned by SeedSFTPServiceToken for a value that is not a generated service token. +var errSFTPSeedFormat = errors.New("sftp service token has the wrong format") + +// SeedSFTPServiceToken registers a service token supplied by the deployment (the chart's local SFTP +// token, spec 040) for cluster, so the SFTP pod in the panel's own cluster can log in without an admin +// step. It is idempotent: a digest already stored, revoked or not, is left alone, so a token an admin +// revoked stays revoked across restarts. A new digest replaces the cluster's previously seeded token +// (and its sessions) in the same transaction, so offline renders that generate a fresh secret never +// count twice against the active limit. At the per-cluster active limit it logs and returns nil; the +// seeded token then stays unusable until an admin revokes one. +func (s *SessionStore) SeedSFTPServiceToken(ctx context.Context, cluster, raw string) error { + if !validSFTPToken(raw, SFTPServicePrefix) { + return fmt.Errorf("seed sftp service token: %w", errSFTPSeedFormat) + } + digest := sessionDigest(raw) + exists, err := sftpExists(ctx, s.db.DB, `SELECT 1 FROM sftp_service_tokens WHERE digest = ?`, digest) + if err != nil { + return fmt.Errorf("seed sftp service token: lookup: %w", err) + } + if exists { + return nil + } + if _, err := s.insertServiceToken(ctx, cluster, digest, raw[:sftpTokenPrefixLen], true); err != nil { + if errors.Is(err, ErrSFTPServiceTokenLimit) { + slog.Warn("sftp: seeded service token not stored, the cluster is at its active token limit; revoke one to use it", "cluster", cluster) + return nil + } + return fmt.Errorf("seed sftp service token: %w", err) + } + return nil +} + +// CreateSFTPServiceToken makes a service token for cluster (e.g. "local"). The token is returned once. +func (s *SessionStore) CreateSFTPServiceToken(ctx context.Context, cluster string) (SFTPServiceToken, string, error) { + token := newSFTPToken(SFTPServicePrefix) + tok, err := s.InsertSFTPServiceToken(ctx, cluster, sessionDigest(token), token[:sftpTokenPrefixLen]) + if err != nil { + return SFTPServiceToken{}, "", err + } + return tok, token, nil +} + +// AuthenticateSFTPService resolves a raw "gpsftps_" service token to (tokenID, cluster). +// It returns sql.ErrNoRows for an unknown, revoked or malformed token. +func (s *SessionStore) AuthenticateSFTPService(ctx context.Context, raw string) (int64, string, error) { + if !validSFTPToken(raw, SFTPServicePrefix) { + return 0, "", sql.ErrNoRows + } + return s.LookupSFTPServiceToken(ctx, sessionDigest(raw)) +} + +// IssueSFTPSession mints a gpsftp_ session token for userID and cluster. credential is "password" or +// "key:". epoch is the users.session_epoch read with the credential check. It returns the token +// and its expiry (now + 15 minutes). +func (s *SessionStore) IssueSFTPSession(ctx context.Context, userID int64, cluster, credential string, epoch int64) (string, time.Time, error) { + return s.IssueSFTPSessionForToken(ctx, userID, cluster, credential, epoch, 0) +} + +// IssueSFTPSessionForToken is IssueSFTPSession for a login made with service token serviceTokenID +// (0 for none). Revoking that service token ends the session. +func (s *SessionStore) IssueSFTPSessionForToken(ctx context.Context, userID int64, cluster, credential string, epoch, serviceTokenID int64) (string, time.Time, error) { + if credential == "" { + return "", time.Time{}, fmt.Errorf("issue sftp session: empty credential") + } + token := newSFTPToken(SFTPSessionTokenPrefix) + expires := time.Now().Add(sftpSessionTTL) + if _, err := s.InsertSFTPSessionForToken(ctx, userID, cluster, credential, sessionDigest(token), epoch, expires, serviceTokenID); err != nil { + return "", time.Time{}, fmt.Errorf("issue sftp session: %w", err) + } + return token, expires, nil +} + +// LookupSFTPSessionToken resolves a raw gpsftp_ session token to its owner and session row. +// Unknown, revoked, expired and epoch-mismatched tokens fail; the errors wrap sql.ErrNoRows, +// errSessionInvalid or errSessionExpired. +func (s *SessionStore) LookupSFTPSessionToken(ctx context.Context, raw string) (*User, SFTPSession, error) { + if !validSFTPToken(raw, SFTPSessionTokenPrefix) { + return nil, SFTPSession{}, sql.ErrNoRows + } + return s.LookupSFTPSession(ctx, sessionDigest(raw)) +} + +// slideSFTPSession moves a session's expiry forward, at most once per sftpSlideInterval. +// Errors are logged only; a failed slide must not fail the request. +func (s *SessionStore) slideSFTPSession(ctx context.Context, id int64) { + now := time.Now() + if v, ok := sftpLastSlide.Load(id); ok { + if last, isTime := v.(time.Time); isTime && now.Sub(last) < sftpSlideInterval { + return + } + } + sftpLastSlide.Store(id, now) + if err := s.SlideSFTPSession(ctx, id, now.Add(sftpSessionTTL)); err != nil { + slog.Warn("sftp slide session", "err", err) + } +} diff --git a/api/internal/db/migrations/common/024_sftp_credentials.sql b/api/internal/db/migrations/common/024_sftp_credentials.sql new file mode 100644 index 000000000..9391eea4f --- /dev/null +++ b/api/internal/db/migrations/common/024_sftp_credentials.sql @@ -0,0 +1,50 @@ +-- Spec 040: SFTP access. Credentials are separate from dashboard logins. +-- sftp_ssh_keys a user's SFTP public keys (normalized authorized_keys line); the +-- fingerprint is unique across all users, so one key belongs to one user +-- sftp_passwords at most one generated SFTP password per user, argon2id hash only +-- sftp_service_tokens per-cluster bearer credentials of an SFTP endpoint (digest only) +-- sftp_sessions short-lived session tokens (digest only) minted by /sftp/v1/login +-- Ids are generated in Go (random positive 53-bit integers) and timestamps are bound from Go +-- as RFC 3339 UTC, so the same statements run on SQLite and PostgreSQL. +-- No foreign keys (SQLite does not enforce them): DeleteUserTx deletes a user's rows in Go. +-- Portable SQL: runs unchanged on SQLite and PostgreSQL. +CREATE TABLE sftp_ssh_keys ( + id BIGINT PRIMARY KEY, + user_id BIGINT NOT NULL, + name TEXT NOT NULL, + public_key TEXT NOT NULL, + fingerprint TEXT NOT NULL UNIQUE, + created_at TEXT NOT NULL, + last_used_at TEXT +); +CREATE INDEX sftp_ssh_keys_user_id ON sftp_ssh_keys(user_id); +CREATE TABLE sftp_passwords ( + user_id BIGINT PRIMARY KEY, + hash TEXT NOT NULL, + length INTEGER NOT NULL, + created_at TEXT NOT NULL, + last_used_at TEXT +); +CREATE TABLE sftp_service_tokens ( + id BIGINT PRIMARY KEY, + cluster TEXT NOT NULL, + digest TEXT NOT NULL UNIQUE, + prefix TEXT NOT NULL, + created_at TEXT NOT NULL, + last_used_at TEXT, + revoked_at TEXT +); +CREATE INDEX sftp_service_tokens_cluster ON sftp_service_tokens(cluster); +CREATE TABLE sftp_sessions ( + id BIGINT PRIMARY KEY, + user_id BIGINT NOT NULL, + cluster TEXT NOT NULL, + credential TEXT NOT NULL, + digest TEXT NOT NULL UNIQUE, + session_epoch BIGINT NOT NULL, + expires_at TEXT NOT NULL, + revoked_at TEXT +); +CREATE INDEX sftp_sessions_user_id ON sftp_sessions(user_id); +-- Source of the request that wrote the row: NULL for dashboard requests, sftp for SFTP. +ALTER TABLE audit_events ADD COLUMN source TEXT; diff --git a/api/internal/db/migrations/common/025_sftp_cluster_endpoints.sql b/api/internal/db/migrations/common/025_sftp_cluster_endpoints.sql new file mode 100644 index 000000000..75652d712 --- /dev/null +++ b/api/internal/db/migrations/common/025_sftp_cluster_endpoints.sql @@ -0,0 +1,10 @@ +-- Spec 040 (US4): the SFTP endpoint address and host key fingerprint of each registered remote +-- cluster, set by an admin with PUT /clusters/{name}/sftp. The panel's own cluster reads its +-- address from chart values and its fingerprint from the host key Secret, so it has no row. +-- Portable SQL: runs unchanged on SQLite and PostgreSQL. +CREATE TABLE sftp_cluster_endpoints ( + cluster TEXT PRIMARY KEY, + address TEXT NOT NULL, + host_key_fingerprint TEXT NOT NULL, + updated_at TEXT NOT NULL +); diff --git a/api/internal/db/migrations/common/026_sftp_session_service_token.sql b/api/internal/db/migrations/common/026_sftp_session_service_token.sql new file mode 100644 index 000000000..2f7c44405 --- /dev/null +++ b/api/internal/db/migrations/common/026_sftp_session_service_token.sql @@ -0,0 +1,8 @@ +-- Spec 040 review: a session remembers the SFTP service token that minted it, so revoking the +-- token ends its sessions. NULL for sessions minted without a service token. +-- seeded marks the token registered from the deployment's chart secret (SeedSFTPServiceToken), +-- so a later render's seeded token replaces it instead of counting against the active limit. +-- Portable SQL: runs unchanged on SQLite and PostgreSQL. +ALTER TABLE sftp_sessions ADD COLUMN service_token_id BIGINT; +ALTER TABLE sftp_service_tokens ADD COLUMN seeded INTEGER NOT NULL DEFAULT 0; +CREATE INDEX sftp_sessions_service_token_id ON sftp_sessions(service_token_id); diff --git a/api/internal/db/migrations_sftp_postgres_test.go b/api/internal/db/migrations_sftp_postgres_test.go new file mode 100644 index 000000000..13da8577e --- /dev/null +++ b/api/internal/db/migrations_sftp_postgres_test.go @@ -0,0 +1,11 @@ +//go:build postgres + +package db + +import "testing" + +// Migration 024 on PostgreSQL: the same SFTP checks as on SQLite, on a +// fresh unmigrated schema of the test database. +func TestPostgres_Migration024_SFTP(t *testing.T) { + checkSFTPMigration(t, openPostgresSchema(t)) +} diff --git a/api/internal/db/migrations_sftp_test.go b/api/internal/db/migrations_sftp_test.go new file mode 100644 index 000000000..3bf4015ba --- /dev/null +++ b/api/internal/db/migrations_sftp_test.go @@ -0,0 +1,128 @@ +package db + +import ( + "database/sql" + "testing" + "time" +) + +// checkSFTPMigration seeds a pre-024 database, runs migration 024 and checks +// that the SFTP tables accept rows, enforce their unique keys and that the +// audit_events.source column is added without touching existing rows. +func checkSFTPMigration(t *testing.T, s *Store) { + t.Helper() + ctx := t.Context() + migrateBefore(t, s, "024") + + var userID int64 + if err := s.DB.QueryRowContext(ctx, + `INSERT INTO users(username, role) VALUES (?, ?) RETURNING id`, "sftp-mig-user", "operator").Scan(&userID); err != nil { + t.Fatalf("insert user: %v", err) + } + ts := time.Now().UTC().Format(time.RFC3339) + var oldAuditID int64 + if err := s.DB.QueryRowContext(ctx, + `INSERT INTO audit_events(ts, actor, method, path, status) VALUES (?, ?, ?, ?, ?) RETURNING id`, + ts, "sftp-mig-actor", "GET", "/api/v1/servers", 200).Scan(&oldAuditID); err != nil { + t.Fatalf("insert pre-024 audit row: %v", err) + } + + if err := s.Migrate(ctx); err != nil { + t.Fatalf("migrate: %v", err) + } + + var applied int + if err := s.DB.QueryRowContext(ctx, + `SELECT COUNT(*) FROM schema_migrations WHERE version = ?`, "024_sftp_credentials.sql").Scan(&applied); err != nil { + t.Fatalf("read schema_migrations: %v", err) + } + if applied != 1 { + t.Fatalf("024_sftp_credentials.sql recorded %d times, want 1", applied) + } + + var oldSource sql.NullString + if err := s.DB.QueryRowContext(ctx, + `SELECT source FROM audit_events WHERE id = ?`, oldAuditID).Scan(&oldSource); err != nil { + t.Fatalf("read pre-024 audit source: %v", err) + } + if oldSource.Valid { + t.Fatalf("pre-024 audit row source = %q, want NULL", oldSource.String) + } + var newAuditID int64 + if err := s.DB.QueryRowContext(ctx, + `INSERT INTO audit_events(ts, actor, method, path, status, source) VALUES (?, ?, ?, ?, ?, ?) RETURNING id`, + ts, "sftp-mig-actor", "GET", "/sftp/v1/login", 200, "sftp").Scan(&newAuditID); err != nil { + t.Fatalf("insert sftp audit row: %v", err) + } + var newSource string + if err := s.DB.QueryRowContext(ctx, + `SELECT source FROM audit_events WHERE id = ?`, newAuditID).Scan(&newSource); err != nil { + t.Fatalf("read sftp audit source: %v", err) + } + if newSource != "sftp" { + t.Fatalf("sftp audit source = %q, want sftp", newSource) + } + + const fingerprint = "SHA256:sftp-mig-fp" + insertKey := func(id int64, fp string) error { + _, err := s.DB.ExecContext(ctx, + `INSERT INTO sftp_ssh_keys(id, user_id, name, public_key, fingerprint, created_at) VALUES (?, ?, ?, ?, ?, ?)`, + id, userID, "laptop", "ssh-ed25519 AAAA", fp, ts) + return err + } + if err := insertKey(9101, fingerprint); err != nil { + t.Fatalf("insert sftp key: %v", err) + } + if err := insertKey(9102, fingerprint); err == nil { + t.Fatal("second sftp key with the same fingerprint accepted, want UNIQUE violation") + } + + insertPassword := func() error { + _, err := s.DB.ExecContext(ctx, + `INSERT INTO sftp_passwords(user_id, hash, length, created_at) VALUES (?, ?, ?, ?)`, + userID, "argon2id-hash", 24, ts) + return err + } + if err := insertPassword(); err != nil { + t.Fatalf("insert sftp password: %v", err) + } + if err := insertPassword(); err == nil { + t.Fatal("second sftp password for one user accepted, want primary key violation") + } + + insertToken := func(id int64, digest string) error { + _, err := s.DB.ExecContext(ctx, + `INSERT INTO sftp_service_tokens(id, cluster, digest, prefix, created_at) VALUES (?, ?, ?, ?, ?)`, + id, "local", digest, "gpsvc_", ts) + return err + } + if err := insertToken(9201, "digest-svc"); err != nil { + t.Fatalf("insert service token: %v", err) + } + if err := insertToken(9202, "digest-svc"); err == nil { + t.Fatal("second service token with the same digest accepted, want UNIQUE violation") + } + + insertSession := func(id int64, digest string) error { + _, err := s.DB.ExecContext(ctx, + `INSERT INTO sftp_sessions(id, user_id, cluster, credential, digest, session_epoch, expires_at) VALUES (?, ?, ?, ?, ?, ?, ?)`, + id, userID, "local", "password", digest, 0, ts) + return err + } + if err := insertSession(9301, "digest-sess"); err != nil { + t.Fatalf("insert sftp session: %v", err) + } + if err := insertSession(9302, "digest-sess"); err == nil { + t.Fatal("second sftp session with the same digest accepted, want UNIQUE violation") + } +} + +// TestMigration024_SFTP_SQLite runs the SFTP migration checks on SQLite. +func TestMigration024_SFTP_SQLite(t *testing.T) { + s, err := Open(t.Context(), "sqlite", ":memory:") + if err != nil { + t.Fatalf("open sqlite: %v", err) + } + t.Cleanup(func() { _ = s.Close() }) + checkSFTPMigration(t, s) +} diff --git a/api/internal/db/users.go b/api/internal/db/users.go index 74ee4068c..43be46504 100644 --- a/api/internal/db/users.go +++ b/api/internal/db/users.go @@ -11,6 +11,7 @@ import ( // transaction: the account's SSO links, preferences, sessions, API tokens, // role bindings, and telemetry notice acks are deleted, and the share links // it created are revoked (revocation, not a delete, keeps their audit trail). +// The account's SFTP keys, SFTP password and SFTP sessions (spec 040) are deleted too. // The rows are removed explicitly rather than left to ON DELETE CASCADE, // because the shipped SQLite DSN runs with foreign keys off. Deleting an // unknown id is a no-op. @@ -44,6 +45,9 @@ func (s *Store) DeleteUserTx(ctx context.Context, tx *sql.Tx, userID int64) erro `DELETE FROM sessions WHERE user_id = ?`, `DELETE FROM api_tokens WHERE user_id = ?`, `DELETE FROM mcp_tokens WHERE user_id = ?`, + `DELETE FROM sftp_ssh_keys WHERE user_id = ?`, + `DELETE FROM sftp_passwords WHERE user_id = ?`, + `DELETE FROM sftp_sessions WHERE user_id = ?`, } { if _, err := tx.ExecContext(ctx, stmt, userID); err != nil { return fmt.Errorf("delete user: %s: %w", stmt, err) diff --git a/api/internal/db/users_sftp_test.go b/api/internal/db/users_sftp_test.go new file mode 100644 index 000000000..2fdbb993c --- /dev/null +++ b/api/internal/db/users_sftp_test.go @@ -0,0 +1,62 @@ +package db + +import ( + "context" + "testing" + "time" +) + +// seedSFTPRows gives userID one SFTP key, one password row and one session. +func seedSFTPRows(t *testing.T, s *Store, userID int64, tag string) { + t.Helper() + ctx := context.Background() + now := time.Now().UTC().Format(time.RFC3339) + for _, stmt := range []struct { + sql string + args []any + }{ + {`INSERT INTO sftp_ssh_keys(id, user_id, name, public_key, fingerprint, created_at) VALUES (?, ?, ?, ?, ?, ?)`, + []any{userID*10 + 1, userID, "key-" + tag, "ssh-ed25519 AAAA-" + tag, "SHA256:fp-" + tag, now}}, + {`INSERT INTO sftp_passwords(user_id, hash, length, created_at) VALUES (?, ?, ?, ?)`, + []any{userID, "hash-" + tag, 24, now}}, + {`INSERT INTO sftp_sessions(id, user_id, cluster, credential, digest, session_epoch, expires_at) VALUES (?, ?, ?, ?, ?, ?, ?)`, + []any{userID*10 + 2, userID, "local", "password", "sess-" + tag, 0, now}}, + } { + if _, err := s.DB.ExecContext(ctx, stmt.sql, stmt.args...); err != nil { + t.Fatalf("seed %q: %v", stmt.sql, err) + } + } +} + +// sftpRowCount counts userID's rows in one SFTP table. +func sftpRowCount(t *testing.T, s *Store, table string, userID int64) int { + t.Helper() + var n int + if err := s.DB.QueryRowContext(context.Background(), + `SELECT COUNT(*) FROM `+table+` WHERE user_id = ?`, userID).Scan(&n); err != nil { + t.Fatalf("count %s: %v", table, err) + } + return n +} + +// TestDeleteUser_RemovesSFTPCredentials checks that deleting an account removes its SFTP +// keys, password and sessions, and leaves another account's SFTP rows untouched. +func TestDeleteUser_RemovesSFTPCredentials(t *testing.T) { + s := newShareLinksStore(t) + doomed := insertTestUser(t, s, "sftp-doomed") + kept := insertTestUser(t, s, "sftp-kept") + seedSFTPRows(t, s, doomed, "doomed") + seedSFTPRows(t, s, kept, "kept") + + if err := s.DeleteUser(context.Background(), doomed); err != nil { + t.Fatalf("delete user: %v", err) + } + for _, table := range []string{"sftp_ssh_keys", "sftp_passwords", "sftp_sessions"} { + if n := sftpRowCount(t, s, table, doomed); n != 0 { + t.Errorf("%s: %d rows left for deleted user, want 0", table, n) + } + if n := sftpRowCount(t, s, table, kept); n != 1 { + t.Errorf("%s: %d rows for other user, want 1", table, n) + } + } +} diff --git a/api/internal/gateway/duration_test.go b/api/internal/gateway/duration_test.go index 22f70b04d..15ee6ea0c 100644 --- a/api/internal/gateway/duration_test.go +++ b/api/internal/gateway/duration_test.go @@ -103,7 +103,7 @@ func durationProxy(ctx context.Context, t *testing.T, h *handler, cert *x509.Cer } func TestGatewayTransfersWithoutTotalCap(t *testing.T) { - for _, path := range []string{"/files/download", "/logs/download", "/files/upload", "/mods/upload", "/mods/install", "capture"} { + for _, path := range []string{"/files/download", "/logs/download", "/files/upload", "/mods/upload", "/mods/install", "/files/stream", "capture"} { t.Run(path, func(t *testing.T) { h, cert := newFixture(t) h.cfg.MaxRequestDuration = 0 @@ -111,6 +111,9 @@ func TestGatewayTransfersWithoutTotalCap(t *testing.T) { if path == "/files/upload" || path == "/mods/upload" || path == "/mods/install" { method = http.MethodPost } + if path == "/files/stream" { + method = http.MethodPut + } var gatewayPath string var err error if path == "capture" { @@ -237,6 +240,9 @@ func TestGatewayDeadlinePolicy(t *testing.T) { {http.MethodPost, "/files/upload", true}, {http.MethodPost, "/mods/upload", true}, {http.MethodPost, "/mods/install", true}, + {http.MethodPut, "/files/stream", true}, + {http.MethodGet, "/files/stat", false}, + {http.MethodPost, "/files/rename", false}, {http.MethodGet, "/status", false}, {http.MethodGet, "/files/list", false}, {http.MethodGet, "/files/read", false}, diff --git a/api/internal/gateway/files_limit_test.go b/api/internal/gateway/files_limit_test.go new file mode 100644 index 000000000..0636316a4 --- /dev/null +++ b/api/internal/gateway/files_limit_test.go @@ -0,0 +1,25 @@ +package gateway + +import ( + "testing" + + "github.com/GameplanePanel/gameplane/api/internal/gatewayprotocol" +) + +func TestGatewayFilesUploadLimit(t *testing.T) { + h, _ := newFixture(t) + + cfg := h.cfg + cfg.FilesMaxUploadBytes = -1 + if _, err := NewHandler(cfg, h.client); err == nil { + t.Fatal("negative upload limit accepted") + } + + for _, limit := range []int64{0, gatewayprotocol.DefaultStreamBodyLimit, 1 << 20} { + cfg := h.cfg + cfg.FilesMaxUploadBytes = limit + if _, err := NewHandler(cfg, h.client); err != nil { + t.Fatalf("limit %d refused: %v", limit, err) + } + } +} diff --git a/api/internal/gateway/server.go b/api/internal/gateway/server.go index 05eda02fa..d88931057 100644 --- a/api/internal/gateway/server.go +++ b/api/internal/gateway/server.go @@ -32,6 +32,9 @@ type Config struct { CaptureMaxRetentionSeconds int64 CaptureDefaultMaxDurationSecs int64 CaptureDefaultMaxSizeBytes int64 + // FilesMaxUploadBytes caps one files/stream body. Zero selects + // gatewayprotocol.DefaultStreamBodyLimit. + FilesMaxUploadBytes int64 } type httpTransport = http.Transport @@ -50,6 +53,12 @@ func NewHandler(cfg Config, client *kube.Client) (http.Handler, error) { if cfg.MaxRequestDuration < 0 { return nil, errors.New("gateway request duration must not be negative") } + if cfg.FilesMaxUploadBytes < 0 { + return nil, errors.New("gateway upload limit must not be negative") + } + if cfg.FilesMaxUploadBytes == 0 { + cfg.FilesMaxUploadBytes = gatewayprotocol.DefaultStreamBodyLimit + } if cfg.CaptureDefaultRetentionSeconds == 0 { cfg.CaptureDefaultRetentionSeconds = 86400 } @@ -98,6 +107,9 @@ func (h *handler) ServeHTTP(w http.ResponseWriter, req *http.Request) { http.NotFound(w, req) return } + if agentPath == "/files/stream" { + maxBody = h.cfg.FilesMaxUploadBytes + } upgrade := req.Header.Get("Upgrade") if gatewayprotocol.Streaming(agentPath) != strings.EqualFold(upgrade, "websocket") || (upgrade != "" && !strings.EqualFold(upgrade, "websocket")) { http.Error(w, "unsupported upgrade", http.StatusBadRequest) diff --git a/api/internal/gatewayprotocol/duration.go b/api/internal/gatewayprotocol/duration.go index b6131a98a..dfba689a4 100644 --- a/api/internal/gatewayprotocol/duration.go +++ b/api/internal/gatewayprotocol/duration.go @@ -12,5 +12,8 @@ func LongRunningOperation(method, path string) bool { if method == http.MethodGet { return Streaming(path) || path == "/files/download" || path == "/logs/download" } + if method == http.MethodPut { + return path == "/files/stream" + } return method == http.MethodPost && (path == "/files/upload" || path == "/mods/upload" || path == "/mods/install") } diff --git a/api/internal/gatewayprotocol/duration_test.go b/api/internal/gatewayprotocol/duration_test.go index 86933e46d..41e8c2fe4 100644 --- a/api/internal/gatewayprotocol/duration_test.go +++ b/api/internal/gatewayprotocol/duration_test.go @@ -17,6 +17,9 @@ func TestLongRunningOperation(t *testing.T) { {http.MethodPost, "/files/upload", true}, {http.MethodPost, "/mods/upload", true}, {http.MethodPost, "/mods/install", true}, + {http.MethodPut, "/files/stream", true}, + {http.MethodGet, "/files/stat", false}, + {http.MethodPost, "/files/rename", false}, {http.MethodGet, "/mods/install", false}, {http.MethodPost, "/mods", false}, {http.MethodPost, "/mods/install/extra", false}, diff --git a/api/internal/gatewayprotocol/protocol.go b/api/internal/gatewayprotocol/protocol.go index 39a233c58..d7ab59627 100644 --- a/api/internal/gatewayprotocol/protocol.go +++ b/api/internal/gatewayprotocol/protocol.go @@ -48,12 +48,16 @@ func ParsePath(path string) (Target, string, error) { return target, agentPath, nil } +// DefaultStreamBodyLimit is the body cap for files/stream when the gateway has no configured +// limit. The gateway replaces it with its configured FilesMaxUploadBytes. +const DefaultStreamBodyLimit int64 = 20 << 30 + // Allowed returns the request body cap for the exact supported operation. func Allowed(method, path string) (int64, bool) { switch method { case http.MethodGet: switch path { - case "/console", "/logs/tail", "/logs/download", "/logs/history", "/files/list", "/files/read", "/files/download", "/files/archive", "/players", "/players/banned", "/players/whitelist", "/players/operators", "/status", "/mods": + case "/console", "/logs/tail", "/logs/download", "/logs/history", "/files/list", "/files/stat", "/files/read", "/files/download", "/files/archive", "/players", "/players/banned", "/players/whitelist", "/players/operators", "/status", "/mods": return 0, true } case http.MethodPost: @@ -62,11 +66,17 @@ func Allowed(method, path string) (int64, bool) { return 16 << 10, true case "/files/archive": return 0, true + case "/files/rename": + return 1 << 20, true case "/mods/upload": return 512 << 20, true case "/files/write", "/files/create", "/files/upload", "/files/mkdir", "/players/kick", "/players/ban", "/players/unban", "/players/whitelist/add", "/players/whitelist/remove", "/mods/install": return 64 << 20, true } + case http.MethodPut: + if path == "/files/stream" { + return DefaultStreamBodyLimit, true + } case http.MethodDelete: if path == "/files/delete" || path == "/mods" { return 64 << 20, true @@ -79,7 +89,7 @@ func Allowed(method, path string) (int64, bool) { func Streaming(path string) bool { return path == "/console" || path == "/logs/tail" } func knownPath(path string) bool { - for _, method := range []string{http.MethodGet, http.MethodPost, http.MethodDelete} { + for _, method := range []string{http.MethodGet, http.MethodPost, http.MethodPut, http.MethodDelete} { if _, ok := Allowed(method, path); ok { return true } diff --git a/api/internal/gatewayprotocol/stream_test.go b/api/internal/gatewayprotocol/stream_test.go new file mode 100644 index 000000000..237adcdea --- /dev/null +++ b/api/internal/gatewayprotocol/stream_test.go @@ -0,0 +1,40 @@ +package gatewayprotocol + +import ( + "net/http" + "testing" +) + +func TestGatewayFileStreamRoutes(t *testing.T) { + if limit, ok := Allowed(http.MethodPut, "/files/stream"); !ok || limit != DefaultStreamBodyLimit { + t.Errorf("PUT /files/stream = (%d, %v), want (%d, true)", limit, ok, DefaultStreamBodyLimit) + } + if _, ok := Allowed(http.MethodPut, "/files/write"); ok { + t.Error("PUT /files/write allowed, want denied") + } + if _, ok := Allowed(http.MethodPut, "/files/create"); ok { + t.Error("PUT /files/create allowed, want denied") + } + if _, ok := Allowed(http.MethodGet, "/files/stat"); !ok { + t.Error("GET /files/stat denied, want allowed") + } + if limit, ok := Allowed(http.MethodPost, "/files/rename"); !ok || limit != 1<<20 { + t.Errorf("POST /files/rename = (%d, %v), want (%d, true)", limit, ok, 1<<20) + } + + target := Target{Cluster: "local", Namespace: "gameplane-games", Name: "srv", UID: "uid-1"} + for _, agentPath := range []string{"/files/stat", "/files/rename", "/files/stream"} { + if _, err := Path(target, agentPath); err != nil { + t.Errorf("Path(%s) error: %v", agentPath, err) + } + } +} + +func TestGatewayFileStreamLongRunning(t *testing.T) { + if !LongRunningOperation(http.MethodPut, "/files/stream") { + t.Error("PUT /files/stream is not long running") + } + if LongRunningOperation(http.MethodPut, "/files/write") { + t.Error("PUT /files/write is long running") + } +} diff --git a/api/internal/handlers/cluster_guard_test.go b/api/internal/handlers/cluster_guard_test.go index 508ccfe47..5ea5bbdf7 100644 --- a/api/internal/handlers/cluster_guard_test.go +++ b/api/internal/handlers/cluster_guard_test.go @@ -278,7 +278,10 @@ func mountHomeClientRoutes(t *testing.T, r chi.Router, home *kube.Client, reg *k MountNotifications(r, notify.New(store, home, controlNS), home, controlNS) MountAuthProviderSecrets(r, home, controlNS) MountClusterActions(r, home, true, "") - MountClusters(r, reg, home, controlNS) + MountClustersWithSFTP(r, reg, home, controlNS, SFTPClusterMount{ + Sessions: auth.NewSessionStore(store), Kube: home, Namespace: controlNS, + HostKeySecret: "gameplane-sftp-host-key", Enabled: true, + }) MountSystemLogs(r, home, controlNS) MountRegistrySecrets(r, home, controlNS) MountRegistryShareWithOptions(r, home, controlNS, RegistryShareOptions{}) diff --git a/api/internal/handlers/clusters.go b/api/internal/handlers/clusters.go index 79052d347..686052fe6 100644 --- a/api/internal/handlers/clusters.go +++ b/api/internal/handlers/clusters.go @@ -30,9 +30,24 @@ import ( // MountClusters registers only local discovery when no remote client is supplied. func MountClusters(r chi.Router, reg *kube.Registry, k *kube.Client, ns string) { + MountClustersWithSFTP(r, reg, k, ns, SFTPClusterMount{}) +} + +// MountClustersWithSFTP is MountClusters plus the per-cluster SFTP endpoint routes (spec 040, US4). The SFTP +// routes are registered for every install with a Sessions store, also when k is nil. +func MountClustersWithSFTP(r chi.Router, reg *kube.Registry, k *kube.Client, ns string, sftp SFTPClusterMount) { h := clustersHandler{reg: reg, k: k, namespace: ns} r.Route("/clusters", func(r chi.Router) { r.Get("/", h.list) + if sftp.Sessions != nil { + mountSFTPClusterRoutes(r, sftpClusterDeps{ + sessions: sftp.Sessions, + defaultCluster: reg.DefaultID(), + localAddress: sftp.PublicAddress, + exists: clusterExists(reg.DefaultID(), k), + localFingerprint: localSFTPFingerprint(sftp.Kube, sftp.Namespace, sftp.HostKeySecret), + }) + } if k == nil { return } diff --git a/api/internal/handlers/mcp_tokens.go b/api/internal/handlers/mcp_tokens.go index f407f42b9..e16792a4d 100644 --- a/api/internal/handlers/mcp_tokens.go +++ b/api/internal/handlers/mcp_tokens.go @@ -48,9 +48,12 @@ type createMCPTokenResp struct { } // refuseTokenCaller writes 403 and reports true when the request was -// authenticated by an MCP token rather than a session. +// authenticated by an MCP token or by an SFTP session (spec 040) rather than a +// session. func refuseTokenCaller(w http.ResponseWriter, req *http.Request) bool { - if _, ok := auth.MCPTokenFromContext(req.Context()); ok { + _, isMCP := auth.MCPTokenFromContext(req.Context()) + _, isSFTP := auth.SFTPCallerFromContext(req.Context()) + if isMCP || isSFTP { httperr.WriteMessage(w, req, messages.New("server.forbidden", nil)) return true } diff --git a/api/internal/handlers/sftp.go b/api/internal/handlers/sftp.go new file mode 100644 index 000000000..9a328793a --- /dev/null +++ b/api/internal/handlers/sftp.go @@ -0,0 +1,368 @@ +package handlers + +import ( + "context" + "database/sql" + "encoding/json" + "errors" + "io" + "net/http" + "strings" + "sync/atomic" + "time" + + "github.com/go-chi/chi/v5" + + "github.com/GameplanePanel/gameplane/api/internal/auth" + "github.com/GameplanePanel/gameplane/api/internal/db" + "github.com/GameplanePanel/gameplane/api/internal/httperr" + "github.com/GameplanePanel/gameplane/api/internal/messages" + "github.com/GameplanePanel/gameplane/api/internal/scope" +) + +// SFTPEndpoint is the address a user connects to for SFTP and the server's host key fingerprint. +type SFTPEndpoint struct { + Address string `json:"address"` + Port int `json:"port"` + HostKeyFingerprint string `json:"hostKeyFingerprint"` +} + +// SFTPEndpointSource reports the SFTP endpoint of cluster. It returns false when none is configured. +type SFTPEndpointSource func(ctx context.Context, cluster string) (SFTPEndpoint, bool) + +// sftpEndpointSource holds the source the chart wiring installs. Nil means the endpoint is unknown. +var sftpEndpointSource atomic.Pointer[SFTPEndpointSource] + +// SetSFTPEndpointSource installs the endpoint source used by GET /users/me/sftp. Nil clears it. +func SetSFTPEndpointSource(fn SFTPEndpointSource) { + if fn == nil { + sftpEndpointSource.Store(nil) + return + } + sftpEndpointSource.Store(&fn) +} + +// mountSFTPRoutes registers the personal SFTP credential routes on the /users router (called from MountUsers: +// chi panics when /users is routed twice). Session-only surface: SFTP-session and MCP-token callers are refused. +func mountSFTPRoutes(r chi.Router, sessions *auth.SessionStore, store *db.Store) { + h := &sftpSelfHandler{sessions: sessions, store: store} + r.Get("/me/sftp", h.getSelf) + r.Post("/me/sftp/keys", h.addKey) + r.Delete("/me/sftp/keys/{id}", h.deleteKey) + r.Post("/me/sftp/password", h.generatePassword) + r.Delete("/me/sftp/password", h.revokePassword) + // Admin view and revoke of another user's SFTP credentials (users:manage in rbac.go). + admin := &sftpAdminHandler{sessions: sessions} + r.Get("/{id}/sftp", admin.get) + r.Delete("/{id}/sftp/keys/{keyId}", admin.deleteKey) + r.Delete("/{id}/sftp/password", admin.revokePassword) +} + +type sftpSelfHandler struct { + sessions *auth.SessionStore + store *db.Store +} + +type sftpKeyReq struct { + Name string `json:"name"` + PublicKey string `json:"publicKey"` +} + +type sftpPasswordReq struct { + Length int `json:"length"` +} + +// refuseNonSession writes 403 and reports true when the request is not a plain user session. The MCP +// token and SFTP guards already keep those callers out; this is the handler-level second check. +func refuseNonSession(w http.ResponseWriter, req *http.Request) bool { + return refuseTokenCaller(w, req) +} + +// writeSFTPErr maps the SFTP store and validation errors to their registry messages. +func writeSFTPErr(w http.ResponseWriter, req *http.Request, err error) { + switch { + case errors.Is(err, auth.ErrSFTPKeyInvalid): + httperr.WriteMessage(w, req, messages.New("server.sftp.key_invalid", nil)) + case errors.Is(err, auth.ErrSFTPKeyType): + httperr.WriteMessage(w, req, messages.New("server.sftp.key_type_unsupported", nil)) + case errors.Is(err, auth.ErrSFTPKeyWeak): + httperr.WriteMessage(w, req, messages.New("server.sftp.key_weak", nil)) + case errors.Is(err, auth.ErrSFTPKeyName): + httperr.WriteMessage(w, req, messages.New("server.sftp.key_name_invalid", nil)) + case errors.Is(err, auth.ErrSFTPKeyNameInUse): + httperr.WriteMessage(w, req, messages.New("server.sftp.key_name_in_use", nil)) + case errors.Is(err, auth.ErrSFTPKeyDuplicate): + httperr.WriteMessage(w, req, messages.New("server.sftp.key_duplicate", nil)) + case errors.Is(err, auth.ErrSFTPKeyLimit): + httperr.WriteMessage(w, req, messages.New("server.sftp.key_limit_reached", nil)) + case errors.Is(err, auth.ErrSFTPNotFound): + httperr.WriteMessage(w, req, messages.New("server.sftp.key_not_found", nil)) + case errors.Is(err, auth.ErrSFTPPasswordLen): + httperr.WriteMessage(w, req, messages.New("server.sftp.password_length_invalid", nil)) + default: + httperr.Write(w, req, err) + } +} + +// getSelf returns the caller's SFTP username, endpoint, keys and password metadata. The password itself is never +// included. +func (h *sftpSelfHandler) getSelf(w http.ResponseWriter, req *http.Request) { + if refuseNonSession(w, req) { + return + } + uid, ok := callerID(w, req) + if !ok { + return + } + ctx := req.Context() + user := auth.UserFromContext(ctx) + if user == nil { + httperr.WriteMessage(w, req, messages.New("server.common.unauthenticated", nil)) + return + } + keys, err := h.sessions.ListSFTPKeys(ctx, uid) + if err != nil { + httperr.Write(w, req, err) + return + } + if keys == nil { + keys = []auth.SFTPKey{} + } + info, found, err := h.sessions.GetSFTPPasswordInfo(ctx, uid) + if err != nil { + httperr.Write(w, req, err) + return + } + var password any + if found { + password = info + } + var endpoint any + if fn := sftpEndpointSource.Load(); fn != nil { + if ep, ok := (*fn)(ctx, scope.DefaultCluster); ok { + endpoint = ep + } + } + writeJSON(w, map[string]any{ + "username": user.Username, + "endpoint": endpoint, + "keys": keys, + "password": password, + }) +} + +// addKey stores one public key for the caller. +func (h *sftpSelfHandler) addKey(w http.ResponseWriter, req *http.Request) { + if refuseNonSession(w, req) { + return + } + uid, ok := callerID(w, req) + if !ok { + return + } + var body sftpKeyReq + if err := json.NewDecoder(req.Body).Decode(&body); err != nil { + httperr.WriteMessage(w, req, messages.New("server.common.invalid_json", nil)) + return + } + key, err := h.sessions.AddSFTPKey(req.Context(), uid, body.Name, body.PublicKey) + if err != nil { + writeSFTPErr(w, req, err) + return + } + writeJSONCreated(w, key) +} + +// deleteKey removes one of the caller's keys and revokes the sessions that used it. +func (h *sftpSelfHandler) deleteKey(w http.ResponseWriter, req *http.Request) { + if refuseNonSession(w, req) { + return + } + uid, ok := callerID(w, req) + if !ok { + return + } + keyID, ok := parseIDParam(w, req, "id") + if !ok { + return + } + if err := h.sessions.DeleteSFTPKey(req.Context(), uid, keyID); err != nil { + writeSFTPErr(w, req, err) + return + } + w.WriteHeader(http.StatusNoContent) +} + +// generatePassword replaces the caller's SFTP password and returns the clear text once. +func (h *sftpSelfHandler) generatePassword(w http.ResponseWriter, req *http.Request) { + if refuseNonSession(w, req) { + return + } + uid, ok := callerID(w, req) + if !ok { + return + } + var body sftpPasswordReq + if err := json.NewDecoder(req.Body).Decode(&body); err != nil && !errors.Is(err, io.EOF) { + httperr.WriteMessage(w, req, messages.New("server.common.invalid_json", nil)) + return + } + pw, err := h.sessions.GenerateAndStoreSFTPPassword(req.Context(), uid, body.Length) + if err != nil { + writeSFTPErr(w, req, err) + return + } + w.Header().Set("Cache-Control", "no-store") + writeJSON(w, map[string]any{"password": pw, "length": body.Length}) +} + +// revokePassword deletes the caller's SFTP password and revokes its sessions. +func (h *sftpSelfHandler) revokePassword(w http.ResponseWriter, req *http.Request) { + if refuseNonSession(w, req) { + return + } + uid, ok := callerID(w, req) + if !ok { + return + } + if err := h.sessions.DeleteSFTPPassword(req.Context(), uid); err != nil { + if errors.Is(err, auth.ErrSFTPNotFound) { + httperr.WriteMessage(w, req, messages.New("server.sftp.password_not_found", nil)) + return + } + httperr.Write(w, req, err) + return + } + w.WriteHeader(http.StatusNoContent) +} + +// sftpAdminHandler serves the admin routes on another user's SFTP credentials. Every route needs users:manage. +type sftpAdminHandler struct { + sessions *auth.SessionStore +} + +// sftpAdminKey is the admin view of one key: no public key body, and the algorithm name in place of it. +type sftpAdminKey struct { + ID int64 `json:"id"` + Name string `json:"name"` + Type string `json:"type"` + Fingerprint string `json:"fingerprint"` + CreatedAt time.Time `json:"createdAt"` + LastUsedAt *time.Time `json:"lastUsedAt"` +} + +// sftpKeyAlgorithm returns the algorithm name, the first field of a normalized " " key. +func sftpKeyAlgorithm(normalized string) string { + if fields := strings.Fields(normalized); len(fields) > 0 { + return fields[0] + } + return "" +} + +// adminUser returns the username of userID and true. For an unknown user it answers 404 user_not_found and +// reports false. +func (h *sftpAdminHandler) adminUser(w http.ResponseWriter, req *http.Request, userID int64) (string, bool) { + name, err := h.sessions.SFTPUsername(req.Context(), userID) + if errors.Is(err, sql.ErrNoRows) { + httperr.WriteMessage(w, req, messages.New("server.common.user_not_found", nil)) + return "", false + } + if err != nil { + httperr.Write(w, req, err) + return "", false + } + return name, true +} + +// get returns one user's keys and password metadata. The password hash and key bodies are never included. +func (h *sftpAdminHandler) get(w http.ResponseWriter, req *http.Request) { + if refuseNonSession(w, req) { + return + } + userID, ok := parseIDParam(w, req, "id") + if !ok { + return + } + username, ok := h.adminUser(w, req, userID) + if !ok { + return + } + ctx := req.Context() + keys, err := h.sessions.ListSFTPKeys(ctx, userID) + if err != nil { + httperr.Write(w, req, err) + return + } + out := make([]sftpAdminKey, 0, len(keys)) + for _, k := range keys { + out = append(out, sftpAdminKey{ + ID: k.ID, + Name: k.Name, + Type: sftpKeyAlgorithm(k.PublicKey), + Fingerprint: k.Fingerprint, + CreatedAt: k.CreatedAt, + LastUsedAt: k.LastUsedAt, + }) + } + info, found, err := h.sessions.GetSFTPPasswordInfo(ctx, userID) + if err != nil { + httperr.Write(w, req, err) + return + } + var password any + if found { + password = info + } + writeJSON(w, map[string]any{ + "userId": userID, + "username": username, + "keys": out, + "password": password, + }) +} + +// deleteKey removes one of the user's keys and revokes the sessions that used it. +func (h *sftpAdminHandler) deleteKey(w http.ResponseWriter, req *http.Request) { + if refuseNonSession(w, req) { + return + } + userID, ok := parseIDParam(w, req, "id") + if !ok { + return + } + keyID, ok := parseIDParam(w, req, "keyId") + if !ok { + return + } + if _, ok := h.adminUser(w, req, userID); !ok { + return + } + if err := h.sessions.DeleteSFTPKey(req.Context(), userID, keyID); err != nil { + writeSFTPErr(w, req, err) + return + } + w.WriteHeader(http.StatusNoContent) +} + +// revokePassword deletes the user's SFTP password and revokes its sessions. +func (h *sftpAdminHandler) revokePassword(w http.ResponseWriter, req *http.Request) { + if refuseNonSession(w, req) { + return + } + userID, ok := parseIDParam(w, req, "id") + if !ok { + return + } + if _, ok := h.adminUser(w, req, userID); !ok { + return + } + if err := h.sessions.DeleteSFTPPassword(req.Context(), userID); err != nil { + if errors.Is(err, auth.ErrSFTPNotFound) { + httperr.WriteMessage(w, req, messages.New("server.sftp.password_not_found", nil)) + return + } + httperr.Write(w, req, err) + return + } + w.WriteHeader(http.StatusNoContent) +} diff --git a/api/internal/handlers/sftp_admin_test.go b/api/internal/handlers/sftp_admin_test.go new file mode 100644 index 000000000..aecf7da84 --- /dev/null +++ b/api/internal/handlers/sftp_admin_test.go @@ -0,0 +1,314 @@ +package handlers + +import ( + "encoding/json" + "fmt" + "net/http" + "strings" + "testing" + "time" + + "github.com/go-chi/chi/v5" + + "github.com/GameplanePanel/gameplane/api/internal/auth" + "github.com/GameplanePanel/gameplane/api/internal/db" + "github.com/GameplanePanel/gameplane/api/internal/scope" +) + +// sftpAdminMissingUser is an id no test user is ever given (sftpSeq stays far below it). +const sftpAdminMissingUser int64 = 987654321 + +type sftpAdminKeyView struct { + ID int64 `json:"id"` + Name string `json:"name"` + Type string `json:"type"` + Fingerprint string `json:"fingerprint"` + CreatedAt time.Time `json:"createdAt"` + LastUsedAt *time.Time `json:"lastUsedAt"` +} + +type sftpAdminPasswordView struct { + Length int `json:"length"` + CreatedAt time.Time `json:"createdAt"` + LastUsedAt *time.Time `json:"lastUsedAt"` +} + +type sftpAdminView struct { + UserID int64 `json:"userId"` + Username string `json:"username"` + Keys []sftpAdminKeyView `json:"keys"` + Password *sftpAdminPasswordView `json:"password"` +} + +// sftpAdminRouter mounts the SFTP routes for a caller who holds users:manage. sftpCaller marks the +// caller as an SFTP session, which every admin route must refuse. +func sftpAdminRouter(sessions *auth.SessionStore, store *db.Store, sftpCaller bool) http.Handler { + r := chi.NewRouter() + r.Use(func(next http.Handler) http.Handler { + return http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) { + ctx := auth.WithUser(req.Context(), &auth.User{ID: 1, Username: "admin", Role: "admin"}) + if sftpCaller { + ctx = auth.WithSFTPCaller(ctx, auth.SFTPCaller{Cluster: scope.DefaultCluster, SessionID: 9}) + } + next.ServeHTTP(w, req.WithContext(ctx)) + }) + }) + mountSFTPRoutes(r, sessions, store) + return r +} + +// sftpAdminSession inserts a live SFTP session for uid under credential. +func sftpAdminSession(t *testing.T, env sftpLoginEnv, uid int64, credential string) { + t.Helper() + digest := fmt.Sprintf("admin-digest-%d", sftpSeq.Add(1)) + if _, err := env.sessions.InsertSFTPSession(t.Context(), uid, scope.DefaultCluster, credential, digest, 0, time.Now().Add(time.Hour)); err != nil { + t.Fatalf("insert session %s: %v", credential, err) + } +} + +// sftpAdminLive counts uid's unrevoked sessions under credential. +func sftpAdminLive(t *testing.T, env sftpLoginEnv, uid int64, credential string) int { + t.Helper() + var n int + if err := env.store.DB.QueryRowContext(t.Context(), + `SELECT COUNT(*) FROM sftp_sessions WHERE user_id = ? AND credential = ? AND revoked_at IS NULL`, + uid, credential).Scan(&n); err != nil { + t.Fatalf("count sessions: %v", err) + } + return n +} + +func TestSFTPAdmin_GetListsKeysAndPasswordWithoutSecrets(t *testing.T) { + env := newSFTPLoginEnv(t) + name, uid := env.seedUser(t, "x") + h := sftpAdminRouter(env.sessions, env.store, false) + + // A user with nothing registered has empty lists and no password. + rr := sftpSelfDo(t, h, http.MethodGet, fmt.Sprintf("/%d/sftp", uid), "") + if rr.Code != http.StatusOK { + t.Fatalf("empty GET: status %d body %s", rr.Code, rr.Body.String()) + } + var empty sftpAdminView + if err := json.Unmarshal(rr.Body.Bytes(), &empty); err != nil { + t.Fatalf("decode empty: %v", err) + } + if empty.Keys == nil || len(empty.Keys) != 0 || empty.Password != nil { + t.Fatalf("empty view = %+v, want no keys and no password", empty) + } + + key, err := env.sessions.AddSFTPKey(t.Context(), uid, "laptop", sftpTestEd25519Line(t)) + if err != nil { + t.Fatalf("add key: %v", err) + } + pw, err := env.sessions.GenerateAndStoreSFTPPassword(t.Context(), uid, 24) + if err != nil { + t.Fatalf("password: %v", err) + } + + rr = sftpSelfDo(t, h, http.MethodGet, fmt.Sprintf("/%d/sftp", uid), "") + if rr.Code != http.StatusOK { + t.Fatalf("GET: status %d body %s", rr.Code, rr.Body.String()) + } + body := rr.Body.String() + for _, secret := range []string{pw, "publicKey", "hash", "argon2"} { + if strings.Contains(body, secret) { + t.Errorf("admin view leaks %q: %s", secret, body) + } + } + var view sftpAdminView + if err := json.Unmarshal(rr.Body.Bytes(), &view); err != nil { + t.Fatalf("decode: %v", err) + } + if view.UserID != uid || view.Username != name { + t.Errorf("identity = %d/%q, want %d/%q", view.UserID, view.Username, uid, name) + } + if len(view.Keys) != 1 { + t.Fatalf("keys = %+v, want one", view.Keys) + } + k := view.Keys[0] + if k.ID != key.ID || k.Name != "laptop" || k.Type != "ssh-ed25519" || k.Fingerprint != key.Fingerprint || k.CreatedAt.IsZero() { + t.Errorf("key view = %+v, want id %d, name laptop, type ssh-ed25519, fingerprint %s", k, key.ID, key.Fingerprint) + } + if view.Password == nil || view.Password.Length != 24 || view.Password.CreatedAt.IsZero() || view.Password.LastUsedAt != nil { + t.Errorf("password view = %+v, want length 24, created, never used", view.Password) + } +} + +func TestSFTPAdmin_UnknownUserIsNotFound(t *testing.T) { + env := newSFTPLoginEnv(t) + h := sftpAdminRouter(env.sessions, env.store, false) + base := fmt.Sprintf("/%d", sftpAdminMissingUser) + for _, rt := range []struct{ method, path string }{ + {http.MethodGet, base + "/sftp"}, + {http.MethodDelete, base + "/sftp/keys/5"}, + {http.MethodDelete, base + "/sftp/password"}, + } { + rr := sftpSelfDo(t, h, rt.method, rt.path, "") + if rr.Code != http.StatusNotFound || sftpProblemID(t, rr) != "server.common.user_not_found" { + t.Errorf("%s %s: status %d body %s, want 404 user_not_found", rt.method, rt.path, rr.Code, rr.Body.String()) + } + } +} + +func TestSFTPAdmin_KeyAndPasswordLookupsAreScopedToTheUser(t *testing.T) { + env := newSFTPLoginEnv(t) + _, aliceID := env.seedUser(t, "x") + _, bobID := env.seedUser(t, "x") + h := sftpAdminRouter(env.sessions, env.store, false) + + bobKey, err := env.sessions.AddSFTPKey(t.Context(), bobID, "bob-laptop", sftpTestEd25519Line(t)) + if err != nil { + t.Fatalf("add bob key: %v", err) + } + + // Alice cannot delete Bob's key through her own id, and gets the same answer as for an unknown key. + rr := sftpSelfDo(t, h, http.MethodDelete, fmt.Sprintf("/%d/sftp/keys/%d", aliceID, bobKey.ID), "") + if rr.Code != http.StatusNotFound || sftpProblemID(t, rr) != "server.sftp.key_not_found" { + t.Fatalf("cross-user key delete: status %d body %s", rr.Code, rr.Body.String()) + } + rr = sftpSelfDo(t, h, http.MethodDelete, fmt.Sprintf("/%d/sftp/keys/%d", aliceID, 424242), "") + if rr.Code != http.StatusNotFound || sftpProblemID(t, rr) != "server.sftp.key_not_found" { + t.Fatalf("unknown key delete: status %d body %s", rr.Code, rr.Body.String()) + } + keys, err := env.sessions.ListSFTPKeys(t.Context(), bobID) + if err != nil || len(keys) != 1 { + t.Fatalf("bob keys after refused delete = %d (err %v), want 1", len(keys), err) + } + + // Alice has no password to revoke. + rr = sftpSelfDo(t, h, http.MethodDelete, fmt.Sprintf("/%d/sftp/password", aliceID), "") + if rr.Code != http.StatusNotFound || sftpProblemID(t, rr) != "server.sftp.password_not_found" { + t.Fatalf("missing password revoke: status %d body %s", rr.Code, rr.Body.String()) + } +} + +func TestSFTPAdmin_RevokeKeyRevokesItsSessionsOnly(t *testing.T) { + env := newSFTPLoginEnv(t) + _, uid := env.seedUser(t, "x") + h := sftpAdminRouter(env.sessions, env.store, false) + + key, err := env.sessions.AddSFTPKey(t.Context(), uid, "laptop", sftpTestEd25519Line(t)) + if err != nil { + t.Fatalf("add key: %v", err) + } + if _, err := env.sessions.GenerateAndStoreSFTPPassword(t.Context(), uid, 24); err != nil { + t.Fatalf("password: %v", err) + } + keyCred := fmt.Sprintf("key:%d", key.ID) + sftpAdminSession(t, env, uid, keyCred) + sftpAdminSession(t, env, uid, "password") + + rr := sftpSelfDo(t, h, http.MethodDelete, fmt.Sprintf("/%d/sftp/keys/%d", uid, key.ID), "") + if rr.Code != http.StatusNoContent { + t.Fatalf("admin key delete: status %d body %s", rr.Code, rr.Body.String()) + } + if n := sftpAdminLive(t, env, uid, keyCred); n != 0 { + t.Errorf("%d live key sessions after revoke, want 0", n) + } + if n := sftpAdminLive(t, env, uid, "password"); n != 1 { + t.Errorf("%d live password sessions after key revoke, want 1", n) + } + keys, err := env.sessions.ListSFTPKeys(t.Context(), uid) + if err != nil || len(keys) != 0 { + t.Errorf("keys after revoke = %d (err %v), want 0", len(keys), err) + } +} + +func TestSFTPAdmin_RevokePasswordRevokesItsSessionsOnly(t *testing.T) { + env := newSFTPLoginEnv(t) + _, uid := env.seedUser(t, "x") + h := sftpAdminRouter(env.sessions, env.store, false) + + key, err := env.sessions.AddSFTPKey(t.Context(), uid, "laptop", sftpTestEd25519Line(t)) + if err != nil { + t.Fatalf("add key: %v", err) + } + if _, err := env.sessions.GenerateAndStoreSFTPPassword(t.Context(), uid, 24); err != nil { + t.Fatalf("password: %v", err) + } + keyCred := fmt.Sprintf("key:%d", key.ID) + sftpAdminSession(t, env, uid, "password") + sftpAdminSession(t, env, uid, keyCred) + + rr := sftpSelfDo(t, h, http.MethodDelete, fmt.Sprintf("/%d/sftp/password", uid), "") + if rr.Code != http.StatusNoContent { + t.Fatalf("admin password revoke: status %d body %s", rr.Code, rr.Body.String()) + } + if n := sftpAdminLive(t, env, uid, "password"); n != 0 { + t.Errorf("%d live password sessions after revoke, want 0", n) + } + if n := sftpAdminLive(t, env, uid, keyCred); n != 1 { + t.Errorf("%d live key sessions after password revoke, want 1", n) + } + + // The admin view now shows no password, and a second revoke is a 404. + rr = sftpSelfDo(t, h, http.MethodGet, fmt.Sprintf("/%d/sftp", uid), "") + var view sftpAdminView + if err := json.Unmarshal(rr.Body.Bytes(), &view); err != nil || rr.Code != http.StatusOK || view.Password != nil { + t.Errorf("GET after revoke: status %d password %+v (err %v)", rr.Code, view.Password, err) + } + rr = sftpSelfDo(t, h, http.MethodDelete, fmt.Sprintf("/%d/sftp/password", uid), "") + if rr.Code != http.StatusNotFound || sftpProblemID(t, rr) != "server.sftp.password_not_found" { + t.Errorf("second revoke: status %d body %s", rr.Code, rr.Body.String()) + } +} + +func TestSFTPAdmin_SFTPSessionCallerRefused(t *testing.T) { + env := newSFTPLoginEnv(t) + _, uid := env.seedUser(t, "x") + key, err := env.sessions.AddSFTPKey(t.Context(), uid, "laptop", sftpTestEd25519Line(t)) + if err != nil { + t.Fatalf("add key: %v", err) + } + if _, err := env.sessions.GenerateAndStoreSFTPPassword(t.Context(), uid, 24); err != nil { + t.Fatalf("password: %v", err) + } + h := sftpAdminRouter(env.sessions, env.store, true) + for _, rt := range []struct{ method, path string }{ + {http.MethodGet, fmt.Sprintf("/%d/sftp", uid)}, + {http.MethodDelete, fmt.Sprintf("/%d/sftp/keys/%d", uid, key.ID)}, + {http.MethodDelete, fmt.Sprintf("/%d/sftp/password", uid)}, + } { + if rr := sftpSelfDo(t, h, rt.method, rt.path, ""); rr.Code != http.StatusForbidden { + t.Errorf("%s %s as sftp caller: status %d body %s, want 403", rt.method, rt.path, rr.Code, rr.Body.String()) + } + } + // Nothing was revoked by the refused calls. + keys, err := env.sessions.ListSFTPKeys(t.Context(), uid) + if err != nil || len(keys) != 1 { + t.Errorf("keys after refused calls = %d (err %v), want 1", len(keys), err) + } +} + +func TestSFTPAdmin_StoreFailuresAreServerErrors(t *testing.T) { + deadStore := newTestStore(t) + sessions := auth.NewSessionStore(deadStore) + if err := deadStore.Close(); err != nil { + t.Fatalf("close store: %v", err) + } + h := sftpAdminRouter(sessions, deadStore, false) + for _, rt := range []struct{ method, path string }{ + {http.MethodGet, "/3/sftp"}, + {http.MethodDelete, "/3/sftp/keys/5"}, + {http.MethodDelete, "/3/sftp/password"}, + } { + if rr := sftpSelfDo(t, h, rt.method, rt.path, ""); rr.Code < http.StatusInternalServerError { + t.Errorf("%s %s on a dead store: status %d, want 5xx", rt.method, rt.path, rr.Code) + } + } +} + +func TestSFTPAdmin_KeyAlgorithm(t *testing.T) { + cases := []struct{ in, want string }{ + {"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5", "ssh-ed25519"}, + {"ecdsa-sha2-nistp256 AAAAE2VjZHNh", "ecdsa-sha2-nistp256"}, + {"", ""}, + {" ", ""}, + {" rsa-sha2-512 AAAAB3NzaC1yc2E ", "rsa-sha2-512"}, + } + for _, c := range cases { + if got := sftpKeyAlgorithm(c.in); got != c.want { + t.Errorf("sftpKeyAlgorithm(%q) = %q, want %q", c.in, got, c.want) + } + } +} diff --git a/api/internal/handlers/sftp_cluster.go b/api/internal/handlers/sftp_cluster.go new file mode 100644 index 000000000..111ca2edc --- /dev/null +++ b/api/internal/handlers/sftp_cluster.go @@ -0,0 +1,370 @@ +package handlers + +import ( + "context" + "crypto" + "encoding/json" + "errors" + "fmt" + "log/slog" + "net" + "net/http" + "regexp" + "strconv" + "strings" + + "github.com/go-chi/chi/v5" + "golang.org/x/crypto/ssh" + apierrors "k8s.io/apimachinery/pkg/api/errors" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + + "github.com/GameplanePanel/gameplane/api/internal/auth" + "github.com/GameplanePanel/gameplane/api/internal/httperr" + "github.com/GameplanePanel/gameplane/api/internal/kube" + "github.com/GameplanePanel/gameplane/api/internal/messages" +) + +// SFTPClusterMount wires the per-cluster SFTP endpoint routes (spec 040, US4). A nil Sessions skips them. +type SFTPClusterMount struct { + Sessions *auth.SessionStore + // Kube reads the host key Secret and checks that a cluster registration exists. It may be nil. + Kube *kube.Client + // PublicAddress is sftp.publicAddress from the chart: the panel's own endpoint address (host or host:port). + PublicAddress string + // HostKeySecret names the Secret (key host_key) in Namespace that holds the panel's SFTP host key. + HostKeySecret string + // Namespace is the release namespace: the host key Secret is rendered there, and the API's Role grants + // get on it there (charts/gameplane/templates/api.yaml). + Namespace string + // Enabled reports whether the panel's own SFTP endpoint is deployed (sftp.enabled). + Enabled bool + // Port is the SFTP port the endpoint listens on (sftp.port). PublicAddress may carry its own port instead. + Port int +} + +// sftpClusterDeps is what the SFTP cluster routes need. Functions keep the handlers testable without a cluster. +type sftpClusterDeps struct { + sessions *auth.SessionStore + defaultCluster string + localAddress string + // exists reports whether cluster is a known cluster (the panel's own or a registered remote). + exists func(ctx context.Context, cluster string) (bool, error) + // localFingerprint returns the panel's SFTP host key fingerprint, or "" when no key is stored yet. + localFingerprint func(ctx context.Context) (string, error) +} + +// sftpHostKeyDataKey is the Secret key the chart writes the SFTP host key under. +const sftpHostKeyDataKey = "host_key" + +var sftpFingerprintPattern = regexp.MustCompile(`^SHA256:[A-Za-z0-9+/]{43}$`) + +// sftpHostKeyFingerprint returns the OpenSSH SHA256 fingerprint of the public half of a PEM private host key. +func sftpHostKeyFingerprint(pemData []byte) (string, error) { + raw, err := ssh.ParseRawPrivateKey(pemData) + if err != nil { + return "", fmt.Errorf("parse sftp host key: %w", err) + } + signer, ok := raw.(crypto.Signer) + if !ok { + return "", errors.New("sftp host key has no public half") + } + pub, err := ssh.NewPublicKey(signer.Public()) + if err != nil { + return "", fmt.Errorf("sftp host key public half: %w", err) + } + return ssh.FingerprintSHA256(pub), nil +} + +// localSFTPFingerprint reads the panel's host key Secret and fingerprints it. A missing Secret, a Secret the +// API may not read (a Forbidden answer means the release Role is missing its resourceNames rule) or an +// unreadable key is logged and reported as "" so the cluster view still loads. +func localSFTPFingerprint(k *kube.Client, ns, secretName string) func(ctx context.Context) (string, error) { + return func(ctx context.Context) (string, error) { + if k == nil { + return "", nil + } + secret, err := k.Secrets(ns).Get(ctx, secretName, metav1.GetOptions{}) + if apierrors.IsNotFound(err) { + return "", nil + } + if apierrors.IsForbidden(err) { + slog.Warn("sftp: no read access to host key secret, fingerprint not shown", "secret", secretName, "namespace", ns, "err", err) + return "", nil + } + if err != nil { + return "", fmt.Errorf("read sftp host key secret: %w", err) + } + data := secret.Data[sftpHostKeyDataKey] + if len(data) == 0 { + return "", nil + } + fp, err := sftpHostKeyFingerprint(data) + if err != nil { + slog.Warn("sftp: host key secret unreadable, fingerprint not shown", "secret", secretName, "err", err) + return "", nil + } + return fp, nil + } +} + +// clusterExists reports whether name is the panel's own cluster or a Cluster registration. +func clusterExists(defaultID string, k *kube.Client) func(ctx context.Context, name string) (bool, error) { + return func(ctx context.Context, name string) (bool, error) { + if name == defaultID { + return true, nil + } + if k == nil { + return false, nil + } + _, err := k.Clusters().Get(ctx, name, metav1.GetOptions{}) + if apierrors.IsNotFound(err) { + return false, nil + } + if err != nil { + return false, fmt.Errorf("get cluster %s: %w", name, err) + } + return true, nil + } +} + +// validSFTPAddress accepts host, host:port, [v6]:port. The address is shown to users, so it carries no path, +// userinfo or scheme. +func validSFTPAddress(addr string) bool { + if addr == "" || len(addr) > 255 || strings.ContainsAny(addr, " \t/\\@?#") { + return false + } + host, port, err := net.SplitHostPort(addr) + if err != nil { + // A bracketed IPv6 literal without a port; any other colon means a bare IPv6 address, which needs brackets. + if strings.HasPrefix(addr, "[") && strings.HasSuffix(addr, "]") { + return net.ParseIP(addr[1:len(addr)-1]) != nil + } + if strings.Contains(addr, ":") { + return false + } + host, port = addr, "" + } + if host == "" { + return false + } + if port != "" { + n, convErr := strconv.Atoi(port) + if convErr != nil || n < 1 || n > 65535 { + return false + } + } + return true +} + +// splitSFTPAddress splits a validated host, host:port or [v6]:port address. Without a port, defaultPort applies. +func splitSFTPAddress(addr string, defaultPort int) (string, int) { + if host, port, err := net.SplitHostPort(addr); err == nil { + if n, convErr := strconv.Atoi(port); convErr == nil { + return host, n + } + } + return strings.TrimSuffix(strings.TrimPrefix(addr, "["), "]"), defaultPort +} + +// LocalSFTPEndpointSource is the endpoint source for GET /users/me/sftp (spec 040). It reports the panel's own +// cluster only while the SFTP endpoint is deployed and its public address is configured; otherwise it reports +// no endpoint, which the personal page shows as null. +func LocalSFTPEndpointSource(m SFTPClusterMount, defaultCluster string) SFTPEndpointSource { + fingerprint := localSFTPFingerprint(m.Kube, m.Namespace, m.HostKeySecret) + return func(ctx context.Context, cluster string) (SFTPEndpoint, bool) { + if !m.Enabled || cluster != defaultCluster || m.PublicAddress == "" { + return SFTPEndpoint{}, false + } + if !validSFTPAddress(m.PublicAddress) { + slog.Warn("sftp: publicAddress is not host or host:port, endpoint not shown", "address", m.PublicAddress) + return SFTPEndpoint{}, false + } + host, port := splitSFTPAddress(m.PublicAddress, m.Port) + fp, err := fingerprint(ctx) + if err != nil { + slog.Warn("sftp: host key fingerprint unavailable, endpoint shown without it", "err", err) + fp = "" + } + return SFTPEndpoint{Address: host, Port: port, HostKeyFingerprint: fp}, true + } +} + +// sftpClusterView is the drawer payload: the endpoint and the active service tokens of one cluster. +type sftpClusterView struct { + Cluster string `json:"cluster"` + Local bool `json:"local"` + Address *string `json:"address"` + HostKeyFingerprint *string `json:"hostKeyFingerprint"` + Tokens []auth.SFTPServiceToken `json:"tokens"` +} + +// sftpTokenCreated is a new service token. Token is the only time the secret is returned. +type sftpTokenCreated struct { + auth.SFTPServiceToken + Token string `json:"token"` +} + +type sftpEndpointReq struct { + Address string `json:"address"` + HostKeyFingerprint string `json:"hostKeyFingerprint"` +} + +type sftpClusterHandler struct { + d sftpClusterDeps +} + +// mountSFTPClusterRoutes registers the SFTP routes under /clusters (called from MountClustersWithSFTP, +// because chi panics when /clusters is routed twice). Every route needs cluster:manage (rbac.go). +func mountSFTPClusterRoutes(r chi.Router, d sftpClusterDeps) { + h := &sftpClusterHandler{d: d} + r.Get("/{name}/sftp", h.get) + r.Put("/{name}/sftp", h.putEndpoint) + r.Post("/{name}/sftp-token", h.createToken) + r.Delete("/{name}/sftp-token/{id}", h.revokeToken) +} + +// cluster refuses token callers, checks the caller and the cluster name, and writes the error itself. +func (h *sftpClusterHandler) cluster(w http.ResponseWriter, req *http.Request) (string, bool) { + if refuseTokenCaller(w, req) { + return "", false + } + if _, ok := callerID(w, req); !ok { + return "", false + } + name := chi.URLParam(req, "name") + known, err := h.d.exists(req.Context(), name) + if err != nil { + httperr.Write(w, req, err) + return "", false + } + if !known { + httperr.WriteMessage(w, req, messages.New(httperr.IDNotFound, nil)) + return "", false + } + return name, true +} + +// endpoint returns the address and fingerprint of cluster: chart values and the host key Secret for the +// panel's own cluster, the stored registration for a remote one. +func (h *sftpClusterHandler) endpoint(ctx context.Context, cluster string) (string, string, error) { + if cluster == h.d.defaultCluster { + fp, err := h.d.localFingerprint(ctx) + if err != nil { + return "", "", err + } + return h.d.localAddress, fp, nil + } + ep, found, err := h.d.sessions.GetSFTPClusterEndpoint(ctx, cluster) + if err != nil || !found { + return "", "", err + } + return ep.Address, ep.HostKeyFingerprint, nil +} + +// get returns the endpoint and the active service tokens of a cluster. Secrets never appear. +func (h *sftpClusterHandler) get(w http.ResponseWriter, req *http.Request) { + name, ok := h.cluster(w, req) + if !ok { + return + } + ctx := req.Context() + address, fp, err := h.endpoint(ctx, name) + if err != nil { + httperr.Write(w, req, err) + return + } + tokens, err := h.d.sessions.ListSFTPServiceTokens(ctx, name) + if err != nil { + httperr.Write(w, req, err) + return + } + view := sftpClusterView{Cluster: name, Local: name == h.d.defaultCluster, Tokens: []auth.SFTPServiceToken{}} + if address != "" { + view.Address = &address + } + if fp != "" { + view.HostKeyFingerprint = &fp + } + for _, t := range tokens { + if t.RevokedAt == nil { + view.Tokens = append(view.Tokens, t) + } + } + writeJSON(w, view) +} + +// putEndpoint stores the address and host key fingerprint of a remote cluster's SFTP endpoint. +func (h *sftpClusterHandler) putEndpoint(w http.ResponseWriter, req *http.Request) { + name, ok := h.cluster(w, req) + if !ok { + return + } + if name == h.d.defaultCluster { + httperr.WriteMessage(w, req, messages.New("server.sftp.endpoint_local", nil)) + return + } + var body sftpEndpointReq + if err := json.NewDecoder(req.Body).Decode(&body); err != nil { + httperr.WriteMessage(w, req, messages.New("server.common.invalid_json", nil)) + return + } + address := strings.TrimSpace(body.Address) + if !validSFTPAddress(address) { + httperr.WriteMessage(w, req, messages.New("server.sftp.endpoint_invalid", nil)) + return + } + fp := strings.TrimSpace(body.HostKeyFingerprint) + if !sftpFingerprintPattern.MatchString(fp) { + httperr.WriteMessage(w, req, messages.New("server.sftp.fingerprint_invalid", nil)) + return + } + ep, err := h.d.sessions.SetSFTPClusterEndpoint(req.Context(), auth.SFTPClusterEndpoint{ + Cluster: name, Address: address, HostKeyFingerprint: fp, + }) + if err != nil { + httperr.Write(w, req, err) + return + } + writeJSON(w, ep) +} + +// createToken mints a service token for a cluster. The token is returned once. Two active tokens per cluster +// at most, so rotation is create, roll the endpoint, then revoke the old one. +func (h *sftpClusterHandler) createToken(w http.ResponseWriter, req *http.Request) { + name, ok := h.cluster(w, req) + if !ok { + return + } + tok, raw, err := h.d.sessions.CreateSFTPServiceToken(req.Context(), name) + if errors.Is(err, auth.ErrSFTPServiceTokenLimit) { + httperr.WriteMessage(w, req, messages.New("server.sftp.token_limit_reached", nil)) + return + } + if err != nil { + httperr.Write(w, req, err) + return + } + writeJSONCreated(w, sftpTokenCreated{SFTPServiceToken: tok, Token: raw}) +} + +// revokeToken revokes one active service token of a cluster. Tokens of other clusters are not found. +func (h *sftpClusterHandler) revokeToken(w http.ResponseWriter, req *http.Request) { + name, ok := h.cluster(w, req) + if !ok { + return + } + id, ok := parseIDParam(w, req, "id") + if !ok { + return + } + err := h.d.sessions.RevokeSFTPServiceToken(req.Context(), name, id) + if errors.Is(err, auth.ErrSFTPNotFound) { + httperr.WriteMessage(w, req, messages.New("server.sftp.token_not_found", nil)) + return + } + if err != nil { + httperr.Write(w, req, err) + return + } + w.WriteHeader(http.StatusNoContent) +} diff --git a/api/internal/handlers/sftp_cluster_envtest_test.go b/api/internal/handlers/sftp_cluster_envtest_test.go new file mode 100644 index 000000000..0b69caa15 --- /dev/null +++ b/api/internal/handlers/sftp_cluster_envtest_test.go @@ -0,0 +1,155 @@ +//go:build envtest + +package handlers + +import ( + "crypto/ed25519" + "crypto/rand" + "crypto/x509" + "encoding/pem" + "net/http" + "net/http/httptest" + "strings" + "testing" + + "github.com/go-chi/chi/v5" + "golang.org/x/crypto/ssh" + corev1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + + "github.com/GameplanePanel/gameplane/api/internal/auth" + "github.com/GameplanePanel/gameplane/api/internal/kube" + "github.com/GameplanePanel/gameplane/api/internal/scope" +) + +// sftpClusterEnvtestRouter mounts the cluster routes on the envtest apiserver: Cluster registrations and the +// host key Secret live there, the store is a fresh SQLite database. +func sftpClusterEnvtestRouter(t *testing.T, hostKeySecret string) (http.Handler, *auth.SessionStore) { + t.Helper() + sessions := auth.NewSessionStore(newTestStore(t)) + reg := kube.NewRegistry(scope.DefaultCluster) + reg.Set(scope.DefaultCluster, kubeC) + r := chi.NewRouter() + MountClustersWithSFTP(r, reg, kubeC, scope.DefaultNamespace, SFTPClusterMount{ + Sessions: sessions, + Kube: kubeC, + PublicAddress: "files.example.com:2222", + HostKeySecret: hostKeySecret, + Namespace: scope.DefaultNamespace, + }) + return r, sessions +} + +// sftpClusterEnvtestHostKey stores a fresh ed25519 host key in a Secret and returns the fingerprint it must show. +func sftpClusterEnvtestHostKey(t *testing.T, name string) string { + t.Helper() + _, priv, err := ed25519.GenerateKey(rand.Reader) + if err != nil { + t.Fatal(err) + } + der, err := x509.MarshalPKCS8PrivateKey(priv) + if err != nil { + t.Fatal(err) + } + pemData := pem.EncodeToMemory(&pem.Block{Type: "PRIVATE KEY", Bytes: der}) + pub, err := ssh.NewPublicKey(priv.Public()) + if err != nil { + t.Fatal(err) + } + if _, err := kubeC.Secrets(scope.DefaultNamespace).Create(t.Context(), &corev1.Secret{ + ObjectMeta: metav1.ObjectMeta{Name: name, Namespace: scope.DefaultNamespace}, + Data: map[string][]byte{sftpHostKeyDataKey: pemData}, + }, metav1.CreateOptions{}); err != nil { + t.Fatalf("create host key secret: %v", err) + } + t.Cleanup(func() { + _ = kubeC.Secrets(scope.DefaultNamespace).Delete(t.Context(), name, metav1.DeleteOptions{}) + }) + return ssh.FingerprintSHA256(pub) +} + +// sftpClusterEnvtestRegister creates a Cluster registration and removes it when the test ends. +func sftpClusterEnvtestRegister(t *testing.T, prefix string) string { + t.Helper() + name := uniqueResourceName(prefix) + if _, err := kubeC.Clusters().Create(t.Context(), newCluster(name, map[string]any{"kubeconfigSecret": map[string]any{"name": name + "-kubeconfig"}}, nil), metav1.CreateOptions{}); err != nil { + t.Fatalf("register cluster %s: %v", name, err) + } + t.Cleanup(func() { + _ = kubeC.Clusters().Delete(t.Context(), name, metav1.DeleteOptions{}) + }) + return name +} + +func sftpClusterEnvtestDo(t *testing.T, h http.Handler, method, path, body string, sftpCaller bool) *httptest.ResponseRecorder { + t.Helper() + req := httptest.NewRequestWithContext(t.Context(), method, path, strings.NewReader(body)) + req.Header.Set("Content-Type", "application/json") + req.Header.Set("Accept", "application/problem+json") + ctx := auth.WithUser(req.Context(), &auth.User{ID: 1, Username: "admin", Role: "admin"}) + if sftpCaller { + ctx = auth.WithSFTPCaller(ctx, auth.SFTPCaller{Cluster: scope.DefaultCluster, SessionID: 9}) + } + rr := httptest.NewRecorder() + h.ServeHTTP(rr, req.WithContext(ctx)) + return rr +} + +// The panel's own endpoint reads its fingerprint from the host key Secret on the apiserver. +func TestSFTPClusterEnvtest_LocalFingerprintFromSecret(t *testing.T) { + secret := uniqueResourceName("sftp-host-key") + want := sftpClusterEnvtestHostKey(t, secret) + h, _ := sftpClusterEnvtestRouter(t, secret) + + view := sftpClusterTestDecode[sftpClusterView](t, sftpClusterEnvtestDo(t, h, http.MethodGet, "/clusters/"+scope.DefaultCluster+"/sftp", "", false)) + if !view.Local || view.Address == nil || *view.Address != "files.example.com:2222" { + t.Fatalf("local view: %+v", view) + } + if view.HostKeyFingerprint == nil || *view.HostKeyFingerprint != want { + t.Fatalf("fingerprint = %v, want %q", view.HostKeyFingerprint, want) + } +} + +// A remote cluster's endpoint and tokens are its own: the token of one cluster is never listed for another, +// and an SFTP session token cannot reach these routes. +func TestSFTPClusterEnvtest_RemoteTokensStayPerCluster(t *testing.T) { + h, _ := sftpClusterEnvtestRouter(t, uniqueResourceName("sftp-host-key")) + remoteA := sftpClusterEnvtestRegister(t, "sftp-remote-a") + remoteB := sftpClusterEnvtestRegister(t, "sftp-remote-b") + + rr := sftpClusterEnvtestDo(t, h, http.MethodPost, "/clusters/"+remoteA+"/sftp-token", "", false) + if rr.Code != http.StatusCreated { + t.Fatalf("create token on %s: status %d body %s", remoteA, rr.Code, rr.Body.String()) + } + created := sftpClusterTestDecode[struct { + ID int64 `json:"id"` + }](t, rr) + + fp := "SHA256:" + strings.Repeat("C", 43) + rr = sftpClusterEnvtestDo(t, h, http.MethodPut, "/clusters/"+remoteA+"/sftp", + `{"address":"sftp.`+remoteA+`.example.com:2222","hostKeyFingerprint":"`+fp+`"}`, false) + if rr.Code != http.StatusOK { + t.Fatalf("put endpoint: status %d body %s", rr.Code, rr.Body.String()) + } + + viewA := sftpClusterTestDecode[sftpClusterView](t, sftpClusterEnvtestDo(t, h, http.MethodGet, "/clusters/"+remoteA+"/sftp", "", false)) + if viewA.Address == nil || viewA.HostKeyFingerprint == nil || *viewA.HostKeyFingerprint != fp || len(viewA.Tokens) != 1 { + t.Fatalf("%s view: %+v", remoteA, viewA) + } + viewB := sftpClusterTestDecode[sftpClusterView](t, sftpClusterEnvtestDo(t, h, http.MethodGet, "/clusters/"+remoteB+"/sftp", "", false)) + if viewB.Address != nil || len(viewB.Tokens) != 0 { + t.Fatalf("%s must not see %s's endpoint or tokens: %+v", remoteB, remoteA, viewB) + } + + // Revoking the token through the other cluster finds nothing. + rr = sftpClusterEnvtestDo(t, h, http.MethodDelete, "/clusters/"+remoteB+"/sftp-token/"+idPath(created.ID), "", false) + if rr.Code != http.StatusNotFound { + t.Fatalf("cross-cluster revoke: status %d body %s", rr.Code, rr.Body.String()) + } + + // An SFTP session token is refused on every cluster route. + rr = sftpClusterEnvtestDo(t, h, http.MethodGet, "/clusters/"+remoteA+"/sftp", "", true) + if rr.Code != http.StatusForbidden { + t.Fatalf("sftp session on cluster route: status %d body %s", rr.Code, rr.Body.String()) + } +} diff --git a/api/internal/handlers/sftp_cluster_test.go b/api/internal/handlers/sftp_cluster_test.go new file mode 100644 index 000000000..243f43228 --- /dev/null +++ b/api/internal/handlers/sftp_cluster_test.go @@ -0,0 +1,335 @@ +package handlers + +import ( + "context" + "crypto/ed25519" + "crypto/rand" + "crypto/x509" + "encoding/json" + "encoding/pem" + "net/http" + "net/http/httptest" + "strconv" + "strings" + "testing" + + "github.com/go-chi/chi/v5" + "golang.org/x/crypto/ssh" + + "github.com/GameplanePanel/gameplane/api/internal/auth" + "github.com/GameplanePanel/gameplane/api/internal/httperr" + "github.com/GameplanePanel/gameplane/api/internal/scope" +) + +var sftpClusterTestFP = "SHA256:" + strings.Repeat("A", 43) + +// sftpClusterTestEnv mounts the SFTP cluster routes with a store, two registered remote clusters +// ("remote-a", "remote-b") and the panel's own cluster. +type sftpClusterTestEnv struct { + sessions *auth.SessionStore + h http.Handler + known map[string]bool +} + +func newSFTPClusterTestEnv(t *testing.T, localAddress string) sftpClusterTestEnv { + t.Helper() + store := newTestStore(t) + env := sftpClusterTestEnv{ + sessions: auth.NewSessionStore(store), + known: map[string]bool{"remote-a": true, "remote-b": true}, + } + known := env.known + deps := sftpClusterDeps{ + sessions: env.sessions, + defaultCluster: scope.DefaultCluster, + localAddress: localAddress, + exists: func(_ context.Context, name string) (bool, error) { + return name == scope.DefaultCluster || known[name], nil + }, + localFingerprint: func(context.Context) (string, error) { return sftpClusterTestFP, nil }, + } + r := chi.NewRouter() + r.Use(func(next http.Handler) http.Handler { + return http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) { + next.ServeHTTP(w, req.WithContext(auth.WithUser(req.Context(), &auth.User{ID: 1, Username: "admin", Role: "admin"}))) + }) + }) + r.Route("/clusters", func(r chi.Router) { mountSFTPClusterRoutes(r, deps) }) + env.h = r + return env +} + +// do sends one request. sftpCaller marks it as made by an SFTP session token, which must be refused. +func (env sftpClusterTestEnv) do(t *testing.T, method, path, body string, sftpCaller bool) *httptest.ResponseRecorder { + t.Helper() + req := httptest.NewRequestWithContext(t.Context(), method, path, strings.NewReader(body)) + req.Header.Set("Content-Type", "application/json") + req.Header.Set("Accept", "application/problem+json") + if sftpCaller { + req = req.WithContext(auth.WithSFTPCaller(req.Context(), auth.SFTPCaller{Cluster: scope.DefaultCluster, SessionID: 9})) + } + rr := httptest.NewRecorder() + env.h.ServeHTTP(rr, req) + return rr +} + +func sftpClusterTestDecode[T any](t *testing.T, rr *httptest.ResponseRecorder) T { + t.Helper() + var v T + if err := json.Unmarshal(rr.Body.Bytes(), &v); err != nil { + t.Fatalf("decode %q: %v", rr.Body.String(), err) + } + return v +} + +func TestSFTPClusterUnit_CreateListRevoke(t *testing.T) { + env := newSFTPClusterTestEnv(t, "") + + rr := env.do(t, http.MethodPost, "/clusters/remote-a/sftp-token", "", false) + if rr.Code != http.StatusCreated { + t.Fatalf("create: status %d body %s", rr.Code, rr.Body.String()) + } + created := sftpClusterTestDecode[struct { + ID int64 `json:"id"` + Cluster string `json:"cluster"` + Token string `json:"token"` + }](t, rr) + if !strings.HasPrefix(created.Token, auth.SFTPServicePrefix) || created.Cluster != "remote-a" || created.ID == 0 { + t.Fatalf("created token: %+v", created) + } + + // The list shows the token's metadata and never its secret. + rr = env.do(t, http.MethodGet, "/clusters/remote-a/sftp", "", false) + if rr.Code != http.StatusOK { + t.Fatalf("get: status %d body %s", rr.Code, rr.Body.String()) + } + if strings.Contains(rr.Body.String(), created.Token) { + t.Fatal("the drawer payload must not carry the token secret") + } + view := sftpClusterTestDecode[sftpClusterView](t, rr) + if view.Local || len(view.Tokens) != 1 || view.Tokens[0].ID != created.ID || view.Address != nil { + t.Fatalf("remote view: %+v", view) + } + + rr = env.do(t, http.MethodDelete, "/clusters/remote-a/sftp-token/"+idPath(created.ID), "", false) + if rr.Code != http.StatusNoContent { + t.Fatalf("revoke: status %d body %s", rr.Code, rr.Body.String()) + } + view = sftpClusterTestDecode[sftpClusterView](t, env.do(t, http.MethodGet, "/clusters/remote-a/sftp", "", false)) + if len(view.Tokens) != 0 { + t.Fatalf("revoked token still listed: %+v", view.Tokens) + } + + rr = env.do(t, http.MethodDelete, "/clusters/remote-a/sftp-token/"+idPath(created.ID), "", false) + if rr.Code != http.StatusNotFound || sftpProblemID(t, rr) != "server.sftp.token_not_found" { + t.Fatalf("second revoke: status %d body %s", rr.Code, rr.Body.String()) + } +} + +// idPath renders a token id for a path. +func idPath(id int64) string { + return strconv.FormatInt(id, 10) +} + +func TestSFTPClusterUnit_TokenLimit(t *testing.T) { + env := newSFTPClusterTestEnv(t, "") + for i := range 2 { + if rr := env.do(t, http.MethodPost, "/clusters/remote-a/sftp-token", "", false); rr.Code != http.StatusCreated { + t.Fatalf("token %d: status %d body %s", i, rr.Code, rr.Body.String()) + } + } + rr := env.do(t, http.MethodPost, "/clusters/remote-a/sftp-token", "", false) + if rr.Code != http.StatusConflict || sftpProblemID(t, rr) != "server.sftp.token_limit_reached" { + t.Fatalf("third token: status %d body %s", rr.Code, rr.Body.String()) + } + // The limit is per cluster: remote-b still has room. + if rr := env.do(t, http.MethodPost, "/clusters/remote-b/sftp-token", "", false); rr.Code != http.StatusCreated { + t.Fatalf("other cluster: status %d body %s", rr.Code, rr.Body.String()) + } +} + +func TestSFTPClusterUnit_UnknownCluster(t *testing.T) { + env := newSFTPClusterTestEnv(t, "") + cases := []struct{ method, path, body string }{ + {http.MethodGet, "/clusters/nope/sftp", ""}, + {http.MethodPut, "/clusters/nope/sftp", `{"address":"a.example.com:2222","hostKeyFingerprint":"` + sftpClusterTestFP + `"}`}, + {http.MethodPost, "/clusters/nope/sftp-token", ""}, + {http.MethodDelete, "/clusters/nope/sftp-token/1", ""}, + } + for _, tc := range cases { + rr := env.do(t, tc.method, tc.path, tc.body, false) + if rr.Code != http.StatusNotFound || sftpProblemID(t, rr) != httperr.IDNotFound { + t.Fatalf("%s %s: status %d body %s", tc.method, tc.path, rr.Code, rr.Body.String()) + } + } +} + +func TestSFTPClusterUnit_RevokeIsScopedToCluster(t *testing.T) { + env := newSFTPClusterTestEnv(t, "") + created := sftpClusterTestDecode[struct { + ID int64 `json:"id"` + }](t, env.do(t, http.MethodPost, "/clusters/remote-a/sftp-token", "", false)) + + // A token of remote-a is not found through remote-b, and stays active on remote-a. + rr := env.do(t, http.MethodDelete, "/clusters/remote-b/sftp-token/"+idPath(created.ID), "", false) + if rr.Code != http.StatusNotFound || sftpProblemID(t, rr) != "server.sftp.token_not_found" { + t.Fatalf("cross-cluster revoke: status %d body %s", rr.Code, rr.Body.String()) + } + view := sftpClusterTestDecode[sftpClusterView](t, env.do(t, http.MethodGet, "/clusters/remote-a/sftp", "", false)) + if len(view.Tokens) != 1 { + t.Fatalf("token should survive a cross-cluster revoke: %+v", view.Tokens) + } +} + +func TestSFTPClusterUnit_PutEndpointAndGet(t *testing.T) { + env := newSFTPClusterTestEnv(t, "files.example.com:2222") + fp := sftpClusterTestFP + body := `{"address":" sftp.remote-a.example.com:2222 ","hostKeyFingerprint":"` + fp + `"}` + rr := env.do(t, http.MethodPut, "/clusters/remote-a/sftp", body, false) + if rr.Code != http.StatusOK { + t.Fatalf("put: status %d body %s", rr.Code, rr.Body.String()) + } + ep := sftpClusterTestDecode[auth.SFTPClusterEndpoint](t, rr) + if ep.Address != "sftp.remote-a.example.com:2222" || ep.HostKeyFingerprint != fp { + t.Fatalf("stored endpoint: %+v", ep) + } + + view := sftpClusterTestDecode[sftpClusterView](t, env.do(t, http.MethodGet, "/clusters/remote-a/sftp", "", false)) + if view.Address == nil || *view.Address != "sftp.remote-a.example.com:2222" || + view.HostKeyFingerprint == nil || *view.HostKeyFingerprint != fp { + t.Fatalf("remote view: %+v", view) + } + + // The panel's own cluster reports the chart address and the host key fingerprint, and is marked local. + local := sftpClusterTestDecode[sftpClusterView](t, env.do(t, http.MethodGet, "/clusters/"+scope.DefaultCluster+"/sftp", "", false)) + if !local.Local || local.Address == nil || *local.Address != "files.example.com:2222" || + local.HostKeyFingerprint == nil || *local.HostKeyFingerprint != sftpClusterTestFP { + t.Fatalf("local view: %+v", local) + } +} + +func TestSFTPClusterUnit_LocalWithoutAddressOrKey(t *testing.T) { + env := newSFTPClusterTestEnv(t, "") + local := sftpClusterTestDecode[sftpClusterView](t, env.do(t, http.MethodGet, "/clusters/"+scope.DefaultCluster+"/sftp", "", false)) + if local.Address != nil { + t.Fatalf("unset publicAddress must read as null: %+v", local) + } + if local.Tokens == nil { + t.Fatal("tokens must be an empty list, not null") + } +} + +func TestSFTPClusterUnit_PutEndpointValidation(t *testing.T) { + env := newSFTPClusterTestEnv(t, "") + fp := sftpClusterTestFP + cases := []struct { + name, body, want string + }{ + {"empty address", `{"address":"","hostKeyFingerprint":"` + fp + `"}`, "server.sftp.endpoint_invalid"}, + {"path in address", `{"address":"http://files.example.com:2222","hostKeyFingerprint":"` + fp + `"}`, "server.sftp.endpoint_invalid"}, + {"port out of range", `{"address":"files.example.com:99999","hostKeyFingerprint":"` + fp + `"}`, "server.sftp.endpoint_invalid"}, + {"no host", `{"address":":2222","hostKeyFingerprint":"` + fp + `"}`, "server.sftp.endpoint_invalid"}, + {"md5 fingerprint", `{"address":"files.example.com:2222","hostKeyFingerprint":"MD5:aa:bb"}`, "server.sftp.fingerprint_invalid"}, + {"short fingerprint", `{"address":"files.example.com:2222","hostKeyFingerprint":"SHA256:abc"}`, "server.sftp.fingerprint_invalid"}, + {"invalid json", `{not json`, "server.common.invalid_json"}, + } + for _, tc := range cases { + rr := env.do(t, http.MethodPut, "/clusters/remote-a/sftp", tc.body, false) + if rr.Code != http.StatusBadRequest || sftpProblemID(t, rr) != tc.want { + t.Fatalf("%s: status %d body %s", tc.name, rr.Code, rr.Body.String()) + } + } + + // The panel's own endpoint is set in chart values, never through this route. + rr := env.do(t, http.MethodPut, "/clusters/"+scope.DefaultCluster+"/sftp", `{"address":"files.example.com:2222","hostKeyFingerprint":"`+fp+`"}`, false) + if rr.Code != http.StatusBadRequest || sftpProblemID(t, rr) != "server.sftp.endpoint_local" { + t.Fatalf("local put: status %d body %s", rr.Code, rr.Body.String()) + } +} + +func TestSFTPClusterUnit_SFTPSessionAndMissingCallerRefused(t *testing.T) { + env := newSFTPClusterTestEnv(t, "") + paths := []struct{ method, path, body string }{ + {http.MethodGet, "/clusters/remote-a/sftp", ""}, + {http.MethodPut, "/clusters/remote-a/sftp", `{"address":"a.example.com:2222","hostKeyFingerprint":"` + sftpClusterTestFP + `"}`}, + {http.MethodPost, "/clusters/remote-a/sftp-token", ""}, + {http.MethodDelete, "/clusters/remote-a/sftp-token/1", ""}, + } + for _, p := range paths { + rr := env.do(t, p.method, p.path, p.body, true) + if rr.Code != http.StatusForbidden || sftpProblemID(t, rr) != "server.forbidden" { + t.Fatalf("%s %s from an SFTP session: status %d body %s", p.method, p.path, rr.Code, rr.Body.String()) + } + } + + // Without a user in the context the route answers as unauthenticated. + bare := chi.NewRouter() + bare.Route("/clusters", func(r chi.Router) { + mountSFTPClusterRoutes(r, sftpClusterDeps{sessions: env.sessions, defaultCluster: scope.DefaultCluster, + exists: func(context.Context, string) (bool, error) { return true, nil }}) + }) + req := httptest.NewRequestWithContext(t.Context(), http.MethodGet, "/clusters/remote-a/sftp", nil) + req.Header.Set("Accept", "application/problem+json") + rr := httptest.NewRecorder() + bare.ServeHTTP(rr, req) + if rr.Code != http.StatusUnauthorized || sftpProblemID(t, rr) != "server.common.unauthenticated" { + t.Fatalf("no caller: status %d body %s", rr.Code, rr.Body.String()) + } +} + +func TestSFTPClusterUnit_ValidSFTPAddress(t *testing.T) { + ok := []string{"files.example.com", "files.example.com:2222", "203.0.113.7:30222", "[2001:db8::1]:2222", "[2001:db8::1]"} + bad := []string{"", " ", "a b", "http://x", "x/y", "user@x", "x?y", ":2222", "x:0", "x:65536", "x:port", "2001:db8::1", "[::1]:x"} + for _, a := range ok { + if !validSFTPAddress(a) { + t.Errorf("address %q should be valid", a) + } + } + for _, a := range bad { + if validSFTPAddress(a) { + t.Errorf("address %q should be invalid", a) + } + } + if validSFTPAddress(strings.Repeat("a", 256)) { + t.Error("an address over 255 characters should be invalid") + } +} + +func TestSFTPClusterUnit_HostKeyFingerprint(t *testing.T) { + _, priv, err := ed25519.GenerateKey(rand.Reader) + if err != nil { + t.Fatalf("generate key: %v", err) + } + der, err := x509.MarshalPKCS8PrivateKey(priv) + if err != nil { + t.Fatalf("marshal key: %v", err) + } + pemData := pem.EncodeToMemory(&pem.Block{Type: "PRIVATE KEY", Bytes: der}) + pub, err := ssh.NewPublicKey(priv.Public()) + if err != nil { + t.Fatalf("public key: %v", err) + } + want := ssh.FingerprintSHA256(pub) + + got, err := sftpHostKeyFingerprint(pemData) + if err != nil || got != want { + t.Fatalf("fingerprint = %q, %v; want %q", got, err, want) + } + if !sftpFingerprintPattern.MatchString(got) { + t.Fatalf("fingerprint %q does not match the accepted format", got) + } + if _, err := sftpHostKeyFingerprint([]byte("not a key")); err == nil { + t.Fatal("garbage host key must fail") + } + + // A missing Secret or a missing cluster client reads as no fingerprint, not an error. + if fp, err := localSFTPFingerprint(nil, "ns", "gameplane-sftp-host-key")(t.Context()); err != nil || fp != "" { + t.Fatalf("nil client: %q, %v", fp, err) + } + if known, err := clusterExists("default", nil)(t.Context(), "remote-a"); err != nil || known { + t.Fatalf("nil client, remote cluster: %v, %v", known, err) + } + if known, err := clusterExists("default", nil)(t.Context(), "default"); err != nil || !known { + t.Fatalf("local cluster: %v, %v", known, err) + } +} diff --git a/api/internal/handlers/sftp_end_test.go b/api/internal/handlers/sftp_end_test.go new file mode 100644 index 000000000..fb68e0f15 --- /dev/null +++ b/api/internal/handlers/sftp_end_test.go @@ -0,0 +1,134 @@ +package handlers + +import ( + "database/sql" + "encoding/json" + "net/http" + "net/http/httptest" + "strings" + "testing" + + "github.com/GameplanePanel/gameplane/api/internal/auth" + "github.com/GameplanePanel/gameplane/api/internal/scope" +) + +// sftpEndRevokedAt returns the revoked_at column of the session behind raw. +func sftpEndRevokedAt(t *testing.T, env sftpLoginEnv, raw string) sql.NullString { + t.Helper() + var v sql.NullString + if err := env.store.DB.QueryRowContext(t.Context(), + `SELECT revoked_at FROM sftp_sessions WHERE digest = ?`, auth.SFTPTokenDigest(raw)).Scan(&v); err != nil { + t.Fatalf("read session: %v", err) + } + return v +} + +func sftpEndBody(t *testing.T, tokens []string) string { + t.Helper() + raw, err := json.Marshal(map[string]any{"sessionTokens": tokens}) + if err != nil { + t.Fatalf("marshal: %v", err) + } + return string(raw) +} + +func TestSFTPEndUnit_RevokesOwnClusterAndIgnoresForeign(t *testing.T) { + env := newSFTPLoginEnv(t) + _, uid := env.seedUser(t, "x") + own, _, err := env.sessions.IssueSFTPSession(t.Context(), uid, scope.DefaultCluster, "password", 0) + if err != nil { + t.Fatalf("issue own: %v", err) + } + foreign, _, err := env.sessions.IssueSFTPSession(t.Context(), uid, "other-cluster", "password", 0) + if err != nil { + t.Fatalf("issue foreign: %v", err) + } + h := sftpLoginRouter(env) + body := sftpEndBody(t, []string{own, foreign, "plain-token", auth.SFTPSessionTokenPrefix + "unknown", own}) + rr := sftpUnitRawPost(t, env, h, "/sftp/v1/sessions/end", body) + if rr.Code != http.StatusNoContent { + t.Fatalf("status %d body %s", rr.Code, rr.Body.String()) + } + if !sftpEndRevokedAt(t, env, own).Valid { + t.Fatal("own-cluster session was not revoked") + } + if sftpEndRevokedAt(t, env, foreign).Valid { + t.Fatal("foreign-cluster session must stay live") + } +} + +func TestSFTPEndUnit_EmptyListIsNoContent(t *testing.T) { + env := newSFTPLoginEnv(t) + rr := sftpUnitRawPost(t, env, sftpLoginRouter(env), "/sftp/v1/sessions/end", `{"sessionTokens":[]}`) + if rr.Code != http.StatusNoContent { + t.Fatalf("status %d body %s", rr.Code, rr.Body.String()) + } +} + +func TestSFTPEndUnit_InvalidJSON(t *testing.T) { + env := newSFTPLoginEnv(t) + rr := sftpUnitRawPost(t, env, sftpLoginRouter(env), "/sftp/v1/sessions/end", "{not json") + if rr.Code != http.StatusBadRequest || sftpProblemID(t, rr) != "server.common.invalid_json" { + t.Fatalf("status %d body %s", rr.Code, rr.Body.String()) + } +} + +func TestSFTPEndUnit_RejectsMissingOrBadServiceToken(t *testing.T) { + env := newSFTPLoginEnv(t) + h := sftpLoginRouter(env) + req := httptest.NewRequestWithContext(t.Context(), http.MethodPost, "/sftp/v1/sessions/end", strings.NewReader(`{"sessionTokens":[]}`)) + req.Header.Set("Accept", "application/problem+json") + rr := httptest.NewRecorder() + h.ServeHTTP(rr, req) + if rr.Code != http.StatusUnauthorized { + t.Fatalf("no token: status %d body %s", rr.Code, rr.Body.String()) + } + + // Called without the service-auth middleware there is no caller in the context. + lh := &sftpLoginHandler{sessions: env.sessions, store: env.store, files: env.files, aud: env.aud} + req = httptest.NewRequestWithContext(t.Context(), http.MethodPost, "/x", strings.NewReader("{}")) + req.Header.Set("Accept", "application/problem+json") + rr = httptest.NewRecorder() + lh.end(rr, req) + if rr.Code != http.StatusUnauthorized || sftpProblemID(t, rr) != "server.common.unauthenticated" { + t.Fatalf("no caller: status %d body %s", rr.Code, rr.Body.String()) + } +} + +func TestSFTPEndUnit_OversizeList(t *testing.T) { + env := newSFTPLoginEnv(t) + tokens := make([]string, sftpCheckMaxTokens+1) + for i := range tokens { + tokens[i] = auth.SFTPSessionTokenPrefix + "x" + } + rr := sftpUnitRawPost(t, env, sftpLoginRouter(env), "/sftp/v1/sessions/end", sftpEndBody(t, tokens)) + if rr.Code != http.StatusBadRequest || sftpProblemID(t, rr) != "server.bad_request" { + t.Fatalf("status %d body %s", rr.Code, rr.Body.String()) + } +} + +func TestSFTPEndUnit_StoreFailure(t *testing.T) { + env := newSFTPLoginEnv(t) + deadStore := newTestStore(t) + deadSessions := auth.NewSessionStore(deadStore) + if err := deadStore.Close(); err != nil { + t.Fatalf("close store: %v", err) + } + h := &sftpLoginHandler{sessions: deadSessions, store: deadStore, files: env.files, aud: env.aud} + req := httptest.NewRequestWithContext(auth.WithSFTPCaller(t.Context(), auth.SFTPCaller{Cluster: scope.DefaultCluster}), + http.MethodPost, "/sftp/v1/sessions/end", strings.NewReader(sftpEndBody(t, []string{auth.SFTPSessionTokenPrefix + "abc"}))) + req.Header.Set("Accept", "application/problem+json") + rr := httptest.NewRecorder() + h.end(rr, req) + if rr.Code != http.StatusServiceUnavailable { + t.Fatalf("status %d body %s", rr.Code, rr.Body.String()) + } +} + +func TestSFTPEndUnit_StoreRejectsOversizeDirectly(t *testing.T) { + env := newSFTPLoginEnv(t) + digests := make([]string, auth.SFTPMaxEndDigests+1) + if err := env.sessions.EndSFTPSessions(t.Context(), scope.DefaultCluster, digests); err == nil { + t.Fatal("expected an error for an oversize digest list") + } +} diff --git a/api/internal/handlers/sftp_envtest_test.go b/api/internal/handlers/sftp_envtest_test.go new file mode 100644 index 000000000..78d93709c --- /dev/null +++ b/api/internal/handlers/sftp_envtest_test.go @@ -0,0 +1,443 @@ +//go:build envtest + +package handlers + +import ( + "context" + "encoding/json" + "fmt" + "io" + "net/http" + "net/http/httptest" + "strings" + "testing" + "time" + + "github.com/go-chi/chi/v5" + + "github.com/GameplanePanel/gameplane/api/internal/auth" + "github.com/GameplanePanel/gameplane/api/internal/db" + "github.com/GameplanePanel/gameplane/api/internal/kube" + "github.com/GameplanePanel/gameplane/api/internal/rbac" + "github.com/GameplanePanel/gameplane/api/internal/scope" +) + +// sftpEnvtestServer serves the user routes (MountUsers, with the self-service and admin SFTP routes) behind the +// real rbac middleware. Every request is made as a user holding perms on the default cluster. +func sftpEnvtestServer(t *testing.T, store *db.Store, sessions *auth.SessionStore, perms ...string) *httptest.Server { + t.Helper() + set := map[string]struct{}{} + for _, p := range perms { + set[p] = struct{}{} + } + caller := &auth.User{ID: 1, Username: "admin", Role: "admin", Perms: map[string]map[string]map[string]struct{}{ + scope.DefaultCluster: {"*": set}, + }} + r := chi.NewRouter() + r.Use(func(next http.Handler) http.Handler { + return http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) { + next.ServeHTTP(w, req.WithContext(auth.WithUser(req.Context(), caller))) + }) + }) + r.Use(rbac.Middleware(nil)) + MountUsers(r, store, sessions, kube.NewRegistry(scope.DefaultCluster)) + srv := httptest.NewServer(r) + t.Cleanup(srv.Close) + return srv +} + +// sftpEnvtestCall sends one request to srv and returns the status code and body. +func sftpEnvtestCall(t *testing.T, srv *httptest.Server, method, path string) (int, string) { + t.Helper() + req, err := http.NewRequestWithContext(t.Context(), method, srv.URL+path, nil) + if err != nil { + t.Fatalf("new request: %v", err) + } + resp, err := http.DefaultClient.Do(req) + if err != nil { + t.Fatalf("%s %s: %v", method, path, err) + } + defer resp.Body.Close() + b, err := io.ReadAll(resp.Body) + if err != nil { + t.Fatalf("read body: %v", err) + } + return resp.StatusCode, string(b) +} + +// sftpEnvtestUser inserts a user with a unique name and returns its id. +func sftpEnvtestUser(t *testing.T, store *db.Store) int64 { + t.Helper() + name := fmt.Sprintf("sftpenv%d", sftpSeq.Add(1)) + if _, err := store.DB.ExecContext(t.Context(), + `INSERT INTO users(username, display_name, email, role, pw_hash) VALUES (?, ?, ?, ?, ?)`, + name, name, name+"@example.com", "viewer", "x"); err != nil { + t.Fatalf("insert user: %v", err) + } + var id int64 + if err := store.DB.QueryRowContext(t.Context(), `SELECT id FROM users WHERE username = ?`, name).Scan(&id); err != nil { + t.Fatalf("user id: %v", err) + } + return id +} + +// sftpEnvtestLive counts uid's unrevoked sessions under credential. +func sftpEnvtestLive(t *testing.T, store *db.Store, uid int64, credential string) int { + t.Helper() + var n int + if err := store.DB.QueryRowContext(t.Context(), + `SELECT COUNT(*) FROM sftp_sessions WHERE user_id = ? AND credential = ? AND revoked_at IS NULL`, + uid, credential).Scan(&n); err != nil { + t.Fatalf("count sessions: %v", err) + } + return n +} + +func TestSFTPEnvtest_AdminListAndRevokeEndLiveSessions(t *testing.T) { + store := newTestStore(t) + sessions := auth.NewSessionStore(store) + srv := sftpEnvtestServer(t, store, sessions, "users:read", "users:manage") + uid := sftpEnvtestUser(t, store) + + key, err := sessions.AddSFTPKey(t.Context(), uid, "laptop", sftpTestEd25519Line(t)) + if err != nil { + t.Fatalf("add key: %v", err) + } + if _, err := sessions.GenerateAndStoreSFTPPassword(t.Context(), uid, 28); err != nil { + t.Fatalf("password: %v", err) + } + keyCred := fmt.Sprintf("key:%d", key.ID) + for _, cred := range []string{keyCred, "password"} { + digest := fmt.Sprintf("envtest-digest-%d", sftpSeq.Add(1)) + if _, err := sessions.InsertSFTPSession(t.Context(), uid, scope.DefaultCluster, cred, digest, 0, time.Now().Add(time.Hour)); err != nil { + t.Fatalf("insert session %s: %v", cred, err) + } + } + + // The admin view lists the key and the password, never the hash. + code, body := sftpEnvtestCall(t, srv, http.MethodGet, fmt.Sprintf("/users/%d/sftp", uid)) + if code != http.StatusOK { + t.Fatalf("admin GET: status %d body %s", code, body) + } + if strings.Contains(body, "hash") || strings.Contains(body, "publicKey") { + t.Errorf("admin view leaks secret material: %s", body) + } + var view sftpAdminView + if err := json.Unmarshal([]byte(body), &view); err != nil { + t.Fatalf("decode: %v", err) + } + if len(view.Keys) != 1 || view.Keys[0].Fingerprint != key.Fingerprint || view.Password == nil || view.Password.Length != 28 { + t.Fatalf("admin view = %+v", view) + } + + // Revoking the key ends only the key's sessions. + if code, body := sftpEnvtestCall(t, srv, http.MethodDelete, fmt.Sprintf("/users/%d/sftp/keys/%d", uid, key.ID)); code != http.StatusNoContent { + t.Fatalf("admin key revoke: status %d body %s", code, body) + } + if n := sftpEnvtestLive(t, store, uid, keyCred); n != 0 { + t.Errorf("%d live key sessions after admin revoke, want 0", n) + } + if n := sftpEnvtestLive(t, store, uid, "password"); n != 1 { + t.Errorf("%d live password sessions after key revoke, want 1", n) + } + + // Revoking the password ends its sessions and the next admin view has no password. + if code, body := sftpEnvtestCall(t, srv, http.MethodDelete, fmt.Sprintf("/users/%d/sftp/password", uid)); code != http.StatusNoContent { + t.Fatalf("admin password revoke: status %d body %s", code, body) + } + if n := sftpEnvtestLive(t, store, uid, "password"); n != 0 { + t.Errorf("%d live password sessions after admin revoke, want 0", n) + } + code, body = sftpEnvtestCall(t, srv, http.MethodGet, fmt.Sprintf("/users/%d/sftp", uid)) + if code != http.StatusOK || !strings.Contains(body, `"password":null`) { + t.Errorf("admin GET after revokes: status %d body %s", code, body) + } +} + +func TestSFTPEnvtest_AdminRoutesNeedUsersManage(t *testing.T) { + store := newTestStore(t) + sessions := auth.NewSessionStore(store) + uid := sftpEnvtestUser(t, store) + key, err := sessions.AddSFTPKey(t.Context(), uid, "laptop", sftpTestEd25519Line(t)) + if err != nil { + t.Fatalf("add key: %v", err) + } + + reader := sftpEnvtestServer(t, store, sessions, "users:read") + if code, _ := sftpEnvtestCall(t, reader, http.MethodGet, fmt.Sprintf("/users/%d/sftp", uid)); code != http.StatusForbidden { + t.Errorf("users:read GET admin view: status %d, want 403", code) + } + if code, _ := sftpEnvtestCall(t, reader, http.MethodDelete, fmt.Sprintf("/users/%d/sftp/keys/%d", uid, key.ID)); code != http.StatusForbidden { + t.Errorf("users:read revokes a key: status %d, want 403", code) + } + keys, err := sessions.ListSFTPKeys(t.Context(), uid) + if err != nil || len(keys) != 1 { + t.Fatalf("key removed by a refused request: %d keys (err %v)", len(keys), err) + } + + manager := sftpEnvtestServer(t, store, sessions, "users:read", "users:manage") + if code, _ := sftpEnvtestCall(t, manager, http.MethodGet, fmt.Sprintf("/users/%d/sftp", uid)); code != http.StatusOK { + t.Errorf("users:manage GET admin view: status %d, want 200", code) + } + if code, _ := sftpEnvtestCall(t, manager, http.MethodDelete, fmt.Sprintf("/users/%d/sftp/keys/%d", uid, key.ID)); code != http.StatusNoContent { + t.Errorf("users:manage revokes a key: status %d, want 204", code) + } +} + +func TestSFTPEnvtest_AdminUnknownUserAndKey(t *testing.T) { + store := newTestStore(t) + sessions := auth.NewSessionStore(store) + srv := sftpEnvtestServer(t, store, sessions, "users:read", "users:manage") + uid := sftpEnvtestUser(t, store) + + if code, _ := sftpEnvtestCall(t, srv, http.MethodGet, fmt.Sprintf("/users/%d/sftp", sftpAdminMissingUser)); code != http.StatusNotFound { + t.Errorf("unknown user GET: status %d, want 404", code) + } + if code, _ := sftpEnvtestCall(t, srv, http.MethodDelete, fmt.Sprintf("/users/%d/sftp/password", uid)); code != http.StatusNotFound { + t.Errorf("password revoke without a password: status %d, want 404", code) + } + if code, _ := sftpEnvtestCall(t, srv, http.MethodDelete, fmt.Sprintf("/users/%d/sftp/keys/99", uid)); code != http.StatusNotFound { + t.Errorf("unknown key revoke: status %d, want 404", code) + } +} + +// sftpEnvtestSelfServer serves the caller's own SFTP routes (/users/me/sftp*) as user uid. ctxFn, when set, +// marks every request as an MCP-token or SFTP-session caller before the routes run. +func sftpEnvtestSelfServer(t *testing.T, store *db.Store, sessions *auth.SessionStore, uid int64, ctxFn func(context.Context) context.Context) *httptest.Server { + t.Helper() + caller := &auth.User{ID: uid, Username: "self", Role: "viewer", Perms: map[string]map[string]map[string]struct{}{}} + r := chi.NewRouter() + r.Use(func(next http.Handler) http.Handler { + return http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) { + ctx := auth.WithUser(req.Context(), caller) + if ctxFn != nil { + ctx = ctxFn(ctx) + } + next.ServeHTTP(w, req.WithContext(ctx)) + }) + }) + r.Use(rbac.Middleware(nil)) + MountUsers(r, store, sessions, kube.NewRegistry(scope.DefaultCluster)) + srv := httptest.NewServer(r) + t.Cleanup(srv.Close) + return srv +} + +// sftpEnvtestSend sends one request with a JSON body (or none when body is "") and returns the status and body. +func sftpEnvtestSend(t *testing.T, srv *httptest.Server, method, path, body string) (int, string) { + t.Helper() + req, err := http.NewRequestWithContext(t.Context(), method, srv.URL+path, strings.NewReader(body)) + if err != nil { + t.Fatalf("new request: %v", err) + } + req.Header.Set("Content-Type", "application/json") + resp, err := http.DefaultClient.Do(req) + if err != nil { + t.Fatalf("%s %s: %v", method, path, err) + } + defer resp.Body.Close() + b, err := io.ReadAll(resp.Body) + if err != nil { + t.Fatalf("read body: %v", err) + } + return resp.StatusCode, string(b) +} + +// sftpEnvtestEpoch returns users.session_epoch for uid. +func sftpEnvtestEpoch(t *testing.T, store *db.Store, uid int64) int64 { + t.Helper() + var ep int64 + if err := store.DB.QueryRowContext(t.Context(), `SELECT session_epoch FROM users WHERE id = ?`, uid).Scan(&ep); err != nil { + t.Fatalf("session epoch: %v", err) + } + return ep +} + +func TestSFTPEnvtest_UserAddsAndRemovesOwnKeys(t *testing.T) { + store := newTestStore(t) + sessions := auth.NewSessionStore(store) + uid := sftpEnvtestUser(t, store) + srv := sftpEnvtestSelfServer(t, store, sessions, uid, nil) + + body, err := json.Marshal(map[string]string{"name": "laptop", "publicKey": sftpTestEd25519Line(t)}) + if err != nil { + t.Fatalf("marshal: %v", err) + } + code, resp := sftpEnvtestSend(t, srv, http.MethodPost, "/users/me/sftp/keys", string(body)) + if code != http.StatusCreated { + t.Fatalf("add key: status %d body %s", code, resp) + } + var key auth.SFTPKey + if err := json.Unmarshal([]byte(resp), &key); err != nil || key.ID == 0 || key.Fingerprint == "" { + t.Fatalf("added key = %+v, %v", key, err) + } + keys, err := sessions.ListSFTPKeys(t.Context(), uid) + if err != nil || len(keys) != 1 { + t.Fatalf("keys after add = %d, %v; want 1", len(keys), err) + } + + if code, body := sftpEnvtestSend(t, srv, http.MethodDelete, fmt.Sprintf("/users/me/sftp/keys/%d", key.ID), ""); code != http.StatusNoContent { + t.Fatalf("remove key: status %d body %s", code, body) + } + keys, err = sessions.ListSFTPKeys(t.Context(), uid) + if err != nil || len(keys) != 0 { + t.Fatalf("keys after remove = %d, %v; want 0", len(keys), err) + } +} + +func TestSFTPEnvtest_DuplicateKeyAcrossUsersRefused(t *testing.T) { + store := newTestStore(t) + sessions := auth.NewSessionStore(store) + first := sftpEnvtestUser(t, store) + second := sftpEnvtestUser(t, store) + firstName, err := sessions.SFTPUsername(t.Context(), first) + if err != nil { + t.Fatalf("username: %v", err) + } + line := sftpTestEd25519Line(t) + body, err := json.Marshal(map[string]string{"name": "shared", "publicKey": line}) + if err != nil { + t.Fatalf("marshal: %v", err) + } + + if code, resp := sftpEnvtestSend(t, sftpEnvtestSelfServer(t, store, sessions, first, nil), http.MethodPost, "/users/me/sftp/keys", string(body)); code != http.StatusCreated { + t.Fatalf("first user add: status %d body %s", code, resp) + } + code, resp := sftpEnvtestSend(t, sftpEnvtestSelfServer(t, store, sessions, second, nil), http.MethodPost, "/users/me/sftp/keys", string(body)) + if code != http.StatusConflict { + t.Fatalf("second user add of the same key: status %d body %s, want 409", code, resp) + } + if strings.Contains(resp, firstName) { + t.Errorf("duplicate refusal names the other user: %s", resp) + } + if keys, err := sessions.ListSFTPKeys(t.Context(), second); err != nil || len(keys) != 0 { + t.Errorf("second user keys = %d, %v; want none", len(keys), err) + } +} + +func TestSFTPEnvtest_PasswordShownOnceAndRegenerateInvalidatesOld(t *testing.T) { + store := newTestStore(t) + sessions := auth.NewSessionStore(store) + uid := sftpEnvtestUser(t, store) + srv := sftpEnvtestSelfServer(t, store, sessions, uid, nil) + username, err := sessions.SFTPUsername(t.Context(), uid) + if err != nil { + t.Fatalf("username: %v", err) + } + + code, resp := sftpEnvtestSend(t, srv, http.MethodPost, "/users/me/sftp/password", `{"length":28}`) + if code != http.StatusOK { + t.Fatalf("generate: status %d body %s", code, resp) + } + var first struct { + Password string `json:"password"` + Length int `json:"length"` + } + if err := json.Unmarshal([]byte(resp), &first); err != nil || first.Password == "" || first.Length != 28 { + t.Fatalf("generate response = %+v, %v", first, err) + } + + // The clear text is returned once: the profile read carries the password's metadata, never the secret. + code, profile := sftpEnvtestCall(t, srv, http.MethodGet, "/users/me/sftp") + if code != http.StatusOK || strings.Contains(profile, first.Password) { + t.Fatalf("profile read after generate: status %d, leaks password: %v", code, strings.Contains(profile, first.Password)) + } + if !strings.Contains(profile, `"length":28`) { + t.Errorf("profile read lacks password metadata: %s", profile) + } + if _, _, ok, err := sessions.VerifySFTPPassword(t.Context(), username, first.Password); err != nil || !ok { + t.Fatalf("first password does not verify: ok=%v err=%v", ok, err) + } + + // Regenerating replaces the password: the old one stops verifying and the new one does. + code, resp = sftpEnvtestSend(t, srv, http.MethodPost, "/users/me/sftp/password", `{"length":24}`) + if code != http.StatusOK { + t.Fatalf("regenerate: status %d body %s", code, resp) + } + var second struct { + Password string `json:"password"` + } + if err := json.Unmarshal([]byte(resp), &second); err != nil || second.Password == "" || second.Password == first.Password { + t.Fatalf("regenerate response = %+v, %v", second, err) + } + if _, _, ok, _ := sessions.VerifySFTPPassword(t.Context(), username, first.Password); ok { + t.Error("old password still verifies after regenerate") + } + if _, _, ok, err := sessions.VerifySFTPPassword(t.Context(), username, second.Password); err != nil || !ok { + t.Errorf("new password does not verify: ok=%v err=%v", ok, err) + } +} + +func TestSFTPEnvtest_PasswordResetAndUserDeleteRevokeSessions(t *testing.T) { + store := newTestStore(t) + sessions := auth.NewSessionStore(store) + srv := sftpEnvtestServer(t, store, sessions, "users:read", "users:manage") + + // Password reset: an SFTP session opened before it stops resolving, because the reset bumps session_epoch. + uid := sftpEnvtestUser(t, store) + raw, _, err := sessions.IssueSFTPSession(t.Context(), uid, scope.DefaultCluster, "password", sftpEnvtestEpoch(t, store, uid)) + if err != nil { + t.Fatalf("issue session: %v", err) + } + if _, _, err := sessions.LookupSFTPSessionToken(t.Context(), raw); err != nil { + t.Fatalf("session before reset does not resolve: %v", err) + } + if code, body := sftpEnvtestSend(t, srv, http.MethodPost, fmt.Sprintf("/users/%d/reset-password", uid), `{"password":"reset-pass-123456"}`); code != http.StatusNoContent { + t.Fatalf("reset password: status %d body %s", code, body) + } + if _, _, err := sessions.LookupSFTPSessionToken(t.Context(), raw); err == nil { + t.Error("SFTP session still resolves after the password reset") + } + + // User removal (the account is the only "disable" the user table has): every SFTP session row goes. + gone := sftpEnvtestUser(t, store) + rawGone, _, err := sessions.IssueSFTPSession(t.Context(), gone, scope.DefaultCluster, "password", sftpEnvtestEpoch(t, store, gone)) + if err != nil { + t.Fatalf("issue session for removal: %v", err) + } + if n := sftpEnvtestLive(t, store, gone, "password"); n != 1 { + t.Fatalf("%d live sessions before removal, want 1", n) + } + if code, body := sftpEnvtestSend(t, srv, http.MethodDelete, fmt.Sprintf("/users/%d", gone), ""); code != http.StatusNoContent { + t.Fatalf("delete user: status %d body %s", code, body) + } + if n := sftpEnvtestLive(t, store, gone, "password"); n != 0 { + t.Errorf("%d live sessions after user removal, want 0", n) + } + if _, _, err := sessions.LookupSFTPSessionToken(t.Context(), rawGone); err == nil { + t.Error("SFTP session still resolves after user removal") + } +} + +func TestSFTPEnvtest_SessionAndMCPTokenCallersRefused(t *testing.T) { + callers := map[string]func(context.Context) context.Context{ + "mcp token": func(ctx context.Context) context.Context { return auth.WithMCPToken(ctx, 7) }, + "sftp session": func(ctx context.Context) context.Context { + return auth.WithSFTPCaller(ctx, auth.SFTPCaller{Cluster: scope.DefaultCluster, SessionID: 9}) + }, + } + for name, withCaller := range callers { + t.Run(name, func(t *testing.T) { + store := newTestStore(t) + sessions := auth.NewSessionStore(store) + uid := sftpEnvtestUser(t, store) + srv := sftpEnvtestSelfServer(t, store, sessions, uid, withCaller) + + if code, body := sftpEnvtestSend(t, srv, http.MethodGet, "/users/me/sftp", ""); code != http.StatusForbidden { + t.Errorf("profile read: status %d body %s, want 403", code, body) + } + if code, body := sftpEnvtestSend(t, srv, http.MethodPost, "/users/me/sftp/keys", fmt.Sprintf(`{"name":"x","publicKey":%q}`, sftpTestEd25519Line(t))); code != http.StatusForbidden { + t.Errorf("add key: status %d body %s, want 403", code, body) + } + if code, body := sftpEnvtestSend(t, srv, http.MethodPost, "/users/me/sftp/password", `{"length":24}`); code != http.StatusForbidden { + t.Errorf("generate password: status %d body %s, want 403", code, body) + } + if keys, err := sessions.ListSFTPKeys(t.Context(), uid); err != nil || len(keys) != 0 { + t.Errorf("refused key add left %d keys (err %v)", len(keys), err) + } + if _, found, err := sessions.GetSFTPPasswordInfo(t.Context(), uid); err != nil || found { + t.Errorf("refused password generate left a password (found %v, err %v)", found, err) + } + }) + } +} diff --git a/api/internal/handlers/sftp_host_key_test.go b/api/internal/handlers/sftp_host_key_test.go new file mode 100644 index 000000000..678cb3c22 --- /dev/null +++ b/api/internal/handlers/sftp_host_key_test.go @@ -0,0 +1,179 @@ +package handlers + +import ( + "context" + "crypto/ed25519" + "crypto/rand" + "crypto/x509" + "encoding/pem" + "errors" + "testing" + + "golang.org/x/crypto/ssh" + corev1 "k8s.io/api/core/v1" + apierrors "k8s.io/apimachinery/pkg/api/errors" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/runtime/schema" + kubefake "k8s.io/client-go/kubernetes/fake" + k8stesting "k8s.io/client-go/testing" + + "github.com/GameplanePanel/gameplane/api/internal/kube" + "github.com/GameplanePanel/gameplane/api/internal/scope" +) + +const hostKeyTestSecret = "gameplane-sftp-host-key" + +// hostKeyTestPEM returns a PEM ed25519 host key and its SHA256 fingerprint. +func hostKeyTestPEM(t *testing.T) ([]byte, string) { + t.Helper() + _, priv, err := ed25519.GenerateKey(rand.Reader) + if err != nil { + t.Fatalf("generate key: %v", err) + } + der, err := x509.MarshalPKCS8PrivateKey(priv) + if err != nil { + t.Fatalf("marshal key: %v", err) + } + pub, err := ssh.NewPublicKey(priv.Public()) + if err != nil { + t.Fatalf("public key: %v", err) + } + return pem.EncodeToMemory(&pem.Block{Type: "PRIVATE KEY", Bytes: der}), ssh.FingerprintSHA256(pub) +} + +func hostKeyTestSecretObj(ns string, data []byte) *corev1.Secret { + return &corev1.Secret{ + ObjectMeta: metav1.ObjectMeta{Name: hostKeyTestSecret, Namespace: ns}, + Data: map[string][]byte{sftpHostKeyDataKey: data}, + } +} + +// hostKeyTestClient returns a cluster client whose Secret reads are answered by the fake clientset. +func hostKeyTestClient(objs ...runtime.Object) (*kube.Client, *kubefake.Clientset) { + cs := kubefake.NewClientset(objs...) + return &kube.Client{Typed: cs}, cs +} + +func TestSFTPHostKeyUnit_FingerprintFromReleaseNamespace(t *testing.T) { + pemData, want := hostKeyTestPEM(t) + k, _ := hostKeyTestClient(hostKeyTestSecretObj("gameplane-system", pemData)) + + got, err := localSFTPFingerprint(k, "gameplane-system", hostKeyTestSecret)(t.Context()) + if err != nil || got != want { + t.Fatalf("fingerprint = %q, %v; want %q", got, err, want) + } + + // The Secret is read in the namespace given, not in another one that happens to hold no key. + got, err = localSFTPFingerprint(k, "gameplane-credentials", hostKeyTestSecret)(t.Context()) + if err != nil || got != "" { + t.Fatalf("other namespace: %q, %v; want empty and no error", got, err) + } +} + +func TestSFTPHostKeyUnit_ForbiddenReadsAsNoFingerprint(t *testing.T) { + k, cs := hostKeyTestClient() + cs.PrependReactor("get", "secrets", func(_ k8stesting.Action) (bool, runtime.Object, error) { + return true, nil, apierrors.NewForbidden(schema.GroupResource{Resource: "secrets"}, hostKeyTestSecret, errors.New("rbac")) + }) + + fp, err := localSFTPFingerprint(k, "gameplane-system", hostKeyTestSecret)(t.Context()) + if err != nil || fp != "" { + t.Fatalf("forbidden read: %q, %v; want empty fingerprint and no error so the drawer still loads", fp, err) + } +} + +func TestSFTPHostKeyUnit_OtherReadErrorIsReturned(t *testing.T) { + k, cs := hostKeyTestClient() + cs.PrependReactor("get", "secrets", func(_ k8stesting.Action) (bool, runtime.Object, error) { + return true, nil, errors.New("apiserver unavailable") + }) + + if _, err := localSFTPFingerprint(k, "gameplane-system", hostKeyTestSecret)(t.Context()); err == nil { + t.Fatal("a non-authorization read error must still be reported") + } +} + +func TestSFTPHostKeyUnit_MissingSecretAndUnreadableKey(t *testing.T) { + k, _ := hostKeyTestClient() + if fp, err := localSFTPFingerprint(k, "gameplane-system", hostKeyTestSecret)(t.Context()); err != nil || fp != "" { + t.Fatalf("missing secret: %q, %v", fp, err) + } + + k, _ = hostKeyTestClient(hostKeyTestSecretObj("gameplane-system", []byte("not a key"))) + if fp, err := localSFTPFingerprint(k, "gameplane-system", hostKeyTestSecret)(t.Context()); err != nil || fp != "" { + t.Fatalf("unreadable key: %q, %v; want empty fingerprint and no error", fp, err) + } +} + +func TestSFTPHostKeyUnit_LocalEndpointSource(t *testing.T) { + pemData, fp := hostKeyTestPEM(t) + k, _ := hostKeyTestClient(hostKeyTestSecretObj("gameplane-system", pemData)) + base := SFTPClusterMount{ + Kube: k, + Namespace: "gameplane-system", + HostKeySecret: hostKeyTestSecret, + Enabled: true, + Port: 2222, + PublicAddress: "files.example.com", + } + + src := LocalSFTPEndpointSource(base, scope.DefaultCluster) + ep, ok := src(t.Context(), scope.DefaultCluster) + if !ok { + t.Fatal("enabled local endpoint with an address must be reported") + } + want := SFTPEndpoint{Address: "files.example.com", Port: 2222, HostKeyFingerprint: fp} + if ep != want { + t.Fatalf("endpoint = %+v; want %+v", ep, want) + } + + // host:port in the address overrides the configured port. + withPort := base + withPort.PublicAddress = "files.example.com:30222" + if ep, ok := LocalSFTPEndpointSource(withPort, scope.DefaultCluster)(t.Context(), scope.DefaultCluster); !ok || ep.Port != 30222 || ep.Address != "files.example.com" { + t.Fatalf("host:port endpoint = %+v, %v", ep, ok) + } + + // Bracketed IPv6 literals keep their host without brackets. + v6 := base + v6.PublicAddress = "[2001:db8::1]:2200" + if ep, ok := LocalSFTPEndpointSource(v6, scope.DefaultCluster)(t.Context(), scope.DefaultCluster); !ok || ep.Address != "2001:db8::1" || ep.Port != 2200 { + t.Fatalf("ipv6 endpoint = %+v, %v", ep, ok) + } + + // Disabled SFTP, another cluster, no address and an invalid address all read as no endpoint (null). + disabled := base + disabled.Enabled = false + noAddress := base + noAddress.PublicAddress = "" + invalid := base + invalid.PublicAddress = "files.example.com/path" + cases := map[string]struct { + mount SFTPClusterMount + cluster string + }{ + "disabled": {disabled, scope.DefaultCluster}, + "other cluster": {base, "remote-a"}, + "no address": {noAddress, scope.DefaultCluster}, + "invalid addr": {invalid, scope.DefaultCluster}, + } + for name, tc := range cases { + if ep, ok := LocalSFTPEndpointSource(tc.mount, scope.DefaultCluster)(t.Context(), tc.cluster); ok { + t.Errorf("%s: endpoint = %+v; want none", name, ep) + } + } +} + +func TestSFTPHostKeyUnit_LocalEndpointSourceWithoutFingerprint(t *testing.T) { + k, cs := hostKeyTestClient() + cs.PrependReactor("get", "secrets", func(_ k8stesting.Action) (bool, runtime.Object, error) { + return true, nil, apierrors.NewForbidden(schema.GroupResource{Resource: "secrets"}, hostKeyTestSecret, errors.New("rbac")) + }) + m := SFTPClusterMount{Kube: k, Namespace: "gameplane-system", HostKeySecret: hostKeyTestSecret, Enabled: true, Port: 2222, PublicAddress: "files.example.com"} + + ep, ok := LocalSFTPEndpointSource(m, scope.DefaultCluster)(context.Background(), scope.DefaultCluster) + if !ok || ep.Address != "files.example.com" || ep.Port != 2222 || ep.HostKeyFingerprint != "" { + t.Fatalf("endpoint without fingerprint = %+v, %v; want address and port with an empty fingerprint", ep, ok) + } +} diff --git a/api/internal/handlers/sftp_login.go b/api/internal/handlers/sftp_login.go new file mode 100644 index 000000000..4a7eedfc0 --- /dev/null +++ b/api/internal/handlers/sftp_login.go @@ -0,0 +1,400 @@ +package handlers + +import ( + "context" + "encoding/json" + "fmt" + "log/slog" + "net" + "net/http" + "net/netip" + "strings" + "time" + + "github.com/go-chi/chi/v5" + "github.com/go-chi/chi/v5/middleware" + + "github.com/GameplanePanel/gameplane/api/internal/audit" + "github.com/GameplanePanel/gameplane/api/internal/auth" + "github.com/GameplanePanel/gameplane/api/internal/db" + "github.com/GameplanePanel/gameplane/api/internal/httperr" + "github.com/GameplanePanel/gameplane/api/internal/messages" + "github.com/GameplanePanel/gameplane/api/internal/rbac" + "github.com/GameplanePanel/gameplane/api/internal/scope" +) + +const ( + // sftpLoginFailedReason is the only reason a failed login writes. The cause stays out of the audit trail. + sftpLoginFailedReason = "sftp-login-failed" + // sftpActorMaxRunes caps the username recorded as the audit actor of a failed login. + sftpActorMaxRunes = 64 + // sftpCheckMaxTokens bounds one sessions/check request. + sftpCheckMaxTokens = 500 +) + +// MountSFTPLogin registers the endpoint-facing routes under /sftp/v1. The caller mounts it OUTSIDE the protected +// group: these routes are authenticated by sessions.SFTPServiceAuth (service token), never by a user session. +func MountSFTPLogin(r chi.Router, sessions *auth.SessionStore, store *db.Store, files *rbac.FileChecker, aud *audit.Auditor) { + h := &sftpLoginHandler{sessions: sessions, store: store, files: files, aud: aud} + r.Group(func(r chi.Router) { + r.Use(sessions.SFTPServiceAuth) + r.Post("/sftp/v1/login", h.login) + r.Post("/sftp/v1/sessions/check", h.check) + r.Post("/sftp/v1/sessions/end", h.end) + }) +} + +// MountSFTPServers registers GET /sftp/v1/servers on the protected group. It is a session-token route: +// the SFTP endpoint lists the servers the signed-in user may reach on the session's cluster. +func MountSFTPServers(p chi.Router, files *rbac.FileChecker) { + h := &sftpServersHandler{files: files} + p.Get("/sftp/v1/servers", h.list) +} + +type sftpLoginHandler struct { + sessions *auth.SessionStore + store *db.Store + files *rbac.FileChecker + aud *audit.Auditor +} + +type sftpLoginReq struct { + Username string `json:"username"` + Password string `json:"password"` + PublicKey string `json:"publicKey"` + RemoteAddr string `json:"remoteAddr"` +} + +type sftpLoginTarget struct { + Namespace string `json:"namespace"` + Server string `json:"server"` +} + +type sftpLoginResp struct { + SessionToken string `json:"sessionToken"` + ExpiresAt time.Time `json:"expiresAt"` + User string `json:"user"` + Target *sftpLoginTarget `json:"target"` +} + +// login exchanges a password or a public key for a gpsftp_ session token. Every refusal writes the same +// body and the same audit reason, whatever the cause. +func (h *sftpLoginHandler) login(w http.ResponseWriter, req *http.Request) { + ctx := req.Context() + caller, ok := auth.SFTPCallerFromContext(ctx) + if !ok { + httperr.WriteMessage(w, req, messages.New("server.common.unauthenticated", nil)) + return + } + var body sftpLoginReq + if err := json.NewDecoder(req.Body).Decode(&body); err != nil { + httperr.WriteMessage(w, req, messages.New("server.common.invalid_json", nil)) + return + } + + base, rawTarget, hasTarget := splitSFTPUsername(body.Username) + actor := truncateRunes(base, sftpActorMaxRunes) + refuse := func(cause string) { + slog.Debug("sftp login refused", "cause", cause) + h.auditLoginFailure(ctx, req, actor) + httperr.WriteMessage(w, req, messages.New("server.sftp.login_failed", nil)) + } + + // Rate limits run before any validation or credential work (so refusals cannot flood the audit + // trail either), keyed like /auth/login: the source address the endpoint reports and the + // username. The request IP is always the SFTP pod, so it is not used. actor is the username + // capped to 64 runes, identical to base for every valid username. + auth.SetActor(ctx, actor) + if !auth.LoginLimiter.RequestBudget(w, req, sftpSourceKey(body.RemoteAddr, req)) { + return + } + if !auth.LoginUserLimiter.RequestBudget(w, req, actor) { + return + } + + if (body.Password == "") == (body.PublicKey == "") { + refuse("credential-shape") + return + } + if !identifierRE.MatchString(base) { + refuse("username") + return + } + var target *sftpLoginTarget + if hasTarget { + t, valid := parseSFTPTarget(rawTarget) + if !valid { + refuse("target") + return + } + target = &t + } + + var ( + userID int64 + credential string + epoch int64 + ) + if body.Password != "" { + uid, ep, good, err := h.sessions.VerifySFTPPassword(ctx, base, body.Password) + if err != nil || !good { + refuse("credential") + return + } + userID, epoch, credential = uid, ep, "password" + } else { + fp, err := auth.SFTPFingerprintForLogin(body.PublicKey) + if err != nil { + refuse("key") + return + } + keyUser, keyID, err := h.sessions.FindSFTPKey(ctx, fp) + if err != nil { + refuse("key") + return + } + userID, credential = keyUser, fmt.Sprintf("key:%d", keyID) + } + + // The user row is read again for the permissions, and its session_epoch must match the one the + // credential check read, so a password reset during login invalidates the new session. A key must + // belong to the user named in the username. + user, dbEpoch, err := h.sessions.SFTPUserByName(ctx, base) + if err != nil || user.ID != userID || (credential == "password" && dbEpoch != epoch) { + refuse("account") + return + } + epoch = dbEpoch + + if target != nil { + ref := rbac.FileTarget{Cluster: caller.Cluster, Namespace: target.Namespace, Server: target.Server} + if err := h.files.Allow(ctx, user, rbac.FileList, ref); err != nil { + refuse("no-access") + return + } + // A namespace-level servers:read passes Allow for any name, so the server must exist too. + exists, err := h.targetServerExists(ctx, user, caller.Cluster, target.Namespace, target.Server) + if err != nil || !exists { + refuse("no-access") + return + } + } + + token, expires, err := h.sessions.IssueSFTPSessionForToken(ctx, user.ID, caller.Cluster, credential, epoch, caller.ServiceTokenID) + if err != nil { + refuse("issue") + return + } + h.sessions.TouchSFTPCredential(ctx, user.ID, credential) + + auditTarget := caller.Cluster + if target != nil { + auditTarget = fmt.Sprintf("%s/%s/%s", caller.Cluster, target.Namespace, target.Server) + } + if err := h.aud.WriteSyncAs(ctx, user.Username, http.MethodPost, req.URL.Path, auditTarget, "", http.StatusOK); err != nil { + // Without a success row the session must not work: revoke it before refusing. + if rerr := h.sessions.RevokeSFTPSessionToken(ctx, token); rerr != nil { + slog.Error("sftp login: revoke unaudited session", "err", rerr) + } + httperr.WriteMessage(w, req, messages.New("server.generic.503", nil)) + return + } + audit.MarkRecorded(ctx) + + writeJSON(w, sftpLoginResp{SessionToken: token, ExpiresAt: expires, User: user.Username, Target: target}) +} + +// auditLoginFailure writes the failed-login row. The middleware row is skipped only after this one lands. +func (h *sftpLoginHandler) auditLoginFailure(ctx context.Context, req *http.Request, actor string) { + if err := h.aud.WriteSyncAs(ctx, actor, http.MethodPost, req.URL.Path, "", sftpLoginFailedReason, http.StatusUnauthorized); err != nil { + slog.Warn("sftp login audit", "err", err) + return + } + audit.MarkRecorded(ctx) +} + +// targetServerExists reports whether the named server exists on cluster and is visible to user. The file +// checker has no direct server getter, so it uses the visible-server listing, which covers every server +// the user may reach through a namespace grant or through ownership. +func (h *sftpLoginHandler) targetServerExists(ctx context.Context, user *auth.User, cluster, ns, name string) (bool, error) { + refs, err := h.files.VisibleServers(ctx, user, cluster) + if err != nil { + return false, fmt.Errorf("list sftp target servers: %w", err) + } + for _, ref := range refs { + if ref.Namespace == ns && ref.Name == name { + return true, nil + } + } + return false, nil +} + +// check reports which of the endpoint's session tokens are no longer valid. Never audited. +func (h *sftpLoginHandler) check(w http.ResponseWriter, req *http.Request) { + ctx := req.Context() + caller, ok := auth.SFTPCallerFromContext(ctx) + if !ok { + httperr.WriteMessage(w, req, messages.New("server.common.unauthenticated", nil)) + return + } + var body struct { + SessionTokens []string `json:"sessionTokens"` + } + if err := json.NewDecoder(req.Body).Decode(&body); err != nil { + httperr.WriteMessage(w, req, messages.New("server.common.invalid_json", nil)) + return + } + if len(body.SessionTokens) > sftpCheckMaxTokens { + httperr.WriteMessage(w, req, messages.New("server.bad_request", nil)) + return + } + + // A token without the session prefix can never be valid: it is reported, not rejected. + revoked := []string{} + byDigest := make(map[string]string, len(body.SessionTokens)) + digests := make([]string, 0, len(body.SessionTokens)) + for _, tok := range body.SessionTokens { + if !strings.HasPrefix(tok, auth.SFTPSessionTokenPrefix) { + revoked = append(revoked, tok) + continue + } + d := auth.SFTPTokenDigest(tok) + if _, dup := byDigest[d]; dup { + continue + } + byDigest[d] = tok + digests = append(digests, d) + } + + missing, err := h.sessions.CheckSFTPSessions(ctx, caller.Cluster, digests) + if err != nil { + httperr.WriteMessage(w, req, messages.New("server.generic.503", nil)) + return + } + for _, d := range missing { + if tok, ok := byDigest[d]; ok { + revoked = append(revoked, tok) + } + } + writeJSON(w, map[string]any{"revoked": revoked}) +} + +// end revokes sessions the endpoint turned away. Unknown or foreign tokens are ignored. +func (h *sftpLoginHandler) end(w http.ResponseWriter, req *http.Request) { + ctx := req.Context() + caller, ok := auth.SFTPCallerFromContext(ctx) + if !ok { + httperr.WriteMessage(w, req, messages.New("server.common.unauthenticated", nil)) + return + } + var body struct { + SessionTokens []string `json:"sessionTokens"` + } + if err := json.NewDecoder(req.Body).Decode(&body); err != nil { + httperr.WriteMessage(w, req, messages.New("server.common.invalid_json", nil)) + return + } + if len(body.SessionTokens) > sftpCheckMaxTokens { + httperr.WriteMessage(w, req, messages.New("server.bad_request", nil)) + return + } + digests := make([]string, 0, len(body.SessionTokens)) + for _, tok := range body.SessionTokens { + if strings.HasPrefix(tok, auth.SFTPSessionTokenPrefix) { + digests = append(digests, auth.SFTPTokenDigest(tok)) + } + } + if err := h.sessions.EndSFTPSessions(ctx, caller.Cluster, digests); err != nil { + httperr.WriteMessage(w, req, messages.New("server.generic.503", nil)) + return + } + w.WriteHeader(http.StatusNoContent) +} + +type sftpServersHandler struct { + files *rbac.FileChecker +} + +type sftpServerItem struct { + Namespace string `json:"namespace"` + Server string `json:"server"` + // Write reports whether the file-access check lets the session change files on this server, so the + // SFTP endpoint refuses an upload when the file is opened instead of when it is closed. + Write bool `json:"write"` +} + +// list serves the session's servers. Only session-token callers may use it. +func (h *sftpServersHandler) list(w http.ResponseWriter, req *http.Request) { + ctx := req.Context() + caller, ok := auth.SFTPCallerFromContext(ctx) + if !ok || caller.SessionID == 0 { + httperr.WriteMessage(w, req, messages.New("server.forbidden", nil)) + return + } + user := auth.UserFromContext(ctx) + if user == nil { + httperr.WriteMessage(w, req, messages.New("server.common.unauthenticated", nil)) + return + } + refs, err := h.files.VisibleServers(ctx, user, caller.Cluster) + if err != nil { + httperr.Write(w, req, err) + return + } + items := make([]sftpServerItem, 0, len(refs)) + for _, ref := range refs { + target := rbac.FileTarget{Cluster: ref.Cluster, Namespace: ref.Namespace, Server: ref.Name} + write := h.files.Allow(ctx, user, rbac.FileCreate, target) == nil + items = append(items, sftpServerItem{Namespace: ref.Namespace, Server: ref.Name, Write: write}) + } + writeJSON(w, map[string]any{"items": items}) +} + +// splitSFTPUsername splits "name+target" at the last "+". The base is what authenticates. +func splitSFTPUsername(raw string) (base, target string, hasTarget bool) { + i := strings.LastIndex(raw, "+") + if i < 0 { + return raw, "", false + } + return raw[:i], raw[i+1:], true +} + +// parseSFTPTarget accepts "server" (default namespace) or "namespace/server". +func parseSFTPTarget(s string) (sftpLoginTarget, bool) { + ns, server := scope.DefaultNamespace, s + if before, after, found := strings.Cut(s, "/"); found { + ns, server = before, after + } + if !dnsLabelRE.MatchString(ns) || !dnsLabelRE.MatchString(server) || !scope.Allowed(ns) { + return sftpLoginTarget{}, false + } + return sftpLoginTarget{Namespace: ns, Server: server}, true +} + +// sftpSourceKey is the address the endpoint reports for the client, falling back to the request's own +// client IP when the body carries no valid address. +func sftpSourceKey(remote string, req *http.Request) string { + if ap, err := netip.ParseAddrPort(remote); err == nil { + return ap.Addr().String() + } + if a, err := netip.ParseAddr(remote); err == nil { + return a.String() + } + if ip := middleware.GetClientIP(req.Context()); ip != "" { + return ip + } + host, _, err := net.SplitHostPort(req.RemoteAddr) + if err != nil { + return req.RemoteAddr + } + return host +} + +// truncateRunes returns at most n runes of s. +func truncateRunes(s string, n int) string { + r := []rune(s) + if len(r) <= n { + return s + } + return string(r[:n]) +} diff --git a/api/internal/handlers/sftp_login_target_exists_test.go b/api/internal/handlers/sftp_login_target_exists_test.go new file mode 100644 index 000000000..9942b2b73 --- /dev/null +++ b/api/internal/handlers/sftp_login_target_exists_test.go @@ -0,0 +1,51 @@ +package handlers + +import ( + "encoding/json" + "net/http" + "strings" + "testing" + + "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" + + "github.com/GameplanePanel/gameplane/api/internal/auth" + "github.com/GameplanePanel/gameplane/api/internal/scope" +) + +// TestSFTPLogin_TargetMustExist covers FR-009a: a namespace-wide servers:read grant passes the access +// check for any name, so a login to a server that does not exist must be refused like a wrong password. +func TestSFTPLogin_TargetMustExist(t *testing.T) { + env := newSFTPLoginEnv(t) + h := sftpLoginRouter(env) + name, id := env.seedUser(t, "x") + // Admin on every namespace of the default cluster: Allow passes for any server name. + if _, err := env.store.DB.ExecContext(t.Context(), + `INSERT INTO user_role_bindings(user_id, role_name, cluster, namespace) VALUES (?, 'admin', ?, '*')`, + id, scope.DefaultCluster); err != nil { + t.Fatalf("bind admin role: %v", err) + } + pw, err := env.sessions.GenerateAndStoreSFTPPassword(t.Context(), id, 24) + if err != nil { + t.Fatalf("password: %v", err) + } + env.fake.items = []unstructured.Unstructured{sftpFakeServer(scope.DefaultNamespace, "survival", id)} + + rr := env.login(t, h, map[string]any{"username": name + "+doesnotexist", "password": pw}) + if rr.Code != http.StatusUnauthorized || sftpProblemID(t, rr) != "server.sftp.login_failed" { + t.Fatalf("missing target login: status %d body %s", rr.Code, rr.Body.String()) + } + + rr = env.login(t, h, map[string]any{"username": name + "+survival", "password": pw}) + if rr.Code != http.StatusOK { + t.Fatalf("existing target login: status %d body %s", rr.Code, rr.Body.String()) + } + var resp struct { + SessionToken string `json:"sessionToken"` + } + if err := json.Unmarshal(rr.Body.Bytes(), &resp); err != nil { + t.Fatalf("decode login response: %v", err) + } + if !strings.HasPrefix(resp.SessionToken, auth.SFTPSessionTokenPrefix) { + t.Fatalf("existing target login returned no session token: %s", rr.Body.String()) + } +} diff --git a/api/internal/handlers/sftp_login_test.go b/api/internal/handlers/sftp_login_test.go new file mode 100644 index 000000000..733120ee2 --- /dev/null +++ b/api/internal/handlers/sftp_login_test.go @@ -0,0 +1,493 @@ +package handlers + +import ( + "bytes" + "context" + "crypto/ed25519" + "crypto/rand" + "database/sql" + "encoding/json" + "errors" + "fmt" + "net/http" + "net/http/httptest" + "strconv" + "strings" + "sync/atomic" + "testing" + + "github.com/go-chi/chi/v5" + "golang.org/x/crypto/ssh" + "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" + + "github.com/GameplanePanel/gameplane/api/internal/audit" + "github.com/GameplanePanel/gameplane/api/internal/auth" + "github.com/GameplanePanel/gameplane/api/internal/db" + "github.com/GameplanePanel/gameplane/api/internal/rbac" + "github.com/GameplanePanel/gameplane/api/internal/scope" +) + +// sftpSeq keeps usernames unique across tests that share the database and the package-wide limiters. +var sftpSeq atomic.Int64 + +var errSFTPFakeNotFound = errors.New("sftp fake: server not found") + +// sftpFakeServers serves GameServers to the file checker without a cluster. +type sftpFakeServers struct { + items []unstructured.Unstructured +} + +func (f *sftpFakeServers) GetServer(_ context.Context, _, ns, name string) (*unstructured.Unstructured, error) { + for i := range f.items { + if f.items[i].GetNamespace() == ns && f.items[i].GetName() == name { + return &f.items[i], nil + } + } + return nil, errSFTPFakeNotFound +} + +func (f *sftpFakeServers) IDs() []string { return []string{scope.DefaultCluster} } + +func (f *sftpFakeServers) ListServers(_ context.Context, _, ns string) ([]unstructured.Unstructured, error) { + var out []unstructured.Unstructured + for _, it := range f.items { + if it.GetNamespace() == ns { + out = append(out, it) + } + } + return out, nil +} + +// sftpFakeServer returns a GameServer in ns owned by ownerID. +func sftpFakeServer(ns, name string, ownerID int64) unstructured.Unstructured { + u := unstructured.Unstructured{} + u.SetNamespace(ns) + u.SetName(name) + u.SetAnnotations(map[string]string{"gameplane.local/owner-id": strconv.FormatInt(ownerID, 10)}) + return u +} + +// sftpLoginEnv is a migrated store with one SFTP service token for the default cluster. +type sftpLoginEnv struct { + store *db.Store + sessions *auth.SessionStore + fake *sftpFakeServers + files *rbac.FileChecker + aud *audit.Auditor + svcRaw string + svcID int64 +} + +func newSFTPLoginEnv(t *testing.T) sftpLoginEnv { + t.Helper() + auth.SetFastHashParams(t) + store := newTestStore(t) + sessions := auth.NewSessionStore(store) + ctx := t.Context() + tok, raw, err := sessions.CreateSFTPServiceToken(ctx, scope.DefaultCluster) + if err != nil { + t.Fatalf("create service token: %v", err) + } + t.Cleanup(func() { + _ = sessions.RevokeSFTPServiceToken(context.Background(), scope.DefaultCluster, tok.ID) + }) + fake := &sftpFakeServers{} + return sftpLoginEnv{ + store: store, sessions: sessions, fake: fake, + files: rbac.NewFileAccess(fake, fake), aud: audit.New(store), + svcRaw: raw, svcID: tok.ID, + } +} + +// seedUser inserts a user with the given dashboard password hash ("x" is not a valid hash, so the +// dashboard login cannot succeed for it). +func (env sftpLoginEnv) seedUser(t *testing.T, pwHash string) (string, int64) { + t.Helper() + name := fmt.Sprintf("sftpuser%d", sftpSeq.Add(1)) + if _, err := env.store.DB.ExecContext(t.Context(), + `INSERT INTO users(username, display_name, email, role, pw_hash) VALUES (?, ?, ?, ?, ?)`, + name, name, name+"@example.com", "viewer", pwHash); err != nil { + t.Fatalf("insert user %s: %v", name, err) + } + var id int64 + if err := env.store.DB.QueryRowContext(t.Context(), + `SELECT id FROM users WHERE username = ?`, name).Scan(&id); err != nil { + t.Fatalf("user id %s: %v", name, err) + } + return name, id +} + +// login posts to the SFTP login route from a fresh source address, so per-address buckets never fill. +func (env sftpLoginEnv) login(t *testing.T, h http.Handler, body map[string]any) *httptest.ResponseRecorder { + t.Helper() + n := sftpSeq.Add(1) + body["remoteAddr"] = fmt.Sprintf("10.0.%d.%d:40000", (n>>8)&255, n&255) + raw, err := json.Marshal(body) + if err != nil { + t.Fatalf("marshal login body: %v", err) + } + req := httptest.NewRequestWithContext(t.Context(), http.MethodPost, "/sftp/v1/login", bytes.NewReader(raw)) + req.Header.Set("Content-Type", "application/json") + req.Header.Set("Authorization", "Bearer "+env.svcRaw) + req.Header.Set("Accept", "application/problem+json") + rr := httptest.NewRecorder() + h.ServeHTTP(rr, req) + return rr +} + +func sftpLoginRouter(env sftpLoginEnv) http.Handler { + r := chi.NewRouter() + MountSFTPLogin(r, env.sessions, env.store, env.files, env.aud) + return r +} + +// sftpProblemID returns the messageId of a problem response. +func sftpProblemID(t *testing.T, rr *httptest.ResponseRecorder) string { + t.Helper() + var p struct { + MessageID string `json:"messageId"` + } + if err := json.Unmarshal(rr.Body.Bytes(), &p); err != nil { + t.Fatalf("decode problem body %q: %v", rr.Body.String(), err) + } + return p.MessageID +} + +// sftpTestEd25519Line returns a fresh ed25519 authorized_keys line. +func sftpTestEd25519Line(t *testing.T) string { + t.Helper() + pub, _, err := ed25519.GenerateKey(rand.Reader) + if err != nil { + t.Fatalf("generate key: %v", err) + } + sshPub, err := ssh.NewPublicKey(pub) + if err != nil { + t.Fatalf("ssh public key: %v", err) + } + return strings.TrimSpace(string(ssh.MarshalAuthorizedKey(sshPub))) +} + +func TestSFTPLogin_FailuresShareOneAnswer(t *testing.T) { + env := newSFTPLoginEnv(t) + h := sftpLoginRouter(env) + + // A user with a dashboard password but no SFTP password, and an OIDC-only account. + dashHash, err := auth.HashPassword(t.Context(), "dashboard-pass") + if err != nil { + t.Fatalf("hash: %v", err) + } + dashName, _ := env.seedUser(t, dashHash) + oidcName, _ := env.seedUser(t, "") + pwName, _ := env.seedUser(t, "x") + if _, err := env.sessions.GenerateAndStoreSFTPPassword(t.Context(), userIDOf(t, env, pwName), 24); err != nil { + t.Fatalf("set sftp password: %v", err) + } + + cases := map[string]map[string]any{ + "wrong password": {"username": pwName, "password": "not-the-password"}, + "unknown user": {"username": "no-such-user-zz", "password": "whatever"}, + "dashboard password": {"username": dashName, "password": "dashboard-pass"}, + "oidc only account": {"username": oidcName, "password": "anything"}, + "malformed key": {"username": pwName, "publicKey": "ssh-ed25519 AAAA-bogus"}, + "two credentials": {"username": pwName, "password": "x", "publicKey": "ssh-ed25519 AAAA"}, + "bad target name": {"username": pwName + "+Bad_Name", "password": "x"}, + "target with three rel": {"username": pwName + "+a/b/c", "password": "x"}, + } + var first string + for name, body := range cases { + rr := env.login(t, h, body) + if rr.Code != http.StatusUnauthorized { + t.Fatalf("%s: status %d, want 401 (body %s)", name, rr.Code, rr.Body.String()) + } + if id := sftpProblemID(t, rr); id != "server.sftp.login_failed" { + t.Fatalf("%s: messageId %q", name, id) + } + if first == "" { + first = rr.Body.String() + } else if rr.Body.String() != first { + t.Fatalf("%s: body differs from the other refusals: %s vs %s", name, rr.Body.String(), first) + } + } +} + +func TestSFTPLogin_PasswordSuccessAndAudit(t *testing.T) { + env := newSFTPLoginEnv(t) + h := sftpLoginRouter(env) + name, uid := env.seedUser(t, "x") + pw, err := env.sessions.GenerateAndStoreSFTPPassword(t.Context(), uid, 24) + if err != nil { + t.Fatalf("set sftp password: %v", err) + } + + rr := env.login(t, h, map[string]any{"username": name, "password": pw}) + if rr.Code != http.StatusOK { + t.Fatalf("login status %d: %s", rr.Code, rr.Body.String()) + } + var resp struct { + SessionToken string `json:"sessionToken"` + User string `json:"user"` + Target *string `json:"target"` + } + if err := json.Unmarshal(rr.Body.Bytes(), &resp); err != nil { + t.Fatalf("decode login: %v", err) + } + if !strings.HasPrefix(resp.SessionToken, auth.SFTPSessionTokenPrefix) || resp.User != name || resp.Target != nil { + t.Fatalf("unexpected login response: %+v", resp) + } + + var source sql.NullString + if err := env.store.DB.QueryRowContext(t.Context(), + `SELECT source FROM audit_events WHERE actor = ? AND status = 200 ORDER BY id DESC LIMIT 1`, name, + ).Scan(&source); err != nil { + t.Fatalf("read success audit row: %v", err) + } + if source.String != "sftp" { + t.Fatalf("audit source %q, want sftp", source.String) + } +} + +func TestSFTPLogin_TargetRequiresAccess(t *testing.T) { + env := newSFTPLoginEnv(t) + h := sftpLoginRouter(env) + owner, ownerID := env.seedUser(t, "x") + outsider, outsiderID := env.seedUser(t, "x") + env.fake.items = []unstructured.Unstructured{sftpFakeServer(scope.DefaultNamespace, "survival", ownerID)} + ownerPW, err := env.sessions.GenerateAndStoreSFTPPassword(t.Context(), ownerID, 24) + if err != nil { + t.Fatalf("owner password: %v", err) + } + outsiderPW, err := env.sessions.GenerateAndStoreSFTPPassword(t.Context(), outsiderID, 24) + if err != nil { + t.Fatalf("outsider password: %v", err) + } + + rr := env.login(t, h, map[string]any{"username": owner + "+survival", "password": ownerPW}) + if rr.Code != http.StatusOK { + t.Fatalf("owner target login status %d: %s", rr.Code, rr.Body.String()) + } + rr = env.login(t, h, map[string]any{"username": outsider + "+survival", "password": outsiderPW}) + if rr.Code != http.StatusUnauthorized || sftpProblemID(t, rr) != "server.sftp.login_failed" { + t.Fatalf("outsider target login: status %d body %s", rr.Code, rr.Body.String()) + } +} + +func TestSFTPLogin_KeyMustBelongToNamedUser(t *testing.T) { + env := newSFTPLoginEnv(t) + h := sftpLoginRouter(env) + alice, aliceID := env.seedUser(t, "x") + bob, _ := env.seedUser(t, "x") + line := sftpTestEd25519Line(t) + if _, err := env.sessions.AddSFTPKey(t.Context(), aliceID, "laptop", line); err != nil { + t.Fatalf("add key: %v", err) + } + + if rr := env.login(t, h, map[string]any{"username": alice, "publicKey": line}); rr.Code != http.StatusOK { + t.Fatalf("alice key login status %d: %s", rr.Code, rr.Body.String()) + } + if rr := env.login(t, h, map[string]any{"username": bob, "publicKey": line}); rr.Code != http.StatusUnauthorized { + t.Fatalf("bob with alice's key: status %d", rr.Code) + } +} + +func TestSFTPLogin_RateLimitPerUsername(t *testing.T) { + env := newSFTPLoginEnv(t) + h := sftpLoginRouter(env) + name, _ := env.seedUser(t, "x") + // The per-username bucket has a burst of 6: the seventh attempt is limited whatever the answer. + for i := range 6 { + rr := env.login(t, h, map[string]any{"username": name, "password": "wrong"}) + if rr.Code != http.StatusUnauthorized { + t.Fatalf("attempt %d: status %d, want 401", i+1, rr.Code) + } + } + if rr := env.login(t, h, map[string]any{"username": name, "password": "wrong"}); rr.Code != http.StatusTooManyRequests { + t.Fatalf("seventh attempt: status %d, want 429", rr.Code) + } +} + +func TestSFTPLogin_RefusesWithoutServiceToken(t *testing.T) { + env := newSFTPLoginEnv(t) + h := sftpLoginRouter(env) + name, uid := env.seedUser(t, "x") + pw, err := env.sessions.GenerateAndStoreSFTPPassword(t.Context(), uid, 24) + if err != nil { + t.Fatalf("set sftp password: %v", err) + } + raw, err := json.Marshal(map[string]any{"username": name, "password": pw}) + if err != nil { + t.Fatalf("marshal: %v", err) + } + + // No bearer, and a session token where the service token belongs. + for _, hdr := range []string{"", "Bearer " + auth.SFTPSessionTokenPrefix + strings.Repeat("A", 43)} { + req := httptest.NewRequestWithContext(t.Context(), http.MethodPost, "/sftp/v1/login", bytes.NewReader(raw)) + req.Header.Set("Accept", "application/problem+json") + if hdr != "" { + req.Header.Set("Authorization", hdr) + } + rr := httptest.NewRecorder() + h.ServeHTTP(rr, req) + if rr.Code != http.StatusUnauthorized || sftpProblemID(t, rr) != "server.common.unauthenticated" { + t.Fatalf("auth %q: status %d body %s", hdr, rr.Code, rr.Body.String()) + } + } +} + +func TestSFTPLogin_CheckReportsRevokedTokens(t *testing.T) { + env := newSFTPLoginEnv(t) + h := sftpLoginRouter(env) + name, uid := env.seedUser(t, "x") + pw, err := env.sessions.GenerateAndStoreSFTPPassword(t.Context(), uid, 24) + if err != nil { + t.Fatalf("set sftp password: %v", err) + } + rr := env.login(t, h, map[string]any{"username": name, "password": pw}) + var login struct { + SessionToken string `json:"sessionToken"` + } + if err := json.Unmarshal(rr.Body.Bytes(), &login); err != nil || login.SessionToken == "" { + t.Fatalf("login: %v body %s", err, rr.Body.String()) + } + + check := func(tokens []string) (int, []string) { + raw, err := json.Marshal(map[string]any{"sessionTokens": tokens}) + if err != nil { + t.Fatalf("marshal: %v", err) + } + req := httptest.NewRequestWithContext(t.Context(), http.MethodPost, "/sftp/v1/sessions/check", bytes.NewReader(raw)) + req.Header.Set("Authorization", "Bearer "+env.svcRaw) + req.Header.Set("Accept", "application/problem+json") + out := httptest.NewRecorder() + h.ServeHTTP(out, req) + var body struct { + Revoked []string `json:"revoked"` + } + _ = json.Unmarshal(out.Body.Bytes(), &body) + return out.Code, body.Revoked + } + + code, revoked := check([]string{login.SessionToken, auth.SFTPSessionTokenPrefix + "unknown"}) + if code != http.StatusOK || len(revoked) != 1 || revoked[0] != auth.SFTPSessionTokenPrefix+"unknown" { + t.Fatalf("live token check: status %d revoked %v", code, revoked) + } + if err := env.sessions.RevokeSFTPSessionToken(t.Context(), login.SessionToken); err != nil { + t.Fatalf("revoke: %v", err) + } + if _, revoked := check([]string{login.SessionToken}); len(revoked) != 1 || revoked[0] != login.SessionToken { + t.Fatalf("revoked token not reported: %v", revoked) + } + + tooMany := make([]string, 501) + for i := range tooMany { + tooMany[i] = auth.SFTPSessionTokenPrefix + "x" + } + if code, _ := check(tooMany); code != http.StatusBadRequest { + t.Fatalf("501 tokens: status %d, want 400", code) + } +} + +// userIDOf reads a seeded user's id by name. +func userIDOf(t *testing.T, env sftpLoginEnv, name string) int64 { + t.Helper() + var id int64 + if err := env.store.DB.QueryRowContext(t.Context(), + `SELECT id FROM users WHERE username = ?`, name).Scan(&id); err != nil { + t.Fatalf("user id %s: %v", name, err) + } + return id +} + +// sftpSelfRouter serves the self-service routes as user uid. sftpCaller marks the request as made by an +// SFTP session, which the routes must refuse. +func sftpSelfRouter(sessions *auth.SessionStore, store *db.Store, uid int64, sftpCaller bool) http.Handler { + r := chi.NewRouter() + r.Use(func(next http.Handler) http.Handler { + return http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) { + ctx := auth.WithUser(req.Context(), &auth.User{ID: uid, Username: "caller", Role: "viewer"}) + if sftpCaller { + ctx = auth.WithSFTPCaller(ctx, auth.SFTPCaller{Cluster: scope.DefaultCluster, SessionID: 9}) + } + next.ServeHTTP(w, req.WithContext(ctx)) + }) + }) + mountSFTPRoutes(r, sessions, store) + return r +} + +func sftpSelfDo(t *testing.T, h http.Handler, method, path, body string) *httptest.ResponseRecorder { + t.Helper() + req := httptest.NewRequestWithContext(t.Context(), method, path, strings.NewReader(body)) + req.Header.Set("Content-Type", "application/json") + req.Header.Set("Accept", "application/problem+json") + rr := httptest.NewRecorder() + h.ServeHTTP(rr, req) + return rr +} + +func TestSFTPSelfService_KeysAndPassword(t *testing.T) { + env := newSFTPLoginEnv(t) + _, aliceID := env.seedUser(t, "x") + _, bobID := env.seedUser(t, "x") + alice := sftpSelfRouter(env.sessions, env.store, aliceID, false) + bob := sftpSelfRouter(env.sessions, env.store, bobID, false) + + line := sftpTestEd25519Line(t) + keyBody, err := json.Marshal(map[string]string{"name": "laptop", "publicKey": line}) + if err != nil { + t.Fatalf("marshal key: %v", err) + } + if rr := sftpSelfDo(t, alice, http.MethodPost, "/me/sftp/keys", string(keyBody)); rr.Code != http.StatusCreated { + t.Fatalf("add key: status %d body %s", rr.Code, rr.Body.String()) + } + if rr := sftpSelfDo(t, bob, http.MethodPost, "/me/sftp/keys", string(keyBody)); rr.Code != http.StatusConflict || + sftpProblemID(t, rr) != "server.sftp.key_duplicate" { + t.Fatalf("duplicate key for bob: status %d body %s", rr.Code, rr.Body.String()) + } + if rr := sftpSelfDo(t, alice, http.MethodPost, "/me/sftp/keys", `{"name":"x","publicKey":"not a key"}`); rr.Code != http.StatusBadRequest || + sftpProblemID(t, rr) != "server.sftp.key_invalid" { + t.Fatalf("invalid key: status %d body %s", rr.Code, rr.Body.String()) + } + + rr := sftpSelfDo(t, alice, http.MethodGet, "/me/sftp", "") + if rr.Code != http.StatusOK || !strings.Contains(rr.Body.String(), `"endpoint":null`) || + !strings.Contains(rr.Body.String(), `"password":null`) { + t.Fatalf("get self: status %d body %s", rr.Code, rr.Body.String()) + } + + gen := sftpSelfDo(t, alice, http.MethodPost, "/me/sftp/password", `{"length":24}`) + if gen.Code != http.StatusOK || gen.Header().Get("Cache-Control") != "no-store" { + t.Fatalf("generate password: status %d headers %v", gen.Code, gen.Header()) + } + var pw struct { + Password string `json:"password"` + Length int `json:"length"` + } + if err := json.Unmarshal(gen.Body.Bytes(), &pw); err != nil || len(pw.Password) != 24 || pw.Length != 24 { + t.Fatalf("generated password body: %v %s", err, gen.Body.String()) + } + if after := sftpSelfDo(t, alice, http.MethodGet, "/me/sftp", ""); strings.Contains(after.Body.String(), pw.Password) { + t.Fatalf("GET /me/sftp leaked the password") + } + + if rr := sftpSelfDo(t, alice, http.MethodPost, "/me/sftp/password", `{"length":5}`); rr.Code != http.StatusBadRequest || + sftpProblemID(t, rr) != "server.sftp.password_length_invalid" { + t.Fatalf("short password: status %d body %s", rr.Code, rr.Body.String()) + } + if rr := sftpSelfDo(t, alice, http.MethodDelete, "/me/sftp/password", ""); rr.Code != http.StatusNoContent { + t.Fatalf("revoke password: status %d", rr.Code) + } + if rr := sftpSelfDo(t, alice, http.MethodDelete, "/me/sftp/password", ""); rr.Code != http.StatusNotFound || + sftpProblemID(t, rr) != "server.sftp.password_not_found" { + t.Fatalf("revoke missing password: status %d body %s", rr.Code, rr.Body.String()) + } +} + +func TestSFTPSelfService_RefusesSFTPCaller(t *testing.T) { + env := newSFTPLoginEnv(t) + _, uid := env.seedUser(t, "x") + h := sftpSelfRouter(env.sessions, env.store, uid, true) + rr := sftpSelfDo(t, h, http.MethodGet, "/me/sftp", "") + if rr.Code != http.StatusForbidden || sftpProblemID(t, rr) != "server.forbidden" { + t.Fatalf("sftp caller on /me/sftp: status %d body %s", rr.Code, rr.Body.String()) + } +} diff --git a/api/internal/handlers/sftp_servers_write_test.go b/api/internal/handlers/sftp_servers_write_test.go new file mode 100644 index 000000000..b8d72fead --- /dev/null +++ b/api/internal/handlers/sftp_servers_write_test.go @@ -0,0 +1,52 @@ +package handlers + +import ( + "context" + "encoding/json" + "net/http" + "testing" + + "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" + + "github.com/GameplanePanel/gameplane/api/internal/auth" + "github.com/GameplanePanel/gameplane/api/internal/rbac" + "github.com/GameplanePanel/gameplane/api/internal/scope" +) + +// The SFTP server listing carries the file-access check's write decision per server: a namespace-wide +// servers:read user may write only the server they own. +func TestSFTPServersUnit_ListCarriesWrite(t *testing.T) { + fake := &sftpFakeServers{items: []unstructured.Unstructured{ + sftpFakeServer(scope.DefaultNamespace, "mine", 7), + sftpFakeServer(scope.DefaultNamespace, "theirs", 8), + }} + files := rbac.NewFileAccess(fake, fake) + user := &auth.User{ID: 7, Username: "seven", Role: "viewer", Perms: map[string]map[string]map[string]struct{}{ + scope.DefaultCluster: {scope.DefaultNamespace: {"servers:read": {}}}, + }} + caller := auth.SFTPCaller{Cluster: scope.DefaultCluster, SessionID: 3} + h := sftpServersRouter(files, func(ctx context.Context) context.Context { + return auth.WithUser(auth.WithSFTPCaller(ctx, caller), user) + }) + + rr := sftpUnitGet(t, h, "/sftp/v1/servers") + var out struct { + Items []sftpServerItem `json:"items"` + } + if err := json.Unmarshal(rr.Body.Bytes(), &out); err != nil || rr.Code != http.StatusOK { + t.Fatalf("status %d err %v body %s", rr.Code, err, rr.Body.String()) + } + got := map[string]bool{} + for _, it := range out.Items { + got[it.Server] = it.Write + } + if len(got) != 2 { + t.Fatalf("items = %+v, want both servers", out.Items) + } + if !got["mine"] { + t.Errorf("owned server: write = false, want true") + } + if got["theirs"] { + t.Errorf("read-only server: write = true, want false") + } +} diff --git a/api/internal/handlers/sftp_unit_test.go b/api/internal/handlers/sftp_unit_test.go new file mode 100644 index 000000000..f29a83daa --- /dev/null +++ b/api/internal/handlers/sftp_unit_test.go @@ -0,0 +1,462 @@ +package handlers + +import ( + "bytes" + "context" + "encoding/json" + "errors" + "net/http" + "net/http/httptest" + "strings" + "testing" + + "github.com/go-chi/chi/v5" + "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" + + "github.com/GameplanePanel/gameplane/api/internal/audit" + "github.com/GameplanePanel/gameplane/api/internal/auth" + "github.com/GameplanePanel/gameplane/api/internal/rbac" + "github.com/GameplanePanel/gameplane/api/internal/scope" +) + +var errSFTPUnitList = errors.New("sftp unit: list failed") + +// sftpUnitFailingLister fails every list call. +type sftpUnitFailingLister struct{ sftpFakeServers } + +func (*sftpUnitFailingLister) ListServers(context.Context, string, string) ([]unstructured.Unstructured, error) { + return nil, errSFTPUnitList +} + +// sftpUnitRawPost posts a raw body to the login-side router with the service token. +func sftpUnitRawPost(t *testing.T, env sftpLoginEnv, h http.Handler, path, body string) *httptest.ResponseRecorder { + t.Helper() + req := httptest.NewRequestWithContext(t.Context(), http.MethodPost, path, strings.NewReader(body)) + req.Header.Set("Authorization", "Bearer "+env.svcRaw) + req.Header.Set("Accept", "application/problem+json") + rr := httptest.NewRecorder() + h.ServeHTTP(rr, req) + return rr +} + +func TestSFTPLoginUnit_InvalidJSONAndMissingCaller(t *testing.T) { + env := newSFTPLoginEnv(t) + h := sftpLoginRouter(env) + for _, path := range []string{"/sftp/v1/login", "/sftp/v1/sessions/check"} { + rr := sftpUnitRawPost(t, env, h, path, "{not json") + if rr.Code != http.StatusBadRequest || sftpProblemID(t, rr) != "server.common.invalid_json" { + t.Fatalf("%s: status %d body %s", path, rr.Code, rr.Body.String()) + } + } + + // Handlers called without the service-auth middleware have no caller in the context. + lh := &sftpLoginHandler{sessions: env.sessions, store: env.store, files: env.files, aud: env.aud} + for name, fn := range map[string]http.HandlerFunc{"login": lh.login, "check": lh.check} { + req := httptest.NewRequestWithContext(t.Context(), http.MethodPost, "/x", strings.NewReader("{}")) + req.Header.Set("Accept", "application/problem+json") + rr := httptest.NewRecorder() + fn(rr, req) + if rr.Code != http.StatusUnauthorized || sftpProblemID(t, rr) != "server.common.unauthenticated" { + t.Fatalf("%s without caller: status %d body %s", name, rr.Code, rr.Body.String()) + } + } +} + +func TestSFTPLoginUnit_UnregisteredKeyAndTargetForms(t *testing.T) { + env := newSFTPLoginEnv(t) + h := sftpLoginRouter(env) + name, uid := env.seedUser(t, "x") + + // A well-formed key nobody registered is refused like every other failure. + rr := env.login(t, h, map[string]any{"username": name, "publicKey": sftpTestEd25519Line(t)}) + if rr.Code != http.StatusUnauthorized || sftpProblemID(t, rr) != "server.sftp.login_failed" { + t.Fatalf("unregistered key: status %d body %s", rr.Code, rr.Body.String()) + } + + // "namespace/server" targets resolve to that namespace; a namespace outside the allowed set fails. + env.fake.items = []unstructured.Unstructured{sftpFakeServer(scope.DefaultNamespace, "survival", uid)} + pw, err := env.sessions.GenerateAndStoreSFTPPassword(t.Context(), uid, 24) + if err != nil { + t.Fatalf("password: %v", err) + } + rr = env.login(t, h, map[string]any{"username": name + "+" + scope.DefaultNamespace + "/survival", "password": pw}) + if rr.Code != http.StatusOK { + t.Fatalf("namespaced target login: status %d body %s", rr.Code, rr.Body.String()) + } + var resp sftpLoginResp + if err := json.Unmarshal(rr.Body.Bytes(), &resp); err != nil { + t.Fatalf("decode: %v", err) + } + if resp.Target == nil || resp.Target.Server != "survival" || resp.Target.Namespace != scope.DefaultNamespace { + t.Fatalf("target = %+v", resp.Target) + } + rr = env.login(t, h, map[string]any{"username": name + "+not-allowed-ns-zz/survival", "password": pw}) + if rr.Code != http.StatusUnauthorized { + t.Fatalf("disallowed namespace: status %d", rr.Code) + } +} + +func TestSFTPLoginUnit_AuditFailureRefusesAndRevokes(t *testing.T) { + env := newSFTPLoginEnv(t) + name, uid := env.seedUser(t, "x") + pw, err := env.sessions.GenerateAndStoreSFTPPassword(t.Context(), uid, 24) + if err != nil { + t.Fatalf("password: %v", err) + } + + // The audit trail lives in a store that is already closed, so no row can land. + deadStore := newTestStore(t) + if err := deadStore.Close(); err != nil { + t.Fatalf("close store: %v", err) + } + env.aud = audit.New(deadStore) + h := sftpLoginRouter(env) + + rr := env.login(t, h, map[string]any{"username": name, "password": pw}) + if rr.Code != http.StatusServiceUnavailable { + t.Fatalf("unaudited success: status %d body %s", rr.Code, rr.Body.String()) + } + var live int + if err := env.store.DB.QueryRowContext(t.Context(), + `SELECT COUNT(*) FROM sftp_sessions WHERE user_id = ? AND revoked_at IS NULL`, uid).Scan(&live); err != nil { + t.Fatalf("count sessions: %v", err) + } + if live != 0 { + t.Fatalf("%d live sessions left after an unaudited login", live) + } + + // A failed login whose audit row cannot be written is still refused with the usual answer. + rr = env.login(t, h, map[string]any{"username": name, "password": "wrong"}) + if rr.Code != http.StatusUnauthorized || sftpProblemID(t, rr) != "server.sftp.login_failed" { + t.Fatalf("unaudited failure: status %d body %s", rr.Code, rr.Body.String()) + } +} + +func TestSFTPLoginUnit_CheckStoreFailure(t *testing.T) { + env := newSFTPLoginEnv(t) + deadStore := newTestStore(t) + deadSessions := auth.NewSessionStore(deadStore) + if err := deadStore.Close(); err != nil { + t.Fatalf("close store: %v", err) + } + h := &sftpLoginHandler{sessions: deadSessions, store: deadStore, files: env.files, aud: env.aud} + body, err := json.Marshal(map[string]any{"sessionTokens": []string{auth.SFTPSessionTokenPrefix + "abc", "plain", auth.SFTPSessionTokenPrefix + "abc"}}) + if err != nil { + t.Fatalf("marshal: %v", err) + } + req := httptest.NewRequestWithContext(auth.WithSFTPCaller(t.Context(), auth.SFTPCaller{Cluster: scope.DefaultCluster}), + http.MethodPost, "/sftp/v1/sessions/check", bytes.NewReader(body)) + req.Header.Set("Accept", "application/problem+json") + rr := httptest.NewRecorder() + h.check(rr, req) + if rr.Code != http.StatusServiceUnavailable { + t.Fatalf("check on a dead store: status %d body %s", rr.Code, rr.Body.String()) + } +} + +func TestSFTPLoginUnit_CheckDeduplicatesAndReportsPlainTokens(t *testing.T) { + env := newSFTPLoginEnv(t) + h := sftpLoginRouter(env) + dup := auth.SFTPSessionTokenPrefix + "dup" + raw, err := json.Marshal(map[string]any{"sessionTokens": []string{"not-a-session-token", dup, dup}}) + if err != nil { + t.Fatalf("marshal: %v", err) + } + rr := sftpUnitRawPost(t, env, h, "/sftp/v1/sessions/check", string(raw)) + var out struct { + Revoked []string `json:"revoked"` + } + if err := json.Unmarshal(rr.Body.Bytes(), &out); err != nil || rr.Code != http.StatusOK { + t.Fatalf("status %d err %v body %s", rr.Code, err, rr.Body.String()) + } + if len(out.Revoked) != 2 || out.Revoked[0] != "not-a-session-token" || out.Revoked[1] != dup { + t.Fatalf("revoked = %v", out.Revoked) + } +} + +// sftpServersRouter serves GET /sftp/v1/servers with the given context decoration. +func sftpServersRouter(files *rbac.FileChecker, decorate func(context.Context) context.Context) http.Handler { + r := chi.NewRouter() + r.Use(func(next http.Handler) http.Handler { + return http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) { + next.ServeHTTP(w, req.WithContext(decorate(req.Context()))) + }) + }) + MountSFTPServers(r, files) + return r +} + +func sftpUnitGet(t *testing.T, h http.Handler, path string) *httptest.ResponseRecorder { + t.Helper() + req := httptest.NewRequestWithContext(t.Context(), http.MethodGet, path, nil) + req.Header.Set("Accept", "application/problem+json") + rr := httptest.NewRecorder() + h.ServeHTTP(rr, req) + return rr +} + +func TestSFTPServersUnit_List(t *testing.T) { + fake := &sftpFakeServers{items: []unstructured.Unstructured{ + sftpFakeServer(scope.DefaultNamespace, "mine", 7), + sftpFakeServer(scope.DefaultNamespace, "theirs", 8), + }} + files := rbac.NewFileAccess(fake, fake) + user := &auth.User{ID: 7, Username: "seven", Role: "viewer"} + caller := auth.SFTPCaller{Cluster: scope.DefaultCluster, SessionID: 3} + + ok := sftpServersRouter(files, func(ctx context.Context) context.Context { + return auth.WithUser(auth.WithSFTPCaller(ctx, caller), user) + }) + rr := sftpUnitGet(t, ok, "/sftp/v1/servers") + var out struct { + Items []sftpServerItem `json:"items"` + } + if err := json.Unmarshal(rr.Body.Bytes(), &out); err != nil || rr.Code != http.StatusOK { + t.Fatalf("status %d err %v body %s", rr.Code, err, rr.Body.String()) + } + if len(out.Items) != 1 || out.Items[0].Server != "mine" || out.Items[0].Namespace != scope.DefaultNamespace { + t.Fatalf("items = %+v, want only the owned server", out.Items) + } + + cases := map[string]struct { + files *rbac.FileChecker + deco func(context.Context) context.Context + status int + id string + }{ + "no caller": {files, func(ctx context.Context) context.Context { return auth.WithUser(ctx, user) }, + http.StatusForbidden, "server.forbidden"}, + "service token caller": {files, func(ctx context.Context) context.Context { + return auth.WithUser(auth.WithSFTPCaller(ctx, auth.SFTPCaller{Cluster: scope.DefaultCluster}), user) + }, http.StatusForbidden, "server.forbidden"}, + "no user": {files, func(ctx context.Context) context.Context { return auth.WithSFTPCaller(ctx, caller) }, + http.StatusUnauthorized, "server.common.unauthenticated"}, + "unknown cluster": {rbac.NewFileAccess(nil, nil), func(ctx context.Context) context.Context { + return auth.WithUser(auth.WithSFTPCaller(ctx, caller), user) + }, http.StatusBadRequest, ""}, + "list failure": {rbac.NewFileAccess(fake, &sftpUnitFailingLister{}), func(ctx context.Context) context.Context { + return auth.WithUser(auth.WithSFTPCaller(ctx, caller), user) + }, http.StatusInternalServerError, ""}, + } + for name, tc := range cases { + rr := sftpUnitGet(t, sftpServersRouter(tc.files, tc.deco), "/sftp/v1/servers") + if rr.Code != tc.status { + t.Errorf("%s: status %d, want %d (body %s)", name, rr.Code, tc.status, rr.Body.String()) + } + if tc.id != "" && sftpProblemID(t, rr) != tc.id { + t.Errorf("%s: messageId %q, want %q", name, sftpProblemID(t, rr), tc.id) + } + } +} + +func TestSFTPUnit_WriteSFTPErrMapsEveryError(t *testing.T) { + cases := []struct { + err error + status int + id string + }{ + {auth.ErrSFTPKeyInvalid, http.StatusBadRequest, "server.sftp.key_invalid"}, + {auth.ErrSFTPKeyType, http.StatusBadRequest, "server.sftp.key_type_unsupported"}, + {auth.ErrSFTPKeyWeak, http.StatusBadRequest, "server.sftp.key_weak"}, + {auth.ErrSFTPKeyName, http.StatusBadRequest, "server.sftp.key_name_invalid"}, + {auth.ErrSFTPKeyNameInUse, http.StatusConflict, "server.sftp.key_name_in_use"}, + {auth.ErrSFTPKeyDuplicate, http.StatusConflict, "server.sftp.key_duplicate"}, + {auth.ErrSFTPKeyLimit, 0, "server.sftp.key_limit_reached"}, + {auth.ErrSFTPNotFound, http.StatusNotFound, "server.sftp.key_not_found"}, + {auth.ErrSFTPPasswordLen, http.StatusBadRequest, "server.sftp.password_length_invalid"}, + {errSFTPUnitList, http.StatusInternalServerError, ""}, + } + for _, tc := range cases { + req := httptest.NewRequestWithContext(t.Context(), http.MethodGet, "/x", nil) + req.Header.Set("Accept", "application/problem+json") + rr := httptest.NewRecorder() + writeSFTPErr(rr, req, tc.err) + if tc.status != 0 && rr.Code != tc.status { + t.Errorf("%v: status %d, want %d", tc.err, rr.Code, tc.status) + } + if rr.Code < 400 { + t.Errorf("%v: status %d is not an error", tc.err, rr.Code) + } + if got := sftpProblemID(t, rr); tc.id != "" && got != tc.id { + t.Errorf("%v: messageId %q, want %q", tc.err, got, tc.id) + } + } +} + +func TestSFTPSelfUnit_EndpointAndKeyLifecycle(t *testing.T) { + env := newSFTPLoginEnv(t) + _, uid := env.seedUser(t, "x") + h := sftpSelfRouter(env.sessions, env.store, uid, false) + + SetSFTPEndpointSource(func(context.Context, string) (SFTPEndpoint, bool) { + return SFTPEndpoint{Address: "sftp.example.test", Port: 2222, HostKeyFingerprint: "SHA256:abc"}, true + }) + t.Cleanup(func() { SetSFTPEndpointSource(nil) }) + + line := sftpTestEd25519Line(t) + keyBody, err := json.Marshal(map[string]string{"name": "desk", "publicKey": line}) + if err != nil { + t.Fatalf("marshal: %v", err) + } + rr := sftpSelfDo(t, h, http.MethodPost, "/me/sftp/keys", string(keyBody)) + if rr.Code != http.StatusCreated { + t.Fatalf("add key: status %d body %s", rr.Code, rr.Body.String()) + } + var key struct { + ID int64 `json:"id"` + } + if err := json.Unmarshal(rr.Body.Bytes(), &key); err != nil || key.ID == 0 { + t.Fatalf("key body: %v %s", err, rr.Body.String()) + } + if rr := sftpSelfDo(t, h, http.MethodPost, "/me/sftp/password", `{"length":24}`); rr.Code != http.StatusOK { + t.Fatalf("password: status %d", rr.Code) + } + + rr = sftpSelfDo(t, h, http.MethodGet, "/me/sftp", "") + var self struct { + Username string `json:"username"` + Endpoint *SFTPEndpoint `json:"endpoint"` + Keys []auth.SFTPKey `json:"keys"` + Password json.RawMessage `json:"password"` + } + if err := json.Unmarshal(rr.Body.Bytes(), &self); err != nil || rr.Code != http.StatusOK { + t.Fatalf("get self: status %d err %v body %s", rr.Code, err, rr.Body.String()) + } + if self.Username != "caller" || self.Endpoint == nil || self.Endpoint.Port != 2222 || len(self.Keys) != 1 || + string(self.Password) == "null" { + t.Fatalf("self = %+v (password %s)", self, self.Password) + } + + // An endpoint source that reports nothing leaves the endpoint null. + SetSFTPEndpointSource(func(context.Context, string) (SFTPEndpoint, bool) { return SFTPEndpoint{}, false }) + if rr := sftpSelfDo(t, h, http.MethodGet, "/me/sftp", ""); !strings.Contains(rr.Body.String(), `"endpoint":null`) { + t.Fatalf("unconfigured endpoint: %s", rr.Body.String()) + } + + if rr := sftpSelfDo(t, h, http.MethodDelete, "/me/sftp/keys/abc", ""); rr.Code != http.StatusBadRequest { + t.Fatalf("bad key id: status %d", rr.Code) + } + if rr := sftpSelfDo(t, h, http.MethodDelete, "/me/sftp/keys/987654321", ""); rr.Code != http.StatusNotFound || + sftpProblemID(t, rr) != "server.sftp.key_not_found" { + t.Fatalf("missing key: status %d body %s", rr.Code, rr.Body.String()) + } + if rr := sftpSelfDo(t, h, http.MethodDelete, "/me/sftp/keys/"+jsonInt(key.ID), ""); rr.Code != http.StatusNoContent { + t.Fatalf("delete key: status %d body %s", rr.Code, rr.Body.String()) + } +} + +func jsonInt(n int64) string { + b, err := json.Marshal(n) + if err != nil { + return "0" + } + return string(b) +} + +func TestSFTPSelfUnit_InvalidBodiesAndAnonymousCallers(t *testing.T) { + env := newSFTPLoginEnv(t) + _, uid := env.seedUser(t, "x") + h := sftpSelfRouter(env.sessions, env.store, uid, false) + + if rr := sftpSelfDo(t, h, http.MethodPost, "/me/sftp/keys", "{bad"); rr.Code != http.StatusBadRequest || + sftpProblemID(t, rr) != "server.common.invalid_json" { + t.Fatalf("bad key body: status %d body %s", rr.Code, rr.Body.String()) + } + if rr := sftpSelfDo(t, h, http.MethodPost, "/me/sftp/password", "{bad"); rr.Code != http.StatusBadRequest || + sftpProblemID(t, rr) != "server.common.invalid_json" { + t.Fatalf("bad password body: status %d body %s", rr.Code, rr.Body.String()) + } + // An empty body is accepted by the decoder and then refused for its zero length. + if rr := sftpSelfDo(t, h, http.MethodPost, "/me/sftp/password", ""); rr.Code != http.StatusBadRequest || + sftpProblemID(t, rr) != "server.sftp.password_length_invalid" { + t.Fatalf("empty password body: status %d body %s", rr.Code, rr.Body.String()) + } + + // With no user in the context every route answers 401. + anon := chi.NewRouter() + mountSFTPRoutes(anon, env.sessions, env.store) + for _, rt := range []struct{ method, path string }{ + {http.MethodGet, "/me/sftp"}, + {http.MethodPost, "/me/sftp/keys"}, + {http.MethodDelete, "/me/sftp/keys/1"}, + {http.MethodPost, "/me/sftp/password"}, + {http.MethodDelete, "/me/sftp/password"}, + } { + rr := sftpSelfDo(t, anon, rt.method, rt.path, "") + if rr.Code != http.StatusUnauthorized || sftpProblemID(t, rr) != "server.common.unauthenticated" { + t.Errorf("%s %s anonymous: status %d body %s", rt.method, rt.path, rr.Code, rr.Body.String()) + } + } + + // Every route refuses an SFTP-session caller. + blocked := sftpSelfRouter(env.sessions, env.store, uid, true) + for _, rt := range []struct{ method, path string }{ + {http.MethodPost, "/me/sftp/keys"}, + {http.MethodDelete, "/me/sftp/keys/1"}, + {http.MethodPost, "/me/sftp/password"}, + {http.MethodDelete, "/me/sftp/password"}, + } { + if rr := sftpSelfDo(t, blocked, rt.method, rt.path, ""); rr.Code != http.StatusForbidden { + t.Errorf("%s %s as sftp caller: status %d", rt.method, rt.path, rr.Code) + } + } +} + +func TestSFTPSelfUnit_StoreFailuresAreServerErrors(t *testing.T) { + deadStore := newTestStore(t) + sessions := auth.NewSessionStore(deadStore) + if err := deadStore.Close(); err != nil { + t.Fatalf("close store: %v", err) + } + h := sftpSelfRouter(sessions, deadStore, 1, false) + for _, rt := range []struct{ method, path string }{ + {http.MethodGet, "/me/sftp"}, + {http.MethodDelete, "/me/sftp/password"}, + {http.MethodDelete, "/me/sftp/keys/5"}, + } { + if rr := sftpSelfDo(t, h, rt.method, rt.path, ""); rr.Code < 500 { + t.Errorf("%s %s on a dead store: status %d, want 5xx", rt.method, rt.path, rr.Code) + } + } +} + +func TestSFTPHelpersUnit(t *testing.T) { + base, target, has := splitSFTPUsername("alice+ns/srv+extra") + if base != "alice+ns/srv" || target != "extra" || !has { + t.Fatalf("split = %q %q %v", base, target, has) + } + if base, _, has := splitSFTPUsername("alice"); base != "alice" || has { + t.Fatalf("split without target = %q %v", base, has) + } + if got, ok := parseSFTPTarget("srv"); !ok || got.Namespace != scope.DefaultNamespace || got.Server != "srv" { + t.Fatalf("parse bare target = %+v %v", got, ok) + } + if _, ok := parseSFTPTarget("Bad_Name"); ok { + t.Fatal("parse accepted an invalid server name") + } + if got := truncateRunes("héllo", 2); got != "hé" { + t.Fatalf("truncateRunes = %q", got) + } + if got := truncateRunes("abc", 5); got != "abc" { + t.Fatalf("truncateRunes short = %q", got) + } + + req := httptest.NewRequestWithContext(t.Context(), http.MethodPost, "/x", nil) + req.RemoteAddr = "192.0.2.9:5555" + cases := []struct{ remote, want string }{ + {"203.0.113.4:2222", "203.0.113.4"}, + {"203.0.113.5", "203.0.113.5"}, + {"[2001:db8::1]:22", "2001:db8::1"}, + {"garbage", "192.0.2.9"}, + {"", "192.0.2.9"}, + } + for _, tc := range cases { + if got := sftpSourceKey(tc.remote, req); got != tc.want { + t.Errorf("sftpSourceKey(%q) = %q, want %q", tc.remote, got, tc.want) + } + } + req.RemoteAddr = "no-port-here" + if got := sftpSourceKey("", req); got != "no-port-here" { + t.Errorf("sftpSourceKey without a port = %q", got) + } +} diff --git a/api/internal/handlers/users.go b/api/internal/handlers/users.go index 178c6c92d..b75447b57 100644 --- a/api/internal/handlers/users.go +++ b/api/internal/handlers/users.go @@ -49,6 +49,8 @@ func MountUsers(r chi.Router, store *db.Store, sessions *auth.SessionStore, clus r.Delete("/{id}/bindings/{role}/{namespace}", h.deleteBinding) // Personal MCP tokens: /me/* for the caller, /{id}/* for admins. mountMCPTokenRoutes(r, sessions) + // Personal SFTP credentials (spec 040): /me/sftp/* for the caller only. + mountSFTPRoutes(r, sessions, store) }) } diff --git a/api/internal/httperr/httperr.go b/api/internal/httperr/httperr.go index 106f6db28..30e5d51e6 100644 --- a/api/internal/httperr/httperr.go +++ b/api/internal/httperr/httperr.go @@ -62,8 +62,17 @@ const ( IDEmptyBody = "server.empty_body" // "empty body" IDInternal = "server.internal" // "internal error" IDRemoteClusterNotImplemented = "server.remote_cluster_not_implemented" // RemoteClusterNotImplemented + // IDFilesStarting is the 503 a stopped server's file route answers while its file-only pod + // starts (spec 040, ws/ensure_files.go). Its text is fixed and safe to show. + IDFilesStarting = "server.files.starting" // "files are starting, try again in a moment" ) +// keepsIDOn5xx reports whether a 5xx message keeps its own id and text. Every other 5xx +// is masked to the generic sentence so internal detail never reaches the client. +func keepsIDOn5xx(id string) bool { + return id == IDRemoteClusterNotImplemented || id == IDFilesStarting +} + // GenericID is the id of the generic sentence registered for an HTTP // status, shown before the detail text in the dashboard. func GenericID(status int) string { @@ -85,6 +94,7 @@ func KnownIDs() []string { IDEmptyBody, IDInternal, IDRemoteClusterNotImplemented, + IDFilesStarting, } } @@ -219,7 +229,7 @@ func WriteCode(w http.ResponseWriter, req *http.Request, status int, err error) // WriteMessage writes a localizable Message. The English text is the // plain-text body, and a problem-document caller also gets m.ID and m.Args. // A nil message or a status of 0 becomes 500. For a status >=500 the body is -// the generic http.StatusText, except for IDRemoteClusterNotImplemented, +// the generic http.StatusText, except for IDRemoteClusterNotImplemented and IDFilesStarting, // whose fixed text is safe to show. func WriteMessage(w http.ResponseWriter, r *http.Request, m *Message) { if m == nil { @@ -230,7 +240,7 @@ func WriteMessage(w http.ResponseWriter, r *http.Request, m *Message) { status = http.StatusInternalServerError } text, id, args := m.English, m.ID, m.Args - if status >= 500 && m.ID != IDRemoteClusterNotImplemented { + if status >= 500 && !keepsIDOn5xx(m.ID) { text = http.StatusText(status) id = GenericID(status) args = nil @@ -263,7 +273,7 @@ func classify(err error) (int, string, string, map[string]any) { if m.Status == 0 { return http.StatusInternalServerError, "internal error", IDInternal, nil } - if m.Status >= 500 && m.ID != IDRemoteClusterNotImplemented { + if m.Status >= 500 && !keepsIDOn5xx(m.ID) { // Same masking as WriteCode and WriteMessage: a 5xx never // echoes the message text or its arguments. return m.Status, http.StatusText(m.Status), GenericID(m.Status), nil diff --git a/api/internal/kube/registry.go b/api/internal/kube/registry.go index 4fcf4a1cf..7334e33a8 100644 --- a/api/internal/kube/registry.go +++ b/api/internal/kube/registry.go @@ -6,6 +6,7 @@ import ( "sort" "sync" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" "k8s.io/apimachinery/pkg/types" ) @@ -270,3 +271,16 @@ func (r *Registry) GetServer(ctx context.Context, cluster, ns, name string) (*un } return c.GetServer(ctx, ns, name) } + +// ListServers lists the GameServers of ns on the named cluster (rbac.ServerLister). +func (r *Registry) ListServers(ctx context.Context, cluster, ns string) ([]unstructured.Unstructured, error) { + c, ok := r.Get(cluster) + if !ok { + return nil, fmt.Errorf("cluster %q not registered", cluster) + } + list, err := c.Dynamic.Resource(GVRs["servers"]).Namespace(ns).List(ctx, metav1.ListOptions{}) + if err != nil { + return nil, fmt.Errorf("list servers: %w", err) + } + return list.Items, nil +} diff --git a/api/internal/kube/registry_list_servers_test.go b/api/internal/kube/registry_list_servers_test.go new file mode 100644 index 000000000..88fdde535 --- /dev/null +++ b/api/internal/kube/registry_list_servers_test.go @@ -0,0 +1,72 @@ +package kube + +import ( + "errors" + "testing" + + "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" + "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/runtime/schema" + dynamicfake "k8s.io/client-go/dynamic/fake" + k8stesting "k8s.io/client-go/testing" +) + +func listServersFake(objs ...runtime.Object) *dynamicfake.FakeDynamicClient { + return dynamicfake.NewSimpleDynamicClientWithCustomListKinds(runtime.NewScheme(), map[schema.GroupVersionResource]string{ + GVRs["servers"]: "GameServerList", + }, objs...) +} + +func listServersObj(ns, name string) *unstructured.Unstructured { + return &unstructured.Unstructured{Object: map[string]any{ + "apiVersion": "gameplane.local/v1alpha1", + "kind": "GameServer", + "metadata": map[string]any{"name": name, "namespace": ns}, + }} +} + +func TestRegistryListServers_UnregisteredCluster(t *testing.T) { + r := NewRegistry("local") + if _, err := r.ListServers(t.Context(), "ghost", "gameplane-games"); err == nil { + t.Fatal("ListServers on an unregistered cluster returned nil error") + } +} + +func TestRegistryListServers_ListsOnlyTheNamespace(t *testing.T) { + dyn := listServersFake( + listServersObj("gameplane-games", "alpha"), + listServersObj("gameplane-games", "beta"), + listServersObj("other", "gamma"), + ) + r := NewRegistry("local") + r.Set("local", &Client{Dynamic: dyn}) + + items, err := r.ListServers(t.Context(), "local", "gameplane-games") + if err != nil { + t.Fatalf("ListServers: %v", err) + } + if len(items) != 2 { + t.Fatalf("ListServers returned %d items, want 2", len(items)) + } + got := map[string]bool{} + for i := range items { + got[items[i].GetName()] = true + } + if !got["alpha"] || !got["beta"] || got["gamma"] { + t.Fatalf("items = %v, want alpha and beta only", got) + } +} + +func TestRegistryListServers_ListErrorIsWrapped(t *testing.T) { + boom := errors.New("apiserver down") + dyn := listServersFake() + dyn.PrependReactor("list", "*", func(k8stesting.Action) (bool, runtime.Object, error) { + return true, nil, boom + }) + r := NewRegistry("local") + r.Set("local", &Client{Dynamic: dyn}) + + if _, err := r.ListServers(t.Context(), "local", "gameplane-games"); !errors.Is(err, boom) { + t.Fatalf("ListServers err = %v, want it to wrap the list error", err) + } +} diff --git a/api/internal/messages/messages.go b/api/internal/messages/messages.go index 2b47d5d74..a27addb9f 100644 --- a/api/internal/messages/messages.go +++ b/api/internal/messages/messages.go @@ -66,6 +66,102 @@ var entries = []Entry{ Description: "API error when a personal MCP token to revoke does not exist, is already revoked, or belongs to another user (mcp_tokens.go:writeMCPTokenErr).", Status: http.StatusNotFound, }, + { + ID: "server.sftp.login_failed", + English: "sftp login failed", + Description: "API error from the SFTP login (sftp_login.go:login) for every refusal cause; the body is identical whatever failed.", + Status: http.StatusUnauthorized, + }, + { + ID: "server.sftp.key_invalid", + English: "not a valid SSH public key", + Description: "API error when an SFTP public key cannot be parsed as one authorized_keys line (sftp.go:writeSFTPErr).", + Status: http.StatusBadRequest, + }, + { + ID: "server.sftp.key_type_unsupported", + English: "unsupported key type; use ed25519, ecdsa or RSA 3072 bits or more", + Description: "API error when an SFTP public key uses an unsupported algorithm (sftp.go:writeSFTPErr).", + Status: http.StatusBadRequest, + }, + { + ID: "server.sftp.key_weak", + English: "RSA keys must be at least 3072 bits", + Description: "API error when an SFTP RSA public key is shorter than 3072 bits (sftp.go:writeSFTPErr).", + Status: http.StatusBadRequest, + }, + { + ID: "server.sftp.key_name_invalid", + English: "name must be 1 to 64 characters", + Description: "API error when an SFTP key name is empty or longer than 64 characters (sftp.go:writeSFTPErr).", + Status: http.StatusBadRequest, + }, + { + ID: "server.sftp.key_name_in_use", + English: "a key with this name already exists", + Description: "API error when the user already has an SFTP key with the same name (sftp.go:writeSFTPErr).", + Status: http.StatusConflict, + }, + { + ID: "server.sftp.key_duplicate", + English: "this key is already registered", + Description: "API error when an SFTP public key is already registered. It never says to whom (sftp.go:writeSFTPErr).", + Status: http.StatusConflict, + }, + { + ID: "server.sftp.key_limit_reached", + English: "you already have 20 SFTP keys; remove one before adding another", + Description: "API error when a user already holds the maximum of 20 SFTP keys (sftp.go:writeSFTPErr).", + Status: http.StatusConflict, + }, + { + ID: "server.sftp.key_not_found", + English: "SFTP key not found", + Description: "API error when an SFTP key to delete does not exist or belongs to another user (sftp.go:writeSFTPErr).", + Status: http.StatusNotFound, + }, + { + ID: "server.sftp.password_length_invalid", + English: "length must be 20 to 40", + Description: "API error when a generated SFTP password length is outside 20 to 40 (sftp.go:writeSFTPErr).", + Status: http.StatusBadRequest, + }, + { + ID: "server.sftp.password_not_found", + English: "no SFTP password is set", + Description: "API error when the user revokes an SFTP password that is not set (sftp.go:revokePassword).", + Status: http.StatusNotFound, + }, + { + ID: "server.sftp.token_limit_reached", + English: "this cluster already has 2 active SFTP tokens; revoke one before creating another", + Description: "API error when a cluster already holds the maximum of 2 active SFTP service tokens (sftp_cluster.go:createToken).", + Status: http.StatusConflict, + }, + { + ID: "server.sftp.token_not_found", + English: "SFTP token not found", + Description: "API error when an SFTP service token to revoke does not exist, is already revoked, or belongs to another cluster (sftp_cluster.go:revokeToken).", + Status: http.StatusNotFound, + }, + { + ID: "server.sftp.endpoint_invalid", + English: "address must be a host or host:port", + Description: "API error when the SFTP endpoint address of a remote cluster is not a host or host:port (sftp_cluster.go:putEndpoint).", + Status: http.StatusBadRequest, + }, + { + ID: "server.sftp.fingerprint_invalid", + English: "host key fingerprint must be a SHA256 fingerprint", + Description: "API error when the SFTP host key fingerprint of a remote cluster is not an OpenSSH SHA256 fingerprint (sftp_cluster.go:putEndpoint).", + Status: http.StatusBadRequest, + }, + { + ID: "server.sftp.endpoint_local", + English: "this cluster's SFTP endpoint is set in the chart values", + Description: "API error when an admin tries to set the SFTP endpoint of the panel's own cluster through the API (sftp_cluster.go:putEndpoint).", + Status: http.StatusBadRequest, + }, { ID: httperr.IDNamespaceForbidden, English: "namespace not permitted", @@ -234,6 +330,12 @@ var entries = []Entry{ Description: "Shown when an admin picks an instance default language that is not offered (missing or below the completeness threshold). language = the tag.", Status: http.StatusBadRequest, }, + { + ID: "server.files.starting", + English: "files are starting, try again in a moment", + Description: "API error when a stopped or asleep server's file-only pod is not ready within 60 s (ws/ensure_files.go:ensureFiles); retry after a short wait.", + Status: http.StatusServiceUnavailable, + }, } // parsedEntry is a registry entry with its English text parsed once. diff --git a/api/internal/rbac/fileaccess.go b/api/internal/rbac/fileaccess.go new file mode 100644 index 000000000..9bbdad42f --- /dev/null +++ b/api/internal/rbac/fileaccess.go @@ -0,0 +1,248 @@ +package rbac + +import ( + "context" + "errors" + "fmt" + "net/http" + "regexp" + "sort" + + "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" + + "github.com/GameplanePanel/gameplane/api/internal/auth" + "github.com/GameplanePanel/gameplane/api/internal/scope" +) + +// FileAccess is the single authorization surface for GameServer file operations (spec 040). +// The dashboard file routes, the SFTP endpoint's session routes and the SFTP server listing all +// go through it, so the rules for "may this user do X to these files" live in one place. +// +// The permission keys used by file routes are defined only here (filePermRead, filePermWrite). +// Spec 039 may replace the rules behind this interface without changing its callers. + +// FileAction names one file operation. +type FileAction string + +// File actions. Each maps to read-class or write-class authorization, see filePermission. +const ( + FileList FileAction = "list" + FileStat FileAction = "stat" + FileRead FileAction = "read" + FileDownload FileAction = "download" + FileCreate FileAction = "create" + FileWrite FileAction = "write" + FileUpload FileAction = "upload" + FileRename FileAction = "rename" + FileMkdir FileAction = "mkdir" + FileDelete FileAction = "delete" +) + +// FileTarget identifies the server and the paths an action touches. Paths is empty for +// route-level checks; FileRename requires two paths (from, to) when the handler checks its body. +type FileTarget struct { + Cluster string + Namespace string + Server string + Paths []string +} + +// ServerRef names one GameServer. +type ServerRef struct { + Cluster string + Namespace string + Name string +} + +// FileAccess decides which servers a user may see and which file operations they may perform. +type FileAccess interface { + // VisibleServers lists the servers on cluster the user may see: every server in a namespace + // the user can read, plus servers they own or collaborate on. + VisibleServers(ctx context.Context, user *auth.User, cluster string) ([]ServerRef, error) + // Allow returns ErrFileAccessDenied unless user may perform action on target. + Allow(ctx context.Context, user *auth.User, action FileAction, target FileTarget) error + // FilterEntries returns the directory entries of target the user may see. + FilterEntries(ctx context.Context, user *auth.User, target FileTarget, names []string) ([]string, error) +} + +// ErrFileAccessDenied is returned when a file operation is not permitted. +var ErrFileAccessDenied = errors.New("file access denied") + +// ServerLister lists GameServers of one namespace on one cluster. *kube.Registry implements it. +type ServerLister interface { + ListServers(ctx context.Context, cluster, ns string) ([]unstructured.Unstructured, error) +} + +// Permission keys for file operations. These are the only place they appear for file routes. +const ( + filePermRead = "servers:read" + filePermWrite = "servers:write" +) + +// FileChecker is the current FileAccess implementation: the namespace permission first, then the +// owner/collaborator grant on the exact server. +type FileChecker struct { + fetch ServerFetcher + list ServerLister +} + +// NewFileAccess returns the FileAccess used by the API. fetch resolves servers for the owner and +// collaborator fallback; list enumerates servers for VisibleServers. Either may be nil, which +// disables the feature that needs it. +func NewFileAccess(fetch ServerFetcher, list ServerLister) *FileChecker { + return &FileChecker{fetch: fetch, list: list} +} + +// filePermission maps an action to the permission it needs. Read-class actions need servers:read, +// everything that changes files needs servers:write (the same split the rule table made for GET +// and non-GET requests under /servers). +func filePermission(action FileAction) (string, bool) { + switch action { + case FileList, FileStat, FileRead, FileDownload: + return filePermRead, true + case FileCreate, FileWrite, FileUpload, FileRename, FileMkdir, FileDelete: + return filePermWrite, true + } + return "", false +} + +// Allow returns ErrFileAccessDenied unless user may perform action on target. +func (c *FileChecker) Allow(ctx context.Context, user *auth.User, action FileAction, target FileTarget) error { + _, err := c.AllowBound(ctx, user, action, target) + return err +} + +// AllowBound is Allow that also returns the context carrying the bound owner/collaborator grant +// (bindServerGrant), which the proxy and the stream revalidation need. When the grant comes from +// the namespace permission, the returned context is the input context. +func (c *FileChecker) AllowBound(ctx context.Context, user *auth.User, action FileAction, target FileTarget) (context.Context, error) { + if user == nil { + return ctx, ErrFileAccessDenied + } + if action == FileRename { + // The route-level check (no paths yet) gates on write-class access; the rename handler + // passes [from, to] and checks delete on from and write on to. + if len(target.Paths) == 0 { + return c.allowOne(ctx, user, filePermWrite, target) + } + if len(target.Paths) != 2 { + return ctx, ErrFileAccessDenied + } + // Delete on from, then write on to. Both are write-class today; spec 039 may split them. + bound, err := c.allowOne(ctx, user, filePermWrite, target) + if err != nil { + return ctx, err + } + return c.allowOne(bound, user, filePermWrite, target) + } + perm, ok := filePermission(action) + if !ok { + return ctx, ErrFileAccessDenied + } + return c.allowOne(ctx, user, perm, target) +} + +// allowOne checks one permission on target, then the owner/collaborator fallback. +func (c *FileChecker) allowOne(ctx context.Context, user *auth.User, perm string, target FileTarget) (context.Context, error) { + if user.Can(perm, true, target.Cluster, target.Namespace) { + return ctx, nil + } + if c.fetch != nil { + if bound, ok := bindServerGrant(ctx, c.fetch, target.Cluster, target.Namespace, target.Server, user.ID, false); ok { + return bound, nil + } + } + return ctx, ErrFileAccessDenied +} + +// FilterEntries returns names unchanged (directory listings are not filtered per entry today). It +// still fails when the user may not list the target. +func (c *FileChecker) FilterEntries(ctx context.Context, user *auth.User, target FileTarget, names []string) ([]string, error) { + if err := c.Allow(ctx, user, FileList, target); err != nil { + return nil, err + } + return names, nil +} + +// VisibleServers lists the servers on cluster the user may see, sorted by namespace then name. +func (c *FileChecker) VisibleServers(ctx context.Context, user *auth.User, cluster string) ([]ServerRef, error) { + if user == nil { + return nil, ErrFileAccessDenied + } + if c.fetch == nil || !containsID(c.fetch.IDs(), cluster) { + return nil, scope.ErrForbiddenCluster + } + if c.list == nil { + return nil, errors.New("file access: server lister not configured") + } + var out []ServerRef + for _, ns := range scope.AllowedNamespaces { + items, err := c.list.ListServers(ctx, cluster, ns) + if err != nil { + return nil, fmt.Errorf("list servers in %s: %w", ns, err) + } + readAll := user.Can(filePermRead, true, cluster, ns) + for i := range items { + obj := &items[i] + if obj.GetDeletionTimestamp() != nil { + continue + } + if !readAll && ownershipRole(obj, user.ID) == roleNone { + continue + } + out = append(out, ServerRef{Cluster: cluster, Namespace: ns, Name: obj.GetName()}) + } + } + sort.SliceStable(out, func(i, j int) bool { + if out[i].Namespace != out[j].Namespace { + return out[i].Namespace < out[j].Namespace + } + return out[i].Name < out[j].Name + }) + return out, nil +} + +func containsID(ids []string, id string) bool { + for _, v := range ids { + if v == id { + return true + } + } + return false +} + +// fileRouteRe matches /servers/{name}/files/{action}. The name cannot contain "/" or ":". +var fileRouteRe = regexp.MustCompile(`^/servers/([^/:]+)/files/([a-z]+)$`) + +// fileRouteActions maps method and action segment to the FileAction the route performs. +// +// POST archive is write-class, as it was under the old rule table (any non-GET under /servers +// needed servers:write), and GET archive is read-class. The FileAction list has no archive +// action yet; spec 039 decides it. +var fileRouteActions = map[string]map[string]FileAction{ + http.MethodGet: { + "list": FileList, "stat": FileStat, "read": FileRead, + "download": FileDownload, "archive": FileDownload, + }, + http.MethodPost: { + "archive": FileWrite, "write": FileWrite, "create": FileCreate, + "upload": FileUpload, "mkdir": FileMkdir, "rename": FileRename, + }, + http.MethodDelete: {"delete": FileDelete}, + http.MethodPut: {"stream": FileUpload}, +} + +// FileActionForRoute reports whether method and path are one of the server file routes, and if so +// which action and server name they target. ok is false for every other request, which keeps the +// rule table's decision. +func FileActionForRoute(method, path string) (action FileAction, server string, ok bool) { + m := fileRouteRe.FindStringSubmatch(path) + if m == nil { + return "", "", false + } + act, found := fileRouteActions[method][m[2]] + if !found { + return "", "", false + } + return act, m[1], true +} diff --git a/api/internal/rbac/fileaccess_sftp_test.go b/api/internal/rbac/fileaccess_sftp_test.go new file mode 100644 index 000000000..89e99889d --- /dev/null +++ b/api/internal/rbac/fileaccess_sftp_test.go @@ -0,0 +1,156 @@ +package rbac + +import ( + "context" + "errors" + "net/http" + "net/http/httptest" + "testing" + "time" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" + + "github.com/GameplanePanel/gameplane/api/internal/auth" + "github.com/GameplanePanel/gameplane/api/internal/scope" +) + +// faFailingLister reports an error for every namespace. +type faFailingLister struct{ faFakeCluster } + +func (faFailingLister) ListServers(context.Context, string, string) ([]unstructured.Unstructured, error) { + return nil, errors.New("list failed") +} + +// faServe runs one request through MiddlewareWithFiles and returns whether next ran and the recorder. +func faServe(t *testing.T, h http.Handler, req *http.Request, u *auth.User) (bool, *httptest.ResponseRecorder) { + t.Helper() + rec := httptest.NewRecorder() + req = req.WithContext(auth.WithUser(req.Context(), u)) + h.ServeHTTP(rec, req) + return rec.Code == http.StatusOK, rec +} + +func faFileHandler(files *FileChecker, fetch ServerFetcher) http.Handler { + return MiddlewareWithFiles(fetch, files)(http.HandlerFunc(func(w http.ResponseWriter, _ *http.Request) { + w.WriteHeader(http.StatusOK) + })) +} + +func TestMiddlewareWithFiles_NilCheckerDefaultsToOwnerFallback(t *testing.T) { + fetch := faFixture() + h := faFileHandler(nil, fetch) + req := httptest.NewRequestWithContext(t.Context(), http.MethodGet, "/servers/srv/files/list", nil) + if ok, rec := faServe(t, h, req, faBare(7)); !ok { + t.Fatalf("owner refused with default checker: %d", rec.Code) + } + req = httptest.NewRequestWithContext(t.Context(), http.MethodGet, "/servers/srv/files/list", nil) + if ok, _ := faServe(t, h, req, faBare(9)); ok { + t.Fatal("stranger allowed with default checker") + } +} + +func TestServeFileRoute_ScopeRefusals(t *testing.T) { + fetch := faFixture() + h := faFileHandler(NewFileAccess(fetch, fetch), fetch) + owner := faUser(1, faLocal, scope.DefaultNamespace, "servers:read") + for name, target := range map[string]string{ + "unknown namespace": "/servers/srv/files/list?namespace=not-a-game-namespace", + "unknown cluster": "/servers/srv/files/list?cluster=not-registered", + } { + t.Run(name, func(t *testing.T) { + req := httptest.NewRequestWithContext(t.Context(), http.MethodGet, target, nil) + ok, rec := faServe(t, h, req, owner) + // namespace_not_permitted and cluster_forbidden are 400s in the message catalog, + // the same answer the rule table gives for these selectors. + if ok || rec.Code != http.StatusBadRequest { + t.Fatalf("called=%v code=%d, want a 400", ok, rec.Code) + } + }) + } +} + +func TestServeFileRoute_MCPTokenWithoutClusterGrantGetsClusterForbidden(t *testing.T) { + fetch := faFixture() + h := faFileHandler(NewFileAccess(fetch, fetch), fetch) + stranger := faBare(9) + + plain := httptest.NewRequestWithContext(t.Context(), http.MethodGet, "/servers/srv/files/list", nil) + okPlain, plainRec := faServe(t, h, plain, stranger) + + mcpReq := httptest.NewRequestWithContext(auth.WithMCPToken(t.Context(), 5), http.MethodGet, "/servers/srv/files/list", nil) + okMCP, mcpRec := faServe(t, h, mcpReq, stranger) + + if okPlain || okMCP { + t.Fatalf("stranger allowed: plain=%v mcp=%v", okPlain, okMCP) + } + // server.forbidden is a 403; server.cluster_forbidden is a 400 in the message catalog. + if plainRec.Code != http.StatusForbidden || mcpRec.Code != http.StatusBadRequest { + t.Fatalf("codes plain=%d mcp=%d, want 403 and 400", plainRec.Code, mcpRec.Code) + } + if plainRec.Body.String() == mcpRec.Body.String() { + t.Fatalf("MCP refusal body equals the plain forbidden body: %s", mcpRec.Body.String()) + } +} + +func TestServeFileRoute_SFTPCallerRecordsFileTarget(t *testing.T) { + fetch := faFixture() + h := faFileHandler(NewFileAccess(fetch, fetch), fetch) + reader := faUser(1, faLocal, scope.DefaultNamespace, "servers:read") + + ctx, holder := auth.WithActorHolder(auth.WithSFTPCaller(t.Context(), auth.SFTPCaller{Cluster: faLocal, SessionID: 4})) + req := httptest.NewRequestWithContext(ctx, http.MethodGet, "/servers/srv/files/list?path=/world/level.dat", nil) + if ok, rec := faServe(t, h, req, reader); !ok { + t.Fatalf("sftp reader refused: %d", rec.Code) + } + want := faLocal + "/" + scope.DefaultNamespace + "/srv /world/level.dat" + if got := holder.Target(); got != want { + t.Fatalf("audit target = %q, want %q", got, want) + } + + // A dashboard request leaves the target to the generic audit middleware. + ctx, holder = auth.WithActorHolder(t.Context()) + req = httptest.NewRequestWithContext(ctx, http.MethodGet, "/servers/srv/files/list?path=/x", nil) + if ok, _ := faServe(t, h, req, reader); !ok { + t.Fatal("dashboard reader refused") + } + if got := holder.Target(); got != "" { + t.Fatalf("dashboard request set audit target %q", got) + } +} + +func TestVisibleServers_ListerErrorDeletedAndNamespaceOrder(t *testing.T) { + reader := func(ns string) *auth.User { return faUser(1, faLocal, ns, "servers:read") } + + failing := &faFailingLister{faFakeCluster: *faFixture()} + files := NewFileAccess(failing, failing) + if _, err := files.VisibleServers(t.Context(), reader(scope.DefaultNamespace), faLocal); err == nil { + t.Fatal("VisibleServers swallowed the lister error") + } + + orig := scope.AllowedNamespaces + scope.AllowedNamespaces = []string{scope.DefaultNamespace, "zz-extra"} + t.Cleanup(func() { scope.AllowedNamespaces = orig }) + + gone := faServer(scope.DefaultNamespace, "gone", 1, "") + now := metav1.NewTime(time.Now()) + gone.SetDeletionTimestamp(&now) + fetch := faCluster([]string{faLocal}, + faServer("zz-extra", "alpha", 1, ""), + faServer(scope.DefaultNamespace, "beta", 1, ""), + gone, + ) + user := &auth.User{ID: 1, Username: "user1", Perms: map[string]map[string]map[string]struct{}{ + faLocal: { + scope.DefaultNamespace: {"servers:read": {}}, + "zz-extra": {"servers:read": {}}, + }, + }} + refs, err := NewFileAccess(fetch, fetch).VisibleServers(t.Context(), user, faLocal) + if err != nil { + t.Fatalf("VisibleServers: %v", err) + } + if len(refs) != 2 || refs[0].Name != "beta" || refs[1].Name != "alpha" { + t.Fatalf("refs = %+v, want beta (default namespace) then alpha, deleted server hidden", refs) + } +} diff --git a/api/internal/rbac/fileaccess_test.go b/api/internal/rbac/fileaccess_test.go new file mode 100644 index 000000000..e21f73562 --- /dev/null +++ b/api/internal/rbac/fileaccess_test.go @@ -0,0 +1,397 @@ +package rbac + +import ( + "context" + "errors" + "fmt" + "net/http" + "net/http/httptest" + "strings" + "testing" + + "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" + "k8s.io/apimachinery/pkg/types" + + "github.com/GameplanePanel/gameplane/api/internal/auth" + "github.com/GameplanePanel/gameplane/api/internal/scope" +) + +const faLocal = "local" + +// faFakeCluster is an in-memory ServerFetcher and ServerLister for one cluster. +type faFakeCluster struct { + ids []string + servers map[string]*unstructured.Unstructured // key: namespace/name +} + +func (f *faFakeCluster) GetServer(_ context.Context, _, ns, name string) (*unstructured.Unstructured, error) { + obj, ok := f.servers[ns+"/"+name] + if !ok { + return nil, errors.New("not found") + } + return obj, nil +} + +func (f *faFakeCluster) IDs() []string { return f.ids } + +func (f *faFakeCluster) ListServers(_ context.Context, _, ns string) ([]unstructured.Unstructured, error) { + var out []unstructured.Unstructured + for key, obj := range f.servers { + if strings.HasPrefix(key, ns+"/") { + out = append(out, *obj) + } + } + return out, nil +} + +// faServer builds a GameServer carrying the ownership annotations ownershipRole reads. +func faServer(ns, name string, owner int64, collaborators string) *unstructured.Unstructured { + obj := &unstructured.Unstructured{} + obj.SetNamespace(ns) + obj.SetName(name) + obj.SetUID(types.UID(name + "-uid")) + ann := map[string]string{"gameplane.local/owner-id": fmt.Sprint(owner)} + if collaborators != "" { + ann["gameplane.local/collaborators"] = collaborators + } + obj.SetAnnotations(ann) + return obj +} + +func faCluster(ids []string, servers ...*unstructured.Unstructured) *faFakeCluster { + f := &faFakeCluster{ids: ids, servers: map[string]*unstructured.Unstructured{}} + for _, obj := range servers { + f.servers[obj.GetNamespace()+"/"+obj.GetName()] = obj + } + return f +} + +// faUser returns a user holding perms on cluster/ns. With no perms it holds nothing. +func faUser(id int64, cluster, ns string, perms ...string) *auth.User { + u := &auth.User{ID: id, Username: fmt.Sprintf("user%d", id)} + if len(perms) > 0 { + set := map[string]struct{}{} + for _, p := range perms { + set[p] = struct{}{} + } + u.Perms = map[string]map[string]map[string]struct{}{cluster: {ns: set}} + } + return u +} + +// faBare returns a user holding no permissions (only ownership grants can apply). +func faBare(id int64) *auth.User { + return &auth.User{ID: id, Username: fmt.Sprintf("user%d", id)} +} + +// faFixture: srv is owned by user 7 with user 8 as collaborator; other is owned by user 99. +func faFixture() *faFakeCluster { + return faCluster([]string{faLocal}, + faServer(scope.DefaultNamespace, "srv", 7, "8"), + faServer(scope.DefaultNamespace, "other", 99, ""), + ) +} + +func faTarget() FileTarget { + return FileTarget{Cluster: faLocal, Namespace: scope.DefaultNamespace, Server: "srv"} +} + +func TestFileAccessPermissionMatrix(t *testing.T) { + fetch := faFixture() + files := NewFileAccess(fetch, fetch) + ns := scope.DefaultNamespace + readActions := []FileAction{FileList, FileStat, FileRead, FileDownload} + writeActions := []FileAction{FileCreate, FileWrite, FileUpload, FileMkdir, FileDelete} + cases := []struct { + name string + user *auth.User + read, write bool + }{ + {"read-only", faUser(1, faLocal, ns, "servers:read"), true, false}, + {"write-only", faUser(2, faLocal, ns, "servers:write"), false, true}, + {"no grant", faBare(9), false, false}, + {"other namespace", faUser(3, faLocal, "other-ns", "servers:read", "servers:write"), false, false}, + {"cluster-wide wildcard", faUser(4, "*", "*", "servers:read", "servers:write"), true, true}, + {"owner", faBare(7), true, true}, + {"collaborator", faBare(8), true, true}, + } + for _, tc := range cases { + for _, action := range readActions { + if err := files.Allow(t.Context(), tc.user, action, faTarget()); (err == nil) != tc.read { + t.Errorf("%s %s: allowed=%v, want %v (err %v)", tc.name, action, err == nil, tc.read, err) + } + } + for _, action := range writeActions { + if err := files.Allow(t.Context(), tc.user, action, faTarget()); (err == nil) != tc.write { + t.Errorf("%s %s: allowed=%v, want %v (err %v)", tc.name, action, err == nil, tc.write, err) + } + } + } +} + +func TestFileAccessNilUserAndUnknownAction(t *testing.T) { + fetch := faFixture() + files := NewFileAccess(fetch, fetch) + if err := files.Allow(t.Context(), nil, FileList, faTarget()); !errors.Is(err, ErrFileAccessDenied) { + t.Errorf("nil user: err = %v, want ErrFileAccessDenied", err) + } + user := faUser(1, faLocal, scope.DefaultNamespace, "servers:read", "servers:write") + if err := files.Allow(t.Context(), user, FileAction("bogus"), faTarget()); !errors.Is(err, ErrFileAccessDenied) { + t.Errorf("unknown action: err = %v, want ErrFileAccessDenied", err) + } +} + +func TestFileAccessRenameNeedsBothPaths(t *testing.T) { + fetch := faFixture() + files := NewFileAccess(fetch, fetch) + ctx := t.Context() + writer := faUser(2, faLocal, scope.DefaultNamespace, "servers:write") + reader := faUser(1, faLocal, scope.DefaultNamespace, "servers:read") + + // Route-level check: no paths yet, so write-class access decides. + if err := files.Allow(ctx, writer, FileRename, faTarget()); err != nil { + t.Errorf("writer route-level rename: %v", err) + } + if err := files.Allow(ctx, reader, FileRename, faTarget()); err == nil { + t.Error("reader route-level rename allowed, want denied") + } + + two := faTarget() + two.Paths = []string{"a.txt", "b.txt"} + if err := files.Allow(ctx, writer, FileRename, two); err != nil { + t.Errorf("writer rename with two paths: %v", err) + } + if err := files.Allow(ctx, reader, FileRename, two); err == nil { + t.Error("reader rename with two paths allowed, want denied") + } + + one := faTarget() + one.Paths = []string{"a.txt"} + if err := files.Allow(ctx, writer, FileRename, one); !errors.Is(err, ErrFileAccessDenied) { + t.Errorf("rename with one path: err = %v, want ErrFileAccessDenied", err) + } +} + +func TestFileAccessBoundGrantContext(t *testing.T) { + fetch := faFixture() + files := NewFileAccess(fetch, fetch) + + ctx, err := files.AllowBound(t.Context(), faBare(7), FileWrite, faTarget()) + if err != nil { + t.Fatalf("owner AllowBound: %v", err) + } + id, ok := BoundServerIdentity(ctx) + if !ok || id.Cluster != faLocal || id.Namespace != scope.DefaultNamespace || id.Name != "srv" || id.UID != "srv-uid" { + t.Errorf("owner bound identity = %+v, %v", id, ok) + } + + // A grant from the namespace permission binds no server identity. + ctx, err = files.AllowBound(t.Context(), faUser(1, faLocal, scope.DefaultNamespace, "servers:read"), FileRead, faTarget()) + if err != nil { + t.Fatalf("reader AllowBound: %v", err) + } + if _, ok := BoundServerIdentity(ctx); ok { + t.Error("permission grant bound a server identity, want none") + } +} + +func TestFileAccessRemoteClusterIsNotGranted(t *testing.T) { + fetch := faFixture() + files := NewFileAccess(fetch, fetch) + reader := faUser(1, faLocal, scope.DefaultNamespace, "servers:read") + remote := faTarget() + remote.Cluster = "remote" + if err := files.Allow(t.Context(), reader, FileList, remote); err == nil { + t.Error("grant on local allowed a file operation on remote") + } + if _, err := files.VisibleServers(t.Context(), reader, "remote"); !errors.Is(err, scope.ErrForbiddenCluster) { + t.Errorf("VisibleServers(remote) err = %v, want ErrForbiddenCluster", err) + } +} + +func TestFileAccessOtherNamespaceGrantDoesNotCrossOver(t *testing.T) { + fetch := faFixture() + files := NewFileAccess(fetch, fetch) + grantedElsewhere := faUser(1, faLocal, "other-ns", "servers:read", "servers:write") + if err := files.Allow(t.Context(), grantedElsewhere, FileList, faTarget()); err == nil { + t.Error("grant in other-ns allowed a file operation in the default namespace") + } +} + +func TestVisibleServers(t *testing.T) { + ns := scope.DefaultNamespace + fetch := faCluster([]string{faLocal}, + faServer(ns, "srv", 7, "8"), + faServer(ns, "other", 99, ""), + faServer(ns, "alpha", 7, ""), + ) + files := NewFileAccess(fetch, fetch) + cases := []struct { + name string + user *auth.User + want string + }{ + {"namespace reader sees the whole namespace", faUser(1, faLocal, ns, "servers:read"), "alpha,other,srv"}, + {"owner sees owned servers", faBare(7), "alpha,srv"}, + {"collaborator sees collaborated servers", faBare(8), "srv"}, + {"no grant sees nothing", faBare(9), ""}, + } + for _, tc := range cases { + refs, err := files.VisibleServers(t.Context(), tc.user, faLocal) + if err != nil { + t.Fatalf("%s: %v", tc.name, err) + } + var names []string + for _, r := range refs { + if r.Cluster != faLocal || r.Namespace != ns { + t.Errorf("%s: ref = %+v", tc.name, r) + } + names = append(names, r.Name) + } + if got := strings.Join(names, ","); got != tc.want { + t.Errorf("%s: names = %q, want %q", tc.name, got, tc.want) + } + } + if _, err := files.VisibleServers(t.Context(), nil, faLocal); !errors.Is(err, ErrFileAccessDenied) { + t.Errorf("nil user: err = %v, want ErrFileAccessDenied", err) + } +} + +func TestVisibleServersRequiresLister(t *testing.T) { + fetch := faFixture() + files := NewFileAccess(fetch, nil) + if _, err := files.VisibleServers(t.Context(), faUser(1, faLocal, scope.DefaultNamespace, "servers:read"), faLocal); err == nil { + t.Error("VisibleServers without a lister returned no error") + } +} + +func TestFilterEntries(t *testing.T) { + fetch := faFixture() + files := NewFileAccess(fetch, fetch) + names := []string{"world", "server.properties"} + reader := faUser(1, faLocal, scope.DefaultNamespace, "servers:read") + got, err := files.FilterEntries(t.Context(), reader, faTarget(), names) + if err != nil || len(got) != len(names) || got[0] != "world" || got[1] != "server.properties" { + t.Errorf("FilterEntries(reader) = %v, %v", got, err) + } + if _, err := files.FilterEntries(t.Context(), faBare(9), faTarget(), names); !errors.Is(err, ErrFileAccessDenied) { + t.Errorf("FilterEntries(no grant) err = %v, want ErrFileAccessDenied", err) + } +} + +func TestFileActionForRoute(t *testing.T) { + cases := []struct { + method, path string + want FileAction + ok bool + }{ + {http.MethodGet, "/servers/srv/files/list", FileList, true}, + {http.MethodGet, "/servers/srv/files/stat", FileStat, true}, + {http.MethodGet, "/servers/srv/files/read", FileRead, true}, + {http.MethodGet, "/servers/srv/files/download", FileDownload, true}, + {http.MethodGet, "/servers/srv/files/archive", FileDownload, true}, + {http.MethodPost, "/servers/srv/files/archive", FileWrite, true}, + {http.MethodPost, "/servers/srv/files/write", FileWrite, true}, + {http.MethodPost, "/servers/srv/files/create", FileCreate, true}, + {http.MethodPost, "/servers/srv/files/upload", FileUpload, true}, + {http.MethodPost, "/servers/srv/files/mkdir", FileMkdir, true}, + {http.MethodPost, "/servers/srv/files/rename", FileRename, true}, + {http.MethodDelete, "/servers/srv/files/delete", FileDelete, true}, + {http.MethodPut, "/servers/srv/files/stream", FileUpload, true}, + // Not file routes: the rule table keeps deciding these. + {http.MethodPut, "/servers/srv/files/create", "", false}, + {http.MethodGet, "/servers/srv/files/stream", "", false}, + {http.MethodDelete, "/servers/srv/files/list", "", false}, + {http.MethodGet, "/servers/srv", "", false}, + {http.MethodGet, "/servers/srv/players", "", false}, + {http.MethodGet, "/servers/srv/files/list/extra", "", false}, + } + for _, tc := range cases { + action, server, ok := FileActionForRoute(tc.method, tc.path) + if ok != tc.ok || action != tc.want { + t.Errorf("%s %s = (%q, %v), want (%q, %v)", tc.method, tc.path, action, ok, tc.want, tc.ok) + } + if ok && server != "srv" { + t.Errorf("%s %s server = %q, want srv", tc.method, tc.path, server) + } + } +} + +// TestFileAccessMatchesRuleTable checks that every file route gives the same answer as the rule +// table with the owner/collaborator fallback that rbac.Middleware applied before this change. +func TestFileAccessMatchesRuleTable(t *testing.T) { + fetch := faFixture() + files := NewFileAccess(fetch, fetch) + ns := scope.DefaultNamespace + routes := []struct{ method, path string }{ + {http.MethodGet, "/servers/srv/files/list"}, + {http.MethodGet, "/servers/srv/files/stat"}, + {http.MethodGet, "/servers/srv/files/read"}, + {http.MethodGet, "/servers/srv/files/download"}, + {http.MethodGet, "/servers/srv/files/archive"}, + {http.MethodPost, "/servers/srv/files/archive"}, + {http.MethodPost, "/servers/srv/files/write"}, + {http.MethodPost, "/servers/srv/files/create"}, + {http.MethodPost, "/servers/srv/files/upload"}, + {http.MethodPost, "/servers/srv/files/mkdir"}, + {http.MethodPost, "/servers/srv/files/rename"}, + {http.MethodDelete, "/servers/srv/files/delete"}, + {http.MethodPut, "/servers/srv/files/stream"}, + } + users := []*auth.User{ + faUser(1, faLocal, ns, "servers:read"), + faUser(2, faLocal, ns, "servers:write"), + faBare(7), + faBare(8), + faBare(9), + faUser(5, "*", "*", "servers:read", "servers:write"), + } + for _, rt := range routes { + action, server, ok := FileActionForRoute(rt.method, rt.path) + if !ok { + t.Fatalf("%s %s is not a file route", rt.method, rt.path) + } + target := FileTarget{Cluster: faLocal, Namespace: ns, Server: server} + for _, u := range users { + old := allow(u, rt.method, rt.path, faLocal, ns) + if !old { + _, old = bindServerGrant(t.Context(), fetch, faLocal, ns, server, u.ID, false) + } + got := files.Allow(t.Context(), u, action, target) == nil + if old != got { + t.Errorf("%s %s user %d: rule table %v, FileAccess %v", rt.method, rt.path, u.ID, old, got) + } + } + } +} + +func TestMiddlewareWithFilesRoutes(t *testing.T) { + fetch := faFixture() + ns := scope.DefaultNamespace + mw := MiddlewareWithFiles(fetch, NewFileAccess(fetch, fetch)) + called := false + h := mw(http.HandlerFunc(func(w http.ResponseWriter, _ *http.Request) { + called = true + w.WriteHeader(http.StatusOK) + })) + serve := func(u *auth.User, method, path string) bool { + t.Helper() + called = false + req := httptest.NewRequestWithContext(t.Context(), method, path, nil) + req = req.WithContext(auth.WithUser(req.Context(), u)) + h.ServeHTTP(httptest.NewRecorder(), req) + return called + } + if !serve(faUser(1, faLocal, ns, "servers:read"), http.MethodGet, "/servers/srv/files/list") { + t.Error("reader GET list was refused") + } + if serve(faUser(1, faLocal, ns, "servers:read"), http.MethodPost, "/servers/srv/files/write") { + t.Error("reader POST write was allowed") + } + if !serve(faBare(7), http.MethodPost, "/servers/srv/files/write") { + t.Error("owner POST write was refused") + } + if serve(faBare(9), http.MethodGet, "/servers/srv/files/list") { + t.Error("user with no grant GET list was allowed") + } +} diff --git a/api/internal/rbac/rbac.go b/api/internal/rbac/rbac.go index ea0c5f2c5..9a33651fb 100644 --- a/api/internal/rbac/rbac.go +++ b/api/internal/rbac/rbac.go @@ -76,6 +76,16 @@ const ( // one cluster never grants access to another — this prevents cross-cluster // privilege escalation. func Middleware(fetch ServerFetcher) func(http.Handler) http.Handler { + return MiddlewareWithFiles(fetch, NewFileAccess(fetch, nil)) +} + +// MiddlewareWithFiles is Middleware with the server file routes authorized by files (see +// fileaccess.go). Every other route keeps the rule table. A nil files is replaced by +// NewFileAccess(fetch, nil). +func MiddlewareWithFiles(fetch ServerFetcher, files *FileChecker) func(http.Handler) http.Handler { + if files == nil { + files = NewFileAccess(fetch, nil) + } return func(next http.Handler) http.Handler { return http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) { u := auth.UserFromContext(req.Context()) @@ -83,6 +93,10 @@ func Middleware(fetch ServerFetcher) func(http.Handler) http.Handler { httperr.WriteMessage(w, req, messages.New("server.common.unauthenticated", nil)) return } + if action, server, isFile := FileActionForRoute(req.Method, req.URL.Path); isFile { + serveFileRoute(w, req, next, fetch, files, u, action, server) + return + } r, ok := match(req.Method, req.URL.Path) if !ok { httperr.WriteMessage(w, req, messages.New("server.forbidden", nil)) @@ -179,6 +193,41 @@ func Middleware(fetch ServerFetcher) func(http.Handler) http.Handler { } } +// serveFileRoute authorizes one /servers/{name}/files route through files. The refusal answers +// match the rule-table path: namespace and cluster first, then server.forbidden, except that an +// MCP token with no grant on the cluster gets server.cluster_forbidden. +func serveFileRoute(w http.ResponseWriter, req *http.Request, next http.Handler, fetch ServerFetcher, files *FileChecker, u *auth.User, action FileAction, server string) { + ns, err := scope.Resolve(req) + if err != nil { + httperr.WriteMessage(w, req, messages.New("server.common.namespace_not_permitted", nil)) + return + } + cl := scope.DefaultCluster + if fetch != nil { + // rbac.Middleware must be mounted with a non-nil fetcher: the cluster gates the + // permission check, so resolving it here keeps the check on the cluster that serves the request. + cl, err = scope.ResolveCluster(req, fetch) + if err != nil { + httperr.WriteMessage(w, req, messages.New("server.cluster_forbidden", nil)) + return + } + } + ctx, err := files.AllowBound(req.Context(), u, action, FileTarget{Cluster: cl, Namespace: ns, Server: server}) + if err != nil { + if _, isToken := auth.MCPTokenFromContext(req.Context()); isToken && !u.CanDiscoverCluster(cl) { + httperr.WriteMessage(w, req, messages.New("server.cluster_forbidden", nil)) + return + } + httperr.WriteMessage(w, req, messages.New("server.forbidden", nil)) + return + } + if _, isSFTP := auth.SFTPCallerFromContext(req.Context()); isSFTP { + // SFTP rows name the file target (spec 040 FR-020); the path is a query parameter on these routes. + auth.SetAuditTarget(req.Context(), cl+"/"+ns+"/"+server+" "+req.URL.Query().Get("path")) + } + next.ServeHTTP(w, req.WithContext(ctx)) +} + // rule maps a request shape to the permission required to perform it. // The first matching rule wins. method "" matches any method; segment "" // matches any first path segment; prefix/suffix narrow further when a @@ -189,7 +238,10 @@ type rule struct { segment string prefix string // strings.HasPrefix(path, prefix) suffix string // strings.HasSuffix(path, suffix) - perm string // required permission; "" = any authenticated user + // contains narrows a rule to paths with this substring in the middle + // (e.g. /users/{id}/sftp/keys/{keyId}), where prefix and suffix cannot. + contains string + perm string // required permission; "" = any authenticated user } var rules = []rule{ @@ -218,6 +270,17 @@ var rules = []rule{ {method: "GET", segment: "users", suffix: "/users/me/mcp-tokens", perm: ""}, {method: "POST", segment: "users", suffix: "/users/me/mcp-tokens", perm: ""}, {method: "DELETE", segment: "users", prefix: "/users/me/mcp-tokens/", perm: ""}, + // Personal SFTP credentials (spec 040): the same self-service split as MCP tokens. + {method: "GET", segment: "users", suffix: "/users/me/sftp", perm: ""}, + {method: "POST", segment: "users", suffix: "/users/me/sftp/keys", perm: ""}, + {method: "DELETE", segment: "users", prefix: "/users/me/sftp/keys/", perm: ""}, + {method: "POST", segment: "users", suffix: "/users/me/sftp/password", perm: ""}, + {method: "DELETE", segment: "users", suffix: "/users/me/sftp/password", perm: ""}, + // Admin SFTP view and revokes of another user's credentials (spec 040 US3): users:manage, not users:read. + // These must precede the generic users rules below. + {method: "GET", segment: "users", suffix: "/sftp", perm: "users:manage"}, + {method: "DELETE", segment: "users", contains: "/sftp/keys/", perm: "users:manage"}, + {method: "DELETE", segment: "users", suffix: "/sftp/password", perm: "users:manage"}, {method: "GET", segment: "users", perm: "users:read"}, {segment: "users", perm: "users:manage"}, @@ -311,6 +374,9 @@ var rules = []rule{ // (plural /clusters endpoint). // Discovery filters each registration by the caller's grants. Namespace // server readers may select their cluster without gaining node inventory. + // The SFTP endpoint drawer (spec 040) lists addresses and tokens, so its + // GET needs cluster:manage; it must come before the generic GET below. + {method: "GET", segment: "clusters", suffix: "/sftp", perm: "cluster:manage"}, {method: "GET", segment: "clusters", perm: ""}, {segment: "clusters", perm: "cluster:manage"}, @@ -368,6 +434,9 @@ func match(method, path string) (rule, bool) { if r.suffix != "" && !strings.HasSuffix(path, r.suffix) { continue } + if r.contains != "" && !strings.Contains(path, r.contains) { + continue + } return r, true } return rule{}, false diff --git a/api/internal/rbac/sftp_admin_rules_test.go b/api/internal/rbac/sftp_admin_rules_test.go new file mode 100644 index 000000000..390b6f80f --- /dev/null +++ b/api/internal/rbac/sftp_admin_rules_test.go @@ -0,0 +1,68 @@ +package rbac + +import ( + "net/http" + "testing" +) + +// TestSFTPAdminRules_MatchUsersManage checks that the admin SFTP routes resolve to users:manage and the +// self-service SFTP routes stay open to any signed-in user. +func TestSFTPAdminRules_MatchUsersManage(t *testing.T) { + cases := []struct { + method, path, perm string + }{ + {"GET", "/users/12/sftp", "users:manage"}, + {"DELETE", "/users/12/sftp/keys/7", "users:manage"}, + {"DELETE", "/users/12/sftp/password", "users:manage"}, + {"GET", "/users/me/sftp", ""}, + {"POST", "/users/me/sftp/keys", ""}, + {"DELETE", "/users/me/sftp/keys/7", ""}, + {"POST", "/users/me/sftp/password", ""}, + {"DELETE", "/users/me/sftp/password", ""}, + } + for _, c := range cases { + r, ok := match(c.method, c.path) + if !ok || r.perm != c.perm { + t.Errorf("%s %s: rule perm=%q ok=%v, want %q", c.method, c.path, r.perm, ok, c.perm) + } + } +} + +// TestSFTPAdminRules_NeedUsersManage proves that reading or revoking another user's SFTP credentials is +// refused to users:read holders and allowed to users:manage holders. +func TestSFTPAdminRules_NeedUsersManage(t *testing.T) { + viewer := clusterWide(RoleViewer, "servers:read") + reader := clusterWide(RoleOperator, "users:read") + manager := clusterWide(RoleAdmin, "users:read", "users:manage") + + for _, target := range []struct{ method, path string }{ + {http.MethodGet, "/users/12/sftp"}, + {http.MethodDelete, "/users/12/sftp/keys/7"}, + {http.MethodDelete, "/users/12/sftp/password"}, + } { + if code := mcpRulesServe(t, viewer, target.method, target.path); code != http.StatusForbidden { + t.Errorf("viewer %s %s: code=%d, want 403", target.method, target.path, code) + } + if code := mcpRulesServe(t, reader, target.method, target.path); code != http.StatusForbidden { + t.Errorf("users:read %s %s: code=%d, want 403", target.method, target.path, code) + } + if code := mcpRulesServe(t, manager, target.method, target.path); code != http.StatusNoContent { + t.Errorf("users:manage %s %s: code=%d, want passthrough", target.method, target.path, code) + } + } +} + +// TestSFTPAdminRules_SelfRoutesOpenToAnyUser keeps the personal SFTP routes reachable by a plain user +// even though the admin rules sit next to them. +func TestSFTPAdminRules_SelfRoutesOpenToAnyUser(t *testing.T) { + plain := clusterWide(RoleViewer) + for _, target := range []struct{ method, path string }{ + {http.MethodGet, "/users/me/sftp"}, + {http.MethodDelete, "/users/me/sftp/keys/4"}, + {http.MethodDelete, "/users/me/sftp/password"}, + } { + if code := mcpRulesServe(t, plain, target.method, target.path); code != http.StatusNoContent { + t.Errorf("%s %s: code=%d, want passthrough", target.method, target.path, code) + } + } +} diff --git a/api/internal/ws/dialer.go b/api/internal/ws/dialer.go index 15a560ecb..526e4ea5c 100644 --- a/api/internal/ws/dialer.go +++ b/api/internal/ws/dialer.go @@ -4,9 +4,12 @@ package ws import ( + "bytes" "crypto/tls" "crypto/x509" + "encoding/json" "errors" + "fmt" "io" "log/slog" "net" @@ -18,8 +21,11 @@ import ( "github.com/coder/websocket" "github.com/go-chi/chi/v5" + "github.com/GameplanePanel/gameplane/api/internal/auth" "github.com/GameplanePanel/gameplane/api/internal/httperr" "github.com/GameplanePanel/gameplane/api/internal/kube" + "github.com/GameplanePanel/gameplane/api/internal/messages" + "github.com/GameplanePanel/gameplane/api/internal/rbac" "github.com/GameplanePanel/gameplane/api/internal/scope" ) @@ -46,9 +52,19 @@ func MountWithPlayerNames(r chi.Router, reg *kube.Registry, caBundle, clientCert transport = newDirectAgentTransport(tlsCfg, 0) } - p := &proxy{k: k, transport: transport, stdin: k, playerNames: names} - if len(gatewayOptions) > 0 && gatewayOptions[0].Namespace != "" && reg != nil { - p.gateway = &agentGatewayResolver{registry: reg, namespace: gatewayOptions[0].Namespace} + p := &proxy{k: k, transport: transport, stdin: k, playerNames: names, maxUploadBytes: defaultMaxUploadBytes} + if len(gatewayOptions) > 0 { + opts := gatewayOptions[0] + p.files = opts.Files + if opts.MaxUploadBytes > 0 { + p.maxUploadBytes = opts.MaxUploadBytes + } + if d, ok := transport.(*directAgentTransport); ok && opts.AgentHost != nil { + d.hostFn = opts.AgentHost + } + if opts.Namespace != "" && reg != nil { + p.gateway = &agentGatewayResolver{registry: reg, namespace: opts.Namespace} + } } r.Get("/ws/servers/{name}/console", p.agentWS("/console")) r.Get("/ws/servers/{name}/logs", p.agentWS("/logs/tail")) @@ -63,16 +79,20 @@ func MountWithPlayerNames(r chi.Router, reg *kube.Registry, caBundle, clientCert // before the game's own log file exists. Mounted unconditionally. mountPodLogs(r, reg) r.Route("/servers/{name}/files", func(r chi.Router) { - r.Get("/list", p.agentHTTP("/files/list")) - r.Get("/read", p.agentHTTP("/files/read")) - r.Get("/download", p.agentHTTP("/files/download")) - r.Get("/archive", p.agentHTTP("/files/archive")) - r.Post("/archive", p.agentHTTP("/files/archive")) - r.Post("/write", p.agentHTTP("/files/write")) - r.Post("/create", p.agentHTTP("/files/create")) - r.Post("/upload", p.agentHTTP("/files/upload")) - r.Post("/mkdir", p.agentHTTP("/files/mkdir")) - r.Delete("/delete", p.agentHTTP("/files/delete")) + // File routes start a file-only pod for a stopped server first (ensure_files.go). + r.Get("/list", p.filesRoute("/files/list", defaultBodyLimit)) + r.Get("/stat", p.filesRoute("/files/stat", defaultBodyLimit)) + r.Get("/read", p.filesRoute("/files/read", defaultBodyLimit)) + r.Get("/download", p.filesRoute("/files/download", defaultBodyLimit)) + r.Get("/archive", p.filesRoute("/files/archive", defaultBodyLimit)) + r.Post("/archive", p.filesRoute("/files/archive", defaultBodyLimit)) + r.Post("/write", p.filesRoute("/files/write", defaultBodyLimit)) + r.Post("/create", p.filesRoute("/files/create", defaultBodyLimit)) + r.Post("/upload", p.filesRoute("/files/upload", defaultBodyLimit)) + r.Post("/mkdir", p.filesRoute("/files/mkdir", defaultBodyLimit)) + r.Post("/rename", p.filesRename()) + r.Put("/stream", p.filesRoute("/files/stream", p.maxUploadBytes)) + r.Delete("/delete", p.filesRoute("/files/delete", defaultBodyLimit)) }) r.Route("/servers/{name}/players", func(r chi.Router) { // Hydrated with Steam display names when a resolver is configured; @@ -156,6 +176,76 @@ type proxy struct { // playerNames, when non-nil, hydrates structured player lists with // display names. It never reaches a moderation route (kick/ban/unban). playerNames PlayerNameResolver + // files authorizes the rename body's two paths (nil disables the body check; the + // route-level check in rbac still applies). maxUploadBytes caps files/stream. + files *rbac.FileChecker + maxUploadBytes int64 +} + +// defaultMaxUploadBytes is the upload cap when no option sets one (Helm files.maxUploadSize default). +const defaultMaxUploadBytes int64 = 20 << 30 + +// renameBodyLimit caps the JSON body of files/rename; the body is small and is read in full to +// authorize both paths before it is proxied. +const renameBodyLimit int64 = 64 << 10 + +// filesRename is the rename route. The route-level check (rbac.MiddlewareWithFiles) sees only the +// URL, so this handler reads the {from, to} body and authorizes both paths before proxying. +func (p *proxy) filesRename() http.HandlerFunc { + return p.agentRoute(func(selected *proxy) http.HandlerFunc { + proxyRename := selected.httpProxyLimit("/files/rename", 1<<20) + return func(w http.ResponseWriter, req *http.Request) { + if selected.files == nil { + if !selected.ensureFiles(w, req) { + return + } + proxyRename(w, req) + return + } + raw, err := io.ReadAll(http.MaxBytesReader(w, req.Body, renameBodyLimit)) + if err != nil { + httperr.WriteMessage(w, req, messages.New("server.bad_request", nil)) + return + } + var body struct { + From string `json:"from"` + To string `json:"to"` + Overwrite bool `json:"overwrite"` + } + if err := json.Unmarshal(raw, &body); err != nil { + httperr.WriteMessage(w, req, messages.New("server.bad_request", nil)) + return + } + u := auth.UserFromContext(req.Context()) + ns, err := scope.Resolve(req) + if err != nil { + httperr.Write(w, req, err) + return + } + cl := scope.RequestedCluster(req) + server := chi.URLParam(req, "name") + ctx, err := selected.files.AllowBound(req.Context(), u, rbac.FileRename, rbac.FileTarget{ + Cluster: cl, + Namespace: ns, + Server: server, + Paths: []string{body.From, body.To}, + }) + if err != nil { + httperr.WriteMessage(w, req, messages.New("server.forbidden", nil)) + return + } + // Audit rows name both paths of the rename (spec 040 FR-020). + auth.SetAuditTarget(ctx, cl+"/"+ns+"/"+server+" "+body.From+" -> "+body.To) + req = req.WithContext(ctx) + req.Body = io.NopCloser(bytes.NewReader(raw)) + req.ContentLength = int64(len(raw)) + // Only an authorized rename may start a file-only pod. + if !selected.ensureFiles(w, req) { + return + } + proxyRename(w, req) + } + }) } func (p *proxy) wsProxy(agentPath string) http.HandlerFunc { @@ -226,9 +316,12 @@ func copyWS(req *http.Request, src, dst *websocket.Conn) error { // cap — enough for modest uploads through the file-browser proxy while // blocking unbounded spam. func (p *proxy) httpProxy(agentPath string) http.HandlerFunc { - return p.httpProxyLimit(agentPath, 64<<20) + return p.httpProxyLimit(agentPath, defaultBodyLimit) } +// defaultBodyLimit is the request-body cap of httpProxy. +const defaultBodyLimit int64 = 64 << 20 + // httpProxyLimit is httpProxy with an explicit request-body cap, for the // few routes that legitimately carry more (mod uploads). func (p *proxy) httpProxyLimit(agentPath string, maxBody int64) http.HandlerFunc { @@ -266,6 +359,11 @@ func (p *proxy) httpProxyLimit(agentPath string, maxBody int64) http.HandlerFunc httperr.WriteCode(w, req, http.StatusBadRequest, err) return } + // A declared length over the cap is refused before any upstream work. + if req.ContentLength > maxBody { + httperr.WriteCode(w, req, http.StatusRequestEntityTooLarge, errBodyTooLarge(maxBody)) + return + } // Forward only headers the agent actually consumes. Never proxy // Cookie, Authorization, X-Gameplane-CSRF — those are the user's // session material and the agent doesn't need them (mTLS is what @@ -274,9 +372,16 @@ func (p *proxy) httpProxyLimit(agentPath string, maxBody int64) http.HandlerFunc resp, err := p.transport.Do(req.Context(), agentRequest{ target: target, method: req.Method, path: agentPath, rawQuery: rawQuery, header: req.Header, - body: http.MaxBytesReader(w, req.Body, maxBody), + body: http.MaxBytesReader(w, req.Body, maxBody), + contentLength: req.ContentLength, }) if err != nil { + // The body cap trips mid-copy when no (or a false) Content-Length was sent. + var tooLarge *http.MaxBytesError + if errors.As(err, &tooLarge) { + httperr.WriteCode(w, req, http.StatusRequestEntityTooLarge, errBodyTooLarge(maxBody)) + return + } writeUpstreamErr(w, req, err) return } @@ -290,6 +395,11 @@ func (p *proxy) httpProxyLimit(agentPath string, maxBody int64) http.HandlerFunc } } +// errBodyTooLarge is the caller-safe 413 detail for a request body over maxBody bytes. +func errBodyTooLarge(maxBody int64) error { + return fmt.Errorf("request body exceeds the %d byte limit", maxBody) +} + // writeUpstreamErr maps transport-level failures on the API→agent leg // to gateway statuses so the dashboard can tell "agent down" (502/504) // apart from API bugs (500). The dashboard's error handling and diff --git a/api/internal/ws/ensure_files.go b/api/internal/ws/ensure_files.go new file mode 100644 index 000000000..4cb69d9c4 --- /dev/null +++ b/api/internal/ws/ensure_files.go @@ -0,0 +1,248 @@ +package ws + +import ( + "context" + "encoding/json" + "errors" + "fmt" + "io" + "log/slog" + "net/http" + "time" + + "github.com/go-chi/chi/v5" + apierrors "k8s.io/apimachinery/pkg/api/errors" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" + "k8s.io/apimachinery/pkg/types" + + "github.com/GameplanePanel/gameplane/api/internal/httperr" + "github.com/GameplanePanel/gameplane/api/internal/kube" + "github.com/GameplanePanel/gameplane/api/internal/messages" + "github.com/GameplanePanel/gameplane/api/internal/scope" +) + +// Annotations shared with the operator (controller.FilesRequestedAtAnnotation and +// controller.IdleAsleepSinceAnnotation). Duplicated on purpose: handlers/lifecycle.go does the same. +const ( + filesRequestedAtAnnotation = "gameplane.local/files-requested-at" + filesIdleAsleepAnnotation = "gameplane.local/idle-asleep-since" +) + +const ( + // filesRequestInterval bounds how often a file request rewrites files-requested-at. The + // operator's idle timer for the file-only pod restarts from that stamp. + filesRequestInterval = time.Minute + // filesReadyTimeout is how long a file request waits for the file-only pod before 503. + filesReadyTimeout = 60 * time.Second + filesPollInterval = time.Second + // filesRefreshInterval is how often a long file request re-checks the stamp. It is half of + // filesRequestInterval so the at-most-once-a-minute patch helper never skips a whole minute. + filesRefreshInterval = filesRequestInterval / 2 +) + +// errFilesStarting means the file-only pod did not answer within filesReadyTimeout. +var errFilesStarting = errors.New("files are starting") + +// filesRoute wraps a file proxy so a stopped or asleep server gets a file-only pod first. +// The route-level RBAC has already run, so unauthorized callers never reach ensureFiles. +func (p *proxy) filesRoute(path string, limit int64) http.HandlerFunc { + return p.agentRoute(func(selected *proxy) http.HandlerFunc { + inner := selected.httpProxyLimit(path, limit) + return func(w http.ResponseWriter, req *http.Request) { + if !selected.ensureFiles(w, req) { + return + } + defer selected.keepFilesRequested(req.Context(), req, filesRefreshInterval, time.Now)() + inner(w, req) + } + }) +} + +// keepFilesRequested refreshes files-requested-at every `every` until the returned stop +// function is called, so a long download or upload to a stopped server keeps its file-only pod +// past the operator's idle timeout. It does nothing for a running server. stop blocks until +// the refresher goroutine has exited, so no patch lands after the handler returned. +func (p *proxy) keepFilesRequested(parent context.Context, req *http.Request, every time.Duration, now func() time.Time) (stop func()) { + noop := func() {} + if p.k == nil || p.k.Dynamic == nil || p.k.Typed == nil || p.transport == nil { + return noop + } + ns, err := scope.Resolve(req) + if err != nil { + return noop + } + name := chi.URLParam(req, "name") + ctx, cancel := context.WithCancel(parent) + done := make(chan struct{}) + go func() { + defer close(done) + ticker := time.NewTicker(every) + defer ticker.Stop() + for { + select { + case <-ctx.Done(): + return + case <-ticker.C: + p.refreshFilesStamp(ctx, ns, name, now()) + } + } + }() + return func() { + cancel() + <-done + } +} + +// refreshFilesStamp re-stamps files-requested-at for a stopped server. Failures are only +// logged: the transfer in flight must not fail because a refresh did. +func (p *proxy) refreshFilesStamp(ctx context.Context, ns, name string, at time.Time) { + gs, err := p.k.GetServer(ctx, ns, name) + if err != nil { + if ctx.Err() == nil { + slog.Warn("refresh files request: get server", "server", name, "err", err) + } + return + } + if p.remoteUID != "" && string(gs.GetUID()) != p.remoteUID { + return + } + if !filesServerStopped(gs) { + return + } + if err := p.requestFilesPod(ctx, gs, at); err != nil && ctx.Err() == nil { + slog.Warn("refresh files request: stamp", "server", name, "err", err) + } +} + +// ensureFiles makes sure a stopped server answers file operations. It returns true when +// the proxy may continue. Otherwise it has already written the response. +func (p *proxy) ensureFiles(w http.ResponseWriter, req *http.Request) bool { + return p.ensureFilesClocked(w, req, time.Now, time.Sleep) +} + +// ensureFilesClocked is ensureFiles with an injected clock, so tests can run the 60 s wait. +func (p *proxy) ensureFilesClocked(w http.ResponseWriter, req *http.Request, now func() time.Time, sleep func(time.Duration)) bool { + // Without a cluster client or agent transport, the proxy writes its usual error. + if p.k == nil || p.k.Dynamic == nil || p.k.Typed == nil || p.transport == nil { + return true + } + ns, err := scope.Resolve(req) + if err != nil { + httperr.Write(w, req, err) + return false + } + err = p.ensureFilesWith(req.Context(), ns, chi.URLParam(req, "name"), now, sleep) + switch { + case err == nil: + return true + case errors.Is(err, errFilesStarting): + w.Header().Set("Retry-After", "2") + httperr.WriteMessage(w, req, messages.New(messages.ID(httperr.IDFilesStarting), nil)) + default: + httperr.Write(w, req, err) + } + return false +} + +// ensureFilesWith is the testable core of ensureFiles. It returns nil for a running server +// (after one GET), or once a stopped server's file-only pod answers. It returns +// errFilesStarting when that does not happen within filesReadyTimeout. +func (p *proxy) ensureFilesWith(ctx context.Context, ns, name string, now func() time.Time, sleep func(time.Duration)) error { + gs, err := p.k.GetServer(ctx, ns, name) + if err != nil { + return fmt.Errorf("get files server: %w", err) + } + // The UID bound by agentRoute must still be this server. A same-named replacement gets + // no file pod from this request. + if p.remoteUID != "" && string(gs.GetUID()) != p.remoteUID { + return apierrors.NewNotFound(kube.GVRs["servers"].GroupResource(), name) + } + if !filesServerStopped(gs) { + return nil + } + if err := p.requestFilesPod(ctx, gs, now()); err != nil { + return err + } + return p.awaitFilesPod(ctx, ns, name, now, sleep) +} + +// filesServerStopped reports whether the server has no game pod to serve files: suspended, +// or idle-asleep (the operator scales the StatefulSet to zero in both cases). +func filesServerStopped(gs *unstructured.Unstructured) bool { + suspended, _, _ := unstructured.NestedBool(gs.Object, "spec", "suspend") + return suspended || gs.GetAnnotations()[filesIdleAsleepAnnotation] != "" +} + +// requestFilesPod stamps files-requested-at, at most once per filesRequestInterval. The stamp +// is the only write: spec and every wake annotation are left alone, so a file request never +// wakes a server. +func (p *proxy) requestFilesPod(ctx context.Context, gs *unstructured.Unstructured, at time.Time) error { + if filesRequestFresh(gs.GetAnnotations()[filesRequestedAtAnnotation], at) { + return nil + } + body, err := json.Marshal(map[string]any{ + "metadata": map[string]any{ + "annotations": map[string]string{filesRequestedAtAnnotation: at.UTC().Format(time.RFC3339)}, + }, + }) + if err != nil { + return fmt.Errorf("encode files request: %w", err) + } + if _, err := p.k.Dynamic.Resource(kube.GVRs["servers"]). + Namespace(gs.GetNamespace()). + Patch(ctx, gs.GetName(), types.MergePatchType, body, metav1.PatchOptions{}); err != nil { + return fmt.Errorf("request files pod: %w", err) + } + return nil +} + +// filesRequestFresh reports whether a files-requested-at stamp is recent enough that no new +// patch is needed. A missing, unparsable or far-future stamp is not fresh. +func filesRequestFresh(stamp string, at time.Time) bool { + t, err := time.Parse(time.RFC3339, stamp) + if err != nil { + return false + } + age := at.Sub(t) + return age > -filesRequestInterval && age < filesRequestInterval +} + +// awaitFilesPod polls until the game pod is gone and the agent answers, or the deadline passes. +func (p *proxy) awaitFilesPod(ctx context.Context, ns, name string, now func() time.Time, sleep func(time.Duration)) error { + deadline := now().Add(filesReadyTimeout) + for { + if p.filesReady(ctx, ns, name) { + return nil + } + if err := ctx.Err(); err != nil { + return err + } + if !now().Before(deadline) { + return errFilesStarting + } + sleep(filesPollInterval) + } +} + +// filesReady is true when the game pod -0 is NotFound (its volume is free) and the +// agent answers a stat of the root. Any error or 5xx means not ready yet. +func (p *proxy) filesReady(ctx context.Context, ns, name string) bool { + _, err := p.k.Typed.CoreV1().Pods(ns).Get(ctx, name+"-0", metav1.GetOptions{}) + if err == nil || !apierrors.IsNotFound(err) { + return false + } + resp, err := p.transport.Do(ctx, agentRequest{ + target: agentTarget{name: name, namespace: ns, uid: p.remoteUID}, + method: http.MethodGet, + path: "/files/stat", + // The root always exists, so a healthy agent answers below 500. + rawQuery: "path=%2F", + }) + if err != nil { + return false + } + _, _ = io.Copy(io.Discard, io.LimitReader(resp.Body, 4<<10)) + _ = resp.Body.Close() + return resp.StatusCode < http.StatusInternalServerError +} diff --git a/api/internal/ws/ensure_files_test.go b/api/internal/ws/ensure_files_test.go new file mode 100644 index 000000000..890881dac --- /dev/null +++ b/api/internal/ws/ensure_files_test.go @@ -0,0 +1,284 @@ +package ws + +import ( + "context" + "encoding/json" + "errors" + "io" + "net/http" + "net/http/httptest" + "strings" + "testing" + "time" + + "github.com/coder/websocket" + "github.com/go-chi/chi/v5" + corev1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" + "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/runtime/schema" + dynamicfake "k8s.io/client-go/dynamic/fake" + k8sfake "k8s.io/client-go/kubernetes/fake" + k8stesting "k8s.io/client-go/testing" + + "github.com/GameplanePanel/gameplane/api/internal/kube" + "github.com/GameplanePanel/gameplane/api/internal/scope" +) + +// scriptedFilesTransport answers agent requests with the scripted status codes, then with +// fallback (200 when zero). It records every agent path it was asked for. +type scriptedFilesTransport struct { + statuses []int + fallback int + paths []string +} + +func (s *scriptedFilesTransport) Do(_ context.Context, op agentRequest) (*http.Response, error) { + s.paths = append(s.paths, op.path) + code := s.fallback + if code == 0 { + code = http.StatusOK + } + if len(s.statuses) > 0 { + code, s.statuses = s.statuses[0], s.statuses[1:] + } + return &http.Response{StatusCode: code, Body: io.NopCloser(strings.NewReader(""))}, nil +} + +func (*scriptedFilesTransport) Dial(context.Context, agentTarget, string, string) (*websocket.Conn, *http.Response, error) { + return nil, nil, errors.New("dial not used by file routes") +} + +// fakeFilesClock is the injected clock: sleeping advances time without blocking. +type fakeFilesClock struct{ now time.Time } + +func (c *fakeFilesClock) Now() time.Time { return c.now } +func (c *fakeFilesClock) Sleep(d time.Duration) { c.now = c.now.Add(d) } + +var filesTestStart = time.Date(2026, 11, 23, 12, 0, 0, 0, time.UTC) + +const filesTestUID = "uid-alpha" + +func filesTestServer(annotations map[string]any, suspend bool) *unstructured.Unstructured { + meta := map[string]any{"name": "alpha", "namespace": scope.DefaultNamespace, "uid": filesTestUID} + if annotations != nil { + meta["annotations"] = annotations + } + return &unstructured.Unstructured{Object: map[string]any{ + "apiVersion": "gameplane.local/v1alpha1", + "kind": "GameServer", + "metadata": meta, + "spec": map[string]any{"suspend": suspend}, + }} +} + +func gamePodNamed(name string) *corev1.Pod { + return &corev1.Pod{ObjectMeta: metav1.ObjectMeta{Name: name + "-0", Namespace: scope.DefaultNamespace}} +} + +type filesFixture struct { + proxy *proxy + typed *k8sfake.Clientset + tr *scriptedFilesTransport + patches []string +} + +// newFilesFixture wires a proxy to fake dynamic and typed clients. Every GameServer patch is +// recorded and then applied by the fake tracker, as the API server would. +func newFilesFixture(t *testing.T, gs *unstructured.Unstructured, tr *scriptedFilesTransport, pods ...*corev1.Pod) *filesFixture { + t.Helper() + dyn := dynamicfake.NewSimpleDynamicClientWithCustomListKinds(runtime.NewScheme(), + map[schema.GroupVersionResource]string{kube.GVRs["servers"]: "GameServerList"}, gs) + objects := make([]runtime.Object, 0, len(pods)) + for _, p := range pods { + objects = append(objects, p) + } + f := &filesFixture{typed: k8sfake.NewSimpleClientset(objects...), tr: tr} + dyn.PrependReactor("patch", "gameservers", func(action k8stesting.Action) (bool, runtime.Object, error) { + f.patches = append(f.patches, string(action.(k8stesting.PatchAction).GetPatch())) + return false, nil, nil + }) + f.proxy = &proxy{ + k: &kube.Client{Dynamic: dyn, Typed: f.typed}, + transport: tr, + remoteUID: filesTestUID, + } + return f +} + +func TestEnsureFilesRunningServerIsNotTouched(t *testing.T) { + f := newFilesFixture(t, filesTestServer(nil, false), &scriptedFilesTransport{}) + clock := &fakeFilesClock{now: filesTestStart} + if err := f.proxy.ensureFilesWith(t.Context(), scope.DefaultNamespace, "alpha", clock.Now, clock.Sleep); err != nil { + t.Fatalf("running server: %v", err) + } + if len(f.patches) != 0 { + t.Fatalf("running server was patched: %v", f.patches) + } + if len(f.tr.paths) != 0 { + t.Fatalf("running server reached the agent: %v", f.tr.paths) + } +} + +func TestEnsureFilesSuspendedServerRequestsOnePod(t *testing.T) { + f := newFilesFixture(t, filesTestServer(nil, true), &scriptedFilesTransport{}) + clock := &fakeFilesClock{now: filesTestStart} + if err := f.proxy.ensureFilesWith(t.Context(), scope.DefaultNamespace, "alpha", clock.Now, clock.Sleep); err != nil { + t.Fatalf("suspended server: %v", err) + } + if len(f.patches) != 1 { + t.Fatalf("patches = %d, want 1", len(f.patches)) + } + var body struct { + Metadata struct { + Annotations map[string]string `json:"annotations"` + } `json:"metadata"` + } + if err := json.Unmarshal([]byte(f.patches[0]), &body); err != nil { + t.Fatalf("patch is not JSON: %v", err) + } + // Only the files stamp is written: no wake annotation and no spec change. + if len(body.Metadata.Annotations) != 1 { + t.Fatalf("patch annotations = %v, want only files-requested-at", body.Metadata.Annotations) + } + if got := body.Metadata.Annotations[filesRequestedAtAnnotation]; got != filesTestStart.Format(time.RFC3339) { + t.Fatalf("files-requested-at = %q, want %q", got, filesTestStart.Format(time.RFC3339)) + } + if strings.Contains(f.patches[0], "spec") || strings.Contains(f.patches[0], "idle-wake") { + t.Fatalf("patch touches spec or a wake annotation: %s", f.patches[0]) + } +} + +func TestEnsureFilesFreshStampSkipsPatch(t *testing.T) { + stamp := filesTestStart.Add(-30 * time.Second).Format(time.RFC3339) + tr := &scriptedFilesTransport{} + f := newFilesFixture(t, filesTestServer(map[string]any{filesRequestedAtAnnotation: stamp}, true), tr) + clock := &fakeFilesClock{now: filesTestStart} + if err := f.proxy.ensureFilesWith(t.Context(), scope.DefaultNamespace, "alpha", clock.Now, clock.Sleep); err != nil { + t.Fatalf("fresh stamp: %v", err) + } + if len(f.patches) != 0 { + t.Fatalf("fresh stamp patched %d times", len(f.patches)) + } + if len(tr.paths) != 1 { + t.Fatalf("agent calls = %d, want 1 readiness check", len(tr.paths)) + } +} + +func TestEnsureFilesStaleStampPatches(t *testing.T) { + stamp := filesTestStart.Add(-90 * time.Second).Format(time.RFC3339) + f := newFilesFixture(t, filesTestServer(map[string]any{filesRequestedAtAnnotation: stamp}, true), &scriptedFilesTransport{}) + clock := &fakeFilesClock{now: filesTestStart} + if err := f.proxy.ensureFilesWith(t.Context(), scope.DefaultNamespace, "alpha", clock.Now, clock.Sleep); err != nil { + t.Fatalf("stale stamp: %v", err) + } + if len(f.patches) != 1 { + t.Fatalf("stale stamp patches = %d, want 1", len(f.patches)) + } +} + +func TestEnsureFilesAsleepCountsAsStopped(t *testing.T) { + asleep := map[string]any{filesIdleAsleepAnnotation: filesTestStart.Add(-time.Hour).Format(time.RFC3339)} + f := newFilesFixture(t, filesTestServer(asleep, false), &scriptedFilesTransport{}) + clock := &fakeFilesClock{now: filesTestStart} + if err := f.proxy.ensureFilesWith(t.Context(), scope.DefaultNamespace, "alpha", clock.Now, clock.Sleep); err != nil { + t.Fatalf("asleep server: %v", err) + } + if len(f.patches) != 1 { + t.Fatalf("asleep server patches = %d, want 1", len(f.patches)) + } + if strings.Contains(f.patches[0], "idle-wake") || strings.Contains(f.patches[0], "suspend") { + t.Fatalf("asleep server wake or spec written: %s", f.patches[0]) + } +} + +func TestEnsureFilesWaitsForGamePodThenAgent(t *testing.T) { + // The game pod is still there at the first check, the agent is not ready twice, then it is. + tr := &scriptedFilesTransport{statuses: []int{http.StatusBadGateway, http.StatusBadGateway, http.StatusOK}} + f := newFilesFixture(t, filesTestServer(nil, true), tr, gamePodNamed("alpha")) + clock := &fakeFilesClock{now: filesTestStart} + deleted := false + sleep := func(d time.Duration) { + clock.Sleep(d) + if !deleted { + deleted = true + _ = f.typed.CoreV1().Pods(scope.DefaultNamespace).Delete(t.Context(), "alpha-0", metav1.DeleteOptions{}) + } + } + if err := f.proxy.ensureFilesWith(t.Context(), scope.DefaultNamespace, "alpha", clock.Now, sleep); err != nil { + t.Fatalf("waiting server: %v", err) + } + if len(f.patches) != 1 { + t.Fatalf("patches = %d, want 1", len(f.patches)) + } + if len(tr.paths) != 3 { + t.Fatalf("agent calls = %d, want 3 (pod gone is checked first)", len(tr.paths)) + } + for _, p := range tr.paths { + if p != "/files/stat" { + t.Fatalf("readiness path = %q, want /files/stat", p) + } + } +} + +func TestEnsureFilesStartingAfterDeadline(t *testing.T) { + tr := &scriptedFilesTransport{fallback: http.StatusBadGateway} + f := newFilesFixture(t, filesTestServer(nil, true), tr) + clock := &fakeFilesClock{now: filesTestStart} + err := f.proxy.ensureFilesWith(t.Context(), scope.DefaultNamespace, "alpha", clock.Now, clock.Sleep) + if !errors.Is(err, errFilesStarting) { + t.Fatalf("err = %v, want errFilesStarting", err) + } + if elapsed := clock.now.Sub(filesTestStart); elapsed < filesReadyTimeout { + t.Fatalf("gave up after %v, before %v", elapsed, filesReadyTimeout) + } +} + +func TestEnsureFilesWrites503WithStartingID(t *testing.T) { + tr := &scriptedFilesTransport{fallback: http.StatusBadGateway} + f := newFilesFixture(t, filesTestServer(nil, true), tr) + clock := &fakeFilesClock{now: filesTestStart} + + req := httptest.NewRequestWithContext(t.Context(), http.MethodGet, "/servers/alpha/files/stat", nil) + req.Header.Set("Accept", "application/problem+json") + rctx := chi.NewRouteContext() + rctx.URLParams.Add("name", "alpha") + req = req.WithContext(context.WithValue(req.Context(), chi.RouteCtxKey, rctx)) + rec := httptest.NewRecorder() + + if f.proxy.ensureFilesClocked(rec, req, clock.Now, clock.Sleep) { + t.Fatal("ensureFiles let a request through while files were starting") + } + if rec.Code != http.StatusServiceUnavailable { + t.Fatalf("status = %d, want 503", rec.Code) + } + if rec.Header().Get("Retry-After") != "2" { + t.Fatalf("Retry-After = %q", rec.Header().Get("Retry-After")) + } + body := rec.Body.String() + if !strings.Contains(body, "server.files.starting") || !strings.Contains(body, "files are starting") { + t.Fatalf("503 body lost its message id or text: %s", body) + } +} + +func TestFilesRequestFreshBoundaries(t *testing.T) { + now := filesTestStart + cases := []struct { + name string + stamp string + want bool + }{ + {"missing", "", false}, + {"unparsable", "yesterday", false}, + {"just written", now.Format(time.RFC3339), true}, + {"just under an interval", now.Add(-filesRequestInterval + time.Second).Format(time.RFC3339), true}, + {"exactly an interval", now.Add(-filesRequestInterval).Format(time.RFC3339), false}, + {"far future", now.Add(time.Hour).Format(time.RFC3339), false}, + } + for _, tc := range cases { + if got := filesRequestFresh(tc.stamp, now); got != tc.want { + t.Errorf("%s: fresh = %v, want %v", tc.name, got, tc.want) + } + } +} diff --git a/api/internal/ws/files_limits_test.go b/api/internal/ws/files_limits_test.go new file mode 100644 index 000000000..009b754bc --- /dev/null +++ b/api/internal/ws/files_limits_test.go @@ -0,0 +1,280 @@ +package ws + +import ( + "context" + "errors" + "fmt" + "io" + "net/http" + "net/http/httptest" + "strings" + "sync" + "testing" + "time" + + "github.com/coder/websocket" + "github.com/go-chi/chi/v5" + "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/runtime/schema" + dynamicfake "k8s.io/client-go/dynamic/fake" + k8sfake "k8s.io/client-go/kubernetes/fake" + k8stesting "k8s.io/client-go/testing" + + "github.com/GameplanePanel/gameplane/api/internal/kube" + "github.com/GameplanePanel/gameplane/api/internal/scope" +) + +// readingTransport drains the request body like a real upstream copy and fails with the body's +// own error, wrapped, as net/http does when the cap trips mid-copy. +type readingTransport struct { + mu sync.Mutex + calls int + got int + err error +} + +func (r *readingTransport) Do(_ context.Context, op agentRequest) (*http.Response, error) { + r.mu.Lock() + r.calls++ + r.mu.Unlock() + var ( + n int64 + err error + ) + if op.body != nil { + n, err = io.Copy(io.Discard, op.body) + } + r.mu.Lock() + r.got = int(n) + r.mu.Unlock() + if err != nil { + return nil, fmt.Errorf("upstream copy: %w", err) + } + if r.err != nil { + return nil, r.err + } + return &http.Response{StatusCode: http.StatusOK, Header: http.Header{}, Body: io.NopCloser(strings.NewReader(""))}, nil +} + +func (*readingTransport) Dial(context.Context, agentTarget, string, string) (*websocket.Conn, *http.Response, error) { + return nil, nil, errors.New("dial not used") +} + +func (r *readingTransport) callCount() int { + r.mu.Lock() + defer r.mu.Unlock() + return r.calls +} + +func limitRequest(t *testing.T, h http.Handler, body string, contentLength int64) *httptest.ResponseRecorder { + t.Helper() + router := chi.NewRouter() + router.Put("/servers/{name}/files/stream", h.ServeHTTP) + req := httptest.NewRequestWithContext(t.Context(), http.MethodPut, "/servers/alpha/files/stream?path=/a", io.NopCloser(strings.NewReader(body))) + req.ContentLength = contentLength + req.Header.Set("Accept", "application/problem+json") + rec := httptest.NewRecorder() + router.ServeHTTP(rec, req) + return rec +} + +func TestHTTPProxyLimitDeclaredLengthOverCapIs413(t *testing.T) { + tr := &readingTransport{} + p := &proxy{transport: tr} + rec := limitRequest(t, p.httpProxyLimit("/files/stream", 16), strings.Repeat("x", 64), 64) + if rec.Code != http.StatusRequestEntityTooLarge { + t.Fatalf("status = %d, want 413: %s", rec.Code, rec.Body.String()) + } + if !strings.Contains(rec.Body.String(), "server.generic.413") { + t.Fatalf("413 lost its message id: %s", rec.Body.String()) + } + if tr.callCount() != 0 { + t.Fatal("an over-limit upload reached the agent transport") + } +} + +func TestHTTPProxyLimitUnknownLengthOverCapIs413(t *testing.T) { + tr := &readingTransport{} + p := &proxy{transport: tr} + // No Content-Length (-1), so the cap trips during the upstream copy. + rec := limitRequest(t, p.httpProxyLimit("/files/stream", 16), strings.Repeat("x", 64), -1) + if rec.Code != http.StatusRequestEntityTooLarge { + t.Fatalf("status = %d, want 413: %s", rec.Code, rec.Body.String()) + } + if tr.callCount() != 1 { + t.Fatalf("transport calls = %d, want 1", tr.callCount()) + } +} + +func TestHTTPProxyLimitWithinCapAndOtherErrors(t *testing.T) { + tr := &readingTransport{} + p := &proxy{transport: tr} + if rec := limitRequest(t, p.httpProxyLimit("/files/stream", 16), strings.Repeat("x", 16), 16); rec.Code != http.StatusOK { + t.Fatalf("at-limit upload status = %d, want 200", rec.Code) + } + if rec := limitRequest(t, p.httpProxyLimit("/files/stream", 16), strings.Repeat("x", 16), -1); rec.Code != http.StatusOK { + t.Fatalf("at-limit unknown-length upload status = %d, want 200", rec.Code) + } + // A transport failure that is not the body cap stays a gateway error. + tr.err = errors.New("connection refused") + if rec := limitRequest(t, p.httpProxyLimit("/files/stream", 16), "x", 1); rec.Code != http.StatusBadGateway { + t.Fatalf("transport failure status = %d, want 502", rec.Code) + } +} + +// refreshFixture is a stopped (or running) GameServer behind fake clients. Patches are counted +// through a channel, so a refresher goroutine can be observed without a data race. +type refreshFixture struct { + proxy *proxy + patched chan string +} + +func newRefreshFixture(t *testing.T, suspend bool, patchErr error) *refreshFixture { + t.Helper() + dyn := dynamicfake.NewSimpleDynamicClientWithCustomListKinds(runtime.NewScheme(), + map[schema.GroupVersionResource]string{kube.GVRs["servers"]: "GameServerList"}, filesTestServer(nil, suspend)) + f := &refreshFixture{patched: make(chan string, 64)} + dyn.PrependReactor("patch", "gameservers", func(action k8stesting.Action) (bool, runtime.Object, error) { + f.patched <- string(action.(k8stesting.PatchAction).GetPatch()) + if patchErr != nil { + return true, nil, patchErr + } + return false, nil, nil + }) + f.proxy = &proxy{ + k: &kube.Client{Dynamic: dyn, Typed: k8sfake.NewSimpleClientset()}, + transport: &readingTransport{}, + remoteUID: filesTestUID, + } + return f +} + +// advancingClock moves two minutes on every call, so each refresh sees a stale stamp. +func advancingClock() func() time.Time { + var mu sync.Mutex + at := filesTestStart + return func() time.Time { + mu.Lock() + defer mu.Unlock() + at = at.Add(2 * time.Minute) + return at + } +} + +func filesRefreshRequest(t *testing.T, target string) *http.Request { + t.Helper() + req := httptest.NewRequestWithContext(t.Context(), http.MethodGet, target, nil) + rctx := chi.NewRouteContext() + rctx.URLParams.Add("name", "alpha") + return req.WithContext(context.WithValue(req.Context(), chi.RouteCtxKey, rctx)) +} + +func waitPatch(t *testing.T, f *refreshFixture) { + t.Helper() + select { + case <-f.patched: + case <-time.After(10 * time.Second): + t.Fatal("no files-requested-at refresh arrived") + } +} + +func TestKeepFilesRequestedRefreshesUntilStopped(t *testing.T) { + f := newRefreshFixture(t, true, nil) + req := filesRefreshRequest(t, "/servers/alpha/files/download?path=/a") + stop := f.proxy.keepFilesRequested(t.Context(), req, 5*time.Millisecond, advancingClock()) + + // The stamp is rewritten again and again while the request is in flight. + waitPatch(t, f) + waitPatch(t, f) + waitPatch(t, f) + stop() + + // stop waits for the goroutine, so nothing lands afterwards. + for len(f.patched) > 0 { + <-f.patched + } + time.Sleep(50 * time.Millisecond) + if n := len(f.patched); n != 0 { + t.Fatalf("%d refreshes after stop", n) + } +} + +func TestKeepFilesRequestedStopsWithItsContext(t *testing.T) { + f := newRefreshFixture(t, true, nil) + req := filesRefreshRequest(t, "/servers/alpha/files/download?path=/a") + ctx, cancel := context.WithCancel(t.Context()) + stop := f.proxy.keepFilesRequested(ctx, req, 5*time.Millisecond, advancingClock()) + waitPatch(t, f) + cancel() + stop() +} + +func TestKeepFilesRequestedLeavesRunningServerAlone(t *testing.T) { + f := newRefreshFixture(t, false, nil) + req := filesRefreshRequest(t, "/servers/alpha/files/download?path=/a") + stop := f.proxy.keepFilesRequested(t.Context(), req, 2*time.Millisecond, advancingClock()) + time.Sleep(60 * time.Millisecond) + stop() + if n := len(f.patched); n != 0 { + t.Fatalf("running server patched %d times", n) + } +} + +func TestKeepFilesRequestedNoopWithoutClusterOrNamespace(t *testing.T) { + req := filesRefreshRequest(t, "/servers/alpha/files/download?path=/a") + (&proxy{}).keepFilesRequested(t.Context(), req, time.Millisecond, time.Now)() + + f := newRefreshFixture(t, true, nil) + bad := filesRefreshRequest(t, "/servers/alpha/files/download?namespace=not-an-allowed-namespace") + f.proxy.keepFilesRequested(t.Context(), bad, time.Millisecond, time.Now)() + if n := len(f.patched); n != 0 { + t.Fatalf("refresher ran for a forbidden namespace (%d patches)", n) + } +} + +func TestRefreshFilesStampFailuresAreSwallowed(t *testing.T) { + // A failing patch is logged, not returned. + f := newRefreshFixture(t, true, errors.New("patch refused")) + f.proxy.refreshFilesStamp(t.Context(), scope.DefaultNamespace, "alpha", filesTestStart) + waitPatch(t, f) + + // A server that is gone, and one replaced under the same name, are both left alone. + f.proxy.refreshFilesStamp(t.Context(), scope.DefaultNamespace, "missing", filesTestStart) + f.proxy.remoteUID = "another-uid" + f.proxy.refreshFilesStamp(t.Context(), scope.DefaultNamespace, "alpha", filesTestStart) + if n := len(f.patched); n != 0 { + t.Fatalf("%d unexpected patches", n) + } + + // A cancelled context hides the error log but still returns quietly. + ctx, cancel := context.WithCancel(t.Context()) + cancel() + f.proxy.remoteUID = filesTestUID + f.proxy.refreshFilesStamp(ctx, scope.DefaultNamespace, "alpha", filesTestStart) +} + +func TestFilesRouteServesStoppedServerAndStopsRefresher(t *testing.T) { + f := newRefreshFixture(t, true, nil) + router := chi.NewRouter() + router.Get("/servers/{name}/files/download", f.proxy.filesRoute("/files/download", defaultBodyLimit)) + req := httptest.NewRequestWithContext(t.Context(), http.MethodGet, "/servers/alpha/files/download?path=/a", nil) + rec := httptest.NewRecorder() + router.ServeHTTP(rec, req) + if rec.Code != http.StatusOK { + t.Fatalf("status = %d: %s", rec.Code, rec.Body.String()) + } + // The request stamped the server once on entry. + waitPatch(t, f) +} + +func TestMountWithGatewayNamespaceOption(t *testing.T) { + reg := kube.NewRegistry(scope.DefaultCluster) + r := chi.NewRouter() + Mount(r, reg, "", "", "", AgentGatewayOptions{Namespace: "gameplane-system", MaxUploadBytes: 1 << 20}) + rec := httptest.NewRecorder() + r.ServeHTTP(rec, httptest.NewRequestWithContext(t.Context(), http.MethodGet, "/servers/alpha/files/stat?path=/", nil)) + // Without mTLS material or a cluster client the route answers 503 instead of panicking. + if rec.Code != http.StatusServiceUnavailable { + t.Fatalf("status = %d, want 503", rec.Code) + } +} diff --git a/api/internal/ws/files_stream_envtest_test.go b/api/internal/ws/files_stream_envtest_test.go new file mode 100644 index 000000000..f5addec40 --- /dev/null +++ b/api/internal/ws/files_stream_envtest_test.go @@ -0,0 +1,249 @@ +package ws + +// Stream, rename and stat file routes through the real rbac middleware and the real direct +// agent transport. The agent is a local mTLS server; the cluster is a fake dynamic client, so +// this test needs no envtest cluster and runs with the normal unit suite. + +import ( + "crypto/ecdsa" + "crypto/elliptic" + "crypto/rand" + "crypto/tls" + "crypto/x509" + "crypto/x509/pkix" + "encoding/pem" + "io" + "math/big" + "net" + "net/http" + "net/http/httptest" + "os" + "path/filepath" + "strings" + "sync" + "testing" + "time" + + "github.com/go-chi/chi/v5" + "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/runtime/schema" + dynamicfake "k8s.io/client-go/dynamic/fake" + k8sfake "k8s.io/client-go/kubernetes/fake" + + "github.com/GameplanePanel/gameplane/api/internal/auth" + "github.com/GameplanePanel/gameplane/api/internal/kube" + "github.com/GameplanePanel/gameplane/api/internal/rbac" + "github.com/GameplanePanel/gameplane/api/internal/scope" +) + +// filesAgentServer is a local mTLS stand-in for the agent. It records every operation it +// completely received, as "METHOD /path". +type filesAgentServer struct { + addr string + mu sync.Mutex + seen []string +} + +func (s *filesAgentServer) ServeHTTP(w http.ResponseWriter, r *http.Request) { + if _, err := io.ReadAll(r.Body); err != nil { + // A truncated body is never recorded as a completed operation. + w.WriteHeader(http.StatusBadRequest) + return + } + s.mu.Lock() + s.seen = append(s.seen, r.Method+" "+r.URL.Path) + s.mu.Unlock() + w.WriteHeader(http.StatusOK) +} + +func (s *filesAgentServer) count() int { + s.mu.Lock() + defer s.mu.Unlock() + return len(s.seen) +} + +func (s *filesAgentServer) last() string { + s.mu.Lock() + defer s.mu.Unlock() + if len(s.seen) == 0 { + return "" + } + return s.seen[len(s.seen)-1] +} + +// newFilesAgentServer starts the mTLS agent. One self-signed ECDSA certificate (IP SAN +// 127.0.0.1, usable for server and client auth) is the trust anchor for both directions. It +// writes the CA, client certificate and client key the API's mTLS loader expects. +func newFilesAgentServer(t *testing.T) (*filesAgentServer, string, string, string) { + t.Helper() + key, err := ecdsa.GenerateKey(elliptic.P256(), rand.Reader) + if err != nil { + t.Fatal(err) + } + tmpl := &x509.Certificate{ + SerialNumber: big.NewInt(1), + Subject: pkix.Name{CommonName: "files-agent-test"}, + NotBefore: time.Now().Add(-time.Minute), + NotAfter: time.Now().Add(time.Hour), + IPAddresses: []net.IP{net.ParseIP("127.0.0.1")}, + BasicConstraintsValid: true, + IsCA: true, + KeyUsage: x509.KeyUsageDigitalSignature | x509.KeyUsageCertSign, + ExtKeyUsage: []x509.ExtKeyUsage{x509.ExtKeyUsageServerAuth, x509.ExtKeyUsageClientAuth}, + } + der, err := x509.CreateCertificate(rand.Reader, tmpl, tmpl, &key.PublicKey, key) + if err != nil { + t.Fatal(err) + } + certPEM := pem.EncodeToMemory(&pem.Block{Type: "CERTIFICATE", Bytes: der}) + keyDER, err := x509.MarshalECPrivateKey(key) + if err != nil { + t.Fatal(err) + } + keyPEM := pem.EncodeToMemory(&pem.Block{Type: "EC PRIVATE KEY", Bytes: keyDER}) + + dir := t.TempDir() + caFile := filepath.Join(dir, "ca.crt") + certFile := filepath.Join(dir, "client.crt") + keyFile := filepath.Join(dir, "client.key") + for path, data := range map[string][]byte{caFile: certPEM, certFile: certPEM, keyFile: keyPEM} { + if err := os.WriteFile(path, data, 0o600); err != nil { + t.Fatal(err) + } + } + pool := x509.NewCertPool() + pool.AppendCertsFromPEM(certPEM) + + agent := &filesAgentServer{} + srv := httptest.NewUnstartedServer(agent) + srv.TLS = &tls.Config{ + MinVersion: tls.VersionTLS12, + Certificates: []tls.Certificate{{Certificate: [][]byte{der}, PrivateKey: key}}, + ClientAuth: tls.RequireAndVerifyClientCert, + ClientCAs: pool, + } + srv.StartTLS() + t.Cleanup(srv.Close) + agent.addr = srv.Listener.Addr().String() + return agent, caFile, certFile, keyFile +} + +// filesPerms grants perms on the test namespace of the home cluster, as a role binding would. +func filesPerms(perms ...string) map[string]map[string]map[string]struct{} { + set := map[string]struct{}{} + for _, p := range perms { + set[p] = struct{}{} + } + return map[string]map[string]map[string]struct{}{scope.DefaultCluster: {scope.DefaultNamespace: set}} +} + +// newFilesRouter mounts the file routes behind the real rbac middleware. The running GameServer +// is owned by user 42 and shared with user 43. +func newFilesRouter(t *testing.T, agentAddr, caFile, certFile, keyFile string, maxUpload int64) http.Handler { + t.Helper() + gs := filesTestServer(map[string]any{ + "gameplane.local/owner-id": "42", + "gameplane.local/collaborators": "43", + }, false) + dyn := dynamicfake.NewSimpleDynamicClientWithCustomListKinds(runtime.NewScheme(), + map[schema.GroupVersionResource]string{kube.GVRs["servers"]: "GameServerList"}, gs) + reg := kube.NewRegistry(scope.DefaultCluster) + reg.Set(scope.DefaultCluster, &kube.Client{Dynamic: dyn, Typed: k8sfake.NewSimpleClientset()}) + files := rbac.NewFileAccess(reg, nil) + + r := chi.NewRouter() + r.Use(rbac.MiddlewareWithFiles(reg, files)) + Mount(r, reg, caFile, certFile, keyFile, AgentGatewayOptions{ + Files: files, + MaxUploadBytes: maxUpload, + AgentHost: func(_, _ string) string { return agentAddr }, + }) + return r +} + +func doFilesRequest(t *testing.T, h http.Handler, user *auth.User, method, target, body string) *httptest.ResponseRecorder { + t.Helper() + req := httptest.NewRequestWithContext(t.Context(), method, target, strings.NewReader(body)) + req = req.WithContext(auth.WithUser(req.Context(), user)) + rec := httptest.NewRecorder() + h.ServeHTTP(rec, req) + return rec +} + +func TestFileRoutesAuthorizeByRoleThroughAgentTransport(t *testing.T) { + agent, caFile, certFile, keyFile := newFilesAgentServer(t) + h := newFilesRouter(t, agent.addr, caFile, certFile, keyFile, 1<<20) + + viewer := &auth.User{ID: 10, Perms: filesPerms("servers:read")} + operator := &auth.User{ID: 11, Perms: filesPerms("servers:read", "servers:write")} + owner := &auth.User{ID: 42} + collaborator := &auth.User{ID: 43} + stranger := &auth.User{ID: 99} + + const ( + statURL = "/servers/alpha/files/stat?path=/" + streamURL = "/servers/alpha/files/stream?path=/a.bin&offset=0" + renameURL = "/servers/alpha/files/rename" + renameBod = `{"from":"/a","to":"/b"}` + agentStat = "/v1/targets/" + filesTestUID + "/files/stat" + agentStrm = "/v1/targets/" + filesTestUID + "/files/stream" + agentRnm = "/v1/targets/" + filesTestUID + "/files/rename" + ) + cases := []struct { + name, method, target, body string + user *auth.User + want int + agentOp string + }{ + {"viewer stat", http.MethodGet, statURL, "", viewer, http.StatusOK, "GET " + agentStat}, + {"viewer stream denied", http.MethodPut, streamURL, "data", viewer, http.StatusForbidden, ""}, + {"viewer rename denied", http.MethodPost, renameURL, renameBod, viewer, http.StatusForbidden, ""}, + {"operator stream", http.MethodPut, streamURL, "data", operator, http.StatusOK, "PUT " + agentStrm}, + {"operator rename", http.MethodPost, renameURL, renameBod, operator, http.StatusOK, "POST " + agentRnm}, + {"owner stat", http.MethodGet, statURL, "", owner, http.StatusOK, "GET " + agentStat}, + {"owner stream", http.MethodPut, streamURL, "data", owner, http.StatusOK, "PUT " + agentStrm}, + {"collaborator rename", http.MethodPost, renameURL, renameBod, collaborator, http.StatusOK, "POST " + agentRnm}, + {"stranger stat denied", http.MethodGet, statURL, "", stranger, http.StatusForbidden, ""}, + } + for _, tc := range cases { + t.Run(tc.name, func(t *testing.T) { + before := agent.count() + rec := doFilesRequest(t, h, tc.user, tc.method, tc.target, tc.body) + if rec.Code != tc.want { + t.Fatalf("status = %d, want %d (body %q)", rec.Code, tc.want, rec.Body.String()) + } + if tc.agentOp == "" { + if agent.count() != before { + t.Fatalf("denied request reached the agent: %s", agent.last()) + } + return + } + if agent.count() != before+1 || agent.last() != tc.agentOp { + t.Fatalf("agent saw %q (count %d -> %d), want %q", agent.last(), before, agent.count(), tc.agentOp) + } + }) + } +} + +func TestFileStreamOverUploadLimitNeverReachesAgent(t *testing.T) { + agent, caFile, certFile, keyFile := newFilesAgentServer(t) + const limit = 16 + h := newFilesRouter(t, agent.addr, caFile, certFile, keyFile, limit) + operator := &auth.User{ID: 11, Perms: filesPerms("servers:read", "servers:write")} + + before := agent.count() + rec := doFilesRequest(t, h, operator, http.MethodPut, + "/servers/alpha/files/stream?path=/big.bin&offset=0", strings.Repeat("x", limit*4)) + if rec.Code != http.StatusRequestEntityTooLarge { + t.Fatalf("over-limit upload status = %d, want 413: %s", rec.Code, rec.Body.String()) + } + if agent.count() != before { + t.Fatalf("over-limit upload completed at the agent: %s", agent.last()) + } + // A within-limit upload still completes, so the cap is the only difference. + rec = doFilesRequest(t, h, operator, http.MethodPut, + "/servers/alpha/files/stream?path=/small.bin&offset=0", strings.Repeat("x", limit)) + if rec.Code != http.StatusOK { + t.Fatalf("within-limit upload status = %d: %s", rec.Code, rec.Body.String()) + } +} diff --git a/api/internal/ws/gateway_client.go b/api/internal/ws/gateway_client.go index cadaddf2a..d896c0902 100644 --- a/api/internal/ws/gateway_client.go +++ b/api/internal/ws/gateway_client.go @@ -30,8 +30,16 @@ const gatewayCredentialsLabel = "gameplane.local/agent-gateway-credentials" var errGatewayUnavailable = errors.New("agent gateway not configured") // AgentGatewayOptions enables registered-cluster agent routes. Secrets are read -// only from the central API's configured credentials namespace. -type AgentGatewayOptions struct{ Namespace string } +// only from the central API's configured credentials namespace. Files authorizes +// the rename body (see filesRename); MaxUploadBytes caps files/stream (0 = 20 GiB). +type AgentGatewayOptions struct { + Namespace string + Files *rbac.FileChecker + MaxUploadBytes int64 + // AgentHost overrides the in-cluster agent host:port of the direct transport. Tests + // use it to reach a local TLS server; nil keeps the service DNS name. + AgentHost func(name, namespace string) string +} type agentGatewayResolver struct { registry *kube.Registry @@ -173,6 +181,7 @@ func (t *gatewayAgentTransport) Do(ctx context.Context, operation agentRequest) if err != nil { return nil, fmt.Errorf("build gateway agent request: %w", err) } + operation.applyContentLength(req) copyProxyHeaders(req.Header, operation.header) client := t.http if gatewayprotocol.LongRunningOperation(operation.method, operation.path) { diff --git a/api/internal/ws/transport.go b/api/internal/ws/transport.go index 85cb54cf3..8306c8b14 100644 --- a/api/internal/ws/transport.go +++ b/api/internal/ws/transport.go @@ -39,6 +39,17 @@ type agentRequest struct { rawQuery string header http.Header body io.Reader + // contentLength is the caller's declared body size. Zero means unknown, + // so the outgoing request keeps the length net/http derives from body. + contentLength int64 +} + +// applyContentLength forwards a known body length so the agent's free-space +// and size pre-checks see the real size instead of a chunked body. +func (operation agentRequest) applyContentLength(req *http.Request) { + if operation.contentLength > 0 { + req.ContentLength = operation.contentLength + } } // agentTransport separates agent operations from their network route. A @@ -123,6 +134,7 @@ func (t *directAgentTransport) Do(ctx context.Context, operation agentRequest) ( if err != nil { return nil, err } + operation.applyContentLength(req) // Keep browser session material out of agents even for internal callers. copyProxyHeaders(req.Header, operation.header) return t.http.Do(req) diff --git a/api/internal/ws/transport_content_length_test.go b/api/internal/ws/transport_content_length_test.go new file mode 100644 index 000000000..2d5cbb52e --- /dev/null +++ b/api/internal/ws/transport_content_length_test.go @@ -0,0 +1,101 @@ +package ws + +import ( + "io" + "net/http" + "net/http/httptest" + "net/url" + "strings" + "testing" + + "github.com/GameplanePanel/gameplane/api/internal/gatewayprotocol" +) + +// contentLengthRoundTripper records the outgoing request's ContentLength and +// answers 204 without touching the network. +type contentLengthRoundTripper struct { + seen *int64 +} + +func (rt contentLengthRoundTripper) RoundTrip(req *http.Request) (*http.Response, error) { + *rt.seen = req.ContentLength + _, _ = io.Copy(io.Discard, req.Body) + return &http.Response{ + StatusCode: http.StatusNoContent, + Body: http.NoBody, + Header: http.Header{}, + Request: req, + }, nil +} + +func TestDirectAgentTransportForwardsKnownContentLength(t *testing.T) { + const payload = "enabled=true" + srv := httptest.NewTLSServer(http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) { + if req.ContentLength != int64(len(payload)) { + t.Errorf("agent saw ContentLength = %d, want %d", req.ContentLength, len(payload)) + } + w.WriteHeader(http.StatusNoContent) + })) + defer srv.Close() + resp, err := testDirectTransport(srv).Do(t.Context(), agentRequest{ + target: agentTarget{name: "alpha", namespace: "gameplane-games"}, + method: http.MethodPost, path: "/files/stream", rawQuery: "path=world.zip", + body: strings.NewReader(payload), + contentLength: int64(len(payload)), + }) + if err != nil { + t.Fatal(err) + } + defer resp.Body.Close() + if resp.StatusCode != http.StatusNoContent { + t.Fatalf("status = %d", resp.StatusCode) + } +} + +func TestDirectAgentTransportUnknownContentLengthStaysChunked(t *testing.T) { + const payload = "chunk" + srv := httptest.NewTLSServer(http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) { + if req.ContentLength != -1 { + t.Errorf("agent saw ContentLength = %d, want -1 (chunked)", req.ContentLength) + } + _, _ = io.Copy(io.Discard, req.Body) + w.WriteHeader(http.StatusNoContent) + })) + defer srv.Close() + // An unrecognised reader type gives net/http no length, and zero means unknown. + resp, err := testDirectTransport(srv).Do(t.Context(), agentRequest{ + target: agentTarget{name: "alpha", namespace: "gameplane-games"}, + method: http.MethodPost, path: "/files/stream", rawQuery: "path=world.zip", + body: io.MultiReader(strings.NewReader(payload)), + }) + if err != nil { + t.Fatal(err) + } + defer resp.Body.Close() + if resp.StatusCode != http.StatusNoContent { + t.Fatalf("status = %d", resp.StatusCode) + } +} + +func TestGatewayTransportForwardsKnownContentLength(t *testing.T) { + const payload = "setting=true" + var seen int64 = -2 + transport := &gatewayAgentTransport{ + base: &url.URL{Scheme: "https", Host: "gateway.test"}, + target: gatewayprotocol.Target{Cluster: "remote", Namespace: "games", Name: "alpha", UID: "remote-uid"}, + http: &http.Client{Transport: contentLengthRoundTripper{seen: &seen}}, + } + resp, err := transport.Do(t.Context(), agentRequest{ + target: agentTarget{name: "alpha", namespace: "games"}, + method: http.MethodPost, path: "/files/write", rawQuery: "path=config.ini", + body: strings.NewReader(payload), + contentLength: int64(len(payload)), + }) + if err != nil { + t.Fatal(err) + } + defer resp.Body.Close() + if seen != int64(len(payload)) { + t.Fatalf("gateway upstream ContentLength = %d, want %d", seen, len(payload)) + } +} diff --git a/api/specs.md b/api/specs.md index 9999cf52f..989a43b31 100644 --- a/api/specs.md +++ b/api/specs.md @@ -338,6 +338,24 @@ trust assumptions, rotation behavior and surfaces outside this protocol. - Gated by `captures:manage` permission - Audit: synchronous write before response with reason "feature_disabled", "server_not_found", "terminating", "patch_failed", or "" on success +### SFTP access (spec 040) + +**Personal credentials** (`api/internal/handlers/sftp.go`, mounted on `/users`, session callers only; SFTP-session and MCP-token callers are refused): +- `GET /users/me/sftp`: the caller's SFTP view (keys, whether a password exists, address and host key fingerprint when SFTP is enabled). +- `POST /users/me/sftp/keys`: add one public key (ed25519, ECDSA or RSA of at least 3072 bits; at most 20 per user; a key may belong to one account only). `DELETE /users/me/sftp/keys/{id}` removes it and ends sessions that used it. +- `POST /users/me/sftp/password`: generate the one password (length 20 to 40). The plaintext is returned once; only a hash is stored. `DELETE /users/me/sftp/password` revokes it. +- Admins with `users:manage`: `GET /users/{id}/sftp`, `DELETE /users/{id}/sftp/keys/{keyId}`, `DELETE /users/{id}/sftp/password`. + +**Remote endpoints and service tokens** (`sftp_cluster.go`, mounted under `/clusters`, `cluster:manage`): +- `GET /clusters/{name}/sftp`: the endpoint (`local` for the panel's own cluster) and active service tokens. Token secrets are never listed; rows show the prefix only. +- `PUT /clusters/{name}/sftp`: set `address` and `hostKeyFingerprint` (`SHA256:` form) for a remote cluster. Refused for `local` with `server.sftp.endpoint_local`; the local endpoint comes from Helm. +- `POST /clusters/{name}/sftp-token`: mint a `gpsftps_` service token, returned once (201). At most two active per cluster; a third returns 409 `server.sftp.token_limit_reached`. Only the digest is stored. +- `DELETE /clusters/{name}/sftp-token/{id}`: revoke (204). Tokens of other clusters are not found. + +**Endpoint-facing routes** (`sftp_login.go`, mounted under `/sftp/v1` outside the protected group, authenticated by the service token or the session token the endpoint holds, never by a dashboard cookie): `POST /sftp/v1/login` resolves username and credential to a session; `POST /sftp/v1/sessions/check` re-validates open sessions (revocation and user disable end them within 60 s, SC-006); `POST /sftp/v1/sessions/end`; `GET /sftp/v1/servers` lists the servers the session can read. Every file operation after login goes to the agent through the normal file routes as the signed-in user, with the same RBAC checks as the Files tab, and is audited with `source: sftp`. + +**Permissions:** reading needs `servers:read` (or ownership or collaborator access); writing, renaming and deleting need `servers:write` (or the same ownership or collaborator access). The data-root and server folders are read-only over SFTP. + ### OIDC role mapping and Helm-seeded provider (install-time configuration) **Helm-seeded provider synthesis & coexistence:** diff --git a/assets/design-export/fig/1-46380.fig b/assets/design-export/fig/1-46380.fig new file mode 100644 index 000000000..a43620c34 Binary files /dev/null and b/assets/design-export/fig/1-46380.fig differ diff --git a/assets/design-export/fig/1-46381.fig b/assets/design-export/fig/1-46381.fig new file mode 100644 index 000000000..3c3375890 Binary files /dev/null and b/assets/design-export/fig/1-46381.fig differ diff --git a/assets/design-export/fig/1-46382.fig b/assets/design-export/fig/1-46382.fig new file mode 100644 index 000000000..54ad0444a Binary files /dev/null and b/assets/design-export/fig/1-46382.fig differ diff --git a/assets/design-export/fig/1-46383.fig b/assets/design-export/fig/1-46383.fig new file mode 100644 index 000000000..209cb4b6b Binary files /dev/null and b/assets/design-export/fig/1-46383.fig differ diff --git a/assets/design-export/fig/1-46384.fig b/assets/design-export/fig/1-46384.fig new file mode 100644 index 000000000..306fc3d90 Binary files /dev/null and b/assets/design-export/fig/1-46384.fig differ diff --git a/assets/design-export/fig/1-46385.fig b/assets/design-export/fig/1-46385.fig new file mode 100644 index 000000000..71cb21ba0 Binary files /dev/null and b/assets/design-export/fig/1-46385.fig differ diff --git a/assets/design-export/fig/1-46386.fig b/assets/design-export/fig/1-46386.fig new file mode 100644 index 000000000..84bc555d1 Binary files /dev/null and b/assets/design-export/fig/1-46386.fig differ diff --git a/assets/design-export/fig/1-46387.fig b/assets/design-export/fig/1-46387.fig new file mode 100644 index 000000000..a60b89a4d Binary files /dev/null and b/assets/design-export/fig/1-46387.fig differ diff --git a/assets/design-export/fig/1-46388.fig b/assets/design-export/fig/1-46388.fig new file mode 100644 index 000000000..c01ed5fd2 Binary files /dev/null and b/assets/design-export/fig/1-46388.fig differ diff --git a/assets/design-export/fig/1-46390.fig b/assets/design-export/fig/1-46390.fig new file mode 100644 index 000000000..5ac6c6866 Binary files /dev/null and b/assets/design-export/fig/1-46390.fig differ diff --git a/assets/design-export/fig/1-46391.fig b/assets/design-export/fig/1-46391.fig new file mode 100644 index 000000000..966d99535 Binary files /dev/null and b/assets/design-export/fig/1-46391.fig differ diff --git a/assets/design-export/fig/1-46392.fig b/assets/design-export/fig/1-46392.fig new file mode 100644 index 000000000..f836f60e7 Binary files /dev/null and b/assets/design-export/fig/1-46392.fig differ diff --git a/assets/design-export/fig/1-46393.fig b/assets/design-export/fig/1-46393.fig new file mode 100644 index 000000000..8aec31ec4 Binary files /dev/null and b/assets/design-export/fig/1-46393.fig differ diff --git a/assets/design-export/fig/1-46394.fig b/assets/design-export/fig/1-46394.fig new file mode 100644 index 000000000..4ee2bbcd7 Binary files /dev/null and b/assets/design-export/fig/1-46394.fig differ diff --git a/assets/design-export/fig/1-46395.fig b/assets/design-export/fig/1-46395.fig new file mode 100644 index 000000000..54ba73fa7 Binary files /dev/null and b/assets/design-export/fig/1-46395.fig differ diff --git a/assets/design-export/fig/1-46396.fig b/assets/design-export/fig/1-46396.fig new file mode 100644 index 000000000..8783d45bc Binary files /dev/null and b/assets/design-export/fig/1-46396.fig differ diff --git a/assets/design-export/fig/1-46397.fig b/assets/design-export/fig/1-46397.fig new file mode 100644 index 000000000..cc84bd4d0 Binary files /dev/null and b/assets/design-export/fig/1-46397.fig differ diff --git a/assets/design-export/fig/1-46398.fig b/assets/design-export/fig/1-46398.fig new file mode 100644 index 000000000..823d929d3 Binary files /dev/null and b/assets/design-export/fig/1-46398.fig differ diff --git a/assets/design-export/fig/1006926387-2294.fig b/assets/design-export/fig/1006926387-2294.fig new file mode 100644 index 000000000..1d59cf7cc Binary files /dev/null and b/assets/design-export/fig/1006926387-2294.fig differ diff --git a/assets/design-export/fig/1006926387-2310.fig b/assets/design-export/fig/1006926387-2310.fig new file mode 100644 index 000000000..3dd65d745 Binary files /dev/null and b/assets/design-export/fig/1006926387-2310.fig differ diff --git a/assets/design-export/fig/1163467012-1553.fig b/assets/design-export/fig/1163467012-1553.fig index bab75197d..3b76d05de 100644 Binary files a/assets/design-export/fig/1163467012-1553.fig and b/assets/design-export/fig/1163467012-1553.fig differ diff --git a/assets/design-export/fig/1163467012-2214.fig b/assets/design-export/fig/1163467012-2214.fig index ff18d8ba0..eeb4b4927 100644 Binary files a/assets/design-export/fig/1163467012-2214.fig and b/assets/design-export/fig/1163467012-2214.fig differ diff --git a/assets/design-export/fig/1163467012-2492.fig b/assets/design-export/fig/1163467012-2492.fig index c5c152765..26704f373 100644 Binary files a/assets/design-export/fig/1163467012-2492.fig and b/assets/design-export/fig/1163467012-2492.fig differ diff --git a/assets/design-export/fig/1163467012-259.fig b/assets/design-export/fig/1163467012-259.fig index 6030aaf4a..5ce502655 100644 Binary files a/assets/design-export/fig/1163467012-259.fig and b/assets/design-export/fig/1163467012-259.fig differ diff --git a/assets/design-export/fig/1163467012-2680.fig b/assets/design-export/fig/1163467012-2680.fig index b43de4b2a..cd8585ab8 100644 Binary files a/assets/design-export/fig/1163467012-2680.fig and b/assets/design-export/fig/1163467012-2680.fig differ diff --git a/assets/design-export/fig/1163467012-2868.fig b/assets/design-export/fig/1163467012-2868.fig index 6a0e9e375..b89634ffb 100644 Binary files a/assets/design-export/fig/1163467012-2868.fig and b/assets/design-export/fig/1163467012-2868.fig differ diff --git a/assets/design-export/fig/1163467012-3056.fig b/assets/design-export/fig/1163467012-3056.fig index 795acf0db..d1448abd0 100644 Binary files a/assets/design-export/fig/1163467012-3056.fig and b/assets/design-export/fig/1163467012-3056.fig differ diff --git a/assets/design-export/fig/1163467012-3228.fig b/assets/design-export/fig/1163467012-3228.fig index cf7cb4c0e..8a2371c88 100644 Binary files a/assets/design-export/fig/1163467012-3228.fig and b/assets/design-export/fig/1163467012-3228.fig differ diff --git a/assets/design-export/fig/1163467012-906.fig b/assets/design-export/fig/1163467012-906.fig index eceeef9c4..ba279350e 100644 Binary files a/assets/design-export/fig/1163467012-906.fig and b/assets/design-export/fig/1163467012-906.fig differ diff --git a/assets/design-export/fig/1274632774-1258.fig b/assets/design-export/fig/1274632774-1258.fig index bf09d52d9..f661defed 100644 Binary files a/assets/design-export/fig/1274632774-1258.fig and b/assets/design-export/fig/1274632774-1258.fig differ diff --git a/assets/design-export/fig/1274632774-130.fig b/assets/design-export/fig/1274632774-130.fig index 35178a8c0..d4d0d196e 100644 Binary files a/assets/design-export/fig/1274632774-130.fig and b/assets/design-export/fig/1274632774-130.fig differ diff --git a/assets/design-export/fig/1274632774-1722.fig b/assets/design-export/fig/1274632774-1722.fig index 8e1096001..e83692ad5 100644 Binary files a/assets/design-export/fig/1274632774-1722.fig and b/assets/design-export/fig/1274632774-1722.fig differ diff --git a/assets/design-export/fig/1274632774-2112.fig b/assets/design-export/fig/1274632774-2112.fig index b4b6992b2..fde93a848 100644 Binary files a/assets/design-export/fig/1274632774-2112.fig and b/assets/design-export/fig/1274632774-2112.fig differ diff --git a/assets/design-export/fig/1274632774-2492.fig b/assets/design-export/fig/1274632774-2492.fig index de5368de9..106e09422 100644 Binary files a/assets/design-export/fig/1274632774-2492.fig and b/assets/design-export/fig/1274632774-2492.fig differ diff --git a/assets/design-export/fig/1274632774-2877.fig b/assets/design-export/fig/1274632774-2877.fig index 81923f05d..8fbd6d563 100644 Binary files a/assets/design-export/fig/1274632774-2877.fig and b/assets/design-export/fig/1274632774-2877.fig differ diff --git a/assets/design-export/fig/1274632774-3217.fig b/assets/design-export/fig/1274632774-3217.fig index 1ab6f005d..d623d85a5 100644 Binary files a/assets/design-export/fig/1274632774-3217.fig and b/assets/design-export/fig/1274632774-3217.fig differ diff --git a/assets/design-export/fig/1274632774-3559.fig b/assets/design-export/fig/1274632774-3559.fig index 85182c908..47849dddb 100644 Binary files a/assets/design-export/fig/1274632774-3559.fig and b/assets/design-export/fig/1274632774-3559.fig differ diff --git a/assets/design-export/fig/1274632774-3890.fig b/assets/design-export/fig/1274632774-3890.fig index 833ae653e..df8f3980f 100644 Binary files a/assets/design-export/fig/1274632774-3890.fig and b/assets/design-export/fig/1274632774-3890.fig differ diff --git a/assets/design-export/fig/1274632774-4001.fig b/assets/design-export/fig/1274632774-4001.fig index c8cc7c852..8958f30b8 100644 Binary files a/assets/design-export/fig/1274632774-4001.fig and b/assets/design-export/fig/1274632774-4001.fig differ diff --git a/assets/design-export/fig/1274632774-4260.fig b/assets/design-export/fig/1274632774-4260.fig index d907eff88..b72e8d965 100644 Binary files a/assets/design-export/fig/1274632774-4260.fig and b/assets/design-export/fig/1274632774-4260.fig differ diff --git a/assets/design-export/fig/1274632774-470.fig b/assets/design-export/fig/1274632774-470.fig index cc0557b08..de8158a4c 100644 Binary files a/assets/design-export/fig/1274632774-470.fig and b/assets/design-export/fig/1274632774-470.fig differ diff --git a/assets/design-export/fig/1274632774-907.fig b/assets/design-export/fig/1274632774-907.fig index b929955b1..f0f3421f5 100644 Binary files a/assets/design-export/fig/1274632774-907.fig and b/assets/design-export/fig/1274632774-907.fig differ diff --git a/assets/design-export/fig/1494270493-26.fig b/assets/design-export/fig/1494270493-26.fig index d087e0976..9c3d9eb02 100644 Binary files a/assets/design-export/fig/1494270493-26.fig and b/assets/design-export/fig/1494270493-26.fig differ diff --git a/assets/design-export/fig/2044649516-1099.fig b/assets/design-export/fig/2044649516-1099.fig index 6b52f0368..edcaf6abf 100644 Binary files a/assets/design-export/fig/2044649516-1099.fig and b/assets/design-export/fig/2044649516-1099.fig differ diff --git a/assets/design-export/fig/2044649516-13.fig b/assets/design-export/fig/2044649516-13.fig index d0b03a623..33b7c0e7d 100644 Binary files a/assets/design-export/fig/2044649516-13.fig and b/assets/design-export/fig/2044649516-13.fig differ diff --git a/assets/design-export/fig/2044649516-1687.fig b/assets/design-export/fig/2044649516-1687.fig index 2f5156253..632118226 100644 Binary files a/assets/design-export/fig/2044649516-1687.fig and b/assets/design-export/fig/2044649516-1687.fig differ diff --git a/assets/design-export/fig/2044649516-2282.fig b/assets/design-export/fig/2044649516-2282.fig index de4247fc3..0cdd52899 100644 Binary files a/assets/design-export/fig/2044649516-2282.fig and b/assets/design-export/fig/2044649516-2282.fig differ diff --git a/assets/design-export/fig/2044649516-2862.fig b/assets/design-export/fig/2044649516-2862.fig index d882e5a48..74a2d5d97 100644 Binary files a/assets/design-export/fig/2044649516-2862.fig and b/assets/design-export/fig/2044649516-2862.fig differ diff --git a/assets/design-export/fig/2044649516-2982.fig b/assets/design-export/fig/2044649516-2982.fig index 2c317a836..229c6210b 100644 Binary files a/assets/design-export/fig/2044649516-2982.fig and b/assets/design-export/fig/2044649516-2982.fig differ diff --git a/assets/design-export/fig/2044649516-579.fig b/assets/design-export/fig/2044649516-579.fig index 2e13a3ec0..989dd3d97 100644 Binary files a/assets/design-export/fig/2044649516-579.fig and b/assets/design-export/fig/2044649516-579.fig differ diff --git a/assets/design-export/fig/46479436-2.fig b/assets/design-export/fig/46479436-2.fig index 308483651..447b1cd20 100644 Binary files a/assets/design-export/fig/46479436-2.fig and b/assets/design-export/fig/46479436-2.fig differ diff --git a/assets/design-export/fig/901437436-1.fig b/assets/design-export/fig/901437436-1.fig index ef2222b69..64ab44e2c 100644 Binary files a/assets/design-export/fig/901437436-1.fig and b/assets/design-export/fig/901437436-1.fig differ diff --git a/assets/design-export/fig/901437436-1393.fig b/assets/design-export/fig/901437436-1393.fig index 6c4058f2b..51a26fdc8 100644 Binary files a/assets/design-export/fig/901437436-1393.fig and b/assets/design-export/fig/901437436-1393.fig differ diff --git a/assets/design-export/fig/901437436-1857.fig b/assets/design-export/fig/901437436-1857.fig index 067d662d4..77b6d387e 100644 Binary files a/assets/design-export/fig/901437436-1857.fig and b/assets/design-export/fig/901437436-1857.fig differ diff --git a/assets/design-export/fig/901437436-2321.fig b/assets/design-export/fig/901437436-2321.fig index d5141c728..e5ef01f6e 100644 Binary files a/assets/design-export/fig/901437436-2321.fig and b/assets/design-export/fig/901437436-2321.fig differ diff --git a/assets/design-export/fig/901437436-2785.fig b/assets/design-export/fig/901437436-2785.fig index d706873a9..22809d92f 100644 Binary files a/assets/design-export/fig/901437436-2785.fig and b/assets/design-export/fig/901437436-2785.fig differ diff --git a/assets/design-export/fig/901437436-3249.fig b/assets/design-export/fig/901437436-3249.fig index a09a0b5d9..74f7ffe23 100644 Binary files a/assets/design-export/fig/901437436-3249.fig and b/assets/design-export/fig/901437436-3249.fig differ diff --git a/assets/design-export/fig/901437436-3713.fig b/assets/design-export/fig/901437436-3713.fig index 04540ac38..b40ca0cf7 100644 Binary files a/assets/design-export/fig/901437436-3713.fig and b/assets/design-export/fig/901437436-3713.fig differ diff --git a/assets/design-export/fig/901437436-465.fig b/assets/design-export/fig/901437436-465.fig index 430057c67..43e4cce51 100644 Binary files a/assets/design-export/fig/901437436-465.fig and b/assets/design-export/fig/901437436-465.fig differ diff --git a/assets/design-export/fig/901437436-929.fig b/assets/design-export/fig/901437436-929.fig index 60e846bb5..2c49a720d 100644 Binary files a/assets/design-export/fig/901437436-929.fig and b/assets/design-export/fig/901437436-929.fig differ diff --git a/assets/design-export/fig/A8vGwM.fig b/assets/design-export/fig/A8vGwM.fig index 8e4030fe2..6cfb965b2 100644 Binary files a/assets/design-export/fig/A8vGwM.fig and b/assets/design-export/fig/A8vGwM.fig differ diff --git a/assets/design-export/fig/B57dG.fig b/assets/design-export/fig/B57dG.fig index e12d2082a..39edc0873 100644 Binary files a/assets/design-export/fig/B57dG.fig and b/assets/design-export/fig/B57dG.fig differ diff --git a/assets/design-export/fig/Bbnga.fig b/assets/design-export/fig/Bbnga.fig index f383a37c4..755facfcb 100644 Binary files a/assets/design-export/fig/Bbnga.fig and b/assets/design-export/fig/Bbnga.fig differ diff --git a/assets/design-export/fig/BdmAW.fig b/assets/design-export/fig/BdmAW.fig index bb5011610..54202e7de 100644 Binary files a/assets/design-export/fig/BdmAW.fig and b/assets/design-export/fig/BdmAW.fig differ diff --git a/assets/design-export/fig/Be7ZW.fig b/assets/design-export/fig/Be7ZW.fig index 20808c491..6d0c45471 100644 Binary files a/assets/design-export/fig/Be7ZW.fig and b/assets/design-export/fig/Be7ZW.fig differ diff --git a/assets/design-export/fig/BguST.fig b/assets/design-export/fig/BguST.fig index 292b445bf..ebcfab1b0 100644 Binary files a/assets/design-export/fig/BguST.fig and b/assets/design-export/fig/BguST.fig differ diff --git a/assets/design-export/fig/Bq2Yg.fig b/assets/design-export/fig/Bq2Yg.fig index c482ca1e8..dfb730c1b 100644 Binary files a/assets/design-export/fig/Bq2Yg.fig and b/assets/design-export/fig/Bq2Yg.fig differ diff --git a/assets/design-export/fig/C2LQE4.fig b/assets/design-export/fig/C2LQE4.fig index 2ad875762..8a231f1ac 100644 Binary files a/assets/design-export/fig/C2LQE4.fig and b/assets/design-export/fig/C2LQE4.fig differ diff --git a/assets/design-export/fig/C5Aoe.fig b/assets/design-export/fig/C5Aoe.fig index 7d77e400b..8e0ebfe9c 100644 Binary files a/assets/design-export/fig/C5Aoe.fig and b/assets/design-export/fig/C5Aoe.fig differ diff --git a/assets/design-export/fig/C9bR6.fig b/assets/design-export/fig/C9bR6.fig index 0d0d01cd6..b5b5424d4 100644 Binary files a/assets/design-export/fig/C9bR6.fig and b/assets/design-export/fig/C9bR6.fig differ diff --git a/assets/design-export/fig/Cb3eC.fig b/assets/design-export/fig/Cb3eC.fig index ac876e9e1..71c00ecef 100644 Binary files a/assets/design-export/fig/Cb3eC.fig and b/assets/design-export/fig/Cb3eC.fig differ diff --git a/assets/design-export/fig/D9QYZ.fig b/assets/design-export/fig/D9QYZ.fig index c2de3eaff..6c07810ad 100644 Binary files a/assets/design-export/fig/D9QYZ.fig and b/assets/design-export/fig/D9QYZ.fig differ diff --git a/assets/design-export/fig/DBQyF.fig b/assets/design-export/fig/DBQyF.fig index 3ecfb051b..e27c0f1d6 100644 Binary files a/assets/design-export/fig/DBQyF.fig and b/assets/design-export/fig/DBQyF.fig differ diff --git a/assets/design-export/fig/DMnEi.fig b/assets/design-export/fig/DMnEi.fig index 05d33aa11..18321d34e 100644 Binary files a/assets/design-export/fig/DMnEi.fig and b/assets/design-export/fig/DMnEi.fig differ diff --git a/assets/design-export/fig/DWztv.fig b/assets/design-export/fig/DWztv.fig index cfb2debba..ddb1824e0 100644 Binary files a/assets/design-export/fig/DWztv.fig and b/assets/design-export/fig/DWztv.fig differ diff --git a/assets/design-export/fig/Dpb9f.fig b/assets/design-export/fig/Dpb9f.fig index 498fb467e..f86a01958 100644 Binary files a/assets/design-export/fig/Dpb9f.fig and b/assets/design-export/fig/Dpb9f.fig differ diff --git a/assets/design-export/fig/DxKOh.fig b/assets/design-export/fig/DxKOh.fig index 5e6f83b47..e7a08fc63 100644 Binary files a/assets/design-export/fig/DxKOh.fig and b/assets/design-export/fig/DxKOh.fig differ diff --git a/assets/design-export/fig/E9EEv0.fig b/assets/design-export/fig/E9EEv0.fig index 9355fa4f0..f6873895f 100644 Binary files a/assets/design-export/fig/E9EEv0.fig and b/assets/design-export/fig/E9EEv0.fig differ diff --git a/assets/design-export/fig/EKJyM.fig b/assets/design-export/fig/EKJyM.fig index c7379fcc7..a67e0abd4 100644 Binary files a/assets/design-export/fig/EKJyM.fig and b/assets/design-export/fig/EKJyM.fig differ diff --git a/assets/design-export/fig/EWrn0.fig b/assets/design-export/fig/EWrn0.fig index 76a55eb52..bda1b5d47 100644 Binary files a/assets/design-export/fig/EWrn0.fig and b/assets/design-export/fig/EWrn0.fig differ diff --git a/assets/design-export/fig/EcoGD.fig b/assets/design-export/fig/EcoGD.fig index 131af5dda..d4b7ebe63 100644 Binary files a/assets/design-export/fig/EcoGD.fig and b/assets/design-export/fig/EcoGD.fig differ diff --git a/assets/design-export/fig/F9pUrx.fig b/assets/design-export/fig/F9pUrx.fig index fa137a0af..be4718d0f 100644 Binary files a/assets/design-export/fig/F9pUrx.fig and b/assets/design-export/fig/F9pUrx.fig differ diff --git a/assets/design-export/fig/FBiMN.fig b/assets/design-export/fig/FBiMN.fig index 2d3aed1cc..43bd3113d 100644 Binary files a/assets/design-export/fig/FBiMN.fig and b/assets/design-export/fig/FBiMN.fig differ diff --git a/assets/design-export/fig/FOVMf.fig b/assets/design-export/fig/FOVMf.fig index f9fae57b4..9568c2ab4 100644 Binary files a/assets/design-export/fig/FOVMf.fig and b/assets/design-export/fig/FOVMf.fig differ diff --git a/assets/design-export/fig/GR1G9.fig b/assets/design-export/fig/GR1G9.fig index 28ba7c0fb..25daa5c9b 100644 Binary files a/assets/design-export/fig/GR1G9.fig and b/assets/design-export/fig/GR1G9.fig differ diff --git a/assets/design-export/fig/GsofJ.fig b/assets/design-export/fig/GsofJ.fig index 8b7abc35c..88325b2d6 100644 Binary files a/assets/design-export/fig/GsofJ.fig and b/assets/design-export/fig/GsofJ.fig differ diff --git a/assets/design-export/fig/HVhmb.fig b/assets/design-export/fig/HVhmb.fig index 71365df1e..b03729bfb 100644 Binary files a/assets/design-export/fig/HVhmb.fig and b/assets/design-export/fig/HVhmb.fig differ diff --git a/assets/design-export/fig/Hy9r0.fig b/assets/design-export/fig/Hy9r0.fig index a24003077..a771d3364 100644 Binary files a/assets/design-export/fig/Hy9r0.fig and b/assets/design-export/fig/Hy9r0.fig differ diff --git a/assets/design-export/fig/IBUqJ.fig b/assets/design-export/fig/IBUqJ.fig index 2e38ca603..b77d018a2 100644 Binary files a/assets/design-export/fig/IBUqJ.fig and b/assets/design-export/fig/IBUqJ.fig differ diff --git a/assets/design-export/fig/IMSD5.fig b/assets/design-export/fig/IMSD5.fig index 81e5fa61a..0f0af3601 100644 Binary files a/assets/design-export/fig/IMSD5.fig and b/assets/design-export/fig/IMSD5.fig differ diff --git a/assets/design-export/fig/IdbiB.fig b/assets/design-export/fig/IdbiB.fig index 92af25db0..c93993876 100644 Binary files a/assets/design-export/fig/IdbiB.fig and b/assets/design-export/fig/IdbiB.fig differ diff --git a/assets/design-export/fig/IyMFM.fig b/assets/design-export/fig/IyMFM.fig index f2b9f42c7..8160a8799 100644 Binary files a/assets/design-export/fig/IyMFM.fig and b/assets/design-export/fig/IyMFM.fig differ diff --git a/assets/design-export/fig/IzuY2.fig b/assets/design-export/fig/IzuY2.fig index 530fdb92d..20f3f4cba 100644 Binary files a/assets/design-export/fig/IzuY2.fig and b/assets/design-export/fig/IzuY2.fig differ diff --git a/assets/design-export/fig/J8GzM9.fig b/assets/design-export/fig/J8GzM9.fig index ee1411e2d..3cb12d6d2 100644 Binary files a/assets/design-export/fig/J8GzM9.fig and b/assets/design-export/fig/J8GzM9.fig differ diff --git a/assets/design-export/fig/K5XinZ.fig b/assets/design-export/fig/K5XinZ.fig index c60dc0b84..fb1ca2859 100644 Binary files a/assets/design-export/fig/K5XinZ.fig and b/assets/design-export/fig/K5XinZ.fig differ diff --git a/assets/design-export/fig/KJdxg.fig b/assets/design-export/fig/KJdxg.fig index 27a4a19dc..56f202c55 100644 Binary files a/assets/design-export/fig/KJdxg.fig and b/assets/design-export/fig/KJdxg.fig differ diff --git a/assets/design-export/fig/KhYNc.fig b/assets/design-export/fig/KhYNc.fig index 454d57278..175245176 100644 Binary files a/assets/design-export/fig/KhYNc.fig and b/assets/design-export/fig/KhYNc.fig differ diff --git a/assets/design-export/fig/LYPXU.fig b/assets/design-export/fig/LYPXU.fig index 4a4ccbd49..a9bff3b27 100644 Binary files a/assets/design-export/fig/LYPXU.fig and b/assets/design-export/fig/LYPXU.fig differ diff --git a/assets/design-export/fig/M2sA4u.fig b/assets/design-export/fig/M2sA4u.fig index f7dce3d77..e2bf0aef0 100644 Binary files a/assets/design-export/fig/M2sA4u.fig and b/assets/design-export/fig/M2sA4u.fig differ diff --git a/assets/design-export/fig/MaoHP.fig b/assets/design-export/fig/MaoHP.fig index 203fcf233..b046b7508 100644 Binary files a/assets/design-export/fig/MaoHP.fig and b/assets/design-export/fig/MaoHP.fig differ diff --git a/assets/design-export/fig/N2nTf.fig b/assets/design-export/fig/N2nTf.fig index e4e57d38f..fb4ba03dd 100644 Binary files a/assets/design-export/fig/N2nTf.fig and b/assets/design-export/fig/N2nTf.fig differ diff --git a/assets/design-export/fig/NKiqf.fig b/assets/design-export/fig/NKiqf.fig index 97f56af3f..ac3f76cad 100644 Binary files a/assets/design-export/fig/NKiqf.fig and b/assets/design-export/fig/NKiqf.fig differ diff --git a/assets/design-export/fig/NLDDv.fig b/assets/design-export/fig/NLDDv.fig index 15517e67f..36cea2d1f 100644 Binary files a/assets/design-export/fig/NLDDv.fig and b/assets/design-export/fig/NLDDv.fig differ diff --git a/assets/design-export/fig/NLu2I.fig b/assets/design-export/fig/NLu2I.fig index c94e69b47..78d2cfe75 100644 Binary files a/assets/design-export/fig/NLu2I.fig and b/assets/design-export/fig/NLu2I.fig differ diff --git a/assets/design-export/fig/Ne5TA.fig b/assets/design-export/fig/Ne5TA.fig index 4028d4c91..2225c8b45 100644 Binary files a/assets/design-export/fig/Ne5TA.fig and b/assets/design-export/fig/Ne5TA.fig differ diff --git a/assets/design-export/fig/NqaaU.fig b/assets/design-export/fig/NqaaU.fig index 948c8c19e..8e8bc976d 100644 Binary files a/assets/design-export/fig/NqaaU.fig and b/assets/design-export/fig/NqaaU.fig differ diff --git a/assets/design-export/fig/O08uaD.fig b/assets/design-export/fig/O08uaD.fig index 623797651..855a2d280 100644 Binary files a/assets/design-export/fig/O08uaD.fig and b/assets/design-export/fig/O08uaD.fig differ diff --git a/assets/design-export/fig/O5kaV.fig b/assets/design-export/fig/O5kaV.fig index 081ae9d04..e9f906c64 100644 Binary files a/assets/design-export/fig/O5kaV.fig and b/assets/design-export/fig/O5kaV.fig differ diff --git a/assets/design-export/fig/OC804.fig b/assets/design-export/fig/OC804.fig index dc4c55758..eec5b8056 100644 Binary files a/assets/design-export/fig/OC804.fig and b/assets/design-export/fig/OC804.fig differ diff --git a/assets/design-export/fig/OecJ5.fig b/assets/design-export/fig/OecJ5.fig index ad79fdc5c..291b61556 100644 Binary files a/assets/design-export/fig/OecJ5.fig and b/assets/design-export/fig/OecJ5.fig differ diff --git a/assets/design-export/fig/QFEg9.fig b/assets/design-export/fig/QFEg9.fig index 6d6d43ffc..b5b1b7b5b 100644 Binary files a/assets/design-export/fig/QFEg9.fig and b/assets/design-export/fig/QFEg9.fig differ diff --git a/assets/design-export/fig/QQtUD.fig b/assets/design-export/fig/QQtUD.fig index a633489d8..b15d01767 100644 Binary files a/assets/design-export/fig/QQtUD.fig and b/assets/design-export/fig/QQtUD.fig differ diff --git a/assets/design-export/fig/QgW58.fig b/assets/design-export/fig/QgW58.fig index bb2c97839..5a2c9949b 100644 Binary files a/assets/design-export/fig/QgW58.fig and b/assets/design-export/fig/QgW58.fig differ diff --git a/assets/design-export/fig/QpEvu.fig b/assets/design-export/fig/QpEvu.fig index cb1038944..be63ab860 100644 Binary files a/assets/design-export/fig/QpEvu.fig and b/assets/design-export/fig/QpEvu.fig differ diff --git a/assets/design-export/fig/RC3Kf.fig b/assets/design-export/fig/RC3Kf.fig index dfeeeef9b..3903507d7 100644 Binary files a/assets/design-export/fig/RC3Kf.fig and b/assets/design-export/fig/RC3Kf.fig differ diff --git a/assets/design-export/fig/RS0KZ.fig b/assets/design-export/fig/RS0KZ.fig index cbb42dea6..7400c2b3f 100644 Binary files a/assets/design-export/fig/RS0KZ.fig and b/assets/design-export/fig/RS0KZ.fig differ diff --git a/assets/design-export/fig/RodrS.fig b/assets/design-export/fig/RodrS.fig index d0f76cc36..feedd1f01 100644 Binary files a/assets/design-export/fig/RodrS.fig and b/assets/design-export/fig/RodrS.fig differ diff --git a/assets/design-export/fig/SUcad.fig b/assets/design-export/fig/SUcad.fig index be3c1ee7c..2dd084f86 100644 Binary files a/assets/design-export/fig/SUcad.fig and b/assets/design-export/fig/SUcad.fig differ diff --git a/assets/design-export/fig/SUtGZ.fig b/assets/design-export/fig/SUtGZ.fig index 86a3474b3..c98b83ee9 100644 Binary files a/assets/design-export/fig/SUtGZ.fig and b/assets/design-export/fig/SUtGZ.fig differ diff --git a/assets/design-export/fig/SeizD.fig b/assets/design-export/fig/SeizD.fig index f8b80fa8b..c896672cc 100644 Binary files a/assets/design-export/fig/SeizD.fig and b/assets/design-export/fig/SeizD.fig differ diff --git a/assets/design-export/fig/T1wkiT.fig b/assets/design-export/fig/T1wkiT.fig index 542b5efd3..8f85a9678 100644 Binary files a/assets/design-export/fig/T1wkiT.fig and b/assets/design-export/fig/T1wkiT.fig differ diff --git a/assets/design-export/fig/T70dJ.fig b/assets/design-export/fig/T70dJ.fig index 436290205..6a0f794b5 100644 Binary files a/assets/design-export/fig/T70dJ.fig and b/assets/design-export/fig/T70dJ.fig differ diff --git a/assets/design-export/fig/TBvTC.fig b/assets/design-export/fig/TBvTC.fig index 5b734f3cb..53a20d2cc 100644 Binary files a/assets/design-export/fig/TBvTC.fig and b/assets/design-export/fig/TBvTC.fig differ diff --git a/assets/design-export/fig/TE2jI.fig b/assets/design-export/fig/TE2jI.fig index 25d654392..73e6556e7 100644 Binary files a/assets/design-export/fig/TE2jI.fig and b/assets/design-export/fig/TE2jI.fig differ diff --git a/assets/design-export/fig/U9xSg.fig b/assets/design-export/fig/U9xSg.fig index 6586eb400..7d6b01128 100644 Binary files a/assets/design-export/fig/U9xSg.fig and b/assets/design-export/fig/U9xSg.fig differ diff --git a/assets/design-export/fig/UCNBm.fig b/assets/design-export/fig/UCNBm.fig index 7f69ce882..3f9372add 100644 Binary files a/assets/design-export/fig/UCNBm.fig and b/assets/design-export/fig/UCNBm.fig differ diff --git a/assets/design-export/fig/UdnBT.fig b/assets/design-export/fig/UdnBT.fig index 04ad2d60e..999ff1d0b 100644 Binary files a/assets/design-export/fig/UdnBT.fig and b/assets/design-export/fig/UdnBT.fig differ diff --git a/assets/design-export/fig/Uzzje.fig b/assets/design-export/fig/Uzzje.fig index 1c121f7f0..39ce1c73d 100644 Binary files a/assets/design-export/fig/Uzzje.fig and b/assets/design-export/fig/Uzzje.fig differ diff --git a/assets/design-export/fig/VM7ro.fig b/assets/design-export/fig/VM7ro.fig index 8d4880677..19c06df0a 100644 Binary files a/assets/design-export/fig/VM7ro.fig and b/assets/design-export/fig/VM7ro.fig differ diff --git a/assets/design-export/fig/VctzT.fig b/assets/design-export/fig/VctzT.fig index 286bf4bad..418db6e6a 100644 Binary files a/assets/design-export/fig/VctzT.fig and b/assets/design-export/fig/VctzT.fig differ diff --git a/assets/design-export/fig/WZdnw.fig b/assets/design-export/fig/WZdnw.fig index 0997524e6..3d5f47fcb 100644 Binary files a/assets/design-export/fig/WZdnw.fig and b/assets/design-export/fig/WZdnw.fig differ diff --git a/assets/design-export/fig/Wj0V4.fig b/assets/design-export/fig/Wj0V4.fig index 92103ca42..78eb9fc4c 100644 Binary files a/assets/design-export/fig/Wj0V4.fig and b/assets/design-export/fig/Wj0V4.fig differ diff --git a/assets/design-export/fig/WrmU5.fig b/assets/design-export/fig/WrmU5.fig index adf6bd607..8840876d0 100644 Binary files a/assets/design-export/fig/WrmU5.fig and b/assets/design-export/fig/WrmU5.fig differ diff --git a/assets/design-export/fig/X405l.fig b/assets/design-export/fig/X405l.fig index 89959c8d4..7684691d6 100644 Binary files a/assets/design-export/fig/X405l.fig and b/assets/design-export/fig/X405l.fig differ diff --git a/assets/design-export/fig/XR0f9.fig b/assets/design-export/fig/XR0f9.fig index e9d9fa5ba..b856cf6db 100644 Binary files a/assets/design-export/fig/XR0f9.fig and b/assets/design-export/fig/XR0f9.fig differ diff --git a/assets/design-export/fig/YN8cE.fig b/assets/design-export/fig/YN8cE.fig index 9569fd1f6..06b6af665 100644 Binary files a/assets/design-export/fig/YN8cE.fig and b/assets/design-export/fig/YN8cE.fig differ diff --git a/assets/design-export/fig/YPKbV.fig b/assets/design-export/fig/YPKbV.fig index b5b0f6cd7..0dddd661e 100644 Binary files a/assets/design-export/fig/YPKbV.fig and b/assets/design-export/fig/YPKbV.fig differ diff --git a/assets/design-export/fig/Z0oyh.fig b/assets/design-export/fig/Z0oyh.fig index c9bf4ad75..e3fe64c88 100644 Binary files a/assets/design-export/fig/Z0oyh.fig and b/assets/design-export/fig/Z0oyh.fig differ diff --git a/assets/design-export/fig/ZU1BG.fig b/assets/design-export/fig/ZU1BG.fig index 8c27c99a6..3cbc03746 100644 Binary files a/assets/design-export/fig/ZU1BG.fig and b/assets/design-export/fig/ZU1BG.fig differ diff --git a/assets/design-export/fig/ZUAq1.fig b/assets/design-export/fig/ZUAq1.fig index 2074881fd..21edbad10 100644 Binary files a/assets/design-export/fig/ZUAq1.fig and b/assets/design-export/fig/ZUAq1.fig differ diff --git a/assets/design-export/fig/ZlLf0.fig b/assets/design-export/fig/ZlLf0.fig index 852a8cb88..b3d33c3f8 100644 Binary files a/assets/design-export/fig/ZlLf0.fig and b/assets/design-export/fig/ZlLf0.fig differ diff --git a/assets/design-export/fig/a7o9C.fig b/assets/design-export/fig/a7o9C.fig index aecf4cc24..6a09523d2 100644 Binary files a/assets/design-export/fig/a7o9C.fig and b/assets/design-export/fig/a7o9C.fig differ diff --git a/assets/design-export/fig/aMU7O.fig b/assets/design-export/fig/aMU7O.fig index 07f2497f9..1b7aff7ed 100644 Binary files a/assets/design-export/fig/aMU7O.fig and b/assets/design-export/fig/aMU7O.fig differ diff --git a/assets/design-export/fig/akr4I.fig b/assets/design-export/fig/akr4I.fig index d585b775e..792cc7d4d 100644 Binary files a/assets/design-export/fig/akr4I.fig and b/assets/design-export/fig/akr4I.fig differ diff --git a/assets/design-export/fig/atqRh.fig b/assets/design-export/fig/atqRh.fig index b48b6f904..95f7d73cf 100644 Binary files a/assets/design-export/fig/atqRh.fig and b/assets/design-export/fig/atqRh.fig differ diff --git a/assets/design-export/fig/b4eaUf.fig b/assets/design-export/fig/b4eaUf.fig index 3af69306f..38ff3785f 100644 Binary files a/assets/design-export/fig/b4eaUf.fig and b/assets/design-export/fig/b4eaUf.fig differ diff --git a/assets/design-export/fig/bYDHC.fig b/assets/design-export/fig/bYDHC.fig index 53540f022..ff20b159a 100644 Binary files a/assets/design-export/fig/bYDHC.fig and b/assets/design-export/fig/bYDHC.fig differ diff --git a/assets/design-export/fig/cDiNb.fig b/assets/design-export/fig/cDiNb.fig index d08ba8831..929a91f85 100644 Binary files a/assets/design-export/fig/cDiNb.fig and b/assets/design-export/fig/cDiNb.fig differ diff --git a/assets/design-export/fig/dBILX.fig b/assets/design-export/fig/dBILX.fig index 9b2662de2..6325f3f9f 100644 Binary files a/assets/design-export/fig/dBILX.fig and b/assets/design-export/fig/dBILX.fig differ diff --git a/assets/design-export/fig/dQV9N.fig b/assets/design-export/fig/dQV9N.fig index 11cb0367f..dff0e5a3e 100644 Binary files a/assets/design-export/fig/dQV9N.fig and b/assets/design-export/fig/dQV9N.fig differ diff --git a/assets/design-export/fig/dhPtX.fig b/assets/design-export/fig/dhPtX.fig index 0c373093f..c58680aa9 100644 Binary files a/assets/design-export/fig/dhPtX.fig and b/assets/design-export/fig/dhPtX.fig differ diff --git a/assets/design-export/fig/dxdEi.fig b/assets/design-export/fig/dxdEi.fig index 00c350f47..c8da14737 100644 Binary files a/assets/design-export/fig/dxdEi.fig and b/assets/design-export/fig/dxdEi.fig differ diff --git a/assets/design-export/fig/e9FnC.fig b/assets/design-export/fig/e9FnC.fig index 9ae31ec7c..a325794bf 100644 Binary files a/assets/design-export/fig/e9FnC.fig and b/assets/design-export/fig/e9FnC.fig differ diff --git a/assets/design-export/fig/e9lV4.fig b/assets/design-export/fig/e9lV4.fig index 147171608..61b3d991d 100644 Binary files a/assets/design-export/fig/e9lV4.fig and b/assets/design-export/fig/e9lV4.fig differ diff --git a/assets/design-export/fig/eGbsg.fig b/assets/design-export/fig/eGbsg.fig index dfb7305f5..97e840910 100644 Binary files a/assets/design-export/fig/eGbsg.fig and b/assets/design-export/fig/eGbsg.fig differ diff --git a/assets/design-export/fig/epZO2.fig b/assets/design-export/fig/epZO2.fig index 7057c8c76..bb81261a7 100644 Binary files a/assets/design-export/fig/epZO2.fig and b/assets/design-export/fig/epZO2.fig differ diff --git a/assets/design-export/fig/fbBqA.fig b/assets/design-export/fig/fbBqA.fig index f2be8cb1b..64605f8bb 100644 Binary files a/assets/design-export/fig/fbBqA.fig and b/assets/design-export/fig/fbBqA.fig differ diff --git a/assets/design-export/fig/g5mEpx.fig b/assets/design-export/fig/g5mEpx.fig index 1382cabf5..3dd3846c6 100644 Binary files a/assets/design-export/fig/g5mEpx.fig and b/assets/design-export/fig/g5mEpx.fig differ diff --git a/assets/design-export/fig/gWqMD.fig b/assets/design-export/fig/gWqMD.fig index e4daf5331..81318e233 100644 Binary files a/assets/design-export/fig/gWqMD.fig and b/assets/design-export/fig/gWqMD.fig differ diff --git a/assets/design-export/fig/gX7um.fig b/assets/design-export/fig/gX7um.fig index e95983ab0..68eb740b2 100644 Binary files a/assets/design-export/fig/gX7um.fig and b/assets/design-export/fig/gX7um.fig differ diff --git a/assets/design-export/fig/hlwx3.fig b/assets/design-export/fig/hlwx3.fig index fdc77461f..09264844f 100644 Binary files a/assets/design-export/fig/hlwx3.fig and b/assets/design-export/fig/hlwx3.fig differ diff --git a/assets/design-export/fig/hmPL7.fig b/assets/design-export/fig/hmPL7.fig index 55ad2c916..8d2b7927e 100644 Binary files a/assets/design-export/fig/hmPL7.fig and b/assets/design-export/fig/hmPL7.fig differ diff --git a/assets/design-export/fig/i4L0M.fig b/assets/design-export/fig/i4L0M.fig index a10cb3740..dd8ae7469 100644 Binary files a/assets/design-export/fig/i4L0M.fig and b/assets/design-export/fig/i4L0M.fig differ diff --git a/assets/design-export/fig/iLm38.fig b/assets/design-export/fig/iLm38.fig index b591c4544..6aee7a9da 100644 Binary files a/assets/design-export/fig/iLm38.fig and b/assets/design-export/fig/iLm38.fig differ diff --git a/assets/design-export/fig/iYUWc.fig b/assets/design-export/fig/iYUWc.fig index 9bf7dd758..7299c1577 100644 Binary files a/assets/design-export/fig/iYUWc.fig and b/assets/design-export/fig/iYUWc.fig differ diff --git a/assets/design-export/fig/j88bl0.fig b/assets/design-export/fig/j88bl0.fig index 6ab389ab8..69238e221 100644 Binary files a/assets/design-export/fig/j88bl0.fig and b/assets/design-export/fig/j88bl0.fig differ diff --git a/assets/design-export/fig/jXykV.fig b/assets/design-export/fig/jXykV.fig index 5ec31ce4f..d21fe67de 100644 Binary files a/assets/design-export/fig/jXykV.fig and b/assets/design-export/fig/jXykV.fig differ diff --git a/assets/design-export/fig/l64bd.fig b/assets/design-export/fig/l64bd.fig index 2e81403d0..9b5806886 100644 Binary files a/assets/design-export/fig/l64bd.fig and b/assets/design-export/fig/l64bd.fig differ diff --git a/assets/design-export/fig/l7TRz9.fig b/assets/design-export/fig/l7TRz9.fig index 14e6e8c22..7924c0153 100644 Binary files a/assets/design-export/fig/l7TRz9.fig and b/assets/design-export/fig/l7TRz9.fig differ diff --git a/assets/design-export/fig/lCTci.fig b/assets/design-export/fig/lCTci.fig index aa456fa12..8d4578161 100644 Binary files a/assets/design-export/fig/lCTci.fig and b/assets/design-export/fig/lCTci.fig differ diff --git a/assets/design-export/fig/lWvcv.fig b/assets/design-export/fig/lWvcv.fig index 2109e86a5..abac36155 100644 Binary files a/assets/design-export/fig/lWvcv.fig and b/assets/design-export/fig/lWvcv.fig differ diff --git a/assets/design-export/fig/lhKzN.fig b/assets/design-export/fig/lhKzN.fig index 61ae42ac7..a4a09cbe6 100644 Binary files a/assets/design-export/fig/lhKzN.fig and b/assets/design-export/fig/lhKzN.fig differ diff --git a/assets/design-export/fig/m5kOm4.fig b/assets/design-export/fig/m5kOm4.fig index 8dcc35b70..30c3d199b 100644 Binary files a/assets/design-export/fig/m5kOm4.fig and b/assets/design-export/fig/m5kOm4.fig differ diff --git a/assets/design-export/fig/mrF6f.fig b/assets/design-export/fig/mrF6f.fig index 6e91592b3..e7f04c135 100644 Binary files a/assets/design-export/fig/mrF6f.fig and b/assets/design-export/fig/mrF6f.fig differ diff --git a/assets/design-export/fig/n2qdi.fig b/assets/design-export/fig/n2qdi.fig index 39570a0b8..6c7819f9a 100644 Binary files a/assets/design-export/fig/n2qdi.fig and b/assets/design-export/fig/n2qdi.fig differ diff --git a/assets/design-export/fig/n6Xlo.fig b/assets/design-export/fig/n6Xlo.fig index a3ec87f16..2206c8751 100644 Binary files a/assets/design-export/fig/n6Xlo.fig and b/assets/design-export/fig/n6Xlo.fig differ diff --git a/assets/design-export/fig/nGJE1.fig b/assets/design-export/fig/nGJE1.fig index 2810ce789..fa11172c1 100644 Binary files a/assets/design-export/fig/nGJE1.fig and b/assets/design-export/fig/nGJE1.fig differ diff --git a/assets/design-export/fig/nNGDX.fig b/assets/design-export/fig/nNGDX.fig index 84e6a44b5..415e11d0e 100644 Binary files a/assets/design-export/fig/nNGDX.fig and b/assets/design-export/fig/nNGDX.fig differ diff --git a/assets/design-export/fig/o1uEP.fig b/assets/design-export/fig/o1uEP.fig index 28a6ae399..bf141eba3 100644 Binary files a/assets/design-export/fig/o1uEP.fig and b/assets/design-export/fig/o1uEP.fig differ diff --git a/assets/design-export/fig/o4LH8W.fig b/assets/design-export/fig/o4LH8W.fig index 64f11396c..82990e7bf 100644 Binary files a/assets/design-export/fig/o4LH8W.fig and b/assets/design-export/fig/o4LH8W.fig differ diff --git a/assets/design-export/fig/oMuyw.fig b/assets/design-export/fig/oMuyw.fig index cdf8fd502..33a223b5b 100644 Binary files a/assets/design-export/fig/oMuyw.fig and b/assets/design-export/fig/oMuyw.fig differ diff --git a/assets/design-export/fig/oPF1n.fig b/assets/design-export/fig/oPF1n.fig index 3020184c5..d9e0e30a7 100644 Binary files a/assets/design-export/fig/oPF1n.fig and b/assets/design-export/fig/oPF1n.fig differ diff --git a/assets/design-export/fig/oyoTs.fig b/assets/design-export/fig/oyoTs.fig index 99e195e20..2e67cdaf1 100644 Binary files a/assets/design-export/fig/oyoTs.fig and b/assets/design-export/fig/oyoTs.fig differ diff --git a/assets/design-export/fig/p8QSPq.fig b/assets/design-export/fig/p8QSPq.fig index 3c21b1fad..e816124b8 100644 Binary files a/assets/design-export/fig/p8QSPq.fig and b/assets/design-export/fig/p8QSPq.fig differ diff --git a/assets/design-export/fig/pnAbF.fig b/assets/design-export/fig/pnAbF.fig index 2c40b595b..76c2b990d 100644 Binary files a/assets/design-export/fig/pnAbF.fig and b/assets/design-export/fig/pnAbF.fig differ diff --git a/assets/design-export/fig/pszxE.fig b/assets/design-export/fig/pszxE.fig index 3cb4ef2e9..aa7022965 100644 Binary files a/assets/design-export/fig/pszxE.fig and b/assets/design-export/fig/pszxE.fig differ diff --git a/assets/design-export/fig/q31B6w.fig b/assets/design-export/fig/q31B6w.fig index e82932247..f9b4233ad 100644 Binary files a/assets/design-export/fig/q31B6w.fig and b/assets/design-export/fig/q31B6w.fig differ diff --git a/assets/design-export/fig/qFLfB.fig b/assets/design-export/fig/qFLfB.fig index 18f3ad8c7..45f2a00bd 100644 Binary files a/assets/design-export/fig/qFLfB.fig and b/assets/design-export/fig/qFLfB.fig differ diff --git a/assets/design-export/fig/r0heh.fig b/assets/design-export/fig/r0heh.fig index 0624dccef..14267700a 100644 Binary files a/assets/design-export/fig/r0heh.fig and b/assets/design-export/fig/r0heh.fig differ diff --git a/assets/design-export/fig/r139UP.fig b/assets/design-export/fig/r139UP.fig index d1865327d..0ad301174 100644 Binary files a/assets/design-export/fig/r139UP.fig and b/assets/design-export/fig/r139UP.fig differ diff --git a/assets/design-export/fig/rJt1I.fig b/assets/design-export/fig/rJt1I.fig index c7d6b8a93..006d99812 100644 Binary files a/assets/design-export/fig/rJt1I.fig and b/assets/design-export/fig/rJt1I.fig differ diff --git a/assets/design-export/fig/sSISK.fig b/assets/design-export/fig/sSISK.fig index a778dfa90..c95eff78f 100644 Binary files a/assets/design-export/fig/sSISK.fig and b/assets/design-export/fig/sSISK.fig differ diff --git a/assets/design-export/fig/t3IY3u.fig b/assets/design-export/fig/t3IY3u.fig index ed917cfda..6ad16b81e 100644 Binary files a/assets/design-export/fig/t3IY3u.fig and b/assets/design-export/fig/t3IY3u.fig differ diff --git a/assets/design-export/fig/t56aLu.fig b/assets/design-export/fig/t56aLu.fig index 67faf8516..e38f6614b 100644 Binary files a/assets/design-export/fig/t56aLu.fig and b/assets/design-export/fig/t56aLu.fig differ diff --git a/assets/design-export/fig/tSOeI.fig b/assets/design-export/fig/tSOeI.fig index 447cf1509..b02a4091f 100644 Binary files a/assets/design-export/fig/tSOeI.fig and b/assets/design-export/fig/tSOeI.fig differ diff --git a/assets/design-export/fig/tooKB.fig b/assets/design-export/fig/tooKB.fig index 78eb3b92b..62266670e 100644 Binary files a/assets/design-export/fig/tooKB.fig and b/assets/design-export/fig/tooKB.fig differ diff --git a/assets/design-export/fig/tr6cE.fig b/assets/design-export/fig/tr6cE.fig index f3fe92807..f98851559 100644 Binary files a/assets/design-export/fig/tr6cE.fig and b/assets/design-export/fig/tr6cE.fig differ diff --git a/assets/design-export/fig/uCA23.fig b/assets/design-export/fig/uCA23.fig index 113a2ff10..f7890efc5 100644 Binary files a/assets/design-export/fig/uCA23.fig and b/assets/design-export/fig/uCA23.fig differ diff --git a/assets/design-export/fig/uMiwd.fig b/assets/design-export/fig/uMiwd.fig index 05d59d4ca..7b849dc1c 100644 Binary files a/assets/design-export/fig/uMiwd.fig and b/assets/design-export/fig/uMiwd.fig differ diff --git a/assets/design-export/fig/uoxQW.fig b/assets/design-export/fig/uoxQW.fig index bf319d2fc..e61f82890 100644 Binary files a/assets/design-export/fig/uoxQW.fig and b/assets/design-export/fig/uoxQW.fig differ diff --git a/assets/design-export/fig/w34N9.fig b/assets/design-export/fig/w34N9.fig index 94c4f9d7f..366a4e4ef 100644 Binary files a/assets/design-export/fig/w34N9.fig and b/assets/design-export/fig/w34N9.fig differ diff --git a/assets/design-export/fig/wqnM9.fig b/assets/design-export/fig/wqnM9.fig index 8c471b214..1b30b4386 100644 Binary files a/assets/design-export/fig/wqnM9.fig and b/assets/design-export/fig/wqnM9.fig differ diff --git a/assets/design-export/fig/wxINm.fig b/assets/design-export/fig/wxINm.fig index 34c0f3088..e0533271a 100644 Binary files a/assets/design-export/fig/wxINm.fig and b/assets/design-export/fig/wxINm.fig differ diff --git a/assets/design-export/fig/xCJlu.fig b/assets/design-export/fig/xCJlu.fig index cf1b267c0..b3a0aa6b2 100644 Binary files a/assets/design-export/fig/xCJlu.fig and b/assets/design-export/fig/xCJlu.fig differ diff --git a/assets/design-export/fig/xvlB6.fig b/assets/design-export/fig/xvlB6.fig index 9d0f4ae2d..a38129513 100644 Binary files a/assets/design-export/fig/xvlB6.fig and b/assets/design-export/fig/xvlB6.fig differ diff --git a/assets/design-export/fig/y3YcQ.fig b/assets/design-export/fig/y3YcQ.fig index 11685fa4a..af2f0570d 100644 Binary files a/assets/design-export/fig/y3YcQ.fig and b/assets/design-export/fig/y3YcQ.fig differ diff --git a/assets/design-export/fig/yrxK2.fig b/assets/design-export/fig/yrxK2.fig index c710113ce..f80a57cfe 100644 Binary files a/assets/design-export/fig/yrxK2.fig and b/assets/design-export/fig/yrxK2.fig differ diff --git a/assets/design-export/fig/zFiOW.fig b/assets/design-export/fig/zFiOW.fig index a9d0c5572..f4e053ff8 100644 Binary files a/assets/design-export/fig/zFiOW.fig and b/assets/design-export/fig/zFiOW.fig differ diff --git a/assets/design-export/fig/zM0VF.fig b/assets/design-export/fig/zM0VF.fig index 8350dc94f..a3e548136 100644 Binary files a/assets/design-export/fig/zM0VF.fig and b/assets/design-export/fig/zM0VF.fig differ diff --git a/assets/design-export/fig/zj5a3.fig b/assets/design-export/fig/zj5a3.fig index 509233a61..196d409d2 100644 Binary files a/assets/design-export/fig/zj5a3.fig and b/assets/design-export/fig/zj5a3.fig differ diff --git a/assets/design-export/fig/zqzr4.fig b/assets/design-export/fig/zqzr4.fig index f916b96d8..287e2a9c7 100644 Binary files a/assets/design-export/fig/zqzr4.fig and b/assets/design-export/fig/zqzr4.fig differ diff --git a/assets/design-export/json/1-46380.json b/assets/design-export/json/1-46380.json new file mode 100644 index 000000000..689812d99 --- /dev/null +++ b/assets/design-export/json/1-46380.json @@ -0,0 +1,602 @@ +{ + "file": "1-46380", + "id": "1:46380", + "name": "Screen/Settings — SFTP", + "type": "FRAME", + "x": 0, + "y": 82663, + "width": 1440, + "height": 1080, + "fills": [{"type": "SOLID", "color": "#121114"}], + "clips": true, + "variables": {"fills/0/color": "background/background"}, + "children": [ + { + "name": "App Sidebar", + "type": "INSTANCE", + "x": 0, + "y": 0, + "width": 260, + "height": 1080, + "component": "Gameplane/App Sidebar", + "componentId": "1:234", + "fills": [{"type": "SOLID", "color": "#17151A"}], + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "layout": { + "mode": "VERTICAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"fills/0/color": "surface/secondary", "strokes/0/color": "border/border"}, + "texts": [ + "gameplane", + "homelab-01", + "GENERAL", + "Dashboard", + "Servers", + "Modules", + "Backups", + "ADMIN", + "Clusters", + "Nodes", + "Users & RBAC", + "Audit log", + "System logs", + "Settings", + "AD", + "admin", + "admin" + ] + }, + { + "id": "1:46399", + "name": "Main", + "type": "FRAME", + "x": 260, + "y": 0, + "width": 1180, + "height": 1080, + "children": [ + { + "id": "1:46440", + "name": "Top Bar", + "type": "FRAME", + "x": 0, + "y": 0, + "width": 1180, + "height": 64, + "fills": [{"type": "SOLID", "color": "#121114"}], + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 32, 0, 32], + "primary": "SPACE_BETWEEN", + "counter": "CENTER", + "sizing": ["FIXED", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"fills/0/color": "background/background", "strokes/0/color": "border/border"}, + "children": [ + { + "id": "1:46532", + "name": "Breadcrumbs", + "type": "FRAME", + "x": 32, + "y": 23, + "width": 157, + "height": 18, + "layout": { + "mode": "HORIZONTAL", + "gap": 8, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["HUG", "HUG"] + }, + "children": [ + { + "id": "1:46607", + "name": "crumbRoot", + "type": "TEXT", + "x": 0, + "y": 0, + "width": 72, + "height": 18, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "text": "gameplane", + "font": ["Geist", 400, 14], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "muted"} + }, + { + "id": "1:46608", + "name": "crumbSep", + "type": "FRAME", + "x": 80, + "y": 2, + "width": 14, + "height": 14, + "variables": {"fills/0/color": "muted"}, + "children": [ + { + "id": "1:46698", + "name": "path", + "type": "VECTOR", + "x": 5.25, + "y": 3.5, + "width": 3.5, + "height": 7, + "strokes": [{"type": "SOLID", "color": "#9E98A6"}], + "strokeWeight": 1.17 + } + ] + }, + { + "id": "1:46609", + "name": "crumbPage", + "type": "TEXT", + "x": 102, + "y": 0, + "width": 55, + "height": 18, + "fills": [{"type": "SOLID", "color": "#F5F3F7"}], + "text": "Settings", + "font": ["Geist", 500, 14], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + } + ] + }, + { + "id": "1:46533", + "name": "Actions", + "type": "FRAME", + "x": 752, + "y": 0, + "width": 396, + "height": 64, + "layout": { + "mode": "HORIZONTAL", + "gap": 12, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["HUG", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "id": "1:46610", + "name": "Cluster Pill", + "type": "FRAME", + "x": 0, + "y": 15.5, + "width": 94, + "height": 33, + "visible": false, + "fills": [{"type": "SOLID", "color": "#1C1A20"}], + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "cornerRadius": 8, + "layout": { + "mode": "HORIZONTAL", + "gap": 8, + "padding": [8, 12, 8, 12], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["HUG", "HUG"] + }, + "variables": {"fills/0/color": "surface/surface", "strokes/0/color": "border/border"}, + "children": [ + { + "id": "1:46699", + "name": "healthDot", + "type": "ELLIPSE", + "x": 12, + "y": 12.5, + "width": 8, + "height": 8, + "fills": [{"type": "SOLID", "color": "#21C45D"}], + "variables": {"fills/0/color": "success/success"} + }, + { + "id": "1:46700", + "name": "clusterName", + "type": "TEXT", + "x": 28, + "y": 8, + "width": 30, + "height": 17, + "fills": [{"type": "SOLID", "color": "#F5F3F7"}], + "text": "local", + "font": ["Geist", 500, 13], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + }, + { + "name": "chevron", + "type": "INSTANCE", + "x": 66, + "y": 8.5, + "width": 16, + "height": 16, + "component": "lucide/chevron-down/16x16", + "variables": {"fills/0/color": "muted"} + } + ] + }, + { + "name": "Search", + "type": "INSTANCE", + "x": 0, + "y": 12, + "width": 300, + "height": 40, + "component": "SearchField/Primary", + "componentId": "1:1928", + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "FIXED"] + }, + "texts": ["Search servers…"] + }, + { + "id": "1:46611", + "name": "Bell Wrap", + "type": "FRAME", + "x": 312, + "y": 12, + "width": 40, + "height": 40, + "children": [ + { + "id": "1:46701", + "name": "Sdet8", + "type": "FRAME", + "x": 0, + "y": 0, + "width": 36, + "height": 36, + "fills": [{"type": "SOLID", "color": "#00000000", "opacity": 0}], + "cornerRadius": 8, + "children": [ + { + "name": "icon", + "type": "INSTANCE", + "x": 8, + "y": 8, + "width": 20, + "height": 20, + "component": "lucide/bell/20x20", + "variables": {"fills/0/color": "foreground/foreground"} + } + ] + }, + { + "id": "1:46702", + "name": "UnreadDot", + "type": "ELLIPSE", + "x": 29, + "y": 1, + "width": 8, + "height": 8, + "visible": false, + "fills": [{"type": "SOLID", "color": "#FF4FA3"}], + "strokes": [{"type": "SOLID", "color": "#121114"}], + "strokeWeight": 1.5, + "variables": {"fills/0/color": "accent/accent", "strokes/0/color": "background/background"} + } + ] + }, + { + "name": "Avatar", + "type": "INSTANCE", + "x": 364, + "y": 16, + "width": 32, + "height": 32, + "component": "Avatar/Text", + "componentId": "1:2407", + "fills": [{"type": "SOLID", "color": "#FF4FA3"}], + "cornerRadius": 9999, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "CENTER", + "counter": "CENTER", + "sizing": ["FIXED", "FIXED"] + }, + "variables": {"fills/0/color": "accent/accent"}, + "texts": ["AD"] + } + ] + } + ] + }, + { + "id": "1:46441", + "name": "Body", + "type": "FRAME", + "x": 0, + "y": 64, + "width": 1180, + "height": 1016, + "layout": { + "mode": "VERTICAL", + "gap": 24, + "padding": [24, 24, 24, 24], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "FIXED"] + }, + "layoutGrow": 1, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "name": "Page Header", + "type": "INSTANCE", + "x": 24, + "y": 24, + "width": 1132, + "height": 53, + "component": "Gameplane/Page Header", + "componentId": "1:3282", + "fills": [{"type": "SOLID", "color": "#121114"}], + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "SPACE_BETWEEN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"fills/0/color": "background/background"}, + "texts": [ + "SFTP access", + "Your personal SFTP credentials for game server files. Admins can see and revoke them." + ] + }, + { + "id": "1:46534", + "name": "Settings Layout", + "type": "FRAME", + "x": 24, + "y": 101, + "width": 1132, + "height": 891, + "layout": { + "mode": "HORIZONTAL", + "gap": 24, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "FIXED"] + }, + "layoutGrow": 1, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "name": "Settings Nav", + "type": "INSTANCE", + "x": 0, + "y": 0, + "width": 220, + "height": 492, + "component": "Gameplane/Admin Settings Nav", + "componentId": "1:3419", + "layout": { + "mode": "VERTICAL", + "gap": 2, + "padding": [8, 0, 8, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "texts": [ + "ACCOUNT", + "Theme", + "MCP tokens", + "SFTP", + "SERVER", + "General", + "Authentication", + "Module sources", + "Mod registries", + "Notifications", + "Telemetry", + "Updates", + "About" + ] + }, + { + "id": "1:46612", + "name": "Content Column", + "type": "FRAME", + "x": 244, + "y": 0, + "width": 888, + "height": 915, + "layout": { + "mode": "VERTICAL", + "gap": 16, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "FIXED"] + }, + "layoutGrow": 1, + "children": [ + { + "name": "Gameplane/Settings/SFTP Address Card", + "type": "INSTANCE", + "x": 0, + "y": 0, + "width": 888, + "height": 420, + "component": "Gameplane/Settings/SFTP Address Card", + "fills": [{"type": "SOLID", "color": "#1C1A20"}], + "cornerRadius": 24, + "variables": {"fills/0/color": "surface/surface"}, + "texts": [ + "SFTP address", + "Use these settings in any SFTP client. Check the host key matches the fingerprint your client shows on first connect.", + "Host", + "sftp.gameplane.example", + "Port", + "2222", + "Host key (SHA256)", + "SHA256:4mQ2xR7vK9pL0wZ3sB8nT1cY6hJ5gF2dA0eU", + "Copy", + "Copy", + "Username", + "Log in with one of these usernames and your SSH key or SFTP password.", + "alice", + "Lists every server you can read, one folder each", + "alice+survival", + "Opens straight in the files of server survival", + "alice+mods/survival", + "Opens a server in another namespace (mods)" + ] + }, + { + "name": "Gameplane/Settings/SFTP Keys Card", + "type": "INSTANCE", + "x": 0, + "y": 436, + "width": 888, + "height": 290, + "component": "Gameplane/Settings/SFTP Keys Card", + "fills": [{"type": "SOLID", "color": "#1C1A20"}], + "cornerRadius": 24, + "variables": {"fills/0/color": "surface/surface"}, + "texts": [ + "SSH keys", + "Public keys that can log in over SFTP. Gameplane stores only the public part.", + "Add key", + "laptop", + "ssh-ed25519 · SHA256:9dK1vT7qLm2Xr8ZcW4bN0eH6sJ3yU5pA1fG", + "Added 3 Oct 2026 · Last used 2 hours ago", + "Remove", + "ci-runner", + "ssh-rsa · SHA256:Lm7Qa2Xp9rTz4Vc8Ns1Wd6Hk3Bj0Ye5Ug", + "Added 21 Nov 2026 · Never used", + "Remove" + ] + }, + { + "id": "1:46703", + "name": "Card SFTP password", + "type": "FRAME", + "x": 0, + "y": 742, + "width": 888, + "height": 170, + "fills": [{"type": "SOLID", "color": "#1C1A20"}], + "cornerRadius": 24, + "variables": {"fills/0/color": "surface/surface"}, + "children": [ + { + "id": "1:46807", + "name": "cardTitle", + "type": "TEXT", + "x": 24, + "y": 20, + "width": 116, + "height": 21, + "fills": [{"type": "SOLID", "color": "#F5F3F7"}], + "text": "SFTP password", + "font": ["Geist", 500, 16], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + }, + { + "id": "1:46808", + "name": "cardBody", + "type": "TEXT", + "x": 24, + "y": 48, + "width": 368, + "height": 18, + "fills": [{"type": "SOLID", "color": "#F5F3F7"}], + "layoutAlignSelf": "STRETCH", + "text": "Set · Created 3 Oct 2026 · Last used 5 minutes ago", + "font": ["Geist", 400, 14], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + }, + { + "id": "1:46809", + "name": "cardBody", + "type": "TEXT", + "x": 24, + "y": 72, + "width": 840, + "height": 18, + "fills": [{"type": "SOLID", "color": "#F5F3F7"}], + "layoutAlignSelf": "STRETCH", + "text": "Shown once when generated and stored only as a hash. It never expires. Regenerating or revoking it stops the old password at once.", + "font": ["Geist", 400, 14], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + }, + { + "name": "Gameplane/Button/Outline", + "type": "INSTANCE", + "x": 24, + "y": 118, + "width": 120, + "height": 32, + "component": "Gameplane/Button/Outline", + "componentId": "1:770", + "fills": [{"type": "SOLID", "color": "#00000000", "opacity": 0}], + "strokes": [{"type": "SOLID", "color": "#00000000", "opacity": 0}], + "strokeWeight": 1, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "CENTER", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "texts": ["Regenerate"] + }, + { + "name": "Gameplane/Button/Small/Danger", + "type": "INSTANCE", + "x": 156, + "y": 122, + "width": 92, + "height": 32, + "component": "Gameplane/Button/Small/Danger", + "componentId": "1:1878", + "fills": [{"type": "SOLID", "color": "#00000000", "opacity": 0}], + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "CENTER", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "texts": ["Revoke"] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] +} diff --git a/assets/design-export/json/1-46381.json b/assets/design-export/json/1-46381.json new file mode 100644 index 000000000..c7aaea378 --- /dev/null +++ b/assets/design-export/json/1-46381.json @@ -0,0 +1,602 @@ +{ + "file": "1-46381", + "id": "1:46381", + "name": "Screen/Settings — SFTP (Light)", + "type": "FRAME", + "x": 1640, + "y": 82663, + "width": 1440, + "height": 1080, + "fills": [{"type": "SOLID", "color": "#FFFFFF"}], + "clips": true, + "variables": {"fills/0/color": "background/background"}, + "children": [ + { + "name": "App Sidebar", + "type": "INSTANCE", + "x": 0, + "y": 0, + "width": 260, + "height": 1080, + "component": "Gameplane/App Sidebar", + "componentId": "1:234", + "fills": [{"type": "SOLID", "color": "#F8DDE9"}], + "strokes": [{"type": "SOLID", "color": "#EFC3D6"}], + "strokeWeight": 1, + "layout": { + "mode": "VERTICAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"fills/0/color": "surface/secondary", "strokes/0/color": "border/border"}, + "texts": [ + "gameplane", + "homelab-01", + "GENERAL", + "Dashboard", + "Servers", + "Modules", + "Backups", + "ADMIN", + "Clusters", + "Nodes", + "Users & RBAC", + "Audit log", + "System logs", + "Settings", + "AD", + "admin", + "admin" + ] + }, + { + "id": "1:46400", + "name": "Main", + "type": "FRAME", + "x": 260, + "y": 0, + "width": 1180, + "height": 1080, + "children": [ + { + "id": "1:46442", + "name": "Top Bar", + "type": "FRAME", + "x": 0, + "y": 0, + "width": 1180, + "height": 64, + "fills": [{"type": "SOLID", "color": "#FFFFFF"}], + "strokes": [{"type": "SOLID", "color": "#EFC3D6"}], + "strokeWeight": 1, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 32, 0, 32], + "primary": "SPACE_BETWEEN", + "counter": "CENTER", + "sizing": ["FIXED", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"fills/0/color": "background/background", "strokes/0/color": "border/border"}, + "children": [ + { + "id": "1:46535", + "name": "Breadcrumbs", + "type": "FRAME", + "x": 32, + "y": 23, + "width": 157, + "height": 18, + "layout": { + "mode": "HORIZONTAL", + "gap": 8, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["HUG", "HUG"] + }, + "children": [ + { + "id": "1:46613", + "name": "crumbRoot", + "type": "TEXT", + "x": 0, + "y": 0, + "width": 72, + "height": 18, + "fills": [{"type": "SOLID", "color": "#6E5262"}], + "text": "gameplane", + "font": ["Geist", 400, 14], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "muted"} + }, + { + "id": "1:46614", + "name": "crumbSep", + "type": "FRAME", + "x": 80, + "y": 2, + "width": 14, + "height": 14, + "variables": {"fills/0/color": "muted"}, + "children": [ + { + "id": "1:46704", + "name": "path", + "type": "VECTOR", + "x": 5.25, + "y": 3.5, + "width": 3.5, + "height": 7, + "strokes": [{"type": "SOLID", "color": "#9E98A6"}], + "strokeWeight": 1.17 + } + ] + }, + { + "id": "1:46615", + "name": "crumbPage", + "type": "TEXT", + "x": 102, + "y": 0, + "width": 55, + "height": 18, + "fills": [{"type": "SOLID", "color": "#2A0F1E"}], + "text": "Settings", + "font": ["Geist", 500, 14], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + } + ] + }, + { + "id": "1:46536", + "name": "Actions", + "type": "FRAME", + "x": 752, + "y": 0, + "width": 396, + "height": 64, + "layout": { + "mode": "HORIZONTAL", + "gap": 12, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["HUG", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "id": "1:46616", + "name": "Cluster Pill", + "type": "FRAME", + "x": 0, + "y": 15.5, + "width": 94, + "height": 33, + "visible": false, + "fills": [{"type": "SOLID", "color": "#FFF7FB"}], + "strokes": [{"type": "SOLID", "color": "#EFC3D6"}], + "strokeWeight": 1, + "cornerRadius": 8, + "layout": { + "mode": "HORIZONTAL", + "gap": 8, + "padding": [8, 12, 8, 12], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["HUG", "HUG"] + }, + "variables": {"fills/0/color": "surface/surface", "strokes/0/color": "border/border"}, + "children": [ + { + "id": "1:46705", + "name": "healthDot", + "type": "ELLIPSE", + "x": 12, + "y": 12.5, + "width": 8, + "height": 8, + "fills": [{"type": "SOLID", "color": "#16A34A"}], + "variables": {"fills/0/color": "success/success"} + }, + { + "id": "1:46706", + "name": "clusterName", + "type": "TEXT", + "x": 28, + "y": 8, + "width": 30, + "height": 17, + "fills": [{"type": "SOLID", "color": "#2A0F1E"}], + "text": "local", + "font": ["Geist", 500, 13], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + }, + { + "name": "chevron", + "type": "INSTANCE", + "x": 66, + "y": 8.5, + "width": 16, + "height": 16, + "component": "lucide/chevron-down/16x16", + "variables": {"fills/0/color": "muted"} + } + ] + }, + { + "name": "Search", + "type": "INSTANCE", + "x": 0, + "y": 12, + "width": 300, + "height": 40, + "component": "SearchField/Primary", + "componentId": "1:1928", + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "FIXED"] + }, + "texts": ["Search servers…"] + }, + { + "id": "1:46617", + "name": "Bell Wrap", + "type": "FRAME", + "x": 312, + "y": 12, + "width": 40, + "height": 40, + "children": [ + { + "id": "1:46707", + "name": "Sdet8", + "type": "FRAME", + "x": 0, + "y": 0, + "width": 36, + "height": 36, + "fills": [{"type": "SOLID", "color": "#00000000", "opacity": 0}], + "cornerRadius": 8, + "children": [ + { + "name": "icon", + "type": "INSTANCE", + "x": 8, + "y": 8, + "width": 20, + "height": 20, + "component": "lucide/bell/20x20", + "variables": {"fills/0/color": "foreground/foreground"} + } + ] + }, + { + "id": "1:46708", + "name": "UnreadDot", + "type": "ELLIPSE", + "x": 29, + "y": 1, + "width": 8, + "height": 8, + "visible": false, + "fills": [{"type": "SOLID", "color": "#DB2777"}], + "strokes": [{"type": "SOLID", "color": "#FFFFFF"}], + "strokeWeight": 1.5, + "variables": {"fills/0/color": "accent/accent", "strokes/0/color": "background/background"} + } + ] + }, + { + "name": "Avatar", + "type": "INSTANCE", + "x": 364, + "y": 16, + "width": 32, + "height": 32, + "component": "Avatar/Text", + "componentId": "1:2407", + "fills": [{"type": "SOLID", "color": "#DB2777"}], + "cornerRadius": 9999, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "CENTER", + "counter": "CENTER", + "sizing": ["FIXED", "FIXED"] + }, + "variables": {"fills/0/color": "accent/accent"}, + "texts": ["AD"] + } + ] + } + ] + }, + { + "id": "1:46443", + "name": "Body", + "type": "FRAME", + "x": 0, + "y": 64, + "width": 1180, + "height": 1016, + "layout": { + "mode": "VERTICAL", + "gap": 24, + "padding": [24, 24, 24, 24], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "FIXED"] + }, + "layoutGrow": 1, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "name": "Page Header", + "type": "INSTANCE", + "x": 24, + "y": 24, + "width": 1132, + "height": 53, + "component": "Gameplane/Page Header", + "componentId": "1:3282", + "fills": [{"type": "SOLID", "color": "#FFFFFF"}], + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "SPACE_BETWEEN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"fills/0/color": "background/background"}, + "texts": [ + "SFTP access", + "Your personal SFTP credentials for game server files. Admins can see and revoke them." + ] + }, + { + "id": "1:46537", + "name": "Settings Layout", + "type": "FRAME", + "x": 24, + "y": 101, + "width": 1132, + "height": 891, + "layout": { + "mode": "HORIZONTAL", + "gap": 24, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "FIXED"] + }, + "layoutGrow": 1, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "name": "Settings Nav", + "type": "INSTANCE", + "x": 0, + "y": 0, + "width": 220, + "height": 492, + "component": "Gameplane/Admin Settings Nav", + "componentId": "1:3419", + "layout": { + "mode": "VERTICAL", + "gap": 2, + "padding": [8, 0, 8, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "texts": [ + "ACCOUNT", + "Theme", + "MCP tokens", + "SFTP", + "SERVER", + "General", + "Authentication", + "Module sources", + "Mod registries", + "Notifications", + "Telemetry", + "Updates", + "About" + ] + }, + { + "id": "1:46618", + "name": "Content Column", + "type": "FRAME", + "x": 244, + "y": 0, + "width": 888, + "height": 915, + "layout": { + "mode": "VERTICAL", + "gap": 16, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "FIXED"] + }, + "layoutGrow": 1, + "children": [ + { + "name": "Gameplane/Settings/SFTP Address Card", + "type": "INSTANCE", + "x": 0, + "y": 0, + "width": 888, + "height": 420, + "component": "Gameplane/Settings/SFTP Address Card", + "fills": [{"type": "SOLID", "color": "#FFF7FB"}], + "cornerRadius": 24, + "variables": {"fills/0/color": "surface/surface"}, + "texts": [ + "SFTP address", + "Use these settings in any SFTP client. Check the host key matches the fingerprint your client shows on first connect.", + "Host", + "sftp.gameplane.example", + "Port", + "2222", + "Host key (SHA256)", + "SHA256:4mQ2xR7vK9pL0wZ3sB8nT1cY6hJ5gF2dA0eU", + "Copy", + "Copy", + "Username", + "Log in with one of these usernames and your SSH key or SFTP password.", + "alice", + "Lists every server you can read, one folder each", + "alice+survival", + "Opens straight in the files of server survival", + "alice+mods/survival", + "Opens a server in another namespace (mods)" + ] + }, + { + "name": "Gameplane/Settings/SFTP Keys Card", + "type": "INSTANCE", + "x": 0, + "y": 436, + "width": 888, + "height": 290, + "component": "Gameplane/Settings/SFTP Keys Card", + "fills": [{"type": "SOLID", "color": "#FFF7FB"}], + "cornerRadius": 24, + "variables": {"fills/0/color": "surface/surface"}, + "texts": [ + "SSH keys", + "Public keys that can log in over SFTP. Gameplane stores only the public part.", + "Add key", + "laptop", + "ssh-ed25519 · SHA256:9dK1vT7qLm2Xr8ZcW4bN0eH6sJ3yU5pA1fG", + "Added 3 Oct 2026 · Last used 2 hours ago", + "Remove", + "ci-runner", + "ssh-rsa · SHA256:Lm7Qa2Xp9rTz4Vc8Ns1Wd6Hk3Bj0Ye5Ug", + "Added 21 Nov 2026 · Never used", + "Remove" + ] + }, + { + "id": "1:46709", + "name": "Card SFTP password", + "type": "FRAME", + "x": 0, + "y": 742, + "width": 888, + "height": 170, + "fills": [{"type": "SOLID", "color": "#FFF7FB"}], + "cornerRadius": 24, + "variables": {"fills/0/color": "surface/surface"}, + "children": [ + { + "id": "1:46810", + "name": "cardTitle", + "type": "TEXT", + "x": 24, + "y": 20, + "width": 116, + "height": 21, + "fills": [{"type": "SOLID", "color": "#2A0F1E"}], + "text": "SFTP password", + "font": ["Geist", 500, 16], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + }, + { + "id": "1:46811", + "name": "cardBody", + "type": "TEXT", + "x": 24, + "y": 48, + "width": 368, + "height": 18, + "fills": [{"type": "SOLID", "color": "#2A0F1E"}], + "layoutAlignSelf": "STRETCH", + "text": "Set · Created 3 Oct 2026 · Last used 5 minutes ago", + "font": ["Geist", 400, 14], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + }, + { + "id": "1:46812", + "name": "cardBody", + "type": "TEXT", + "x": 24, + "y": 72, + "width": 840, + "height": 18, + "fills": [{"type": "SOLID", "color": "#2A0F1E"}], + "layoutAlignSelf": "STRETCH", + "text": "Shown once when generated and stored only as a hash. It never expires. Regenerating or revoking it stops the old password at once.", + "font": ["Geist", 400, 14], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + }, + { + "name": "Gameplane/Button/Outline", + "type": "INSTANCE", + "x": 24, + "y": 118, + "width": 120, + "height": 32, + "component": "Gameplane/Button/Outline", + "componentId": "1:770", + "fills": [{"type": "SOLID", "color": "#00000000", "opacity": 0}], + "strokes": [{"type": "SOLID", "color": "#00000000", "opacity": 0}], + "strokeWeight": 1, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "CENTER", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "texts": ["Regenerate"] + }, + { + "name": "Gameplane/Button/Small/Danger", + "type": "INSTANCE", + "x": 156, + "y": 122, + "width": 92, + "height": 32, + "component": "Gameplane/Button/Small/Danger", + "componentId": "1:1878", + "fills": [{"type": "SOLID", "color": "#00000000", "opacity": 0}], + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "CENTER", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "texts": ["Revoke"] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] +} diff --git a/assets/design-export/json/1-46382.json b/assets/design-export/json/1-46382.json new file mode 100644 index 000000000..ade5ff87b --- /dev/null +++ b/assets/design-export/json/1-46382.json @@ -0,0 +1,611 @@ +{ + "file": "1-46382", + "id": "1:46382", + "name": "Screen/Settings — SFTP (Not enabled)", + "type": "FRAME", + "x": 3280, + "y": 82663, + "width": 1440, + "height": 1080, + "fills": [{"type": "SOLID", "color": "#121114"}], + "clips": true, + "variables": {"fills/0/color": "background/background"}, + "children": [ + { + "name": "App Sidebar", + "type": "INSTANCE", + "x": 0, + "y": 0, + "width": 260, + "height": 1080, + "component": "Gameplane/App Sidebar", + "componentId": "1:234", + "fills": [{"type": "SOLID", "color": "#17151A"}], + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "layout": { + "mode": "VERTICAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"fills/0/color": "surface/secondary", "strokes/0/color": "border/border"}, + "texts": [ + "gameplane", + "homelab-01", + "GENERAL", + "Dashboard", + "Servers", + "Modules", + "Backups", + "ADMIN", + "Clusters", + "Nodes", + "Users & RBAC", + "Audit log", + "System logs", + "Settings", + "AD", + "admin", + "admin" + ] + }, + { + "id": "1:46401", + "name": "Main", + "type": "FRAME", + "x": 260, + "y": 0, + "width": 1180, + "height": 1080, + "children": [ + { + "id": "1:46444", + "name": "Top Bar", + "type": "FRAME", + "x": 0, + "y": 0, + "width": 1180, + "height": 64, + "fills": [{"type": "SOLID", "color": "#121114"}], + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 32, 0, 32], + "primary": "SPACE_BETWEEN", + "counter": "CENTER", + "sizing": ["FIXED", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"fills/0/color": "background/background", "strokes/0/color": "border/border"}, + "children": [ + { + "id": "1:46538", + "name": "Breadcrumbs", + "type": "FRAME", + "x": 32, + "y": 23, + "width": 157, + "height": 18, + "layout": { + "mode": "HORIZONTAL", + "gap": 8, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["HUG", "HUG"] + }, + "children": [ + { + "id": "1:46619", + "name": "crumbRoot", + "type": "TEXT", + "x": 0, + "y": 0, + "width": 72, + "height": 18, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "text": "gameplane", + "font": ["Geist", 400, 14], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "muted"} + }, + { + "id": "1:46620", + "name": "crumbSep", + "type": "FRAME", + "x": 80, + "y": 2, + "width": 14, + "height": 14, + "variables": {"fills/0/color": "muted"}, + "children": [ + { + "id": "1:46710", + "name": "path", + "type": "VECTOR", + "x": 5.25, + "y": 3.5, + "width": 3.5, + "height": 7, + "strokes": [{"type": "SOLID", "color": "#9E98A6"}], + "strokeWeight": 1.17 + } + ] + }, + { + "id": "1:46621", + "name": "crumbPage", + "type": "TEXT", + "x": 102, + "y": 0, + "width": 55, + "height": 18, + "fills": [{"type": "SOLID", "color": "#F5F3F7"}], + "text": "Settings", + "font": ["Geist", 500, 14], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + } + ] + }, + { + "id": "1:46539", + "name": "Actions", + "type": "FRAME", + "x": 752, + "y": 0, + "width": 396, + "height": 64, + "layout": { + "mode": "HORIZONTAL", + "gap": 12, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["HUG", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "id": "1:46622", + "name": "Cluster Pill", + "type": "FRAME", + "x": 0, + "y": 15.5, + "width": 94, + "height": 33, + "visible": false, + "fills": [{"type": "SOLID", "color": "#1C1A20"}], + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "cornerRadius": 8, + "layout": { + "mode": "HORIZONTAL", + "gap": 8, + "padding": [8, 12, 8, 12], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["HUG", "HUG"] + }, + "variables": {"fills/0/color": "surface/surface", "strokes/0/color": "border/border"}, + "children": [ + { + "id": "1:46711", + "name": "healthDot", + "type": "ELLIPSE", + "x": 12, + "y": 12.5, + "width": 8, + "height": 8, + "fills": [{"type": "SOLID", "color": "#21C45D"}], + "variables": {"fills/0/color": "success/success"} + }, + { + "id": "1:46712", + "name": "clusterName", + "type": "TEXT", + "x": 28, + "y": 8, + "width": 30, + "height": 17, + "fills": [{"type": "SOLID", "color": "#F5F3F7"}], + "text": "local", + "font": ["Geist", 500, 13], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + }, + { + "name": "chevron", + "type": "INSTANCE", + "x": 66, + "y": 8.5, + "width": 16, + "height": 16, + "component": "lucide/chevron-down/16x16", + "variables": {"fills/0/color": "muted"} + } + ] + }, + { + "name": "Search", + "type": "INSTANCE", + "x": 0, + "y": 12, + "width": 300, + "height": 40, + "component": "SearchField/Primary", + "componentId": "1:1928", + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "FIXED"] + }, + "texts": ["Search servers…"] + }, + { + "id": "1:46623", + "name": "Bell Wrap", + "type": "FRAME", + "x": 312, + "y": 12, + "width": 40, + "height": 40, + "children": [ + { + "id": "1:46713", + "name": "Sdet8", + "type": "FRAME", + "x": 0, + "y": 0, + "width": 36, + "height": 36, + "fills": [{"type": "SOLID", "color": "#00000000", "opacity": 0}], + "cornerRadius": 8, + "children": [ + { + "name": "icon", + "type": "INSTANCE", + "x": 8, + "y": 8, + "width": 20, + "height": 20, + "component": "lucide/bell/20x20", + "variables": {"fills/0/color": "foreground/foreground"} + } + ] + }, + { + "id": "1:46714", + "name": "UnreadDot", + "type": "ELLIPSE", + "x": 29, + "y": 1, + "width": 8, + "height": 8, + "visible": false, + "fills": [{"type": "SOLID", "color": "#FF4FA3"}], + "strokes": [{"type": "SOLID", "color": "#121114"}], + "strokeWeight": 1.5, + "variables": {"fills/0/color": "accent/accent", "strokes/0/color": "background/background"} + } + ] + }, + { + "name": "Avatar", + "type": "INSTANCE", + "x": 364, + "y": 16, + "width": 32, + "height": 32, + "component": "Avatar/Text", + "componentId": "1:2407", + "fills": [{"type": "SOLID", "color": "#FF4FA3"}], + "cornerRadius": 9999, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "CENTER", + "counter": "CENTER", + "sizing": ["FIXED", "FIXED"] + }, + "variables": {"fills/0/color": "accent/accent"}, + "texts": ["AD"] + } + ] + } + ] + }, + { + "id": "1:46445", + "name": "Body", + "type": "FRAME", + "x": 0, + "y": 64, + "width": 1180, + "height": 1016, + "layout": { + "mode": "VERTICAL", + "gap": 24, + "padding": [24, 24, 24, 24], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "FIXED"] + }, + "layoutGrow": 1, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "name": "Page Header", + "type": "INSTANCE", + "x": 24, + "y": 24, + "width": 1132, + "height": 53, + "component": "Gameplane/Page Header", + "componentId": "1:3282", + "fills": [{"type": "SOLID", "color": "#121114"}], + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "SPACE_BETWEEN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"fills/0/color": "background/background"}, + "texts": [ + "SFTP access", + "Your personal SFTP credentials for game server files. Admins can see and revoke them." + ] + }, + { + "id": "1:46540", + "name": "Settings Layout", + "type": "FRAME", + "x": 24, + "y": 101, + "width": 1132, + "height": 891, + "layout": { + "mode": "HORIZONTAL", + "gap": 24, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "FIXED"] + }, + "layoutGrow": 1, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "name": "Settings Nav", + "type": "INSTANCE", + "x": 0, + "y": 0, + "width": 220, + "height": 492, + "component": "Gameplane/Admin Settings Nav", + "componentId": "1:3419", + "layout": { + "mode": "VERTICAL", + "gap": 2, + "padding": [8, 0, 8, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "texts": [ + "ACCOUNT", + "Theme", + "MCP tokens", + "SFTP", + "SERVER", + "General", + "Authentication", + "Module sources", + "Mod registries", + "Notifications", + "Telemetry", + "Updates", + "About" + ] + }, + { + "id": "1:46624", + "name": "Content Column", + "type": "FRAME", + "x": 244, + "y": 0, + "width": 888, + "height": 915, + "layout": { + "mode": "VERTICAL", + "gap": 16, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "FIXED"] + }, + "layoutGrow": 1, + "children": [ + { + "id": "1:46715", + "name": "Card SFTP address", + "type": "FRAME", + "x": 0, + "y": 0, + "width": 888, + "height": 124, + "fills": [{"type": "SOLID", "color": "#1C1A20"}], + "cornerRadius": 24, + "variables": {"fills/0/color": "surface/surface"}, + "children": [ + { + "id": "1:46813", + "name": "cardTitle", + "type": "TEXT", + "x": 24, + "y": 20, + "width": 104, + "height": 21, + "fills": [{"type": "SOLID", "color": "#F5F3F7"}], + "text": "SFTP address", + "font": ["Geist", 500, 16], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + }, + { + "id": "1:46814", + "name": "cardBody", + "type": "TEXT", + "x": 24, + "y": 48, + "width": 840, + "height": 36, + "fills": [{"type": "SOLID", "color": "#F5F3F7"}], + "layoutAlignSelf": "STRETCH", + "text": "SFTP is not enabled on this cluster. An administrator can turn it on with the sftp.enabled Helm value. Your SSH keys and password are still managed here.", + "font": ["Geist", 400, 14], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + } + ] + }, + { + "name": "Gameplane/Settings/SFTP Keys Card", + "type": "INSTANCE", + "x": 0, + "y": 140, + "width": 888, + "height": 290, + "component": "Gameplane/Settings/SFTP Keys Card", + "fills": [{"type": "SOLID", "color": "#1C1A20"}], + "cornerRadius": 24, + "variables": {"fills/0/color": "surface/surface"}, + "texts": [ + "SSH keys", + "Public keys that can log in over SFTP. Gameplane stores only the public part.", + "Add key", + "laptop", + "ssh-ed25519 · SHA256:9dK1vT7qLm2Xr8ZcW4bN0eH6sJ3yU5pA1fG", + "Added 3 Oct 2026 · Last used 2 hours ago", + "Remove", + "ci-runner", + "ssh-rsa · SHA256:Lm7Qa2Xp9rTz4Vc8Ns1Wd6Hk3Bj0Ye5Ug", + "Added 21 Nov 2026 · Never used", + "Remove" + ] + }, + { + "id": "1:46716", + "name": "Card SFTP password", + "type": "FRAME", + "x": 0, + "y": 446, + "width": 888, + "height": 170, + "fills": [{"type": "SOLID", "color": "#1C1A20"}], + "cornerRadius": 24, + "variables": {"fills/0/color": "surface/surface"}, + "children": [ + { + "id": "1:46815", + "name": "cardTitle", + "type": "TEXT", + "x": 24, + "y": 20, + "width": 116, + "height": 21, + "fills": [{"type": "SOLID", "color": "#F5F3F7"}], + "text": "SFTP password", + "font": ["Geist", 500, 16], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + }, + { + "id": "1:46816", + "name": "cardBody", + "type": "TEXT", + "x": 24, + "y": 48, + "width": 368, + "height": 18, + "fills": [{"type": "SOLID", "color": "#F5F3F7"}], + "layoutAlignSelf": "STRETCH", + "text": "Set · Created 3 Oct 2026 · Last used 5 minutes ago", + "font": ["Geist", 400, 14], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + }, + { + "id": "1:46817", + "name": "cardBody", + "type": "TEXT", + "x": 24, + "y": 72, + "width": 840, + "height": 18, + "fills": [{"type": "SOLID", "color": "#F5F3F7"}], + "layoutAlignSelf": "STRETCH", + "text": "Shown once when generated and stored only as a hash. It never expires. Regenerating or revoking it stops the old password at once.", + "font": ["Geist", 400, 14], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + }, + { + "name": "Gameplane/Button/Outline", + "type": "INSTANCE", + "x": 24, + "y": 118, + "width": 120, + "height": 32, + "component": "Gameplane/Button/Outline", + "componentId": "1:770", + "fills": [{"type": "SOLID", "color": "#00000000", "opacity": 0}], + "strokes": [{"type": "SOLID", "color": "#00000000", "opacity": 0}], + "strokeWeight": 1, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "CENTER", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "texts": ["Regenerate"] + }, + { + "name": "Gameplane/Button/Small/Danger", + "type": "INSTANCE", + "x": 156, + "y": 122, + "width": 92, + "height": 32, + "component": "Gameplane/Button/Small/Danger", + "componentId": "1:1878", + "fills": [{"type": "SOLID", "color": "#00000000", "opacity": 0}], + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "CENTER", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "texts": ["Revoke"] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] +} diff --git a/assets/design-export/json/1-46383.json b/assets/design-export/json/1-46383.json new file mode 100644 index 000000000..ebffb91cd --- /dev/null +++ b/assets/design-export/json/1-46383.json @@ -0,0 +1,580 @@ +{ + "file": "1-46383", + "id": "1:46383", + "name": "Screen/Settings — SFTP (No password)", + "type": "FRAME", + "x": 4920, + "y": 82663, + "width": 1440, + "height": 1080, + "fills": [{"type": "SOLID", "color": "#121114"}], + "clips": true, + "variables": {"fills/0/color": "background/background"}, + "children": [ + { + "name": "App Sidebar", + "type": "INSTANCE", + "x": 0, + "y": 0, + "width": 260, + "height": 1080, + "component": "Gameplane/App Sidebar", + "componentId": "1:234", + "fills": [{"type": "SOLID", "color": "#17151A"}], + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "layout": { + "mode": "VERTICAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"fills/0/color": "surface/secondary", "strokes/0/color": "border/border"}, + "texts": [ + "gameplane", + "homelab-01", + "GENERAL", + "Dashboard", + "Servers", + "Modules", + "Backups", + "ADMIN", + "Clusters", + "Nodes", + "Users & RBAC", + "Audit log", + "System logs", + "Settings", + "AD", + "admin", + "admin" + ] + }, + { + "id": "1:46402", + "name": "Main", + "type": "FRAME", + "x": 260, + "y": 0, + "width": 1180, + "height": 1080, + "children": [ + { + "id": "1:46446", + "name": "Top Bar", + "type": "FRAME", + "x": 0, + "y": 0, + "width": 1180, + "height": 64, + "fills": [{"type": "SOLID", "color": "#121114"}], + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 32, 0, 32], + "primary": "SPACE_BETWEEN", + "counter": "CENTER", + "sizing": ["FIXED", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"fills/0/color": "background/background", "strokes/0/color": "border/border"}, + "children": [ + { + "id": "1:46541", + "name": "Breadcrumbs", + "type": "FRAME", + "x": 32, + "y": 23, + "width": 157, + "height": 18, + "layout": { + "mode": "HORIZONTAL", + "gap": 8, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["HUG", "HUG"] + }, + "children": [ + { + "id": "1:46625", + "name": "crumbRoot", + "type": "TEXT", + "x": 0, + "y": 0, + "width": 72, + "height": 18, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "text": "gameplane", + "font": ["Geist", 400, 14], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "muted"} + }, + { + "id": "1:46626", + "name": "crumbSep", + "type": "FRAME", + "x": 80, + "y": 2, + "width": 14, + "height": 14, + "variables": {"fills/0/color": "muted"}, + "children": [ + { + "id": "1:46717", + "name": "path", + "type": "VECTOR", + "x": 5.25, + "y": 3.5, + "width": 3.5, + "height": 7, + "strokes": [{"type": "SOLID", "color": "#9E98A6"}], + "strokeWeight": 1.17 + } + ] + }, + { + "id": "1:46627", + "name": "crumbPage", + "type": "TEXT", + "x": 102, + "y": 0, + "width": 55, + "height": 18, + "fills": [{"type": "SOLID", "color": "#F5F3F7"}], + "text": "Settings", + "font": ["Geist", 500, 14], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + } + ] + }, + { + "id": "1:46542", + "name": "Actions", + "type": "FRAME", + "x": 752, + "y": 0, + "width": 396, + "height": 64, + "layout": { + "mode": "HORIZONTAL", + "gap": 12, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["HUG", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "id": "1:46628", + "name": "Cluster Pill", + "type": "FRAME", + "x": 0, + "y": 15.5, + "width": 94, + "height": 33, + "visible": false, + "fills": [{"type": "SOLID", "color": "#1C1A20"}], + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "cornerRadius": 8, + "layout": { + "mode": "HORIZONTAL", + "gap": 8, + "padding": [8, 12, 8, 12], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["HUG", "HUG"] + }, + "variables": {"fills/0/color": "surface/surface", "strokes/0/color": "border/border"}, + "children": [ + { + "id": "1:46718", + "name": "healthDot", + "type": "ELLIPSE", + "x": 12, + "y": 12.5, + "width": 8, + "height": 8, + "fills": [{"type": "SOLID", "color": "#21C45D"}], + "variables": {"fills/0/color": "success/success"} + }, + { + "id": "1:46719", + "name": "clusterName", + "type": "TEXT", + "x": 28, + "y": 8, + "width": 30, + "height": 17, + "fills": [{"type": "SOLID", "color": "#F5F3F7"}], + "text": "local", + "font": ["Geist", 500, 13], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + }, + { + "name": "chevron", + "type": "INSTANCE", + "x": 66, + "y": 8.5, + "width": 16, + "height": 16, + "component": "lucide/chevron-down/16x16", + "variables": {"fills/0/color": "muted"} + } + ] + }, + { + "name": "Search", + "type": "INSTANCE", + "x": 0, + "y": 12, + "width": 300, + "height": 40, + "component": "SearchField/Primary", + "componentId": "1:1928", + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "FIXED"] + }, + "texts": ["Search servers…"] + }, + { + "id": "1:46629", + "name": "Bell Wrap", + "type": "FRAME", + "x": 312, + "y": 12, + "width": 40, + "height": 40, + "children": [ + { + "id": "1:46720", + "name": "Sdet8", + "type": "FRAME", + "x": 0, + "y": 0, + "width": 36, + "height": 36, + "fills": [{"type": "SOLID", "color": "#00000000", "opacity": 0}], + "cornerRadius": 8, + "children": [ + { + "name": "icon", + "type": "INSTANCE", + "x": 8, + "y": 8, + "width": 20, + "height": 20, + "component": "lucide/bell/20x20", + "variables": {"fills/0/color": "foreground/foreground"} + } + ] + }, + { + "id": "1:46721", + "name": "UnreadDot", + "type": "ELLIPSE", + "x": 29, + "y": 1, + "width": 8, + "height": 8, + "visible": false, + "fills": [{"type": "SOLID", "color": "#FF4FA3"}], + "strokes": [{"type": "SOLID", "color": "#121114"}], + "strokeWeight": 1.5, + "variables": {"fills/0/color": "accent/accent", "strokes/0/color": "background/background"} + } + ] + }, + { + "name": "Avatar", + "type": "INSTANCE", + "x": 364, + "y": 16, + "width": 32, + "height": 32, + "component": "Avatar/Text", + "componentId": "1:2407", + "fills": [{"type": "SOLID", "color": "#FF4FA3"}], + "cornerRadius": 9999, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "CENTER", + "counter": "CENTER", + "sizing": ["FIXED", "FIXED"] + }, + "variables": {"fills/0/color": "accent/accent"}, + "texts": ["AD"] + } + ] + } + ] + }, + { + "id": "1:46447", + "name": "Body", + "type": "FRAME", + "x": 0, + "y": 64, + "width": 1180, + "height": 1016, + "layout": { + "mode": "VERTICAL", + "gap": 24, + "padding": [24, 24, 24, 24], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "FIXED"] + }, + "layoutGrow": 1, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "name": "Page Header", + "type": "INSTANCE", + "x": 24, + "y": 24, + "width": 1132, + "height": 53, + "component": "Gameplane/Page Header", + "componentId": "1:3282", + "fills": [{"type": "SOLID", "color": "#121114"}], + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "SPACE_BETWEEN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"fills/0/color": "background/background"}, + "texts": [ + "SFTP access", + "Your personal SFTP credentials for game server files. Admins can see and revoke them." + ] + }, + { + "id": "1:46543", + "name": "Settings Layout", + "type": "FRAME", + "x": 24, + "y": 101, + "width": 1132, + "height": 891, + "layout": { + "mode": "HORIZONTAL", + "gap": 24, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "FIXED"] + }, + "layoutGrow": 1, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "name": "Settings Nav", + "type": "INSTANCE", + "x": 0, + "y": 0, + "width": 220, + "height": 492, + "component": "Gameplane/Admin Settings Nav", + "componentId": "1:3419", + "layout": { + "mode": "VERTICAL", + "gap": 2, + "padding": [8, 0, 8, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "texts": [ + "ACCOUNT", + "Theme", + "MCP tokens", + "SFTP", + "SERVER", + "General", + "Authentication", + "Module sources", + "Mod registries", + "Notifications", + "Telemetry", + "Updates", + "About" + ] + }, + { + "id": "1:46630", + "name": "Content Column", + "type": "FRAME", + "x": 244, + "y": 0, + "width": 888, + "height": 915, + "layout": { + "mode": "VERTICAL", + "gap": 16, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "FIXED"] + }, + "layoutGrow": 1, + "children": [ + { + "name": "Gameplane/Settings/SFTP Address Card", + "type": "INSTANCE", + "x": 0, + "y": 0, + "width": 888, + "height": 420, + "component": "Gameplane/Settings/SFTP Address Card", + "fills": [{"type": "SOLID", "color": "#1C1A20"}], + "cornerRadius": 24, + "variables": {"fills/0/color": "surface/surface"}, + "texts": [ + "SFTP address", + "Use these settings in any SFTP client. Check the host key matches the fingerprint your client shows on first connect.", + "Host", + "sftp.gameplane.example", + "Port", + "2222", + "Host key (SHA256)", + "SHA256:4mQ2xR7vK9pL0wZ3sB8nT1cY6hJ5gF2dA0eU", + "Copy", + "Copy", + "Username", + "Log in with one of these usernames and your SSH key or SFTP password.", + "alice", + "Lists every server you can read, one folder each", + "alice+survival", + "Opens straight in the files of server survival", + "alice+mods/survival", + "Opens a server in another namespace (mods)" + ] + }, + { + "name": "Gameplane/Settings/SFTP Keys Card", + "type": "INSTANCE", + "x": 0, + "y": 436, + "width": 888, + "height": 290, + "component": "Gameplane/Settings/SFTP Keys Card", + "fills": [{"type": "SOLID", "color": "#1C1A20"}], + "cornerRadius": 24, + "variables": {"fills/0/color": "surface/surface"}, + "texts": [ + "SSH keys", + "Public keys that can log in over SFTP. Gameplane stores only the public part.", + "Add key", + "laptop", + "ssh-ed25519 · SHA256:9dK1vT7qLm2Xr8ZcW4bN0eH6sJ3yU5pA1fG", + "Added 3 Oct 2026 · Last used 2 hours ago", + "Remove", + "ci-runner", + "ssh-rsa · SHA256:Lm7Qa2Xp9rTz4Vc8Ns1Wd6Hk3Bj0Ye5Ug", + "Added 21 Nov 2026 · Never used", + "Remove" + ] + }, + { + "id": "1:46722", + "name": "Card SFTP password", + "type": "FRAME", + "x": 0, + "y": 742, + "width": 888, + "height": 170, + "fills": [{"type": "SOLID", "color": "#1C1A20"}], + "cornerRadius": 24, + "variables": {"fills/0/color": "surface/surface"}, + "children": [ + { + "id": "1:46818", + "name": "cardTitle", + "type": "TEXT", + "x": 24, + "y": 20, + "width": 116, + "height": 21, + "fills": [{"type": "SOLID", "color": "#F5F3F7"}], + "text": "SFTP password", + "font": ["Geist", 500, 16], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + }, + { + "id": "1:46819", + "name": "cardBody", + "type": "TEXT", + "x": 24, + "y": 48, + "width": 368, + "height": 18, + "fills": [{"type": "SOLID", "color": "#F5F3F7"}], + "layoutAlignSelf": "STRETCH", + "text": "Not set · You have no SFTP password yet", + "font": ["Geist", 400, 14], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + }, + { + "id": "1:46820", + "name": "cardBody", + "type": "TEXT", + "x": 24, + "y": 72, + "width": 840, + "height": 18, + "fills": [{"type": "SOLID", "color": "#F5F3F7"}], + "layoutAlignSelf": "STRETCH", + "text": "Generate one to log in with a password, or add an SSH key above. A password is shown once and never expires.", + "font": ["Geist", 400, 14], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + }, + { + "name": "Gameplane/Button/Default", + "type": "INSTANCE", + "x": 24, + "y": 118, + "width": 160, + "height": 36, + "component": "Gameplane/Button/Default", + "componentId": "1:306", + "fills": [{"type": "SOLID", "color": "#00000000", "opacity": 0}], + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "CENTER", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "texts": ["Generate password"] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] +} diff --git a/assets/design-export/json/1-46384.json b/assets/design-export/json/1-46384.json new file mode 100644 index 000000000..be1619141 --- /dev/null +++ b/assets/design-export/json/1-46384.json @@ -0,0 +1,267 @@ +{ + "file": "1-46384", + "id": "1:46384", + "name": "Gameplane/Dialog/Add SSH key", + "type": "FRAME", + "x": 6560, + "y": 82663, + "width": 480, + "height": 380, + "fills": [{"type": "SOLID", "color": "#1C1A20"}], + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "cornerRadius": 12, + "clips": true, + "variables": {"fills/0/color": "surface/surface", "strokes/0/color": "border/border"}, + "children": [ + { + "id": "1:46403", + "name": "mTitle", + "type": "TEXT", + "x": 20, + "y": 20, + "width": 99, + "height": 24, + "fills": [{"type": "SOLID", "color": "#F5F3F7"}], + "text": "Add SSH key", + "font": ["Geist", 600, 16], + "lineHeight": {"value": 150, "unit": "PERCENT"}, + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + }, + { + "id": "1:46404", + "name": "mDescWrap", + "type": "FRAME", + "x": 20, + "y": 44, + "width": 440, + "height": 25, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [4, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "id": "1:46448", + "name": "mDesc", + "type": "TEXT", + "x": 0, + "y": 4, + "width": 440, + "height": 21, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "layoutGrow": 1, + "text": "Paste one OpenSSH public key.", + "font": ["Geist", 400, 14], + "lineHeight": {"value": 150, "unit": "PERCENT"}, + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "muted"} + } + ] + }, + { + "id": "1:46405", + "name": "mFooter", + "type": "FRAME", + "x": 20, + "y": 308, + "width": 440, + "height": 52, + "layout": { + "mode": "HORIZONTAL", + "gap": 8, + "padding": [20, 0, 0, 0], + "primary": "MAX", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "id": "1:46449", + "name": "btnCancel", + "type": "FRAME", + "x": 298, + "y": 20, + "width": 64, + "height": 32, + "cornerRadius": 6, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 12, 0, 12], + "primary": "CENTER", + "counter": "CENTER", + "sizing": ["HUG", "FIXED"] + }, + "children": [ + { + "id": "1:46544", + "name": "text", + "type": "TEXT", + "x": 12, + "y": 8, + "width": 40, + "height": 16, + "fills": [{"type": "SOLID", "color": "#F5F3F7"}], + "text": "Cancel", + "font": ["Geist", 500, 12], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + } + ] + }, + { + "id": "1:46450", + "name": "btnPrimary", + "type": "FRAME", + "x": 370, + "y": 20, + "width": 70, + "height": 32, + "opacity": 0.5, + "fills": [{"type": "SOLID", "color": "#FF4FA3"}], + "cornerRadius": 6, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 12, 0, 12], + "primary": "CENTER", + "counter": "CENTER", + "sizing": ["HUG", "FIXED"] + }, + "variables": {"fills/0/color": "accent/accent"}, + "children": [ + { + "id": "1:46545", + "name": "text", + "type": "TEXT", + "x": 12, + "y": 8, + "width": 46, + "height": 16, + "fills": [{"type": "SOLID", "color": "#FFFFFF"}], + "text": "Add key", + "font": ["Geist", 500, 12], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "accent/foreground"} + } + ] + } + ] + }, + { + "id": "1:46406", + "name": "Body", + "type": "FRAME", + "x": 20, + "y": 69, + "width": 440, + "height": 230, + "children": [ + { + "id": "1:46451", + "name": "cardBody", + "type": "TEXT", + "x": 0, + "y": 0, + "width": 368, + "height": 18, + "fills": [{"type": "SOLID", "color": "#F5F3F7"}], + "layoutAlignSelf": "STRETCH", + "text": "Name", + "font": ["Geist", 400, 14], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + }, + { + "name": "Gameplane/Input", + "type": "INSTANCE", + "x": 0, + "y": 22, + "width": 440, + "height": 36, + "component": "Gameplane/Input", + "componentId": "1:706", + "fills": [{"type": "SOLID", "color": "#17151A"}], + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "effects": [{"type": "DROP_SHADOW", "radius": 2, "visible": true}], + "cornerRadius": 12, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [8, 12, 8, 12], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "FIXED"] + }, + "variables": { + "cornerRadius": "radius/xl", + "fills/0/color": "field/background", + "strokes/0/color": "field/border" + }, + "texts": ["laptop"] + }, + { + "id": "1:46452", + "name": "cardBody", + "type": "TEXT", + "x": 0, + "y": 80, + "width": 368, + "height": 18, + "fills": [{"type": "SOLID", "color": "#F5F3F7"}], + "layoutAlignSelf": "STRETCH", + "text": "Public key", + "font": ["Geist", 400, 14], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + }, + { + "name": "Gameplane/Input", + "type": "INSTANCE", + "x": 0, + "y": 102, + "width": 440, + "height": 96, + "component": "Gameplane/Input", + "componentId": "1:706", + "fills": [{"type": "SOLID", "color": "#17151A"}], + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "effects": [{"type": "DROP_SHADOW", "radius": 2, "visible": true}], + "cornerRadius": 12, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [8, 12, 8, 12], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "FIXED"] + }, + "variables": { + "cornerRadius": "radius/xl", + "fills/0/color": "field/background", + "strokes/0/color": "field/border" + }, + "texts": ["ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIN7d… laptop"] + }, + { + "id": "1:46453", + "name": "cardBody", + "type": "TEXT", + "x": 0, + "y": 206, + "width": 440, + "height": 36, + "fills": [{"type": "SOLID", "color": "#F5F3F7"}], + "layoutAlignSelf": "STRETCH", + "text": "Paste one line from your .pub file. Ed25519, ECDSA and RSA keys are accepted.", + "font": ["Geist", 400, 14], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + } + ] + } + ] +} diff --git a/assets/design-export/json/1-46385.json b/assets/design-export/json/1-46385.json new file mode 100644 index 000000000..d16595f8d --- /dev/null +++ b/assets/design-export/json/1-46385.json @@ -0,0 +1,297 @@ +{ + "file": "1-46385", + "id": "1:46385", + "name": "Gameplane/Dialog/Add SSH key (Invalid key)", + "type": "FRAME", + "x": 7240, + "y": 82663, + "width": 480, + "height": 470, + "fills": [{"type": "SOLID", "color": "#1C1A20"}], + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "cornerRadius": 12, + "clips": true, + "variables": {"fills/0/color": "surface/surface", "strokes/0/color": "border/border"}, + "children": [ + { + "id": "1:46407", + "name": "mTitle", + "type": "TEXT", + "x": 20, + "y": 20, + "width": 99, + "height": 24, + "fills": [{"type": "SOLID", "color": "#F5F3F7"}], + "text": "Add SSH key", + "font": ["Geist", 600, 16], + "lineHeight": {"value": 150, "unit": "PERCENT"}, + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + }, + { + "id": "1:46408", + "name": "mDescWrap", + "type": "FRAME", + "x": 20, + "y": 44, + "width": 440, + "height": 25, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [4, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "id": "1:46454", + "name": "mDesc", + "type": "TEXT", + "x": 0, + "y": 4, + "width": 440, + "height": 21, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "layoutGrow": 1, + "text": "Paste one OpenSSH public key.", + "font": ["Geist", 400, 14], + "lineHeight": {"value": 150, "unit": "PERCENT"}, + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "muted"} + } + ] + }, + { + "id": "1:46409", + "name": "mFooter", + "type": "FRAME", + "x": 20, + "y": 398, + "width": 440, + "height": 52, + "layout": { + "mode": "HORIZONTAL", + "gap": 8, + "padding": [20, 0, 0, 0], + "primary": "MAX", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "id": "1:46455", + "name": "btnCancel", + "type": "FRAME", + "x": 298, + "y": 20, + "width": 64, + "height": 32, + "cornerRadius": 6, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 12, 0, 12], + "primary": "CENTER", + "counter": "CENTER", + "sizing": ["HUG", "FIXED"] + }, + "children": [ + { + "id": "1:46546", + "name": "text", + "type": "TEXT", + "x": 12, + "y": 8, + "width": 40, + "height": 16, + "fills": [{"type": "SOLID", "color": "#F5F3F7"}], + "text": "Cancel", + "font": ["Geist", 500, 12], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + } + ] + }, + { + "id": "1:46456", + "name": "btnPrimary", + "type": "FRAME", + "x": 370, + "y": 20, + "width": 70, + "height": 32, + "opacity": 0.5, + "fills": [{"type": "SOLID", "color": "#FF4FA3"}], + "cornerRadius": 6, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 12, 0, 12], + "primary": "CENTER", + "counter": "CENTER", + "sizing": ["HUG", "FIXED"] + }, + "variables": {"fills/0/color": "accent/accent"}, + "children": [ + { + "id": "1:46547", + "name": "text", + "type": "TEXT", + "x": 12, + "y": 8, + "width": 46, + "height": 16, + "fills": [{"type": "SOLID", "color": "#FFFFFF"}], + "text": "Add key", + "font": ["Geist", 500, 12], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "accent/foreground"} + } + ] + } + ] + }, + { + "id": "1:46410", + "name": "Body", + "type": "FRAME", + "x": 20, + "y": 69, + "width": 440, + "height": 320, + "children": [ + { + "name": "Gameplane/Error Banner", + "type": "INSTANCE", + "x": 0, + "y": 0, + "width": 440, + "height": 64, + "component": "Gameplane/Error Banner", + "componentId": "1:4577", + "fills": [{"type": "SOLID", "color": "#1C1A20"}], + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "cornerRadius": 6, + "layout": { + "mode": "HORIZONTAL", + "gap": 8, + "padding": [12, 12, 12, 12], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "FIXED"] + }, + "variables": { + "cornerRadius": "radius/md", + "fills/0/color": "surface/surface", + "strokes/0/color": "border/border" + }, + "texts": [ + "This is not a valid OpenSSH public key. Check that the line starts with ssh-ed25519, ecdsa-sha2 or ssh-rsa." + ] + }, + { + "id": "1:46457", + "name": "cardBody", + "type": "TEXT", + "x": 0, + "y": 76, + "width": 368, + "height": 18, + "fills": [{"type": "SOLID", "color": "#F5F3F7"}], + "layoutAlignSelf": "STRETCH", + "text": "Name", + "font": ["Geist", 400, 14], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + }, + { + "name": "Gameplane/Input", + "type": "INSTANCE", + "x": 0, + "y": 98, + "width": 440, + "height": 36, + "component": "Gameplane/Input", + "componentId": "1:706", + "fills": [{"type": "SOLID", "color": "#17151A"}], + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "effects": [{"type": "DROP_SHADOW", "radius": 2, "visible": true}], + "cornerRadius": 12, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [8, 12, 8, 12], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "FIXED"] + }, + "variables": { + "cornerRadius": "radius/xl", + "fills/0/color": "field/background", + "strokes/0/color": "field/border" + }, + "texts": ["laptop"] + }, + { + "id": "1:46458", + "name": "cardBody", + "type": "TEXT", + "x": 0, + "y": 156, + "width": 368, + "height": 18, + "fills": [{"type": "SOLID", "color": "#F5F3F7"}], + "layoutAlignSelf": "STRETCH", + "text": "Public key", + "font": ["Geist", 400, 14], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + }, + { + "name": "Gameplane/Input", + "type": "INSTANCE", + "x": 0, + "y": 178, + "width": 440, + "height": 96, + "component": "Gameplane/Input", + "componentId": "1:706", + "fills": [{"type": "SOLID", "color": "#17151A"}], + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "effects": [{"type": "DROP_SHADOW", "radius": 2, "visible": true}], + "cornerRadius": 12, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [8, 12, 8, 12], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "FIXED"] + }, + "variables": { + "cornerRadius": "radius/xl", + "fills/0/color": "field/background", + "strokes/0/color": "field/border" + }, + "texts": ["ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIN7d"] + }, + { + "id": "1:46459", + "name": "cardBody", + "type": "TEXT", + "x": 0, + "y": 282, + "width": 440, + "height": 36, + "fills": [{"type": "SOLID", "color": "#F5F3F7"}], + "layoutAlignSelf": "STRETCH", + "text": "Paste one line from your .pub file. Ed25519, ECDSA and RSA keys are accepted.", + "font": ["Geist", 400, 14], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + } + ] + } + ] +} diff --git a/assets/design-export/json/1-46386.json b/assets/design-export/json/1-46386.json new file mode 100644 index 000000000..271f807d3 --- /dev/null +++ b/assets/design-export/json/1-46386.json @@ -0,0 +1,269 @@ +{ + "file": "1-46386", + "id": "1:46386", + "name": "Gameplane/Dialog/Generate SFTP password", + "type": "FRAME", + "x": 7920, + "y": 82663, + "width": 480, + "height": 300, + "fills": [{"type": "SOLID", "color": "#1C1A20"}], + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "cornerRadius": 12, + "clips": true, + "variables": {"fills/0/color": "surface/surface", "strokes/0/color": "border/border"}, + "children": [ + { + "id": "1:46411", + "name": "mTitle", + "type": "TEXT", + "x": 20, + "y": 20, + "width": 193, + "height": 24, + "fills": [{"type": "SOLID", "color": "#F5F3F7"}], + "text": "Generate SFTP password", + "font": ["Geist", 600, 16], + "lineHeight": {"value": 150, "unit": "PERCENT"}, + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + }, + { + "id": "1:46412", + "name": "mDescWrap", + "type": "FRAME", + "x": 20, + "y": 44, + "width": 440, + "height": 25, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [4, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "id": "1:46460", + "name": "mDesc", + "type": "TEXT", + "x": 0, + "y": 4, + "width": 440, + "height": 21, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "layoutGrow": 1, + "text": "Replaces your current password.", + "font": ["Geist", 400, 14], + "lineHeight": {"value": 150, "unit": "PERCENT"}, + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "muted"} + } + ] + }, + { + "id": "1:46413", + "name": "mFooter", + "type": "FRAME", + "x": 20, + "y": 228, + "width": 440, + "height": 52, + "layout": { + "mode": "HORIZONTAL", + "gap": 8, + "padding": [20, 0, 0, 0], + "primary": "MAX", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "id": "1:46461", + "name": "btnCancel", + "type": "FRAME", + "x": 292, + "y": 20, + "width": 64, + "height": 32, + "cornerRadius": 6, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 12, 0, 12], + "primary": "CENTER", + "counter": "CENTER", + "sizing": ["HUG", "FIXED"] + }, + "children": [ + { + "id": "1:46548", + "name": "text", + "type": "TEXT", + "x": 12, + "y": 8, + "width": 40, + "height": 16, + "fills": [{"type": "SOLID", "color": "#F5F3F7"}], + "text": "Cancel", + "font": ["Geist", 500, 12], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + } + ] + }, + { + "id": "1:46462", + "name": "btnPrimary", + "type": "FRAME", + "x": 364, + "y": 20, + "width": 76, + "height": 32, + "opacity": 0.5, + "fills": [{"type": "SOLID", "color": "#FF4FA3"}], + "cornerRadius": 6, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 12, 0, 12], + "primary": "CENTER", + "counter": "CENTER", + "sizing": ["HUG", "FIXED"] + }, + "variables": {"fills/0/color": "accent/accent"}, + "children": [ + { + "id": "1:46549", + "name": "text", + "type": "TEXT", + "x": 12, + "y": 8, + "width": 52, + "height": 16, + "fills": [{"type": "SOLID", "color": "#FFFFFF"}], + "text": "Generate", + "font": ["Geist", 500, 12], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "accent/foreground"} + } + ] + } + ] + }, + { + "id": "1:46414", + "name": "Body", + "type": "FRAME", + "x": 20, + "y": 69, + "width": 440, + "height": 150, + "children": [ + { + "id": "1:46463", + "name": "cardBody", + "type": "TEXT", + "x": 0, + "y": 0, + "width": 368, + "height": 18, + "fills": [{"type": "SOLID", "color": "#F5F3F7"}], + "layoutAlignSelf": "STRETCH", + "text": "Length", + "font": ["Geist", 400, 14], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + }, + { + "id": "1:46464", + "name": "cardBody", + "type": "TEXT", + "x": 340, + "y": 0, + "width": 368, + "height": 18, + "fills": [{"type": "SOLID", "color": "#F5F3F7"}], + "layoutAlignSelf": "STRETCH", + "text": "32 characters", + "font": ["Geist", 400, 14], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + }, + { + "id": "1:46465", + "name": "Slider track", + "type": "RECTANGLE", + "x": 0, + "y": 30, + "width": 440, + "height": 4 + }, + { + "id": "1:46466", + "name": "Slider fill", + "type": "RECTANGLE", + "x": 0, + "y": 30, + "width": 264, + "height": 4, + "fills": [{"type": "SOLID", "color": "#FF4FA3"}], + "variables": {"fills/0/color": "accent/accent"} + }, + { + "id": "1:46467", + "name": "Slider knob", + "type": "RECTANGLE", + "x": 257, + "y": 25, + "width": 14, + "height": 14, + "fills": [{"type": "SOLID", "color": "#FF4FA3"}], + "cornerRadius": 7, + "variables": {"fills/0/color": "accent/accent"} + }, + { + "id": "1:46468", + "name": "cardBody", + "type": "TEXT", + "x": 0, + "y": 44, + "width": 368, + "height": 18, + "fills": [{"type": "SOLID", "color": "#F5F3F7"}], + "layoutAlignSelf": "STRETCH", + "text": "20", + "font": ["Geist", 400, 14], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + }, + { + "id": "1:46469", + "name": "cardBody", + "type": "TEXT", + "x": 420, + "y": 44, + "width": 368, + "height": 18, + "fills": [{"type": "SOLID", "color": "#F5F3F7"}], + "layoutAlignSelf": "STRETCH", + "text": "40", + "font": ["Geist", 400, 14], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + }, + { + "id": "1:46470", + "name": "cardBody", + "type": "TEXT", + "x": 0, + "y": 78, + "width": 440, + "height": 36, + "fills": [{"type": "SOLID", "color": "#F5F3F7"}], + "layoutAlignSelf": "STRETCH", + "text": "Each character is drawn at random from the 94 printable ASCII characters (no spaces) with a cryptographically secure generator.", + "font": ["Geist", 400, 14], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + } + ] + } + ] +} diff --git a/assets/design-export/json/1-46387.json b/assets/design-export/json/1-46387.json new file mode 100644 index 000000000..ca383e058 --- /dev/null +++ b/assets/design-export/json/1-46387.json @@ -0,0 +1,260 @@ +{ + "file": "1-46387", + "id": "1:46387", + "name": "Gameplane/Dialog/SFTP password (Shown once)", + "type": "FRAME", + "x": 8600, + "y": 82663, + "width": 480, + "height": 420, + "fills": [{"type": "SOLID", "color": "#1C1A20"}], + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "cornerRadius": 12, + "clips": true, + "variables": {"fills/0/color": "surface/surface", "strokes/0/color": "border/border"}, + "children": [ + { + "id": "1:46415", + "name": "mTitle", + "type": "TEXT", + "x": 20, + "y": 20, + "width": 157, + "height": 24, + "fills": [{"type": "SOLID", "color": "#F5F3F7"}], + "text": "Your SFTP password", + "font": ["Geist", 600, 16], + "lineHeight": {"value": 150, "unit": "PERCENT"}, + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + }, + { + "id": "1:46416", + "name": "mDescWrap", + "type": "FRAME", + "x": 20, + "y": 44, + "width": 440, + "height": 25, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [4, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "id": "1:46471", + "name": "mDesc", + "type": "TEXT", + "x": 0, + "y": 4, + "width": 440, + "height": 21, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "layoutGrow": 1, + "text": "Copy it now. Gameplane stores only a hash and cannot show it again.", + "font": ["Geist", 400, 14], + "lineHeight": {"value": 150, "unit": "PERCENT"}, + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "muted"} + } + ] + }, + { + "id": "1:46417", + "name": "mFooter", + "type": "FRAME", + "x": 20, + "y": 348, + "width": 440, + "height": 52, + "layout": { + "mode": "HORIZONTAL", + "gap": 8, + "padding": [20, 0, 0, 0], + "primary": "MAX", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "id": "1:46472", + "name": "btnCancel", + "type": "FRAME", + "x": 266, + "y": 20, + "width": 64, + "height": 32, + "visible": false, + "cornerRadius": 6, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 12, 0, 12], + "primary": "CENTER", + "counter": "CENTER", + "sizing": ["HUG", "FIXED"] + }, + "children": [ + { + "id": "1:46550", + "name": "text", + "type": "TEXT", + "x": 12, + "y": 8, + "width": 40, + "height": 16, + "fills": [{"type": "SOLID", "color": "#F5F3F7"}], + "text": "Cancel", + "font": ["Geist", 500, 12], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + } + ] + }, + { + "id": "1:46473", + "name": "btnPrimary", + "type": "FRAME", + "x": 386, + "y": 20, + "width": 54, + "height": 32, + "opacity": 0.5, + "fills": [{"type": "SOLID", "color": "#FF4FA3"}], + "cornerRadius": 6, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 12, 0, 12], + "primary": "CENTER", + "counter": "CENTER", + "sizing": ["HUG", "FIXED"] + }, + "variables": {"fills/0/color": "accent/accent"}, + "children": [ + { + "id": "1:46551", + "name": "text", + "type": "TEXT", + "x": 12, + "y": 8, + "width": 30, + "height": 16, + "fills": [{"type": "SOLID", "color": "#FFFFFF"}], + "text": "Done", + "font": ["Geist", 500, 12], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "accent/foreground"} + } + ] + } + ] + }, + { + "id": "1:46418", + "name": "Body", + "type": "FRAME", + "x": 20, + "y": 69, + "width": 440, + "height": 270, + "children": [ + { + "name": "Gameplane/Error Banner", + "type": "INSTANCE", + "x": 0, + "y": 0, + "width": 440, + "height": 64, + "component": "Gameplane/Error Banner", + "componentId": "1:4577", + "fills": [{"type": "SOLID", "color": "#1C1A20"}], + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "cornerRadius": 6, + "layout": { + "mode": "HORIZONTAL", + "gap": 8, + "padding": [12, 12, 12, 12], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "FIXED"] + }, + "variables": { + "cornerRadius": "radius/md", + "fills/0/color": "surface/surface", + "strokes/0/color": "border/border" + }, + "texts": ["You will not see this again. Store it in a password manager before you close this dialog."] + }, + { + "id": "1:46474", + "name": "Password box", + "type": "FRAME", + "x": 0, + "y": 80, + "width": 440, + "height": 48, + "fills": [{"type": "SOLID", "color": "#1C1A20"}], + "cornerRadius": 24, + "variables": {"fills/0/color": "surface/surface"}, + "children": [ + { + "id": "1:46552", + "name": "text", + "type": "TEXT", + "x": 12, + "y": 15, + "width": 261, + "height": 18, + "fills": [{"type": "SOLID", "color": "#F5F3F7"}], + "text": "k7#Qp2vR9xW4mT8nL1zF5dH0bY3sC6g", + "font": ["JetBrains Mono", 600, 14], + "variables": {"fontFamily": "typography/font-mono", "fills/0/color": "foreground/foreground"} + } + ] + }, + { + "name": "Gameplane/Button/Small/Outline", + "type": "INSTANCE", + "x": 0, + "y": 144, + "width": 84, + "height": 32, + "component": "Gameplane/Button/Small/Outline", + "componentId": "1:740", + "fills": [{"type": "SOLID", "color": "#00000000", "opacity": 0}], + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "CENTER", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "variables": {"strokes/0/color": "border/border"}, + "texts": ["Copy"] + }, + { + "id": "1:46475", + "name": "cardBody", + "type": "TEXT", + "x": 100, + "y": 152, + "width": 368, + "height": 18, + "fills": [{"type": "SOLID", "color": "#F5F3F7"}], + "layoutAlignSelf": "STRETCH", + "text": "32 characters", + "font": ["Geist", 400, 14], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + } + ] + } + ] +} diff --git a/assets/design-export/json/1-46388.json b/assets/design-export/json/1-46388.json new file mode 100644 index 000000000..fcf817a68 --- /dev/null +++ b/assets/design-export/json/1-46388.json @@ -0,0 +1,588 @@ +{ + "file": "1-46388", + "id": "1:46388", + "name": "Screen/Settings — SFTP (Non-admin)", + "type": "FRAME", + "x": 10700, + "y": 82663, + "width": 1440, + "height": 1080, + "fills": [{"type": "SOLID", "color": "#121114"}], + "clips": true, + "variables": {"fills/0/color": "background/background"}, + "children": [ + { + "name": "App Sidebar", + "type": "INSTANCE", + "x": 0, + "y": 0, + "width": 260, + "height": 1080, + "component": "Gameplane/App Sidebar", + "componentId": "1:234", + "fills": [{"type": "SOLID", "color": "#17151A"}], + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "layout": { + "mode": "VERTICAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"fills/0/color": "surface/secondary", "strokes/0/color": "border/border"}, + "texts": [ + "gameplane", + "homelab-01", + "GENERAL", + "Dashboard", + "Servers", + "Modules", + "Backups", + "ADMIN", + "Clusters", + "Nodes", + "Users & RBAC", + "Audit log", + "System logs", + "Settings", + "AD", + "admin", + "admin" + ] + }, + { + "id": "1:46419", + "name": "Main", + "type": "FRAME", + "x": 260, + "y": 0, + "width": 1180, + "height": 1080, + "children": [ + { + "id": "1:46476", + "name": "Top Bar", + "type": "FRAME", + "x": 0, + "y": 0, + "width": 1180, + "height": 64, + "fills": [{"type": "SOLID", "color": "#121114"}], + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 32, 0, 32], + "primary": "SPACE_BETWEEN", + "counter": "CENTER", + "sizing": ["FIXED", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"fills/0/color": "background/background", "strokes/0/color": "border/border"}, + "children": [ + { + "id": "1:46553", + "name": "Breadcrumbs", + "type": "FRAME", + "x": 32, + "y": 23, + "width": 157, + "height": 18, + "layout": { + "mode": "HORIZONTAL", + "gap": 8, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["HUG", "HUG"] + }, + "children": [ + { + "id": "1:46631", + "name": "crumbRoot", + "type": "TEXT", + "x": 0, + "y": 0, + "width": 72, + "height": 18, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "text": "gameplane", + "font": ["Geist", 400, 14], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "muted"} + }, + { + "id": "1:46632", + "name": "crumbSep", + "type": "FRAME", + "x": 80, + "y": 2, + "width": 14, + "height": 14, + "variables": {"fills/0/color": "muted"}, + "children": [ + { + "id": "1:46723", + "name": "path", + "type": "VECTOR", + "x": 5.25, + "y": 3.5, + "width": 3.5, + "height": 7, + "strokes": [{"type": "SOLID", "color": "#9E98A6"}], + "strokeWeight": 1.17 + } + ] + }, + { + "id": "1:46633", + "name": "crumbPage", + "type": "TEXT", + "x": 102, + "y": 0, + "width": 55, + "height": 18, + "fills": [{"type": "SOLID", "color": "#F5F3F7"}], + "text": "Settings", + "font": ["Geist", 500, 14], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + } + ] + }, + { + "id": "1:46554", + "name": "Actions", + "type": "FRAME", + "x": 752, + "y": 0, + "width": 396, + "height": 64, + "layout": { + "mode": "HORIZONTAL", + "gap": 12, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["HUG", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "id": "1:46634", + "name": "Cluster Pill", + "type": "FRAME", + "x": 0, + "y": 15.5, + "width": 94, + "height": 33, + "visible": false, + "fills": [{"type": "SOLID", "color": "#1C1A20"}], + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "cornerRadius": 8, + "layout": { + "mode": "HORIZONTAL", + "gap": 8, + "padding": [8, 12, 8, 12], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["HUG", "HUG"] + }, + "variables": {"fills/0/color": "surface/surface", "strokes/0/color": "border/border"}, + "children": [ + { + "id": "1:46724", + "name": "healthDot", + "type": "ELLIPSE", + "x": 12, + "y": 12.5, + "width": 8, + "height": 8, + "fills": [{"type": "SOLID", "color": "#21C45D"}], + "variables": {"fills/0/color": "success/success"} + }, + { + "id": "1:46725", + "name": "clusterName", + "type": "TEXT", + "x": 28, + "y": 8, + "width": 30, + "height": 17, + "fills": [{"type": "SOLID", "color": "#F5F3F7"}], + "text": "local", + "font": ["Geist", 500, 13], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + }, + { + "name": "chevron", + "type": "INSTANCE", + "x": 66, + "y": 8.5, + "width": 16, + "height": 16, + "component": "lucide/chevron-down/16x16", + "variables": {"fills/0/color": "muted"} + } + ] + }, + { + "name": "Search", + "type": "INSTANCE", + "x": 0, + "y": 12, + "width": 300, + "height": 40, + "component": "SearchField/Primary", + "componentId": "1:1928", + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "FIXED"] + }, + "texts": ["Search servers…"] + }, + { + "id": "1:46635", + "name": "Bell Wrap", + "type": "FRAME", + "x": 312, + "y": 12, + "width": 40, + "height": 40, + "children": [ + { + "id": "1:46726", + "name": "Sdet8", + "type": "FRAME", + "x": 0, + "y": 0, + "width": 36, + "height": 36, + "fills": [{"type": "SOLID", "color": "#00000000", "opacity": 0}], + "cornerRadius": 8, + "children": [ + { + "name": "icon", + "type": "INSTANCE", + "x": 8, + "y": 8, + "width": 20, + "height": 20, + "component": "lucide/bell/20x20", + "variables": {"fills/0/color": "foreground/foreground"} + } + ] + }, + { + "id": "1:46727", + "name": "UnreadDot", + "type": "ELLIPSE", + "x": 29, + "y": 1, + "width": 8, + "height": 8, + "visible": false, + "fills": [{"type": "SOLID", "color": "#FF4FA3"}], + "strokes": [{"type": "SOLID", "color": "#121114"}], + "strokeWeight": 1.5, + "variables": {"fills/0/color": "accent/accent", "strokes/0/color": "background/background"} + } + ] + }, + { + "name": "Avatar", + "type": "INSTANCE", + "x": 364, + "y": 16, + "width": 32, + "height": 32, + "component": "Avatar/Text", + "componentId": "1:2407", + "fills": [{"type": "SOLID", "color": "#FF4FA3"}], + "cornerRadius": 9999, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "CENTER", + "counter": "CENTER", + "sizing": ["FIXED", "FIXED"] + }, + "variables": {"fills/0/color": "accent/accent"}, + "texts": ["AD"] + } + ] + } + ] + }, + { + "id": "1:46477", + "name": "Body", + "type": "FRAME", + "x": 0, + "y": 64, + "width": 1180, + "height": 1016, + "layout": { + "mode": "VERTICAL", + "gap": 24, + "padding": [24, 24, 24, 24], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "FIXED"] + }, + "layoutGrow": 1, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "name": "Page Header", + "type": "INSTANCE", + "x": 24, + "y": 24, + "width": 1132, + "height": 53, + "component": "Gameplane/Page Header", + "componentId": "1:3282", + "fills": [{"type": "SOLID", "color": "#121114"}], + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "SPACE_BETWEEN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"fills/0/color": "background/background"}, + "texts": [ + "SFTP access", + "Your personal SFTP credentials for game server files. Admins can see and revoke them." + ] + }, + { + "id": "1:46555", + "name": "Settings Layout", + "type": "FRAME", + "x": 24, + "y": 101, + "width": 1132, + "height": 891, + "layout": { + "mode": "HORIZONTAL", + "gap": 24, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "FIXED"] + }, + "layoutGrow": 1, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "name": "Settings Nav", + "type": "INSTANCE", + "x": 0, + "y": 0, + "width": 220, + "height": 158, + "component": "Gameplane/Admin Settings Nav", + "componentId": "1:3419", + "layout": { + "mode": "VERTICAL", + "gap": 2, + "padding": [8, 0, 8, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "texts": ["ACCOUNT", "Theme", "MCP tokens", "SFTP"] + }, + { + "id": "1:46636", + "name": "Content Column", + "type": "FRAME", + "x": 244, + "y": 0, + "width": 888, + "height": 915, + "layout": { + "mode": "VERTICAL", + "gap": 16, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "FIXED"] + }, + "layoutGrow": 1, + "children": [ + { + "name": "Gameplane/Settings/SFTP Address Card", + "type": "INSTANCE", + "x": 0, + "y": 0, + "width": 888, + "height": 420, + "component": "Gameplane/Settings/SFTP Address Card", + "fills": [{"type": "SOLID", "color": "#1C1A20"}], + "cornerRadius": 24, + "variables": {"fills/0/color": "surface/surface"}, + "texts": [ + "SFTP address", + "Use these settings in any SFTP client. Check the host key matches the fingerprint your client shows on first connect.", + "Host", + "sftp.gameplane.example", + "Port", + "2222", + "Host key (SHA256)", + "SHA256:4mQ2xR7vK9pL0wZ3sB8nT1cY6hJ5gF2dA0eU", + "Copy", + "Copy", + "Username", + "Log in with one of these usernames and your SSH key or SFTP password.", + "alice", + "Lists every server you can read, one folder each", + "alice+survival", + "Opens straight in the files of server survival", + "alice+mods/survival", + "Opens a server in another namespace (mods)" + ] + }, + { + "name": "Gameplane/Settings/SFTP Keys Card", + "type": "INSTANCE", + "x": 0, + "y": 436, + "width": 888, + "height": 290, + "component": "Gameplane/Settings/SFTP Keys Card", + "fills": [{"type": "SOLID", "color": "#1C1A20"}], + "cornerRadius": 24, + "variables": {"fills/0/color": "surface/surface"}, + "texts": [ + "SSH keys", + "Public keys that can log in over SFTP. Gameplane stores only the public part.", + "Add key", + "laptop", + "ssh-ed25519 · SHA256:9dK1vT7qLm2Xr8ZcW4bN0eH6sJ3yU5pA1fG", + "Added 3 Oct 2026 · Last used 2 hours ago", + "Remove", + "ci-runner", + "ssh-rsa · SHA256:Lm7Qa2Xp9rTz4Vc8Ns1Wd6Hk3Bj0Ye5Ug", + "Added 21 Nov 2026 · Never used", + "Remove" + ] + }, + { + "id": "1:46728", + "name": "Card SFTP password", + "type": "FRAME", + "x": 0, + "y": 742, + "width": 888, + "height": 170, + "fills": [{"type": "SOLID", "color": "#1C1A20"}], + "cornerRadius": 24, + "variables": {"fills/0/color": "surface/surface"}, + "children": [ + { + "id": "1:46821", + "name": "cardTitle", + "type": "TEXT", + "x": 24, + "y": 20, + "width": 116, + "height": 21, + "fills": [{"type": "SOLID", "color": "#F5F3F7"}], + "text": "SFTP password", + "font": ["Geist", 500, 16], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + }, + { + "id": "1:46822", + "name": "cardBody", + "type": "TEXT", + "x": 24, + "y": 48, + "width": 368, + "height": 18, + "fills": [{"type": "SOLID", "color": "#F5F3F7"}], + "layoutAlignSelf": "STRETCH", + "text": "Set · Created 3 Oct 2026 · Last used 5 minutes ago", + "font": ["Geist", 400, 14], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + }, + { + "id": "1:46823", + "name": "cardBody", + "type": "TEXT", + "x": 24, + "y": 72, + "width": 840, + "height": 18, + "fills": [{"type": "SOLID", "color": "#F5F3F7"}], + "layoutAlignSelf": "STRETCH", + "text": "Shown once when generated and stored only as a hash. It never expires. Regenerating or revoking it stops the old password at once.", + "font": ["Geist", 400, 14], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + }, + { + "name": "Gameplane/Button/Outline", + "type": "INSTANCE", + "x": 24, + "y": 118, + "width": 120, + "height": 32, + "component": "Gameplane/Button/Outline", + "componentId": "1:770", + "fills": [{"type": "SOLID", "color": "#00000000", "opacity": 0}], + "strokes": [{"type": "SOLID", "color": "#00000000", "opacity": 0}], + "strokeWeight": 1, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "CENTER", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "texts": ["Regenerate"] + }, + { + "name": "Gameplane/Button/Small/Danger", + "type": "INSTANCE", + "x": 156, + "y": 122, + "width": 92, + "height": 32, + "component": "Gameplane/Button/Small/Danger", + "componentId": "1:1878", + "fills": [{"type": "SOLID", "color": "#00000000", "opacity": 0}], + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "CENTER", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "texts": ["Revoke"] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] +} diff --git a/assets/design-export/json/1-46390.json b/assets/design-export/json/1-46390.json new file mode 100644 index 000000000..75bbb3c5a --- /dev/null +++ b/assets/design-export/json/1-46390.json @@ -0,0 +1,3330 @@ +{ + "file": "1-46390", + "id": "1:46390", + "name": "Screen/Server Detail — Files (Uploads)", + "type": "FRAME", + "x": 2280, + "y": 32501, + "width": 1440, + "height": 900, + "fills": [{"type": "SOLID", "color": "#121114"}], + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "FIXED"] + }, + "clips": true, + "variables": {"fills/0/color": "background/background"}, + "children": [ + { + "name": "App Sidebar", + "type": "INSTANCE", + "x": 0, + "y": 0, + "width": 260, + "height": 900, + "component": "Gameplane/App Sidebar", + "componentId": "1:234", + "fills": [{"type": "SOLID", "color": "#17151A"}], + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "layout": { + "mode": "VERTICAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"fills/0/color": "surface/secondary", "strokes/0/color": "border/border"}, + "texts": [ + "gameplane", + "homelab-01", + "GENERAL", + "Dashboard", + "Servers", + "Modules", + "Backups", + "ADMIN", + "Clusters", + "Nodes", + "Users & RBAC", + "Audit log", + "System logs", + "Settings", + "AD", + "admin", + "admin" + ] + }, + { + "id": "1:46420", + "name": "Main", + "type": "FRAME", + "x": 260, + "y": 0, + "width": 1180, + "height": 900, + "fills": [{"type": "SOLID", "color": "#121114"}], + "layout": { + "mode": "VERTICAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "FIXED"] + }, + "layoutGrow": 1, + "layoutAlignSelf": "STRETCH", + "variables": {"fills/0/color": "background/background"}, + "children": [ + { + "name": "Top Bar", + "type": "INSTANCE", + "x": 0, + "y": 0, + "width": 1180, + "height": 64, + "component": "Gameplane/Top Bar", + "componentId": "1:281", + "fills": [{"type": "SOLID", "color": "#121114"}], + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 32, 0, 32], + "primary": "SPACE_BETWEEN", + "counter": "CENTER", + "sizing": ["FIXED", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"fills/0/color": "background/background", "strokes/0/color": "border/border"}, + "texts": ["gameplane", "mc-survival", "Search servers…", "AD"] + }, + { + "name": "Detail Header", + "type": "INSTANCE", + "x": 0, + "y": 64, + "width": 1180, + "height": 86, + "component": "Gameplane/Server Detail Header", + "componentId": "1:447", + "fills": [{"type": "SOLID", "color": "#121114"}], + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [16, 24, 16, 24], + "primary": "SPACE_BETWEEN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"fills/0/color": "background/background"}, + "texts": [ + "MI", + "mc-survival", + "Running", + "site: remote-lab · minecraft-java · 1.21.4-fabric · ns: gameplane-games", + "Restart", + "Stop", + "Open console" + ] + }, + { + "name": "Tabs Bar", + "type": "INSTANCE", + "x": 0, + "y": 150, + "width": 1180, + "height": 76, + "component": "Gameplane/Server Detail Tabs", + "componentId": "1:466", + "fills": [{"type": "SOLID", "color": "#121114"}], + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [18, 24, 18, 24], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"fills/0/color": "background/background", "strokes/0/color": "border/border"}, + "texts": [ + "Overview", + "Events", + "Console", + "Logs", + "Files", + "Mods", + "Modpacks", + "Players", + "Backups", + "Capture", + "Settings" + ] + }, + { + "id": "1:46478", + "name": "Body", + "type": "FRAME", + "x": 0, + "y": 226, + "width": 1180, + "height": 674, + "fills": [{"type": "SOLID", "color": "#121114"}], + "layout": { + "mode": "VERTICAL", + "gap": 12, + "padding": [4, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "FIXED"] + }, + "layoutGrow": 1, + "layoutAlignSelf": "STRETCH", + "variables": {"fills/0/color": "background/background"}, + "children": [ + { + "id": "1:46556", + "name": "Files Toolbar", + "type": "FRAME", + "x": 0, + "y": 4, + "width": 1180, + "height": 36, + "layout": { + "mode": "HORIZONTAL", + "gap": 12, + "padding": [0, 0, 0, 0], + "primary": "SPACE_BETWEEN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "id": "1:46637", + "name": "Breadcrumb", + "type": "FRAME", + "x": 0, + "y": 3, + "width": 32, + "height": 30, + "fills": [{"type": "SOLID", "color": "#1C1A20"}], + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "cornerRadius": 4, + "layout": { + "mode": "HORIZONTAL", + "gap": 4, + "padding": [6, 12, 6, 12], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["HUG", "FIXED"] + }, + "variables": {"fills/0/color": "surface/surface", "strokes/0/color": "border/border"}, + "children": [ + { + "id": "1:46729", + "name": "Path", + "type": "TEXT", + "x": 12, + "y": 7, + "width": 8, + "height": 16, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "text": "/", + "font": ["JetBrains Mono", 400, 12], + "variables": {"fontFamily": "typography/font-mono", "fills/0/color": "muted"} + } + ] + }, + { + "id": "1:46638", + "name": "Toolbar Actions", + "type": "FRAME", + "x": 830, + "y": 0, + "width": 350, + "height": 36, + "layout": { + "mode": "HORIZONTAL", + "gap": 8, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["HUG", "HUG"] + }, + "children": [ + { + "name": "Btn New File", + "type": "INSTANCE", + "x": 0, + "y": 2, + "width": 93, + "height": 32, + "component": "Button/Outline/SM", + "componentId": "1:633", + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "cornerRadius": 24, + "layout": { + "mode": "HORIZONTAL", + "gap": 5, + "padding": [8, 12, 8, 12], + "primary": "CENTER", + "counter": "CENTER", + "sizing": ["HUG", "FIXED"] + }, + "variables": { + "cornerRadius": "radius/3xl", + "paddingRight": "spacing/3", + "paddingLeft": "spacing/3", + "strokes/0/color": "border-2" + }, + "texts": ["New file"] + }, + { + "name": "Btn New Folder", + "type": "INSTANCE", + "x": 101, + "y": 2, + "width": 110, + "height": 32, + "component": "Button/Outline/SM", + "componentId": "1:633", + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "cornerRadius": 24, + "layout": { + "mode": "HORIZONTAL", + "gap": 5, + "padding": [8, 12, 8, 12], + "primary": "CENTER", + "counter": "CENTER", + "sizing": ["HUG", "FIXED"] + }, + "variables": { + "cornerRadius": "radius/3xl", + "paddingRight": "spacing/3", + "paddingLeft": "spacing/3", + "strokes/0/color": "border-2" + }, + "texts": ["New folder"] + }, + { + "name": "Btn Upload", + "type": "INSTANCE", + "x": 219, + "y": 2, + "width": 87, + "height": 32, + "component": "Button/Outline/SM", + "componentId": "1:633", + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "cornerRadius": 24, + "layout": { + "mode": "HORIZONTAL", + "gap": 5, + "padding": [8, 12, 8, 12], + "primary": "CENTER", + "counter": "CENTER", + "sizing": ["HUG", "FIXED"] + }, + "variables": { + "cornerRadius": "radius/3xl", + "paddingRight": "spacing/3", + "paddingLeft": "spacing/3", + "strokes/0/color": "border-2" + }, + "texts": ["Upload"] + }, + { + "name": "Btn Refresh", + "type": "INSTANCE", + "x": 314, + "y": 0, + "width": 36, + "height": 36, + "component": "Button/Outline/Icon/MD", + "componentId": "1:774", + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "cornerRadius": 24, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "CENTER", + "counter": "CENTER", + "sizing": ["FIXED", "FIXED"] + }, + "variables": {"cornerRadius": "radius/3xl", "strokes/0/color": "border-2"} + } + ] + } + ] + }, + { + "id": "1:46557", + "name": "Selected file actions", + "type": "FRAME", + "x": 0, + "y": 52, + "width": 1180, + "height": 32, + "layout": { + "mode": "HORIZONTAL", + "gap": 8, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "id": "1:46639", + "name": "text", + "type": "TEXT", + "x": 0, + "y": 7, + "width": 67, + "height": 18, + "fills": [{"type": "SOLID", "color": "#F5F3F7"}], + "text": "2 selected", + "font": ["Geist", 400, 14], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + }, + { + "id": "1:46640", + "name": "Download ZIP", + "type": "FRAME", + "x": 75, + "y": 0, + "width": 100, + "height": 32, + "fills": [{"type": "SOLID", "color": "#FF4FA3"}], + "cornerRadius": 6, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [5, 12, 5, 12], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["HUG", "FIXED"] + }, + "variables": {"fills/0/color": "accent/accent"}, + "children": [ + { + "id": "1:46730", + "name": "text", + "type": "TEXT", + "x": 12, + "y": 8, + "width": 76, + "height": 16, + "fills": [{"type": "SOLID", "color": "#FFFFFF"}], + "text": "Download ZIP", + "font": ["Geist", 400, 12], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "accent/foreground"} + } + ] + }, + { + "id": "1:46641", + "name": "Create ZIP", + "type": "FRAME", + "x": 183, + "y": 0, + "width": 81, + "height": 32, + "fills": [{"type": "SOLID", "color": "#FF4FA3"}], + "cornerRadius": 6, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [5, 12, 5, 12], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["HUG", "FIXED"] + }, + "variables": {"fills/0/color": "accent/accent"}, + "children": [ + { + "id": "1:46731", + "name": "text", + "type": "TEXT", + "x": 12, + "y": 8, + "width": 57, + "height": 16, + "fills": [{"type": "SOLID", "color": "#FFFFFF"}], + "text": "Create ZIP", + "font": ["Geist", 400, 12], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "accent/foreground"} + } + ] + }, + { + "id": "1:46642", + "name": "Delete selected", + "type": "FRAME", + "x": 272, + "y": 0, + "width": 110, + "height": 32, + "fills": [{"type": "SOLID", "color": "#E0304F"}], + "cornerRadius": 6, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [5, 12, 5, 12], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["HUG", "FIXED"] + }, + "variables": {"fills/0/color": "danger/danger"}, + "children": [ + { + "id": "1:46732", + "name": "text", + "type": "TEXT", + "x": 12, + "y": 8, + "width": 86, + "height": 16, + "fills": [{"type": "SOLID", "color": "#FCFCFC"}], + "text": "Delete selected", + "font": ["Geist", 400, 12], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "danger/foreground"} + } + ] + } + ] + }, + { + "id": "1:46558", + "name": "Open files", + "type": "FRAME", + "x": 0, + "y": 96, + "width": 1180, + "height": 38, + "fills": [{"type": "SOLID", "color": "#121114"}], + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "layout": { + "mode": "HORIZONTAL", + "gap": 4, + "padding": [4, 8, 4, 8], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"fills/0/color": "background/background", "strokes/0/color": "border/border"}, + "children": [ + { + "id": "1:46643", + "name": "/eula.txt", + "type": "FRAME", + "x": 8, + "y": 4, + "width": 83, + "height": 30, + "fills": [{"type": "SOLID", "color": "#121114"}], + "layout": { + "mode": "HORIZONTAL", + "gap": 6, + "padding": [7, 9, 7, 9], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["HUG", "HUG"] + }, + "variables": {"fills/0/color": "background/background"}, + "children": [ + { + "id": "1:46733", + "name": "text", + "type": "TEXT", + "x": 9, + "y": 7, + "width": 47, + "height": 16, + "fills": [{"type": "SOLID", "color": "#F5F3F7"}], + "text": "/eula.txt", + "font": ["Geist", 400, 12], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + }, + { + "id": "1:46734", + "name": "icon", + "type": "FRAME", + "x": 62, + "y": 9, + "width": 12, + "height": 12, + "variables": {"fills/0/color": "muted"}, + "children": [ + { + "id": "1:46824", + "name": "path", + "type": "VECTOR", + "x": 3, + "y": 3, + "width": 6, + "height": 6, + "strokes": [{"type": "SOLID", "color": "#9E98A6"}], + "strokeWeight": 1 + } + ] + } + ] + }, + { + "id": "1:46644", + "name": "/server.properties", + "type": "FRAME", + "x": 95, + "y": 4, + "width": 133, + "height": 30, + "fills": [{"type": "SOLID", "color": "#232128"}], + "layout": { + "mode": "HORIZONTAL", + "gap": 6, + "padding": [7, 9, 7, 9], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["HUG", "HUG"] + }, + "variables": {"fills/0/color": "default/default"}, + "children": [ + { + "id": "1:46735", + "name": "text", + "type": "TEXT", + "x": 9, + "y": 7, + "width": 97, + "height": 16, + "fills": [{"type": "SOLID", "color": "#F5F3F7"}], + "text": "/server.properties", + "font": ["Geist", 400, 12], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + }, + { + "id": "1:46736", + "name": "icon", + "type": "FRAME", + "x": 112, + "y": 9, + "width": 12, + "height": 12, + "variables": {"fills/0/color": "muted"}, + "children": [ + { + "id": "1:46825", + "name": "path", + "type": "VECTOR", + "x": 3, + "y": 3, + "width": 6, + "height": 6, + "strokes": [{"type": "SOLID", "color": "#9E98A6"}], + "strokeWeight": 1 + } + ] + } + ] + } + ] + }, + { + "id": "1:46559", + "name": "Files Panes", + "type": "FRAME", + "x": 0, + "y": 146, + "width": 1180, + "height": 528, + "fills": [{"type": "SOLID", "color": "#1C1A20"}], + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "cornerRadius": 4, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "FIXED"] + }, + "layoutGrow": 1, + "layoutAlignSelf": "STRETCH", + "clips": true, + "variables": {"fills/0/color": "surface/surface", "strokes/0/color": "border/border"}, + "children": [ + { + "id": "1:46645", + "name": "Left Pane", + "type": "FRAME", + "x": 0, + "y": 0, + "width": 288, + "height": 528, + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "layout": { + "mode": "VERTICAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"strokes/0/color": "border/border"}, + "children": [ + { + "id": "1:46737", + "name": "Path Bar", + "type": "FRAME", + "x": 0, + "y": 0, + "width": 288, + "height": 32, + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [8, 12, 8, 12], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"strokes/0/color": "border/border"}, + "children": [ + { + "id": "1:46826", + "name": "Path", + "type": "TEXT", + "x": 12, + "y": 8, + "width": 8, + "height": 16, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "text": "/", + "font": ["JetBrains Mono", 400, 12], + "variables": {"fontFamily": "typography/font-mono", "fills/0/color": "muted"} + } + ] + }, + { + "id": "1:46738", + "name": "File List", + "type": "FRAME", + "x": 0, + "y": 32, + "width": 288, + "height": 496, + "layout": { + "mode": "VERTICAL", + "gap": 2, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "FIXED"] + }, + "layoutGrow": 1, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "id": "1:46827", + "name": "Row — libraries", + "type": "FRAME", + "x": 0, + "y": 0, + "width": 288, + "height": 26, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "SPACE_BETWEEN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "id": "1:46892", + "name": "Name", + "type": "FRAME", + "x": 0, + "y": 0, + "width": 264, + "height": 26, + "fills": [{"type": "SOLID", "color": "#1C1A20"}], + "strokes": [{"type": "SOLID", "color": "#232227"}], + "strokeWeight": 1, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [4, 12, 4, 12], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutGrow": 1, + "variables": {"fills/0/color": "surface/surface", "strokes/0/color": "separator/separator"}, + "children": [ + { + "id": "1:46957", + "name": "Left", + "type": "FRAME", + "x": 12, + "y": 4, + "width": 113, + "height": 18, + "layout": { + "mode": "HORIZONTAL", + "gap": 8, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["HUG", "HUG"] + }, + "children": [ + { + "id": "1:47019", + "name": "icon", + "type": "FRAME", + "x": 0, + "y": 2, + "width": 14, + "height": 14, + "variables": {"fills/0/color": "muted"}, + "children": [ + { + "id": "1:47146", + "name": "path", + "type": "VECTOR", + "x": 1.75, + "y": 1.75, + "width": 10.5, + "height": 10.5, + "strokes": [{"type": "SOLID", "color": "#9E98A6"}], + "strokeWeight": 1.17 + } + ] + }, + { + "id": "1:47020", + "name": "icon", + "type": "FRAME", + "x": 22, + "y": 3, + "width": 12, + "height": 12, + "variables": {"fills/0/color": "muted"}, + "children": [ + { + "id": "1:47147", + "name": "path", + "type": "VECTOR", + "x": 4.5, + "y": 3, + "width": 3, + "height": 6, + "strokes": [{"type": "SOLID", "color": "#9E98A6"}], + "strokeWeight": 1 + } + ] + }, + { + "id": "1:47021", + "name": "Icon", + "type": "FRAME", + "x": 42, + "y": 3, + "width": 12, + "height": 12, + "variables": {"fills/0/color": "muted"}, + "children": [ + { + "id": "1:47148", + "name": "path", + "type": "VECTOR", + "x": 1, + "y": 1.5, + "width": 10, + "height": 8.5, + "strokes": [{"type": "SOLID", "color": "#9E98A6"}], + "strokeWeight": 1 + } + ] + }, + { + "id": "1:47022", + "name": "Name", + "type": "TEXT", + "x": 62, + "y": 0, + "width": 51, + "height": 18, + "fills": [{"type": "SOLID", "color": "#F5F3F7"}], + "text": "libraries", + "font": ["Geist", 400, 14], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + } + ] + } + ] + }, + { + "name": "Size", + "type": "INSTANCE", + "x": 264, + "y": 1, + "width": 24, + "height": 24, + "component": "Table Cell", + "componentId": "1:824", + "fills": [{"type": "SOLID", "color": "#1C1A20"}], + "strokes": [{"type": "SOLID", "color": "#232227"}], + "strokeWeight": 1, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [4, 12, 4, 12], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["HUG", "HUG"] + }, + "variables": {"fills/0/color": "surface/surface", "strokes/0/color": "separator/separator"} + } + ] + }, + { + "id": "1:46828", + "name": "Row — logs", + "type": "FRAME", + "x": 0, + "y": 28, + "width": 288, + "height": 26, + "fills": [{"type": "SOLID", "color": "#232128"}], + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "SPACE_BETWEEN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"fills/0/color": "default/default"}, + "children": [ + { + "id": "1:46893", + "name": "Name", + "type": "FRAME", + "x": 0, + "y": 0, + "width": 248, + "height": 26, + "fills": [{"type": "SOLID", "color": "#1C1A20"}], + "strokes": [{"type": "SOLID", "color": "#232227"}], + "strokeWeight": 1, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [4, 12, 4, 12], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutGrow": 1, + "variables": {"fills/0/color": "surface/surface", "strokes/0/color": "separator/separator"}, + "children": [ + { + "id": "1:46958", + "name": "Left", + "type": "FRAME", + "x": 12, + "y": 4, + "width": 89, + "height": 18, + "layout": { + "mode": "HORIZONTAL", + "gap": 8, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["HUG", "HUG"] + }, + "children": [ + { + "id": "1:47023", + "name": "icon", + "type": "FRAME", + "x": 0, + "y": 2, + "width": 14, + "height": 14, + "variables": {"fills/0/color": "muted"}, + "children": [ + { + "id": "1:47149", + "name": "path", + "type": "VECTOR", + "x": 1.75, + "y": 1.75, + "width": 10.5, + "height": 10.5, + "strokes": [{"type": "SOLID", "color": "#9E98A6"}], + "strokeWeight": 1.17 + } + ] + }, + { + "id": "1:47024", + "name": "icon", + "type": "FRAME", + "x": 22, + "y": 3, + "width": 12, + "height": 12, + "variables": {"fills/0/color": "muted"}, + "children": [ + { + "id": "1:47150", + "name": "path", + "type": "VECTOR", + "x": 3, + "y": 4.5, + "width": 6, + "height": 3, + "strokes": [{"type": "SOLID", "color": "#9E98A6"}], + "strokeWeight": 1 + } + ] + }, + { + "id": "1:47025", + "name": "Icon", + "type": "FRAME", + "x": 42, + "y": 3, + "width": 12, + "height": 12, + "variables": {"fills/0/color": "muted"}, + "children": [ + { + "id": "1:47151", + "name": "path", + "type": "VECTOR", + "x": 1, + "y": 1.5, + "width": 10, + "height": 8.5, + "strokes": [{"type": "SOLID", "color": "#9E98A6"}], + "strokeWeight": 1 + } + ] + }, + { + "id": "1:47026", + "name": "Name", + "type": "TEXT", + "x": 62, + "y": 0, + "width": 27, + "height": 18, + "fills": [{"type": "SOLID", "color": "#F5F3F7"}], + "text": "logs", + "font": ["Geist", 400, 14], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + } + ] + } + ] + }, + { + "id": "1:46894", + "name": "Folder Actions", + "type": "FRAME", + "x": 248, + "y": 1, + "width": 40, + "height": 24, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 8, 0, 8], + "primary": "MAX", + "counter": "CENTER", + "sizing": ["HUG", "HUG"] + }, + "children": [ + { + "name": "Btn Delete Folder", + "type": "INSTANCE", + "x": 8, + "y": 0, + "width": 24, + "height": 24, + "component": "Button/Ghost/Icon/SM", + "componentId": "1:835", + "cornerRadius": 6, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "CENTER", + "counter": "CENTER", + "sizing": ["FIXED", "FIXED"] + } + } + ] + } + ] + }, + { + "id": "1:46829", + "name": "Latest log in expanded logs folder", + "type": "FRAME", + "x": 0, + "y": 56, + "width": 157, + "height": 26, + "layout": { + "mode": "HORIZONTAL", + "gap": 8, + "padding": [4, 28, 4, 28], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["HUG", "HUG"] + }, + "children": [ + { + "id": "1:46895", + "name": "icon", + "type": "FRAME", + "x": 28, + "y": 6, + "width": 14, + "height": 14, + "variables": {"fills/0/color": "muted"}, + "children": [ + { + "id": "1:46959", + "name": "path", + "type": "VECTOR", + "x": 1.75, + "y": 1.75, + "width": 10.5, + "height": 10.5, + "strokes": [{"type": "SOLID", "color": "#9E98A6"}], + "strokeWeight": 1.17 + } + ] + }, + { + "id": "1:46896", + "name": "icon", + "type": "FRAME", + "x": 50, + "y": 7, + "width": 12, + "height": 12, + "variables": {"fills/0/color": "muted"}, + "children": [ + { + "id": "1:46960", + "name": "path", + "type": "VECTOR", + "x": 2, + "y": 1, + "width": 8, + "height": 10, + "strokes": [{"type": "SOLID", "color": "#9E98A6"}], + "strokeWeight": 1 + }, + { + "id": "1:46961", + "name": "path", + "type": "VECTOR", + "x": 7, + "y": 1, + "width": 3, + "height": 3, + "strokes": [{"type": "SOLID", "color": "#9E98A6"}], + "strokeWeight": 1 + } + ] + }, + { + "id": "1:46897", + "name": "text", + "type": "TEXT", + "x": 70, + "y": 4, + "width": 59, + "height": 18, + "fills": [{"type": "SOLID", "color": "#F5F3F7"}], + "text": "latest.log", + "font": ["Geist", 400, 14], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + } + ] + }, + { + "id": "1:46830", + "name": "Row — mods", + "type": "FRAME", + "x": 0, + "y": 84, + "width": 288, + "height": 26, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "SPACE_BETWEEN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "id": "1:46898", + "name": "Name", + "type": "FRAME", + "x": 0, + "y": 0, + "width": 264, + "height": 26, + "fills": [{"type": "SOLID", "color": "#1C1A20"}], + "strokes": [{"type": "SOLID", "color": "#232227"}], + "strokeWeight": 1, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [4, 12, 4, 12], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutGrow": 1, + "variables": {"fills/0/color": "surface/surface", "strokes/0/color": "separator/separator"}, + "children": [ + { + "id": "1:46962", + "name": "Left", + "type": "FRAME", + "x": 12, + "y": 4, + "width": 98, + "height": 18, + "layout": { + "mode": "HORIZONTAL", + "gap": 8, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["HUG", "HUG"] + }, + "children": [ + { + "id": "1:47027", + "name": "icon", + "type": "FRAME", + "x": 0, + "y": 2, + "width": 14, + "height": 14, + "variables": {"fills/0/color": "muted"}, + "children": [ + { + "id": "1:47152", + "name": "path", + "type": "VECTOR", + "x": 1.75, + "y": 1.75, + "width": 10.5, + "height": 10.5, + "strokes": [{"type": "SOLID", "color": "#9E98A6"}], + "strokeWeight": 1.17 + } + ] + }, + { + "id": "1:47028", + "name": "icon", + "type": "FRAME", + "x": 22, + "y": 3, + "width": 12, + "height": 12, + "variables": {"fills/0/color": "muted"}, + "children": [ + { + "id": "1:47153", + "name": "path", + "type": "VECTOR", + "x": 4.5, + "y": 3, + "width": 3, + "height": 6, + "strokes": [{"type": "SOLID", "color": "#9E98A6"}], + "strokeWeight": 1 + } + ] + }, + { + "id": "1:47029", + "name": "Icon", + "type": "FRAME", + "x": 42, + "y": 3, + "width": 12, + "height": 12, + "variables": {"fills/0/color": "muted"}, + "children": [ + { + "id": "1:47154", + "name": "path", + "type": "VECTOR", + "x": 1, + "y": 1.5, + "width": 10, + "height": 8.5, + "strokes": [{"type": "SOLID", "color": "#9E98A6"}], + "strokeWeight": 1 + } + ] + }, + { + "id": "1:47030", + "name": "Name", + "type": "TEXT", + "x": 62, + "y": 0, + "width": 36, + "height": 18, + "fills": [{"type": "SOLID", "color": "#F5F3F7"}], + "text": "mods", + "font": ["Geist", 400, 14], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + } + ] + } + ] + }, + { + "name": "Size", + "type": "INSTANCE", + "x": 264, + "y": 1, + "width": 24, + "height": 24, + "component": "Table Cell", + "componentId": "1:824", + "fills": [{"type": "SOLID", "color": "#1C1A20"}], + "strokes": [{"type": "SOLID", "color": "#232227"}], + "strokeWeight": 1, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [4, 12, 4, 12], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["HUG", "HUG"] + }, + "variables": {"fills/0/color": "surface/surface", "strokes/0/color": "separator/separator"} + } + ] + }, + { + "id": "1:46831", + "name": "Row — versions", + "type": "FRAME", + "x": 0, + "y": 112, + "width": 288, + "height": 26, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "SPACE_BETWEEN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "id": "1:46899", + "name": "Name", + "type": "FRAME", + "x": 0, + "y": 0, + "width": 264, + "height": 26, + "fills": [{"type": "SOLID", "color": "#1C1A20"}], + "strokes": [{"type": "SOLID", "color": "#232227"}], + "strokeWeight": 1, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [4, 12, 4, 12], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutGrow": 1, + "variables": {"fills/0/color": "surface/surface", "strokes/0/color": "separator/separator"}, + "children": [ + { + "id": "1:46963", + "name": "Left", + "type": "FRAME", + "x": 12, + "y": 4, + "width": 116, + "height": 18, + "layout": { + "mode": "HORIZONTAL", + "gap": 8, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["HUG", "HUG"] + }, + "children": [ + { + "id": "1:47031", + "name": "icon", + "type": "FRAME", + "x": 0, + "y": 2, + "width": 14, + "height": 14, + "variables": {"fills/0/color": "muted"}, + "children": [ + { + "id": "1:47155", + "name": "path", + "type": "VECTOR", + "x": 1.75, + "y": 1.75, + "width": 10.5, + "height": 10.5, + "strokes": [{"type": "SOLID", "color": "#9E98A6"}], + "strokeWeight": 1.17 + } + ] + }, + { + "id": "1:47032", + "name": "icon", + "type": "FRAME", + "x": 22, + "y": 3, + "width": 12, + "height": 12, + "variables": {"fills/0/color": "muted"}, + "children": [ + { + "id": "1:47156", + "name": "path", + "type": "VECTOR", + "x": 4.5, + "y": 3, + "width": 3, + "height": 6, + "strokes": [{"type": "SOLID", "color": "#9E98A6"}], + "strokeWeight": 1 + } + ] + }, + { + "id": "1:47033", + "name": "Icon", + "type": "FRAME", + "x": 42, + "y": 3, + "width": 12, + "height": 12, + "variables": {"fills/0/color": "muted"}, + "children": [ + { + "id": "1:47157", + "name": "path", + "type": "VECTOR", + "x": 1, + "y": 1.5, + "width": 10, + "height": 8.5, + "strokes": [{"type": "SOLID", "color": "#9E98A6"}], + "strokeWeight": 1 + } + ] + }, + { + "id": "1:47034", + "name": "Name", + "type": "TEXT", + "x": 62, + "y": 0, + "width": 54, + "height": 18, + "fills": [{"type": "SOLID", "color": "#F5F3F7"}], + "text": "versions", + "font": ["Geist", 400, 14], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + } + ] + } + ] + }, + { + "name": "Size", + "type": "INSTANCE", + "x": 264, + "y": 1, + "width": 24, + "height": 24, + "component": "Table Cell", + "componentId": "1:824", + "fills": [{"type": "SOLID", "color": "#1C1A20"}], + "strokes": [{"type": "SOLID", "color": "#232227"}], + "strokeWeight": 1, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [4, 12, 4, 12], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["HUG", "HUG"] + }, + "variables": {"fills/0/color": "surface/surface", "strokes/0/color": "separator/separator"} + } + ] + }, + { + "id": "1:46832", + "name": "Row — world", + "type": "FRAME", + "x": 0, + "y": 140, + "width": 288, + "height": 26, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "SPACE_BETWEEN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "id": "1:46900", + "name": "Name", + "type": "FRAME", + "x": 0, + "y": 0, + "width": 264, + "height": 26, + "fills": [{"type": "SOLID", "color": "#1C1A20"}], + "strokes": [{"type": "SOLID", "color": "#232227"}], + "strokeWeight": 1, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [4, 12, 4, 12], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutGrow": 1, + "variables": {"fills/0/color": "surface/surface", "strokes/0/color": "separator/separator"}, + "children": [ + { + "id": "1:46964", + "name": "Left", + "type": "FRAME", + "x": 12, + "y": 4, + "width": 98, + "height": 18, + "layout": { + "mode": "HORIZONTAL", + "gap": 8, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["HUG", "HUG"] + }, + "children": [ + { + "id": "1:47035", + "name": "icon", + "type": "FRAME", + "x": 0, + "y": 2, + "width": 14, + "height": 14, + "variables": {"fills/0/color": "muted"}, + "children": [ + { + "id": "1:47158", + "name": "path", + "type": "VECTOR", + "x": 1.75, + "y": 1.75, + "width": 10.5, + "height": 10.5, + "strokes": [{"type": "SOLID", "color": "#9E98A6"}], + "strokeWeight": 1.17 + } + ] + }, + { + "id": "1:47036", + "name": "icon", + "type": "FRAME", + "x": 22, + "y": 3, + "width": 12, + "height": 12, + "variables": {"fills/0/color": "muted"}, + "children": [ + { + "id": "1:47159", + "name": "path", + "type": "VECTOR", + "x": 4.5, + "y": 3, + "width": 3, + "height": 6, + "strokes": [{"type": "SOLID", "color": "#9E98A6"}], + "strokeWeight": 1 + } + ] + }, + { + "id": "1:47037", + "name": "Icon", + "type": "FRAME", + "x": 42, + "y": 3, + "width": 12, + "height": 12, + "variables": {"fills/0/color": "muted"}, + "children": [ + { + "id": "1:47160", + "name": "path", + "type": "VECTOR", + "x": 1, + "y": 1.5, + "width": 10, + "height": 8.5, + "strokes": [{"type": "SOLID", "color": "#9E98A6"}], + "strokeWeight": 1 + } + ] + }, + { + "id": "1:47038", + "name": "Name", + "type": "TEXT", + "x": 62, + "y": 0, + "width": 36, + "height": 18, + "fills": [{"type": "SOLID", "color": "#F5F3F7"}], + "text": "world", + "font": ["Geist", 400, 14], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + } + ] + } + ] + }, + { + "name": "Size", + "type": "INSTANCE", + "x": 264, + "y": 1, + "width": 24, + "height": 24, + "component": "Table Cell", + "componentId": "1:824", + "fills": [{"type": "SOLID", "color": "#1C1A20"}], + "strokes": [{"type": "SOLID", "color": "#232227"}], + "strokeWeight": 1, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [4, 12, 4, 12], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["HUG", "HUG"] + }, + "variables": {"fills/0/color": "surface/surface", "strokes/0/color": "separator/separator"} + } + ] + }, + { + "id": "1:46833", + "name": "Row — banned-ips.json", + "type": "FRAME", + "x": 0, + "y": 168, + "width": 288, + "height": 26, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "SPACE_BETWEEN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "id": "1:46901", + "name": "Name", + "type": "FRAME", + "x": 0, + "y": 0, + "width": 245, + "height": 26, + "fills": [{"type": "SOLID", "color": "#1C1A20"}], + "strokes": [{"type": "SOLID", "color": "#232227"}], + "strokeWeight": 1, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [4, 12, 4, 12], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutGrow": 1, + "variables": {"fills/0/color": "surface/surface", "strokes/0/color": "separator/separator"}, + "children": [ + { + "id": "1:46965", + "name": "Left", + "type": "FRAME", + "x": 12, + "y": 4, + "width": 145, + "height": 18, + "layout": { + "mode": "HORIZONTAL", + "gap": 8, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["HUG", "HUG"] + }, + "children": [ + { + "id": "1:47039", + "name": "icon", + "type": "FRAME", + "x": 0, + "y": 2, + "width": 14, + "height": 14, + "variables": {"fills/0/color": "muted"}, + "children": [ + { + "id": "1:47161", + "name": "path", + "type": "VECTOR", + "x": 1.75, + "y": 1.75, + "width": 10.5, + "height": 10.5, + "strokes": [{"type": "SOLID", "color": "#9E98A6"}], + "strokeWeight": 1.17 + } + ] + }, + { + "id": "1:47040", + "name": "Icon", + "type": "FRAME", + "x": 22, + "y": 3, + "width": 12, + "height": 12, + "variables": {"fills/0/color": "muted"}, + "children": [ + { + "id": "1:47162", + "name": "path", + "type": "VECTOR", + "x": 2, + "y": 1, + "width": 8, + "height": 10, + "strokes": [{"type": "SOLID", "color": "#9E98A6"}], + "strokeWeight": 1 + }, + { + "id": "1:47163", + "name": "path", + "type": "VECTOR", + "x": 7, + "y": 1, + "width": 3, + "height": 3, + "strokes": [{"type": "SOLID", "color": "#9E98A6"}], + "strokeWeight": 1 + } + ] + }, + { + "id": "1:47041", + "name": "Name", + "type": "TEXT", + "x": 42, + "y": 0, + "width": 103, + "height": 18, + "fills": [{"type": "SOLID", "color": "#F5F3F7"}], + "text": "banned-ips.json", + "font": ["Geist", 400, 14], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + } + ] + } + ] + }, + { + "name": "Size", + "type": "INSTANCE", + "x": 245, + "y": 1, + "width": 43, + "height": 24, + "component": "Table Cell", + "componentId": "1:824", + "fills": [{"type": "SOLID", "color": "#1C1A20"}], + "strokes": [{"type": "SOLID", "color": "#232227"}], + "strokeWeight": 1, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [4, 12, 4, 12], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["HUG", "HUG"] + }, + "variables": {"fills/0/color": "surface/surface", "strokes/0/color": "separator/separator"}, + "texts": ["2 B"] + } + ] + }, + { + "id": "1:46834", + "name": "Row — eula.txt", + "type": "FRAME", + "x": 0, + "y": 196, + "width": 288, + "height": 26, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "SPACE_BETWEEN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "id": "1:46902", + "name": "Name", + "type": "FRAME", + "x": 0, + "y": 0, + "width": 238, + "height": 26, + "fills": [{"type": "SOLID", "color": "#1C1A20"}], + "strokes": [{"type": "SOLID", "color": "#232227"}], + "strokeWeight": 1, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [4, 12, 4, 12], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutGrow": 1, + "variables": {"fills/0/color": "surface/surface", "strokes/0/color": "separator/separator"}, + "children": [ + { + "id": "1:46966", + "name": "Left", + "type": "FRAME", + "x": 12, + "y": 4, + "width": 91, + "height": 18, + "layout": { + "mode": "HORIZONTAL", + "gap": 8, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["HUG", "HUG"] + }, + "children": [ + { + "id": "1:47042", + "name": "icon", + "type": "FRAME", + "x": 0, + "y": 2, + "width": 14, + "height": 14, + "variables": {"fills/0/color": "muted"}, + "children": [ + { + "id": "1:47164", + "name": "path", + "type": "VECTOR", + "x": 1.75, + "y": 1.75, + "width": 10.5, + "height": 10.5, + "strokes": [{"type": "SOLID", "color": "#9E98A6"}], + "strokeWeight": 1.17 + }, + { + "id": "1:47165", + "name": "path", + "type": "VECTOR", + "x": 4.67, + "y": 5.25, + "width": 4.67, + "height": 3.21, + "strokes": [{"type": "SOLID", "color": "#9E98A6"}], + "strokeWeight": 1.17 + } + ] + }, + { + "id": "1:47043", + "name": "Icon", + "type": "FRAME", + "x": 22, + "y": 3, + "width": 12, + "height": 12, + "variables": {"fills/0/color": "muted"}, + "children": [ + { + "id": "1:47166", + "name": "path", + "type": "VECTOR", + "x": 2, + "y": 1, + "width": 8, + "height": 10, + "strokes": [{"type": "SOLID", "color": "#9E98A6"}], + "strokeWeight": 1 + }, + { + "id": "1:47167", + "name": "path", + "type": "VECTOR", + "x": 7, + "y": 1, + "width": 3, + "height": 3, + "strokes": [{"type": "SOLID", "color": "#9E98A6"}], + "strokeWeight": 1 + } + ] + }, + { + "id": "1:47044", + "name": "Name", + "type": "TEXT", + "x": 42, + "y": 0, + "width": 49, + "height": 18, + "fills": [{"type": "SOLID", "color": "#F5F3F7"}], + "text": "eula.txt", + "font": ["Geist", 400, 14], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + } + ] + } + ] + }, + { + "name": "Size", + "type": "INSTANCE", + "x": 238, + "y": 1, + "width": 50, + "height": 24, + "component": "Table Cell", + "componentId": "1:824", + "fills": [{"type": "SOLID", "color": "#1C1A20"}], + "strokes": [{"type": "SOLID", "color": "#232227"}], + "strokeWeight": 1, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [4, 12, 4, 12], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["HUG", "HUG"] + }, + "variables": {"fills/0/color": "surface/surface", "strokes/0/color": "separator/separator"}, + "texts": ["68 B"] + } + ] + }, + { + "id": "1:46835", + "name": "Row — fabric-server-mc.1.21.4-loader…jar", + "type": "FRAME", + "x": 0, + "y": 224, + "width": 288, + "height": 26, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "SPACE_BETWEEN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "id": "1:46903", + "name": "Name", + "type": "FRAME", + "x": 0, + "y": 0, + "width": 227, + "height": 26, + "fills": [{"type": "SOLID", "color": "#1C1A20"}], + "strokes": [{"type": "SOLID", "color": "#232227"}], + "strokeWeight": 1, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [4, 12, 4, 12], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutGrow": 1, + "variables": {"fills/0/color": "surface/surface", "strokes/0/color": "separator/separator"}, + "children": [ + { + "id": "1:46967", + "name": "Left", + "type": "FRAME", + "x": 12, + "y": 4, + "width": 255, + "height": 18, + "layout": { + "mode": "HORIZONTAL", + "gap": 8, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["HUG", "HUG"] + }, + "children": [ + { + "id": "1:47045", + "name": "icon", + "type": "FRAME", + "x": 0, + "y": 2, + "width": 14, + "height": 14, + "variables": {"fills/0/color": "muted"}, + "children": [ + { + "id": "1:47168", + "name": "path", + "type": "VECTOR", + "x": 1.75, + "y": 1.75, + "width": 10.5, + "height": 10.5, + "strokes": [{"type": "SOLID", "color": "#9E98A6"}], + "strokeWeight": 1.17 + } + ] + }, + { + "id": "1:47046", + "name": "Icon", + "type": "FRAME", + "x": 22, + "y": 3, + "width": 12, + "height": 12, + "variables": {"fills/0/color": "muted"}, + "children": [ + { + "id": "1:47169", + "name": "path", + "type": "VECTOR", + "x": 2, + "y": 1, + "width": 8, + "height": 10, + "strokes": [{"type": "SOLID", "color": "#9E98A6"}], + "strokeWeight": 1 + }, + { + "id": "1:47170", + "name": "path", + "type": "VECTOR", + "x": 7, + "y": 1, + "width": 3, + "height": 3, + "strokes": [{"type": "SOLID", "color": "#9E98A6"}], + "strokeWeight": 1 + } + ] + }, + { + "id": "1:47047", + "name": "Name", + "type": "TEXT", + "x": 42, + "y": 0, + "width": 213, + "height": 18, + "fills": [{"type": "SOLID", "color": "#F5F3F7"}], + "text": "fabric-server-mc.1.21.4-loader…jar", + "font": ["Geist", 400, 14], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + } + ] + } + ] + }, + { + "name": "Size", + "type": "INSTANCE", + "x": 227, + "y": 1, + "width": 61, + "height": 24, + "component": "Table Cell", + "componentId": "1:824", + "fills": [{"type": "SOLID", "color": "#1C1A20"}], + "strokes": [{"type": "SOLID", "color": "#232227"}], + "strokeWeight": 1, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [4, 12, 4, 12], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["HUG", "HUG"] + }, + "variables": {"fills/0/color": "surface/surface", "strokes/0/color": "separator/separator"}, + "texts": ["175 KB"] + } + ] + }, + { + "id": "1:46836", + "name": "Row — ops.json", + "type": "FRAME", + "x": 0, + "y": 252, + "width": 288, + "height": 26, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "SPACE_BETWEEN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "id": "1:46904", + "name": "Name", + "type": "FRAME", + "x": 0, + "y": 0, + "width": 245, + "height": 26, + "fills": [{"type": "SOLID", "color": "#1C1A20"}], + "strokes": [{"type": "SOLID", "color": "#232227"}], + "strokeWeight": 1, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [4, 12, 4, 12], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutGrow": 1, + "variables": {"fills/0/color": "surface/surface", "strokes/0/color": "separator/separator"}, + "children": [ + { + "id": "1:46968", + "name": "Left", + "type": "FRAME", + "x": 12, + "y": 4, + "width": 95, + "height": 18, + "layout": { + "mode": "HORIZONTAL", + "gap": 8, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["HUG", "HUG"] + }, + "children": [ + { + "id": "1:47048", + "name": "icon", + "type": "FRAME", + "x": 0, + "y": 2, + "width": 14, + "height": 14, + "variables": {"fills/0/color": "muted"}, + "children": [ + { + "id": "1:47171", + "name": "path", + "type": "VECTOR", + "x": 1.75, + "y": 1.75, + "width": 10.5, + "height": 10.5, + "strokes": [{"type": "SOLID", "color": "#9E98A6"}], + "strokeWeight": 1.17 + } + ] + }, + { + "id": "1:47049", + "name": "Icon", + "type": "FRAME", + "x": 22, + "y": 3, + "width": 12, + "height": 12, + "variables": {"fills/0/color": "muted"}, + "children": [ + { + "id": "1:47172", + "name": "path", + "type": "VECTOR", + "x": 2, + "y": 1, + "width": 8, + "height": 10, + "strokes": [{"type": "SOLID", "color": "#9E98A6"}], + "strokeWeight": 1 + }, + { + "id": "1:47173", + "name": "path", + "type": "VECTOR", + "x": 7, + "y": 1, + "width": 3, + "height": 3, + "strokes": [{"type": "SOLID", "color": "#9E98A6"}], + "strokeWeight": 1 + } + ] + }, + { + "id": "1:47050", + "name": "Name", + "type": "TEXT", + "x": 42, + "y": 0, + "width": 53, + "height": 18, + "fills": [{"type": "SOLID", "color": "#F5F3F7"}], + "text": "ops.json", + "font": ["Geist", 400, 14], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + } + ] + } + ] + }, + { + "name": "Size", + "type": "INSTANCE", + "x": 245, + "y": 1, + "width": 43, + "height": 24, + "component": "Table Cell", + "componentId": "1:824", + "fills": [{"type": "SOLID", "color": "#1C1A20"}], + "strokes": [{"type": "SOLID", "color": "#232227"}], + "strokeWeight": 1, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [4, 12, 4, 12], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["HUG", "HUG"] + }, + "variables": {"fills/0/color": "surface/surface", "strokes/0/color": "separator/separator"}, + "texts": ["2 B"] + } + ] + }, + { + "id": "1:46837", + "name": "Row — server.properties", + "type": "FRAME", + "x": 0, + "y": 280, + "width": 288, + "height": 26, + "fills": [{"type": "SOLID", "color": "#2C1926"}], + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "SPACE_BETWEEN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"fills/0/color": "accent/soft"}, + "children": [ + { + "id": "1:46905", + "name": "Name", + "type": "FRAME", + "x": 0, + "y": 0, + "width": 230, + "height": 26, + "fills": [{"type": "SOLID", "color": "#1C1A20"}], + "strokes": [{"type": "SOLID", "color": "#232227"}], + "strokeWeight": 1, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [4, 12, 4, 12], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutGrow": 1, + "variables": {"fills/0/color": "surface/surface", "strokes/0/color": "separator/separator"}, + "children": [ + { + "id": "1:46969", + "name": "Left", + "type": "FRAME", + "x": 12, + "y": 4, + "width": 149, + "height": 18, + "layout": { + "mode": "HORIZONTAL", + "gap": 8, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["HUG", "HUG"] + }, + "children": [ + { + "id": "1:47051", + "name": "icon", + "type": "FRAME", + "x": 0, + "y": 2, + "width": 14, + "height": 14, + "variables": {"fills/0/color": "muted"}, + "children": [ + { + "id": "1:47174", + "name": "path", + "type": "VECTOR", + "x": 1.75, + "y": 1.75, + "width": 10.5, + "height": 10.5, + "strokes": [{"type": "SOLID", "color": "#9E98A6"}], + "strokeWeight": 1.17 + }, + { + "id": "1:47175", + "name": "path", + "type": "VECTOR", + "x": 4.67, + "y": 5.25, + "width": 4.67, + "height": 3.21, + "strokes": [{"type": "SOLID", "color": "#9E98A6"}], + "strokeWeight": 1.17 + } + ] + }, + { + "id": "1:47052", + "name": "Icon", + "type": "FRAME", + "x": 22, + "y": 3, + "width": 12, + "height": 12, + "variables": {"fills/0/color": "muted"}, + "children": [ + { + "id": "1:47176", + "name": "path", + "type": "VECTOR", + "x": 2, + "y": 1, + "width": 8, + "height": 10, + "strokes": [{"type": "SOLID", "color": "#9E98A6"}], + "strokeWeight": 1 + }, + { + "id": "1:47177", + "name": "path", + "type": "VECTOR", + "x": 7, + "y": 1, + "width": 3, + "height": 3, + "strokes": [{"type": "SOLID", "color": "#9E98A6"}], + "strokeWeight": 1 + } + ] + }, + { + "id": "1:47053", + "name": "Name", + "type": "TEXT", + "x": 42, + "y": 0, + "width": 107, + "height": 18, + "fills": [{"type": "SOLID", "color": "#F5F3F7"}], + "text": "server.properties", + "font": ["Geist", 400, 14], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + } + ] + } + ] + }, + { + "name": "Size", + "type": "INSTANCE", + "x": 230, + "y": 1, + "width": 58, + "height": 24, + "component": "Table Cell", + "componentId": "1:824", + "fills": [{"type": "SOLID", "color": "#1C1A20"}], + "strokes": [{"type": "SOLID", "color": "#232227"}], + "strokeWeight": 1, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [4, 12, 4, 12], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["HUG", "HUG"] + }, + "variables": {"fills/0/color": "surface/surface", "strokes/0/color": "separator/separator"}, + "texts": ["1.4 KB"] + } + ] + }, + { + "id": "1:46838", + "name": "Row — usercache.json", + "type": "FRAME", + "x": 0, + "y": 308, + "width": 288, + "height": 26, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "SPACE_BETWEEN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "id": "1:46906", + "name": "Name", + "type": "FRAME", + "x": 0, + "y": 0, + "width": 245, + "height": 26, + "fills": [{"type": "SOLID", "color": "#1C1A20"}], + "strokes": [{"type": "SOLID", "color": "#232227"}], + "strokeWeight": 1, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [4, 12, 4, 12], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutGrow": 1, + "variables": {"fills/0/color": "surface/surface", "strokes/0/color": "separator/separator"}, + "children": [ + { + "id": "1:46970", + "name": "Left", + "type": "FRAME", + "x": 12, + "y": 4, + "width": 138, + "height": 18, + "layout": { + "mode": "HORIZONTAL", + "gap": 8, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["HUG", "HUG"] + }, + "children": [ + { + "id": "1:47054", + "name": "icon", + "type": "FRAME", + "x": 0, + "y": 2, + "width": 14, + "height": 14, + "variables": {"fills/0/color": "muted"}, + "children": [ + { + "id": "1:47178", + "name": "path", + "type": "VECTOR", + "x": 1.75, + "y": 1.75, + "width": 10.5, + "height": 10.5, + "strokes": [{"type": "SOLID", "color": "#9E98A6"}], + "strokeWeight": 1.17 + } + ] + }, + { + "id": "1:47055", + "name": "Icon", + "type": "FRAME", + "x": 22, + "y": 3, + "width": 12, + "height": 12, + "variables": {"fills/0/color": "muted"}, + "children": [ + { + "id": "1:47179", + "name": "path", + "type": "VECTOR", + "x": 2, + "y": 1, + "width": 8, + "height": 10, + "strokes": [{"type": "SOLID", "color": "#9E98A6"}], + "strokeWeight": 1 + }, + { + "id": "1:47180", + "name": "path", + "type": "VECTOR", + "x": 7, + "y": 1, + "width": 3, + "height": 3, + "strokes": [{"type": "SOLID", "color": "#9E98A6"}], + "strokeWeight": 1 + } + ] + }, + { + "id": "1:47056", + "name": "Name", + "type": "TEXT", + "x": 42, + "y": 0, + "width": 96, + "height": 18, + "fills": [{"type": "SOLID", "color": "#F5F3F7"}], + "text": "usercache.json", + "font": ["Geist", 400, 14], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + } + ] + } + ] + }, + { + "name": "Size", + "type": "INSTANCE", + "x": 245, + "y": 1, + "width": 43, + "height": 24, + "component": "Table Cell", + "componentId": "1:824", + "fills": [{"type": "SOLID", "color": "#1C1A20"}], + "strokes": [{"type": "SOLID", "color": "#232227"}], + "strokeWeight": 1, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [4, 12, 4, 12], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["HUG", "HUG"] + }, + "variables": {"fills/0/color": "surface/surface", "strokes/0/color": "separator/separator"}, + "texts": ["2 B"] + } + ] + }, + { + "id": "1:46839", + "name": "Row — whitelist.json", + "type": "FRAME", + "x": 0, + "y": 336, + "width": 288, + "height": 26, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "SPACE_BETWEEN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "id": "1:46907", + "name": "Name", + "type": "FRAME", + "x": 0, + "y": 0, + "width": 245, + "height": 26, + "fills": [{"type": "SOLID", "color": "#1C1A20"}], + "strokes": [{"type": "SOLID", "color": "#232227"}], + "strokeWeight": 1, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [4, 12, 4, 12], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutGrow": 1, + "variables": {"fills/0/color": "surface/surface", "strokes/0/color": "separator/separator"}, + "children": [ + { + "id": "1:46971", + "name": "Left", + "type": "FRAME", + "x": 12, + "y": 4, + "width": 127, + "height": 18, + "layout": { + "mode": "HORIZONTAL", + "gap": 8, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["HUG", "HUG"] + }, + "children": [ + { + "id": "1:47057", + "name": "icon", + "type": "FRAME", + "x": 0, + "y": 2, + "width": 14, + "height": 14, + "variables": {"fills/0/color": "muted"}, + "children": [ + { + "id": "1:47181", + "name": "path", + "type": "VECTOR", + "x": 1.75, + "y": 1.75, + "width": 10.5, + "height": 10.5, + "strokes": [{"type": "SOLID", "color": "#9E98A6"}], + "strokeWeight": 1.17 + } + ] + }, + { + "id": "1:47058", + "name": "Icon", + "type": "FRAME", + "x": 22, + "y": 3, + "width": 12, + "height": 12, + "variables": {"fills/0/color": "muted"}, + "children": [ + { + "id": "1:47182", + "name": "path", + "type": "VECTOR", + "x": 2, + "y": 1, + "width": 8, + "height": 10, + "strokes": [{"type": "SOLID", "color": "#9E98A6"}], + "strokeWeight": 1 + }, + { + "id": "1:47183", + "name": "path", + "type": "VECTOR", + "x": 7, + "y": 1, + "width": 3, + "height": 3, + "strokes": [{"type": "SOLID", "color": "#9E98A6"}], + "strokeWeight": 1 + } + ] + }, + { + "id": "1:47059", + "name": "Name", + "type": "TEXT", + "x": 42, + "y": 0, + "width": 85, + "height": 18, + "fills": [{"type": "SOLID", "color": "#F5F3F7"}], + "text": "whitelist.json", + "font": ["Geist", 400, 14], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + } + ] + } + ] + }, + { + "name": "Size", + "type": "INSTANCE", + "x": 245, + "y": 1, + "width": 43, + "height": 24, + "component": "Table Cell", + "componentId": "1:824", + "fills": [{"type": "SOLID", "color": "#1C1A20"}], + "strokes": [{"type": "SOLID", "color": "#232227"}], + "strokeWeight": 1, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [4, 12, 4, 12], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["HUG", "HUG"] + }, + "variables": {"fills/0/color": "surface/surface", "strokes/0/color": "separator/separator"}, + "texts": ["2 B"] + } + ] + } + ] + } + ] + }, + { + "id": "1:46646", + "name": "Right Pane", + "type": "FRAME", + "x": 288, + "y": 0, + "width": 892, + "height": 528, + "layout": { + "mode": "VERTICAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "FIXED"] + }, + "layoutGrow": 1, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "id": "1:46739", + "name": "Editor actions", + "type": "FRAME", + "x": 0, + "y": 0, + "width": 892, + "height": 42, + "layout": { + "mode": "HORIZONTAL", + "gap": 8, + "padding": [8, 12, 8, 12], + "primary": "SPACE_BETWEEN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "id": "1:46840", + "name": "frame", + "type": "FRAME", + "x": 12, + "y": 12, + "width": 129, + "height": 18, + "layout": { + "mode": "HORIZONTAL", + "gap": 8, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["HUG", "HUG"] + }, + "children": [ + { + "id": "1:46908", + "name": "icon", + "type": "FRAME", + "x": 0, + "y": 2, + "width": 14, + "height": 14, + "variables": {"fills/0/color": "muted"}, + "children": [ + { + "id": "1:46972", + "name": "path", + "type": "VECTOR", + "x": 2.33, + "y": 1.17, + "width": 9.33, + "height": 11.67, + "strokes": [{"type": "SOLID", "color": "#9E98A6"}], + "strokeWeight": 1.17 + }, + { + "id": "1:46973", + "name": "path", + "type": "VECTOR", + "x": 8.17, + "y": 1.17, + "width": 3.5, + "height": 3.5, + "strokes": [{"type": "SOLID", "color": "#9E98A6"}], + "strokeWeight": 1.17 + } + ] + }, + { + "id": "1:46909", + "name": "text", + "type": "TEXT", + "x": 22, + "y": 0, + "width": 107, + "height": 18, + "fills": [{"type": "SOLID", "color": "#F5F3F7"}], + "text": "server.properties", + "font": ["Geist", 400, 14], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + } + ] + }, + { + "id": "1:46841", + "name": "frame", + "type": "FRAME", + "x": 673, + "y": 8, + "width": 207, + "height": 26, + "layout": { + "mode": "HORIZONTAL", + "gap": 8, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["HUG", "HUG"] + }, + "children": [ + { + "id": "1:46910", + "name": "Download", + "type": "FRAME", + "x": 0, + "y": 0, + "width": 80, + "height": 26, + "fills": [{"type": "SOLID", "color": "#232128"}], + "cornerRadius": 6, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [5, 12, 5, 12], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["HUG", "HUG"] + }, + "variables": {"fills/0/color": "default/default"}, + "children": [ + { + "id": "1:46974", + "name": "text", + "type": "TEXT", + "x": 12, + "y": 5, + "width": 56, + "height": 16, + "fills": [{"type": "SOLID", "color": "#F5F3F7"}], + "text": "Download", + "font": ["Geist", 400, 12], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + } + ] + }, + { + "id": "1:46911", + "name": "Delete", + "type": "FRAME", + "x": 88, + "y": 0, + "width": 60, + "height": 26, + "fills": [{"type": "SOLID", "color": "#232128"}], + "cornerRadius": 6, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [5, 12, 5, 12], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["HUG", "HUG"] + }, + "variables": {"fills/0/color": "default/default"}, + "children": [ + { + "id": "1:46975", + "name": "text", + "type": "TEXT", + "x": 12, + "y": 5, + "width": 36, + "height": 16, + "fills": [{"type": "SOLID", "color": "#F5F3F7"}], + "text": "Delete", + "font": ["Geist", 400, 12], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + } + ] + }, + { + "id": "1:46912", + "name": "Save", + "type": "FRAME", + "x": 156, + "y": 0, + "width": 51, + "height": 26, + "fills": [{"type": "SOLID", "color": "#232128"}], + "cornerRadius": 6, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [5, 12, 5, 12], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["HUG", "HUG"] + }, + "variables": {"fills/0/color": "default/default"}, + "children": [ + { + "id": "1:46976", + "name": "text", + "type": "TEXT", + "x": 12, + "y": 5, + "width": 27, + "height": 16, + "fills": [{"type": "SOLID", "color": "#F5F3F7"}], + "text": "Save", + "font": ["Geist", 400, 12], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + } + ] + } + ] + } + ] + }, + { + "id": "1:46740", + "name": "Monaco editor", + "type": "FRAME", + "x": 0, + "y": 42, + "width": 892, + "height": 486, + "fills": [{"type": "SOLID", "color": "#1E1E1E"}], + "layout": { + "mode": "HORIZONTAL", + "gap": 22, + "padding": [0, 28, 0, 28], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "FIXED"] + }, + "layoutGrow": 1, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "id": "1:46842", + "name": "text", + "type": "TEXT", + "x": 28, + "y": 0, + "width": 8, + "height": 120, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "text": "1\n2\n3\n4\n5\n6", + "font": ["JetBrains Mono", 400, 13], + "lineHeight": {"value": 154.99999523162842, "unit": "PERCENT"}, + "variables": {"fontFamily": "typography/font-mono", "fills/0/color": "muted"} + }, + { + "id": "1:46843", + "name": "text", + "type": "TEXT", + "x": 58, + "y": 0, + "width": 219, + "height": 120, + "fills": [{"type": "SOLID", "color": "#F5F3F7"}], + "text": "#Minecraft server properties\nmotd=Survival server\ndifficulty=normal\ngamemode=survival\nmax-players=20\nwhite-list=true", + "font": ["JetBrains Mono", 400, 13], + "lineHeight": {"value": 154.99999523162842, "unit": "PERCENT"}, + "variables": {"fontFamily": "typography/font-mono", "fills/0/color": "foreground/foreground"} + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "id": "1:46421", + "name": "Upload panel", + "type": "FRAME", + "x": 996, + "y": 626, + "width": 420, + "height": 250, + "fills": [{"type": "SOLID", "color": "#1C1A20"}], + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "effects": [{"type": "DROP_SHADOW", "radius": 24, "visible": true}], + "cornerRadius": 24, + "absolute": true, + "variables": {"fills/0/color": "surface/surface", "strokes/0/color": "border/border"}, + "children": [ + { + "id": "1:46479", + "name": "cardTitle", + "type": "TEXT", + "x": 16, + "y": 16, + "width": 119, + "height": 21, + "fills": [{"type": "SOLID", "color": "#F5F3F7"}], + "text": "Uploads · 3 files", + "font": ["Geist", 500, 16], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + }, + { + "name": "Gameplane/Button/Small/Ghost", + "type": "INSTANCE", + "x": 320, + "y": 8, + "width": 84, + "height": 32, + "component": "Gameplane/Button/Small/Ghost", + "componentId": "1:1124", + "fills": [{"type": "SOLID", "color": "#00000000", "opacity": 0}], + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "CENTER", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "texts": ["Cancel all"] + }, + { + "id": "1:46480", + "name": "cardBody", + "type": "TEXT", + "x": 16, + "y": 60, + "width": 180, + "height": 18, + "fills": [{"type": "SOLID", "color": "#F5F3F7"}], + "layoutAlignSelf": "STRETCH", + "text": "world-backup-2026-11.zip", + "font": ["Geist", 400, 14], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + }, + { + "id": "1:46481", + "name": "cardBody", + "type": "TEXT", + "x": 200, + "y": 60, + "width": 128, + "height": 18, + "fills": [{"type": "SOLID", "color": "#F5F3F7"}], + "layoutAlignSelf": "STRETCH", + "text": "1.8 of 2.0 GiB · 90%", + "font": ["Geist", 400, 14], + "align": "RIGHT", + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + }, + { + "id": "1:46482", + "name": "Progress track", + "type": "RECTANGLE", + "x": 16, + "y": 84, + "width": 388, + "height": 4, + "fills": [{"type": "SOLID", "color": "#2C2932"}], + "variables": {"fills/0/color": "border/border"} + }, + { + "id": "1:46483", + "name": "Progress fill", + "type": "RECTANGLE", + "x": 16, + "y": 84, + "width": 349.2, + "height": 4, + "fills": [{"type": "SOLID", "color": "#FF4FA3"}], + "variables": {"fills/0/color": "accent/accent"} + }, + { + "name": "Gameplane/Button/Small/Ghost", + "type": "INSTANCE", + "x": 336, + "y": 53, + "width": 68, + "height": 32, + "component": "Gameplane/Button/Small/Ghost", + "componentId": "1:1124", + "fills": [{"type": "SOLID", "color": "#00000000", "opacity": 0}], + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "CENTER", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "texts": ["Cancel"] + }, + { + "id": "1:46484", + "name": "cardBody", + "type": "TEXT", + "x": 16, + "y": 108, + "width": 180, + "height": 18, + "fills": [{"type": "SOLID", "color": "#F5F3F7"}], + "layoutAlignSelf": "STRETCH", + "text": "mod-jei-19.jar", + "font": ["Geist", 400, 14], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + }, + { + "id": "1:46485", + "name": "cardBody", + "type": "TEXT", + "x": 200, + "y": 108, + "width": 128, + "height": 18, + "fills": [{"type": "SOLID", "color": "#F5F3F7"}], + "layoutAlignSelf": "STRETCH", + "text": "Done", + "font": ["Geist", 400, 14], + "align": "RIGHT", + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + }, + { + "id": "1:46486", + "name": "cardBody", + "type": "TEXT", + "x": 16, + "y": 146, + "width": 180, + "height": 18, + "fills": [{"type": "SOLID", "color": "#F5F3F7"}], + "layoutAlignSelf": "STRETCH", + "text": "server.properties", + "font": ["Geist", 400, 14], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + }, + { + "id": "1:46487", + "name": "cardBody", + "type": "TEXT", + "x": 200, + "y": 146, + "width": 128, + "height": 18, + "fills": [{"type": "SOLID", "color": "#F5F3F7"}], + "layoutAlignSelf": "STRETCH", + "text": "Waiting", + "font": ["Geist", 400, 14], + "align": "RIGHT", + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + }, + { + "id": "1:46488", + "name": "Progress track", + "type": "RECTANGLE", + "x": 16, + "y": 170, + "width": 388, + "height": 4, + "fills": [{"type": "SOLID", "color": "#2C2932"}], + "variables": {"fills/0/color": "border/border"} + }, + { + "name": "Gameplane/Button/Small/Ghost", + "type": "INSTANCE", + "x": 336, + "y": 139, + "width": 68, + "height": 32, + "component": "Gameplane/Button/Small/Ghost", + "componentId": "1:1124", + "fills": [{"type": "SOLID", "color": "#00000000", "opacity": 0}], + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "CENTER", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "texts": ["Cancel"] + }, + { + "id": "1:46489", + "name": "cardBody", + "type": "TEXT", + "x": 16, + "y": 194, + "width": 388, + "height": 36, + "fills": [{"type": "SOLID", "color": "#F5F3F7"}], + "layoutAlignSelf": "STRETCH", + "text": "Uploads go straight to the server volume. Cancelling removes the part written so far, and the old file stays.", + "font": ["Geist", 400, 14], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + } + ] + } + ] +} diff --git a/assets/design-export/json/1-46391.json b/assets/design-export/json/1-46391.json new file mode 100644 index 000000000..4b2665963 --- /dev/null +++ b/assets/design-export/json/1-46391.json @@ -0,0 +1,3330 @@ +{ + "file": "1-46391", + "id": "1:46391", + "name": "Screen/Server Detail — Files (Uploads, Light)", + "type": "FRAME", + "x": 3920, + "y": 32501, + "width": 1440, + "height": 900, + "fills": [{"type": "SOLID", "color": "#FFFFFF"}], + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "FIXED"] + }, + "clips": true, + "variables": {"fills/0/color": "background/background"}, + "children": [ + { + "name": "App Sidebar", + "type": "INSTANCE", + "x": 0, + "y": 0, + "width": 260, + "height": 900, + "component": "Gameplane/App Sidebar", + "componentId": "1:234", + "fills": [{"type": "SOLID", "color": "#F8DDE9"}], + "strokes": [{"type": "SOLID", "color": "#EFC3D6"}], + "strokeWeight": 1, + "layout": { + "mode": "VERTICAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"fills/0/color": "surface/secondary", "strokes/0/color": "border/border"}, + "texts": [ + "gameplane", + "homelab-01", + "GENERAL", + "Dashboard", + "Servers", + "Modules", + "Backups", + "ADMIN", + "Clusters", + "Nodes", + "Users & RBAC", + "Audit log", + "System logs", + "Settings", + "AD", + "admin", + "admin" + ] + }, + { + "id": "1:46422", + "name": "Main", + "type": "FRAME", + "x": 260, + "y": 0, + "width": 1180, + "height": 900, + "fills": [{"type": "SOLID", "color": "#FFFFFF"}], + "layout": { + "mode": "VERTICAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "FIXED"] + }, + "layoutGrow": 1, + "layoutAlignSelf": "STRETCH", + "variables": {"fills/0/color": "background/background"}, + "children": [ + { + "name": "Top Bar", + "type": "INSTANCE", + "x": 0, + "y": 0, + "width": 1180, + "height": 64, + "component": "Gameplane/Top Bar", + "componentId": "1:281", + "fills": [{"type": "SOLID", "color": "#FFFFFF"}], + "strokes": [{"type": "SOLID", "color": "#EFC3D6"}], + "strokeWeight": 1, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 32, 0, 32], + "primary": "SPACE_BETWEEN", + "counter": "CENTER", + "sizing": ["FIXED", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"fills/0/color": "background/background", "strokes/0/color": "border/border"}, + "texts": ["gameplane", "mc-survival", "Search servers…", "AD"] + }, + { + "name": "Detail Header", + "type": "INSTANCE", + "x": 0, + "y": 64, + "width": 1180, + "height": 86, + "component": "Gameplane/Server Detail Header", + "componentId": "1:447", + "fills": [{"type": "SOLID", "color": "#FFFFFF"}], + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [16, 24, 16, 24], + "primary": "SPACE_BETWEEN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"fills/0/color": "background/background"}, + "texts": [ + "MI", + "mc-survival", + "Running", + "site: remote-lab · minecraft-java · 1.21.4-fabric · ns: gameplane-games", + "Restart", + "Stop", + "Open console" + ] + }, + { + "name": "Tabs Bar", + "type": "INSTANCE", + "x": 0, + "y": 150, + "width": 1180, + "height": 76, + "component": "Gameplane/Server Detail Tabs", + "componentId": "1:466", + "fills": [{"type": "SOLID", "color": "#FFFFFF"}], + "strokes": [{"type": "SOLID", "color": "#EFC3D6"}], + "strokeWeight": 1, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [18, 24, 18, 24], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"fills/0/color": "background/background", "strokes/0/color": "border/border"}, + "texts": [ + "Overview", + "Events", + "Console", + "Logs", + "Files", + "Mods", + "Modpacks", + "Players", + "Backups", + "Capture", + "Settings" + ] + }, + { + "id": "1:46490", + "name": "Body", + "type": "FRAME", + "x": 0, + "y": 226, + "width": 1180, + "height": 674, + "fills": [{"type": "SOLID", "color": "#FFFFFF"}], + "layout": { + "mode": "VERTICAL", + "gap": 12, + "padding": [4, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "FIXED"] + }, + "layoutGrow": 1, + "layoutAlignSelf": "STRETCH", + "variables": {"fills/0/color": "background/background"}, + "children": [ + { + "id": "1:46560", + "name": "Files Toolbar", + "type": "FRAME", + "x": 0, + "y": 4, + "width": 1180, + "height": 36, + "layout": { + "mode": "HORIZONTAL", + "gap": 12, + "padding": [0, 0, 0, 0], + "primary": "SPACE_BETWEEN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "id": "1:46647", + "name": "Breadcrumb", + "type": "FRAME", + "x": 0, + "y": 3, + "width": 32, + "height": 30, + "fills": [{"type": "SOLID", "color": "#FFF7FB"}], + "strokes": [{"type": "SOLID", "color": "#EFC3D6"}], + "strokeWeight": 1, + "cornerRadius": 4, + "layout": { + "mode": "HORIZONTAL", + "gap": 4, + "padding": [6, 12, 6, 12], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["HUG", "FIXED"] + }, + "variables": {"fills/0/color": "surface/surface", "strokes/0/color": "border/border"}, + "children": [ + { + "id": "1:46741", + "name": "Path", + "type": "TEXT", + "x": 12, + "y": 7, + "width": 8, + "height": 16, + "fills": [{"type": "SOLID", "color": "#6E5262"}], + "text": "/", + "font": ["JetBrains Mono", 400, 12], + "variables": {"fontFamily": "typography/font-mono", "fills/0/color": "muted"} + } + ] + }, + { + "id": "1:46648", + "name": "Toolbar Actions", + "type": "FRAME", + "x": 830, + "y": 0, + "width": 350, + "height": 36, + "layout": { + "mode": "HORIZONTAL", + "gap": 8, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["HUG", "HUG"] + }, + "children": [ + { + "name": "Btn New File", + "type": "INSTANCE", + "x": 0, + "y": 2, + "width": 93, + "height": 32, + "component": "Button/Outline/SM", + "componentId": "1:633", + "strokes": [{"type": "SOLID", "color": "#EFC3D6"}], + "strokeWeight": 1, + "cornerRadius": 24, + "layout": { + "mode": "HORIZONTAL", + "gap": 5, + "padding": [8, 12, 8, 12], + "primary": "CENTER", + "counter": "CENTER", + "sizing": ["HUG", "FIXED"] + }, + "variables": { + "cornerRadius": "radius/3xl", + "paddingRight": "spacing/3", + "paddingLeft": "spacing/3", + "strokes/0/color": "border-2" + }, + "texts": ["New file"] + }, + { + "name": "Btn New Folder", + "type": "INSTANCE", + "x": 101, + "y": 2, + "width": 110, + "height": 32, + "component": "Button/Outline/SM", + "componentId": "1:633", + "strokes": [{"type": "SOLID", "color": "#EFC3D6"}], + "strokeWeight": 1, + "cornerRadius": 24, + "layout": { + "mode": "HORIZONTAL", + "gap": 5, + "padding": [8, 12, 8, 12], + "primary": "CENTER", + "counter": "CENTER", + "sizing": ["HUG", "FIXED"] + }, + "variables": { + "cornerRadius": "radius/3xl", + "paddingRight": "spacing/3", + "paddingLeft": "spacing/3", + "strokes/0/color": "border-2" + }, + "texts": ["New folder"] + }, + { + "name": "Btn Upload", + "type": "INSTANCE", + "x": 219, + "y": 2, + "width": 87, + "height": 32, + "component": "Button/Outline/SM", + "componentId": "1:633", + "strokes": [{"type": "SOLID", "color": "#EFC3D6"}], + "strokeWeight": 1, + "cornerRadius": 24, + "layout": { + "mode": "HORIZONTAL", + "gap": 5, + "padding": [8, 12, 8, 12], + "primary": "CENTER", + "counter": "CENTER", + "sizing": ["HUG", "FIXED"] + }, + "variables": { + "cornerRadius": "radius/3xl", + "paddingRight": "spacing/3", + "paddingLeft": "spacing/3", + "strokes/0/color": "border-2" + }, + "texts": ["Upload"] + }, + { + "name": "Btn Refresh", + "type": "INSTANCE", + "x": 314, + "y": 0, + "width": 36, + "height": 36, + "component": "Button/Outline/Icon/MD", + "componentId": "1:774", + "strokes": [{"type": "SOLID", "color": "#EFC3D6"}], + "strokeWeight": 1, + "cornerRadius": 24, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "CENTER", + "counter": "CENTER", + "sizing": ["FIXED", "FIXED"] + }, + "variables": {"cornerRadius": "radius/3xl", "strokes/0/color": "border-2"} + } + ] + } + ] + }, + { + "id": "1:46561", + "name": "Selected file actions", + "type": "FRAME", + "x": 0, + "y": 52, + "width": 1180, + "height": 32, + "layout": { + "mode": "HORIZONTAL", + "gap": 8, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "id": "1:46649", + "name": "text", + "type": "TEXT", + "x": 0, + "y": 7, + "width": 67, + "height": 18, + "fills": [{"type": "SOLID", "color": "#2A0F1E"}], + "text": "2 selected", + "font": ["Geist", 400, 14], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + }, + { + "id": "1:46650", + "name": "Download ZIP", + "type": "FRAME", + "x": 75, + "y": 0, + "width": 100, + "height": 32, + "fills": [{"type": "SOLID", "color": "#DB2777"}], + "cornerRadius": 6, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [5, 12, 5, 12], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["HUG", "FIXED"] + }, + "variables": {"fills/0/color": "accent/accent"}, + "children": [ + { + "id": "1:46742", + "name": "text", + "type": "TEXT", + "x": 12, + "y": 8, + "width": 76, + "height": 16, + "fills": [{"type": "SOLID", "color": "#FFFFFF"}], + "text": "Download ZIP", + "font": ["Geist", 400, 12], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "accent/foreground"} + } + ] + }, + { + "id": "1:46651", + "name": "Create ZIP", + "type": "FRAME", + "x": 183, + "y": 0, + "width": 81, + "height": 32, + "fills": [{"type": "SOLID", "color": "#DB2777"}], + "cornerRadius": 6, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [5, 12, 5, 12], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["HUG", "FIXED"] + }, + "variables": {"fills/0/color": "accent/accent"}, + "children": [ + { + "id": "1:46743", + "name": "text", + "type": "TEXT", + "x": 12, + "y": 8, + "width": 57, + "height": 16, + "fills": [{"type": "SOLID", "color": "#FFFFFF"}], + "text": "Create ZIP", + "font": ["Geist", 400, 12], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "accent/foreground"} + } + ] + }, + { + "id": "1:46652", + "name": "Delete selected", + "type": "FRAME", + "x": 272, + "y": 0, + "width": 110, + "height": 32, + "fills": [{"type": "SOLID", "color": "#DC2828"}], + "cornerRadius": 6, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [5, 12, 5, 12], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["HUG", "FIXED"] + }, + "variables": {"fills/0/color": "danger/danger"}, + "children": [ + { + "id": "1:46744", + "name": "text", + "type": "TEXT", + "x": 12, + "y": 8, + "width": 86, + "height": 16, + "fills": [{"type": "SOLID", "color": "#FCFCFC"}], + "text": "Delete selected", + "font": ["Geist", 400, 12], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "danger/foreground"} + } + ] + } + ] + }, + { + "id": "1:46562", + "name": "Open files", + "type": "FRAME", + "x": 0, + "y": 96, + "width": 1180, + "height": 38, + "fills": [{"type": "SOLID", "color": "#FFFFFF"}], + "strokes": [{"type": "SOLID", "color": "#EFC3D6"}], + "strokeWeight": 1, + "layout": { + "mode": "HORIZONTAL", + "gap": 4, + "padding": [4, 8, 4, 8], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"fills/0/color": "background/background", "strokes/0/color": "border/border"}, + "children": [ + { + "id": "1:46653", + "name": "/eula.txt", + "type": "FRAME", + "x": 8, + "y": 4, + "width": 83, + "height": 30, + "fills": [{"type": "SOLID", "color": "#FFFFFF"}], + "layout": { + "mode": "HORIZONTAL", + "gap": 6, + "padding": [7, 9, 7, 9], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["HUG", "HUG"] + }, + "variables": {"fills/0/color": "background/background"}, + "children": [ + { + "id": "1:46745", + "name": "text", + "type": "TEXT", + "x": 9, + "y": 7, + "width": 47, + "height": 16, + "fills": [{"type": "SOLID", "color": "#2A0F1E"}], + "text": "/eula.txt", + "font": ["Geist", 400, 12], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + }, + { + "id": "1:46746", + "name": "icon", + "type": "FRAME", + "x": 62, + "y": 9, + "width": 12, + "height": 12, + "variables": {"fills/0/color": "muted"}, + "children": [ + { + "id": "1:46844", + "name": "path", + "type": "VECTOR", + "x": 3, + "y": 3, + "width": 6, + "height": 6, + "strokes": [{"type": "SOLID", "color": "#9E98A6"}], + "strokeWeight": 1 + } + ] + } + ] + }, + { + "id": "1:46654", + "name": "/server.properties", + "type": "FRAME", + "x": 95, + "y": 4, + "width": 133, + "height": 30, + "fills": [{"type": "SOLID", "color": "#F6DCE7"}], + "layout": { + "mode": "HORIZONTAL", + "gap": 6, + "padding": [7, 9, 7, 9], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["HUG", "HUG"] + }, + "variables": {"fills/0/color": "default/default"}, + "children": [ + { + "id": "1:46747", + "name": "text", + "type": "TEXT", + "x": 9, + "y": 7, + "width": 97, + "height": 16, + "fills": [{"type": "SOLID", "color": "#2A0F1E"}], + "text": "/server.properties", + "font": ["Geist", 400, 12], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + }, + { + "id": "1:46748", + "name": "icon", + "type": "FRAME", + "x": 112, + "y": 9, + "width": 12, + "height": 12, + "variables": {"fills/0/color": "muted"}, + "children": [ + { + "id": "1:46845", + "name": "path", + "type": "VECTOR", + "x": 3, + "y": 3, + "width": 6, + "height": 6, + "strokes": [{"type": "SOLID", "color": "#9E98A6"}], + "strokeWeight": 1 + } + ] + } + ] + } + ] + }, + { + "id": "1:46563", + "name": "Files Panes", + "type": "FRAME", + "x": 0, + "y": 146, + "width": 1180, + "height": 528, + "fills": [{"type": "SOLID", "color": "#FFF7FB"}], + "strokes": [{"type": "SOLID", "color": "#EFC3D6"}], + "strokeWeight": 1, + "cornerRadius": 4, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "FIXED"] + }, + "layoutGrow": 1, + "layoutAlignSelf": "STRETCH", + "clips": true, + "variables": {"fills/0/color": "surface/surface", "strokes/0/color": "border/border"}, + "children": [ + { + "id": "1:46655", + "name": "Left Pane", + "type": "FRAME", + "x": 0, + "y": 0, + "width": 288, + "height": 528, + "strokes": [{"type": "SOLID", "color": "#EFC3D6"}], + "strokeWeight": 1, + "layout": { + "mode": "VERTICAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"strokes/0/color": "border/border"}, + "children": [ + { + "id": "1:46749", + "name": "Path Bar", + "type": "FRAME", + "x": 0, + "y": 0, + "width": 288, + "height": 32, + "strokes": [{"type": "SOLID", "color": "#EFC3D6"}], + "strokeWeight": 1, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [8, 12, 8, 12], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"strokes/0/color": "border/border"}, + "children": [ + { + "id": "1:46846", + "name": "Path", + "type": "TEXT", + "x": 12, + "y": 8, + "width": 8, + "height": 16, + "fills": [{"type": "SOLID", "color": "#6E5262"}], + "text": "/", + "font": ["JetBrains Mono", 400, 12], + "variables": {"fontFamily": "typography/font-mono", "fills/0/color": "muted"} + } + ] + }, + { + "id": "1:46750", + "name": "File List", + "type": "FRAME", + "x": 0, + "y": 32, + "width": 288, + "height": 496, + "layout": { + "mode": "VERTICAL", + "gap": 2, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "FIXED"] + }, + "layoutGrow": 1, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "id": "1:46847", + "name": "Row — libraries", + "type": "FRAME", + "x": 0, + "y": 0, + "width": 288, + "height": 26, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "SPACE_BETWEEN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "id": "1:46913", + "name": "Name", + "type": "FRAME", + "x": 0, + "y": 0, + "width": 264, + "height": 26, + "fills": [{"type": "SOLID", "color": "#FFF7FB"}], + "strokes": [{"type": "SOLID", "color": "#EFC3D6"}], + "strokeWeight": 1, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [4, 12, 4, 12], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutGrow": 1, + "variables": {"fills/0/color": "surface/surface", "strokes/0/color": "separator/separator"}, + "children": [ + { + "id": "1:46977", + "name": "Left", + "type": "FRAME", + "x": 12, + "y": 4, + "width": 113, + "height": 18, + "layout": { + "mode": "HORIZONTAL", + "gap": 8, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["HUG", "HUG"] + }, + "children": [ + { + "id": "1:47060", + "name": "icon", + "type": "FRAME", + "x": 0, + "y": 2, + "width": 14, + "height": 14, + "variables": {"fills/0/color": "muted"}, + "children": [ + { + "id": "1:47184", + "name": "path", + "type": "VECTOR", + "x": 1.75, + "y": 1.75, + "width": 10.5, + "height": 10.5, + "strokes": [{"type": "SOLID", "color": "#9E98A6"}], + "strokeWeight": 1.17 + } + ] + }, + { + "id": "1:47061", + "name": "icon", + "type": "FRAME", + "x": 22, + "y": 3, + "width": 12, + "height": 12, + "variables": {"fills/0/color": "muted"}, + "children": [ + { + "id": "1:47185", + "name": "path", + "type": "VECTOR", + "x": 4.5, + "y": 3, + "width": 3, + "height": 6, + "strokes": [{"type": "SOLID", "color": "#9E98A6"}], + "strokeWeight": 1 + } + ] + }, + { + "id": "1:47062", + "name": "Icon", + "type": "FRAME", + "x": 42, + "y": 3, + "width": 12, + "height": 12, + "variables": {"fills/0/color": "muted"}, + "children": [ + { + "id": "1:47186", + "name": "path", + "type": "VECTOR", + "x": 1, + "y": 1.5, + "width": 10, + "height": 8.5, + "strokes": [{"type": "SOLID", "color": "#9E98A6"}], + "strokeWeight": 1 + } + ] + }, + { + "id": "1:47063", + "name": "Name", + "type": "TEXT", + "x": 62, + "y": 0, + "width": 51, + "height": 18, + "fills": [{"type": "SOLID", "color": "#2A0F1E"}], + "text": "libraries", + "font": ["Geist", 400, 14], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + } + ] + } + ] + }, + { + "name": "Size", + "type": "INSTANCE", + "x": 264, + "y": 1, + "width": 24, + "height": 24, + "component": "Table Cell", + "componentId": "1:824", + "fills": [{"type": "SOLID", "color": "#FFF7FB"}], + "strokes": [{"type": "SOLID", "color": "#EFC3D6"}], + "strokeWeight": 1, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [4, 12, 4, 12], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["HUG", "HUG"] + }, + "variables": {"fills/0/color": "surface/surface", "strokes/0/color": "separator/separator"} + } + ] + }, + { + "id": "1:46848", + "name": "Row — logs", + "type": "FRAME", + "x": 0, + "y": 28, + "width": 288, + "height": 26, + "fills": [{"type": "SOLID", "color": "#F6DCE7"}], + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "SPACE_BETWEEN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"fills/0/color": "default/default"}, + "children": [ + { + "id": "1:46914", + "name": "Name", + "type": "FRAME", + "x": 0, + "y": 0, + "width": 248, + "height": 26, + "fills": [{"type": "SOLID", "color": "#FFF7FB"}], + "strokes": [{"type": "SOLID", "color": "#EFC3D6"}], + "strokeWeight": 1, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [4, 12, 4, 12], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutGrow": 1, + "variables": {"fills/0/color": "surface/surface", "strokes/0/color": "separator/separator"}, + "children": [ + { + "id": "1:46978", + "name": "Left", + "type": "FRAME", + "x": 12, + "y": 4, + "width": 89, + "height": 18, + "layout": { + "mode": "HORIZONTAL", + "gap": 8, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["HUG", "HUG"] + }, + "children": [ + { + "id": "1:47064", + "name": "icon", + "type": "FRAME", + "x": 0, + "y": 2, + "width": 14, + "height": 14, + "variables": {"fills/0/color": "muted"}, + "children": [ + { + "id": "1:47187", + "name": "path", + "type": "VECTOR", + "x": 1.75, + "y": 1.75, + "width": 10.5, + "height": 10.5, + "strokes": [{"type": "SOLID", "color": "#9E98A6"}], + "strokeWeight": 1.17 + } + ] + }, + { + "id": "1:47065", + "name": "icon", + "type": "FRAME", + "x": 22, + "y": 3, + "width": 12, + "height": 12, + "variables": {"fills/0/color": "muted"}, + "children": [ + { + "id": "1:47188", + "name": "path", + "type": "VECTOR", + "x": 3, + "y": 4.5, + "width": 6, + "height": 3, + "strokes": [{"type": "SOLID", "color": "#9E98A6"}], + "strokeWeight": 1 + } + ] + }, + { + "id": "1:47066", + "name": "Icon", + "type": "FRAME", + "x": 42, + "y": 3, + "width": 12, + "height": 12, + "variables": {"fills/0/color": "muted"}, + "children": [ + { + "id": "1:47189", + "name": "path", + "type": "VECTOR", + "x": 1, + "y": 1.5, + "width": 10, + "height": 8.5, + "strokes": [{"type": "SOLID", "color": "#9E98A6"}], + "strokeWeight": 1 + } + ] + }, + { + "id": "1:47067", + "name": "Name", + "type": "TEXT", + "x": 62, + "y": 0, + "width": 27, + "height": 18, + "fills": [{"type": "SOLID", "color": "#2A0F1E"}], + "text": "logs", + "font": ["Geist", 400, 14], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + } + ] + } + ] + }, + { + "id": "1:46915", + "name": "Folder Actions", + "type": "FRAME", + "x": 248, + "y": 1, + "width": 40, + "height": 24, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 8, 0, 8], + "primary": "MAX", + "counter": "CENTER", + "sizing": ["HUG", "HUG"] + }, + "children": [ + { + "name": "Btn Delete Folder", + "type": "INSTANCE", + "x": 8, + "y": 0, + "width": 24, + "height": 24, + "component": "Button/Ghost/Icon/SM", + "componentId": "1:835", + "cornerRadius": 6, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "CENTER", + "counter": "CENTER", + "sizing": ["FIXED", "FIXED"] + } + } + ] + } + ] + }, + { + "id": "1:46849", + "name": "Latest log in expanded logs folder", + "type": "FRAME", + "x": 0, + "y": 56, + "width": 157, + "height": 26, + "layout": { + "mode": "HORIZONTAL", + "gap": 8, + "padding": [4, 28, 4, 28], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["HUG", "HUG"] + }, + "children": [ + { + "id": "1:46916", + "name": "icon", + "type": "FRAME", + "x": 28, + "y": 6, + "width": 14, + "height": 14, + "variables": {"fills/0/color": "muted"}, + "children": [ + { + "id": "1:46979", + "name": "path", + "type": "VECTOR", + "x": 1.75, + "y": 1.75, + "width": 10.5, + "height": 10.5, + "strokes": [{"type": "SOLID", "color": "#9E98A6"}], + "strokeWeight": 1.17 + } + ] + }, + { + "id": "1:46917", + "name": "icon", + "type": "FRAME", + "x": 50, + "y": 7, + "width": 12, + "height": 12, + "variables": {"fills/0/color": "muted"}, + "children": [ + { + "id": "1:46980", + "name": "path", + "type": "VECTOR", + "x": 2, + "y": 1, + "width": 8, + "height": 10, + "strokes": [{"type": "SOLID", "color": "#9E98A6"}], + "strokeWeight": 1 + }, + { + "id": "1:46981", + "name": "path", + "type": "VECTOR", + "x": 7, + "y": 1, + "width": 3, + "height": 3, + "strokes": [{"type": "SOLID", "color": "#9E98A6"}], + "strokeWeight": 1 + } + ] + }, + { + "id": "1:46918", + "name": "text", + "type": "TEXT", + "x": 70, + "y": 4, + "width": 59, + "height": 18, + "fills": [{"type": "SOLID", "color": "#2A0F1E"}], + "text": "latest.log", + "font": ["Geist", 400, 14], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + } + ] + }, + { + "id": "1:46850", + "name": "Row — mods", + "type": "FRAME", + "x": 0, + "y": 84, + "width": 288, + "height": 26, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "SPACE_BETWEEN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "id": "1:46919", + "name": "Name", + "type": "FRAME", + "x": 0, + "y": 0, + "width": 264, + "height": 26, + "fills": [{"type": "SOLID", "color": "#FFF7FB"}], + "strokes": [{"type": "SOLID", "color": "#EFC3D6"}], + "strokeWeight": 1, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [4, 12, 4, 12], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutGrow": 1, + "variables": {"fills/0/color": "surface/surface", "strokes/0/color": "separator/separator"}, + "children": [ + { + "id": "1:46982", + "name": "Left", + "type": "FRAME", + "x": 12, + "y": 4, + "width": 98, + "height": 18, + "layout": { + "mode": "HORIZONTAL", + "gap": 8, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["HUG", "HUG"] + }, + "children": [ + { + "id": "1:47068", + "name": "icon", + "type": "FRAME", + "x": 0, + "y": 2, + "width": 14, + "height": 14, + "variables": {"fills/0/color": "muted"}, + "children": [ + { + "id": "1:47190", + "name": "path", + "type": "VECTOR", + "x": 1.75, + "y": 1.75, + "width": 10.5, + "height": 10.5, + "strokes": [{"type": "SOLID", "color": "#9E98A6"}], + "strokeWeight": 1.17 + } + ] + }, + { + "id": "1:47069", + "name": "icon", + "type": "FRAME", + "x": 22, + "y": 3, + "width": 12, + "height": 12, + "variables": {"fills/0/color": "muted"}, + "children": [ + { + "id": "1:47191", + "name": "path", + "type": "VECTOR", + "x": 4.5, + "y": 3, + "width": 3, + "height": 6, + "strokes": [{"type": "SOLID", "color": "#9E98A6"}], + "strokeWeight": 1 + } + ] + }, + { + "id": "1:47070", + "name": "Icon", + "type": "FRAME", + "x": 42, + "y": 3, + "width": 12, + "height": 12, + "variables": {"fills/0/color": "muted"}, + "children": [ + { + "id": "1:47192", + "name": "path", + "type": "VECTOR", + "x": 1, + "y": 1.5, + "width": 10, + "height": 8.5, + "strokes": [{"type": "SOLID", "color": "#9E98A6"}], + "strokeWeight": 1 + } + ] + }, + { + "id": "1:47071", + "name": "Name", + "type": "TEXT", + "x": 62, + "y": 0, + "width": 36, + "height": 18, + "fills": [{"type": "SOLID", "color": "#2A0F1E"}], + "text": "mods", + "font": ["Geist", 400, 14], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + } + ] + } + ] + }, + { + "name": "Size", + "type": "INSTANCE", + "x": 264, + "y": 1, + "width": 24, + "height": 24, + "component": "Table Cell", + "componentId": "1:824", + "fills": [{"type": "SOLID", "color": "#FFF7FB"}], + "strokes": [{"type": "SOLID", "color": "#EFC3D6"}], + "strokeWeight": 1, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [4, 12, 4, 12], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["HUG", "HUG"] + }, + "variables": {"fills/0/color": "surface/surface", "strokes/0/color": "separator/separator"} + } + ] + }, + { + "id": "1:46851", + "name": "Row — versions", + "type": "FRAME", + "x": 0, + "y": 112, + "width": 288, + "height": 26, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "SPACE_BETWEEN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "id": "1:46920", + "name": "Name", + "type": "FRAME", + "x": 0, + "y": 0, + "width": 264, + "height": 26, + "fills": [{"type": "SOLID", "color": "#FFF7FB"}], + "strokes": [{"type": "SOLID", "color": "#EFC3D6"}], + "strokeWeight": 1, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [4, 12, 4, 12], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutGrow": 1, + "variables": {"fills/0/color": "surface/surface", "strokes/0/color": "separator/separator"}, + "children": [ + { + "id": "1:46983", + "name": "Left", + "type": "FRAME", + "x": 12, + "y": 4, + "width": 116, + "height": 18, + "layout": { + "mode": "HORIZONTAL", + "gap": 8, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["HUG", "HUG"] + }, + "children": [ + { + "id": "1:47072", + "name": "icon", + "type": "FRAME", + "x": 0, + "y": 2, + "width": 14, + "height": 14, + "variables": {"fills/0/color": "muted"}, + "children": [ + { + "id": "1:47193", + "name": "path", + "type": "VECTOR", + "x": 1.75, + "y": 1.75, + "width": 10.5, + "height": 10.5, + "strokes": [{"type": "SOLID", "color": "#9E98A6"}], + "strokeWeight": 1.17 + } + ] + }, + { + "id": "1:47073", + "name": "icon", + "type": "FRAME", + "x": 22, + "y": 3, + "width": 12, + "height": 12, + "variables": {"fills/0/color": "muted"}, + "children": [ + { + "id": "1:47194", + "name": "path", + "type": "VECTOR", + "x": 4.5, + "y": 3, + "width": 3, + "height": 6, + "strokes": [{"type": "SOLID", "color": "#9E98A6"}], + "strokeWeight": 1 + } + ] + }, + { + "id": "1:47074", + "name": "Icon", + "type": "FRAME", + "x": 42, + "y": 3, + "width": 12, + "height": 12, + "variables": {"fills/0/color": "muted"}, + "children": [ + { + "id": "1:47195", + "name": "path", + "type": "VECTOR", + "x": 1, + "y": 1.5, + "width": 10, + "height": 8.5, + "strokes": [{"type": "SOLID", "color": "#9E98A6"}], + "strokeWeight": 1 + } + ] + }, + { + "id": "1:47075", + "name": "Name", + "type": "TEXT", + "x": 62, + "y": 0, + "width": 54, + "height": 18, + "fills": [{"type": "SOLID", "color": "#2A0F1E"}], + "text": "versions", + "font": ["Geist", 400, 14], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + } + ] + } + ] + }, + { + "name": "Size", + "type": "INSTANCE", + "x": 264, + "y": 1, + "width": 24, + "height": 24, + "component": "Table Cell", + "componentId": "1:824", + "fills": [{"type": "SOLID", "color": "#FFF7FB"}], + "strokes": [{"type": "SOLID", "color": "#EFC3D6"}], + "strokeWeight": 1, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [4, 12, 4, 12], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["HUG", "HUG"] + }, + "variables": {"fills/0/color": "surface/surface", "strokes/0/color": "separator/separator"} + } + ] + }, + { + "id": "1:46852", + "name": "Row — world", + "type": "FRAME", + "x": 0, + "y": 140, + "width": 288, + "height": 26, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "SPACE_BETWEEN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "id": "1:46921", + "name": "Name", + "type": "FRAME", + "x": 0, + "y": 0, + "width": 264, + "height": 26, + "fills": [{"type": "SOLID", "color": "#FFF7FB"}], + "strokes": [{"type": "SOLID", "color": "#EFC3D6"}], + "strokeWeight": 1, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [4, 12, 4, 12], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutGrow": 1, + "variables": {"fills/0/color": "surface/surface", "strokes/0/color": "separator/separator"}, + "children": [ + { + "id": "1:46984", + "name": "Left", + "type": "FRAME", + "x": 12, + "y": 4, + "width": 98, + "height": 18, + "layout": { + "mode": "HORIZONTAL", + "gap": 8, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["HUG", "HUG"] + }, + "children": [ + { + "id": "1:47076", + "name": "icon", + "type": "FRAME", + "x": 0, + "y": 2, + "width": 14, + "height": 14, + "variables": {"fills/0/color": "muted"}, + "children": [ + { + "id": "1:47196", + "name": "path", + "type": "VECTOR", + "x": 1.75, + "y": 1.75, + "width": 10.5, + "height": 10.5, + "strokes": [{"type": "SOLID", "color": "#9E98A6"}], + "strokeWeight": 1.17 + } + ] + }, + { + "id": "1:47077", + "name": "icon", + "type": "FRAME", + "x": 22, + "y": 3, + "width": 12, + "height": 12, + "variables": {"fills/0/color": "muted"}, + "children": [ + { + "id": "1:47197", + "name": "path", + "type": "VECTOR", + "x": 4.5, + "y": 3, + "width": 3, + "height": 6, + "strokes": [{"type": "SOLID", "color": "#9E98A6"}], + "strokeWeight": 1 + } + ] + }, + { + "id": "1:47078", + "name": "Icon", + "type": "FRAME", + "x": 42, + "y": 3, + "width": 12, + "height": 12, + "variables": {"fills/0/color": "muted"}, + "children": [ + { + "id": "1:47198", + "name": "path", + "type": "VECTOR", + "x": 1, + "y": 1.5, + "width": 10, + "height": 8.5, + "strokes": [{"type": "SOLID", "color": "#9E98A6"}], + "strokeWeight": 1 + } + ] + }, + { + "id": "1:47079", + "name": "Name", + "type": "TEXT", + "x": 62, + "y": 0, + "width": 36, + "height": 18, + "fills": [{"type": "SOLID", "color": "#2A0F1E"}], + "text": "world", + "font": ["Geist", 400, 14], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + } + ] + } + ] + }, + { + "name": "Size", + "type": "INSTANCE", + "x": 264, + "y": 1, + "width": 24, + "height": 24, + "component": "Table Cell", + "componentId": "1:824", + "fills": [{"type": "SOLID", "color": "#FFF7FB"}], + "strokes": [{"type": "SOLID", "color": "#EFC3D6"}], + "strokeWeight": 1, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [4, 12, 4, 12], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["HUG", "HUG"] + }, + "variables": {"fills/0/color": "surface/surface", "strokes/0/color": "separator/separator"} + } + ] + }, + { + "id": "1:46853", + "name": "Row — banned-ips.json", + "type": "FRAME", + "x": 0, + "y": 168, + "width": 288, + "height": 26, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "SPACE_BETWEEN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "id": "1:46922", + "name": "Name", + "type": "FRAME", + "x": 0, + "y": 0, + "width": 245, + "height": 26, + "fills": [{"type": "SOLID", "color": "#FFF7FB"}], + "strokes": [{"type": "SOLID", "color": "#EFC3D6"}], + "strokeWeight": 1, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [4, 12, 4, 12], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutGrow": 1, + "variables": {"fills/0/color": "surface/surface", "strokes/0/color": "separator/separator"}, + "children": [ + { + "id": "1:46985", + "name": "Left", + "type": "FRAME", + "x": 12, + "y": 4, + "width": 145, + "height": 18, + "layout": { + "mode": "HORIZONTAL", + "gap": 8, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["HUG", "HUG"] + }, + "children": [ + { + "id": "1:47080", + "name": "icon", + "type": "FRAME", + "x": 0, + "y": 2, + "width": 14, + "height": 14, + "variables": {"fills/0/color": "muted"}, + "children": [ + { + "id": "1:47199", + "name": "path", + "type": "VECTOR", + "x": 1.75, + "y": 1.75, + "width": 10.5, + "height": 10.5, + "strokes": [{"type": "SOLID", "color": "#9E98A6"}], + "strokeWeight": 1.17 + } + ] + }, + { + "id": "1:47081", + "name": "Icon", + "type": "FRAME", + "x": 22, + "y": 3, + "width": 12, + "height": 12, + "variables": {"fills/0/color": "muted"}, + "children": [ + { + "id": "1:47200", + "name": "path", + "type": "VECTOR", + "x": 2, + "y": 1, + "width": 8, + "height": 10, + "strokes": [{"type": "SOLID", "color": "#9E98A6"}], + "strokeWeight": 1 + }, + { + "id": "1:47201", + "name": "path", + "type": "VECTOR", + "x": 7, + "y": 1, + "width": 3, + "height": 3, + "strokes": [{"type": "SOLID", "color": "#9E98A6"}], + "strokeWeight": 1 + } + ] + }, + { + "id": "1:47082", + "name": "Name", + "type": "TEXT", + "x": 42, + "y": 0, + "width": 103, + "height": 18, + "fills": [{"type": "SOLID", "color": "#2A0F1E"}], + "text": "banned-ips.json", + "font": ["Geist", 400, 14], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + } + ] + } + ] + }, + { + "name": "Size", + "type": "INSTANCE", + "x": 245, + "y": 1, + "width": 43, + "height": 24, + "component": "Table Cell", + "componentId": "1:824", + "fills": [{"type": "SOLID", "color": "#FFF7FB"}], + "strokes": [{"type": "SOLID", "color": "#EFC3D6"}], + "strokeWeight": 1, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [4, 12, 4, 12], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["HUG", "HUG"] + }, + "variables": {"fills/0/color": "surface/surface", "strokes/0/color": "separator/separator"}, + "texts": ["2 B"] + } + ] + }, + { + "id": "1:46854", + "name": "Row — eula.txt", + "type": "FRAME", + "x": 0, + "y": 196, + "width": 288, + "height": 26, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "SPACE_BETWEEN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "id": "1:46923", + "name": "Name", + "type": "FRAME", + "x": 0, + "y": 0, + "width": 238, + "height": 26, + "fills": [{"type": "SOLID", "color": "#FFF7FB"}], + "strokes": [{"type": "SOLID", "color": "#EFC3D6"}], + "strokeWeight": 1, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [4, 12, 4, 12], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutGrow": 1, + "variables": {"fills/0/color": "surface/surface", "strokes/0/color": "separator/separator"}, + "children": [ + { + "id": "1:46986", + "name": "Left", + "type": "FRAME", + "x": 12, + "y": 4, + "width": 91, + "height": 18, + "layout": { + "mode": "HORIZONTAL", + "gap": 8, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["HUG", "HUG"] + }, + "children": [ + { + "id": "1:47083", + "name": "icon", + "type": "FRAME", + "x": 0, + "y": 2, + "width": 14, + "height": 14, + "variables": {"fills/0/color": "muted"}, + "children": [ + { + "id": "1:47202", + "name": "path", + "type": "VECTOR", + "x": 1.75, + "y": 1.75, + "width": 10.5, + "height": 10.5, + "strokes": [{"type": "SOLID", "color": "#9E98A6"}], + "strokeWeight": 1.17 + }, + { + "id": "1:47203", + "name": "path", + "type": "VECTOR", + "x": 4.67, + "y": 5.25, + "width": 4.67, + "height": 3.21, + "strokes": [{"type": "SOLID", "color": "#9E98A6"}], + "strokeWeight": 1.17 + } + ] + }, + { + "id": "1:47084", + "name": "Icon", + "type": "FRAME", + "x": 22, + "y": 3, + "width": 12, + "height": 12, + "variables": {"fills/0/color": "muted"}, + "children": [ + { + "id": "1:47204", + "name": "path", + "type": "VECTOR", + "x": 2, + "y": 1, + "width": 8, + "height": 10, + "strokes": [{"type": "SOLID", "color": "#9E98A6"}], + "strokeWeight": 1 + }, + { + "id": "1:47205", + "name": "path", + "type": "VECTOR", + "x": 7, + "y": 1, + "width": 3, + "height": 3, + "strokes": [{"type": "SOLID", "color": "#9E98A6"}], + "strokeWeight": 1 + } + ] + }, + { + "id": "1:47085", + "name": "Name", + "type": "TEXT", + "x": 42, + "y": 0, + "width": 49, + "height": 18, + "fills": [{"type": "SOLID", "color": "#2A0F1E"}], + "text": "eula.txt", + "font": ["Geist", 400, 14], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + } + ] + } + ] + }, + { + "name": "Size", + "type": "INSTANCE", + "x": 238, + "y": 1, + "width": 50, + "height": 24, + "component": "Table Cell", + "componentId": "1:824", + "fills": [{"type": "SOLID", "color": "#FFF7FB"}], + "strokes": [{"type": "SOLID", "color": "#EFC3D6"}], + "strokeWeight": 1, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [4, 12, 4, 12], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["HUG", "HUG"] + }, + "variables": {"fills/0/color": "surface/surface", "strokes/0/color": "separator/separator"}, + "texts": ["68 B"] + } + ] + }, + { + "id": "1:46855", + "name": "Row — fabric-server-mc.1.21.4-loader…jar", + "type": "FRAME", + "x": 0, + "y": 224, + "width": 288, + "height": 26, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "SPACE_BETWEEN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "id": "1:46924", + "name": "Name", + "type": "FRAME", + "x": 0, + "y": 0, + "width": 227, + "height": 26, + "fills": [{"type": "SOLID", "color": "#FFF7FB"}], + "strokes": [{"type": "SOLID", "color": "#EFC3D6"}], + "strokeWeight": 1, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [4, 12, 4, 12], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutGrow": 1, + "variables": {"fills/0/color": "surface/surface", "strokes/0/color": "separator/separator"}, + "children": [ + { + "id": "1:46987", + "name": "Left", + "type": "FRAME", + "x": 12, + "y": 4, + "width": 255, + "height": 18, + "layout": { + "mode": "HORIZONTAL", + "gap": 8, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["HUG", "HUG"] + }, + "children": [ + { + "id": "1:47086", + "name": "icon", + "type": "FRAME", + "x": 0, + "y": 2, + "width": 14, + "height": 14, + "variables": {"fills/0/color": "muted"}, + "children": [ + { + "id": "1:47206", + "name": "path", + "type": "VECTOR", + "x": 1.75, + "y": 1.75, + "width": 10.5, + "height": 10.5, + "strokes": [{"type": "SOLID", "color": "#9E98A6"}], + "strokeWeight": 1.17 + } + ] + }, + { + "id": "1:47087", + "name": "Icon", + "type": "FRAME", + "x": 22, + "y": 3, + "width": 12, + "height": 12, + "variables": {"fills/0/color": "muted"}, + "children": [ + { + "id": "1:47207", + "name": "path", + "type": "VECTOR", + "x": 2, + "y": 1, + "width": 8, + "height": 10, + "strokes": [{"type": "SOLID", "color": "#9E98A6"}], + "strokeWeight": 1 + }, + { + "id": "1:47208", + "name": "path", + "type": "VECTOR", + "x": 7, + "y": 1, + "width": 3, + "height": 3, + "strokes": [{"type": "SOLID", "color": "#9E98A6"}], + "strokeWeight": 1 + } + ] + }, + { + "id": "1:47088", + "name": "Name", + "type": "TEXT", + "x": 42, + "y": 0, + "width": 213, + "height": 18, + "fills": [{"type": "SOLID", "color": "#2A0F1E"}], + "text": "fabric-server-mc.1.21.4-loader…jar", + "font": ["Geist", 400, 14], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + } + ] + } + ] + }, + { + "name": "Size", + "type": "INSTANCE", + "x": 227, + "y": 1, + "width": 61, + "height": 24, + "component": "Table Cell", + "componentId": "1:824", + "fills": [{"type": "SOLID", "color": "#FFF7FB"}], + "strokes": [{"type": "SOLID", "color": "#EFC3D6"}], + "strokeWeight": 1, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [4, 12, 4, 12], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["HUG", "HUG"] + }, + "variables": {"fills/0/color": "surface/surface", "strokes/0/color": "separator/separator"}, + "texts": ["175 KB"] + } + ] + }, + { + "id": "1:46856", + "name": "Row — ops.json", + "type": "FRAME", + "x": 0, + "y": 252, + "width": 288, + "height": 26, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "SPACE_BETWEEN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "id": "1:46925", + "name": "Name", + "type": "FRAME", + "x": 0, + "y": 0, + "width": 245, + "height": 26, + "fills": [{"type": "SOLID", "color": "#FFF7FB"}], + "strokes": [{"type": "SOLID", "color": "#EFC3D6"}], + "strokeWeight": 1, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [4, 12, 4, 12], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutGrow": 1, + "variables": {"fills/0/color": "surface/surface", "strokes/0/color": "separator/separator"}, + "children": [ + { + "id": "1:46988", + "name": "Left", + "type": "FRAME", + "x": 12, + "y": 4, + "width": 95, + "height": 18, + "layout": { + "mode": "HORIZONTAL", + "gap": 8, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["HUG", "HUG"] + }, + "children": [ + { + "id": "1:47089", + "name": "icon", + "type": "FRAME", + "x": 0, + "y": 2, + "width": 14, + "height": 14, + "variables": {"fills/0/color": "muted"}, + "children": [ + { + "id": "1:47209", + "name": "path", + "type": "VECTOR", + "x": 1.75, + "y": 1.75, + "width": 10.5, + "height": 10.5, + "strokes": [{"type": "SOLID", "color": "#9E98A6"}], + "strokeWeight": 1.17 + } + ] + }, + { + "id": "1:47090", + "name": "Icon", + "type": "FRAME", + "x": 22, + "y": 3, + "width": 12, + "height": 12, + "variables": {"fills/0/color": "muted"}, + "children": [ + { + "id": "1:47210", + "name": "path", + "type": "VECTOR", + "x": 2, + "y": 1, + "width": 8, + "height": 10, + "strokes": [{"type": "SOLID", "color": "#9E98A6"}], + "strokeWeight": 1 + }, + { + "id": "1:47211", + "name": "path", + "type": "VECTOR", + "x": 7, + "y": 1, + "width": 3, + "height": 3, + "strokes": [{"type": "SOLID", "color": "#9E98A6"}], + "strokeWeight": 1 + } + ] + }, + { + "id": "1:47091", + "name": "Name", + "type": "TEXT", + "x": 42, + "y": 0, + "width": 53, + "height": 18, + "fills": [{"type": "SOLID", "color": "#2A0F1E"}], + "text": "ops.json", + "font": ["Geist", 400, 14], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + } + ] + } + ] + }, + { + "name": "Size", + "type": "INSTANCE", + "x": 245, + "y": 1, + "width": 43, + "height": 24, + "component": "Table Cell", + "componentId": "1:824", + "fills": [{"type": "SOLID", "color": "#FFF7FB"}], + "strokes": [{"type": "SOLID", "color": "#EFC3D6"}], + "strokeWeight": 1, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [4, 12, 4, 12], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["HUG", "HUG"] + }, + "variables": {"fills/0/color": "surface/surface", "strokes/0/color": "separator/separator"}, + "texts": ["2 B"] + } + ] + }, + { + "id": "1:46857", + "name": "Row — server.properties", + "type": "FRAME", + "x": 0, + "y": 280, + "width": 288, + "height": 26, + "fills": [{"type": "SOLID", "color": "#FFFFFF"}], + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "SPACE_BETWEEN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"fills/0/color": "accent/soft"}, + "children": [ + { + "id": "1:46926", + "name": "Name", + "type": "FRAME", + "x": 0, + "y": 0, + "width": 230, + "height": 26, + "fills": [{"type": "SOLID", "color": "#FFF7FB"}], + "strokes": [{"type": "SOLID", "color": "#EFC3D6"}], + "strokeWeight": 1, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [4, 12, 4, 12], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutGrow": 1, + "variables": {"fills/0/color": "surface/surface", "strokes/0/color": "separator/separator"}, + "children": [ + { + "id": "1:46989", + "name": "Left", + "type": "FRAME", + "x": 12, + "y": 4, + "width": 149, + "height": 18, + "layout": { + "mode": "HORIZONTAL", + "gap": 8, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["HUG", "HUG"] + }, + "children": [ + { + "id": "1:47092", + "name": "icon", + "type": "FRAME", + "x": 0, + "y": 2, + "width": 14, + "height": 14, + "variables": {"fills/0/color": "muted"}, + "children": [ + { + "id": "1:47212", + "name": "path", + "type": "VECTOR", + "x": 1.75, + "y": 1.75, + "width": 10.5, + "height": 10.5, + "strokes": [{"type": "SOLID", "color": "#9E98A6"}], + "strokeWeight": 1.17 + }, + { + "id": "1:47213", + "name": "path", + "type": "VECTOR", + "x": 4.67, + "y": 5.25, + "width": 4.67, + "height": 3.21, + "strokes": [{"type": "SOLID", "color": "#9E98A6"}], + "strokeWeight": 1.17 + } + ] + }, + { + "id": "1:47093", + "name": "Icon", + "type": "FRAME", + "x": 22, + "y": 3, + "width": 12, + "height": 12, + "variables": {"fills/0/color": "muted"}, + "children": [ + { + "id": "1:47214", + "name": "path", + "type": "VECTOR", + "x": 2, + "y": 1, + "width": 8, + "height": 10, + "strokes": [{"type": "SOLID", "color": "#9E98A6"}], + "strokeWeight": 1 + }, + { + "id": "1:47215", + "name": "path", + "type": "VECTOR", + "x": 7, + "y": 1, + "width": 3, + "height": 3, + "strokes": [{"type": "SOLID", "color": "#9E98A6"}], + "strokeWeight": 1 + } + ] + }, + { + "id": "1:47094", + "name": "Name", + "type": "TEXT", + "x": 42, + "y": 0, + "width": 107, + "height": 18, + "fills": [{"type": "SOLID", "color": "#2A0F1E"}], + "text": "server.properties", + "font": ["Geist", 400, 14], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + } + ] + } + ] + }, + { + "name": "Size", + "type": "INSTANCE", + "x": 230, + "y": 1, + "width": 58, + "height": 24, + "component": "Table Cell", + "componentId": "1:824", + "fills": [{"type": "SOLID", "color": "#FFF7FB"}], + "strokes": [{"type": "SOLID", "color": "#EFC3D6"}], + "strokeWeight": 1, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [4, 12, 4, 12], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["HUG", "HUG"] + }, + "variables": {"fills/0/color": "surface/surface", "strokes/0/color": "separator/separator"}, + "texts": ["1.4 KB"] + } + ] + }, + { + "id": "1:46858", + "name": "Row — usercache.json", + "type": "FRAME", + "x": 0, + "y": 308, + "width": 288, + "height": 26, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "SPACE_BETWEEN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "id": "1:46927", + "name": "Name", + "type": "FRAME", + "x": 0, + "y": 0, + "width": 245, + "height": 26, + "fills": [{"type": "SOLID", "color": "#FFF7FB"}], + "strokes": [{"type": "SOLID", "color": "#EFC3D6"}], + "strokeWeight": 1, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [4, 12, 4, 12], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutGrow": 1, + "variables": {"fills/0/color": "surface/surface", "strokes/0/color": "separator/separator"}, + "children": [ + { + "id": "1:46990", + "name": "Left", + "type": "FRAME", + "x": 12, + "y": 4, + "width": 138, + "height": 18, + "layout": { + "mode": "HORIZONTAL", + "gap": 8, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["HUG", "HUG"] + }, + "children": [ + { + "id": "1:47095", + "name": "icon", + "type": "FRAME", + "x": 0, + "y": 2, + "width": 14, + "height": 14, + "variables": {"fills/0/color": "muted"}, + "children": [ + { + "id": "1:47216", + "name": "path", + "type": "VECTOR", + "x": 1.75, + "y": 1.75, + "width": 10.5, + "height": 10.5, + "strokes": [{"type": "SOLID", "color": "#9E98A6"}], + "strokeWeight": 1.17 + } + ] + }, + { + "id": "1:47096", + "name": "Icon", + "type": "FRAME", + "x": 22, + "y": 3, + "width": 12, + "height": 12, + "variables": {"fills/0/color": "muted"}, + "children": [ + { + "id": "1:47217", + "name": "path", + "type": "VECTOR", + "x": 2, + "y": 1, + "width": 8, + "height": 10, + "strokes": [{"type": "SOLID", "color": "#9E98A6"}], + "strokeWeight": 1 + }, + { + "id": "1:47218", + "name": "path", + "type": "VECTOR", + "x": 7, + "y": 1, + "width": 3, + "height": 3, + "strokes": [{"type": "SOLID", "color": "#9E98A6"}], + "strokeWeight": 1 + } + ] + }, + { + "id": "1:47097", + "name": "Name", + "type": "TEXT", + "x": 42, + "y": 0, + "width": 96, + "height": 18, + "fills": [{"type": "SOLID", "color": "#2A0F1E"}], + "text": "usercache.json", + "font": ["Geist", 400, 14], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + } + ] + } + ] + }, + { + "name": "Size", + "type": "INSTANCE", + "x": 245, + "y": 1, + "width": 43, + "height": 24, + "component": "Table Cell", + "componentId": "1:824", + "fills": [{"type": "SOLID", "color": "#FFF7FB"}], + "strokes": [{"type": "SOLID", "color": "#EFC3D6"}], + "strokeWeight": 1, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [4, 12, 4, 12], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["HUG", "HUG"] + }, + "variables": {"fills/0/color": "surface/surface", "strokes/0/color": "separator/separator"}, + "texts": ["2 B"] + } + ] + }, + { + "id": "1:46859", + "name": "Row — whitelist.json", + "type": "FRAME", + "x": 0, + "y": 336, + "width": 288, + "height": 26, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "SPACE_BETWEEN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "id": "1:46928", + "name": "Name", + "type": "FRAME", + "x": 0, + "y": 0, + "width": 245, + "height": 26, + "fills": [{"type": "SOLID", "color": "#FFF7FB"}], + "strokes": [{"type": "SOLID", "color": "#EFC3D6"}], + "strokeWeight": 1, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [4, 12, 4, 12], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutGrow": 1, + "variables": {"fills/0/color": "surface/surface", "strokes/0/color": "separator/separator"}, + "children": [ + { + "id": "1:46991", + "name": "Left", + "type": "FRAME", + "x": 12, + "y": 4, + "width": 127, + "height": 18, + "layout": { + "mode": "HORIZONTAL", + "gap": 8, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["HUG", "HUG"] + }, + "children": [ + { + "id": "1:47098", + "name": "icon", + "type": "FRAME", + "x": 0, + "y": 2, + "width": 14, + "height": 14, + "variables": {"fills/0/color": "muted"}, + "children": [ + { + "id": "1:47219", + "name": "path", + "type": "VECTOR", + "x": 1.75, + "y": 1.75, + "width": 10.5, + "height": 10.5, + "strokes": [{"type": "SOLID", "color": "#9E98A6"}], + "strokeWeight": 1.17 + } + ] + }, + { + "id": "1:47099", + "name": "Icon", + "type": "FRAME", + "x": 22, + "y": 3, + "width": 12, + "height": 12, + "variables": {"fills/0/color": "muted"}, + "children": [ + { + "id": "1:47220", + "name": "path", + "type": "VECTOR", + "x": 2, + "y": 1, + "width": 8, + "height": 10, + "strokes": [{"type": "SOLID", "color": "#9E98A6"}], + "strokeWeight": 1 + }, + { + "id": "1:47221", + "name": "path", + "type": "VECTOR", + "x": 7, + "y": 1, + "width": 3, + "height": 3, + "strokes": [{"type": "SOLID", "color": "#9E98A6"}], + "strokeWeight": 1 + } + ] + }, + { + "id": "1:47100", + "name": "Name", + "type": "TEXT", + "x": 42, + "y": 0, + "width": 85, + "height": 18, + "fills": [{"type": "SOLID", "color": "#2A0F1E"}], + "text": "whitelist.json", + "font": ["Geist", 400, 14], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + } + ] + } + ] + }, + { + "name": "Size", + "type": "INSTANCE", + "x": 245, + "y": 1, + "width": 43, + "height": 24, + "component": "Table Cell", + "componentId": "1:824", + "fills": [{"type": "SOLID", "color": "#FFF7FB"}], + "strokes": [{"type": "SOLID", "color": "#EFC3D6"}], + "strokeWeight": 1, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [4, 12, 4, 12], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["HUG", "HUG"] + }, + "variables": {"fills/0/color": "surface/surface", "strokes/0/color": "separator/separator"}, + "texts": ["2 B"] + } + ] + } + ] + } + ] + }, + { + "id": "1:46656", + "name": "Right Pane", + "type": "FRAME", + "x": 288, + "y": 0, + "width": 892, + "height": 528, + "layout": { + "mode": "VERTICAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "FIXED"] + }, + "layoutGrow": 1, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "id": "1:46751", + "name": "Editor actions", + "type": "FRAME", + "x": 0, + "y": 0, + "width": 892, + "height": 42, + "layout": { + "mode": "HORIZONTAL", + "gap": 8, + "padding": [8, 12, 8, 12], + "primary": "SPACE_BETWEEN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "id": "1:46860", + "name": "frame", + "type": "FRAME", + "x": 12, + "y": 12, + "width": 129, + "height": 18, + "layout": { + "mode": "HORIZONTAL", + "gap": 8, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["HUG", "HUG"] + }, + "children": [ + { + "id": "1:46929", + "name": "icon", + "type": "FRAME", + "x": 0, + "y": 2, + "width": 14, + "height": 14, + "variables": {"fills/0/color": "muted"}, + "children": [ + { + "id": "1:46992", + "name": "path", + "type": "VECTOR", + "x": 2.33, + "y": 1.17, + "width": 9.33, + "height": 11.67, + "strokes": [{"type": "SOLID", "color": "#9E98A6"}], + "strokeWeight": 1.17 + }, + { + "id": "1:46993", + "name": "path", + "type": "VECTOR", + "x": 8.17, + "y": 1.17, + "width": 3.5, + "height": 3.5, + "strokes": [{"type": "SOLID", "color": "#9E98A6"}], + "strokeWeight": 1.17 + } + ] + }, + { + "id": "1:46930", + "name": "text", + "type": "TEXT", + "x": 22, + "y": 0, + "width": 107, + "height": 18, + "fills": [{"type": "SOLID", "color": "#2A0F1E"}], + "text": "server.properties", + "font": ["Geist", 400, 14], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + } + ] + }, + { + "id": "1:46861", + "name": "frame", + "type": "FRAME", + "x": 673, + "y": 8, + "width": 207, + "height": 26, + "layout": { + "mode": "HORIZONTAL", + "gap": 8, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["HUG", "HUG"] + }, + "children": [ + { + "id": "1:46931", + "name": "Download", + "type": "FRAME", + "x": 0, + "y": 0, + "width": 80, + "height": 26, + "fills": [{"type": "SOLID", "color": "#F6DCE7"}], + "cornerRadius": 6, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [5, 12, 5, 12], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["HUG", "HUG"] + }, + "variables": {"fills/0/color": "default/default"}, + "children": [ + { + "id": "1:46994", + "name": "text", + "type": "TEXT", + "x": 12, + "y": 5, + "width": 56, + "height": 16, + "fills": [{"type": "SOLID", "color": "#2A0F1E"}], + "text": "Download", + "font": ["Geist", 400, 12], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + } + ] + }, + { + "id": "1:46932", + "name": "Delete", + "type": "FRAME", + "x": 88, + "y": 0, + "width": 60, + "height": 26, + "fills": [{"type": "SOLID", "color": "#F6DCE7"}], + "cornerRadius": 6, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [5, 12, 5, 12], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["HUG", "HUG"] + }, + "variables": {"fills/0/color": "default/default"}, + "children": [ + { + "id": "1:46995", + "name": "text", + "type": "TEXT", + "x": 12, + "y": 5, + "width": 36, + "height": 16, + "fills": [{"type": "SOLID", "color": "#2A0F1E"}], + "text": "Delete", + "font": ["Geist", 400, 12], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + } + ] + }, + { + "id": "1:46933", + "name": "Save", + "type": "FRAME", + "x": 156, + "y": 0, + "width": 51, + "height": 26, + "fills": [{"type": "SOLID", "color": "#F6DCE7"}], + "cornerRadius": 6, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [5, 12, 5, 12], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["HUG", "HUG"] + }, + "variables": {"fills/0/color": "default/default"}, + "children": [ + { + "id": "1:46996", + "name": "text", + "type": "TEXT", + "x": 12, + "y": 5, + "width": 27, + "height": 16, + "fills": [{"type": "SOLID", "color": "#2A0F1E"}], + "text": "Save", + "font": ["Geist", 400, 12], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + } + ] + } + ] + } + ] + }, + { + "id": "1:46752", + "name": "Monaco editor", + "type": "FRAME", + "x": 0, + "y": 42, + "width": 892, + "height": 486, + "fills": [{"type": "SOLID", "color": "#1E1E1E"}], + "layout": { + "mode": "HORIZONTAL", + "gap": 22, + "padding": [0, 28, 0, 28], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "FIXED"] + }, + "layoutGrow": 1, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "id": "1:46862", + "name": "text", + "type": "TEXT", + "x": 28, + "y": 0, + "width": 8, + "height": 120, + "fills": [{"type": "SOLID", "color": "#6E5262"}], + "text": "1\n2\n3\n4\n5\n6", + "font": ["JetBrains Mono", 400, 13], + "lineHeight": {"value": 154.99999523162842, "unit": "PERCENT"}, + "variables": {"fontFamily": "typography/font-mono", "fills/0/color": "muted"} + }, + { + "id": "1:46863", + "name": "text", + "type": "TEXT", + "x": 58, + "y": 0, + "width": 219, + "height": 120, + "fills": [{"type": "SOLID", "color": "#2A0F1E"}], + "text": "#Minecraft server properties\nmotd=Survival server\ndifficulty=normal\ngamemode=survival\nmax-players=20\nwhite-list=true", + "font": ["JetBrains Mono", 400, 13], + "lineHeight": {"value": 154.99999523162842, "unit": "PERCENT"}, + "variables": {"fontFamily": "typography/font-mono", "fills/0/color": "foreground/foreground"} + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "id": "1:46423", + "name": "Upload panel", + "type": "FRAME", + "x": 996, + "y": 626, + "width": 420, + "height": 250, + "fills": [{"type": "SOLID", "color": "#FFF7FB"}], + "strokes": [{"type": "SOLID", "color": "#EFC3D6"}], + "strokeWeight": 1, + "effects": [{"type": "DROP_SHADOW", "radius": 24, "visible": true}], + "cornerRadius": 24, + "absolute": true, + "variables": {"fills/0/color": "surface/surface", "strokes/0/color": "border/border"}, + "children": [ + { + "id": "1:46491", + "name": "cardTitle", + "type": "TEXT", + "x": 16, + "y": 16, + "width": 119, + "height": 21, + "fills": [{"type": "SOLID", "color": "#2A0F1E"}], + "text": "Uploads · 3 files", + "font": ["Geist", 500, 16], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + }, + { + "name": "Gameplane/Button/Small/Ghost", + "type": "INSTANCE", + "x": 320, + "y": 8, + "width": 84, + "height": 32, + "component": "Gameplane/Button/Small/Ghost", + "componentId": "1:1124", + "fills": [{"type": "SOLID", "color": "#00000000", "opacity": 0}], + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "CENTER", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "texts": ["Cancel all"] + }, + { + "id": "1:46492", + "name": "cardBody", + "type": "TEXT", + "x": 16, + "y": 60, + "width": 180, + "height": 18, + "fills": [{"type": "SOLID", "color": "#2A0F1E"}], + "layoutAlignSelf": "STRETCH", + "text": "world-backup-2026-11.zip", + "font": ["Geist", 400, 14], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + }, + { + "id": "1:46493", + "name": "cardBody", + "type": "TEXT", + "x": 200, + "y": 60, + "width": 128, + "height": 18, + "fills": [{"type": "SOLID", "color": "#2A0F1E"}], + "layoutAlignSelf": "STRETCH", + "text": "1.8 of 2.0 GiB · 90%", + "font": ["Geist", 400, 14], + "align": "RIGHT", + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + }, + { + "id": "1:46494", + "name": "Progress track", + "type": "RECTANGLE", + "x": 16, + "y": 84, + "width": 388, + "height": 4, + "fills": [{"type": "SOLID", "color": "#EFC3D6"}], + "variables": {"fills/0/color": "border/border"} + }, + { + "id": "1:46495", + "name": "Progress fill", + "type": "RECTANGLE", + "x": 16, + "y": 84, + "width": 349.2, + "height": 4, + "fills": [{"type": "SOLID", "color": "#DB2777"}], + "variables": {"fills/0/color": "accent/accent"} + }, + { + "name": "Gameplane/Button/Small/Ghost", + "type": "INSTANCE", + "x": 336, + "y": 53, + "width": 68, + "height": 32, + "component": "Gameplane/Button/Small/Ghost", + "componentId": "1:1124", + "fills": [{"type": "SOLID", "color": "#00000000", "opacity": 0}], + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "CENTER", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "texts": ["Cancel"] + }, + { + "id": "1:46496", + "name": "cardBody", + "type": "TEXT", + "x": 16, + "y": 108, + "width": 180, + "height": 18, + "fills": [{"type": "SOLID", "color": "#2A0F1E"}], + "layoutAlignSelf": "STRETCH", + "text": "mod-jei-19.jar", + "font": ["Geist", 400, 14], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + }, + { + "id": "1:46497", + "name": "cardBody", + "type": "TEXT", + "x": 200, + "y": 108, + "width": 128, + "height": 18, + "fills": [{"type": "SOLID", "color": "#2A0F1E"}], + "layoutAlignSelf": "STRETCH", + "text": "Done", + "font": ["Geist", 400, 14], + "align": "RIGHT", + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + }, + { + "id": "1:46498", + "name": "cardBody", + "type": "TEXT", + "x": 16, + "y": 146, + "width": 180, + "height": 18, + "fills": [{"type": "SOLID", "color": "#2A0F1E"}], + "layoutAlignSelf": "STRETCH", + "text": "server.properties", + "font": ["Geist", 400, 14], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + }, + { + "id": "1:46499", + "name": "cardBody", + "type": "TEXT", + "x": 200, + "y": 146, + "width": 128, + "height": 18, + "fills": [{"type": "SOLID", "color": "#2A0F1E"}], + "layoutAlignSelf": "STRETCH", + "text": "Waiting", + "font": ["Geist", 400, 14], + "align": "RIGHT", + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + }, + { + "id": "1:46500", + "name": "Progress track", + "type": "RECTANGLE", + "x": 16, + "y": 170, + "width": 388, + "height": 4, + "fills": [{"type": "SOLID", "color": "#EFC3D6"}], + "variables": {"fills/0/color": "border/border"} + }, + { + "name": "Gameplane/Button/Small/Ghost", + "type": "INSTANCE", + "x": 336, + "y": 139, + "width": 68, + "height": 32, + "component": "Gameplane/Button/Small/Ghost", + "componentId": "1:1124", + "fills": [{"type": "SOLID", "color": "#00000000", "opacity": 0}], + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "CENTER", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "texts": ["Cancel"] + }, + { + "id": "1:46501", + "name": "cardBody", + "type": "TEXT", + "x": 16, + "y": 194, + "width": 388, + "height": 36, + "fills": [{"type": "SOLID", "color": "#2A0F1E"}], + "layoutAlignSelf": "STRETCH", + "text": "Uploads go straight to the server volume. Cancelling removes the part written so far, and the old file stays.", + "font": ["Geist", 400, 14], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + } + ] + } + ] +} diff --git a/assets/design-export/json/1-46392.json b/assets/design-export/json/1-46392.json new file mode 100644 index 000000000..e69a11297 --- /dev/null +++ b/assets/design-export/json/1-46392.json @@ -0,0 +1,3291 @@ +{ + "file": "1-46392", + "id": "1:46392", + "name": "Screen/Server Detail — Files (Uploads with errors)", + "type": "FRAME", + "x": 5560, + "y": 32501, + "width": 1440, + "height": 900, + "fills": [{"type": "SOLID", "color": "#121114"}], + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "FIXED"] + }, + "clips": true, + "variables": {"fills/0/color": "background/background"}, + "children": [ + { + "name": "App Sidebar", + "type": "INSTANCE", + "x": 0, + "y": 0, + "width": 260, + "height": 900, + "component": "Gameplane/App Sidebar", + "componentId": "1:234", + "fills": [{"type": "SOLID", "color": "#17151A"}], + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "layout": { + "mode": "VERTICAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"fills/0/color": "surface/secondary", "strokes/0/color": "border/border"}, + "texts": [ + "gameplane", + "homelab-01", + "GENERAL", + "Dashboard", + "Servers", + "Modules", + "Backups", + "ADMIN", + "Clusters", + "Nodes", + "Users & RBAC", + "Audit log", + "System logs", + "Settings", + "AD", + "admin", + "admin" + ] + }, + { + "id": "1:46424", + "name": "Main", + "type": "FRAME", + "x": 260, + "y": 0, + "width": 1180, + "height": 900, + "fills": [{"type": "SOLID", "color": "#121114"}], + "layout": { + "mode": "VERTICAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "FIXED"] + }, + "layoutGrow": 1, + "layoutAlignSelf": "STRETCH", + "variables": {"fills/0/color": "background/background"}, + "children": [ + { + "name": "Top Bar", + "type": "INSTANCE", + "x": 0, + "y": 0, + "width": 1180, + "height": 64, + "component": "Gameplane/Top Bar", + "componentId": "1:281", + "fills": [{"type": "SOLID", "color": "#121114"}], + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 32, 0, 32], + "primary": "SPACE_BETWEEN", + "counter": "CENTER", + "sizing": ["FIXED", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"fills/0/color": "background/background", "strokes/0/color": "border/border"}, + "texts": ["gameplane", "mc-survival", "Search servers…", "AD"] + }, + { + "name": "Detail Header", + "type": "INSTANCE", + "x": 0, + "y": 64, + "width": 1180, + "height": 86, + "component": "Gameplane/Server Detail Header", + "componentId": "1:447", + "fills": [{"type": "SOLID", "color": "#121114"}], + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [16, 24, 16, 24], + "primary": "SPACE_BETWEEN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"fills/0/color": "background/background"}, + "texts": [ + "MI", + "mc-survival", + "Running", + "site: remote-lab · minecraft-java · 1.21.4-fabric · ns: gameplane-games", + "Restart", + "Stop", + "Open console" + ] + }, + { + "name": "Tabs Bar", + "type": "INSTANCE", + "x": 0, + "y": 150, + "width": 1180, + "height": 76, + "component": "Gameplane/Server Detail Tabs", + "componentId": "1:466", + "fills": [{"type": "SOLID", "color": "#121114"}], + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [18, 24, 18, 24], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"fills/0/color": "background/background", "strokes/0/color": "border/border"}, + "texts": [ + "Overview", + "Events", + "Console", + "Logs", + "Files", + "Mods", + "Modpacks", + "Players", + "Backups", + "Capture", + "Settings" + ] + }, + { + "id": "1:46502", + "name": "Body", + "type": "FRAME", + "x": 0, + "y": 226, + "width": 1180, + "height": 674, + "fills": [{"type": "SOLID", "color": "#121114"}], + "layout": { + "mode": "VERTICAL", + "gap": 12, + "padding": [4, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "FIXED"] + }, + "layoutGrow": 1, + "layoutAlignSelf": "STRETCH", + "variables": {"fills/0/color": "background/background"}, + "children": [ + { + "id": "1:46564", + "name": "Files Toolbar", + "type": "FRAME", + "x": 0, + "y": 4, + "width": 1180, + "height": 36, + "layout": { + "mode": "HORIZONTAL", + "gap": 12, + "padding": [0, 0, 0, 0], + "primary": "SPACE_BETWEEN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "id": "1:46657", + "name": "Breadcrumb", + "type": "FRAME", + "x": 0, + "y": 3, + "width": 32, + "height": 30, + "fills": [{"type": "SOLID", "color": "#1C1A20"}], + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "cornerRadius": 4, + "layout": { + "mode": "HORIZONTAL", + "gap": 4, + "padding": [6, 12, 6, 12], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["HUG", "FIXED"] + }, + "variables": {"fills/0/color": "surface/surface", "strokes/0/color": "border/border"}, + "children": [ + { + "id": "1:46753", + "name": "Path", + "type": "TEXT", + "x": 12, + "y": 7, + "width": 8, + "height": 16, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "text": "/", + "font": ["JetBrains Mono", 400, 12], + "variables": {"fontFamily": "typography/font-mono", "fills/0/color": "muted"} + } + ] + }, + { + "id": "1:46658", + "name": "Toolbar Actions", + "type": "FRAME", + "x": 830, + "y": 0, + "width": 350, + "height": 36, + "layout": { + "mode": "HORIZONTAL", + "gap": 8, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["HUG", "HUG"] + }, + "children": [ + { + "name": "Btn New File", + "type": "INSTANCE", + "x": 0, + "y": 2, + "width": 93, + "height": 32, + "component": "Button/Outline/SM", + "componentId": "1:633", + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "cornerRadius": 24, + "layout": { + "mode": "HORIZONTAL", + "gap": 5, + "padding": [8, 12, 8, 12], + "primary": "CENTER", + "counter": "CENTER", + "sizing": ["HUG", "FIXED"] + }, + "variables": { + "cornerRadius": "radius/3xl", + "paddingRight": "spacing/3", + "paddingLeft": "spacing/3", + "strokes/0/color": "border-2" + }, + "texts": ["New file"] + }, + { + "name": "Btn New Folder", + "type": "INSTANCE", + "x": 101, + "y": 2, + "width": 110, + "height": 32, + "component": "Button/Outline/SM", + "componentId": "1:633", + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "cornerRadius": 24, + "layout": { + "mode": "HORIZONTAL", + "gap": 5, + "padding": [8, 12, 8, 12], + "primary": "CENTER", + "counter": "CENTER", + "sizing": ["HUG", "FIXED"] + }, + "variables": { + "cornerRadius": "radius/3xl", + "paddingRight": "spacing/3", + "paddingLeft": "spacing/3", + "strokes/0/color": "border-2" + }, + "texts": ["New folder"] + }, + { + "name": "Btn Upload", + "type": "INSTANCE", + "x": 219, + "y": 2, + "width": 87, + "height": 32, + "component": "Button/Outline/SM", + "componentId": "1:633", + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "cornerRadius": 24, + "layout": { + "mode": "HORIZONTAL", + "gap": 5, + "padding": [8, 12, 8, 12], + "primary": "CENTER", + "counter": "CENTER", + "sizing": ["HUG", "FIXED"] + }, + "variables": { + "cornerRadius": "radius/3xl", + "paddingRight": "spacing/3", + "paddingLeft": "spacing/3", + "strokes/0/color": "border-2" + }, + "texts": ["Upload"] + }, + { + "name": "Btn Refresh", + "type": "INSTANCE", + "x": 314, + "y": 0, + "width": 36, + "height": 36, + "component": "Button/Outline/Icon/MD", + "componentId": "1:774", + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "cornerRadius": 24, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "CENTER", + "counter": "CENTER", + "sizing": ["FIXED", "FIXED"] + }, + "variables": {"cornerRadius": "radius/3xl", "strokes/0/color": "border-2"} + } + ] + } + ] + }, + { + "id": "1:46565", + "name": "Selected file actions", + "type": "FRAME", + "x": 0, + "y": 52, + "width": 1180, + "height": 32, + "layout": { + "mode": "HORIZONTAL", + "gap": 8, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "id": "1:46659", + "name": "text", + "type": "TEXT", + "x": 0, + "y": 7, + "width": 67, + "height": 18, + "fills": [{"type": "SOLID", "color": "#F5F3F7"}], + "text": "2 selected", + "font": ["Geist", 400, 14], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + }, + { + "id": "1:46660", + "name": "Download ZIP", + "type": "FRAME", + "x": 75, + "y": 0, + "width": 100, + "height": 32, + "fills": [{"type": "SOLID", "color": "#FF4FA3"}], + "cornerRadius": 6, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [5, 12, 5, 12], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["HUG", "FIXED"] + }, + "variables": {"fills/0/color": "accent/accent"}, + "children": [ + { + "id": "1:46754", + "name": "text", + "type": "TEXT", + "x": 12, + "y": 8, + "width": 76, + "height": 16, + "fills": [{"type": "SOLID", "color": "#FFFFFF"}], + "text": "Download ZIP", + "font": ["Geist", 400, 12], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "accent/foreground"} + } + ] + }, + { + "id": "1:46661", + "name": "Create ZIP", + "type": "FRAME", + "x": 183, + "y": 0, + "width": 81, + "height": 32, + "fills": [{"type": "SOLID", "color": "#FF4FA3"}], + "cornerRadius": 6, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [5, 12, 5, 12], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["HUG", "FIXED"] + }, + "variables": {"fills/0/color": "accent/accent"}, + "children": [ + { + "id": "1:46755", + "name": "text", + "type": "TEXT", + "x": 12, + "y": 8, + "width": 57, + "height": 16, + "fills": [{"type": "SOLID", "color": "#FFFFFF"}], + "text": "Create ZIP", + "font": ["Geist", 400, 12], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "accent/foreground"} + } + ] + }, + { + "id": "1:46662", + "name": "Delete selected", + "type": "FRAME", + "x": 272, + "y": 0, + "width": 110, + "height": 32, + "fills": [{"type": "SOLID", "color": "#E0304F"}], + "cornerRadius": 6, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [5, 12, 5, 12], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["HUG", "FIXED"] + }, + "variables": {"fills/0/color": "danger/danger"}, + "children": [ + { + "id": "1:46756", + "name": "text", + "type": "TEXT", + "x": 12, + "y": 8, + "width": 86, + "height": 16, + "fills": [{"type": "SOLID", "color": "#FCFCFC"}], + "text": "Delete selected", + "font": ["Geist", 400, 12], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "danger/foreground"} + } + ] + } + ] + }, + { + "id": "1:46566", + "name": "Open files", + "type": "FRAME", + "x": 0, + "y": 96, + "width": 1180, + "height": 38, + "fills": [{"type": "SOLID", "color": "#121114"}], + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "layout": { + "mode": "HORIZONTAL", + "gap": 4, + "padding": [4, 8, 4, 8], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"fills/0/color": "background/background", "strokes/0/color": "border/border"}, + "children": [ + { + "id": "1:46663", + "name": "/eula.txt", + "type": "FRAME", + "x": 8, + "y": 4, + "width": 83, + "height": 30, + "fills": [{"type": "SOLID", "color": "#121114"}], + "layout": { + "mode": "HORIZONTAL", + "gap": 6, + "padding": [7, 9, 7, 9], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["HUG", "HUG"] + }, + "variables": {"fills/0/color": "background/background"}, + "children": [ + { + "id": "1:46757", + "name": "text", + "type": "TEXT", + "x": 9, + "y": 7, + "width": 47, + "height": 16, + "fills": [{"type": "SOLID", "color": "#F5F3F7"}], + "text": "/eula.txt", + "font": ["Geist", 400, 12], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + }, + { + "id": "1:46758", + "name": "icon", + "type": "FRAME", + "x": 62, + "y": 9, + "width": 12, + "height": 12, + "variables": {"fills/0/color": "muted"}, + "children": [ + { + "id": "1:46864", + "name": "path", + "type": "VECTOR", + "x": 3, + "y": 3, + "width": 6, + "height": 6, + "strokes": [{"type": "SOLID", "color": "#9E98A6"}], + "strokeWeight": 1 + } + ] + } + ] + }, + { + "id": "1:46664", + "name": "/server.properties", + "type": "FRAME", + "x": 95, + "y": 4, + "width": 133, + "height": 30, + "fills": [{"type": "SOLID", "color": "#232128"}], + "layout": { + "mode": "HORIZONTAL", + "gap": 6, + "padding": [7, 9, 7, 9], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["HUG", "HUG"] + }, + "variables": {"fills/0/color": "default/default"}, + "children": [ + { + "id": "1:46759", + "name": "text", + "type": "TEXT", + "x": 9, + "y": 7, + "width": 97, + "height": 16, + "fills": [{"type": "SOLID", "color": "#F5F3F7"}], + "text": "/server.properties", + "font": ["Geist", 400, 12], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + }, + { + "id": "1:46760", + "name": "icon", + "type": "FRAME", + "x": 112, + "y": 9, + "width": 12, + "height": 12, + "variables": {"fills/0/color": "muted"}, + "children": [ + { + "id": "1:46865", + "name": "path", + "type": "VECTOR", + "x": 3, + "y": 3, + "width": 6, + "height": 6, + "strokes": [{"type": "SOLID", "color": "#9E98A6"}], + "strokeWeight": 1 + } + ] + } + ] + } + ] + }, + { + "id": "1:46567", + "name": "Files Panes", + "type": "FRAME", + "x": 0, + "y": 146, + "width": 1180, + "height": 528, + "fills": [{"type": "SOLID", "color": "#1C1A20"}], + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "cornerRadius": 4, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "FIXED"] + }, + "layoutGrow": 1, + "layoutAlignSelf": "STRETCH", + "clips": true, + "variables": {"fills/0/color": "surface/surface", "strokes/0/color": "border/border"}, + "children": [ + { + "id": "1:46665", + "name": "Left Pane", + "type": "FRAME", + "x": 0, + "y": 0, + "width": 288, + "height": 528, + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "layout": { + "mode": "VERTICAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"strokes/0/color": "border/border"}, + "children": [ + { + "id": "1:46761", + "name": "Path Bar", + "type": "FRAME", + "x": 0, + "y": 0, + "width": 288, + "height": 32, + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [8, 12, 8, 12], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"strokes/0/color": "border/border"}, + "children": [ + { + "id": "1:46866", + "name": "Path", + "type": "TEXT", + "x": 12, + "y": 8, + "width": 8, + "height": 16, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "text": "/", + "font": ["JetBrains Mono", 400, 12], + "variables": {"fontFamily": "typography/font-mono", "fills/0/color": "muted"} + } + ] + }, + { + "id": "1:46762", + "name": "File List", + "type": "FRAME", + "x": 0, + "y": 32, + "width": 288, + "height": 496, + "layout": { + "mode": "VERTICAL", + "gap": 2, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "FIXED"] + }, + "layoutGrow": 1, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "id": "1:46867", + "name": "Row — libraries", + "type": "FRAME", + "x": 0, + "y": 0, + "width": 288, + "height": 26, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "SPACE_BETWEEN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "id": "1:46934", + "name": "Name", + "type": "FRAME", + "x": 0, + "y": 0, + "width": 264, + "height": 26, + "fills": [{"type": "SOLID", "color": "#1C1A20"}], + "strokes": [{"type": "SOLID", "color": "#232227"}], + "strokeWeight": 1, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [4, 12, 4, 12], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutGrow": 1, + "variables": {"fills/0/color": "surface/surface", "strokes/0/color": "separator/separator"}, + "children": [ + { + "id": "1:46997", + "name": "Left", + "type": "FRAME", + "x": 12, + "y": 4, + "width": 113, + "height": 18, + "layout": { + "mode": "HORIZONTAL", + "gap": 8, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["HUG", "HUG"] + }, + "children": [ + { + "id": "1:47101", + "name": "icon", + "type": "FRAME", + "x": 0, + "y": 2, + "width": 14, + "height": 14, + "variables": {"fills/0/color": "muted"}, + "children": [ + { + "id": "1:47222", + "name": "path", + "type": "VECTOR", + "x": 1.75, + "y": 1.75, + "width": 10.5, + "height": 10.5, + "strokes": [{"type": "SOLID", "color": "#9E98A6"}], + "strokeWeight": 1.17 + } + ] + }, + { + "id": "1:47102", + "name": "icon", + "type": "FRAME", + "x": 22, + "y": 3, + "width": 12, + "height": 12, + "variables": {"fills/0/color": "muted"}, + "children": [ + { + "id": "1:47223", + "name": "path", + "type": "VECTOR", + "x": 4.5, + "y": 3, + "width": 3, + "height": 6, + "strokes": [{"type": "SOLID", "color": "#9E98A6"}], + "strokeWeight": 1 + } + ] + }, + { + "id": "1:47103", + "name": "Icon", + "type": "FRAME", + "x": 42, + "y": 3, + "width": 12, + "height": 12, + "variables": {"fills/0/color": "muted"}, + "children": [ + { + "id": "1:47224", + "name": "path", + "type": "VECTOR", + "x": 1, + "y": 1.5, + "width": 10, + "height": 8.5, + "strokes": [{"type": "SOLID", "color": "#9E98A6"}], + "strokeWeight": 1 + } + ] + }, + { + "id": "1:47104", + "name": "Name", + "type": "TEXT", + "x": 62, + "y": 0, + "width": 51, + "height": 18, + "fills": [{"type": "SOLID", "color": "#F5F3F7"}], + "text": "libraries", + "font": ["Geist", 400, 14], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + } + ] + } + ] + }, + { + "name": "Size", + "type": "INSTANCE", + "x": 264, + "y": 1, + "width": 24, + "height": 24, + "component": "Table Cell", + "componentId": "1:824", + "fills": [{"type": "SOLID", "color": "#1C1A20"}], + "strokes": [{"type": "SOLID", "color": "#232227"}], + "strokeWeight": 1, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [4, 12, 4, 12], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["HUG", "HUG"] + }, + "variables": {"fills/0/color": "surface/surface", "strokes/0/color": "separator/separator"} + } + ] + }, + { + "id": "1:46868", + "name": "Row — logs", + "type": "FRAME", + "x": 0, + "y": 28, + "width": 288, + "height": 26, + "fills": [{"type": "SOLID", "color": "#232128"}], + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "SPACE_BETWEEN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"fills/0/color": "default/default"}, + "children": [ + { + "id": "1:46935", + "name": "Name", + "type": "FRAME", + "x": 0, + "y": 0, + "width": 248, + "height": 26, + "fills": [{"type": "SOLID", "color": "#1C1A20"}], + "strokes": [{"type": "SOLID", "color": "#232227"}], + "strokeWeight": 1, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [4, 12, 4, 12], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutGrow": 1, + "variables": {"fills/0/color": "surface/surface", "strokes/0/color": "separator/separator"}, + "children": [ + { + "id": "1:46998", + "name": "Left", + "type": "FRAME", + "x": 12, + "y": 4, + "width": 89, + "height": 18, + "layout": { + "mode": "HORIZONTAL", + "gap": 8, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["HUG", "HUG"] + }, + "children": [ + { + "id": "1:47105", + "name": "icon", + "type": "FRAME", + "x": 0, + "y": 2, + "width": 14, + "height": 14, + "variables": {"fills/0/color": "muted"}, + "children": [ + { + "id": "1:47225", + "name": "path", + "type": "VECTOR", + "x": 1.75, + "y": 1.75, + "width": 10.5, + "height": 10.5, + "strokes": [{"type": "SOLID", "color": "#9E98A6"}], + "strokeWeight": 1.17 + } + ] + }, + { + "id": "1:47106", + "name": "icon", + "type": "FRAME", + "x": 22, + "y": 3, + "width": 12, + "height": 12, + "variables": {"fills/0/color": "muted"}, + "children": [ + { + "id": "1:47226", + "name": "path", + "type": "VECTOR", + "x": 3, + "y": 4.5, + "width": 6, + "height": 3, + "strokes": [{"type": "SOLID", "color": "#9E98A6"}], + "strokeWeight": 1 + } + ] + }, + { + "id": "1:47107", + "name": "Icon", + "type": "FRAME", + "x": 42, + "y": 3, + "width": 12, + "height": 12, + "variables": {"fills/0/color": "muted"}, + "children": [ + { + "id": "1:47227", + "name": "path", + "type": "VECTOR", + "x": 1, + "y": 1.5, + "width": 10, + "height": 8.5, + "strokes": [{"type": "SOLID", "color": "#9E98A6"}], + "strokeWeight": 1 + } + ] + }, + { + "id": "1:47108", + "name": "Name", + "type": "TEXT", + "x": 62, + "y": 0, + "width": 27, + "height": 18, + "fills": [{"type": "SOLID", "color": "#F5F3F7"}], + "text": "logs", + "font": ["Geist", 400, 14], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + } + ] + } + ] + }, + { + "id": "1:46936", + "name": "Folder Actions", + "type": "FRAME", + "x": 248, + "y": 1, + "width": 40, + "height": 24, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 8, 0, 8], + "primary": "MAX", + "counter": "CENTER", + "sizing": ["HUG", "HUG"] + }, + "children": [ + { + "name": "Btn Delete Folder", + "type": "INSTANCE", + "x": 8, + "y": 0, + "width": 24, + "height": 24, + "component": "Button/Ghost/Icon/SM", + "componentId": "1:835", + "cornerRadius": 6, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "CENTER", + "counter": "CENTER", + "sizing": ["FIXED", "FIXED"] + } + } + ] + } + ] + }, + { + "id": "1:46869", + "name": "Latest log in expanded logs folder", + "type": "FRAME", + "x": 0, + "y": 56, + "width": 157, + "height": 26, + "layout": { + "mode": "HORIZONTAL", + "gap": 8, + "padding": [4, 28, 4, 28], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["HUG", "HUG"] + }, + "children": [ + { + "id": "1:46937", + "name": "icon", + "type": "FRAME", + "x": 28, + "y": 6, + "width": 14, + "height": 14, + "variables": {"fills/0/color": "muted"}, + "children": [ + { + "id": "1:46999", + "name": "path", + "type": "VECTOR", + "x": 1.75, + "y": 1.75, + "width": 10.5, + "height": 10.5, + "strokes": [{"type": "SOLID", "color": "#9E98A6"}], + "strokeWeight": 1.17 + } + ] + }, + { + "id": "1:46938", + "name": "icon", + "type": "FRAME", + "x": 50, + "y": 7, + "width": 12, + "height": 12, + "variables": {"fills/0/color": "muted"}, + "children": [ + { + "id": "1:47000", + "name": "path", + "type": "VECTOR", + "x": 2, + "y": 1, + "width": 8, + "height": 10, + "strokes": [{"type": "SOLID", "color": "#9E98A6"}], + "strokeWeight": 1 + }, + { + "id": "1:47001", + "name": "path", + "type": "VECTOR", + "x": 7, + "y": 1, + "width": 3, + "height": 3, + "strokes": [{"type": "SOLID", "color": "#9E98A6"}], + "strokeWeight": 1 + } + ] + }, + { + "id": "1:46939", + "name": "text", + "type": "TEXT", + "x": 70, + "y": 4, + "width": 59, + "height": 18, + "fills": [{"type": "SOLID", "color": "#F5F3F7"}], + "text": "latest.log", + "font": ["Geist", 400, 14], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + } + ] + }, + { + "id": "1:46870", + "name": "Row — mods", + "type": "FRAME", + "x": 0, + "y": 84, + "width": 288, + "height": 26, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "SPACE_BETWEEN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "id": "1:46940", + "name": "Name", + "type": "FRAME", + "x": 0, + "y": 0, + "width": 264, + "height": 26, + "fills": [{"type": "SOLID", "color": "#1C1A20"}], + "strokes": [{"type": "SOLID", "color": "#232227"}], + "strokeWeight": 1, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [4, 12, 4, 12], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutGrow": 1, + "variables": {"fills/0/color": "surface/surface", "strokes/0/color": "separator/separator"}, + "children": [ + { + "id": "1:47002", + "name": "Left", + "type": "FRAME", + "x": 12, + "y": 4, + "width": 98, + "height": 18, + "layout": { + "mode": "HORIZONTAL", + "gap": 8, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["HUG", "HUG"] + }, + "children": [ + { + "id": "1:47109", + "name": "icon", + "type": "FRAME", + "x": 0, + "y": 2, + "width": 14, + "height": 14, + "variables": {"fills/0/color": "muted"}, + "children": [ + { + "id": "1:47228", + "name": "path", + "type": "VECTOR", + "x": 1.75, + "y": 1.75, + "width": 10.5, + "height": 10.5, + "strokes": [{"type": "SOLID", "color": "#9E98A6"}], + "strokeWeight": 1.17 + } + ] + }, + { + "id": "1:47110", + "name": "icon", + "type": "FRAME", + "x": 22, + "y": 3, + "width": 12, + "height": 12, + "variables": {"fills/0/color": "muted"}, + "children": [ + { + "id": "1:47229", + "name": "path", + "type": "VECTOR", + "x": 4.5, + "y": 3, + "width": 3, + "height": 6, + "strokes": [{"type": "SOLID", "color": "#9E98A6"}], + "strokeWeight": 1 + } + ] + }, + { + "id": "1:47111", + "name": "Icon", + "type": "FRAME", + "x": 42, + "y": 3, + "width": 12, + "height": 12, + "variables": {"fills/0/color": "muted"}, + "children": [ + { + "id": "1:47230", + "name": "path", + "type": "VECTOR", + "x": 1, + "y": 1.5, + "width": 10, + "height": 8.5, + "strokes": [{"type": "SOLID", "color": "#9E98A6"}], + "strokeWeight": 1 + } + ] + }, + { + "id": "1:47112", + "name": "Name", + "type": "TEXT", + "x": 62, + "y": 0, + "width": 36, + "height": 18, + "fills": [{"type": "SOLID", "color": "#F5F3F7"}], + "text": "mods", + "font": ["Geist", 400, 14], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + } + ] + } + ] + }, + { + "name": "Size", + "type": "INSTANCE", + "x": 264, + "y": 1, + "width": 24, + "height": 24, + "component": "Table Cell", + "componentId": "1:824", + "fills": [{"type": "SOLID", "color": "#1C1A20"}], + "strokes": [{"type": "SOLID", "color": "#232227"}], + "strokeWeight": 1, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [4, 12, 4, 12], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["HUG", "HUG"] + }, + "variables": {"fills/0/color": "surface/surface", "strokes/0/color": "separator/separator"} + } + ] + }, + { + "id": "1:46871", + "name": "Row — versions", + "type": "FRAME", + "x": 0, + "y": 112, + "width": 288, + "height": 26, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "SPACE_BETWEEN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "id": "1:46941", + "name": "Name", + "type": "FRAME", + "x": 0, + "y": 0, + "width": 264, + "height": 26, + "fills": [{"type": "SOLID", "color": "#1C1A20"}], + "strokes": [{"type": "SOLID", "color": "#232227"}], + "strokeWeight": 1, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [4, 12, 4, 12], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutGrow": 1, + "variables": {"fills/0/color": "surface/surface", "strokes/0/color": "separator/separator"}, + "children": [ + { + "id": "1:47003", + "name": "Left", + "type": "FRAME", + "x": 12, + "y": 4, + "width": 116, + "height": 18, + "layout": { + "mode": "HORIZONTAL", + "gap": 8, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["HUG", "HUG"] + }, + "children": [ + { + "id": "1:47113", + "name": "icon", + "type": "FRAME", + "x": 0, + "y": 2, + "width": 14, + "height": 14, + "variables": {"fills/0/color": "muted"}, + "children": [ + { + "id": "1:47231", + "name": "path", + "type": "VECTOR", + "x": 1.75, + "y": 1.75, + "width": 10.5, + "height": 10.5, + "strokes": [{"type": "SOLID", "color": "#9E98A6"}], + "strokeWeight": 1.17 + } + ] + }, + { + "id": "1:47114", + "name": "icon", + "type": "FRAME", + "x": 22, + "y": 3, + "width": 12, + "height": 12, + "variables": {"fills/0/color": "muted"}, + "children": [ + { + "id": "1:47232", + "name": "path", + "type": "VECTOR", + "x": 4.5, + "y": 3, + "width": 3, + "height": 6, + "strokes": [{"type": "SOLID", "color": "#9E98A6"}], + "strokeWeight": 1 + } + ] + }, + { + "id": "1:47115", + "name": "Icon", + "type": "FRAME", + "x": 42, + "y": 3, + "width": 12, + "height": 12, + "variables": {"fills/0/color": "muted"}, + "children": [ + { + "id": "1:47233", + "name": "path", + "type": "VECTOR", + "x": 1, + "y": 1.5, + "width": 10, + "height": 8.5, + "strokes": [{"type": "SOLID", "color": "#9E98A6"}], + "strokeWeight": 1 + } + ] + }, + { + "id": "1:47116", + "name": "Name", + "type": "TEXT", + "x": 62, + "y": 0, + "width": 54, + "height": 18, + "fills": [{"type": "SOLID", "color": "#F5F3F7"}], + "text": "versions", + "font": ["Geist", 400, 14], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + } + ] + } + ] + }, + { + "name": "Size", + "type": "INSTANCE", + "x": 264, + "y": 1, + "width": 24, + "height": 24, + "component": "Table Cell", + "componentId": "1:824", + "fills": [{"type": "SOLID", "color": "#1C1A20"}], + "strokes": [{"type": "SOLID", "color": "#232227"}], + "strokeWeight": 1, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [4, 12, 4, 12], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["HUG", "HUG"] + }, + "variables": {"fills/0/color": "surface/surface", "strokes/0/color": "separator/separator"} + } + ] + }, + { + "id": "1:46872", + "name": "Row — world", + "type": "FRAME", + "x": 0, + "y": 140, + "width": 288, + "height": 26, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "SPACE_BETWEEN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "id": "1:46942", + "name": "Name", + "type": "FRAME", + "x": 0, + "y": 0, + "width": 264, + "height": 26, + "fills": [{"type": "SOLID", "color": "#1C1A20"}], + "strokes": [{"type": "SOLID", "color": "#232227"}], + "strokeWeight": 1, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [4, 12, 4, 12], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutGrow": 1, + "variables": {"fills/0/color": "surface/surface", "strokes/0/color": "separator/separator"}, + "children": [ + { + "id": "1:47004", + "name": "Left", + "type": "FRAME", + "x": 12, + "y": 4, + "width": 98, + "height": 18, + "layout": { + "mode": "HORIZONTAL", + "gap": 8, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["HUG", "HUG"] + }, + "children": [ + { + "id": "1:47117", + "name": "icon", + "type": "FRAME", + "x": 0, + "y": 2, + "width": 14, + "height": 14, + "variables": {"fills/0/color": "muted"}, + "children": [ + { + "id": "1:47234", + "name": "path", + "type": "VECTOR", + "x": 1.75, + "y": 1.75, + "width": 10.5, + "height": 10.5, + "strokes": [{"type": "SOLID", "color": "#9E98A6"}], + "strokeWeight": 1.17 + } + ] + }, + { + "id": "1:47118", + "name": "icon", + "type": "FRAME", + "x": 22, + "y": 3, + "width": 12, + "height": 12, + "variables": {"fills/0/color": "muted"}, + "children": [ + { + "id": "1:47235", + "name": "path", + "type": "VECTOR", + "x": 4.5, + "y": 3, + "width": 3, + "height": 6, + "strokes": [{"type": "SOLID", "color": "#9E98A6"}], + "strokeWeight": 1 + } + ] + }, + { + "id": "1:47119", + "name": "Icon", + "type": "FRAME", + "x": 42, + "y": 3, + "width": 12, + "height": 12, + "variables": {"fills/0/color": "muted"}, + "children": [ + { + "id": "1:47236", + "name": "path", + "type": "VECTOR", + "x": 1, + "y": 1.5, + "width": 10, + "height": 8.5, + "strokes": [{"type": "SOLID", "color": "#9E98A6"}], + "strokeWeight": 1 + } + ] + }, + { + "id": "1:47120", + "name": "Name", + "type": "TEXT", + "x": 62, + "y": 0, + "width": 36, + "height": 18, + "fills": [{"type": "SOLID", "color": "#F5F3F7"}], + "text": "world", + "font": ["Geist", 400, 14], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + } + ] + } + ] + }, + { + "name": "Size", + "type": "INSTANCE", + "x": 264, + "y": 1, + "width": 24, + "height": 24, + "component": "Table Cell", + "componentId": "1:824", + "fills": [{"type": "SOLID", "color": "#1C1A20"}], + "strokes": [{"type": "SOLID", "color": "#232227"}], + "strokeWeight": 1, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [4, 12, 4, 12], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["HUG", "HUG"] + }, + "variables": {"fills/0/color": "surface/surface", "strokes/0/color": "separator/separator"} + } + ] + }, + { + "id": "1:46873", + "name": "Row — banned-ips.json", + "type": "FRAME", + "x": 0, + "y": 168, + "width": 288, + "height": 26, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "SPACE_BETWEEN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "id": "1:46943", + "name": "Name", + "type": "FRAME", + "x": 0, + "y": 0, + "width": 245, + "height": 26, + "fills": [{"type": "SOLID", "color": "#1C1A20"}], + "strokes": [{"type": "SOLID", "color": "#232227"}], + "strokeWeight": 1, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [4, 12, 4, 12], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutGrow": 1, + "variables": {"fills/0/color": "surface/surface", "strokes/0/color": "separator/separator"}, + "children": [ + { + "id": "1:47005", + "name": "Left", + "type": "FRAME", + "x": 12, + "y": 4, + "width": 145, + "height": 18, + "layout": { + "mode": "HORIZONTAL", + "gap": 8, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["HUG", "HUG"] + }, + "children": [ + { + "id": "1:47121", + "name": "icon", + "type": "FRAME", + "x": 0, + "y": 2, + "width": 14, + "height": 14, + "variables": {"fills/0/color": "muted"}, + "children": [ + { + "id": "1:47237", + "name": "path", + "type": "VECTOR", + "x": 1.75, + "y": 1.75, + "width": 10.5, + "height": 10.5, + "strokes": [{"type": "SOLID", "color": "#9E98A6"}], + "strokeWeight": 1.17 + } + ] + }, + { + "id": "1:47122", + "name": "Icon", + "type": "FRAME", + "x": 22, + "y": 3, + "width": 12, + "height": 12, + "variables": {"fills/0/color": "muted"}, + "children": [ + { + "id": "1:47238", + "name": "path", + "type": "VECTOR", + "x": 2, + "y": 1, + "width": 8, + "height": 10, + "strokes": [{"type": "SOLID", "color": "#9E98A6"}], + "strokeWeight": 1 + }, + { + "id": "1:47239", + "name": "path", + "type": "VECTOR", + "x": 7, + "y": 1, + "width": 3, + "height": 3, + "strokes": [{"type": "SOLID", "color": "#9E98A6"}], + "strokeWeight": 1 + } + ] + }, + { + "id": "1:47123", + "name": "Name", + "type": "TEXT", + "x": 42, + "y": 0, + "width": 103, + "height": 18, + "fills": [{"type": "SOLID", "color": "#F5F3F7"}], + "text": "banned-ips.json", + "font": ["Geist", 400, 14], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + } + ] + } + ] + }, + { + "name": "Size", + "type": "INSTANCE", + "x": 245, + "y": 1, + "width": 43, + "height": 24, + "component": "Table Cell", + "componentId": "1:824", + "fills": [{"type": "SOLID", "color": "#1C1A20"}], + "strokes": [{"type": "SOLID", "color": "#232227"}], + "strokeWeight": 1, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [4, 12, 4, 12], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["HUG", "HUG"] + }, + "variables": {"fills/0/color": "surface/surface", "strokes/0/color": "separator/separator"}, + "texts": ["2 B"] + } + ] + }, + { + "id": "1:46874", + "name": "Row — eula.txt", + "type": "FRAME", + "x": 0, + "y": 196, + "width": 288, + "height": 26, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "SPACE_BETWEEN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "id": "1:46944", + "name": "Name", + "type": "FRAME", + "x": 0, + "y": 0, + "width": 238, + "height": 26, + "fills": [{"type": "SOLID", "color": "#1C1A20"}], + "strokes": [{"type": "SOLID", "color": "#232227"}], + "strokeWeight": 1, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [4, 12, 4, 12], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutGrow": 1, + "variables": {"fills/0/color": "surface/surface", "strokes/0/color": "separator/separator"}, + "children": [ + { + "id": "1:47006", + "name": "Left", + "type": "FRAME", + "x": 12, + "y": 4, + "width": 91, + "height": 18, + "layout": { + "mode": "HORIZONTAL", + "gap": 8, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["HUG", "HUG"] + }, + "children": [ + { + "id": "1:47124", + "name": "icon", + "type": "FRAME", + "x": 0, + "y": 2, + "width": 14, + "height": 14, + "variables": {"fills/0/color": "muted"}, + "children": [ + { + "id": "1:47240", + "name": "path", + "type": "VECTOR", + "x": 1.75, + "y": 1.75, + "width": 10.5, + "height": 10.5, + "strokes": [{"type": "SOLID", "color": "#9E98A6"}], + "strokeWeight": 1.17 + }, + { + "id": "1:47241", + "name": "path", + "type": "VECTOR", + "x": 4.67, + "y": 5.25, + "width": 4.67, + "height": 3.21, + "strokes": [{"type": "SOLID", "color": "#9E98A6"}], + "strokeWeight": 1.17 + } + ] + }, + { + "id": "1:47125", + "name": "Icon", + "type": "FRAME", + "x": 22, + "y": 3, + "width": 12, + "height": 12, + "variables": {"fills/0/color": "muted"}, + "children": [ + { + "id": "1:47242", + "name": "path", + "type": "VECTOR", + "x": 2, + "y": 1, + "width": 8, + "height": 10, + "strokes": [{"type": "SOLID", "color": "#9E98A6"}], + "strokeWeight": 1 + }, + { + "id": "1:47243", + "name": "path", + "type": "VECTOR", + "x": 7, + "y": 1, + "width": 3, + "height": 3, + "strokes": [{"type": "SOLID", "color": "#9E98A6"}], + "strokeWeight": 1 + } + ] + }, + { + "id": "1:47126", + "name": "Name", + "type": "TEXT", + "x": 42, + "y": 0, + "width": 49, + "height": 18, + "fills": [{"type": "SOLID", "color": "#F5F3F7"}], + "text": "eula.txt", + "font": ["Geist", 400, 14], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + } + ] + } + ] + }, + { + "name": "Size", + "type": "INSTANCE", + "x": 238, + "y": 1, + "width": 50, + "height": 24, + "component": "Table Cell", + "componentId": "1:824", + "fills": [{"type": "SOLID", "color": "#1C1A20"}], + "strokes": [{"type": "SOLID", "color": "#232227"}], + "strokeWeight": 1, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [4, 12, 4, 12], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["HUG", "HUG"] + }, + "variables": {"fills/0/color": "surface/surface", "strokes/0/color": "separator/separator"}, + "texts": ["68 B"] + } + ] + }, + { + "id": "1:46875", + "name": "Row — fabric-server-mc.1.21.4-loader…jar", + "type": "FRAME", + "x": 0, + "y": 224, + "width": 288, + "height": 26, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "SPACE_BETWEEN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "id": "1:46945", + "name": "Name", + "type": "FRAME", + "x": 0, + "y": 0, + "width": 227, + "height": 26, + "fills": [{"type": "SOLID", "color": "#1C1A20"}], + "strokes": [{"type": "SOLID", "color": "#232227"}], + "strokeWeight": 1, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [4, 12, 4, 12], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutGrow": 1, + "variables": {"fills/0/color": "surface/surface", "strokes/0/color": "separator/separator"}, + "children": [ + { + "id": "1:47007", + "name": "Left", + "type": "FRAME", + "x": 12, + "y": 4, + "width": 255, + "height": 18, + "layout": { + "mode": "HORIZONTAL", + "gap": 8, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["HUG", "HUG"] + }, + "children": [ + { + "id": "1:47127", + "name": "icon", + "type": "FRAME", + "x": 0, + "y": 2, + "width": 14, + "height": 14, + "variables": {"fills/0/color": "muted"}, + "children": [ + { + "id": "1:47244", + "name": "path", + "type": "VECTOR", + "x": 1.75, + "y": 1.75, + "width": 10.5, + "height": 10.5, + "strokes": [{"type": "SOLID", "color": "#9E98A6"}], + "strokeWeight": 1.17 + } + ] + }, + { + "id": "1:47128", + "name": "Icon", + "type": "FRAME", + "x": 22, + "y": 3, + "width": 12, + "height": 12, + "variables": {"fills/0/color": "muted"}, + "children": [ + { + "id": "1:47245", + "name": "path", + "type": "VECTOR", + "x": 2, + "y": 1, + "width": 8, + "height": 10, + "strokes": [{"type": "SOLID", "color": "#9E98A6"}], + "strokeWeight": 1 + }, + { + "id": "1:47246", + "name": "path", + "type": "VECTOR", + "x": 7, + "y": 1, + "width": 3, + "height": 3, + "strokes": [{"type": "SOLID", "color": "#9E98A6"}], + "strokeWeight": 1 + } + ] + }, + { + "id": "1:47129", + "name": "Name", + "type": "TEXT", + "x": 42, + "y": 0, + "width": 213, + "height": 18, + "fills": [{"type": "SOLID", "color": "#F5F3F7"}], + "text": "fabric-server-mc.1.21.4-loader…jar", + "font": ["Geist", 400, 14], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + } + ] + } + ] + }, + { + "name": "Size", + "type": "INSTANCE", + "x": 227, + "y": 1, + "width": 61, + "height": 24, + "component": "Table Cell", + "componentId": "1:824", + "fills": [{"type": "SOLID", "color": "#1C1A20"}], + "strokes": [{"type": "SOLID", "color": "#232227"}], + "strokeWeight": 1, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [4, 12, 4, 12], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["HUG", "HUG"] + }, + "variables": {"fills/0/color": "surface/surface", "strokes/0/color": "separator/separator"}, + "texts": ["175 KB"] + } + ] + }, + { + "id": "1:46876", + "name": "Row — ops.json", + "type": "FRAME", + "x": 0, + "y": 252, + "width": 288, + "height": 26, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "SPACE_BETWEEN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "id": "1:46946", + "name": "Name", + "type": "FRAME", + "x": 0, + "y": 0, + "width": 245, + "height": 26, + "fills": [{"type": "SOLID", "color": "#1C1A20"}], + "strokes": [{"type": "SOLID", "color": "#232227"}], + "strokeWeight": 1, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [4, 12, 4, 12], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutGrow": 1, + "variables": {"fills/0/color": "surface/surface", "strokes/0/color": "separator/separator"}, + "children": [ + { + "id": "1:47008", + "name": "Left", + "type": "FRAME", + "x": 12, + "y": 4, + "width": 95, + "height": 18, + "layout": { + "mode": "HORIZONTAL", + "gap": 8, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["HUG", "HUG"] + }, + "children": [ + { + "id": "1:47130", + "name": "icon", + "type": "FRAME", + "x": 0, + "y": 2, + "width": 14, + "height": 14, + "variables": {"fills/0/color": "muted"}, + "children": [ + { + "id": "1:47247", + "name": "path", + "type": "VECTOR", + "x": 1.75, + "y": 1.75, + "width": 10.5, + "height": 10.5, + "strokes": [{"type": "SOLID", "color": "#9E98A6"}], + "strokeWeight": 1.17 + } + ] + }, + { + "id": "1:47131", + "name": "Icon", + "type": "FRAME", + "x": 22, + "y": 3, + "width": 12, + "height": 12, + "variables": {"fills/0/color": "muted"}, + "children": [ + { + "id": "1:47248", + "name": "path", + "type": "VECTOR", + "x": 2, + "y": 1, + "width": 8, + "height": 10, + "strokes": [{"type": "SOLID", "color": "#9E98A6"}], + "strokeWeight": 1 + }, + { + "id": "1:47249", + "name": "path", + "type": "VECTOR", + "x": 7, + "y": 1, + "width": 3, + "height": 3, + "strokes": [{"type": "SOLID", "color": "#9E98A6"}], + "strokeWeight": 1 + } + ] + }, + { + "id": "1:47132", + "name": "Name", + "type": "TEXT", + "x": 42, + "y": 0, + "width": 53, + "height": 18, + "fills": [{"type": "SOLID", "color": "#F5F3F7"}], + "text": "ops.json", + "font": ["Geist", 400, 14], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + } + ] + } + ] + }, + { + "name": "Size", + "type": "INSTANCE", + "x": 245, + "y": 1, + "width": 43, + "height": 24, + "component": "Table Cell", + "componentId": "1:824", + "fills": [{"type": "SOLID", "color": "#1C1A20"}], + "strokes": [{"type": "SOLID", "color": "#232227"}], + "strokeWeight": 1, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [4, 12, 4, 12], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["HUG", "HUG"] + }, + "variables": {"fills/0/color": "surface/surface", "strokes/0/color": "separator/separator"}, + "texts": ["2 B"] + } + ] + }, + { + "id": "1:46877", + "name": "Row — server.properties", + "type": "FRAME", + "x": 0, + "y": 280, + "width": 288, + "height": 26, + "fills": [{"type": "SOLID", "color": "#2C1926"}], + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "SPACE_BETWEEN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"fills/0/color": "accent/soft"}, + "children": [ + { + "id": "1:46947", + "name": "Name", + "type": "FRAME", + "x": 0, + "y": 0, + "width": 230, + "height": 26, + "fills": [{"type": "SOLID", "color": "#1C1A20"}], + "strokes": [{"type": "SOLID", "color": "#232227"}], + "strokeWeight": 1, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [4, 12, 4, 12], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutGrow": 1, + "variables": {"fills/0/color": "surface/surface", "strokes/0/color": "separator/separator"}, + "children": [ + { + "id": "1:47009", + "name": "Left", + "type": "FRAME", + "x": 12, + "y": 4, + "width": 149, + "height": 18, + "layout": { + "mode": "HORIZONTAL", + "gap": 8, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["HUG", "HUG"] + }, + "children": [ + { + "id": "1:47133", + "name": "icon", + "type": "FRAME", + "x": 0, + "y": 2, + "width": 14, + "height": 14, + "variables": {"fills/0/color": "muted"}, + "children": [ + { + "id": "1:47250", + "name": "path", + "type": "VECTOR", + "x": 1.75, + "y": 1.75, + "width": 10.5, + "height": 10.5, + "strokes": [{"type": "SOLID", "color": "#9E98A6"}], + "strokeWeight": 1.17 + }, + { + "id": "1:47251", + "name": "path", + "type": "VECTOR", + "x": 4.67, + "y": 5.25, + "width": 4.67, + "height": 3.21, + "strokes": [{"type": "SOLID", "color": "#9E98A6"}], + "strokeWeight": 1.17 + } + ] + }, + { + "id": "1:47134", + "name": "Icon", + "type": "FRAME", + "x": 22, + "y": 3, + "width": 12, + "height": 12, + "variables": {"fills/0/color": "muted"}, + "children": [ + { + "id": "1:47252", + "name": "path", + "type": "VECTOR", + "x": 2, + "y": 1, + "width": 8, + "height": 10, + "strokes": [{"type": "SOLID", "color": "#9E98A6"}], + "strokeWeight": 1 + }, + { + "id": "1:47253", + "name": "path", + "type": "VECTOR", + "x": 7, + "y": 1, + "width": 3, + "height": 3, + "strokes": [{"type": "SOLID", "color": "#9E98A6"}], + "strokeWeight": 1 + } + ] + }, + { + "id": "1:47135", + "name": "Name", + "type": "TEXT", + "x": 42, + "y": 0, + "width": 107, + "height": 18, + "fills": [{"type": "SOLID", "color": "#F5F3F7"}], + "text": "server.properties", + "font": ["Geist", 400, 14], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + } + ] + } + ] + }, + { + "name": "Size", + "type": "INSTANCE", + "x": 230, + "y": 1, + "width": 58, + "height": 24, + "component": "Table Cell", + "componentId": "1:824", + "fills": [{"type": "SOLID", "color": "#1C1A20"}], + "strokes": [{"type": "SOLID", "color": "#232227"}], + "strokeWeight": 1, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [4, 12, 4, 12], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["HUG", "HUG"] + }, + "variables": {"fills/0/color": "surface/surface", "strokes/0/color": "separator/separator"}, + "texts": ["1.4 KB"] + } + ] + }, + { + "id": "1:46878", + "name": "Row — usercache.json", + "type": "FRAME", + "x": 0, + "y": 308, + "width": 288, + "height": 26, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "SPACE_BETWEEN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "id": "1:46948", + "name": "Name", + "type": "FRAME", + "x": 0, + "y": 0, + "width": 245, + "height": 26, + "fills": [{"type": "SOLID", "color": "#1C1A20"}], + "strokes": [{"type": "SOLID", "color": "#232227"}], + "strokeWeight": 1, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [4, 12, 4, 12], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutGrow": 1, + "variables": {"fills/0/color": "surface/surface", "strokes/0/color": "separator/separator"}, + "children": [ + { + "id": "1:47010", + "name": "Left", + "type": "FRAME", + "x": 12, + "y": 4, + "width": 138, + "height": 18, + "layout": { + "mode": "HORIZONTAL", + "gap": 8, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["HUG", "HUG"] + }, + "children": [ + { + "id": "1:47136", + "name": "icon", + "type": "FRAME", + "x": 0, + "y": 2, + "width": 14, + "height": 14, + "variables": {"fills/0/color": "muted"}, + "children": [ + { + "id": "1:47254", + "name": "path", + "type": "VECTOR", + "x": 1.75, + "y": 1.75, + "width": 10.5, + "height": 10.5, + "strokes": [{"type": "SOLID", "color": "#9E98A6"}], + "strokeWeight": 1.17 + } + ] + }, + { + "id": "1:47137", + "name": "Icon", + "type": "FRAME", + "x": 22, + "y": 3, + "width": 12, + "height": 12, + "variables": {"fills/0/color": "muted"}, + "children": [ + { + "id": "1:47255", + "name": "path", + "type": "VECTOR", + "x": 2, + "y": 1, + "width": 8, + "height": 10, + "strokes": [{"type": "SOLID", "color": "#9E98A6"}], + "strokeWeight": 1 + }, + { + "id": "1:47256", + "name": "path", + "type": "VECTOR", + "x": 7, + "y": 1, + "width": 3, + "height": 3, + "strokes": [{"type": "SOLID", "color": "#9E98A6"}], + "strokeWeight": 1 + } + ] + }, + { + "id": "1:47138", + "name": "Name", + "type": "TEXT", + "x": 42, + "y": 0, + "width": 96, + "height": 18, + "fills": [{"type": "SOLID", "color": "#F5F3F7"}], + "text": "usercache.json", + "font": ["Geist", 400, 14], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + } + ] + } + ] + }, + { + "name": "Size", + "type": "INSTANCE", + "x": 245, + "y": 1, + "width": 43, + "height": 24, + "component": "Table Cell", + "componentId": "1:824", + "fills": [{"type": "SOLID", "color": "#1C1A20"}], + "strokes": [{"type": "SOLID", "color": "#232227"}], + "strokeWeight": 1, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [4, 12, 4, 12], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["HUG", "HUG"] + }, + "variables": {"fills/0/color": "surface/surface", "strokes/0/color": "separator/separator"}, + "texts": ["2 B"] + } + ] + }, + { + "id": "1:46879", + "name": "Row — whitelist.json", + "type": "FRAME", + "x": 0, + "y": 336, + "width": 288, + "height": 26, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "SPACE_BETWEEN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "id": "1:46949", + "name": "Name", + "type": "FRAME", + "x": 0, + "y": 0, + "width": 245, + "height": 26, + "fills": [{"type": "SOLID", "color": "#1C1A20"}], + "strokes": [{"type": "SOLID", "color": "#232227"}], + "strokeWeight": 1, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [4, 12, 4, 12], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutGrow": 1, + "variables": {"fills/0/color": "surface/surface", "strokes/0/color": "separator/separator"}, + "children": [ + { + "id": "1:47011", + "name": "Left", + "type": "FRAME", + "x": 12, + "y": 4, + "width": 127, + "height": 18, + "layout": { + "mode": "HORIZONTAL", + "gap": 8, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["HUG", "HUG"] + }, + "children": [ + { + "id": "1:47139", + "name": "icon", + "type": "FRAME", + "x": 0, + "y": 2, + "width": 14, + "height": 14, + "variables": {"fills/0/color": "muted"}, + "children": [ + { + "id": "1:47257", + "name": "path", + "type": "VECTOR", + "x": 1.75, + "y": 1.75, + "width": 10.5, + "height": 10.5, + "strokes": [{"type": "SOLID", "color": "#9E98A6"}], + "strokeWeight": 1.17 + } + ] + }, + { + "id": "1:47140", + "name": "Icon", + "type": "FRAME", + "x": 22, + "y": 3, + "width": 12, + "height": 12, + "variables": {"fills/0/color": "muted"}, + "children": [ + { + "id": "1:47258", + "name": "path", + "type": "VECTOR", + "x": 2, + "y": 1, + "width": 8, + "height": 10, + "strokes": [{"type": "SOLID", "color": "#9E98A6"}], + "strokeWeight": 1 + }, + { + "id": "1:47259", + "name": "path", + "type": "VECTOR", + "x": 7, + "y": 1, + "width": 3, + "height": 3, + "strokes": [{"type": "SOLID", "color": "#9E98A6"}], + "strokeWeight": 1 + } + ] + }, + { + "id": "1:47141", + "name": "Name", + "type": "TEXT", + "x": 42, + "y": 0, + "width": 85, + "height": 18, + "fills": [{"type": "SOLID", "color": "#F5F3F7"}], + "text": "whitelist.json", + "font": ["Geist", 400, 14], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + } + ] + } + ] + }, + { + "name": "Size", + "type": "INSTANCE", + "x": 245, + "y": 1, + "width": 43, + "height": 24, + "component": "Table Cell", + "componentId": "1:824", + "fills": [{"type": "SOLID", "color": "#1C1A20"}], + "strokes": [{"type": "SOLID", "color": "#232227"}], + "strokeWeight": 1, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [4, 12, 4, 12], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["HUG", "HUG"] + }, + "variables": {"fills/0/color": "surface/surface", "strokes/0/color": "separator/separator"}, + "texts": ["2 B"] + } + ] + } + ] + } + ] + }, + { + "id": "1:46666", + "name": "Right Pane", + "type": "FRAME", + "x": 288, + "y": 0, + "width": 892, + "height": 528, + "layout": { + "mode": "VERTICAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "FIXED"] + }, + "layoutGrow": 1, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "id": "1:46763", + "name": "Editor actions", + "type": "FRAME", + "x": 0, + "y": 0, + "width": 892, + "height": 42, + "layout": { + "mode": "HORIZONTAL", + "gap": 8, + "padding": [8, 12, 8, 12], + "primary": "SPACE_BETWEEN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "id": "1:46880", + "name": "frame", + "type": "FRAME", + "x": 12, + "y": 12, + "width": 129, + "height": 18, + "layout": { + "mode": "HORIZONTAL", + "gap": 8, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["HUG", "HUG"] + }, + "children": [ + { + "id": "1:46950", + "name": "icon", + "type": "FRAME", + "x": 0, + "y": 2, + "width": 14, + "height": 14, + "variables": {"fills/0/color": "muted"}, + "children": [ + { + "id": "1:47012", + "name": "path", + "type": "VECTOR", + "x": 2.33, + "y": 1.17, + "width": 9.33, + "height": 11.67, + "strokes": [{"type": "SOLID", "color": "#9E98A6"}], + "strokeWeight": 1.17 + }, + { + "id": "1:47013", + "name": "path", + "type": "VECTOR", + "x": 8.17, + "y": 1.17, + "width": 3.5, + "height": 3.5, + "strokes": [{"type": "SOLID", "color": "#9E98A6"}], + "strokeWeight": 1.17 + } + ] + }, + { + "id": "1:46951", + "name": "text", + "type": "TEXT", + "x": 22, + "y": 0, + "width": 107, + "height": 18, + "fills": [{"type": "SOLID", "color": "#F5F3F7"}], + "text": "server.properties", + "font": ["Geist", 400, 14], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + } + ] + }, + { + "id": "1:46881", + "name": "frame", + "type": "FRAME", + "x": 673, + "y": 8, + "width": 207, + "height": 26, + "layout": { + "mode": "HORIZONTAL", + "gap": 8, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["HUG", "HUG"] + }, + "children": [ + { + "id": "1:46952", + "name": "Download", + "type": "FRAME", + "x": 0, + "y": 0, + "width": 80, + "height": 26, + "fills": [{"type": "SOLID", "color": "#232128"}], + "cornerRadius": 6, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [5, 12, 5, 12], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["HUG", "HUG"] + }, + "variables": {"fills/0/color": "default/default"}, + "children": [ + { + "id": "1:47014", + "name": "text", + "type": "TEXT", + "x": 12, + "y": 5, + "width": 56, + "height": 16, + "fills": [{"type": "SOLID", "color": "#F5F3F7"}], + "text": "Download", + "font": ["Geist", 400, 12], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + } + ] + }, + { + "id": "1:46953", + "name": "Delete", + "type": "FRAME", + "x": 88, + "y": 0, + "width": 60, + "height": 26, + "fills": [{"type": "SOLID", "color": "#232128"}], + "cornerRadius": 6, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [5, 12, 5, 12], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["HUG", "HUG"] + }, + "variables": {"fills/0/color": "default/default"}, + "children": [ + { + "id": "1:47015", + "name": "text", + "type": "TEXT", + "x": 12, + "y": 5, + "width": 36, + "height": 16, + "fills": [{"type": "SOLID", "color": "#F5F3F7"}], + "text": "Delete", + "font": ["Geist", 400, 12], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + } + ] + }, + { + "id": "1:46954", + "name": "Save", + "type": "FRAME", + "x": 156, + "y": 0, + "width": 51, + "height": 26, + "fills": [{"type": "SOLID", "color": "#232128"}], + "cornerRadius": 6, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [5, 12, 5, 12], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["HUG", "HUG"] + }, + "variables": {"fills/0/color": "default/default"}, + "children": [ + { + "id": "1:47016", + "name": "text", + "type": "TEXT", + "x": 12, + "y": 5, + "width": 27, + "height": 16, + "fills": [{"type": "SOLID", "color": "#F5F3F7"}], + "text": "Save", + "font": ["Geist", 400, 12], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + } + ] + } + ] + } + ] + }, + { + "id": "1:46764", + "name": "Monaco editor", + "type": "FRAME", + "x": 0, + "y": 42, + "width": 892, + "height": 486, + "fills": [{"type": "SOLID", "color": "#1E1E1E"}], + "layout": { + "mode": "HORIZONTAL", + "gap": 22, + "padding": [0, 28, 0, 28], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "FIXED"] + }, + "layoutGrow": 1, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "id": "1:46882", + "name": "text", + "type": "TEXT", + "x": 28, + "y": 0, + "width": 8, + "height": 120, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "text": "1\n2\n3\n4\n5\n6", + "font": ["JetBrains Mono", 400, 13], + "lineHeight": {"value": 154.99999523162842, "unit": "PERCENT"}, + "variables": {"fontFamily": "typography/font-mono", "fills/0/color": "muted"} + }, + { + "id": "1:46883", + "name": "text", + "type": "TEXT", + "x": 58, + "y": 0, + "width": 219, + "height": 120, + "fills": [{"type": "SOLID", "color": "#F5F3F7"}], + "text": "#Minecraft server properties\nmotd=Survival server\ndifficulty=normal\ngamemode=survival\nmax-players=20\nwhite-list=true", + "font": ["JetBrains Mono", 400, 13], + "lineHeight": {"value": 154.99999523162842, "unit": "PERCENT"}, + "variables": {"fontFamily": "typography/font-mono", "fills/0/color": "foreground/foreground"} + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "id": "1:46425", + "name": "Upload panel (errors)", + "type": "FRAME", + "x": 996, + "y": 596, + "width": 420, + "height": 280, + "fills": [{"type": "SOLID", "color": "#1C1A20"}], + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "effects": [{"type": "DROP_SHADOW", "radius": 24, "visible": true}], + "cornerRadius": 24, + "absolute": true, + "variables": {"fills/0/color": "surface/surface", "strokes/0/color": "border/border"}, + "children": [ + { + "id": "1:46503", + "name": "cardTitle", + "type": "TEXT", + "x": 16, + "y": 16, + "width": 129, + "height": 21, + "fills": [{"type": "SOLID", "color": "#F5F3F7"}], + "text": "Uploads · 3 failed", + "font": ["Geist", 500, 16], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + }, + { + "id": "1:46504", + "name": "cardBody", + "type": "TEXT", + "x": 16, + "y": 60, + "width": 180, + "height": 18, + "fills": [{"type": "SOLID", "color": "#F5F3F7"}], + "layoutAlignSelf": "STRETCH", + "text": "fabric-api.jar", + "font": ["Geist", 400, 14], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + }, + { + "id": "1:46505", + "name": "cardBody", + "type": "TEXT", + "x": 200, + "y": 60, + "width": 128, + "height": 18, + "fills": [{"type": "SOLID", "color": "#F5F3F7"}], + "layoutAlignSelf": "STRETCH", + "text": "Failed at 64%", + "font": ["Geist", 400, 14], + "align": "RIGHT", + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + }, + { + "id": "1:46506", + "name": "Progress track", + "type": "RECTANGLE", + "x": 16, + "y": 84, + "width": 388, + "height": 4, + "fills": [{"type": "SOLID", "color": "#2C2932"}], + "variables": {"fills/0/color": "border/border"} + }, + { + "id": "1:46507", + "name": "Progress fill", + "type": "RECTANGLE", + "x": 16, + "y": 84, + "width": 248.32, + "height": 4, + "fills": [{"type": "SOLID", "color": "#FF4FA3"}], + "variables": {"fills/0/color": "accent/accent"} + }, + { + "name": "Gameplane/Button/Small/Ghost", + "type": "INSTANCE", + "x": 336, + "y": 53, + "width": 68, + "height": 32, + "component": "Gameplane/Button/Small/Ghost", + "componentId": "1:1124", + "fills": [{"type": "SOLID", "color": "#00000000", "opacity": 0}], + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "CENTER", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "texts": ["Retry"] + }, + { + "name": "Gameplane/Error Banner", + "type": "INSTANCE", + "x": 16, + "y": 100, + "width": 388, + "height": 44, + "component": "Gameplane/Error Banner", + "componentId": "1:4577", + "fills": [{"type": "SOLID", "color": "#1C1A20"}], + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "cornerRadius": 6, + "layout": { + "mode": "HORIZONTAL", + "gap": 8, + "padding": [12, 12, 12, 12], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "FIXED"] + }, + "variables": { + "cornerRadius": "radius/md", + "fills/0/color": "surface/surface", + "strokes/0/color": "border/border" + }, + "texts": ["Connection to the server was lost. The old file is unchanged. Retry to upload again."] + }, + { + "name": "Gameplane/Error Banner", + "type": "INSTANCE", + "x": 16, + "y": 158, + "width": 388, + "height": 44, + "component": "Gameplane/Error Banner", + "componentId": "1:4577", + "fills": [{"type": "SOLID", "color": "#1C1A20"}], + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "cornerRadius": 6, + "layout": { + "mode": "HORIZONTAL", + "gap": 8, + "padding": [12, 12, 12, 12], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "FIXED"] + }, + "variables": { + "cornerRadius": "radius/md", + "fills/0/color": "surface/surface", + "strokes/0/color": "border/border" + }, + "texts": ["Not uploaded: world-2026.zip is 24.0 GiB. The limit is 20 GiB (files.maxUploadSize)."] + }, + { + "name": "Gameplane/Error Banner", + "type": "INSTANCE", + "x": 16, + "y": 216, + "width": 388, + "height": 44, + "component": "Gameplane/Error Banner", + "componentId": "1:4577", + "fills": [{"type": "SOLID", "color": "#1C1A20"}], + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "cornerRadius": 6, + "layout": { + "mode": "HORIZONTAL", + "gap": 8, + "padding": [12, 12, 12, 12], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "FIXED"] + }, + "variables": { + "cornerRadius": "radius/md", + "fills/0/color": "surface/surface", + "strokes/0/color": "border/border" + }, + "texts": ["Not uploaded: backup.tar needs 6.0 GiB, but the volume has 2.1 GiB free. Nothing was written."] + } + ] + } + ] +} diff --git a/assets/design-export/json/1-46393.json b/assets/design-export/json/1-46393.json new file mode 100644 index 000000000..b686b70cf --- /dev/null +++ b/assets/design-export/json/1-46393.json @@ -0,0 +1,498 @@ +{ + "file": "1-46393", + "id": "1:46393", + "name": "Screen/Server Detail — Files (Starting)", + "type": "FRAME", + "x": 7200, + "y": 32501, + "width": 1440, + "height": 900, + "fills": [{"type": "SOLID", "color": "#121114"}], + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "FIXED"] + }, + "clips": true, + "variables": {"fills/0/color": "background/background"}, + "children": [ + { + "name": "App Sidebar", + "type": "INSTANCE", + "x": 0, + "y": 0, + "width": 260, + "height": 900, + "component": "Gameplane/App Sidebar", + "componentId": "1:234", + "fills": [{"type": "SOLID", "color": "#17151A"}], + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "layout": { + "mode": "VERTICAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"fills/0/color": "surface/secondary", "strokes/0/color": "border/border"}, + "texts": [ + "gameplane", + "homelab-01", + "GENERAL", + "Dashboard", + "Servers", + "Modules", + "Backups", + "ADMIN", + "Clusters", + "Nodes", + "Users & RBAC", + "Audit log", + "System logs", + "Settings", + "AD", + "admin", + "admin" + ] + }, + { + "id": "1:46426", + "name": "Main", + "type": "FRAME", + "x": 260, + "y": 0, + "width": 1180, + "height": 900, + "fills": [{"type": "SOLID", "color": "#121114"}], + "layout": { + "mode": "VERTICAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "FIXED"] + }, + "layoutGrow": 1, + "layoutAlignSelf": "STRETCH", + "variables": {"fills/0/color": "background/background"}, + "children": [ + { + "name": "Top Bar", + "type": "INSTANCE", + "x": 0, + "y": 0, + "width": 1180, + "height": 64, + "component": "Gameplane/Top Bar", + "componentId": "1:281", + "fills": [{"type": "SOLID", "color": "#121114"}], + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 32, 0, 32], + "primary": "SPACE_BETWEEN", + "counter": "CENTER", + "sizing": ["FIXED", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"fills/0/color": "background/background", "strokes/0/color": "border/border"}, + "texts": ["gameplane", "mc-survival", "Search servers…", "AD"] + }, + { + "name": "Detail Header", + "type": "INSTANCE", + "x": 0, + "y": 64, + "width": 1180, + "height": 86, + "component": "Gameplane/Server Detail Header", + "componentId": "1:447", + "fills": [{"type": "SOLID", "color": "#121114"}], + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [16, 24, 16, 24], + "primary": "SPACE_BETWEEN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"fills/0/color": "background/background"}, + "texts": [ + "MI", + "mc-survival", + "Stopped", + "site: remote-lab · minecraft-java · 1.21.4-fabric · ns: gameplane-games", + "Restart", + "Start", + "Open console" + ] + }, + { + "name": "Tabs Bar", + "type": "INSTANCE", + "x": 0, + "y": 150, + "width": 1180, + "height": 76, + "component": "Gameplane/Server Detail Tabs", + "componentId": "1:466", + "fills": [{"type": "SOLID", "color": "#121114"}], + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [18, 24, 18, 24], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"fills/0/color": "background/background", "strokes/0/color": "border/border"}, + "texts": [ + "Overview", + "Events", + "Console", + "Logs", + "Files", + "Mods", + "Modpacks", + "Players", + "Backups", + "Capture", + "Settings" + ] + }, + { + "id": "1:46508", + "name": "Body", + "type": "FRAME", + "x": 0, + "y": 226, + "width": 1180, + "height": 674, + "fills": [{"type": "SOLID", "color": "#121114"}], + "layout": { + "mode": "VERTICAL", + "gap": 12, + "padding": [4, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "FIXED"] + }, + "layoutGrow": 1, + "layoutAlignSelf": "STRETCH", + "variables": {"fills/0/color": "background/background"}, + "children": [ + { + "id": "1:46568", + "name": "Files Toolbar", + "type": "FRAME", + "x": 0, + "y": 4, + "width": 1180, + "height": 36, + "layout": { + "mode": "HORIZONTAL", + "gap": 12, + "padding": [0, 0, 0, 0], + "primary": "SPACE_BETWEEN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "id": "1:46667", + "name": "Breadcrumb", + "type": "FRAME", + "x": 0, + "y": 3, + "width": 32, + "height": 30, + "fills": [{"type": "SOLID", "color": "#1C1A20"}], + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "cornerRadius": 4, + "layout": { + "mode": "HORIZONTAL", + "gap": 4, + "padding": [6, 12, 6, 12], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["HUG", "FIXED"] + }, + "variables": {"fills/0/color": "surface/surface", "strokes/0/color": "border/border"}, + "children": [ + { + "id": "1:46765", + "name": "Path", + "type": "TEXT", + "x": 12, + "y": 7, + "width": 8, + "height": 16, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "text": "/", + "font": ["JetBrains Mono", 400, 12], + "variables": {"fontFamily": "typography/font-mono", "fills/0/color": "muted"} + } + ] + }, + { + "id": "1:46668", + "name": "Toolbar Actions", + "type": "FRAME", + "x": 830, + "y": 0, + "width": 350, + "height": 36, + "layout": { + "mode": "HORIZONTAL", + "gap": 8, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["HUG", "HUG"] + }, + "children": [ + { + "name": "Btn New File", + "type": "INSTANCE", + "x": 0, + "y": 2, + "width": 93, + "height": 32, + "opacity": 0.45, + "component": "Button/Outline/SM", + "componentId": "1:633", + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "cornerRadius": 24, + "layout": { + "mode": "HORIZONTAL", + "gap": 5, + "padding": [8, 12, 8, 12], + "primary": "CENTER", + "counter": "CENTER", + "sizing": ["HUG", "FIXED"] + }, + "variables": { + "cornerRadius": "radius/3xl", + "paddingRight": "spacing/3", + "paddingLeft": "spacing/3", + "strokes/0/color": "border-2" + }, + "texts": ["New file"] + }, + { + "name": "Btn New Folder", + "type": "INSTANCE", + "x": 101, + "y": 2, + "width": 110, + "height": 32, + "opacity": 0.45, + "component": "Button/Outline/SM", + "componentId": "1:633", + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "cornerRadius": 24, + "layout": { + "mode": "HORIZONTAL", + "gap": 5, + "padding": [8, 12, 8, 12], + "primary": "CENTER", + "counter": "CENTER", + "sizing": ["HUG", "FIXED"] + }, + "variables": { + "cornerRadius": "radius/3xl", + "paddingRight": "spacing/3", + "paddingLeft": "spacing/3", + "strokes/0/color": "border-2" + }, + "texts": ["New folder"] + }, + { + "name": "Btn Upload", + "type": "INSTANCE", + "x": 219, + "y": 2, + "width": 87, + "height": 32, + "opacity": 0.45, + "component": "Button/Outline/SM", + "componentId": "1:633", + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "cornerRadius": 24, + "layout": { + "mode": "HORIZONTAL", + "gap": 5, + "padding": [8, 12, 8, 12], + "primary": "CENTER", + "counter": "CENTER", + "sizing": ["HUG", "FIXED"] + }, + "variables": { + "cornerRadius": "radius/3xl", + "paddingRight": "spacing/3", + "paddingLeft": "spacing/3", + "strokes/0/color": "border-2" + }, + "texts": ["Upload"] + }, + { + "name": "Btn Refresh", + "type": "INSTANCE", + "x": 314, + "y": 0, + "width": 36, + "height": 36, + "opacity": 0.45, + "component": "Button/Outline/Icon/MD", + "componentId": "1:774", + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "cornerRadius": 24, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "CENTER", + "counter": "CENTER", + "sizing": ["FIXED", "FIXED"] + }, + "variables": {"cornerRadius": "radius/3xl", "strokes/0/color": "border-2"} + } + ] + } + ] + }, + { + "id": "1:46569", + "name": "Files starting", + "type": "FRAME", + "x": 0, + "y": 52, + "width": 1180, + "height": 528, + "children": [ + { + "id": "1:46669", + "name": "cardTitle", + "type": "TEXT", + "x": 545, + "y": 110, + "width": 126, + "height": 21, + "fills": [{"type": "SOLID", "color": "#F5F3F7"}], + "text": "Files are starting", + "font": ["Geist", 500, 16], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + }, + { + "id": "1:46670", + "name": "cardBody", + "type": "TEXT", + "x": 300, + "y": 152, + "width": 580, + "height": 36, + "fills": [{"type": "SOLID", "color": "#F5F3F7"}], + "layoutAlignSelf": "STRETCH", + "text": "mc-survival is stopped. Its files open in a short-lived file-only pod so you can edit them. The game does not start, and players cannot reach the pod.", + "font": ["Geist", 400, 14], + "align": "CENTER", + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + }, + { + "id": "1:46671", + "name": "cardBody", + "type": "TEXT", + "x": 330, + "y": 272, + "width": 520, + "height": 18, + "fills": [{"type": "SOLID", "color": "#F5F3F7"}], + "layoutAlignSelf": "STRETCH", + "text": "Usually ready in a few seconds. The list appears as soon as the pod is ready.", + "font": ["Geist", 400, 14], + "align": "CENTER", + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + }, + { + "name": "Spinner", + "type": "INSTANCE", + "x": 509, + "y": 108, + "width": 24, + "height": 24, + "component": "Spinner", + "componentId": "1:5493", + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "CENTER", + "counter": "CENTER", + "sizing": ["FIXED", "FIXED"] + } + }, + { + "id": "1:46672", + "name": "Progress track", + "type": "RECTANGLE", + "x": 410, + "y": 216, + "width": 360, + "height": 4, + "fills": [{"type": "SOLID", "color": "#2C2932"}], + "cornerRadius": 2, + "variables": {"fills/0/color": "border/border"} + }, + { + "id": "1:46673", + "name": "Progress fill", + "type": "RECTANGLE", + "x": 410, + "y": 216, + "width": 140, + "height": 4, + "fills": [{"type": "SOLID", "color": "#FF4FA3"}], + "cornerRadius": 2, + "variables": {"fills/0/color": "accent/accent"} + }, + { + "id": "1:46674", + "name": "cardBody", + "type": "TEXT", + "x": 410, + "y": 230, + "width": 360, + "height": 16, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "layoutAlignSelf": "STRETCH", + "text": "Preparing files…", + "font": ["Geist", 400, 12], + "align": "CENTER", + "variables": {"fontFamily": "typography/font-sans"} + } + ] + } + ] + } + ] + } + ] +} diff --git a/assets/design-export/json/1-46394.json b/assets/design-export/json/1-46394.json new file mode 100644 index 000000000..4f1c9b49a --- /dev/null +++ b/assets/design-export/json/1-46394.json @@ -0,0 +1,474 @@ +{ + "file": "1-46394", + "id": "1:46394", + "name": "Screen/Server Detail — Files (Starting timed out)", + "type": "FRAME", + "x": 8840, + "y": 32501, + "width": 1440, + "height": 900, + "fills": [{"type": "SOLID", "color": "#121114"}], + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "FIXED"] + }, + "clips": true, + "variables": {"fills/0/color": "background/background"}, + "children": [ + { + "name": "App Sidebar", + "type": "INSTANCE", + "x": 0, + "y": 0, + "width": 260, + "height": 900, + "component": "Gameplane/App Sidebar", + "componentId": "1:234", + "fills": [{"type": "SOLID", "color": "#17151A"}], + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "layout": { + "mode": "VERTICAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"fills/0/color": "surface/secondary", "strokes/0/color": "border/border"}, + "texts": [ + "gameplane", + "homelab-01", + "GENERAL", + "Dashboard", + "Servers", + "Modules", + "Backups", + "ADMIN", + "Clusters", + "Nodes", + "Users & RBAC", + "Audit log", + "System logs", + "Settings", + "AD", + "admin", + "admin" + ] + }, + { + "id": "1:46427", + "name": "Main", + "type": "FRAME", + "x": 260, + "y": 0, + "width": 1180, + "height": 900, + "fills": [{"type": "SOLID", "color": "#121114"}], + "layout": { + "mode": "VERTICAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "FIXED"] + }, + "layoutGrow": 1, + "layoutAlignSelf": "STRETCH", + "variables": {"fills/0/color": "background/background"}, + "children": [ + { + "name": "Top Bar", + "type": "INSTANCE", + "x": 0, + "y": 0, + "width": 1180, + "height": 64, + "component": "Gameplane/Top Bar", + "componentId": "1:281", + "fills": [{"type": "SOLID", "color": "#121114"}], + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 32, 0, 32], + "primary": "SPACE_BETWEEN", + "counter": "CENTER", + "sizing": ["FIXED", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"fills/0/color": "background/background", "strokes/0/color": "border/border"}, + "texts": ["gameplane", "mc-survival", "Search servers…", "AD"] + }, + { + "name": "Detail Header", + "type": "INSTANCE", + "x": 0, + "y": 64, + "width": 1180, + "height": 86, + "component": "Gameplane/Server Detail Header", + "componentId": "1:447", + "fills": [{"type": "SOLID", "color": "#121114"}], + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [16, 24, 16, 24], + "primary": "SPACE_BETWEEN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"fills/0/color": "background/background"}, + "texts": [ + "MI", + "mc-survival", + "Stopped", + "site: remote-lab · minecraft-java · 1.21.4-fabric · ns: gameplane-games", + "Restart", + "Start", + "Open console" + ] + }, + { + "name": "Tabs Bar", + "type": "INSTANCE", + "x": 0, + "y": 150, + "width": 1180, + "height": 76, + "component": "Gameplane/Server Detail Tabs", + "componentId": "1:466", + "fills": [{"type": "SOLID", "color": "#121114"}], + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [18, 24, 18, 24], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"fills/0/color": "background/background", "strokes/0/color": "border/border"}, + "texts": [ + "Overview", + "Events", + "Console", + "Logs", + "Files", + "Mods", + "Modpacks", + "Players", + "Backups", + "Capture", + "Settings" + ] + }, + { + "id": "1:46509", + "name": "Body", + "type": "FRAME", + "x": 0, + "y": 226, + "width": 1180, + "height": 674, + "fills": [{"type": "SOLID", "color": "#121114"}], + "layout": { + "mode": "VERTICAL", + "gap": 12, + "padding": [4, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "FIXED"] + }, + "layoutGrow": 1, + "layoutAlignSelf": "STRETCH", + "variables": {"fills/0/color": "background/background"}, + "children": [ + { + "id": "1:46570", + "name": "Files Toolbar", + "type": "FRAME", + "x": 0, + "y": 4, + "width": 1180, + "height": 36, + "layout": { + "mode": "HORIZONTAL", + "gap": 12, + "padding": [0, 0, 0, 0], + "primary": "SPACE_BETWEEN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "id": "1:46675", + "name": "Breadcrumb", + "type": "FRAME", + "x": 0, + "y": 3, + "width": 32, + "height": 30, + "fills": [{"type": "SOLID", "color": "#1C1A20"}], + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "cornerRadius": 4, + "layout": { + "mode": "HORIZONTAL", + "gap": 4, + "padding": [6, 12, 6, 12], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["HUG", "FIXED"] + }, + "variables": {"fills/0/color": "surface/surface", "strokes/0/color": "border/border"}, + "children": [ + { + "id": "1:46766", + "name": "Path", + "type": "TEXT", + "x": 12, + "y": 7, + "width": 8, + "height": 16, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "text": "/", + "font": ["JetBrains Mono", 400, 12], + "variables": {"fontFamily": "typography/font-mono", "fills/0/color": "muted"} + } + ] + }, + { + "id": "1:46676", + "name": "Toolbar Actions", + "type": "FRAME", + "x": 830, + "y": 0, + "width": 350, + "height": 36, + "layout": { + "mode": "HORIZONTAL", + "gap": 8, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["HUG", "HUG"] + }, + "children": [ + { + "name": "Btn New File", + "type": "INSTANCE", + "x": 0, + "y": 2, + "width": 93, + "height": 32, + "opacity": 0.45, + "component": "Button/Outline/SM", + "componentId": "1:633", + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "cornerRadius": 24, + "layout": { + "mode": "HORIZONTAL", + "gap": 5, + "padding": [8, 12, 8, 12], + "primary": "CENTER", + "counter": "CENTER", + "sizing": ["HUG", "FIXED"] + }, + "variables": { + "cornerRadius": "radius/3xl", + "paddingRight": "spacing/3", + "paddingLeft": "spacing/3", + "strokes/0/color": "border-2" + }, + "texts": ["New file"] + }, + { + "name": "Btn New Folder", + "type": "INSTANCE", + "x": 101, + "y": 2, + "width": 110, + "height": 32, + "opacity": 0.45, + "component": "Button/Outline/SM", + "componentId": "1:633", + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "cornerRadius": 24, + "layout": { + "mode": "HORIZONTAL", + "gap": 5, + "padding": [8, 12, 8, 12], + "primary": "CENTER", + "counter": "CENTER", + "sizing": ["HUG", "FIXED"] + }, + "variables": { + "cornerRadius": "radius/3xl", + "paddingRight": "spacing/3", + "paddingLeft": "spacing/3", + "strokes/0/color": "border-2" + }, + "texts": ["New folder"] + }, + { + "name": "Btn Upload", + "type": "INSTANCE", + "x": 219, + "y": 2, + "width": 87, + "height": 32, + "opacity": 0.45, + "component": "Button/Outline/SM", + "componentId": "1:633", + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "cornerRadius": 24, + "layout": { + "mode": "HORIZONTAL", + "gap": 5, + "padding": [8, 12, 8, 12], + "primary": "CENTER", + "counter": "CENTER", + "sizing": ["HUG", "FIXED"] + }, + "variables": { + "cornerRadius": "radius/3xl", + "paddingRight": "spacing/3", + "paddingLeft": "spacing/3", + "strokes/0/color": "border-2" + }, + "texts": ["Upload"] + }, + { + "name": "Btn Refresh", + "type": "INSTANCE", + "x": 314, + "y": 0, + "width": 36, + "height": 36, + "opacity": 0.45, + "component": "Button/Outline/Icon/MD", + "componentId": "1:774", + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "cornerRadius": 24, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "CENTER", + "counter": "CENTER", + "sizing": ["FIXED", "FIXED"] + }, + "variables": {"cornerRadius": "radius/3xl", "strokes/0/color": "border-2"} + } + ] + } + ] + }, + { + "id": "1:46571", + "name": "Files starting", + "type": "FRAME", + "x": 0, + "y": 52, + "width": 1180, + "height": 528, + "children": [ + { + "id": "1:46677", + "name": "cardTitle", + "type": "TEXT", + "x": 524.5, + "y": 110, + "width": 131, + "height": 21, + "fills": [{"type": "SOLID", "color": "#F5F3F7"}], + "text": "Files did not start", + "font": ["Geist", 500, 16], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + }, + { + "name": "Gameplane/Error Card", + "type": "INSTANCE", + "x": 390, + "y": 152, + "width": 400, + "height": 58, + "component": "Gameplane/Error Card", + "componentId": "1:10060", + "fills": [{"type": "SOLID", "color": "#1C1A20"}], + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "cornerRadius": 24, + "layout": { + "mode": "HORIZONTAL", + "gap": 12, + "padding": [20, 20, 20, 20], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "FIXED"] + }, + "variables": { + "cornerRadius": "radius/3xl", + "fills/0/color": "surface/surface", + "strokes/0/color": "border/border" + }, + "texts": ["Files are starting, try again. The file-only pod was not ready within 60 seconds."] + }, + { + "name": "Gameplane/Button/Default", + "type": "INSTANCE", + "x": 535, + "y": 232, + "width": 110, + "height": 36, + "component": "Gameplane/Button/Default", + "componentId": "1:306", + "fills": [{"type": "SOLID", "color": "#00000000", "opacity": 0}], + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "CENTER", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "texts": ["Retry"] + }, + { + "id": "1:46678", + "name": "cardBody", + "type": "TEXT", + "x": 330, + "y": 288, + "width": 520, + "height": 18, + "fills": [{"type": "SOLID", "color": "#F5F3F7"}], + "layoutAlignSelf": "STRETCH", + "text": "Nothing was started. The server stays stopped, and no file was changed.", + "font": ["Geist", 400, 14], + "align": "CENTER", + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + } + ] + } + ] + } + ] + } + ] +} diff --git a/assets/design-export/json/1-46395.json b/assets/design-export/json/1-46395.json new file mode 100644 index 000000000..e297259b4 --- /dev/null +++ b/assets/design-export/json/1-46395.json @@ -0,0 +1,1439 @@ +{ + "file": "1-46395", + "id": "1:46395", + "name": "Screen/Users & RBAC — SFTP access (admin)", + "type": "FRAME", + "x": 5880, + "y": 70673, + "width": 1440, + "height": 900, + "fills": [{"type": "SOLID", "color": "#121114"}], + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "FIXED"] + }, + "clips": true, + "variables": {"fills/0/color": "background/background"}, + "children": [ + { + "name": "App Sidebar", + "type": "INSTANCE", + "x": 0, + "y": 0, + "width": 260, + "height": 900, + "component": "Gameplane/App Sidebar", + "componentId": "1:234", + "fills": [{"type": "SOLID", "color": "#17151A"}], + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "layout": { + "mode": "VERTICAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"fills/0/color": "surface/secondary", "strokes/0/color": "border/border"}, + "texts": [ + "gameplane", + "homelab-01", + "GENERAL", + "Dashboard", + "Servers", + "Modules", + "Backups", + "ADMIN", + "Clusters", + "Nodes", + "Users & RBAC", + "Audit log", + "System logs", + "Settings", + "AD", + "admin", + "admin" + ] + }, + { + "id": "1:46428", + "name": "Main", + "type": "FRAME", + "x": 260, + "y": 0, + "width": 1180, + "height": 900, + "fills": [{"type": "SOLID", "color": "#121114"}], + "layout": { + "mode": "VERTICAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "FIXED"] + }, + "layoutGrow": 1, + "layoutAlignSelf": "STRETCH", + "variables": {"fills/0/color": "background/background"}, + "children": [ + { + "name": "Top Bar", + "type": "INSTANCE", + "x": 0, + "y": 0, + "width": 1180, + "height": 64, + "component": "Gameplane/Top Bar", + "componentId": "1:281", + "fills": [{"type": "SOLID", "color": "#121114"}], + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 32, 0, 32], + "primary": "SPACE_BETWEEN", + "counter": "CENTER", + "sizing": ["FIXED", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"fills/0/color": "background/background", "strokes/0/color": "border/border"}, + "texts": ["gameplane", "Users & RBAC", "Search servers…", "AD"] + }, + { + "id": "1:46510", + "name": "Body", + "type": "FRAME", + "x": 0, + "y": 64, + "width": 1180, + "height": 836, + "fills": [{"type": "SOLID", "color": "#121114"}], + "layout": { + "mode": "VERTICAL", + "gap": 24, + "padding": [24, 24, 24, 24], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "FIXED"] + }, + "layoutGrow": 1, + "layoutAlignSelf": "STRETCH", + "variables": {"fills/0/color": "background/background"}, + "children": [ + { + "id": "1:46572", + "name": "Page Header", + "type": "FRAME", + "x": 24, + "y": 24, + "width": 1132, + "height": 53, + "fills": [{"type": "SOLID", "color": "#121114"}], + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "SPACE_BETWEEN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"fills/0/color": "background/background"}, + "children": [ + { + "id": "1:46679", + "name": "Title Col", + "type": "FRAME", + "x": 0, + "y": 0, + "width": 308, + "height": 53, + "layout": { + "mode": "VERTICAL", + "gap": 4, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "HUG"] + }, + "children": [ + { + "id": "1:46767", + "name": "phTitle", + "type": "TEXT", + "x": 0, + "y": 0, + "width": 160, + "height": 31, + "fills": [{"type": "SOLID", "color": "#F5F3F7"}], + "text": "Users & RBAC", + "font": ["Geist", 600, 24], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + }, + { + "id": "1:46768", + "name": "phSubtitle", + "type": "TEXT", + "x": 0, + "y": 35, + "width": 308, + "height": 18, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "text": "Manage access to the Gameplane control plane.", + "font": ["Geist", 400, 14], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "muted"} + } + ] + }, + { + "id": "1:46680", + "name": "phActions", + "type": "FRAME", + "x": 897, + "y": 6.5, + "width": 235, + "height": 40, + "layout": { + "mode": "HORIZONTAL", + "gap": 12, + "padding": [0, 0, 0, 0], + "primary": "MAX", + "counter": "CENTER", + "sizing": ["HUG", "FIXED"] + }, + "children": [ + { + "name": "Audit Log Button", + "type": "INSTANCE", + "x": 0, + "y": 4, + "width": 98, + "height": 32, + "component": "Gameplane/Button/Outline", + "componentId": "1:770", + "fills": [{"type": "SOLID", "color": "#00000000", "opacity": 0}], + "strokes": [{"type": "SOLID", "color": "#00000000", "opacity": 0}], + "strokeWeight": 1, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "CENTER", + "counter": "CENTER", + "sizing": ["HUG", "HUG"] + }, + "texts": ["Audit log"] + }, + { + "name": "Invite User Button", + "type": "INSTANCE", + "x": 110, + "y": 2, + "width": 125, + "height": 36, + "component": "Gameplane/Button/Default", + "componentId": "1:306", + "fills": [{"type": "SOLID", "color": "#00000000", "opacity": 0}], + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "CENTER", + "counter": "CENTER", + "sizing": ["HUG", "HUG"] + }, + "texts": ["Invite user"] + } + ] + } + ] + }, + { + "name": "Filter Row", + "type": "INSTANCE", + "x": 24, + "y": 101, + "width": 1132, + "height": 40, + "component": "Gameplane/RBAC Filter Row", + "componentId": "1:3048", + "layout": { + "mode": "HORIZONTAL", + "gap": 12, + "padding": [0, 0, 0, 0], + "primary": "SPACE_BETWEEN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "texts": ["Users", "2", "Roles", "3", "Service accounts", "Identity providers", "Search users…"] + }, + { + "id": "1:46573", + "name": "Users Table", + "type": "FRAME", + "x": 24, + "y": 165, + "width": 1132, + "height": 240, + "fills": [{"type": "SOLID", "color": "#17151A"}], + "cornerRadius": 20, + "layout": { + "mode": "VERTICAL", + "gap": 0, + "padding": [0, 4, 4, 4], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "clips": true, + "variables": {"fills/0/color": "surface/secondary"}, + "children": [ + { + "id": "1:46681", + "name": "Head Row", + "type": "FRAME", + "x": 4, + "y": 0, + "width": 1124, + "height": 36, + "fills": [{"type": "SOLID", "color": "#17151A"}], + "strokes": [{"type": "SOLID", "color": "#232227"}], + "strokeWeight": 1, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"fills/0/color": "surface/secondary", "strokes/0/color": "separator/separator"}, + "children": [ + { + "name": "Table Column", + "type": "INSTANCE", + "x": 0, + "y": 0, + "width": 690, + "height": 36, + "component": "Table Column", + "componentId": "1:1264", + "fills": [{"type": "SOLID", "color": "#17151A"}], + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [10, 16, 10, 16], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutGrow": 1, + "variables": {"fills/0/color": "surface/secondary"}, + "texts": ["USER"] + }, + { + "name": "Table Column", + "type": "INSTANCE", + "x": 690, + "y": 0, + "width": 140, + "height": 36, + "component": "Table Column", + "componentId": "1:1264", + "fills": [{"type": "SOLID", "color": "#17151A"}], + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [10, 16, 10, 16], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "variables": {"fills/0/color": "surface/secondary"}, + "texts": ["ROLE"] + }, + { + "name": "Table Column", + "type": "INSTANCE", + "x": 830, + "y": 0, + "width": 120, + "height": 36, + "component": "Table Column", + "componentId": "1:1264", + "fills": [{"type": "SOLID", "color": "#17151A"}], + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [10, 16, 10, 16], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "variables": {"fills/0/color": "surface/secondary"}, + "texts": ["PROVIDER"] + }, + { + "name": "Table Column", + "type": "INSTANCE", + "x": 950, + "y": 0, + "width": 110, + "height": 36, + "component": "Table Column", + "componentId": "1:1264", + "fills": [{"type": "SOLID", "color": "#17151A"}], + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [10, 16, 10, 16], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "variables": {"fills/0/color": "surface/secondary"}, + "texts": ["CREATED"] + }, + { + "name": "Table Column", + "type": "INSTANCE", + "x": 1060, + "y": 0, + "width": 64, + "height": 36, + "component": "Table Column", + "componentId": "1:1264", + "fills": [{"type": "SOLID", "color": "#17151A"}], + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [10, 16, 10, 16], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "variables": {"fills/0/color": "surface/secondary"} + } + ] + }, + { + "id": "1:46682", + "name": "Table Body", + "type": "FRAME", + "x": 4, + "y": 36, + "width": 1124, + "height": 200, + "cornerRadius": 16, + "layout": { + "mode": "VERTICAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "clips": true, + "variables": {"cornerRadius": "radius/2xl"}, + "children": [ + { + "id": "1:46769", + "name": "Row Admin", + "type": "FRAME", + "x": 0, + "y": 0, + "width": 1124, + "height": 100, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "id": "1:46884", + "name": "Table Cell", + "type": "FRAME", + "x": 0, + "y": 0, + "width": 690, + "height": 58, + "fills": [{"type": "SOLID", "color": "#1C1A20"}], + "strokes": [{"type": "SOLID", "color": "#232227"}], + "strokeWeight": 1, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [12, 16, 12, 16], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutGrow": 1, + "variables": {"fills/0/color": "surface/surface", "strokes/0/color": "separator/separator"}, + "children": [ + { + "id": "1:46955", + "name": "frame", + "type": "FRAME", + "x": 16, + "y": 12, + "width": 122, + "height": 34, + "layout": { + "mode": "HORIZONTAL", + "gap": 12, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["HUG", "HUG"] + }, + "children": [ + { + "name": "Avatar/Small", + "type": "INSTANCE", + "x": 0, + "y": 1, + "width": 32, + "height": 32, + "component": "Avatar/Small", + "componentId": "1:3073", + "fills": [{"type": "SOLID", "color": "#2C1926"}], + "cornerRadius": 9999, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "CENTER", + "counter": "CENTER", + "sizing": ["FIXED", "FIXED"] + }, + "variables": {"fills/0/color": "accent/soft"}, + "texts": ["AD"] + }, + { + "id": "1:47017", + "name": "frame", + "type": "FRAME", + "x": 44, + "y": 0, + "width": 78, + "height": 34, + "layout": { + "mode": "VERTICAL", + "gap": 2, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "HUG"] + }, + "children": [ + { + "id": "1:47142", + "name": "frame", + "type": "FRAME", + "x": 0, + "y": 0, + "width": 78, + "height": 18, + "layout": { + "mode": "HORIZONTAL", + "gap": 8, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["HUG", "HUG"] + }, + "children": [ + { + "id": "1:47260", + "name": "text", + "type": "TEXT", + "x": 0, + "y": 0, + "width": 42, + "height": 18, + "fills": [{"type": "SOLID", "color": "#F5F3F7"}], + "text": "admin", + "font": ["JetBrains Mono", 400, 14], + "variables": {"fontFamily": "typography/font-mono", "fills/0/color": "foreground/foreground"} + }, + { + "name": "Chip/Soft/Default/SM", + "type": "INSTANCE", + "x": 50, + "y": 0.5, + "width": 28, + "height": 17, + "component": "Chip/Soft/Default/SM", + "componentId": "1:1002", + "fills": [{"type": "SOLID", "color": "#232128"}], + "cornerRadius": 16, + "layout": { + "mode": "HORIZONTAL", + "gap": 2, + "padding": [2, 4, 2, 4], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["HUG", "HUG"] + }, + "variables": {"cornerRadius": "radius/2xl", "fills/0/color": "default/default"}, + "texts": ["you"] + } + ] + }, + { + "id": "1:47143", + "name": "text", + "type": "TEXT", + "x": 0, + "y": 20, + "width": 32, + "height": 14, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "text": "admin", + "font": ["Geist", 400, 11], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "muted"} + } + ] + } + ] + } + ] + }, + { + "id": "1:46885", + "name": "Table Cell", + "type": "FRAME", + "x": 690, + "y": 0, + "width": 140, + "height": 100, + "fills": [{"type": "SOLID", "color": "#1C1A20"}], + "strokes": [{"type": "SOLID", "color": "#232227"}], + "strokeWeight": 1, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [12, 16, 12, 16], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"fills/0/color": "surface/surface", "strokes/0/color": "separator/separator"}, + "children": [ + { + "name": "Chip/Soft/Warning/SM", + "type": "INSTANCE", + "x": 16, + "y": 41.5, + "width": 46, + "height": 17, + "component": "Chip/Soft/Warning/SM", + "componentId": "1:3082", + "fills": [{"type": "SOLID", "color": "#F7B75026", "opacity": 0.15}], + "cornerRadius": 16, + "layout": { + "mode": "HORIZONTAL", + "gap": 2, + "padding": [2, 4, 2, 4], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["HUG", "HUG"] + }, + "variables": {"cornerRadius": "radius/2xl", "fills/0/color": "warning/soft"}, + "texts": ["ADMIN"] + } + ] + }, + { + "id": "1:46886", + "name": "Table Cell", + "type": "FRAME", + "x": 830, + "y": 0, + "width": 120, + "height": 100, + "fills": [{"type": "SOLID", "color": "#1C1A20"}], + "strokes": [{"type": "SOLID", "color": "#232227"}], + "strokeWeight": 1, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [12, 16, 12, 16], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"fills/0/color": "surface/surface", "strokes/0/color": "separator/separator"}, + "children": [ + { + "name": "Chip/Tertiary/Default/SM", + "type": "INSTANCE", + "x": 16, + "y": 41.5, + "width": 45, + "height": 17, + "component": "Chip/Tertiary/Default/SM", + "componentId": "1:1932", + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "cornerRadius": 16, + "layout": { + "mode": "HORIZONTAL", + "gap": 2, + "padding": [2, 4, 2, 4], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["HUG", "HUG"] + }, + "variables": {"cornerRadius": "radius/2xl", "strokes/0/color": "border/border"}, + "texts": ["LOCAL"] + } + ] + }, + { + "name": "Table Cell", + "type": "INSTANCE", + "x": 950, + "y": 0, + "width": 110, + "height": 100, + "component": "Table Cell", + "componentId": "1:824", + "fills": [{"type": "SOLID", "color": "#1C1A20"}], + "strokes": [{"type": "SOLID", "color": "#232227"}], + "strokeWeight": 1, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [12, 16, 12, 16], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"fills/0/color": "surface/surface", "strokes/0/color": "separator/separator"}, + "texts": ["6d ago"] + }, + { + "id": "1:46887", + "name": "Table Cell", + "type": "FRAME", + "x": 1060, + "y": 0, + "width": 64, + "height": 100, + "fills": [{"type": "SOLID", "color": "#1C1A20"}], + "strokes": [{"type": "SOLID", "color": "#232227"}], + "strokeWeight": 1, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [12, 16, 12, 16], + "primary": "CENTER", + "counter": "CENTER", + "sizing": ["HUG", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"fills/0/color": "surface/surface", "strokes/0/color": "separator/separator"}, + "children": [ + { + "name": "Button/Ghost/Icon/SM", + "type": "INSTANCE", + "x": 16, + "y": 34, + "width": 32, + "height": 32, + "component": "Button/Ghost/Icon/SM", + "componentId": "1:835", + "cornerRadius": 6, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "CENTER", + "counter": "CENTER", + "sizing": ["FIXED", "FIXED"] + } + } + ] + } + ] + }, + { + "id": "1:46770", + "name": "Row Smoke", + "type": "FRAME", + "x": 0, + "y": 100, + "width": 1124, + "height": 100, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "id": "1:46888", + "name": "Table Cell", + "type": "FRAME", + "x": 0, + "y": 0, + "width": 690, + "height": 58, + "fills": [{"type": "SOLID", "color": "#1C1A20"}], + "strokes": [{"type": "SOLID", "color": "#232227"}], + "strokeWeight": 1, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [12, 16, 12, 16], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutGrow": 1, + "variables": {"fills/0/color": "surface/surface", "strokes/0/color": "separator/separator"}, + "children": [ + { + "id": "1:46956", + "name": "frame", + "type": "FRAME", + "x": 16, + "y": 12, + "width": 145, + "height": 34, + "layout": { + "mode": "HORIZONTAL", + "gap": 12, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["HUG", "HUG"] + }, + "children": [ + { + "name": "Avatar/Small", + "type": "INSTANCE", + "x": 0, + "y": 1, + "width": 32, + "height": 32, + "component": "Avatar/Small", + "componentId": "1:3073", + "fills": [{"type": "SOLID", "color": "#2C1926"}], + "cornerRadius": 9999, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "CENTER", + "counter": "CENTER", + "sizing": ["FIXED", "FIXED"] + }, + "variables": {"fills/0/color": "accent/soft"}, + "texts": ["SM"] + }, + { + "id": "1:47018", + "name": "frame", + "type": "FRAME", + "x": 44, + "y": 0, + "width": 101, + "height": 34, + "layout": { + "mode": "VERTICAL", + "gap": 2, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "HUG"] + }, + "children": [ + { + "id": "1:47144", + "name": "frame", + "type": "FRAME", + "x": 0, + "y": 0, + "width": 101, + "height": 18, + "layout": { + "mode": "HORIZONTAL", + "gap": 8, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["HUG", "HUG"] + }, + "children": [ + { + "id": "1:47261", + "name": "text", + "type": "TEXT", + "x": 0, + "y": 0, + "width": 101, + "height": 18, + "fills": [{"type": "SOLID", "color": "#F5F3F7"}], + "text": "smoke-collab", + "font": ["JetBrains Mono", 400, 14], + "variables": {"fontFamily": "typography/font-mono", "fills/0/color": "foreground/foreground"} + } + ] + }, + { + "id": "1:47145", + "name": "text", + "type": "TEXT", + "x": 0, + "y": 20, + "width": 10, + "height": 14, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "text": "—", + "font": ["Geist", 400, 11], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "muted"} + } + ] + } + ] + } + ] + }, + { + "id": "1:46889", + "name": "Table Cell", + "type": "FRAME", + "x": 690, + "y": 0, + "width": 140, + "height": 100, + "fills": [{"type": "SOLID", "color": "#1C1A20"}], + "strokes": [{"type": "SOLID", "color": "#232227"}], + "strokeWeight": 1, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [12, 16, 12, 16], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"fills/0/color": "surface/surface", "strokes/0/color": "separator/separator"}, + "children": [ + { + "name": "Chip/Soft/Default/SM", + "type": "INSTANCE", + "x": 16, + "y": 41.5, + "width": 51, + "height": 17, + "component": "Chip/Soft/Default/SM", + "componentId": "1:1002", + "fills": [{"type": "SOLID", "color": "#232128"}], + "cornerRadius": 16, + "layout": { + "mode": "HORIZONTAL", + "gap": 2, + "padding": [2, 4, 2, 4], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["HUG", "HUG"] + }, + "variables": {"cornerRadius": "radius/2xl", "fills/0/color": "default/default"}, + "texts": ["VIEWER"] + } + ] + }, + { + "id": "1:46890", + "name": "Table Cell", + "type": "FRAME", + "x": 830, + "y": 0, + "width": 120, + "height": 100, + "fills": [{"type": "SOLID", "color": "#1C1A20"}], + "strokes": [{"type": "SOLID", "color": "#232227"}], + "strokeWeight": 1, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [12, 16, 12, 16], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"fills/0/color": "surface/surface", "strokes/0/color": "separator/separator"}, + "children": [ + { + "name": "Chip/Tertiary/Default/SM", + "type": "INSTANCE", + "x": 16, + "y": 41.5, + "width": 45, + "height": 17, + "component": "Chip/Tertiary/Default/SM", + "componentId": "1:1932", + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "cornerRadius": 16, + "layout": { + "mode": "HORIZONTAL", + "gap": 2, + "padding": [2, 4, 2, 4], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["HUG", "HUG"] + }, + "variables": {"cornerRadius": "radius/2xl", "strokes/0/color": "border/border"}, + "texts": ["LOCAL"] + } + ] + }, + { + "name": "Table Cell", + "type": "INSTANCE", + "x": 950, + "y": 0, + "width": 110, + "height": 100, + "component": "Table Cell", + "componentId": "1:824", + "fills": [{"type": "SOLID", "color": "#1C1A20"}], + "strokes": [{"type": "SOLID", "color": "#232227"}], + "strokeWeight": 1, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [12, 16, 12, 16], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"fills/0/color": "surface/surface", "strokes/0/color": "separator/separator"}, + "texts": ["4d ago"] + }, + { + "id": "1:46891", + "name": "Table Cell", + "type": "FRAME", + "x": 1060, + "y": 0, + "width": 64, + "height": 100, + "fills": [{"type": "SOLID", "color": "#1C1A20"}], + "strokes": [{"type": "SOLID", "color": "#232227"}], + "strokeWeight": 1, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [12, 16, 12, 16], + "primary": "CENTER", + "counter": "CENTER", + "sizing": ["HUG", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"fills/0/color": "surface/surface", "strokes/0/color": "separator/separator"}, + "children": [ + { + "name": "Button/Ghost/Icon/SM", + "type": "INSTANCE", + "x": 16, + "y": 34, + "width": 32, + "height": 32, + "component": "Button/Ghost/Icon/SM", + "componentId": "1:835", + "cornerRadius": 6, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "CENTER", + "counter": "CENTER", + "sizing": ["FIXED", "FIXED"] + } + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "id": "1:46429", + "name": "Backdrop", + "type": "RECTANGLE", + "x": 0, + "y": 0, + "width": 1440, + "height": 900, + "fills": [{"type": "SOLID", "color": "#000000", "opacity": 0.5}], + "absolute": true + }, + { + "id": "1:46430", + "name": "Gameplane/Dialog/Users · SFTP access (smoke-collab)", + "type": "FRAME", + "x": 960, + "y": 0, + "width": 480, + "height": 900, + "fills": [{"type": "SOLID", "color": "#1C1A20"}], + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "layout": { + "mode": "VERTICAL", + "gap": 16, + "padding": [20, 20, 20, 20], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "FIXED"] + }, + "absolute": true, + "variables": {"fills/0/color": "surface/surface", "strokes/0/color": "border/border"}, + "children": [ + { + "id": "1:46511", + "name": "mTitle", + "type": "TEXT", + "x": 20, + "y": 20, + "width": 214, + "height": 24, + "fills": [{"type": "SOLID", "color": "#F5F3F7"}], + "text": "SFTP access · smoke-collab", + "font": ["Geist", 600, 16], + "lineHeight": {"value": 150, "unit": "PERCENT"}, + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + }, + { + "id": "1:46512", + "name": "mDesc", + "type": "TEXT", + "x": 20, + "y": 60, + "width": 440, + "height": 21, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "layoutAlignSelf": "STRETCH", + "text": "Remove a key or revoke the password. The user keeps their account.", + "font": ["Geist", 400, 14], + "lineHeight": {"value": 150, "unit": "PERCENT"}, + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "muted"} + }, + { + "id": "1:46513", + "name": "SSH keys", + "type": "FRAME", + "x": 20, + "y": 97, + "width": 440, + "height": 87, + "layout": { + "mode": "VERTICAL", + "gap": 8, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "id": "1:46574", + "name": "cardTitle", + "type": "TEXT", + "x": 0, + "y": 0, + "width": 440, + "height": 21, + "fills": [{"type": "SOLID", "color": "#F5F3F7"}], + "layoutAlignSelf": "STRETCH", + "text": "SSH keys (1)", + "font": ["Geist", 500, 16], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + }, + { + "id": "1:46575", + "name": "Key row laptop", + "type": "FRAME", + "x": 0, + "y": 29, + "width": 440, + "height": 58, + "layout": { + "mode": "HORIZONTAL", + "gap": 12, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "id": "1:46683", + "name": "Key info", + "type": "FRAME", + "x": 0, + "y": 0, + "width": 336, + "height": 58, + "layout": { + "mode": "VERTICAL", + "gap": 2, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutGrow": 1, + "children": [ + { + "id": "1:46771", + "name": "text", + "type": "TEXT", + "x": 0, + "y": 0, + "width": 336, + "height": 18, + "fills": [{"type": "SOLID", "color": "#F5F3F7"}], + "layoutAlignSelf": "STRETCH", + "text": "laptop · ssh-ed25519", + "font": ["JetBrains Mono", 600, 14], + "variables": {"fontFamily": "typography/font-mono", "fills/0/color": "foreground/foreground"} + }, + { + "id": "1:46772", + "name": "text", + "type": "TEXT", + "x": 0, + "y": 20, + "width": 336, + "height": 18, + "fills": [{"type": "SOLID", "color": "#F5F3F7"}], + "layoutAlignSelf": "STRETCH", + "text": "SHA256:9dK1vT7q…pA1fG", + "font": ["JetBrains Mono", 600, 14], + "variables": {"fontFamily": "typography/font-mono", "fills/0/color": "foreground/foreground"} + }, + { + "id": "1:46773", + "name": "cardBody", + "type": "TEXT", + "x": 0, + "y": 40, + "width": 336, + "height": 18, + "fills": [{"type": "SOLID", "color": "#F5F3F7"}], + "layoutAlignSelf": "STRETCH", + "text": "Added 3 Oct 2026 · Last used 2 hours ago", + "font": ["Geist", 400, 14], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + } + ] + }, + { + "name": "Gameplane/Button/Small/Danger", + "type": "INSTANCE", + "x": 348, + "y": 0, + "width": 92, + "height": 32, + "component": "Gameplane/Button/Small/Danger", + "componentId": "1:1878", + "fills": [{"type": "SOLID", "color": "#00000000", "opacity": 0}], + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "CENTER", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "texts": ["Remove"] + } + ] + } + ] + }, + { + "id": "1:46514", + "name": "Divider", + "type": "RECTANGLE", + "x": 20, + "y": 200, + "width": 440, + "height": 1, + "layoutAlignSelf": "STRETCH" + }, + { + "id": "1:46515", + "name": "Password", + "type": "FRAME", + "x": 20, + "y": 217, + "width": 440, + "height": 61, + "layout": { + "mode": "VERTICAL", + "gap": 8, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "id": "1:46576", + "name": "cardTitle", + "type": "TEXT", + "x": 0, + "y": 0, + "width": 440, + "height": 21, + "fills": [{"type": "SOLID", "color": "#F5F3F7"}], + "layoutAlignSelf": "STRETCH", + "text": "Password", + "font": ["Geist", 500, 16], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + }, + { + "id": "1:46577", + "name": "Password row", + "type": "FRAME", + "x": 0, + "y": 29, + "width": 440, + "height": 32, + "layout": { + "mode": "HORIZONTAL", + "gap": 12, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "id": "1:46684", + "name": "cardBody", + "type": "TEXT", + "x": 0, + "y": 0, + "width": 336, + "height": 32, + "fills": [{"type": "SOLID", "color": "#F5F3F7"}], + "layoutGrow": 1, + "layoutAlignSelf": "STRETCH", + "text": "Set · Created 3 Oct 2026 · Last used 5 minutes ago", + "font": ["Geist", 400, 14], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + }, + { + "name": "Gameplane/Button/Small/Danger", + "type": "INSTANCE", + "x": 348, + "y": 0, + "width": 92, + "height": 32, + "component": "Gameplane/Button/Small/Danger", + "componentId": "1:1878", + "fills": [{"type": "SOLID", "color": "#00000000", "opacity": 0}], + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "CENTER", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "texts": ["Revoke"] + } + ] + } + ] + }, + { + "id": "1:46516", + "name": "Footer", + "type": "FRAME", + "x": 20, + "y": 844, + "width": 440, + "height": 36, + "layout": { + "mode": "HORIZONTAL", + "gap": 8, + "padding": [0, 0, 0, 0], + "primary": "MAX", + "counter": "MIN", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "absolute": true, + "children": [ + { + "name": "Gameplane/Button/Default", + "type": "INSTANCE", + "x": 373, + "y": 0, + "width": 67, + "height": 36, + "component": "Gameplane/Button/Default", + "componentId": "1:306", + "fills": [{"type": "SOLID", "color": "#00000000", "opacity": 0}], + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "CENTER", + "counter": "CENTER", + "sizing": ["HUG", "HUG"] + }, + "texts": ["Done"] + } + ] + } + ] + } + ] +} diff --git a/assets/design-export/json/1-46396.json b/assets/design-export/json/1-46396.json new file mode 100644 index 000000000..c05c0bc1e --- /dev/null +++ b/assets/design-export/json/1-46396.json @@ -0,0 +1,882 @@ +{ + "file": "1-46396", + "id": "1:46396", + "name": "Screen/Clusters — SFTP (remote-lab)", + "type": "FRAME", + "x": 31670, + "y": 68073, + "width": 1440, + "height": 900, + "fills": [{"type": "SOLID", "color": "#121114"}], + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "FIXED"] + }, + "clips": true, + "variables": {"fills/0/color": "background/background"}, + "children": [ + { + "name": "App Sidebar", + "type": "INSTANCE", + "x": 0, + "y": 0, + "width": 260, + "height": 900, + "component": "Gameplane/App Sidebar", + "componentId": "1:234", + "fills": [{"type": "SOLID", "color": "#17151A"}], + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "layout": { + "mode": "VERTICAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"fills/0/color": "surface/secondary", "strokes/0/color": "border/border"}, + "texts": [ + "gameplane", + "homelab-01", + "GENERAL", + "Dashboard", + "Servers", + "Modules", + "Backups", + "ADMIN", + "Clusters", + "Nodes", + "Users & RBAC", + "Audit log", + "System logs", + "Settings", + "AD", + "admin", + "admin" + ] + }, + { + "id": "1:46431", + "name": "Main", + "type": "FRAME", + "x": 260, + "y": 0, + "width": 1180, + "height": 900, + "fills": [{"type": "SOLID", "color": "#121114"}], + "layout": { + "mode": "VERTICAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "FIXED"] + }, + "layoutGrow": 1, + "layoutAlignSelf": "STRETCH", + "variables": {"fills/0/color": "background/background"}, + "children": [ + { + "name": "Top Bar", + "type": "INSTANCE", + "x": 0, + "y": 0, + "width": 1180, + "height": 64, + "component": "Gameplane/Top Bar", + "componentId": "1:281", + "fills": [{"type": "SOLID", "color": "#121114"}], + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 32, 0, 32], + "primary": "SPACE_BETWEEN", + "counter": "CENTER", + "sizing": ["FIXED", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"fills/0/color": "background/background", "strokes/0/color": "border/border"}, + "texts": ["gameplane", "Clusters", "Search servers…", "AD"] + }, + { + "id": "1:46517", + "name": "Body", + "type": "FRAME", + "x": 0, + "y": 64, + "width": 1180, + "height": 836, + "layout": { + "mode": "VERTICAL", + "gap": 24, + "padding": [24, 24, 24, 24], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "FIXED"] + }, + "layoutGrow": 1, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "name": "Clusters header", + "type": "INSTANCE", + "x": 24, + "y": 24, + "width": 1132, + "height": 53, + "component": "Gameplane/Page Header", + "componentId": "1:3282", + "fills": [{"type": "SOLID", "color": "#121114"}], + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "SPACE_BETWEEN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"fills/0/color": "background/background"}, + "texts": ["Clusters", "Registered clusters, connectivity and node inventory."] + }, + { + "id": "1:46578", + "name": "API status scope", + "type": "TEXT", + "x": 24, + "y": 101, + "width": 1132, + "height": 18, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "layoutAlignSelf": "STRETCH", + "text": "2 clusters available · Status reports Kubernetes API connectivity, not game or gateway health.", + "font": ["Geist", 400, 14], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "muted"} + }, + { + "id": "1:46579", + "name": "Registered cluster cards", + "type": "FRAME", + "x": 24, + "y": 143, + "width": 1132, + "height": 247, + "layout": { + "mode": "HORIZONTAL", + "gap": 16, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "id": "1:46685", + "name": "local cluster", + "type": "FRAME", + "x": 0, + "y": 0, + "width": 558, + "height": 247, + "fills": [{"type": "SOLID", "color": "#1C1A20"}], + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "cornerRadius": 24, + "layout": { + "mode": "VERTICAL", + "gap": 16, + "padding": [20, 20, 20, 20], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutGrow": 1, + "variables": { + "cornerRadius": "radius/3xl", + "fills/0/color": "surface/surface", + "strokes/0/color": "border/border" + }, + "children": [ + { + "id": "1:46774", + "name": "Cluster name", + "type": "TEXT", + "x": 20, + "y": 20, + "width": 42, + "height": 23, + "fills": [{"type": "SOLID", "color": "#F5F3F7"}], + "text": "local", + "font": ["Geist", 600, 18], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + }, + { + "id": "1:46775", + "name": "Stable cluster identity", + "type": "TEXT", + "x": 20, + "y": 59, + "width": 37, + "height": 16, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "text": "local", + "font": ["JetBrains Mono", 400, 12], + "variables": {"fontFamily": "typography/font-mono", "fills/0/color": "muted"} + }, + { + "id": "1:46776", + "name": "API connectivity", + "type": "TEXT", + "x": 20, + "y": 91, + "width": 79, + "height": 18, + "fills": [{"type": "SOLID", "color": "#21C45D"}], + "text": "API: Healthy", + "font": ["Geist", 400, 14], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "success/success"} + }, + { + "id": "1:46777", + "name": "Central cluster label", + "type": "TEXT", + "x": 20, + "y": 125, + "width": 95, + "height": 18, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "text": "Central cluster", + "font": ["Geist", 400, 14], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "muted"} + }, + { + "id": "1:46778", + "name": "Last check", + "type": "TEXT", + "x": 20, + "y": 159, + "width": 124, + "height": 16, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "text": "Last checked just now", + "font": ["Geist", 400, 12], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "muted"} + }, + { + "id": "1:46779", + "name": "Cluster actions", + "type": "FRAME", + "x": 20, + "y": 191, + "width": 233, + "height": 36, + "layout": { + "mode": "HORIZONTAL", + "gap": 8, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "HUG"] + }, + "children": [ + { + "name": "Open cluster", + "type": "INSTANCE", + "x": 0, + "y": 0, + "width": 117, + "height": 36, + "component": "Button/Primary/MD", + "componentId": "1:1094", + "fills": [{"type": "SOLID", "color": "#FF4FA3"}], + "cornerRadius": 24, + "layout": { + "mode": "HORIZONTAL", + "gap": 8, + "padding": [8, 16, 8, 16], + "primary": "CENTER", + "counter": "CENTER", + "sizing": ["HUG", "FIXED"] + }, + "variables": { + "itemSpacing": "spacing/2", + "cornerRadius": "radius/3xl", + "paddingRight": "spacing/4", + "paddingLeft": "spacing/4", + "fills/0/color": "accent/accent" + }, + "texts": ["Open cluster"] + }, + { + "name": "View nodes", + "type": "INSTANCE", + "x": 125, + "y": 0, + "width": 108, + "height": 36, + "component": "Button/Outline/MD", + "componentId": "1:1794", + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "cornerRadius": 24, + "layout": { + "mode": "HORIZONTAL", + "gap": 8, + "padding": [8, 16, 8, 16], + "primary": "CENTER", + "counter": "CENTER", + "sizing": ["HUG", "FIXED"] + }, + "variables": { + "itemSpacing": "spacing/2", + "cornerRadius": "radius/3xl", + "paddingRight": "spacing/4", + "paddingLeft": "spacing/4", + "strokes/0/color": "border-2" + }, + "texts": ["View nodes"] + } + ] + } + ] + }, + { + "id": "1:46686", + "name": "remote-lab cluster", + "type": "FRAME", + "x": 574, + "y": 0, + "width": 558, + "height": 213, + "fills": [{"type": "SOLID", "color": "#1C1A20"}], + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "cornerRadius": 24, + "layout": { + "mode": "VERTICAL", + "gap": 16, + "padding": [20, 20, 20, 20], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutGrow": 1, + "variables": { + "cornerRadius": "radius/3xl", + "fills/0/color": "surface/surface", + "strokes/0/color": "border/border" + }, + "children": [ + { + "id": "1:46780", + "name": "Cluster name", + "type": "TEXT", + "x": 20, + "y": 20, + "width": 96, + "height": 23, + "fills": [{"type": "SOLID", "color": "#F5F3F7"}], + "text": "remote-lab", + "font": ["Geist", 600, 18], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + }, + { + "id": "1:46781", + "name": "Stable cluster identity", + "type": "TEXT", + "x": 20, + "y": 59, + "width": 73, + "height": 16, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "text": "remote-lab", + "font": ["JetBrains Mono", 400, 12], + "variables": {"fontFamily": "typography/font-mono", "fills/0/color": "muted"} + }, + { + "id": "1:46782", + "name": "API connectivity", + "type": "TEXT", + "x": 20, + "y": 91, + "width": 79, + "height": 18, + "fills": [{"type": "SOLID", "color": "#21C45D"}], + "text": "API: Healthy", + "font": ["Geist", 400, 14], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "success/success"} + }, + { + "id": "1:46783", + "name": "Last check", + "type": "TEXT", + "x": 20, + "y": 125, + "width": 124, + "height": 16, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "text": "Last checked just now", + "font": ["Geist", 400, 12], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "muted"} + }, + { + "id": "1:46784", + "name": "Cluster actions", + "type": "FRAME", + "x": 20, + "y": 157, + "width": 233, + "height": 36, + "layout": { + "mode": "HORIZONTAL", + "gap": 8, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "HUG"] + }, + "children": [ + { + "name": "Open cluster", + "type": "INSTANCE", + "x": 0, + "y": 0, + "width": 117, + "height": 36, + "component": "Button/Primary/MD", + "componentId": "1:1094", + "fills": [{"type": "SOLID", "color": "#FF4FA3"}], + "cornerRadius": 24, + "layout": { + "mode": "HORIZONTAL", + "gap": 8, + "padding": [8, 16, 8, 16], + "primary": "CENTER", + "counter": "CENTER", + "sizing": ["HUG", "FIXED"] + }, + "variables": { + "itemSpacing": "spacing/2", + "cornerRadius": "radius/3xl", + "paddingRight": "spacing/4", + "paddingLeft": "spacing/4", + "fills/0/color": "accent/accent" + }, + "texts": ["Open cluster"] + }, + { + "name": "View nodes", + "type": "INSTANCE", + "x": 125, + "y": 0, + "width": 108, + "height": 36, + "component": "Button/Outline/MD", + "componentId": "1:1794", + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "cornerRadius": 24, + "layout": { + "mode": "HORIZONTAL", + "gap": 8, + "padding": [8, 16, 8, 16], + "primary": "CENTER", + "counter": "CENTER", + "sizing": ["HUG", "FIXED"] + }, + "variables": { + "itemSpacing": "spacing/2", + "cornerRadius": "radius/3xl", + "paddingRight": "spacing/4", + "paddingLeft": "spacing/4", + "strokes/0/color": "border-2" + }, + "texts": ["View nodes"] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "id": "1:46432", + "name": "Backdrop", + "type": "RECTANGLE", + "x": 0, + "y": 0, + "width": 1440, + "height": 900, + "fills": [{"type": "SOLID", "color": "#000000", "opacity": 0.5}], + "absolute": true + }, + { + "id": "1:46433", + "name": "Gameplane/Dialog/Cluster · SFTP (remote-lab)", + "type": "FRAME", + "x": 960, + "y": 0, + "width": 480, + "height": 900, + "fills": [{"type": "SOLID", "color": "#1C1A20"}], + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "absolute": true, + "clips": true, + "variables": {"fills/0/color": "surface/surface", "strokes/0/color": "border/border"}, + "children": [ + { + "id": "1:46518", + "name": "mTitle", + "type": "TEXT", + "x": 20, + "y": 20, + "width": 137, + "height": 24, + "fills": [{"type": "SOLID", "color": "#F5F3F7"}], + "text": "SFTP · remote-lab", + "font": ["Geist", 600, 16], + "lineHeight": {"value": 150, "unit": "PERCENT"}, + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + }, + { + "id": "1:46519", + "name": "mDescWrap", + "type": "FRAME", + "x": 20, + "y": 44, + "width": 440, + "height": 46, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [4, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "id": "1:46580", + "name": "mDesc", + "type": "TEXT", + "x": 0, + "y": 4, + "width": 440, + "height": 42, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "layoutGrow": 1, + "text": "Users connect to this address with their own SSH key or SFTP password. Their permissions on this cluster decide what they see.", + "font": ["Geist", 400, 14], + "lineHeight": {"value": 150, "unit": "PERCENT"}, + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "muted"} + } + ] + }, + { + "id": "1:46520", + "name": "mFooter", + "type": "FRAME", + "x": 20, + "y": 828, + "width": 440, + "height": 52, + "layout": { + "mode": "HORIZONTAL", + "gap": 8, + "padding": [20, 0, 0, 0], + "primary": "MAX", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "id": "1:46581", + "name": "btnCancel", + "type": "FRAME", + "x": 263, + "y": 20, + "width": 64, + "height": 32, + "cornerRadius": 6, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 12, 0, 12], + "primary": "CENTER", + "counter": "CENTER", + "sizing": ["HUG", "FIXED"] + }, + "children": [ + { + "id": "1:46687", + "name": "text", + "type": "TEXT", + "x": 12, + "y": 8, + "width": 40, + "height": 16, + "fills": [{"type": "SOLID", "color": "#F5F3F7"}], + "text": "Cancel", + "font": ["Geist", 500, 12], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + } + ] + }, + { + "id": "1:46582", + "name": "btnPrimary", + "type": "FRAME", + "x": 335, + "y": 20, + "width": 105, + "height": 32, + "opacity": 0.5, + "fills": [{"type": "SOLID", "color": "#FF4FA3"}], + "cornerRadius": 6, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 12, 0, 12], + "primary": "CENTER", + "counter": "CENTER", + "sizing": ["HUG", "FIXED"] + }, + "variables": {"fills/0/color": "accent/accent"}, + "children": [ + { + "id": "1:46688", + "name": "text", + "type": "TEXT", + "x": 12, + "y": 8, + "width": 81, + "height": 16, + "fills": [{"type": "SOLID", "color": "#FFFFFF"}], + "text": "Save endpoint", + "font": ["Geist", 500, 12], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "accent/foreground"} + } + ] + } + ] + }, + { + "id": "1:46521", + "name": "Body", + "type": "FRAME", + "x": 20, + "y": 108, + "width": 440, + "height": 376, + "children": [ + { + "id": "1:46583", + "name": "cardBody", + "type": "TEXT", + "x": 0, + "y": 0, + "width": 368, + "height": 18, + "fills": [{"type": "SOLID", "color": "#F5F3F7"}], + "layoutAlignSelf": "STRETCH", + "text": "Address", + "font": ["Geist", 400, 14], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + }, + { + "name": "Gameplane/Input", + "type": "INSTANCE", + "x": 0, + "y": 22, + "width": 440, + "height": 36, + "component": "Gameplane/Input", + "componentId": "1:706", + "fills": [{"type": "SOLID", "color": "#17151A"}], + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "effects": [{"type": "DROP_SHADOW", "radius": 2, "visible": true}], + "cornerRadius": 12, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [8, 12, 8, 12], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "FIXED"] + }, + "variables": { + "cornerRadius": "radius/xl", + "fills/0/color": "field/background", + "strokes/0/color": "field/border" + }, + "texts": ["sftp.remote-lab.example:2222"] + }, + { + "id": "1:46584", + "name": "cardBody", + "type": "TEXT", + "x": 0, + "y": 76, + "width": 368, + "height": 18, + "fills": [{"type": "SOLID", "color": "#F5F3F7"}], + "layoutAlignSelf": "STRETCH", + "text": "Host key fingerprint (from the cluster registration)", + "font": ["Geist", 400, 14], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + }, + { + "id": "1:46585", + "name": "text", + "type": "TEXT", + "x": 0, + "y": 98, + "width": 362, + "height": 18, + "fills": [{"type": "SOLID", "color": "#F5F3F7"}], + "text": "SHA256:4mQ2xR7vK9pL0wZ3sB8nT1cY6hJ5gF2dA0eU", + "font": ["JetBrains Mono", 600, 14], + "variables": {"fontFamily": "typography/font-mono", "fills/0/color": "foreground/foreground"} + }, + { + "id": "1:46586", + "name": "Divider", + "type": "RECTANGLE", + "x": 0, + "y": 124, + "width": 440, + "height": 1 + }, + { + "id": "1:46587", + "name": "cardTitle", + "type": "TEXT", + "x": 0, + "y": 140, + "width": 222, + "height": 21, + "fills": [{"type": "SOLID", "color": "#F5F3F7"}], + "text": "Endpoint tokens · 1 of 2 in use", + "font": ["Geist", 500, 16], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + }, + { + "id": "1:46588", + "name": "text", + "type": "TEXT", + "x": 0, + "y": 224, + "width": 126, + "height": 18, + "fills": [{"type": "SOLID", "color": "#F5F3F7"}], + "text": "remote-lab-sftp", + "font": ["JetBrains Mono", 600, 14], + "variables": {"fontFamily": "typography/font-mono", "fills/0/color": "foreground/foreground"} + }, + { + "id": "1:46589", + "name": "cardBody", + "type": "TEXT", + "x": 0, + "y": 248, + "width": 368, + "height": 18, + "fills": [{"type": "SOLID", "color": "#F5F3F7"}], + "layoutAlignSelf": "STRETCH", + "text": "Created 3 Oct 2026 · Last used 4 minutes ago", + "font": ["Geist", 400, 14], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + }, + { + "name": "Gameplane/Button/Small/Danger", + "type": "INSTANCE", + "x": 348, + "y": 216, + "width": 92, + "height": 32, + "component": "Gameplane/Button/Small/Danger", + "componentId": "1:1878", + "fills": [{"type": "SOLID", "color": "#00000000", "opacity": 0}], + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "CENTER", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "texts": ["Revoke"] + }, + { + "name": "Gameplane/Button/Outline", + "type": "INSTANCE", + "x": 0, + "y": 278, + "width": 130, + "height": 32, + "component": "Gameplane/Button/Outline", + "componentId": "1:770", + "fills": [{"type": "SOLID", "color": "#00000000", "opacity": 0}], + "strokes": [{"type": "SOLID", "color": "#00000000", "opacity": 0}], + "strokeWeight": 1, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "CENTER", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "texts": ["Create token"] + }, + { + "id": "1:46590", + "name": "cardBody", + "type": "TEXT", + "x": 0, + "y": 324, + "width": 440, + "height": 36, + "fills": [{"type": "SOLID", "color": "#F5F3F7"}], + "layoutAlignSelf": "STRETCH", + "text": "A cluster can have at most 2 active tokens. Revoking a token stops that endpoint from logging users in.", + "font": ["Geist", 400, 14], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + }, + { + "id": "1:46591", + "name": "cardBody", + "type": "TEXT", + "x": 0, + "y": 165, + "width": 440, + "height": 34, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "layoutAlignSelf": "STRETCH", + "text": "Used only by this cluster's SFTP server to reach the central API. Never give these to users.", + "font": ["Geist", 400, 13], + "variables": {"fontFamily": "typography/font-sans"} + } + ] + } + ] + } + ] +} diff --git a/assets/design-export/json/1-46397.json b/assets/design-export/json/1-46397.json new file mode 100644 index 000000000..4f037585a --- /dev/null +++ b/assets/design-export/json/1-46397.json @@ -0,0 +1,774 @@ +{ + "file": "1-46397", + "id": "1:46397", + "name": "Screen/Clusters — SFTP (remote-lab) — Token created", + "type": "FRAME", + "x": 33310, + "y": 68073, + "width": 1440, + "height": 900, + "fills": [{"type": "SOLID", "color": "#121114"}], + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "FIXED"] + }, + "clips": true, + "variables": {"fills/0/color": "background/background"}, + "children": [ + { + "name": "App Sidebar", + "type": "INSTANCE", + "x": 0, + "y": 0, + "width": 260, + "height": 900, + "component": "Gameplane/App Sidebar", + "componentId": "1:234", + "fills": [{"type": "SOLID", "color": "#17151A"}], + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "layout": { + "mode": "VERTICAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"fills/0/color": "surface/secondary", "strokes/0/color": "border/border"}, + "texts": [ + "gameplane", + "homelab-01", + "GENERAL", + "Dashboard", + "Servers", + "Modules", + "Backups", + "ADMIN", + "Clusters", + "Nodes", + "Users & RBAC", + "Audit log", + "System logs", + "Settings", + "AD", + "admin", + "admin" + ] + }, + { + "id": "1:46434", + "name": "Main", + "type": "FRAME", + "x": 260, + "y": 0, + "width": 1180, + "height": 900, + "fills": [{"type": "SOLID", "color": "#121114"}], + "layout": { + "mode": "VERTICAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "FIXED"] + }, + "layoutGrow": 1, + "layoutAlignSelf": "STRETCH", + "variables": {"fills/0/color": "background/background"}, + "children": [ + { + "name": "Top Bar", + "type": "INSTANCE", + "x": 0, + "y": 0, + "width": 1180, + "height": 64, + "component": "Gameplane/Top Bar", + "componentId": "1:281", + "fills": [{"type": "SOLID", "color": "#121114"}], + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 32, 0, 32], + "primary": "SPACE_BETWEEN", + "counter": "CENTER", + "sizing": ["FIXED", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"fills/0/color": "background/background", "strokes/0/color": "border/border"}, + "texts": ["gameplane", "Clusters", "Search servers…", "AD"] + }, + { + "id": "1:46522", + "name": "Body", + "type": "FRAME", + "x": 0, + "y": 64, + "width": 1180, + "height": 836, + "layout": { + "mode": "VERTICAL", + "gap": 24, + "padding": [24, 24, 24, 24], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "FIXED"] + }, + "layoutGrow": 1, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "name": "Clusters header", + "type": "INSTANCE", + "x": 24, + "y": 24, + "width": 1132, + "height": 53, + "component": "Gameplane/Page Header", + "componentId": "1:3282", + "fills": [{"type": "SOLID", "color": "#121114"}], + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "SPACE_BETWEEN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"fills/0/color": "background/background"}, + "texts": ["Clusters", "Registered clusters, connectivity and node inventory."] + }, + { + "id": "1:46592", + "name": "API status scope", + "type": "TEXT", + "x": 24, + "y": 101, + "width": 1132, + "height": 18, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "layoutAlignSelf": "STRETCH", + "text": "2 clusters available · Status reports Kubernetes API connectivity, not game or gateway health.", + "font": ["Geist", 400, 14], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "muted"} + }, + { + "id": "1:46593", + "name": "Registered cluster cards", + "type": "FRAME", + "x": 24, + "y": 143, + "width": 1132, + "height": 247, + "layout": { + "mode": "HORIZONTAL", + "gap": 16, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "id": "1:46689", + "name": "local cluster", + "type": "FRAME", + "x": 0, + "y": 0, + "width": 558, + "height": 247, + "fills": [{"type": "SOLID", "color": "#1C1A20"}], + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "cornerRadius": 24, + "layout": { + "mode": "VERTICAL", + "gap": 16, + "padding": [20, 20, 20, 20], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutGrow": 1, + "variables": { + "cornerRadius": "radius/3xl", + "fills/0/color": "surface/surface", + "strokes/0/color": "border/border" + }, + "children": [ + { + "id": "1:46785", + "name": "Cluster name", + "type": "TEXT", + "x": 20, + "y": 20, + "width": 42, + "height": 23, + "fills": [{"type": "SOLID", "color": "#F5F3F7"}], + "text": "local", + "font": ["Geist", 600, 18], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + }, + { + "id": "1:46786", + "name": "Stable cluster identity", + "type": "TEXT", + "x": 20, + "y": 59, + "width": 37, + "height": 16, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "text": "local", + "font": ["JetBrains Mono", 400, 12], + "variables": {"fontFamily": "typography/font-mono", "fills/0/color": "muted"} + }, + { + "id": "1:46787", + "name": "API connectivity", + "type": "TEXT", + "x": 20, + "y": 91, + "width": 79, + "height": 18, + "fills": [{"type": "SOLID", "color": "#21C45D"}], + "text": "API: Healthy", + "font": ["Geist", 400, 14], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "success/success"} + }, + { + "id": "1:46788", + "name": "Central cluster label", + "type": "TEXT", + "x": 20, + "y": 125, + "width": 95, + "height": 18, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "text": "Central cluster", + "font": ["Geist", 400, 14], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "muted"} + }, + { + "id": "1:46789", + "name": "Last check", + "type": "TEXT", + "x": 20, + "y": 159, + "width": 124, + "height": 16, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "text": "Last checked just now", + "font": ["Geist", 400, 12], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "muted"} + }, + { + "id": "1:46790", + "name": "Cluster actions", + "type": "FRAME", + "x": 20, + "y": 191, + "width": 233, + "height": 36, + "layout": { + "mode": "HORIZONTAL", + "gap": 8, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "HUG"] + }, + "children": [ + { + "name": "Open cluster", + "type": "INSTANCE", + "x": 0, + "y": 0, + "width": 117, + "height": 36, + "component": "Button/Primary/MD", + "componentId": "1:1094", + "fills": [{"type": "SOLID", "color": "#FF4FA3"}], + "cornerRadius": 24, + "layout": { + "mode": "HORIZONTAL", + "gap": 8, + "padding": [8, 16, 8, 16], + "primary": "CENTER", + "counter": "CENTER", + "sizing": ["HUG", "FIXED"] + }, + "variables": { + "itemSpacing": "spacing/2", + "cornerRadius": "radius/3xl", + "paddingRight": "spacing/4", + "paddingLeft": "spacing/4", + "fills/0/color": "accent/accent" + }, + "texts": ["Open cluster"] + }, + { + "name": "View nodes", + "type": "INSTANCE", + "x": 125, + "y": 0, + "width": 108, + "height": 36, + "component": "Button/Outline/MD", + "componentId": "1:1794", + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "cornerRadius": 24, + "layout": { + "mode": "HORIZONTAL", + "gap": 8, + "padding": [8, 16, 8, 16], + "primary": "CENTER", + "counter": "CENTER", + "sizing": ["HUG", "FIXED"] + }, + "variables": { + "itemSpacing": "spacing/2", + "cornerRadius": "radius/3xl", + "paddingRight": "spacing/4", + "paddingLeft": "spacing/4", + "strokes/0/color": "border-2" + }, + "texts": ["View nodes"] + } + ] + } + ] + }, + { + "id": "1:46690", + "name": "remote-lab cluster", + "type": "FRAME", + "x": 574, + "y": 0, + "width": 558, + "height": 213, + "fills": [{"type": "SOLID", "color": "#1C1A20"}], + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "cornerRadius": 24, + "layout": { + "mode": "VERTICAL", + "gap": 16, + "padding": [20, 20, 20, 20], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutGrow": 1, + "variables": { + "cornerRadius": "radius/3xl", + "fills/0/color": "surface/surface", + "strokes/0/color": "border/border" + }, + "children": [ + { + "id": "1:46791", + "name": "Cluster name", + "type": "TEXT", + "x": 20, + "y": 20, + "width": 96, + "height": 23, + "fills": [{"type": "SOLID", "color": "#F5F3F7"}], + "text": "remote-lab", + "font": ["Geist", 600, 18], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + }, + { + "id": "1:46792", + "name": "Stable cluster identity", + "type": "TEXT", + "x": 20, + "y": 59, + "width": 73, + "height": 16, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "text": "remote-lab", + "font": ["JetBrains Mono", 400, 12], + "variables": {"fontFamily": "typography/font-mono", "fills/0/color": "muted"} + }, + { + "id": "1:46793", + "name": "API connectivity", + "type": "TEXT", + "x": 20, + "y": 91, + "width": 79, + "height": 18, + "fills": [{"type": "SOLID", "color": "#21C45D"}], + "text": "API: Healthy", + "font": ["Geist", 400, 14], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "success/success"} + }, + { + "id": "1:46794", + "name": "Last check", + "type": "TEXT", + "x": 20, + "y": 125, + "width": 124, + "height": 16, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "text": "Last checked just now", + "font": ["Geist", 400, 12], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "muted"} + }, + { + "id": "1:46795", + "name": "Cluster actions", + "type": "FRAME", + "x": 20, + "y": 157, + "width": 233, + "height": 36, + "layout": { + "mode": "HORIZONTAL", + "gap": 8, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "HUG"] + }, + "children": [ + { + "name": "Open cluster", + "type": "INSTANCE", + "x": 0, + "y": 0, + "width": 117, + "height": 36, + "component": "Button/Primary/MD", + "componentId": "1:1094", + "fills": [{"type": "SOLID", "color": "#FF4FA3"}], + "cornerRadius": 24, + "layout": { + "mode": "HORIZONTAL", + "gap": 8, + "padding": [8, 16, 8, 16], + "primary": "CENTER", + "counter": "CENTER", + "sizing": ["HUG", "FIXED"] + }, + "variables": { + "itemSpacing": "spacing/2", + "cornerRadius": "radius/3xl", + "paddingRight": "spacing/4", + "paddingLeft": "spacing/4", + "fills/0/color": "accent/accent" + }, + "texts": ["Open cluster"] + }, + { + "name": "View nodes", + "type": "INSTANCE", + "x": 125, + "y": 0, + "width": 108, + "height": 36, + "component": "Button/Outline/MD", + "componentId": "1:1794", + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "cornerRadius": 24, + "layout": { + "mode": "HORIZONTAL", + "gap": 8, + "padding": [8, 16, 8, 16], + "primary": "CENTER", + "counter": "CENTER", + "sizing": ["HUG", "FIXED"] + }, + "variables": { + "itemSpacing": "spacing/2", + "cornerRadius": "radius/3xl", + "paddingRight": "spacing/4", + "paddingLeft": "spacing/4", + "strokes/0/color": "border-2" + }, + "texts": ["View nodes"] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "id": "1:46435", + "name": "Backdrop", + "type": "RECTANGLE", + "x": 0, + "y": 0, + "width": 1440, + "height": 900, + "fills": [{"type": "SOLID", "color": "#000000", "opacity": 0.5}], + "absolute": true + }, + { + "id": "1:46436", + "name": "Gameplane/Dialog/Cluster · SFTP token created (Shown once)", + "type": "FRAME", + "x": 960, + "y": 0, + "width": 480, + "height": 900, + "fills": [{"type": "SOLID", "color": "#1C1A20"}], + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "absolute": true, + "clips": true, + "variables": {"fills/0/color": "surface/surface", "strokes/0/color": "border/border"}, + "children": [ + { + "id": "1:46523", + "name": "mTitle", + "type": "TEXT", + "x": 20, + "y": 20, + "width": 180, + "height": 24, + "fills": [{"type": "SOLID", "color": "#F5F3F7"}], + "text": "Endpoint token created", + "font": ["Geist", 600, 16], + "lineHeight": {"value": 150, "unit": "PERCENT"}, + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + }, + { + "id": "1:46524", + "name": "mDescWrap", + "type": "FRAME", + "x": 20, + "y": 44, + "width": 440, + "height": 25, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [4, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "id": "1:46594", + "name": "mDesc", + "type": "TEXT", + "x": 0, + "y": 4, + "width": 440, + "height": 21, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "layoutGrow": 1, + "text": "Copy it now. Gameplane stores only a hash and cannot show it again.", + "font": ["Geist", 400, 14], + "lineHeight": {"value": 150, "unit": "PERCENT"}, + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "muted"} + } + ] + }, + { + "id": "1:46525", + "name": "mFooter", + "type": "FRAME", + "x": 20, + "y": 828, + "width": 440, + "height": 52, + "layout": { + "mode": "HORIZONTAL", + "gap": 8, + "padding": [20, 0, 0, 0], + "primary": "MAX", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "id": "1:46595", + "name": "btnCancel", + "type": "FRAME", + "x": 266, + "y": 20, + "width": 64, + "height": 32, + "visible": false, + "cornerRadius": 6, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 12, 0, 12], + "primary": "CENTER", + "counter": "CENTER", + "sizing": ["HUG", "FIXED"] + }, + "children": [ + { + "id": "1:46691", + "name": "text", + "type": "TEXT", + "x": 12, + "y": 8, + "width": 40, + "height": 16, + "fills": [{"type": "SOLID", "color": "#F5F3F7"}], + "text": "Cancel", + "font": ["Geist", 500, 12], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + } + ] + }, + { + "id": "1:46596", + "name": "btnPrimary", + "type": "FRAME", + "x": 386, + "y": 20, + "width": 54, + "height": 32, + "opacity": 0.5, + "fills": [{"type": "SOLID", "color": "#FF4FA3"}], + "cornerRadius": 6, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 12, 0, 12], + "primary": "CENTER", + "counter": "CENTER", + "sizing": ["HUG", "FIXED"] + }, + "variables": {"fills/0/color": "accent/accent"}, + "children": [ + { + "id": "1:46692", + "name": "text", + "type": "TEXT", + "x": 12, + "y": 8, + "width": 30, + "height": 16, + "fills": [{"type": "SOLID", "color": "#FFFFFF"}], + "text": "Done", + "font": ["Geist", 500, 12], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "accent/foreground"} + } + ] + } + ] + }, + { + "id": "1:46526", + "name": "Body", + "type": "FRAME", + "x": 20, + "y": 85, + "width": 440, + "height": 180, + "children": [ + { + "name": "Gameplane/Error Banner", + "type": "INSTANCE", + "x": 0, + "y": 0, + "width": 440, + "height": 64, + "component": "Gameplane/Error Banner", + "componentId": "1:4577", + "fills": [{"type": "SOLID", "color": "#1C1A20"}], + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "cornerRadius": 6, + "layout": { + "mode": "HORIZONTAL", + "gap": 8, + "padding": [12, 12, 12, 12], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "FIXED"] + }, + "variables": { + "cornerRadius": "radius/md", + "fills/0/color": "surface/surface", + "strokes/0/color": "border/border" + }, + "texts": [ + "You will not see this again. Put it in the remote cluster’s SFTP secret before you close this dialog." + ] + }, + { + "id": "1:46597", + "name": "Token box", + "type": "FRAME", + "x": 0, + "y": 80, + "width": 440, + "height": 48, + "fills": [{"type": "SOLID", "color": "#1C1A20"}], + "cornerRadius": 24, + "variables": {"fills/0/color": "surface/surface"}, + "children": [ + { + "id": "1:46693", + "name": "text", + "type": "TEXT", + "x": 12, + "y": 15, + "width": 320, + "height": 18, + "fills": [{"type": "SOLID", "color": "#F5F3F7"}], + "text": "gpsftps_7Kq2mX9vT4wR1sL8pN3dB6hY0cF5jA", + "font": ["JetBrains Mono", 600, 14], + "variables": {"fontFamily": "typography/font-mono", "fills/0/color": "foreground/foreground"} + } + ] + }, + { + "name": "Gameplane/Button/Small/Outline", + "type": "INSTANCE", + "x": 0, + "y": 144, + "width": 84, + "height": 32, + "component": "Gameplane/Button/Small/Outline", + "componentId": "1:740", + "fills": [{"type": "SOLID", "color": "#00000000", "opacity": 0}], + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "CENTER", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "variables": {"strokes/0/color": "border/border"}, + "texts": ["Copy"] + } + ] + } + ] + } + ] +} diff --git a/assets/design-export/json/1-46398.json b/assets/design-export/json/1-46398.json new file mode 100644 index 000000000..145a07f7a --- /dev/null +++ b/assets/design-export/json/1-46398.json @@ -0,0 +1,838 @@ +{ + "file": "1-46398", + "id": "1:46398", + "name": "Screen/Clusters — SFTP (remote-lab) — Token limit", + "type": "FRAME", + "x": 34950, + "y": 68073, + "width": 1440, + "height": 900, + "fills": [{"type": "SOLID", "color": "#121114"}], + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "FIXED"] + }, + "clips": true, + "variables": {"fills/0/color": "background/background"}, + "children": [ + { + "name": "App Sidebar", + "type": "INSTANCE", + "x": 0, + "y": 0, + "width": 260, + "height": 900, + "component": "Gameplane/App Sidebar", + "componentId": "1:234", + "fills": [{"type": "SOLID", "color": "#17151A"}], + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "layout": { + "mode": "VERTICAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"fills/0/color": "surface/secondary", "strokes/0/color": "border/border"}, + "texts": [ + "gameplane", + "homelab-01", + "GENERAL", + "Dashboard", + "Servers", + "Modules", + "Backups", + "ADMIN", + "Clusters", + "Nodes", + "Users & RBAC", + "Audit log", + "System logs", + "Settings", + "AD", + "admin", + "admin" + ] + }, + { + "id": "1:46437", + "name": "Main", + "type": "FRAME", + "x": 260, + "y": 0, + "width": 1180, + "height": 900, + "fills": [{"type": "SOLID", "color": "#121114"}], + "layout": { + "mode": "VERTICAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "FIXED"] + }, + "layoutGrow": 1, + "layoutAlignSelf": "STRETCH", + "variables": {"fills/0/color": "background/background"}, + "children": [ + { + "name": "Top Bar", + "type": "INSTANCE", + "x": 0, + "y": 0, + "width": 1180, + "height": 64, + "component": "Gameplane/Top Bar", + "componentId": "1:281", + "fills": [{"type": "SOLID", "color": "#121114"}], + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 32, 0, 32], + "primary": "SPACE_BETWEEN", + "counter": "CENTER", + "sizing": ["FIXED", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"fills/0/color": "background/background", "strokes/0/color": "border/border"}, + "texts": ["gameplane", "Clusters", "Search servers…", "AD"] + }, + { + "id": "1:46527", + "name": "Body", + "type": "FRAME", + "x": 0, + "y": 64, + "width": 1180, + "height": 836, + "layout": { + "mode": "VERTICAL", + "gap": 24, + "padding": [24, 24, 24, 24], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "FIXED"] + }, + "layoutGrow": 1, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "name": "Clusters header", + "type": "INSTANCE", + "x": 24, + "y": 24, + "width": 1132, + "height": 53, + "component": "Gameplane/Page Header", + "componentId": "1:3282", + "fills": [{"type": "SOLID", "color": "#121114"}], + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "SPACE_BETWEEN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"fills/0/color": "background/background"}, + "texts": ["Clusters", "Registered clusters, connectivity and node inventory."] + }, + { + "id": "1:46598", + "name": "API status scope", + "type": "TEXT", + "x": 24, + "y": 101, + "width": 1132, + "height": 18, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "layoutAlignSelf": "STRETCH", + "text": "2 clusters available · Status reports Kubernetes API connectivity, not game or gateway health.", + "font": ["Geist", 400, 14], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "muted"} + }, + { + "id": "1:46599", + "name": "Registered cluster cards", + "type": "FRAME", + "x": 24, + "y": 143, + "width": 1132, + "height": 247, + "layout": { + "mode": "HORIZONTAL", + "gap": 16, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "id": "1:46694", + "name": "local cluster", + "type": "FRAME", + "x": 0, + "y": 0, + "width": 558, + "height": 247, + "fills": [{"type": "SOLID", "color": "#1C1A20"}], + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "cornerRadius": 24, + "layout": { + "mode": "VERTICAL", + "gap": 16, + "padding": [20, 20, 20, 20], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutGrow": 1, + "variables": { + "cornerRadius": "radius/3xl", + "fills/0/color": "surface/surface", + "strokes/0/color": "border/border" + }, + "children": [ + { + "id": "1:46796", + "name": "Cluster name", + "type": "TEXT", + "x": 20, + "y": 20, + "width": 42, + "height": 23, + "fills": [{"type": "SOLID", "color": "#F5F3F7"}], + "text": "local", + "font": ["Geist", 600, 18], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + }, + { + "id": "1:46797", + "name": "Stable cluster identity", + "type": "TEXT", + "x": 20, + "y": 59, + "width": 37, + "height": 16, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "text": "local", + "font": ["JetBrains Mono", 400, 12], + "variables": {"fontFamily": "typography/font-mono", "fills/0/color": "muted"} + }, + { + "id": "1:46798", + "name": "API connectivity", + "type": "TEXT", + "x": 20, + "y": 91, + "width": 79, + "height": 18, + "fills": [{"type": "SOLID", "color": "#21C45D"}], + "text": "API: Healthy", + "font": ["Geist", 400, 14], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "success/success"} + }, + { + "id": "1:46799", + "name": "Central cluster label", + "type": "TEXT", + "x": 20, + "y": 125, + "width": 95, + "height": 18, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "text": "Central cluster", + "font": ["Geist", 400, 14], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "muted"} + }, + { + "id": "1:46800", + "name": "Last check", + "type": "TEXT", + "x": 20, + "y": 159, + "width": 124, + "height": 16, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "text": "Last checked just now", + "font": ["Geist", 400, 12], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "muted"} + }, + { + "id": "1:46801", + "name": "Cluster actions", + "type": "FRAME", + "x": 20, + "y": 191, + "width": 233, + "height": 36, + "layout": { + "mode": "HORIZONTAL", + "gap": 8, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "HUG"] + }, + "children": [ + { + "name": "Open cluster", + "type": "INSTANCE", + "x": 0, + "y": 0, + "width": 117, + "height": 36, + "component": "Button/Primary/MD", + "componentId": "1:1094", + "fills": [{"type": "SOLID", "color": "#FF4FA3"}], + "cornerRadius": 24, + "layout": { + "mode": "HORIZONTAL", + "gap": 8, + "padding": [8, 16, 8, 16], + "primary": "CENTER", + "counter": "CENTER", + "sizing": ["HUG", "FIXED"] + }, + "variables": { + "itemSpacing": "spacing/2", + "cornerRadius": "radius/3xl", + "paddingRight": "spacing/4", + "paddingLeft": "spacing/4", + "fills/0/color": "accent/accent" + }, + "texts": ["Open cluster"] + }, + { + "name": "View nodes", + "type": "INSTANCE", + "x": 125, + "y": 0, + "width": 108, + "height": 36, + "component": "Button/Outline/MD", + "componentId": "1:1794", + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "cornerRadius": 24, + "layout": { + "mode": "HORIZONTAL", + "gap": 8, + "padding": [8, 16, 8, 16], + "primary": "CENTER", + "counter": "CENTER", + "sizing": ["HUG", "FIXED"] + }, + "variables": { + "itemSpacing": "spacing/2", + "cornerRadius": "radius/3xl", + "paddingRight": "spacing/4", + "paddingLeft": "spacing/4", + "strokes/0/color": "border-2" + }, + "texts": ["View nodes"] + } + ] + } + ] + }, + { + "id": "1:46695", + "name": "remote-lab cluster", + "type": "FRAME", + "x": 574, + "y": 0, + "width": 558, + "height": 213, + "fills": [{"type": "SOLID", "color": "#1C1A20"}], + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "cornerRadius": 24, + "layout": { + "mode": "VERTICAL", + "gap": 16, + "padding": [20, 20, 20, 20], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutGrow": 1, + "variables": { + "cornerRadius": "radius/3xl", + "fills/0/color": "surface/surface", + "strokes/0/color": "border/border" + }, + "children": [ + { + "id": "1:46802", + "name": "Cluster name", + "type": "TEXT", + "x": 20, + "y": 20, + "width": 96, + "height": 23, + "fills": [{"type": "SOLID", "color": "#F5F3F7"}], + "text": "remote-lab", + "font": ["Geist", 600, 18], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + }, + { + "id": "1:46803", + "name": "Stable cluster identity", + "type": "TEXT", + "x": 20, + "y": 59, + "width": 73, + "height": 16, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "text": "remote-lab", + "font": ["JetBrains Mono", 400, 12], + "variables": {"fontFamily": "typography/font-mono", "fills/0/color": "muted"} + }, + { + "id": "1:46804", + "name": "API connectivity", + "type": "TEXT", + "x": 20, + "y": 91, + "width": 79, + "height": 18, + "fills": [{"type": "SOLID", "color": "#21C45D"}], + "text": "API: Healthy", + "font": ["Geist", 400, 14], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "success/success"} + }, + { + "id": "1:46805", + "name": "Last check", + "type": "TEXT", + "x": 20, + "y": 125, + "width": 124, + "height": 16, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "text": "Last checked just now", + "font": ["Geist", 400, 12], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "muted"} + }, + { + "id": "1:46806", + "name": "Cluster actions", + "type": "FRAME", + "x": 20, + "y": 157, + "width": 233, + "height": 36, + "layout": { + "mode": "HORIZONTAL", + "gap": 8, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "HUG"] + }, + "children": [ + { + "name": "Open cluster", + "type": "INSTANCE", + "x": 0, + "y": 0, + "width": 117, + "height": 36, + "component": "Button/Primary/MD", + "componentId": "1:1094", + "fills": [{"type": "SOLID", "color": "#FF4FA3"}], + "cornerRadius": 24, + "layout": { + "mode": "HORIZONTAL", + "gap": 8, + "padding": [8, 16, 8, 16], + "primary": "CENTER", + "counter": "CENTER", + "sizing": ["HUG", "FIXED"] + }, + "variables": { + "itemSpacing": "spacing/2", + "cornerRadius": "radius/3xl", + "paddingRight": "spacing/4", + "paddingLeft": "spacing/4", + "fills/0/color": "accent/accent" + }, + "texts": ["Open cluster"] + }, + { + "name": "View nodes", + "type": "INSTANCE", + "x": 125, + "y": 0, + "width": 108, + "height": 36, + "component": "Button/Outline/MD", + "componentId": "1:1794", + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "cornerRadius": 24, + "layout": { + "mode": "HORIZONTAL", + "gap": 8, + "padding": [8, 16, 8, 16], + "primary": "CENTER", + "counter": "CENTER", + "sizing": ["HUG", "FIXED"] + }, + "variables": { + "itemSpacing": "spacing/2", + "cornerRadius": "radius/3xl", + "paddingRight": "spacing/4", + "paddingLeft": "spacing/4", + "strokes/0/color": "border-2" + }, + "texts": ["View nodes"] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "id": "1:46438", + "name": "Backdrop", + "type": "RECTANGLE", + "x": 0, + "y": 0, + "width": 1440, + "height": 900, + "fills": [{"type": "SOLID", "color": "#000000", "opacity": 0.5}], + "absolute": true + }, + { + "id": "1:46439", + "name": "Gameplane/Dialog/Cluster · SFTP token limit reached", + "type": "FRAME", + "x": 960, + "y": 0, + "width": 480, + "height": 900, + "fills": [{"type": "SOLID", "color": "#1C1A20"}], + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "absolute": true, + "clips": true, + "variables": {"fills/0/color": "surface/surface", "strokes/0/color": "border/border"}, + "children": [ + { + "id": "1:46528", + "name": "mTitle", + "type": "TEXT", + "x": 20, + "y": 20, + "width": 137, + "height": 24, + "fills": [{"type": "SOLID", "color": "#F5F3F7"}], + "text": "SFTP · remote-lab", + "font": ["Geist", 600, 16], + "lineHeight": {"value": 150, "unit": "PERCENT"}, + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + }, + { + "id": "1:46529", + "name": "mDescWrap", + "type": "FRAME", + "x": 20, + "y": 44, + "width": 440, + "height": 25, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [4, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "id": "1:46600", + "name": "mDesc", + "type": "TEXT", + "x": 0, + "y": 4, + "width": 440, + "height": 21, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "layoutGrow": 1, + "text": "This cluster already has the maximum of 2 active tokens.", + "font": ["Geist", 400, 14], + "lineHeight": {"value": 150, "unit": "PERCENT"}, + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "muted"} + } + ] + }, + { + "id": "1:46530", + "name": "mFooter", + "type": "FRAME", + "x": 20, + "y": 828, + "width": 440, + "height": 52, + "layout": { + "mode": "HORIZONTAL", + "gap": 8, + "padding": [20, 0, 0, 0], + "primary": "MAX", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "id": "1:46601", + "name": "btnCancel", + "type": "FRAME", + "x": 263, + "y": 20, + "width": 64, + "height": 32, + "cornerRadius": 6, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 12, 0, 12], + "primary": "CENTER", + "counter": "CENTER", + "sizing": ["HUG", "FIXED"] + }, + "children": [ + { + "id": "1:46696", + "name": "text", + "type": "TEXT", + "x": 12, + "y": 8, + "width": 40, + "height": 16, + "fills": [{"type": "SOLID", "color": "#F5F3F7"}], + "text": "Cancel", + "font": ["Geist", 500, 12], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + } + ] + }, + { + "id": "1:46602", + "name": "btnPrimary", + "type": "FRAME", + "x": 335, + "y": 20, + "width": 105, + "height": 32, + "opacity": 0.5, + "fills": [{"type": "SOLID", "color": "#FF4FA3"}], + "cornerRadius": 6, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 12, 0, 12], + "primary": "CENTER", + "counter": "CENTER", + "sizing": ["HUG", "FIXED"] + }, + "variables": {"fills/0/color": "accent/accent"}, + "children": [ + { + "id": "1:46697", + "name": "text", + "type": "TEXT", + "x": 12, + "y": 8, + "width": 81, + "height": 16, + "fills": [{"type": "SOLID", "color": "#FFFFFF"}], + "text": "Save endpoint", + "font": ["Geist", 500, 12], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "accent/foreground"} + } + ] + } + ] + }, + { + "id": "1:46531", + "name": "Body", + "type": "FRAME", + "x": 20, + "y": 85, + "width": 440, + "height": 270, + "children": [ + { + "name": "Gameplane/Error Banner", + "type": "INSTANCE", + "x": 0, + "y": 0, + "width": 440, + "height": 44, + "component": "Gameplane/Error Banner", + "componentId": "1:4577", + "fills": [{"type": "SOLID", "color": "#1C1A20"}], + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "cornerRadius": 6, + "layout": { + "mode": "HORIZONTAL", + "gap": 8, + "padding": [12, 12, 12, 12], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "FIXED"] + }, + "variables": { + "cornerRadius": "radius/md", + "fills/0/color": "surface/surface", + "strokes/0/color": "border/border" + }, + "texts": ["Revoke one token before you can create another."] + }, + { + "id": "1:46603", + "name": "text", + "type": "TEXT", + "x": 0, + "y": 62, + "width": 126, + "height": 18, + "fills": [{"type": "SOLID", "color": "#F5F3F7"}], + "text": "remote-lab-sftp", + "font": ["JetBrains Mono", 600, 14], + "variables": {"fontFamily": "typography/font-mono", "fills/0/color": "foreground/foreground"} + }, + { + "id": "1:46604", + "name": "cardBody", + "type": "TEXT", + "x": 0, + "y": 86, + "width": 368, + "height": 18, + "fills": [{"type": "SOLID", "color": "#F5F3F7"}], + "layoutAlignSelf": "STRETCH", + "text": "Created 3 Oct 2026 · Last used 4 minutes ago", + "font": ["Geist", 400, 14], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + }, + { + "name": "Gameplane/Button/Small/Danger", + "type": "INSTANCE", + "x": 348, + "y": 54, + "width": 92, + "height": 32, + "component": "Gameplane/Button/Small/Danger", + "componentId": "1:1878", + "fills": [{"type": "SOLID", "color": "#00000000", "opacity": 0}], + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "CENTER", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "texts": ["Revoke"] + }, + { + "id": "1:46605", + "name": "text", + "type": "TEXT", + "x": 0, + "y": 120, + "width": 143, + "height": 18, + "fills": [{"type": "SOLID", "color": "#F5F3F7"}], + "text": "remote-lab-sftp-2", + "font": ["JetBrains Mono", 600, 14], + "variables": {"fontFamily": "typography/font-mono", "fills/0/color": "foreground/foreground"} + }, + { + "id": "1:46606", + "name": "cardBody", + "type": "TEXT", + "x": 0, + "y": 144, + "width": 368, + "height": 18, + "fills": [{"type": "SOLID", "color": "#F5F3F7"}], + "layoutAlignSelf": "STRETCH", + "text": "Created 21 Nov 2026 · Never used", + "font": ["Geist", 400, 14], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + }, + { + "name": "Gameplane/Button/Small/Danger", + "type": "INSTANCE", + "x": 348, + "y": 112, + "width": 92, + "height": 32, + "component": "Gameplane/Button/Small/Danger", + "componentId": "1:1878", + "fills": [{"type": "SOLID", "color": "#00000000", "opacity": 0}], + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "CENTER", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "texts": ["Revoke"] + }, + { + "name": "Gameplane/Button/Outline", + "type": "INSTANCE", + "x": 0, + "y": 184, + "width": 130, + "height": 32, + "opacity": 0.4, + "component": "Gameplane/Button/Outline", + "componentId": "1:770", + "fills": [{"type": "SOLID", "color": "#00000000", "opacity": 0}], + "strokes": [{"type": "SOLID", "color": "#00000000", "opacity": 0}], + "strokeWeight": 1, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "CENTER", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "texts": ["Create token"] + } + ] + } + ] + } + ] +} diff --git a/assets/design-export/json/1006926387-2294.json b/assets/design-export/json/1006926387-2294.json new file mode 100644 index 000000000..a9bbe853a --- /dev/null +++ b/assets/design-export/json/1006926387-2294.json @@ -0,0 +1,319 @@ +{ + "file": "1006926387-2294", + "name": "Gameplane/Dialog/Regenerate SFTP password", + "type": "INSTANCE", + "x": 9280, + "y": 82663, + "width": 440, + "height": 163, + "component": "Gameplane/Confirm Dialog", + "componentId": "1:10169", + "fills": [{"type": "SOLID", "color": "#1C1A20"}], + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "effects": [{"type": "DROP_SHADOW", "radius": 32, "visible": true}], + "cornerRadius": 12, + "layout": { + "mode": "VERTICAL", + "gap": 0, + "padding": [20, 20, 20, 20], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "variables": { + "cornerRadius": "radius/xl", + "fills/0/color": "surface/surface", + "strokes/0/color": "border/border" + }, + "children": [ + { + "id": "0:47910", + "name": "cdTitle", + "type": "TEXT", + "x": 20, + "y": 20, + "width": 220, + "height": 21, + "component": "cdTitle", + "componentId": "1:10170", + "fills": [{"type": "SOLID", "color": "#F5F3F7"}], + "text": "Regenerate SFTP password?", + "font": ["Geist", 600, 16], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + }, + { + "id": "0:47911", + "name": "cdDescWrap", + "type": "FRAME", + "x": 20, + "y": 41, + "width": 400, + "height": 50, + "component": "cdDescWrap", + "componentId": "1:10171", + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [8, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "id": "0:47912", + "name": "cdDesc", + "type": "TEXT", + "x": 0, + "y": 8, + "width": 400, + "height": 42, + "component": "cdDesc", + "componentId": "1:10172", + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "layoutGrow": 1, + "text": "Your current password stops working at once. The new password is shown once, so copy it then.", + "font": ["Geist", 400, 14], + "lineHeight": {"value": 150, "unit": "PERCENT"}, + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/muted"} + } + ] + }, + { + "id": "0:47913", + "name": "cdPhrase", + "type": "FRAME", + "x": 20, + "y": 112, + "width": 400, + "height": 72, + "visible": false, + "component": "cdPhrase", + "componentId": "1:10173", + "layout": { + "mode": "VERTICAL", + "gap": 4, + "padding": [16, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "id": "0:47914", + "name": "cdPhraseRow", + "type": "FRAME", + "x": 0, + "y": 16, + "width": 170, + "height": 16, + "component": "cdPhraseRow", + "componentId": "1:10174", + "layout": { + "mode": "HORIZONTAL", + "gap": 4, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["HUG", "HUG"] + }, + "children": [ + { + "id": "0:47915", + "name": "cdPhraseType", + "type": "TEXT", + "x": 0, + "y": 0, + "width": 26, + "height": 16, + "component": "cdPhraseType", + "componentId": "1:10175", + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "text": "Type", + "font": ["Geist", 400, 12], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/muted"} + }, + { + "id": "0:47916", + "name": "cdPhraseValue", + "type": "TEXT", + "x": 30, + "y": 0, + "width": 80, + "height": 16, + "component": "cdPhraseValue", + "componentId": "1:10176", + "fills": [{"type": "SOLID", "color": "#F5F3F7"}], + "text": "mc-survival", + "font": ["JetBrains Mono", 400, 12], + "variables": {"fontFamily": "typography/font-mono", "fills/0/color": "foreground/foreground"} + }, + { + "id": "0:47917", + "name": "cdPhraseConfirm", + "type": "TEXT", + "x": 114, + "y": 0, + "width": 56, + "height": 16, + "component": "cdPhraseConfirm", + "componentId": "1:10177", + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "text": "to confirm", + "font": ["Geist", 400, 12], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/muted"} + } + ] + }, + { + "id": "0:47918", + "name": "cdInput", + "type": "FRAME", + "x": 0, + "y": 36, + "width": 400, + "height": 36, + "component": "cdInput", + "componentId": "1:10178", + "fills": [{"type": "SOLID", "color": "#17151A"}], + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "cornerRadius": 6, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 12, 0, 12], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "variables": { + "cornerRadius": "radius/md", + "fills/0/color": "field/background", + "strokes/0/color": "field/border" + }, + "children": [ + { + "id": "0:47919", + "name": "cdInputValue", + "type": "TEXT", + "x": 12, + "y": 8.5, + "width": 0, + "height": 19, + "component": "cdInputValue", + "componentId": "1:10179", + "fills": [{"type": "SOLID", "color": "#FCFCFC"}], + "text": "", + "font": ["Geist", 400, 14], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "field/foreground"} + } + ] + } + ] + }, + { + "id": "0:47920", + "name": "cdFooter", + "type": "FRAME", + "x": 20, + "y": 91, + "width": 400, + "height": 52, + "component": "cdFooter", + "componentId": "1:10180", + "layout": { + "mode": "HORIZONTAL", + "gap": 8, + "padding": [20, 0, 0, 0], + "primary": "MAX", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "id": "0:47921", + "name": "btnCancel", + "type": "FRAME", + "x": 222, + "y": 20, + "width": 70, + "height": 32, + "component": "btnCancel", + "componentId": "1:10181", + "cornerRadius": 6, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 12, 0, 12], + "primary": "CENTER", + "counter": "CENTER", + "sizing": ["HUG", "FIXED"] + }, + "variables": {"cornerRadius": "radius/md"}, + "children": [ + { + "id": "0:47922", + "name": "cdCancelLabel", + "type": "TEXT", + "x": 12, + "y": 7, + "width": 46, + "height": 18, + "component": "cdCancelLabel", + "componentId": "1:10182", + "fills": [{"type": "SOLID", "color": "#F5F3F7"}], + "text": "Cancel", + "font": ["Geist", 500, 14], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + } + ] + }, + { + "id": "0:47923", + "name": "btnConfirm", + "type": "FRAME", + "x": 300, + "y": 20, + "width": 100, + "height": 32, + "component": "btnConfirm", + "componentId": "1:10183", + "fills": [{"type": "SOLID", "color": "#E0304F"}], + "cornerRadius": 6, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 12, 0, 12], + "primary": "CENTER", + "counter": "CENTER", + "sizing": ["HUG", "FIXED"] + }, + "variables": {"cornerRadius": "radius/md", "fills/0/color": "danger/danger"}, + "children": [ + { + "id": "0:47924", + "name": "cdConfirmLabel", + "type": "TEXT", + "x": 12, + "y": 7, + "width": 76, + "height": 18, + "component": "cdConfirmLabel", + "componentId": "1:10184", + "fills": [{"type": "SOLID", "color": "#FCFCFC"}], + "text": "Regenerate", + "font": ["Geist", 500, 14], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "danger/foreground"} + } + ] + } + ] + } + ] +} diff --git a/assets/design-export/json/1006926387-2310.json b/assets/design-export/json/1006926387-2310.json new file mode 100644 index 000000000..c34ec5202 --- /dev/null +++ b/assets/design-export/json/1006926387-2310.json @@ -0,0 +1,319 @@ +{ + "file": "1006926387-2310", + "name": "Gameplane/Dialog/Revoke SFTP password", + "type": "INSTANCE", + "x": 9860, + "y": 82663, + "width": 440, + "height": 163, + "component": "Gameplane/Confirm Dialog", + "componentId": "1:10169", + "fills": [{"type": "SOLID", "color": "#1C1A20"}], + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "effects": [{"type": "DROP_SHADOW", "radius": 32, "visible": true}], + "cornerRadius": 12, + "layout": { + "mode": "VERTICAL", + "gap": 0, + "padding": [20, 20, 20, 20], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "variables": { + "cornerRadius": "radius/xl", + "fills/0/color": "surface/surface", + "strokes/0/color": "border/border" + }, + "children": [ + { + "id": "0:47925", + "name": "cdTitle", + "type": "TEXT", + "x": 20, + "y": 20, + "width": 188, + "height": 21, + "component": "cdTitle", + "componentId": "1:10170", + "fills": [{"type": "SOLID", "color": "#F5F3F7"}], + "text": "Revoke SFTP password?", + "font": ["Geist", 600, 16], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + }, + { + "id": "0:47926", + "name": "cdDescWrap", + "type": "FRAME", + "x": 20, + "y": 41, + "width": 400, + "height": 50, + "component": "cdDescWrap", + "componentId": "1:10171", + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [8, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "id": "0:47927", + "name": "cdDesc", + "type": "TEXT", + "x": 0, + "y": 8, + "width": 400, + "height": 42, + "component": "cdDesc", + "componentId": "1:10172", + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "layoutGrow": 1, + "text": "The password stops working at once and cannot be used again. Open SFTP sessions that use it end within one minute.", + "font": ["Geist", 400, 14], + "lineHeight": {"value": 150, "unit": "PERCENT"}, + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/muted"} + } + ] + }, + { + "id": "0:47928", + "name": "cdPhrase", + "type": "FRAME", + "x": 20, + "y": 112, + "width": 400, + "height": 72, + "visible": false, + "component": "cdPhrase", + "componentId": "1:10173", + "layout": { + "mode": "VERTICAL", + "gap": 4, + "padding": [16, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "id": "0:47929", + "name": "cdPhraseRow", + "type": "FRAME", + "x": 0, + "y": 16, + "width": 170, + "height": 16, + "component": "cdPhraseRow", + "componentId": "1:10174", + "layout": { + "mode": "HORIZONTAL", + "gap": 4, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["HUG", "HUG"] + }, + "children": [ + { + "id": "0:47930", + "name": "cdPhraseType", + "type": "TEXT", + "x": 0, + "y": 0, + "width": 26, + "height": 16, + "component": "cdPhraseType", + "componentId": "1:10175", + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "text": "Type", + "font": ["Geist", 400, 12], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/muted"} + }, + { + "id": "0:47931", + "name": "cdPhraseValue", + "type": "TEXT", + "x": 30, + "y": 0, + "width": 80, + "height": 16, + "component": "cdPhraseValue", + "componentId": "1:10176", + "fills": [{"type": "SOLID", "color": "#F5F3F7"}], + "text": "mc-survival", + "font": ["JetBrains Mono", 400, 12], + "variables": {"fontFamily": "typography/font-mono", "fills/0/color": "foreground/foreground"} + }, + { + "id": "0:47932", + "name": "cdPhraseConfirm", + "type": "TEXT", + "x": 114, + "y": 0, + "width": 56, + "height": 16, + "component": "cdPhraseConfirm", + "componentId": "1:10177", + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "text": "to confirm", + "font": ["Geist", 400, 12], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/muted"} + } + ] + }, + { + "id": "0:47933", + "name": "cdInput", + "type": "FRAME", + "x": 0, + "y": 36, + "width": 400, + "height": 36, + "component": "cdInput", + "componentId": "1:10178", + "fills": [{"type": "SOLID", "color": "#17151A"}], + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "cornerRadius": 6, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 12, 0, 12], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "variables": { + "cornerRadius": "radius/md", + "fills/0/color": "field/background", + "strokes/0/color": "field/border" + }, + "children": [ + { + "id": "0:47934", + "name": "cdInputValue", + "type": "TEXT", + "x": 12, + "y": 8.5, + "width": 0, + "height": 19, + "component": "cdInputValue", + "componentId": "1:10179", + "fills": [{"type": "SOLID", "color": "#FCFCFC"}], + "text": "", + "font": ["Geist", 400, 14], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "field/foreground"} + } + ] + } + ] + }, + { + "id": "0:47935", + "name": "cdFooter", + "type": "FRAME", + "x": 20, + "y": 91, + "width": 400, + "height": 52, + "component": "cdFooter", + "componentId": "1:10180", + "layout": { + "mode": "HORIZONTAL", + "gap": 8, + "padding": [20, 0, 0, 0], + "primary": "MAX", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "id": "0:47936", + "name": "btnCancel", + "type": "FRAME", + "x": 249, + "y": 20, + "width": 70, + "height": 32, + "component": "btnCancel", + "componentId": "1:10181", + "cornerRadius": 6, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 12, 0, 12], + "primary": "CENTER", + "counter": "CENTER", + "sizing": ["HUG", "FIXED"] + }, + "variables": {"cornerRadius": "radius/md"}, + "children": [ + { + "id": "0:47937", + "name": "cdCancelLabel", + "type": "TEXT", + "x": 12, + "y": 7, + "width": 46, + "height": 18, + "component": "cdCancelLabel", + "componentId": "1:10182", + "fills": [{"type": "SOLID", "color": "#F5F3F7"}], + "text": "Cancel", + "font": ["Geist", 500, 14], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + } + ] + }, + { + "id": "0:47938", + "name": "btnConfirm", + "type": "FRAME", + "x": 327, + "y": 20, + "width": 73, + "height": 32, + "component": "btnConfirm", + "componentId": "1:10183", + "fills": [{"type": "SOLID", "color": "#E0304F"}], + "cornerRadius": 6, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 12, 0, 12], + "primary": "CENTER", + "counter": "CENTER", + "sizing": ["HUG", "FIXED"] + }, + "variables": {"cornerRadius": "radius/md", "fills/0/color": "danger/danger"}, + "children": [ + { + "id": "0:47939", + "name": "cdConfirmLabel", + "type": "TEXT", + "x": 12, + "y": 7, + "width": 49, + "height": 18, + "component": "cdConfirmLabel", + "componentId": "1:10184", + "fills": [{"type": "SOLID", "color": "#FCFCFC"}], + "text": "Revoke", + "font": ["Geist", 500, 14], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "danger/foreground"} + } + ] + } + ] + } + ] +} diff --git a/assets/design-export/json/1274632774-4001.json b/assets/design-export/json/1274632774-4001.json index d44c09730..cb6fbc4df 100644 --- a/assets/design-export/json/1274632774-4001.json +++ b/assets/design-export/json/1274632774-4001.json @@ -3,7 +3,7 @@ "name": "Screen/Admin Settings — Mod registries (Share CurseForge key)", "type": "FRAME", "x": 3280, - "y": 88972, + "y": 90452, "width": 1440, "height": 900, "fills": [{"type": "SOLID", "color": "#121114"}], @@ -804,7 +804,7 @@ "x": 0, "y": 0, "width": 220, - "height": 356, + "height": 492, "component": "Gameplane/Admin Settings Nav", "componentId": "1:3419", "layout": { @@ -816,8 +816,12 @@ "sizing": ["HUG", "FIXED"] }, "texts": [ - "General", + "ACCOUNT", "Theme", + "MCP tokens", + "SFTP", + "SERVER", + "General", "Authentication", "Module sources", "Mod registries", diff --git a/assets/design-export/json/1274632774-4260.json b/assets/design-export/json/1274632774-4260.json index e818c1316..5d1517c30 100644 --- a/assets/design-export/json/1274632774-4260.json +++ b/assets/design-export/json/1274632774-4260.json @@ -3,7 +3,7 @@ "name": "Screen/Admin Settings — Mod registries (Key from startup flag)", "type": "FRAME", "x": 4920, - "y": 88972, + "y": 90452, "width": 1440, "height": 900, "fills": [{"type": "SOLID", "color": "#121114"}], @@ -804,7 +804,7 @@ "x": 0, "y": 0, "width": 220, - "height": 356, + "height": 492, "component": "Gameplane/Admin Settings Nav", "componentId": "1:3419", "layout": { @@ -816,8 +816,12 @@ "sizing": ["HUG", "FIXED"] }, "texts": [ - "General", + "ACCOUNT", "Theme", + "MCP tokens", + "SFTP", + "SERVER", + "General", "Authentication", "Module sources", "Mod registries", diff --git a/assets/design-export/json/1494270493-26.json b/assets/design-export/json/1494270493-26.json index 407a78598..0dd567240 100644 --- a/assets/design-export/json/1494270493-26.json +++ b/assets/design-export/json/1494270493-26.json @@ -3,7 +3,7 @@ "name": "States/Backup schedule — Edit with restricted snapshot strategy", "type": "FRAME", "x": 0, - "y": 98049, + "y": 99529, "width": 1524, "height": 582, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/2044649516-1099.json b/assets/design-export/json/2044649516-1099.json index 2a8ab5da7..01b2e479b 100644 --- a/assets/design-export/json/2044649516-1099.json +++ b/assets/design-export/json/2044649516-1099.json @@ -3,7 +3,7 @@ "name": "Screen/MCP Tokens — Create", "type": "FRAME", "x": 3280, - "y": 99883, + "y": 101363, "width": 1440, "height": 900, "fills": [{"type": "SOLID", "color": "#121114"}], @@ -382,433 +382,35 @@ "children": [ { "name": "Settings Nav", - "type": "FRAME", + "type": "INSTANCE", "x": 0, "y": 0, "width": 220, - "height": 394, - "children": [ - { - "name": "snGeneral", - "type": "FRAME", - "x": 0, - "y": 8, - "width": 220, - "height": 36, - "fills": [{"type": "SOLID", "color": "#00000000", "opacity": 0}], - "cornerRadius": 6, - "layout": { - "mode": "HORIZONTAL", - "gap": 8, - "padding": [8, 12, 8, 12], - "primary": "MIN", - "counter": "CENTER", - "sizing": ["FIXED", "FIXED"] - }, - "layoutAlignSelf": "STRETCH", - "children": [ - { - "name": "icon", - "type": "INSTANCE", - "x": 12, - "y": 10, - "width": 16, - "height": 16, - "component": "lucide/cog/16x16" - }, - { - "name": "text", - "type": "TEXT", - "x": 36, - "y": 9, - "width": 50, - "height": 18, - "fills": [{"type": "SOLID", "color": "#9E98A6"}], - "text": "General", - "font": ["Geist", 400, 14], - "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "muted"} - } - ] - }, - { - "name": "snTheme", - "type": "FRAME", - "x": 0, - "y": 46, - "width": 220, - "height": 36, - "fills": [{"type": "SOLID", "color": "#000000", "opacity": 0}], - "cornerRadius": 6, - "layout": { - "mode": "HORIZONTAL", - "gap": 8, - "padding": [8, 12, 8, 12], - "primary": "MIN", - "counter": "CENTER", - "sizing": ["FIXED", "FIXED"] - }, - "layoutAlignSelf": "STRETCH", - "children": [ - { - "name": "icon", - "type": "INSTANCE", - "x": 12, - "y": 10, - "width": 16, - "height": 16, - "component": "lucide/palette/16x16" - }, - { - "name": "text", - "type": "TEXT", - "x": 36, - "y": 9, - "width": 43, - "height": 18, - "fills": [{"type": "SOLID", "color": "#9E98A6"}], - "text": "Theme", - "font": ["Geist", 400, 14], - "variables": {"fontFamily": "typography/font-sans"} - } - ] - }, - { - "name": "snAuth", - "type": "FRAME", - "x": 0, - "y": 122, - "width": 220, - "height": 36, - "cornerRadius": 6, - "layout": { - "mode": "HORIZONTAL", - "gap": 8, - "padding": [8, 12, 8, 12], - "primary": "MIN", - "counter": "CENTER", - "sizing": ["FIXED", "FIXED"] - }, - "layoutAlignSelf": "STRETCH", - "children": [ - { - "name": "icon", - "type": "INSTANCE", - "x": 12, - "y": 10, - "width": 16, - "height": 16, - "component": "lucide/shield-check/16x16", - "variables": {"fills/0/color": "muted"} - }, - { - "name": "text", - "type": "TEXT", - "x": 36, - "y": 9, - "width": 94, - "height": 18, - "fills": [{"type": "SOLID", "color": "#9E98A6"}], - "text": "Authentication", - "font": ["Geist", 400, 14], - "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "muted"} - } - ] - }, - { - "name": "snModules", - "type": "FRAME", - "x": 0, - "y": 160, - "width": 220, - "height": 36, - "cornerRadius": 6, - "layout": { - "mode": "HORIZONTAL", - "gap": 8, - "padding": [8, 12, 8, 12], - "primary": "MIN", - "counter": "CENTER", - "sizing": ["FIXED", "FIXED"] - }, - "layoutAlignSelf": "STRETCH", - "children": [ - { - "name": "icon", - "type": "INSTANCE", - "x": 12, - "y": 10, - "width": 16, - "height": 16, - "component": "lucide/boxes/16x16", - "variables": {"fills/0/color": "muted"} - }, - { - "name": "text", - "type": "TEXT", - "x": 36, - "y": 9, - "width": 102, - "height": 18, - "fills": [{"type": "SOLID", "color": "#9E98A6"}], - "text": "Module sources", - "font": ["Geist", 400, 14], - "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "muted"} - } - ] - }, - { - "name": "snModRegistries", - "type": "FRAME", - "x": 0, - "y": 198, - "width": 220, - "height": 36, - "cornerRadius": 6, - "layout": { - "mode": "HORIZONTAL", - "gap": 8, - "padding": [8, 12, 8, 12], - "primary": "MIN", - "counter": "CENTER", - "sizing": ["FIXED", "FIXED"] - }, - "layoutAlignSelf": "STRETCH", - "children": [ - { - "name": "icon", - "type": "INSTANCE", - "x": 12, - "y": 10, - "width": 16, - "height": 16, - "component": "lucide/key/16x16", - "variables": {"fills/0/color": "muted"} - }, - { - "name": "text", - "type": "TEXT", - "x": 36, - "y": 9, - "width": 92, - "height": 18, - "fills": [{"type": "SOLID", "color": "#9E98A6"}], - "text": "Mod registries", - "font": ["Geist", 400, 14], - "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "muted"} - } - ] - }, - { - "name": "snNotifications", - "type": "FRAME", - "x": 0, - "y": 236, - "width": 220, - "height": 36, - "cornerRadius": 6, - "layout": { - "mode": "HORIZONTAL", - "gap": 8, - "padding": [8, 12, 8, 12], - "primary": "MIN", - "counter": "CENTER", - "sizing": ["FIXED", "FIXED"] - }, - "layoutAlignSelf": "STRETCH", - "children": [ - { - "name": "icon", - "type": "INSTANCE", - "x": 12, - "y": 10, - "width": 16, - "height": 16, - "component": "lucide/bell/16x16", - "variables": {"fills/0/color": "muted"} - }, - { - "name": "text", - "type": "TEXT", - "x": 36, - "y": 9, - "width": 81, - "height": 18, - "fills": [{"type": "SOLID", "color": "#9E98A6"}], - "text": "Notifications", - "font": ["Geist", 400, 14], - "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "muted"} - } - ] - }, - { - "name": "snTelemetry", - "type": "FRAME", - "x": 0, - "y": 274, - "width": 220, - "height": 36, - "cornerRadius": 6, - "layout": { - "mode": "HORIZONTAL", - "gap": 8, - "padding": [8, 12, 8, 12], - "primary": "MIN", - "counter": "CENTER", - "sizing": ["FIXED", "FIXED"] - }, - "layoutAlignSelf": "STRETCH", - "children": [ - { - "name": "icon", - "type": "INSTANCE", - "x": 12, - "y": 10, - "width": 16, - "height": 16, - "component": "lucide/activity/16x16", - "variables": {"fills/0/color": "muted"} - }, - { - "name": "text", - "type": "TEXT", - "x": 36, - "y": 9, - "width": 64, - "height": 18, - "fills": [{"type": "SOLID", "color": "#9E98A6"}], - "text": "Telemetry", - "font": ["Geist", 400, 14], - "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "muted"} - } - ] - }, - { - "name": "snUpdates", - "type": "FRAME", - "x": 0, - "y": 312, - "width": 220, - "height": 36, - "cornerRadius": 6, - "layout": { - "mode": "HORIZONTAL", - "gap": 8, - "padding": [8, 12, 8, 12], - "primary": "MIN", - "counter": "CENTER", - "sizing": ["FIXED", "FIXED"] - }, - "layoutAlignSelf": "STRETCH", - "children": [ - { - "name": "icon", - "type": "INSTANCE", - "x": 12, - "y": 10, - "width": 16, - "height": 16, - "component": "lucide/refresh-ccw/16x16", - "variables": {"fills/0/color": "muted"} - }, - { - "name": "text", - "type": "TEXT", - "x": 36, - "y": 9, - "width": 54, - "height": 18, - "fills": [{"type": "SOLID", "color": "#9E98A6"}], - "text": "Updates", - "font": ["Geist", 400, 14], - "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "muted"} - } - ] - }, - { - "name": "snAbout", - "type": "FRAME", - "x": 0, - "y": 350, - "width": 220, - "height": 36, - "cornerRadius": 6, - "layout": { - "mode": "HORIZONTAL", - "gap": 8, - "padding": [8, 12, 8, 12], - "primary": "MIN", - "counter": "CENTER", - "sizing": ["FIXED", "FIXED"] - }, - "layoutAlignSelf": "STRETCH", - "children": [ - { - "name": "icon", - "type": "INSTANCE", - "x": 12, - "y": 10, - "width": 16, - "height": 16, - "component": "lucide/info/16x16", - "variables": {"fills/0/color": "muted"} - }, - { - "name": "text", - "type": "TEXT", - "x": 36, - "y": 9, - "width": 39, - "height": 18, - "fills": [{"type": "SOLID", "color": "#9E98A6"}], - "text": "About", - "font": ["Geist", 400, 14], - "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "muted"} - } - ] - }, - { - "name": "snMcp", - "type": "FRAME", - "x": 0, - "y": 84, - "width": 220, - "height": 36, - "fills": [{"type": "SOLID", "color": "#17151A"}], - "cornerRadius": 6, - "layout": { - "mode": "HORIZONTAL", - "gap": 8, - "padding": [8, 12, 8, 12], - "primary": "MIN", - "counter": "CENTER", - "sizing": ["FIXED", "FIXED"] - }, - "layoutAlignSelf": "STRETCH", - "variables": {"fills/0/color": "surface/secondary"}, - "children": [ - { - "name": "icon", - "type": "INSTANCE", - "x": 12, - "y": 10, - "width": 16, - "height": 16, - "component": "lucide/link/16x16" - }, - { - "name": "text", - "type": "TEXT", - "x": 36, - "y": 9, - "width": 79, - "height": 18, - "fills": [{"type": "SOLID", "color": "#F5F3F7"}], - "text": "MCP tokens", - "font": ["Geist", 400, 14], - "variables": {"fontFamily": "typography/font-sans"} - } - ] - } + "height": 492, + "component": "Gameplane/Admin Settings Nav", + "componentId": "1:3419", + "layout": { + "mode": "VERTICAL", + "gap": 2, + "padding": [8, 0, 8, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "texts": [ + "ACCOUNT", + "Theme", + "MCP tokens", + "SFTP", + "SERVER", + "General", + "Authentication", + "Module sources", + "Mod registries", + "Notifications", + "Telemetry", + "Updates", + "About" ] }, { diff --git a/assets/design-export/json/2044649516-13.json b/assets/design-export/json/2044649516-13.json index be9b17935..c81427f05 100644 --- a/assets/design-export/json/2044649516-13.json +++ b/assets/design-export/json/2044649516-13.json @@ -3,7 +3,7 @@ "name": "Screen/MCP Tokens", "type": "FRAME", "x": 0, - "y": 99883, + "y": 101363, "width": 1440, "height": 900, "fills": [{"type": "SOLID", "color": "#121114"}], @@ -382,433 +382,35 @@ "children": [ { "name": "Settings Nav", - "type": "FRAME", + "type": "INSTANCE", "x": 0, "y": 0, "width": 220, - "height": 394, - "children": [ - { - "name": "snGeneral", - "type": "FRAME", - "x": 0, - "y": 8, - "width": 220, - "height": 36, - "fills": [{"type": "SOLID", "color": "#00000000", "opacity": 0}], - "cornerRadius": 6, - "layout": { - "mode": "HORIZONTAL", - "gap": 8, - "padding": [8, 12, 8, 12], - "primary": "MIN", - "counter": "CENTER", - "sizing": ["FIXED", "FIXED"] - }, - "layoutAlignSelf": "STRETCH", - "children": [ - { - "name": "icon", - "type": "INSTANCE", - "x": 12, - "y": 10, - "width": 16, - "height": 16, - "component": "lucide/cog/16x16" - }, - { - "name": "text", - "type": "TEXT", - "x": 36, - "y": 9, - "width": 50, - "height": 18, - "fills": [{"type": "SOLID", "color": "#9E98A6"}], - "text": "General", - "font": ["Geist", 400, 14], - "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "muted"} - } - ] - }, - { - "name": "snTheme", - "type": "FRAME", - "x": 0, - "y": 46, - "width": 220, - "height": 36, - "fills": [{"type": "SOLID", "color": "#000000", "opacity": 0}], - "cornerRadius": 6, - "layout": { - "mode": "HORIZONTAL", - "gap": 8, - "padding": [8, 12, 8, 12], - "primary": "MIN", - "counter": "CENTER", - "sizing": ["FIXED", "FIXED"] - }, - "layoutAlignSelf": "STRETCH", - "children": [ - { - "name": "icon", - "type": "INSTANCE", - "x": 12, - "y": 10, - "width": 16, - "height": 16, - "component": "lucide/palette/16x16" - }, - { - "name": "text", - "type": "TEXT", - "x": 36, - "y": 9, - "width": 43, - "height": 18, - "fills": [{"type": "SOLID", "color": "#9E98A6"}], - "text": "Theme", - "font": ["Geist", 400, 14], - "variables": {"fontFamily": "typography/font-sans"} - } - ] - }, - { - "name": "snAuth", - "type": "FRAME", - "x": 0, - "y": 122, - "width": 220, - "height": 36, - "cornerRadius": 6, - "layout": { - "mode": "HORIZONTAL", - "gap": 8, - "padding": [8, 12, 8, 12], - "primary": "MIN", - "counter": "CENTER", - "sizing": ["FIXED", "FIXED"] - }, - "layoutAlignSelf": "STRETCH", - "children": [ - { - "name": "icon", - "type": "INSTANCE", - "x": 12, - "y": 10, - "width": 16, - "height": 16, - "component": "lucide/shield-check/16x16", - "variables": {"fills/0/color": "muted"} - }, - { - "name": "text", - "type": "TEXT", - "x": 36, - "y": 9, - "width": 94, - "height": 18, - "fills": [{"type": "SOLID", "color": "#9E98A6"}], - "text": "Authentication", - "font": ["Geist", 400, 14], - "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "muted"} - } - ] - }, - { - "name": "snModules", - "type": "FRAME", - "x": 0, - "y": 160, - "width": 220, - "height": 36, - "cornerRadius": 6, - "layout": { - "mode": "HORIZONTAL", - "gap": 8, - "padding": [8, 12, 8, 12], - "primary": "MIN", - "counter": "CENTER", - "sizing": ["FIXED", "FIXED"] - }, - "layoutAlignSelf": "STRETCH", - "children": [ - { - "name": "icon", - "type": "INSTANCE", - "x": 12, - "y": 10, - "width": 16, - "height": 16, - "component": "lucide/boxes/16x16", - "variables": {"fills/0/color": "muted"} - }, - { - "name": "text", - "type": "TEXT", - "x": 36, - "y": 9, - "width": 102, - "height": 18, - "fills": [{"type": "SOLID", "color": "#9E98A6"}], - "text": "Module sources", - "font": ["Geist", 400, 14], - "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "muted"} - } - ] - }, - { - "name": "snModRegistries", - "type": "FRAME", - "x": 0, - "y": 198, - "width": 220, - "height": 36, - "cornerRadius": 6, - "layout": { - "mode": "HORIZONTAL", - "gap": 8, - "padding": [8, 12, 8, 12], - "primary": "MIN", - "counter": "CENTER", - "sizing": ["FIXED", "FIXED"] - }, - "layoutAlignSelf": "STRETCH", - "children": [ - { - "name": "icon", - "type": "INSTANCE", - "x": 12, - "y": 10, - "width": 16, - "height": 16, - "component": "lucide/key/16x16", - "variables": {"fills/0/color": "muted"} - }, - { - "name": "text", - "type": "TEXT", - "x": 36, - "y": 9, - "width": 92, - "height": 18, - "fills": [{"type": "SOLID", "color": "#9E98A6"}], - "text": "Mod registries", - "font": ["Geist", 400, 14], - "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "muted"} - } - ] - }, - { - "name": "snNotifications", - "type": "FRAME", - "x": 0, - "y": 236, - "width": 220, - "height": 36, - "cornerRadius": 6, - "layout": { - "mode": "HORIZONTAL", - "gap": 8, - "padding": [8, 12, 8, 12], - "primary": "MIN", - "counter": "CENTER", - "sizing": ["FIXED", "FIXED"] - }, - "layoutAlignSelf": "STRETCH", - "children": [ - { - "name": "icon", - "type": "INSTANCE", - "x": 12, - "y": 10, - "width": 16, - "height": 16, - "component": "lucide/bell/16x16", - "variables": {"fills/0/color": "muted"} - }, - { - "name": "text", - "type": "TEXT", - "x": 36, - "y": 9, - "width": 81, - "height": 18, - "fills": [{"type": "SOLID", "color": "#9E98A6"}], - "text": "Notifications", - "font": ["Geist", 400, 14], - "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "muted"} - } - ] - }, - { - "name": "snTelemetry", - "type": "FRAME", - "x": 0, - "y": 274, - "width": 220, - "height": 36, - "cornerRadius": 6, - "layout": { - "mode": "HORIZONTAL", - "gap": 8, - "padding": [8, 12, 8, 12], - "primary": "MIN", - "counter": "CENTER", - "sizing": ["FIXED", "FIXED"] - }, - "layoutAlignSelf": "STRETCH", - "children": [ - { - "name": "icon", - "type": "INSTANCE", - "x": 12, - "y": 10, - "width": 16, - "height": 16, - "component": "lucide/activity/16x16", - "variables": {"fills/0/color": "muted"} - }, - { - "name": "text", - "type": "TEXT", - "x": 36, - "y": 9, - "width": 64, - "height": 18, - "fills": [{"type": "SOLID", "color": "#9E98A6"}], - "text": "Telemetry", - "font": ["Geist", 400, 14], - "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "muted"} - } - ] - }, - { - "name": "snUpdates", - "type": "FRAME", - "x": 0, - "y": 312, - "width": 220, - "height": 36, - "cornerRadius": 6, - "layout": { - "mode": "HORIZONTAL", - "gap": 8, - "padding": [8, 12, 8, 12], - "primary": "MIN", - "counter": "CENTER", - "sizing": ["FIXED", "FIXED"] - }, - "layoutAlignSelf": "STRETCH", - "children": [ - { - "name": "icon", - "type": "INSTANCE", - "x": 12, - "y": 10, - "width": 16, - "height": 16, - "component": "lucide/refresh-ccw/16x16", - "variables": {"fills/0/color": "muted"} - }, - { - "name": "text", - "type": "TEXT", - "x": 36, - "y": 9, - "width": 54, - "height": 18, - "fills": [{"type": "SOLID", "color": "#9E98A6"}], - "text": "Updates", - "font": ["Geist", 400, 14], - "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "muted"} - } - ] - }, - { - "name": "snAbout", - "type": "FRAME", - "x": 0, - "y": 350, - "width": 220, - "height": 36, - "cornerRadius": 6, - "layout": { - "mode": "HORIZONTAL", - "gap": 8, - "padding": [8, 12, 8, 12], - "primary": "MIN", - "counter": "CENTER", - "sizing": ["FIXED", "FIXED"] - }, - "layoutAlignSelf": "STRETCH", - "children": [ - { - "name": "icon", - "type": "INSTANCE", - "x": 12, - "y": 10, - "width": 16, - "height": 16, - "component": "lucide/info/16x16", - "variables": {"fills/0/color": "muted"} - }, - { - "name": "text", - "type": "TEXT", - "x": 36, - "y": 9, - "width": 39, - "height": 18, - "fills": [{"type": "SOLID", "color": "#9E98A6"}], - "text": "About", - "font": ["Geist", 400, 14], - "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "muted"} - } - ] - }, - { - "name": "snMcp", - "type": "FRAME", - "x": 0, - "y": 84, - "width": 220, - "height": 36, - "fills": [{"type": "SOLID", "color": "#17151A"}], - "cornerRadius": 6, - "layout": { - "mode": "HORIZONTAL", - "gap": 8, - "padding": [8, 12, 8, 12], - "primary": "MIN", - "counter": "CENTER", - "sizing": ["FIXED", "FIXED"] - }, - "layoutAlignSelf": "STRETCH", - "variables": {"fills/0/color": "surface/secondary"}, - "children": [ - { - "name": "icon", - "type": "INSTANCE", - "x": 12, - "y": 10, - "width": 16, - "height": 16, - "component": "lucide/link/16x16" - }, - { - "name": "text", - "type": "TEXT", - "x": 36, - "y": 9, - "width": 79, - "height": 18, - "fills": [{"type": "SOLID", "color": "#F5F3F7"}], - "text": "MCP tokens", - "font": ["Geist", 400, 14], - "variables": {"fontFamily": "typography/font-sans"} - } - ] - } + "height": 492, + "component": "Gameplane/Admin Settings Nav", + "componentId": "1:3419", + "layout": { + "mode": "VERTICAL", + "gap": 2, + "padding": [8, 0, 8, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "texts": [ + "ACCOUNT", + "Theme", + "MCP tokens", + "SFTP", + "SERVER", + "General", + "Authentication", + "Module sources", + "Mod registries", + "Notifications", + "Telemetry", + "Updates", + "About" ] }, { diff --git a/assets/design-export/json/2044649516-1687.json b/assets/design-export/json/2044649516-1687.json index ee5fe7a8d..026315f7b 100644 --- a/assets/design-export/json/2044649516-1687.json +++ b/assets/design-export/json/2044649516-1687.json @@ -3,7 +3,7 @@ "name": "Screen/MCP Tokens — Created", "type": "FRAME", "x": 4920, - "y": 99883, + "y": 101363, "width": 1440, "height": 900, "fills": [{"type": "SOLID", "color": "#121114"}], @@ -382,433 +382,35 @@ "children": [ { "name": "Settings Nav", - "type": "FRAME", + "type": "INSTANCE", "x": 0, "y": 0, "width": 220, - "height": 394, - "children": [ - { - "name": "snGeneral", - "type": "FRAME", - "x": 0, - "y": 8, - "width": 220, - "height": 36, - "fills": [{"type": "SOLID", "color": "#00000000", "opacity": 0}], - "cornerRadius": 6, - "layout": { - "mode": "HORIZONTAL", - "gap": 8, - "padding": [8, 12, 8, 12], - "primary": "MIN", - "counter": "CENTER", - "sizing": ["FIXED", "FIXED"] - }, - "layoutAlignSelf": "STRETCH", - "children": [ - { - "name": "icon", - "type": "INSTANCE", - "x": 12, - "y": 10, - "width": 16, - "height": 16, - "component": "lucide/cog/16x16" - }, - { - "name": "text", - "type": "TEXT", - "x": 36, - "y": 9, - "width": 50, - "height": 18, - "fills": [{"type": "SOLID", "color": "#9E98A6"}], - "text": "General", - "font": ["Geist", 400, 14], - "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "muted"} - } - ] - }, - { - "name": "snTheme", - "type": "FRAME", - "x": 0, - "y": 46, - "width": 220, - "height": 36, - "fills": [{"type": "SOLID", "color": "#000000", "opacity": 0}], - "cornerRadius": 6, - "layout": { - "mode": "HORIZONTAL", - "gap": 8, - "padding": [8, 12, 8, 12], - "primary": "MIN", - "counter": "CENTER", - "sizing": ["FIXED", "FIXED"] - }, - "layoutAlignSelf": "STRETCH", - "children": [ - { - "name": "icon", - "type": "INSTANCE", - "x": 12, - "y": 10, - "width": 16, - "height": 16, - "component": "lucide/palette/16x16" - }, - { - "name": "text", - "type": "TEXT", - "x": 36, - "y": 9, - "width": 43, - "height": 18, - "fills": [{"type": "SOLID", "color": "#9E98A6"}], - "text": "Theme", - "font": ["Geist", 400, 14], - "variables": {"fontFamily": "typography/font-sans"} - } - ] - }, - { - "name": "snAuth", - "type": "FRAME", - "x": 0, - "y": 122, - "width": 220, - "height": 36, - "cornerRadius": 6, - "layout": { - "mode": "HORIZONTAL", - "gap": 8, - "padding": [8, 12, 8, 12], - "primary": "MIN", - "counter": "CENTER", - "sizing": ["FIXED", "FIXED"] - }, - "layoutAlignSelf": "STRETCH", - "children": [ - { - "name": "icon", - "type": "INSTANCE", - "x": 12, - "y": 10, - "width": 16, - "height": 16, - "component": "lucide/shield-check/16x16", - "variables": {"fills/0/color": "muted"} - }, - { - "name": "text", - "type": "TEXT", - "x": 36, - "y": 9, - "width": 94, - "height": 18, - "fills": [{"type": "SOLID", "color": "#9E98A6"}], - "text": "Authentication", - "font": ["Geist", 400, 14], - "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "muted"} - } - ] - }, - { - "name": "snModules", - "type": "FRAME", - "x": 0, - "y": 160, - "width": 220, - "height": 36, - "cornerRadius": 6, - "layout": { - "mode": "HORIZONTAL", - "gap": 8, - "padding": [8, 12, 8, 12], - "primary": "MIN", - "counter": "CENTER", - "sizing": ["FIXED", "FIXED"] - }, - "layoutAlignSelf": "STRETCH", - "children": [ - { - "name": "icon", - "type": "INSTANCE", - "x": 12, - "y": 10, - "width": 16, - "height": 16, - "component": "lucide/boxes/16x16", - "variables": {"fills/0/color": "muted"} - }, - { - "name": "text", - "type": "TEXT", - "x": 36, - "y": 9, - "width": 102, - "height": 18, - "fills": [{"type": "SOLID", "color": "#9E98A6"}], - "text": "Module sources", - "font": ["Geist", 400, 14], - "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "muted"} - } - ] - }, - { - "name": "snModRegistries", - "type": "FRAME", - "x": 0, - "y": 198, - "width": 220, - "height": 36, - "cornerRadius": 6, - "layout": { - "mode": "HORIZONTAL", - "gap": 8, - "padding": [8, 12, 8, 12], - "primary": "MIN", - "counter": "CENTER", - "sizing": ["FIXED", "FIXED"] - }, - "layoutAlignSelf": "STRETCH", - "children": [ - { - "name": "icon", - "type": "INSTANCE", - "x": 12, - "y": 10, - "width": 16, - "height": 16, - "component": "lucide/key/16x16", - "variables": {"fills/0/color": "muted"} - }, - { - "name": "text", - "type": "TEXT", - "x": 36, - "y": 9, - "width": 92, - "height": 18, - "fills": [{"type": "SOLID", "color": "#9E98A6"}], - "text": "Mod registries", - "font": ["Geist", 400, 14], - "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "muted"} - } - ] - }, - { - "name": "snNotifications", - "type": "FRAME", - "x": 0, - "y": 236, - "width": 220, - "height": 36, - "cornerRadius": 6, - "layout": { - "mode": "HORIZONTAL", - "gap": 8, - "padding": [8, 12, 8, 12], - "primary": "MIN", - "counter": "CENTER", - "sizing": ["FIXED", "FIXED"] - }, - "layoutAlignSelf": "STRETCH", - "children": [ - { - "name": "icon", - "type": "INSTANCE", - "x": 12, - "y": 10, - "width": 16, - "height": 16, - "component": "lucide/bell/16x16", - "variables": {"fills/0/color": "muted"} - }, - { - "name": "text", - "type": "TEXT", - "x": 36, - "y": 9, - "width": 81, - "height": 18, - "fills": [{"type": "SOLID", "color": "#9E98A6"}], - "text": "Notifications", - "font": ["Geist", 400, 14], - "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "muted"} - } - ] - }, - { - "name": "snTelemetry", - "type": "FRAME", - "x": 0, - "y": 274, - "width": 220, - "height": 36, - "cornerRadius": 6, - "layout": { - "mode": "HORIZONTAL", - "gap": 8, - "padding": [8, 12, 8, 12], - "primary": "MIN", - "counter": "CENTER", - "sizing": ["FIXED", "FIXED"] - }, - "layoutAlignSelf": "STRETCH", - "children": [ - { - "name": "icon", - "type": "INSTANCE", - "x": 12, - "y": 10, - "width": 16, - "height": 16, - "component": "lucide/activity/16x16", - "variables": {"fills/0/color": "muted"} - }, - { - "name": "text", - "type": "TEXT", - "x": 36, - "y": 9, - "width": 64, - "height": 18, - "fills": [{"type": "SOLID", "color": "#9E98A6"}], - "text": "Telemetry", - "font": ["Geist", 400, 14], - "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "muted"} - } - ] - }, - { - "name": "snUpdates", - "type": "FRAME", - "x": 0, - "y": 312, - "width": 220, - "height": 36, - "cornerRadius": 6, - "layout": { - "mode": "HORIZONTAL", - "gap": 8, - "padding": [8, 12, 8, 12], - "primary": "MIN", - "counter": "CENTER", - "sizing": ["FIXED", "FIXED"] - }, - "layoutAlignSelf": "STRETCH", - "children": [ - { - "name": "icon", - "type": "INSTANCE", - "x": 12, - "y": 10, - "width": 16, - "height": 16, - "component": "lucide/refresh-ccw/16x16", - "variables": {"fills/0/color": "muted"} - }, - { - "name": "text", - "type": "TEXT", - "x": 36, - "y": 9, - "width": 54, - "height": 18, - "fills": [{"type": "SOLID", "color": "#9E98A6"}], - "text": "Updates", - "font": ["Geist", 400, 14], - "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "muted"} - } - ] - }, - { - "name": "snAbout", - "type": "FRAME", - "x": 0, - "y": 350, - "width": 220, - "height": 36, - "cornerRadius": 6, - "layout": { - "mode": "HORIZONTAL", - "gap": 8, - "padding": [8, 12, 8, 12], - "primary": "MIN", - "counter": "CENTER", - "sizing": ["FIXED", "FIXED"] - }, - "layoutAlignSelf": "STRETCH", - "children": [ - { - "name": "icon", - "type": "INSTANCE", - "x": 12, - "y": 10, - "width": 16, - "height": 16, - "component": "lucide/info/16x16", - "variables": {"fills/0/color": "muted"} - }, - { - "name": "text", - "type": "TEXT", - "x": 36, - "y": 9, - "width": 39, - "height": 18, - "fills": [{"type": "SOLID", "color": "#9E98A6"}], - "text": "About", - "font": ["Geist", 400, 14], - "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "muted"} - } - ] - }, - { - "name": "snMcp", - "type": "FRAME", - "x": 0, - "y": 84, - "width": 220, - "height": 36, - "fills": [{"type": "SOLID", "color": "#17151A"}], - "cornerRadius": 6, - "layout": { - "mode": "HORIZONTAL", - "gap": 8, - "padding": [8, 12, 8, 12], - "primary": "MIN", - "counter": "CENTER", - "sizing": ["FIXED", "FIXED"] - }, - "layoutAlignSelf": "STRETCH", - "variables": {"fills/0/color": "surface/secondary"}, - "children": [ - { - "name": "icon", - "type": "INSTANCE", - "x": 12, - "y": 10, - "width": 16, - "height": 16, - "component": "lucide/link/16x16" - }, - { - "name": "text", - "type": "TEXT", - "x": 36, - "y": 9, - "width": 79, - "height": 18, - "fills": [{"type": "SOLID", "color": "#F5F3F7"}], - "text": "MCP tokens", - "font": ["Geist", 400, 14], - "variables": {"fontFamily": "typography/font-sans"} - } - ] - } + "height": 492, + "component": "Gameplane/Admin Settings Nav", + "componentId": "1:3419", + "layout": { + "mode": "VERTICAL", + "gap": 2, + "padding": [8, 0, 8, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "texts": [ + "ACCOUNT", + "Theme", + "MCP tokens", + "SFTP", + "SERVER", + "General", + "Authentication", + "Module sources", + "Mod registries", + "Notifications", + "Telemetry", + "Updates", + "About" ] }, { diff --git a/assets/design-export/json/2044649516-2282.json b/assets/design-export/json/2044649516-2282.json index f7cd5b4d2..f60d4c601 100644 --- a/assets/design-export/json/2044649516-2282.json +++ b/assets/design-export/json/2044649516-2282.json @@ -3,7 +3,7 @@ "name": "Screen/MCP Tokens — Revoke", "type": "FRAME", "x": 6560, - "y": 99883, + "y": 101363, "width": 1440, "height": 900, "fills": [{"type": "SOLID", "color": "#121114"}], @@ -382,433 +382,35 @@ "children": [ { "name": "Settings Nav", - "type": "FRAME", + "type": "INSTANCE", "x": 0, "y": 0, "width": 220, - "height": 394, - "children": [ - { - "name": "snGeneral", - "type": "FRAME", - "x": 0, - "y": 8, - "width": 220, - "height": 36, - "fills": [{"type": "SOLID", "color": "#00000000", "opacity": 0}], - "cornerRadius": 6, - "layout": { - "mode": "HORIZONTAL", - "gap": 8, - "padding": [8, 12, 8, 12], - "primary": "MIN", - "counter": "CENTER", - "sizing": ["FIXED", "FIXED"] - }, - "layoutAlignSelf": "STRETCH", - "children": [ - { - "name": "icon", - "type": "INSTANCE", - "x": 12, - "y": 10, - "width": 16, - "height": 16, - "component": "lucide/cog/16x16" - }, - { - "name": "text", - "type": "TEXT", - "x": 36, - "y": 9, - "width": 50, - "height": 18, - "fills": [{"type": "SOLID", "color": "#9E98A6"}], - "text": "General", - "font": ["Geist", 400, 14], - "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "muted"} - } - ] - }, - { - "name": "snTheme", - "type": "FRAME", - "x": 0, - "y": 46, - "width": 220, - "height": 36, - "fills": [{"type": "SOLID", "color": "#000000", "opacity": 0}], - "cornerRadius": 6, - "layout": { - "mode": "HORIZONTAL", - "gap": 8, - "padding": [8, 12, 8, 12], - "primary": "MIN", - "counter": "CENTER", - "sizing": ["FIXED", "FIXED"] - }, - "layoutAlignSelf": "STRETCH", - "children": [ - { - "name": "icon", - "type": "INSTANCE", - "x": 12, - "y": 10, - "width": 16, - "height": 16, - "component": "lucide/palette/16x16" - }, - { - "name": "text", - "type": "TEXT", - "x": 36, - "y": 9, - "width": 43, - "height": 18, - "fills": [{"type": "SOLID", "color": "#9E98A6"}], - "text": "Theme", - "font": ["Geist", 400, 14], - "variables": {"fontFamily": "typography/font-sans"} - } - ] - }, - { - "name": "snAuth", - "type": "FRAME", - "x": 0, - "y": 122, - "width": 220, - "height": 36, - "cornerRadius": 6, - "layout": { - "mode": "HORIZONTAL", - "gap": 8, - "padding": [8, 12, 8, 12], - "primary": "MIN", - "counter": "CENTER", - "sizing": ["FIXED", "FIXED"] - }, - "layoutAlignSelf": "STRETCH", - "children": [ - { - "name": "icon", - "type": "INSTANCE", - "x": 12, - "y": 10, - "width": 16, - "height": 16, - "component": "lucide/shield-check/16x16", - "variables": {"fills/0/color": "muted"} - }, - { - "name": "text", - "type": "TEXT", - "x": 36, - "y": 9, - "width": 94, - "height": 18, - "fills": [{"type": "SOLID", "color": "#9E98A6"}], - "text": "Authentication", - "font": ["Geist", 400, 14], - "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "muted"} - } - ] - }, - { - "name": "snModules", - "type": "FRAME", - "x": 0, - "y": 160, - "width": 220, - "height": 36, - "cornerRadius": 6, - "layout": { - "mode": "HORIZONTAL", - "gap": 8, - "padding": [8, 12, 8, 12], - "primary": "MIN", - "counter": "CENTER", - "sizing": ["FIXED", "FIXED"] - }, - "layoutAlignSelf": "STRETCH", - "children": [ - { - "name": "icon", - "type": "INSTANCE", - "x": 12, - "y": 10, - "width": 16, - "height": 16, - "component": "lucide/boxes/16x16", - "variables": {"fills/0/color": "muted"} - }, - { - "name": "text", - "type": "TEXT", - "x": 36, - "y": 9, - "width": 102, - "height": 18, - "fills": [{"type": "SOLID", "color": "#9E98A6"}], - "text": "Module sources", - "font": ["Geist", 400, 14], - "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "muted"} - } - ] - }, - { - "name": "snModRegistries", - "type": "FRAME", - "x": 0, - "y": 198, - "width": 220, - "height": 36, - "cornerRadius": 6, - "layout": { - "mode": "HORIZONTAL", - "gap": 8, - "padding": [8, 12, 8, 12], - "primary": "MIN", - "counter": "CENTER", - "sizing": ["FIXED", "FIXED"] - }, - "layoutAlignSelf": "STRETCH", - "children": [ - { - "name": "icon", - "type": "INSTANCE", - "x": 12, - "y": 10, - "width": 16, - "height": 16, - "component": "lucide/key/16x16", - "variables": {"fills/0/color": "muted"} - }, - { - "name": "text", - "type": "TEXT", - "x": 36, - "y": 9, - "width": 92, - "height": 18, - "fills": [{"type": "SOLID", "color": "#9E98A6"}], - "text": "Mod registries", - "font": ["Geist", 400, 14], - "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "muted"} - } - ] - }, - { - "name": "snNotifications", - "type": "FRAME", - "x": 0, - "y": 236, - "width": 220, - "height": 36, - "cornerRadius": 6, - "layout": { - "mode": "HORIZONTAL", - "gap": 8, - "padding": [8, 12, 8, 12], - "primary": "MIN", - "counter": "CENTER", - "sizing": ["FIXED", "FIXED"] - }, - "layoutAlignSelf": "STRETCH", - "children": [ - { - "name": "icon", - "type": "INSTANCE", - "x": 12, - "y": 10, - "width": 16, - "height": 16, - "component": "lucide/bell/16x16", - "variables": {"fills/0/color": "muted"} - }, - { - "name": "text", - "type": "TEXT", - "x": 36, - "y": 9, - "width": 81, - "height": 18, - "fills": [{"type": "SOLID", "color": "#9E98A6"}], - "text": "Notifications", - "font": ["Geist", 400, 14], - "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "muted"} - } - ] - }, - { - "name": "snTelemetry", - "type": "FRAME", - "x": 0, - "y": 274, - "width": 220, - "height": 36, - "cornerRadius": 6, - "layout": { - "mode": "HORIZONTAL", - "gap": 8, - "padding": [8, 12, 8, 12], - "primary": "MIN", - "counter": "CENTER", - "sizing": ["FIXED", "FIXED"] - }, - "layoutAlignSelf": "STRETCH", - "children": [ - { - "name": "icon", - "type": "INSTANCE", - "x": 12, - "y": 10, - "width": 16, - "height": 16, - "component": "lucide/activity/16x16", - "variables": {"fills/0/color": "muted"} - }, - { - "name": "text", - "type": "TEXT", - "x": 36, - "y": 9, - "width": 64, - "height": 18, - "fills": [{"type": "SOLID", "color": "#9E98A6"}], - "text": "Telemetry", - "font": ["Geist", 400, 14], - "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "muted"} - } - ] - }, - { - "name": "snUpdates", - "type": "FRAME", - "x": 0, - "y": 312, - "width": 220, - "height": 36, - "cornerRadius": 6, - "layout": { - "mode": "HORIZONTAL", - "gap": 8, - "padding": [8, 12, 8, 12], - "primary": "MIN", - "counter": "CENTER", - "sizing": ["FIXED", "FIXED"] - }, - "layoutAlignSelf": "STRETCH", - "children": [ - { - "name": "icon", - "type": "INSTANCE", - "x": 12, - "y": 10, - "width": 16, - "height": 16, - "component": "lucide/refresh-ccw/16x16", - "variables": {"fills/0/color": "muted"} - }, - { - "name": "text", - "type": "TEXT", - "x": 36, - "y": 9, - "width": 54, - "height": 18, - "fills": [{"type": "SOLID", "color": "#9E98A6"}], - "text": "Updates", - "font": ["Geist", 400, 14], - "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "muted"} - } - ] - }, - { - "name": "snAbout", - "type": "FRAME", - "x": 0, - "y": 350, - "width": 220, - "height": 36, - "cornerRadius": 6, - "layout": { - "mode": "HORIZONTAL", - "gap": 8, - "padding": [8, 12, 8, 12], - "primary": "MIN", - "counter": "CENTER", - "sizing": ["FIXED", "FIXED"] - }, - "layoutAlignSelf": "STRETCH", - "children": [ - { - "name": "icon", - "type": "INSTANCE", - "x": 12, - "y": 10, - "width": 16, - "height": 16, - "component": "lucide/info/16x16", - "variables": {"fills/0/color": "muted"} - }, - { - "name": "text", - "type": "TEXT", - "x": 36, - "y": 9, - "width": 39, - "height": 18, - "fills": [{"type": "SOLID", "color": "#9E98A6"}], - "text": "About", - "font": ["Geist", 400, 14], - "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "muted"} - } - ] - }, - { - "name": "snMcp", - "type": "FRAME", - "x": 0, - "y": 84, - "width": 220, - "height": 36, - "fills": [{"type": "SOLID", "color": "#17151A"}], - "cornerRadius": 6, - "layout": { - "mode": "HORIZONTAL", - "gap": 8, - "padding": [8, 12, 8, 12], - "primary": "MIN", - "counter": "CENTER", - "sizing": ["FIXED", "FIXED"] - }, - "layoutAlignSelf": "STRETCH", - "variables": {"fills/0/color": "surface/secondary"}, - "children": [ - { - "name": "icon", - "type": "INSTANCE", - "x": 12, - "y": 10, - "width": 16, - "height": 16, - "component": "lucide/link/16x16" - }, - { - "name": "text", - "type": "TEXT", - "x": 36, - "y": 9, - "width": 79, - "height": 18, - "fills": [{"type": "SOLID", "color": "#F5F3F7"}], - "text": "MCP tokens", - "font": ["Geist", 400, 14], - "variables": {"fontFamily": "typography/font-sans"} - } - ] - } + "height": 492, + "component": "Gameplane/Admin Settings Nav", + "componentId": "1:3419", + "layout": { + "mode": "VERTICAL", + "gap": 2, + "padding": [8, 0, 8, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "texts": [ + "ACCOUNT", + "Theme", + "MCP tokens", + "SFTP", + "SERVER", + "General", + "Authentication", + "Module sources", + "Mod registries", + "Notifications", + "Telemetry", + "Updates", + "About" ] }, { diff --git a/assets/design-export/json/2044649516-2862.json b/assets/design-export/json/2044649516-2862.json index 788bf88e4..b412af3da 100644 --- a/assets/design-export/json/2044649516-2862.json +++ b/assets/design-export/json/2044649516-2862.json @@ -3,7 +3,7 @@ "name": "Screen/Mobile — MCP Tokens", "type": "FRAME", "x": 8200, - "y": 99883, + "y": 101363, "width": 390, "height": 844, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/2044649516-2982.json b/assets/design-export/json/2044649516-2982.json index f51940a20..eb9713f37 100644 --- a/assets/design-export/json/2044649516-2982.json +++ b/assets/design-export/json/2044649516-2982.json @@ -3,7 +3,7 @@ "name": "Screen/Users & RBAC — MCP tokens", "type": "FRAME", "x": 8790, - "y": 99883, + "y": 101363, "width": 1440, "height": 900, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/2044649516-579.json b/assets/design-export/json/2044649516-579.json index 5be8ca73c..2980d7612 100644 --- a/assets/design-export/json/2044649516-579.json +++ b/assets/design-export/json/2044649516-579.json @@ -3,7 +3,7 @@ "name": "Screen/MCP Tokens — Empty", "type": "FRAME", "x": 1640, - "y": 99883, + "y": 101363, "width": 1440, "height": 900, "fills": [{"type": "SOLID", "color": "#121114"}], @@ -382,433 +382,35 @@ "children": [ { "name": "Settings Nav", - "type": "FRAME", + "type": "INSTANCE", "x": 0, "y": 0, "width": 220, - "height": 394, - "children": [ - { - "name": "snGeneral", - "type": "FRAME", - "x": 0, - "y": 8, - "width": 220, - "height": 36, - "fills": [{"type": "SOLID", "color": "#00000000", "opacity": 0}], - "cornerRadius": 6, - "layout": { - "mode": "HORIZONTAL", - "gap": 8, - "padding": [8, 12, 8, 12], - "primary": "MIN", - "counter": "CENTER", - "sizing": ["FIXED", "FIXED"] - }, - "layoutAlignSelf": "STRETCH", - "children": [ - { - "name": "icon", - "type": "INSTANCE", - "x": 12, - "y": 10, - "width": 16, - "height": 16, - "component": "lucide/cog/16x16" - }, - { - "name": "text", - "type": "TEXT", - "x": 36, - "y": 9, - "width": 50, - "height": 18, - "fills": [{"type": "SOLID", "color": "#9E98A6"}], - "text": "General", - "font": ["Geist", 400, 14], - "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "muted"} - } - ] - }, - { - "name": "snTheme", - "type": "FRAME", - "x": 0, - "y": 46, - "width": 220, - "height": 36, - "fills": [{"type": "SOLID", "color": "#000000", "opacity": 0}], - "cornerRadius": 6, - "layout": { - "mode": "HORIZONTAL", - "gap": 8, - "padding": [8, 12, 8, 12], - "primary": "MIN", - "counter": "CENTER", - "sizing": ["FIXED", "FIXED"] - }, - "layoutAlignSelf": "STRETCH", - "children": [ - { - "name": "icon", - "type": "INSTANCE", - "x": 12, - "y": 10, - "width": 16, - "height": 16, - "component": "lucide/palette/16x16" - }, - { - "name": "text", - "type": "TEXT", - "x": 36, - "y": 9, - "width": 43, - "height": 18, - "fills": [{"type": "SOLID", "color": "#9E98A6"}], - "text": "Theme", - "font": ["Geist", 400, 14], - "variables": {"fontFamily": "typography/font-sans"} - } - ] - }, - { - "name": "snAuth", - "type": "FRAME", - "x": 0, - "y": 122, - "width": 220, - "height": 36, - "cornerRadius": 6, - "layout": { - "mode": "HORIZONTAL", - "gap": 8, - "padding": [8, 12, 8, 12], - "primary": "MIN", - "counter": "CENTER", - "sizing": ["FIXED", "FIXED"] - }, - "layoutAlignSelf": "STRETCH", - "children": [ - { - "name": "icon", - "type": "INSTANCE", - "x": 12, - "y": 10, - "width": 16, - "height": 16, - "component": "lucide/shield-check/16x16", - "variables": {"fills/0/color": "muted"} - }, - { - "name": "text", - "type": "TEXT", - "x": 36, - "y": 9, - "width": 94, - "height": 18, - "fills": [{"type": "SOLID", "color": "#9E98A6"}], - "text": "Authentication", - "font": ["Geist", 400, 14], - "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "muted"} - } - ] - }, - { - "name": "snModules", - "type": "FRAME", - "x": 0, - "y": 160, - "width": 220, - "height": 36, - "cornerRadius": 6, - "layout": { - "mode": "HORIZONTAL", - "gap": 8, - "padding": [8, 12, 8, 12], - "primary": "MIN", - "counter": "CENTER", - "sizing": ["FIXED", "FIXED"] - }, - "layoutAlignSelf": "STRETCH", - "children": [ - { - "name": "icon", - "type": "INSTANCE", - "x": 12, - "y": 10, - "width": 16, - "height": 16, - "component": "lucide/boxes/16x16", - "variables": {"fills/0/color": "muted"} - }, - { - "name": "text", - "type": "TEXT", - "x": 36, - "y": 9, - "width": 102, - "height": 18, - "fills": [{"type": "SOLID", "color": "#9E98A6"}], - "text": "Module sources", - "font": ["Geist", 400, 14], - "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "muted"} - } - ] - }, - { - "name": "snModRegistries", - "type": "FRAME", - "x": 0, - "y": 198, - "width": 220, - "height": 36, - "cornerRadius": 6, - "layout": { - "mode": "HORIZONTAL", - "gap": 8, - "padding": [8, 12, 8, 12], - "primary": "MIN", - "counter": "CENTER", - "sizing": ["FIXED", "FIXED"] - }, - "layoutAlignSelf": "STRETCH", - "children": [ - { - "name": "icon", - "type": "INSTANCE", - "x": 12, - "y": 10, - "width": 16, - "height": 16, - "component": "lucide/key/16x16", - "variables": {"fills/0/color": "muted"} - }, - { - "name": "text", - "type": "TEXT", - "x": 36, - "y": 9, - "width": 92, - "height": 18, - "fills": [{"type": "SOLID", "color": "#9E98A6"}], - "text": "Mod registries", - "font": ["Geist", 400, 14], - "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "muted"} - } - ] - }, - { - "name": "snNotifications", - "type": "FRAME", - "x": 0, - "y": 236, - "width": 220, - "height": 36, - "cornerRadius": 6, - "layout": { - "mode": "HORIZONTAL", - "gap": 8, - "padding": [8, 12, 8, 12], - "primary": "MIN", - "counter": "CENTER", - "sizing": ["FIXED", "FIXED"] - }, - "layoutAlignSelf": "STRETCH", - "children": [ - { - "name": "icon", - "type": "INSTANCE", - "x": 12, - "y": 10, - "width": 16, - "height": 16, - "component": "lucide/bell/16x16", - "variables": {"fills/0/color": "muted"} - }, - { - "name": "text", - "type": "TEXT", - "x": 36, - "y": 9, - "width": 81, - "height": 18, - "fills": [{"type": "SOLID", "color": "#9E98A6"}], - "text": "Notifications", - "font": ["Geist", 400, 14], - "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "muted"} - } - ] - }, - { - "name": "snTelemetry", - "type": "FRAME", - "x": 0, - "y": 274, - "width": 220, - "height": 36, - "cornerRadius": 6, - "layout": { - "mode": "HORIZONTAL", - "gap": 8, - "padding": [8, 12, 8, 12], - "primary": "MIN", - "counter": "CENTER", - "sizing": ["FIXED", "FIXED"] - }, - "layoutAlignSelf": "STRETCH", - "children": [ - { - "name": "icon", - "type": "INSTANCE", - "x": 12, - "y": 10, - "width": 16, - "height": 16, - "component": "lucide/activity/16x16", - "variables": {"fills/0/color": "muted"} - }, - { - "name": "text", - "type": "TEXT", - "x": 36, - "y": 9, - "width": 64, - "height": 18, - "fills": [{"type": "SOLID", "color": "#9E98A6"}], - "text": "Telemetry", - "font": ["Geist", 400, 14], - "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "muted"} - } - ] - }, - { - "name": "snUpdates", - "type": "FRAME", - "x": 0, - "y": 312, - "width": 220, - "height": 36, - "cornerRadius": 6, - "layout": { - "mode": "HORIZONTAL", - "gap": 8, - "padding": [8, 12, 8, 12], - "primary": "MIN", - "counter": "CENTER", - "sizing": ["FIXED", "FIXED"] - }, - "layoutAlignSelf": "STRETCH", - "children": [ - { - "name": "icon", - "type": "INSTANCE", - "x": 12, - "y": 10, - "width": 16, - "height": 16, - "component": "lucide/refresh-ccw/16x16", - "variables": {"fills/0/color": "muted"} - }, - { - "name": "text", - "type": "TEXT", - "x": 36, - "y": 9, - "width": 54, - "height": 18, - "fills": [{"type": "SOLID", "color": "#9E98A6"}], - "text": "Updates", - "font": ["Geist", 400, 14], - "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "muted"} - } - ] - }, - { - "name": "snAbout", - "type": "FRAME", - "x": 0, - "y": 350, - "width": 220, - "height": 36, - "cornerRadius": 6, - "layout": { - "mode": "HORIZONTAL", - "gap": 8, - "padding": [8, 12, 8, 12], - "primary": "MIN", - "counter": "CENTER", - "sizing": ["FIXED", "FIXED"] - }, - "layoutAlignSelf": "STRETCH", - "children": [ - { - "name": "icon", - "type": "INSTANCE", - "x": 12, - "y": 10, - "width": 16, - "height": 16, - "component": "lucide/info/16x16", - "variables": {"fills/0/color": "muted"} - }, - { - "name": "text", - "type": "TEXT", - "x": 36, - "y": 9, - "width": 39, - "height": 18, - "fills": [{"type": "SOLID", "color": "#9E98A6"}], - "text": "About", - "font": ["Geist", 400, 14], - "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "muted"} - } - ] - }, - { - "name": "snMcp", - "type": "FRAME", - "x": 0, - "y": 84, - "width": 220, - "height": 36, - "fills": [{"type": "SOLID", "color": "#17151A"}], - "cornerRadius": 6, - "layout": { - "mode": "HORIZONTAL", - "gap": 8, - "padding": [8, 12, 8, 12], - "primary": "MIN", - "counter": "CENTER", - "sizing": ["FIXED", "FIXED"] - }, - "layoutAlignSelf": "STRETCH", - "variables": {"fills/0/color": "surface/secondary"}, - "children": [ - { - "name": "icon", - "type": "INSTANCE", - "x": 12, - "y": 10, - "width": 16, - "height": 16, - "component": "lucide/link/16x16" - }, - { - "name": "text", - "type": "TEXT", - "x": 36, - "y": 9, - "width": 79, - "height": 18, - "fills": [{"type": "SOLID", "color": "#F5F3F7"}], - "text": "MCP tokens", - "font": ["Geist", 400, 14], - "variables": {"fontFamily": "typography/font-sans"} - } - ] - } + "height": 492, + "component": "Gameplane/Admin Settings Nav", + "componentId": "1:3419", + "layout": { + "mode": "VERTICAL", + "gap": 2, + "padding": [8, 0, 8, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "texts": [ + "ACCOUNT", + "Theme", + "MCP tokens", + "SFTP", + "SERVER", + "General", + "Authentication", + "Module sources", + "Mod registries", + "Notifications", + "Telemetry", + "Updates", + "About" ] }, { diff --git a/assets/design-export/json/46479436-2.json b/assets/design-export/json/46479436-2.json index 5ef8c5ecd..69935f5cd 100644 --- a/assets/design-export/json/46479436-2.json +++ b/assets/design-export/json/46479436-2.json @@ -3,7 +3,7 @@ "name": "Gameplane/Dialog/Back up now (No destinations)", "type": "FRAME", "x": 0, - "y": 98811, + "y": 100291, "width": 480, "height": 279, "fills": [{"type": "SOLID", "color": "#FFF7FB"}], diff --git a/assets/design-export/json/B57dG.json b/assets/design-export/json/B57dG.json index 57648223c..decb9a290 100644 --- a/assets/design-export/json/B57dG.json +++ b/assets/design-export/json/B57dG.json @@ -4,7 +4,7 @@ "name": "Screen/Share Link — Start timed out", "type": "FRAME", "x": 9840, - "y": 95669, + "y": 97149, "width": 1440, "height": 900, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/C2LQE4.json b/assets/design-export/json/C2LQE4.json index d22fec68a..6c3e3aed7 100644 --- a/assets/design-export/json/C2LQE4.json +++ b/assets/design-export/json/C2LQE4.json @@ -4,7 +4,7 @@ "name": "Screen/Share Link — Up", "type": "FRAME", "x": 0, - "y": 95669, + "y": 97149, "width": 1440, "height": 900, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/D9QYZ.json b/assets/design-export/json/D9QYZ.json index 282a5c446..978ab2bde 100644 --- a/assets/design-export/json/D9QYZ.json +++ b/assets/design-export/json/D9QYZ.json @@ -4,7 +4,7 @@ "name": "Legacy/Standalone — Backup destinations — Moved", "type": "FRAME", "x": 1640, - "y": 86372, + "y": 87852, "width": 1440, "height": 900, "fills": [{"type": "SOLID", "color": "#121114"}], @@ -215,7 +215,7 @@ "x": 0, "y": 0, "width": 220, - "height": 356, + "height": 492, "component": "Gameplane/Admin Settings Nav", "componentId": "1:3419", "layout": { @@ -227,8 +227,12 @@ "sizing": ["HUG", "FIXED"] }, "texts": [ - "General", + "ACCOUNT", "Theme", + "MCP tokens", + "SFTP", + "SERVER", + "General", "Authentication", "Module sources", "Mod registries", diff --git a/assets/design-export/json/DBQyF.json b/assets/design-export/json/DBQyF.json index 06463466b..4b71b3084 100644 --- a/assets/design-export/json/DBQyF.json +++ b/assets/design-export/json/DBQyF.json @@ -4,7 +4,7 @@ "name": "Screen/Admin Settings — Telemetry (disabled)", "type": "FRAME", "x": 6560, - "y": 91637, + "y": 93117, "width": 1440, "height": 641, "fills": [{"type": "SOLID", "color": "#121114"}], @@ -176,7 +176,7 @@ "x": 0, "y": 0, "width": 220, - "height": 356, + "height": 492, "component": "Gameplane/Admin Settings Nav", "componentId": "1:3419", "layout": { @@ -188,8 +188,12 @@ "sizing": ["HUG", "FIXED"] }, "texts": [ - "General", + "ACCOUNT", "Theme", + "MCP tokens", + "SFTP", + "SERVER", + "General", "Authentication", "Module sources", "Mod registries", diff --git a/assets/design-export/json/EcoGD.json b/assets/design-export/json/EcoGD.json index bc371b143..4c0c65d0d 100644 --- a/assets/design-export/json/EcoGD.json +++ b/assets/design-export/json/EcoGD.json @@ -4,7 +4,7 @@ "name": "Screen/Share Link — Starting", "type": "FRAME", "x": 4920, - "y": 95669, + "y": 97149, "width": 1440, "height": 900, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/FBiMN.json b/assets/design-export/json/FBiMN.json index 63e12787d..e90f568a2 100644 --- a/assets/design-export/json/FBiMN.json +++ b/assets/design-export/json/FBiMN.json @@ -4,7 +4,7 @@ "name": "Screen/Share Link — Asleep (Start cooldown)", "type": "FRAME", "x": 3280, - "y": 95669, + "y": 97149, "width": 1440, "height": 900, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/FOVMf.json b/assets/design-export/json/FOVMf.json index 371e63e96..398a73c95 100644 --- a/assets/design-export/json/FOVMf.json +++ b/assets/design-export/json/FOVMf.json @@ -4,7 +4,7 @@ "name": "Screen/Standalone — Settings · About", "type": "FRAME", "x": 1640, - "y": 94369, + "y": 95849, "width": 1440, "height": 900, "fills": [{"type": "SOLID", "color": "#121114"}], @@ -215,7 +215,7 @@ "x": 0, "y": 0, "width": 220, - "height": 356, + "height": 492, "component": "Gameplane/Admin Settings Nav", "componentId": "1:3419", "layout": { @@ -227,8 +227,12 @@ "sizing": ["HUG", "FIXED"] }, "texts": [ - "General", + "ACCOUNT", "Theme", + "MCP tokens", + "SFTP", + "SERVER", + "General", "Authentication", "Module sources", "Mod registries", diff --git a/assets/design-export/json/K5XinZ.json b/assets/design-export/json/K5XinZ.json index 85a384bdb..599881251 100644 --- a/assets/design-export/json/K5XinZ.json +++ b/assets/design-export/json/K5XinZ.json @@ -4,7 +4,7 @@ "name": "Screen/Admin Settings — Telemetry (none)", "type": "FRAME", "x": 8200, - "y": 91637, + "y": 93117, "width": 1440, "height": 605, "fills": [{"type": "SOLID", "color": "#121114"}], @@ -176,7 +176,7 @@ "x": 0, "y": 0, "width": 220, - "height": 356, + "height": 492, "component": "Gameplane/Admin Settings Nav", "componentId": "1:3419", "layout": { @@ -188,8 +188,12 @@ "sizing": ["HUG", "FIXED"] }, "texts": [ - "General", + "ACCOUNT", "Theme", + "MCP tokens", + "SFTP", + "SERVER", + "General", "Authentication", "Module sources", "Mod registries", diff --git a/assets/design-export/json/LYPXU.json b/assets/design-export/json/LYPXU.json index c58f04212..8d0ba2de9 100644 --- a/assets/design-export/json/LYPXU.json +++ b/assets/design-export/json/LYPXU.json @@ -4,7 +4,7 @@ "name": "Screen/Share Link — Stopped by owner", "type": "FRAME", "x": 8200, - "y": 95669, + "y": 97149, "width": 1440, "height": 900, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/M2sA4u.json b/assets/design-export/json/M2sA4u.json index 2aa8e519f..a3c3e1184 100644 --- a/assets/design-export/json/M2sA4u.json +++ b/assets/design-export/json/M2sA4u.json @@ -4,7 +4,7 @@ "name": "Screen/Admin Settings — Updates", "type": "FRAME", "x": 0, - "y": 93069, + "y": 94549, "width": 1440, "height": 900, "fills": [{"type": "SOLID", "color": "#121114"}], @@ -176,7 +176,7 @@ "x": 0, "y": 0, "width": 220, - "height": 356, + "height": 492, "component": "Gameplane/Admin Settings Nav", "componentId": "1:3419", "layout": { @@ -188,8 +188,12 @@ "sizing": ["HUG", "FIXED"] }, "texts": [ - "General", + "ACCOUNT", "Theme", + "MCP tokens", + "SFTP", + "SERVER", + "General", "Authentication", "Module sources", "Mod registries", diff --git a/assets/design-export/json/Ne5TA.json b/assets/design-export/json/Ne5TA.json index 90c5cce35..9f63f981b 100644 --- a/assets/design-export/json/Ne5TA.json +++ b/assets/design-export/json/Ne5TA.json @@ -4,7 +4,7 @@ "name": "Screen/Not Found", "type": "FRAME", "x": 0, - "y": 96969, + "y": 98449, "width": 1440, "height": 900, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/QgW58.json b/assets/design-export/json/QgW58.json index 85833b10c..0c5afa052 100644 --- a/assets/design-export/json/QgW58.json +++ b/assets/design-export/json/QgW58.json @@ -4,7 +4,7 @@ "name": "Screen/Admin Settings — Authentication (Save rejected)", "type": "FRAME", "x": 3280, - "y": 82663, + "y": 84143, "width": 1440, "height": 1660, "fills": [{"type": "SOLID", "color": "#121114"}], @@ -175,7 +175,7 @@ "x": 0, "y": 0, "width": 220, - "height": 356, + "height": 492, "component": "Gameplane/Admin Settings Nav", "componentId": "1:3419", "layout": { @@ -187,8 +187,12 @@ "sizing": ["HUG", "FIXED"] }, "texts": [ - "General", + "ACCOUNT", "Theme", + "MCP tokens", + "SFTP", + "SERVER", + "General", "Authentication", "Module sources", "Mod registries", diff --git a/assets/design-export/json/RC3Kf.json b/assets/design-export/json/RC3Kf.json index f2640a7c8..02edf23a1 100644 --- a/assets/design-export/json/RC3Kf.json +++ b/assets/design-export/json/RC3Kf.json @@ -4,7 +4,7 @@ "name": "Legacy/Admin Settings — Backup destinations — Moved", "type": "FRAME", "x": 0, - "y": 86372, + "y": 87852, "width": 1440, "height": 900, "fills": [{"type": "SOLID", "color": "#121114"}], @@ -176,7 +176,7 @@ "x": 0, "y": 0, "width": 220, - "height": 356, + "height": 492, "component": "Gameplane/Admin Settings Nav", "componentId": "1:3419", "layout": { @@ -188,8 +188,12 @@ "sizing": ["HUG", "FIXED"] }, "texts": [ - "General", + "ACCOUNT", "Theme", + "MCP tokens", + "SFTP", + "SERVER", + "General", "Authentication", "Module sources", "Mod registries", diff --git a/assets/design-export/json/SUcad.json b/assets/design-export/json/SUcad.json index fea04a308..40c23409e 100644 --- a/assets/design-export/json/SUcad.json +++ b/assets/design-export/json/SUcad.json @@ -4,7 +4,7 @@ "name": "Screen/Admin Settings — Notifications (Add sink)", "type": "FRAME", "x": 1640, - "y": 90272, + "y": 91752, "width": 1440, "height": 965, "fills": [{"type": "SOLID", "color": "#121114"}], @@ -176,7 +176,7 @@ "x": 0, "y": 0, "width": 220, - "height": 356, + "height": 492, "component": "Gameplane/Admin Settings Nav", "componentId": "1:3419", "layout": { @@ -188,8 +188,12 @@ "sizing": ["HUG", "FIXED"] }, "texts": [ - "General", + "ACCOUNT", "Theme", + "MCP tokens", + "SFTP", + "SERVER", + "General", "Authentication", "Module sources", "Mod registries", diff --git a/assets/design-export/json/T1wkiT.json b/assets/design-export/json/T1wkiT.json index ea66516cf..ebcd52323 100644 --- a/assets/design-export/json/T1wkiT.json +++ b/assets/design-export/json/T1wkiT.json @@ -403,7 +403,7 @@ "x": 0, "y": 0, "width": 220, - "height": 356, + "height": 492, "component": "Gameplane/Admin Settings Nav", "componentId": "1:3419", "layout": { @@ -415,8 +415,12 @@ "sizing": ["HUG", "FIXED"] }, "texts": [ - "General", + "ACCOUNT", "Theme", + "MCP tokens", + "SFTP", + "SERVER", + "General", "Authentication", "Module sources", "Mod registries", diff --git a/assets/design-export/json/UdnBT.json b/assets/design-export/json/UdnBT.json index 606e4207d..5c3a0be76 100644 --- a/assets/design-export/json/UdnBT.json +++ b/assets/design-export/json/UdnBT.json @@ -4,7 +4,7 @@ "name": "Screen/Admin Settings — Authentication (Role rules)", "type": "FRAME", "x": 6560, - "y": 82663, + "y": 84143, "width": 1440, "height": 2600, "fills": [{"type": "SOLID", "color": "#121114"}], @@ -175,7 +175,7 @@ "x": 0, "y": 0, "width": 220, - "height": 356, + "height": 492, "component": "Gameplane/Admin Settings Nav", "componentId": "1:3419", "layout": { @@ -187,8 +187,12 @@ "sizing": ["HUG", "FIXED"] }, "texts": [ - "General", + "ACCOUNT", "Theme", + "MCP tokens", + "SFTP", + "SERVER", + "General", "Authentication", "Module sources", "Mod registries", diff --git a/assets/design-export/json/Uzzje.json b/assets/design-export/json/Uzzje.json index 9f271332f..7c3d649e0 100644 --- a/assets/design-export/json/Uzzje.json +++ b/assets/design-export/json/Uzzje.json @@ -4,7 +4,7 @@ "name": "Screen/Standalone — Settings · Updates", "type": "FRAME", "x": 1640, - "y": 93069, + "y": 94549, "width": 1440, "height": 900, "fills": [{"type": "SOLID", "color": "#121114"}], @@ -215,7 +215,7 @@ "x": 0, "y": 0, "width": 220, - "height": 356, + "height": 492, "component": "Gameplane/Admin Settings Nav", "componentId": "1:3419", "layout": { @@ -227,8 +227,12 @@ "sizing": ["HUG", "FIXED"] }, "texts": [ - "General", + "ACCOUNT", "Theme", + "MCP tokens", + "SFTP", + "SERVER", + "General", "Authentication", "Module sources", "Mod registries", diff --git a/assets/design-export/json/WZdnw.json b/assets/design-export/json/WZdnw.json index dcb7a3d17..3fb9ec213 100644 --- a/assets/design-export/json/WZdnw.json +++ b/assets/design-export/json/WZdnw.json @@ -176,7 +176,7 @@ "x": 0, "y": 0, "width": 220, - "height": 356, + "height": 492, "component": "Gameplane/Admin Settings Nav", "componentId": "1:3419", "layout": { @@ -188,8 +188,12 @@ "sizing": ["HUG", "FIXED"] }, "texts": [ - "General", + "ACCOUNT", "Theme", + "MCP tokens", + "SFTP", + "SERVER", + "General", "Authentication", "Module sources", "Mod registries", diff --git a/assets/design-export/json/Wj0V4.json b/assets/design-export/json/Wj0V4.json index 4fbfc0b1e..20e500c2d 100644 --- a/assets/design-export/json/Wj0V4.json +++ b/assets/design-export/json/Wj0V4.json @@ -4,7 +4,7 @@ "name": "Screen/Admin Settings — Mod registries", "type": "FRAME", "x": 0, - "y": 88972, + "y": 90452, "width": 1440, "height": 900, "fills": [{"type": "SOLID", "color": "#121114"}], @@ -831,7 +831,7 @@ "x": 0, "y": 0, "width": 220, - "height": 356, + "height": 492, "component": "Gameplane/Admin Settings Nav", "componentId": "1:3419", "layout": { @@ -843,8 +843,12 @@ "sizing": ["HUG", "FIXED"] }, "texts": [ - "General", + "ACCOUNT", "Theme", + "MCP tokens", + "SFTP", + "SERVER", + "General", "Authentication", "Module sources", "Mod registries", diff --git a/assets/design-export/json/cDiNb.json b/assets/design-export/json/cDiNb.json index 388bcd7c7..80880b041 100644 --- a/assets/design-export/json/cDiNb.json +++ b/assets/design-export/json/cDiNb.json @@ -4,7 +4,7 @@ "name": "Screen/Admin Settings — Telemetry (bundled)", "type": "FRAME", "x": 4920, - "y": 91637, + "y": 93117, "width": 1440, "height": 777, "fills": [{"type": "SOLID", "color": "#121114"}], @@ -176,7 +176,7 @@ "x": 0, "y": 0, "width": 220, - "height": 356, + "height": 492, "component": "Gameplane/Admin Settings Nav", "componentId": "1:3419", "layout": { @@ -188,8 +188,12 @@ "sizing": ["HUG", "FIXED"] }, "texts": [ - "General", + "ACCOUNT", "Theme", + "MCP tokens", + "SFTP", + "SERVER", + "General", "Authentication", "Module sources", "Mod registries", diff --git a/assets/design-export/json/epZO2.json b/assets/design-export/json/epZO2.json index 6dd3a5174..644e0f091 100644 --- a/assets/design-export/json/epZO2.json +++ b/assets/design-export/json/epZO2.json @@ -4,7 +4,7 @@ "name": "Screen/Share Link — Invalid or expired", "type": "FRAME", "x": 6560, - "y": 95669, + "y": 97149, "width": 1440, "height": 900, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/g5mEpx.json b/assets/design-export/json/g5mEpx.json index de062e088..68bfe57d2 100644 --- a/assets/design-export/json/g5mEpx.json +++ b/assets/design-export/json/g5mEpx.json @@ -4,7 +4,7 @@ "name": "Screen/Admin Settings — Module sources", "type": "FRAME", "x": 0, - "y": 87672, + "y": 89152, "width": 1440, "height": 900, "fills": [{"type": "SOLID", "color": "#121114"}], @@ -176,7 +176,7 @@ "x": 0, "y": 0, "width": 220, - "height": 356, + "height": 492, "component": "Gameplane/Admin Settings Nav", "componentId": "1:3419", "layout": { @@ -188,8 +188,12 @@ "sizing": ["HUG", "FIXED"] }, "texts": [ - "General", + "ACCOUNT", "Theme", + "MCP tokens", + "SFTP", + "SERVER", + "General", "Authentication", "Module sources", "Mod registries", diff --git a/assets/design-export/json/i4L0M.json b/assets/design-export/json/i4L0M.json index 666fcd536..adb3f9b63 100644 --- a/assets/design-export/json/i4L0M.json +++ b/assets/design-export/json/i4L0M.json @@ -4,7 +4,7 @@ "name": "Screen/Admin Settings — Mod registries (Key saved)", "type": "FRAME", "x": 1640, - "y": 88972, + "y": 90452, "width": 1440, "height": 900, "fills": [{"type": "SOLID", "color": "#121114"}], @@ -831,7 +831,7 @@ "x": 0, "y": 0, "width": 220, - "height": 356, + "height": 492, "component": "Gameplane/Admin Settings Nav", "componentId": "1:3419", "layout": { @@ -843,8 +843,12 @@ "sizing": ["HUG", "FIXED"] }, "texts": [ - "General", + "ACCOUNT", "Theme", + "MCP tokens", + "SFTP", + "SERVER", + "General", "Authentication", "Module sources", "Mod registries", diff --git a/assets/design-export/json/l64bd.json b/assets/design-export/json/l64bd.json index 6b8a9e7ce..92c5b5839 100644 --- a/assets/design-export/json/l64bd.json +++ b/assets/design-export/json/l64bd.json @@ -4,7 +4,7 @@ "name": "Screen/Standalone — Settings · Module sources", "type": "FRAME", "x": 1640, - "y": 87672, + "y": 89152, "width": 1440, "height": 900, "fills": [{"type": "SOLID", "color": "#121114"}], @@ -215,7 +215,7 @@ "x": 0, "y": 0, "width": 220, - "height": 356, + "height": 492, "component": "Gameplane/Admin Settings Nav", "componentId": "1:3419", "layout": { @@ -227,8 +227,12 @@ "sizing": ["HUG", "FIXED"] }, "texts": [ - "General", + "ACCOUNT", "Theme", + "MCP tokens", + "SFTP", + "SERVER", + "General", "Authentication", "Module sources", "Mod registries", diff --git a/assets/design-export/json/l7TRz9.json b/assets/design-export/json/l7TRz9.json index 7b82135ab..269b17637 100644 --- a/assets/design-export/json/l7TRz9.json +++ b/assets/design-export/json/l7TRz9.json @@ -4,7 +4,7 @@ "name": "Screen/Admin Settings — Telemetry (default)", "type": "FRAME", "x": 1640, - "y": 91637, + "y": 93117, "width": 1440, "height": 1031, "fills": [{"type": "SOLID", "color": "#121114"}], @@ -176,7 +176,7 @@ "x": 0, "y": 0, "width": 220, - "height": 356, + "height": 492, "component": "Gameplane/Admin Settings Nav", "componentId": "1:3419", "layout": { @@ -188,8 +188,12 @@ "sizing": ["HUG", "FIXED"] }, "texts": [ - "General", + "ACCOUNT", "Theme", + "MCP tokens", + "SFTP", + "SERVER", + "General", "Authentication", "Module sources", "Mod registries", diff --git a/assets/design-export/json/lCTci.json b/assets/design-export/json/lCTci.json index e5b831140..07fb20dc4 100644 --- a/assets/design-export/json/lCTci.json +++ b/assets/design-export/json/lCTci.json @@ -50,7 +50,7 @@ "x": 0, "y": 64, "width": 390, - "height": 914, + "height": 1050, "fills": [{"type": "SOLID", "color": "#121114"}], "layout": { "mode": "VERTICAL", @@ -93,7 +93,7 @@ "x": 16, "y": 98, "width": 358, - "height": 356, + "height": 492, "component": "Gameplane/Admin Settings Nav", "componentId": "1:3419", "layout": { @@ -106,8 +106,12 @@ }, "layoutAlignSelf": "STRETCH", "texts": [ - "General", + "ACCOUNT", "Theme", + "MCP tokens", + "SFTP", + "SERVER", + "General", "Authentication", "Module sources", "Mod registries", @@ -122,7 +126,7 @@ "name": "Language Card", "type": "INSTANCE", "x": 16, - "y": 470, + "y": 606, "width": 358, "height": 428, "component": "Gameplane/Language Card", diff --git a/assets/design-export/json/lWvcv.json b/assets/design-export/json/lWvcv.json index 8d3da5ca5..5bd0bc0cb 100644 --- a/assets/design-export/json/lWvcv.json +++ b/assets/design-export/json/lWvcv.json @@ -403,7 +403,7 @@ "x": 0, "y": 0, "width": 220, - "height": 356, + "height": 492, "component": "Gameplane/Admin Settings Nav", "componentId": "1:3419", "layout": { @@ -415,8 +415,12 @@ "sizing": ["HUG", "FIXED"] }, "texts": [ - "General", + "ACCOUNT", "Theme", + "MCP tokens", + "SFTP", + "SERVER", + "General", "Authentication", "Module sources", "Mod registries", diff --git a/assets/design-export/json/mrF6f.json b/assets/design-export/json/mrF6f.json index 7e570c7dc..01e00d114 100644 --- a/assets/design-export/json/mrF6f.json +++ b/assets/design-export/json/mrF6f.json @@ -4,7 +4,7 @@ "name": "Screen/Admin Settings — Authentication (Role rules empty, not overridden)", "type": "FRAME", "x": 8200, - "y": 82663, + "y": 84143, "width": 888, "height": 649, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/n6Xlo.json b/assets/design-export/json/n6Xlo.json index 020cabc54..efd9fbf5e 100644 --- a/assets/design-export/json/n6Xlo.json +++ b/assets/design-export/json/n6Xlo.json @@ -4,7 +4,7 @@ "name": "Screen/Admin Settings — Notifications", "type": "FRAME", "x": 0, - "y": 90272, + "y": 91752, "width": 1440, "height": 900, "fills": [{"type": "SOLID", "color": "#121114"}], @@ -176,7 +176,7 @@ "x": 0, "y": 0, "width": 220, - "height": 356, + "height": 492, "component": "Gameplane/Admin Settings Nav", "componentId": "1:3419", "layout": { @@ -188,8 +188,12 @@ "sizing": ["HUG", "FIXED"] }, "texts": [ - "General", + "ACCOUNT", "Theme", + "MCP tokens", + "SFTP", + "SERVER", + "General", "Authentication", "Module sources", "Mod registries", diff --git a/assets/design-export/json/nNGDX.json b/assets/design-export/json/nNGDX.json index b8777faae..ad8dfc2dd 100644 --- a/assets/design-export/json/nNGDX.json +++ b/assets/design-export/json/nNGDX.json @@ -4,7 +4,7 @@ "name": "Screen/Admin Settings — Authentication (No OIDC mappings)", "type": "FRAME", "x": 1640, - "y": 82663, + "y": 84143, "width": 1440, "height": 1463, "fills": [{"type": "SOLID", "color": "#121114"}], @@ -175,7 +175,7 @@ "x": 0, "y": 0, "width": 220, - "height": 356, + "height": 492, "component": "Gameplane/Admin Settings Nav", "componentId": "1:3419", "layout": { @@ -187,8 +187,12 @@ "sizing": ["HUG", "FIXED"] }, "texts": [ - "General", + "ACCOUNT", "Theme", + "MCP tokens", + "SFTP", + "SERVER", + "General", "Authentication", "Module sources", "Mod registries", diff --git a/assets/design-export/json/q31B6w.json b/assets/design-export/json/q31B6w.json index 02eaaba10..51d893a35 100644 --- a/assets/design-export/json/q31B6w.json +++ b/assets/design-export/json/q31B6w.json @@ -4,7 +4,7 @@ "name": "Screen/Share Link — Asleep (can start)", "type": "FRAME", "x": 1640, - "y": 95669, + "y": 97149, "width": 1440, "height": 900, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/qFLfB.json b/assets/design-export/json/qFLfB.json index fe31ff523..a34df83dd 100644 --- a/assets/design-export/json/qFLfB.json +++ b/assets/design-export/json/qFLfB.json @@ -4,7 +4,7 @@ "name": "Historical/Share Link — Asleep (view only)", "type": "FRAME", "x": 11480, - "y": 95669, + "y": 97149, "width": 1440, "height": 900, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/r0heh.json b/assets/design-export/json/r0heh.json index c2cd8a1a0..0eed59ffe 100644 --- a/assets/design-export/json/r0heh.json +++ b/assets/design-export/json/r0heh.json @@ -4,7 +4,7 @@ "name": "Screen/Admin Settings — Telemetry (custom)", "type": "FRAME", "x": 3280, - "y": 91637, + "y": 93117, "width": 1440, "height": 1032, "fills": [{"type": "SOLID", "color": "#121114"}], @@ -176,7 +176,7 @@ "x": 0, "y": 0, "width": 220, - "height": 356, + "height": 492, "component": "Gameplane/Admin Settings Nav", "componentId": "1:3419", "layout": { @@ -188,8 +188,12 @@ "sizing": ["HUG", "FIXED"] }, "texts": [ - "General", + "ACCOUNT", "Theme", + "MCP tokens", + "SFTP", + "SERVER", + "General", "Authentication", "Module sources", "Mod registries", diff --git a/assets/design-export/json/uMiwd.json b/assets/design-export/json/uMiwd.json index 6f8d3c508..dc34ea626 100644 --- a/assets/design-export/json/uMiwd.json +++ b/assets/design-export/json/uMiwd.json @@ -4,7 +4,7 @@ "name": "Screen/Admin Settings — Authentication", "type": "FRAME", "x": 0, - "y": 82663, + "y": 84143, "width": 1440, "height": 1636, "fills": [{"type": "SOLID", "color": "#121114"}], @@ -830,7 +830,7 @@ "x": 0, "y": 0, "width": 220, - "height": 356, + "height": 492, "component": "Gameplane/Admin Settings Nav", "componentId": "1:3419", "layout": { @@ -842,8 +842,12 @@ "sizing": ["HUG", "FIXED"] }, "texts": [ - "General", + "ACCOUNT", "Theme", + "MCP tokens", + "SFTP", + "SERVER", + "General", "Authentication", "Module sources", "Mod registries", diff --git a/assets/design-export/json/uoxQW.json b/assets/design-export/json/uoxQW.json index 46ab5ffe6..60aee3df0 100644 --- a/assets/design-export/json/uoxQW.json +++ b/assets/design-export/json/uoxQW.json @@ -4,7 +4,7 @@ "name": "Screen/Admin Settings — Telemetry", "type": "FRAME", "x": 0, - "y": 91637, + "y": 93117, "width": 1440, "height": 900, "fills": [{"type": "SOLID", "color": "#121114"}], @@ -176,7 +176,7 @@ "x": 0, "y": 0, "width": 220, - "height": 356, + "height": 492, "component": "Gameplane/Admin Settings Nav", "componentId": "1:3419", "layout": { @@ -188,8 +188,12 @@ "sizing": ["HUG", "FIXED"] }, "texts": [ - "General", + "ACCOUNT", "Theme", + "MCP tokens", + "SFTP", + "SERVER", + "General", "Authentication", "Module sources", "Mod registries", diff --git a/assets/design-export/json/yrxK2.json b/assets/design-export/json/yrxK2.json index 66f75c623..a0c728a8a 100644 --- a/assets/design-export/json/yrxK2.json +++ b/assets/design-export/json/yrxK2.json @@ -4,7 +4,7 @@ "name": "Screen/Admin Settings — Telemetry (Reset ID confirm)", "type": "FRAME", "x": 9840, - "y": 91637, + "y": 93117, "width": 1440, "height": 1031, "fills": [{"type": "SOLID", "color": "#121114"}], @@ -176,7 +176,7 @@ "x": 0, "y": 0, "width": 220, - "height": 356, + "height": 492, "component": "Gameplane/Admin Settings Nav", "componentId": "1:3419", "layout": { @@ -188,8 +188,12 @@ "sizing": ["HUG", "FIXED"] }, "texts": [ - "General", + "ACCOUNT", "Theme", + "MCP tokens", + "SFTP", + "SERVER", + "General", "Authentication", "Module sources", "Mod registries", diff --git a/assets/design-export/json/zM0VF.json b/assets/design-export/json/zM0VF.json index 2c4fc3439..f361bbd71 100644 --- a/assets/design-export/json/zM0VF.json +++ b/assets/design-export/json/zM0VF.json @@ -4,7 +4,7 @@ "name": "Screen/Admin Settings — About", "type": "FRAME", "x": 0, - "y": 94369, + "y": 95849, "width": 1440, "height": 900, "fills": [{"type": "SOLID", "color": "#121114"}], @@ -176,7 +176,7 @@ "x": 0, "y": 0, "width": 220, - "height": 356, + "height": 492, "component": "Gameplane/Admin Settings Nav", "componentId": "1:3419", "layout": { @@ -188,8 +188,12 @@ "sizing": ["HUG", "FIXED"] }, "texts": [ - "General", + "ACCOUNT", "Theme", + "MCP tokens", + "SFTP", + "SERVER", + "General", "Authentication", "Module sources", "Mod registries", diff --git a/assets/design-export/json/zqzr4.json b/assets/design-export/json/zqzr4.json index d4314f8c2..bd94d4ecb 100644 --- a/assets/design-export/json/zqzr4.json +++ b/assets/design-export/json/zqzr4.json @@ -4,7 +4,7 @@ "name": "Screen/Admin Settings — Authentication (Admin mapping warning)", "type": "FRAME", "x": 4920, - "y": 82663, + "y": 84143, "width": 1440, "height": 2488, "fills": [{"type": "SOLID", "color": "#121114"}], @@ -175,7 +175,7 @@ "x": 0, "y": 0, "width": 220, - "height": 356, + "height": 492, "component": "Gameplane/Admin Settings Nav", "componentId": "1:3419", "layout": { @@ -187,8 +187,12 @@ "sizing": ["HUG", "FIXED"] }, "texts": [ - "General", + "ACCOUNT", "Theme", + "MCP tokens", + "SFTP", + "SERVER", + "General", "Authentication", "Module sources", "Mod registries", diff --git a/assets/design-export/parts.json b/assets/design-export/parts.json index c635c3b28..6ad129c14 100644 --- a/assets/design-export/parts.json +++ b/assets/design-export/parts.json @@ -5,7 +5,7 @@ "name": "Gameplane/Provenance Badge/Not configured", "width": 115, "height": 17, - "hash": "90ba3c20f56470574c986c2e7f311c7d6ede1f1b836a519abd4d299e16a7cea2" + "hash": "7895ae3a00ae13f7d5f1abf5a68fca3ddd83ebd3a7fa83b6d6052f8ca8336f9d" }, { "file": "CqaSq", @@ -13,7 +13,7 @@ "name": "Gameplane/Role Editor Modal", "width": 480, "height": 513, - "hash": "167f98c1ac00aec40e55916070c11a0b17e07d837723f0e11dafcc106188c031" + "hash": "9c499f1105c0f0e2c68d27a52a8c9788e7cb79e1a1042109f12b5d6a8ff61728" }, { "file": "DMnEi", @@ -21,7 +21,7 @@ "name": "Gameplane/Dialog/Add Module Source", "width": 480, "height": 885, - "hash": "ca3037ce0d185a6c6a970f2a0887ab7ca97735de00b533adc3f58da3a73f2979" + "hash": "a9cd2f7d3010a22a44b1680fa3426aaa500527f8e909c603339f28fc556276c3" }, { "file": "E9EEv0", @@ -29,7 +29,7 @@ "name": "Gameplane/Dialog/Restore Backup", "width": 480, "height": 389, - "hash": "9eda1e5f990da49cb6ca33369dc36ba7bf3021756356d3a498af33a2a007df02" + "hash": "9141fbbfb090dc4da9f69d7353a804e9e76b25b183497af818b07274da1f30c3" }, { "file": "Kp48V", @@ -45,7 +45,7 @@ "name": "Gameplane/Dialog/Reset Password", "width": 480, "height": 215, - "hash": "f01c5ea45f0085a5fe132d0a34fbc87927bdec63d882fcd19006a2af4fa25804" + "hash": "905b6da0671edabfdf1de11c497b2aef296038a562223ca22116f25110938aa6" }, { "file": "NLDDv", @@ -53,7 +53,7 @@ "name": "Gameplane/Dialog/Invite User", "width": 480, "height": 516, - "hash": "24eb3554200b847199caaeaa3152e4f407666248e0c91092bbfc9afd898361a8" + "hash": "182d792d0a9449f744102b14b48786c7982feeef321159702d4e31a8575d2577" }, { "file": "R65Xyx", @@ -61,7 +61,7 @@ "name": "Gameplane/Provenance Badge/Overridden", "width": 169, "height": 17, - "hash": "f9191c3fb79a87c89f8e7fa016b7369143866f8374b403cf3f78d37b8bb775d3" + "hash": "2cf49c89f11fbc2ba1997c3165aa78ca5a330f78dab2245c7d74ad67a8f00f45" }, { "file": "Rwnu3", @@ -69,7 +69,7 @@ "name": "Gameplane/Provenance Badge/From Helm", "width": 127, "height": 17, - "hash": "da8e9cc4a602054d79c5e087c8ade02ffd0e028f44f5f26512f4b316b63f64f2" + "hash": "ad3955c879ce7d8d4e0a0a3da869d0bc0d0acc4898804a58538d489d5ef4b568" }, { "file": "S7SCDc", @@ -85,7 +85,7 @@ "name": "Gameplane/Dialog/Share Link Created", "width": 480, "height": 380, - "hash": "2bb7c4817914fb650f1388db5f3cb2919ee645bbbc803a9d7b87c573c44ed7b3" + "hash": "698702d7d49a516899b3f2be3a0284be9228b46f0053bc3b9ca68248e1ccef1f" }, { "file": "XL5ZU", @@ -93,7 +93,7 @@ "name": "Gameplane/Removable Group Chip/Orange", "width": 83, "height": 23, - "hash": "d0f732437f659f8af9331cdbe52097ab9c6a28ce4dd05fa1439e2a1699e4ebd1" + "hash": "6266a1b771c73445ba945d372731f86c9c17e06ec75a81e05c3dc7c7feec510c" }, { "file": "atqRh", @@ -101,7 +101,7 @@ "name": "Gameplane/Dialog/Create Share Link", "width": 480, "height": 302, - "hash": "ca9ab9c4adfb2fd581bc40d669e423826a04f256794fa8932d5eb5509c75aeaf" + "hash": "4830449746514dd4ef5bba43d419899624347170aa69bf1e897b9153d15270d0" }, { "file": "bHJy6", @@ -117,7 +117,7 @@ "name": "Integrity Banner (Broken)", "width": 1132, "height": 64, - "hash": "72db58c0d54bc99bc37d71d0f7679c2f9d530a71231b910443bd2432a37d9ce7" + "hash": "1affe6e27d63550b4a6696e64ac2f0b72282a84f675b82daf13754e6523cc805" }, { "file": "t3IY3u", @@ -125,7 +125,7 @@ "name": "Gameplane/Dialog/Edit User", "width": 480, "height": 558, - "hash": "f64d8fd07763d2d8c30aa177d3186cbd9a11e7ae16815cb1acd975b638843b23" + "hash": "08a315f112208a15adc51825e194d11a6a28ae2fd09e503c2cf545725f6f6900" }, { "file": "uw0dB", @@ -133,7 +133,7 @@ "name": "Gameplane/Removable Group Chip/Secondary", "width": 77, "height": 23, - "hash": "6959522d0bb443cfccf5136c576b22a41843aae77582351a74f0891143b500aa" + "hash": "03657b8fa9601ca66ba9fc9505b519de32497ae22fa6f31b8a79fb51fe5d2086" }, { "file": "vStkb", @@ -141,7 +141,7 @@ "name": "Gameplane/Removable Group Chip/Violet", "width": 77, "height": 23, - "hash": "930971de322ebfebe0e447e440cb018e009ce60cb508eda6a58bced989716be7" + "hash": "ece8e5e1208ba180b8a5235ffaa7ecd85a87dbbb14d571709601e3f188c1b391" }, { "file": "zhLZN", @@ -149,7 +149,7 @@ "name": "Gameplane/Backup Detail Drawer", "width": 440, "height": 760, - "hash": "39411551a5833b8a60b919ef6e52ab7b38f61db4648681e9777c032957e335d2" + "hash": "592fa569bba6dd74b2fa14ac5f66c2fdabaf73a44c825cdb9e0957b4c9139745" }, { "file": "security-advanced", @@ -165,7 +165,7 @@ "name": "Gameplane/Security Advanced/Mobile", "width": 327, "height": 891, - "hash": "bc7cd0e6f699c6c3d18e4b309aba852fb5cfd665230d7d0e80da544906d694ec" + "hash": "4a47b4583be072a97abe97f8f91b531ef50f56904b1636c808356bf28e85067e" }, { "file": "dialog-risky-security-value", @@ -181,7 +181,7 @@ "name": "Gameplane/Dialog/Security File Access Warning", "width": 480, "height": 286, - "hash": "a1046cf96a3fe71a0e224c5410d064ca838be92ae992ebd9df77f97af6250fac" + "hash": "e2ca9f0c7a3b06e9f6335c0d345793c6331a6a796eb1504fdf2e0bd93981f5b4" }, { "file": "cluster-security-panel", @@ -189,7 +189,7 @@ "name": "Gameplane/Cluster Security Panel", "width": 1132, "height": 209, - "hash": "d0bc64736eaf66503edcf7b984ec01720afa598ed07d1227e82b13b0da5f95ae" + "hash": "66d9b3109cc0d5a113e1741fb2f0fcd7917f15fe1a6ecfd351b12f677fa3450d" }, { "file": "UserMenu", @@ -197,6 +197,6 @@ "name": "Gameplane/Top Bar — User Menu", "width": 232, "height": 181, - "hash": "30533515c59a99fcc4c9ec2861ad5bbfa4ea0a0c7b87f7afef0a81b0abe64725" + "hash": "b450e035399bce9fd02698bcb06db061275e84a22aab272d7065339b865e9e99" } ] diff --git a/assets/design-export/screens.json b/assets/design-export/screens.json index af7073ef6..77d8029eb 100644 --- a/assets/design-export/screens.json +++ b/assets/design-export/screens.json @@ -5,7 +5,7 @@ "name": "Screen/Login", "width": 1440, "height": 900, - "hash": "77ecaaf96c8338e014eba8b7101895e0cec32084071eb4a41ca7741017ceaa9e" + "hash": "793fdac7728f5e20ae676c7cd8da384d7b5d3a328515da7d4ac6143c1cbe11e2" }, { "file": "jmoi3", @@ -13,7 +13,7 @@ "name": "Screen/Login — Invalid credentials", "width": 1440, "height": 900, - "hash": "f3c03f83a4c0c2d3c8baec003ecc856dcd49b6d767c8137b0430350e5007e5d4" + "hash": "428443f11a732121c8f43bd141ae861ed1ad0ac0d20a5580aebfca886470adef" }, { "file": "ljdA5", @@ -21,7 +21,7 @@ "name": "Screen/Login — SSO only", "width": 1440, "height": 900, - "hash": "dc5870426ed3c765a5065ac329b1346dab7206ce495ee298c27c595caa65158f" + "hash": "1641fa6cc2b3f64ece7d00746f2495b9ee4f094c0b077980a946c42f7898d8a7" }, { "file": "N13Xud", @@ -37,7 +37,7 @@ "name": "Screen/Dashboard Home", "width": 1440, "height": 1150, - "hash": "bf1fb96b40f8089abd3a3e091037f73469e07b2632aca17f454a2414cc226dc2" + "hash": "4750ea2b0681c0c3cfe9269aee1d9a38eba3ef131bf2a51d1d47e1db8d1ede77" }, { "file": "EZFW0", @@ -45,7 +45,7 @@ "name": "Screen/Server Detail — Overview", "width": 1440, "height": 1300, - "hash": "e4d3710d56062c9c3a39c7269f5829bfdf600a9f7394fbc70c0d5560090c512b" + "hash": "0a186970d8cd305612befeb19597c83b51136b4d1159ccf0966d9d8750a811d4" }, { "file": "P08Uw", @@ -53,7 +53,7 @@ "name": "Screen/Server Detail — Events", "width": 1440, "height": 900, - "hash": "71697ab54a29fd6c92e35fc3ee14d548b5df3d1b7fb381a567a503df1b495980" + "hash": "df77c7355ac3c9c50748e7bd8c17bf919895f4173d260c471250f33f5e0d29bc" }, { "file": "Xn5ns", @@ -61,7 +61,7 @@ "name": "Screen/Server Detail — Console", "width": 1440, "height": 900, - "hash": "881b058e4f27ed4ce89e69ed366f4d04c7552a1443408c48d858c7ebe9aa4b5b" + "hash": "0f64e756d76f94f0cac8e7572e266455ca67fa4a69847416e13d50bcdc7a3383" }, { "file": "kPmoo", @@ -69,7 +69,7 @@ "name": "Screen/Server Detail — Logs", "width": 1440, "height": 900, - "hash": "d874b477b122c7648250e8f9f503a74ff9db3eca9d22640e01d7d6b03f64436d" + "hash": "bc856d31375bb29c2013c294676d27a0b6fa46fc0b52663e1a1f2f809ec136b6" }, { "file": "FtdkI", @@ -77,7 +77,7 @@ "name": "Screen/Server Detail — Logs (Failed)", "width": 1440, "height": 900, - "hash": "f2afa9b9c6f4d6b792567fd0e56bf337146c590c7aa49c9ce01e912d80ca4a94" + "hash": "f29bc746dd72916a60083e1257416f5919a6f0232a5e84195b5ff65ed64fe94f" }, { "file": "Burtr", @@ -85,7 +85,7 @@ "name": "Screen/Server Detail — Files", "width": 1440, "height": 900, - "hash": "3c14a54120a6c9d7b08abdcaeecb02dab5c8cb38bb209eda28958b53d53c3d83" + "hash": "36f8d0f08984a14e0f946bf0c3e28c4152cd9e4e28d8b820142e33ebc6fc6b36" }, { "file": "sZtDi", @@ -93,7 +93,7 @@ "name": "Screen/Server Detail — Mods", "width": 1440, "height": 900, - "hash": "df092a86b2a91fe8cb54ebc532124e3103eb71d699e78320df6bbea8a68d7591" + "hash": "07cb81e121251cf19b6b88c84c405bb118a0a63d5b6b9abd7a31de1170d48003" }, { "file": "GayoL", @@ -101,7 +101,7 @@ "name": "Screen/Server Detail — Mods — Browse (added)", "width": 1440, "height": 900, - "hash": "525a0022a098b836f79b24a84b7b8a800eb31e5288505a2d39191fb78523c6be" + "hash": "3a9184119898be4ddaa752953e67f2a176b233bd7748fb168325bb49a5f5da46" }, { "file": "Ss0Yr", @@ -109,7 +109,7 @@ "name": "Screen/Server Detail — Mods — Install mod (from URL)", "width": 1440, "height": 900, - "hash": "316389ed126b73f1edbfde2d4ffb9748b9ab9dcd00fc07622ab7f8bc07f9bfaf" + "hash": "6f141ab56b2f94f105f7a7bf1cfcfaca65edb7a4b798492aa87a2f7c611d8f9b" }, { "file": "V1VhGE", @@ -117,7 +117,7 @@ "name": "Screen/Server Detail — Mods — Install mod (upload)", "width": 1440, "height": 900, - "hash": "46665061927eeaf8d889057530de40292d643dadb475dc6d59d3798e4f0b0c1f" + "hash": "929abd4b0a3d0a0ee42d8cecd87c636e5ec3698990a80a5493348555e4797b83" }, { "file": "tY6RD", @@ -125,7 +125,7 @@ "name": "Screen/Server Detail — Modpacks", "width": 1440, "height": 900, - "hash": "5131f857ab745772221063155aef748b1606b331bc70d2d09800d03d182a63d9" + "hash": "885f6b276b83c0174e5cd9a6f9a3db3f48fa5cc95f3055c147d5c60076622a45" }, { "file": "dPP50", @@ -133,7 +133,7 @@ "name": "Screen/Server Detail — Players", "width": 1440, "height": 900, - "hash": "5e4809f626a93d7e4fb20fbd8cbb9d1991fd5bf3793a0657fff7451432382a2e" + "hash": "b6dbc5b99e28eaf9acd66b95d59a5dc4fbeb367b8ac4f57d7e9add5607e67759" }, { "file": "pssCT", @@ -141,7 +141,7 @@ "name": "Screen/Server Detail — Backups", "width": 1440, "height": 900, - "hash": "23e4050ece5b192ca5abd0937eefe4e800dd08cafd0a46d40f86a63dfda22d9b" + "hash": "06d918939a657267673c4ff141381d9de6fc1a52043a98b225c648036d78b16c" }, { "file": "hLB9Z", @@ -149,7 +149,7 @@ "name": "Screen/Server Detail — Settings", "width": 1440, "height": 900, - "hash": "1b03fdd1d2cd1ae2ddf4847d7ace9e46e284a5462462726c6527b94193cbcb31" + "hash": "37ece8e119e8c8706e2b888c629d4acdddc1539b04602b590cabaf90a53181b8" }, { "file": "swxkJ", @@ -157,7 +157,7 @@ "name": "Screen/Server Detail — Settings · Version", "width": 1440, "height": 900, - "hash": "3054b950494349c36184cd5760db50d472191c93699e535a54defe45312bc270" + "hash": "74b5b4ffd92af09a7abeabec37648cb8415972bfb28d21f19a7930b9cdf390b8" }, { "file": "E0ypH", @@ -165,7 +165,7 @@ "name": "Screen/Server Detail — Settings · Resources", "width": 1440, "height": 900, - "hash": "cefc250449a186bbc3a59a539afe351e680e4f7573395b675081801755113ae7" + "hash": "cfaceedf6bed154e469adb63a6cad45e4387de6cecc283a67431ec18bad4fa1b" }, { "file": "J5pjJ3", @@ -173,7 +173,7 @@ "name": "Server Detail · Settings · Networking · Complete", "width": 1440, "height": 900, - "hash": "e81e027aebd078a45f26f9a5e9b3ff58957939132783616d7287b20de4f9af1c" + "hash": "7414b785e3496b699192872b6bde58f778618aed5e07c8c5f2884f99dfd28f3d" }, { "file": "ugDSa", @@ -181,7 +181,7 @@ "name": "Screen/Server Detail — Settings · Environment", "width": 1440, "height": 900, - "hash": "4012473a2e8c8b01ca37b6c927396fb7e8721087658fad1d9fe8f872a28d6b4e" + "hash": "78806b4c9440359fda761a63c9825124b6a8b437b6c1ab62e75aad2035837e5b" }, { "file": "i1bLR", @@ -189,7 +189,7 @@ "name": "Screen/Server Detail — Settings · Lifecycle", "width": 1440, "height": 1620, - "hash": "29ffb3d931a4eb3daa50de546f1f33b08fde617ee54f1961a9e67f9a3f9debe1" + "hash": "4c142f69a8ab04d98283576d1efa5edaa4b5c2d25482e3f5902176dc0d2cec81" }, { "file": "KaRFX", @@ -197,7 +197,7 @@ "name": "Screen/Server Detail — Settings · Scheduled backups", "width": 1440, "height": 900, - "hash": "dcbe6f7df20b50a6b3caed4b7ec16f493b4929dd37c23c3a59d15cf216c22504" + "hash": "777e3b5f9ed5ac12011c52385b460ee32b0510f8f5855840bd65e4f6592c9641" }, { "file": "Y5cmvI", @@ -205,7 +205,7 @@ "name": "Screen/Server Detail — Settings · Placement", "width": 1440, "height": 900, - "hash": "019a460b6beb016a9bf3181ffe33aa5f07132e58de3c292afc9d857bf2107972" + "hash": "87867f5be2aeb6a40c38abc8d34f02c171cec66df9c0dcc0e8bdd598a8ff9c75" }, { "file": "iSA6R", @@ -213,7 +213,7 @@ "name": "Screen/Mobile — Server Detail — Settings · Placement", "width": 375, "height": 900, - "hash": "5f73554994d7d0f5c8ad9572f427de02e575e3b4cddccdadbd3ed2c3de26c50f" + "hash": "c8c50984aab41433309eaf3db9932dce776b1aec7f9427838de006a4a7c72443" }, { "file": "VfB0Y", @@ -221,7 +221,7 @@ "name": "Screen/Server Detail — Settings · RBAC & access", "width": 1440, "height": 900, - "hash": "6128ba198019be58178162ef24eee76a66fe91a892c127c25201c1013ddfbe13" + "hash": "563bbde283a4b70bc461ba8407cb0331bd70949d5907b0223949177282b887e7" }, { "file": "i8wib", @@ -229,7 +229,7 @@ "name": "Screen/Server Detail — Settings · Danger zone", "width": 1440, "height": 900, - "hash": "faa98e8a8912046a53026935d62f472b07396f32474de24b28f98a6bb1711c1f" + "hash": "a63b59c3acee372a1a9e90dc81d79721d5d38d5b3b9aee47b177fed7dc777765" }, { "file": "W8idqY", @@ -237,7 +237,7 @@ "name": "Screen/Create Server — Step 1 Template", "width": 1440, "height": 980, - "hash": "29b4a8ac0a1dfa57ee46085605d734edd6c601d3871995c68469c336d1b27d97" + "hash": "a4d0efbc191d266b2f553d9ef5f26dec3f13b9d1a87ba3708d2e6f69f63979e2" }, { "file": "nNL3E", @@ -245,7 +245,7 @@ "name": "Screen/Create Server — Step 2 Version", "width": 1440, "height": 1000, - "hash": "33545be3c88ff3950a69fdee573235fa283a85446102834bafa254227d966c84" + "hash": "10d11fce6bf049aa42ea43a7f8fc99e5cd15b20e3a6ff4d2102f033e83f02112" }, { "file": "vUqMl", @@ -253,7 +253,7 @@ "name": "Screen/Create Server — Step 3 Configure", "width": 1440, "height": 2120, - "hash": "a847aaad659f4af95673b6df2e8e1801079476b1f3017fb35240bf13b12d3c57" + "hash": "924c893f58b851ea239d3256129b7905ff04a2785b358d478650c1433e68d59a" }, { "file": "f1Vga", @@ -261,7 +261,7 @@ "name": "Screen/Create Server — Step 4 Network", "width": 1440, "height": 1270, - "hash": "ea291e97fafa8b6664b5a43ad9f730e6442b3d5ca69b979f7e395b901ade63bc" + "hash": "25c86a15dec43cb637a5eb79ff72749d12d0c1dc23a1f8603a0d3dffd0785d89" }, { "file": "UMJli", @@ -269,7 +269,7 @@ "name": "Screen/Create Server — Step 5 Review", "width": 1440, "height": 1000, - "hash": "f24de233d58947f70817287623693d74031cc769078c0318e83d7d3ab2a98271" + "hash": "47ee1488116d30e66ca5a68132b1e8a11b98027b313f9ceed1e6837d083fc9eb" }, { "file": "kK8Ji", @@ -277,7 +277,7 @@ "name": "Screen/Modules Catalog", "width": 1440, "height": 1320, - "hash": "0c4b1ccec03bc47e6de3d654536a9ee7937fea5cb86ee298b1a8b862671840af" + "hash": "83253bd5ded413d1ece74c0a2ee7be6b989bd171217139f5162142b3697348da" }, { "file": "DPrYX", @@ -285,7 +285,7 @@ "name": "Screen/Backups — Index", "width": 1440, "height": 900, - "hash": "458e882c3789d085af42f6d696bde9190ff6df175e7c42f7c46742378203b2b6" + "hash": "36d1bb9fea7cafbc06d8deaf8b7aa6d7c494cfedabe8198bb9ba0a1041191b1a" }, { "file": "9dBXM", @@ -293,7 +293,7 @@ "name": "Screen/Backups — Index (Empty)", "width": 1440, "height": 900, - "hash": "6d3f38a17b599e5cb8e79a66338d04e89fe06bf1b4e6a65b6ff15b0b11dafd07" + "hash": "9f2767a50d145cec3f500b7d681e67e22c80ec7f64697de00fb21d89485c105d" }, { "file": "fK8Bi", @@ -301,7 +301,7 @@ "name": "Screen/Backups — Schedules", "width": 1440, "height": 1150, - "hash": "fc577fc2beebefa0ce7dda3cae3de587c1e6a0c9e8143773ec3761951ccdd86f" + "hash": "e6256605784325e491472bee76302b256c329aa7dcb0b6cfb696d74c99b4e05f" }, { "file": "vtExV", @@ -309,7 +309,7 @@ "name": "Screen/Backups — Schedules (Empty)", "width": 1440, "height": 1150, - "hash": "243390a674f32729ebbb7e0fe897141aefb50a5468773397f6495c00ecbc66dd" + "hash": "4aace3eef130529f3fc2be650874ca9b2ccb2145e5bae9da0149e68ebbdc83f1" }, { "file": "tTSdi", @@ -317,7 +317,7 @@ "name": "Screen/Backups — Restores", "width": 1440, "height": 900, - "hash": "385daa91d044635f1487b32012a0629fcb58c24bab997a242975dc3a347fd88e" + "hash": "5f950f0bb68d8ff2574654068a579f393c2357f5e4ae2f5610c906ebfc474abc" }, { "file": "nfMMj", @@ -325,7 +325,7 @@ "name": "Screen/Backups — Restores (Empty)", "width": 1440, "height": 900, - "hash": "5dc395a885dac374414cd92f2881baf3b21be052c02347a2839ea191b88d806c" + "hash": "db18e5707addee53835cba08be92ee8062ebc8c6beb7d3e8b3830a20a78ef3d5" }, { "file": "j9W8A", @@ -333,7 +333,7 @@ "name": "Legacy/Cluster Settings — Superseded", "width": 1440, "height": 900, - "hash": "ad0265a467838e14ae69909e160a8ebbfe024f88681cb8d4ed2bdcf1562a5923" + "hash": "1c864e6f36861a94d19a4cda1df6b548a54184f5a9db906b59c1523ecd742d1e" }, { "file": "bYDHC", @@ -341,7 +341,7 @@ "name": "Screen/Users & RBAC", "width": 1440, "height": 900, - "hash": "9b79d2c93d87020d125a3f07e507ea559f5b02ca90db3db3af5f88058f2d55be" + "hash": "1ee925c0669b88a405e1081511bd6c60ee45f3f6d95d1370e19fc4ad81c338dc" }, { "file": "e9lV4", @@ -349,7 +349,7 @@ "name": "Screen/Users & RBAC — Roles", "width": 1440, "height": 900, - "hash": "92412f393020a97ea5e089e94182c28a9e1297da96100a14fcbb88a2b325a034" + "hash": "89e1d6c3d386584b9008102b95e748fb991c0b3dca23820c86e946cc696d0118" }, { "file": "TBvTC", @@ -357,7 +357,7 @@ "name": "Screen/Users & RBAC — Service accounts", "width": 1440, "height": 900, - "hash": "9ef9674e8c77639e789a05f210d03487fcf31803d373140e52e98907f7aa3964" + "hash": "36799f61abe143bab706aa56c067ffef6232cad9e707d66796816d01a221f068" }, { "file": "Dpb9f", @@ -365,7 +365,7 @@ "name": "Screen/Users & RBAC — Identity providers", "width": 1440, "height": 900, - "hash": "86e9a4fa778cdb93ad1495d92c1d6639be022bac6b1d429529717cb80703efa7" + "hash": "3c85b541bef4b1b3b8d4224d970cf1fffd9d4e92895cff77176ee9fd894938a2" }, { "file": "DxKOh", @@ -373,7 +373,7 @@ "name": "Screen/Audit Log", "width": 1440, "height": 900, - "hash": "532bc709b5129912d05b5251d86718fd88334224f8e4e38269a276d653a2d9ad" + "hash": "1e2915983787dec406576f70a15359918aae242eb77cd96bc75e186f2dca4ed0" }, { "file": "Bq2Yg", @@ -381,7 +381,7 @@ "name": "Screen/Admin — System Logs", "width": 1440, "height": 900, - "hash": "c805320801690bab8e8bbf16c923fffe2b6a6e79a1de9029fbdf2abd3030d4f5" + "hash": "563e55e17487122b519ecdd7263d61fbc229db014c758b776f80ba33df04c22e" }, { "file": "WZdnw", @@ -389,7 +389,7 @@ "name": "Screen/Admin Settings", "width": 1440, "height": 900, - "hash": "b765d621ff1173462b561a823befe4db0272c34c27c04c5bc73cffc34ebf7e30" + "hash": "4d96da5f9ce171df3d542920c76ea51f5acfb0fbe0e6c926b789a2812a2a0e43" }, { "file": "uMiwd", @@ -397,7 +397,7 @@ "name": "Screen/Admin Settings — Authentication", "width": 1440, "height": 1636, - "hash": "da8a62f7d3754acf340de75b2fa92fce8adcd43b6afb62185dcb9fc8ab0d7dbb" + "hash": "6d97b0a5afa9e3efc01b3a5e9a388a0a119e0d58b4e2eb2fe82379f2a046f076" }, { "file": "RC3Kf", @@ -405,7 +405,7 @@ "name": "Legacy/Admin Settings — Backup destinations — Moved", "width": 1440, "height": 900, - "hash": "21083e2230d924a7b2ed00f7910fa72462791f0a22b9722211f6d6df13bf6a92" + "hash": "54c8f50e2f5db5338a424a62c80b9e7798e21cff23beba3c524b3b15f400840e" }, { "file": "g5mEpx", @@ -413,7 +413,7 @@ "name": "Screen/Admin Settings — Module sources", "width": 1440, "height": 900, - "hash": "00b5a4aa7370300fe688bb863895d05073ce1dcb1d4dc079c863f2261ce3cd11" + "hash": "921366061d5f8512d49a5a5757e0d972e84fa78cb9261ab820400c591bd8679a" }, { "file": "n6Xlo", @@ -421,7 +421,7 @@ "name": "Screen/Admin Settings — Notifications", "width": 1440, "height": 900, - "hash": "a7bbb09cac5efdecfe7d52c16366418ae6f27ba97efeaf535e927f7f954659bb" + "hash": "1dcd74a3416f57c0de14562e4caf93d8c87042034655f1d69f9d8a5ffc572517" }, { "file": "uoxQW", @@ -429,7 +429,7 @@ "name": "Screen/Admin Settings — Telemetry", "width": 1440, "height": 900, - "hash": "77fec3de8463495dbfc5d99e9b01c9b8125ed48781e1e7fa50123280e6252657" + "hash": "aa77a8015498470ad3bc57ee27bc14c61eb48137a94e5f96d0cb4ded40b6e4c9" }, { "file": "M2sA4u", @@ -437,7 +437,7 @@ "name": "Screen/Admin Settings — Updates", "width": 1440, "height": 900, - "hash": "b3c7814d5ee073ae0d77956f3390339567932cfdad1d584edc34b21a3b2c21ef" + "hash": "660d42de42dfaa7f0ef5fbddf75dea88350420beedb4b0add3766eec9f4ff536" }, { "file": "zM0VF", @@ -445,7 +445,7 @@ "name": "Screen/Admin Settings — About", "width": 1440, "height": 900, - "hash": "2f022dddca4b7363a5ea7e0efa4a2e1771fb27269a82a96ffb1b28a665b9326e" + "hash": "ff0ded5df75df53ddb27a1131378f313140ccdd3709a186ec70166aa4087b556" }, { "file": "tooKB", @@ -453,7 +453,7 @@ "name": "Screen/Mobile — Servers", "width": 390, "height": 954, - "hash": "6467246897df9e558bf0343af8cb5607cfb111b1afc1af08b0fd040acad6b9f9" + "hash": "e91ab5ab5400d4cc14ecbbed613170d53c48afe6ba23441d724752bbc89aa753" }, { "file": "SeizD", @@ -461,7 +461,7 @@ "name": "Screen/Mobile — Nav Drawer", "width": 390, "height": 844, - "hash": "e7f5cedf1fb93dc9607e738f9188e45d0dcec55cf8802c9f261c34335d3f6d90" + "hash": "1c5ffe359bb5c8276f3c4451cbc958eadb4af10fc8988dbe165fa5e66c1724f3" }, { "file": "Wj0V4", @@ -469,7 +469,7 @@ "name": "Screen/Admin Settings — Mod registries", "width": 1440, "height": 900, - "hash": "a281f937b4174f32288df5c13c2bdb219b001ae5dfe424d058fa381e5204f953" + "hash": "e0b15e9dfcfccdf339bbbfcf626d3a30df3e5042d3d4dff2d34e9484ee2e1572" }, { "file": "i4L0M", @@ -477,7 +477,7 @@ "name": "Screen/Admin Settings — Mod registries (Key saved)", "width": 1440, "height": 900, - "hash": "8e314eaf5c2014c46ef6c08265ecee7994b10fd01c165db5502b08a4bb89d75d" + "hash": "e98effaf8373bf6b4534ffa0e350f071d7f13462775033631d9fa752df24c50a" }, { "file": "KhYNc", @@ -485,7 +485,7 @@ "name": "Screen/Server Detail — Mods (by ID)", "width": 1440, "height": 900, - "hash": "99b88242b4c35eb5f00955e29838d4c64af1c27349cd3846cd22c4afa9006360" + "hash": "7f2c0c0dbf44a5723c80cf2fbf5fc8cb481198cf264a3d9b8d564fe39f6226d5" }, { "file": "IzuY2", @@ -493,7 +493,7 @@ "name": "Screen/Server Detail — Overview (Never sleeps)", "width": 1440, "height": 1725, - "hash": "ca40aa0b2944bb423d18dba6263258215c0f922c67f6f590b7a8c19c34f4c13a" + "hash": "f1a008ec9ba474689bda49a2d27498d5a507e08d2cb993c5d68edab20d1ea852" }, { "file": "TE2jI", @@ -501,7 +501,7 @@ "name": "Screen/Server Detail — Overview (Asleep)", "width": 1440, "height": 1102, - "hash": "2891cf1d9c94c33069c0890ed12e4ca28357fab14cf044d69c462b2d617e5cae" + "hash": "93ae7530fb3a5316533b0c60b32f257f6a3554a294fd484383630cc234892e34" }, { "file": "x7MJI", @@ -517,7 +517,7 @@ "name": "Screen/Server Detail — Settings · Share links", "width": 1440, "height": 900, - "hash": "43a631499834f8337e801710f4b7cc680a61be4e37ebbc87aeb078bec4c35701" + "hash": "f7978615628770431a9306ee06047cc6e24e55c241716d6c674db519459080ed" }, { "file": "dQV9N", @@ -525,7 +525,7 @@ "name": "Screen/Server Detail — Settings · Share links (Empty)", "width": 1440, "height": 900, - "hash": "5a3f18271b0e03b17bcf1c1a2368dd3a4daeb0149ea165adae4645d6ef5bcfba" + "hash": "c99d038e7fec7fb09171e05eb839f8d09ed47d4b2e36bf5fb1eb68706354e710" }, { "file": "C2LQE4", @@ -533,7 +533,7 @@ "name": "Screen/Share Link — Up", "width": 1440, "height": 900, - "hash": "ec10e46a36b0737d1654b8bbd4692534c608c1b8df89c1b1fce2f56f547ea43c" + "hash": "1689fb9a45631def13401dbf23ecb892639b9a1f6dae9922a6c4f981b407b3ec" }, { "file": "q31B6w", @@ -541,7 +541,7 @@ "name": "Screen/Share Link — Asleep (can start)", "width": 1440, "height": 900, - "hash": "b022993691902f3a734be042f3802a8fdea3960beddfd328cde128f8d14daf68" + "hash": "43d5eb7b81059dfbaed5ffcf5c63c291b30937f2638819e03961b09cd7ac606d" }, { "file": "qFLfB", @@ -549,7 +549,7 @@ "name": "Historical/Share Link — Asleep (view only)", "width": 1440, "height": 900, - "hash": "df91eeb255d7d07adfb0dc131bf5f573dcefe354836b92929164c94a4fc058bf" + "hash": "9cf292296aa0ecd7595f2df6c496e9fb2731b4665bc4abb8cdad8ddeb7a775ee" }, { "file": "EcoGD", @@ -557,7 +557,7 @@ "name": "Screen/Share Link — Starting", "width": 1440, "height": 900, - "hash": "9d3c914c103af983dc17bacb241493bb0a44e5b71c42646ffa4fe785e41f3c4d" + "hash": "5627a79ea7ce938b1162ccfb036df4bfb0ccd747fd4061b6819113b3409242bf" }, { "file": "epZO2", @@ -565,7 +565,7 @@ "name": "Screen/Share Link — Invalid or expired", "width": 1440, "height": 900, - "hash": "6dfb7b641d792ceb19fcf6878ef9ea881de24f03f265fe80bcf7b20a8765299a" + "hash": "c0a8d2bda445e532526bf2284f3de4b5b059769ba401511316931a66d59fb9df" }, { "file": "LYPXU", @@ -573,7 +573,7 @@ "name": "Screen/Share Link — Stopped by owner", "width": 1440, "height": 900, - "hash": "015feb2cb477db1973765812edf35e81db06836546caf31a5751048909e0f08a" + "hash": "d9e4e5ac4037450265bd595c1dda18e10f08e245bf8a6f9318403e6133077538" }, { "file": "B57dG", @@ -581,7 +581,7 @@ "name": "Screen/Share Link — Start timed out", "width": 1440, "height": 900, - "hash": "6d4633d12130ac40d3d91102106479a9720a8847e862fc78337534672e47b49e" + "hash": "43b47af76da7dccf61d9fabce74c88b7bc4aa4f1ea4e4e262b228f514a43e4e0" }, { "file": "Bbnga", @@ -589,7 +589,7 @@ "name": "Screen/Server Detail — Capture (Not enabled)", "width": 1440, "height": 900, - "hash": "860a8081c256045d2ffd875dc80fcb98771e6ce687335162220925ea2386f669" + "hash": "3621c228e11b4e38fdcb7203ca959771f5f611c0a0654534a8b649eedbaf7e78" }, { "file": "dBILX", @@ -597,7 +597,7 @@ "name": "Screen/Server Detail — Capture (Empty)", "width": 1440, "height": 900, - "hash": "9d6e3ea700f011da0347afe5796be939be7c28f541976af1f70a82f5fcf9373d" + "hash": "68033e14f533e74d9b6a456ad817c34980d7e19195bc7475457ce1f3b34302c5" }, { "file": "xvlB6", @@ -605,7 +605,7 @@ "name": "Screen/Server Detail — Capture (Running)", "width": 1440, "height": 900, - "hash": "d210860736c8b7b7adae32e16727cb82851304d0aac33bffb65d74375e4448d5" + "hash": "029a00607dcb4cd04692c8f24b061178abc027b5668983497174de1479bb6478" }, { "file": "m5kOm4", @@ -613,7 +613,7 @@ "name": "Screen/Server Detail — Capture (List)", "width": 1440, "height": 900, - "hash": "d2c222c7f9ebe6f14ac829e1cadf0bb67b5c5fe0897f69ef0eaaf6f18236d794" + "hash": "8484c23aa3067debfce33e494e0c445baff5b31ef792627c1a5b26366e9961d8" }, { "file": "O08uaD", @@ -621,7 +621,7 @@ "name": "Screen/Server Detail — Capture — Start capture", "width": 1440, "height": 900, - "hash": "f185dc3e6a25fc5ca70ab001248d31715e720c274dfbb529363a9a8d43a8e14d" + "hash": "5b4e91ac4f69c320edc9e02914925e27b4ab5bab8e189eeeb79943ab9a031eee" }, { "file": "b4eaUf", @@ -629,7 +629,7 @@ "name": "Screen/Server Detail — Capture — Start capture (Invalid filter)", "width": 1440, "height": 900, - "hash": "863cb08a7c51a3ff8482bca848e5e30f653544b55cdab45ea3c91fd6e5679a78" + "hash": "fd9665538b71bbd9589e1b29fe2438bada21de2649778a127cdc14b553e87094" }, { "file": "RodrS", @@ -637,7 +637,7 @@ "name": "Screen/Server Detail — Settings · Network capture", "width": 1440, "height": 900, - "hash": "87d117449c1bb2e4e68c0ce5eb7302c9513f261a2909cd391567bd4d18a3352b" + "hash": "b53393801b9a62ddfad7b867bce796201ff2916584d80518a6e5ae5248b97aec" }, { "file": "nNGDX", @@ -645,7 +645,7 @@ "name": "Screen/Admin Settings — Authentication (No OIDC mappings)", "width": 1440, "height": 1463, - "hash": "98274e8c4ce07557b50fc100eda9d8afb6174dcadf691143d249585867a3d7eb" + "hash": "a6cec8d0a0256df5fb2782a19b2c460f236d23ac872ea79924baf3e9daa541f8" }, { "file": "dxdEi", @@ -653,7 +653,7 @@ "name": "Legacy/Cluster Settings — Default storage — Superseded", "width": 1440, "height": 900, - "hash": "0343a9e4f52246c8310713ab7a5eef2620aa774a56f785d3adf208d5a4ed89f3" + "hash": "acd100b13b53145b79df08ccde0a401b562376a30071d655255da93b241c86eb" }, { "file": "QgW58", @@ -661,7 +661,7 @@ "name": "Screen/Admin Settings — Authentication (Save rejected)", "width": 1440, "height": 1660, - "hash": "6009cc7a7c5df4121c202385028e66203820ed28f27a82c70c57e60585744900" + "hash": "183edffbe8d5c781fe5d69c2c8990293b8813d6dc00b47f73769c64902a47faa" }, { "file": "zqzr4", @@ -669,7 +669,7 @@ "name": "Screen/Admin Settings — Authentication (Admin mapping warning)", "width": 1440, "height": 2488, - "hash": "554e9e422cfab688ff71c150e9c18a6d15e039512e9b482e35e7ffbc0e612a0b" + "hash": "6b5e65b2bd6036efdbb1d6e22d1193de0fc01ef8ea353a65b61a8050f4025376" }, { "file": "o4LH8W", @@ -677,7 +677,7 @@ "name": "Screen/Server Detail — Overview (PVC Provisioning Failed)", "width": 1440, "height": 1320, - "hash": "58572e0cecfc779d30f07dd4566bc632babcfdfb4d478e44421f592fde029047" + "hash": "b7dbeadbb22342881edc09b9fce8b37f93057bce0582f6a6c8b5a43f52f0c864" }, { "file": "zFiOW", @@ -685,7 +685,7 @@ "name": "Screen/Servers (Light)", "width": 1440, "height": 1010, - "hash": "fed55c40b45b4be6cf8f29eaf2d1370eaaf39b357afe0136647b0dff0349adc5" + "hash": "19a36dd68c7649a8ffcd6f5e7d2448334adf7be696ab6001588a9e29d98ff226" }, { "file": "F9pUrx", @@ -693,7 +693,7 @@ "name": "Screen/Servers", "width": 1440, "height": 900, - "hash": "00da5a6d3d2cf316c1c4b6ff17d75c52aebb4c7e736952aecd120ed24d9664ea" + "hash": "a8293546192c80c96d2e918c3975f4a909933a9f978f8cd5b11463d332d315e2" }, { "file": "Hy9r0", @@ -701,7 +701,7 @@ "name": "Screen/Server Detail — Overview (Idle armed)", "width": 1440, "height": 1622, - "hash": "c0c7232215f22a0bee256992231af936110ac0a1bf81ed9c6054463235902c9c" + "hash": "c3e83fc0b7c3caac83c17bf56db38d2204d52e284ede69459d23a81464d37f83" }, { "file": "sSISK", @@ -709,7 +709,7 @@ "name": "Screen/Server Detail — Overview (Light)", "width": 1440, "height": 1300, - "hash": "16d8cb72104fb6110a96f3c2576bd5382322d0fd89f0689373d04ccf7eebc71d" + "hash": "589a3a2725fc5892362d89295eee445d1a447db6353af9227e860a2bd81374e6" }, { "file": "gX7um", @@ -717,7 +717,7 @@ "name": "Screen/Login (Light)", "width": 1440, "height": 900, - "hash": "dc8fdff3f1c5313cc08c48940cf33f72629e68a3162efff0c3deeb3b2b88f25e" + "hash": "9a358fa6cc1fdb32c74e2b830b3992bf71257f15dc66a93b47571610627362d3" }, { "file": "oyoTs", @@ -725,7 +725,7 @@ "name": "Screen/Dashboard Home (Light)", "width": 1440, "height": 1150, - "hash": "e7a7c4f8a0679daac164627cbde3ebdd9de38c5a583ceceba8226e628c7b2759" + "hash": "f3dec57987b155026df0228dcd6dbcdbf63086c56bfa4aff69c33959ebc91861" }, { "file": "DWztv", @@ -733,7 +733,7 @@ "name": "Screen/Mobile — Servers (Light)", "width": 390, "height": 844, - "hash": "3a0df42a6405bc29774bc856641479f277a30669ab02aafbde2fefa7e28bf8ba" + "hash": "244e307fe39b1235b618c5b7a5bae00b6929d8543807f2428c382e7574022ed2" }, { "file": "IdbiB", @@ -741,7 +741,7 @@ "name": "Screen/Dialog/Build Module — Step 1 (Preset & Metadata)", "width": 800, "height": 977, - "hash": "0bb057c7ee75f5afe3f6d4d67c9dfd6f19ad75d618e2da36e273f465227bbf28" + "hash": "6b548cbd050368768648162d88e58f9b97ea21085691f64615f60407ffc62dcf" }, { "file": "O5kaV", @@ -749,7 +749,7 @@ "name": "Screen/Dialog/Build Module — Step 2 (Container & Ports)", "width": 800, "height": 546, - "hash": "47a938711d0698ea89f0d456191e9c70cfa4bd2d48345824b985345b70b474f8" + "hash": "086c9febb0ea7033486e6586bbfa9166f5c5c06dad5bdcd5ffa503980e0aa9f3" }, { "file": "hmPL7", @@ -757,7 +757,7 @@ "name": "Screen/Dialog/Build Module — Step 3 (Review & Export)", "width": 840, "height": 593, - "hash": "da96a1caed49732423b6c3829b041455b5f90372ffe386eed4fe27250dd5fc17" + "hash": "db0f1738e8530c63c2a352e70e0c09351507b0d13f74a64eb4e9ee9e57375dd5" }, { "file": "uCA23", @@ -765,7 +765,7 @@ "name": "Screen/Server Detail — Settings · General", "width": 1440, "height": 900, - "hash": "89d56e4369307e0c2d1c23d883ce8b0e396ab3dc6f84f290f546513e2572af2c" + "hash": "72c3ee537da8fb627a44faff01aa68f04e43a4af59f6e9a763b67eb2a42e49bb" }, { "file": "VctzT", @@ -773,7 +773,7 @@ "name": "Screen/Server Detail — Settings · Version", "width": 1440, "height": 900, - "hash": "3ed41e23ff79ad46be7e893a16cd2529b7fab6aa6fe37b90b69319ec4c226ac4" + "hash": "f0b5a576b2f1913c68dcce42767994d55a847c27029268678026434a9cc3b4f4" }, { "file": "iLm38", @@ -781,7 +781,7 @@ "name": "Screen/Server Detail — Settings · Environment", "width": 1440, "height": 900, - "hash": "81c80ded0c9fdd69ead2730eb6c2c35319f1e706780a717722a7b4328c3aed6e" + "hash": "18e4931818dad8fdac0c7a84dd6f40e611b2c5e48dffc73754f24fb81a4891ef" }, { "file": "QpEvu", @@ -789,7 +789,7 @@ "name": "Screen/Server Detail — Settings · Access", "width": 1440, "height": 900, - "hash": "d01dee4a67fd824aec45394ff8bc3c031bb2729c57a131930d8c20aace40f456" + "hash": "dfca0c100cb332c6d4cf6cb192402b6bf640d207c7bc99046ee031f4f2fca755" }, { "file": "XR0f9", @@ -797,7 +797,7 @@ "name": "Screen/Server Detail — Settings · Danger zone", "width": 1440, "height": 900, - "hash": "50edf255de2e046e8c7b01db29010d1dca6d1dc5042e37b1a6eb9774e2ea3424" + "hash": "22ae35f94d514cf23f0c0fe2308cb1e5ca820cb3db3187c3711841f0bf69db1d" }, { "file": "QQtUD", @@ -805,7 +805,7 @@ "name": "Screen/Create Server — Step 4 Network (as built)", "width": 1440, "height": 1270, - "hash": "b540213000cf715fb147a991104cd48391606206195d11be1c42fe73b37e5bd0" + "hash": "976f599d05ea99bad2cdd1a3ec349cd6aa394ae0301d1ff067c9b065eb5ed0a1" }, { "file": "IyMFM", @@ -813,7 +813,7 @@ "name": "J5pjJ3 states/Tunnel enabled", "width": 500, "height": 476, - "hash": "03ecd26f8ce1d3f60ecf1440f59c9d52f79c925fda3d9a56153fc88f0199a99c" + "hash": "220a3bac825bef0921e42d5d553f4cb23becd9deefb12629e06bd3f4a1d0fb49" }, { "file": "jXykV", @@ -821,7 +821,7 @@ "name": "J5pjJ3 states/Alerts", "width": 700, "height": 246, - "hash": "68bd769f2705155fb2d7dd422bf7fff1e5d4b51fee3386799c034054e2d1d5ec" + "hash": "4b5ad7cb81f01b9128400d6035af5b3377b89cffef84ea744b181220d2197550" }, { "file": "tr6cE", @@ -829,7 +829,7 @@ "name": "Screen/Share links — Create link (No expiry)", "width": 480, "height": 322, - "hash": "c2ee77518dcec3b09408572b7348462e4cfc1f911216223438d7435eb585cb4b" + "hash": "1a37e73f5a1f16c11b4179e3aedd94d9a34e9cb6faac61b3ca3d1152f4b792f6" }, { "file": "oPF1n", @@ -837,7 +837,7 @@ "name": "Screen/Share links — Create link (Custom date)", "width": 480, "height": 382, - "hash": "518b160fca0c4daa12de3c423d696f018751d26b431c21f8c52fffb79a889094" + "hash": "555f5620808bd0cc4eb29fab7e3eb6c0c3f6d3930e6cc9ededbc6694f0e106f1" }, { "file": "X405l", @@ -845,7 +845,7 @@ "name": "Screen/Server Detail — Console (not running – Stopped/Suspended)", "width": 1440, "height": 900, - "hash": "2ed6457dfa9e7a5ab41cb86eb457f672ce14ffd4593d53222c979541a5662178" + "hash": "959b72586090fd4d78e57fb9f2c996256c5a9cbb23fe7cd02f0761f18581811b" }, { "file": "j88bl0", @@ -853,7 +853,7 @@ "name": "Screen/Server Detail — Console (not running – Pod failure)", "width": 1440, "height": 900, - "hash": "24ee6a17838c302f11954d252bb3395f501bf3cf29a7e80cffd391d0bc9d78d2" + "hash": "ed71cb09a7d5b0ae36e1c09561c4c25fa0166b22058cf582b0ed832826c10033" }, { "file": "lWvcv", @@ -861,7 +861,7 @@ "name": "Screen/Theme Settings", "width": 1440, "height": 2344, - "hash": "9d85c80b1e188ec56a7e84c676f5dd4de76ab09be0736183128346c05c2f809f" + "hash": "5a8c3da1de337292b20a970d8cdfbe6dac1ef5090710252c09ba95def64c5b0e" }, { "file": "T1wkiT", @@ -869,7 +869,7 @@ "name": "Screen/Theme Settings — Warnings", "width": 1440, "height": 2490, - "hash": "b40862f3412d34c253065df1e16c9a8866a5b71b9784ce2fe7687cbc75816bcc" + "hash": "4cc418809058bd0dab82bd4f8cd914374885aa08ca7be010f0bff921a3dc4187" }, { "file": "lhKzN", @@ -877,7 +877,7 @@ "name": "Create Server — Step 4 Network · Tunnel disabled", "width": 1440, "height": 1170, - "hash": "9696d4409eca5bd4ae5c50ef8d626b137091bc244222cf01813bc39e873a1e21" + "hash": "ece953adb78f4179ed944580eda1270f9060b17f5cc183806d942a5fe582130f" }, { "file": "a7o9C", @@ -885,7 +885,7 @@ "name": "Create Server — Step 4 Network · Tunnel enabled, no provider", "width": 1440, "height": 1170, - "hash": "1ed2b65b064dae9b5d4c4a37d7b85ffd2ac4407e087a240b41a67ec4d753cdce" + "hash": "62556996ae7cbe55f59af6c6c008201a6b16cb2e90e2baf5159a09a185b6b8a4" }, { "file": "ZU1BG", @@ -893,7 +893,7 @@ "name": "Create Server — Step 4 Network · Tunnel enabled, provider selected", "width": 1440, "height": 1170, - "hash": "b804fd31f674f4074bdc511228734f3f0b3435ad77ebab66449c62046dcf62b7" + "hash": "f5fa2dec63c06c25446018be93493265fd501a4445f989d35224d57db8412091" }, { "file": "eGbsg", @@ -901,7 +901,7 @@ "name": "Create Server — Step 4 Network · Tunnel enabled, complete", "width": 1440, "height": 1170, - "hash": "ff68df5f3f23e2f2e480ad886c2476ebcdeeff2f29dac61d8e1f452a59fa75f0" + "hash": "40e4374e481893eddec526479d52241eb9f7275fedae96fe61ee2aeb975b3062" }, { "file": "nGJE1", @@ -909,7 +909,7 @@ "name": "Server Detail · Settings · Networking · Tunnel disabled", "width": 1440, "height": 900, - "hash": "39d644e150a090920c451f25994b652c112d58bcc9bf1d5025e069066fc40d80" + "hash": "6fe5a5e3e19142c37b8427dab1bc98519a38fd0e182fa943343d7c52f44daae3" }, { "file": "dhPtX", @@ -917,7 +917,7 @@ "name": "Server Detail · Settings · Networking · Tunnel initial enable", "width": 1440, "height": 900, - "hash": "4b67875de9e95e451615262f37374008099a072ee01a7df772fc56276f02e8fd" + "hash": "38fc5f28c5debcbf87b8686f3c3640bb6ac5ac5e20c83c8863cfeb6e8e6eac63" }, { "file": "tSOeI", @@ -925,7 +925,7 @@ "name": "Server Detail · Settings · Networking · Provider selected", "width": 1440, "height": 900, - "hash": "a45e93569780006da0f64b0b9503b7cdee1617f2d05f084baeeb7efe2436daa1" + "hash": "bd96f6d4e2f01c0cd420ec0d51229708dd2ffe337ff0b3a2c3e4b567825e225c" }, { "file": "y3YcQ", @@ -933,7 +933,7 @@ "name": "Server Detail · Settings · Networking · Credentials entering", "width": 1440, "height": 900, - "hash": "8bfa2fdfbc7fd17d0d730798198791aa906a55a405e8456aadec52fbbe641e01" + "hash": "c4ed41fc4d6f1ead208449e3e84b962bdcdcb9cd64beb9ed106afe7a6455b560" }, { "file": "EKJyM", @@ -941,7 +941,7 @@ "name": "Server Detail · Settings · Networking · Provider + credentials complete", "width": 1440, "height": 900, - "hash": "83e93abc351bae844acc604f33099cb1f960762be8b6600e20a099354cfd3329" + "hash": "134ae23868a102807b680f9c2ee2e06706ca6264d1f7f67cce83afd4bd164b02" }, { "file": "akr4I", @@ -949,7 +949,7 @@ "name": "Screen/Server Detail — Capture (No access)", "width": 1440, "height": 900, - "hash": "f0e522c092fe01b1c19fe018b416ab3e44e6ccb595964d23023349efd5fbd01d" + "hash": "0039c401ffef2cbcba33ca41af12f9aa7051c90725c21f75fce8d9daa5c3a01f" }, { "file": "hlwx3", @@ -957,7 +957,7 @@ "name": "State/Server Actions Menu — Owner-only disabled", "width": 520, "height": 220, - "hash": "6ae847aa81d527b3219afe543a0e4a9c66f661890959404e8b581e7b1743712e" + "hash": "21c5d6c463fba02388ff16d1c4618925b72e758e4796ca436b43b6f7c5abe8b4" }, { "file": "IMSD5", @@ -965,7 +965,7 @@ "name": "Screen/Server Detail — Settings · Danger zone (Owner-only)", "width": 1440, "height": 900, - "hash": "344a618e6e61001f57f575fad7037394f219782275872e22497d5eaa7844e075" + "hash": "c0410a216d4355f86d97880b4ad5ef4c90fa05755c9382db68aea6319894c8d4" }, { "file": "gWqMD", @@ -973,7 +973,7 @@ "name": "Screen/Server Detail — Settings · Access (Read-only)", "width": 1440, "height": 900, - "hash": "f37bebc3f8427f1ef11f482a661656cbeb6663e34141de21b6fb9d50223a9352" + "hash": "9e580b6ff6d68384194348b46197e536445b79e13f7a7573cf9df035f9e491a5" }, { "file": "UCNBm", @@ -981,7 +981,7 @@ "name": "Screen/Servers — Cluster filters open", "width": 1440, "height": 900, - "hash": "cdaf24768519798c3ad4f91d306d9c1599f807d954564b48c73357ad3e264b40" + "hash": "5c9c894b1ef42e42b9439e7ab63c5351d73aec358ebbfff0b7debadd64e97936" }, { "file": "pnAbF", @@ -989,7 +989,7 @@ "name": "Screen/Backups — Filters open", "width": 1440, "height": 900, - "hash": "932b7ad024f836c0d3dd978d90f655d6b872976aeec62c14b592ceece821a75e" + "hash": "1ca0689fc97e80fd345441fe20ec58de3d159fae6afe0447328c3f919e96c367" }, { "file": "Cb3eC", @@ -997,7 +997,7 @@ "name": "Screen/Backups — Schedules filters open", "width": 1440, "height": 1150, - "hash": "18b52c4ac65eb49f2c811228d334eb5a13cea95bfac7009d29e81a32baa9eb3f" + "hash": "52b14357b4424f477941fff8bf59c4fa16d14689e2ebf46e869f06fc3b1f655b" }, { "file": "fbBqA", @@ -1005,7 +1005,7 @@ "name": "Screen/Backups — Restores filters open", "width": 1440, "height": 900, - "hash": "2f7a78346403fbbec634cdb1874fb2932f58a487fede596daada74e24b4a9b0a" + "hash": "d24bd5ddf02f224a78463ec6f01674c4dc6174aba028162b571a4846e238106f" }, { "file": "YPKbV", @@ -1013,7 +1013,7 @@ "name": "Screen/Dashboard — Partial cluster coverage", "width": 1440, "height": 1220, - "hash": "2698a3a73dbe50a7a5459775c70b39de39e556971e5fefb02e189bd9881c4984" + "hash": "b142cc7de459dc6ef00b9d8b597ae328e5c5af7bef709eb1a225b8c54cbe421f" }, { "file": "w1QYmf", @@ -1029,7 +1029,7 @@ "name": "Screen/Mobile — Remote server Capture", "width": 375, "height": 900, - "hash": "c8bfad92be14ddb9db3b81a56fb9ad44771a4db470bb4e5992857f1f81275d48" + "hash": "ae01700c6922125d83de452633ce4e38024a03fe684c563cc22a3b7bd5bc698e" }, { "file": "C5Aoe", @@ -1037,7 +1037,7 @@ "name": "Screen/Mobile — Servers filters open", "width": 375, "height": 954, - "hash": "f1559130a0842fe883ebae363a15a7caa16a1271c3cf6c0749e75b7d637cf82d" + "hash": "26398b0188e1855ee2b5074982c9358ead9ae6e60a2c911fdf3dc3694a246d8d" }, { "file": "NKiqf", @@ -1045,7 +1045,7 @@ "name": "Screen/Mobile — Backups filters open", "width": 375, "height": 844, - "hash": "e4a9d68f5c996156ad86223c1f6006a17cec0f1dd3f5f4f51f146110209e1237" + "hash": "070e9f749ed73504685f87d58db20eda66845000acd1a9e1478bc855915117f4" }, { "file": "iYUWc", @@ -1053,7 +1053,7 @@ "name": "Screen/Clusters — Registered clusters", "width": 1440, "height": 900, - "hash": "f9d6ac1cb4b960bb8bfa3f7db5d9b5f5a307beda85788d213781c4e93869e581" + "hash": "048eadbfbeade78db4913b61a2f204c5be9a1844f259ce61940a1c6c5b2cbbae" }, { "file": "oMuyw", @@ -1061,7 +1061,7 @@ "name": "Gameplane/Dialog/New File (Invalid name)", "width": 440, "height": 310, - "hash": "d01789829e07435bb8d7bd9ad186098946ad46063eb4e222345536ae6a8d3b29" + "hash": "13cc3f448bef177b7689d59180828e1b0b09600a69d9ee7710ca369b5ee6f2a9" }, { "file": "OC804", @@ -1069,7 +1069,7 @@ "name": "Screen/Server Detail — Settings · Game configuration", "width": 1440, "height": 900, - "hash": "c82458076fe6e773819dcac5a61621aab21f8de4bb4995e2ce2d9aec4d61137b" + "hash": "0a97a5f37179f967718be40c6faa4d259b7e05a6319f26f116ebd6d70b644bed" }, { "file": "QFEg9", @@ -1077,7 +1077,7 @@ "name": "Screen/Server Detail — Settings · Game configuration (Invalid value)", "width": 1440, "height": 900, - "hash": "52a3f8bf603c3001d0852a3e07c3fb59bb3dc5f7970d831ace5c963d465f7db7" + "hash": "f21b9f78d7ef9ab27d242437a6400e0f548f3139784719fc6355fd409c37c9c7" }, { "file": "wxINm", @@ -1085,7 +1085,7 @@ "name": "Screen/Server Detail — Settings · Game configuration (Read-only)", "width": 1440, "height": 900, - "hash": "8ded99fd5eed17d069f89263e261b589a309eaec832c5a9118bed7bdb5ec2c55" + "hash": "272ef03d7b87dc8ee5084714b1c5ea01e95bdd48c0c68e468e8642d82dcbd126" }, { "file": "e9FnC", @@ -1093,7 +1093,7 @@ "name": "Screen/Server Detail — Settings · Game configuration (Orphaned key)", "width": 1440, "height": 960, - "hash": "07f0371a65092c9ed2ed7940c98b6fe754db221b26b7493b5b7de9732b96bad2" + "hash": "6a7723d2ce2ca60eacef856d8812aa0b831f818914a14d199dd3d48b532b96b2" }, { "file": "Ne5TA", @@ -1101,7 +1101,7 @@ "name": "Screen/Not Found", "width": 1440, "height": 900, - "hash": "aa05a169edd581d965b357efd9e30751aee58cb59486eaf65f98cc1ed72d9691" + "hash": "830358fe3f4e3e521eb4d4c827a8580dadb6b3274cfa889e6aa24e97ce40ad77" }, { "file": "FBiMN", @@ -1109,7 +1109,7 @@ "name": "Screen/Share Link — Asleep (Start cooldown)", "width": 1440, "height": 900, - "hash": "785aecc2d868259cd9272cd85b2e56a4973da2557f45780d32be26b34f598934" + "hash": "8110373d4bb5446ce80ad58481c5265fa6c5baafd67c53ffd9d9343c0634799e" }, { "file": "zj5a3", @@ -1117,7 +1117,7 @@ "name": "Screen/Dashboard Home — Telemetry notice (default)", "width": 1440, "height": 1380, - "hash": "d806d82227b28fd2600a2399d80064e5724ff2fbd44ff1e2e7bb2e5dc6eeedc1" + "hash": "6d220619df6ea01492e9d36f36cb91b7494a5254c668db96a3827e1a9ffeef89" }, { "file": "l7TRz9", @@ -1125,7 +1125,7 @@ "name": "Screen/Admin Settings — Telemetry (default)", "width": 1440, "height": 1031, - "hash": "e835187c4dc88cb417539c9e4a8963bf7bdbdee8aefa506d8ec867ef26a48541" + "hash": "983c24084daf69c924b97136d9cc549376321c2915a32c9bd5f803ea8df1dc68" }, { "file": "GR1G9", @@ -1133,7 +1133,7 @@ "name": "Screen/Dashboard Home — Telemetry notice (bundled)", "width": 1440, "height": 1380, - "hash": "620f9b60a4e43e4c2909d847ab723b806f5ed45a5aae48b97ad9a57c66ffbdcc" + "hash": "0a8493805ab2d8833504bd309f8f13b5403b9587fbd5bb719a10d844cd8a9da4" }, { "file": "r0heh", @@ -1141,7 +1141,7 @@ "name": "Screen/Admin Settings — Telemetry (custom)", "width": 1440, "height": 1032, - "hash": "bd2316abeb711eaf9ce7f55dd8f054348e3d008e0e36dca730a2124fba36a4d4" + "hash": "5742d2be11b84120eac440aa82c86ce4a21e87534e159f54bec7233061ad8111" }, { "file": "cDiNb", @@ -1149,7 +1149,7 @@ "name": "Screen/Admin Settings — Telemetry (bundled)", "width": 1440, "height": 777, - "hash": "af2e5b90e26c6b5f226a86a80e95f3bf412dee919600e16374de3db8bc46b382" + "hash": "5b9b1080947cc8cf6397b87839feece99522a3ff48770aa167be96225a93b2c9" }, { "file": "DBQyF", @@ -1157,7 +1157,7 @@ "name": "Screen/Admin Settings — Telemetry (disabled)", "width": 1440, "height": 641, - "hash": "e042daafd867376a962ceb4645f9d567e45073089536c8e3e51f494c9615157e" + "hash": "0755ab58b28ec0aa9218e068197c655d6739a864adfb048a483d361d7e5b0b30" }, { "file": "K5XinZ", @@ -1165,7 +1165,7 @@ "name": "Screen/Admin Settings — Telemetry (none)", "width": 1440, "height": 605, - "hash": "ea77966cd2c54aa0f43ac72939c128bfedd00a573884ead1ec7be5ef9e7d89ac" + "hash": "e36caf051efd7a1451305dcc96cd746925bffc1347defaf53a167e3179e6e608" }, { "file": "yrxK2", @@ -1173,7 +1173,7 @@ "name": "Screen/Admin Settings — Telemetry (Reset ID confirm)", "width": 1440, "height": 1031, - "hash": "9237e3356d3734c37f37af64b1b18c6b08816e0beceec5f88b8d34103ce1e0a0" + "hash": "341584e4d065cd2d675dedc7d16e6009e01cca74773777749fd2c552ec4b4ba5" }, { "file": "n2qdi", @@ -1181,7 +1181,7 @@ "name": "Screen/Standalone — Clusters (Empty)", "width": 1440, "height": 900, - "hash": "77a1c1be371b77d2ba2de4a362098b22debb1684f4cbfc95d1d77759b70ff4d2" + "hash": "39fb77298caa30878a598ba00d96a2f512875342c6dec0321c2de4fa85a02cc5" }, { "file": "WrmU5", @@ -1189,7 +1189,7 @@ "name": "Screen/Standalone — Clusters (Registered)", "width": 1440, "height": 900, - "hash": "5be09472e646dfaef6987f725cb170c283c5ee6d159659f39f73fc9762e1045a" + "hash": "7756a3fa09c603f75f6d9a4fdf232110be43052a01710fbb20205d49fafdcaba" }, { "file": "Be7ZW", @@ -1197,7 +1197,7 @@ "name": "Legacy/Standalone — Cluster inventory selection — Superseded", "width": 1440, "height": 900, - "hash": "9d610fd0f3db173a0a11d93a11b1a221d93aadb0a7f0b98104a7dfcb863b54c0" + "hash": "6889b195bb0ee9eaffa232244faac11c313b259f2287ee04e0473794e57ec87d" }, { "file": "Z0oyh", @@ -1205,7 +1205,7 @@ "name": "Screen/Standalone — Modules (No selection)", "width": 1440, "height": 900, - "hash": "08ec9ad8f00747cd4d00bb4d6ba89caee9b35ec03c12014eafedc247b664cc92" + "hash": "bce5be7db462dd6751720c49b3c59cbf069a4e67121fa67ea59961397e46bb42" }, { "file": "ZlLf0", @@ -1213,7 +1213,7 @@ "name": "Screen/Standalone — Modules (Permission denied)", "width": 1440, "height": 900, - "hash": "b4d037f678e68a1da3876eec5f1e52217a5d3bbdf0975b831d730b2965a4480d" + "hash": "4423d923352bf6f57d85e89b0f6e3c864f6e615e59d3034196514b3edcf81737" }, { "file": "RpHBg", @@ -1221,7 +1221,7 @@ "name": "Screen/Standalone — Register cluster", "width": 1440, "height": 900, - "hash": "85d4a86132983e3d8acfd24e142ddc62e12bde4e4ffd8c647ef4126e4af9d4d7" + "hash": "498cbe06cff8e7b2f17fd2855f3b17719098d6dd02c474d5f01aa5b4f873e35f" }, { "file": "HVhmb", @@ -1229,7 +1229,7 @@ "name": "Legacy/Clusters list — Remove registration — Moved", "width": 1440, "height": 900, - "hash": "75e41bea36535221f80243a7b7ff3937d55a9a1e04c20d7fe0775bb6db70bbcc" + "hash": "1e2ca79275b91b7fd4fb55d452141ca7eeeab235ae9f29f3cf700ae32c8fbaa6" }, { "file": "RS0KZ", @@ -1237,7 +1237,7 @@ "name": "State/Standalone — Cluster selection and request states", "width": 1440, "height": 732, - "hash": "d2e53e194fe094ec398ac3acf7833f123888f025c64f606438ede3af32e58ff5" + "hash": "8eab9a82676d11be23ff2bcae38982441b24c183801c13c06f9cb916bdf63b06" }, { "file": "D9QYZ", @@ -1245,7 +1245,7 @@ "name": "Legacy/Standalone — Backup destinations — Moved", "width": 1440, "height": 900, - "hash": "5730e594521a249b00c536f14baf9031f6b44719815ebb6570584c3c92db2c5c" + "hash": "b0eaf8c646e53a99d586f84d966c3fe2c1ceb8b1d48ac3fff27bdf56e75c73f1" }, { "file": "l64bd", @@ -1253,7 +1253,7 @@ "name": "Screen/Standalone — Settings · Module sources", "width": 1440, "height": 900, - "hash": "c3397377299a9eb8e891cf38a6f408d1273239559505328f7e5271b4255190f4" + "hash": "5ba23292e5ad092964b6f08826bfda2dae233d2c4141a4ef62772440cf131b8a" }, { "file": "Uzzje", @@ -1261,7 +1261,7 @@ "name": "Screen/Standalone — Settings · Updates", "width": 1440, "height": 900, - "hash": "3c1f181213c96c2a7bb24f6b4d6a20ff3ba3bac84c5c8fdae03cd340bc1d948e" + "hash": "d7a802fcaca1c470abe0e5c8de7783096c0a099741f900acb7a57d8f35108adb" }, { "file": "FOVMf", @@ -1269,7 +1269,7 @@ "name": "Screen/Standalone — Settings · About", "width": 1440, "height": 900, - "hash": "248cb8b49735a09188b1b2abee96f3a436c20b7b96317651707d554f526c2caa" + "hash": "162fe82f600431df1a38975e85f07a000bc380eda98b85f2e1fa501ac6f1606b" }, { "file": "r139UP", @@ -1277,7 +1277,7 @@ "name": "Screen/Standalone — System logs", "width": 1440, "height": 900, - "hash": "4dab3f9c27c1b897bb8e9818ecc72eb3cd28b24b8f494d319a1e1f057660a498" + "hash": "4e7b055c85b3c3fbdc8464f1dceda4464a38731212ab81959b6baf01b6ce0df8" }, { "file": "EWrn0", @@ -1285,7 +1285,7 @@ "name": "Screen/Standalone — Modules (East selected)", "width": 1440, "height": 1900, - "hash": "9b567d8086225e3b68bf32cebc03bb1eb5cad109169ec8de964454dc25a05c18" + "hash": "f28eaa3d5ca7c6876f040ab74851e2fe6417722b595f29164ecb1d79f9c4ea63" }, { "file": "p8QSPq", @@ -1293,7 +1293,7 @@ "name": "Screen/Standalone — Modules (Manage sources)", "width": 1440, "height": 2050, - "hash": "db1b8cf242a1968e00ac2b49747a0829f07721b35b44a4bf022c2e545b6f7fbd" + "hash": "83fef0296a9a555211fc1f807aad2b5fcddc37ca4ec06c98f92979614b1585bc" }, { "file": "aMU7O", @@ -1301,7 +1301,7 @@ "name": "Gameplane/Dialog/Edit user — Standalone (No target)", "width": 480, "height": 643, - "hash": "8f82f8d42a8b99898e1d8ddc84a3e654afef4acbd63ffad6973b097cc74a1402" + "hash": "d5934a366f909769eaee9078bed124ebf6e7a6ee1d7485f466dac2c560d9e5e0" }, { "file": "C9bR6", @@ -1309,7 +1309,7 @@ "name": "Gameplane/Dialog/Edit user — Standalone (Remote grant)", "width": 480, "height": 643, - "hash": "85a7db8a2ffaa8ea1a0e125d73290562dc87d727887cf2ec1e1ad9329a68afb6" + "hash": "fdd9e5a75e9e14dbe24e56ece8007640a3d78a4f9056a07af821a6163ed00fd1" }, { "file": "w34N9", @@ -1317,7 +1317,7 @@ "name": "Screen/Standalone — Dashboard (No workload clusters)", "width": 1440, "height": 1150, - "hash": "f731b3bf98f67518051bbd98c5c571f9a4a20c1d8f05f5686d1d8502af4123ac" + "hash": "23ea62c540b4f2f6b2f167d7365ef3d3134163c07432ab21903e354c1995507d" }, { "file": "U9xSg", @@ -1325,7 +1325,7 @@ "name": "Screen/Server Detail — Players (Nuclear Option)", "width": 1440, "height": 900, - "hash": "0feb96d6e6aee5415a987d4c730a7e7d879204723e89dafebd837486e4e26ef0" + "hash": "8f571e77881980a7ce8a95bbbd2f57757c1d13f16760fbfabd331e054dfee095" }, { "file": "BguST", @@ -1333,7 +1333,7 @@ "name": "Screen/Server Detail — Settings · Game configuration (Password will be removed)", "width": 1440, "height": 900, - "hash": "c4eaa7cf09bd3564a004e0cbb0894ec11408fe724eed92547fca632bc7d8ca8c" + "hash": "88fbe4b3c937cb1415ef0c1a4ea870246824402a32097e77c1b74fb3f2ed9839" }, { "file": "YN8cE", @@ -1341,7 +1341,7 @@ "name": "Screen/Server Detail — Settings · Game configuration (New password typed)", "width": 1440, "height": 900, - "hash": "cee44b9bd498c798dbe4ac4e16af60473bd37808d67901f519eb3301484abd66" + "hash": "1767239db4082722fc6b9413d1e453fa145c82d3cde757786b561d4015b1a817" }, { "file": "GsofJ", @@ -1349,7 +1349,7 @@ "name": "Screen/Login — Language menu open", "width": 1440, "height": 900, - "hash": "d7e66f08776b94a3cb64b7a6e40bb7312acd25e40b27e119de972793acfa09d2" + "hash": "935a52f58e5ba98c7f115b4928fb17e2997e145e65d339aa0fa547aeffb9f208" }, { "file": "lCTci", @@ -1357,7 +1357,7 @@ "name": "Screen/Mobile — Theme Settings · Language", "width": 390, "height": 972, - "hash": "dbc02ab13bdb74e7c8638338e920e71aa4dc68cd47305377c919fa6774445b20" + "hash": "242c26ffabe60e2b0bbf0cbd1bd60f4af9a126b75cf7c4d16db809025cf1fb31" }, { "file": "SUcad", @@ -1365,7 +1365,7 @@ "name": "Screen/Admin Settings — Notifications (Add sink)", "width": 1440, "height": 965, - "hash": "98f7d40f649a9ed436614a5114f35b26b7c87b76dc167e0806041890f28e90e3" + "hash": "75ce384b22d094f1db2edbbd5fae0c477a73fb47f901ea1a0253f36e3c0aee44" }, { "file": "NqaaU", @@ -1373,7 +1373,7 @@ "name": "Screen/Server Detail — Settings · Resources (Reserve less on)", "width": 1440, "height": 1000, - "hash": "df6b39d7fbde902f55ae27856e6eaa3e432eb5b2da7d06ee9417763f15f632af" + "hash": "17a33e589ca1e90c03a2ecd59d9321575d37d30b3ad37bffd474aaeef3e2fd03" }, { "file": "NLu2I", @@ -1381,7 +1381,7 @@ "name": "Screen/Create Server — Step 3 Configure (Reserve less on)", "width": 1440, "height": 2214, - "hash": "da4e3e87df6b1c49b0abb1ec9c5145fb65c78744d6dc0ad9aec4ea07aa6ee7d1" + "hash": "6f857fafe948c657ba603f1e966a1ec191fc852e4a25f57329fb6e0b9d3c7539" }, { "file": "A8vGwM", @@ -1389,7 +1389,7 @@ "name": "Screen/Server Detail — Settings · Lifecycle (Wake on connect unavailable)", "width": 1440, "height": 1620, - "hash": "21ea5ed39afc843039e0b07ee83482cea73283b5eb84fbc88e8dbbb1ab7db76c" + "hash": "18db61d01cd9a6a956195a3a8edb03545807ffff661e24789ff4f4c9d60e9f11" }, { "file": "BdmAW", @@ -1397,7 +1397,7 @@ "name": "Screen/Nodes — All clusters", "width": 1440, "height": 900, - "hash": "d4d2101983cd559717492651a20a3556099bb9ff910f7a07ad05e59a7b9bd80c" + "hash": "cdf61524d29b6265a16aafa726949c7849ae9f47e378c705eb2f00ab25d718f0" }, { "file": "wqnM9", @@ -1405,7 +1405,7 @@ "name": "Screen/Cluster Details — Overview", "width": 1440, "height": 900, - "hash": "63d0d9b2a72e4fb0e703744b5af5a0feee8aea57c988817f1f000f7b5c90a3ce" + "hash": "99193c2f3aa39c74471c5cb2c69f688278fd5c0fe0490480c4fb2dccc8a337f3" }, { "file": "J8GzM9", @@ -1413,7 +1413,7 @@ "name": "Screen/Cluster Details — Nodes", "width": 1440, "height": 900, - "hash": "ac6283aeb942b75ca69521d6a44511be83a71e6339ce31b86fcc1b963d7bafa7" + "hash": "cdde3430411d692c9c6542c4122036c17d3259c098c64c03551da8b426722a1c" }, { "file": "OecJ5", @@ -1421,7 +1421,7 @@ "name": "Screen/Cluster Details — Configuration — Local", "width": 1440, "height": 1293, - "hash": "ac8040db33aeba612c5e05ec06cc829916198dc57ea477875077b2266f454f5c" + "hash": "b3373e74495784d549cabd92c8588094a4b2db46d1b8909c3c76e88942dbf449" }, { "file": "t56aLu", @@ -1429,7 +1429,7 @@ "name": "Screen/Cluster Details — Configuration — Remote", "width": 1440, "height": 1293, - "hash": "6c80ba606798fb1521943c9630e5d568555b19d13868da8df20cf0b16ea67e25" + "hash": "5578c61795e636fdb2de6b6afe7d008db4751e433029893eeb91b73eebc1ff1d" }, { "file": "IBUqJ", @@ -1437,7 +1437,7 @@ "name": "Screen/Nodes — Add node target", "width": 1440, "height": 900, - "hash": "3b767e90650a439a817a92a8db4ba4fd26c2469fd0f31a3196ebe8b127f99ec4" + "hash": "6a686da0ac8747ee790dfc21fee1bba049a654ce3d7bae54b820971a39fff32c" }, { "file": "N2nTf", @@ -1445,7 +1445,7 @@ "name": "Screen/Mobile — Nodes — All clusters", "width": 390, "height": 1620, - "hash": "097c798897b91f098c42a7d157703f690fc000bbbffb16c8225cc84af3cb9a31" + "hash": "978bb38d16a0916341884765f8b63bc8be484acdcc4bee94a76a5e8e177b71cc" }, { "file": "T70dJ", @@ -1453,7 +1453,7 @@ "name": "Screen/Cluster Details — Configuration — Default storage", "width": 1440, "height": 1293, - "hash": "51cd26a96588fb3edd332f22cb533d090a75a10f6ee2a1a41f465a99027e1976" + "hash": "0b33d9873585423fc9ff06fdb5ef0313ee57988dd015be43e9f457e08c8217cb" }, { "file": "KJdxg", @@ -1461,7 +1461,7 @@ "name": "Screen/Server Detail — Settings · Minecraft JVM startup", "width": 1440, "height": 980, - "hash": "cce282a651d5d7afe160fe3c3c5dee881f2ebcbb5c5c819f9559923a18b4f08e" + "hash": "6760040e31a813520fa59f29cfa0b0668985f41471f10ee275b6ca7f2fdd024b" }, { "file": "ZUAq1", @@ -1469,7 +1469,7 @@ "name": "Screen/Server Detail — Settings · Minecraft JVM heap validation", "width": 1440, "height": 980, - "hash": "bf09904461ae52c3046b294e20edbbd27789d170e5e5aacfc62a66daaf093e39" + "hash": "ee97de054a1d09ceaae83014aaf6c45680bda62323299e224dcb0d2099d4b1b9" }, { "file": "o1uEP", @@ -1477,7 +1477,7 @@ "name": "Gameplane/Dialog/Create ZIP", "width": 448, "height": 196, - "hash": "7e2fe9db3d1bf8c9c210d1ecb86eb654c2e95258aa776d0ab636fc9273336c2b" + "hash": "e4d864249779e08bc326b22788c4bd19b0190453dd25e1880f87f34b8745985e" }, { "file": "UdnBT", @@ -1485,7 +1485,7 @@ "name": "Screen/Admin Settings — Authentication (Role rules)", "width": 1440, "height": 2600, - "hash": "9bbf22ebe9b1df2b1820cfabf298b6f85cdf92a31d12c558a28fdd6f8756e07f" + "hash": "3c1d48c091baf3d10b3955705b05f1eef52f7f8109dbe8abcc81418bded6c884" }, { "file": "mrF6f", @@ -1493,7 +1493,7 @@ "name": "Screen/Admin Settings — Authentication (Role rules empty, not overridden)", "width": 888, "height": 649, - "hash": "7589ebd89f62b7f6ad8828181ddf15d9e5bd888332dfb8361a01bfd93a57b9c7" + "hash": "153a25f3313f4a8f8735f2cf5d934ce7a1436ec075a96571e6c8116425ef4da4" }, { "file": "rJt1I", @@ -1501,7 +1501,7 @@ "name": "Screen/Users & RBAC — Role source", "width": 1440, "height": 900, - "hash": "13fd85c16c9a566721bc624178b39579562988e75051978e2faaa68b105c36dd" + "hash": "c22894f6d623ac096607306d12a9deece16f25c7b1aae8df827e4d7282663e85" }, { "file": "pszxE", @@ -1509,7 +1509,7 @@ "name": "Users & RBAC — Return to SSO control dialogs", "width": 1040, "height": 721, - "hash": "93b9948a30fb97f91dc4c9d0c07255a763a88e9de4cfaedfec106fd3bdb26695" + "hash": "b819da5bcb30e221f0de45e46c317ea433734994aafb4c8e9ca3ab18967b8d38" }, { "file": "1274632774-130", @@ -1517,7 +1517,7 @@ "name": "Screen/Server Detail — Modpacks (Active pack)", "width": 1440, "height": 900, - "hash": "9da037830fc58c0ada631ca68a5f03bc9f2e6be7490659be466dd09b1f217d02" + "hash": "6dfe1b7dc0db53a012c5a1568ec1dff63a9d0f61e8bc4227d12e53a177a1c672" }, { "file": "1274632774-470", @@ -1525,7 +1525,7 @@ "name": "Screen/Server Detail — Modpacks — Choose version", "width": 1440, "height": 900, - "hash": "75f64bd867cd9acbc5c5980fb0df2838a23c083a716b017889de71acd363b87e" + "hash": "d64c4cca27fbb18d73c484d443a0835f741dec4050a8628f918bbfef4912a167" }, { "file": "1274632774-907", @@ -1533,7 +1533,7 @@ "name": "Screen/Server Detail — Modpacks — Confirm install", "width": 1440, "height": 900, - "hash": "edfdcf766b22d2795236b968f0c256006768d2bd0699795de09baa9fe3d72abd" + "hash": "37d517fc7ad6b735e3ce28fb1f74d46fb874bab4fa9122cac34d608efa10e762" }, { "file": "1274632774-1258", @@ -1541,7 +1541,7 @@ "name": "Screen/Server Detail — Modpacks — Change version", "width": 1440, "height": 900, - "hash": "fd649681eb2573f6560496dfcb12e6d3e6d1a77b787dd219778268188cafbd3c" + "hash": "959ed73f140f09ebee7733822375e59c805114547446014c712624b1ced861ec" }, { "file": "1274632774-1722", @@ -1549,7 +1549,7 @@ "name": "Screen/Server Detail — Modpacks — Confirm downgrade", "width": 1440, "height": 900, - "hash": "70e4f1323976da87a5c25b3a0c1e32a0934510923c261c5935cb64179837c4e4" + "hash": "332852b8c2bfb18f49336ba5ff6b96fa89f9a3eee9609a19691b6bbc421a3025" }, { "file": "1274632774-2112", @@ -1557,7 +1557,7 @@ "name": "Screen/Server Detail — Modpacks — Remove", "width": 1440, "height": 900, - "hash": "21bf68892ce979a6ecd7b25e92c5b2271f08c7abe9d86b5a286837edea3fad2c" + "hash": "defeac40dcacd2af25a4433ae9382a1cfe90c424b96b744c35758edb0bdf488f" }, { "file": "1274632774-2492", @@ -1565,7 +1565,7 @@ "name": "Screen/Server Detail — Modpacks (Missing files)", "width": 1440, "height": 1080, - "hash": "00e8189cdf79908d5962a6c47d86bd62a13df447a5c566448d9b45f30e806db3" + "hash": "6eeb2a41e0d8f5d4380b61a978b6c25f540cf21793bb391bb6e85b6faa45484b" }, { "file": "1274632774-2877", @@ -1573,7 +1573,7 @@ "name": "Screen/Server Detail — Modpacks (Active pack, Light)", "width": 1440, "height": 900, - "hash": "8faafdec17dc03b73e08dab6bf809b2d97e20e163f63b511a0e0b379a8555dd9" + "hash": "6f927c95c0da9784678f9dd3efb031a9ba2578a37f811f728b677ebbcb7192f2" }, { "file": "1274632774-3217", @@ -1581,7 +1581,7 @@ "name": "Screen/Server Detail — Modpacks (Read-only)", "width": 1440, "height": 900, - "hash": "bb6ab213388ca4c23534787c93331674b9988fc7d3cf6449c1d72cfc8b2b89c1" + "hash": "4d445dedf4e747d1f44310818f55a1cadf0bd819325027b7aeacfe5a7551b661" }, { "file": "1274632774-3559", @@ -1589,7 +1589,7 @@ "name": "States/Modpacks — Active card and tab states (reference)", "width": 2280, "height": 1158, - "hash": "870444c793eea6acc6e378d042058355176a816e3936555e7d14f8d36819f73d" + "hash": "719a7adc6dc7ce0beceab7a47101dd4001e0d0784566676230f1f98c544c108e" }, { "file": "1274632774-3890", @@ -1597,7 +1597,7 @@ "name": "Screen/Mobile — Server Detail — Modpacks", "width": 390, "height": 1100, - "hash": "54c37d7b8245cc26a02bb9bd1603bc15a633495120a953209ad0d701c13ba545" + "hash": "9d9b21a0539b3421ba80f5f682ad5c5ae4136470a9dfd43c3b4d88e9a85e6026" }, { "file": "1274632774-4001", @@ -1605,7 +1605,7 @@ "name": "Screen/Admin Settings — Mod registries (Share CurseForge key)", "width": 1440, "height": 900, - "hash": "67b4995fb4d5a71da8d7459e62c5467f76011318bcebd3315462d80871b09e6f" + "hash": "406de5bed2e1ce5368472060d5e5c7df3dd74e16e4d4dcd2318835f8138b2ee1" }, { "file": "1274632774-4260", @@ -1613,7 +1613,7 @@ "name": "Screen/Admin Settings — Mod registries (Key from startup flag)", "width": 1440, "height": 900, - "hash": "60da886e6958ab6e8417d242edcec688042f37fa5dc7f51b63ec3175942d4995" + "hash": "343f3b02d895d17d15a4bf28ee68de69c4f4409c112a30ba5d32b96a90e501fe" }, { "file": "1494270493-26", @@ -1621,7 +1621,7 @@ "name": "States/Backup schedule — Edit with restricted snapshot strategy", "width": 1524, "height": 582, - "hash": "112ea1ab66477f6a8c927a5bc0f82647bbfdcb98efb0937bd23b42c0e564fa65" + "hash": "21878d2d7565ed1d3f54a548397762a402f29d42c24c2ab3561372f908db4891" }, { "file": "46479436-2", @@ -1629,7 +1629,7 @@ "name": "Gameplane/Dialog/Back up now (No destinations)", "width": 480, "height": 279, - "hash": "a4bf75132b68f8f9d73662106d9fd04d4b232cacb58b848083c9a25f6fa1de5f" + "hash": "6ccdc70d91fc189231d31d952770f4e831c9eecf6044863d7e589ccea0820717" }, { "file": "2044649516-13", @@ -1637,7 +1637,7 @@ "name": "Screen/MCP Tokens", "width": 1440, "height": 900, - "hash": "977729dda33c42ada5ae2ad39740192ffb4a3786c6ab14791e4cea05db28c49d" + "hash": "74286833fee78823e0511dd7c304b0e0470ca0478cb2c07546674fca97890347" }, { "file": "2044649516-579", @@ -1645,7 +1645,7 @@ "name": "Screen/MCP Tokens — Empty", "width": 1440, "height": 900, - "hash": "93d85316117bdfe07601e62392ae3c1b4f76e288759f895b6b6f9b254f006cfc" + "hash": "ae827583059502c35251e96a5f4328e566dfa9f53e0d2106664ec03e6b5f7f8c" }, { "file": "2044649516-1099", @@ -1653,7 +1653,7 @@ "name": "Screen/MCP Tokens — Create", "width": 1440, "height": 900, - "hash": "bdf8ecfeb20825c19662e9f5e8449dc1b2454eb435fa2773f3c03d2b82e6e313" + "hash": "c9c87eb87a1ace9a02a5764882a109185d4de8d8b30319418af5bf35fc34de47" }, { "file": "2044649516-1687", @@ -1661,7 +1661,7 @@ "name": "Screen/MCP Tokens — Created", "width": 1440, "height": 900, - "hash": "3e1b1825152a07f1e9a930f15a98cffdb7f9b5f4743080ac09a36e9adf2c9965" + "hash": "471e2b504e953ed0440a14a94646ea207a903c0c4260bbc52c85b77098ddc3f7" }, { "file": "2044649516-2282", @@ -1669,7 +1669,7 @@ "name": "Screen/MCP Tokens — Revoke", "width": 1440, "height": 900, - "hash": "bfbed148ff6ae45a4b2c79daeb7fa74ba45fb006e99a4674e057895d0694ce01" + "hash": "8629f5ee76d6c6a1a2e23593f40d84869681108793cb48bd6824220cb5e7a37d" }, { "file": "2044649516-2862", @@ -1677,7 +1677,7 @@ "name": "Screen/Mobile — MCP Tokens", "width": 390, "height": 844, - "hash": "d39d85036286830609a9322a65a241af9d399f6a0c8bfa5eab7c46003db78b37" + "hash": "59f8a2c8d41eec6a8ecb9132aa47b404ac08aac5de8491081e5f985da7e4b4a6" }, { "file": "2044649516-2982", @@ -1685,7 +1685,7 @@ "name": "Screen/Users & RBAC — MCP tokens", "width": 1440, "height": 900, - "hash": "8729ed0ebf9a2df8a2c455b2be45c1130c9792abd994c6b50557789e916b7b4b" + "hash": "e3056311249be033b01f183d76bced06cff0a335c7c6533107d210c1fe605049" }, { "file": "901437436-1", @@ -1693,7 +1693,7 @@ "name": "Screen/Server Detail — Settings · Security", "width": 1440, "height": 1001, - "hash": "cf78d87af59411e26e9fd4e8fc6f25368ddd8d51410874a9587ede7d925125d0" + "hash": "0414d14c8eaf37c026fb7d69de7d1b6fb62fdbb86211ea993ed2b6af52f4a8b8" }, { "file": "901437436-465", @@ -1701,7 +1701,7 @@ "name": "Screen/Server Detail — Settings · Security (Light)", "width": 1440, "height": 1001, - "hash": "bea86ea26661de2882019cba4e88be65977e8868a9c918161d9de3059b2c738a" + "hash": "3f355281474d7187577f6721e2b43a015578a8e438051b7f8ff94b1c006ba265" }, { "file": "901437436-929", @@ -1709,7 +1709,7 @@ "name": "Screen/Server Detail — Settings · Security (Image default, no effect)", "width": 1440, "height": 925, - "hash": "597971cef574d46465e3b99030ef905b34754a81dcf4d0dde95f48e8a406673c" + "hash": "65125ea559c5a2932dfbbff9973fab3ae03405c1f220855022cbbb209c3624f0" }, { "file": "901437436-1393", @@ -1717,7 +1717,7 @@ "name": "Screen/Server Detail — Settings · Security (Read-only)", "width": 1440, "height": 900, - "hash": "76af85e27648ed1f5800be71e192609cd56f7943b893424851f337859b5ee6d1" + "hash": "f3e4054f1bb557b4c147b048be3331453ffcf7bb43f79d3070cc832922d7cfc6" }, { "file": "901437436-1857", @@ -1725,7 +1725,7 @@ "name": "Screen/Server Detail — Settings · Security (Held back, stopped)", "width": 1440, "height": 1017, - "hash": "a8b93bf7261472a731f1830326b4f8554f09e8f3fe580bb5eea0d703070e0332" + "hash": "839d0bd1869a120c82cfd95ba2fe2e341cd7d678032a212911f7cab526f9a8da" }, { "file": "901437436-2321", @@ -1733,7 +1733,7 @@ "name": "Screen/Server Detail — Settings · Security (Held back, running)", "width": 1440, "height": 1017, - "hash": "1110fb58875a4f5ef9dffe919206da76bc2b74b369b287e1b2c07aa77fbb92d0" + "hash": "3156da935e45c4f88d89c4cb261ab90d6ccc7c3e688fe9b8af89765488b775dc" }, { "file": "901437436-2785", @@ -1741,7 +1741,7 @@ "name": "Screen/Server Detail — Settings · Security (Refused)", "width": 1440, "height": 1041, - "hash": "20481c1fb94189a05a93dfb4e873959144fdf4c17c0bee56f1787788e27a3c83" + "hash": "89bf980003039b63f5284666acb399670c85dcb2b5032b01b6c4e5152054fb5f" }, { "file": "901437436-3249", @@ -1749,7 +1749,7 @@ "name": "Screen/Server Detail — Settings · Security (Forbidden)", "width": 1440, "height": 1001, - "hash": "f16e6e6916929287c52a8459c38fe78a6bd431be2b1c03094e0543c81a8dfe45" + "hash": "ae64f906cdf6db79383ddea8002d679f143123ae741ee30ce66e5d39bedac95f" }, { "file": "901437436-3713", @@ -1757,7 +1757,7 @@ "name": "Screen/Server Detail — Settings · Security (File-access warning)", "width": 1440, "height": 925, - "hash": "98f4f09f2cffe1e9f23a5221d7f1eb43bea5bf5a9ce34d6d125c234c40587b5d" + "hash": "071d74d0e74b0e3ff763e39b38bbae5c8c1a091153a8681c97659304aaed91f4" }, { "file": "1163467012-2214", @@ -1765,7 +1765,7 @@ "name": "Screen/Mobile — Server Detail — Settings · Security", "width": 375, "height": 1352, - "hash": "64461be5537086f9c4cbf157ebdecde593c75b3e0fd326970c8c967e5516c26f" + "hash": "c6b1abe02623e69cabc78b691d1ca6e945d65c2655cbc455d550ae4cb623b037" }, { "file": "1163467012-259", @@ -1773,7 +1773,7 @@ "name": "Screen/Create Server — Step 3 Configure (Advanced security open)", "width": 1440, "height": 2461, - "hash": "f0d7643d62592e98e931003d0a7525c1c5bbc0325b6460e3136907b101bcc5b0" + "hash": "7cd2ec23c29462de92246d1ae3abe85f242e86f72ff0b7d5d14f207d6af3d31d" }, { "file": "1163467012-906", @@ -1781,7 +1781,7 @@ "name": "Screen/Create Server — Step 3 Configure (Advanced security refused)", "width": 1440, "height": 2552, - "hash": "5ac73ac88d5da031b649d946b7cadfb4ac7fc3adda5875001fb1cf6166973c14" + "hash": "18aace6b2516f7c05e49ef5998a30f9fd16e622a73d85a62453bd6c6247ee83f" }, { "file": "1163467012-1553", @@ -1789,7 +1789,7 @@ "name": "Screen/Create Server — Step 3 Configure (Risky value confirmation)", "width": 1440, "height": 2461, - "hash": "fecdbc3537b639b1646916700f6413324a87ccbd11772a35f4609c624eb6c5fd" + "hash": "0f9e93999f9bc2aff720fd7ce385264c1937287c1cf3157a5d240626d85ebc4c" }, { "file": "1163467012-2492", @@ -1797,7 +1797,7 @@ "name": "Screen/Cluster Details — Configuration — Remote (Allow root on)", "width": 1440, "height": 1293, - "hash": "5b1f5b1e4a37a219b3091e359c4ea66d9e76ca518dde34452c6b8b85a5c84518" + "hash": "fba5deaf75efb01f7ae30d9f515984b0730afcccc7703962fa15770196a747dc" }, { "file": "1163467012-2680", @@ -1805,7 +1805,7 @@ "name": "Screen/Cluster Details — Configuration — Remote (Security settings missing)", "width": 1440, "height": 1385, - "hash": "8c0535780c746024d0365bb64ffb9f33dd62c76bd70d183430887fdc8b5cb04f" + "hash": "3a7b8966f6d7a0c974dcc77ad97a4408cbea3969861cec940c02f851017d9112" }, { "file": "1163467012-2868", @@ -1813,7 +1813,7 @@ "name": "Screen/Cluster Details — Configuration — Remote (Light)", "width": 1440, "height": 1293, - "hash": "a590259ba18837bd668f4b50a1ed258ab113f251405f57a37354836d52eb677a" + "hash": "99e706a0b40576078bf12cb6b73c6e39e533375c5f66c1b8568d1be42d06aca2" }, { "file": "1163467012-3056", @@ -1821,7 +1821,7 @@ "name": "Screen/Standalone — Register cluster (Control-plane namespace edited)", "width": 1440, "height": 900, - "hash": "aca8fbc83f2c1f139aecfcb1a320b0735c8198adaf71765b21c6ad9e40615347" + "hash": "6c8fd3a7368ad5bc7db8b9bc28f07b985732af7359094741adebc1a67a1e2940" }, { "file": "1163467012-3228", @@ -1829,6 +1829,166 @@ "name": "Screen/Standalone — Register cluster (Invalid control-plane namespace)", "width": 1440, "height": 900, - "hash": "56a24ac97bb6f656ac2f252dfad133e1639793badf3031c495497c3512b89d4c" + "hash": "523ce5738ed0ea80a0ed7a25073c8eed2ee4d0945337d4fe5b7591fd18ac688f" + }, + { + "file": "1-46380", + "figId": "1:46380", + "name": "Screen/Settings — SFTP", + "width": 1440, + "height": 1080, + "hash": "706ae1c978c816f697b0c514df81c54c9df06879c4cebebd73e1d44578156fa6" + }, + { + "file": "1-46381", + "figId": "1:46381", + "name": "Screen/Settings — SFTP (Light)", + "width": 1440, + "height": 1080, + "hash": "85bd462c3446d782fd2fc66521beb2793a4493fbb70f0fb5d806b25a3fc1217d" + }, + { + "file": "1-46382", + "figId": "1:46382", + "name": "Screen/Settings — SFTP (Not enabled)", + "width": 1440, + "height": 1080, + "hash": "92ccd2459648f77524a80d5b1565b4b3a16cfca7faa22feaf7bb4f0239f24cbe" + }, + { + "file": "1-46383", + "figId": "1:46383", + "name": "Screen/Settings — SFTP (No password)", + "width": 1440, + "height": 1080, + "hash": "43644daec320e3a7a0599ab7dd5b53899ec2fe12bf4dea5f2f24928f3b3dd848" + }, + { + "file": "1-46384", + "figId": "1:46384", + "name": "Gameplane/Dialog/Add SSH key", + "width": 480, + "height": 380, + "hash": "54d0ad7c689604579c7435f80b97359e1274e87d050b86d1df3f1b1ca08bde30" + }, + { + "file": "1-46385", + "figId": "1:46385", + "name": "Gameplane/Dialog/Add SSH key (Invalid key)", + "width": 480, + "height": 470, + "hash": "7a4bc83cd8d7b1f4b33e5f4b0507c72bbd4e5d7c6caabee99832e7c8ed09d7ae" + }, + { + "file": "1-46386", + "figId": "1:46386", + "name": "Gameplane/Dialog/Generate SFTP password", + "width": 480, + "height": 300, + "hash": "61e19df6011fff5d77c37fe88621896c92a8d07e35107c6ff0dfeee670e759df" + }, + { + "file": "1-46387", + "figId": "1:46387", + "name": "Gameplane/Dialog/SFTP password (Shown once)", + "width": 480, + "height": 420, + "hash": "34b349c22b15a18291b6435147fbdb3d161fb43ea02892db69ee22734431fc54" + }, + { + "file": "1006926387-2294", + "figId": "1006926387:2294", + "name": "Gameplane/Dialog/Regenerate SFTP password", + "width": 440, + "height": 163, + "hash": "115afb4abdb6c87c332b7160043322ea24a855ff86fef7ad88da794c1002b2c3" + }, + { + "file": "1006926387-2310", + "figId": "1006926387:2310", + "name": "Gameplane/Dialog/Revoke SFTP password", + "width": 440, + "height": 163, + "hash": "f3faee3d8295d38535aebfe3f0d979bcc0a54492ce50255525f0e766a32c04dd" + }, + { + "file": "1-46388", + "figId": "1:46388", + "name": "Screen/Settings — SFTP (Non-admin)", + "width": 1440, + "height": 1080, + "hash": "7f12e4521f03e33f8fa7a07091b4c163ae728e25f475932a4618dd132d71307a" + }, + { + "file": "1-46390", + "figId": "1:46390", + "name": "Screen/Server Detail — Files (Uploads)", + "width": 1440, + "height": 900, + "hash": "c5f4b6ab23422969137609ae41bc52f2a186bc0b32d5a7b63b96a9c02c197440" + }, + { + "file": "1-46391", + "figId": "1:46391", + "name": "Screen/Server Detail — Files (Uploads, Light)", + "width": 1440, + "height": 900, + "hash": "b23f6ada006f1e58b9fd1905b789133b6d621a738ce5fbf972d3f5a3a41431ea" + }, + { + "file": "1-46392", + "figId": "1:46392", + "name": "Screen/Server Detail — Files (Uploads with errors)", + "width": 1440, + "height": 900, + "hash": "5ff50ce8636f17abeb78e4bf345940b2f1623b2bc307bd4a6b7995bc0fd89e46" + }, + { + "file": "1-46393", + "figId": "1:46393", + "name": "Screen/Server Detail — Files (Starting)", + "width": 1440, + "height": 900, + "hash": "028012a3bb917f789b01bdc9a2c840e115acb31ee801ff5b810e6504f93a0e2b" + }, + { + "file": "1-46394", + "figId": "1:46394", + "name": "Screen/Server Detail — Files (Starting timed out)", + "width": 1440, + "height": 900, + "hash": "65a606c63af998cdd3959f8655bb21b56d6d37a00fab3b459dd23b2e8eb66011" + }, + { + "file": "1-46395", + "figId": "1:46395", + "name": "Screen/Users & RBAC — SFTP access (admin)", + "width": 1440, + "height": 900, + "hash": "9f4dddac114a281b49eac975e1eb4ab52c2b498bcac084b6f9071cb6dc5e5c1a" + }, + { + "file": "1-46396", + "figId": "1:46396", + "name": "Screen/Clusters — SFTP (remote-lab)", + "width": 1440, + "height": 900, + "hash": "f2710ad66a908fcffd370cdb17b3e23075047ee45c4c8ab11af2c0dfa741cd75" + }, + { + "file": "1-46397", + "figId": "1:46397", + "name": "Screen/Clusters — SFTP (remote-lab) — Token created", + "width": 1440, + "height": 900, + "hash": "c4bc7697cdf97f2f23dd6a02ec9e2fda1af04873533ceee9c548984e1ee0599b" + }, + { + "file": "1-46398", + "figId": "1:46398", + "name": "Screen/Clusters — SFTP (remote-lab) — Token limit", + "width": 1440, + "height": 900, + "hash": "9e8f6b34f82a255b5eae43ef9d04bf10891a34132378efc2a04cfcc2e0fabb5d" } ] diff --git a/assets/design-export/screenshots/1-46380.png b/assets/design-export/screenshots/1-46380.png new file mode 100644 index 000000000..637ab719d Binary files /dev/null and b/assets/design-export/screenshots/1-46380.png differ diff --git a/assets/design-export/screenshots/1-46381.png b/assets/design-export/screenshots/1-46381.png new file mode 100644 index 000000000..5b5929041 Binary files /dev/null and b/assets/design-export/screenshots/1-46381.png differ diff --git a/assets/design-export/screenshots/1-46382.png b/assets/design-export/screenshots/1-46382.png new file mode 100644 index 000000000..0857ad883 Binary files /dev/null and b/assets/design-export/screenshots/1-46382.png differ diff --git a/assets/design-export/screenshots/1-46383.png b/assets/design-export/screenshots/1-46383.png new file mode 100644 index 000000000..18cce1d8e Binary files /dev/null and b/assets/design-export/screenshots/1-46383.png differ diff --git a/assets/design-export/screenshots/1-46384.png b/assets/design-export/screenshots/1-46384.png new file mode 100644 index 000000000..54e40b901 Binary files /dev/null and b/assets/design-export/screenshots/1-46384.png differ diff --git a/assets/design-export/screenshots/1-46385.png b/assets/design-export/screenshots/1-46385.png new file mode 100644 index 000000000..8c5c040ef Binary files /dev/null and b/assets/design-export/screenshots/1-46385.png differ diff --git a/assets/design-export/screenshots/1-46386.png b/assets/design-export/screenshots/1-46386.png new file mode 100644 index 000000000..9f1d3801c Binary files /dev/null and b/assets/design-export/screenshots/1-46386.png differ diff --git a/assets/design-export/screenshots/1-46387.png b/assets/design-export/screenshots/1-46387.png new file mode 100644 index 000000000..c5e303d82 Binary files /dev/null and b/assets/design-export/screenshots/1-46387.png differ diff --git a/assets/design-export/screenshots/1-46388.png b/assets/design-export/screenshots/1-46388.png new file mode 100644 index 000000000..428ce0141 Binary files /dev/null and b/assets/design-export/screenshots/1-46388.png differ diff --git a/assets/design-export/screenshots/1-46390.png b/assets/design-export/screenshots/1-46390.png new file mode 100644 index 000000000..875dc73d3 Binary files /dev/null and b/assets/design-export/screenshots/1-46390.png differ diff --git a/assets/design-export/screenshots/1-46391.png b/assets/design-export/screenshots/1-46391.png new file mode 100644 index 000000000..443e0d7e1 Binary files /dev/null and b/assets/design-export/screenshots/1-46391.png differ diff --git a/assets/design-export/screenshots/1-46392.png b/assets/design-export/screenshots/1-46392.png new file mode 100644 index 000000000..989cf386e Binary files /dev/null and b/assets/design-export/screenshots/1-46392.png differ diff --git a/assets/design-export/screenshots/1-46393.png b/assets/design-export/screenshots/1-46393.png new file mode 100644 index 000000000..508140b4a Binary files /dev/null and b/assets/design-export/screenshots/1-46393.png differ diff --git a/assets/design-export/screenshots/1-46394.png b/assets/design-export/screenshots/1-46394.png new file mode 100644 index 000000000..81ae17dbb Binary files /dev/null and b/assets/design-export/screenshots/1-46394.png differ diff --git a/assets/design-export/screenshots/1-46395.png b/assets/design-export/screenshots/1-46395.png new file mode 100644 index 000000000..2a1595be2 Binary files /dev/null and b/assets/design-export/screenshots/1-46395.png differ diff --git a/assets/design-export/screenshots/1-46396.png b/assets/design-export/screenshots/1-46396.png new file mode 100644 index 000000000..1dcd0e506 Binary files /dev/null and b/assets/design-export/screenshots/1-46396.png differ diff --git a/assets/design-export/screenshots/1-46397.png b/assets/design-export/screenshots/1-46397.png new file mode 100644 index 000000000..a9631ca2c Binary files /dev/null and b/assets/design-export/screenshots/1-46397.png differ diff --git a/assets/design-export/screenshots/1-46398.png b/assets/design-export/screenshots/1-46398.png new file mode 100644 index 000000000..cecd2ac74 Binary files /dev/null and b/assets/design-export/screenshots/1-46398.png differ diff --git a/assets/design-export/screenshots/1006926387-2294.png b/assets/design-export/screenshots/1006926387-2294.png new file mode 100644 index 000000000..75a9dacbb Binary files /dev/null and b/assets/design-export/screenshots/1006926387-2294.png differ diff --git a/assets/design-export/screenshots/1006926387-2310.png b/assets/design-export/screenshots/1006926387-2310.png new file mode 100644 index 000000000..1b6ccacd5 Binary files /dev/null and b/assets/design-export/screenshots/1006926387-2310.png differ diff --git a/assets/design-export/screenshots/1274632774-4001.png b/assets/design-export/screenshots/1274632774-4001.png index b448667fb..79469db02 100644 Binary files a/assets/design-export/screenshots/1274632774-4001.png and b/assets/design-export/screenshots/1274632774-4001.png differ diff --git a/assets/design-export/screenshots/1274632774-4260.png b/assets/design-export/screenshots/1274632774-4260.png index 0d8898320..bf88c4f5b 100644 Binary files a/assets/design-export/screenshots/1274632774-4260.png and b/assets/design-export/screenshots/1274632774-4260.png differ diff --git a/assets/design-export/screenshots/2044649516-1099.png b/assets/design-export/screenshots/2044649516-1099.png index e909e8ee1..39ceb7ee5 100644 Binary files a/assets/design-export/screenshots/2044649516-1099.png and b/assets/design-export/screenshots/2044649516-1099.png differ diff --git a/assets/design-export/screenshots/2044649516-13.png b/assets/design-export/screenshots/2044649516-13.png index d207f37d7..92e86e61b 100644 Binary files a/assets/design-export/screenshots/2044649516-13.png and b/assets/design-export/screenshots/2044649516-13.png differ diff --git a/assets/design-export/screenshots/2044649516-1687.png b/assets/design-export/screenshots/2044649516-1687.png index 8aca1dfa3..48087b828 100644 Binary files a/assets/design-export/screenshots/2044649516-1687.png and b/assets/design-export/screenshots/2044649516-1687.png differ diff --git a/assets/design-export/screenshots/2044649516-2282.png b/assets/design-export/screenshots/2044649516-2282.png index 95e83aadf..5122fcfa7 100644 Binary files a/assets/design-export/screenshots/2044649516-2282.png and b/assets/design-export/screenshots/2044649516-2282.png differ diff --git a/assets/design-export/screenshots/2044649516-579.png b/assets/design-export/screenshots/2044649516-579.png index bfd2ac953..2c2273416 100644 Binary files a/assets/design-export/screenshots/2044649516-579.png and b/assets/design-export/screenshots/2044649516-579.png differ diff --git a/assets/design-export/screenshots/D9QYZ.png b/assets/design-export/screenshots/D9QYZ.png index af889e37e..8be23a7e5 100644 Binary files a/assets/design-export/screenshots/D9QYZ.png and b/assets/design-export/screenshots/D9QYZ.png differ diff --git a/assets/design-export/screenshots/DBQyF.png b/assets/design-export/screenshots/DBQyF.png index df3593591..c3dda8b69 100644 Binary files a/assets/design-export/screenshots/DBQyF.png and b/assets/design-export/screenshots/DBQyF.png differ diff --git a/assets/design-export/screenshots/FOVMf.png b/assets/design-export/screenshots/FOVMf.png index 04f03ce52..4f799f848 100644 Binary files a/assets/design-export/screenshots/FOVMf.png and b/assets/design-export/screenshots/FOVMf.png differ diff --git a/assets/design-export/screenshots/K5XinZ.png b/assets/design-export/screenshots/K5XinZ.png index e8f25638f..004bee972 100644 Binary files a/assets/design-export/screenshots/K5XinZ.png and b/assets/design-export/screenshots/K5XinZ.png differ diff --git a/assets/design-export/screenshots/M2sA4u.png b/assets/design-export/screenshots/M2sA4u.png index b309e5531..e28c665d6 100644 Binary files a/assets/design-export/screenshots/M2sA4u.png and b/assets/design-export/screenshots/M2sA4u.png differ diff --git a/assets/design-export/screenshots/QgW58.png b/assets/design-export/screenshots/QgW58.png index 6ba75e057..e02dd7ab7 100644 Binary files a/assets/design-export/screenshots/QgW58.png and b/assets/design-export/screenshots/QgW58.png differ diff --git a/assets/design-export/screenshots/RC3Kf.png b/assets/design-export/screenshots/RC3Kf.png index ad36db3e2..4283e15fd 100644 Binary files a/assets/design-export/screenshots/RC3Kf.png and b/assets/design-export/screenshots/RC3Kf.png differ diff --git a/assets/design-export/screenshots/SUcad.png b/assets/design-export/screenshots/SUcad.png index 1359659cf..d83081e1b 100644 Binary files a/assets/design-export/screenshots/SUcad.png and b/assets/design-export/screenshots/SUcad.png differ diff --git a/assets/design-export/screenshots/T1wkiT.png b/assets/design-export/screenshots/T1wkiT.png index 6cac0cdb3..61ff03829 100644 Binary files a/assets/design-export/screenshots/T1wkiT.png and b/assets/design-export/screenshots/T1wkiT.png differ diff --git a/assets/design-export/screenshots/UdnBT.png b/assets/design-export/screenshots/UdnBT.png index 13d75d04c..a31bfc7c1 100644 Binary files a/assets/design-export/screenshots/UdnBT.png and b/assets/design-export/screenshots/UdnBT.png differ diff --git a/assets/design-export/screenshots/Uzzje.png b/assets/design-export/screenshots/Uzzje.png index 88a4578c4..665fd888c 100644 Binary files a/assets/design-export/screenshots/Uzzje.png and b/assets/design-export/screenshots/Uzzje.png differ diff --git a/assets/design-export/screenshots/WZdnw.png b/assets/design-export/screenshots/WZdnw.png index 23ba033b8..9771a64c3 100644 Binary files a/assets/design-export/screenshots/WZdnw.png and b/assets/design-export/screenshots/WZdnw.png differ diff --git a/assets/design-export/screenshots/Wj0V4.png b/assets/design-export/screenshots/Wj0V4.png index 7a21e63f8..239fa92b3 100644 Binary files a/assets/design-export/screenshots/Wj0V4.png and b/assets/design-export/screenshots/Wj0V4.png differ diff --git a/assets/design-export/screenshots/cDiNb.png b/assets/design-export/screenshots/cDiNb.png index f074ea9dc..7d3f2c7f0 100644 Binary files a/assets/design-export/screenshots/cDiNb.png and b/assets/design-export/screenshots/cDiNb.png differ diff --git a/assets/design-export/screenshots/g5mEpx.png b/assets/design-export/screenshots/g5mEpx.png index c5408a5b3..41ce736f4 100644 Binary files a/assets/design-export/screenshots/g5mEpx.png and b/assets/design-export/screenshots/g5mEpx.png differ diff --git a/assets/design-export/screenshots/i4L0M.png b/assets/design-export/screenshots/i4L0M.png index ffcf0e73a..e1eb66fba 100644 Binary files a/assets/design-export/screenshots/i4L0M.png and b/assets/design-export/screenshots/i4L0M.png differ diff --git a/assets/design-export/screenshots/l64bd.png b/assets/design-export/screenshots/l64bd.png index c443c7a26..20168c30a 100644 Binary files a/assets/design-export/screenshots/l64bd.png and b/assets/design-export/screenshots/l64bd.png differ diff --git a/assets/design-export/screenshots/l7TRz9.png b/assets/design-export/screenshots/l7TRz9.png index 8db999b23..ec4e29442 100644 Binary files a/assets/design-export/screenshots/l7TRz9.png and b/assets/design-export/screenshots/l7TRz9.png differ diff --git a/assets/design-export/screenshots/lCTci.png b/assets/design-export/screenshots/lCTci.png index b3a2d0da6..626c8b1f9 100644 Binary files a/assets/design-export/screenshots/lCTci.png and b/assets/design-export/screenshots/lCTci.png differ diff --git a/assets/design-export/screenshots/lWvcv.png b/assets/design-export/screenshots/lWvcv.png index cc33678bc..a0075244e 100644 Binary files a/assets/design-export/screenshots/lWvcv.png and b/assets/design-export/screenshots/lWvcv.png differ diff --git a/assets/design-export/screenshots/n6Xlo.png b/assets/design-export/screenshots/n6Xlo.png index 135c7e6a9..167bde357 100644 Binary files a/assets/design-export/screenshots/n6Xlo.png and b/assets/design-export/screenshots/n6Xlo.png differ diff --git a/assets/design-export/screenshots/nNGDX.png b/assets/design-export/screenshots/nNGDX.png index b4d1c38c2..f5e1f6fa7 100644 Binary files a/assets/design-export/screenshots/nNGDX.png and b/assets/design-export/screenshots/nNGDX.png differ diff --git a/assets/design-export/screenshots/r0heh.png b/assets/design-export/screenshots/r0heh.png index 243cafb8b..ab2196c89 100644 Binary files a/assets/design-export/screenshots/r0heh.png and b/assets/design-export/screenshots/r0heh.png differ diff --git a/assets/design-export/screenshots/uMiwd.png b/assets/design-export/screenshots/uMiwd.png index 528b09a49..571fad607 100644 Binary files a/assets/design-export/screenshots/uMiwd.png and b/assets/design-export/screenshots/uMiwd.png differ diff --git a/assets/design-export/screenshots/uoxQW.png b/assets/design-export/screenshots/uoxQW.png index d1d57bf93..fa005735e 100644 Binary files a/assets/design-export/screenshots/uoxQW.png and b/assets/design-export/screenshots/uoxQW.png differ diff --git a/assets/design-export/screenshots/yrxK2.png b/assets/design-export/screenshots/yrxK2.png index 696ce9f12..fcc4cea7c 100644 Binary files a/assets/design-export/screenshots/yrxK2.png and b/assets/design-export/screenshots/yrxK2.png differ diff --git a/assets/design-export/screenshots/zM0VF.png b/assets/design-export/screenshots/zM0VF.png index 9c3c28c00..198fe0330 100644 Binary files a/assets/design-export/screenshots/zM0VF.png and b/assets/design-export/screenshots/zM0VF.png differ diff --git a/assets/design-export/screenshots/zqzr4.png b/assets/design-export/screenshots/zqzr4.png index be4fb7c9c..7a8e71298 100644 Binary files a/assets/design-export/screenshots/zqzr4.png and b/assets/design-export/screenshots/zqzr4.png differ diff --git a/changelog/unreleased/1074-sftp-access.md b/changelog/unreleased/1074-sftp-access.md new file mode 100644 index 000000000..7d9d1d90d --- /dev/null +++ b/changelog/unreleased/1074-sftp-access.md @@ -0,0 +1,3 @@ +# SFTP access to game server files + +SFTP is an optional component, off by default: set `sftp.enabled=true` (and `sftp.serviceType`, `sftp.publicAddress` if you need outside access) to browse, upload and download server files with FileZilla, WinSCP or `sftp`. Every login and file change goes through the API as the signed-in user, so the Files tab permissions and the audit log apply, with source `sftp`. Users add SSH keys and generate a SFTP password under Settings, SFTP; admins can revoke them in Users, and remote clusters get their own endpoint under Clusters. Uploads from SFTP and the Files tab now stream and are capped by the new `files.maxUploadSize` value (default `20Gi`), and `operator.filesIdleTimeout` (default `10m`) sets how long a file-only pod stays up for a stopped server. Setup and troubleshooting: [docs/sftp.md](../../docs/sftp.md). [PR #1074](https://github.com/GameplanePanel/Gameplane/pull/1074) diff --git a/charts/gameplane/templates/_helpers.tpl b/charts/gameplane/templates/_helpers.tpl index 9ff5b28aa..384e6ff36 100644 --- a/charts/gameplane/templates/_helpers.tpl +++ b/charts/gameplane/templates/_helpers.tpl @@ -80,6 +80,28 @@ track a rolling channel. {{- end -}} {{- end -}} +{{- define "gameplane.sftpImage" -}} +{{- if .Values.sftp.image -}}{{- .Values.sftp.image -}} +{{- else -}}{{- printf "%s/sftp:%s" .Values.image.registry (include "gameplane.imageTag" .) -}}{{- end -}} +{{- end -}} + +{{- /* gameplane.quantityBytes converts a Kubernetes quantity (Ki Mi Gi Ti Pi, k K M G T P, or digits) to an +integer byte count string. Helm has no quantity parser, so anything else fails the render. A YAML integer +arrives as float64, so it is formatted without an exponent. */ -}} +{{- define "gameplane.quantityBytes" -}} +{{- $raw := . -}} +{{- $s := "" -}} +{{- if kindIs "float64" $raw -}}{{- $s = printf "%.0f" $raw -}}{{- else -}}{{- $s = toString $raw | trim -}}{{- end -}} +{{- if not (regexMatch "^[0-9]+(Ki|Mi|Gi|Ti|Pi|k|K|M|G|T|P)?$" $s) -}} +{{- fail (printf "files.maxUploadSize %q must be a whole-number quantity such as 20Gi" $s) -}} +{{- end -}} +{{- $n := regexFind "^[0-9]+" $s | int64 -}} +{{- if lt $n 1 -}}{{- fail (printf "files.maxUploadSize %q must be greater than zero" $s) -}}{{- end -}} +{{- $u := regexFind "[A-Za-z]+$" $s -}} +{{- $m := dict "" 1 "Ki" 1024 "Mi" 1048576 "Gi" 1073741824 "Ti" 1099511627776 "Pi" 1125899906842624 "k" 1000 "K" 1000 "M" 1000000 "G" 1000000000 "T" 1000000000000 "P" 1000000000000000 -}} +{{- mul $n (index $m $u | int64) | int64 -}} +{{- end -}} + {{- /* gameplane.labels intentionally omits app.kubernetes.io/name so each resource can set its own (e.g. "gameplane-api", "gameplane-operator") diff --git a/charts/gameplane/templates/api.yaml b/charts/gameplane/templates/api.yaml index ab9c557a1..d892d6709 100644 --- a/charts/gameplane/templates/api.yaml +++ b/charts/gameplane/templates/api.yaml @@ -158,6 +158,32 @@ metadata: namespace: {{ .Release.Namespace }} labels: {{- include "gameplane.labels" . | nindent 4 }} roleRef: { apiGroup: rbac.authorization.k8s.io, kind: Role, name: {{ .Release.Name }}-api-logs } +subjects: + - kind: ServiceAccount + name: gameplane-api + namespace: {{ .Release.Namespace }} +--- +# The panel's SFTP host key Secret lives in the release namespace (templates/sftp.yaml). The API reads only +# that one Secret, for the fingerprint shown on the SFTP endpoint cards (spec 040, api/internal/handlers/sftp_cluster.go). +apiVersion: rbac.authorization.k8s.io/v1 +kind: Role +metadata: + name: {{ .Release.Name }}-api-sftp-host-key + namespace: {{ .Release.Namespace }} + labels: {{- include "gameplane.labels" . | nindent 4 }} +rules: + - apiGroups: [""] + resources: [secrets] + resourceNames: [{{ ((.Values.sftp | default dict).hostKeySecret | default "gameplane-sftp-host-key") | quote }}] + verbs: [get] +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: RoleBinding +metadata: + name: {{ .Release.Name }}-api-sftp-host-key + namespace: {{ .Release.Namespace }} + labels: {{- include "gameplane.labels" . | nindent 4 }} +roleRef: { apiGroup: rbac.authorization.k8s.io, kind: Role, name: {{ .Release.Name }}-api-sftp-host-key } subjects: - kind: ServiceAccount name: gameplane-api @@ -333,6 +359,8 @@ spec: - --agent-client-cert=/etc/gameplane/agent-client/tls.crt - --agent-client-key=/etc/gameplane/agent-client/tls.key {{- end }} + {{- /* Shared with the dashboard Files tab; also applies on standalone installs. */}} + - {{ printf "--files-max-upload-bytes=%s" (include "gameplane.quantityBytes" ((.Values.files | default dict).maxUploadSize | default "20Gi")) | quote }} {{- if gt (int .Values.api.audit.retentionDays) 0 }} - --audit-retention-days={{ .Values.api.audit.retentionDays }} {{- end }} @@ -428,6 +456,23 @@ spec: - name: GAMEPLANE_CLUSTER_OPS value: "true" {{- end }} + {{- /* Local SFTP endpoint (spec 040): the API seeds this service token so the in-cluster pod can log in. */}} + {{- if and (.Values.sftp | default dict).enabled (not (.Values.sftp | default dict).apiURL) }} + - name: GAMEPLANE_SFTP_LOCAL_SERVICE_TOKEN + valueFrom: + secretKeyRef: + name: gameplane-sftp-service-token + key: token + {{- /* The dashboard's endpoint card for this cluster: address from values, fingerprint from the host key Secret. */}} + - name: GAMEPLANE_SFTP_PUBLIC_ADDRESS + value: {{ (.Values.sftp).publicAddress | default "" | quote }} + - name: GAMEPLANE_SFTP_HOST_KEY_SECRET + value: {{ (.Values.sftp).hostKeySecret | default "gameplane-sftp-host-key" | quote }} + - name: GAMEPLANE_SFTP_ENABLED + value: "true" + - name: GAMEPLANE_SFTP_PORT + value: {{ printf "%d" (int (.Values.sftp).port) | quote }} + {{- end }} {{- if .Values.api.oidc.enabled }} - name: GAMEPLANE_OIDC_CLIENT_SECRET valueFrom: diff --git a/charts/gameplane/templates/gateway.yaml b/charts/gameplane/templates/gateway.yaml index aeab6bafc..76bf62729 100644 --- a/charts/gameplane/templates/gateway.yaml +++ b/charts/gameplane/templates/gateway.yaml @@ -92,6 +92,31 @@ spec: ports: - { protocol: TCP, port: 8090 } - { protocol: TCP, port: 9091 } +--- +# File-only pods (spec 040) serve /files on the agent port while a server is stopped. The +# gateway may reach them there and nowhere else (no capture or kubelet port). +apiVersion: networking.k8s.io/v1 +kind: NetworkPolicy +metadata: + name: {{ $.Release.Name }}-gateway-to-files + namespace: {{ . }} + labels: {{- include "gameplane.labels" $ | nindent 4 }} +spec: + podSelector: + matchLabels: + app.kubernetes.io/name: gameplane-files + policyTypes: [Ingress] + ingress: + - from: + - namespaceSelector: + matchLabels: + kubernetes.io/metadata.name: {{ $.Release.Namespace }} + podSelector: + matchLabels: + app.kubernetes.io/name: gameplane-gateway + app.kubernetes.io/instance: {{ $.Release.Name }} + ports: + - { protocol: TCP, port: 8090 } {{- end }} {{- end }} --- @@ -142,6 +167,7 @@ spec: - {{ printf "--capture-max-retention=%d" (.Values.capture.maxRetentionSeconds | int64) | quote }} - {{ printf "--capture-default-max-duration=%d" (.Values.capture.defaultMaxDurationSeconds | int64) | quote }} - {{ printf "--capture-default-max-size=%d" (.Values.capture.defaultMaxSizeBytes | int64) | quote }} + - {{ printf "--files-max-upload-bytes=%s" (include "gameplane.quantityBytes" ((.Values.files | default dict).maxUploadSize | default "20Gi")) | quote }} ports: - { name: mtls, containerPort: 8443 } # The listener requires mTLS on every request; no unauthenticated diff --git a/charts/gameplane/templates/networkpolicies.yaml b/charts/gameplane/templates/networkpolicies.yaml index b274ea5c2..69d4ea47e 100644 --- a/charts/gameplane/templates/networkpolicies.yaml +++ b/charts/gameplane/templates/networkpolicies.yaml @@ -103,6 +103,38 @@ spec: app.kubernetes.io/name: gameplane-operator ports: - { protocol: TCP, port: 8090 } +--- +# File-only pods (spec 040) serve /files on the agent port while a server is stopped. Only +# the API and operator may reach them, and only on that port. +apiVersion: networking.k8s.io/v1 +kind: NetworkPolicy +metadata: + name: allow-api-to-files + namespace: {{ $namespace }} + labels: {{- include "gameplane.labels" . | nindent 4 }} +spec: + podSelector: + matchLabels: + app.kubernetes.io/name: gameplane-files + policyTypes: [Ingress] + ingress: + - from: + {{- if (eq (include "gameplane.apiEnabled" .) "true") }} + - namespaceSelector: + matchLabels: + kubernetes.io/metadata.name: {{ .Release.Namespace }} + podSelector: + matchLabels: + app.kubernetes.io/name: gameplane-api + {{- end }} + - namespaceSelector: + matchLabels: + kubernetes.io/metadata.name: {{ .Release.Namespace }} + podSelector: + matchLabels: + app.kubernetes.io/name: gameplane-operator + ports: + - { protocol: TCP, port: 8090 } {{- $capture := .Values.capture | default dict }} {{- if $capture.enabled }} --- diff --git a/charts/gameplane/templates/operator.yaml b/charts/gameplane/templates/operator.yaml index 502e84111..76d2f16df 100644 --- a/charts/gameplane/templates/operator.yaml +++ b/charts/gameplane/templates/operator.yaml @@ -177,6 +177,11 @@ rules: - apiGroups: [""] resources: [pods/ephemeralcontainers] verbs: [get, patch, update] + # File-only pod for a stopped server (spec 040, gameserver_files.go): the + # operator creates and removes -files in this managed namespace only. + - apiGroups: [""] + resources: [pods] + verbs: [create, delete] # Per-GameServer agent identity: SA + heartbeat Role/RoleBinding # (resourceNames-scoped to one GameServer's status subresource). # Granting gameservers/status passes the RBAC escalation check @@ -361,6 +366,12 @@ spec: # (Always for :edge installs, IfNotPresent for pinned tags) so # the agent sidecar rolls in step with the rest of Gameplane. - --agent-image-pull-policy={{ .Values.image.pullPolicy }} + {{- /* Per-upload limit for every agent (dashboard Files tab and SFTP). Falls back to 20Gi when + files is absent after --reuse-values from a release that predates it. */}} + - {{ printf "--agent-max-upload-bytes=%s" (include "gameplane.quantityBytes" ((.Values.files | default dict).maxUploadSize | default "20Gi")) | quote }} + {{- with .Values.operator.filesIdleTimeout }} + - --files-idle-timeout={{ . }} + {{- end }} - --sentinel-image={{ include "gameplane.sentinelImage" . }} {{- if hasKey .Values.operator "tailscaleMaxSessions" }} - --tailscale-max-sessions={{ .Values.operator.tailscaleMaxSessions }} diff --git a/charts/gameplane/templates/sftp.yaml b/charts/gameplane/templates/sftp.yaml new file mode 100644 index 000000000..3a8ad6e16 --- /dev/null +++ b/charts/gameplane/templates/sftp.yaml @@ -0,0 +1,210 @@ +{{- /* +SFTP endpoint for game server files (spec 040). Off by default. The pod holds no game +volumes: every login and file operation goes to the Gameplane API as the signed-in user. + +Local mode (default): the panel's own cluster. The chart generates a service token Secret +that the API seeds at startup, and the pod talks to the in-cluster API Service. +Remote mode (sftp.apiURL set): this cluster runs only the SFTP pod against a central panel; +sftp.serviceTokenSecret must hold the token created there. +*/ -}} +{{- if (.Values.sftp | default dict).enabled }} +{{- $sftp := .Values.sftp }} +{{- $apiEnabled := eq (include "gameplane.apiEnabled" .) "true" }} +{{- $local := not $sftp.apiURL }} +{{- if and $local (not $apiEnabled) }} +{{- fail "sftp.enabled=true with api.enabled=false requires sftp.apiURL (the central panel the SFTP pod logs in to)" }} +{{- end }} +{{- if and (not $local) (not $sftp.serviceTokenSecret) }} +{{- fail "sftp.apiURL is set (remote mode): sftp.serviceTokenSecret must name a Secret with the service token (key token) created in the central panel" }} +{{- end }} +{{- if not (has $sftp.serviceType (list "ClusterIP" "NodePort" "LoadBalancer")) }} +{{- fail (printf "sftp.serviceType must be ClusterIP, NodePort or LoadBalancer (got %q)" $sftp.serviceType) }} +{{- end }} +{{- if and $sftp.nodePort (or (ne $sftp.serviceType "NodePort") (lt (int $sftp.nodePort) 30000) (gt (int $sftp.nodePort) 32767)) }} +{{- fail "sftp.nodePort applies only to serviceType NodePort and must be 30000-32767" }} +{{- end }} +{{- if and $sftp.loadBalancerIP (ne $sftp.serviceType "LoadBalancer") }} +{{- fail "sftp.loadBalancerIP applies only to serviceType LoadBalancer" }} +{{- end }} +{{- $hostKeySecret := $sftp.hostKeySecret | default "gameplane-sftp-host-key" }} +{{- /* Local mode always uses the chart-generated token the API seeds; remote mode uses the operator-supplied Secret. */}} +{{- $tokenSecret := ternary "gameplane-sftp-service-token" $sftp.serviceTokenSecret $local }} +{{- $apiURL := ternary (printf "http://gameplane-api.%s.svc" .Release.Namespace) $sftp.apiURL $local }} +{{- /* Generated once: lookup returns the live Secret on install and upgrade; offline renders regenerate it. */}} +{{- if not $sftp.hostKeySecret }} +{{- $old := lookup "v1" "Secret" .Release.Namespace "gameplane-sftp-host-key" }} +--- +apiVersion: v1 +kind: Secret +metadata: + name: gameplane-sftp-host-key + namespace: {{ .Release.Namespace }} + labels: {{- include "gameplane.labels" . | nindent 4 }} + annotations: + helm.sh/resource-policy: keep +type: Opaque +data: + host_key: {{ dig "data" "host_key" "" ($old | default dict) | default (genPrivateKey "ed25519" | b64enc) }} +{{- end }} +{{- if $local }} +{{- $old := lookup "v1" "Secret" .Release.Namespace "gameplane-sftp-service-token" }} +--- +# Local service token for the API's SFTP login path. The API seeds it at startup +# (GAMEPLANE_SFTP_LOCAL_SERVICE_TOKEN). The SFTP pod reads the same value from its file. +apiVersion: v1 +kind: Secret +metadata: + name: gameplane-sftp-service-token + namespace: {{ .Release.Namespace }} + labels: {{- include "gameplane.labels" . | nindent 4 }} + annotations: + helm.sh/resource-policy: keep +type: Opaque +data: + token: {{ dig "data" "token" "" ($old | default dict) | default (printf "gpsftps_%s" (randAlphaNum 43) | b64enc) }} +{{- end }} +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + name: gameplane-sftp + namespace: {{ .Release.Namespace }} + labels: {{- include "gameplane.labels" . | nindent 4 }} +spec: + replicas: {{ $sftp.replicas }} + selector: + matchLabels: { app.kubernetes.io/name: gameplane-sftp } + template: + metadata: + labels: + app.kubernetes.io/name: gameplane-sftp + {{- include "gameplane.labels" . | nindent 8 }} + spec: + {{- include "gameplane.placement" $sftp | nindent 6 }} + automountServiceAccountToken: false + securityContext: + runAsNonRoot: true + runAsUser: 65532 + seccompProfile: { type: RuntimeDefault } + containers: + - name: sftp + image: {{ include "gameplane.sftpImage" . }} + imagePullPolicy: {{ .Values.image.pullPolicy }} + args: ["serve"] + env: + - { name: GAMEPLANE_SFTP_LISTEN, value: {{ printf ":%d" (int $sftp.port) | quote }} } + - { name: GAMEPLANE_SFTP_HOST_KEY, value: /etc/gameplane/sftp/hostkeys } + - { name: GAMEPLANE_SFTP_API_URL, value: {{ $apiURL | quote }} } + - { name: GAMEPLANE_SFTP_SERVICE_TOKEN_FILE, value: /etc/gameplane/sftp-token/token } + {{- if $sftp.apiCASecret }} + - { name: GAMEPLANE_SFTP_CA_FILE, value: /etc/gameplane/sftp-ca/ca.crt } + {{- end }} + - { name: GAMEPLANE_SFTP_IDLE_TIMEOUT, value: {{ $sftp.idleTimeout | quote }} } + - { name: GAMEPLANE_SFTP_MAX_SESSIONS_PER_USER, value: {{ printf "%d" (int $sftp.maxSessionsPerUser) | quote }} } + - { name: GAMEPLANE_SFTP_MAX_TRANSFERS_PER_USER, value: {{ printf "%d" (int $sftp.maxTransfersPerUser) | quote }} } + - { name: GAMEPLANE_SFTP_DEFAULT_NAMESPACE, value: {{ .Values.gamesNamespace | quote }} } + - { name: GAMEPLANE_SFTP_METRICS_ADDR, value: ":9102" } + ports: + - { name: ssh, containerPort: {{ int $sftp.port }} } + - { name: metrics, containerPort: 9102 } + livenessProbe: { tcpSocket: { port: ssh }, initialDelaySeconds: 5, periodSeconds: 20 } + readinessProbe: { tcpSocket: { port: ssh }, initialDelaySeconds: 2, periodSeconds: 10 } + resources: {{- toYaml $sftp.resources | nindent 12 }} + securityContext: + allowPrivilegeEscalation: false + readOnlyRootFilesystem: true + capabilities: { drop: [ALL] } + volumeMounts: + - { name: host-key, mountPath: /etc/gameplane/sftp/hostkeys, readOnly: true } + - { name: service-token, mountPath: /etc/gameplane/sftp-token, readOnly: true } + {{- if $sftp.apiCASecret }} + - { name: api-ca, mountPath: /etc/gameplane/sftp-ca, readOnly: true } + {{- end }} + volumes: + - name: host-key + secret: + secretName: {{ $hostKeySecret }} + items: + - { key: host_key, path: host_key } + - name: service-token + secret: + secretName: {{ $tokenSecret }} + items: + - { key: token, path: token } + {{- if $sftp.apiCASecret }} + - name: api-ca + secret: + secretName: {{ $sftp.apiCASecret }} + items: + - { key: ca.crt, path: ca.crt } + {{- end }} + {{- with .Values.image.pullSecrets }} + imagePullSecrets: {{- toYaml . | nindent 8 }} + {{- end }} +--- +apiVersion: v1 +kind: Service +metadata: + name: gameplane-sftp + namespace: {{ .Release.Namespace }} + labels: {{- include "gameplane.labels" . | nindent 4 }} +spec: + type: {{ $sftp.serviceType }} + {{- if and (eq $sftp.serviceType "LoadBalancer") $sftp.loadBalancerIP }} + loadBalancerIP: {{ $sftp.loadBalancerIP | quote }} + {{- end }} + selector: { app.kubernetes.io/name: gameplane-sftp } + ports: + - name: ssh + port: {{ int $sftp.port }} + targetPort: ssh + protocol: TCP + {{- if and (eq $sftp.serviceType "NodePort") $sftp.nodePort }} + nodePort: {{ int $sftp.nodePort }} + {{- end }} +{{- if .Values.networkPolicies.enabled }} +--- +# SFTP clients come from the internet, so ingress is open on the SFTP port only. Egress is +# limited to DNS plus the API (local mode) or the central panel's endpoint (remote mode). +apiVersion: networking.k8s.io/v1 +kind: NetworkPolicy +metadata: + name: gameplane-sftp + namespace: {{ .Release.Namespace }} + labels: {{- include "gameplane.labels" . | nindent 4 }} +spec: + podSelector: + matchLabels: + app.kubernetes.io/name: gameplane-sftp + policyTypes: [Ingress, Egress] + ingress: + - ports: + - { protocol: TCP, port: {{ int $sftp.port }} } + egress: + - to: + - namespaceSelector: + matchLabels: + kubernetes.io/metadata.name: kube-system + ports: + - { protocol: UDP, port: 53 } + - { protocol: TCP, port: 53 } + {{- if $local }} + - to: + - podSelector: + matchLabels: + app.kubernetes.io/name: gameplane-api + ports: + - { protocol: TCP, port: 8000 } + {{- else }} + {{- $hostPort := (urlParse $sftp.apiURL).host | default "" }} + {{- $apiPort := 443 }} + {{- if regexMatch ":[0-9]+$" $hostPort }} + {{- $apiPort = regexFind "[0-9]+$" $hostPort | int }} + {{- end }} + - ports: + {{- range $port := uniq (list 443 $apiPort) }} + - { protocol: TCP, port: {{ $port }} } + {{- end }} + {{- end }} +{{- end }} +{{- end }} diff --git a/charts/gameplane/tests/sftp.sh b/charts/gameplane/tests/sftp.sh new file mode 100755 index 000000000..59a22fe8a --- /dev/null +++ b/charts/gameplane/tests/sftp.sh @@ -0,0 +1,121 @@ +#!/usr/bin/env bash +# Render the SFTP endpoint in its modes and check the objects it owns (spec 040, US4). +set -euo pipefail +cd "$(dirname "$0")/../../.." +scratch="$(mktemp -d)" +trap 'rm -rf "$scratch"' EXIT +render() { # render [helm --set args...] + local out="$1"; shift + helm template gameplane charts/gameplane --namespace gameplane-system "$@" > "$out" +} +render "$scratch/off.yaml" --set sftp.enabled=false +render "$scratch/local.yaml" --set sftp.enabled=true +render "$scratch/nodeport.yaml" --set sftp.enabled=true --set sftp.serviceType=NodePort --set sftp.nodePort=30222 --set sftp.publicAddress=files.example.com:30222 +render "$scratch/lb.yaml" --set sftp.enabled=true --set sftp.serviceType=LoadBalancer --set sftp.loadBalancerIP=203.0.113.10 +render "$scratch/remote.yaml" --set api.enabled=false --set sftp.enabled=true \ + --set sftp.apiURL=https://panel.example.com --set sftp.serviceTokenSecret=panel-sftp-token +render "$scratch/hostkey.yaml" --set sftp.enabled=true --set sftp.hostKeySecret=panel-host-key +python3 - "$scratch" <<'PY' +import pathlib,sys,yaml +root=pathlib.Path(sys.argv[1]) +SFTP_NAMES={'gameplane-sftp','gameplane-sftp-host-key','gameplane-sftp-service-token'} + +def docs(name): + return [d for d in yaml.safe_load_all((root/name).read_text()) if d] + +def find(all_docs, kind, name): + hits=[d for d in all_docs if d.get('kind')==kind and d['metadata']['name']==name] + assert len(hits)<=1, (kind, name, len(hits)) + return hits[0] if hits else None + +def env_of(all_docs): + dep=find(all_docs,'Deployment','gameplane-sftp') + assert dep is not None, 'missing Deployment gameplane-sftp' + return {e['name']:e.get('value') for e in dep['spec']['template']['spec']['containers'][0].get('env') or []} + +# 1. Off: nothing the SFTP endpoint owns is rendered, and the API gets no SFTP env. +off=docs('off.yaml') +leftovers=[(d['kind'], d['metadata']['name']) for d in off + if d.get('kind') in ('Deployment','Service','Secret','NetworkPolicy') and d['metadata']['name'] in SFTP_NAMES] +assert not leftovers, leftovers +for d in off: + if d.get('kind')=='Deployment' and d['metadata']['name']=='gameplane-api': + names={e['name'] for c in d['spec']['template']['spec']['containers'] for e in c.get('env') or []} + assert not any(n.startswith('GAMEPLANE_SFTP_') for n in names), names + +# 2. Local, default ClusterIP: Deployment, Service, both Secrets, NetworkPolicy. +local=docs('local.yaml') +svc=find(local,'Service','gameplane-sftp') +assert svc is not None and svc['spec']['type']=='ClusterIP', svc +assert 'nodePort' not in svc['spec']['ports'][0], svc['spec']['ports'] +assert svc['spec']['ports'][0]['port']==2222, svc['spec']['ports'] +hk=find(local,'Secret','gameplane-sftp-host-key') +assert hk is not None and hk['metadata']['annotations']['helm.sh/resource-policy']=='keep', hk +tok=find(local,'Secret','gameplane-sftp-service-token') +assert tok is not None and tok['metadata']['annotations']['helm.sh/resource-policy']=='keep', tok +env=env_of(local) +assert env['GAMEPLANE_SFTP_API_URL']=='http://gameplane-api.gameplane-system.svc', env +assert env['GAMEPLANE_SFTP_SERVICE_TOKEN_FILE']=='/etc/gameplane/sftp-token/token', env +np=find(local,'NetworkPolicy','gameplane-sftp') +assert np is not None, 'missing NetworkPolicy gameplane-sftp' +assert np['spec']['ingress'][0]['ports']==[{'protocol':'TCP','port':2222}], np['spec']['ingress'] + +# 3. NodePort: the fixed node port and the public address reach the chart output. +nodeport=docs('nodeport.yaml') +svc=find(nodeport,'Service','gameplane-sftp') +assert svc['spec']['type']=='NodePort', svc['spec'] +assert svc['spec']['ports'][0]['nodePort']==30222, svc['spec']['ports'] +api=[d for d in nodeport if d.get('kind')=='Deployment' and d['metadata']['name']=='gameplane-api'] +assert api, 'missing Deployment gameplane-api' +api_env={e['name']:e.get('value') for c in api[0]['spec']['template']['spec']['containers'] for e in c.get('env') or []} +assert api_env['GAMEPLANE_SFTP_PUBLIC_ADDRESS']=='files.example.com:30222', api_env + +# 4. LoadBalancer: the requested external IP is set; no node port. +lb=find(docs('lb.yaml'),'Service','gameplane-sftp') +assert lb['spec']['type']=='LoadBalancer' and lb['spec']['loadBalancerIP']=='203.0.113.10', lb['spec'] +assert 'nodePort' not in lb['spec']['ports'][0], lb['spec']['ports'] + +# 5. Remote (gateway-only, api.enabled=false): the pod logs in to the central panel with the +# operator's token Secret, the chart makes no local token Secret, and egress is limited to +# the central API's port. +remote=docs('remote.yaml') +env=env_of(remote) +assert env['GAMEPLANE_SFTP_API_URL']=='https://panel.example.com', env +assert find(remote,'Secret','gameplane-sftp-service-token') is None, 'remote mode must not render the local token Secret' +dep=find(remote,'Deployment','gameplane-sftp') +vols={v['name']:v for v in dep['spec']['template']['spec']['volumes']} +assert vols['service-token']['secret']['secretName']=='panel-sftp-token', vols['service-token'] +np=find(remote,'NetworkPolicy','gameplane-sftp') +egress_ports=[p['port'] for rule in np['spec']['egress'] for p in rule.get('ports') or []] +assert 443 in egress_ports, egress_ports + +# 6. Host key Secret: the API reads it from the release namespace, so its Role must grant get on that +# Secret name only. The default name is rendered by the chart; a custom name is supplied by the operator +# and the API env and the Role both carry it. +def api_env_of(all_docs): + dep=find(all_docs,'Deployment','gameplane-api') + assert dep is not None, 'missing Deployment gameplane-api' + return {e['name']:e.get('value') for c in dep['spec']['template']['spec']['containers'] for e in c.get('env') or []} + +def check_host_key_role(all_docs, secret_name): + role=find(all_docs,'Role','gameplane-api-sftp-host-key') + assert role is not None, 'missing Role gameplane-api-sftp-host-key' + assert role['metadata']['namespace']=='gameplane-system', role['metadata'] + assert role['rules']==[{'apiGroups':[''],'resources':['secrets'],'resourceNames':[secret_name],'verbs':['get']}], role['rules'] + rb=find(all_docs,'RoleBinding','gameplane-api-sftp-host-key') + assert rb is not None and rb['roleRef']['name']=='gameplane-api-sftp-host-key', rb + assert rb['subjects']==[{'kind':'ServiceAccount','name':'gameplane-api','namespace':'gameplane-system'}], rb['subjects'] + +check_host_key_role(local, 'gameplane-sftp-host-key') +env=api_env_of(local) +assert env['GAMEPLANE_SFTP_HOST_KEY_SECRET']=='gameplane-sftp-host-key', env +assert env['GAMEPLANE_SFTP_ENABLED']=='true' and env['GAMEPLANE_SFTP_PORT']=='2222', env +assert env['GAMEPLANE_SFTP_PUBLIC_ADDRESS']=='', env + +hostkey=docs('hostkey.yaml') +env=api_env_of(hostkey) +assert env['GAMEPLANE_SFTP_HOST_KEY_SECRET']=='panel-host-key', env +check_host_key_role(hostkey, 'panel-host-key') +assert find(hostkey,'Secret','gameplane-sftp-host-key') is None, 'custom hostKeySecret must not render the chart host key' +print('sftp chart checks ok') +PY diff --git a/charts/gameplane/values.yaml b/charts/gameplane/values.yaml index fbc543660..c716ed57e 100644 --- a/charts/gameplane/values.yaml +++ b/charts/gameplane/values.yaml @@ -80,6 +80,9 @@ crds: operator: # Bound, rotating agent-only token; 600 supports short rotation drills. agentTokenExpirationSeconds: 3600 + # How long a stopped server's file-only pod (spec 040) stays up after its last + # file operation before the operator removes it. Must be a positive duration. + filesIdleTimeout: 10m # Disable the operator and bundled native CRDs for a standalone central panel. enabled: true replicas: 1 @@ -805,6 +808,48 @@ mcpServer: requests: { cpu: 50m, memory: 32Mi } limits: { cpu: 200m, memory: 128Mi } +# File transfer settings shared by the dashboard Files tab and SFTP (spec 040). +files: + # Maximum size of one file upload. Binary or decimal Kubernetes quantity + # (Ki/Mi/Gi/Ti, K/M/G/T) or a plain byte count. Passed to the operator + # (agent --max-upload-bytes), the API and the gateway. + maxUploadSize: 20Gi + +# SFTP endpoint for game server files (spec 040). Off by default. Every login and +# file operation is authorised by the Gameplane API as the signed-in user. +sftp: + enabled: false + port: 2222 + # Empty => {image.registry}/sftp:{image tag}. Set a full reference to pin. + image: "" + # ClusterIP (default), NodePort or LoadBalancer. Use LoadBalancer or NodePort to accept SFTP from outside the cluster. + serviceType: ClusterIP + # NodePort only: fixed node port (30000-32767). 0 = let Kubernetes choose. + nodePort: 0 + # LoadBalancer only: requested external IP, when the cloud supports it. Empty = provider default. + loadBalancerIP: "" + # Address shown to users in the profile (host or host:port). Empty = unknown. + publicAddress: "" + # Remote clusters: central API URL, optional CA bundle Secret (key ca.crt) and an existing Secret + # with key `token` holding the service token created in the central panel. + apiURL: "" + apiCASecret: "" + serviceTokenSecret: "" + # Existing Secret with a `host_key` PEM; empty => chart generates one once (kept on uninstall). + hostKeySecret: "" + idleTimeout: 15m + maxSessionsPerUser: 4 + maxTransfersPerUser: 8 + replicas: 1 + nodeSelector: {} + tolerations: [] + affinity: {} + topologySpreadConstraints: [] + priorityClassName: "" + resources: + requests: { cpu: 50m, memory: 64Mi } + limits: { cpu: 500m, memory: 256Mi } + # Informational release-channel label shown read-only in the dashboard's # Admin Settings → Updates section. Nothing consumes it — Gameplane is # upgraded via Helm (image tags / chart versions). Empty (default) diff --git a/containers/docker-bake.hcl b/containers/docker-bake.hcl index 9102aa44f..2d7ea26ad 100644 --- a/containers/docker-bake.hcl +++ b/containers/docker-bake.hcl @@ -4,7 +4,7 @@ # sequential `docker build`s. Tags match what `make e2e-images` produces # and what deploy/kind/e2e.sh loads. group "e2e" { - targets = ["e2e-operator", "e2e-api", "e2e-agent", "e2e-sentinel", "e2e-capture-sidecar", "e2e-telemetry-receiver", "e2e-fakeoidc", "e2e-mcp-server", "e2e-audit-syslog-bridge", "e2e-tunnel-frp"] + targets = ["e2e-operator", "e2e-api", "e2e-agent", "e2e-sentinel", "e2e-capture-sidecar", "e2e-telemetry-receiver", "e2e-fakeoidc", "e2e-mcp-server", "e2e-sftp", "e2e-audit-syslog-bridge", "e2e-tunnel-frp"] } target "e2e-operator" { @@ -62,6 +62,14 @@ target "e2e-mcp-server" { tags = ["gameplane-test/mcp-server:e2e"] } +# The SFTP endpoint (spec 040). Base "e2e" group so the sftp e2e bucket finds +# it loaded in the cluster. +target "e2e-sftp" { + context = "." + dockerfile = "sftp/Dockerfile" + tags = ["gameplane-test/sftp:e2e"] +} + # The RFC 5424 audit syslog forwarder (spec 013 US5). Base "e2e" group. target "e2e-audit-syslog-bridge" { context = "." diff --git a/deploy/kind/e2e.sh b/deploy/kind/e2e.sh index 3edff743e..913afffa7 100755 --- a/deploy/kind/e2e.sh +++ b/deploy/kind/e2e.sh @@ -230,8 +230,8 @@ EOF install_metallb apply_metallb_pools - echo "loading gameplane-test/{operator,api,agent,sentinel,capture-sidecar,telemetry-receiver,mcp-server,audit-syslog-bridge,tunnel-frp}:${TAG} images into kind" - for img in operator api agent sentinel capture-sidecar telemetry-receiver mcp-server audit-syslog-bridge tunnel-frp; do + echo "loading gameplane-test/{operator,api,agent,sentinel,capture-sidecar,telemetry-receiver,mcp-server,sftp,audit-syslog-bridge,tunnel-frp}:${TAG} images into kind" + for img in operator api agent sentinel capture-sidecar telemetry-receiver mcp-server sftp audit-syslog-bridge tunnel-frp; do if ! docker image inspect "gameplane-test/${img}:${TAG}" >/dev/null 2>&1; then echo " missing local image gameplane-test/${img}:${TAG} — building" dockerfile="${REPO}/${img}/Dockerfile" diff --git a/design.fig b/design.fig index 99f29a2ba..6d6fb7b32 100644 Binary files a/design.fig and b/design.fig differ diff --git a/docs/agent-architecture.md b/docs/agent-architecture.md index ff323357a..e2fd221bf 100644 --- a/docs/agent-architecture.md +++ b/docs/agent-architecture.md @@ -29,6 +29,7 @@ This document is the **first stop** for AI agents modifying or extending Gamepla | **Telemetry-Receiver** | `telemetry-receiver/specs.md` | Ingests and processes anonymous usage telemetry from the API. | | **Telemetryschema** | `telemetryschema/specs.md` | Shared telemetry report contract (types, enumerations, strict decode, official module catalog, report signing) used by the API and the telemetry-receiver. | | **MCP-Server** | `mcp-server/specs.md` (submodule `GameplanePanel/mcp`) | Read-only Model Context Protocol server exposing cluster state to AI tools. | +| **SFTP** | `sftp/specs.md` (submodule `GameplanePanel/sftp`) | Optional SFTP endpoint for game server files. Every login and file operation goes to the API as the signed-in user ([`docs/sftp.md`](sftp.md)). | ## Shared Libraries & Tooling @@ -64,6 +65,7 @@ This document is the **first stop** for AI agents modifying or extending Gamepla | Server security overrides (run-as user or group, fsGroup, ownership check, root rule, per-cluster allow-root setting) | `docs/security.md` ("Server security overrides"), `docs/module-authoring.md` ("Security context"), `operator/specs.md`, `api/specs.md`, `operator/internal/controller/security_overrides.go`, `operator/internal/controller/security_settings.go`, `api/internal/handlers/security_overrides.go`, `api/internal/handlers/security_settings.go`, `web/src/components/SecurityAdvanced.tsx`, `web/src/components/clusters/SecuritySettingsPanel.tsx` | | Change personal MCP tokens or the MCP read routes (`api/internal/auth/mcptokens.go`, `api/internal/handlers/mcp_tokens.go`, `api/internal/handlers/pods.go`, `web/src/routes/McpTokens.tsx`, the MCP tokens dialog in `web/src/routes/Users.tsx`) | `api/specs.md`, `web/specs.md`, `docs/security.md` ("mcp-server (optional)") | | Change MCP server RBAC or namespace scope (`charts/gameplane/templates/mcp-server.yaml`, `charts/gameplane/tests/mcp-server-rbac.sh`) | `docs/security.md` ("mcp-server (optional)"), `mcp-server/specs.md` | +| Change SFTP access (`sftp/`, `api/internal/auth/sftp*.go`, `api/internal/handlers/sftp*.go`, `charts/gameplane/templates/sftp.yaml`, the SFTP profile page and Clusters drawer) | `docs/sftp.md`, `sftp/specs.md`, `specs/040-sftp-access/` | | Decide where new code goes | `docs/layout.md` | ## How to use this index diff --git a/docs/architecture.md b/docs/architecture.md index 7c65dae7c..4fe42175c 100644 --- a/docs/architecture.md +++ b/docs/architecture.md @@ -666,6 +666,12 @@ flowchart LR Opt-in per GameServer via `spec.capture.enabled` and admin-only (`captures:manage` permission). Disabled by default; enabled cluster-wide via `capture.enabled` Helm value. See the [`GameplanePanel/capture-sidecar`](https://github.com/GameplanePanel/capture-sidecar) repo (the `capture-sidecar/` submodule). +- **sftp [optional]**: an SFTP endpoint for game server files (submodule + `GameplanePanel/sftp`, the `sftp/` folder; spec 040), enabled by `sftp.enabled`. + It holds no game volumes and no credential store: each login and file + operation is decided by the API as the signed-in user, and each cluster + endpoint authenticates to the API with its own service token. See + [sftp.md](sftp.md) and [security.md](security.md#sftp-endpoint-spec-040-optional). - **mcp-server [optional]**: a standalone, strictly read-only MCP server (submodule `GameplanePanel/mcp`) — its tool handlers only ever hold a `*kube.Client` (`mcp-server/internal/kube`), whose sole exported methods are List/Get-shaped; the underlying typed/ diff --git a/docs/install.md b/docs/install.md index 69905623b..f0300be6d 100644 --- a/docs/install.md +++ b/docs/install.md @@ -357,6 +357,7 @@ Top-level knobs (see `values.yaml` for the full list): - `clusterOps.externalAddress` — external (node-routable) API server address, e.g. `1.2.3.4:6443` or `https://k8s.example.com:6443`, used in the join command and downloaded kubeconfig instead of the in-cluster ClusterIP; leave empty only when the in-cluster address is itself reachable from outside the cluster - `mcpServer.enabled` — optional strictly read-only MCP (Model Context Protocol) server [optional] for AI assistants to read cluster state and propose fixes (default off); see [mcp-server/README.md](https://github.com/GameplanePanel/mcp/blob/main/README.md) - `mcpServer.replicas` — MCP server replicas (default 1) +- `sftp.enabled` — optional SFTP endpoint for game server files (default off); see [sftp.md](sftp.md) - `updates.channel` — informational release-channel label (e.g., `stable`, `edge`) shown read-only in the dashboard's Admin Settings → Updates section; purely informational (Gameplane upgrades via Helm, not auto-update) - `podSecurity.enforceRestricted` — defaults to true on new installs. Enables the Restricted game/config-init profile and namespace admission. Templates require positive `security.runAsUser` and `security.fsGroup`; verify image compatibility and migrate existing file ownership before upgrading. Enabling it rolls existing Pods once. - `podSecurity.version` — pinned PSA minor, default `v1.34`; administrator override for a tested cluster version. diff --git a/docs/security.md b/docs/security.md index 202b82ffd..f58b9a4a1 100644 --- a/docs/security.md +++ b/docs/security.md @@ -758,6 +758,39 @@ earlier: The mods package confines its own paths separately (`ConfinePath`/`ConfineRelPath`) and does not use this descriptor walk. +## SFTP endpoint (spec 040, optional) + +The SFTP endpoint (`sftp.enabled`, off by default; see [sftp.md](sftp.md)) is a +second internet-facing listener, so it gets the same treatment as the dashboard: + +- **Authentication is decided by the API.** The SFTP pod holds no password + hashes and no key store. Each login (`POST /sftp/v1/login`) is checked by the + API against the user's own SSH public keys or generated password. The login + limiter is the same one the dashboard uses, so guessing is throttled per IP + and per username. A refused login returns one generic refusal, so the client + cannot tell a wrong password from a server the user cannot read. +- **Service tokens are per cluster.** The SFTP pod authenticates to the API with + a `gpsftps_` token minted under **Clusters**. Each cluster has at most two + active tokens, shown once, stored only as a digest, and revocable. A token + identifies a cluster endpoint; it does not identify a user and grants no + file access by itself. +- **Host key.** The SSH host key lives in the `gameplane-sftp-host-key` Secret, + created once by the chart and kept on uninstall. Users see its fingerprint on + their profile page and every client pins it. A bring-your-own key replaces the + Secret's `host_key` entry (`sftp.hostKeySecret`). +- **File-only pod.** The SFTP pod keeps no game data and mounts no game + volume. Every file operation is a request to the API, which runs it through the + agent as the signed-in user, with the same RBAC, ownership and dotfile rules as + the Files tab, and records it in the audit log with `source: sftp`. For a + stopped server, the operator's file-only pod (agent `--files-only`, no host + ports, removed after `--files-idle-timeout`) serves the same files; file access + never starts the game. Enabling SFTP grants the operator `pods: create, delete` + in game namespaces so it can run that file-only pod. +- **Revocation and disable** end open sessions within 60 seconds and refuse new + logins (FR-007, SC-006). +- **Transfers.** Uploads are capped by `files.maxUploadSize` and the volume's + free space. Idle sessions close after `sftp.idleTimeout`. + ## Runtime mod installs (agent) Separately from the module supply chain above, a running server can install diff --git a/docs/sftp.md b/docs/sftp.md new file mode 100644 index 000000000..dccb70d3e --- /dev/null +++ b/docs/sftp.md @@ -0,0 +1,244 @@ +# SFTP access to game server files + +Gameplane can serve the files of your game servers over SFTP, so you can use +FileZilla, WinSCP or the `sftp` command to upload worlds and mods, and download +backups. SFTP is off by default. It is an optional component, like the MCP +server and the audit syslog bridge. + +Every login and every file operation goes through the Gameplane API as the +signed-in user. The SFTP pod keeps no game data. Permissions, ownership and +the audit log work the same as in the Files tab, so a user can only reach +what they could already reach in the dashboard. + +## Turn it on + +SFTP is controlled by Helm values. Enable it with `helm upgrade --reuse-values`: + +```sh +helm upgrade gameplane charts/gameplane --reuse-values \ + --set sftp.enabled=true +``` + +By default the endpoint is a `ClusterIP` Service on port `2222`, which only +reaches the cluster from inside. To accept connections from your network, pick +an exposure: + +| Value | Use it when | +| --- | --- | +| `sftp.serviceType: LoadBalancer` | Your cloud or load balancer gives the Service an address. Set `sftp.loadBalancerIP` to request one. | +| `sftp.serviceType: NodePort` | Clients can reach a node address. Set `sftp.nodePort` (30000-32767) to fix the port. | +| `sftp.publicAddress` | Set this to the address users should type, for example `files.example.com:2222`. The profile page shows it. | + +Other values: + +- `sftp.port` (default `2222`): the port the SFTP server listens on. +- `sftp.idleTimeout` (default `15m`): an idle SFTP session is closed after this. +- `sftp.maxSessionsPerUser` (default `4`) and `sftp.maxTransfersPerUser` (default `8`). +- `files.maxUploadSize` (default `20Gi`): the largest single file one upload can + send, through SFTP and the dashboard. It accepts Kubernetes quantities + (`Ki`, `Mi`, `Gi`, `Ti`, `K`, `M`, `G`, `T`) or a plain byte count. Uploads + stream to the game's storage, and the agent refuses a file that would not fit + in the free space. + +The chart also creates a Secret named `gameplane-sftp-host-key` with the SSH +host key. It is created once and kept when you uninstall, so clients do not +see a changed key after an upgrade. To bring your own key, set +`sftp.hostKeySecret` to a Secret with a `host_key` entry in PEM format. +For GitOps or offline renders (`helm template`, Argo CD), set `sftp.hostKeySecret` +and the service token secret explicitly, because the chart cannot look up +existing Secrets there and would otherwise generate new values on every render. + +Check that the pod is running: + +```sh +kubectl -n gameplane get deploy gameplane-sftp +``` + +With `sftp.enabled` false (the default), the chart creates none of the SFTP +objects, and the profile page has no SFTP section. + +## Set up your credentials + +Each user manages their own SFTP access in the dashboard, under **Settings, +SFTP**. SSO users do too: there is no separate SFTP account to create. The page +shows: + +- the address and port, +- the two username forms (below), +- the host key fingerprint, so you can check the server you connect to, +- your SSH public keys, +- whether you have a generated password. + +**SSH keys.** Click **Add key** and paste one public key (one line, starting +with `ssh-ed25519`, `ecdsa-sha2-` or `ssh-rsa`). Keys must be ed25519, ECDSA +(nistp256, nistp384 or nistp521) or RSA with at least 3072 bits. You can keep up +to 20 keys. A key cannot be added to two accounts. Removing a key closes any +session that used it. + +**Generated password.** Click **Generate password**, choose a length from 20 to +40, and copy it. The password is shown once. Gameplane stores only a hash, so +it cannot be shown again. The password does not expire. + +You have one password at a time. **Regenerate** replaces it, and the old one +stops working at the next login. **Revoke** removes it and closes the sessions +that used it. + +The dashboard login password is never accepted by SFTP. + +## Connect + +Use the address and port from the profile page. Use one of your usernames +(see the next section) and either your key or your generated password. + +**`sftp` command:** + +```sh +sftp -P 2222 alice@files.example.com +sftp -P 2222 -i ~/.ssh/id_ed25519 alice@files.example.com +``` + +**FileZilla:** protocol **SFTP - SSH File Transfer Protocol**, host, port, +username, and either the password or a key file (Edit, Settings, SFTP, Add key +file). + +**WinSCP:** file protocol **SFTP**, host, port and username. Enter the password, +or choose a private key under **Advanced, Authentication**. + +The first time you connect, the client asks you to accept the host key. +Compare the fingerprint it shows with the one on your profile page. They must +match exactly, and it is in the `SHA256:` form. If they differ, do not log in: +someone else may be answering on that address, or the endpoint was rebuilt +with a new key. + +WinSCP and FileZilla upload to a temporary `*.filepart` name and rename the +file when it is complete. That works. + +## Usernames and what you see + +The username chooses where the session starts. + +- `alice` opens the root of the cluster endpoint. Servers in the default games + namespace appear as folders at the top, and servers in other namespaces + appear under `_namespaces//`. Example: `_namespaces/events/lobby`. +- `alice+survival` opens straight in the files of the server `survival` in the + default games namespace. +- `alice+events/lobby` opens straight in the files of `lobby` in the namespace + `events`. + +Both forms use the same password or key and the same permission checks. You +only see the servers you can read. + +Permissions: + +- Reading needs `servers:read` on the server, or the usual ownership or + collaborator access. +- Writing, renaming and deleting need `servers:write`, or ownership or + collaborator access, the same as in the Files tab. +- The root and the server folders are read-only over SFTP. You create, rename + and delete files inside a server, not the server folder itself. +- Dotfiles are never listed or created over SFTP. +- An SFTP session has no shell, no commands and no port forwarding. It only + moves files. + +A login that is refused for any reason (wrong password, revoked key, no access +to the server in the username, a disabled account) gets the same generic +refusal from the SFTP server. The client shows only a failed login. This is on +purpose, so a refusal does not reveal which servers exist. + +## Remote clusters + +Each cluster has its own SFTP endpoint. A remote cluster shows only its own +servers, so two clusters mean two addresses and two host keys. The same +credentials work on each endpoint, as long as the user can read the servers +there. + +An admin sets up a remote endpoint under **Clusters**, in the cluster's SFTP +drawer: + +1. Click **Create service token**. The token is shown once. Gameplane keeps + two active tokens per cluster at most, so revoke an old one before making a + third. +2. Install the chart on the remote cluster with SFTP on and the central panel + as its API: + + ```sh + helm upgrade gameplane charts/gameplane --reuse-values \ + --set sftp.enabled=true \ + --set sftp.apiURL=https://panel.example.com \ + --set sftp.serviceTokenSecret=gameplane-sftp-remote-token + ``` + + The Secret `gameplane-sftp-remote-token` must hold the token in its `token` + key. Add `sftp.apiCASecret` if the panel uses a private CA. +3. Set the endpoint address and host key fingerprint in the drawer, so the + users of that cluster see the right address. + +The remote endpoint sends each login and file operation to the central API, and +the API reaches the files through the remote gateway. The remote cluster must +be able to reach the central API over HTTPS. If it cannot, logins fail, and the +SFTP pod logs a clear message about the API. + +## Stopped and sleeping servers + +You can edit the files of a stopped server over SFTP, and the Files tab shows +them too. Gameplane starts a small file-only pod that mounts the server's +storage. The game does not start, and no player port opens. A sleeping server +is not woken up by browsing its files. + +- The first `ls` may take up to a minute while the pod starts. If the pod does + not come up in time, the request fails and you can retry. +- If you start the server while files are open, the SFTP session reports that + the server is starting. The game starts after the file-only pod is removed. +- The file-only pod is removed after `operator.filesIdleTimeout` (default + `10m`) without file access. + +## Revoking access + +Revoking a key, revoking or regenerating the password, disabling a user, or +deleting a user closes their open SFTP sessions. This happens within about 60 +seconds. New logins with the revoked credential fail straight away. + +Admins do this from the user's row in **Users**, with `users:manage`. + +## Troubleshooting + +**The connection is refused or times out.** Check that the Service has an +address (`kubectl -n gameplane get svc gameplane-sftp`), that the port is open +on your firewall or load balancer, and that `sftp.enabled` is true. + +**Login fails with the right password.** A password is replaced when +you regenerate it, so make sure you copied the newest one. Check that you can +read the server in the username. For `alice+survival`, `survival` must be in +the default games namespace. For `alice+events/lobby`, the namespace must be +spelled right. Check that the key is still on your profile. + +**Too many attempts.** The API limits logins per user and per source address. +Wait a minute and try again. + +**The host key changed warning.** Compare the fingerprint with your profile +page. If it differs, the endpoint's key changed, for example after the +`gameplane-sftp-host-key` Secret was deleted. Do not accept the new key until +an admin confirms it. + +**"Permission denied" on upload or rename.** You can read the server but do not +have `servers:write` on it, or the path is a server folder itself. Server +folders are read-only over SFTP. + +**An upload stops with "file too large".** The file is bigger than +`files.maxUploadSize`. Raise the value with `helm upgrade --reuse-values`. + +**Files of a stopped server do not appear.** Wait a minute and retry. If it keeps failing, +check that the `gameplane-files` pod in the games namespace is running. + +**The session closes on its own.** It was idle for longer than +`sftp.idleTimeout`, the key or password was revoked, or the server pod could +not be reached. The SFTP pod's logs show which. + +Logs: `kubectl -n gameplane logs deploy/gameplane-sftp`. Audit entries for SFTP +file changes show `source: sftp` in the audit log. + +## Related + +- [Security notes](security.md) for the threat model of optional components. +- [Install](install.md) for the full list of Helm values. +- The Files tab in the dashboard uses the same permissions and limits. diff --git a/go.work.sum b/go.work.sum index c08877678..ed368aec9 100644 --- a/go.work.sum +++ b/go.work.sum @@ -1277,6 +1277,7 @@ golang.org/x/net v0.53.0/go.mod h1:JvMuJH7rrdiCfbeHoo3fCQU24Lf5JJwT9W3sJFulfgs= golang.org/x/net v0.55.0/go.mod h1:L5U2KuzuOe1lY7Z+aWVIKK6qEeJXnXV9yzGA+WCHJww= golang.org/x/net v0.56.0/go.mod h1:D3Ku6r+V6JROoZK144D2XfMHFcMq/0zSfLelVTCFKec= golang.org/x/net v0.57.0/go.mod h1:KpXc8iv+r3XplLAG/f7Jsf9RPszJzdR0f58q9vGOuEU= +golang.org/x/net v0.58.0/go.mod h1:YwCddHnFlT7eLQqVprV19OnhLGtc5xOKgE0RyqgfWAU= golang.org/x/net v0.59.0/go.mod h1:2DA/G1UfVbCpQPeWTmMPGY7Cs2PkBkwu743bVX5PIVg= golang.org/x/net v0.60.0/go.mod h1:2DA/G1UfVbCpQPeWTmMPGY7Cs2PkBkwu743bVX5PIVg= golang.org/x/net v0.61.0/go.mod h1:WgDCOTH8iwtB66T4/GfI94AHo/hhdb7Hah9NDseQfiI= @@ -1375,6 +1376,7 @@ golang.org/x/sys v0.42.0/go.mod h1:4GL1E5IUh+htKOUEOaiffhrAeqysfVGipDYzABqnCmw= golang.org/x/sys v0.43.0/go.mod h1:4GL1E5IUh+htKOUEOaiffhrAeqysfVGipDYzABqnCmw= golang.org/x/sys v0.45.0/go.mod h1:4GL1E5IUh+htKOUEOaiffhrAeqysfVGipDYzABqnCmw= golang.org/x/sys v0.46.0/go.mod h1:4GL1E5IUh+htKOUEOaiffhrAeqysfVGipDYzABqnCmw= +golang.org/x/sys v0.47.0/go.mod h1:4GL1E5IUh+htKOUEOaiffhrAeqysfVGipDYzABqnCmw= golang.org/x/sys v0.48.0/go.mod h1:hNLxWAXmnKAxqDtdwIYC4bM9oQPEecfsnNMuSxOs3og= golang.org/x/telemetry v0.0.0-20251008203120-078029d740a8/go.mod h1:Pi4ztBfryZoJEkyFTI5/Ocsu2jXyDr6iSdgJiYE/uwE= golang.org/x/telemetry v0.0.0-20251203150158-8fff8a5912fc/go.mod h1:hKdjCMrbv9skySur+Nek8Hd0uJ0GuxJIoIX2payrIdQ= @@ -1387,6 +1389,7 @@ golang.org/x/telemetry v0.0.0-20261009151841-97e8ea77aa2a/go.mod h1:i+ivNqjDnTF3 golang.org/x/term v0.27.0 h1:WP60Sv1nlK1T6SupCHbXzSaN0b9wUmsPoRS9b61A23Q= golang.org/x/term v0.27.0/go.mod h1:iMsnZpn0cago0GOrHO2+Y7u7JPn5AylBrcoWkElMTSM= golang.org/x/term v0.37.0/go.mod h1:5pB4lxRNYYVZuTLmy8oR2BH8dflOR+IbTYFD8fi3254= +golang.org/x/term v0.45.0/go.mod h1:9aqxs0blBcrm/n0L9QW0aRVD+ktan8ssZromtqJC43w= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= diff --git a/hack/auto_label.py b/hack/auto_label.py index 6b091ca03..766e6d164 100755 --- a/hack/auto_label.py +++ b/hack/auto_label.py @@ -58,6 +58,7 @@ "sentinel": "area: optional-components", "capture-sidecar": "area: optional-components", "mcp-server": "area: optional-components", + "sftp": "area: optional-components", "tunnel": "area: optional-components", "audit-syslog-bridge": "area: optional-components", "telemetry-receiver": "area: optional-components", diff --git a/hack/ci_scope.py b/hack/ci_scope.py index 24bf1ead0..c47bebbef 100644 --- a/hack/ci_scope.py +++ b/hack/ci_scope.py @@ -14,7 +14,7 @@ EDGE_IMAGES = [ {"component": component} for component in ( "operator", "api", "web", "agent", "audit-syslog-bridge", - "telemetry-receiver", "sentinel", "capture-sidecar", "mcp-server", + "telemetry-receiver", "sentinel", "capture-sidecar", "mcp-server", "sftp", ) ] + [ {"component": f"tunnel-{name}", "dockerfile": f"tunnel/Dockerfile.{name}"} @@ -29,8 +29,8 @@ FORCE_ALL_PREFIXES = (".github/actions/",) # Mirrors the e2e-go matrix buckets in .github/workflows/ci.yaml. E2E_BUCKETS = ["operator", "api-auth", "api-roles", "api-rbac", "api-agent", "api-mods", - "telemetry", "optional-components", "restricted-workloads", "wake-hostport", "network-isolation", "management-placement", "backup-preparation", "monitoring", "recovery", "standalone"] -E2E_AMD64_ONLY = {"wake-hostport", "network-isolation", "management-placement", "backup-preparation", "monitoring", "recovery", "standalone"} + "telemetry", "optional-components", "restricted-workloads", "wake-hostport", "network-isolation", "management-placement", "backup-preparation", "monitoring", "recovery", "standalone", "sftp"] +E2E_AMD64_ONLY = {"wake-hostport", "network-isolation", "management-placement", "backup-preparation", "monitoring", "recovery", "standalone", "sftp"} SUITES_FILE = "test/e2e/suite-components.json" # Paths no Go e2e test reads. Their own jobs keep their paths-filter gates. NO_E2E_FILES = { diff --git a/i18n/locales/en/app.json b/i18n/locales/en/app.json index 7d2befa4d..1bd5dcc07 100644 --- a/i18n/locales/en/app.json +++ b/i18n/locales/en/app.json @@ -943,6 +943,10 @@ "defaultMessage": "empty body", "description": "API error when a route that expects a JSON body receives none." }, + "server.files.starting": { + "defaultMessage": "files are starting, try again in a moment", + "description": "API error when a stopped or asleep server's file-only pod is not ready within 60 s (ws/ensure_files.go:ensureFiles); retry after a short wait." + }, "server.forbidden": { "defaultMessage": "forbidden", "description": "API error when the caller, or the API's service identity in Kubernetes, is not allowed to perform the operation." @@ -1147,6 +1151,70 @@ "defaultMessage": "root values (user 0, group 0, filesystem group 0, or the image default for user or group) are not allowed on this cluster until an administrator allows root overrides in that cluster's Configuration", "description": "API error from the GameServer save path when a new or changed root value is saved while the cluster's allow-root-overrides setting is off. Argument setting names the first offending setting." }, + "server.sftp.endpoint_invalid": { + "defaultMessage": "address must be a host or host:port", + "description": "API error when the SFTP endpoint address of a remote cluster is not a host or host:port (sftp_cluster.go:putEndpoint)." + }, + "server.sftp.endpoint_local": { + "defaultMessage": "this cluster's SFTP endpoint is set in the chart values", + "description": "API error when an admin tries to set the SFTP endpoint of the panel's own cluster through the API (sftp_cluster.go:putEndpoint)." + }, + "server.sftp.fingerprint_invalid": { + "defaultMessage": "host key fingerprint must be a SHA256 fingerprint", + "description": "API error when the SFTP host key fingerprint of a remote cluster is not an OpenSSH SHA256 fingerprint (sftp_cluster.go:putEndpoint)." + }, + "server.sftp.key_duplicate": { + "defaultMessage": "this key is already registered", + "description": "API error when an SFTP public key is already registered. It never says to whom (sftp.go:writeSFTPErr)." + }, + "server.sftp.key_invalid": { + "defaultMessage": "not a valid SSH public key", + "description": "API error when an SFTP public key cannot be parsed as one authorized_keys line (sftp.go:writeSFTPErr)." + }, + "server.sftp.key_limit_reached": { + "defaultMessage": "you already have 20 SFTP keys; remove one before adding another", + "description": "API error when a user already holds the maximum of 20 SFTP keys (sftp.go:writeSFTPErr)." + }, + "server.sftp.key_name_in_use": { + "defaultMessage": "a key with this name already exists", + "description": "API error when the user already has an SFTP key with the same name (sftp.go:writeSFTPErr)." + }, + "server.sftp.key_name_invalid": { + "defaultMessage": "name must be 1 to 64 characters", + "description": "API error when an SFTP key name is empty or longer than 64 characters (sftp.go:writeSFTPErr)." + }, + "server.sftp.key_not_found": { + "defaultMessage": "SFTP key not found", + "description": "API error when an SFTP key to delete does not exist or belongs to another user (sftp.go:writeSFTPErr)." + }, + "server.sftp.key_type_unsupported": { + "defaultMessage": "unsupported key type; use ed25519, ecdsa or RSA 3072 bits or more", + "description": "API error when an SFTP public key uses an unsupported algorithm (sftp.go:writeSFTPErr)." + }, + "server.sftp.key_weak": { + "defaultMessage": "RSA keys must be at least 3072 bits", + "description": "API error when an SFTP RSA public key is shorter than 3072 bits (sftp.go:writeSFTPErr)." + }, + "server.sftp.login_failed": { + "defaultMessage": "sftp login failed", + "description": "API error from the SFTP login (sftp_login.go:login) for every refusal cause; the body is identical whatever failed." + }, + "server.sftp.password_length_invalid": { + "defaultMessage": "length must be 20 to 40", + "description": "API error when a generated SFTP password length is outside 20 to 40 (sftp.go:writeSFTPErr)." + }, + "server.sftp.password_not_found": { + "defaultMessage": "no SFTP password is set", + "description": "API error when the user revokes an SFTP password that is not set (sftp.go:revokePassword)." + }, + "server.sftp.token_limit_reached": { + "defaultMessage": "this cluster already has 2 active SFTP tokens; revoke one before creating another", + "description": "API error when a cluster already holds the maximum of 2 active SFTP service tokens (sftp_cluster.go:createToken)." + }, + "server.sftp.token_not_found": { + "defaultMessage": "SFTP token not found", + "description": "API error when an SFTP service token to revoke does not exist, is already revoked, or belongs to another cluster (sftp_cluster.go:revokeToken)." + }, "server.shares.expires_at_in_past": { "defaultMessage": "expiresAt must be in the future", "description": "API error from the share-links API (shares.go:createShareHandler)." @@ -4115,6 +4183,226 @@ "defaultMessage": "Working…", "description": "Wipe server dialog: submit button label while the wipe runs" }, + "web.components.sftp.add_key": { + "defaultMessage": "Add key", + "description": "SFTP add-key dialog: submit button label; keep it short" + }, + "web.components.sftp.add_key_failed": { + "defaultMessage": "Could not add the key.", + "description": "SFTP add-key dialog: fallback error when the server gives no message" + }, + "web.components.sftp.add_ssh_key": { + "defaultMessage": "Add SSH key", + "description": "SFTP add-key dialog: heading and the title of the dialog" + }, + "web.components.sftp.cancel": { + "defaultMessage": "Cancel", + "description": "SFTP dialogs: button that closes the dialog without changes; keep it short" + }, + "web.components.sftp.characters": { + "defaultMessage": "{count} characters", + "description": "SFTP shown-once dialog: password length; {count} is a number" + }, + "web.components.sftp.cluster_drawer.address": { + "defaultMessage": "Address", + "description": "Cluster SFTP drawer: label for the SFTP address field (host or host:port)" + }, + "web.components.sftp.cluster_drawer.address_placeholder": { + "defaultMessage": "sftp.example.com:2222", + "description": "Cluster SFTP drawer: example value shown inside the empty address field; a sample, not a default" + }, + "web.components.sftp.cluster_drawer.cancel": { + "defaultMessage": "Cancel", + "description": "Cluster SFTP drawer: button that closes the drawer without further changes; keep it short" + }, + "web.components.sftp.cluster_drawer.copied": { + "defaultMessage": "Copied", + "description": "Cluster SFTP token shown-once dialog: button label after the token was copied" + }, + "web.components.sftp.cluster_drawer.copy": { + "defaultMessage": "Copy", + "description": "Cluster SFTP token shown-once dialog: button that copies the token to the clipboard; keep it short" + }, + "web.components.sftp.cluster_drawer.create_failed": { + "defaultMessage": "The token could not be created.", + "description": "Cluster SFTP drawer: fallback error when creating an endpoint token fails" + }, + "web.components.sftp.cluster_drawer.create_token": { + "defaultMessage": "Create token", + "description": "Cluster SFTP drawer: button that creates a new endpoint token; disabled at the token limit; keep it short" + }, + "web.components.sftp.cluster_drawer.created_description": { + "defaultMessage": "Copy it now. Gameplane stores only a hash and cannot show it again.", + "description": "Cluster SFTP token shown-once dialog: instruction under the heading" + }, + "web.components.sftp.cluster_drawer.created_title": { + "defaultMessage": "Endpoint token created", + "description": "Cluster SFTP token shown-once dialog: heading" + }, + "web.components.sftp.cluster_drawer.created_warning": { + "defaultMessage": "You will not see this again. Put it in the remote cluster's SFTP secret before you close this dialog.", + "description": "Cluster SFTP token shown-once dialog: warning that the token cannot be shown again and must go into the remote cluster's SFTP secret" + }, + "web.components.sftp.cluster_drawer.description": { + "defaultMessage": "Users connect to this address with their own SSH key or SFTP password. Their permissions on this cluster decide what they can reach.", + "description": "Cluster SFTP drawer: explains that users connect to the address and their cluster permissions decide what they reach" + }, + "web.components.sftp.cluster_drawer.done": { + "defaultMessage": "Done", + "description": "Cluster SFTP token shown-once dialog: button that closes the dialog; keep it short" + }, + "web.components.sftp.cluster_drawer.host_key_fingerprint": { + "defaultMessage": "Host key fingerprint (from the cluster registration)", + "description": "Cluster SFTP drawer: label for the host key fingerprint field; the value comes from the cluster registration" + }, + "web.components.sftp.cluster_drawer.last_used": { + "defaultMessage": "Last used {time}", + "description": "Cluster SFTP drawer: when a token was last used; {time} is a relative time" + }, + "web.components.sftp.cluster_drawer.limit_message": { + "defaultMessage": "This cluster already has the maximum of {limit} active tokens. Revoke one token before you can create another.", + "description": "Cluster SFTP drawer: warning shown when the cluster has the maximum number of active tokens; {limit} is a number" + }, + "web.components.sftp.cluster_drawer.load_failed": { + "defaultMessage": "Could not load the SFTP endpoint.", + "description": "Cluster SFTP drawer: error when the cluster's SFTP endpoint cannot be loaded" + }, + "web.components.sftp.cluster_drawer.loading": { + "defaultMessage": "Loading…", + "description": "Cluster SFTP drawer: loading text" + }, + "web.components.sftp.cluster_drawer.local_note": { + "defaultMessage": "This is the panel's own cluster. Its address comes from the chart and its host key fingerprint from the panel's host key.", + "description": "Cluster SFTP drawer: note for the panel's own cluster, whose endpoint is read-only and comes from the chart and host key" + }, + "web.components.sftp.cluster_drawer.never_used": { + "defaultMessage": "Never used", + "description": "Cluster SFTP drawer: a token that has never been used" + }, + "web.components.sftp.cluster_drawer.no_tokens": { + "defaultMessage": "No active tokens.", + "description": "Cluster SFTP drawer: shown when the cluster has no active endpoint token" + }, + "web.components.sftp.cluster_drawer.revoke": { + "defaultMessage": "Revoke", + "description": "Cluster SFTP drawer: button that revokes one endpoint token; keep it short" + }, + "web.components.sftp.cluster_drawer.revoke_failed": { + "defaultMessage": "The token could not be revoked.", + "description": "Cluster SFTP drawer: fallback error when revoking an endpoint token fails" + }, + "web.components.sftp.cluster_drawer.save_endpoint": { + "defaultMessage": "Save endpoint", + "description": "Cluster SFTP drawer: button that saves the cluster's SFTP address and host key fingerprint; keep it short" + }, + "web.components.sftp.cluster_drawer.save_failed": { + "defaultMessage": "The endpoint could not be saved.", + "description": "Cluster SFTP drawer: fallback error when saving the endpoint fails" + }, + "web.components.sftp.cluster_drawer.title": { + "defaultMessage": "SFTP · {cluster}", + "description": "Cluster SFTP drawer: heading; {cluster} is the cluster display name" + }, + "web.components.sftp.cluster_drawer.token_limit_hint": { + "defaultMessage": "A cluster can have at most {limit} active tokens. Revoking a token stops that endpoint from logging users in.", + "description": "Cluster SFTP drawer: explains the per-cluster token limit and what revoking does; {limit} is a number" + }, + "web.components.sftp.cluster_drawer.token_meta": { + "defaultMessage": "Created {created} · {lastUsed}", + "description": "Cluster SFTP drawer: when an endpoint token was created and when it was last used; {created} and {lastUsed} are relative times" + }, + "web.components.sftp.cluster_drawer.token_use_hint": { + "defaultMessage": "Used only by this cluster's SFTP server to reach the central API. Never give these to users.", + "description": "Cluster SFTP drawer: explains that endpoint tokens are for the cluster's SFTP server only" + }, + "web.components.sftp.cluster_drawer.tokens_heading": { + "defaultMessage": "Endpoint tokens · {count} of {limit} in use", + "description": "Cluster SFTP drawer: heading of the endpoint token list with the active count and the per-cluster limit; {count} and {limit} are numbers" + }, + "web.components.sftp.copied": { + "defaultMessage": "Copied", + "description": "SFTP shown-once dialog: button label after the password was copied" + }, + "web.components.sftp.copy": { + "defaultMessage": "Copy", + "description": "SFTP shown-once dialog: button that copies the password to the clipboard; keep it short" + }, + "web.components.sftp.copy_it_now": { + "defaultMessage": "Copy it now. Gameplane stores only a hash and cannot show it again.", + "description": "SFTP shown-once dialog: instruction under the heading" + }, + "web.components.sftp.done": { + "defaultMessage": "Done", + "description": "SFTP dialogs: button that closes the dialog; keep it short" + }, + "web.components.sftp.each_character_is_drawn": { + "defaultMessage": "Each character is drawn at random from the 94 printable ASCII characters (no spaces) with a cryptographically secure generator.", + "description": "SFTP generate dialog: explains how the password is generated" + }, + "web.components.sftp.fingerprint_placeholder": { + "defaultMessage": "SHA256:", + "description": "Cluster SFTP drawer: placeholder in the host key fingerprint field; the fingerprint format prefix, keep as is" + }, + "web.components.sftp.generate": { + "defaultMessage": "Generate", + "description": "SFTP generate dialog: submit button label; keep it short" + }, + "web.components.sftp.generate_failed": { + "defaultMessage": "Could not generate a password.", + "description": "SFTP generate dialog: fallback error when the server gives no message" + }, + "web.components.sftp.generate_sftp_password": { + "defaultMessage": "Generate SFTP password", + "description": "SFTP generate dialog: heading and the title of the dialog" + }, + "web.components.sftp.key_name_type": { + "defaultMessage": "{name} · {type}", + "description": "Admin SFTP access drawer: an SSH key row, its name then its key type" + }, + "web.components.sftp.laptop": { + "defaultMessage": "laptop", + "description": "SFTP add-key dialog: example key name shown in the empty name field; a sample name, not a default value" + }, + "web.components.sftp.length": { + "defaultMessage": "Length", + "description": "SFTP generate dialog: label of the password length slider" + }, + "web.components.sftp.length_characters": { + "defaultMessage": "{count} characters", + "description": "SFTP generate dialog: the chosen password length; {count} is a number" + }, + "web.components.sftp.name": { + "defaultMessage": "Name", + "description": "SFTP add-key dialog: label above the key name field" + }, + "web.components.sftp.paste_one_line_from_your_pub": { + "defaultMessage": "Paste one line from your .pub file. Ed25519, ECDSA and RSA keys are accepted.", + "description": "SFTP add-key dialog: hint under the public key box listing the accepted key types" + }, + "web.components.sftp.paste_one_openssh_public_key": { + "defaultMessage": "Paste one OpenSSH public key.", + "description": "SFTP add-key dialog: instruction under the heading" + }, + "web.components.sftp.public_key": { + "defaultMessage": "Public key", + "description": "SFTP add-key dialog: label above the public key text box" + }, + "web.components.sftp.public_key_placeholder": { + "defaultMessage": "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIN7d... laptop", + "description": "SFTP add-key dialog: example public key in the empty key box; keep the key text, only the trailing name may be translated" + }, + "web.components.sftp.replaces_your_current_password": { + "defaultMessage": "Replaces your current password.", + "description": "SFTP generate dialog: note that the new password replaces the existing one" + }, + "web.components.sftp.you_will_not_see_this_again": { + "defaultMessage": "You will not see this again. Store it in a password manager before you close this dialog.", + "description": "SFTP shown-once dialog: warning that the password cannot be shown again" + }, + "web.components.sftp.your_sftp_password": { + "defaultMessage": "Your SFTP password", + "description": "SFTP shown-once dialog: heading" + }, "web.components.ui.admin.edit_user_dialog.cancel": { "defaultMessage": "Cancel", "description": "Edit user dialog: button that closes the dialog without saving; keep it short" @@ -4347,6 +4635,66 @@ "defaultMessage": "Used when no rule matches. Users whose role was set by hand are always let in.", "description": "Role rules editor: hint under the fallback role dropdown" }, + "web.components.ui.admin.sftp_access_drawer.action_failed": { + "defaultMessage": "The change could not be saved.", + "description": "Admin SFTP drawer: fallback error when a remove or revoke fails" + }, + "web.components.ui.admin.sftp_access_drawer.description": { + "defaultMessage": "Remove a key or revoke the password. The user keeps their account.", + "description": "Admin SFTP drawer: explains that the admin removes keys or revokes the password and the account stays" + }, + "web.components.ui.admin.sftp_access_drawer.done": { + "defaultMessage": "Done", + "description": "Admin SFTP drawer: button that closes the drawer; keep it short" + }, + "web.components.ui.admin.sftp_access_drawer.key_added_last_used": { + "defaultMessage": "Added {added} · {lastUsed}", + "description": "Admin SFTP drawer: when a key was added and last used; {added} and {lastUsed} are relative times" + }, + "web.components.ui.admin.sftp_access_drawer.load_failed": { + "defaultMessage": "Could not load SFTP access.", + "description": "Admin SFTP drawer: error when the user's SFTP credentials cannot be loaded" + }, + "web.components.ui.admin.sftp_access_drawer.loading": { + "defaultMessage": "Loading…", + "description": "Admin SFTP drawer: loading text" + }, + "web.components.ui.admin.sftp_access_drawer.never_used": { + "defaultMessage": "Never used", + "description": "Admin SFTP drawer: a key that has never logged in" + }, + "web.components.ui.admin.sftp_access_drawer.no_keys": { + "defaultMessage": "No SSH keys.", + "description": "Admin SFTP drawer: shown when the user has no SSH keys" + }, + "web.components.ui.admin.sftp_access_drawer.password": { + "defaultMessage": "Password", + "description": "Admin SFTP drawer: heading of the password section" + }, + "web.components.ui.admin.sftp_access_drawer.password_not_set": { + "defaultMessage": "Not set.", + "description": "Admin SFTP drawer: the user has no SFTP password" + }, + "web.components.ui.admin.sftp_access_drawer.password_set": { + "defaultMessage": "Set · Created {created} · {lastUsed}", + "description": "Admin SFTP drawer: password status line; {created} and {lastUsed} are relative times" + }, + "web.components.ui.admin.sftp_access_drawer.remove": { + "defaultMessage": "Remove", + "description": "Admin SFTP drawer: button that removes a user's SSH key or revokes the password; keep it short" + }, + "web.components.ui.admin.sftp_access_drawer.revoke": { + "defaultMessage": "Revoke", + "description": "Admin SFTP drawer: button that revokes the user's SFTP password; keep it short" + }, + "web.components.ui.admin.sftp_access_drawer.ssh_keys_count": { + "defaultMessage": "SSH keys ({count})", + "description": "Admin SFTP drawer: heading of the key list with the number of keys; {count} is a number" + }, + "web.components.ui.admin.sftp_access_drawer.title": { + "defaultMessage": "SFTP access · {username}", + "description": "Admin SFTP drawer: heading; {username} is the account name" + }, "web.components.ui.app_loading_skeleton.admin": { "defaultMessage": "Admin", "description": "App loading skeleton: placeholder heading above the admin group of navigation items while the page loads" @@ -4739,6 +5087,10 @@ "defaultMessage": "About", "description": "Settings nav: label of the About settings section" }, + "web.components.ui.settings_nav.account": { + "defaultMessage": "Account", + "description": "Settings nav: heading of the group of per-user settings (Theme, MCP tokens, SFTP); shown in uppercase" + }, "web.components.ui.settings_nav.authentication": { "defaultMessage": "Authentication", "description": "Settings nav: label of the Authentication settings section" @@ -4763,10 +5115,18 @@ "defaultMessage": "Notifications", "description": "Settings nav: label of the Notifications settings section" }, + "web.components.ui.settings_nav.server": { + "defaultMessage": "Server", + "description": "Settings nav: heading of the group of admin server settings; shown in uppercase" + }, "web.components.ui.settings_nav.settings_sections": { "defaultMessage": "Settings sections", "description": "Settings navigation: screen-reader name of the list of settings sections; not visible on screen" }, + "web.components.ui.settings_nav.sftp": { + "defaultMessage": "SFTP", + "description": "Settings nav: label of the personal SFTP access page; a protocol name, keep it as is" + }, "web.components.ui.settings_nav.telemetry": { "defaultMessage": "Telemetry", "description": "Settings nav: label of the Telemetry settings section" @@ -6891,6 +7251,14 @@ "defaultMessage": "Removes this panel's connection to the cluster. Running workloads remain on the cluster.", "description": "Clusters: text in the remove-cluster confirmation dialog saying the panel's connection is removed while running workloads stay on the cluster" }, + "web.routes.clusters.sftp": { + "defaultMessage": "SFTP", + "description": "Clusters: button on a cluster card that opens the cluster's SFTP endpoint drawer; shown only to users who can manage clusters; keep it short" + }, + "web.routes.clusters.sftp_for": { + "defaultMessage": "SFTP for {name}", + "description": "Clusters: accessible label of the SFTP button on a cluster card; {name} is the cluster display name" + }, "web.routes.clusters.view_nodes": { "defaultMessage": "View nodes", "description": "Clusters: button on a cluster card that opens the node inventory for that cluster; shown only when the user can view inventory; keep it short" @@ -8223,6 +8591,166 @@ "defaultMessage": "The page you're looking for doesn't exist or has moved.", "description": "Not found: explanation under the heading saying the page does not exist or has moved" }, + "web.routes.profile_sftp.add_key": { + "defaultMessage": "Add key", + "description": "SFTP page: button that opens the add SSH key dialog; keep it short" + }, + "web.routes.profile_sftp.copy": { + "defaultMessage": "Copy", + "description": "SFTP page: button that copies a value; keep it short" + }, + "web.routes.profile_sftp.copy_host": { + "defaultMessage": "Copy host", + "description": "SFTP page: button that copies the host name" + }, + "web.routes.profile_sftp.copy_host_key": { + "defaultMessage": "Copy host key", + "description": "SFTP page: button that copies the host key fingerprint" + }, + "web.routes.profile_sftp.description": { + "defaultMessage": "Your personal SFTP credentials for game server files. Admins can see and revoke them.", + "description": "SFTP page: description under the page title" + }, + "web.routes.profile_sftp.generate_password": { + "defaultMessage": "Generate password", + "description": "SFTP page: button that opens the generate password dialog; keep it short" + }, + "web.routes.profile_sftp.host": { + "defaultMessage": "Host", + "description": "SFTP page: label of the host name row" + }, + "web.routes.profile_sftp.host_key_sha256": { + "defaultMessage": "Host key (SHA256)", + "description": "SFTP page: label of the host key fingerprint row; SHA256 is a technical term" + }, + "web.routes.profile_sftp.key_added_last_used": { + "defaultMessage": "Added {added} · {lastUsed}", + "description": "SFTP page: when a key was added and when it was last used; {added} and {lastUsed} are relative times" + }, + "web.routes.profile_sftp.key_type_fingerprint": { + "defaultMessage": "{type} · {fingerprint}", + "description": "SFTP page: an SSH key row, its key type then its fingerprint" + }, + "web.routes.profile_sftp.load_failed": { + "defaultMessage": "Could not load your SFTP access.", + "description": "SFTP page: error shown when the credentials cannot be loaded" + }, + "web.routes.profile_sftp.loading": { + "defaultMessage": "Loading SFTP access…", + "description": "SFTP page: loading text shown while the credentials are fetched" + }, + "web.routes.profile_sftp.log_in_with_one_of": { + "defaultMessage": "Log in with one of these usernames and your SSH key or SFTP password.", + "description": "SFTP page: instruction above the username forms" + }, + "web.routes.profile_sftp.never_used": { + "defaultMessage": "Never used", + "description": "SFTP page: a key or password that has never logged in" + }, + "web.routes.profile_sftp.no_keys": { + "defaultMessage": "No SSH keys yet.", + "description": "SFTP page: shown when the user has no SSH keys" + }, + "web.routes.profile_sftp.not_enabled": { + "defaultMessage": "SFTP is not enabled on this cluster. An administrator can turn it on with the sftp.enabled Helm value. Your SSH keys and password are still managed here.", + "description": "SFTP page: shown when the cluster has no SFTP endpoint; sftp.enabled is a Helm value name, keep it as is" + }, + "web.routes.profile_sftp.password_help": { + "defaultMessage": "Shown once when generated and stored only as a hash. It never expires. Regenerating or revoking it stops the old password at once.", + "description": "SFTP page: explains the password is shown once, stored as a hash, never expires, and that regenerating or revoking stops the old one" + }, + "web.routes.profile_sftp.password_not_set": { + "defaultMessage": "Not set · You have no SFTP password yet", + "description": "SFTP page: password status when none is set" + }, + "web.routes.profile_sftp.password_not_set_help": { + "defaultMessage": "Generate one to log in with a password, or add an SSH key above. A password is shown once and never expires.", + "description": "SFTP page: explains how to get a password when none is set" + }, + "web.routes.profile_sftp.password_set": { + "defaultMessage": "Set · Created {created} · {lastUsed}", + "description": "SFTP page: password status line; {created} and {lastUsed} are relative times" + }, + "web.routes.profile_sftp.port": { + "defaultMessage": "Port", + "description": "SFTP page: label of the port row" + }, + "web.routes.profile_sftp.public_keys_that_can_log_in": { + "defaultMessage": "Public keys that can log in over SFTP. Gameplane stores only the public part.", + "description": "SFTP page: explains that only public keys are stored" + }, + "web.routes.profile_sftp.regenerate": { + "defaultMessage": "Regenerate", + "description": "SFTP page: button that replaces the password with a new one; keep it short" + }, + "web.routes.profile_sftp.remove": { + "defaultMessage": "Remove", + "description": "SFTP page: button that removes an SSH key or revokes the password; keep it short" + }, + "web.routes.profile_sftp.remove_key_description": { + "defaultMessage": "Open SFTP sessions that use this key end within one minute. You can add it again later.", + "description": "SFTP page: explains what removing an SSH key does" + }, + "web.routes.profile_sftp.remove_key_question": { + "defaultMessage": "Remove SSH key?", + "description": "SFTP page: title of the confirm dialog that removes a key" + }, + "web.routes.profile_sftp.revoke": { + "defaultMessage": "Revoke", + "description": "SFTP page: button that revokes the SFTP password; keep it short" + }, + "web.routes.profile_sftp.revoke_password_description": { + "defaultMessage": "The password stops working at once and cannot be used again. Open SFTP sessions that use it end within one minute.", + "description": "SFTP page: explains what revoking the password does" + }, + "web.routes.profile_sftp.revoke_password_question": { + "defaultMessage": "Revoke SFTP password?", + "description": "SFTP page: title of the confirm dialog that revokes the password" + }, + "web.routes.profile_sftp.sftp_access": { + "defaultMessage": "SFTP access", + "description": "SFTP page: page title, at the top of the screen" + }, + "web.routes.profile_sftp.sftp_address": { + "defaultMessage": "SFTP address", + "description": "SFTP page: heading of the address card" + }, + "web.routes.profile_sftp.sftp_password": { + "defaultMessage": "SFTP password", + "description": "SFTP page: heading of the password card" + }, + "web.routes.profile_sftp.ssh_keys": { + "defaultMessage": "SSH keys", + "description": "SFTP page: heading of the SSH keys card" + }, + "web.routes.profile_sftp.use_these_settings": { + "defaultMessage": "Use these settings in any SFTP client. Check the host key matches the fingerprint your client shows on first connect.", + "description": "SFTP page: instruction under the address heading" + }, + "web.routes.profile_sftp.username": { + "defaultMessage": "Username", + "description": "SFTP page: heading of the username forms" + }, + "web.routes.profile_sftp.username_all_servers": { + "defaultMessage": "Lists every server you can read, one folder each", + "description": "SFTP page: explains the plain username form" + }, + "web.routes.profile_sftp.username_namespace": { + "defaultMessage": "Opens a server in another namespace (mods)", + "description": "SFTP page: explains the user+namespace/server username form; mods is an example namespace name" + }, + "web.routes.profile_sftp.username_namespace_form": { + "defaultMessage": "{username}+mods/'<'server'>'", + "description": "SFTP page: the user+namespace/server username form; mods is an example namespace, a placeholder" + }, + "web.routes.profile_sftp.username_one_server": { + "defaultMessage": "Opens straight in the files of that server", + "description": "SFTP page: explains the user+server username form" + }, + "web.routes.profile_sftp.username_server_form": { + "defaultMessage": "{username}+'<'server'>'", + "description": "SFTP page: the user+server username form; is a placeholder the user replaces with a server name" + }, "web.routes.server_detail.loading": { "defaultMessage": "Loading…", "description": "Server detail: loading text shown in the body of a tab while that tab's content is still loading" @@ -9023,6 +9551,10 @@ "defaultMessage": "Cancel", "description": "Files tab: button in the name prompt dialog that closes it without creating anything; keep it short" }, + "web.routes.tabs.files.cancel_all": { + "defaultMessage": "Cancel all", + "description": "Upload tray: cancels every waiting and running upload" + }, "web.routes.tabs.files.close_file": { "defaultMessage": "Close {path}", "description": "Close a file tab after saving its edits." @@ -9143,6 +9675,10 @@ "defaultMessage": "Refresh", "description": "Files tab: icon-only button that reloads the file list; read by screen readers; keep it short" }, + "web.routes.tabs.files.retry": { + "defaultMessage": "Retry", + "description": "Retry a failed action such as an upload or a files-starting request; keep it short" + }, "web.routes.tabs.files.root_crumb": { "defaultMessage": "/", "description": "Files: breadcrumb button that jumps to the server data root, shown as a slash" @@ -9163,10 +9699,82 @@ "defaultMessage": "{count} selected", "description": "Number of checked file paths." }, + "web.routes.tabs.files.starting_timed_out_detail": { + "defaultMessage": "Files did not start. Try again.", + "description": "Files tab: text under the heading when the file-only pod was not ready in time; the user can retry" + }, + "web.routes.tabs.files.starting_timed_out_nothing": { + "defaultMessage": "Nothing was started. The server stays stopped, and no file was changed.", + "description": "Files tab: reassurance after the files pod did not start; the server stays stopped and files are unchanged" + }, + "web.routes.tabs.files.starting_timed_out_title": { + "defaultMessage": "Files did not start", + "description": "Files tab: heading shown when the file-only pod was not ready in time" + }, "web.routes.tabs.files.upload": { "defaultMessage": "Upload", "description": "Files tab: button that uploads a file to the current folder; shows a spinner while the upload runs; keep it short" }, + "web.routes.tabs.files.upload_cancel": { + "defaultMessage": "Cancel", + "description": "Upload tray: cancels one upload" + }, + "web.routes.tabs.files.upload_cancelled": { + "defaultMessage": "Cancelled", + "description": "Upload tray row for a file the user cancelled" + }, + "web.routes.tabs.files.upload_connection_lost": { + "defaultMessage": "Connection to the server was lost. The old file is unchanged. Retry to upload again.", + "description": "Upload error: the connection dropped mid-upload; the previous file is kept and the user can retry" + }, + "web.routes.tabs.files.upload_done": { + "defaultMessage": "Done", + "description": "Upload tray row for a file that finished uploading" + }, + "web.routes.tabs.files.upload_failed": { + "defaultMessage": "Upload failed.", + "description": "Upload error when the cause is not known" + }, + "web.routes.tabs.files.upload_failed_at": { + "defaultMessage": "Failed at {percent}%", + "description": "Upload tray row for a failed file: whole percent sent before it failed" + }, + "web.routes.tabs.files.upload_no_space": { + "defaultMessage": "Not enough free space on the server", + "description": "Upload error: the server's volume has too little free space for the file" + }, + "web.routes.tabs.files.upload_note": { + "defaultMessage": "Uploads go straight to the server volume. Cancelling removes the part written so far, and the old file stays.", + "description": "Upload tray footnote explaining that uploads write directly to the volume and what cancelling does" + }, + "web.routes.tabs.files.upload_progress": { + "defaultMessage": "{loaded} of {total} · {percent}%", + "description": "Upload tray row while a file uploads: bytes sent, total size and whole percent" + }, + "web.routes.tabs.files.upload_too_large": { + "defaultMessage": "Larger than the upload limit", + "description": "Upload error: the file is larger than the server's upload limit, when the limit is not known" + }, + "web.routes.tabs.files.upload_too_large_limit": { + "defaultMessage": "Larger than the {limit} upload limit", + "description": "Upload error: the file is larger than the server's upload limit; {limit} is the limit with its unit, such as 20 GiB" + }, + "web.routes.tabs.files.upload_tray": { + "defaultMessage": "Upload progress", + "description": "Accessible name of the bottom-right tray that lists file uploads and their progress" + }, + "web.routes.tabs.files.upload_waiting": { + "defaultMessage": "Waiting", + "description": "Upload tray row for a file queued behind the one that is uploading" + }, + "web.routes.tabs.files.uploads_failed": { + "defaultMessage": "Uploads · {count} failed", + "description": "Upload tray title when every remaining upload has failed; {count} is the number of failed files" + }, + "web.routes.tabs.files.uploads_title": { + "defaultMessage": "Uploads · {count, plural, one {# file} other {# files}}", + "description": "Upload tray title with the number of files in the batch" + }, "web.routes.tabs.files.working": { "defaultMessage": "Working…", "description": "Files: label of the dialog submit button while the request is running" @@ -12139,6 +12747,10 @@ "defaultMessage": "Set new password", "description": "Users: submit button label in the reset-password dialog" }, + "web.routes.users.sftp_access": { + "defaultMessage": "SFTP access", + "description": "Users: menu item that opens the admin SFTP drawer for a user's keys and password; keep it short" + }, "web.routes.users.tab_count": { "defaultMessage": "({count})", "description": "Users: item count shown after a tab name; {count} is the number of items" diff --git a/operator/cmd/main.go b/operator/cmd/main.go index d8d0e2f87..73292a8f1 100644 --- a/operator/cmd/main.go +++ b/operator/cmd/main.go @@ -133,6 +133,8 @@ func main() { tunnelPlayitImage string restrictTunnelEgress bool agentLogLevel string + agentMaxUploadBytes int64 + filesIdleTimeout time.Duration agentCABundle string agentClientCert string agentClientKey string @@ -254,6 +256,10 @@ func main() { flag.StringVar(&agentLogLevel, "agent-log-level", "", "Log level (debug, info, warn, or error) injected into agent sidecars as GAMEPLANE_LOG_LEVEL. "+ "Empty injects nothing (the agent defaults to info) and avoids rolling existing pods.") + flag.DurationVar(&filesIdleTimeout, "files-idle-timeout", controller.DefaultFilesIdleTimeout, + "Remove a stopped server's file-only pod after this long without a file operation; must be positive.") + flag.Int64Var(&agentMaxUploadBytes, "agent-max-upload-bytes", 0, + "Per-upload size limit passed to every agent as --max-upload-bytes; 0 keeps the agent default (20 GiB).") flag.StringVar(&moduleNamespace, "module-namespace", "gameplane-system", "Namespace where ModuleSource credential Secrets live.") flag.StringVar(&moduleConfigMapNamespace, "module-configmap-namespace", "", @@ -325,6 +331,14 @@ func main() { opts := zap.Options{Development: true} opts.BindFlags(flag.CommandLine) flag.Parse() + if filesIdleTimeout <= 0 { + fmt.Fprintln(os.Stderr, "--files-idle-timeout must be positive") + os.Exit(1) + } + if agentMaxUploadBytes < 0 { + fmt.Fprintln(os.Stderr, "--agent-max-upload-bytes must not be negative") + os.Exit(1) + } if wakeStartLimit < 0 || wakeStartLimit > 128 { fmt.Fprintln(os.Stderr, "--wake-start-limit must be between 0 and 128") os.Exit(1) @@ -547,6 +561,8 @@ func main() { TunnelPlayitImage: tunnelPlayitImage, RestrictTunnelEgress: restrictTunnelEgress, AgentLogLevel: agentLogLevel, + AgentMaxUploadBytes: agentMaxUploadBytes, + FilesIdleTimeout: filesIdleTimeout, AgentCASecretName: agentCASecretName, AgentCASecretNamespace: agentCASecretNamespace, WakeStartLimit: wakeStartLimit, diff --git a/operator/config/rbac/role_namespace.yaml b/operator/config/rbac/role_namespace.yaml index a37b46aeb..a7dea376b 100644 --- a/operator/config/rbac/role_namespace.yaml +++ b/operator/config/rbac/role_namespace.yaml @@ -77,6 +77,11 @@ rules: - apiGroups: [""] resources: ["pods/ephemeralcontainers"] verbs: ["get", "patch", "update"] + # File-only pod for a stopped server (spec 040, gameserver_files.go): + # create and remove -files in this namespace only. + - apiGroups: [""] + resources: ["pods"] + verbs: ["create", "delete"] # Per-GameServer agent identity: SA + heartbeat Role/RoleBinding # (resourceNames-scoped to one GameServer's status subresource). # Granting gameservers/status passes the RBAC escalation check because diff --git a/operator/internal/controller/gameserver_controller.go b/operator/internal/controller/gameserver_controller.go index 662879fb3..6cf8c4012 100644 --- a/operator/internal/controller/gameserver_controller.go +++ b/operator/internal/controller/gameserver_controller.go @@ -90,6 +90,13 @@ type GameServerReconciler struct { // to info and existing StatefulSets don't roll on operator upgrade. AgentLogLevel string + // AgentMaxUploadBytes, when positive, is passed to every agent as + // --max-upload-bytes (Helm files.maxUploadSize). Zero keeps the agent default. + AgentMaxUploadBytes int64 + // FilesIdleTimeout is how long a stopped server's file-only pod lives + // after its last file operation. Zero or less uses DefaultFilesIdleTimeout. + FilesIdleTimeout time.Duration + // Auxiliary resources are complete install-level overrides. Nil uses the // built-in requests; a non-nil empty object explicitly clears them. AgentResources *corev1.ResourceRequirements @@ -594,6 +601,15 @@ func (r *GameServerReconciler) Reconcile(ctx context.Context, req ctrl.Request) logger.Error(err, "compute desired replicas") return ctrl.Result{}, err } + // A file-only pod must be gone before the game starts (spec 040 FR-013c). + // The hold may zero replicas while that pod drains; the pre-hold value + // says a start is pending, so the files pod is not recreated meanwhile. + startWanted := replicas > 0 + replicas, stopRequeue, err = r.holdStartForFilesPod(ctx, &gs, replicas, stopRequeue) + if err != nil { + logger.Error(err, "hold start for files pod") + return ctrl.Result{}, err + } if err := r.reconcileStatefulSet(ctx, &gs, &tmpl, ver, mc, replicas, &wipeState); err != nil { if apierrors.IsConflict(err) { return requeueOnConflict(ctrl.Result{}, err) @@ -601,6 +617,11 @@ func (r *GameServerReconciler) Reconcile(ctx context.Context, req ctrl.Request) logger.Error(err, "reconcile StatefulSet") return ctrl.Result{}, err } + filesRequeue, err := r.reconcileFilesPod(ctx, &gs, &tmpl, ver, replicas, startWanted) + if err != nil { + logger.Error(err, "reconcile files pod") + return ctrl.Result{}, err + } if err := r.reconcileModpackRollout(ctx, &gs); err != nil { if apierrors.IsConflict(err) { return requeueOnConflict(ctrl.Result{}, err) @@ -681,7 +702,7 @@ func (r *GameServerReconciler) Reconcile(ctx context.Context, req ctrl.Request) // the sleep deadline or the next wake window; take whichever comes first, // or nothing fires the transition until an unrelated event happens to // wake the reconciler. - hints := []time.Duration{stopRequeue, idleRequeue, recoveryRetry, modpackKeyRequeue(&gs)} + hints := []time.Duration{stopRequeue, idleRequeue, recoveryRetry, modpackKeyRequeue(&gs), filesRequeue} if _, held, _ := lifecycleOwner(&gs); held { hints = append(hints, 5*time.Second) } @@ -1333,17 +1354,26 @@ func (r *GameServerReconciler) reconcileAgentService( svc := &corev1.Service{ ObjectMeta: metav1.ObjectMeta{Name: gs.Name + "-agent", Namespace: gs.Namespace}, } - _, err := controllerutil.CreateOrUpdate(ctx, r.Client, svc, func() error { + // A file-only pod (spec 040) serves the agent while the server is stopped. + serving, err := r.filesPodServing(ctx, gs) + if err != nil { + return err + } + selector := map[string]string{ + "app.kubernetes.io/name": "gameplane-game", + "app.kubernetes.io/instance": gs.Name, + } + if serving { + selector = filesPodLabels(gs) + } + _, err = controllerutil.CreateOrUpdate(ctx, r.Client, svc, func() error { svc.Spec.Type = corev1.ServiceTypeClusterIP // The agent must be reachable while the game container is still // starting (console/files/logs during long world generation), so // don't gate endpoints on whole-pod readiness — the game's // readiness probe would otherwise hold the agent hostage. svc.Spec.PublishNotReadyAddresses = true - svc.Spec.Selector = map[string]string{ - "app.kubernetes.io/name": "gameplane-game", - "app.kubernetes.io/instance": gs.Name, - } + svc.Spec.Selector = selector svc.Spec.Ports = []corev1.ServicePort{ { Name: "agent", @@ -2096,7 +2126,9 @@ func (r *GameServerReconciler) reconcileStatefulSet( } ss.Spec.Template.Spec.Containers = []corev1.Container{ buildGameContainer(gs, tmpl, image, ver, mc), - buildAgentContainer(gs, tmpl, ver, r.AgentImage, r.AgentLogLevel, r.AgentImagePullPolicy, r.AgentResources), + withAgentTransferFlags( + buildAgentContainer(gs, tmpl, ver, r.AgentImage, r.AgentLogLevel, r.AgentImagePullPolicy, r.AgentResources), + r.AgentMaxUploadBytes, false), } volumes := []corev1.Volume{ { diff --git a/operator/internal/controller/gameserver_files.go b/operator/internal/controller/gameserver_files.go new file mode 100644 index 000000000..ab9c27de1 --- /dev/null +++ b/operator/internal/controller/gameserver_files.go @@ -0,0 +1,325 @@ +package controller + +import ( + "context" + "fmt" + "strconv" + "time" + + appsv1 "k8s.io/api/apps/v1" + corev1 "k8s.io/api/core/v1" + apierrors "k8s.io/apimachinery/pkg/api/errors" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/types" + "sigs.k8s.io/controller-runtime/pkg/controller/controllerutil" + + gameplanev1alpha1 "github.com/GameplanePanel/gameplane/operator/api/v1alpha1" +) + +// File-only pod (spec 040). While a server is stopped, the API asks for file +// access by stamping FilesRequestedAtAnnotation. The operator then runs a +// short-lived pod, -files, that carries the same data and mod volumes and +// the agent with --files-only. It never starts the game, never writes wake or +// idle state and is removed after FilesIdleTimeout without a file operation. +const ( + // FilesRequestedAtAnnotation holds an RFC 3339 timestamp written by the + // API on every file operation against a stopped server. + FilesRequestedAtAnnotation = "gameplane.local/files-requested-at" + // DefaultFilesIdleTimeout is how long a file-only pod outlives its last + // file operation when the operator sets no idle timeout. + DefaultFilesIdleTimeout = 10 * time.Minute + + filesPodNameSuffix = "-files" + filesPodGoneRequeue = 2 * time.Second +) + +// filesPodName is the name of the file-only pod for gs. +func filesPodName(gs *gameplanev1alpha1.GameServer) string { + return gs.Name + filesPodNameSuffix +} + +// filesPodLabels are the only labels on a file-only pod. They deliberately +// omit the game labels so no game Service, PodDisruptionBudget, NetworkPolicy +// or wake path selects it; only the -agent Service selects it, through +// reconcileAgentService. +func filesPodLabels(gs *gameplanev1alpha1.GameServer) map[string]string { + return map[string]string{ + "app.kubernetes.io/name": "gameplane-files", + "app.kubernetes.io/instance": gs.Name, + } +} + +// withAgentTransferFlags appends the optional per-agent flags (spec 040). +func withAgentTransferFlags(c corev1.Container, maxUploadBytes int64, filesOnly bool) corev1.Container { + if maxUploadBytes > 0 { + c.Args = append(c.Args, "--max-upload-bytes="+strconv.FormatInt(maxUploadBytes, 10)) + } + if filesOnly { + c.Args = append(c.Args, "--files-only") + } + return c +} + +// filesTimeout is the configured idle timeout, or the default when unset. +func (r *GameServerReconciler) filesTimeout() time.Duration { + if r.FilesIdleTimeout <= 0 { + return DefaultFilesIdleTimeout + } + return r.FilesIdleTimeout +} + +// filesRequestFresh reports whether a file operation was requested within +// timeout of now, and how long that window has left. An unparseable stamp, +// or one further in the future than timeout, is never fresh. +func filesRequestFresh(gs *gameplanev1alpha1.GameServer, now time.Time, timeout time.Duration) (bool, time.Duration) { + raw := gs.Annotations[FilesRequestedAtAnnotation] + if raw == "" { + return false, 0 + } + at, err := time.Parse(time.RFC3339, raw) + if err != nil || at.After(now.Add(timeout)) { + return false, 0 + } + age := max(now.Sub(at), 0) + if age >= timeout { + return false, 0 + } + return true, timeout - age +} + +// getFilesPod returns the file-only pod for gs, or nil when there is none. A +// pod with that name that gs does not control is an error: it is never +// adopted or deleted. +func (r *GameServerReconciler) getFilesPod(ctx context.Context, gs *gameplanev1alpha1.GameServer) (*corev1.Pod, error) { + var pod corev1.Pod + key := types.NamespacedName{Namespace: gs.Namespace, Name: filesPodName(gs)} + if err := r.Get(ctx, key, &pod); err != nil { + if apierrors.IsNotFound(err) { + return nil, nil + } + return nil, fmt.Errorf("get files pod: %w", err) + } + if !metav1.IsControlledBy(&pod, gs) { + return nil, fmt.Errorf("pod %s exists and is not controlled by this GameServer", key.Name) + } + return &pod, nil +} + +// filesPodServing reports whether the file-only pod exists and is not +// terminating, which is when the -agent Service routes to it. +func (r *GameServerReconciler) filesPodServing(ctx context.Context, gs *gameplanev1alpha1.GameServer) (bool, error) { + pod, err := r.getFilesPod(ctx, gs) + if err != nil { + return false, err + } + return pod != nil && pod.DeletionTimestamp == nil, nil +} + +// filesSafeToMount reports whether no backup, restore, wipe or rollout owner +// may be using the server's volumes, so a file-only pod can mount them. +func filesSafeToMount(gs *gameplanev1alpha1.GameServer) bool { + if gs.Annotations[restoreGuardAnnotation] != "" || gs.Annotations[wipeGuardAnnotation] != "" || pendingWipe(gs) { + return false + } + _, held, err := lifecycleOwner(gs) + return !held && err == nil +} + +// buildFilesPod renders the file-only pod. It runs the agent with --files-only +// and mounts only the data volume, the agent TLS Secret and the active mod +// volume. The RCON password and mod-portal credentials are left out, and so +// is the service-account token, since no heartbeat runs in this pod. +func (r *GameServerReconciler) buildFilesPod( + gs *gameplanev1alpha1.GameServer, tmpl *gameplanev1alpha1.GameTemplate, ver *gameplanev1alpha1.GameVersion, +) (*corev1.Pod, error) { + c := withAgentTransferFlags( + buildAgentContainer(gs, tmpl, ver, r.AgentImage, r.AgentLogLevel, r.AgentImagePullPolicy, r.AgentResources), + r.AgentMaxUploadBytes, true) + keep := map[string]bool{"data": true, "agent-tls": true} + if m := modVolumeMount(tmpl, ver); m != nil { + keep[m.Name] = true + } + var mounts []corev1.VolumeMount + for _, m := range c.VolumeMounts { + if keep[m.Name] { + mounts = append(mounts, m) + } + } + c.VolumeMounts = mounts + + volumes := []corev1.Volume{ + { + Name: "data", + VolumeSource: corev1.VolumeSource{ + PersistentVolumeClaim: &corev1.PersistentVolumeClaimVolumeSource{ClaimName: gs.Name + "-data"}, + }, + }, + { + Name: "agent-tls", + VolumeSource: corev1.VolumeSource{ + Secret: &corev1.SecretVolumeSource{SecretName: agentTLSSecretName(gs)}, + }, + }, + } + if v := modVolume(gs, tmpl, ver); v != nil { + volumes = append(volumes, *v) + } + + sec := gamePodSecurityContext(tmpl) + if sec == nil { + sec = &corev1.PodSecurityContext{} + } + pod := &corev1.Pod{ + ObjectMeta: metav1.ObjectMeta{ + Name: filesPodName(gs), + Namespace: gs.Namespace, + Labels: filesPodLabels(gs), + }, + Spec: corev1.PodSpec{ + Containers: []corev1.Container{c}, + Volumes: volumes, + AutomountServiceAccountToken: ptrTo(false), + RestartPolicy: corev1.RestartPolicyAlways, + TerminationGracePeriodSeconds: ptrTo(int64(5)), + SecurityContext: sec, + }, + } + pod.Spec.NodeSelector, pod.Spec.Tolerations = r.GameWorkloadPolicy.placement(gs, tmpl) + if r.RestrictedWorkloads { + sec.RunAsNonRoot = ptrTo(true) + sec.SeccompProfile = &corev1.SeccompProfile{Type: corev1.SeccompProfileTypeRuntimeDefault} + pod.Annotations = map[string]string{workloadSecurityLabel: "restricted"} + } + if err := controllerutil.SetControllerReference(gs, pod, r.Scheme); err != nil { + return nil, fmt.Errorf("set files pod owner: %w", err) + } + return pod, nil +} + +// reconcileFilesPod keeps the file-only pod in step with the server. It exists +// only while the server has no replicas, a file operation is still inside the +// idle timeout, and no lifecycle owner holds the volumes. It is created only +// after the game pod is gone, because the data volume is ReadWriteOnce. It +// returns how long until the idle timeout could expire, or zero. +// +// startWanted is the replica count before holdStartForFilesPod ran. When a +// start is wanted, replicas may already be zero only because the hold is +// waiting for the files pod to drain, so no file-only pod is created then. +func (r *GameServerReconciler) reconcileFilesPod( + ctx context.Context, gs *gameplanev1alpha1.GameServer, tmpl *gameplanev1alpha1.GameTemplate, + ver *gameplanev1alpha1.GameVersion, replicas int32, startWanted bool, +) (time.Duration, error) { + pod, err := r.getFilesPod(ctx, gs) + if err != nil { + return 0, err + } + fresh, remaining := filesRequestFresh(gs, time.Now(), r.filesTimeout()) + if replicas != 0 || startWanted || !fresh || !filesSafeToMount(gs) { + stale := &corev1.Pod{ObjectMeta: metav1.ObjectMeta{Name: filesPodName(gs), Namespace: gs.Namespace}} + if err := r.deleteIfControlledBy(ctx, gs, stale); err != nil { + return 0, fmt.Errorf("delete files pod: %w", err) + } + if err := r.reconcileAgentService(ctx, gs); err != nil { + return 0, err + } + return 0, nil + } + + if pod != nil { + // Still terminating: the volume must not be shared until the pod is + // gone, so wait rather than create a replacement. + if pod.DeletionTimestamp != nil { + return filesPodGoneRequeue, nil + } + if pod.Status.Phase == corev1.PodFailed || pod.Status.Phase == corev1.PodSucceeded { + if err := r.deleteIfControlledBy(ctx, gs, pod); err != nil { + return 0, fmt.Errorf("delete finished files pod: %w", err) + } + return filesPodGoneRequeue, nil + } + } else { + // The game pod must be fully gone before a second pod mounts the + // ReadWriteOnce data volume (FR-013c). Read it live, not from cache. + var game corev1.Pod + err := r.wipeReader().Get(ctx, types.NamespacedName{Namespace: gs.Namespace, Name: gs.Name + "-0"}, &game) + if err == nil { + return filesPodGoneRequeue, nil + } + if !apierrors.IsNotFound(err) { + return 0, fmt.Errorf("get game pod: %w", err) + } + fp, err := r.buildFilesPod(gs, tmpl, ver) + if err != nil { + return 0, err + } + if err := r.Create(ctx, fp); err != nil { + if apierrors.IsAlreadyExists(err) { + return time.Second, nil + } + return 0, fmt.Errorf("create files pod: %w", err) + } + } + if err := r.reconcileAgentService(ctx, gs); err != nil { + return 0, err + } + // Nothing else wakes the reconciler when the idle window closes, so + // requeue just past its end. A new file operation rewrites the stamp. + return remaining + time.Second, nil +} + +// holdStartForFilesPod keeps a scale-up waiting until the file-only pod is gone +// (FR-013c). The caller passes the replicas it computed, so the hold is a +// no-op unless a file-only pod exists. +func (r *GameServerReconciler) holdStartForFilesPod( + ctx context.Context, gs *gameplanev1alpha1.GameServer, replicas int32, requeue time.Duration, +) (int32, time.Duration, error) { + if replicas <= 0 { + return replicas, requeue, nil + } + // A file-only pod can exist only after a file operation stamped the + // server, so servers that never used files pay no extra read. + if gs.Annotations[FilesRequestedAtAnnotation] == "" { + return replicas, requeue, nil + } + // Read live: a pod created moments ago may not be in the cache yet, and + // starting the game beside it would share the ReadWriteOnce volume. + var pod *corev1.Pod + var live corev1.Pod + key := types.NamespacedName{Namespace: gs.Namespace, Name: filesPodName(gs)} + switch err := r.wipeReader().Get(ctx, key, &live); { + case err == nil: + if !metav1.IsControlledBy(&live, gs) { + return 0, 0, fmt.Errorf("pod %s exists and is not controlled by this GameServer", key.Name) + } + pod = &live + case !apierrors.IsNotFound(err): + return 0, 0, fmt.Errorf("get files pod: %w", err) + } + if pod == nil { + return replicas, requeue, nil + } + if err := r.deleteIfControlledBy(ctx, gs, pod); err != nil { + return 0, 0, fmt.Errorf("delete files pod before start: %w", err) + } + if err := r.reconcileAgentService(ctx, gs); err != nil { + return 0, 0, err + } + live = corev1.Pod{} + switch err := r.wipeReader().Get(ctx, key, &live); { + case apierrors.IsNotFound(err): + return replicas, requeue, nil + case err != nil: + return 0, 0, fmt.Errorf("get files pod: %w", err) + } + // The pod object still exists (terminating), so the volume is still in + // use. A StatefulSet that is already running is never scaled to zero here. + var ss appsv1.StatefulSet + err := r.wipeReader().Get(ctx, types.NamespacedName{Namespace: gs.Namespace, Name: gs.Name}, &ss) + if err != nil && !apierrors.IsNotFound(err) { + return 0, 0, fmt.Errorf("get StatefulSet: %w", err) + } + if err == nil && ss.Spec.Replicas != nil && *ss.Spec.Replicas > 0 { + return replicas, requeue, nil + } + return 0, filesPodGoneRequeue, nil +} diff --git a/operator/internal/controller/gameserver_files_envtest_test.go b/operator/internal/controller/gameserver_files_envtest_test.go new file mode 100644 index 000000000..6f6e0a299 --- /dev/null +++ b/operator/internal/controller/gameserver_files_envtest_test.go @@ -0,0 +1,364 @@ +//go:build envtest + +package controller + +import ( + "context" + "testing" + "time" + + appsv1 "k8s.io/api/apps/v1" + corev1 "k8s.io/api/core/v1" + apierrors "k8s.io/apimachinery/pkg/api/errors" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/types" + "k8s.io/client-go/util/retry" + "sigs.k8s.io/controller-runtime/pkg/manager" + + gameplanev1alpha1 "github.com/GameplanePanel/gameplane/operator/api/v1alpha1" +) + +// withFilesReconciler is withGameServerReconciler with a short file-only idle +// timeout, so teardown can be observed without a long wait. +func withFilesReconciler(t *testing.T, ns string, idle time.Duration) setupReconciler { + t.Helper() + seedAgentCA(t, ns, "agent-ca") + return func(mgr manager.Manager) error { + return (&GameServerReconciler{ + Client: mgr.GetClient(), + APIReader: mgr.GetAPIReader(), + Scheme: mgr.GetScheme(), + AgentImage: "ghcr.io/gameplanepanel/gameplane/agent:test", + AgentCASecretName: "agent-ca", + AgentCASecretNamespace: ns, + FilesIdleTimeout: idle, + }).SetupWithManager(mgr) + } +} + +// filesPodFor returns the file-only pod -files, or false when absent. +func filesPodFor(t *testing.T, ns, name string) (*corev1.Pod, bool) { + t.Helper() + var pod corev1.Pod + err := k8sClient.Get(context.Background(), types.NamespacedName{Namespace: ns, Name: name + "-files"}, &pod) + if apierrors.IsNotFound(err) { + return nil, false + } + if err != nil { + t.Fatalf("get files pod: %v", err) + } + return &pod, true +} + +// statefulSetReplicas returns the StatefulSet's spec.replicas, or -1 when the +// StatefulSet or the field is absent. +func statefulSetReplicas(t *testing.T, ns, name string) int32 { + t.Helper() + var ss appsv1.StatefulSet + err := k8sClient.Get(context.Background(), types.NamespacedName{Namespace: ns, Name: name}, &ss) + if apierrors.IsNotFound(err) { + return -1 + } + if err != nil { + t.Fatalf("get statefulset: %v", err) + } + if ss.Spec.Replicas == nil { + return -1 + } + return *ss.Spec.Replicas +} + +// assertFilesPodShape checks the file-only pod's identity, mounts and security +// surface. It must hold for every file-only pod, so it reports with Errorf. +func assertFilesPodShape(t *testing.T, pod *corev1.Pod, gs *gameplanev1alpha1.GameServer) { + t.Helper() + if len(pod.Labels) != 2 || + pod.Labels["app.kubernetes.io/name"] != "gameplane-files" || + pod.Labels["app.kubernetes.io/instance"] != gs.Name { + t.Errorf("files pod labels = %v, want only the files labels", pod.Labels) + } + owner := metav1.GetControllerOf(pod) + if owner == nil || owner.Kind != "GameServer" || owner.Name != gs.Name || owner.UID != gs.UID || + owner.BlockOwnerDeletion == nil || !*owner.BlockOwnerDeletion { + t.Errorf("files pod controller owner = %+v, want GameServer %s (%s)", owner, gs.Name, gs.UID) + } + if pod.Spec.HostNetwork { + t.Errorf("files pod uses hostNetwork") + } + if pod.Spec.AutomountServiceAccountToken == nil || *pod.Spec.AutomountServiceAccountToken { + t.Errorf("files pod automounts a service account token") + } + if len(pod.Spec.Containers) != 1 { + t.Fatalf("files pod has %d containers, want only the agent", len(pod.Spec.Containers)) + } + agent := pod.Spec.Containers[0] + hasFilesOnly := false + for _, arg := range agent.Args { + if arg == "--files-only" { + hasFilesOnly = true + } + } + if !hasFilesOnly { + t.Errorf("agent args %v lack --files-only", agent.Args) + } + for _, p := range agent.Ports { + if p.HostPort != 0 { + t.Errorf("agent port %s has hostPort %d", p.Name, p.HostPort) + } + } + volumes := map[string]bool{} + for _, v := range pod.Spec.Volumes { + volumes[v.Name] = true + if v.HostPath != nil { + t.Errorf("files pod has hostPath volume %s", v.Name) + } + } + if !volumes["data"] || !volumes["agent-tls"] || len(volumes) != 2 { + t.Errorf("files pod volumes = %v, want exactly data and agent-tls", volumes) + } + for _, m := range agent.VolumeMounts { + if m.Name == "rcon-password" || m.Name == agentTokenVolumeName { + t.Errorf("files pod mounts %s", m.Name) + } + } +} + +// TestGameServerFiles_PodOnlyWhileStoppedAndFresh covers the file-only pod's +// gate: a running server gets none, a stopped server with a fresh request gets +// one with the expected shape, and a stale request gets none. +func TestGameServerFiles_PodOnlyWhileStoppedAndFresh(t *testing.T) { + ns := newNamespace(t) + startMgr(t, ns, withGameServerReconciler(t, ns)) + + tmpl := buildGameTemplate(uniqueName("minecraft")) + if err := k8sClient.Create(context.Background(), tmpl); err != nil { + t.Fatalf("create template: %v", err) + } + deleteCleanup(t, tmpl) + + fresh := time.Now().UTC().Format(time.RFC3339) + stale := time.Now().UTC().Add(-time.Hour).Format(time.RFC3339) + + running := buildGameServer(ns, "running", tmpl.Name) + running.Annotations = map[string]string{FilesRequestedAtAnnotation: fresh} + if err := k8sClient.Create(context.Background(), running); err != nil { + t.Fatalf("create running gameserver: %v", err) + } + consistently(t, 3*time.Second, func() (bool, string) { + _, ok := filesPodFor(t, ns, "running") + return !ok, "files pod exists while the server is running" + }) + + stopped := buildGameServer(ns, "stopped", tmpl.Name) + stopped.Spec.Suspend = true + stopped.Annotations = map[string]string{FilesRequestedAtAnnotation: fresh} + if err := k8sClient.Create(context.Background(), stopped); err != nil { + t.Fatalf("create stopped gameserver: %v", err) + } + eventually(t, func() (bool, string) { + pod, ok := filesPodFor(t, ns, "stopped") + if !ok { + return false, "files pod not created for a stopped server with a fresh request" + } + assertFilesPodShape(t, pod, getGameServer(t, ns, "stopped")) + return true, "" + }) + + staleGS := buildGameServer(ns, "stale", tmpl.Name) + staleGS.Spec.Suspend = true + staleGS.Annotations = map[string]string{FilesRequestedAtAnnotation: stale} + if err := k8sClient.Create(context.Background(), staleGS); err != nil { + t.Fatalf("create stale gameserver: %v", err) + } + consistently(t, 3*time.Second, func() (bool, string) { + _, ok := filesPodFor(t, ns, "stale") + return !ok, "files pod exists for a stale request" + }) +} + +// TestGameServerFiles_IdleTeardownRevertsService checks that the -agent +// Service follows the file-only pod: it selects the pod while it exists, the +// pod is removed after the idle timeout, and the Service reverts to the game. +func TestGameServerFiles_IdleTeardownRevertsService(t *testing.T) { + ns := newNamespace(t) + startMgr(t, ns, withFilesReconciler(t, ns, 3*time.Second)) + + tmpl := buildGameTemplate(uniqueName("minecraft")) + if err := k8sClient.Create(context.Background(), tmpl); err != nil { + t.Fatalf("create template: %v", err) + } + deleteCleanup(t, tmpl) + + gs := buildGameServer(ns, "idle", tmpl.Name) + gs.Spec.Suspend = true + gs.Annotations = map[string]string{FilesRequestedAtAnnotation: time.Now().UTC().Format(time.RFC3339)} + if err := k8sClient.Create(context.Background(), gs); err != nil { + t.Fatalf("create gameserver: %v", err) + } + + serviceSelector := func() (map[string]string, bool, string) { + var svc corev1.Service + if err := k8sClient.Get(context.Background(), types.NamespacedName{Namespace: ns, Name: "idle-agent"}, &svc); err != nil { + return nil, false, "agent service: " + err.Error() + } + if !svc.Spec.PublishNotReadyAddresses { + t.Errorf("agent service lost PublishNotReadyAddresses") + } + return svc.Spec.Selector, true, "" + } + filesLabels := filesPodLabels(gs) + gameLabels := map[string]string{ + "app.kubernetes.io/name": "gameplane-game", + "app.kubernetes.io/instance": "idle", + } + + eventually(t, func() (bool, string) { + if _, ok := filesPodFor(t, ns, "idle"); !ok { + return false, "files pod not created" + } + sel, ok, msg := serviceSelector() + if !ok { + return false, msg + } + return sel["app.kubernetes.io/name"] == filesLabels["app.kubernetes.io/name"], "service does not select the files pod" + }) + + eventuallyWith(t, 20*time.Second, func() (bool, string) { + _, ok := filesPodFor(t, ns, "idle") + return !ok, "files pod still present after the idle timeout" + }) + eventually(t, func() (bool, string) { + sel, ok, msg := serviceSelector() + if !ok { + return false, msg + } + return sel["app.kubernetes.io/name"] == gameLabels["app.kubernetes.io/name"], "service did not revert to the game pod" + }) +} + +// TestGameServerFiles_StartWaitsForFilesPodGone checks FR-013c: a scale-up +// must not create the game pod while the file-only pod still exists. A +// finalizer keeps the file-only pod terminating, so the StatefulSet must stay +// at zero replicas until it is actually removed. +func TestGameServerFiles_StartWaitsForFilesPodGone(t *testing.T) { + ns := newNamespace(t) + startMgr(t, ns, withGameServerReconciler(t, ns)) + + tmpl := buildGameTemplate(uniqueName("minecraft")) + if err := k8sClient.Create(context.Background(), tmpl); err != nil { + t.Fatalf("create template: %v", err) + } + deleteCleanup(t, tmpl) + + gs := buildGameServer(ns, "wait", tmpl.Name) + gs.Spec.Suspend = true + gs.Annotations = map[string]string{FilesRequestedAtAnnotation: time.Now().UTC().Format(time.RFC3339)} + if err := k8sClient.Create(context.Background(), gs); err != nil { + t.Fatalf("create gameserver: %v", err) + } + eventually(t, func() (bool, string) { + _, ok := filesPodFor(t, ns, "wait") + return ok, "files pod not created" + }) + + // Hold the file-only pod open with a finalizer, then request a start. + const hold = "test/hold" + if err := retry.RetryOnConflict(retry.DefaultRetry, func() error { + pod, ok := filesPodFor(t, ns, "wait") + if !ok { + t.Fatalf("files pod vanished before the hold was set") + } + pod.Finalizers = append(pod.Finalizers, hold) + return k8sClient.Update(context.Background(), pod) + }); err != nil { + t.Fatalf("add finalizer: %v", err) + } + if err := retry.RetryOnConflict(retry.DefaultRetry, func() error { + cur := getGameServer(t, ns, "wait") + cur.Spec.Suspend = false + return k8sClient.Update(context.Background(), cur) + }); err != nil { + t.Fatalf("unsuspend: %v", err) + } + + eventually(t, func() (bool, string) { + pod, ok := filesPodFor(t, ns, "wait") + if !ok || pod.DeletionTimestamp == nil { + return false, "files pod not yet terminating" + } + return true, "" + }) + consistently(t, 2*time.Second, func() (bool, string) { + if r := statefulSetReplicas(t, ns, "wait"); r == 1 { + return false, "game StatefulSet scaled up while the files pod still exists" + } + return true, "" + }) + + if err := retry.RetryOnConflict(retry.DefaultRetry, func() error { + pod, ok := filesPodFor(t, ns, "wait") + if !ok { + return nil + } + var kept []string + for _, f := range pod.Finalizers { + if f != hold { + kept = append(kept, f) + } + } + pod.Finalizers = kept + return k8sClient.Update(context.Background(), pod) + }); err != nil { + t.Fatalf("remove finalizer: %v", err) + } + eventually(t, func() (bool, string) { + if _, ok := filesPodFor(t, ns, "wait"); ok { + return false, "files pod still present" + } + if r := statefulSetReplicas(t, ns, "wait"); r != 1 { + return false, "game StatefulSet not yet scaled to 1" + } + return true, "" + }) +} + +// TestGameServerFiles_AsleepServerNotWoken checks that a file-only pod never +// wakes a sleeping server: no wake request, suspend unchanged, no replicas. +func TestGameServerFiles_AsleepServerNotWoken(t *testing.T) { + ns := newNamespace(t) + startMgr(t, ns, withGameServerReconciler(t, ns)) + + tmpl := buildGameTemplate(uniqueName("minecraft")) + if err := k8sClient.Create(context.Background(), tmpl); err != nil { + t.Fatalf("create template: %v", err) + } + deleteCleanup(t, tmpl) + + now := time.Now().UTC().Format(time.RFC3339) + gs := buildGameServer(ns, "asleep", tmpl.Name) + gs.Spec.Suspend = true + gs.Annotations = map[string]string{ + IdleAsleepSinceAnnotation: now, + FilesRequestedAtAnnotation: now, + } + if err := k8sClient.Create(context.Background(), gs); err != nil { + t.Fatalf("create gameserver: %v", err) + } + eventually(t, func() (bool, string) { + _, ok := filesPodFor(t, ns, "asleep") + return ok, "files pod not created for an asleep server" + }) + consistently(t, 2*time.Second, func() (bool, string) { + cur := getGameServer(t, ns, "asleep") + if _, woke := cur.Annotations[IdleWakeRequestedAnnotation]; woke { + return false, "file access stamped a wake request" + } + if !cur.Spec.Suspend { + return false, "file access cleared spec.suspend" + } + if r := statefulSetReplicas(t, ns, "asleep"); r > 0 { + return false, "file access scaled the StatefulSet up" + } + return true, "" + }) +} diff --git a/operator/internal/controller/gameserver_files_start_test.go b/operator/internal/controller/gameserver_files_start_test.go new file mode 100644 index 000000000..7c12a3694 --- /dev/null +++ b/operator/internal/controller/gameserver_files_start_test.go @@ -0,0 +1,64 @@ +package controller + +import ( + "context" + "testing" + "time" + + corev1 "k8s.io/api/core/v1" + apierrors "k8s.io/apimachinery/pkg/api/errors" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/types" + "sigs.k8s.io/controller-runtime/pkg/client/fake" + + gameplanev1alpha1 "github.com/GameplanePanel/gameplane/operator/api/v1alpha1" +) + +// filesStartTestServer returns a GameServer whose file request is fresh. +func filesStartTestServer() *gameplanev1alpha1.GameServer { + return &gameplanev1alpha1.GameServer{ObjectMeta: metav1.ObjectMeta{ + Name: "gs", Namespace: "ns", + Annotations: map[string]string{ + FilesRequestedAtAnnotation: time.Now().UTC().Format(time.RFC3339), + }, + }} +} + +// TestReconcileFilesPodNotRecreatedWhileStartPending covers the start race: +// holdStartForFilesPod zeroes replicas while the file-only pod drains. With a +// start still wanted, reconcileFilesPod must not create a replacement pod. +func TestReconcileFilesPodNotRecreatedWhileStartPending(t *testing.T) { + s := testScheme(t) + gs := filesStartTestServer() + cl := fake.NewClientBuilder().WithScheme(s).WithObjects(gs).Build() + r := &GameServerReconciler{Client: cl, APIReader: cl, Scheme: s, FilesIdleTimeout: 10 * time.Minute} + key := types.NamespacedName{Namespace: "ns", Name: filesPodName(gs)} + + if _, err := r.reconcileFilesPod(context.Background(), gs, + &gameplanev1alpha1.GameTemplate{}, &gameplanev1alpha1.GameVersion{}, 0, true); err != nil { + t.Fatalf("reconcileFilesPod (start pending): %v", err) + } + var pod corev1.Pod + if err := cl.Get(context.Background(), key, &pod); !apierrors.IsNotFound(err) { + t.Fatalf("files pod created while start pending: get err = %v", err) + } +} + +// TestReconcileFilesPodCreatedWhenIdle is the control for the test above: with +// no start wanted and a fresh file request, the file-only pod is created. +func TestReconcileFilesPodCreatedWhenIdle(t *testing.T) { + s := testScheme(t) + gs := filesStartTestServer() + cl := fake.NewClientBuilder().WithScheme(s).WithObjects(gs).Build() + r := &GameServerReconciler{Client: cl, APIReader: cl, Scheme: s, FilesIdleTimeout: 10 * time.Minute} + key := types.NamespacedName{Namespace: "ns", Name: filesPodName(gs)} + + if _, err := r.reconcileFilesPod(context.Background(), gs, + &gameplanev1alpha1.GameTemplate{}, &gameplanev1alpha1.GameVersion{}, 0, false); err != nil { + t.Fatalf("reconcileFilesPod (idle): %v", err) + } + var pod corev1.Pod + if err := cl.Get(context.Background(), key, &pod); err != nil { + t.Fatalf("files pod not created while idle: %v", err) + } +} diff --git a/operator/internal/controller/gameserver_files_unit_test.go b/operator/internal/controller/gameserver_files_unit_test.go new file mode 100644 index 000000000..76fe5155a --- /dev/null +++ b/operator/internal/controller/gameserver_files_unit_test.go @@ -0,0 +1,83 @@ +package controller + +import ( + "testing" + "time" + + corev1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + + gameplanev1alpha1 "github.com/GameplanePanel/gameplane/operator/api/v1alpha1" +) + +func filesTestServer(stamp string) *gameplanev1alpha1.GameServer { + gs := &gameplanev1alpha1.GameServer{ObjectMeta: metav1.ObjectMeta{Name: "gs", Namespace: "ns"}} + if stamp != "" { + gs.Annotations = map[string]string{FilesRequestedAtAnnotation: stamp} + } + return gs +} + +func TestFilesRequestFresh(t *testing.T) { + now := time.Date(2026, 11, 23, 12, 0, 0, 0, time.UTC) + const timeout = 10 * time.Minute + stamp := func(d time.Duration) string { return now.Add(d).Format(time.RFC3339) } + + cases := []struct { + name string + stamp string + wantFresh bool + wantLeft time.Duration + }{ + {"absent", "", false, 0}, + {"unparseable", "yesterday", false, 0}, + {"non-RFC3339", "2026-11-23 12:00:00", false, 0}, + {"just requested", stamp(0), true, timeout}, + {"half elapsed", stamp(-5 * time.Minute), true, 5 * time.Minute}, + {"one second before expiry", stamp(-timeout + time.Second), true, time.Second}, + {"exactly at timeout", stamp(-timeout), false, 0}, + {"expired", stamp(-time.Hour), false, 0}, + {"slightly future", stamp(time.Second), true, timeout}, + {"future beyond timeout", stamp(timeout + time.Minute), false, 0}, + } + for _, tc := range cases { + t.Run(tc.name, func(t *testing.T) { + fresh, left := filesRequestFresh(filesTestServer(tc.stamp), now, timeout) + if fresh != tc.wantFresh { + t.Fatalf("fresh = %v, want %v", fresh, tc.wantFresh) + } + if left != tc.wantLeft { + t.Fatalf("remaining = %s, want %s", left, tc.wantLeft) + } + }) + } +} + +func TestWithAgentTransferFlags(t *testing.T) { + base := corev1.Container{Name: "agent", Args: []string{"--tls-cert=/x"}} + + unchanged := withAgentTransferFlags(base, 0, false) + if len(unchanged.Args) != 1 { + t.Fatalf("zero limit and not files-only added args: %v", unchanged.Args) + } + + got := withAgentTransferFlags(base, 1<<30, true) + want := []string{"--tls-cert=/x", "--max-upload-bytes=1073741824", "--files-only"} + if len(got.Args) != len(want) { + t.Fatalf("args = %v, want %v", got.Args, want) + } + for i := range want { + if got.Args[i] != want[i] { + t.Fatalf("args = %v, want %v", got.Args, want) + } + } +} + +func TestFilesTimeoutDefaults(t *testing.T) { + if got := (&GameServerReconciler{}).filesTimeout(); got != DefaultFilesIdleTimeout { + t.Fatalf("zero timeout = %s, want default %s", got, DefaultFilesIdleTimeout) + } + if got := (&GameServerReconciler{FilesIdleTimeout: 3 * time.Second}).filesTimeout(); got != 3*time.Second { + t.Fatalf("configured timeout = %s, want 3s", got) + } +} diff --git a/operator/specs.md b/operator/specs.md index 44bd0e316..39179658b 100644 --- a/operator/specs.md +++ b/operator/specs.md @@ -487,6 +487,16 @@ Primary reconcilers register with the manager in `cmd/main.go` and handle CRD li - **conditionArgs:** `status.conditionArgs[]` carries the values interpolated into the English `message` of the condition's current reason, recomputed on every `reconcileStatus` pass by `deriveConditionArgs` (`gameserver_condition_args.go`); `setPhase`, `setTunnelCredentialRefused` and `clearTunnelCredentialRefused` maintain their own entry. The `message` is unchanged. Translation ids are `condition..` (lower-cased) and are listed in `i18n/locales/en/app.json`. - **TunnelReady condition:** Reports tunnel pod readiness when `spec.networking.tunnel.enabled=true` (absent when disabled). Computed in `computeTunnelConditions` (`gameserver_status.go`) each pass reconcileStatus runs, with reasons `InvalidConfig`, `UnsupportedProtocol` (Tailscale, advertised protocols other than TCP/UDP), `DeploymentNotReady`, `PortNotMapped` (frp, unmapped advertised ports), `NoCredentials` (tailscale/playit missing `credentialsSecretRef`), `UnknownProvider`, and `Ready`. **Credential ownership:** `reconcileTunnel` refuses to mount a `credentialsSecretRef` Secret that has no `ownerReference` matching the GameServer's name and UID (including a stale reference from a deleted same-name GameServer) (`isServerOwnedSecret`) — supported credential paths are the dashboard, the `PUT /servers/{name}:tunnel-credentials` API (which sets the ownerReference), or a manually-created Secret with an explicit ownerReference. A refused Secret is never mounted: `reconcileTunnel` still writes the tunnel Deployment, with no credential volume and zero replicas, so a tunnel already running with that Secret stops. It also writes `TunnelReady=False/TunnelCredentialRefused` (naming the Secret, never its data) directly from `reconcileTunnel` before `Reconcile` returns its error — this bypasses the normal `reconcileStatus` pass since Reconcile returns early on that error — The condition carries its own current `observedGeneration`, but `status.observedGeneration` is not advanced on a refused pass (the rest of status is not recomputed). Once the credential becomes acceptable (or the tunnel is no longer wanted), `reconcileTunnel` removes the refusal condition itself (`clearTunnelCredentialRefused`) before returning, so it does not linger if a later step (NetworkPolicy, Service, StatefulSet) fails; reconcileStatus then writes the real TunnelReady. The refusal message points at the dashboard/API, except when the refused Secret is the canonical `-tunnel-auth` name, where the API answers 409 and the message says to fix the ownerReference or delete the Secret first. +### File-only pod (spec 040) +- **Purpose:** file access to a stopped server without starting the game. `gameserver_files.go` owns it. +- **Trigger:** the API stamps `gameplane.local/files-requested-at` (RFC 3339) on each file operation. The pod exists only while `replicas == 0`, the stamp is within `--files-idle-timeout` (default 10 minutes), and no backup, restore, wipe or lifecycle owner holds the volumes. +- **Pod:** `-files`, owned by the GameServer, labelled `app.kubernetes.io/name=gameplane-files`. Its agent runs with `--files-only` and mounts only `data`, `agent-tls` and the active mod volume. It sets no service-account token and no host ports. +- **Service:** `-agent` selects the file-only pod while it exists and is not terminating, and the game pod otherwise. `PublishNotReadyAddresses` is unchanged. +- **Start ordering (FR-013c):** `holdStartForFilesPod` deletes the file-only pod before a scale-up and holds replicas at zero while the pod object still exists. The game pod is created only after `-0` is gone, because the data volume is ReadWriteOnce. +- **No wake:** file access never writes `spec.suspend`, `idle-wake-requested` or `idle-asleep-since`. +- **RBAC:** `pods` create and delete in the managed namespace (namespace Role only). +- **Flags:** `--files-idle-timeout` (positive duration) and `--agent-max-upload-bytes` (0 keeps the agent default; passed to every agent as `--max-upload-bytes`). + ### GameServer modpacks (spec 035) Source: `operator/internal/controller/gameserver_modpack.go`. Contract: `specs/035-curseforge-modpacks/contracts/operator-modpack.md`. diff --git a/sftp b/sftp new file mode 160000 index 000000000..2d695cc3f --- /dev/null +++ b/sftp @@ -0,0 +1 @@ +Subproject commit 2d695cc3f72b176691bbfbe5ec0af4410920c16a diff --git a/specs/040-sftp-access/contracts/api.md b/specs/040-sftp-access/contracts/api.md index b5e4fed6f..b3b670391 100644 --- a/specs/040-sftp-access/contracts/api.md +++ b/specs/040-sftp-access/contracts/api.md @@ -17,11 +17,15 @@ The API splits `username` at the last `+` (R4). A target login also asks the fil Request: `{"sessionTokens": ["gpsftp_…", …]}` (up to 500). Response: `{"revoked": ["gpsftp_…", …]}`. Called every 30 s. +### `POST /sftp/v1/sessions/end` + +Request: `{"sessionTokens": ["gpsftp_…", …]}` (up to 500). Response 204, no body. Revokes each listed session issued for the service token's cluster, in one transaction; unknown, foreign-cluster and already revoked tokens are ignored without error. The SFTP server calls it when it turns away a session after login (per-user session cap reached, SSH handshake failed) so the API session does not linger. Not audited. + ## Called by the SFTP server (bearer: SFTP session token `gpsftp_…`) Only these routes accept a session token (guard like `MCPTokenGuard`); `cluster` is forced to the token's cluster: -- `GET /sftp/v1/servers` (root listing: `{namespace, server}` pairs from the file-access check's `VisibleServers` for the token's cluster) +- `GET /sftp/v1/servers` (root listing: `{namespace, server, write}` items from the file-access check's `VisibleServers` for the token's cluster; `write` is the same check's `create` decision for that server, so the endpoint refuses an upload when the file is opened) - `GET /servers/{name}/files/{list,stat,download}` - `POST /servers/{name}/files/{mkdir,rename}`, `DELETE /servers/{name}/files/delete` - `PUT /servers/{name}/files/stream?path=…&offset=N` (OD-6) @@ -38,9 +42,26 @@ Only these routes accept a session token (guard like `MCPTokenGuard`); `cluster` | `POST /users/me/sftp/password` | signed in | generate or regenerate `{length: 20..40}` → `{password}` shown once | | `DELETE /users/me/sftp/password` | signed in | revoke | | `GET /users/{id}/sftp`, `DELETE /users/{id}/sftp/keys/{keyId}`, `DELETE /users/{id}/sftp/password` | `users:manage` | admin view and revoke | -| `POST /clusters/{name}/sftp-token`, `DELETE /clusters/{name}/sftp-token/{id}` | `cluster:manage` | remote endpoint service token, shown once | +| `GET /clusters/{name}/sftp` | `cluster:manage` | endpoint (address, host key fingerprint) and active service tokens of one cluster (drawer view, see below) | +| `PUT /clusters/{name}/sftp` | `cluster:manage` | set a remote cluster's endpoint `{address, hostKeyFingerprint}` → `200 {cluster, address, hostKeyFingerprint, updatedAt}`; refused for the panel's own cluster (`server.sftp.endpoint_local`) | +| `POST /clusters/{name}/sftp-token` | `cluster:manage` | new service token → `201 {id, cluster, prefix, createdAt, lastUsedAt, revokedAt, token}`; `token` is shown once; 409 `server.sftp.token_limit_reached` at 2 active tokens | +| `DELETE /clusters/{name}/sftp-token/{id}` | `cluster:manage` | revoke one active token of that cluster; 404 `server.sftp.token_not_found` otherwise; `204` | + +`GET /clusters/{name}/sftp` response, the same for every cluster: + +```json +{ + "cluster": "edge-1", + "local": false, + "address": "sftp.edge-1.example.com:2222", + "hostKeyFingerprint": "SHA256:…", + "tokens": [{"id": 12, "cluster": "edge-1", "prefix": "gpsftps_ab12…", "createdAt": "…", "lastUsedAt": null, "revokedAt": null}] +} +``` + +`address` and `hostKeyFingerprint` are `null` when unset. `tokens` lists active tokens only, newest first. A token has no name column: the drawer labels it by `prefix` and `createdAt`. Unknown clusters answer 404 (`server.not_found`) on every cluster route. -Session-token requests are refused on all of these. Endpoint address and host key fingerprint per cluster come from Helm values the API reads (`sftp.publicAddress`, host key Secret) for the local cluster, and from the cluster registration for remote clusters (`PUT /clusters/{name}/sftp` `{address, hostKeyFingerprint}`). +Session-token requests are refused on all of these (403 `server.forbidden`). The panel's own cluster (`local: true`) reads its address from Helm values (`sftp.publicAddress`, passed to the API as `GAMEPLANE_SFTP_PUBLIC_ADDRESS`) and its fingerprint from the host key Secret (`GAMEPLANE_SFTP_HOST_KEY_SECRET`, key `host_key`). Remote clusters read both from the stored endpoint (`PUT`), see data-model.md (`sftp_cluster_endpoints`). The fingerprint is the OpenSSH `SHA256:` form; `PUT` rejects anything else (`server.sftp.fingerprint_invalid`) and addresses that are not `host` or `host:port` (`server.sftp.endpoint_invalid`). ## Agent (mTLS, `/v1/targets/{uid}` prefix as today) diff --git a/specs/040-sftp-access/data-model.md b/specs/040-sftp-access/data-model.md index bfb4858de..a9dc6a6d0 100644 --- a/specs/040-sftp-access/data-model.md +++ b/specs/040-sftp-access/data-model.md @@ -33,7 +33,7 @@ Regenerate replaces the row in one transaction; revoke deletes it. No expiry (OD | Column | Type | Notes | |---|---|---| | id | BIGINT PK | | -| cluster | TEXT NOT NULL | cluster the endpoint serves; `default` for the panel's own cluster | +| cluster | TEXT NOT NULL | cluster the endpoint serves; `local` for the panel's own cluster (`scope.DefaultCluster`) | | digest | TEXT NOT NULL UNIQUE | SHA-256 hex of `gpsftps_…` | | prefix | TEXT NOT NULL | first 12 chars, for display | | created_at | TEXT NOT NULL | | @@ -53,10 +53,23 @@ At most 2 active per cluster (rotation). | digest | TEXT NOT NULL UNIQUE | SHA-256 of `gpsftp_…` session token | | session_epoch | BIGINT NOT NULL | copied from `users.session_epoch` | | expires_at | TEXT NOT NULL | now + 15 min, extended on use (sliding, at most once a minute) | -| revoked_at | TEXT | set when the credential is removed or regenerated | +| revoked_at | TEXT | set when the credential is removed or regenerated, or when the SFTP server ends a session it turned away (`POST /sftp/v1/sessions/end`) | Expired rows are swept with the MCP token sweeper. +## sftp_cluster_endpoints + +Migration `025_sftp_cluster_endpoints.sql`. The SFTP endpoint of each registered remote cluster, set by `PUT /clusters/{name}/sftp`. The panel's own cluster has no row: its address comes from chart values and its fingerprint from the host key Secret. + +| Column | Type | Notes | +|---|---|---| +| cluster | TEXT PK | cluster name | +| address | TEXT NOT NULL | `host` or `host:port`, shown to users | +| host_key_fingerprint | TEXT NOT NULL | OpenSSH `SHA256:` fingerprint of the endpoint's host key | +| updated_at | TEXT NOT NULL | RFC 3339 UTC | + +Removing a cluster registration leaves its row behind; it is harmless and is replaced if the cluster is registered again. + ## audit_events (changed) Add `source TEXT` (NULL for dashboard requests, `sftp` for SFTP session requests). diff --git a/specs/040-sftp-access/plan.md b/specs/040-sftp-access/plan.md index 9f180fae1..bbcb48744 100644 --- a/specs/040-sftp-access/plan.md +++ b/specs/040-sftp-access/plan.md @@ -71,7 +71,7 @@ operator/cmd/main.go --files-idle-timeout api/internal/db/migrations/common/024_sftp_credentials.sql api/internal/auth/sftp.go keys, passwords, service tokens, sessions, guard (+ tests) api/internal/handlers/sftp.go profile, admin, cluster token routes (+ envtest) -api/internal/handlers/sftp_login.go /sftp/v1/login, /sftp/v1/sessions/check +api/internal/handlers/sftp_login.go /sftp/v1/login, /sftp/v1/sessions/check, /sftp/v1/sessions/end api/internal/rbac/fileaccess.go FileAccess helper: the one place file permissions are decided (R8) api/internal/ws/dialer.go mount files/stat, files/rename, files/stream; ensure file-only access on stopped servers api/internal/gatewayprotocol/ stat, rename, stream as allowed operations; stream long-running @@ -84,15 +84,11 @@ test/e2e/sftp_test.go, test/e2e/buckets.sh, test/e2e/multicluster_sftp_test.go docs/sftp.md, docs/security.md, docs/architecture.md; changelog/unreleased/-sftp-access.md ``` -### Delivery (stacked PRs, each green in CI before the next merges) +### Delivery (one Gameplane PR plus one sftp repo PR; valgul 2026-11-23) -1. **Spec PR** (docs only): this folder. -2. **Agent PR**: stat, rename, stream + `agent/specs.md`. -3. **Operator PR**: file-only pod, selector switch, start ordering, NetworkPolicy for `gameplane-files`. -4. **API PR**: migration, credentials, SFTP login/session, guard, new file routes, ensure-files, gateway protocol, audit source. -5. **SFTP component PR** in `GameplanePanel/sftp` (OD-7 A). -6. **Design PR** then **Web PR**: profile section, admin revoke, cluster token, Files tab starting state (after design sign-off). -7. **Chart + docs + E2E PR**: `sftp.yaml`, values, submodule add/pointer, Makefile image, docs, changelog, E2E buckets. +1. **Spec PRs** (docs only, merged): #1065, #1066, #1068. +2. **Gameplane PR** `feat/040-sftp-access`: agent, operator, API, design then web (after design sign-off), chart, docs, changelog, E2E buckets and the `sftp` submodule pointer, as separate commits in that order. +3. **SFTP component PR** in `GameplanePanel/sftp` (OD-7 A), branch `feat/initial-server` to `main`. It merges first; the Gameplane PR then points the `sftp` submodule at the merged commit. ## Complexity Tracking diff --git a/specs/040-sftp-access/quickstart.md b/specs/040-sftp-access/quickstart.md index f57af71c9..4562c7e2b 100644 --- a/specs/040-sftp-access/quickstart.md +++ b/specs/040-sftp-access/quickstart.md @@ -55,7 +55,7 @@ sftp -P 2222 'bob+events/lobby@' # fails like a wrong password ## 6. Upload, rename, delete, permissions (US2) ```sh -sftp> put big-world.zip survival/ # 2 GiB; interrupt, then: reput +sftp> put big-world.zip survival/ # 2 GiB; interrupt: no partial file remains, then put again sftp> rename survival/a.txt survival/b.txt sftp> mkdir survival/new && rmdir survival/new sftp> rm creative/x.txt # as bob: Permission denied diff --git a/specs/040-sftp-access/spec.md b/specs/040-sftp-access/spec.md index 8a1eadde7..ebc2861d3 100644 --- a/specs/040-sftp-access/spec.md +++ b/specs/040-sftp-access/spec.md @@ -46,7 +46,7 @@ A user with write access to a server uploads a mod jar, edits a config file in p **Acceptance Scenarios**: 1. **Given** write access to A, **When** the user uploads a 2 GiB file, **Then** it lands in A complete, and a client that uploads to a temporary name and renames it at the end (WinSCP default) also succeeds. -2. **Given** write access to A, **When** an upload is interrupted and the client resumes it, **Then** the finished file matches the source. +2. **Given** write access to A, **When** an upload is interrupted, **Then** no partial file is left (an existing file keeps its old content), and when the client sends the file again the finished file matches the source. Uploads are atomic (amended 2026-11-23, valgul). 3. **Given** read-only access to B, **When** the user tries to upload, rename, delete or make a folder in B, **Then** the client gets "permission denied" and B is unchanged. 4. **Given** any user, **When** they try to create, rename or delete a top-level server folder, or reach a path outside the server's data root (`..`, symlinks, dotfiles), **Then** the request is refused. 5. **Given** any write through SFTP, **When** an admin opens the audit log, **Then** the entry names the user, the server, the operation, the path and that it came from SFTP. @@ -109,7 +109,7 @@ A user stops a server, or it falls asleep when idle, and then opens its folder o - A server's volumes can only be attached to one node: the file-only pod lands where the volumes can attach. - Two servers share a name in different namespaces: they appear under different `/_namespaces/` paths, or one of them as `/` when it is in the default games namespace (OD-3). - A server is created, deleted or renamed while a user is connected: the root listing reflects it on the next listing; operations on a deleted server fail cleanly. -- The server's pod restarts mid-transfer: the transfer fails with a clear error and can be resumed. +- The server's pod restarts mid-transfer: the transfer fails with a clear error; a download can be resumed, an upload leaves the target unchanged and is sent again. - A volume fills up during an upload: the client gets an error and no half-written file replaces the old one. - A user has hundreds of servers: listing the root still answers within the success criterion. - A path holds characters SFTP clients send in other encodings: names are treated as UTF-8 and invalid names are refused, not mangled. @@ -156,7 +156,7 @@ A user stops a server, or it falls asleep when idle, and then opens its folder o **File operations** -- **FR-014**: The SFTP endpoint MUST support listing a folder, stat of one path, download with resume from an offset, upload, upload resume (write at an offset or append), overwrite, rename/move within one server, mkdir, delete of files and of empty folders, and recursive delete as the client requests it. +- **FR-014**: The SFTP endpoint MUST support listing a folder, stat of one path, download with resume from an offset, upload, upload resume (write at an offset or append) onto a file that is already stored, overwrite, rename/move within one server, mkdir, delete of files and of empty folders, and recursive delete as the client requests it. - **FR-015**: The agent sidecar's file API MUST gain the operations FR-014 needs that it lacks today: stat, rename/move, read from an offset, and write at an offset or append. The new operations MUST keep the existing guarantees: rooted at the data root, no dotfiles, no symlink following, and safe against a path changing between check and use. - **FR-016**: An upload that fails or is cancelled MUST NOT leave a partly written file in place of an existing file of the same name. - **FR-017**: Changing file modes, owners and timestamps (`chmod`, `chown`, `utime`) MUST either be accepted as a no-op or refused consistently; it MUST NOT change ownership inside the volume. @@ -189,7 +189,7 @@ A user stops a server, or it falls asleep when idle, and then opens its folder o - **SC-001**: A user can go from "SFTP enabled" to browsing a server's files in a desktop SFTP client in under 3 minutes, following only the dashboard profile page. - **SC-002**: Listing the root for a user with 200 servers answers in under 2 seconds; listing a folder of 1,000 files answers in under 2 seconds. -- **SC-003**: A 2 GiB upload and download each complete with matching checksums, and each resumes correctly after a forced disconnect at 50%. +- **SC-003**: A 2 GiB upload and download each complete with matching checksums. A download resumes correctly after a forced disconnect at 50%; an upload cut at 50% leaves no partial file (an existing file keeps its old content), and sending it again completes with a matching checksum (amended 2026-11-23, valgul: uploads stay atomic). - **SC-004**: In a permission test matrix (read-only, write, owner, collaborator, no access, remote cluster), 100% of operations are allowed or refused exactly as the dashboard Files tab allows or refuses them, and a code search finds no permission key tested outside the file-access check. - **SC-005**: 100% of SFTP changes in the test run appear in the audit log with source `sftp`. - **SC-006**: A revoked credential or disabled user loses an open session within 60 seconds. diff --git a/specs/040-sftp-access/tasks.md b/specs/040-sftp-access/tasks.md index 0e7aeffc0..9ab2a6403 100644 --- a/specs/040-sftp-access/tasks.md +++ b/specs/040-sftp-access/tasks.md @@ -8,7 +8,7 @@ **Organization**: by user story in spec priority order: US1, US2 (P1), then US3, US4, US5 (P2). -**Delivery** (plan.md): stacked PRs from this thread, each green before the next merges: agent `feat/040-sftp-agent`, operator `feat/040-sftp-files-pod`, API `feat/040-sftp-api`, `GameplanePanel/sftp` `feat/initial-server`, design `design/040-sftp`, web `feat/040-sftp-ui`, chart/docs/E2E `feat/040-sftp-chart`. Implementation runs through `Workflow` scripts (Principle V): haiku agents with an explicit `model:`, then one diff review per batch one tier up. +**Delivery** (plan.md, valgul 2026-11-23): one Gameplane PR on `feat/040-sftp-access` (agent, operator, API, design, web, chart, docs, E2E as separate commits) plus one `GameplanePanel/sftp` PR on `feat/initial-server`, which merges first. Implementation runs through `Workflow` scripts (Principle V): haiku agents with an explicit `model:`, then one diff review per batch one tier up. ## Format: `[ID] [P?] [Story] Description` @@ -22,10 +22,10 @@ **Purpose**: branches, test sign-off, the new repository, and the one design pass every UI task depends on. -- [ ] T001 Confirm PR #1066 (spec 040 quickstart) is merged to `master`; create the branches named in **Delivery** from fresh `master` (Gameplane) and `main` (sftp); record base SHAs in each PR description. -- [ ] T002 List every existing test that encodes behaviour this spec changes (file, test name, assertion, needed change) and get valgul's written sign-off before editing any, in `specs/040-sftp-access/T002-test-signoff.md`. Candidates: `agent/internal/files/*_test.go` (route table, upload caps), operator envtests asserting the `-agent` Service selector in `operator/internal/controller/`, `api/internal/gateway/*_test.go` (operation allow-list), `api/internal/audit/*_test.go` (row shape, webhook/S3 payload), `api/internal/rbac/*_test.go` (route rules), `web/src/routes/tabs/Files*.test.tsx` (multipart upload), `test/e2e/optional_components_e2e_test.go`. Write "none needed" with the reason for each file that needs no change. -- [ ] T003 Scaffold `GameplanePanel/sftp` like `GameplanePanel/mcp`: `sftp/go.mod` (module `github.com/GameplanePanel/sftp`), `sftp/.github/workflows/ci.yaml` calling Gameplane's `go-component.yaml` pinned by SHA, `sftp/.testcoverage.yml`, `sftp/CLAUDE.md`, `sftp/AGENTS.md`, `sftp/specs.md` (empty sections), `sftp/Dockerfile` copying `sftp/...` from the Gameplane build context, `sftp/cmd/main.go` stub that builds. -- [ ] T004 Design in `design.fig` through OpenPencil (never edit the file directly): profile SFTP section (address, port, `` and `+` username forms, host key fingerprint, keys list, add-key dialog, generate-password dialog with a 20–40 length picker and one-time display, regenerate and revoke confirms), admin SFTP panel on Users, Clusters SFTP token dialog and endpoint fields, Files tab per-file upload progress with cancel (OD-6), Files tab "files are starting" state (OD-4). Run `hack/design/fig-export.ts`, commit `assets/design-export/` with `design.fig` on `design/040-sftp`, and get valgul's sign-off before any React task (T030, T035, T036, T042, T050). +- [X] T001 Confirm PR #1066 (spec 040 quickstart) is merged to `master`; create the two branches named in **Delivery** from fresh `master` (Gameplane) and `main` (sftp); record base SHAs in each PR description. +- [X] T002 List every existing test that encodes behaviour this spec changes (file, test name, assertion, needed change) and get valgul's written sign-off before editing any, in `specs/040-sftp-access/T002-test-signoff.md`. Candidates: `agent/internal/files/*_test.go` (route table, upload caps), operator envtests asserting the `-agent` Service selector in `operator/internal/controller/`, `api/internal/gateway/*_test.go` (operation allow-list), `api/internal/audit/*_test.go` (row shape, webhook/S3 payload), `api/internal/rbac/*_test.go` (route rules), `web/src/routes/tabs/Files*.test.tsx` (multipart upload), `test/e2e/optional_components_e2e_test.go`. Write "none needed" with the reason for each file that needs no change. +- [X] T003 Scaffold `GameplanePanel/sftp` like `GameplanePanel/mcp`: `sftp/go.mod` (module `github.com/GameplanePanel/sftp`), `sftp/.github/workflows/ci.yaml` calling Gameplane's `go-component.yaml` pinned by SHA, `sftp/.testcoverage.yml`, `sftp/CLAUDE.md`, `sftp/AGENTS.md`, `sftp/specs.md` (empty sections), `sftp/Dockerfile` copying `sftp/...` from the Gameplane build context, `sftp/cmd/main.go` stub that builds. +- [X] T004 Design in `design.fig` through OpenPencil (never edit the file directly): profile SFTP section (address, port, `` and `+` username forms, host key fingerprint, keys list, add-key dialog, generate-password dialog with a 20–40 length picker and one-time display, regenerate and revoke confirms), admin SFTP panel on Users, Clusters SFTP token dialog and endpoint fields, Files tab per-file upload progress with cancel (OD-6), Files tab "files are starting" state (OD-4). Run `hack/design/fig-export.ts`, commit `assets/design-export/` with `design.fig` on `design/040-sftp`, and get valgul's sign-off before any React task (T030, T035, T036, T042, T050). --- @@ -35,25 +35,25 @@ **⚠️ CRITICAL**: no user story work starts until this phase is complete. -- [ ] T005 [P] Agent `GET /files/stat?path=` in `agent/internal/files/stat.go`: rooted walk like `list`, dotfiles refused (`errDotfile`), returns one `Entry`, 404 when missing; mount in the bounded group in `agent/internal/files/files.go`. -- [ ] T006 [P] Agent `POST /files/rename` `{from, to, overwrite}` in `agent/internal/files/rename_linux.go`: `renameat` on directory fds from the rooted walker, refuses the root, dotfiles and `overwrite=false` onto an existing name; mount in the bounded group. -- [ ] T007 [P] Agent `PUT /files/stream?path=&offset=N` in `agent/internal/files/stream_linux.go`: raw body; `offset=0` writes a new temp file in the target directory, `offset=N` (N ≤ existing size) copies the first N bytes first; `statfs` free-space check before writing; limit from new flag `--max-upload-bytes` in `agent/cmd/main.go`; fsync and `renameat` commit on success; temp removed on any error or cancel (FR-016); mount next to `upload` (no 30 s timeout). -- [ ] T008 Agent tests in new files `agent/internal/files/stat_test.go`, `agent/internal/files/rename_linux_test.go`, `agent/internal/files/stream_linux_test.go`: `..` and symlink-swap escapes via the `beforeOpen` seam, dotfile refusal, resume prefix copy, cancel mid-stream keeps the old file, free-space refusal, size limit, overwrite rules. -- [ ] T009 Document the three routes and their invariants in `agent/specs.md`. -- [ ] T010 Migration `api/internal/db/migrations/common/024_sftp_credentials.sql` per data-model.md: `sftp_ssh_keys`, `sftp_passwords`, `sftp_service_tokens`, `sftp_sessions`, `audit_events.source`; portable SQL, ids and timestamps bound from Go; `DeleteUserTx` in `api/internal/db/` deletes a user's SFTP rows. -- [ ] T011 Credential store in `api/internal/auth/sftp.go`: SSH key parse and normalize (ed25519, ecdsa-sha2-nistp256/384/521, RSA ≥ 3072 bits), SHA256 fingerprint, 20 keys per user; password generate from `crypto/rand` uniform over the 94 printable ASCII characters (space excluded), length 20–40, argon2id hash via `api/internal/auth/password.go`; one password per user, regenerate replaces in one transaction. -- [ ] T012 Service and session tokens in `api/internal/auth/sftp_tokens.go`: service tokens `gpsftps_` (SHA-256 digest, bound to one cluster, 2 active per cluster), session tokens `gpsftp_` (15 min sliding, `last_used_at` at most once a minute, `session_epoch` copied from `users.session_epoch`), revocation on key delete, password regenerate/revoke, user disable or delete; sweeper next to the MCP token sweeper. -- [ ] T013 Session-token guard in `api/internal/auth/sftp_guard.go` (pattern of `MCPTokenGuard` in `api/internal/auth/mcptokens.go`): only the routes listed in contracts/api.md, `cluster` forced to the token's cluster; wire into the auth chain in `api/cmd/main.go`. -- [ ] T014 Audit source: `api/internal/audit/audit.go` writes `source=sftp` for requests authenticated by a session token and adds `source` to the webhook and S3 payloads (`api/internal/audit/s3.go`) as an additive field. -- [ ] T015 File-access helper `api/internal/rbac/fileaccess.go` per contracts/api.md and research R8: `VisibleServers`, `Allow`, `FilterEntries`; today's implementation wraps `servers:read`, `servers:write` and the ownership/collaboration fallback from `api/internal/rbac/rbac.go`; rename checks delete on the source plus create/write on the destination. Move the existing Files tab routes in `api/internal/ws/dialer.go` onto it so no file route tests a permission key itself. Tests in new `api/internal/rbac/fileaccess_test.go` (matrix: read-only, write, owner, collaborator, none, other namespace, remote cluster). -- [ ] T016 API file routes in `api/internal/ws/dialer.go`: mount `files/stat`, `files/rename` and `files/stream`, each authorized through the T015 helper; exempt `files/stream` from the body limit in `api/cmd/main.go` and apply `files.maxUploadSize`; add the three to the gateway allow-list and mark `stream` long-running in `api/internal/gatewayprotocol/` and `api/internal/gateway/server.go`. -- [ ] T017 `POST /sftp/v1/login` and `POST /sftp/v1/sessions/check` in `api/internal/handlers/sftp_login.go` per contracts/api.md: service-token auth, split at the last `+`, target checked with the T015 helper (`Allow` list), generic 401 (`server.sftp.login_failed`), shared login rate limiter from `api/internal/auth/ratelimit.go`, audit rows for success and failure. -- [ ] T018 Self-service credential routes `GET /users/me/sftp`, `POST|DELETE /users/me/sftp/keys[/{id}]`, `POST|DELETE /users/me/sftp/password` in `api/internal/handlers/sftp.go`, mounted from `MountUsers`; refused for session-token and MCP-token requests. -- [ ] T019 API tests in new files: `api/internal/auth/sftp_test.go` (key types, password alphabet and length distribution, hash, token digests, epoch), `api/internal/auth/sftp_guard_test.go` (allow-list, cluster forcing), `api/internal/audit/audit_source_test.go`, `api/internal/handlers/sftp_login_envtest_test.go` (login matrix, rate limit, generic refusals), migration test on SQLite and PostgreSQL. -- [ ] T020 [P] API client in `sftp/internal/apiclient/client.go`: login, session check, `GET /sftp/v1/servers`, `files/list`, `files/stat`, `files/download` with `Range`, `files/stream`, `files/rename`, `files/mkdir`, `files/delete`; API errors mapped to SFTP status codes; optional CA bundle. -- [ ] T021 SSH server in `sftp/internal/sshserver/server.go` and `sftp/cmd/main.go`: host key from a mounted Secret file, password and public-key callbacks that call `/sftp/v1/login`, SFTP subsystem only (no shell, exec, port forwarding or SCP, FR-004), idle timeout, per-user session cap, 30 s `sessions/check` loop closing revoked sessions, Prometheus metrics (sessions, logins by result, bytes) (FR-022). -- [ ] T022 Minimal chart template `charts/gameplane/templates/sftp.yaml` and `values.yaml` keys `sftp.enabled` (false), `sftp.port` (2222), `sftp.image`: Deployment, ClusterIP Service, host key Secret generated once (`lookup`, `helm.sh/resource-policy: keep`), local service token Secret shared with the API; NetworkPolicy in `charts/gameplane/templates/networkpolicies.yaml` for SFTP ingress and egress to the API only. -- [ ] T023 Add the `sftp` submodule: `.gitmodules` entry with `component = true`, path filters for `hack/submodules.sh check`, `IMAGES += sftp` and `image-sftp` in `Makefile`, release image list and cosign signing. +- [X] T005 [P] Agent `GET /files/stat?path=` in `agent/internal/files/stat.go`: rooted walk like `list`, dotfiles refused (`errDotfile`), returns one `Entry`, 404 when missing; mount in the bounded group in `agent/internal/files/files.go`. +- [X] T006 [P] Agent `POST /files/rename` `{from, to, overwrite}` in `agent/internal/files/rename_linux.go`: `renameat` on directory fds from the rooted walker, refuses the root, dotfiles and `overwrite=false` onto an existing name; mount in the bounded group. +- [X] T007 [P] Agent `PUT /files/stream?path=&offset=N` in `agent/internal/files/stream_linux.go`: raw body; `offset=0` writes a new temp file in the target directory, `offset=N` (N ≤ existing size) copies the first N bytes first; `statfs` free-space check before writing; limit from new flag `--max-upload-bytes` in `agent/cmd/main.go`; fsync and `renameat` commit on success; temp removed on any error or cancel (FR-016); mount next to `upload` (no 30 s timeout). +- [X] T008 Agent tests in new files `agent/internal/files/stat_test.go`, `agent/internal/files/rename_linux_test.go`, `agent/internal/files/stream_linux_test.go`: `..` and symlink-swap escapes via the `beforeOpen` seam, dotfile refusal, resume prefix copy, cancel mid-stream keeps the old file, free-space refusal, size limit, overwrite rules. +- [X] T009 Document the three routes and their invariants in `agent/specs.md`. +- [X] T010 Migration `api/internal/db/migrations/common/024_sftp_credentials.sql` per data-model.md: `sftp_ssh_keys`, `sftp_passwords`, `sftp_service_tokens`, `sftp_sessions`, `audit_events.source`; portable SQL, ids and timestamps bound from Go; `DeleteUserTx` in `api/internal/db/` deletes a user's SFTP rows. +- [X] T011 Credential store in `api/internal/auth/sftp.go`: SSH key parse and normalize (ed25519, ecdsa-sha2-nistp256/384/521, RSA ≥ 3072 bits), SHA256 fingerprint, 20 keys per user; password generate from `crypto/rand` uniform over the 94 printable ASCII characters (space excluded), length 20–40, argon2id hash via `api/internal/auth/password.go`; one password per user, regenerate replaces in one transaction. +- [X] T012 Service and session tokens in `api/internal/auth/sftp_tokens.go`: service tokens `gpsftps_` (SHA-256 digest, bound to one cluster, 2 active per cluster), session tokens `gpsftp_` (15 min sliding, `last_used_at` at most once a minute, `session_epoch` copied from `users.session_epoch`), revocation on key delete, password regenerate/revoke, user disable or delete; sweeper next to the MCP token sweeper. +- [X] T013 Session-token guard in `api/internal/auth/sftp_guard.go` (pattern of `MCPTokenGuard` in `api/internal/auth/mcptokens.go`): only the routes listed in contracts/api.md, `cluster` forced to the token's cluster; wire into the auth chain in `api/cmd/main.go`. +- [X] T014 Audit source: `api/internal/audit/audit.go` writes `source=sftp` for requests authenticated by a session token and adds `source` to the webhook and S3 payloads (`api/internal/audit/s3.go`) as an additive field. +- [X] T015 File-access helper `api/internal/rbac/fileaccess.go` per contracts/api.md and research R8: `VisibleServers`, `Allow`, `FilterEntries`; today's implementation wraps `servers:read`, `servers:write` and the ownership/collaboration fallback from `api/internal/rbac/rbac.go`; rename checks delete on the source plus create/write on the destination. Move the existing Files tab routes in `api/internal/ws/dialer.go` onto it so no file route tests a permission key itself. Tests in new `api/internal/rbac/fileaccess_test.go` (matrix: read-only, write, owner, collaborator, none, other namespace, remote cluster). +- [X] T016 API file routes in `api/internal/ws/dialer.go`: mount `files/stat`, `files/rename` and `files/stream`, each authorized through the T015 helper; exempt `files/stream` from the body limit in `api/cmd/main.go` and apply `files.maxUploadSize`; add the three to the gateway allow-list and mark `stream` long-running in `api/internal/gatewayprotocol/` and `api/internal/gateway/server.go`. +- [X] T017 `POST /sftp/v1/login` and `POST /sftp/v1/sessions/check` in `api/internal/handlers/sftp_login.go` per contracts/api.md: service-token auth, split at the last `+`, target checked with the T015 helper (`Allow` list), generic 401 (`server.sftp.login_failed`), shared login rate limiter from `api/internal/auth/ratelimit.go`, audit rows for success and failure. +- [X] T018 Self-service credential routes `GET /users/me/sftp`, `POST|DELETE /users/me/sftp/keys[/{id}]`, `POST|DELETE /users/me/sftp/password` in `api/internal/handlers/sftp.go`, mounted from `MountUsers`; refused for session-token and MCP-token requests. +- [X] T019 API tests in new files: `api/internal/auth/sftp_test.go` (key types, password alphabet and length distribution, hash, token digests, epoch), `api/internal/auth/sftp_guard_test.go` (allow-list, cluster forcing), `api/internal/audit/audit_source_test.go`, `api/internal/handlers/sftp_login_envtest_test.go` (login matrix, rate limit, generic refusals), migration test on SQLite and PostgreSQL. +- [X] T020 [P] API client in `sftp/internal/apiclient/client.go`: login, session check, `GET /sftp/v1/servers`, `files/list`, `files/stat`, `files/download` with `Range`, `files/stream`, `files/rename`, `files/mkdir`, `files/delete`; API errors mapped to SFTP status codes; optional CA bundle. +- [X] T021 SSH server in `sftp/internal/sshserver/server.go` and `sftp/cmd/main.go`: host key from a mounted Secret file, password and public-key callbacks that call `/sftp/v1/login`, SFTP subsystem only (no shell, exec, port forwarding or SCP, FR-004), idle timeout, per-user session cap, 30 s `sessions/check` loop closing revoked sessions, Prometheus metrics (sessions, logins by result, bytes) (FR-022). +- [X] T022 Minimal chart template `charts/gameplane/templates/sftp.yaml` and `values.yaml` keys `sftp.enabled` (false), `sftp.port` (2222), `sftp.image`: Deployment, ClusterIP Service, host key Secret generated once (`lookup`, `helm.sh/resource-policy: keep`), local service token Secret shared with the API; NetworkPolicy in `charts/gameplane/templates/networkpolicies.yaml` for SFTP ingress and egress to the API only. +- [X] T023 Add the `sftp` submodule: `.gitmodules` entry with `component = true`, path filters for `hack/submodules.sh check`, `IMAGES += sftp` and `image-sftp` in `Makefile`, release image list and cosign signing. **Checkpoint**: an SFTP server deploys, logs a seeded user in, and can call the API; user story phases can start. @@ -67,12 +67,12 @@ ### Tests for User Story 1 -- [ ] T024 [P] [US1] Component tests in `sftp/internal/vfs/read_test.go` against an `httptest` API: tree `/` and `/_namespaces//`, per-server login root, dotfiles absent, root and server folders read-only, download from an offset. -- [ ] T025 [P] [US1] Component tests in `sftp/internal/sshserver/server_test.go`: shell, exec and forwarding refused; revoked session closed after the check loop; session cap. +- [X] T024 [P] [US1] Component tests in `sftp/internal/vfs/read_test.go` against an `httptest` API: tree `/` and `/_namespaces//`, per-server login root, dotfiles absent, root and server folders read-only, download from an offset. +- [X] T025 [P] [US1] Component tests in `sftp/internal/sshserver/server_test.go`: shell, exec and forwarding refused; revoked session closed after the check loop; session cap. ### Implementation for User Story 1 -- [ ] T026 [US1] Read-side VFS in `sftp/internal/vfs/vfs.go` implementing `pkg/sftp` `FileLister` and `FileReader`: root from `GET /sftp/v1/servers` (the helper's `VisibleServers`) (default games namespace at the top, others under `/_namespaces/`), per-server login rooted at one server, `Stat`/`Lstat` via `files/stat`, `ReadAt` via ranged `files/download`; mkdir/rename/remove at the root or a server folder return permission denied (FR-012). +- [X] T026 [US1] Read-side VFS in `sftp/internal/vfs/vfs.go` implementing `pkg/sftp` `FileLister` and `FileReader`: root from `GET /sftp/v1/servers` (the helper's `VisibleServers`) (default games namespace at the top, others under `/_namespaces/`), per-server login rooted at one server, `Stat`/`Lstat` via `files/stat`, `ReadAt` via ranged `files/download`; mkdir/rename/remove at the root or a server folder return permission denied (FR-012). **Checkpoint**: US1 works on its own against a running server. @@ -82,19 +82,19 @@ **Goal**: users with write access change files over SFTP and from the dashboard with large, resumable uploads (OD-6). -**Independent Test**: as a user with `servers:write` on A and `servers:read` on B: upload 2 GiB to A with an interrupt and resume, WinSCP-style temp-and-rename, mkdir, rename, delete all succeed and show in the Files tab and audit log with source `sftp`; the same on B is refused and B is unchanged (quickstart §6, §7). +**Independent Test**: as a user with `servers:write` on A and `servers:read` on B: upload 2 GiB to A, interrupt one upload (no partial file remains) and send it again, WinSCP-style temp-and-rename, mkdir, rename, delete all succeed and show in the Files tab and audit log with source `sftp`; the same on B is refused and B is unchanged (quickstart §6, §7). ### Tests for User Story 2 -- [ ] T027 [P] [US2] Component tests in `sftp/internal/vfs/write_test.go`: sequential write streams once, first write at offset N resumes, out-of-order write returns `SSH_FX_OP_UNSUPPORTED`, temp-and-rename, `SETSTAT` mode/time no-op and owner refused, write on a read-only server refused, transfer cap. -- [ ] T028 [P] [US2] Envtest `api/internal/handlers/files_stream_envtest_test.go`: stream, rename and stat through the API with read-only, write, owner and collaborator users; body limit; audit `source`. +- [X] T027 [P] [US2] Component tests in `sftp/internal/vfs/write_test.go`: sequential write streams once, first write at offset N resumes, out-of-order write returns `SSH_FX_OP_UNSUPPORTED`, temp-and-rename, `SETSTAT` mode/time no-op and owner refused, write on a read-only server refused, transfer cap. +- [X] T028 [P] [US2] Envtest `api/internal/handlers/files_stream_envtest_test.go`: stream, rename and stat through the API with read-only, write, owner and collaborator users; body limit; audit `source`. ### Implementation for User Story 2 -- [ ] T029 [US2] Write-side VFS in `sftp/internal/vfs/write.go` implementing `FileWriter` and `FileCmder`: one `files/stream` call per open handle fed by a pipe, resume on a first write at offset N > 0, rename (incl. `posix-rename@openssh.com`), mkdir, remove, rmdir, `SETSTAT` per FR-017, per-user transfer cap. -- [ ] T030 [US2] Dashboard streaming upload (FR-018b) after T004 sign-off: `web/src/routes/tabs/Files.tsx` uploads each file with `PUT files/stream` using `XMLHttpRequest` upload progress, per-file progress and cancel per the design; `uploadStream` in `web/src/lib/api.ts`; i18n strings in the web pack. -- [ ] T031 [US2] Vitest `web/src/routes/tabs/Files_stream.test.tsx`: progress, cancel, error states, size-limit message. -- [ ] T032 [US2] Helm `files.maxUploadSize` (default `20Gi`) in `charts/gameplane/values.yaml`, passed to the operator (agent flag `--max-upload-bytes`, built in `buildAgentContainer` in `operator/internal/controller/gameserver_controller.go`), the API and the gateway; keep the multipart `files/upload` route for one release. +- [X] T029 [US2] Write-side VFS in `sftp/internal/vfs/write.go` implementing `FileWriter` and `FileCmder`: one `files/stream` call per open handle fed by a pipe, resume on a first write at offset N > 0, rename (incl. `posix-rename@openssh.com`), mkdir, remove, rmdir, `SETSTAT` per FR-017, per-user transfer cap. +- [X] T030 [US2] Dashboard streaming upload (FR-018b) after T004 sign-off: `web/src/routes/tabs/Files.tsx` uploads each file with `PUT files/stream` using `XMLHttpRequest` upload progress, per-file progress and cancel per the design; `uploadStream` in `web/src/lib/api.ts`; i18n strings in the web pack. +- [X] T031 [US2] Vitest `web/src/routes/tabs/Files_stream.test.tsx`: progress, cancel, error states, size-limit message. +- [X] T032 [US2] Helm `files.maxUploadSize` (default `20Gi`) in `charts/gameplane/values.yaml`, passed to the operator (agent flag `--max-upload-bytes`, built in `buildAgentContainer` in `operator/internal/controller/gameserver_controller.go`), the API and the gateway; keep the multipart `files/upload` route for one release. **Checkpoint**: US1 and US2 both work; P1 scope is shippable. @@ -108,14 +108,14 @@ ### Tests for User Story 3 -- [ ] T033 [P] [US3] Envtest `api/internal/handlers/sftp_envtest_test.go`: add/remove keys, duplicate fingerprint across users refused, password shown once, regenerate invalidates the old one, admin list and revoke, user disable and password reset revoke sessions, session-token and MCP-token requests refused. +- [X] T033 [P] [US3] Envtest `api/internal/handlers/sftp_envtest_test.go`: add/remove keys, duplicate fingerprint across users refused, password shown once, regenerate invalidates the old one, admin list and revoke, user disable and password reset revoke sessions, session-token and MCP-token requests refused. ### Implementation for User Story 3 -- [ ] T034 [US3] Admin routes `GET /users/{id}/sftp`, `DELETE /users/{id}/sftp/keys/{keyId}`, `DELETE /users/{id}/sftp/password` in `api/internal/handlers/sftp.go`, mounted with `users:manage` RBAC in `api/internal/rbac/`. -- [ ] T035 [US3] Personal SFTP page after T004 sign-off: new `web/src/routes/ProfileSftp.tsx` at `/settings/sftp` (next to `/settings/theme`), registered in `web/src/router/tree.tsx` and linked where the design places it; API methods in `web/src/lib/api.ts`; i18n strings. -- [ ] T036 [US3] Admin SFTP panel on `web/src/routes/Users.tsx` per the design. -- [ ] T037 [US3] Vitest `web/src/routes/ProfileSftp.test.tsx` and `web/src/routes/Users_sftp.test.tsx`: add/remove key, generate with length picker, one-time display, regenerate and revoke confirms, admin revoke. +- [X] T034 [US3] Admin routes `GET /users/{id}/sftp`, `DELETE /users/{id}/sftp/keys/{keyId}`, `DELETE /users/{id}/sftp/password` in `api/internal/handlers/sftp.go`, mounted with `users:manage` RBAC in `api/internal/rbac/`. +- [X] T035 [US3] Personal SFTP page after T004 sign-off: new `web/src/routes/ProfileSftp.tsx` at `/settings/sftp` (next to `/settings/theme`), registered in `web/src/router/tree.tsx` and linked where the design places it; API methods in `web/src/lib/api.ts`; i18n strings. +- [X] T036 [US3] Admin SFTP panel on `web/src/routes/Users.tsx` per the design. +- [X] T037 [US3] Vitest `web/src/routes/ProfileSftp.test.tsx` and `web/src/routes/Users_sftp.test.tsx`: add/remove key, generate with length picker, one-time display, regenerate and revoke confirms, admin revoke. **Checkpoint**: US3 works with US1/US2 credentials replaced by real dashboard-managed ones. @@ -129,14 +129,14 @@ ### Tests for User Story 4 -- [ ] T038 [P] [US4] Chart checks in new `charts/gameplane/tests/sftp.sh` (pattern of `charts/gameplane/tests/mcp-server-rbac.sh`): off renders nothing; on renders Deployment, Service (ClusterIP, NodePort, LoadBalancer variants), host key Secret with keep policy, NetworkPolicy. -- [ ] T039 [P] [US4] Envtest `api/internal/handlers/sftp_cluster_envtest_test.go`: create/revoke service tokens with `cluster:manage`, endpoint address and fingerprint per cluster, a remote service token cannot list another cluster. +- [X] T038 [P] [US4] Chart checks in new `charts/gameplane/tests/sftp.sh` (pattern of `charts/gameplane/tests/mcp-server-rbac.sh`): off renders nothing; on renders Deployment, Service (ClusterIP, NodePort, LoadBalancer variants), host key Secret with keep policy, NetworkPolicy. +- [X] T039 [P] [US4] Envtest `api/internal/handlers/sftp_cluster_envtest_test.go`: create/revoke service tokens with `cluster:manage`, endpoint address and fingerprint per cluster, a remote service token cannot list another cluster. ### Implementation for User Story 4 -- [ ] T040 [US4] Chart exposure and remote mode in `charts/gameplane/templates/sftp.yaml` and `values.yaml`: `sftp.serviceType`, `sftp.nodePort`, `sftp.loadBalancerIP`, `sftp.publicAddress`, `sftp.apiURL`, `sftp.apiCASecret`, `sftp.serviceTokenSecret`, `sftp.maxSessionsPerUser` (4), `sftp.maxTransfersPerUser` (8); render on a gateway-only install. -- [ ] T041 [US4] `POST /clusters/{name}/sftp-token`, `DELETE /clusters/{name}/sftp-token/{id}` and `PUT /clusters/{name}/sftp` in `api/internal/handlers/sftp_cluster.go`; local endpoint address and fingerprint read from Helm values and the host key Secret. -- [ ] T042 [US4] Clusters SFTP dialog after T004 sign-off in `web/src/routes/Clusters.tsx`, API methods in `web/src/lib/api.ts`, Vitest `web/src/routes/Clusters_sftp.test.tsx`. +- [X] T040 [US4] Chart exposure and remote mode in `charts/gameplane/templates/sftp.yaml` and `values.yaml`: `sftp.serviceType`, `sftp.nodePort`, `sftp.loadBalancerIP`, `sftp.publicAddress`, `sftp.apiURL`, `sftp.apiCASecret`, `sftp.serviceTokenSecret`, `sftp.maxSessionsPerUser` (4), `sftp.maxTransfersPerUser` (8); render on a gateway-only install. +- [X] T041 [US4] `POST /clusters/{name}/sftp-token`, `DELETE /clusters/{name}/sftp-token/{id}` and `PUT /clusters/{name}/sftp` in `api/internal/handlers/sftp_cluster.go`; local endpoint address and fingerprint read from Helm values and the host key Secret. +- [X] T042 [US4] Clusters SFTP dialog after T004 sign-off in `web/src/routes/Clusters.tsx`, API methods in `web/src/lib/api.ts`, Vitest `web/src/routes/Clusters_sftp.test.tsx`. **Checkpoint**: admins can roll SFTP out to every cluster. @@ -150,17 +150,17 @@ ### Tests for User Story 5 -- [ ] T043 [P] [US5] Operator envtest `operator/internal/controller/gameserver_files_envtest_test.go`: pod created only while replicas are 0 and the annotation is fresh, `-agent` selector switched both ways, idle teardown, start while active waits for deletion, asleep server not woken, server delete removes the pod, no host ports. -- [ ] T044 [P] [US5] API test `api/internal/ws/ensure_files_test.go`: annotation patched at most once a minute, 60 s wait, `503 server.files.starting`. +- [X] T043 [P] [US5] Operator envtest `operator/internal/controller/gameserver_files_envtest_test.go`: pod created only while replicas are 0 and the annotation is fresh, `-agent` selector switched both ways, idle teardown, start while active waits for deletion, asleep server not woken, server delete removes the pod, no host ports. +- [X] T044 [P] [US5] API test `api/internal/ws/ensure_files_test.go`: annotation patched at most once a minute, 60 s wait, `503 server.files.starting`. ### Implementation for User Story 5 -- [ ] T045 [US5] Agent files-only mode flag `--files-only` in `agent/cmd/main.go`: mount only `/files/*`, `/healthz` and metrics. -- [ ] T046 [US5] Reconciler `operator/internal/controller/gameserver_files.go`: file-only Pod (labels `app.kubernetes.io/name: gameplane-files`, `app.kubernetes.io/instance: `, server volumes, agent container from `buildAgentContainer` with `--files-only`, owned by the GameServer, no host ports) while replicas are 0 and `gameplane.local/files-requested-at` is younger than `--files-idle-timeout`; switch the `-agent` Service selector in `reconcileAgentService`; delete on idle or server delete; flag in `operator/cmd/main.go`, Helm `operator.filesIdleTimeout` (`10m`). -- [ ] T047 [US5] Start ordering in `desiredReplicas` in `operator/internal/controller/gameserver_controller.go`: delete the file-only pod and requeue until it is gone before scaling up; file access never sets a wake. -- [ ] T048 [US5] NetworkPolicy in `charts/gameplane/templates/networkpolicies.yaml` allowing API, operator and gateway ingress to `gameplane-files` pods on 8090 only. -- [ ] T049 [US5] Ensure-files in the API file routes in `api/internal/ws/dialer.go` (new helper `api/internal/ws/ensure_files.go`): when the server is stopped or asleep, patch the annotation, wait up to 60 s for the agent Service, otherwise `503 server.files.starting`; works for remote clusters through the registry client. -- [ ] T050 [US5] Files tab "files are starting" state after T004 sign-off in `web/src/routes/tabs/Files.tsx`, Vitest `web/src/routes/tabs/Files_starting.test.tsx`. +- [X] T045 [US5] Agent files-only mode flag `--files-only` in `agent/cmd/main.go`: mount only `/files/*`, `/healthz` and metrics. +- [X] T046 [US5] Reconciler `operator/internal/controller/gameserver_files.go`: file-only Pod (labels `app.kubernetes.io/name: gameplane-files`, `app.kubernetes.io/instance: `, server volumes, agent container from `buildAgentContainer` with `--files-only`, owned by the GameServer, no host ports) while replicas are 0 and `gameplane.local/files-requested-at` is younger than `--files-idle-timeout`; switch the `-agent` Service selector in `reconcileAgentService`; delete on idle or server delete; flag in `operator/cmd/main.go`, Helm `operator.filesIdleTimeout` (`10m`). +- [X] T047 [US5] Start ordering in `desiredReplicas` in `operator/internal/controller/gameserver_controller.go`: delete the file-only pod and requeue until it is gone before scaling up; file access never sets a wake. +- [X] T048 [US5] NetworkPolicy in `charts/gameplane/templates/networkpolicies.yaml` allowing API, operator and gateway ingress to `gameplane-files` pods on 8090 only. +- [X] T049 [US5] Ensure-files in the API file routes in `api/internal/ws/dialer.go` (new helper `api/internal/ws/ensure_files.go`): when the server is stopped or asleep, patch the annotation, wait up to 60 s for the agent Service, otherwise `503 server.files.starting`; works for remote clusters through the registry client. +- [X] T050 [US5] Files tab "files are starting" state after T004 sign-off in `web/src/routes/tabs/Files.tsx`, Vitest `web/src/routes/tabs/Files_starting.test.tsx`. **Checkpoint**: all five stories work independently. @@ -168,11 +168,12 @@ ## Phase 8: Polish & Cross-Cutting Concerns -- [ ] T051 [P] E2E bucket `sftp` in new `test/e2e/sftp_e2e_test.go`, registered in `test/e2e/buckets.sh`: chart off, connect, tree and per-server login, 2 GiB upload/download with resume, permission matrix, audit `source`, revoke within 60 s, stopped server; `t.Parallel()`, unique names, at most 3 admin logins. -- [ ] T052 [P] Remote endpoint E2E in new `test/e2e/multicluster_sftp_e2e_test.go` (bucket `multicluster`). -- [ ] T053 [P] Docs: new `docs/sftp.md` (enable, connect with FileZilla/WinSCP/`sftp`, host key check, credentials, per-server login, remote clusters, stopped servers), threat-model entry in `docs/security.md`, component in `docs/architecture.md`, `sftp/specs.md` and `sftp/README.md`, `operator` and `api` docs for the annotation and routes. -- [ ] T054 Changelog `changelog/unreleased/-sftp-access.md` in the chart PR per `changelog/unreleased/README.md` (new Helm values `sftp.*`, `files.maxUploadSize`, `operator.filesIdleTimeout`). +- [X] T051 [P] E2E bucket `sftp` in new `test/e2e/sftp_e2e_test.go`, registered in `test/e2e/buckets.sh`: chart off, connect, tree and per-server login, 2 GiB upload/download, download resume, atomic interrupted upload (SC-003 amended 2026-11-23), permission matrix, audit `source`, revoke within 60 s, stopped server; `t.Parallel()`, unique names, at most 3 admin logins. +- [X] T052 [P] Remote endpoint E2E in new `test/e2e/multicluster_sftp_e2e_test.go` (bucket `multicluster`), run as the `sftp-remote-endpoint` subtest of `TestMultiCluster_TokenRemoteGrant` to share its admin login (valgul 2026-11-23). Admin contract only: the cross-cluster SFTP login is not covered because cluster B pods have no route to the central API (see the file's package comment). +- [X] T053 [P] Docs: new `docs/sftp.md` (enable, connect with FileZilla/WinSCP/`sftp`, host key check, credentials, per-server login, remote clusters, stopped servers), threat-model entry in `docs/security.md`, component in `docs/architecture.md`, `operator/specs.md` and `api/specs.md` for the file-only pod and routes. Open: `sftp/specs.md` and `sftp/README.md` live in the `GameplanePanel/sftp` submodule, which is not checked out in this worktree; they are not done here. +- [X] T054 Changelog `changelog/unreleased/-sftp-access.md` in the chart PR per `changelog/unreleased/README.md` (new Helm values `sftp.*`, `files.maxUploadSize`, `operator.filesIdleTimeout`). - [ ] T055 Run every scenario in `specs/040-sftp-access/quickstart.md` on a dev cluster and record results in the chart PR. +- [X] T056 `POST /sftp/v1/sessions/end` in `api/internal/handlers/sftp_login.go` (`end`) and `EndSFTPSessions` in `api/internal/auth/sftp_revoke.go`, per contracts/api.md: lets the SFTP server revoke a session it refused after login (session cap, failed SSH handshake); same service-token auth and cluster binding as `sessions/check`; unit tests in `api/internal/handlers/sftp_end_test.go`. --- @@ -196,7 +197,7 @@ ### Within Each User Story -- Tests are written alongside implementation in the same PR; CI must be green before the next stacked PR merges. +- Tests are written alongside implementation in the same PR; CI must be green on both PRs before they merge (sftp repo PR first). - API before web; design sign-off before web. ### Parallel Opportunities @@ -242,4 +243,4 @@ Task: "API test ensure_files_test.go" (T044) 6. US5 → stopped and sleeping servers. 7. Polish → E2E, docs, changelog, quickstart run. -Each step maps onto the stacked PRs in **Delivery**; no step breaks the previous ones. +Each step is one or more commits in the Gameplane PR (the sftp server in its repo PR); no step breaks the previous ones. diff --git a/specs/done_037-scope-mcp-server-permissions/tasks.md b/specs/done_037-scope-mcp-server-permissions/tasks.md index b214b708d..65c079d62 100644 --- a/specs/done_037-scope-mcp-server-permissions/tasks.md +++ b/specs/done_037-scope-mcp-server-permissions/tasks.md @@ -104,7 +104,7 @@ - [X] T036 [US3] In `mcp-server/internal/panel/client.go`: with no `cluster` argument, call `/clusters`, run the read on each listed cluster concurrently (bounded, 4 at a time, 10 s each), return results grouped by cluster plus `unavailable: [ids]`; with no `namespace`, use `/namespaces?cluster=` for that cluster. (done in mcp #5: mcp-server/internal/panel/fanout.go (fanOut, bounded semaphore)) - [X] T037 [US3] Shape grouped results in `mcp-server/tools.go` (`{clusters: {: …}, unavailable: […]}`), keeping single-cluster output unchanged when `cluster` is given. (done as shipped, accepted by valgul 2026-11-23: mcp#5 merges per-cluster results with a cluster label on each item and reports failed clusters as `unavailable clusters: ` (`mcp-server/internal/panel/fanout.go`), not a `{clusters, unavailable}` object) - [X] T038 [P] [US3] New tests `mcp-server/internal/panel/fanout_test.go`: two clusters merged and labelled, one unreachable reported not fatal, forbidden cluster indistinguishable from unknown. (done in mcp #5: mcp-server/internal/panel/fanout_test.go) -- [X] T039 [US3] New E2E `TestMultiCluster_MCPTokenRemoteGrant` in `test/e2e/multicluster_mcp_e2e_test.go` (bucket `multicluster`, register in `test/e2e/buckets.sh`): user with a remote grant for one namespace reads it with `?cluster=` through the token, gets forbidden on an ungranted cluster with the same body as an unknown ID, and a namespace-only server grant cannot read `/cluster` data. (done in #1045/#1046 line: test/e2e/multicluster_mcp_e2e_test.go:31 TestMultiCluster_MCPTokenRemoteGrant) +- [X] T039 [US3] New E2E `TestMultiCluster_MCPTokenRemoteGrant` in `test/e2e/multicluster_mcp_e2e_test.go` (bucket `multicluster`, register in `test/e2e/buckets.sh`): user with a remote grant for one namespace reads it with `?cluster=` through the token, gets forbidden on an ungranted cluster with the same body as an unknown ID, and a namespace-only server grant cannot read `/cluster` data. (done in #1045/#1046 line: test/e2e/multicluster_mcp_e2e_test.go:31 TestMultiCluster_MCPTokenRemoteGrant; renamed TestMultiCluster_TokenRemoteGrant by spec 040) --- diff --git a/test/e2e/buckets.sh b/test/e2e/buckets.sh index 09c1f55d3..a5a0f5cef 100755 --- a/test/e2e/buckets.sh +++ b/test/e2e/buckets.sh @@ -400,7 +400,8 @@ EOF # that TestAPI_AccountRemoval_RevokesSharesAndAllowsSSOReprovision signs in # through. # -# TestMultiCluster_MCPTokenRemoteGrant (spec 037, T039) costs +1 e2e-admin +# TestMultiCluster_TokenRemoteGrant (spec 037 T039, plus spec 040 T052 as its +# sftp-remote-endpoint subtest on the same admin login) costs +1 e2e-admin # login plus one login as its own user, bringing this job to 7 admin logins, # the ceiling: do not add admin logins to this bucket. Run in parallel, its two # logins made TestAPI_I18n_ProblemJSON's failed-login pair hit 429, so it runs @@ -413,7 +414,7 @@ TestAPI_I18n_ModuleLocales TestAPI_SSORoleRules TestMultiCluster_ClusterDispatchAndScopedRBAC TestMultiCluster_GatewayParity -TestMultiCluster_MCPTokenRemoteGrant +TestMultiCluster_TokenRemoteGrant EOF } @@ -536,8 +537,17 @@ TestStandalone_HelmPanelLifecycle EOF } +# sftp owns its cluster: TestSFTP_Lifecycle runs `helm upgrade --reuse-values` +# to enable the SFTP endpoint, so it cannot share a cluster with other tests. +# Admin logins: one. SFTP logins share the auth limiter; see the test's doc +# comment for the per-user budget. amd64 only, like standalone. +bucket_sftp() { cat <<'EOF' +TestSFTP_Lifecycle +EOF +} + bucket_names() { - printf '%s\n' operator api-auth api-roles api-rbac api-agent api-mods ratelimit bot-fast bot-heavy multicluster upgrade postgres-availability postgres-pitr postgres-ha telemetry capture-overhead optional-components restricted-workloads wake-hostport network-isolation management-placement backup-preparation monitoring recovery standalone + printf '%s\n' operator api-auth api-roles api-rbac api-agent api-mods ratelimit bot-fast bot-heavy multicluster upgrade postgres-availability postgres-pitr postgres-ha telemetry capture-overhead optional-components restricted-workloads wake-hostport network-isolation management-placement backup-preparation monitoring recovery standalone sftp } list_bucket() { @@ -566,6 +576,7 @@ list_bucket() { backup-preparation) bucket_backup_preparation ;; recovery) bucket_recovery ;; standalone) bucket_standalone ;; + sftp) bucket_sftp ;; monitoring) bucket_monitoring ;; *) echo "unknown bucket: $1 (known: $(bucket_names | tr '\n' ' '))" >&2 diff --git a/test/e2e/go.mod b/test/e2e/go.mod index e26183b23..1bfd4fed1 100644 --- a/test/e2e/go.mod +++ b/test/e2e/go.mod @@ -16,6 +16,8 @@ require ( github.com/GameplanePanel/gameplane/telemetryschema v0.0.0 github.com/coder/websocket v1.8.15 github.com/gopacket/gopacket v1.8.0 + github.com/pkg/sftp v1.13.12 + golang.org/x/crypto v0.59.0 k8s.io/api v0.37.2 k8s.io/apiextensions-apiserver v0.37.2 k8s.io/apimachinery v0.37.2 @@ -47,6 +49,7 @@ require ( github.com/google/gnostic-models v0.7.1 // indirect github.com/google/uuid v1.6.0 // indirect github.com/json-iterator/go v1.1.12 // indirect + github.com/kr/fs v0.1.0 // indirect github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.3-0.20250322232337-35a7c28c31ee // indirect github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect @@ -54,10 +57,10 @@ require ( github.com/x448/float16 v0.8.4 // indirect go.yaml.in/yaml/v2 v2.4.4 // indirect go.yaml.in/yaml/v3 v3.0.5 // indirect - golang.org/x/net v0.58.0 // indirect + golang.org/x/net v0.62.0 // indirect golang.org/x/oauth2 v0.36.0 // indirect - golang.org/x/sys v0.47.0 // indirect - golang.org/x/term v0.45.0 // indirect + golang.org/x/sys v0.50.0 // indirect + golang.org/x/term v0.48.0 // indirect golang.org/x/text v0.44.0 // indirect golang.org/x/time v0.15.0 // indirect google.golang.org/protobuf v1.36.12 // indirect diff --git a/test/e2e/go.sum b/test/e2e/go.sum index f2cea2d92..fa913e5a4 100644 --- a/test/e2e/go.sum +++ b/test/e2e/go.sum @@ -55,6 +55,8 @@ github.com/gopacket/gopacket v1.8.0 h1:1kiBo8+AXwzvqRBpJ01HvU6GQsb0oPK10tLJpuutE github.com/gopacket/gopacket v1.8.0/go.mod h1:QKowPlTLrQU2rqV5C5I14Aoaid3l8da3kbddibc/Wgk= github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= +github.com/kr/fs v0.1.0 h1:Jskdu9ieNAYnjxsi0LbQp1ulIKZV1LAFgK1tWhpZgl8= +github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= @@ -67,6 +69,8 @@ github.com/modern-go/reflect2 v1.0.3-0.20250322232337-35a7c28c31ee h1:W5t00kpgFd github.com/modern-go/reflect2 v1.0.3-0.20250322232337-35a7c28c31ee/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA= github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= +github.com/pkg/sftp v1.13.12 h1:Myhzy/ZzLPnCtE2F2WtDHsgs8RfgMnH2gfbHuCJhkMU= +github.com/pkg/sftp v1.13.12/go.mod h1:uNkH9roSXglNJqM+glJJi+TQXQUm0fXFWqCFmT8hsN0= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U= github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= @@ -90,14 +94,16 @@ go.yaml.in/yaml/v2 v2.4.4 h1:tuyd0P+2Ont/d6e2rl3be67goVK4R6deVxCUX5vyPaQ= go.yaml.in/yaml/v2 v2.4.4/go.mod h1:gMZqIpDtDqOfM0uNfy0SkpRhvUryYH0Z6wdMYcacYXQ= go.yaml.in/yaml/v3 v3.0.5 h1:N6y/pJk8buWs9NY5ERU2HSMfm+IuD/OtfdAnq6kESPw= go.yaml.in/yaml/v3 v3.0.5/go.mod h1:HVTZu1O7/Vkt2N+BFy8Zza+lnLsABggaTM2ZpNIGuKg= -golang.org/x/net v0.58.0 h1:ynWG7rqYi4ccpTEuPZ2QGWHktVEM9DMCj9yzDE0Q7To= -golang.org/x/net v0.58.0/go.mod h1:YwCddHnFlT7eLQqVprV19OnhLGtc5xOKgE0RyqgfWAU= +golang.org/x/crypto v0.59.0 h1:xS2jhqYbzNrpvkWP2YTDf4TJwBy3ykR03i8vFDxEc7c= +golang.org/x/crypto v0.59.0/go.mod h1:veDyUwATGs3c+vN3VfTbzViMGXeTBk3WyhBOkn+F/4U= +golang.org/x/net v0.62.0 h1:18ELalfM5+XNRwzM2nYqXsZQ9ByS1uhj2O/U7+5jqRY= +golang.org/x/net v0.62.0/go.mod h1:WgDCOTH8iwtB66T4/GfI94AHo/hhdb7Hah9NDseQfiI= golang.org/x/oauth2 v0.36.0 h1:peZ/1z27fi9hUOFCAZaHyrpWG5lwe0RJEEEeH0ThlIs= golang.org/x/oauth2 v0.36.0/go.mod h1:YDBUJMTkDnJS+A4BP4eZBjCqtokkg1hODuPjwiGPO7Q= -golang.org/x/sys v0.47.0 h1:o7XGOvZQCADBQQ4Y7VNq2dRWQR7JmOUW8Kxx4ZsNgWs= -golang.org/x/sys v0.47.0/go.mod h1:4GL1E5IUh+htKOUEOaiffhrAeqysfVGipDYzABqnCmw= -golang.org/x/term v0.45.0 h1:NwWyBmoJCbfTHpxrWoZ9C6/VxOf7ic219I8xZZFdrf0= -golang.org/x/term v0.45.0/go.mod h1:9aqxs0blBcrm/n0L9QW0aRVD+ktan8ssZromtqJC43w= +golang.org/x/sys v0.50.0 h1:dkKZEFTEKaLr1sjhs0WiKqoi8Jj5nHbS3Njmx1UoMJs= +golang.org/x/sys v0.50.0/go.mod h1:hNLxWAXmnKAxqDtdwIYC4bM9oQPEecfsnNMuSxOs3og= +golang.org/x/term v0.48.0 h1:G6UU1eiSB8nl3DzeUGt7Mg+2SctI8tPS6Z5/mBt6cOk= +golang.org/x/term v0.48.0/go.mod h1:BRDLHCZr2SUjIeBHHpRyQeC9xzSAVbzY2rvKgafnHf4= golang.org/x/text v0.44.0 h1:YItdp/mQNGnsmrgpcdA5yQ3bnRxCfo/Tj/iByGW9GGo= golang.org/x/text v0.44.0/go.mod h1:S4FR1waQ9LbjQTls97SyRjDaUUVkaM+cXwwuG/G+MwY= golang.org/x/time v0.15.0 h1:bbrp8t3bGUeFOx08pvsMYRTCVSMk89u4tKbNOZbp88U= diff --git a/test/e2e/multicluster_mcp_e2e_test.go b/test/e2e/multicluster_mcp_e2e_test.go index c171f86c4..77695a433 100644 --- a/test/e2e/multicluster_mcp_e2e_test.go +++ b/test/e2e/multicluster_mcp_e2e_test.go @@ -11,7 +11,13 @@ import ( "time" ) -// TestMultiCluster_MCPTokenRemoteGrant proves that a personal MCP token +// TestMultiCluster_TokenRemoteGrant checks the per-cluster tokens of a +// registered REMOTE cluster: the personal MCP token (below) and, in the +// sftp-remote-endpoint subtest, the remote cluster's SFTP endpoint and SFTP +// service tokens (remoteSFTPEndpointChecks, multicluster_sftp_e2e_test.go). +// Both share one admin login, because this bucket is at its login ceiling. +// +// The MCP part proves that a personal MCP token // follows its owner's per-cluster grants on a registered REMOTE cluster, not // just the home cluster. The owner has no local grant at all, and only a // namespace-scoped servers:read grant on the remote cluster. With that token: @@ -28,7 +34,7 @@ import ( // retried on 429. Go runs non-parallel tests before the parallel ones resume, // so this test's two logins happen first, and it waits at the end until the // limiter has refilled them (IP limiter: 5 per minute). -func TestMultiCluster_MCPTokenRemoteGrant(t *testing.T) { +func TestMultiCluster_TokenRemoteGrant(t *testing.T) { _, clusterBName := ensureClusterB(t) envInstance.BootstrapAdmin(t, adminUsername, adminPassword) @@ -120,6 +126,11 @@ func TestMultiCluster_MCPTokenRemoteGrant(t *testing.T) { if status != http.StatusBadRequest && status != http.StatusForbidden { t.Errorf("GET /pods kube-system on remote cluster with namespace-only grant: status=%d want a 400/403 refusal body=%s", status, b) } + + // --- Remote SFTP endpoint and service tokens (spec 040, T052) ----------- + t.Run("sftp-remote-endpoint", func(t *testing.T) { + remoteSFTPEndpointChecks(t, admin, clusterID) + }) } // mcpMCCreateRole creates a custom role and removes it at cleanup. diff --git a/test/e2e/multicluster_sftp_e2e_test.go b/test/e2e/multicluster_sftp_e2e_test.go new file mode 100644 index 000000000..093a47004 --- /dev/null +++ b/test/e2e/multicluster_sftp_e2e_test.go @@ -0,0 +1,141 @@ +//go:build e2e + +package e2e + +import ( + "crypto/ed25519" + "crypto/rand" + "encoding/json" + "fmt" + "net/http" + "strings" + "testing" + + "golang.org/x/crypto/ssh" +) + +// remoteSFTPEndpointChecks covers spec 040's remote-cluster endpoint on the +// central panel, as the sftp-remote-endpoint subtest of +// TestMultiCluster_TokenRemoteGrant (it reuses that test's admin login and +// registered remote cluster clusterID): a registered remote cluster gets its +// own SFTP endpoint address, host key fingerprint and service tokens. It checks +// the admin contract only: PUT sets the endpoint, tokens are shown once and +// capped at two active, the listing never echoes a token, a revoked token +// disappears, and the panel's own cluster refuses a remote endpoint. +// +// Not covered here: the SFTP pod running on cluster B and logging in to this +// API across clusters. The dual-cluster job has no route from cluster B's pods +// to this cluster's API, so that path stays a manual check (quickstart §10). +func remoteSFTPEndpointChecks(t *testing.T, admin *APIClient, clusterID string) { + t.Helper() + // A real SHA256 fingerprint in OpenSSH form; the panel only checks the shape. + pub, _, err := ed25519.GenerateKey(rand.Reader) + if err != nil { + t.Fatalf("generate host key: %v", err) + } + sshPub, err := ssh.NewPublicKey(pub) + if err != nil { + t.Fatalf("ssh public key: %v", err) + } + fingerprint := ssh.FingerprintSHA256(sshPub) + const address = "sftp.e2e-remote.example.test:2222" + + resp, body, err := admin.Do(http.MethodPut, "/clusters/"+clusterID+"/sftp", map[string]string{ + "address": address, + "hostKeyFingerprint": fingerprint, + }) + if err != nil { + t.Fatalf("PUT remote sftp endpoint: %v", err) + } + _ = resp.Body.Close() + if resp.StatusCode != http.StatusOK { + t.Fatalf("PUT remote sftp endpoint: status=%d body=%s", resp.StatusCode, body) + } + + mint := func() (int64, string) { + t.Helper() + resp, body, err := admin.Post("/clusters/"+clusterID+"/sftp-token", nil) + if err != nil { + t.Fatalf("POST sftp-token: %v", err) + } + _ = resp.Body.Close() + if resp.StatusCode != http.StatusCreated { + t.Fatalf("POST sftp-token: status=%d body=%s", resp.StatusCode, body) + } + var out struct { + ID int64 `json:"id"` + Token string `json:"token"` + } + if err := json.Unmarshal(body, &out); err != nil { + t.Fatalf("decode sftp-token: %v", err) + } + if !strings.HasPrefix(out.Token, "gpsftps_") || out.ID == 0 { + t.Fatalf("sftp-token: want gpsftps_ token and id, got id=%d token=%q", out.ID, out.Token) + } + return out.ID, out.Token + } + + firstID, firstToken := mint() + _, _ = mint() + + // Error ids travel in the problem+json body, so ask for it. + if status, id, _ := ssoRulesProblem(t, admin, http.MethodPost, "/clusters/"+clusterID+"/sftp-token", nil); status != http.StatusConflict || id != "server.sftp.token_limit_reached" { + t.Fatalf("third sftp token: want 409 server.sftp.token_limit_reached, got status=%d id=%s", status, id) + } + + resp, body, err = admin.Get("/clusters/" + clusterID + "/sftp") + if err != nil { + t.Fatalf("GET cluster sftp: %v", err) + } + _ = resp.Body.Close() + if resp.StatusCode != http.StatusOK { + t.Fatalf("GET cluster sftp: status=%d body=%s", resp.StatusCode, body) + } + var view struct { + Local bool `json:"local"` + Address string `json:"address"` + HostKeyFingerprint string `json:"hostKeyFingerprint"` + Tokens []struct { + ID int64 `json:"id"` + } `json:"tokens"` + } + if err := json.Unmarshal(body, &view); err != nil { + t.Fatalf("decode cluster sftp view: %v", err) + } + if view.Local || view.Address != address || view.HostKeyFingerprint != fingerprint { + t.Fatalf("cluster sftp view: local=%v address=%q fingerprint=%q, want remote %q %q", + view.Local, view.Address, view.HostKeyFingerprint, address, fingerprint) + } + if len(view.Tokens) != 2 { + t.Fatalf("cluster sftp view: want 2 active tokens, got %d", len(view.Tokens)) + } + if strings.Contains(string(body), firstToken) { + t.Fatalf("cluster sftp view leaks a token secret") + } + + resp, body, err = admin.Delete(fmt.Sprintf("/clusters/%s/sftp-token/%d", clusterID, firstID)) + if err != nil { + t.Fatalf("revoke sftp token: %v", err) + } + _ = resp.Body.Close() + if resp.StatusCode != http.StatusNoContent { + t.Fatalf("revoke sftp token: status=%d body=%s", resp.StatusCode, body) + } + resp, body, err = admin.Get("/clusters/" + clusterID + "/sftp") + if err != nil { + t.Fatalf("GET cluster sftp after revoke: %v", err) + } + _ = resp.Body.Close() + if err := json.Unmarshal(body, &view); err != nil || len(view.Tokens) != 1 { + t.Fatalf("after revoke: want 1 active token, got %d (%v) body=%s", len(view.Tokens), err, body) + } + + // The panel's own cluster takes its endpoint from Helm, never from PUT. + status, id, _ := ssoRulesProblem(t, admin, http.MethodPut, "/clusters/local/sftp", map[string]string{ + "address": address, + "hostKeyFingerprint": fingerprint, + }) + if status < 400 || status >= 500 || id != "server.sftp.endpoint_local" { + t.Fatalf("PUT local sftp endpoint: want a 4xx server.sftp.endpoint_local refusal, got status=%d id=%s", status, id) + } +} diff --git a/test/e2e/sftp_e2e_test.go b/test/e2e/sftp_e2e_test.go new file mode 100644 index 000000000..7671dcb1c --- /dev/null +++ b/test/e2e/sftp_e2e_test.go @@ -0,0 +1,566 @@ +//go:build e2e + +package e2e + +import ( + "bytes" + "crypto/ed25519" + "crypto/rand" + "crypto/sha256" + "encoding/json" + "errors" + "fmt" + "io" + "net/http" + "os" + "strings" + "testing" + "time" + + "github.com/pkg/sftp" + "golang.org/x/crypto/ssh" + apierrors "k8s.io/apimachinery/pkg/api/errors" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +const ( + sftpSystemNS = "gameplane-system" + sftpGamesNS = "gameplane-games" + sftpService = "svc/gameplane-sftp" + sftpServicePort = 2222 + sftpHostKeySecret = "gameplane-sftp-host-key" + // sftpUploadSize is the round-trip payload. The spec's 2 GiB (SC-003) is too + // slow for a CI runner behind kubectl port-forward, so the CI payload is + // 64 MiB. It still exercises the streamed write path, a ranged download and + // an interrupted upload. Raise it only for a manual run that needs the full size. + sftpUploadSize = 64 << 20 +) + +// sftpHostKey reads the chart-generated host key Secret and returns its public +// half, so every SSH dial pins the server to the key the operator installed. +func sftpHostKey(t *testing.T) ssh.PublicKey { + t.Helper() + sec, err := envInstance.K8s.CoreV1().Secrets(sftpSystemNS).Get(t.Context(), sftpHostKeySecret, metav1.GetOptions{}) + if err != nil { + t.Fatalf("read %s: %v", sftpHostKeySecret, err) + } + signer, err := ssh.ParsePrivateKey(sec.Data["host_key"]) + if err != nil { + t.Fatalf("parse host_key: %v", err) + } + return signer.PublicKey() +} + +// sftpDial opens an SSH connection with auth and starts the SFTP subsystem. +// It returns the error instead of failing so negative logins can be asserted. +func sftpDial(port int, user string, auth ssh.AuthMethod, hostKey ssh.PublicKey) (*ssh.Client, *sftp.Client, error) { + cfg := &ssh.ClientConfig{ + User: user, + Auth: []ssh.AuthMethod{auth}, + HostKeyCallback: ssh.FixedHostKey(hostKey), + Timeout: 20 * time.Second, + } + conn, err := ssh.Dial("tcp", fmt.Sprintf("127.0.0.1:%d", port), cfg) + if err != nil { + return nil, nil, err + } + sc, err := sftp.NewClient(conn) + if err != nil { + _ = conn.Close() + return nil, nil, err + } + return conn, sc, nil +} + +// sftpEntryNames returns the names of a directory listing, or the error. +func sftpEntryNames(sc *sftp.Client, dir string) ([]string, error) { + entries, err := sc.ReadDir(dir) + if err != nil { + return nil, err + } + names := make([]string, 0, len(entries)) + for _, e := range entries { + names = append(names, e.Name()) + } + return names, nil +} + +func sftpContains(names []string, want string) bool { + for _, n := range names { + if n == want { + return true + } + } + return false +} + +// sftpSHA256 hashes a whole reader. +func sftpSHA256(t *testing.T, r io.Reader) [32]byte { + t.Helper() + h := sha256.New() + if _, err := io.Copy(h, r); err != nil { + t.Fatalf("hash: %v", err) + } + var sum [32]byte + copy(sum[:], h.Sum(nil)) + return sum +} + +// sftpNewKey generates an ed25519 client key and returns its authorized_keys +// line (for the API) and an SSH auth method (for the client). +func sftpNewKey(t *testing.T) (string, ssh.AuthMethod) { + t.Helper() + pub, priv, err := ed25519.GenerateKey(rand.Reader) + if err != nil { + t.Fatalf("generate key: %v", err) + } + sshPub, err := ssh.NewPublicKey(pub) + if err != nil { + t.Fatalf("ssh public key: %v", err) + } + signer, err := ssh.NewSignerFromKey(priv) + if err != nil { + t.Fatalf("ssh signer: %v", err) + } + line := strings.TrimSpace(string(ssh.MarshalAuthorizedKey(sshPub))) + return line, ssh.PublicKeys(signer) +} + +// sftpAddKey registers an authorized_keys line on the caller's account and +// returns the key id. +func sftpAddKey(t *testing.T, cli *APIClient, name, line string) int64 { + t.Helper() + resp, body, err := cli.Post("/users/me/sftp/keys", map[string]string{"name": name, "publicKey": line}) + if err != nil { + t.Fatalf("add sftp key: %v", err) + } + _ = resp.Body.Close() + if resp.StatusCode != http.StatusCreated { + t.Fatalf("add sftp key: status=%d body=%s", resp.StatusCode, body) + } + var out struct { + ID int64 `json:"id"` + } + if err := json.Unmarshal(body, &out); err != nil || out.ID == 0 { + t.Fatalf("add sftp key: no id in %s (%v)", body, err) + } + return out.ID +} + +// sftpGeneratePassword replaces the caller's SFTP password and returns it. +func sftpGeneratePassword(t *testing.T, cli *APIClient, length int) string { + t.Helper() + resp, body, err := cli.Post("/users/me/sftp/password", map[string]int{"length": length}) + if err != nil { + t.Fatalf("generate sftp password: %v", err) + } + _ = resp.Body.Close() + if resp.StatusCode != http.StatusOK { + t.Fatalf("generate sftp password: status=%d body=%s", resp.StatusCode, body) + } + var out struct { + Password string `json:"password"` + } + if err := json.Unmarshal(body, &out); err != nil || len(out.Password) != length { + t.Fatalf("generate sftp password: want %d chars, got %q (%v)", length, out.Password, err) + } + return out.Password +} + +// TestSFTP_Lifecycle walks spec 040 on the bucket's own cluster: the endpoint +// is off by default, `helm upgrade --reuse-values` enables it, then one +// user with a key and one with a password browse, download, upload, rename +// and delete through SFTP. The per-server login form, the read-only +// permission matrix, the audit `source` field, a stopped server, and +// revocation are checked in the same run. +// +// Admin logins: one. Alice (read and write): API login, key login, +// per-server password login, a reconnect after the simulated network drop in +// the interrupted-upload subtest, and one refused login after revocation (5 +// of her 6-per-user burst). Bob (read only): API login, password login, and +// one refused login for a server he cannot read (3). Total 9 logins against +// the per-IP burst of 10. The reconnect reuses alice's key and replaces the +// session that the earlier subtests opened, so no extra login is spent on the +// browse, upload or revocation steps. Any new login here needs a new bucket. +func TestSFTP_Lifecycle(t *testing.T) { + t.Parallel() + + suffix := time.Now().UnixNano() + gsName := fmt.Sprintf("e2e-sftp-gs-%d", suffix) + tmplName := fmt.Sprintf("e2e-sftp-tmpl-%d", suffix) + aliceRole := fmt.Sprintf("e2e-sftp-rw-%d", suffix) + bobRole := fmt.Sprintf("e2e-sftp-ro-%d", suffix) + uploadName := "e2e-sftp-upload.bin" + renamedName := "e2e-sftp-renamed.bin" + dirName := "e2e-sftp-dir" + + if !t.Run("disabled", func(t *testing.T) { + _, err := envInstance.K8s.AppsV1().Deployments(sftpSystemNS).Get(t.Context(), "gameplane-sftp", metav1.GetOptions{}) + if !apierrors.IsNotFound(err) { + t.Fatalf("gameplane-sftp deployment: want NotFound by default, got err=%v", err) + } + }) { + return + } + + if !t.Run("enable", func(t *testing.T) { + helmUpgradeReuse(t.Context(), t, "sftp.enabled=true") + envInstance.Eventually(t, 3*time.Minute, func() (bool, string) { + d, err := envInstance.K8s.AppsV1().Deployments(sftpSystemNS).Get(t.Context(), "gameplane-sftp", metav1.GetOptions{}) + if err != nil { + return false, err.Error() + } + return d.Status.ReadyReplicas >= 1, fmt.Sprintf("gameplane-sftp readyReplicas=%d", d.Status.ReadyReplicas) + }) + }) { + return + } + + port, stopForward := envInstance.PortForward(t, sftpSystemNS, sftpService, sftpServicePort) + t.Cleanup(stopForward) + hostKey := sftpHostKey(t) + + applyBusyboxTemplate(t, tmplName) + applyBusyboxGameServer(t, sftpGamesNS, gsName, tmplName) + requireAgentReady(t, sftpGamesNS, gsName) + + envInstance.BootstrapAdmin(t, adminUsername, adminPassword) + admin := envInstance.APIClient(t, adminUsername, adminPassword) + t.Cleanup(admin.Close) + + for _, r := range []struct { + name string + perms []string + }{ + {aliceRole, []string{"servers:read", "servers:write"}}, + {bobRole, []string{"servers:read"}}, + } { + resp, body, err := admin.Post("/roles", map[string]any{ + "name": r.name, + "description": "e2e sftp access", + "permissions": r.perms, + }) + if err != nil { + t.Fatalf("create role %s: %v", r.name, err) + } + _ = resp.Body.Close() + if resp.StatusCode != http.StatusCreated { + t.Fatalf("create role %s: status=%d body=%s", r.name, resp.StatusCode, body) + } + roleName := r.name + t.Cleanup(func() { + if d, _, _ := admin.Delete("/roles/" + roleName); d != nil { + _ = d.Body.Close() + } + }) + } + + aliceName, alicePW, aliceID := envInstance.CreateUser(t, admin, aliceRole, "e2e-sftp-alice") + t.Cleanup(func() { + if d, _, _ := admin.Delete("/users/" + aliceID); d != nil { + _ = d.Body.Close() + } + }) + bobName, bobPW, bobID := envInstance.CreateUser(t, admin, bobRole, "e2e-sftp-bob") + t.Cleanup(func() { + if d, _, _ := admin.Delete("/users/" + bobID); d != nil { + _ = d.Body.Close() + } + }) + + alice := envInstance.APIClient(t, aliceName, alicePW) + t.Cleanup(alice.Close) + keyLine, keyAuth := sftpNewKey(t) + keyID := sftpAddKey(t, alice, "e2e-sftp-laptop", keyLine) + + var aliceSSH *ssh.Client + var aliceSFTP *sftp.Client + // alice's connection lives across the subtests below (and is replaced by + // the interrupted-upload subtest's reconnect), so the parent test closes it, not the + // login subtest: a subtest's cleanup runs when that subtest ends. + t.Cleanup(func() { + if aliceSSH != nil { + _ = aliceSSH.Close() + } + }) + if !t.Run("login-and-browse", func(t *testing.T) { + var err error + aliceSSH, aliceSFTP, err = sftpDial(port, aliceName, keyAuth, hostKey) + if err != nil { + t.Fatalf("alice key login: %v", err) + } + + names, err := sftpEntryNames(aliceSFTP, "/") + if err != nil { + t.Fatalf("list root: %v", err) + } + if !sftpContains(names, gsName) { + t.Fatalf("root listing %v: missing server %s", names, gsName) + } + for _, n := range names { + if strings.HasPrefix(n, ".") { + t.Fatalf("root listing exposes dotfile %q", n) + } + } + }) { + return + } + + if !t.Run("upload-download-and-edit", func(t *testing.T) { + payload := make([]byte, sftpUploadSize) + if _, err := rand.Read(payload); err != nil { + t.Fatalf("random payload: %v", err) + } + want := sha256.Sum256(payload) + + target := "/" + gsName + "/" + uploadName + f, err := aliceSFTP.Create(target) + if err != nil { + t.Fatalf("create %s: %v", target, err) + } + if _, err := io.Copy(f, bytes.NewReader(payload)); err != nil { + t.Fatalf("upload %s: %v", target, err) + } + if err := f.Close(); err != nil { + t.Fatalf("close %s: %v", target, err) + } + + // Full download and checksum against the bytes uploaded. + rf, err := aliceSFTP.Open(target) + if err != nil { + t.Fatalf("open %s: %v", target, err) + } + got := sftpSHA256(t, rf) + _ = rf.Close() + if got != want { + t.Fatalf("download checksum mismatch for %s", target) + } + + // Ranged download from the middle (the resume path a client uses). + half := int64(sftpUploadSize / 2) + rf, err = aliceSFTP.Open(target) + if err != nil { + t.Fatalf("reopen %s: %v", target, err) + } + tail := sftpSHA256(t, io.NewSectionReader(rf, half, int64(sftpUploadSize)-half)) + _ = rf.Close() + if tail != sha256.Sum256(payload[half:]) { + t.Fatalf("ranged download from offset %d checksum mismatch", half) + } + + if err := aliceSFTP.Rename(target, "/"+gsName+"/"+renamedName); err != nil { + t.Fatalf("rename: %v", err) + } + if err := aliceSFTP.Mkdir("/" + gsName + "/" + dirName); err != nil { + t.Fatalf("mkdir: %v", err) + } + if err := aliceSFTP.RemoveDirectory("/" + gsName + "/" + dirName); err != nil { + t.Fatalf("rmdir: %v", err) + } + if err := aliceSFTP.Remove("/" + gsName + "/" + renamedName); err != nil { + t.Fatalf("remove: %v", err) + } + }) { + return + } + + // Interrupted upload (spec US2 scenario 2, SC-003 as amended 2026-11-23): + // uploads are atomic. Alice's key session writes the first half, then its + // connection is dropped with the file still open. The API commits only a + // body that ends cleanly, so no partial file may appear. She reconnects + // with the same key and sends the whole file again, which must match the + // source byte for byte. + if !t.Run("interrupted-upload-atomic", func(t *testing.T) { + payload := make([]byte, sftpUploadSize) + if _, err := rand.Read(payload); err != nil { + t.Fatalf("random payload: %v", err) + } + want := sha256.Sum256(payload) + half := sftpUploadSize / 2 + target := "/" + gsName + "/e2e-sftp-interrupted.bin" + + f, err := aliceSFTP.Create(target) + if err != nil { + t.Fatalf("create %s: %v", target, err) + } + if _, err := f.Write(payload[:half]); err != nil { + t.Fatalf("first half of %s: %v", target, err) + } + // Simulated network drop: the file handle is abandoned, not closed. + _ = aliceSSH.Close() + + aliceSSH, aliceSFTP, err = sftpDial(port, aliceName, keyAuth, hostKey) + if err != nil { + t.Fatalf("alice reconnect after drop: %v", err) + } + // The aborted stream must never leave a partial file behind. Poll for a + // few seconds so a late commit would be caught, not missed. + deadline := time.Now().Add(10 * time.Second) + for time.Now().Before(deadline) { + st, err := aliceSFTP.Stat(target) + if err == nil { + t.Fatalf("interrupted upload left a %d-byte file at %s, want none", st.Size(), target) + } + if !errors.Is(err, os.ErrNotExist) { + t.Fatalf("stat %s after drop: %v", target, err) + } + time.Sleep(time.Second) + } + + rf, err := aliceSFTP.Create(target) + if err != nil { + t.Fatalf("recreate %s: %v", target, err) + } + if _, err := rf.Write(payload); err != nil { + t.Fatalf("upload %s again: %v", target, err) + } + if err := rf.Close(); err != nil { + t.Fatalf("close %s: %v", target, err) + } + + dl, err := aliceSFTP.Open(target) + if err != nil { + t.Fatalf("open %s: %v", target, err) + } + got := sftpSHA256(t, dl) + _ = dl.Close() + if got != want { + t.Fatalf("re-sent upload %s checksum mismatch", target) + } + if err := aliceSFTP.Remove(target); err != nil { + t.Fatalf("remove %s: %v", target, err) + } + }) { + return + } + + if !t.Run("audit-source-sftp", func(t *testing.T) { + envInstance.Eventually(t, time.Minute, func() (bool, string) { + resp, body, err := admin.Get("/admin/audit?limit=200") + if err != nil { + return false, err.Error() + } + _ = resp.Body.Close() + if resp.StatusCode != http.StatusOK { + return false, fmt.Sprintf("GET /admin/audit: status=%d", resp.StatusCode) + } + return strings.Contains(string(body), `"source":"sftp"`), "no audit row with source sftp yet" + }) + }) { + return + } + + if !t.Run("per-server-login", func(t *testing.T) { + // alice+ roots the session at that server's files (OD-3). + aliceSrvPW := sftpGeneratePassword(t, alice, 32) + conn, sc, err := sftpDial(port, aliceName+"+"+gsName, ssh.Password(aliceSrvPW), hostKey) + if err != nil { + t.Fatalf("alice+%s password login: %v", gsName, err) + } + t.Cleanup(func() { _ = conn.Close() }) + names, err := sftpEntryNames(sc, "/") + if err != nil { + t.Fatalf("list per-server root: %v", err) + } + if sftpContains(names, gsName) { + t.Fatalf("per-server root %v should not show the server folder itself", names) + } + }) { + return + } + + bob := envInstance.APIClient(t, bobName, bobPW) + t.Cleanup(bob.Close) + bobPassword := sftpGeneratePassword(t, bob, 24) + + if !t.Run("read-only-permission-matrix", func(t *testing.T) { + conn, sc, err := sftpDial(port, bobName, ssh.Password(bobPassword), hostKey) + if err != nil { + t.Fatalf("bob password login: %v", err) + } + t.Cleanup(func() { _ = conn.Close() }) + + names, err := sftpEntryNames(sc, "/") + if err != nil { + t.Fatalf("bob list root: %v", err) + } + if !sftpContains(names, gsName) { + t.Fatalf("bob root listing %v: missing readable server %s", names, gsName) + } + if err := sc.Mkdir("/" + gsName + "/bob-denied"); err == nil { + t.Fatalf("bob mkdir on %s: want permission denied", gsName) + } + if f, err := sc.Create("/" + gsName + "/bob-denied.txt"); err == nil { + _ = f.Close() + t.Fatalf("bob create on %s: want permission denied", gsName) + } + + // A server bob cannot read is refused exactly like a wrong password. + if c, _, err := sftpDial(port, bobName+"+e2e-sftp-missing", ssh.Password(bobPassword), hostKey); err == nil { + _ = c.Close() + t.Fatalf("bob login to an unreadable server: want refusal") + } + }) { + return + } + + if !t.Run("stopped-server-files", func(t *testing.T) { + resp, body, err := alice.Post("/servers/"+gsName+":stop", nil) + if err != nil { + t.Fatalf("stop server: %v", err) + } + _ = resp.Body.Close() + if resp.StatusCode/100 != 2 { + t.Fatalf("stop server: status=%d body=%s", resp.StatusCode, body) + } + // The file-only pod serves the folder while the game stays stopped. + envInstance.Eventually(t, 3*time.Minute, func() (bool, string) { + if _, err := sftpEntryNames(aliceSFTP, "/"+gsName); err != nil { + return false, err.Error() + } + return true, "" + }) + pods, err := envInstance.K8s.CoreV1().Pods(sftpGamesNS).List(t.Context(), metav1.ListOptions{ + LabelSelector: "app.kubernetes.io/name=gameplane-files,app.kubernetes.io/instance=" + gsName, + }) + if err != nil { + t.Fatalf("list files-only pods: %v", err) + } + if len(pods.Items) == 0 { + t.Fatalf("no gameplane-files pod for stopped server %s", gsName) + } + for _, p := range pods.Items { + for _, c := range p.Spec.Containers { + for _, cp := range c.Ports { + if cp.HostPort != 0 { + t.Fatalf("files-only pod %s exposes host port %d", p.Name, cp.HostPort) + } + } + } + } + }) { + return + } + + t.Run("revocation", func(t *testing.T) { + resp, body, err := admin.Delete(fmt.Sprintf("/users/%s/sftp/keys/%d", aliceID, keyID)) + if err != nil { + t.Fatalf("revoke key: %v", err) + } + _ = resp.Body.Close() + if resp.StatusCode/100 != 2 { + t.Fatalf("revoke key: status=%d body=%s", resp.StatusCode, body) + } + // SC-006 and FR-007: an open session ends within 60 s of revocation. + envInstance.Eventually(t, 60*time.Second, func() (bool, string) { + if _, err := sftpEntryNames(aliceSFTP, "/"); err != nil { + return true, "" + } + return false, "alice's session still open after key revocation" + }) + if c, _, err := sftpDial(port, aliceName, keyAuth, hostKey); err == nil { + _ = c.Close() + t.Fatalf("alice key login after revocation: want refusal") + } + }) +} diff --git a/test/e2e/suite-components.json b/test/e2e/suite-components.json index 98dec6340..7e29c18a4 100644 --- a/test/e2e/suite-components.json +++ b/test/e2e/suite-components.json @@ -59,7 +59,8 @@ { "tests": "^TestGameServer_CaptureOverhead_Joined$", "components": ["capture-sidecar", "gameproto", "modules"], "paths": ["test/e2e/internal/minecraft-java/", "test/e2e/internal/probe/", "test/e2e/gameprobe_job.go"] }, - { "tests": "^TestMultiCluster_", "components": ["operator", "api", "agent", "capture-sidecar"] }, + { "tests": "^TestMultiCluster_", "components": ["operator", "api", "agent", "capture-sidecar", "sftp"] }, + { "tests": "^TestSFTP_", "components": ["operator", "api", "agent", "sftp", "charts"] }, { "tests": "^TestUpgrade_", "components": ["operator", "api", "agent"] }, { "tests": "^TestPanel_Postgres(ActiveActiveFailover|PointInTimeRecovery)$", "components": ["api", "operator", "agent"] }, { "tests": "^TestTelemetry", "components": ["operator", "api", "telemetry-receiver", "telemetryschema"], diff --git a/web/src/components/sftp/ClusterSftpDrawer.tsx b/web/src/components/sftp/ClusterSftpDrawer.tsx new file mode 100644 index 000000000..f672b9b62 --- /dev/null +++ b/web/src/components/sftp/ClusterSftpDrawer.tsx @@ -0,0 +1,258 @@ +// Cluster SFTP drawer (spec 040, US4; design Screen/Clusters — SFTP (remote-lab) 309702331-255, +// token created 309702331-453, token limit 309702331-643). Opened from a cluster card on Clusters by a +// user with cluster:manage. It sets the remote cluster's SFTP endpoint (address and host key fingerprint), +// lists its active endpoint tokens, creates a token (shown once) and revokes one. The panel's own cluster +// reads its endpoint from Helm values and the host key Secret, so its endpoint is shown read-only. + +import { useState } from "react"; +import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query"; +import { + Button, + Description, + Input, + Label, + Modal, + ModalBackdrop, + ModalBody, + ModalContainer, + ModalDialog, + ModalFooter, + ModalHeader, + ModalHeading, +} from "@heroui/react"; +import { AlertCircle, Copy, Trash2 } from "lucide-react"; +import { errorTextIntl } from "@/lib/errors"; +import { formatRelative } from "@/lib/utils"; +import { useOptionalIntl } from "@/lib/i18n/format"; +import { + CLUSTER_SFTP_TOKEN_LIMIT, + createClusterSftpToken, + getClusterSftp, + putClusterSftp, + revokeClusterSftpToken, + type ClusterSftpEndpoint, + type ClusterSftpTokenCreated, + type ClusterSftpView, +} from "@/lib/api"; + +// Same shape the API checks (sftpFingerprintPattern in sftp_cluster.go). Checked here for immediate feedback. +const FINGERPRINT_PATTERN = /^SHA256:[A-Za-z0-9+/]{43}$/; + +export function ClusterSftpDrawer({ + cluster, + label, + onClose, +}: { + cluster: string; + label: string; + onClose: () => void; +}) { + const intl = useOptionalIntl(); + const qc = useQueryClient(); + const queryKey = ["clusters", cluster, "sftp"] as const; + // Form fields stay undefined until the admin edits them, so the saved values show until then. + const [addressDraft, setAddressDraft] = useState(undefined); + const [fingerprintDraft, setFingerprintDraft] = useState(undefined); + const [created, setCreated] = useState(null); + + const { data, error, isPending } = useQuery({ + queryKey, + queryFn: () => getClusterSftp(cluster), + }); + + const refresh = () => { + void qc.invalidateQueries({ queryKey }); + }; + + const save = useMutation({ + mutationFn: (body: { address: string; hostKeyFingerprint: string }) => putClusterSftp(cluster, body), + onSuccess: (endpoint: ClusterSftpEndpoint) => { + qc.setQueryData(queryKey, (prev) => + prev ? { ...prev, address: endpoint.address, hostKeyFingerprint: endpoint.hostKeyFingerprint } : prev, + ); + setAddressDraft(undefined); + setFingerprintDraft(undefined); + refresh(); + }, + }); + + const createToken = useMutation({ + mutationFn: () => createClusterSftpToken(cluster), + onSuccess: (token) => { + setCreated(token); + refresh(); + }, + }); + + const revoke = useMutation({ + mutationFn: (tokenId: number) => revokeClusterSftpToken(cluster, tokenId), + onSuccess: refresh, + }); + + const address = addressDraft ?? data?.address ?? ""; + const fingerprint = fingerprintDraft ?? data?.hostKeyFingerprint ?? ""; + const tokenCount = data?.tokens.length ?? 0; + const atLimit = tokenCount >= CLUSTER_SFTP_TOKEN_LIMIT; + const canSave = address.trim() !== "" && FINGERPRINT_PATTERN.test(fingerprint.trim()) && !save.isPending; + const actionError = save.error ?? createToken.error ?? revoke.error; + const actionFallback = save.error + ? intl.formatMessage({ id: "web.components.sftp.cluster_drawer.save_failed", defaultMessage: "The endpoint could not be saved.", description: "Cluster SFTP drawer: fallback error when saving the endpoint fails" }) + : createToken.error + ? intl.formatMessage({ id: "web.components.sftp.cluster_drawer.create_failed", defaultMessage: "The token could not be created.", description: "Cluster SFTP drawer: fallback error when creating an endpoint token fails" }) + : intl.formatMessage({ id: "web.components.sftp.cluster_drawer.revoke_failed", defaultMessage: "The token could not be revoked.", description: "Cluster SFTP drawer: fallback error when revoking an endpoint token fails" }); + + return ( + <> + !open && onClose()}> + + + + + + {intl.formatMessage({ id: "web.components.sftp.cluster_drawer.title", defaultMessage: "SFTP · {cluster}", description: "Cluster SFTP drawer: heading; {cluster} is the cluster display name" }, { cluster: label })} + + + {intl.formatMessage({ id: "web.components.sftp.cluster_drawer.description", defaultMessage: "Users connect to this address with their own SSH key or SFTP password. Their permissions on this cluster decide what they can reach.", description: "Cluster SFTP drawer: explains that users connect to the address and their cluster permissions decide what they reach" })} + + + + {error ? ( +

+ {errorTextIntl(intl, error, intl.formatMessage({ id: "web.components.sftp.cluster_drawer.load_failed", defaultMessage: "Could not load the SFTP endpoint.", description: "Cluster SFTP drawer: error when the cluster's SFTP endpoint cannot be loaded" }))} +

+ ) : isPending || !data ? ( +

{intl.formatMessage({ id: "web.components.sftp.cluster_drawer.loading", defaultMessage: "Loading…", description: "Cluster SFTP drawer: loading text" })}

+ ) : ( + <> +
+ {data.local ? ( + <> +

{intl.formatMessage({ id: "web.components.sftp.cluster_drawer.local_note", defaultMessage: "This is the panel's own cluster. Its address comes from the chart and its host key fingerprint from the panel's host key.", description: "Cluster SFTP drawer: note for the panel's own cluster, whose endpoint is read-only and comes from the chart and host key" })}

+

{data.address ?? intl.formatMessage({ id: "web.common.empty_value", defaultMessage: "—", description: "Shown in place of a value that is not set" })}

+

{data.hostKeyFingerprint ?? intl.formatMessage({ id: "web.common.empty_value", defaultMessage: "—", description: "Shown in place of a value that is not set" })}

+ + ) : ( +
{ + event.preventDefault(); + if (canSave) save.mutate({ address: address.trim(), hostKeyFingerprint: fingerprint.trim() }); + }} + > +
+ + setAddressDraft(event.target.value)} placeholder={intl.formatMessage({ id: "web.components.sftp.cluster_drawer.address_placeholder", defaultMessage: "sftp.example.com:2222", description: "Cluster SFTP drawer: example value shown inside the empty address field; a sample, not a default" })} className="font-mono" /> +
+
+ + setFingerprintDraft(event.target.value)} placeholder={intl.formatMessage({ id: "web.components.sftp.fingerprint_placeholder", defaultMessage: "SHA256:", description: "Cluster SFTP drawer: placeholder in the host key fingerprint field; the fingerprint format prefix, keep as is" })} className="font-mono text-xs" /> +
+ +
+ )} +
+ +
+

+ {intl.formatMessage({ id: "web.components.sftp.cluster_drawer.tokens_heading", defaultMessage: "Endpoint tokens · {count} of {limit} in use", description: "Cluster SFTP drawer: heading of the endpoint token list with the active count and the per-cluster limit; {count} and {limit} are numbers" }, { count: tokenCount, limit: CLUSTER_SFTP_TOKEN_LIMIT })} +

+ {atLimit && ( +
+ + + {intl.formatMessage({ id: "web.components.sftp.cluster_drawer.limit_message", defaultMessage: "This cluster already has the maximum of {limit} active tokens. Revoke one token before you can create another.", description: "Cluster SFTP drawer: warning shown when the cluster has the maximum number of active tokens; {limit} is a number" }, { limit: CLUSTER_SFTP_TOKEN_LIMIT })} + +
+ )} + {tokenCount === 0 && ( +

{intl.formatMessage({ id: "web.components.sftp.cluster_drawer.no_tokens", defaultMessage: "No active tokens.", description: "Cluster SFTP drawer: shown when the cluster has no active endpoint token" })}

+ )} + {data.tokens.map((t) => ( +
+
+

{t.prefix}

+

+ {intl.formatMessage({ id: "web.components.sftp.cluster_drawer.token_meta", defaultMessage: "Created {created} · {lastUsed}", description: "Cluster SFTP drawer: when an endpoint token was created and when it was last used; {created} and {lastUsed} are relative times" }, { created: formatRelative(t.createdAt, intl), lastUsed: t.lastUsedAt ? intl.formatMessage({ id: "web.components.sftp.cluster_drawer.last_used", defaultMessage: "Last used {time}", description: "Cluster SFTP drawer: when a token was last used; {time} is a relative time" }, { time: formatRelative(t.lastUsedAt, intl) }) : intl.formatMessage({ id: "web.components.sftp.cluster_drawer.never_used", defaultMessage: "Never used", description: "Cluster SFTP drawer: a token that has never been used" }) })} +

+
+ +
+ ))} + +

+ {intl.formatMessage({ id: "web.components.sftp.cluster_drawer.token_limit_hint", defaultMessage: "A cluster can have at most {limit} active tokens. Revoking a token stops that endpoint from logging users in.", description: "Cluster SFTP drawer: explains the per-cluster token limit and what revoking does; {limit} is a number" }, { limit: CLUSTER_SFTP_TOKEN_LIMIT })} +

+

+ {intl.formatMessage({ id: "web.components.sftp.cluster_drawer.token_use_hint", defaultMessage: "Used only by this cluster's SFTP server to reach the central API. Never give these to users.", description: "Cluster SFTP drawer: explains that endpoint tokens are for the cluster's SFTP server only" })} +

+
+ + )} + {actionError && ( +

+ {errorTextIntl(intl, actionError, actionFallback)} +

+ )} +
+ + + +
+
+
+
+ {created && setCreated(null)} />} + + ); +} + +// Shown once, right after a token is created. Gameplane keeps only a hash, so the secret is lost on close. +function ClusterSftpTokenShownOnce({ token, onDone }: { token: string; onDone: () => void }) { + const intl = useOptionalIntl(); + const [copied, setCopied] = useState(false); + const copy = () => { + try { + void navigator.clipboard.writeText(token).then( + () => setCopied(true), + () => setCopied(false), + ); + } catch { + setCopied(false); + } + }; + + return ( + + + + + + {intl.formatMessage({ id: "web.components.sftp.cluster_drawer.created_title", defaultMessage: "Endpoint token created", description: "Cluster SFTP token shown-once dialog: heading" })} + {intl.formatMessage({ id: "web.components.sftp.cluster_drawer.created_description", defaultMessage: "Copy it now. Gameplane stores only a hash and cannot show it again.", description: "Cluster SFTP token shown-once dialog: instruction under the heading" })} + + +
+ + {intl.formatMessage({ id: "web.components.sftp.cluster_drawer.created_warning", defaultMessage: "You will not see this again. Put it in the remote cluster's SFTP secret before you close this dialog.", description: "Cluster SFTP token shown-once dialog: warning that the token cannot be shown again and must go into the remote cluster's SFTP secret" })} +
+ {token} + +
+ + + +
+
+
+
+ ); +} diff --git a/web/src/components/sftp/SftpDialogs.tsx b/web/src/components/sftp/SftpDialogs.tsx new file mode 100644 index 000000000..5daa1fdc3 --- /dev/null +++ b/web/src/components/sftp/SftpDialogs.tsx @@ -0,0 +1,289 @@ +// SFTP dialogs shared by the personal SFTP page (routes/ProfileSftp.tsx) and +// the admin SFTP drawer (components/ui/admin/SftpAccessDrawer.tsx). Designs: +// Gameplane/Dialog/Add SSH key (1006926387-2214, -2231 invalid key), +// Generate SFTP password (-2253), SFTP password shown once (-2271). +// The generated password exists only in the caller's state; it is never +// put in a query cache. + +import { useState } from "react"; +import { + Button, + Description, + Input, + Label, + Modal, + ModalBackdrop, + ModalBody, + ModalContainer, + ModalDialog, + ModalFooter, + ModalHeader, + ModalHeading, +} from "@heroui/react"; +import { AlertCircle, Copy } from "lucide-react"; +import { errorTextIntl } from "@/lib/errors"; +import { useOptionalIntl } from "@/lib/i18n/format"; +import { + addSftpKey, + generateSftpPassword, + SFTP_PASSWORD_DEFAULT_LENGTH, + SFTP_PASSWORD_MAX_LENGTH, + SFTP_PASSWORD_MIN_LENGTH, + type SftpKey, +} from "@/lib/api"; + +const dialogClass = "w-[480px] max-w-[480px] rounded-xl"; + +// AddKeyDialog stores one OpenSSH public key. The server does the parsing; +// its refusal (server.sftp.key_invalid, key_duplicate, ...) shows inline. +export function AddKeyDialog({ + open, + onClose, + onAdded, + addKey = addSftpKey, +}: { + open: boolean; + onClose: () => void; + onAdded: (key: SftpKey) => void; + /** Injection seam for tests; production uses the real client. */ + addKey?: (name: string, publicKey: string) => Promise; +}) { + const intl = useOptionalIntl(); + const [name, setName] = useState(""); + const [publicKey, setPublicKey] = useState(""); + const [busy, setBusy] = useState(false); + const [error, setError] = useState(null); + + const reset = () => { + setName(""); + setPublicKey(""); + setError(null); + }; + const close = () => { + if (busy) return; + reset(); + onClose(); + }; + const submit = async () => { + setBusy(true); + setError(null); + try { + const key = await addKey(name.trim(), publicKey.trim()); + reset(); + onAdded(key); + } catch (err) { + setError(errorTextIntl(intl, err, intl.formatMessage({ id: "web.components.sftp.add_key_failed", defaultMessage: "Could not add the key.", description: "SFTP add-key dialog: fallback error when the server gives no message" }))); + } finally { + setBusy(false); + } + }; + + return ( + !o && close()}> + + + + + {intl.formatMessage({ id: "web.components.sftp.add_ssh_key", defaultMessage: "Add SSH key", description: "SFTP add-key dialog: heading and the title of the dialog" })} + {intl.formatMessage({ id: "web.components.sftp.paste_one_openssh_public_key", defaultMessage: "Paste one OpenSSH public key.", description: "SFTP add-key dialog: instruction under the heading" })} + + + {error && ( +
+ + {error} +
+ )} +
+ + setName(e.target.value)} + placeholder={intl.formatMessage({ id: "web.components.sftp.laptop", defaultMessage: "laptop", description: "SFTP add-key dialog: example key name shown in the empty name field; a sample name, not a default value" })} + disabled={busy} + /> +
+
+ +