diff --git a/agent/internal/files/files.go b/agent/internal/files/files.go index e074577cf..1e6e73b8e 100644 --- a/agent/internal/files/files.go +++ b/agent/internal/files/files.go @@ -45,6 +45,24 @@ func hasDotComponent(rel string) bool { return strings.HasPrefix(rel, ".") || strings.Contains(rel, "/.") } +// readableDotfiles are the only dotfiles /files/read serves: the pack +// manifests the itzg image writes at the data root, which the API reads to +// adopt a legacy modpack (spec 035, research R6). Exact root-level names; no +// other operation, directory or dotfile is affected. +var readableDotfiles = map[string]struct{}{ + ".modrinth-modpack-manifest.json": {}, + ".curseforge-manifest.json": {}, +} + +// readComponents is components() for /files/read: it additionally admits the +// readableDotfiles names, matched exactly after the leading slash is trimmed. +func (h *handler) readComponents(rel string) ([]string, error) { + if _, ok := readableDotfiles[strings.TrimPrefix(rel, "/")]; ok { + return []string{strings.TrimPrefix(rel, "/")}, nil + } + return h.components(rel) +} + type handler struct { archiveLock sync.Mutex root string @@ -161,7 +179,7 @@ func (h *handler) list(w http.ResponseWriter, req *http.Request) { } func (h *handler) read(w http.ResponseWriter, req *http.Request) { - comps, err := h.components(req.URL.Query().Get("path")) + comps, err := h.readComponents(req.URL.Query().Get("path")) if err != nil { h.fail(w, err) return diff --git a/agent/internal/files/readable_dotfiles_test.go b/agent/internal/files/readable_dotfiles_test.go new file mode 100644 index 000000000..212f01965 --- /dev/null +++ b/agent/internal/files/readable_dotfiles_test.go @@ -0,0 +1,89 @@ +package files + +import ( + "io" + "net/http" + "net/url" + "os" + "path/filepath" + "testing" +) + +func TestReadAllowsPackManifestDotfiles(t *testing.T) { + srvURL, root := newServer(t) + for _, name := range []string{".modrinth-modpack-manifest.json", ".curseforge-manifest.json"} { + if err := os.WriteFile(filepath.Join(root, name), []byte(`{"versionId":"v1"}`), 0o600); err != nil { + t.Fatalf("write %s: %v", name, err) + } + for _, p := range []string{name, "/" + name} { + resp := get(t, srvURL, "/files/read", url.Values{"path": {p}}) + body, _ := io.ReadAll(resp.Body) + _ = resp.Body.Close() + if resp.StatusCode != http.StatusOK || string(body) != `{"versionId":"v1"}` { + t.Fatalf("read %q = %d %q", p, resp.StatusCode, body) + } + } + } +} + +func TestReadStillRejectsOtherDotfiles(t *testing.T) { + srvURL, root := newServer(t) + for _, name := range []string{".mods-manifest.json", ".env"} { + if err := os.WriteFile(filepath.Join(root, name), []byte("x"), 0o600); err != nil { + t.Fatalf("write: %v", err) + } + } + if err := os.Mkdir(filepath.Join(root, "sub"), 0o700); err != nil { + t.Fatalf("mkdir: %v", err) + } + if err := os.WriteFile(filepath.Join(root, "sub", ".curseforge-manifest.json"), []byte("x"), 0o600); err != nil { + t.Fatalf("write nested: %v", err) + } + for _, p := range []string{".mods-manifest.json", ".env", "sub/.curseforge-manifest.json", "/.curseforge-manifest.json/../.env"} { + resp := get(t, srvURL, "/files/read", url.Values{"path": {p}}) + _ = resp.Body.Close() + if resp.StatusCode != http.StatusBadRequest { + t.Fatalf("read %q = %d, want 400", p, resp.StatusCode) + } + } +} + +func TestReadManifestDotfileSymlinkNotFollowed(t *testing.T) { + srvURL, root := newServer(t) + outside := filepath.Join(t.TempDir(), "outside.json") + if err := os.WriteFile(outside, []byte("secret"), 0o600); err != nil { + t.Fatalf("write outside: %v", err) + } + if err := os.Symlink(outside, filepath.Join(root, ".curseforge-manifest.json")); err != nil { + t.Fatalf("symlink: %v", err) + } + resp := get(t, srvURL, "/files/read", url.Values{"path": {".curseforge-manifest.json"}}) + body, _ := io.ReadAll(resp.Body) + _ = resp.Body.Close() + if resp.StatusCode == http.StatusOK || string(body) == "secret" { + t.Fatalf("symlinked manifest served: %d %q", resp.StatusCode, body) + } +} + +func TestManifestDotfilesNotWritableOrDeletable(t *testing.T) { + srvURL, root := newServer(t) + name := ".curseforge-manifest.json" + if err := os.WriteFile(filepath.Join(root, name), []byte("x"), 0o600); err != nil { + t.Fatalf("write: %v", err) + } + req, err := http.NewRequestWithContext(t.Context(), http.MethodDelete, srvURL+"/files/delete?path="+name, nil) + if err != nil { + t.Fatalf("req: %v", err) + } + resp, err := http.DefaultClient.Do(req) + if err != nil { + t.Fatalf("delete: %v", err) + } + _ = resp.Body.Close() + if resp.StatusCode != http.StatusBadRequest { + t.Fatalf("delete = %d, want 400", resp.StatusCode) + } + if _, err := os.Stat(filepath.Join(root, name)); err != nil { + t.Fatalf("manifest removed: %v", err) + } +} diff --git a/api/cmd/main.go b/api/cmd/main.go index 66a428cfd..db9f53c83 100644 --- a/api/cmd/main.go +++ b/api/cmd/main.go @@ -390,6 +390,9 @@ func main() { // rbac.Middleware and handlers.MountPods read it to gate pod and event reads. scope.SetControlPlaneNamespace(cfg.namespace) + // Internal reads use the same selected cluster and credentials as + // browser-facing agent routes, including remote-only management installs. + agentLister := ws.NewClusterAgentClient(reg, credentialsNS, cfg.agentCABundle, cfg.agentClientCert, cfg.agentClientKey) // Protected API r.Group(func(p chi.Router) { p.Use(sessions.Authenticate) @@ -433,6 +436,9 @@ func main() { handlers.MountSystemLogs(p, k8s, cfg.namespace) handlers.MountModulesWithRegistry(p, reg, moduleConfigMapNS) handlers.MountRegistrySecrets(p, k8s, credentialsNS) + handlers.MountRegistryShareWithOptions(p, k8s, credentialsNS, handlers.RegistryShareOptions{ + StartupKeySet: cfg.curseforgeAPIKey != "", + }) // Precedence: a runtime, admin-configured key (DB row + labelled // Secret, resolved lazily per registry.DBKeyFunc) always wins over // the startup --curseforge-api-key flag, so adding/rotating a key @@ -444,10 +450,12 @@ func main() { registry.DBKeyFunc(store, registry.NewK8sSecretReader(k8s, credentialsNS)), registry.StaticKeys(map[string]string{"curseforge": cfg.curseforgeAPIKey}), )) - handlers.MountRegistryWithRegistry(p, reg, regSet) - // Internal reads use the same selected cluster and credentials as - // browser-facing agent routes, including remote-only management installs. - agentLister := ws.NewClusterAgentClient(reg, credentialsNS, cfg.agentCABundle, cfg.agentClientCert, cfg.agentClientKey) + handlers.MountRegistryWithOptions(p, reg, regSet, handlers.RegistryOptions{ + Audit: auditor, + Home: k8s, + ControlNS: credentialsNS, + Files: agentLister, + }) handlers.MountModUpdatesWithRegistry(p, reg, regSet, agentLister) // ID-managed mods (ARK CurseForge ids, Project Zomboid MOD_IDS, // Steam Workshop lists): the API only writes GameServer.spec.mods.ids; @@ -488,6 +496,7 @@ func main() { jobs.Go(func() { sessions.RunGC(leaderCtx, time.Hour) }) jobs.Go(func() { notify.New(store, k8s, credentialsNS).RunWithRegistry(leaderCtx, reg) }) jobs.Go(func() { reporter.Run(leaderCtx) }) + jobs.Go(func() { handlers.RunModpackAdoptSweep(leaderCtx, reg, agentLister, logger) }) jobs.Go(func() { auditor.RunRetention(leaderCtx, time.Duration(cfg.auditRetentionDays)*24*time.Hour, 24*time.Hour, logger) }) diff --git a/api/cmd/mounts_test.go b/api/cmd/mounts_test.go index 46ae6dcf7..6f6a33216 100644 --- a/api/cmd/mounts_test.go +++ b/api/cmd/mounts_test.go @@ -21,6 +21,7 @@ var homeClientMounts = []string{ "handlers.MountClusters", "handlers.MountNotifications", "handlers.MountRegistrySecrets", + "handlers.MountRegistryShareWithOptions", "handlers.MountSystemLogs", } diff --git a/api/internal/handlers/cluster_guard_test.go b/api/internal/handlers/cluster_guard_test.go index 981e41803..508ccfe47 100644 --- a/api/internal/handlers/cluster_guard_test.go +++ b/api/internal/handlers/cluster_guard_test.go @@ -200,9 +200,15 @@ func TestRegistry_ServesHomeClusterOnly(t *testing.T) { } for _, q := range []string{"", "?cluster=local"} { - rr := do(t, r, rt.method, rt.path+q, rt.body) - if rr.Code != http.StatusOK { - t.Errorf("query=%q: got %d, want 200: %s", q, rr.Code, rr.Body) + lk := registryHomeClient() + lr := mountRegistryRouter(lk, fakeSet{p: &fakeProvider{}}) + rr := do(t, lr, rt.method, rt.path+q, rt.body) + want := http.StatusOK + if rt.path == "/servers/alpha/modpack" && rt.method == http.MethodPost { + want = http.StatusAccepted + } + if rr.Code != want { + t.Errorf("query=%q: got %d, want %d: %s", q, rr.Code, want, rr.Body) } } }) @@ -275,6 +281,7 @@ func mountHomeClientRoutes(t *testing.T, r chi.Router, home *kube.Client, reg *k MountClusters(r, reg, home, controlNS) MountSystemLogs(r, home, controlNS) MountRegistrySecrets(r, home, controlNS) + MountRegistryShareWithOptions(r, home, controlNS, RegistryShareOptions{}) } // TestHomeClientMounts_ServeHomeClusterOnly calls every route of the diff --git a/api/internal/handlers/destinations.go b/api/internal/handlers/destinations.go index 56081f30b..66f8a3a34 100644 --- a/api/internal/handlers/destinations.go +++ b/api/internal/handlers/destinations.go @@ -29,8 +29,9 @@ import ( ) // destinationLabel marks a Secret as a Gameplane backup destination. The -// agent and operator never read this label — it's purely a discovery -// hint for the API. +// agent never reads this label. The operator reads it only to decide +// whether any destination exists for a modpack removal or change backup +// (spec 035); otherwise it is a discovery hint for the API. const destinationLabel = "gameplane.local/backup-destination" // MountDestinations wires /backup-destinations onto the supplied router. diff --git a/api/internal/handlers/mod_target.go b/api/internal/handlers/mod_target.go index 84683988a..3d80f020b 100644 --- a/api/internal/handlers/mod_target.go +++ b/api/internal/handlers/mod_target.go @@ -23,6 +23,7 @@ import ( // Registry provider credentials are deliberately not part of this target: those // remain centrally configured by the API administrator. type modTarget struct { + cluster string k *kube.Client namespace string server *unstructured.Unstructured @@ -119,7 +120,7 @@ func loadModTarget(w http.ResponseWriter, req *http.Request, clients *kube.Regis http.NotFound(w, req) return nil, false } - target := &modTarget{k: k, namespace: ns, server: gs} + target := &modTarget{cluster: cluster, k: k, namespace: ns, server: gs} templateName, _, _ := unstructured.NestedString(gs.Object, "spec", "templateRef", "name") if templateName != "" { target.template, err = k.Dynamic.Resource(kube.GVRs["templates"]).Get(req.Context(), templateName, metav1.GetOptions{}) diff --git a/api/internal/handlers/mod_target_test.go b/api/internal/handlers/mod_target_test.go index 75726498a..e1d68c905 100644 --- a/api/internal/handlers/mod_target_test.go +++ b/api/internal/handlers/mod_target_test.go @@ -89,8 +89,12 @@ func TestClusterModWritesRetryOnlyUnchangedTarget(t *testing.T) { if test.want == http.StatusOK { wantUpdates = 2 } - if response.Code != test.want || updates != wantUpdates || kubeClientCalls(t, home) != 0 { - t.Fatalf("status=%d want=%d updates=%d want=%d home calls=%d body=%s", response.Code, test.want, updates, wantUpdates, kubeClientCalls(t, home), response.Body) + wantStatus := test.want + if test.want == http.StatusOK && route.method == http.MethodPost && route.path == "/servers/alpha/modpack" { + wantStatus = http.StatusAccepted + } + if response.Code != wantStatus || updates != wantUpdates || kubeClientCalls(t, home) != 0 { + t.Fatalf("status=%d want=%d updates=%d want=%d home calls=%d body=%s", response.Code, wantStatus, updates, wantUpdates, kubeClientCalls(t, home), response.Body) } stored, err := client.Tracker().Get(kube.GVRs["servers"], scope.DefaultNamespace, "alpha") if err != nil { diff --git a/api/internal/handlers/modpack_adopt.go b/api/internal/handlers/modpack_adopt.go new file mode 100644 index 000000000..875daa538 --- /dev/null +++ b/api/internal/handlers/modpack_adopt.go @@ -0,0 +1,202 @@ +package handlers + +import ( + "context" + "encoding/json" + "fmt" + "log/slog" + + 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/client-go/util/retry" + + "github.com/GameplanePanel/gameplane/api/internal/kube" + "github.com/GameplanePanel/gameplane/api/internal/scope" +) + +// modpackAdoptedAnnotation mirrors v1alpha1.ModpackAdoptedAnnotation. +const modpackAdoptedAnnotation = "gameplane.local/modpack-adopted" + +// adoptFileCap bounds the manifest read. +const adoptFileCap = 64 << 10 + +type adoptPlan struct { + provider string + project string + versionFile *adoptFileCfg +} + +// legacyModpackPlan returns the adoption plan for a legacy server, or false. +func legacyModpackPlan(gs, tmpl *unstructured.Unstructured) (adoptPlan, bool) { + if tmpl == nil { + return adoptPlan{}, false + } + if _, has, _ := unstructured.NestedMap(gs.Object, "spec", "modpack"); has { + return adoptPlan{}, false + } + if _, has, _ := unstructured.NestedMap(gs.Object, "status", "modpack"); has { + return adoptPlan{}, false + } + env, _, _ := unstructured.NestedSlice(gs.Object, "spec", "env") + for _, p := range registryProviders(tmpl) { + if p.modpacks == nil || p.modpacks.refEnv == "" { + continue + } + for _, item := range env { + m, ok := item.(map[string]any) + if !ok { + continue + } + if name, _ := m["name"].(string); name != p.modpacks.refEnv { + continue + } + if value, _ := m["value"].(string); modpackProjectRe.MatchString(value) { + return adoptPlan{provider: p.provider, project: value, versionFile: p.modpacks.adoptVersionFile}, true + } + } + } + return adoptPlan{}, false +} + +// readAdoptedVersion reads the installed pack version the image recorded. +// "" when the server has no pod, the file is unreadable, not JSON, lacks the +// field or holds a value that is not a valid pin. +func readAdoptedVersion(ctx context.Context, files AgentFileReader, cluster string, gs *unstructured.Unstructured, f *adoptFileCfg) string { + if files == nil || f == nil || !serverHasPod(gs) { + return "" + } + data, err := files.ReadFileForCluster(ctx, cluster, gs.GetName(), gs.GetNamespace(), f.path, adoptFileCap) + if err != nil { + return "" + } + var doc map[string]any + if json.Unmarshal(data, &doc) != nil { + return "" + } + v, _ := doc[f.field].(string) + if v == "" || !modpackVersionRe.MatchString(v) { + return "" + } + return v +} + +// adoptLegacyModpack adopts gs when it is a legacy candidate and returns the +// server as stored afterwards (the input unchanged and adopted=false when it +// is not a candidate or someone else adopted it first). The write re-reads the +// server and retries on conflict, so concurrent API replicas are safe. +func adoptLegacyModpack(ctx context.Context, k *kube.Client, cluster string, files AgentFileReader, + gs, tmpl *unstructured.Unstructured) (*unstructured.Unstructured, bool, error) { + plan, ok := legacyModpackPlan(gs, tmpl) + if !ok { + return gs, false, nil + } + version := readAdoptedVersion(ctx, files, cluster, gs, plan.versionFile) + res := k.Dynamic.Resource(kube.GVRs["servers"]).Namespace(gs.GetNamespace()) + out, adopted := gs, false + err := retry.RetryOnConflict(retry.DefaultRetry, func() error { + cur, err := res.Get(ctx, gs.GetName(), metav1.GetOptions{}) + if err != nil { + return err + } + if gs.GetUID() != "" && cur.GetUID() != gs.GetUID() { + return apierrors.NewNotFound(kube.GVRs["servers"].GroupResource(), gs.GetName()) + } + if _, still := legacyModpackPlan(cur, tmpl); !still { + out = cur + return nil + } + spec := map[string]any{"provider": plan.provider, "project": plan.project} + if version != "" { + spec["version"] = version + } + if err := unstructured.SetNestedMap(cur.Object, spec, "spec", "modpack"); err != nil { + return fmt.Errorf("set spec.modpack: %w", err) + } + ann := cur.GetAnnotations() + if ann == nil { + ann = map[string]string{} + } + ann[modpackAdoptedAnnotation] = "true" + cur.SetAnnotations(ann) + updated, err := res.Update(ctx, cur, metav1.UpdateOptions{}) + if err != nil { + return err + } + out, adopted = updated, true + return nil + }) + if err != nil { + return gs, false, fmt.Errorf("adopt modpack of %s/%s: %w", gs.GetNamespace(), gs.GetName(), err) + } + return out, adopted, nil +} + +// adoptLegacy is the lazy retry on GET /servers/{name}/modpack: adopt the +// target server if it is still unmigrated. Errors are logged; the unmodified +// server is returned so the GET still answers. +func (h *registryHandler) adoptLegacy(ctx context.Context, target *modTarget) *unstructured.Unstructured { + updated, _, err := adoptLegacyModpack(ctx, target.k, target.cluster, h.files, target.server, target.template) + if err != nil { + slog.Warn("legacy modpack adoption failed", "server", target.server.GetName(), "err", err) + return target.server + } + return updated +} + +// RunModpackAdoptSweep adopts every legacy server in every registered cluster +// once. Call it from the leader-only worker at API startup; it is idempotent +// (adopted servers are no longer candidates) and returns when done or ctx ends. +func RunModpackAdoptSweep(ctx context.Context, clients *kube.Registry, files AgentFileReader, logger *slog.Logger) { + for _, cluster := range clients.IDs() { + k, ok := clients.Get(cluster) + if !ok || k == nil || k.Dynamic == nil { + continue + } + sweepModpackAdoption(ctx, k, cluster, files, logger) + } +} + +func sweepModpackAdoption(ctx context.Context, k *kube.Client, cluster string, files AgentFileReader, logger *slog.Logger) { + templates := map[string]*unstructured.Unstructured{} + adopted, failed := 0, 0 + for _, ns := range scope.AllowedNamespaces { + list, err := k.Dynamic.Resource(kube.GVRs["servers"]).Namespace(ns).List(ctx, metav1.ListOptions{}) + if err != nil { + logger.Warn("modpack adoption sweep: list servers", "cluster", cluster, "namespace", ns, "err", err) + continue + } + for i := range list.Items { + if ctx.Err() != nil { + return + } + gs := &list.Items[i] + name, _, _ := unstructured.NestedString(gs.Object, "spec", "templateRef", "name") + if name == "" { + continue + } + tmpl, seen := templates[name] + if !seen { + tmpl, err = k.Dynamic.Resource(kube.GVRs["templates"]).Get(ctx, name, metav1.GetOptions{}) + if err != nil { + tmpl = nil + if !apierrors.IsNotFound(err) { + logger.Warn("modpack adoption sweep: get template", "cluster", cluster, "template", name, "err", err) + } + } + templates[name] = tmpl + } + _, did, err := adoptLegacyModpack(ctx, k, cluster, files, gs, tmpl) + switch { + case err != nil: + failed++ + logger.Warn("modpack adoption sweep", "cluster", cluster, "server", gs.GetName(), "err", err) + case did: + adopted++ + } + } + } + if adopted > 0 || failed > 0 { + logger.Info("modpack adoption sweep done", "cluster", cluster, "adopted", adopted, "failed", failed) + } +} diff --git a/api/internal/handlers/modpack_adopt_envtest_test.go b/api/internal/handlers/modpack_adopt_envtest_test.go new file mode 100644 index 000000000..e4cbb37c6 --- /dev/null +++ b/api/internal/handlers/modpack_adopt_envtest_test.go @@ -0,0 +1,162 @@ +//go:build envtest + +package handlers + +import ( + "context" + "log/slog" + "net/http" + "testing" + + "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" + + "github.com/GameplanePanel/gameplane/api/internal/scope" +) + +func legacyServer(o *unstructured.Unstructured) { + _ = unstructured.SetNestedSlice(o.Object, []any{ + map[string]any{"name": "MODRINTH_MODPACK", "value": "cobblemon"}, + map[string]any{"name": "TYPE", "value": "MODRINTH"}, + map[string]any{"name": "KEEP", "value": "me"}, + }, "spec", "env") +} + +func TestModpackAdoption_SweepReadsVersionThroughAgent(t *testing.T) { + e := newModpackEnv(t, "servers:read", "servers:write") + e.files.files[".modrinth-modpack-manifest.json"] = `{"projectSlug":"cobblemon","versionId":"ver123"}` + gs := e.server(t, "1.21.1-neoforge", legacyServer) + setServerStatus(t, gs.GetName(), map[string]any{"phase": "Running"}) + + sweepModpackAdoption(context.Background(), e.home, scope.DefaultCluster, e.files, slog.Default()) + + got := getServerObj(t, gs.GetName()) + spec, _, _ := unstructured.NestedMap(got.Object, "spec", "modpack") + if spec["provider"] != "modrinth" || spec["project"] != "cobblemon" || spec["version"] != "ver123" { + t.Fatalf("spec.modpack = %v, want modrinth/cobblemon/ver123", spec) + } + if got.GetAnnotations()[modpackAdoptedAnnotation] != "true" { + t.Errorf("adopted annotation missing: %v", got.GetAnnotations()) + } + env, _, _ := unstructured.NestedSlice(got.Object, "spec", "env") + if len(env) != 3 { + t.Errorf("spec.env changed by adoption: %v", env) + } + // Second sweep is a no-op (not a candidate any more): resourceVersion stays. + rv := got.GetResourceVersion() + sweepModpackAdoption(context.Background(), e.home, scope.DefaultCluster, e.files, slog.Default()) + if after := getServerObj(t, gs.GetName()); after.GetResourceVersion() != rv { + t.Errorf("second sweep rewrote the server (%s -> %s)", rv, after.GetResourceVersion()) + } +} + +func TestModpackAdoption_UnreadableLeavesPackUnpinned(t *testing.T) { + e := newModpackEnv(t, "servers:read", "servers:write") + // Stopped server: no pod, so the agent must not even be asked. The lazy + // retry on GET does the adoption. + gs := e.server(t, "1.21.1-neoforge", legacyServer) + setServerStatus(t, gs.GetName(), map[string]any{"phase": "Stopped"}) + + rr := modpackReq(t, e.router, http.MethodGet, "/servers/"+gs.GetName()+"/modpack", nil) + if rr.Code != http.StatusOK { + t.Fatalf("GET status %d: %s", rr.Code, rr.Body) + } + v := decodeModpackView(t, rr) + if v.Active == nil || v.Active.Project != "cobblemon" || v.Active.Pinned || v.Active.Version != "" { + t.Errorf("active = %+v, want cobblemon, pinned=false, no version", v.Active) + } + if len(e.files.calls) != 0 { + t.Errorf("agent read for a stopped server: %v", e.files.calls) + } + got := getServerObj(t, gs.GetName()) + if _, has := got.Object["spec"].(map[string]any)["modpack"].(map[string]any)["version"]; has { + t.Errorf("version must be absent") + } + if got.GetAnnotations()[modpackAdoptedAnnotation] != "true" { + t.Errorf("adopted annotation missing") + } +} + +func TestModpackAdoption_BadManifestAndManagedServersAreSkipped(t *testing.T) { + e := newModpackEnv(t, "servers:read", "servers:write") + e.files.files[".modrinth-modpack-manifest.json"] = `not json` + bad := e.server(t, "1.21.1-neoforge", legacyServer) + setServerStatus(t, bad.GetName(), map[string]any{"phase": "Running"}) + managed := e.server(t, "1.21.1-neoforge", func(o *unstructured.Unstructured) { + legacyServer(o) + _ = unstructured.SetNestedMap(o.Object, map[string]any{"provider": "modrinth", "project": "other", "version": "v9"}, "spec", "modpack") + }) + removed := e.server(t, "1.21.1-neoforge", legacyServer) + setServerStatus(t, removed.GetName(), map[string]any{"phase": "Running", "modpack": map[string]any{"phase": "Applied"}}) + + sweepModpackAdoption(context.Background(), e.home, scope.DefaultCluster, e.files, slog.Default()) + + if spec, _, _ := unstructured.NestedMap(getServerObj(t, bad.GetName()).Object, "spec", "modpack"); spec["project"] != "cobblemon" || spec["version"] != nil { + t.Errorf("unparsable manifest: spec.modpack = %v, want cobblemon without version", spec) + } + if spec, _, _ := unstructured.NestedMap(getServerObj(t, managed.GetName()).Object, "spec", "modpack"); spec["project"] != "other" { + t.Errorf("already managed server rewritten: %v", spec) + } + if _, found, _ := unstructured.NestedMap(getServerObj(t, removed.GetName()).Object, "spec", "modpack"); found { + t.Errorf("a server whose pack was removed (status.modpack set) must not be re-adopted") + } +} + +func TestModpackInstall_BackupFirstNeedsDestination(t *testing.T) { + e := newModpackEnv(t, "servers:read", "servers:write") + gs := e.server(t, "1.21.1-neoforge", nil) + path := "/servers/" + gs.GetName() + "/modpack" + body := map[string]any{"provider": "modrinth", "project": "cobblemon", "version": "v1", "backupFirst": true} + + rr := modpackReq(t, e.router, http.MethodPost, path, body) + if rr.Code != http.StatusBadRequest || problemID(t, rr) != "server.modpack.backup_unavailable" { + t.Fatalf("status %d id %q, want 400 server.modpack.backup_unavailable", rr.Code, problemID(t, rr)) + } + e.addDestination(t) + rr = modpackReq(t, e.router, http.MethodPost, path, body) + if rr.Code != http.StatusAccepted { + t.Fatalf("with destination: status %d: %s", rr.Code, rr.Body) + } + spec, _, _ := unstructured.NestedMap(getServerObj(t, gs.GetName()).Object, "spec", "modpack") + if spec["backupFirst"] != true { + t.Errorf("spec.modpack = %v, want backupFirst=true", spec) + } +} + +func TestModpackInstall_ConflictWhileChangeInProgress(t *testing.T) { + e := newModpackEnv(t, "servers:read", "servers:write") + gs := e.server(t, "1.21.1-neoforge", func(o *unstructured.Unstructured) { + _ = unstructured.SetNestedMap(o.Object, map[string]any{"provider": "modrinth", "project": "cobblemon", "version": "v1"}, "spec", "modpack") + }) + path := "/servers/" + gs.GetName() + "/modpack" + body := map[string]any{"provider": "modrinth", "project": "cobblemon", "version": "v2"} + same := map[string]any{"provider": "modrinth", "project": "cobblemon", "version": "v1"} + + // Written, operator has not seen it yet (no status): Pending, so 409. + if rr := modpackReq(t, e.router, http.MethodPost, path, body); rr.Code != http.StatusConflict || problemID(t, rr) != "server.modpack.change_in_progress" { + t.Fatalf("pending: status %d id %q", rr.Code, problemID(t, rr)) + } + for _, phase := range []string{"BackingUp", "Applying"} { + setServerStatus(t, gs.GetName(), modpackStatus(phase, gs.GetGeneration(), nil)) + if rr := modpackReq(t, e.router, http.MethodPost, path, body); rr.Code != http.StatusConflict { + t.Errorf("%s: status %d, want 409", phase, rr.Code) + } + } + // BackupFailed for the current request and target: a new change is allowed. + failed := modpackStatus("BackupFailed", gs.GetGeneration(), nil) + failed["modpack"].(map[string]any)["target"] = same + setServerStatus(t, gs.GetName(), failed) + if rr := modpackReq(t, e.router, http.MethodPost, path, body); rr.Code != http.StatusAccepted { + t.Errorf("BackupFailed: status %d: %s", rr.Code, rr.Body) + } + // After that write the generation moved: the change is pending again. + if rr := modpackReq(t, e.router, http.MethodPost, path, same); rr.Code != http.StatusConflict { + t.Errorf("after the retry write: status %d, want 409", rr.Code) + } + // Applied: free again. + cur := getServerObj(t, gs.GetName()) + setServerStatus(t, gs.GetName(), modpackStatus("Applied", cur.GetGeneration(), + map[string]any{"provider": "modrinth", "project": "cobblemon", "version": "v2"})) + if rr := modpackReq(t, e.router, http.MethodPost, path, same); rr.Code != http.StatusAccepted { + t.Errorf("Applied: status %d: %s", rr.Code, rr.Body) + } +} diff --git a/api/internal/handlers/modpack_missing.go b/api/internal/handlers/modpack_missing.go new file mode 100644 index 000000000..6ec1fa4e1 --- /dev/null +++ b/api/internal/handlers/modpack_missing.go @@ -0,0 +1,158 @@ +package handlers + +import ( + "bufio" + "bytes" + "context" + "errors" + "log/slog" + "net/http" + "net/url" + "regexp" + "strings" + + "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" + + "github.com/GameplanePanel/gameplane/api/internal/ws" +) + +// AgentFileReader reads one small file from a server's data volume through its +// agent sidecar; satisfied by *ws.AgentClient. A missing file must be reported +// as an error wrapping ws.ErrAgentFileNotFound. At most limit bytes are returned. +type AgentFileReader interface { + ReadFileForCluster(ctx context.Context, cluster, name, namespace, path string, limit int64) ([]byte, error) +} + +const ( + // missingFilesReadCap bounds the bytes read and parsed. + missingFilesReadCap = 256 << 10 + // missingFilesMaxRows bounds the rows returned. + missingFilesMaxRows = 200 + // missingFieldMaxRunes bounds each returned field. + missingFieldMaxRunes = 256 + // curseForgePageHost is the only host a download page may point at. + curseForgePageHost = "www.curseforge.com" + // defaultDownloadsPath is the data-relative folder the module's + // CF_DOWNLOADS_REPO=/data/downloads points the image at. + defaultDownloadsPath = "downloads/" +) + +var missingColumnSplit = regexp.MustCompile(`\s{2,}|\t+`) + +// parseModsNeedDownload parses MODS_NEED_DOWNLOAD.txt. Blank lines, the header +// row, rows with fewer than 3 columns and rows whose last column is not an +// https://www.curseforge.com/... URL are dropped. Input beyond +// missingFilesReadCap and rows beyond missingFilesMaxRows are ignored. 4 columns +// are Mod, Version Name, Filename, Download page; 3 columns are Mod, Filename, +// Download page; with more than 4, the leading columns join into Mod. +func parseModsNeedDownload(data []byte) []modpackMissingFile { + out := []modpackMissingFile{} + if len(data) > missingFilesReadCap { + data = data[:missingFilesReadCap] + } + sc := bufio.NewScanner(bytes.NewReader(data)) + sc.Buffer(make([]byte, 0, 4096), missingFilesReadCap+1) + for sc.Scan() && len(out) < missingFilesMaxRows { + line := strings.TrimSpace(sc.Text()) + if line == "" { + continue + } + cols := missingColumnSplit.Split(line, -1) + n := len(cols) + if n < 3 { + continue + } + page := strings.TrimSpace(cols[n-1]) + if !validCurseForgePage(page) { + continue + } + row := modpackMissingFile{DownloadPage: page, Filename: cleanMissingField(cols[n-2])} + if n == 3 { + row.Mod = cleanMissingField(cols[0]) + } else { + row.VersionName = cleanMissingField(cols[n-3]) + row.Mod = cleanMissingField(strings.Join(cols[:n-3], " ")) + } + out = append(out, row) + } + return out +} + +// validCurseForgePage accepts only https://www.curseforge.com/... without +// userinfo, so a hostile file cannot make the dashboard link elsewhere. +func validCurseForgePage(raw string) bool { + if len(raw) > 512 || !strings.HasPrefix(raw, "https://"+curseForgePageHost+"/") { + return false + } + u, err := url.Parse(raw) + return err == nil && u.Scheme == "https" && u.Host == curseForgePageHost && u.User == nil +} + +// cleanMissingField drops control characters and bounds the length. +func cleanMissingField(s string) string { + s = strings.Map(func(r rune) rune { + if r < 0x20 || r == 0x7f { + return -1 + } + return r + }, strings.TrimSpace(s)) + return truncate(s, missingFieldMaxRunes) +} + +// downloadsPathFor derives the data-relative downloads folder from the +// provider's fixed CF_DOWNLOADS_REPO env, defaulting to "downloads/". +func downloadsPathFor(mp *modpackCfg) string { + for _, e := range mp.env { + if e.Name != "CF_DOWNLOADS_REPO" { + continue + } + if rel := strings.Trim(strings.TrimPrefix(e.Value, "/data"), "/"); rel != "" { + return rel + "/" + } + } + return defaultDownloadsPath +} + +// serverHasPod reports whether a pod (and so the agent) can exist: not +// suspended and in a phase that has a pod. Stopped, Suspended (also idle sleep) +// and Pending servers have none. +func serverHasPod(gs *unstructured.Unstructured) bool { + if suspended, _, _ := unstructured.NestedBool(gs.Object, "spec", "suspend"); suspended { + return false + } + phase, _, _ := unstructured.NestedString(gs.Object, "status", "phase") + switch phase { + case "Starting", "Running", "Stopping", "Failed": + return true + } + return false +} + +// fillMissingFiles sets view.MissingFiles / MissingFilesUnknown / DownloadsPath +// from the active pack's provider (missingFilesPath). No-op without an active +// pack or when the provider declares no missingFilesPath. +func (h *registryHandler) fillMissingFiles(req *http.Request, target *modTarget, gs *unstructured.Unstructured, view *modpackView) { + if view.Active == nil { + return + } + prov, ok := pickProvider(target.template, view.Active.Provider) + if !ok || prov.modpacks == nil || prov.modpacks.missingFilesPath == "" { + return + } + view.DownloadsPath = downloadsPathFor(prov.modpacks) + if h.files == nil || !serverHasPod(gs) { + view.MissingFilesUnknown = true + return + } + data, err := h.files.ReadFileForCluster(req.Context(), target.cluster, gs.GetName(), target.namespace, + prov.modpacks.missingFilesPath, missingFilesReadCap) + switch { + case err == nil: + view.MissingFiles = parseModsNeedDownload(data) + case errors.Is(err, ws.ErrAgentFileNotFound): + // The image deletes the file after a good install: nothing to download. + default: + slog.Debug("read missing-files list failed", "server", gs.GetName(), "err", err) + view.MissingFilesUnknown = true + } +} diff --git a/api/internal/handlers/modpack_missing_test.go b/api/internal/handlers/modpack_missing_test.go new file mode 100644 index 000000000..5f75f1c34 --- /dev/null +++ b/api/internal/handlers/modpack_missing_test.go @@ -0,0 +1,287 @@ +package handlers + +import ( + "context" + "encoding/json" + "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/kube" + "github.com/GameplanePanel/gameplane/api/internal/scope" + "github.com/GameplanePanel/gameplane/api/internal/ws" +) + +// fakeAgentFiles is an AgentFileReader backed by a map; a path absent from the +// map is ws.ErrAgentFileNotFound, err (when set) wins over everything. +type fakeAgentFiles struct { + files map[string]string + err error + calls []string +} + +func (f *fakeAgentFiles) ReadFileForCluster(_ context.Context, _, _, _, path string, limit int64) ([]byte, error) { + f.calls = append(f.calls, path) + if f.err != nil { + return nil, f.err + } + body, ok := f.files[path] + if !ok { + return nil, ws.ErrAgentFileNotFound + } + if int64(len(body)) > limit { + body = body[:limit] + } + return []byte(body), nil +} + +// modpackTestTemplate declares the three registries like the minecraft-java +// module: modrinth (adoptable), curseforge (needs the shared key on java8) and +// ftb (modpacks only). Versions: a Java 21 NeoForge entry and a java8-multiarch +// Forge entry. Fields displayName/version/image make it valid for envtest too. +func modpackTestTemplate(name string) *unstructured.Unstructured { + versions := []any{ + map[string]any{"id": "1.21.1-neoforge", "displayName": "1.21.1 NeoForge", "image": "itzg/minecraft-server:java21", + "loader": "neoforge", "gameVersion": "1.21.1", "default": true}, + map[string]any{"id": "1.12.2-forge", "displayName": "1.12.2 Forge", "image": "itzg/minecraft-server:java8-multiarch@sha256:0123456789abcdef", + "loader": "forge", "gameVersion": "1.12.2"}, + } + tmpl := newTemplateObj(name, nil, versions) + _ = unstructured.SetNestedField(tmpl.Object, map[string]any{ + "providers": []any{ + map[string]any{"provider": "modrinth", "modpacks": map[string]any{ + "refEnv": "MODRINTH_MODPACK", "versionEnv": "MODRINTH_VERSION", + "adoptVersionFile": map[string]any{"path": ".modrinth-modpack-manifest.json", "field": "versionId"}, + "env": []any{map[string]any{"name": "TYPE", "value": "MODRINTH"}}, + }}, + map[string]any{"provider": "curseforge", "curseforgeGameID": int64(432), "modpacks": map[string]any{ + "refEnv": "CF_SLUG", "versionEnv": "CF_FILE_ID", "apiKeyEnv": "CF_API_KEY", + "needsKeyImageTags": []any{"java8-multiarch", "java8"}, + "missingFilesPath": "MODS_NEED_DOWNLOAD.txt", + "env": []any{ + map[string]any{"name": "TYPE", "value": "AUTO_CURSEFORGE"}, + map[string]any{"name": "CF_DOWNLOADS_REPO", "value": "/data/downloads"}, + }, + }}, + map[string]any{"provider": "ftb", "modpacksOnly": true, "modpacks": map[string]any{ + "refEnv": "FTB_MODPACK_ID", "versionEnv": "FTB_MODPACK_VERSION_ID", + "env": []any{map[string]any{"name": "TYPE", "value": "FTBA"}}, + }}, + }, + }, "spec", "capabilities", "mods", "registry") + _ = unstructured.SetNestedField(tmpl.Object, "Modpack test", "spec", "displayName") + _ = unstructured.SetNestedField(tmpl.Object, "1", "spec", "version") + _ = unstructured.SetNestedField(tmpl.Object, "itzg/minecraft-server:java21", "spec", "image") + return tmpl +} + +// mountModpackRouter mounts the registry routes over a one-cluster registry +// (no RBAC middleware). +func mountModpackRouter(k *kube.Client, opts RegistryOptions) http.Handler { + clients := kube.NewRegistry(scope.DefaultCluster) + clients.Set(scope.DefaultCluster, k) + r := chi.NewRouter() + MountRegistryWithOptions(r, clients, fakeSet{p: &fakeProvider{}}, opts) + return r +} + +// modpackReq performs a request that asks for problem+json errors. +func modpackReq(t *testing.T, h http.Handler, method, path string, body any) *httptest.ResponseRecorder { + t.Helper() + var rdr *strings.Reader + if body != nil { + b, err := json.Marshal(body) + if err != nil { + t.Fatalf("marshal: %v", err) + } + rdr = strings.NewReader(string(b)) + } else { + rdr = strings.NewReader("") + } + req := httptest.NewRequestWithContext(t.Context(), method, path, rdr) + req.Header.Set("Accept", "application/problem+json") + rr := httptest.NewRecorder() + h.ServeHTTP(rr, req) + return rr +} + +// problemID returns the messageId of a problem+json response body. +func problemID(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 %q: %v", rr.Body.String(), err) + } + return p.MessageID +} + +func decodeModpackView(t *testing.T, rr *httptest.ResponseRecorder) modpackView { + t.Helper() + var v modpackView + if err := json.Unmarshal(rr.Body.Bytes(), &v); err != nil { + t.Fatalf("decode view %q: %v", rr.Body.String(), err) + } + return v +} + +// modpackRow joins columns with 3 spaces, like the image's table. +func modpackRow(cols ...string) string { return strings.Join(cols, " ") } + +// NOTE: hand-made sample (no real MODS_NEED_DOWNLOAD.txt has been captured). +func modsNeedDownloadSample() string { + return strings.Join([]string{ + modpackRow("Mod", "Version Name", "Filename", "Download page"), + modpackRow("Some Mod", "1.2.3", "somemod-1.2.3.jar", "https://www.curseforge.com/minecraft/mc-mods/some-mod/download/123"), + modpackRow("Another Mod", "2.0.0 beta", "another-2.0.0.jar", "https://www.curseforge.com/minecraft/mc-mods/another-mod/download/456"), + modpackRow("Short Mod", "short.jar", "https://www.curseforge.com/minecraft/mc-mods/short/download/9"), + modpackRow("Evil Mod", "1.0", "evil.jar", "https://evil.example.com/minecraft/mc-mods/evil/download/1"), + modpackRow("Look Alike", "1.0", "look.jar", "https://www.curseforge.com.evil.example/x"), + modpackRow("Plain Http", "1.0", "plain.jar", "http://www.curseforge.com/x"), + modpackRow("No Link", "1.0", "nolink.jar"), + "", + }, "\n") +} + +func TestParseModsNeedDownload_RowsAndColumns(t *testing.T) { + got := parseModsNeedDownload([]byte(modsNeedDownloadSample())) + want := []modpackMissingFile{ + {Mod: "Some Mod", VersionName: "1.2.3", Filename: "somemod-1.2.3.jar", DownloadPage: "https://www.curseforge.com/minecraft/mc-mods/some-mod/download/123"}, + {Mod: "Another Mod", VersionName: "2.0.0 beta", Filename: "another-2.0.0.jar", DownloadPage: "https://www.curseforge.com/minecraft/mc-mods/another-mod/download/456"}, + {Mod: "Short Mod", VersionName: "", Filename: "short.jar", DownloadPage: "https://www.curseforge.com/minecraft/mc-mods/short/download/9"}, + } + if len(got) != len(want) { + t.Fatalf("rows = %d (%+v), want %d: header, non-CurseForge, http and link-less rows must be dropped", len(got), got, len(want)) + } + for i := range want { + if got[i] != want[i] { + t.Errorf("row %d = %+v, want %+v", i, got[i], want[i]) + } + } +} + +func TestParseModsNeedDownload_Caps(t *testing.T) { + line := modpackRow("Mod", "1", "f.jar", "https://www.curseforge.com/minecraft/mc-mods/m/download/1") + many := strings.Repeat(line+"\n", 5000) + if got := parseModsNeedDownload([]byte(many)); len(got) != missingFilesMaxRows { + t.Errorf("rows = %d, want the %d-row cap", len(got), missingFilesMaxRows) + } + huge := strings.Repeat("x", 4*missingFilesReadCap) + if got := parseModsNeedDownload([]byte(huge)); len(got) != 0 { + t.Errorf("oversized junk produced %d rows", len(got)) + } + long := modpackRow(strings.Repeat("m", 1000), "1", "f.jar", "https://www.curseforge.com/x/y") + got := parseModsNeedDownload([]byte(long)) + if len(got) != 1 || len([]rune(got[0].Mod)) != missingFieldMaxRunes { + t.Errorf("long field not truncated to %d runes: %+v", missingFieldMaxRunes, got) + } + ctl := modpackRow("Bad\x1b[31mMod", "1", "f.jar", "https://www.curseforge.com/x/y") + if got := parseModsNeedDownload([]byte(ctl)); len(got) != 1 || strings.ContainsRune(got[0].Mod, 0x1b) { + t.Errorf("control characters kept: %+v", got) + } +} + +func modpackServerObj(name, tmpl, version, phase string, pack map[string]any) *unstructured.Unstructured { + gs := serverWithVersion(scope.DefaultNamespace, name, tmpl, version) + if pack != nil { + _ = unstructured.SetNestedMap(gs.Object, pack, "spec", "modpack") + } + if phase != "" { + _ = unstructured.SetNestedField(gs.Object, phase, "status", "phase") + } + return gs +} + +func TestGetModpack_MissingFiles(t *testing.T) { + cf := map[string]any{"provider": "curseforge", "project": "atm10", "version": "6512345"} + for _, tc := range []struct { + name string + phase string + files *fakeAgentFiles + wantRows int + wantUnknown bool + wantCalls int + }{ + {"file present", "Running", &fakeAgentFiles{files: map[string]string{"MODS_NEED_DOWNLOAD.txt": modsNeedDownloadSample()}}, 3, false, 1}, + {"file absent", "Running", &fakeAgentFiles{files: map[string]string{}}, 0, false, 1}, + {"agent error", "Running", &fakeAgentFiles{err: context.DeadlineExceeded}, 0, true, 1}, + {"no pod (stopped)", "Stopped", &fakeAgentFiles{files: map[string]string{}}, 0, true, 0}, + {"no pod (suspended)", "Suspended", &fakeAgentFiles{files: map[string]string{}}, 0, true, 0}, + {"no pod (no status)", "", &fakeAgentFiles{files: map[string]string{}}, 0, true, 0}, + } { + t.Run(tc.name, func(t *testing.T) { + k := fakeKubeClient(modpackTestTemplate("minecraft"), modpackServerObj("alpha", "minecraft", "1.21.1-neoforge", tc.phase, cf)) + rr := modpackReq(t, mountModpackRouter(k, RegistryOptions{Files: tc.files}), http.MethodGet, "/servers/alpha/modpack", nil) + if rr.Code != http.StatusOK { + t.Fatalf("status %d: %s", rr.Code, rr.Body) + } + v := decodeModpackView(t, rr) + if len(v.MissingFiles) != tc.wantRows || v.MissingFilesUnknown != tc.wantUnknown || len(tc.files.calls) != tc.wantCalls { + t.Errorf("rows=%d unknown=%v calls=%v, want rows=%d unknown=%v calls=%d", + len(v.MissingFiles), v.MissingFilesUnknown, tc.files.calls, tc.wantRows, tc.wantUnknown, tc.wantCalls) + } + if v.DownloadsPath != "downloads/" { + t.Errorf("downloadsPath = %q, want downloads/", v.DownloadsPath) + } + }) + } +} + +func TestGetModpack_ModrinthHasNoMissingFiles(t *testing.T) { + files := &fakeAgentFiles{files: map[string]string{"MODS_NEED_DOWNLOAD.txt": modsNeedDownloadSample()}} + mr := map[string]any{"provider": "modrinth", "project": "cobblemon", "version": "v1"} + k := fakeKubeClient(modpackTestTemplate("minecraft"), modpackServerObj("alpha", "minecraft", "1.21.1-neoforge", "Running", mr)) + rr := modpackReq(t, mountModpackRouter(k, RegistryOptions{Files: files}), http.MethodGet, "/servers/alpha/modpack", nil) + v := decodeModpackView(t, rr) + if len(v.MissingFiles) != 0 || v.MissingFilesUnknown || v.DownloadsPath != "" || len(files.calls) != 0 { + t.Errorf("modrinth pack must not read the list: %+v calls=%v", v, files.calls) + } +} + +func TestImageTag(t *testing.T) { + for in, want := range map[string]string{ + "itzg/minecraft-server:java21": "java21", + "itzg/minecraft-server:java8-multiarch@sha256:abcdef": "java8-multiarch", + "registry.local:5000/itzg/minecraft-server:java8": "java8", + "registry.local:5000/itzg/minecraft-server": "", + "itzg/minecraft-server@sha256:abcdef": "", + "": "", + } { + if got := imageTag(in); got != want { + t.Errorf("imageTag(%q) = %q, want %q", in, got, want) + } + } +} + +func TestProviders_ModsBrowseAndBlockedReason(t *testing.T) { + // java21 image: nothing blocked; ftb is modpacks-only. + k := fakeKubeClient(modpackTestTemplate("minecraft"), modpackServerObj("alpha", "minecraft", "1.21.1-neoforge", "", nil)) + rr := modpackReq(t, mountModpackRouter(k, RegistryOptions{}), http.MethodGet, "/servers/alpha/mods/registry/providers", nil) + var got []providerInfo + if err := json.Unmarshal(rr.Body.Bytes(), &got); err != nil || len(got) != 3 { + t.Fatalf("decode %q: %v", rr.Body, err) + } + if !got[0].ModsBrowse || got[2].ModsBrowse || got[2].Provider != "ftb" { + t.Errorf("modsBrowse wrong: %+v", got) + } + for _, p := range got { + if p.ModpacksBlockedReason != "" { + t.Errorf("java21 image: %s blocked (%q)", p.Provider, p.ModpacksBlockedReason) + } + } + // java8-multiarch image, sharing off (no home client): curseforge blocked only. + k = fakeKubeClient(modpackTestTemplate("minecraft"), modpackServerObj("alpha", "minecraft", "1.12.2-forge", "", nil)) + rr = modpackReq(t, mountModpackRouter(k, RegistryOptions{}), http.MethodGet, "/servers/alpha/mods/registry/providers", nil) + got = nil + if err := json.Unmarshal(rr.Body.Bytes(), &got); err != nil { + t.Fatal(err) + } + if got[1].Provider != "curseforge" || got[1].ModpacksBlockedReason != "curseforge_key_not_shared" || got[0].ModpacksBlockedReason != "" { + t.Errorf("blocked reasons wrong: %+v", got) + } +} diff --git a/api/internal/handlers/registry.go b/api/internal/handlers/registry.go index 273ae0157..211334cc7 100644 --- a/api/internal/handlers/registry.go +++ b/api/internal/handlers/registry.go @@ -14,8 +14,10 @@ import ( "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/httperr" "github.com/GameplanePanel/gameplane/api/internal/kube" + "github.com/GameplanePanel/gameplane/api/internal/messages" "github.com/GameplanePanel/gameplane/api/internal/registry" ) @@ -24,6 +26,13 @@ import ( // 501 so the dashboard hides Browse and falls back to install-by-URL. var errNoRegistry = errors.New("no mod registry for this server") +// Install-body validation errors (400). +var ( + errModpackProject = errors.New("project (or ref) is required and may only contain letters, digits, '.', '_' and '-' (max 128)") + errModpackVersion = errors.New("version may only contain letters, digits, '.', '_' and '-' (max 64)") + errModpackBackupFirst = errors.New("backupFirst must be true or false") +) + // registrySet is the subset of *registry.Set the handler needs, so tests // can inject a fake. Available reports whether an engine is usable (e.g. // CurseForge needs an API key). Both methods take context for lazy key @@ -48,7 +57,29 @@ func MountRegistry(r chi.Router, k *kube.Client, reg registrySet) { // cluster. The provider set and its administrator-managed credentials remain // central; selecting a cluster never selects a different credential store. func MountRegistryWithRegistry(r chi.Router, clients *kube.Registry, reg registrySet) { - mountRegistry(r, ®istryHandler{clients: clients, reg: reg}) + MountRegistryWithOptions(r, clients, reg, RegistryOptions{}) +} + +// RegistryOptions carries the optional collaborators of the modpack routes. +// The zero value is valid: no explicit audit rows, key sharing always reads as +// off, and missing-file / legacy-adoption reads report "unknown". +type RegistryOptions struct { + // Audit records one explicit row per modpack install/change/remove. + Audit *audit.Auditor + // Home is the control-plane client that holds the managed registry key + // Secret (central, never the selected cluster); ControlNS is its namespace. + Home *kube.Client + ControlNS string + // Files reads small files from a server's data volume through its agent. + Files AgentFileReader +} + +// MountRegistryWithOptions is MountRegistryWithRegistry plus RegistryOptions. +func MountRegistryWithOptions(r chi.Router, clients *kube.Registry, reg registrySet, opts RegistryOptions) { + mountRegistry(r, ®istryHandler{ + clients: clients, reg: reg, + audit: opts.Audit, home: opts.Home, controlNS: opts.ControlNS, files: opts.Files, + }) } func mountRegistry(r chi.Router, h *registryHandler) { @@ -56,21 +87,29 @@ func mountRegistry(r chi.Router, h *registryHandler) { r.Get("/servers/{name}/mods/registry/search", h.search) r.Get("/servers/{name}/mods/registry/projects/{project}/versions", h.versions) r.Get("/servers/{name}/mods/registry/projects/{project}/modpack", h.modpackDeps) + r.Get("/servers/{name}/modpack", h.getModpack) r.Post("/servers/{name}/modpack", h.installModpack) + r.Delete("/servers/{name}/modpack", h.removeModpack) } type registryHandler struct { - clients *kube.Registry - k *kube.Client - reg registrySet + clients *kube.Registry + k *kube.Client + reg registrySet + audit *audit.Auditor + home *kube.Client + controlNS string + files AgentFileReader } // providerInfo is one entry of the providers listing the dashboard uses to // build its provider switch. type providerInfo struct { - Provider string `json:"provider"` - Available bool `json:"available"` - Modpacks bool `json:"modpacks"` + Provider string `json:"provider"` + Available bool `json:"available"` + Modpacks bool `json:"modpacks"` + ModsBrowse bool `json:"modsBrowse"` + ModpacksBlockedReason string `json:"modpacksBlockedReason"` } // providers lists the registries this server's template declares, marking @@ -85,9 +124,11 @@ func (h *registryHandler) providers(w http.ResponseWriter, req *http.Request) { out := make([]providerInfo, 0, len(declared)) for _, p := range declared { out = append(out, providerInfo{ - Provider: p.provider, - Available: h.reg.Available(req.Context(), p.provider), - Modpacks: p.modpacks != nil, + Provider: p.provider, + Available: h.reg.Available(req.Context(), p.provider), + Modpacks: p.modpacks != nil, + ModsBrowse: !p.modpacksOnly, + ModpacksBlockedReason: h.modpacksBlockedReason(req.Context(), target, p), }) } writeJSON(w, out) @@ -143,6 +184,7 @@ func (h *registryHandler) versions(w http.ResponseWriter, req *http.Request) { res, err := p.Versions(req.Context(), chi.URLParam(req, "project"), registry.Filter{ Loader: loader, GameVersion: gameVersion, + ProjectType: req.URL.Query().Get("type"), }) if err != nil { httperr.WriteCode(w, req, http.StatusBadGateway, fmt.Errorf("mod registry versions failed: %w", err)) @@ -172,16 +214,30 @@ func (h *registryHandler) modpackDeps(w http.ResponseWriter, req *http.Request) writeJSON(w, files) } -// installModpack applies an env-mode modpack (e.g. Modrinth on itzg): it -// patches the GameServer's env to pin the chosen pack, which the operator -// rolls out. Deps-mode providers (no refEnv) are installed via modpackDeps -// + /mods/install instead, so they get a 409 here. +// installModpack records an env-mode modpack (e.g. Modrinth, CurseForge, FTB +// on itzg) as GameServer.spec.modpack. It never touches spec.env: the operator +// renders the pack env and rolls the server out (spec 035, core rule 10). +// Deps-mode providers (no refEnv) are installed via modpackDeps + +// /mods/install instead, so they get a 409 here. The body is either the new +// {provider, project, version, title, versionName, backupFirst} (version +// required) or the legacy {"ref"} with ?provider= (project = ref, no pinned +// version). 400s (shape, version, backup destination) come before the 409s +// (key not shared, change in progress). func (h *registryHandler) installModpack(w http.ResponseWriter, req *http.Request) { target, ok := loadModTarget(w, req, h.clients, h.k) if !ok { return } - prov, ok := pickProvider(target.template, req.URL.Query().Get("provider")) + var body modpackInstallBody + if err := decodeBody(req, &body); err != nil { + httperr.WriteCode(w, req, http.StatusBadRequest, errModpackProject) + return + } + providerName := body.Provider + if providerName == "" { + providerName = req.URL.Query().Get("provider") + } + prov, ok := pickProvider(target.template, providerName) if !ok || prov.modpacks == nil { httperr.WriteCode(w, req, http.StatusNotImplemented, errNoRegistry) return @@ -191,23 +247,58 @@ func (h *registryHandler) installModpack(w http.ResponseWriter, req *http.Reques errors.New("this provider installs modpacks per dependency; install the resolved mods instead")) return } - - var body struct { - Ref string `json:"ref"` + legacy := strings.TrimSpace(body.Project) == "" && strings.TrimSpace(body.Ref) != "" + if !normalizeModpackBody(w, req, &body) { + return } - if err := decodeBody(req, &body); err != nil || strings.TrimSpace(body.Ref) == "" { - httperr.WriteCode(w, req, http.StatusBadRequest, errors.New("ref is required")) + if !legacy && body.Version == "" { + httperr.WriteMessage(w, req, messages.New("server.modpack.version_required", nil)) return } - - apply := append([]envKV{{Name: prov.modpacks.refEnv, Value: strings.TrimSpace(body.Ref)}}, prov.modpacks.env...) - if _, err := updateModTarget(req.Context(), target, func(current *unstructured.Unstructured) { - setEnvVars(current, apply) - }); err != nil { + if body.BackupFirst && h.backupDestinationName(req, target) == "" { + httperr.WriteMessage(w, req, messages.New("server.modpack.backup_unavailable", nil)) + return + } + if h.modpacksBlockedReason(req.Context(), target, prov) != "" { + httperr.WriteMessage(w, req, messages.New("server.modpack.key_required", nil)) + return + } + if modpackChangeInProgress(target.server) { + httperr.WriteMessage(w, req, messages.New("server.modpack.change_in_progress", nil)) + return + } + action := "install" + if cur := currentModpack(target.server); cur != nil && cur.Provider == prov.provider && cur.Project == body.Project { + action = "change" + } + spec := modpackSpecFrom(prov.provider, body) + // A fresh id per request: a repeat POST of the same choice after + // BackupFailed is then a new spec value (new generation), which tells the + // operator to start a new change. + requestID, err := newModpackRequestID() + if err != nil { httperr.Write(w, req, err) return } - writeJSON(w, map[string]any{"ok": true}) + spec["requestId"] = requestID + updated, err := updateModTarget(req.Context(), target, func(current *unstructured.Unstructured) { + // SetNestedMap only fails on a non-map parent; spec is always a map here. + _ = unstructured.SetNestedMap(current.Object, spec, "spec", "modpack") + // A removal whose backup failed leaves its request behind, and an + // adopted legacy pin would hold back the new pack; installing a pack + // supersedes both. + if ann := current.GetAnnotations(); ann != nil { + delete(ann, modpackRemoveAnnotation) + delete(ann, modpackAdoptedAnnotation) + current.SetAnnotations(ann) + } + }) + if err != nil { + httperr.Write(w, req, err) + return + } + h.auditModpack(req, target.server.GetName(), action, prov.provider, body.Project, body.Version) + writeJSONStatus(w, http.StatusAccepted, h.modpackViewFor(req, target, updated, false)) } // resolve picks the requested provider from the selected server's template, @@ -248,12 +339,25 @@ type providerCfg struct { curseforgeGameID int32 githubOwner string githubRepo string + modpacksOnly bool modpacks *modpackCfg } type modpackCfg struct { - refEnv string - env []envKV + refEnv string + versionEnv string + apiKeyEnv string + needsKeyImageTags []string + missingFilesPath string + adoptVersionFile *adoptFileCfg + env []envKV +} + +// adoptFileCfg mirrors ModpackSpec.adoptVersionFile: a JSON file below the data +// mount and the top-level field of it that holds the installed version. +type adoptFileCfg struct { + path string + field string } // registryProviders reads capabilities.mods.registry.providers[]. @@ -279,6 +383,7 @@ func registryProviders(tmpl *unstructured.Unstructured) []providerCfg { cfg.community, _ = m["community"].(string) cfg.steamAppID = nestedInt32(m["steamAppID"]) cfg.curseforgeGameID = nestedInt32(m["curseforgeGameID"]) + cfg.modpacksOnly, _ = m["modpacksOnly"].(bool) if gh, ok := m["github"].(map[string]any); ok { cfg.githubOwner, _ = gh["owner"].(string) cfg.githubRepo, _ = gh["repo"].(string) @@ -286,6 +391,23 @@ func registryProviders(tmpl *unstructured.Unstructured) []providerCfg { if mp, ok := m["modpacks"].(map[string]any); ok { mc := &modpackCfg{} mc.refEnv, _ = mp["refEnv"].(string) + mc.versionEnv, _ = mp["versionEnv"].(string) + mc.apiKeyEnv, _ = mp["apiKeyEnv"].(string) + mc.missingFilesPath, _ = mp["missingFilesPath"].(string) + if tags, ok := mp["needsKeyImageTags"].([]any); ok { + for _, t := range tags { + if s, ok := t.(string); ok && s != "" { + mc.needsKeyImageTags = append(mc.needsKeyImageTags, s) + } + } + } + if af, ok := mp["adoptVersionFile"].(map[string]any); ok { + p, _ := af["path"].(string) + f, _ := af["field"].(string) + if p != "" && f != "" { + mc.adoptVersionFile = &adoptFileCfg{path: p, field: f} + } + } if envs, ok := mp["env"].([]any); ok { for _, e := range envs { if em, ok := e.(map[string]any); ok { @@ -351,14 +473,16 @@ func pickProvider(tmpl *unstructured.Unstructured, name string) (providerCfg, bo return providerCfg{}, false } -// activeVersion mirrors the operator's version selection (and the web's -// activeVersion): the entry whose id matches the server's selection, else -// the default entry, else the first. Returns the entry's loader id and -// clean game-version token. Both may be empty. -func activeVersion(tmpl *unstructured.Unstructured, selected string) (loader, gameVersion string) { +// activeVersionEntry mirrors the operator's version selection (and the web's +// activeVersion): the entry whose id matches the server's selection, else the +// default entry, else the first. Nil when the template has no versions. +func activeVersionEntry(tmpl *unstructured.Unstructured, selected string) map[string]any { + if tmpl == nil { + return nil + } versions, found, err := unstructured.NestedSlice(tmpl.Object, "spec", "versions") if !found || err != nil { - return "", "" + return nil } var first, def map[string]any for _, raw := range versions { @@ -370,19 +494,26 @@ func activeVersion(tmpl *unstructured.Unstructured, selected string) (loader, ga first = m } if id, _ := m["id"].(string); selected != "" && id == selected { - return loaderGameVersion(m) + return m } if d, _ := m["default"].(bool); d && def == nil { def = m } } - switch { - case def != nil: - return loaderGameVersion(def) - case first != nil: - return loaderGameVersion(first) + if def != nil { + return def + } + return first +} + +// activeVersion returns the selected entry's loader id and clean game-version +// token. Both may be empty. +func activeVersion(tmpl *unstructured.Unstructured, selected string) (loader, gameVersion string) { + m := activeVersionEntry(tmpl, selected) + if m == nil { + return "", "" } - return "", "" + return loaderGameVersion(m) } func loaderGameVersion(m map[string]any) (loader, gameVersion string) { diff --git a/api/internal/handlers/registry_cluster_test.go b/api/internal/handlers/registry_cluster_test.go index fe81f76de..2c5aa4576 100644 --- a/api/internal/handlers/registry_cluster_test.go +++ b/api/internal/handlers/registry_cluster_test.go @@ -105,14 +105,31 @@ func TestRegistryRemoteUsesSelectedTemplateAndWritesOnlySelectedServer(t *testin router := mountClusterModRouter(modClusterClients(home, remote), set, modRouteUser("remote", "servers:read", "servers:write"), nil) response := do(t, router, route.method, route.path+"?cluster=remote", route.body) - if response.Code != http.StatusOK { - t.Fatalf("status = %d: %s", response.Code, response.Body) + wantStatus := http.StatusOK + if route.path == "/servers/alpha/modpack" && route.method == http.MethodPost { + wantStatus = http.StatusAccepted + } + if response.Code != wantStatus { + t.Fatalf("status = %d, want %d: %s", response.Code, wantStatus, response.Body) } if n := kubeClientCalls(t, home); n != 0 { t.Fatalf("home client saw %d calls", n) } - if n := len(remote.Typed.(*kubefake.Clientset).Actions()); n != 0 { - t.Fatalf("remote typed client saw %d calls; provider credentials must stay central", n) + remoteTyped := remote.Typed.(*kubefake.Clientset).Actions() + wantTyped := 0 + isModpackPost := route.path == "/servers/alpha/modpack" && route.method == http.MethodPost + if isModpackPost { + wantTyped = 1 + } + if n := len(remoteTyped); n != wantTyped { + t.Fatalf("remote typed client saw %d calls, want %d; provider credentials must stay central", n, wantTyped) + } + if isModpackPost { + list, ok := remoteTyped[0].(ktesting.ListAction) + if !ok || list.GetVerb() != "list" || list.GetResource().Resource != "secrets" || + list.GetListRestrictions().Labels.String() != "gameplane.local/backup-destination=true" { + t.Fatalf("remote typed call = %s %s, want list secrets with label gameplane.local/backup-destination=true", remoteTyped[0].GetVerb(), remoteTyped[0].GetResource().Resource) + } } switch route.path { case "/servers/alpha/mods/registry/providers": @@ -138,9 +155,11 @@ func TestRegistryRemoteUsesSelectedTemplateAndWritesOnlySelectedServer(t *testin t.Fatal(err) } env, _, _ := unstructured.NestedSlice(gs.Object, "spec", "env") - want := []any{map[string]any{"name": "KEEP", "value": "remote"}, map[string]any{"name": "remote_PACK", "value": "pack"}} - if !reflect.DeepEqual(env, want) || gs.GetUID() != "remote-uid" || gs.GetResourceVersion() != "17" { - t.Fatalf("updated wrong server or fields: metadata=%v env=%v", gs.Object["metadata"], env) + wantEnv := []any{map[string]any{"name": "KEEP", "value": "remote"}} + mp, _, _ := unstructured.NestedMap(gs.Object, "spec", "modpack") + if !reflect.DeepEqual(env, wantEnv) || mp["provider"] != "modrinth" || mp["project"] != "pack" || + gs.GetUID() != "remote-uid" || gs.GetResourceVersion() != "17" { + t.Fatalf("updated wrong server or fields: metadata=%v env=%v modpack=%v", gs.Object["metadata"], env, mp) } } }) @@ -210,6 +229,9 @@ func TestClusterModRoutesEnforceScopedPermissionsAndOwnership(t *testing.T) { if test.name == "remote read grant" && route.method != http.MethodGet { want = http.StatusForbidden } + if want == http.StatusOK && route.method == http.MethodPost && route.path == "/servers/alpha/modpack" { + want = http.StatusAccepted + } response := do(t, router, route.method, route.path+"?cluster=remote", route.body) if response.Code != want { t.Fatalf("status = %d, want %d: %s", response.Code, want, response.Body) diff --git a/api/internal/handlers/registry_modpack.go b/api/internal/handlers/registry_modpack.go new file mode 100644 index 000000000..c9118b0de --- /dev/null +++ b/api/internal/handlers/registry_modpack.go @@ -0,0 +1,452 @@ +package handlers + +import ( + "context" + "crypto/rand" + "encoding/hex" + "encoding/json" + "fmt" + "log/slog" + "net/http" + "regexp" + "slices" + "strconv" + "strings" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" + + "github.com/GameplanePanel/gameplane/api/internal/audit" + "github.com/GameplanePanel/gameplane/api/internal/httperr" + "github.com/GameplanePanel/gameplane/api/internal/messages" + "github.com/GameplanePanel/gameplane/api/internal/scope" +) + +// Spec 035: GameServer.spec.modpack is the only place the API records a pack; +// the operator renders the env and reports progress in status.modpack. The +// wire shapes follow specs/035-curseforge-modpacks/contracts/api-modpack.md. + +// modpackRemoveAnnotation mirrors v1alpha1.ModpackRemoveAnnotation (the API +// reads unstructured objects and does not import the operator types). +const modpackRemoveAnnotation = "gameplane.local/modpack-remove" + +// modpackProjectRe and modpackVersionRe mirror the GameServer CRD patterns of +// spec.modpack.project and spec.modpack.version, so a bad value is a 400 from +// us instead of an apiserver 422. +var ( + modpackProjectRe = regexp.MustCompile(`^[A-Za-z0-9._-]{1,128}$`) + modpackVersionRe = regexp.MustCompile(`^[A-Za-z0-9._-]{0,64}$`) +) + +// Phases written by the operator (status.modpack.phase). "Pending" is also +// synthesised by modpackPhase for a change the operator has not seen yet. +const ( + modpackPhasePending = "Pending" + modpackPhaseBackingUp = "BackingUp" + modpackPhaseApplying = "Applying" + modpackPhaseBackupFailed = "BackupFailed" +) + +// blockedCurseForgeKeyNotShared is providerInfo.modpacksBlockedReason when the +// selected version's image has no built-in CurseForge key and sharing is off. +const blockedCurseForgeKeyNotShared = "curseforge_key_not_shared" + +// modpackInstallBody is the POST /servers/{name}/modpack request. Ref is the +// pre-035 body ({"ref": ""} plus ?provider=); it is accepted as +// project with no pinned version so the current dashboard keeps working until +// the web tasks switch to the new body. +type modpackInstallBody struct { + Provider string `json:"provider"` + Project string `json:"project"` + Version string `json:"version"` + Title string `json:"title"` + VersionName string `json:"versionName"` + BackupFirst bool `json:"backupFirst"` + Ref string `json:"ref"` +} + +// modpackRemoveRequest is the JSON stored in the modpack-remove annotation. +type modpackRemoveRequest struct { + RequestID string `json:"requestId"` + BackupFirst bool `json:"backupFirst"` +} + +type modpackActive struct { + Provider string `json:"provider"` + Project string `json:"project"` + Version string `json:"version"` + Title string `json:"title"` + VersionName string `json:"versionName"` + Pinned bool `json:"pinned"` + PendingRemoval bool `json:"pendingRemoval,omitempty"` +} + +// modpackMissingFile is one row of MODS_NEED_DOWNLOAD.txt (parsed in modpack_missing.go). +type modpackMissingFile struct { + Mod string `json:"mod"` + VersionName string `json:"versionName"` + Filename string `json:"filename"` + DownloadPage string `json:"downloadPage"` +} + +type modpackView struct { + Active *modpackActive `json:"active"` + Phase string `json:"phase"` + Message string `json:"message"` + BackupName string `json:"backupName"` + KeyShared bool `json:"keyShared"` + MissingFiles []modpackMissingFile `json:"missingFiles"` + MissingFilesUnknown bool `json:"missingFilesUnknown"` + DownloadsPath string `json:"downloadsPath"` + BackupAvailable bool `json:"backupAvailable"` + // BackupDestination is the name of the backup destination the pre-change + // backup goes to (alphabetically first when several exist); empty when none. + BackupDestination string `json:"backupDestination,omitempty"` +} + +// getModpack serves GET /servers/{name}/modpack. A legacy server (pack env in +// spec.env, no spec.modpack) is adopted first (modpack_adopt.go, research R6). +func (h *registryHandler) getModpack(w http.ResponseWriter, req *http.Request) { + target, ok := loadModTarget(w, req, h.clients, h.k) + if !ok { + return + } + gs := h.adoptLegacy(req.Context(), target) + writeJSON(w, h.modpackViewFor(req, target, gs, true)) +} + +// modpackViewFor builds the GET body from a server object (the one just +// written, for POST/DELETE responses). withMissing reads MODS_NEED_DOWNLOAD.txt +// through the agent (GET only; POST/DELETE skip the agent round trip). +func (h *registryHandler) modpackViewFor(req *http.Request, target *modTarget, gs *unstructured.Unstructured, withMissing bool) modpackView { + view := modpackView{MissingFiles: []modpackMissingFile{}} + spec, hasSpec, _ := unstructured.NestedMap(gs.Object, "spec", "modpack") + st, _, _ := unstructured.NestedMap(gs.Object, "status", "modpack") + applied, hasApplied, _ := unstructured.NestedMap(st, "applied") + removing := gs.GetAnnotations()[modpackRemoveAnnotation] != "" + + switch { + case hasSpec: + view.Active = activeFrom(spec, false) + case hasApplied && removing: + view.Active = activeFrom(applied, true) + } + view.Phase = modpackPhase(gs) + view.Message, _, _ = unstructured.NestedString(st, "message") + view.BackupName, _, _ = unstructured.NestedString(st, "backupName") + view.KeyShared, _, _ = unstructured.NestedBool(st, "keyShared") + view.BackupDestination = h.backupDestinationName(req, target) + view.BackupAvailable = view.BackupDestination != "" + if withMissing { + h.fillMissingFiles(req, target, gs, &view) + } + return view +} + +// modpackPhase is status.modpack.phase, except that a change the operator has +// not picked up yet (spec.modpack differs from status.modpack.applied, or a +// removal is requested while a pack is still applied) reads "Pending". The one +// exception: BackupFailed for the request that is current (same request id and +// the target it started from still desired) stays visible, because the +// operator leaves spec unequal to applied after refusing it; an unrelated spec +// edit does not hide it. +func modpackPhase(gs *unstructured.Unstructured) string { + st, _, _ := unstructured.NestedMap(gs.Object, "status", "modpack") + phase, _, _ := unstructured.NestedString(st, "phase") + spec, hasSpec, _ := unstructured.NestedMap(gs.Object, "spec", "modpack") + applied, hasApplied, _ := unstructured.NestedMap(st, "applied") + removing := gs.GetAnnotations()[modpackRemoveAnnotation] != "" + waiting := (hasSpec && !samePack(spec, applied, hasApplied)) || (!hasSpec && hasApplied && removing) + if !waiting { + return phase + } + if phase == modpackPhaseBackupFailed { + target, hasTarget, _ := unstructured.NestedMap(st, "target") + requestID, _, _ := unstructured.NestedString(st, "requestId") + sameTarget := (hasSpec && samePack(spec, target, hasTarget)) || (!hasSpec && !hasTarget) + if sameTarget && requestID == currentModpackRequestID(gs) { + return phase + } + } + return modpackPhasePending +} + +// currentModpackRequestID mirrors the operator's modpackRequestID: the removal +// request id when a removal is requested, else spec.modpack.requestId. +func currentModpackRequestID(gs *unstructured.Unstructured) string { + ann := gs.GetAnnotations() + if raw := ann[modpackRemoveAnnotation]; raw != "" { + var req modpackRemoveRequest + if err := json.Unmarshal([]byte(raw), &req); err != nil { + return raw + } + return req.RequestID + } + id, _, _ := unstructured.NestedString(gs.Object, "spec", "modpack", "requestId") + return id +} + +// modpackChangeInProgress reports that a previous change has not finished: +// POST and DELETE answer 409 server.modpack.change_in_progress meanwhile. +// Applied, BackupFailed (for the current request) and "never managed" are +// all free to change. +func modpackChangeInProgress(gs *unstructured.Unstructured) bool { + switch modpackPhase(gs) { + case modpackPhasePending, modpackPhaseBackingUp, modpackPhaseApplying: + return true + } + return false +} + +// currentModpack is the pack the server has now: spec.modpack, else the +// applied pack of a removal still pending. Nil when none. +func currentModpack(gs *unstructured.Unstructured) *modpackActive { + if spec, ok, _ := unstructured.NestedMap(gs.Object, "spec", "modpack"); ok { + return activeFrom(spec, false) + } + if applied, ok, _ := unstructured.NestedMap(gs.Object, "status", "modpack", "applied"); ok { + return activeFrom(applied, true) + } + return nil +} + +func activeFrom(m map[string]any, pendingRemoval bool) *modpackActive { + str := func(k string) string { s, _ := m[k].(string); return s } + a := &modpackActive{ + Provider: str("provider"), Project: str("project"), Version: str("version"), + Title: str("title"), VersionName: str("versionName"), PendingRemoval: pendingRemoval, + } + a.Pinned = a.Version != "" + return a +} + +func samePack(spec, applied map[string]any, hasApplied bool) bool { + if !hasApplied { + return false + } + for _, k := range []string{"provider", "project", "version", "title", "versionName"} { + a, _ := spec[k].(string) + b, _ := applied[k].(string) + if a != b { + return false + } + } + return true +} + +// backupDestinationName returns the name of the backup destination in the +// server's namespace (a Secret labelled gameplane.local/backup-destination=true, +// the same discovery the /backup-destinations routes use, destinations.go), +// or "" when there is none. When several exist the alphabetically first name +// wins, matching the operator's choice (gameserver_modpack.go). +func (h *registryHandler) backupDestinationName(req *http.Request, target *modTarget) string { + if target.k == nil || target.k.Typed == nil { + return "" + } + list, err := target.k.Typed.CoreV1().Secrets(target.namespace).List(req.Context(), metav1.ListOptions{ + LabelSelector: destinationLabel + "=true", + }) + if err != nil || len(list.Items) == 0 { + return "" + } + names := make([]string, 0, len(list.Items)) + for _, s := range list.Items { + names = append(names, s.Name) + } + slices.Sort(names) + return names[0] +} + +// modpacksBlockedReason is providerInfo.modpacksBlockedReason: non-empty when +// the provider declares needsKeyImageTags, the server's selected version image +// carries one of those tags, and the administrator has not enabled key +// sharing. The Secret is read only when the first two hold. +func (h *registryHandler) modpacksBlockedReason(ctx context.Context, target *modTarget, p providerCfg) string { + if p.modpacks == nil || len(p.modpacks.needsKeyImageTags) == 0 { + return "" + } + selected, _, _ := unstructured.NestedString(target.server.Object, "spec", "version") + entry := activeVersionEntry(target.template, selected) + if entry == nil { + return "" + } + image, _ := entry["image"].(string) + tag := imageTag(image) + if tag == "" || !slices.Contains(p.modpacks.needsKeyImageTags, tag) { + return "" + } + // The share flag lives on the management cluster's Secret; a remote + // cluster's operator reads its own namespace and never gets the key, so + // it counts as not shared there. + if target.cluster == scope.DefaultCluster && h.keyShared(ctx) { + return "" + } + return blockedCurseForgeKeyNotShared +} + +// keyShared reads the share annotation of the managed CurseForge key Secret +// (registry_secret.go:curseforgeShareState). False with no home client. +func (h *registryHandler) keyShared(ctx context.Context) bool { + share, _ := curseforgeShareState(ctx, h.home, h.controlNS) + return share +} + +// imageTag returns the tag of an image reference: the part after the last ":" +// of the last path element and before "@digest". "" when there is no tag. +func imageTag(image string) string { + if i := strings.IndexByte(image, '@'); i >= 0 { + image = image[:i] + } + slash := strings.LastIndexByte(image, '/') + colon := strings.LastIndexByte(image, ':') + if colon > slash { + return image[colon+1:] + } + return "" +} + +// removeModpack serves DELETE /servers/{name}/modpack?backupFirst=true|false. +// It deletes spec.modpack and asks the operator (annotation) to remove the pack, +// wipe the mods folder and optionally back up first. Allowed when spec.modpack is +// set, when a removal failed (BackupFailed, annotation still present: the retry +// replaces the annotation) or when only status.modpack.applied is left. 404 only +// when neither spec.modpack nor status.modpack.applied is set. +func (h *registryHandler) removeModpack(w http.ResponseWriter, req *http.Request) { + target, ok := loadModTarget(w, req, h.clients, h.k) + if !ok { + return + } + backupFirst := false + if raw := req.URL.Query().Get("backupFirst"); raw != "" { + v, err := strconv.ParseBool(raw) + if err != nil { + httperr.WriteCode(w, req, http.StatusBadRequest, errModpackBackupFirst) + return + } + backupFirst = v + } + gs := target.server + spec, hasSpec, _ := unstructured.NestedMap(gs.Object, "spec", "modpack") + applied, hasApplied, _ := unstructured.NestedMap(gs.Object, "status", "modpack", "applied") + if !hasSpec && !hasApplied { + httperr.WriteMessage(w, req, messages.New("server.modpack.not_found", nil)) + return + } + if backupFirst && h.backupDestinationName(req, target) == "" { + httperr.WriteMessage(w, req, messages.New("server.modpack.backup_unavailable", nil)) + return + } + // A failed removal is retried by calling DELETE again; every other + // unfinished change blocks. + retry := !hasSpec && gs.GetAnnotations()[modpackRemoveAnnotation] != "" && modpackPhase(gs) == modpackPhaseBackupFailed + if !retry && modpackChangeInProgress(gs) { + httperr.WriteMessage(w, req, messages.New("server.modpack.change_in_progress", nil)) + return + } + removed := activeFrom(applied, false) + if hasSpec { + removed = activeFrom(spec, false) + } + requestID, err := newModpackRequestID() + if err != nil { + httperr.Write(w, req, err) + return + } + marker, err := json.Marshal(modpackRemoveRequest{RequestID: requestID, BackupFirst: backupFirst}) + if err != nil { + httperr.Write(w, req, fmt.Errorf("encode modpack removal request: %w", err)) + return + } + updated, err := updateModTarget(req.Context(), target, func(current *unstructured.Unstructured) { + unstructured.RemoveNestedField(current.Object, "spec", "modpack") + ann := current.GetAnnotations() + if ann == nil { + ann = map[string]string{} + } + ann[modpackRemoveAnnotation] = string(marker) + current.SetAnnotations(ann) + }) + if err != nil { + httperr.Write(w, req, err) + return + } + h.auditModpack(req, gs.GetName(), "remove", removed.Provider, removed.Project, removed.Version) + writeJSONStatus(w, http.StatusAccepted, h.modpackViewFor(req, target, updated, false)) +} + +// newModpackRequestID returns a random 128-bit hex id for a removal request. +func newModpackRequestID() (string, error) { + var b [16]byte + if _, err := rand.Read(b[:]); err != nil { + return "", fmt.Errorf("generate modpack request id: %w", err) + } + return hex.EncodeToString(b[:]), nil +} + +// auditModpack writes the explicit audit row of a modpack write (action is +// install, change or remove). Provider, project and version are validated +// slugs; the CurseForge key never reaches this code. A failed audit write is +// logged and the generic audit middleware row stays as the fallback. +func (h *registryHandler) auditModpack(req *http.Request, serverName, action, provider, project, version string) { + if h.audit == nil { + return + } + reason := fmt.Sprintf("server.modpack.%s provider=%s project=%s version=%s", action, provider, project, version) + if err := h.audit.WriteSync(req.Context(), req.Method, req.URL.Path, serverName, reason, http.StatusAccepted); err != nil { + slog.Warn("modpack audit write failed", "server", serverName, "action", action, "err", err) + return + } + audit.MarkRecorded(req.Context()) +} + +// modpackSpecFrom turns a validated install body into the spec.modpack map. +func modpackSpecFrom(provider string, b modpackInstallBody) map[string]any { + m := map[string]any{"provider": provider, "project": b.Project} + if b.Version != "" { + m["version"] = b.Version + } + if b.Title != "" { + m["title"] = truncate(b.Title, 128) + } + if b.VersionName != "" { + m["versionName"] = truncate(b.VersionName, 128) + } + if b.BackupFirst { + m["backupFirst"] = true + } + return m +} + +func truncate(s string, n int) string { + if r := []rune(s); len(r) > n { + return string(r[:n]) + } + return s +} + +// normalizeModpackBody resolves the legacy {"ref"} body and validates the +// fields against the CRD patterns. ok is false after writing a 400. +func normalizeModpackBody(w http.ResponseWriter, req *http.Request, b *modpackInstallBody) bool { + b.Project = strings.TrimSpace(b.Project) + if b.Project == "" { + b.Project = strings.TrimSpace(b.Ref) + } + b.Version = strings.TrimSpace(b.Version) + if !modpackProjectRe.MatchString(b.Project) { + httperr.WriteCode(w, req, http.StatusBadRequest, errModpackProject) + return false + } + if !modpackVersionRe.MatchString(b.Version) { + httperr.WriteCode(w, req, http.StatusBadRequest, errModpackVersion) + return false + } + return true +} + +// writeJSONStatus is writeJSON with an explicit status. Content-Type is set +// before WriteHeader, which snapshots the headers. +func writeJSONStatus(w http.ResponseWriter, status int, v any) { + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(status) + _ = json.NewEncoder(w).Encode(v) +} diff --git a/api/internal/handlers/registry_modpack_adopt_clear_envtest_test.go b/api/internal/handlers/registry_modpack_adopt_clear_envtest_test.go new file mode 100644 index 000000000..835b51ae7 --- /dev/null +++ b/api/internal/handlers/registry_modpack_adopt_clear_envtest_test.go @@ -0,0 +1,38 @@ +//go:build envtest + +package handlers + +import ( + "net/http" + "testing" + + "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" +) + +// TestModpackInstall_ClearsAdoptionPin asserts that installing a pack removes +// the legacy adoption pin (gameplane.local/modpack-adopted) so it no longer +// holds back the new pack, and that a pending removal request is cleared too. +func TestModpackInstall_ClearsAdoptionPin(t *testing.T) { + e := newModpackEnv(t, "servers:read", "servers:write") + gs := e.server(t, "1.21.1-neoforge", func(o *unstructured.Unstructured) { + o.SetAnnotations(map[string]string{ + modpackAdoptedAnnotation: `{"version":"legacy"}`, + modpackRemoveAnnotation: `{"requestId":"old","backupFirst":true}`, + }) + }) + path := "/servers/" + gs.GetName() + "/modpack" + + rr := modpackReq(t, e.router, http.MethodPost, path, map[string]any{ + "provider": "curseforge", "project": "all-the-mods-10", "version": "6512345", + "title": "All the Mods 10", "versionName": "ATM10-2.41"}) + if rr.Code != http.StatusAccepted { + t.Fatalf("POST status %d: %s", rr.Code, rr.Body) + } + ann := getServerObj(t, gs.GetName()).GetAnnotations() + if v, ok := ann[modpackAdoptedAnnotation]; ok { + t.Errorf("adoption pin still set after install: %q", v) + } + if v, ok := ann[modpackRemoveAnnotation]; ok { + t.Errorf("removal request still set after install: %q", v) + } +} diff --git a/api/internal/handlers/registry_modpack_destination_test.go b/api/internal/handlers/registry_modpack_destination_test.go new file mode 100644 index 000000000..bd85e1472 --- /dev/null +++ b/api/internal/handlers/registry_modpack_destination_test.go @@ -0,0 +1,53 @@ +package handlers + +import ( + "context" + "net/http" + "net/http/httptest" + "testing" + + corev1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + k8sfake "k8s.io/client-go/kubernetes/fake" + + "github.com/GameplanePanel/gameplane/api/internal/kube" +) + +func destinationSecret(ns, name string) *corev1.Secret { + return &corev1.Secret{ + ObjectMeta: metav1.ObjectMeta{ + Name: name, + Namespace: ns, + Labels: map[string]string{destinationLabel: "true"}, + }, + } +} + +func TestBackupDestinationNameFirstByName(t *testing.T) { + const ns = "games" + cs := k8sfake.NewSimpleClientset( + destinationSecret(ns, "b-dest"), + destinationSecret(ns, "a-dest"), + &corev1.Secret{ObjectMeta: metav1.ObjectMeta{Name: "unlabelled", Namespace: ns}}, + ) + h := ®istryHandler{} + target := &modTarget{k: &kube.Client{Typed: cs}, namespace: ns} + req := httptest.NewRequestWithContext(context.Background(), http.MethodGet, "/", nil) + if got := h.backupDestinationName(req, target); got != "a-dest" { + t.Errorf("backupDestinationName = %q, want a-dest", got) + } +} + +func TestBackupDestinationNameNone(t *testing.T) { + const ns = "games" + cs := k8sfake.NewSimpleClientset(&corev1.Secret{ObjectMeta: metav1.ObjectMeta{Name: "unlabelled", Namespace: ns}}) + h := ®istryHandler{} + target := &modTarget{k: &kube.Client{Typed: cs}, namespace: ns} + req := httptest.NewRequestWithContext(context.Background(), http.MethodGet, "/", nil) + if got := h.backupDestinationName(req, target); got != "" { + t.Errorf("backupDestinationName = %q, want empty", got) + } + if got := h.backupDestinationName(req, &modTarget{namespace: ns}); got != "" { + t.Errorf("nil client backupDestinationName = %q, want empty", got) + } +} diff --git a/api/internal/handlers/registry_modpack_envtest_test.go b/api/internal/handlers/registry_modpack_envtest_test.go new file mode 100644 index 000000000..7231c3ff3 --- /dev/null +++ b/api/internal/handlers/registry_modpack_envtest_test.go @@ -0,0 +1,386 @@ +//go:build envtest + +package handlers + +import ( + "context" + "encoding/json" + "net/http" + "strings" + "testing" + + "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" + k8sfake "k8s.io/client-go/kubernetes/fake" + + "github.com/GameplanePanel/gameplane/api/internal/audit" + "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/registry" + "github.com/GameplanePanel/gameplane/api/internal/scope" +) + +const modpackControlNS = "gameplane-system" + +type modpackEnv struct { + router http.Handler + home *kube.Client // envtest dynamic + fake typed (secrets) + files *fakeAgentFiles + auditor *audit.Auditor + tmpl string // template name +} + +// newModpackEnv mounts the registry routes for a user holding perms in the +// default namespace, creates the template, and returns the harness. +func newModpackEnv(t *testing.T, perms ...string) *modpackEnv { + t.Helper() + home := &kube.Client{Dynamic: kubeC.Dynamic, Typed: k8sfake.NewSimpleClientset(), Config: cfg} + clients := kube.NewRegistry(scope.DefaultCluster) + clients.Set(scope.DefaultCluster, home) + set := map[string]struct{}{} + for _, p := range perms { + set[p] = struct{}{} + } + user := &auth.User{ID: 99, Username: "modpack-tester", + Perms: map[string]map[string]map[string]struct{}{scope.DefaultCluster: {scope.DefaultNamespace: set}}} + env := &modpackEnv{home: home, files: &fakeAgentFiles{files: map[string]string{}}, auditor: audit.New(captureAuditStore)} + 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(), user))) + }) + }) + r.Use(rbac.Middleware(clients)) + MountRegistryWithOptions(r, clients, fakeSet{p: &fakeProvider{}}, RegistryOptions{ + Audit: env.auditor, Home: home, ControlNS: modpackControlNS, Files: env.files, + }) + env.router = r + + env.tmpl = uniqueResourceName("mp-tmpl") + if _, err := kubeC.Dynamic.Resource(gvrTemplates()).Create(context.Background(), modpackTestTemplate(env.tmpl), metav1.CreateOptions{}); err != nil { + t.Fatalf("create template: %v", err) + } + t.Cleanup(func() { + _ = kubeC.Dynamic.Resource(gvrTemplates()).Delete(context.Background(), env.tmpl, metav1.DeleteOptions{}) + }) + return env +} + +// server creates a GameServer on the env's template. mutate may add spec fields +// or annotations before create. Returns the stored object (generation set). +func (e *modpackEnv) server(t *testing.T, version string, mutate func(*unstructured.Unstructured)) *unstructured.Unstructured { + t.Helper() + name := uniqueResourceName("mp-srv") + gs := serverWithVersion(scope.DefaultNamespace, name, e.tmpl, version) + if mutate != nil { + mutate(gs) + } + res := kubeC.Dynamic.Resource(gvrServers()).Namespace(scope.DefaultNamespace) + created, err := res.Create(context.Background(), gs, metav1.CreateOptions{}) + if err != nil { + t.Fatalf("create server: %v", err) + } + t.Cleanup(func() { _ = res.Delete(context.Background(), name, metav1.DeleteOptions{}) }) + return created +} + +func setServerStatus(t *testing.T, name string, status map[string]any) { + t.Helper() + res := kubeC.Dynamic.Resource(gvrServers()).Namespace(scope.DefaultNamespace) + cur, err := res.Get(context.Background(), name, metav1.GetOptions{}) + if err != nil { + t.Fatalf("get server: %v", err) + } + if err := unstructured.SetNestedField(cur.Object, status, "status"); err != nil { + t.Fatalf("set status: %v", err) + } + if _, err := res.UpdateStatus(context.Background(), cur, metav1.UpdateOptions{}); err != nil { + t.Fatalf("update status: %v", err) + } +} + +func getServerObj(t *testing.T, name string) *unstructured.Unstructured { + t.Helper() + return getDynamic(t, gvrServers(), scope.DefaultNamespace, name) +} + +// modpackStatus builds status{phase, modpack{phase, observedGeneration, applied}}. +func modpackStatus(phase string, observedGeneration int64, applied map[string]any) map[string]any { + mp := map[string]any{"phase": phase, "observedGeneration": observedGeneration} + if applied != nil { + mp["applied"] = applied + } + return map[string]any{"phase": "Running", "modpack": mp} +} + +func (e *modpackEnv) addDestination(t *testing.T) { + t.Helper() + sec := &corev1.Secret{ObjectMeta: metav1.ObjectMeta{Name: "dest", Namespace: scope.DefaultNamespace, + Labels: map[string]string{destinationLabel: "true"}}} + if _, err := e.home.Typed.CoreV1().Secrets(scope.DefaultNamespace).Create(context.Background(), sec, metav1.CreateOptions{}); err != nil { + t.Fatalf("create destination: %v", err) + } +} + +// addKeySecret creates the managed CurseForge key Secret (Data is set directly: +// the fake clientset does not convert StringData). +func (e *modpackEnv) addKeySecret(t *testing.T, key string, shared bool) { + t.Helper() + sec := &corev1.Secret{ObjectMeta: metav1.ObjectMeta{Name: registry.DefaultKeySecretName("curseforge"), Namespace: modpackControlNS, + Labels: map[string]string{registry.RegistryKeySecretLabel: "true"}}, Data: map[string][]byte{"apiKey": []byte(key)}} + if shared { + sec.Annotations = map[string]string{curseforgeShareAnnotation: "true"} + } + if _, err := e.home.Typed.CoreV1().Secrets(modpackControlNS).Create(context.Background(), sec, metav1.CreateOptions{}); err != nil { + t.Fatalf("create key secret: %v", err) + } +} + +// auditReasons returns the reason of every POST/DELETE audit row of path. +func auditReasons(t *testing.T, a *audit.Auditor, method, path string) []string { + t.Helper() + var out []string + err := a.Stream(context.Background(), audit.StreamFilter{Method: method}, func(e audit.Event) error { + if e.Path == path { + out = append(out, e.Reason) + } + return nil + }) + if err != nil { + t.Fatalf("stream audit: %v", err) + } + return out +} + +// ----- T015 ----- + +func TestModpackInstall_WritesSpecAuditsWithoutKey(t *testing.T) { + e := newModpackEnv(t, "servers:read", "servers:write") + e.addKeySecret(t, "super-secret-cf-key", true) + gs := e.server(t, "1.21.1-neoforge", nil) + path := "/servers/" + gs.GetName() + "/modpack" + + rr := modpackReq(t, e.router, http.MethodPost, path, map[string]any{ + "provider": "curseforge", "project": "all-the-mods-10", "version": "6512345", + "title": "All the Mods 10", "versionName": "ATM10-2.41"}) + if rr.Code != http.StatusAccepted { + t.Fatalf("POST status %d: %s", rr.Code, rr.Body) + } + v := decodeModpackView(t, rr) + if v.Active == nil || v.Active.Provider != "curseforge" || v.Active.Version != "6512345" || !v.Active.Pinned { + t.Errorf("response active = %+v", v.Active) + } + got := getServerObj(t, gs.GetName()) + spec, _, _ := unstructured.NestedMap(got.Object, "spec", "modpack") + if spec["provider"] != "curseforge" || spec["project"] != "all-the-mods-10" || spec["version"] != "6512345" || + spec["title"] != "All the Mods 10" || spec["versionName"] != "ATM10-2.41" { + t.Errorf("spec.modpack = %v", spec) + } + if _, found, _ := unstructured.NestedSlice(got.Object, "spec", "env"); found { + t.Errorf("spec.env must stay untouched (the operator renders the pack env)") + } + reasons := auditReasons(t, e.auditor, http.MethodPost, path) + if len(reasons) != 1 || reasons[0] != "server.modpack.install provider=curseforge project=all-the-mods-10 version=6512345" { + t.Errorf("audit reasons = %v", reasons) + } + for _, r := range reasons { + if strings.Contains(r, "super-secret-cf-key") { + t.Errorf("audit row leaks the key: %q", r) + } + } +} + +func TestModpackInstall_SameProjectIsAChange(t *testing.T) { + e := newModpackEnv(t, "servers:read", "servers:write") + gs := e.server(t, "1.21.1-neoforge", func(o *unstructured.Unstructured) { + _ = unstructured.SetNestedMap(o.Object, map[string]any{"provider": "modrinth", "project": "cobblemon", "version": "v1"}, "spec", "modpack") + }) + setServerStatus(t, gs.GetName(), modpackStatus("Applied", gs.GetGeneration(), + map[string]any{"provider": "modrinth", "project": "cobblemon", "version": "v1"})) + path := "/servers/" + gs.GetName() + "/modpack" + rr := modpackReq(t, e.router, http.MethodPost, path, map[string]any{"provider": "modrinth", "project": "cobblemon", "version": "v2"}) + if rr.Code != http.StatusAccepted { + t.Fatalf("status %d: %s", rr.Code, rr.Body) + } + if reasons := auditReasons(t, e.auditor, http.MethodPost, path); len(reasons) != 1 || !strings.HasPrefix(reasons[0], "server.modpack.change provider=modrinth project=cobblemon version=v2") { + t.Errorf("audit reasons = %v", reasons) + } +} + +func TestModpackInstall_NeedsManagePermission(t *testing.T) { + e := newModpackEnv(t, "servers:read") + gs := e.server(t, "1.21.1-neoforge", nil) + rr := modpackReq(t, e.router, http.MethodPost, "/servers/"+gs.GetName()+"/modpack", + map[string]any{"provider": "modrinth", "project": "cobblemon", "version": "v1"}) + if rr.Code != http.StatusForbidden { + t.Fatalf("read-only user got %d, want 403", rr.Code) + } + if _, found, _ := unstructured.NestedMap(getServerObj(t, gs.GetName()).Object, "spec", "modpack"); found { + t.Errorf("spec.modpack written despite 403") + } + if rr := modpackReq(t, e.router, http.MethodGet, "/servers/"+gs.GetName()+"/modpack", nil); rr.Code != http.StatusOK { + t.Errorf("read user GET status %d", rr.Code) + } +} + +func TestModpackInstall_KeyRequiredWhileSharingOff(t *testing.T) { + e := newModpackEnv(t, "servers:read", "servers:write") + gs := e.server(t, "1.12.2-forge", nil) // java8-multiarch image: no built-in key + path := "/servers/" + gs.GetName() + "/modpack" + body := map[string]any{"provider": "curseforge", "project": "sky-factory-4", "version": "2915237"} + + rr := modpackReq(t, e.router, http.MethodPost, path, body) + if rr.Code != http.StatusConflict || problemID(t, rr) != "server.modpack.key_required" { + t.Fatalf("status %d id %q, want 409 server.modpack.key_required", rr.Code, problemID(t, rr)) + } + if _, found, _ := unstructured.NestedMap(getServerObj(t, gs.GetName()).Object, "spec", "modpack"); found { + t.Errorf("spec.modpack written despite 409") + } + // Sharing on (managed key + annotation): the same request is accepted. + e.addKeySecret(t, "k", true) + if rr := modpackReq(t, e.router, http.MethodPost, path, body); rr.Code != http.StatusAccepted { + t.Fatalf("after sharing on: status %d: %s", rr.Code, rr.Body) + } +} + +func TestModpackInstall_VersionRequiredLegacyBodyStillAccepted(t *testing.T) { + e := newModpackEnv(t, "servers:read", "servers:write") + gs := e.server(t, "1.21.1-neoforge", nil) + path := "/servers/" + gs.GetName() + "/modpack" + + rr := modpackReq(t, e.router, http.MethodPost, path, map[string]any{"provider": "modrinth", "project": "cobblemon"}) + if rr.Code != http.StatusBadRequest || problemID(t, rr) != "server.modpack.version_required" { + t.Fatalf("status %d id %q, want 400 server.modpack.version_required", rr.Code, problemID(t, rr)) + } + rr = modpackReq(t, e.router, http.MethodPost, path+"?provider=modrinth", map[string]any{"ref": "cobblemon"}) + if rr.Code != http.StatusAccepted { + t.Fatalf("legacy {ref} body: status %d: %s", rr.Code, rr.Body) + } + spec, _, _ := unstructured.NestedMap(getServerObj(t, gs.GetName()).Object, "spec", "modpack") + if spec["provider"] != "modrinth" || spec["project"] != "cobblemon" || spec["version"] != nil { + t.Errorf("legacy spec.modpack = %v", spec) + } +} + +// ----- T038 ----- + +func appliedCF() map[string]any { + return map[string]any{"provider": "curseforge", "project": "atm10", "version": "6512345"} +} + +func TestModpackRemove_SetsAnnotationAndShowsPendingRemoval(t *testing.T) { + e := newModpackEnv(t, "servers:read", "servers:write") + e.addDestination(t) + gs := e.server(t, "1.21.1-neoforge", func(o *unstructured.Unstructured) { + _ = unstructured.SetNestedMap(o.Object, appliedCF(), "spec", "modpack") + }) + setServerStatus(t, gs.GetName(), modpackStatus("Applied", gs.GetGeneration(), appliedCF())) + path := "/servers/" + gs.GetName() + "/modpack" + + rr := modpackReq(t, e.router, http.MethodDelete, path+"?backupFirst=true", nil) + if rr.Code != http.StatusAccepted { + t.Fatalf("DELETE status %d: %s", rr.Code, rr.Body) + } + v := decodeModpackView(t, rr) + if v.Active == nil || !v.Active.PendingRemoval || v.Active.Project != "atm10" || v.Phase != "Pending" { + t.Errorf("response = %+v active=%+v, want pendingRemoval active atm10 and phase Pending", v, v.Active) + } + got := getServerObj(t, gs.GetName()) + if _, found, _ := unstructured.NestedMap(got.Object, "spec", "modpack"); found { + t.Errorf("spec.modpack still set") + } + var marker modpackRemoveRequest + if err := json.Unmarshal([]byte(got.GetAnnotations()[modpackRemoveAnnotation]), &marker); err != nil || marker.RequestID == "" || !marker.BackupFirst { + t.Errorf("annotation = %q (err %v), want requestId and backupFirst=true", got.GetAnnotations()[modpackRemoveAnnotation], err) + } + // GET shows the same pending removal. + g := decodeModpackView(t, modpackReq(t, e.router, http.MethodGet, path, nil)) + if g.Active == nil || !g.Active.PendingRemoval || !g.BackupAvailable { + t.Errorf("GET = %+v active=%+v", g, g.Active) + } + if reasons := auditReasons(t, e.auditor, http.MethodDelete, path); len(reasons) != 1 || + reasons[0] != "server.modpack.remove provider=curseforge project=atm10 version=6512345" { + t.Errorf("audit reasons = %v", reasons) + } +} + +func TestModpackRemove_BackupFirstNeedsDestination(t *testing.T) { + e := newModpackEnv(t, "servers:read", "servers:write") + gs := e.server(t, "1.21.1-neoforge", func(o *unstructured.Unstructured) { + _ = unstructured.SetNestedMap(o.Object, appliedCF(), "spec", "modpack") + }) + setServerStatus(t, gs.GetName(), modpackStatus("Applied", gs.GetGeneration(), appliedCF())) + path := "/servers/" + gs.GetName() + "/modpack" + rr := modpackReq(t, e.router, http.MethodDelete, path+"?backupFirst=true", nil) + if rr.Code != http.StatusBadRequest || problemID(t, rr) != "server.modpack.backup_unavailable" { + t.Fatalf("status %d id %q, want 400 server.modpack.backup_unavailable", rr.Code, problemID(t, rr)) + } + if rr := modpackReq(t, e.router, http.MethodDelete, path+"?backupFirst=maybe", nil); rr.Code != http.StatusBadRequest { + t.Errorf("invalid backupFirst status %d, want 400", rr.Code) + } + if _, found, _ := unstructured.NestedMap(getServerObj(t, gs.GetName()).Object, "spec", "modpack"); !found { + t.Errorf("a rejected DELETE must not remove spec.modpack") + } +} + +func TestModpackRemove_RetryAfterFailedBackup(t *testing.T) { + e := newModpackEnv(t, "servers:read", "servers:write") + gs := e.server(t, "1.21.1-neoforge", func(o *unstructured.Unstructured) { + o.SetAnnotations(map[string]string{modpackRemoveAnnotation: `{"requestId":"old","backupFirst":true}`}) + }) + setServerStatus(t, gs.GetName(), map[string]any{"phase": "Running", "modpack": map[string]any{ + "phase": "BackupFailed", "observedGeneration": gs.GetGeneration(), "requestId": "old", "message": "backup failed", "applied": appliedCF()}}) + path := "/servers/" + gs.GetName() + "/modpack" + + g := decodeModpackView(t, modpackReq(t, e.router, http.MethodGet, path, nil)) + if g.Phase != "BackupFailed" || g.Message != "backup failed" || g.Active == nil || !g.Active.PendingRemoval { + t.Errorf("GET before retry = %+v active=%+v", g, g.Active) + } + rr := modpackReq(t, e.router, http.MethodDelete, path+"?backupFirst=false", nil) + if rr.Code != http.StatusAccepted { + t.Fatalf("retry status %d: %s", rr.Code, rr.Body) + } + var marker modpackRemoveRequest + if err := json.Unmarshal([]byte(getServerObj(t, gs.GetName()).GetAnnotations()[modpackRemoveAnnotation]), &marker); err != nil || + marker.RequestID == "" || marker.RequestID == "old" || marker.BackupFirst { + t.Errorf("retry annotation = %+v (err %v), want a new requestId and backupFirst=false", marker, err) + } +} + +func TestModpackRemove_NotFoundOnlyWithoutSpecAndApplied(t *testing.T) { + e := newModpackEnv(t, "servers:read", "servers:write") + none := e.server(t, "1.21.1-neoforge", nil) + rr := modpackReq(t, e.router, http.MethodDelete, "/servers/"+none.GetName()+"/modpack", nil) + if rr.Code != http.StatusNotFound || problemID(t, rr) != "server.modpack.not_found" { + t.Fatalf("no pack: status %d id %q, want 404 server.modpack.not_found", rr.Code, problemID(t, rr)) + } + // spec.modpack alone (never applied yet) is removable. + specOnly := e.server(t, "1.21.1-neoforge", func(o *unstructured.Unstructured) { + _ = unstructured.SetNestedMap(o.Object, appliedCF(), "spec", "modpack") + }) + setServerStatus(t, specOnly.GetName(), modpackStatus("Applied", specOnly.GetGeneration(), appliedCF())) + if rr := modpackReq(t, e.router, http.MethodDelete, "/servers/"+specOnly.GetName()+"/modpack", nil); rr.Code != http.StatusAccepted { + t.Errorf("spec+applied: status %d: %s", rr.Code, rr.Body) + } + // status.modpack.applied alone (spec already gone, no removal in flight) is removable too. + appliedOnly := e.server(t, "1.21.1-neoforge", nil) + setServerStatus(t, appliedOnly.GetName(), modpackStatus("Applied", appliedOnly.GetGeneration(), appliedCF())) + if rr := modpackReq(t, e.router, http.MethodDelete, "/servers/"+appliedOnly.GetName()+"/modpack", nil); rr.Code != http.StatusAccepted { + t.Errorf("applied only: status %d: %s", rr.Code, rr.Body) + } +} + +func TestModpackRemove_ConflictWhileApplying(t *testing.T) { + e := newModpackEnv(t, "servers:read", "servers:write") + gs := e.server(t, "1.21.1-neoforge", func(o *unstructured.Unstructured) { + _ = unstructured.SetNestedMap(o.Object, appliedCF(), "spec", "modpack") + }) + setServerStatus(t, gs.GetName(), modpackStatus("Applying", gs.GetGeneration(), appliedCF())) + rr := modpackReq(t, e.router, http.MethodDelete, "/servers/"+gs.GetName()+"/modpack", nil) + if rr.Code != http.StatusConflict || problemID(t, rr) != "server.modpack.change_in_progress" { + t.Fatalf("status %d id %q, want 409 server.modpack.change_in_progress", rr.Code, problemID(t, rr)) + } +} diff --git a/api/internal/handlers/registry_modpack_remote_key_test.go b/api/internal/handlers/registry_modpack_remote_key_test.go new file mode 100644 index 000000000..7a19b2d22 --- /dev/null +++ b/api/internal/handlers/registry_modpack_remote_key_test.go @@ -0,0 +1,46 @@ +package handlers + +import ( + "context" + "testing" + + corev1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + + "github.com/GameplanePanel/gameplane/api/internal/registry" + "github.com/GameplanePanel/gameplane/api/internal/scope" +) + +// The share flag is read from the management cluster's Secret, but a remote +// cluster's operator never gets the key: a server on another cluster counts as +// "not shared" even when sharing is on at home. +func TestModpacksBlockedReason_RemoteClusterKeyNotShared(t *testing.T) { + home := fakeKubeClient() + sec := &corev1.Secret{ + ObjectMeta: metav1.ObjectMeta{ + Name: registry.DefaultKeySecretName("curseforge"), Namespace: "ctl", + Labels: map[string]string{registry.RegistryKeySecretLabel: "true"}, + Annotations: map[string]string{curseforgeShareAnnotation: "true"}, + }, + Data: map[string][]byte{"apiKey": []byte("k")}, + } + if _, err := home.Typed.CoreV1().Secrets("ctl").Create(context.Background(), sec, metav1.CreateOptions{}); err != nil { + t.Fatalf("create secret: %v", err) + } + h := ®istryHandler{home: home, controlNS: "ctl"} + tmpl := modpackTestTemplate("minecraft") + prov, ok := pickProvider(tmpl, "curseforge") + if !ok { + t.Fatal("curseforge provider missing from the test template") + } + server := modpackServerObj("alpha", "minecraft", "1.12.2-forge", "", nil) + + local := &modTarget{cluster: scope.DefaultCluster, server: server, template: tmpl} + if got := h.modpacksBlockedReason(context.Background(), local, prov); got != "" { + t.Errorf("home cluster with sharing on: blocked reason %q, want none", got) + } + remote := &modTarget{cluster: "edge-1", server: server, template: tmpl} + if got := h.modpacksBlockedReason(context.Background(), remote, prov); got != blockedCurseForgeKeyNotShared { + t.Errorf("remote cluster: blocked reason %q, want %q", got, blockedCurseForgeKeyNotShared) + } +} diff --git a/api/internal/handlers/registry_secret.go b/api/internal/handlers/registry_secret.go index 25f7057a6..7f3bfcb1e 100644 --- a/api/internal/handlers/registry_secret.go +++ b/api/internal/handlers/registry_secret.go @@ -1,11 +1,16 @@ package handlers import ( + "context" "encoding/json" "errors" + "io" "net/http" "github.com/go-chi/chi/v5" + apierrors "k8s.io/apimachinery/pkg/api/errors" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/client-go/util/retry" "github.com/GameplanePanel/gameplane/api/internal/httperr" "github.com/GameplanePanel/gameplane/api/internal/kube" @@ -29,6 +34,9 @@ func MountRegistrySecrets(r chi.Router, k *kube.Client, controlNS string) { type registrySecretHandler struct { k *kube.Client ns string + // startupKey is true when the --curseforge-api-key startup flag is set. + // Only this bool reaches the share view; the key itself never does. + startupKey bool } // secretName validates provider against the closed set of keyed @@ -84,3 +92,117 @@ func (h registrySecretHandler) del(w http.ResponseWriter, req *http.Request) { } w.WriteHeader(http.StatusNoContent) } + +// curseforgeShareAnnotation on the managed CurseForge key Secret turns on +// sharing the key with game servers (the operator copies it into a Secret +// owned by each server that runs a CurseForge pack). +const curseforgeShareAnnotation = "gameplane.local/share-with-game-servers" + +var errNoManagedKey = errors.New("no managed CurseForge key") + +// MountRegistryShare exposes the admin "share the CurseForge key with game +// servers" setting. RBAC: /admin/registries is config:manage in rbac.go. +func MountRegistryShare(r chi.Router, k *kube.Client, controlNS string) { + MountRegistryShareWithOptions(r, k, controlNS, RegistryShareOptions{}) +} + +// RegistryShareOptions carries what the share view needs to name the key +// source. It holds facts only (never the key value). +type RegistryShareOptions struct { + // StartupKeySet is true when the --curseforge-api-key startup flag is set. + StartupKeySet bool +} + +// MountRegistryShareWithOptions is MountRegistryShare with the startup-flag +// fact, so the GET view can report where the effective key comes from. +func MountRegistryShareWithOptions(r chi.Router, k *kube.Client, controlNS string, opts RegistryShareOptions) { + h := registrySecretHandler{k: k, ns: controlNS, startupKey: opts.StartupKeySet} + r.Get("/admin/registries/curseforge/share", h.getShare) + r.Put("/admin/registries/curseforge/share", h.putShare) +} + +type shareView struct { + Share bool `json:"share"` + ManagedKey bool `json:"managedKey"` + KeySource string `json:"keySource"` +} + +// keySourceFor names where the CurseForge key comes from: "admin" for a +// managed Secret key, "startup-flag" when only the flag is set, else "". +func (h registrySecretHandler) keySourceFor(managed bool) string { + switch { + case managed: + return "admin" + case h.startupKey: + return "startup-flag" + default: + return "" + } +} + +// curseforgeShareState reads the managed key Secret of the control namespace: +// managedKey is true when a Secret labelled for mod-registry keys holds a +// non-empty apiKey (a key given only by the startup flag does not count); +// share is true only then and with the annotation set to "true". Any read +// failure (or a nil client) is (false, false). +func curseforgeShareState(ctx context.Context, k *kube.Client, ns string) (share, managedKey bool) { + store := k.Secrets(ns) + if store == nil || ns == "" { + return false, false + } + sec, err := store.Get(ctx, registry.DefaultKeySecretName("curseforge"), metav1.GetOptions{}) + if err != nil || sec.Labels[registry.RegistryKeySecretLabel] != "true" || len(sec.Data["apiKey"]) == 0 { + return false, false + } + return sec.Annotations[curseforgeShareAnnotation] == "true", true +} + +func (h registrySecretHandler) getShare(w http.ResponseWriter, req *http.Request) { + share, managed := curseforgeShareState(req.Context(), h.k, h.ns) + writeJSON(w, shareView{Share: share, ManagedKey: managed, KeySource: h.keySourceFor(managed)}) +} + +func (h registrySecretHandler) putShare(w http.ResponseWriter, req *http.Request) { + var body struct { + Share *bool `json:"share"` + } + if err := json.NewDecoder(io.LimitReader(req.Body, 1<<10)).Decode(&body); err != nil || body.Share == nil { + httperr.WriteMessage(w, req, messages.New("server.common.invalid_json", nil)) + return + } + want := *body.Share + store := h.k.Secrets(h.ns) + name := registry.DefaultKeySecretName("curseforge") + ctx := req.Context() + err := retry.RetryOnConflict(retry.DefaultRetry, func() error { + sec, err := store.Get(ctx, name, metav1.GetOptions{}) + if err != nil { + return err + } + if sec.Labels[registry.RegistryKeySecretLabel] != "true" || len(sec.Data["apiKey"]) == 0 { + return errNoManagedKey + } + if want { + if sec.Annotations == nil { + sec.Annotations = map[string]string{} + } + sec.Annotations[curseforgeShareAnnotation] = "true" + } else { + delete(sec.Annotations, curseforgeShareAnnotation) + } + _, err = store.Update(ctx, sec, metav1.UpdateOptions{}) + return err + }) + switch { + case err == nil: + writeJSON(w, shareView{Share: want, ManagedKey: true, KeySource: h.keySourceFor(true)}) + case errors.Is(err, errNoManagedKey) || apierrors.IsNotFound(err): + if !want { + writeJSON(w, shareView{KeySource: h.keySourceFor(false)}) + return + } + httperr.WriteMessage(w, req, messages.New("server.registry.share_needs_managed_key", nil)) + default: + httperr.Write(w, req, err) + } +} diff --git a/api/internal/handlers/registry_share_keysource_test.go b/api/internal/handlers/registry_share_keysource_test.go new file mode 100644 index 000000000..263416e28 --- /dev/null +++ b/api/internal/handlers/registry_share_keysource_test.go @@ -0,0 +1,75 @@ +package handlers + +import ( + "context" + "encoding/json" + "net/http" + "net/http/httptest" + "testing" + + "github.com/go-chi/chi/v5" + corev1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + k8sfake "k8s.io/client-go/kubernetes/fake" + + "github.com/GameplanePanel/gameplane/api/internal/kube" + "github.com/GameplanePanel/gameplane/api/internal/registry" +) + +func shareKeySourceRouter(t *testing.T, secret *corev1.Secret, opts RegistryShareOptions) http.Handler { + t.Helper() + k := &kube.Client{Typed: k8sfake.NewSimpleClientset()} + if secret != nil { + if _, err := k.Typed.CoreV1().Secrets("gameplane-system").Create(context.Background(), secret, metav1.CreateOptions{}); err != nil { + t.Fatal(err) + } + } + r := chi.NewRouter() + MountRegistryShareWithOptions(r, k, "gameplane-system", opts) + return r +} + +func getShareKeySource(t *testing.T, h http.Handler) string { + t.Helper() + rec := httptest.NewRecorder() + h.ServeHTTP(rec, httptest.NewRequestWithContext(context.Background(), http.MethodGet, "/admin/registries/curseforge/share", nil)) + if rec.Code != http.StatusOK { + t.Fatalf("status = %d, body %s", rec.Code, rec.Body.String()) + } + var body map[string]any + if err := json.Unmarshal(rec.Body.Bytes(), &body); err != nil { + t.Fatal(err) + } + src, _ := body["keySource"].(string) + return src +} + +func TestRegistryShareKeySourceVocabulary(t *testing.T) { + managed := &corev1.Secret{ + ObjectMeta: metav1.ObjectMeta{ + Name: registry.DefaultKeySecretName("curseforge"), + Namespace: "gameplane-system", + Labels: map[string]string{registry.RegistryKeySecretLabel: "true"}, + }, + Data: map[string][]byte{"apiKey": []byte("k-secret")}, + } + cases := []struct { + name string + secret *corev1.Secret + opts RegistryShareOptions + want string + }{ + {"managed key wins over the flag", managed, RegistryShareOptions{StartupKeySet: true}, "admin"}, + {"managed key only", managed, RegistryShareOptions{}, "admin"}, + {"no secret, startup flag set", nil, RegistryShareOptions{StartupKeySet: true}, "startup-flag"}, + {"no secret, no flag", nil, RegistryShareOptions{}, ""}, + } + for _, tc := range cases { + t.Run(tc.name, func(t *testing.T) { + h := shareKeySourceRouter(t, tc.secret, tc.opts) + if got := getShareKeySource(t, h); got != tc.want { + t.Errorf("keySource = %q, want %q", got, tc.want) + } + }) + } +} diff --git a/api/internal/handlers/registry_share_test.go b/api/internal/handlers/registry_share_test.go new file mode 100644 index 000000000..70f49ac3b --- /dev/null +++ b/api/internal/handlers/registry_share_test.go @@ -0,0 +1,75 @@ +package handlers + +import ( + "context" + "encoding/json" + "net/http" + "testing" + + "github.com/go-chi/chi/v5" + corev1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + k8sfake "k8s.io/client-go/kubernetes/fake" + + "github.com/GameplanePanel/gameplane/api/internal/kube" + "github.com/GameplanePanel/gameplane/api/internal/registry" +) + +func shareRouter(t *testing.T, secret *corev1.Secret) (http.Handler, *kube.Client) { + t.Helper() + k := &kube.Client{Typed: k8sfake.NewSimpleClientset()} + if secret != nil { + if _, err := k.Typed.CoreV1().Secrets("gameplane-system").Create(context.Background(), secret, metav1.CreateOptions{}); err != nil { + t.Fatal(err) + } + } + r := chi.NewRouter() + MountRegistryShare(r, k, "gameplane-system") + return r, k +} + +func managedKeySecret() *corev1.Secret { + return &corev1.Secret{ObjectMeta: metav1.ObjectMeta{Name: registry.DefaultKeySecretName("curseforge"), Namespace: "gameplane-system", + Labels: map[string]string{registry.RegistryKeySecretLabel: "true"}}, Data: map[string][]byte{"apiKey": []byte("k")}} +} + +func TestShare_PutSetsAndClearsAnnotation(t *testing.T) { + r, k := shareRouter(t, managedKeySecret()) + var v shareView + if rr := do(t, r, http.MethodGet, "/admin/registries/curseforge/share", nil); rr.Code != 200 || json.Unmarshal(rr.Body.Bytes(), &v) != nil || v.Share || !v.ManagedKey { + t.Fatalf("initial GET = %d %s", rr.Code, rr.Body) + } + if rr := do(t, r, http.MethodPut, "/admin/registries/curseforge/share", map[string]any{"share": true}); rr.Code != 200 { + t.Fatalf("PUT true = %d %s", rr.Code, rr.Body) + } + sec, _ := k.Typed.CoreV1().Secrets("gameplane-system").Get(context.Background(), registry.DefaultKeySecretName("curseforge"), metav1.GetOptions{}) + if sec.Annotations[curseforgeShareAnnotation] != "true" || string(sec.Data["apiKey"]) != "k" { + t.Errorf("secret after PUT true: annotations=%v", sec.Annotations) + } + if rr := do(t, r, http.MethodPut, "/admin/registries/curseforge/share", map[string]any{"share": false}); rr.Code != 200 { + t.Fatalf("PUT false = %d %s", rr.Code, rr.Body) + } + sec, _ = k.Typed.CoreV1().Secrets("gameplane-system").Get(context.Background(), registry.DefaultKeySecretName("curseforge"), metav1.GetOptions{}) + if _, has := sec.Annotations[curseforgeShareAnnotation]; has { + t.Errorf("annotation not cleared: %v", sec.Annotations) + } +} + +func TestShare_NeedsManagedKey(t *testing.T) { + r, _ := shareRouter(t, nil) // only a startup flag would hold a key: no Secret + rr := modpackReq(t, r, http.MethodPut, "/admin/registries/curseforge/share", map[string]any{"share": true}) + if rr.Code != http.StatusConflict || problemID(t, rr) != "server.registry.share_needs_managed_key" { + t.Fatalf("status %d id %q, want 409 server.registry.share_needs_managed_key", rr.Code, problemID(t, rr)) + } + if rr := do(t, r, http.MethodPut, "/admin/registries/curseforge/share", map[string]any{"share": false}); rr.Code != 200 { + t.Errorf("clearing with no managed key = %d, want 200", rr.Code) + } + var v shareView + rr = do(t, r, http.MethodGet, "/admin/registries/curseforge/share", nil) + if err := json.Unmarshal(rr.Body.Bytes(), &v); err != nil || v.Share || v.ManagedKey { + t.Errorf("GET without secret = %s", rr.Body) + } + if rr := do(t, r, http.MethodPut, "/admin/registries/curseforge/share", "not an object"); rr.Code != http.StatusBadRequest { + t.Errorf("bad body = %d, want 400", rr.Code) + } +} diff --git a/api/internal/handlers/registry_test.go b/api/internal/handlers/registry_test.go index 669ef8502..1d36acd7d 100644 --- a/api/internal/handlers/registry_test.go +++ b/api/internal/handlers/registry_test.go @@ -332,7 +332,7 @@ func TestRegistry_UnknownServer_404(t *testing.T) { } } -func TestInstallModpack_SetsEnv(t *testing.T) { +func TestInstallModpack_WritesSpecModpack(t *testing.T) { versions := []any{map[string]any{"id": "1.21.4-fabric", "loader": "fabric", "gameVersion": "1.21.4", "default": true}} reg := map[string]any{ "provider": "modrinth", @@ -347,8 +347,9 @@ func TestInstallModpack_SetsEnv(t *testing.T) { ) r := mountRegistryRouter(k, fakeSet{p: &fakeProvider{}}) - rr := do(t, r, "POST", "/servers/alpha/modpack", map[string]any{"ref": "cobblemon"}) - if rr.Code != 200 { + rr := do(t, r, "POST", "/servers/alpha/modpack", + map[string]any{"provider": "modrinth", "project": "cobblemon", "version": "v1", "title": "Cobblemon", "versionName": "1.0"}) + if rr.Code != http.StatusAccepted { t.Fatalf("got %d %s", rr.Code, rr.Body) } gs, err := k.Dynamic.Resource(kube.GVRs["servers"]).Namespace("gameplane-games"). @@ -356,14 +357,12 @@ func TestInstallModpack_SetsEnv(t *testing.T) { if err != nil { t.Fatalf("get: %v", err) } - env, _, _ := unstructured.NestedSlice(gs.Object, "spec", "env") - got := map[string]string{} - for _, e := range env { - m := e.(map[string]any) - got[m["name"].(string)], _ = m["value"].(string) + mp, _, _ := unstructured.NestedMap(gs.Object, "spec", "modpack") + if mp["provider"] != "modrinth" || mp["project"] != "cobblemon" || mp["version"] != "v1" { + t.Errorf("spec.modpack = %v", mp) } - if got["MODRINTH_MODPACK"] != "cobblemon" || got["TYPE"] != "MODRINTH" { - t.Errorf("env = %v, want MODRINTH_MODPACK=cobblemon TYPE=MODRINTH", got) + if env, _, _ := unstructured.NestedSlice(gs.Object, "spec", "env"); len(env) != 0 { + t.Errorf("spec.env must stay untouched, got %v", env) } } diff --git a/api/internal/messages/entries_server.go b/api/internal/messages/entries_server.go index 38693be04..089e0202e 100644 --- a/api/internal/messages/entries_server.go +++ b/api/internal/messages/entries_server.go @@ -89,6 +89,36 @@ var serverEntries = []Entry{ Description: "API error from the server lifecycle API (lifecycle.go:cloneHandler).", Status: http.StatusBadRequest, }, + { + ID: "server.modpack.backup_unavailable", + English: "no backup destination is configured for this server", + Description: "API error from the modpack API (registry.go:installModpack, registry_modpack.go:removeModpack) when backupFirst is requested but the server has no backup destination.", + Status: http.StatusBadRequest, + }, + { + ID: "server.modpack.change_in_progress", + English: "a modpack change is already in progress; wait for it to finish", + Description: "API error from the modpack API (registry.go:installModpack, registry_modpack.go:removeModpack) while the previous modpack change is still pending, backing up or applying.", + Status: http.StatusConflict, + }, + { + ID: "server.modpack.key_required", + English: "this modpack registry needs the CurseForge key to be shared with game servers; ask an administrator to turn on key sharing", + Description: "API error from the modpack API (registry.go:installModpack) when the server's game image has no built-in CurseForge key and the administrator has not enabled key sharing.", + Status: http.StatusConflict, + }, + { + ID: "server.modpack.not_found", + English: "this server has no modpack", + Description: "API error from the modpack API (registry_modpack.go:removeModpack) when there is no modpack to remove.", + Status: http.StatusNotFound, + }, + { + ID: "server.modpack.version_required", + English: "version is required", + Description: "API error from the modpack API (registry.go:installModpack) when a modpack is installed without choosing a version.", + Status: http.StatusBadRequest, + }, { ID: "server.notifications.sink_name_not_dns_label", English: "sink name must be a DNS label (lowercase, digits, hyphens)", @@ -119,6 +149,12 @@ var serverEntries = []Entry{ Description: "API error from the mod-registry credentials API (registry_secret.go:put).", Status: http.StatusUnprocessableEntity, }, + { + ID: "server.registry.share_needs_managed_key", + English: "the CurseForge key must be saved in the panel before it can be shared with game servers", + Description: "API error from the mod-registry credentials API (registry_secret.go:putShare) when key sharing is turned on but the key comes only from a startup flag, not from a saved Secret.", + Status: http.StatusConflict, + }, { ID: "server.roles.admin_not_editable", English: "the admin role cannot be edited", diff --git a/api/internal/registry/curseforge.go b/api/internal/registry/curseforge.go index 78d063d99..be31aa921 100644 --- a/api/internal/registry/curseforge.go +++ b/api/internal/registry/curseforge.go @@ -7,7 +7,10 @@ import ( "io" "net/http" "net/url" + "slices" "strconv" + "strings" + "time" ) // Curseforge searches the CurseForge v1 API (api.curseforge.com), which @@ -45,8 +48,9 @@ func (g *curseforgeGame) Versions(ctx context.Context, projectID string, f Filte return g.cf.Versions(ctx, projectID, f) } -// ModpackDeps is a no-op: the games wired to CurseForge install content as -// single mods (or via idList), not via dependency resolution. +// ModpackDeps is a no-op: a CurseForge modpack installs through the game +// image's env (itzg AUTO_CURSEFORGE with the pack slug and file id the +// operator renders from spec.modpack), never by resolving dependency mods. func (g *curseforgeGame) ModpackDeps(ctx context.Context, projectID string) ([]File, error) { return g.cf.ModpackDeps(ctx, projectID) } @@ -182,10 +186,14 @@ func (m cfMod) project() Project { } } -// Versions lists a mod's files filtered to the active loader + game version, -// newest first (CurseForge returns files newest-first already). Files whose -// author disabled third-party distribution carry no downloadUrl and are -// skipped — the dashboard can't install them. +// Versions lists a mod's (or, with f.ProjectType "modpack", a modpack's) +// files filtered to the active loader + game version, newest first +// (CurseForge returns files newest-first already). Modpacks use the same +// /mods/{id}/files endpoint as mods (class 4471 only matters for search); +// because their pinned file id is what the operator installs, the filter is +// also applied client side for modpacks. Files whose author disabled +// third-party distribution carry no downloadUrl and are skipped — neither +// the dashboard nor the pack installer can fetch them. func (c *Curseforge) Versions(ctx context.Context, projectID string, f Filter) ([]Version, error) { params := url.Values{} if f.GameVersion != "" { @@ -211,11 +219,20 @@ func (c *Curseforge) Versions(ctx context.Context, projectID string, f Filter) ( if fl.DownloadURL == "" { continue } + if f.modpack() && !cfFileMatches(fl.GameVersions, f) { + continue + } + published := "" + if t, err := time.Parse(time.RFC3339Nano, fl.FileDate); err == nil { + published = t.UTC().Format(time.RFC3339) + } out = append(out, Version{ ID: strconv.Itoa(fl.ID), Name: fl.DisplayName, VersionNumber: fl.DisplayName, GameVersions: fl.GameVersions, + ReleaseType: cfReleaseType(fl.ReleaseType), + PublishedAt: published, Files: []File{{ Filename: fl.FileName, DownloadURL: fl.DownloadURL, @@ -234,12 +251,64 @@ type cfFile struct { DownloadURL string `json:"downloadUrl"` FileLength int64 `json:"fileLength"` GameVersions []string `json:"gameVersions"` + ReleaseType int `json:"releaseType"` + FileDate string `json:"fileDate"` +} + +// cfReleaseType maps CurseForge's numeric releaseType (1 release, 2 beta, +// 3 alpha) to the Version.ReleaseType vocabulary; "" for anything else. +func cfReleaseType(n int) string { + switch n { + case 1: + return "release" + case 2: + return "beta" + case 3: + return "alpha" + default: + return "" + } +} + +// cfLoaderTags maps a Gameplane loader id to the loader tag CurseForge puts +// in a file's gameVersions list next to the Minecraft version. +var cfLoaderTags = map[string]string{ + "forge": "Forge", + "neoforge": "NeoForge", + "fabric": "Fabric", + "quilt": "Quilt", +} + +// cfFileMatches reports whether a file's gameVersions tags fit the filter. +// The game version must be listed exactly (when set). The loader (when set) +// matches if the file lists it, or if the file lists no loader tag at all +// (nothing to judge by); a file that lists only other loaders is rejected. +func cfFileMatches(tags []string, f Filter) bool { + if f.GameVersion != "" && !slices.Contains(tags, f.GameVersion) { + return false + } + want, ok := cfLoaderTags[f.Loader] + if !ok { + return true + } + hasLoader := false + for _, tag := range tags { + for _, known := range cfLoaderTags { + if !strings.EqualFold(tag, known) { + continue + } + if strings.EqualFold(tag, want) { + return true + } + hasLoader = true + } + } + return !hasLoader } -// ModpackDeps is a no-op: the games wired to CurseForge install content as -// single mods (or via idList), not via dependency resolution — see -// curseforgeGame.ModpackDeps, the Provider surface that actually gets -// called. +// ModpackDeps is a no-op: a CurseForge modpack installs through the game +// image's env (see curseforgeGame.ModpackDeps, the Provider surface that +// actually gets called), so there are no dependency files to resolve. func (c *Curseforge) ModpackDeps(_ context.Context, _ string) ([]File, error) { return nil, nil } diff --git a/api/internal/registry/curseforge_modpack_test.go b/api/internal/registry/curseforge_modpack_test.go new file mode 100644 index 000000000..3dc75752c --- /dev/null +++ b/api/internal/registry/curseforge_modpack_test.go @@ -0,0 +1,128 @@ +package registry + +import ( + "context" + "net/http" + "net/http/httptest" + "os" + "reflect" + "testing" +) + +func versionIDs(vs []Version) []string { + ids := make([]string, 0, len(vs)) + for _, v := range vs { + ids = append(ids, v.ID) + } + return ids +} + +// TestCurseforgeModpackVersionsFiltered serves the hand-made class 4471 +// fixture (files mixing Minecraft versions and loaders, one with a null +// downloadUrl) and checks the engine asks CurseForge for the right facets +// and keeps only files matching the server's game version and loader. +func TestCurseforgeModpackVersionsFiltered(t *testing.T) { + body, err := os.ReadFile("testdata/curseforge/modpack-files.json") + if err != nil { + t.Fatalf("read fixture: %v", err) + } + var gotPath, gotGV, gotLoader, gotPageSize, gotKey string + srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + gotPath = r.URL.Path + gotGV = r.URL.Query().Get("gameVersion") + gotLoader = r.URL.Query().Get("modLoaderType") + gotPageSize = r.URL.Query().Get("pageSize") + gotKey = r.Header.Get("x-api-key") + _, _ = w.Write(body) + })) + defer srv.Close() + + cases := []struct { + name string + filter Filter + wantIDs []string + wantGV string + wantLoader string + }{ + {"neoforge 1.21.1", Filter{Loader: "neoforge", GameVersion: "1.21.1"}, []string{"6512345", "6498001"}, "1.21.1", "6"}, + {"forge 1.20.1", Filter{Loader: "forge", GameVersion: "1.20.1"}, []string{"5900123"}, "1.20.1", "1"}, + {"fabric 1.20.1", Filter{Loader: "fabric", GameVersion: "1.20.1"}, []string{"5712004"}, "1.20.1", "4"}, + {"forge 1.16.5", Filter{Loader: "forge", GameVersion: "1.16.5"}, []string{"4321987"}, "1.16.5", "1"}, + {"forge 1.21.1 has none", Filter{Loader: "forge", GameVersion: "1.21.1"}, []string{}, "1.21.1", "1"}, + {"no filter keeps every downloadable file", Filter{}, []string{"6512345", "6498001", "5900123", "5712004", "4321987"}, "", ""}, + } + for _, tc := range cases { + t.Run(tc.name, func(t *testing.T) { + tc.filter.ProjectType = "modpack" + got, err := testCurseforgeGame(srv.URL, cfGameMinecraft).Versions(context.Background(), "925200", tc.filter) + if err != nil { + t.Fatalf("Versions: %v", err) + } + if gotPath != "/mods/925200/files" { + t.Errorf("path = %q, want /mods/925200/files", gotPath) + } + if gotKey != "secret-key" { + t.Errorf("x-api-key = %q", gotKey) + } + if gotGV != tc.wantGV || gotLoader != tc.wantLoader || gotPageSize != "50" { + t.Errorf("query gameVersion=%q modLoaderType=%q pageSize=%q, want %q %q 50", gotGV, gotLoader, gotPageSize, tc.wantGV, tc.wantLoader) + } + if ids := versionIDs(got); !reflect.DeepEqual(ids, tc.wantIDs) { + t.Errorf("ids = %v, want %v", ids, tc.wantIDs) + } + }) + } +} + +// TestCurseforgeModpackVersionFields checks the mapped fields of the newest +// matching file, and that the null-downloadUrl file (6480777) is skipped. +func TestCurseforgeModpackVersionFields(t *testing.T) { + body, err := os.ReadFile("testdata/curseforge/modpack-files.json") + if err != nil { + t.Fatalf("read fixture: %v", err) + } + srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, _ *http.Request) { + _, _ = w.Write(body) + })) + defer srv.Close() + + got, err := testCurseforgeGame(srv.URL, cfGameMinecraft).Versions(context.Background(), "925200", + Filter{Loader: "neoforge", GameVersion: "1.21.1", ProjectType: "modpack"}) + if err != nil { + t.Fatalf("Versions: %v", err) + } + if len(got) != 2 { + t.Fatalf("len = %d, want 2 (beta file without downloadUrl is skipped)", len(got)) + } + v := got[0] + if v.ID != "6512345" || v.Name != "All the Mods 10-2.41" || v.VersionNumber != "All the Mods 10-2.41" { + t.Errorf("version = %+v", v) + } + if len(v.Files) != 1 || v.Files[0].Filename != "All the Mods 10-2.41.zip" || + v.Files[0].Size != 184549376 || !v.Files[0].Primary { + t.Errorf("files = %+v", v.Files) + } +} + +// TestCurseforgeModVersionsNotFilteredClientSide proves the client-side +// filter is modpack-only: mod lookups keep relying on CurseForge's own +// facets, so a mock that ignores them returns every downloadable file. +func TestCurseforgeModVersionsNotFilteredClientSide(t *testing.T) { + body, err := os.ReadFile("testdata/curseforge/modpack-files.json") + if err != nil { + t.Fatalf("read fixture: %v", err) + } + srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, _ *http.Request) { + _, _ = w.Write(body) + })) + defer srv.Close() + + got, err := testCurseforgeGame(srv.URL, cfGameMinecraft).Versions(context.Background(), "925200", + Filter{Loader: "neoforge", GameVersion: "1.21.1"}) + if err != nil { + t.Fatalf("Versions: %v", err) + } + if len(got) != 5 { + t.Errorf("len = %d, want 5 (no client-side filtering for mods)", len(got)) + } +} diff --git a/api/internal/registry/curseforge_version_meta_test.go b/api/internal/registry/curseforge_version_meta_test.go new file mode 100644 index 000000000..871ce8cdc --- /dev/null +++ b/api/internal/registry/curseforge_version_meta_test.go @@ -0,0 +1,49 @@ +package registry + +import ( + "context" + "net/http" + "net/http/httptest" + "testing" +) + +func TestCurseforgeVersionsCarryReleaseTypeAndPublishedAt(t *testing.T) { + srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, _ *http.Request) { + _, _ = w.Write([]byte(`{"data":[ + {"id":1,"displayName":"r","fileName":"r.jar","downloadUrl":"https://edge.forgecdn.net/r.jar","fileLength":1,"gameVersions":["1.21.1"],"releaseType":1,"fileDate":"2026-10-28T14:03:11.52Z"}, + {"id":2,"displayName":"b","fileName":"b.jar","downloadUrl":"https://edge.forgecdn.net/b.jar","fileLength":1,"gameVersions":["1.21.1"],"releaseType":2,"fileDate":"2026-10-28T14:03:11.52Z"}, + {"id":3,"displayName":"a","fileName":"a.jar","downloadUrl":"https://edge.forgecdn.net/a.jar","fileLength":1,"gameVersions":["1.21.1"],"releaseType":3,"fileDate":"2026-10-28T14:03:11.52Z"}, + {"id":4,"displayName":"u","fileName":"u.jar","downloadUrl":"https://edge.forgecdn.net/u.jar","fileLength":1,"gameVersions":["1.21.1"],"releaseType":9,"fileDate":"not-a-date"} + ]}`)) + })) + defer srv.Close() + + got, err := testCurseforgeGame(srv.URL, cfGameMinecraft).Versions(context.Background(), "925200", Filter{}) + if err != nil { + t.Fatalf("Versions: %v", err) + } + if len(got) != 4 { + t.Fatalf("len = %d, want 4", len(got)) + } + wantTypes := []string{"release", "beta", "alpha", ""} + for i, want := range wantTypes { + if got[i].ReleaseType != want { + t.Errorf("version %d ReleaseType = %q, want %q", i, got[i].ReleaseType, want) + } + } + if got[0].PublishedAt != "2026-10-28T14:03:11Z" { + t.Errorf("PublishedAt = %q, want 2026-10-28T14:03:11Z", got[0].PublishedAt) + } + if got[3].PublishedAt != "" { + t.Errorf("bad fileDate PublishedAt = %q, want empty", got[3].PublishedAt) + } +} + +func TestCfReleaseTypeMapping(t *testing.T) { + cases := map[int]string{1: "release", 2: "beta", 3: "alpha", 0: "", 9: ""} + for n, want := range cases { + if got := cfReleaseType(n); got != want { + t.Errorf("cfReleaseType(%d) = %q, want %q", n, got, want) + } + } +} diff --git a/api/internal/registry/ftb.go b/api/internal/registry/ftb.go new file mode 100644 index 000000000..04b3941fb --- /dev/null +++ b/api/internal/registry/ftb.go @@ -0,0 +1,361 @@ +package registry + +import ( + "context" + "encoding/json" + "errors" + "fmt" + "io" + "net/http" + "net/url" + "sort" + "strconv" + "strings" + "sync" + "time" + + "golang.org/x/sync/errgroup" +) + +// FTB searches Feed The Beast's public modpack API +// (api.feed-the-beast.com), which needs no key. It is modpack-only: the Mods +// tab never browses it (the template marks the provider modpacksOnly) and a +// non-modpack Search returns nothing, like Hangar does for modpacks. +// +// FTB's search answers with pack ids only, so Search asks for up to +// ftbCandidateLimit candidate ids, then resolves pack details in batches of +// ftbBatchSize with at most ftbConcurrency requests in flight, keeping only +// packs that have a version matching the server's Minecraft version and +// loader. Filtering happens before the page limit: it stops when the +// filtered page is full, the candidates run out, or ftbMaxDetails details +// have been resolved, so latency stays bounded. Details are cached for +// ftbDetailTTL (Versions reuses them). Installing is not done here: the +// operator installs the pack through the game image (TYPE=FTBA with the pack +// and version ids), so versions carry no download files. +type FTB struct { + client *http.Client + userAgent string + baseURL string // overridable in tests; default https://api.feed-the-beast.com/v1/modpacks/public/modpack + now func() time.Time // test seam for the detail cache + + mu sync.Mutex + cache map[int]ftbCacheEntry +} + +const ( + ftbCandidateLimit = 100 // candidate ids requested from FTB per search + ftbBatchSize = 20 // details resolved per batch + ftbMaxDetails = 100 // hard cap on details resolved per search + ftbConcurrency = 4 // parallel detail requests + ftbDetailTTL = 10 * time.Minute +) + +// errFTBNotFound marks an id FTB no longer knows (HTTP 404). Search skips +// such candidates; Versions reports them. +var errFTBNotFound = errors.New("ftb: pack not found") + +type ftbCacheEntry struct { + pack *ftbPack + fetched time.Time +} + +// ftbPack is the compact, cached form of one pack detail. +type ftbPack struct { + ID int + Slug string + Name string + Synopsis string + Author string + IconURL string + Installs int64 + Versions []ftbVersion +} + +type ftbVersion struct { + ID int + Name string + Type string // release, beta, alpha, archived + Updated int64 + Game string // Minecraft version + Loader string // forge, neoforge, fabric, quilt; "" when none +} + +func newFTB(client *http.Client, userAgent string) *FTB { + return &FTB{ + client: client, + userAgent: userAgent, + baseURL: "https://api.feed-the-beast.com/v1/modpacks/public/modpack", + now: time.Now, + cache: map[int]ftbCacheEntry{}, + } +} + +// Search lists FTB packs that have a version for q.GameVersion and q.Loader +// (either may be empty: no filter). An empty term uses FTB's popular list. +// Sort and Category are not supported by FTB and are ignored; Offset applies +// to the filtered list. +func (f *FTB) Search(ctx context.Context, q SearchQuery) ([]Project, error) { + if !q.modpack() { + return nil, nil + } + ids, err := f.candidates(ctx, q.Term) + if err != nil { + return nil, err + } + if len(ids) > ftbMaxDetails { + ids = ids[:ftbMaxDetails] + } + offset := max(q.Offset, 0) + need := clampLimit(q.Limit) + offset + + var matched []Project + for start := 0; start < len(ids) && len(matched) < need; start += ftbBatchSize { + batch := ids[start:min(start+ftbBatchSize, len(ids))] + packs, err := f.resolve(ctx, batch) + if err != nil { + return nil, err + } + for _, p := range packs { + if p != nil && p.hasMatch(q.Loader, q.GameVersion) { + matched = append(matched, p.project()) + } + } + } + if offset >= len(matched) { + return []Project{}, nil + } + return matched[offset:min(need, len(matched))], nil +} + +// candidates returns the candidate pack ids for a search term, or FTB's +// popular list when the term is empty. +func (f *FTB) candidates(ctx context.Context, term string) ([]int, error) { + u := f.baseURL + "/popular/installs/" + strconv.Itoa(ftbCandidateLimit) + if term != "" { + u = f.baseURL + "/search/" + strconv.Itoa(ftbCandidateLimit) + "?" + url.Values{"term": {term}}.Encode() + } + var resp struct { + Packs []int `json:"packs"` + } + if err := f.get(ctx, u, &resp); err != nil { + return nil, fmt.Errorf("ftb search: %w", err) + } + return resp.Packs, nil +} + +// resolve fetches the details of one batch with bounded concurrency. The +// result keeps the batch order; a pack FTB no longer knows is nil. +func (f *FTB) resolve(ctx context.Context, ids []int) ([]*ftbPack, error) { + out := make([]*ftbPack, len(ids)) + g, gctx := errgroup.WithContext(ctx) + g.SetLimit(ftbConcurrency) + for i, id := range ids { + g.Go(func() error { + p, err := f.pack(gctx, id) + if errors.Is(err, errFTBNotFound) { + return nil + } + if err != nil { + return err + } + out[i] = p + return nil + }) + } + if err := g.Wait(); err != nil { + return nil, err + } + return out, nil +} + +// pack returns one pack's compact detail, served from the cache while fresh. +func (f *FTB) pack(ctx context.Context, id int) (*ftbPack, error) { + f.mu.Lock() + e, ok := f.cache[id] + fresh := ok && f.now().Sub(e.fetched) < ftbDetailTTL + f.mu.Unlock() + if fresh { + return e.pack, nil + } + + var raw struct { + ID int `json:"id"` + Slug string `json:"slug"` + Name string `json:"name"` + Synopsis string `json:"synopsis"` + Installs int64 `json:"installs"` + Authors []struct { + Name string `json:"name"` + } `json:"authors"` + Art []struct { + Type string `json:"type"` + URL string `json:"url"` + } `json:"art"` + Versions []struct { + ID int `json:"id"` + Name string `json:"name"` + Type string `json:"type"` + Updated int64 `json:"updated"` + Targets []struct { + Name string `json:"name"` + Type string `json:"type"` + Version string `json:"version"` + } `json:"targets"` + } `json:"versions"` + } + if err := f.get(ctx, f.baseURL+"/"+strconv.Itoa(id), &raw); err != nil { + return nil, fmt.Errorf("ftb pack %d: %w", id, err) + } + p := &ftbPack{ + ID: raw.ID, + Slug: raw.Slug, + Name: raw.Name, + Synopsis: raw.Synopsis, + Installs: raw.Installs, + } + if len(raw.Authors) > 0 { + p.Author = raw.Authors[0].Name + } + for _, a := range raw.Art { + if a.Type == "square" { + p.IconURL = a.URL + break + } + } + for _, v := range raw.Versions { + fv := ftbVersion{ID: v.ID, Name: v.Name, Type: v.Type, Updated: v.Updated} + for _, t := range v.Targets { + switch t.Type { + case "game": + fv.Game = t.Version + case "modloader": + fv.Loader = t.Name + } + } + p.Versions = append(p.Versions, fv) + } + + f.mu.Lock() + f.cache[id] = ftbCacheEntry{pack: p, fetched: f.now()} + f.mu.Unlock() + return p, nil +} + +// matches reports whether a version is installable for the filter: not +// archived, and (when set) on the given Minecraft version and loader. +func (v ftbVersion) matches(loader, gameVersion string) bool { + if v.Type == "archived" { + return false + } + if gameVersion != "" && v.Game != gameVersion { + return false + } + return loader == "" || strings.EqualFold(v.Loader, loader) +} + +func (p *ftbPack) hasMatch(loader, gameVersion string) bool { + for _, v := range p.Versions { + if v.matches(loader, gameVersion) { + return true + } + } + return false +} + +func (p *ftbPack) project() Project { + return Project{ + ID: strconv.Itoa(p.ID), + Slug: p.Slug, + Title: p.Name, + Description: p.Synopsis, + Author: p.Author, + IconURL: p.IconURL, + Downloads: p.Installs, + Provider: "ftb", + } +} + +// Versions lists a pack's installable versions that match the server's +// Minecraft version and loader, newest first. projectID is FTB's numeric pack +// id. Versions carry no files: the operator installs the pack by id through +// the game image. +func (f *FTB) Versions(ctx context.Context, projectID string, flt Filter) ([]Version, error) { + if !isDigits(projectID) || len(projectID) > 9 { + return nil, fmt.Errorf("ftb: invalid pack id %q", projectID) + } + id, err := strconv.Atoi(projectID) + if err != nil { + return nil, fmt.Errorf("ftb: invalid pack id %q: %w", projectID, err) + } + p, err := f.pack(ctx, id) + if err != nil { + return nil, err + } + var match []ftbVersion + for _, v := range p.Versions { + if v.matches(flt.Loader, flt.GameVersion) { + match = append(match, v) + } + } + sort.SliceStable(match, func(i, j int) bool { + if match[i].Updated != match[j].Updated { + return match[i].Updated > match[j].Updated + } + return match[i].ID > match[j].ID + }) + out := make([]Version, 0, len(match)) + for _, v := range match { + ver := Version{ + ID: strconv.Itoa(v.ID), + Name: v.Name, + VersionNumber: v.Name, + Files: []File{}, + } + switch v.Type { + case "release", "beta", "alpha": + ver.ReleaseType = v.Type + } + if v.Updated > 0 { + ver.PublishedAt = time.Unix(v.Updated, 0).UTC().Format(time.RFC3339) + } + if v.Game != "" { + ver.GameVersions = []string{v.Game} + } + if v.Loader != "" { + ver.Loaders = []string{v.Loader} + } + out = append(out, ver) + } + return out, nil +} + +// ModpackDeps is a no-op: FTB packs install through the game image's env +// (TYPE=FTBA with the pack and version ids), not by resolving dependencies. +func (f *FTB) ModpackDeps(_ context.Context, _ string) ([]File, error) { + return nil, nil +} + +// get performs a keyless FTB GET into v, mapping 404 to errFTBNotFound. +func (f *FTB) get(ctx context.Context, rawURL string, v any) error { + req, err := http.NewRequestWithContext(ctx, http.MethodGet, rawURL, nil) + if err != nil { + return fmt.Errorf("ftb request: %w", err) + } + req.Header.Set("User-Agent", f.userAgent) + req.Header.Set("Accept", "application/json") + resp, err := f.client.Do(req) + if err != nil { + return sanitizeUpstreamErr("ftb GET", err) + } + defer func() { _ = resp.Body.Close() }() + if resp.StatusCode == http.StatusNotFound { + return errFTBNotFound + } + if resp.StatusCode != http.StatusOK { + return fmt.Errorf("ftb GET: upstream status %d", resp.StatusCode) + } + if err := json.NewDecoder(io.LimitReader(resp.Body, defaultMaxRespBytes)).Decode(v); err != nil { + return fmt.Errorf("ftb decode: %w", err) + } + return nil +} diff --git a/api/internal/registry/ftb_test.go b/api/internal/registry/ftb_test.go new file mode 100644 index 000000000..9ad4babe9 --- /dev/null +++ b/api/internal/registry/ftb_test.go @@ -0,0 +1,451 @@ +package registry + +import ( + "context" + "encoding/json" + "fmt" + "net/http" + "net/http/httptest" + "os" + "reflect" + "strconv" + "strings" + "sync" + "testing" + "time" +) + +func testFTB(baseURL string) *FTB { + f := newFTB(&http.Client{Timeout: 5 * time.Second}, "gameplane-test") + f.baseURL = baseURL + return f +} + +// ftbServer fakes api.feed-the-beast.com: search/popular answer with +// `candidates` (or searchBody when set), pack details come from `packs`. +type ftbServer struct { + *httptest.Server + + candidates []int + searchBody []byte + packs func(id int) ([]byte, int) // body, status (0 means 200) + delay time.Duration + listStatus int + + mu sync.Mutex + details int + inflight int + maxInflight int + listPath string + listTerm string +} + +func newFTBServer(t *testing.T, candidates []int, packs func(id int) ([]byte, int)) *ftbServer { + t.Helper() + s := &ftbServer{candidates: candidates, packs: packs} + s.Server = httptest.NewServer(http.HandlerFunc(s.serve)) + t.Cleanup(s.Close) + return s +} + +func (s *ftbServer) serve(w http.ResponseWriter, r *http.Request) { + rest := strings.TrimPrefix(r.URL.Path, "/") + if strings.HasPrefix(rest, "search/") || strings.HasPrefix(rest, "popular/") { + s.mu.Lock() + s.listPath = r.URL.Path + s.listTerm = r.URL.Query().Get("term") + s.mu.Unlock() + if s.listStatus != 0 { + w.WriteHeader(s.listStatus) + return + } + if s.searchBody != nil { + _, _ = w.Write(s.searchBody) + return + } + out, _ := json.Marshal(map[string]any{"status": "success", "packs": s.candidates}) + _, _ = w.Write(out) + return + } + id, err := strconv.Atoi(rest) + if err != nil { + http.NotFound(w, r) + return + } + s.mu.Lock() + s.details++ + s.inflight++ + if s.inflight > s.maxInflight { + s.maxInflight = s.inflight + } + s.mu.Unlock() + defer func() { + s.mu.Lock() + s.inflight-- + s.mu.Unlock() + }() + if s.delay > 0 { + time.Sleep(s.delay) + } + body, status := s.packs(id) + if status != 0 && status != http.StatusOK { + w.WriteHeader(status) + return + } + _, _ = w.Write(body) +} + +func (s *ftbServer) detailCount() int { + s.mu.Lock() + defer s.mu.Unlock() + return s.details +} + +func ftbFixture(t *testing.T, name string) []byte { + t.Helper() + b, err := os.ReadFile("testdata/ftb/" + name) + if err != nil { + t.Fatalf("read fixture %s: %v", name, err) + } + return b +} + +// ftbFixturePacks serves the recorded pack-.json files (ids 130, 100, 4) +// and 404 for anything else. +func ftbFixturePacks() func(id int) ([]byte, int) { + return func(id int) ([]byte, int) { + b, err := os.ReadFile(fmt.Sprintf("testdata/ftb/pack-%d.json", id)) + if err != nil { + return nil, http.StatusNotFound + } + return b, 0 + } +} + +// ftbSynthPack builds a one-version pack for the batching tests. +func ftbSynthPack(id int, game, loader string) []byte { + b, _ := json.Marshal(map[string]any{ + "id": id, "name": fmt.Sprintf("Pack %d", id), "slug": fmt.Sprintf("pack-%d", id), + "synopsis": "synthetic", "installs": id, + "authors": []map[string]any{{"name": "FTB Team"}}, + "art": []map[string]any{{"type": "square", "url": "https://cdn.example/x.png"}}, + "versions": []map[string]any{{ + "id": id * 10, "name": "1.0.0", "type": "release", "updated": 1700000000 + id, + "targets": []map[string]any{ + {"name": "minecraft", "type": "game", "version": game}, + {"name": loader, "type": "modloader", "version": "1.0"}, + }, + }}, + }) + return b +} + +func ftbRange(from, to int) []int { + ids := make([]int, 0, to-from+1) + for i := from; i <= to; i++ { + ids = append(ids, i) + } + return ids +} + +func projectIDs(ps []Project) []string { + ids := make([]string, 0, len(ps)) + for _, p := range ps { + ids = append(ids, p.ID) + } + return ids +} + +func TestFTBSearchFixtures(t *testing.T) { + srv := newFTBServer(t, nil, ftbFixturePacks()) + srv.searchBody = ftbFixture(t, "search.json") + + cases := []struct { + name string + loader, gv string + wantIDs []string + }{ + {"neoforge 1.21.1", "neoforge", "1.21.1", []string{"130"}}, + {"forge 1.18.2", "forge", "1.18.2", []string{"100"}}, + {"forge 1.12.2", "forge", "1.12.2", []string{"4"}}, + {"no filter keeps FTB order", "", "", []string{"130", "100", "4"}}, + {"fabric 1.21.1 has none", "fabric", "1.21.1", []string{}}, + } + for _, tc := range cases { + t.Run(tc.name, func(t *testing.T) { + got, err := testFTB(srv.URL).Search(context.Background(), SearchQuery{ + Term: "stone", Loader: tc.loader, GameVersion: tc.gv, ProjectType: "modpack", Limit: 20, + }) + if err != nil { + t.Fatalf("Search: %v", err) + } + if ids := projectIDs(got); !reflect.DeepEqual(ids, tc.wantIDs) { + t.Errorf("ids = %v, want %v", ids, tc.wantIDs) + } + }) + } + + srv.mu.Lock() + gotPath, gotTerm := srv.listPath, srv.listTerm + srv.mu.Unlock() + if gotPath != "/search/100" || gotTerm != "stone" { + t.Errorf("search request = %q term %q, want /search/100 term stone", gotPath, gotTerm) + } + + got, err := testFTB(srv.URL).Search(context.Background(), SearchQuery{ + Term: "stone", Loader: "neoforge", GameVersion: "1.21.1", ProjectType: "modpack", + }) + if err != nil || len(got) != 1 { + t.Fatalf("Search: %v, %v", got, err) + } + p := got[0] + if p.ID != "130" || p.Slug != "ftb-stoneblock-4" || p.Title != "FTB StoneBlock 4" || + p.Author != "FTB Team" || p.Downloads != 2219810 || p.Provider != "ftb" || + p.IconURL != "https://cdn.feed-the-beast.com/blob/5b/5b10fbf6e78546a5a4be81a2d311718cc24d29e4277e747028d787d6fec0be46.webp" || + !strings.HasPrefix(p.Description, "The stone remembers.") { + t.Errorf("project = %+v", p) + } +} + +func TestFTBSearchPopularWithoutTerm(t *testing.T) { + srv := newFTBServer(t, []int{130}, ftbFixturePacks()) + got, err := testFTB(srv.URL).Search(context.Background(), SearchQuery{ProjectType: "modpack"}) + if err != nil || len(got) != 1 { + t.Fatalf("Search: %v, %v", got, err) + } + srv.mu.Lock() + defer srv.mu.Unlock() + if srv.listPath != "/popular/installs/100" || srv.listTerm != "" { + t.Errorf("request = %q term %q, want /popular/installs/100", srv.listPath, srv.listTerm) + } +} + +// A match that only appears after the first 20 candidates must still be +// found: filtering happens before the page limit, in batches of 20. +func TestFTBSearchFiltersBeforePageLimit(t *testing.T) { + srv := newFTBServer(t, ftbRange(1, 45), func(id int) ([]byte, int) { + if id == 41 { + return ftbSynthPack(id, "1.21.1", "neoforge"), 0 + } + return ftbSynthPack(id, "1.20.1", "forge"), 0 + }) + got, err := testFTB(srv.URL).Search(context.Background(), SearchQuery{ + Term: "x", Loader: "neoforge", GameVersion: "1.21.1", ProjectType: "modpack", Limit: 20, + }) + if err != nil { + t.Fatalf("Search: %v", err) + } + if ids := projectIDs(got); !reflect.DeepEqual(ids, []string{"41"}) { + t.Errorf("ids = %v, want [41]", ids) + } + if n := srv.detailCount(); n != 45 { + t.Errorf("detail calls = %d, want 45 (batches of 20, 20, 5)", n) + } +} + +// Once the filtered page is full no further batch is resolved. +func TestFTBSearchStopsWhenPageFull(t *testing.T) { + all := func(id int) ([]byte, int) { return ftbSynthPack(id, "1.21.1", "neoforge"), 0 } + q := SearchQuery{Term: "x", Loader: "neoforge", GameVersion: "1.21.1", ProjectType: "modpack", Limit: 20} + + srv := newFTBServer(t, ftbRange(1, 100), all) + got, err := testFTB(srv.URL).Search(context.Background(), q) + if err != nil { + t.Fatalf("Search: %v", err) + } + if len(got) != 20 || srv.detailCount() != 20 { + t.Errorf("len = %d details = %d, want 20 and 20", len(got), srv.detailCount()) + } + + // Offset 15 + limit 10 needs 25 matches: two batches, ids 16..25 returned. + srv2 := newFTBServer(t, ftbRange(1, 100), all) + q.Offset, q.Limit = 15, 10 + got, err = testFTB(srv2.URL).Search(context.Background(), q) + if err != nil { + t.Fatalf("Search: %v", err) + } + if len(got) != 10 || got[0].ID != "16" || srv2.detailCount() != 40 { + t.Errorf("len = %d first = %v details = %d, want 10, 16 and 40", len(got), projectIDs(got), srv2.detailCount()) + } +} + +// FTB may return more ids than asked for; never resolve more than 100. +func TestFTBSearchStopsAt100Details(t *testing.T) { + srv := newFTBServer(t, ftbRange(1, 150), func(id int) ([]byte, int) { + return ftbSynthPack(id, "1.20.1", "forge"), 0 + }) + got, err := testFTB(srv.URL).Search(context.Background(), SearchQuery{ + Term: "x", Loader: "neoforge", GameVersion: "1.21.1", ProjectType: "modpack", Limit: 20, + }) + if err != nil { + t.Fatalf("Search: %v", err) + } + if len(got) != 0 { + t.Errorf("len = %d, want 0", len(got)) + } + if n := srv.detailCount(); n != 100 { + t.Errorf("detail calls = %d, want 100", n) + } +} + +func TestFTBDetailCache(t *testing.T) { + srv := newFTBServer(t, []int{130}, ftbFixturePacks()) + f := testFTB(srv.URL) + clock := time.Date(2026, 11, 19, 12, 0, 0, 0, time.UTC) + f.now = func() time.Time { return clock } + q := SearchQuery{Term: "stone", Loader: "neoforge", GameVersion: "1.21.1", ProjectType: "modpack"} + ctx := context.Background() + + if _, err := f.Search(ctx, q); err != nil { + t.Fatalf("Search: %v", err) + } + if _, err := f.Search(ctx, q); err != nil { + t.Fatalf("Search: %v", err) + } + if _, err := f.Versions(ctx, "130", Filter{}); err != nil { + t.Fatalf("Versions: %v", err) + } + if n := srv.detailCount(); n != 1 { + t.Fatalf("detail calls = %d, want 1 (cached)", n) + } + + clock = clock.Add(9 * time.Minute) + if _, err := f.Search(ctx, q); err != nil { + t.Fatalf("Search: %v", err) + } + if n := srv.detailCount(); n != 1 { + t.Errorf("detail calls after 9m = %d, want 1", n) + } + + clock = clock.Add(2 * time.Minute) // 11 minutes since the fetch + if _, err := f.Search(ctx, q); err != nil { + t.Fatalf("Search: %v", err) + } + if n := srv.detailCount(); n != 2 { + t.Errorf("detail calls after 11m = %d, want 2 (expired)", n) + } +} + +func TestFTBSearchBoundedConcurrency(t *testing.T) { + srv := newFTBServer(t, ftbRange(1, 40), func(id int) ([]byte, int) { + return ftbSynthPack(id, "1.21.1", "neoforge"), 0 + }) + srv.delay = 15 * time.Millisecond + got, err := testFTB(srv.URL).Search(context.Background(), SearchQuery{ + Term: "x", Loader: "neoforge", GameVersion: "1.21.1", ProjectType: "modpack", Limit: 40, + }) + if err != nil { + t.Fatalf("Search: %v", err) + } + if len(got) != 40 { + t.Errorf("len = %d, want 40", len(got)) + } + srv.mu.Lock() + defer srv.mu.Unlock() + if srv.maxInflight > 4 || srv.maxInflight < 2 { + t.Errorf("max in-flight detail requests = %d, want between 2 and 4", srv.maxInflight) + } +} + +func TestFTBUpstreamErrors(t *testing.T) { + ctx := context.Background() + q := SearchQuery{Term: "x", ProjectType: "modpack"} + + t.Run("search failure", func(t *testing.T) { + srv := newFTBServer(t, nil, ftbFixturePacks()) + srv.listStatus = http.StatusInternalServerError + if _, err := testFTB(srv.URL).Search(ctx, q); err == nil { + t.Error("Search succeeded, want upstream error") + } + }) + t.Run("detail failure fails the search", func(t *testing.T) { + srv := newFTBServer(t, []int{130}, func(int) ([]byte, int) { return nil, http.StatusBadGateway }) + if _, err := testFTB(srv.URL).Search(ctx, q); err == nil { + t.Error("Search succeeded, want upstream error") + } + }) + t.Run("unknown pack is skipped", func(t *testing.T) { + srv := newFTBServer(t, []int{999, 130}, ftbFixturePacks()) + got, err := testFTB(srv.URL).Search(ctx, q) + if err != nil { + t.Fatalf("Search: %v", err) + } + if ids := projectIDs(got); !reflect.DeepEqual(ids, []string{"130"}) { + t.Errorf("ids = %v, want [130]", ids) + } + }) + t.Run("versions of unknown pack", func(t *testing.T) { + srv := newFTBServer(t, nil, ftbFixturePacks()) + if _, err := testFTB(srv.URL).Versions(ctx, "999", Filter{}); err == nil { + t.Error("Versions succeeded, want error") + } + }) + t.Run("invalid pack id", func(t *testing.T) { + srv := newFTBServer(t, nil, ftbFixturePacks()) + if _, err := testFTB(srv.URL).Versions(ctx, "../130", Filter{}); err == nil { + t.Error("Versions succeeded, want error") + } + if n := srv.detailCount(); n != 0 { + t.Errorf("detail calls = %d, want 0", n) + } + }) +} + +func TestFTBModsSearchReturnsNothing(t *testing.T) { + got, err := testFTB("http://unused").Search(context.Background(), SearchQuery{Term: "x"}) + if err != nil || got != nil { + t.Errorf("mod search = %v, %v, want nil, nil", got, err) + } +} + +func TestFTBVersions(t *testing.T) { + srv := newFTBServer(t, nil, ftbFixturePacks()) + ctx := context.Background() + + got, err := testFTB(srv.URL).Versions(ctx, "130", Filter{Loader: "neoforge", GameVersion: "1.21.1", ProjectType: "modpack"}) + if err != nil { + t.Fatalf("Versions: %v", err) + } + // 56 versions in the fixture, 5 archived. + if len(got) != 51 { + t.Fatalf("len = %d, want 51", len(got)) + } + if got[0].ID != "100574" || got[0].Name != "1.24.1" || got[len(got)-1].ID != "100140" { + t.Errorf("order: first %+v last %+v, want newest 100574 first and 100140 last", got[0], got[len(got)-1]) + } + for _, v := range got { + if v.ID == "100142" { + t.Error("archived version 100142 listed") + } + } + if !reflect.DeepEqual(got[0].GameVersions, []string{"1.21.1"}) || !reflect.DeepEqual(got[0].Loaders, []string{"neoforge"}) || + got[0].Files == nil || len(got[0].Files) != 0 { + t.Errorf("fields = %+v", got[0]) + } + + // Wrong loader or game version: nothing, as an empty (non-nil) list. + none, err := testFTB(srv.URL).Versions(ctx, "130", Filter{Loader: "forge", GameVersion: "1.21.1"}) + if err != nil || none == nil || len(none) != 0 { + t.Errorf("forge 1.21.1 = %v, %v, want empty non-nil", none, err) + } + + // Pack 100: 20 release + 6 beta + 1 alpha on Forge 1.18.2, 1 archived. + st3, err := testFTB(srv.URL).Versions(ctx, "100", Filter{Loader: "forge", GameVersion: "1.18.2"}) + if err != nil || len(st3) != 27 { + t.Errorf("pack 100 forge 1.18.2 = %d versions, %v, want 27", len(st3), err) + } +} + +func TestSetForFTB(t *testing.T) { + s := NewSet("test", StaticKeys(map[string]string{})) + p, ok := s.For(context.Background(), Config{Provider: "ftb"}) + if !ok { + t.Fatal("ftb should be selectable without a key") + } + if _, isFTB := p.(*FTB); !isFTB { + t.Errorf("provider = %T, want *FTB", p) + } + if !s.Available(context.Background(), "ftb") { + t.Error("ftb should be available without a key") + } +} diff --git a/api/internal/registry/ftb_version_meta_test.go b/api/internal/registry/ftb_version_meta_test.go new file mode 100644 index 000000000..419da1189 --- /dev/null +++ b/api/internal/registry/ftb_version_meta_test.go @@ -0,0 +1,29 @@ +package registry + +import ( + "context" + "testing" +) + +func TestFTBVersionsCarryReleaseTypeAndPublishedAt(t *testing.T) { + pack := []byte(`{"id":130,"name":"meta","versions":[ + {"id":1,"name":"1.0","type":"release","updated":1700000001,"targets":[{"name":"neoforge","type":"modloader","version":"21.1"},{"name":"1.21.1","type":"game","version":"1.21.1"}]}, + {"id":2,"name":"0.9","type":"beta","updated":0,"targets":[{"name":"neoforge","type":"modloader","version":"21.1"},{"name":"1.21.1","type":"game","version":"1.21.1"}]}, + {"id":3,"name":"old","type":"archived","updated":1700000003,"targets":[{"name":"neoforge","type":"modloader","version":"21.1"},{"name":"1.21.1","type":"game","version":"1.21.1"}]} + ]}`) + srv := newFTBServer(t, nil, func(int) ([]byte, int) { return pack, 0 }) + + got, err := testFTB(srv.URL).Versions(context.Background(), "130", Filter{Loader: "neoforge", GameVersion: "1.21.1", ProjectType: "modpack"}) + if err != nil { + t.Fatalf("Versions: %v", err) + } + if len(got) != 2 { + t.Fatalf("len = %d, want 2 (archived dropped)", len(got)) + } + if got[0].ID != "1" || got[0].ReleaseType != "release" || got[0].PublishedAt != "2023-11-14T22:13:21Z" { + t.Errorf("release version = %+v", got[0]) + } + if got[1].ID != "2" || got[1].ReleaseType != "beta" || got[1].PublishedAt != "" { + t.Errorf("beta version without updated = %+v", got[1]) + } +} diff --git a/api/internal/registry/modrinth.go b/api/internal/registry/modrinth.go index 72f9dc61e..e87592e6b 100644 --- a/api/internal/registry/modrinth.go +++ b/api/internal/registry/modrinth.go @@ -128,6 +128,7 @@ func (m *Modrinth) Versions(ctx context.Context, projectID string, f Filter) ([] GameVersions []string `json:"game_versions"` Loaders []string `json:"loaders"` DatePublished string `json:"date_published"` + VersionType string `json:"version_type"` Files []struct { URL string `json:"url"` Filename string `json:"filename"` @@ -159,6 +160,8 @@ func (m *Modrinth) Versions(ctx context.Context, projectID string, f Filter) ([] VersionNumber: v.VersionNumber, GameVersions: v.GameVersions, Loaders: v.Loaders, + ReleaseType: v.VersionType, + PublishedAt: v.DatePublished, Files: files, }) } diff --git a/api/internal/registry/modrinth_version_meta_test.go b/api/internal/registry/modrinth_version_meta_test.go new file mode 100644 index 000000000..3f0baac9c --- /dev/null +++ b/api/internal/registry/modrinth_version_meta_test.go @@ -0,0 +1,31 @@ +package registry + +import ( + "context" + "net/http" + "net/http/httptest" + "testing" +) + +func TestModrinthVersionsCarryReleaseTypeAndPublishedAt(t *testing.T) { + srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, _ *http.Request) { + _, _ = w.Write([]byte(`[ + {"id":"b1","name":"v2","version_number":"2.0","game_versions":["1.21.4"],"loaders":["fabric"],"version_type":"beta","date_published":"2025-06-01T00:00:00Z","files":[]} + ]`)) + })) + defer srv.Close() + + got, err := testModrinth(srv.URL).Versions(context.Background(), "sodium", Filter{}) + if err != nil { + t.Fatalf("Versions: %v", err) + } + if len(got) != 1 { + t.Fatalf("len = %d, want 1", len(got)) + } + if got[0].ReleaseType != "beta" { + t.Errorf("ReleaseType = %q, want beta", got[0].ReleaseType) + } + if got[0].PublishedAt != "2025-06-01T00:00:00Z" { + t.Errorf("PublishedAt = %q, want 2025-06-01T00:00:00Z", got[0].PublishedAt) + } +} diff --git a/api/internal/registry/registry.go b/api/internal/registry/registry.go index 41b70d2fd..87e9c67ac 100644 --- a/api/internal/registry/registry.go +++ b/api/internal/registry/registry.go @@ -1,7 +1,7 @@ // Package registry implements read-only browse/search of external game-mod // registries (Modrinth, Thunderstore, CurseForge, Hangar, the Factorio mod // portal, the Steam Workshop, Nexus Mods, SpigotMC via Spiget, GitHub -// Releases, uMod) for the dashboard's mod manager. +// Releases, uMod, FTB modpacks) for the dashboard's mod manager. // // The engines here are generic: a GameTemplate's capabilities.mods.registry // block picks a provider and supplies its parameters, and the handler in @@ -11,7 +11,8 @@ // agent install path, which re-checks the host allowlist and SSRF guard. // Search itself only ever GETs fixed provider hostnames // (api.modrinth.com, thunderstore.io, api.steampowered.com, -// api.nexusmods.com, api.spiget.org, api.github.com, umod.org). Every +// api.nexusmods.com, api.spiget.org, api.github.com, umod.org, +// api.feed-the-beast.com). Every // engine shares one HTTP client that dials through netguard.IsPublic, so a // fetch, redirects included, only ever connects to a globally routable // address and never goes through a proxy from the pod environment. @@ -76,7 +77,12 @@ type Version struct { VersionNumber string `json:"versionNumber,omitempty"` GameVersions []string `json:"gameVersions,omitempty"` Loaders []string `json:"loaders,omitempty"` - Files []File `json:"files"` + // ReleaseType is "release", "beta" or "alpha"; empty when the provider + // does not say. + ReleaseType string `json:"releaseType,omitempty"` + // PublishedAt is RFC 3339 UTC; empty when unknown. + PublishedAt string `json:"publishedAt,omitempty"` + Files []File `json:"files"` } // SearchQuery is a normalized search request. Loader and GameVersion are @@ -105,11 +111,17 @@ type SearchQuery struct { func (q SearchQuery) modpack() bool { return q.ProjectType == "modpack" } // Filter narrows a Versions lookup to the active loader + game version. +// ProjectType is "modpack" when the caller lists pack versions (the +// handler forwards ?type=modpack); empty (or "mod") lists mod versions. type Filter struct { Loader string GameVersion string + ProjectType string } +// modpack reports whether this lookup targets modpack versions. +func (f Filter) modpack() bool { return f.ProjectType == "modpack" } + // KeyFunc returns the API key for a provider, or "" if unconfigured. type KeyFunc func(ctx context.Context, provider string) string @@ -177,7 +189,7 @@ type builtEntry struct { } // Set holds the constructed engines, sharing one HTTP client. Keyless engines -// (modrinth, thunderstore, hangar, factorio, spigot, github, umod) are built +// (modrinth, thunderstore, hangar, factorio, spigot, github, umod, ftb) are built // once and reused; the Thunderstore engine caches its community package // lists internally. Keyed engines (curseforge, steam, nexus) are built // lazily behind a TTL + key-hash cache so a key can be changed at runtime @@ -192,6 +204,7 @@ type Set struct { spigot *Spigot github *GitHub umod *Umod + ftb *FTB // keyed engine cache, one entry per provider name mu sync.Mutex @@ -224,6 +237,7 @@ func NewSet(version string, keyFunc KeyFunc) *Set { spigot: newSpigot(client, ua), github: newGitHub(client, ua), umod: newUmod(client, ua), + ftb: newFTB(client, ua), keyFunc: keyFunc, client: client, ua: ua, @@ -269,6 +283,8 @@ func (s *Set) For(ctx context.Context, cfg Config) (Provider, bool) { return &githubRepo{gh: s.github, owner: cfg.GitHubOwner, repo: cfg.GitHubRepo}, true case "umod": return s.umod, true + case "ftb": + return s.ftb, true case "steam": if cfg.SteamAppID <= 0 { return nil, false @@ -299,7 +315,7 @@ func (s *Set) For(ctx context.Context, cfg Config) (Provider, bool) { // (SteamAppID/CurseForgeGameID/Community), which For validates. func (s *Set) Available(ctx context.Context, provider string) bool { switch provider { - case "modrinth", "thunderstore", "hangar", "factorio", "spigot", "github", "umod": + case "modrinth", "thunderstore", "hangar", "factorio", "spigot", "github", "umod", "ftb": return true case "curseforge": cf, err := s.curseforgeLazy(ctx) diff --git a/api/internal/registry/registry_ftb_dialguard_test.go b/api/internal/registry/registry_ftb_dialguard_test.go new file mode 100644 index 000000000..98d9fe513 --- /dev/null +++ b/api/internal/registry/registry_ftb_dialguard_test.go @@ -0,0 +1,43 @@ +package registry + +import ( + "context" + "errors" + "net/http" + "net/http/httptest" + "testing" + + "github.com/GameplanePanel/gameplane/netguard" +) + +// TestSet_FTBFetchesDialOnlyPublicAddresses checks that the FTB engine built +// by NewSet uses the Set's netguard.IsPublic client: a link-local address, +// and a loopback listener that is really up, are refused at dial time for +// both the search and the pack-detail paths. +func TestSet_FTBFetchesDialOnlyPublicAddresses(t *testing.T) { + ctx := context.Background() + srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, _ *http.Request) { + w.Header().Set("Content-Type", "application/json") + _, _ = w.Write([]byte(`{"status":"success","packs":[]}`)) + })) + defer srv.Close() + + for name, base := range map[string]string{ + "link-local": "http://169.254.169.254/v1/modpacks/public/modpack", + "loopback": srv.URL, + } { + s := NewSet("test", StaticKeys(map[string]string{})) + if s.ftb.client != s.client { + t.Fatalf("%s: ftb engine does not share the Set's guarded client", name) + } + s.ftb.baseURL = base + _, err := s.ftb.Search(ctx, SearchQuery{Term: "x", ProjectType: "modpack"}) + if !errors.Is(err, netguard.ErrBlockedAddr) { + t.Errorf("%s search: err = %v, want netguard.ErrBlockedAddr", name, err) + } + _, err = s.ftb.Versions(ctx, "130", Filter{}) + if !errors.Is(err, netguard.ErrBlockedAddr) { + t.Errorf("%s versions: err = %v, want netguard.ErrBlockedAddr", name, err) + } + } +} diff --git a/api/internal/registry/testdata/curseforge/README.md b/api/internal/registry/testdata/curseforge/README.md new file mode 100644 index 000000000..e19e39094 --- /dev/null +++ b/api/internal/registry/testdata/curseforge/README.md @@ -0,0 +1,3 @@ +# CurseForge test fixtures + +`modpack-files.json` is HAND-MADE, not a recorded response: no CurseForge API key was available when the spec 035 fixtures were written. It follows the shape the API's engine decodes for `GET /v1/mods/{modId}/files` (`{"data": [cfFile...]}`, see `cfFile` in `api/internal/registry/curseforge.go`: `id`, `displayName`, `fileName`, `downloadUrl`, `fileLength`, `gameVersions`), plus the other fields the real API returns (`modId`, `releaseType`, `fileDate`, `pagination`) which the decoder ignores. The pack is a made-up class 4471 (Modpacks) project with files that mix Minecraft versions and loaders in `gameVersions` (NeoForge/Forge/Fabric, in different orders, plus `Client` and `Java 8`) and one file with `"downloadUrl": null` (distribution disabled). Replace it with a real recorded response when a key is available (`curl -H "x-api-key: $KEY" "https://api.curseforge.com/v1/mods//files?pageSize=50"`). diff --git a/api/internal/registry/testdata/curseforge/modpack-files.json b/api/internal/registry/testdata/curseforge/modpack-files.json new file mode 100644 index 000000000..5cfd8f460 --- /dev/null +++ b/api/internal/registry/testdata/curseforge/modpack-files.json @@ -0,0 +1,95 @@ +{ + "data": [ + { + "id": 6512345, + "gameId": 432, + "modId": 925200, + "isAvailable": true, + "displayName": "All the Mods 10-2.41", + "fileName": "All the Mods 10-2.41.zip", + "releaseType": 1, + "fileStatus": 4, + "downloadUrl": "https://edge.forgecdn.net/files/6512/345/All+the+Mods+10-2.41.zip", + "fileLength": 184549376, + "downloadCount": 120345, + "gameVersions": ["1.21.1", "NeoForge"], + "fileDate": "2026-10-28T14:03:11.52Z" + }, + { + "id": 6498001, + "gameId": 432, + "modId": 925200, + "isAvailable": true, + "displayName": "All the Mods 10-2.40", + "fileName": "All the Mods 10-2.40.zip", + "releaseType": 1, + "fileStatus": 4, + "downloadUrl": "https://edge.forgecdn.net/files/6498/001/All+the+Mods+10-2.40.zip", + "fileLength": 184102912, + "downloadCount": 98011, + "gameVersions": ["NeoForge", "1.21.1"], + "fileDate": "2026-10-14T09:41:02.07Z" + }, + { + "id": 6480777, + "gameId": 432, + "modId": 925200, + "isAvailable": true, + "displayName": "All the Mods 10-2.39-beta", + "fileName": "All the Mods 10-2.39-beta.zip", + "releaseType": 2, + "fileStatus": 4, + "downloadUrl": null, + "fileLength": 183900160, + "downloadCount": 4410, + "gameVersions": ["1.21.1", "NeoForge"], + "fileDate": "2026-09-30T18:22:45.9Z" + }, + { + "id": 5900123, + "gameId": 432, + "modId": 925200, + "isAvailable": true, + "displayName": "All the Mods 10-2.12", + "fileName": "All the Mods 10-2.12.zip", + "releaseType": 1, + "fileStatus": 4, + "downloadUrl": "https://edge.forgecdn.net/files/5900/123/All+the+Mods+10-2.12.zip", + "fileLength": 170393600, + "downloadCount": 60234, + "gameVersions": ["1.20.1", "Forge"], + "fileDate": "2026-03-02T11:10:00.0Z" + }, + { + "id": 5712004, + "gameId": 432, + "modId": 925200, + "isAvailable": true, + "displayName": "All the Mods 10-2.05 (Fabric)", + "fileName": "All the Mods 10-2.05-fabric.zip", + "releaseType": 1, + "fileStatus": 4, + "downloadUrl": "https://edge.forgecdn.net/files/5712/004/All+the+Mods+10-2.05-fabric.zip", + "fileLength": 150994944, + "downloadCount": 21876, + "gameVersions": ["Fabric", "1.20.1", "Client"], + "fileDate": "2026-01-19T07:55:31.3Z" + }, + { + "id": 4321987, + "gameId": 432, + "modId": 925200, + "isAvailable": true, + "displayName": "All the Mods 10-1.9 (1.16.5)", + "fileName": "All the Mods 10-1.9.zip", + "releaseType": 1, + "fileStatus": 4, + "downloadUrl": "https://edge.forgecdn.net/files/4321/987/All+the+Mods+10-1.9.zip", + "fileLength": 120586240, + "downloadCount": 15002, + "gameVersions": ["1.16.5", "Forge", "Java 8"], + "fileDate": "2024-04-12T20:00:00.0Z" + } + ], + "pagination": {"index": 0, "pageSize": 50, "resultCount": 6, "totalCount": 6} +} diff --git a/api/internal/registry/testdata/ftb/README.md b/api/internal/registry/testdata/ftb/README.md new file mode 100644 index 000000000..10a9d8109 --- /dev/null +++ b/api/internal/registry/testdata/ftb/README.md @@ -0,0 +1,4 @@ +# FTB test fixtures + +Recorded from the public FTB API (no key) on 2026-11-19 with the commands in the spec 035 T002 brief: +`search.json` (search term "stone"), `pack-.json` (pack detail, `description` removed), `version--.json` (version detail; `files` trimmed to the first 3 entries and `changelog` removed). Fields are otherwise untouched. Ids: 130 FTB StoneBlock 4 (NeoForge 1.21.1), 100 FTB StoneBlock 3 (Forge 1.18.2), 4 FTB Presents Stoneblock 2 (Forge 1.12.2). diff --git a/api/internal/registry/testdata/ftb/pack-100.json b/api/internal/registry/testdata/ftb/pack-100.json new file mode 100644 index 000000000..dce82726a --- /dev/null +++ b/api/internal/registry/testdata/ftb/pack-100.json @@ -0,0 +1,1130 @@ +{ + "art": [ + { + "compressed": false, + "height": 512, + "id": -1, + "mirrors": [], + "order": 0, + "sha1": "08e2b62329bbf778eabcf5ca8f0d7b6b61a82b34", + "title": "Logo", + "type": "square", + "updated": 0, + "url": "https://cdn.feed-the-beast.com/blob/27/277ea696db174dabd3cdc1ba9f6120218c8f9c6aea916855140f6be41adf821a.png", + "width": 512 + }, + { + "compressed": false, + "height": 1080, + "id": -1, + "mirrors": [], + "order": 1, + "sha1": "ac058b5f8638fed132b3893abebe2cac18d13bbb", + "title": "Background", + "type": "splash", + "updated": 0, + "url": "https://cdn.feed-the-beast.com/blob/8b/8be71c3fda1c8e071dae644a023025940f2ef1b8f80aa8c153b46602748eccd6.png", + "width": 1920 + } + ], + "authors": [ + { + "id": -1, + "name": "FTB Team", + "type": "team", + "updated": 0, + "website": "https://www.feed-the-beast.com/" + } + ], + "featured": false, + "id": 100, + "installs": 2525282, + "links": [ + { + "id": -1, + "link": "https://docs.feed-the-beast.com", + "name": "Wiki", + "type": "misc" + }, + { + "id": -1, + "link": "https://github.com/ftbteam/ftb-modpack-issues/issues", + "name": "Issue Tracker", + "type": "misc" + } + ], + "meta": { + "curseforgeProjectId": 1091305, + "isLegacy": true, + "supportsWorlds": true + }, + "name": "FTB StoneBlock 3", + "notification": "", + "plays": 14479333, + "plays_14d": 7432014, + "private": false, + "provider": "modpacks.ch", + "rating": { + "age": 7, + "alcoholdrugs": false, + "configured": false, + "frightening": true, + "gambling": false, + "id": -1, + "language": false, + "nuditysexual": false, + "sterotypeshate": false, + "verified": false, + "violence": true + }, + "released": 1667330107, + "slug": "ftb-stoneblock-3", + "status": "success", + "synopsis": "In a world surrounded by stone, build yourself a subterranean kingdom that really rocks! Use magic and technology to forge your realm to your designs.", + "tags": [ + { + "id": 9, + "name": "FTB" + }, + { + "id": 12, + "name": "Magic" + }, + { + "id": 13, + "name": "Tech" + }, + { + "id": 14, + "name": "Questing" + }, + { + "id": 23, + "name": "Exploration" + }, + { + "id": 45, + "name": "1.18.2" + }, + { + "id": 22, + "name": "Large" + }, + { + "id": 102, + "name": "Kitchen Sink" + } + ], + "type": "release", + "updated": 1667243244, + "versions": [ + { + "id": 2275, + "name": "1.0.0", + "private": false, + "released": 1667330107, + "specs": { + "id": -1, + "minimum": 4096, + "recommended": 6144 + }, + "targets": [ + { + "id": -1, + "name": "minecraft", + "type": "game", + "updated": 0, + "version": "1.18.2" + }, + { + "id": -1, + "name": "forge", + "type": "modloader", + "updated": 0, + "version": "40.1.84" + }, + { + "id": -1, + "name": "java", + "type": "runtime", + "updated": 0, + "version": "17.0.2+8" + } + ], + "type": "beta", + "updated": 1667330107 + }, + { + "id": 2276, + "name": "1.0.1", + "private": false, + "released": 1667420169, + "specs": { + "id": -1, + "minimum": 4096, + "recommended": 6144 + }, + "targets": [ + { + "id": -1, + "name": "minecraft", + "type": "game", + "updated": 0, + "version": "1.18.2" + }, + { + "id": -1, + "name": "forge", + "type": "modloader", + "updated": 0, + "version": "40.1.84" + }, + { + "id": -1, + "name": "java", + "type": "runtime", + "updated": 0, + "version": "17.0.2+8" + } + ], + "type": "release", + "updated": 1667420169 + }, + { + "id": 2277, + "name": "1.0.2", + "private": false, + "released": 1667501951, + "specs": { + "id": -1, + "minimum": 4096, + "recommended": 6144 + }, + "targets": [ + { + "id": -1, + "name": "minecraft", + "type": "game", + "updated": 0, + "version": "1.18.2" + }, + { + "id": -1, + "name": "forge", + "type": "modloader", + "updated": 0, + "version": "40.1.84" + }, + { + "id": -1, + "name": "java", + "type": "runtime", + "updated": 0, + "version": "17.0.2+8" + } + ], + "type": "release", + "updated": 1667501951 + }, + { + "id": 2280, + "name": "1.1.0", + "private": false, + "released": 1667759149, + "specs": { + "id": -1, + "minimum": 4096, + "recommended": 6144 + }, + "targets": [ + { + "id": -1, + "name": "minecraft", + "type": "game", + "updated": 0, + "version": "1.18.2" + }, + { + "id": -1, + "name": "forge", + "type": "modloader", + "updated": 0, + "version": "40.1.84" + }, + { + "id": -1, + "name": "java", + "type": "runtime", + "updated": 0, + "version": "17.0.2+8" + } + ], + "type": "beta", + "updated": 1667759149 + }, + { + "id": 2282, + "name": "1.1.1", + "private": false, + "released": 1667903164, + "specs": { + "id": -1, + "minimum": 4096, + "recommended": 6144 + }, + "targets": [ + { + "id": -1, + "name": "minecraft", + "type": "game", + "updated": 0, + "version": "1.18.2" + }, + { + "id": -1, + "name": "forge", + "type": "modloader", + "updated": 0, + "version": "40.1.84" + }, + { + "id": -1, + "name": "java", + "type": "runtime", + "updated": 0, + "version": "17.0.2+8" + } + ], + "type": "release", + "updated": 1667903164 + }, + { + "id": 2283, + "name": "1.2.0", + "private": false, + "released": 1667938978, + "specs": { + "id": -1, + "minimum": 4096, + "recommended": 6144 + }, + "targets": [ + { + "id": -1, + "name": "minecraft", + "type": "game", + "updated": 0, + "version": "1.18.2" + }, + { + "id": -1, + "name": "forge", + "type": "modloader", + "updated": 0, + "version": "40.1.84" + }, + { + "id": -1, + "name": "java", + "type": "runtime", + "updated": 0, + "version": "17.0.2+8" + } + ], + "type": "release", + "updated": 1667938978 + }, + { + "id": 2287, + "name": "1.2.1", + "private": false, + "released": 1668119916, + "specs": { + "id": -1, + "minimum": 4096, + "recommended": 6144 + }, + "targets": [ + { + "id": -1, + "name": "minecraft", + "type": "game", + "updated": 0, + "version": "1.18.2" + }, + { + "id": -1, + "name": "forge", + "type": "modloader", + "updated": 0, + "version": "40.1.84" + }, + { + "id": -1, + "name": "java", + "type": "runtime", + "updated": 0, + "version": "17.0.2+8" + } + ], + "type": "beta", + "updated": 1668119916 + }, + { + "id": 2288, + "name": "1.3.0", + "private": false, + "released": 1668453107, + "specs": { + "id": -1, + "minimum": 4096, + "recommended": 6144 + }, + "targets": [ + { + "id": -1, + "name": "minecraft", + "type": "game", + "updated": 0, + "version": "1.18.2" + }, + { + "id": -1, + "name": "forge", + "type": "modloader", + "updated": 0, + "version": "40.1.84" + }, + { + "id": -1, + "name": "java", + "type": "runtime", + "updated": 0, + "version": "17.0.2+8" + } + ], + "type": "release", + "updated": 1668453107 + }, + { + "id": 2293, + "name": "1.4.0", + "private": false, + "released": 1669321533, + "specs": { + "id": -1, + "minimum": 4096, + "recommended": 6144 + }, + "targets": [ + { + "id": -1, + "name": "minecraft", + "type": "game", + "updated": 0, + "version": "1.18.2" + }, + { + "id": -1, + "name": "forge", + "type": "modloader", + "updated": 0, + "version": "40.1.84" + }, + { + "id": -1, + "name": "java", + "type": "runtime", + "updated": 0, + "version": "17.0.2+8" + } + ], + "type": "archived", + "updated": 1669321533 + }, + { + "id": 2294, + "name": "1.4.1", + "private": false, + "released": 1669322832, + "specs": { + "id": -1, + "minimum": 4096, + "recommended": 6144 + }, + "targets": [ + { + "id": -1, + "name": "minecraft", + "type": "game", + "updated": 0, + "version": "1.18.2" + }, + { + "id": -1, + "name": "forge", + "type": "modloader", + "updated": 0, + "version": "40.1.84" + }, + { + "id": -1, + "name": "java", + "type": "runtime", + "updated": 0, + "version": "17.0.2+8" + } + ], + "type": "beta", + "updated": 1669322832 + }, + { + "id": 2295, + "name": "1.4.2", + "private": false, + "released": 1669404952, + "specs": { + "id": -1, + "minimum": 4096, + "recommended": 6144 + }, + "targets": [ + { + "id": -1, + "name": "minecraft", + "type": "game", + "updated": 0, + "version": "1.18.2" + }, + { + "id": -1, + "name": "forge", + "type": "modloader", + "updated": 0, + "version": "40.1.84" + }, + { + "id": -1, + "name": "java", + "type": "runtime", + "updated": 0, + "version": "17.0.2+8" + } + ], + "type": "beta", + "updated": 1669404952 + }, + { + "id": 2298, + "name": "1.4.3", + "private": false, + "released": 1670588480, + "specs": { + "id": -1, + "minimum": 4096, + "recommended": 6144 + }, + "targets": [ + { + "id": -1, + "name": "minecraft", + "type": "game", + "updated": 0, + "version": "1.18.2" + }, + { + "id": -1, + "name": "forge", + "type": "modloader", + "updated": 0, + "version": "40.1.84" + }, + { + "id": -1, + "name": "java", + "type": "runtime", + "updated": 0, + "version": "17.0.2+8" + } + ], + "type": "release", + "updated": 1670588480 + }, + { + "id": 2308, + "name": "1.5.0", + "private": false, + "released": 1671881071, + "specs": { + "id": -1, + "minimum": 4096, + "recommended": 6144 + }, + "targets": [ + { + "id": -1, + "name": "minecraft", + "type": "game", + "updated": 0, + "version": "1.18.2" + }, + { + "id": -1, + "name": "forge", + "type": "modloader", + "updated": 0, + "version": "40.1.92" + }, + { + "id": -1, + "name": "java", + "type": "runtime", + "updated": 0, + "version": "17.0.2+8" + } + ], + "type": "release", + "updated": 1671881071 + }, + { + "id": 2327, + "name": "1.6.0", + "private": false, + "released": 1675453657, + "specs": { + "id": -1, + "minimum": 4096, + "recommended": 6144 + }, + "targets": [ + { + "id": -1, + "name": "minecraft", + "type": "game", + "updated": 0, + "version": "1.18.2" + }, + { + "id": -1, + "name": "forge", + "type": "modloader", + "updated": 0, + "version": "40.2.1" + }, + { + "id": -1, + "name": "java", + "type": "runtime", + "updated": 0, + "version": "17.0.2+8" + } + ], + "type": "alpha", + "updated": 1675453657 + }, + { + "id": 2328, + "name": "1.6.1", + "private": false, + "released": 1675523714, + "specs": { + "id": -1, + "minimum": 4096, + "recommended": 6144 + }, + "targets": [ + { + "id": -1, + "name": "minecraft", + "type": "game", + "updated": 0, + "version": "1.18.2" + }, + { + "id": -1, + "name": "forge", + "type": "modloader", + "updated": 0, + "version": "40.2.1" + }, + { + "id": -1, + "name": "java", + "type": "runtime", + "updated": 0, + "version": "17.0.2+8" + } + ], + "type": "release", + "updated": 1675523714 + }, + { + "id": 6479, + "name": "1.7.0", + "private": false, + "released": 1683967859, + "specs": { + "id": -1, + "minimum": 4096, + "recommended": 6144 + }, + "targets": [ + { + "id": -1, + "name": "minecraft", + "type": "game", + "updated": 0, + "version": "1.18.2" + }, + { + "id": -1, + "name": "forge", + "type": "modloader", + "updated": 0, + "version": "40.2.1" + }, + { + "id": -1, + "name": "java", + "type": "runtime", + "updated": 0, + "version": "17.0.2+8" + } + ], + "type": "beta", + "updated": 1683967859 + }, + { + "id": 6498, + "name": "1.7.1", + "private": false, + "released": 1685996761, + "specs": { + "id": -1, + "minimum": 4096, + "recommended": 6144 + }, + "targets": [ + { + "id": -1, + "name": "minecraft", + "type": "game", + "updated": 0, + "version": "1.18.2" + }, + { + "id": -1, + "name": "forge", + "type": "modloader", + "updated": 0, + "version": "40.2.1" + }, + { + "id": -1, + "name": "java", + "type": "runtime", + "updated": 0, + "version": "17.0.2+8" + } + ], + "type": "release", + "updated": 1685996761 + }, + { + "id": 6647, + "name": "1.8.0", + "private": false, + "released": 1691672431, + "specs": { + "id": -1, + "minimum": 4096, + "recommended": 6144 + }, + "targets": [ + { + "id": -1, + "name": "minecraft", + "type": "game", + "updated": 0, + "version": "1.18.2" + }, + { + "id": -1, + "name": "forge", + "type": "modloader", + "updated": 0, + "version": "40.2.10" + }, + { + "id": -1, + "name": "java", + "type": "runtime", + "updated": 0, + "version": "17.0.2+8" + } + ], + "type": "release", + "updated": 1691672431 + }, + { + "id": 6967, + "name": "1.8.1", + "private": false, + "released": 1698747472, + "specs": { + "id": -1, + "minimum": 4096, + "recommended": 6144 + }, + "targets": [ + { + "id": -1, + "name": "minecraft", + "type": "game", + "updated": 0, + "version": "1.18.2" + }, + { + "id": -1, + "name": "forge", + "type": "modloader", + "updated": 0, + "version": "40.2.9" + }, + { + "id": -1, + "name": "java", + "type": "runtime", + "updated": 0, + "version": "17.0.2+8" + } + ], + "type": "release", + "updated": 1698747472 + }, + { + "id": 11655, + "name": "1.9.0", + "private": false, + "released": 1706997565, + "specs": { + "id": -1, + "minimum": 4096, + "recommended": 6144 + }, + "targets": [ + { + "id": -1, + "name": "minecraft", + "type": "game", + "updated": 0, + "version": "1.18.2" + }, + { + "id": -1, + "name": "forge", + "type": "modloader", + "updated": 0, + "version": "40.2.14" + }, + { + "id": -1, + "name": "java", + "type": "runtime", + "updated": 0, + "version": "17.0.2+8" + } + ], + "type": "release", + "updated": 1706997565 + }, + { + "id": 12145, + "name": "1.10.0", + "private": false, + "released": 1718983764, + "specs": { + "id": -1, + "minimum": 4096, + "recommended": 6144 + }, + "targets": [ + { + "id": -1, + "name": "minecraft", + "type": "game", + "updated": 0, + "version": "1.18.2" + }, + { + "id": -1, + "name": "forge", + "type": "modloader", + "updated": 0, + "version": "40.2.14" + }, + { + "id": -1, + "name": "java", + "type": "runtime", + "updated": 0, + "version": "17.0.2+8" + } + ], + "type": "release", + "updated": 1718983764 + }, + { + "id": 12492, + "name": "1.11.0", + "private": false, + "released": 1726692434, + "specs": { + "id": -1, + "minimum": 4096, + "recommended": 6144 + }, + "targets": [ + { + "id": -1, + "name": "minecraft", + "type": "game", + "updated": 0, + "version": "1.18.2" + }, + { + "id": -1, + "name": "forge", + "type": "modloader", + "updated": 0, + "version": "40.2.14" + }, + { + "id": -1, + "name": "java", + "type": "runtime", + "updated": 0, + "version": "17.0.2+8" + } + ], + "type": "release", + "updated": 1726692434 + }, + { + "id": 12632, + "name": "1.11.1", + "private": false, + "released": 1731616290, + "specs": { + "id": -1, + "minimum": 4096, + "recommended": 6144 + }, + "targets": [ + { + "id": -1, + "name": "minecraft", + "type": "game", + "updated": 0, + "version": "1.18.2" + }, + { + "id": -1, + "name": "forge", + "type": "modloader", + "updated": 0, + "version": "40.2.14" + }, + { + "id": -1, + "name": "java", + "type": "runtime", + "updated": 0, + "version": "17.0.2+8" + } + ], + "type": "release", + "updated": 1731616290 + }, + { + "id": 100013, + "name": "1.11.2", + "private": false, + "released": 1734729268, + "specs": { + "id": -1, + "minimum": 4096, + "recommended": 6144 + }, + "targets": [ + { + "id": -1, + "name": "minecraft", + "type": "game", + "updated": 0, + "version": "1.18.2" + }, + { + "id": -1, + "name": "forge", + "type": "modloader", + "updated": 0, + "version": "40.2.14" + }, + { + "id": -1, + "name": "java", + "type": "runtime", + "updated": 0, + "version": "17.0.2+8" + } + ], + "type": "release", + "updated": 1734729268 + }, + { + "id": 100021, + "name": "1.11.3", + "private": false, + "released": 1737660938, + "specs": { + "id": -1, + "minimum": 4096, + "recommended": 6144 + }, + "targets": [ + { + "id": -1, + "name": "minecraft", + "type": "game", + "updated": 0, + "version": "1.18.2" + }, + { + "id": -1, + "name": "forge", + "type": "modloader", + "updated": 0, + "version": "40.2.14" + }, + { + "id": -1, + "name": "java", + "type": "runtime", + "updated": 0, + "version": "17.0.2+8" + } + ], + "type": "release", + "updated": 1737660938 + }, + { + "id": 100043, + "name": "1.11.4", + "private": false, + "released": 1741432146, + "specs": { + "id": -1, + "minimum": 4096, + "recommended": 6144 + }, + "targets": [ + { + "id": -1, + "name": "minecraft", + "type": "game", + "updated": 0, + "version": "1.18.2" + }, + { + "id": -1, + "name": "forge", + "type": "modloader", + "updated": 0, + "version": "40.2.14" + }, + { + "id": -1, + "name": "java", + "type": "runtime", + "updated": 0, + "version": "17.0.2+8" + } + ], + "type": "release", + "updated": 1741432146 + }, + { + "id": 100096, + "name": "1.11.5", + "private": false, + "released": 1748535636, + "specs": { + "id": -1, + "minimum": 4096, + "recommended": 6144 + }, + "targets": [ + { + "id": -1, + "name": "minecraft", + "type": "game", + "updated": 0, + "version": "1.18.2" + }, + { + "id": -1, + "name": "forge", + "type": "modloader", + "updated": 0, + "version": "40.2.34" + }, + { + "id": -1, + "name": "java", + "type": "runtime", + "updated": 0, + "version": "17.0.2+8" + } + ], + "type": "release", + "updated": 1748535636 + }, + { + "id": 100359, + "name": "1.11.6", + "private": false, + "released": 1781198103, + "specs": { + "id": -1, + "minimum": 4096, + "recommended": 6144 + }, + "targets": [ + { + "id": -1, + "name": "minecraft", + "type": "game", + "updated": 0, + "version": "1.18.2" + }, + { + "id": -1, + "name": "forge", + "type": "modloader", + "updated": 0, + "version": "40.2.34" + }, + { + "id": -1, + "name": "java", + "type": "runtime", + "updated": 0, + "version": "17.0.2+8" + } + ], + "type": "release", + "updated": 1781198103 + } + ] +} diff --git a/api/internal/registry/testdata/ftb/pack-130.json b/api/internal/registry/testdata/ftb/pack-130.json new file mode 100644 index 000000000..6f95580ca --- /dev/null +++ b/api/internal/registry/testdata/ftb/pack-130.json @@ -0,0 +1,2336 @@ +{ + "art": [ + { + "compressed": false, + "height": 512, + "id": -1, + "mirrors": [], + "order": 0, + "sha1": "68956ac57b28ce4ebbe9535820311af863f682bb", + "title": "Logo", + "type": "square", + "updated": 0, + "url": "https://cdn.feed-the-beast.com/blob/5b/5b10fbf6e78546a5a4be81a2d311718cc24d29e4277e747028d787d6fec0be46.webp", + "width": 512 + }, + { + "compressed": false, + "height": 1080, + "id": -1, + "mirrors": [], + "order": 1, + "sha1": "e1373197e44478979d456ad60f6b8577014eb932", + "title": "Background", + "type": "splash", + "updated": 0, + "url": "https://cdn.feed-the-beast.com/blob/98/98b53e2120cbc2dca41d65b5aac42862671f1d8b76d8374cd2cdde32bc24bb6e.webp", + "width": 1920 + }, + { + "compressed": false, + "description": "", + "height": 1027, + "id": -1, + "mirrors": [], + "order": 1002, + "sha1": "b12ba42eb0a97486cd5efedcfb136ec996b11997", + "title": "Spawn", + "type": "screenshot", + "updated": 1761732737, + "url": "https://cdn.feed-the-beast.com/blob/98/98433704039cf25f1b4a63ca76ca8757bfd15da43778a6ee0dc85f72b04cef5e.webp", + "width": 1920 + }, + { + "compressed": false, + "description": "", + "height": 1027, + "id": -1, + "mirrors": [], + "order": 1003, + "sha1": "89a06f065a8643daea3288bba311d16a3885231e", + "title": "Cave starter", + "type": "screenshot", + "updated": 1761732780, + "url": "https://cdn.feed-the-beast.com/blob/fc/fc911eb09aa9bc57cbfcdb63e3510174e1ddab91a97cff1bba5a75c338b9b9d7.webp", + "width": 1920 + }, + { + "compressed": false, + "description": "", + "height": 1027, + "id": -1, + "mirrors": [], + "order": 1004, + "sha1": "494f8f9aac63c8ec3386033678fcc207f151472e", + "title": "Cherry Grove Starter", + "type": "screenshot", + "updated": 1761732800, + "url": "https://cdn.feed-the-beast.com/blob/9d/9d64d449bd1e1575395646e8b3aa1e1b56d7125b7e19066746d71ca0dc71fdd9.webp", + "width": 1920 + }, + { + "compressed": false, + "description": "", + "height": 1080, + "id": -1, + "mirrors": [], + "order": 1005, + "sha1": "047f6c4373b3b3538ad97a161084a84acbec9402", + "title": "Arcane Grove", + "type": "screenshot", + "updated": 1761732834, + "url": "https://cdn.feed-the-beast.com/blob/51/51f4b185bf5c4c93394360a764559d4ea1495f07c00598ce40644f7940f78560.webp", + "width": 1920 + }, + { + "compressed": false, + "description": "", + "height": 1080, + "id": -1, + "mirrors": [], + "order": 1006, + "sha1": "b3a8ff7965357dfca6fc2f074e6300a743ef45bb", + "title": "A mysterious boss appears!", + "type": "screenshot", + "updated": 1761732887, + "url": "https://cdn.feed-the-beast.com/blob/9d/9d574d9ffe810c380ab3309a0fc8cfa7d93a0c5e96c54a63dcd2d5436d3c56eb.webp", + "width": 1920 + }, + { + "compressed": false, + "description": "", + "height": 1080, + "id": -1, + "mirrors": [], + "order": 1007, + "sha1": "961e4b95452c66903e21145e4f27ad6f8bb252b5", + "title": "The end", + "type": "screenshot", + "updated": 1761732928, + "url": "https://cdn.feed-the-beast.com/blob/af/afd250b491a023d38bc82fe9fb8db9da0ad70af8d03d1a7b4110d61f7c172e45.webp", + "width": 1920 + }, + { + "compressed": false, + "description": "", + "height": 1080, + "id": -1, + "mirrors": [], + "order": 1008, + "sha1": "f4dec9e715382954521912579ef15e7f9dc5f434", + "title": "Healing spring", + "type": "screenshot", + "updated": 1761732944, + "url": "https://cdn.feed-the-beast.com/blob/4a/4ad2331330f994f880319be0cba9700722b8d70458a7fd55e878dfe051c93d09.webp", + "width": 1920 + }, + { + "compressed": false, + "description": "", + "height": 1027, + "id": -1, + "mirrors": [], + "order": 1009, + "sha1": "2f95415dbb61db31f86dd84e66e5f6fa7c88d655", + "title": "Mangrove Starter", + "type": "screenshot", + "updated": 1761732978, + "url": "https://cdn.feed-the-beast.com/blob/62/62a8af9b23b8e5ee182431b98416a574690f8feaba909bc941751bf9ee90250b.webp", + "width": 1920 + }, + { + "compressed": false, + "description": "", + "height": 1080, + "id": -1, + "mirrors": [], + "order": 1010, + "sha1": "a3a57594f767d298f1753719ab7a129c0f830f25", + "title": "Taking a dive", + "type": "screenshot", + "updated": 1761733011, + "url": "https://cdn.feed-the-beast.com/blob/50/50e2a8ebdbc659e9b5a43e6d5071f5efae4f7abf392c2768d0667e2435c6abe1.webp", + "width": 1920 + }, + { + "compressed": false, + "description": "", + "height": 1080, + "id": -1, + "mirrors": [], + "order": 1011, + "sha1": "3cdc262abfdb3bcd71cac81b225b4de6e2f6a178", + "title": "Is that a Yeti?!", + "type": "screenshot", + "updated": 1761733029, + "url": "https://cdn.feed-the-beast.com/blob/c2/c26e7ba0a2576bc9a772c4cae2a053f6069b687fc6a65240246c4b44837492ec.webp", + "width": 1920 + }, + { + "compressed": false, + "description": "", + "height": 1080, + "id": -1, + "mirrors": [], + "order": 1012, + "sha1": "996583d77c248b79ef4a7e17d05fe0d2a510f0cb", + "title": "Weeping Well", + "type": "screenshot", + "updated": 1761733050, + "url": "https://cdn.feed-the-beast.com/blob/8a/8a42aa7c5c278a3e8e500d732fbcb76b8a33c8a3943a9385bf3590b86bcab7ac.webp", + "width": 1920 + }, + { + "compressed": false, + "description": "", + "height": 1080, + "id": -1, + "mirrors": [], + "order": 1013, + "sha1": "2c93f96887e12311ecfb1616d749394229c30ac0", + "title": "Void", + "type": "screenshot", + "updated": 1761733087, + "url": "https://cdn.feed-the-beast.com/blob/54/54f5717e6c9513202332295c3893edb52dd0a1b68348af3931b6f90bc136f2a9.webp", + "width": 1920 + }, + { + "compressed": false, + "description": "", + "height": 1080, + "id": -1, + "mirrors": [], + "order": 1014, + "sha1": "1e786a38a8543058d99d0e1c75bc7e3560483cc6", + "title": "Nether dungeon", + "type": "screenshot", + "updated": 1761733107, + "url": "https://cdn.feed-the-beast.com/blob/44/446049dc732525b734960776801b43dcd758c89b027003e5137f1b1ac3c8ddbd.webp", + "width": 1920 + } + ], + "authors": [ + { + "id": -1, + "name": "FTB Team", + "type": "team", + "updated": 0, + "website": "https://www.feed-the-beast.com/" + } + ], + "featured": true, + "id": 130, + "installs": 2219810, + "links": [ + { + "id": -1, + "link": "https://docs.feed-the-beast.com", + "name": "Wiki", + "type": "misc" + }, + { + "id": -1, + "link": "https://github.com/ftbteam/ftb-modpack-issues/issues", + "name": "Issue Tracker", + "type": "misc" + } + ], + "meta": { + "curseforgeProjectId": 1373378, + "isLegacy": false, + "supportsWorlds": true + }, + "name": "FTB StoneBlock 4", + "notification": "", + "plays": 13442764, + "plays_14d": 1453747, + "private": false, + "provider": "modpacks.ch", + "rating": { + "age": 7, + "alcoholdrugs": false, + "configured": false, + "frightening": true, + "gambling": false, + "id": -1, + "language": false, + "nuditysexual": false, + "sterotypeshate": false, + "verified": false, + "violence": true + }, + "released": 1761746400, + "slug": "ftb-stoneblock-4", + "status": "success", + "synopsis": "The stone remembers. Dive into StoneBlock 4, the next evolution of Minecraft’s underground survival: explore handcrafted Vaults, learn from ancient Echoes, power the World Engine, all on 1.21.1 ", + "tags": [ + { + "id": 9, + "name": "FTB" + }, + { + "id": 103, + "name": "1.21.1" + }, + { + "id": 24, + "name": "Adventure" + }, + { + "id": 29, + "name": "Challenge" + }, + { + "id": 26, + "name": "Combat" + }, + { + "id": 23, + "name": "Exploration" + }, + { + "id": 22, + "name": "Large" + }, + { + "id": 12, + "name": "Magic" + }, + { + "id": 55, + "name": "NeoForge" + }, + { + "id": 46, + "name": "Progression" + }, + { + "id": 14, + "name": "Questing" + }, + { + "id": 13, + "name": "Tech" + } + ], + "type": "release", + "updated": 1761733221, + "versions": [ + { + "id": 100140, + "name": "1.0.0", + "private": false, + "released": 1761664502, + "specs": { + "id": -1, + "minimum": 5120, + "recommended": 6144 + }, + "targets": [ + { + "id": -1, + "name": "minecraft", + "type": "game", + "updated": 0, + "version": "1.21.1" + }, + { + "id": -1, + "name": "neoforge", + "type": "modloader", + "updated": 0, + "version": "21.1.209" + }, + { + "id": -1, + "name": "java", + "type": "runtime", + "updated": 0, + "version": "21.0.4+7-LTS" + } + ], + "type": "release", + "updated": 1761664502 + }, + { + "id": 100141, + "name": "1.0.1", + "private": false, + "released": 1761819603, + "specs": { + "id": -1, + "minimum": 5120, + "recommended": 6144 + }, + "targets": [ + { + "id": -1, + "name": "minecraft", + "type": "game", + "updated": 0, + "version": "1.21.1" + }, + { + "id": -1, + "name": "neoforge", + "type": "modloader", + "updated": 0, + "version": "21.1.213" + }, + { + "id": -1, + "name": "java", + "type": "runtime", + "updated": 0, + "version": "21.0.4+7-LTS" + } + ], + "type": "release", + "updated": 1761819603 + }, + { + "id": 100142, + "name": "1.0.2", + "private": false, + "released": 1762032602, + "specs": { + "id": -1, + "minimum": 5120, + "recommended": 6144 + }, + "targets": [ + { + "id": -1, + "name": "minecraft", + "type": "game", + "updated": 0, + "version": "1.21.1" + }, + { + "id": -1, + "name": "neoforge", + "type": "modloader", + "updated": 0, + "version": "21.1.213" + }, + { + "id": -1, + "name": "java", + "type": "runtime", + "updated": 0, + "version": "21.0.4+7-LTS" + } + ], + "type": "archived", + "updated": 1762040967 + }, + { + "id": 100143, + "name": "1.0.3", + "private": false, + "released": 1762040702, + "specs": { + "id": -1, + "minimum": 6144, + "recommended": 8192 + }, + "targets": [ + { + "id": -1, + "name": "minecraft", + "type": "game", + "updated": 0, + "version": "1.21.1" + }, + { + "id": -1, + "name": "neoforge", + "type": "modloader", + "updated": 0, + "version": "21.1.213" + }, + { + "id": -1, + "name": "java", + "type": "runtime", + "updated": 0, + "version": "21.0.4+7-LTS" + } + ], + "type": "release", + "updated": 1762040702 + }, + { + "id": 100144, + "name": "1.0.4", + "private": false, + "released": 1762205402, + "specs": { + "id": -1, + "minimum": 6144, + "recommended": 8192 + }, + "targets": [ + { + "id": -1, + "name": "minecraft", + "type": "game", + "updated": 0, + "version": "1.21.1" + }, + { + "id": -1, + "name": "neoforge", + "type": "modloader", + "updated": 0, + "version": "21.1.213" + }, + { + "id": -1, + "name": "java", + "type": "runtime", + "updated": 0, + "version": "21.0.4+7-LTS" + } + ], + "type": "release", + "updated": 1762205402 + }, + { + "id": 100145, + "name": "1.0.5", + "private": false, + "released": 1762209902, + "specs": { + "id": -1, + "minimum": 6144, + "recommended": 8192 + }, + "targets": [ + { + "id": -1, + "name": "minecraft", + "type": "game", + "updated": 0, + "version": "1.21.1" + }, + { + "id": -1, + "name": "neoforge", + "type": "modloader", + "updated": 0, + "version": "21.1.213" + }, + { + "id": -1, + "name": "java", + "type": "runtime", + "updated": 0, + "version": "21.0.4+7-LTS" + } + ], + "type": "archived", + "updated": 1762242381 + }, + { + "id": 100146, + "name": "1.0.6", + "private": false, + "released": 1762223403, + "specs": { + "id": -1, + "minimum": 6144, + "recommended": 8192 + }, + "targets": [ + { + "id": -1, + "name": "minecraft", + "type": "game", + "updated": 0, + "version": "1.21.1" + }, + { + "id": -1, + "name": "neoforge", + "type": "modloader", + "updated": 0, + "version": "21.1.213" + }, + { + "id": -1, + "name": "java", + "type": "runtime", + "updated": 0, + "version": "21.0.4+7-LTS" + } + ], + "type": "archived", + "updated": 1762242373 + }, + { + "id": 100147, + "name": "1.0.7", + "private": false, + "released": 1762225502, + "specs": { + "id": -1, + "minimum": 6144, + "recommended": 8192 + }, + "targets": [ + { + "id": -1, + "name": "minecraft", + "type": "game", + "updated": 0, + "version": "1.21.1" + }, + { + "id": -1, + "name": "neoforge", + "type": "modloader", + "updated": 0, + "version": "21.1.213" + }, + { + "id": -1, + "name": "java", + "type": "runtime", + "updated": 0, + "version": "21.0.4+7-LTS" + } + ], + "type": "release", + "updated": 1762225502 + }, + { + "id": 100148, + "name": "1.0.8", + "private": false, + "released": 1762463702, + "specs": { + "id": -1, + "minimum": 6144, + "recommended": 8192 + }, + "targets": [ + { + "id": -1, + "name": "minecraft", + "type": "game", + "updated": 0, + "version": "1.21.1" + }, + { + "id": -1, + "name": "neoforge", + "type": "modloader", + "updated": 0, + "version": "21.1.213" + }, + { + "id": -1, + "name": "java", + "type": "runtime", + "updated": 0, + "version": "21.0.4+7-LTS" + } + ], + "type": "release", + "updated": 1762463702 + }, + { + "id": 100150, + "name": "1.1.0", + "private": false, + "released": 1763076602, + "specs": { + "id": -1, + "minimum": 6144, + "recommended": 8192 + }, + "targets": [ + { + "id": -1, + "name": "minecraft", + "type": "game", + "updated": 0, + "version": "1.21.1" + }, + { + "id": -1, + "name": "neoforge", + "type": "modloader", + "updated": 0, + "version": "21.1.213" + }, + { + "id": -1, + "name": "java", + "type": "runtime", + "updated": 0, + "version": "21.0.4+7-LTS" + } + ], + "type": "release", + "updated": 1763076602 + }, + { + "id": 100151, + "name": "1.1.1", + "private": false, + "released": 1763319902, + "specs": { + "id": -1, + "minimum": 6144, + "recommended": 8192 + }, + "targets": [ + { + "id": -1, + "name": "minecraft", + "type": "game", + "updated": 0, + "version": "1.21.1" + }, + { + "id": -1, + "name": "neoforge", + "type": "modloader", + "updated": 0, + "version": "21.1.213" + }, + { + "id": -1, + "name": "java", + "type": "runtime", + "updated": 0, + "version": "21.0.4+7-LTS" + } + ], + "type": "release", + "updated": 1763319902 + }, + { + "id": 100152, + "name": "1.1.2", + "private": false, + "released": 1763506802, + "specs": { + "id": -1, + "minimum": 6144, + "recommended": 8192 + }, + "targets": [ + { + "id": -1, + "name": "minecraft", + "type": "game", + "updated": 0, + "version": "1.21.1" + }, + { + "id": -1, + "name": "neoforge", + "type": "modloader", + "updated": 0, + "version": "21.1.213" + }, + { + "id": -1, + "name": "java", + "type": "runtime", + "updated": 0, + "version": "21.0.4+7-LTS" + } + ], + "type": "release", + "updated": 1763506802 + }, + { + "id": 100156, + "name": "1.2.0", + "private": false, + "released": 1764105002, + "specs": { + "id": -1, + "minimum": 6144, + "recommended": 8192 + }, + "targets": [ + { + "id": -1, + "name": "minecraft", + "type": "game", + "updated": 0, + "version": "1.21.1" + }, + { + "id": -1, + "name": "neoforge", + "type": "modloader", + "updated": 0, + "version": "21.1.213" + }, + { + "id": -1, + "name": "java", + "type": "runtime", + "updated": 0, + "version": "21.0.4+7-LTS" + } + ], + "type": "release", + "updated": 1764105002 + }, + { + "id": 100157, + "name": "1.2.1", + "private": false, + "released": 1764200402, + "specs": { + "id": -1, + "minimum": 6144, + "recommended": 8192 + }, + "targets": [ + { + "id": -1, + "name": "minecraft", + "type": "game", + "updated": 0, + "version": "1.21.1" + }, + { + "id": -1, + "name": "neoforge", + "type": "modloader", + "updated": 0, + "version": "21.1.213" + }, + { + "id": -1, + "name": "java", + "type": "runtime", + "updated": 0, + "version": "21.0.4+7-LTS" + } + ], + "type": "release", + "updated": 1764200402 + }, + { + "id": 100158, + "name": "1.3.0", + "private": false, + "released": 1764864902, + "specs": { + "id": -1, + "minimum": 6144, + "recommended": 8192 + }, + "targets": [ + { + "id": -1, + "name": "minecraft", + "type": "game", + "updated": 0, + "version": "1.21.1" + }, + { + "id": -1, + "name": "neoforge", + "type": "modloader", + "updated": 0, + "version": "21.1.213" + }, + { + "id": -1, + "name": "java", + "type": "runtime", + "updated": 0, + "version": "21.0.4+7-LTS" + } + ], + "type": "release", + "updated": 1764864902 + }, + { + "id": 100159, + "name": "1.4.0", + "private": false, + "released": 1765252502, + "specs": { + "id": -1, + "minimum": 6144, + "recommended": 8192 + }, + "targets": [ + { + "id": -1, + "name": "minecraft", + "type": "game", + "updated": 0, + "version": "1.21.1" + }, + { + "id": -1, + "name": "neoforge", + "type": "modloader", + "updated": 0, + "version": "21.1.216" + }, + { + "id": -1, + "name": "java", + "type": "runtime", + "updated": 0, + "version": "21.0.4+7-LTS" + } + ], + "type": "release", + "updated": 1765252502 + }, + { + "id": 100164, + "name": "1.5.0", + "private": false, + "released": 1765912503, + "specs": { + "id": -1, + "minimum": 6144, + "recommended": 8192 + }, + "targets": [ + { + "id": -1, + "name": "minecraft", + "type": "game", + "updated": 0, + "version": "1.21.1" + }, + { + "id": -1, + "name": "neoforge", + "type": "modloader", + "updated": 0, + "version": "21.1.216" + }, + { + "id": -1, + "name": "java", + "type": "runtime", + "updated": 0, + "version": "21.0.4+7-LTS" + } + ], + "type": "release", + "updated": 1765912503 + }, + { + "id": 100171, + "name": "1.6.0", + "private": false, + "released": 1767757203, + "specs": { + "id": -1, + "minimum": 6144, + "recommended": 8192 + }, + "targets": [ + { + "id": -1, + "name": "minecraft", + "type": "game", + "updated": 0, + "version": "1.21.1" + }, + { + "id": -1, + "name": "neoforge", + "type": "modloader", + "updated": 0, + "version": "21.1.216" + }, + { + "id": -1, + "name": "java", + "type": "runtime", + "updated": 0, + "version": "21.0.4+7-LTS" + } + ], + "type": "release", + "updated": 1767757203 + }, + { + "id": 100174, + "name": "1.7.0", + "private": false, + "released": 1769805602, + "specs": { + "id": -1, + "minimum": 6144, + "recommended": 8192 + }, + "targets": [ + { + "id": -1, + "name": "minecraft", + "type": "game", + "updated": 0, + "version": "1.21.1" + }, + { + "id": -1, + "name": "neoforge", + "type": "modloader", + "updated": 0, + "version": "21.1.218" + }, + { + "id": -1, + "name": "java", + "type": "runtime", + "updated": 0, + "version": "21.0.4+7-LTS" + } + ], + "type": "release", + "updated": 1769805602 + }, + { + "id": 100175, + "name": "1.7.1", + "private": false, + "released": 1770067202, + "specs": { + "id": -1, + "minimum": 6144, + "recommended": 8192 + }, + "targets": [ + { + "id": -1, + "name": "minecraft", + "type": "game", + "updated": 0, + "version": "1.21.1" + }, + { + "id": -1, + "name": "neoforge", + "type": "modloader", + "updated": 0, + "version": "21.1.218" + }, + { + "id": -1, + "name": "java", + "type": "runtime", + "updated": 0, + "version": "21.0.4+7-LTS" + } + ], + "type": "archived", + "updated": 1770116899 + }, + { + "id": 100176, + "name": "1.7.2", + "private": false, + "released": 1770117303, + "specs": { + "id": -1, + "minimum": 6144, + "recommended": 8192 + }, + "targets": [ + { + "id": -1, + "name": "minecraft", + "type": "game", + "updated": 0, + "version": "1.21.1" + }, + { + "id": -1, + "name": "neoforge", + "type": "modloader", + "updated": 0, + "version": "21.1.218" + }, + { + "id": -1, + "name": "java", + "type": "runtime", + "updated": 0, + "version": "21.0.4+7-LTS" + } + ], + "type": "release", + "updated": 1770117303 + }, + { + "id": 100177, + "name": "1.7.3", + "private": false, + "released": 1770132002, + "specs": { + "id": -1, + "minimum": 6144, + "recommended": 8192 + }, + "targets": [ + { + "id": -1, + "name": "minecraft", + "type": "game", + "updated": 0, + "version": "1.21.1" + }, + { + "id": -1, + "name": "neoforge", + "type": "modloader", + "updated": 0, + "version": "21.1.218" + }, + { + "id": -1, + "name": "java", + "type": "runtime", + "updated": 0, + "version": "21.0.4+7-LTS" + } + ], + "type": "release", + "updated": 1770132002 + }, + { + "id": 100180, + "name": "1.8.0", + "private": false, + "released": 1770750602, + "specs": { + "id": -1, + "minimum": 6144, + "recommended": 8192 + }, + "targets": [ + { + "id": -1, + "name": "minecraft", + "type": "game", + "updated": 0, + "version": "1.21.1" + }, + { + "id": -1, + "name": "neoforge", + "type": "modloader", + "updated": 0, + "version": "21.1.219" + }, + { + "id": -1, + "name": "java", + "type": "runtime", + "updated": 0, + "version": "21.0.4+7-LTS" + } + ], + "type": "release", + "updated": 1770801457 + }, + { + "id": 100212, + "name": "1.8.1", + "private": false, + "released": 1773228602, + "specs": { + "id": -1, + "minimum": 6144, + "recommended": 8192 + }, + "targets": [ + { + "id": -1, + "name": "minecraft", + "type": "game", + "updated": 0, + "version": "1.21.1" + }, + { + "id": -1, + "name": "neoforge", + "type": "modloader", + "updated": 0, + "version": "21.1.219" + }, + { + "id": -1, + "name": "java", + "type": "runtime", + "updated": 0, + "version": "21.0.4+7-LTS" + } + ], + "type": "release", + "updated": 1773228602 + }, + { + "id": 100214, + "name": "1.9.0", + "private": false, + "released": 1773782702, + "specs": { + "id": -1, + "minimum": 6144, + "recommended": 8192 + }, + "targets": [ + { + "id": -1, + "name": "minecraft", + "type": "game", + "updated": 0, + "version": "1.21.1" + }, + { + "id": -1, + "name": "neoforge", + "type": "modloader", + "updated": 0, + "version": "21.1.219" + }, + { + "id": -1, + "name": "java", + "type": "runtime", + "updated": 0, + "version": "21.0.4+7-LTS" + } + ], + "type": "release", + "updated": 1773782702 + }, + { + "id": 100219, + "name": "1.9.1", + "private": false, + "released": 1773880202, + "specs": { + "id": -1, + "minimum": 6144, + "recommended": 8192 + }, + "targets": [ + { + "id": -1, + "name": "minecraft", + "type": "game", + "updated": 0, + "version": "1.21.1" + }, + { + "id": -1, + "name": "neoforge", + "type": "modloader", + "updated": 0, + "version": "21.1.220" + }, + { + "id": -1, + "name": "java", + "type": "runtime", + "updated": 0, + "version": "21.0.4+7-LTS" + } + ], + "type": "release", + "updated": 1773880202 + }, + { + "id": 100232, + "name": "1.9.3", + "private": false, + "released": 1774221302, + "specs": { + "id": -1, + "minimum": 6144, + "recommended": 8192 + }, + "targets": [ + { + "id": -1, + "name": "minecraft", + "type": "game", + "updated": 0, + "version": "1.21.1" + }, + { + "id": -1, + "name": "neoforge", + "type": "modloader", + "updated": 0, + "version": "21.1.220" + }, + { + "id": -1, + "name": "java", + "type": "runtime", + "updated": 0, + "version": "21.0.4+7-LTS" + } + ], + "type": "archived", + "updated": 1775205222 + }, + { + "id": 100235, + "name": "1.9.4", + "private": false, + "released": 1774403702, + "specs": { + "id": -1, + "minimum": 6144, + "recommended": 8192 + }, + "targets": [ + { + "id": -1, + "name": "minecraft", + "type": "game", + "updated": 0, + "version": "1.21.1" + }, + { + "id": -1, + "name": "neoforge", + "type": "modloader", + "updated": 0, + "version": "21.1.220" + }, + { + "id": -1, + "name": "java", + "type": "runtime", + "updated": 0, + "version": "21.0.4+7-LTS" + } + ], + "type": "release", + "updated": 1774403702 + }, + { + "id": 100249, + "name": "1.9.5", + "private": false, + "released": 1775030702, + "specs": { + "id": -1, + "minimum": 6144, + "recommended": 8192 + }, + "targets": [ + { + "id": -1, + "name": "minecraft", + "type": "game", + "updated": 0, + "version": "1.21.1" + }, + { + "id": -1, + "name": "neoforge", + "type": "modloader", + "updated": 0, + "version": "21.1.220" + }, + { + "id": -1, + "name": "java", + "type": "runtime", + "updated": 0, + "version": "21.0.4+7-LTS" + } + ], + "type": "release", + "updated": 1775030702 + }, + { + "id": 100256, + "name": "1.9.6", + "private": false, + "released": 1775242802, + "specs": { + "id": -1, + "minimum": 6144, + "recommended": 8192 + }, + "targets": [ + { + "id": -1, + "name": "minecraft", + "type": "game", + "updated": 0, + "version": "1.21.1" + }, + { + "id": -1, + "name": "neoforge", + "type": "modloader", + "updated": 0, + "version": "21.1.222" + }, + { + "id": -1, + "name": "java", + "type": "runtime", + "updated": 0, + "version": "21.0.4+7-LTS" + } + ], + "type": "release", + "updated": 1775242802 + }, + { + "id": 100262, + "name": "1.10.0", + "private": false, + "released": 1775615702, + "specs": { + "id": -1, + "minimum": 6144, + "recommended": 8192 + }, + "targets": [ + { + "id": -1, + "name": "minecraft", + "type": "game", + "updated": 0, + "version": "1.21.1" + }, + { + "id": -1, + "name": "neoforge", + "type": "modloader", + "updated": 0, + "version": "21.1.222" + }, + { + "id": -1, + "name": "java", + "type": "runtime", + "updated": 0, + "version": "21.0.4+7-LTS" + } + ], + "type": "release", + "updated": 1775615702 + }, + { + "id": 100272, + "name": "1.11.0", + "private": false, + "released": 1776315002, + "specs": { + "id": -1, + "minimum": 6144, + "recommended": 8192 + }, + "targets": [ + { + "id": -1, + "name": "minecraft", + "type": "game", + "updated": 0, + "version": "1.21.1" + }, + { + "id": -1, + "name": "neoforge", + "type": "modloader", + "updated": 0, + "version": "21.1.224" + }, + { + "id": -1, + "name": "java", + "type": "runtime", + "updated": 0, + "version": "21.0.4+7-LTS" + } + ], + "type": "release", + "updated": 1776315002 + }, + { + "id": 100284, + "name": "1.11.1", + "private": false, + "released": 1777035902, + "specs": { + "id": -1, + "minimum": 6144, + "recommended": 8192 + }, + "targets": [ + { + "id": -1, + "name": "minecraft", + "type": "game", + "updated": 0, + "version": "1.21.1" + }, + { + "id": -1, + "name": "neoforge", + "type": "modloader", + "updated": 0, + "version": "21.1.224" + }, + { + "id": -1, + "name": "java", + "type": "runtime", + "updated": 0, + "version": "21.0.4+7-LTS" + } + ], + "type": "release", + "updated": 1777035902 + }, + { + "id": 100298, + "name": "1.12.0", + "private": false, + "released": 1778118002, + "specs": { + "id": -1, + "minimum": 6144, + "recommended": 8192 + }, + "targets": [ + { + "id": -1, + "name": "minecraft", + "type": "game", + "updated": 0, + "version": "1.21.1" + }, + { + "id": -1, + "name": "neoforge", + "type": "modloader", + "updated": 0, + "version": "21.1.224" + }, + { + "id": -1, + "name": "java", + "type": "runtime", + "updated": 0, + "version": "21.0.4+7-LTS" + } + ], + "type": "release", + "updated": 1778118002 + }, + { + "id": 100309, + "name": "1.13.0", + "private": false, + "released": 1778606402, + "specs": { + "id": -1, + "minimum": 6144, + "recommended": 8192 + }, + "targets": [ + { + "id": -1, + "name": "minecraft", + "type": "game", + "updated": 0, + "version": "1.21.1" + }, + { + "id": -1, + "name": "neoforge", + "type": "modloader", + "updated": 0, + "version": "21.1.228" + }, + { + "id": -1, + "name": "java", + "type": "runtime", + "updated": 0, + "version": "21.0.4+7-LTS" + } + ], + "type": "release", + "updated": 1778606402 + }, + { + "id": 100312, + "name": "1.13.1", + "private": false, + "released": 1778617202, + "specs": { + "id": -1, + "minimum": 6144, + "recommended": 8192 + }, + "targets": [ + { + "id": -1, + "name": "minecraft", + "type": "game", + "updated": 0, + "version": "1.21.1" + }, + { + "id": -1, + "name": "neoforge", + "type": "modloader", + "updated": 0, + "version": "21.1.228" + }, + { + "id": -1, + "name": "java", + "type": "runtime", + "updated": 0, + "version": "21.0.4+7-LTS" + } + ], + "type": "release", + "updated": 1778617202 + }, + { + "id": 100330, + "name": "1.14.0", + "private": false, + "released": 1779883649, + "specs": { + "id": -1, + "minimum": 6144, + "recommended": 8192 + }, + "targets": [ + { + "id": -1, + "name": "minecraft", + "type": "game", + "updated": 0, + "version": "1.21.1" + }, + { + "id": -1, + "name": "neoforge", + "type": "modloader", + "updated": 0, + "version": "21.1.228" + }, + { + "id": -1, + "name": "java", + "type": "runtime", + "updated": 0, + "version": "21.0.4+7-LTS" + } + ], + "type": "release", + "updated": 1779883649 + }, + { + "id": 100338, + "name": "1.14.1", + "private": false, + "released": 1780240951, + "specs": { + "id": -1, + "minimum": 6144, + "recommended": 8192 + }, + "targets": [ + { + "id": -1, + "name": "minecraft", + "type": "game", + "updated": 0, + "version": "1.21.1" + }, + { + "id": -1, + "name": "neoforge", + "type": "modloader", + "updated": 0, + "version": "21.1.230" + }, + { + "id": -1, + "name": "java", + "type": "runtime", + "updated": 0, + "version": "21.0.4+7-LTS" + } + ], + "type": "release", + "updated": 1780240951 + }, + { + "id": 100344, + "name": "1.14.2", + "private": false, + "released": 1780449404, + "specs": { + "id": -1, + "minimum": 6144, + "recommended": 8192 + }, + "targets": [ + { + "id": -1, + "name": "minecraft", + "type": "game", + "updated": 0, + "version": "1.21.1" + }, + { + "id": -1, + "name": "neoforge", + "type": "modloader", + "updated": 0, + "version": "21.1.233" + }, + { + "id": -1, + "name": "java", + "type": "runtime", + "updated": 0, + "version": "21.0.4+7-LTS" + } + ], + "type": "release", + "updated": 1780449404 + }, + { + "id": 100366, + "name": "1.15.0", + "private": false, + "released": 1781318703, + "specs": { + "id": -1, + "minimum": 6144, + "recommended": 8192 + }, + "targets": [ + { + "id": -1, + "name": "minecraft", + "type": "game", + "updated": 0, + "version": "1.21.1" + }, + { + "id": -1, + "name": "neoforge", + "type": "modloader", + "updated": 0, + "version": "21.1.233" + }, + { + "id": -1, + "name": "java", + "type": "runtime", + "updated": 0, + "version": "21.0.4+7-LTS" + } + ], + "type": "release", + "updated": 1781318703 + }, + { + "id": 100368, + "name": "1.15.2", + "private": false, + "released": 1781587803, + "specs": { + "id": -1, + "minimum": 6144, + "recommended": 8192 + }, + "targets": [ + { + "id": -1, + "name": "minecraft", + "type": "game", + "updated": 0, + "version": "1.21.1" + }, + { + "id": -1, + "name": "neoforge", + "type": "modloader", + "updated": 0, + "version": "21.1.233" + }, + { + "id": -1, + "name": "java", + "type": "runtime", + "updated": 0, + "version": "21.0.4+7-LTS" + } + ], + "type": "release", + "updated": 1781587803 + }, + { + "id": 100372, + "name": "1.15.3", + "private": false, + "released": 1781687103, + "specs": { + "id": -1, + "minimum": 6144, + "recommended": 8192 + }, + "targets": [ + { + "id": -1, + "name": "minecraft", + "type": "game", + "updated": 0, + "version": "1.21.1" + }, + { + "id": -1, + "name": "neoforge", + "type": "modloader", + "updated": 0, + "version": "21.1.233" + }, + { + "id": -1, + "name": "java", + "type": "runtime", + "updated": 0, + "version": "21.0.4+7-LTS" + } + ], + "type": "release", + "updated": 1781687103 + }, + { + "id": 100408, + "name": "1.16.0", + "private": false, + "released": 1783000428, + "specs": { + "id": -1, + "minimum": 6144, + "recommended": 8192 + }, + "targets": [ + { + "id": -1, + "name": "minecraft", + "type": "game", + "updated": 0, + "version": "1.21.1" + }, + { + "id": -1, + "name": "neoforge", + "type": "modloader", + "updated": 0, + "version": "21.1.233" + }, + { + "id": -1, + "name": "java", + "type": "runtime", + "updated": 0, + "version": "21.0.4+7-LTS" + } + ], + "type": "release", + "updated": 1783000428 + }, + { + "id": 100429, + "name": "1.17.0", + "private": false, + "released": 1784922904, + "specs": { + "id": -1, + "minimum": 6144, + "recommended": 8192 + }, + "targets": [ + { + "id": -1, + "name": "minecraft", + "type": "game", + "updated": 0, + "version": "1.21.1" + }, + { + "id": -1, + "name": "neoforge", + "type": "modloader", + "updated": 0, + "version": "21.1.243" + }, + { + "id": -1, + "name": "java", + "type": "runtime", + "updated": 0, + "version": "21.0.4+7-LTS" + } + ], + "type": "release", + "updated": 1784922904 + }, + { + "id": 100437, + "name": "1.17.1", + "private": false, + "released": 1785255744, + "specs": { + "id": -1, + "minimum": 6144, + "recommended": 8192 + }, + "targets": [ + { + "id": -1, + "name": "minecraft", + "type": "game", + "updated": 0, + "version": "1.21.1" + }, + { + "id": -1, + "name": "neoforge", + "type": "modloader", + "updated": 0, + "version": "21.1.243" + }, + { + "id": -1, + "name": "java", + "type": "runtime", + "updated": 0, + "version": "21.0.4+7-LTS" + } + ], + "type": "release", + "updated": 1785255744 + }, + { + "id": 100440, + "name": "1.17.2", + "private": false, + "released": 1785334503, + "specs": { + "id": -1, + "minimum": 6144, + "recommended": 8192 + }, + "targets": [ + { + "id": -1, + "name": "minecraft", + "type": "game", + "updated": 0, + "version": "1.21.1" + }, + { + "id": -1, + "name": "neoforge", + "type": "modloader", + "updated": 0, + "version": "21.1.243" + }, + { + "id": -1, + "name": "java", + "type": "runtime", + "updated": 0, + "version": "21.0.4+7-LTS" + } + ], + "type": "release", + "updated": 1785334503 + }, + { + "id": 100456, + "name": "1.18.0", + "private": false, + "released": 1786147448, + "specs": { + "id": -1, + "minimum": 6144, + "recommended": 8192 + }, + "targets": [ + { + "id": -1, + "name": "minecraft", + "type": "game", + "updated": 0, + "version": "1.21.1" + }, + { + "id": -1, + "name": "neoforge", + "type": "modloader", + "updated": 0, + "version": "21.1.243" + }, + { + "id": -1, + "name": "java", + "type": "runtime", + "updated": 0, + "version": "21.0.4+7-LTS" + } + ], + "type": "release", + "updated": 1786147448 + }, + { + "id": 100459, + "name": "1.19.0", + "private": false, + "released": 1786458903, + "specs": { + "id": -1, + "minimum": 6144, + "recommended": 8192 + }, + "targets": [ + { + "id": -1, + "name": "minecraft", + "type": "game", + "updated": 0, + "version": "1.21.1" + }, + { + "id": -1, + "name": "neoforge", + "type": "modloader", + "updated": 0, + "version": "21.1.248" + }, + { + "id": -1, + "name": "java", + "type": "runtime", + "updated": 0, + "version": "21.0.4+7-LTS" + } + ], + "type": "release", + "updated": 1786458903 + }, + { + "id": 100462, + "name": "1.19.1", + "private": false, + "released": 1786502103, + "specs": { + "id": -1, + "minimum": 6144, + "recommended": 8192 + }, + "targets": [ + { + "id": -1, + "name": "minecraft", + "type": "game", + "updated": 0, + "version": "1.21.1" + }, + { + "id": -1, + "name": "neoforge", + "type": "modloader", + "updated": 0, + "version": "21.1.248" + }, + { + "id": -1, + "name": "java", + "type": "runtime", + "updated": 0, + "version": "21.0.4+7-LTS" + } + ], + "type": "release", + "updated": 1786502103 + }, + { + "id": 100484, + "name": "1.20.0", + "private": false, + "released": 1787776802, + "specs": { + "id": -1, + "minimum": 6144, + "recommended": 8192 + }, + "targets": [ + { + "id": -1, + "name": "minecraft", + "type": "game", + "updated": 0, + "version": "1.21.1" + }, + { + "id": -1, + "name": "neoforge", + "type": "modloader", + "updated": 0, + "version": "21.1.248" + }, + { + "id": -1, + "name": "java", + "type": "runtime", + "updated": 0, + "version": "21.0.4+7-LTS" + } + ], + "type": "release", + "updated": 1787776802 + }, + { + "id": 100489, + "name": "1.20.1", + "private": false, + "released": 1788302702, + "specs": { + "id": -1, + "minimum": 6144, + "recommended": 8192 + }, + "targets": [ + { + "id": -1, + "name": "minecraft", + "type": "game", + "updated": 0, + "version": "1.21.1" + }, + { + "id": -1, + "name": "neoforge", + "type": "modloader", + "updated": 0, + "version": "21.1.248" + }, + { + "id": -1, + "name": "java", + "type": "runtime", + "updated": 0, + "version": "21.0.4+7-LTS" + } + ], + "type": "release", + "updated": 1788302702 + }, + { + "id": 100501, + "name": "1.21.0", + "private": false, + "released": 1788984902, + "specs": { + "id": -1, + "minimum": 6144, + "recommended": 8192 + }, + "targets": [ + { + "id": -1, + "name": "minecraft", + "type": "game", + "updated": 0, + "version": "1.21.1" + }, + { + "id": -1, + "name": "neoforge", + "type": "modloader", + "updated": 0, + "version": "21.1.248" + }, + { + "id": -1, + "name": "java", + "type": "runtime", + "updated": 0, + "version": "21.0.4+7-LTS" + } + ], + "type": "release", + "updated": 1788984902 + }, + { + "id": 100515, + "name": "1.22.0", + "private": false, + "released": 1790090702, + "specs": { + "id": -1, + "minimum": 6144, + "recommended": 8192 + }, + "targets": [ + { + "id": -1, + "name": "minecraft", + "type": "game", + "updated": 0, + "version": "1.21.1" + }, + { + "id": -1, + "name": "neoforge", + "type": "modloader", + "updated": 0, + "version": "21.1.250" + }, + { + "id": -1, + "name": "java", + "type": "runtime", + "updated": 0, + "version": "21.0.4+7-LTS" + } + ], + "type": "release", + "updated": 1790090702 + }, + { + "id": 100554, + "name": "1.23.0", + "private": false, + "released": 1791775502, + "specs": { + "id": -1, + "minimum": 6144, + "recommended": 8192 + }, + "targets": [ + { + "id": -1, + "name": "minecraft", + "type": "game", + "updated": 0, + "version": "1.21.1" + }, + { + "id": -1, + "name": "neoforge", + "type": "modloader", + "updated": 0, + "version": "21.1.250" + }, + { + "id": -1, + "name": "java", + "type": "runtime", + "updated": 0, + "version": "21.0.4+7-LTS" + } + ], + "type": "release", + "updated": 1791775502 + }, + { + "id": 100570, + "name": "1.24.0", + "private": false, + "released": 1792618202, + "specs": { + "id": -1, + "minimum": 6144, + "recommended": 8192 + }, + "targets": [ + { + "id": -1, + "name": "minecraft", + "type": "game", + "updated": 0, + "version": "1.21.1" + }, + { + "id": -1, + "name": "neoforge", + "type": "modloader", + "updated": 0, + "version": "21.1.262" + }, + { + "id": -1, + "name": "java", + "type": "runtime", + "updated": 0, + "version": "21.0.4+7-LTS" + } + ], + "type": "release", + "updated": 1792618202 + }, + { + "id": 100574, + "name": "1.24.1", + "private": false, + "released": 1792622102, + "specs": { + "id": -1, + "minimum": 6144, + "recommended": 8192 + }, + "targets": [ + { + "id": -1, + "name": "minecraft", + "type": "game", + "updated": 0, + "version": "1.21.1" + }, + { + "id": -1, + "name": "neoforge", + "type": "modloader", + "updated": 0, + "version": "21.1.262" + }, + { + "id": -1, + "name": "java", + "type": "runtime", + "updated": 0, + "version": "21.0.4+7-LTS" + } + ], + "type": "release", + "updated": 1792622102 + } + ] +} diff --git a/api/internal/registry/testdata/ftb/pack-4.json b/api/internal/registry/testdata/ftb/pack-4.json new file mode 100644 index 000000000..d63897492 --- /dev/null +++ b/api/internal/registry/testdata/ftb/pack-4.json @@ -0,0 +1,344 @@ +{ + "art": [ + { + "compressed": false, + "height": 512, + "id": -1, + "mirrors": [], + "order": 0, + "sha1": "83368d267dc917283ec207b6bab641c834b467f1", + "title": "Logo", + "type": "square", + "updated": 0, + "url": "https://cdn.feed-the-beast.com/blob/38/386ff1cc602943863eea02d642bb3107c6b4ab0008dc3cf144544165ef52a939.png", + "width": 512 + }, + { + "compressed": false, + "height": 1080, + "id": -1, + "mirrors": [], + "order": 1, + "sha1": "32ec70a0b579137cbab2bd4e5a6202776ff0ed84", + "title": "Background", + "type": "splash", + "updated": 0, + "url": "https://cdn.feed-the-beast.com/blob/a7/a710d45599a32968912b31bcaac91bbca397b926cf8587d614dea4e51bc184f7.png", + "width": 1920 + } + ], + "authors": [ + { + "id": -1, + "name": "FTB Team", + "type": "team", + "updated": 0, + "website": "https://www.feed-the-beast.com/" + } + ], + "featured": false, + "id": 4, + "installs": 485127, + "links": [ + { + "id": -1, + "link": "https://docs.feed-the-beast.com", + "name": "Wiki", + "type": "misc" + }, + { + "id": -1, + "link": "https://github.com/ftbteam/ftb-modpack-issues/issues", + "name": "Issue Tracker", + "type": "misc" + }, + { + "id": -1, + "link": "https://www.youtube.com/watch?v=iGIl76S3fc0", + "name": "ChosenArchitect plays FTB Presents Stoneblock 2", + "type": "video" + } + ], + "meta": { + "curseforgeProjectId": 310396, + "isLegacy": true, + "supportsWorlds": false + }, + "name": "FTB Presents Stoneblock 2", + "notification": "", + "plays": 3158861, + "plays_14d": 3158861, + "private": false, + "provider": "modpacks.ch", + "rating": { + "age": 7, + "alcoholdrugs": false, + "configured": false, + "frightening": true, + "gambling": false, + "id": -1, + "language": false, + "nuditysexual": false, + "sterotypeshate": false, + "verified": false, + "violence": true + }, + "released": 1585735857, + "slug": "ftb-presents-stoneblock-2", + "status": "success", + "synopsis": "The Stoneblock you like, now just even better then before! New mods, new dimensions, and new bosses! ", + "tags": [ + { + "id": 9, + "name": "FTB" + }, + { + "id": 12, + "name": "Magic" + }, + { + "id": 13, + "name": "Tech" + }, + { + "id": 14, + "name": "Questing" + }, + { + "id": 23, + "name": "Exploration" + }, + { + "id": 6, + "name": "1.12.2" + }, + { + "id": 22, + "name": "Large" + }, + { + "id": 102, + "name": "Kitchen Sink" + } + ], + "type": "release", + "updated": 1585735857, + "versions": [ + { + "id": 94, + "name": "1.20.0", + "private": false, + "released": 1596289070, + "specs": { + "id": -1, + "minimum": 4092, + "recommended": 6138 + }, + "targets": [ + { + "id": -1, + "name": "minecraft", + "type": "game", + "updated": 0, + "version": "1.12.2" + }, + { + "id": -1, + "name": "forge", + "type": "modloader", + "updated": 0, + "version": "14.23.5.2847" + }, + { + "id": -1, + "name": "java", + "type": "runtime", + "updated": 0, + "version": "8.0.312+7" + } + ], + "type": "release", + "updated": 1596289070 + }, + { + "id": 141, + "name": "1.21.0", + "private": false, + "released": 1603038076, + "specs": { + "id": -1, + "minimum": 4096, + "recommended": 6122 + }, + "targets": [ + { + "id": -1, + "name": "minecraft", + "type": "game", + "updated": 0, + "version": "1.12.2" + }, + { + "id": -1, + "name": "forge", + "type": "modloader", + "updated": 0, + "version": "14.23.5.2847" + }, + { + "id": -1, + "name": "java", + "type": "runtime", + "updated": 0, + "version": "8.0.312+7" + } + ], + "type": "release", + "updated": 1603038076 + }, + { + "id": 153, + "name": "1.21.1", + "private": false, + "released": 1603548262, + "specs": { + "id": -1, + "minimum": 4096, + "recommended": 6122 + }, + "targets": [ + { + "id": -1, + "name": "minecraft", + "type": "game", + "updated": 0, + "version": "1.12.2" + }, + { + "id": -1, + "name": "forge", + "type": "modloader", + "updated": 0, + "version": "14.23.5.2847" + }, + { + "id": -1, + "name": "java", + "type": "runtime", + "updated": 0, + "version": "8.0.312+7" + } + ], + "type": "release", + "updated": 1603548262 + }, + { + "id": 2115, + "name": "1.22.0", + "private": false, + "released": 1678012813, + "specs": { + "id": -1, + "minimum": 4096, + "recommended": 6144 + }, + "targets": [ + { + "id": -1, + "name": "minecraft", + "type": "game", + "updated": 0, + "version": "1.12.2" + }, + { + "id": -1, + "name": "forge", + "type": "modloader", + "updated": 0, + "version": "14.23.5.2860" + }, + { + "id": -1, + "name": "java", + "type": "runtime", + "updated": 0, + "version": "8.0.312+7" + } + ], + "type": "release", + "updated": 1678012813 + }, + { + "id": 12182, + "name": "1.23.0", + "private": false, + "released": 1719574054, + "specs": { + "id": -1, + "minimum": 4096, + "recommended": 6144 + }, + "targets": [ + { + "id": -1, + "name": "minecraft", + "type": "game", + "updated": 0, + "version": "1.12.2" + }, + { + "id": -1, + "name": "forge", + "type": "modloader", + "updated": 0, + "version": "14.23.5.2860" + }, + { + "id": -1, + "name": "java", + "type": "runtime", + "updated": 0, + "version": "8.0.312+7" + } + ], + "type": "release", + "updated": 1719574054 + }, + { + "id": 100093, + "name": "1.23.1", + "private": false, + "released": 1747911202, + "specs": { + "id": -1, + "minimum": 4096, + "recommended": 6144 + }, + "targets": [ + { + "id": -1, + "name": "minecraft", + "type": "game", + "updated": 0, + "version": "1.12.2" + }, + { + "id": -1, + "name": "forge", + "type": "modloader", + "updated": 0, + "version": "14.23.5.2860" + }, + { + "id": -1, + "name": "java", + "type": "runtime", + "updated": 0, + "version": "8.0.312+7" + } + ], + "type": "release", + "updated": 1747911202 + } + ] +} diff --git a/api/internal/registry/testdata/ftb/search.json b/api/internal/registry/testdata/ftb/search.json new file mode 100644 index 000000000..514a932f5 --- /dev/null +++ b/api/internal/registry/testdata/ftb/search.json @@ -0,0 +1,11 @@ +{ + "count": 3, + "curseforge": [], + "packs": [ + 130, + 100, + 4 + ], + "status": "success", + "updated": 1795124357 +} diff --git a/api/internal/registry/testdata/ftb/version-100-100359.json b/api/internal/registry/testdata/ftb/version-100-100359.json new file mode 100644 index 000000000..d4dcff0f6 --- /dev/null +++ b/api/internal/registry/testdata/ftb/version-100-100359.json @@ -0,0 +1,113 @@ +{ + "files": [ + { + "clientonly": false, + "hashes": { + "cfMurmur": 171778091, + "murmur": 3861719366, + "sha1": "4110547c387c96f481e3d2dd840ec51917952534", + "sha256": "50f8a5bee199a9f544ad1c87441e424ad768195b3fa95eb1d8372de18c7da346", + "sha512": "c59c916a4e1204eef90e8e5b609ea4e01ea11d91fe32ab97de4c6c19894eb1590859fd40a86336444799877d78511ae49ae4c8b4b3190f4f04db98837be5a91e" + }, + "id": 4254609718, + "mirrors": [], + "name": "EnderStorage.cfg", + "optional": false, + "path": "./config", + "serveronly": false, + "sha1": "4110547c387c96f481e3d2dd840ec51917952534", + "size": 522, + "tags": [], + "type": "config", + "updated": 1781197685, + "url": "https://files.feed-the-beast.com/blob/b5/b531647b7f129799124b4594fffb05567cfde3ad884e3309557d45555a218e61.cfg", + "version": "0" + }, + { + "clientonly": false, + "hashes": { + "cfMurmur": 3995973784, + "murmur": 2132616502, + "sha1": "f3339fdddcd8ff831ba7c5b3d9a4f87d68eb3ea8", + "sha256": "a9c6ee5c60e634126d5b5b462f088a943beb73f6a0afc62570c59499b98a9a0f", + "sha512": "9f67d5090bc78e08058183098c5051bc188f51b20963acf4602eab327764be3eaad87c81ef597e4e7a7850af10f987674ccea5a2e68a7548d4e9c917e774b588" + }, + "id": 4254609717, + "mirrors": [], + "name": "cofh_core-common.toml", + "optional": false, + "path": "./config", + "serveronly": false, + "sha1": "f3339fdddcd8ff831ba7c5b3d9a4f87d68eb3ea8", + "size": 637, + "tags": [], + "type": "config", + "updated": 1781197685, + "url": "https://files.feed-the-beast.com/blob/83/8378511327c6f44df73ede6e44c0a40ee35acf638090434e0b72145bda66a02f.toml", + "version": "0" + }, + { + "clientonly": false, + "hashes": { + "cfMurmur": 3255768285, + "murmur": 1609467815, + "sha1": "826d09f65c5bfd3071b10119bc4a5e78198de523", + "sha256": "0a70d58a4a562c2aa2945a3883d35fa3a8e90d80eab9d6b2db3be6103f71b9b2", + "sha512": "73cc14e116e5c0bda101a3c5f98e1ff38fe5faa1ef6be3770727e285b6141eb2a118e0add3ec3b05fe5474d9df0aa6884eadd56fcfa0aedbf2801750e8668c26" + }, + "id": 4254609716, + "mirrors": [], + "name": "flywheel-client.toml", + "optional": false, + "path": "./config", + "serveronly": false, + "sha1": "826d09f65c5bfd3071b10119bc4a5e78198de523", + "size": 266, + "tags": [], + "type": "config", + "updated": 1781197685, + "url": "https://files.feed-the-beast.com/blob/a9/a9aae7a561bd18c894283b283b930bdc510b9b8f85a2d25a7e82f4de990bdd6b.toml", + "version": "0" + } + ], + "id": 100359, + "installs": 9643, + "links": [], + "name": "1.11.6", + "notification": "", + "parent": 100, + "plays": 51328, + "private": false, + "refreshed": 0, + "specs": { + "id": 0, + "minimum": 4096, + "recommended": 6144 + }, + "status": "success", + "targets": [ + { + "id": -1, + "name": "minecraft", + "type": "game", + "updated": 0, + "version": "1.18.2" + }, + { + "id": -1, + "name": "forge", + "type": "modloader", + "updated": 0, + "version": "40.2.34" + }, + { + "id": -1, + "name": "java", + "type": "runtime", + "updated": 0, + "version": "17.0.2+8" + } + ], + "type": "release", + "updated": 1781198103 +} diff --git a/api/internal/registry/testdata/ftb/version-130-100574.json b/api/internal/registry/testdata/ftb/version-130-100574.json new file mode 100644 index 000000000..aead52a4f --- /dev/null +++ b/api/internal/registry/testdata/ftb/version-130-100574.json @@ -0,0 +1,113 @@ +{ + "files": [ + { + "clientonly": false, + "hashes": { + "cfMurmur": 171778091, + "murmur": 3861719366, + "sha1": "4110547c387c96f481e3d2dd840ec51917952534", + "sha256": "50f8a5bee199a9f544ad1c87441e424ad768195b3fa95eb1d8372de18c7da346", + "sha512": "c59c916a4e1204eef90e8e5b609ea4e01ea11d91fe32ab97de4c6c19894eb1590859fd40a86336444799877d78511ae49ae4c8b4b3190f4f04db98837be5a91e" + }, + "id": 3362178186, + "mirrors": [], + "name": "EnderStorage.cfg", + "optional": false, + "path": "./config", + "serveronly": false, + "sha1": "4110547c387c96f481e3d2dd840ec51917952534", + "size": 522, + "tags": [], + "type": "config", + "updated": 1792621714, + "url": "https://files.feed-the-beast.com/blob/b5/b531647b7f129799124b4594fffb05567cfde3ad884e3309557d45555a218e61.cfg", + "version": "0" + }, + { + "clientonly": false, + "hashes": { + "cfMurmur": 939992675, + "murmur": 3825858197, + "sha1": "0cfa7903413dfaec4cf49d03bfd0c9a4aef9653f", + "sha256": "60a758a55730a593a2e225989ab1123845bdccea73a7528c2ae3f445a9758e0e", + "sha512": "f253e1c02f5c40fd95f8a8df614ad25f1cd79e1d823c03e53d2ba1f4c5278183185ba88f9bfddbc3c4de700bba95da1aaefb01554d7643d11a662109139aeb31" + }, + "id": 3362178185, + "mirrors": [], + "name": "framedblocks-server.toml", + "optional": false, + "path": "./config", + "serveronly": false, + "sha1": "0cfa7903413dfaec4cf49d03bfd0c9a4aef9653f", + "size": 1232, + "tags": [], + "type": "config", + "updated": 1792621714, + "url": "https://files.feed-the-beast.com/blob/80/8025ca3a5cb60dbe1ad47bc05a28f0e7272b07b29747e65a8cfee2ff158e2a26.toml", + "version": "0" + }, + { + "clientonly": false, + "hashes": { + "cfMurmur": 182781453, + "murmur": 4002806722, + "sha1": "85692f6218cff312fc88ec3abf8bb0bedaa77ed8", + "sha256": "1c75d9e9980f590c76c5367661ab40ac66ecebf5b5dde166964a16b99a6c63c3", + "sha512": "312af19e233f6a42cd23b6b724536f84a2e6b1525ac06fe95fa373bac2ffe6804253504108db097d07f8c2e269e68910341fc5cbc5a8422d8ff107bb66f6b96a" + }, + "id": 3362178236, + "mirrors": [], + "name": "rftoolsutility-client.toml", + "optional": false, + "path": "./config", + "serveronly": false, + "sha1": "85692f6218cff312fc88ec3abf8bb0bedaa77ed8", + "size": 518, + "tags": [], + "type": "config", + "updated": 1792621714, + "url": "https://files.feed-the-beast.com/blob/e0/e0bccc939fb8635a7b93a8a804fbf8ae154b7c16329807775c8e3a1004067b1e.toml", + "version": "0" + } + ], + "id": 100574, + "installs": 50957, + "links": [], + "name": "1.24.1", + "notification": "", + "parent": 130, + "plays": 261778, + "private": false, + "refreshed": 0, + "specs": { + "id": 0, + "minimum": 6144, + "recommended": 8192 + }, + "status": "success", + "targets": [ + { + "id": -1, + "name": "minecraft", + "type": "game", + "updated": 0, + "version": "1.21.1" + }, + { + "id": -1, + "name": "neoforge", + "type": "modloader", + "updated": 0, + "version": "21.1.262" + }, + { + "id": -1, + "name": "java", + "type": "runtime", + "updated": 0, + "version": "21.0.4+7-LTS" + } + ], + "type": "release", + "updated": 1792622102 +} diff --git a/api/internal/ws/agent_client.go b/api/internal/ws/agent_client.go index 2c00239c6..d3d425d27 100644 --- a/api/internal/ws/agent_client.go +++ b/api/internal/ws/agent_client.go @@ -7,6 +7,7 @@ import ( "fmt" "io" "net/http" + "net/url" "strings" "time" @@ -68,58 +69,99 @@ func (c *AgentClient) GetJSON(ctx context.Context, name, namespace, path string, // GetJSONForCluster resolves the same registered cluster as its caller's resource // lookup. The remote transport binds the operation to the live server UID. func (c *AgentClient) GetJSONForCluster(ctx context.Context, cluster, name, namespace, path string, out any) error { + resp, cancel, err := c.get(ctx, cluster, name, namespace, path, "", "application/json") + if err != nil { + return err + } + defer cancel() + defer func() { _ = resp.Body.Close() }() + if resp.StatusCode != http.StatusOK { + return fmt.Errorf("agent GET %s: status %d", path, resp.StatusCode) + } + if err := json.NewDecoder(io.LimitReader(resp.Body, agentRespCap)).Decode(out); err != nil { + return fmt.Errorf("agent GET %s: decode: %w", path, err) + } + return nil +} + +// ErrAgentFileNotFound is returned by ReadFileForCluster when the agent +// answers 404 for the requested path. +var ErrAgentFileNotFound = errors.New("agent file not found") + +// ReadFileForCluster reads one small file below the server's data mount +// through the agent's /files/read. At most limit bytes are returned (a longer +// file is cut, not an error). A missing file is ErrAgentFileNotFound; any other +// failure (no pod, agent unreachable, 4xx/5xx) is a wrapped error. +func (c *AgentClient) ReadFileForCluster(ctx context.Context, cluster, name, namespace, path string, limit int64) ([]byte, error) { + query := url.Values{"path": {path}}.Encode() + resp, cancel, err := c.get(ctx, cluster, name, namespace, "/files/read", query, "*/*") + if err != nil { + return nil, err + } + defer cancel() + defer func() { _ = resp.Body.Close() }() + switch resp.StatusCode { + case http.StatusOK: + case http.StatusNotFound: + return nil, ErrAgentFileNotFound + default: + return nil, fmt.Errorf("agent GET /files/read: status %d", resp.StatusCode) + } + data, err := io.ReadAll(io.LimitReader(resp.Body, limit)) + if err != nil { + return nil, fmt.Errorf("agent GET /files/read: read: %w", err) + } + return data, nil +} + +// get resolves the target and transport (the former body of GetJSONForCluster, +// unchanged) and performs one GET. The caller must call the returned cancel +// after it has finished with the response body. +func (c *AgentClient) get(ctx context.Context, cluster, name, namespace, path, rawQuery, accept string) (*http.Response, context.CancelFunc, error) { target := agentTarget{name: name, namespace: namespace} if err := target.validate(); err != nil { - return err + return nil, nil, err } transport := c.transport cluster = strings.TrimSpace(cluster) if cluster != "" && cluster != scope.DefaultCluster { if c.gateway == nil || c.gateway.registry == nil { - return errGatewayUnavailable + return nil, nil, errGatewayUnavailable } var err error _, transport, err = c.gateway.resolve(ctx, cluster, target) if err != nil { - return err + return nil, nil, err } } else if c.gateway != nil && c.gateway.registry != nil { var err error target, err = localAgentTarget(ctx, c.gateway.registry.Default(), target) if err != nil { - return err + return nil, nil, err } } else if bound, ok := rbac.BoundServerIdentity(ctx); ok { // Legacy clients lack a registry, but can still enforce the exact // ownership grant at the receiving agent's UID route. if err := rbac.ValidateServerIdentity(ctx, scope.DefaultCluster, namespace, name, bound.UID); err != nil { - return err + return nil, nil, err } target.uid = bound.UID } if transport == nil { - return errors.New("agent mTLS not configured") + return nil, nil, errors.New("agent mTLS not configured") } // Match the historical bound on internal one-shot reads for gateways too. ctx, cancel := context.WithTimeout(ctx, 15*time.Second) - defer cancel() - resp, err := transport.Do(ctx, agentRequest{ target: target, - method: http.MethodGet, path: path, - header: http.Header{"Accept": {"application/json"}}, + method: http.MethodGet, path: path, rawQuery: rawQuery, + header: http.Header{"Accept": {accept}}, }) if err != nil { - return fmt.Errorf("agent GET %s: %w", path, err) - } - defer func() { _ = resp.Body.Close() }() - if resp.StatusCode != http.StatusOK { - return fmt.Errorf("agent GET %s: status %d", path, resp.StatusCode) + cancel() + return nil, nil, fmt.Errorf("agent GET %s: %w", path, err) } - if err := json.NewDecoder(io.LimitReader(resp.Body, agentRespCap)).Decode(out); err != nil { - return fmt.Errorf("agent GET %s: decode: %w", path, err) - } - return nil + return resp, cancel, nil } // agentHostFor is the in-cluster DNS + port of a server's agent sidecar — diff --git a/api/specs.md b/api/specs.md index a86ea2790..09d75685f 100644 --- a/api/specs.md +++ b/api/specs.md @@ -169,7 +169,9 @@ The HTTP server listens on `:8000` (configurable) with these route groups. Prome - `/modules/catalog` — GET: merged catalog across sources, with installation state - `/modules/{name}/locales/{tag}` — GET: the module's translated messages for a language as a flat id → message map, read from the operator-written `-locales` ConfigMap. The tag falls back to its base language; an unknown or malformed tag, or a module without translations, returns `200 {}`; values are the validated ICU message strings, uncompiled. 404 only when the Module does not exist. Requires `modules:read`. - `/modules/builder/{archetypes,scaffold,validate,preview,export}` — module builder workflow -- `/servers/{name}/mods/registry/providers`, `/servers/{name}/mods/registry/search`, `/servers/{name}/mods/registry/projects/{project}/versions`, `/servers/{name}/mods/registry/projects/{project}/modpack` (GET), `POST /servers/{name}/modpack` — live mod registry queries (CurseForge, Modrinth, Spigot, etc.) +- `/servers/{name}/mods/registry/providers`, `/servers/{name}/mods/registry/search`, `/servers/{name}/mods/registry/projects/{project}/versions` (`?type=modpack` returns pack versions for the server's Minecraft version and loader, newest first), `/servers/{name}/mods/registry/projects/{project}/modpack` (GET, deps-mode packs) — live mod registry queries (CurseForge, Modrinth, FTB, Spigot, etc.) +- `/servers/{name}/modpack` — GET: active pack, phase, backup, missing manual-download files; POST: install or change version (202, writes `spec.modpack` only); DELETE `?backupFirst=`: remove the pack (202, deletes `spec.modpack`, sets `gameplane.local/modpack-remove`). See [Modpacks (spec 035)](#modpacks-spec-035) +- `/admin/registries/curseforge/share` — GET/PUT: admin toggle for sharing the managed CurseForge key with game servers (`config:manage`) - `/servers/{name}/mods/updates` — GET: available updates for a mod - `/servers/{name}/mods/ids` — GET, PUT: ID-managed mods (ARK CurseForge IDs, Project Zomboid MOD_IDs, Steam Workshop lists) - `/cluster`, `/cluster/info`, `/cluster/stats` — GET: selected-cluster version, nodes, storage and optional usage. Require cluster-wide `cluster:read` on the selected cluster (or wildcard cluster); namespace grants cannot read node inventory. Remote requests use only that registry client's nodes, PVs, metrics and version, never home-cluster inventory. A registered cluster whose client is unavailable returns 503; an authorized unknown selector returns 400. Kubernetes denials retain their status with generic messages. Metrics-server absence remains optional and omits usage rather than reporting zero. Remote info returns the registration ID as its name, `clusterOps: false`, no local update channel, and the central API's `gameplaneVersion`. Node pod counts are populated from a cluster-wide Pending+Running pod list (paginated in 500-pod chunks with server-side terminal-pod filtering); counts are omitted entirely (not zero) when the list fails. Per-cluster counts are cached for ~15 seconds. diff --git a/assets/design-export/fig/1274632774-1258.fig b/assets/design-export/fig/1274632774-1258.fig new file mode 100644 index 000000000..02579ebf4 Binary files /dev/null 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 new file mode 100644 index 000000000..28d7dff9e Binary files /dev/null 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 new file mode 100644 index 000000000..b4e5760a2 Binary files /dev/null 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 new file mode 100644 index 000000000..adf6f5044 Binary files /dev/null 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 new file mode 100644 index 000000000..39c44732f Binary files /dev/null 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 new file mode 100644 index 000000000..feb8162ea Binary files /dev/null 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 new file mode 100644 index 000000000..4aa79e24c Binary files /dev/null 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 new file mode 100644 index 000000000..13c9662b6 Binary files /dev/null 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 new file mode 100644 index 000000000..b67042230 Binary files /dev/null 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 new file mode 100644 index 000000000..ad243cfae Binary files /dev/null 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 new file mode 100644 index 000000000..14915bae9 Binary files /dev/null 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 new file mode 100644 index 000000000..c27ce59a7 Binary files /dev/null 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 new file mode 100644 index 000000000..ac56d527a Binary files /dev/null and b/assets/design-export/fig/1274632774-907.fig differ diff --git a/assets/design-export/fig/9dBXM.fig b/assets/design-export/fig/9dBXM.fig index 791cccd5f..214265804 100644 Binary files a/assets/design-export/fig/9dBXM.fig and b/assets/design-export/fig/9dBXM.fig differ diff --git a/assets/design-export/fig/A8vGwM.fig b/assets/design-export/fig/A8vGwM.fig index d16fb51eb..7966408c2 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 4e197cc3e..1bbfa3de4 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/BV5ei.fig b/assets/design-export/fig/BV5ei.fig index e7b8fafe4..415edc1c5 100644 Binary files a/assets/design-export/fig/BV5ei.fig and b/assets/design-export/fig/BV5ei.fig differ diff --git a/assets/design-export/fig/Bbnga.fig b/assets/design-export/fig/Bbnga.fig index 55fa18cc5..3d0802a2e 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 eb49d2ddc..253eefa6c 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 cc8cdaa9b..2499f92af 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 6383c515a..dde3a5db3 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 7292d0b03..369f71279 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/Burtr.fig b/assets/design-export/fig/Burtr.fig index de74bc7ae..d9bb9ad56 100644 Binary files a/assets/design-export/fig/Burtr.fig and b/assets/design-export/fig/Burtr.fig differ diff --git a/assets/design-export/fig/C2LQE4.fig b/assets/design-export/fig/C2LQE4.fig index 2fa967eed..aab7821c3 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 c412f2c2c..3243b3da2 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 29dc74294..95b3e466c 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 dd83d1a14..cb765eb32 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/CqaSq.fig b/assets/design-export/fig/CqaSq.fig index 266c468ad..d6487ec6f 100644 Binary files a/assets/design-export/fig/CqaSq.fig and b/assets/design-export/fig/CqaSq.fig differ diff --git a/assets/design-export/fig/D9QYZ.fig b/assets/design-export/fig/D9QYZ.fig index 413d1f10e..2d39eb1e9 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 842844c69..a7d5d9d3e 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 e7c3bc568..c2d3a7dbb 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/DPrYX.fig b/assets/design-export/fig/DPrYX.fig index 4bdee73ed..29f8f37c0 100644 Binary files a/assets/design-export/fig/DPrYX.fig and b/assets/design-export/fig/DPrYX.fig differ diff --git a/assets/design-export/fig/DWztv.fig b/assets/design-export/fig/DWztv.fig index 638f98680..10cec4522 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 1330dc5f0..0e0cc2d7d 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 9c30eac71..d79f84d91 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/E0ypH.fig b/assets/design-export/fig/E0ypH.fig index 9b282fb2d..9ffcc44ec 100644 Binary files a/assets/design-export/fig/E0ypH.fig and b/assets/design-export/fig/E0ypH.fig differ diff --git a/assets/design-export/fig/E9EEv0.fig b/assets/design-export/fig/E9EEv0.fig index 66a512ec3..b5cf237e0 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 1ea977359..e53755857 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 88ff7e1d5..43abfe4ca 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/EZFW0.fig b/assets/design-export/fig/EZFW0.fig index 13f0d7c5d..910c646c0 100644 Binary files a/assets/design-export/fig/EZFW0.fig and b/assets/design-export/fig/EZFW0.fig differ diff --git a/assets/design-export/fig/EcoGD.fig b/assets/design-export/fig/EcoGD.fig index 6d65866f0..2b12ef38d 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 1a6842c76..cfc913c4e 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 d53289cf6..b47a59f6d 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 29d6f04cb..873d43939 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/FtdkI.fig b/assets/design-export/fig/FtdkI.fig index 20b793704..e93dd1c07 100644 Binary files a/assets/design-export/fig/FtdkI.fig and b/assets/design-export/fig/FtdkI.fig differ diff --git a/assets/design-export/fig/GR1G9.fig b/assets/design-export/fig/GR1G9.fig index b0ab50d72..c04cbb44d 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/GayoL.fig b/assets/design-export/fig/GayoL.fig index 505c28501..585fd145d 100644 Binary files a/assets/design-export/fig/GayoL.fig and b/assets/design-export/fig/GayoL.fig differ diff --git a/assets/design-export/fig/GsofJ.fig b/assets/design-export/fig/GsofJ.fig index 2802ab216..0a75848c8 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 9d8900f61..8075e243a 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 535e4aa57..808a4279b 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 9a9936017..74a7b88d3 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 75526c8f6..d50f8fe81 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 7943ba893..54d06ac15 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 b4026dd4c..799cf2120 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 eb967ba70..8a7dc9250 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/J5pjJ3.fig b/assets/design-export/fig/J5pjJ3.fig index 06aa20ee6..1caa959bb 100644 Binary files a/assets/design-export/fig/J5pjJ3.fig and b/assets/design-export/fig/J5pjJ3.fig differ diff --git a/assets/design-export/fig/J8GzM9.fig b/assets/design-export/fig/J8GzM9.fig index 6e91396c0..017e30a45 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 a3b41fdd6..548ee1d2b 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 78b0b3007..b319f525f 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/KaRFX.fig b/assets/design-export/fig/KaRFX.fig index 2fd4617bf..9b18808ce 100644 Binary files a/assets/design-export/fig/KaRFX.fig and b/assets/design-export/fig/KaRFX.fig differ diff --git a/assets/design-export/fig/KhYNc.fig b/assets/design-export/fig/KhYNc.fig index c5d61b839..989a591f9 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/Kp48V.fig b/assets/design-export/fig/Kp48V.fig index b2286fc51..0dc0ee57f 100644 Binary files a/assets/design-export/fig/Kp48V.fig and b/assets/design-export/fig/Kp48V.fig differ diff --git a/assets/design-export/fig/LYPXU.fig b/assets/design-export/fig/LYPXU.fig index 7c75926ac..327a701e4 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 61f2f3d46..0c2dec007 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 a24a14ec0..735a5a9dd 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/N1GkB.fig b/assets/design-export/fig/N1GkB.fig index b25f82030..d69c3a4c5 100644 Binary files a/assets/design-export/fig/N1GkB.fig and b/assets/design-export/fig/N1GkB.fig differ diff --git a/assets/design-export/fig/N2nTf.fig b/assets/design-export/fig/N2nTf.fig index 952e22e4c..57419d9d4 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 828b246af..9b93af3df 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 f7809e098..fc286dfe5 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 ad2be56a4..fedee8c76 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 e12922193..095ceb99a 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 919121e6f..b6424e818 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 dd86189a8..629ff34b3 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 4a4bb7f0c..1988a1625 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 f08c11f92..912622b45 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 f14f8932b..b2f974eb0 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/P08Uw.fig b/assets/design-export/fig/P08Uw.fig index 3c7283a7c..cd9dff661 100644 Binary files a/assets/design-export/fig/P08Uw.fig and b/assets/design-export/fig/P08Uw.fig differ diff --git a/assets/design-export/fig/QFEg9.fig b/assets/design-export/fig/QFEg9.fig index d16fbbc85..6a932fa80 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 b2ebf4c43..360abcbc8 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 a64ca3655..69cdef342 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 04c5c3f9c..3f4aecdd7 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/R65Xyx.fig b/assets/design-export/fig/R65Xyx.fig index 04183dd75..378746e68 100644 Binary files a/assets/design-export/fig/R65Xyx.fig and b/assets/design-export/fig/R65Xyx.fig differ diff --git a/assets/design-export/fig/RC3Kf.fig b/assets/design-export/fig/RC3Kf.fig index 87e38da1c..4e564623f 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 95abd4d17..1500c340a 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 e14d377f6..9f9a0cd72 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/RpHBg.fig b/assets/design-export/fig/RpHBg.fig index b73e32d2e..b25920713 100644 Binary files a/assets/design-export/fig/RpHBg.fig and b/assets/design-export/fig/RpHBg.fig differ diff --git a/assets/design-export/fig/Rwnu3.fig b/assets/design-export/fig/Rwnu3.fig index db5a32ceb..d898999ff 100644 Binary files a/assets/design-export/fig/Rwnu3.fig and b/assets/design-export/fig/Rwnu3.fig differ diff --git a/assets/design-export/fig/S7SCDc.fig b/assets/design-export/fig/S7SCDc.fig index 5efdd776c..7d528d728 100644 Binary files a/assets/design-export/fig/S7SCDc.fig and b/assets/design-export/fig/S7SCDc.fig differ diff --git a/assets/design-export/fig/SUcad.fig b/assets/design-export/fig/SUcad.fig index 40344f29b..a432f0e5a 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 f5a7f68e0..7a807800f 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 1672d2252..c0ebd2cf2 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/Ss0Yr.fig b/assets/design-export/fig/Ss0Yr.fig index 3fcc4a0e2..3406faa4d 100644 Binary files a/assets/design-export/fig/Ss0Yr.fig and b/assets/design-export/fig/Ss0Yr.fig differ diff --git a/assets/design-export/fig/T1wkiT.fig b/assets/design-export/fig/T1wkiT.fig index 8a9c4f515..d984d02f0 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 4d50e7416..a556c8670 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 a2ad464e8..8db931537 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 587e89c49..66c48530a 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 512821d46..11c125f5d 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 55ba917a7..b7aa70eee 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/UMJli.fig b/assets/design-export/fig/UMJli.fig index e553f4611..5e84652f9 100644 Binary files a/assets/design-export/fig/UMJli.fig and b/assets/design-export/fig/UMJli.fig differ diff --git a/assets/design-export/fig/UdnBT.fig b/assets/design-export/fig/UdnBT.fig index f9d52cd0b..5bf1e84b6 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 267b2a964..b9d467665 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/V1VhGE.fig b/assets/design-export/fig/V1VhGE.fig index a89838c4c..b55c681c5 100644 Binary files a/assets/design-export/fig/V1VhGE.fig and b/assets/design-export/fig/V1VhGE.fig differ diff --git a/assets/design-export/fig/VM7ro.fig b/assets/design-export/fig/VM7ro.fig index 74f11a482..57ca21bcf 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 6ae2eb4f7..2621e858e 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/VfB0Y.fig b/assets/design-export/fig/VfB0Y.fig index f24ca56d4..74cae81ce 100644 Binary files a/assets/design-export/fig/VfB0Y.fig and b/assets/design-export/fig/VfB0Y.fig differ diff --git a/assets/design-export/fig/W8idqY.fig b/assets/design-export/fig/W8idqY.fig index bbb9a4238..56e1f055d 100644 Binary files a/assets/design-export/fig/W8idqY.fig and b/assets/design-export/fig/W8idqY.fig differ diff --git a/assets/design-export/fig/WZdnw.fig b/assets/design-export/fig/WZdnw.fig index f09f449da..09170665c 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 e33049c9b..c8777ffee 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 81981c29d..a14990c81 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 ae6b6c870..ba3a02b32 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/XL5ZU.fig b/assets/design-export/fig/XL5ZU.fig index 7c654df65..427b7dddd 100644 Binary files a/assets/design-export/fig/XL5ZU.fig and b/assets/design-export/fig/XL5ZU.fig differ diff --git a/assets/design-export/fig/XR0f9.fig b/assets/design-export/fig/XR0f9.fig index 36f040e82..91e94dfa6 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/Xn5ns.fig b/assets/design-export/fig/Xn5ns.fig index e4432b97a..c48b1660a 100644 Binary files a/assets/design-export/fig/Xn5ns.fig and b/assets/design-export/fig/Xn5ns.fig differ diff --git a/assets/design-export/fig/Y5cmvI.fig b/assets/design-export/fig/Y5cmvI.fig index f8514b99e..3ceb7a945 100644 Binary files a/assets/design-export/fig/Y5cmvI.fig and b/assets/design-export/fig/Y5cmvI.fig differ diff --git a/assets/design-export/fig/YN8cE.fig b/assets/design-export/fig/YN8cE.fig index fbc35a045..ab25bce51 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 eb16b9179..cd43081a2 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 5c8dff22d..44a0d3a91 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 29d62ce6c..8fc414f7b 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 bf6b8faa6..3d4e3973d 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 d1d011fb3..d524fc0e2 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 608c20718..4ac88c7da 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 b5b199baa..004d6b4e2 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 c8209bacd..4210886b6 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 a2ccdf12c..2e476491a 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 c4ed1a62d..1d906ab46 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/bHJy6.fig b/assets/design-export/fig/bHJy6.fig index 895bc6c86..8569148c0 100644 Binary files a/assets/design-export/fig/bHJy6.fig and b/assets/design-export/fig/bHJy6.fig differ diff --git a/assets/design-export/fig/bYDHC.fig b/assets/design-export/fig/bYDHC.fig index e5b3fec49..cc94cb676 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 2a7fea606..c9d1b6eec 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 a6e9f12f1..ccb3cee47 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/dPP50.fig b/assets/design-export/fig/dPP50.fig index 805525d7b..663490f59 100644 Binary files a/assets/design-export/fig/dPP50.fig and b/assets/design-export/fig/dPP50.fig differ diff --git a/assets/design-export/fig/dQV9N.fig b/assets/design-export/fig/dQV9N.fig index 75c0384aa..44ac5f70d 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 1649e1c16..111e91dd0 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 f908ea119..658c842c2 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 d0e339496..2589a50b0 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 0bd45811e..5ef6bddda 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 6b5319826..84be04f03 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 7d94c09e6..294373bf7 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/f1Vga.fig b/assets/design-export/fig/f1Vga.fig index 224b6ba39..a992f9d58 100644 Binary files a/assets/design-export/fig/f1Vga.fig and b/assets/design-export/fig/f1Vga.fig differ diff --git a/assets/design-export/fig/fK8Bi.fig b/assets/design-export/fig/fK8Bi.fig index bfb4112b7..04b1f79f7 100644 Binary files a/assets/design-export/fig/fK8Bi.fig and b/assets/design-export/fig/fK8Bi.fig differ diff --git a/assets/design-export/fig/fbBqA.fig b/assets/design-export/fig/fbBqA.fig index c53447c1c..1e1fe178e 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 1377457b5..f639ed553 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 1d6a7fea6..6f2016b01 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 bb488d729..7f44051af 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/hLB9Z.fig b/assets/design-export/fig/hLB9Z.fig index 9c1ef3f31..5a2762667 100644 Binary files a/assets/design-export/fig/hLB9Z.fig and b/assets/design-export/fig/hLB9Z.fig differ diff --git a/assets/design-export/fig/hlwx3.fig b/assets/design-export/fig/hlwx3.fig index ed63ed88f..cfc5e6033 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 5aadceff4..437d19a6a 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/i1bLR.fig b/assets/design-export/fig/i1bLR.fig index 86d924f7d..6bdd69655 100644 Binary files a/assets/design-export/fig/i1bLR.fig and b/assets/design-export/fig/i1bLR.fig differ diff --git a/assets/design-export/fig/i4L0M.fig b/assets/design-export/fig/i4L0M.fig index 33cf52891..aa8b8c0d0 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/i8wib.fig b/assets/design-export/fig/i8wib.fig index b69ff1398..a95e6fe06 100644 Binary files a/assets/design-export/fig/i8wib.fig and b/assets/design-export/fig/i8wib.fig differ diff --git a/assets/design-export/fig/iLm38.fig b/assets/design-export/fig/iLm38.fig index 7265010c9..e08f3aa7f 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/iSA6R.fig b/assets/design-export/fig/iSA6R.fig index 0932cdda2..fc34a971d 100644 Binary files a/assets/design-export/fig/iSA6R.fig and b/assets/design-export/fig/iSA6R.fig differ diff --git a/assets/design-export/fig/iYUWc.fig b/assets/design-export/fig/iYUWc.fig index 20d1b5fd2..5eb634e3c 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/j24cXg.fig b/assets/design-export/fig/j24cXg.fig index e6b809ab8..49c3cc648 100644 Binary files a/assets/design-export/fig/j24cXg.fig and b/assets/design-export/fig/j24cXg.fig differ diff --git a/assets/design-export/fig/j88bl0.fig b/assets/design-export/fig/j88bl0.fig index f6859c6d8..942e4485a 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/j9W8A.fig b/assets/design-export/fig/j9W8A.fig index f866b8062..c97f854e5 100644 Binary files a/assets/design-export/fig/j9W8A.fig and b/assets/design-export/fig/j9W8A.fig differ diff --git a/assets/design-export/fig/jXykV.fig b/assets/design-export/fig/jXykV.fig index 1c300dce4..a1d5c247f 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/jmoi3.fig b/assets/design-export/fig/jmoi3.fig index f137096f9..2b25399a3 100644 Binary files a/assets/design-export/fig/jmoi3.fig and b/assets/design-export/fig/jmoi3.fig differ diff --git a/assets/design-export/fig/kK8Ji.fig b/assets/design-export/fig/kK8Ji.fig index 515c33593..404d6e1eb 100644 Binary files a/assets/design-export/fig/kK8Ji.fig and b/assets/design-export/fig/kK8Ji.fig differ diff --git a/assets/design-export/fig/kPmoo.fig b/assets/design-export/fig/kPmoo.fig index e8f15b9d1..7cf88fca0 100644 Binary files a/assets/design-export/fig/kPmoo.fig and b/assets/design-export/fig/kPmoo.fig differ diff --git a/assets/design-export/fig/l64bd.fig b/assets/design-export/fig/l64bd.fig index ad7f075ca..5b1e4dc84 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 e01e939d3..dd8a68659 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 30eb3861a..138f21de1 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 84f4b6116..9e4a185fa 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 81a22164f..cbf31aa44 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/ljdA5.fig b/assets/design-export/fig/ljdA5.fig index e72c9bd0e..56fcf80be 100644 Binary files a/assets/design-export/fig/ljdA5.fig and b/assets/design-export/fig/ljdA5.fig differ diff --git a/assets/design-export/fig/m1hP1j.fig b/assets/design-export/fig/m1hP1j.fig index 3f6e3d34b..2e36fdc2c 100644 Binary files a/assets/design-export/fig/m1hP1j.fig and b/assets/design-export/fig/m1hP1j.fig differ diff --git a/assets/design-export/fig/m5kOm4.fig b/assets/design-export/fig/m5kOm4.fig index f6c895e03..b21886f0b 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 f262ed535..2bdbecf6c 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 3437151ca..6b1b9933e 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 35cd1bc62..544e09dd9 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 6314817a8..eeccea340 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 810ccdff0..0b64601c5 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/nNL3E.fig b/assets/design-export/fig/nNL3E.fig index 30fbab78a..90cf1474f 100644 Binary files a/assets/design-export/fig/nNL3E.fig and b/assets/design-export/fig/nNL3E.fig differ diff --git a/assets/design-export/fig/nfMMj.fig b/assets/design-export/fig/nfMMj.fig index e03ab041a..e9d1eb7bb 100644 Binary files a/assets/design-export/fig/nfMMj.fig and b/assets/design-export/fig/nfMMj.fig differ diff --git a/assets/design-export/fig/o1uEP.fig b/assets/design-export/fig/o1uEP.fig index 2a239a667..fb42608a7 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 d9692983a..a073e6234 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 2fcd9d1a3..35296aab7 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 76f3fa369..c3ab3dff8 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 d85391d15..6b92a851b 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 262db5639..704449865 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 0e0f4b98f..2c921b8c8 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/pssCT.fig b/assets/design-export/fig/pssCT.fig index 7af81b836..7aaa938e8 100644 Binary files a/assets/design-export/fig/pssCT.fig and b/assets/design-export/fig/pssCT.fig differ diff --git a/assets/design-export/fig/pszxE.fig b/assets/design-export/fig/pszxE.fig index 449b86eed..f48c9be41 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 c870510b7..cc7ca616b 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 37376bd33..aaa329c43 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 68b51a10b..251676ed3 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 bd9631b72..526d78d1f 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 8fbc1746a..f3353f39f 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 b44559509..e545dc11b 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/sZtDi.fig b/assets/design-export/fig/sZtDi.fig index 3cf002454..98705a983 100644 Binary files a/assets/design-export/fig/sZtDi.fig and b/assets/design-export/fig/sZtDi.fig differ diff --git a/assets/design-export/fig/swxkJ.fig b/assets/design-export/fig/swxkJ.fig index 7c4003db2..109468557 100644 Binary files a/assets/design-export/fig/swxkJ.fig and b/assets/design-export/fig/swxkJ.fig differ diff --git a/assets/design-export/fig/t3IY3u.fig b/assets/design-export/fig/t3IY3u.fig index 2d84879c2..d4c926cf4 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 109a40e94..140701256 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 3ab7d4a5b..6df4f2c84 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/tTSdi.fig b/assets/design-export/fig/tTSdi.fig index 721b182b7..e8bfcec9a 100644 Binary files a/assets/design-export/fig/tTSdi.fig and b/assets/design-export/fig/tTSdi.fig differ diff --git a/assets/design-export/fig/tY6RD.fig b/assets/design-export/fig/tY6RD.fig index f3fc1b5ef..3b53467b6 100644 Binary files a/assets/design-export/fig/tY6RD.fig and b/assets/design-export/fig/tY6RD.fig differ diff --git a/assets/design-export/fig/tooKB.fig b/assets/design-export/fig/tooKB.fig index ea5985208..adad70d09 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 ea82ebb0a..92084481a 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 771fa4e20..8abbd6702 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 5bb78bfc4..161796fc4 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/ugDSa.fig b/assets/design-export/fig/ugDSa.fig index 0816ecf4b..9c05c1c7e 100644 Binary files a/assets/design-export/fig/ugDSa.fig and b/assets/design-export/fig/ugDSa.fig differ diff --git a/assets/design-export/fig/uoxQW.fig b/assets/design-export/fig/uoxQW.fig index a0cd85aec..99c215530 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/uw0dB.fig b/assets/design-export/fig/uw0dB.fig index aae5f386c..589da76a3 100644 Binary files a/assets/design-export/fig/uw0dB.fig and b/assets/design-export/fig/uw0dB.fig differ diff --git a/assets/design-export/fig/vStkb.fig b/assets/design-export/fig/vStkb.fig index 00b7b71a7..b8646d50f 100644 Binary files a/assets/design-export/fig/vStkb.fig and b/assets/design-export/fig/vStkb.fig differ diff --git a/assets/design-export/fig/vUqMl.fig b/assets/design-export/fig/vUqMl.fig index 0c8933f65..d667a1960 100644 Binary files a/assets/design-export/fig/vUqMl.fig and b/assets/design-export/fig/vUqMl.fig differ diff --git a/assets/design-export/fig/vtExV.fig b/assets/design-export/fig/vtExV.fig index 12e764a46..eebf5b45d 100644 Binary files a/assets/design-export/fig/vtExV.fig and b/assets/design-export/fig/vtExV.fig differ diff --git a/assets/design-export/fig/w1QYmf.fig b/assets/design-export/fig/w1QYmf.fig index ec873bdb0..77751c4aa 100644 Binary files a/assets/design-export/fig/w1QYmf.fig and b/assets/design-export/fig/w1QYmf.fig differ diff --git a/assets/design-export/fig/w34N9.fig b/assets/design-export/fig/w34N9.fig index 1f0e69650..f41cf2a99 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 cf9259f9c..07d4fe728 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 572130951..23a9ea794 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 a43f19cea..b7030664b 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 7bb4e79ff..6231f769c 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 ae6682140..dd065ca75 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 41976d90b..abd20badc 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 dad2ef80b..d6be0b378 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 5d8a6778d..51fe2ef24 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/zhLZN.fig b/assets/design-export/fig/zhLZN.fig index 8274c4a7c..c06311c00 100644 Binary files a/assets/design-export/fig/zhLZN.fig and b/assets/design-export/fig/zhLZN.fig differ diff --git a/assets/design-export/fig/zj5a3.fig b/assets/design-export/fig/zj5a3.fig index d76d2a987..d065dadad 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 0ce3a7356..71e180577 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/1274632774-1258.json b/assets/design-export/json/1274632774-1258.json new file mode 100644 index 000000000..672e6f27e --- /dev/null +++ b/assets/design-export/json/1274632774-1258.json @@ -0,0 +1,1857 @@ +{ + "file": "1274632774-1258", + "name": "Screen/Server Detail — Modpacks — Change version", + "type": "FRAME", + "x": 6560, + "y": 32970, + "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" + ] + }, + { + "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", "test-server-02", "Search servers…", "AD"] + }, + { + "name": "Body", + "type": "FRAME", + "x": 0, + "y": 64, + "width": 1180, + "height": 836, + "fills": [{"type": "SOLID", "color": "#121114"}], + "layout": { + "mode": "VERTICAL", + "gap": 16, + "padding": [24, 24, 24, 24], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "FIXED"] + }, + "layoutGrow": 1, + "layoutAlignSelf": "STRETCH", + "variables": {"fills/0/color": "background/background"}, + "children": [ + { + "name": "Detail Header", + "type": "INSTANCE", + "x": 24, + "y": 24, + "width": 1132, + "height": 78, + "component": "Gameplane/Server Detail Header", + "componentId": "1:447", + "fills": [{"type": "SOLID", "color": "#121114"}], + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [8, 0, 16, 0], + "primary": "SPACE_BETWEEN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"fills/0/color": "background/background"}, + "texts": [ + "MI", + "test-server-02", + "Running", + "minecraft-java · fabric 1.21.1 · ns: default · up 13d 4h", + "Restart", + "Stop", + "Open console" + ] + }, + { + "name": "Tabs Bar", + "type": "INSTANCE", + "x": 24, + "y": 118, + "width": 1132, + "height": 40, + "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": [0, 0, 0, 0], + "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" + ] + }, + { + "name": "Active Modpack Card", + "type": "INSTANCE", + "x": 24, + "y": 174, + "width": 1132, + "height": 106, + "component": "Gameplane/Active Modpack Card", + "fills": [{"type": "SOLID", "color": "#1C1A20"}], + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "cornerRadius": 12, + "layout": { + "mode": "VERTICAL", + "gap": 12, + "padding": [16, 16, 16, 16], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"fills/0/color": "surface/surface", "strokes/0/color": "border/border"}, + "texts": [ + "Active modpack", + "Fabulously Optimized", + "Modrinth", + "Applied", + "Version 6.4.0 · pinned · Minecraft 1.21.1 · Fabric", + "Change version", + "Remove" + ] + }, + { + "name": "Modpacks Heading", + "type": "FRAME", + "x": 24, + "y": 296, + "width": 1132, + "height": 34, + "layout": { + "mode": "VERTICAL", + "gap": 2, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "name": "heading", + "type": "TEXT", + "x": 0, + "y": 0, + "width": 119, + "height": 18, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "text": "Browse modpacks", + "font": ["Geist", 400, 14], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "muted"} + }, + { + "name": "subheading", + "type": "TEXT", + "x": 0, + "y": 20, + "width": 1132, + "height": 14, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "layoutAlignSelf": "STRETCH", + "text": "Pick a pack and a version. The server pins that version and restarts to install it; a restart never upgrades it.", + "font": ["Geist", 400, 11], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "muted"} + } + ] + }, + { + "name": "Filters Row", + "type": "FRAME", + "x": 24, + "y": 346, + "width": 1132, + "height": 40, + "layout": { + "mode": "HORIZONTAL", + "gap": 8, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "name": "Provider Switch", + "type": "INSTANCE", + "x": 0, + "y": 0, + "width": 266, + "height": 40, + "component": "Gameplane/Provider Switch", + "fills": [{"type": "SOLID", "color": "#232128"}], + "cornerRadius": 20, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [4, 4, 4, 4], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "HUG"] + }, + "variables": {"fills/0/color": "default/default"}, + "texts": ["Modrinth", "CurseForge", "FTB"] + }, + { + "name": "Search", + "type": "INSTANCE", + "x": 274, + "y": 2, + "width": 630, + "height": 36, + "component": "Gameplane/Search Input", + "componentId": "1:975", + "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": 6, + "padding": [0, 12, 0, 12], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "FIXED"] + }, + "layoutGrow": 1, + "variables": { + "cornerRadius": "radius/xl", + "fills/0/color": "field/background", + "strokes/0/color": "field/border" + }, + "texts": ["Search modpacks…"] + }, + { + "name": "Select", + "type": "INSTANCE", + "x": 912, + "y": 2, + "width": 220, + "height": 36, + "component": "Gameplane/Select", + "componentId": "1:311", + "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": "SPACE_BETWEEN", + "counter": "CENTER", + "sizing": ["FIXED", "FIXED"] + }, + "variables": { + "cornerRadius": "radius/xl", + "fills/0/color": "field/background", + "strokes/0/color": "field/border" + }, + "texts": ["Sort: Downloads"] + } + ] + }, + { + "name": "Category Chips", + "type": "FRAME", + "x": 24, + "y": 402, + "width": 1132, + "height": 24, + "layout": { + "mode": "HORIZONTAL", + "gap": 6, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "name": "chipAll", + "type": "INSTANCE", + "x": 0, + "y": 3.5, + "width": 22, + "height": 17, + "component": "Chip/Primary/Accent/SM", + "componentId": "1:981", + "fills": [{"type": "SOLID", "color": "#FF4FA3"}], + "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": "accent/accent"}, + "texts": ["All"] + }, + { + "name": "chipAdventure", + "type": "INSTANCE", + "x": 28, + "y": 0, + "width": 77, + "height": 24, + "component": "Gameplane/Tag", + "componentId": "1:1142", + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "cornerRadius": 999, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [4, 10, 4, 10], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "HUG"] + }, + "variables": {"strokes/0/color": "border/border"}, + "texts": ["Adventure"] + }, + { + "name": "chipTech", + "type": "INSTANCE", + "x": 111, + "y": 0, + "width": 46, + "height": 24, + "component": "Gameplane/Tag", + "componentId": "1:1142", + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "cornerRadius": 999, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [4, 10, 4, 10], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "HUG"] + }, + "variables": {"strokes/0/color": "border/border"}, + "texts": ["Tech"] + }, + { + "name": "chipMagic", + "type": "INSTANCE", + "x": 163, + "y": 0, + "width": 54, + "height": 24, + "component": "Gameplane/Tag", + "componentId": "1:1142", + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "cornerRadius": 999, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [4, 10, 4, 10], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "HUG"] + }, + "variables": {"strokes/0/color": "border/border"}, + "texts": ["Magic"] + }, + { + "name": "chipOptimized", + "type": "INSTANCE", + "x": 223, + "y": 0, + "width": 77, + "height": 24, + "component": "Gameplane/Tag", + "componentId": "1:1142", + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "cornerRadius": 999, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [4, 10, 4, 10], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "HUG"] + }, + "variables": {"strokes/0/color": "border/border"}, + "texts": ["Optimized"] + }, + { + "name": "chipMultiplayer", + "type": "INSTANCE", + "x": 306, + "y": 0, + "width": 82, + "height": 24, + "component": "Gameplane/Tag", + "componentId": "1:1142", + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "cornerRadius": 999, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [4, 10, 4, 10], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "HUG"] + }, + "variables": {"strokes/0/color": "border/border"}, + "texts": ["Multiplayer"] + } + ] + }, + { + "name": "Modpacks Grid", + "type": "FRAME", + "x": 24, + "y": 442, + "width": 1132, + "height": 220, + "layout": { + "mode": "VERTICAL", + "gap": 8, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "name": "Row 1", + "type": "FRAME", + "x": 0, + "y": 0, + "width": 1132, + "height": 68, + "layout": { + "mode": "HORIZONTAL", + "gap": 8, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "name": "Card Fabulously Optimized", + "type": "FRAME", + "x": 0, + "y": 0, + "width": 562, + "height": 68, + "fills": [{"type": "SOLID", "color": "#1C1A20"}], + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "cornerRadius": 12, + "layout": { + "mode": "HORIZONTAL", + "gap": 12, + "padding": [16, 16, 16, 16], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutGrow": 1, + "variables": { + "cornerRadius": "radius/xl", + "paddingTop": "spacing/4", + "paddingRight": "spacing/4", + "paddingBottom": "spacing/4", + "paddingLeft": "spacing/4", + "fills/0/color": "surface/surface", + "strokes/0/color": "border/border" + }, + "children": [ + { + "name": "Cover", + "type": "FRAME", + "x": 16, + "y": 16, + "width": 36, + "height": 36, + "fills": [{"type": "SOLID", "color": "#00000000", "opacity": 0}], + "cornerRadius": 4, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "CENTER", + "counter": "CENTER", + "sizing": ["FIXED", "FIXED"] + }, + "children": [ + { + "name": "Icon", + "type": "FRAME", + "x": 8, + "y": 8, + "width": 20, + "height": 20, + "variables": {"fills/0/color": "muted"}, + "children": [ + { + "name": "path", + "type": "VECTOR", + "x": 2.5, + "y": 1.67, + "width": 15, + "height": 16.67, + "strokes": [{"type": "SOLID", "color": "#9E98A6"}], + "strokeWeight": 1.67 + }, + { + "name": "path", + "type": "VECTOR", + "x": 2.74, + "y": 3.56, + "width": 14.52, + "height": 6.44, + "strokes": [{"type": "SOLID", "color": "#9E98A6"}], + "strokeWeight": 1.67 + } + ] + } + ] + }, + { + "name": "Info", + "type": "FRAME", + "x": 64, + "y": 17, + "width": 404, + "height": 34, + "layout": { + "mode": "VERTICAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutGrow": 1, + "children": [ + { + "name": "text", + "type": "TEXT", + "x": 0, + "y": 0, + "width": 142, + "height": 18, + "fills": [{"type": "SOLID", "color": "#F5F3F7"}], + "text": "Fabulously Optimized", + "font": ["Geist", 500, 14], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + }, + { + "name": "text", + "type": "TEXT", + "x": 0, + "y": 18, + "width": 157, + "height": 16, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "text": "robotkoer · 14.2M downloads", + "font": ["Geist", 400, 12], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "muted"} + } + ] + }, + { + "name": "Btn Install", + "type": "INSTANCE", + "x": 480, + "y": 18, + "width": 66, + "height": 32, + "component": "Gameplane/Button/Small/Default", + "componentId": "1:709", + "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": ["Install…"] + } + ] + }, + { + "name": "Card Vanilla Perfected", + "type": "FRAME", + "x": 570, + "y": 0, + "width": 562, + "height": 68, + "fills": [{"type": "SOLID", "color": "#1C1A20"}], + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "cornerRadius": 12, + "layout": { + "mode": "HORIZONTAL", + "gap": 12, + "padding": [16, 16, 16, 16], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutGrow": 1, + "variables": { + "cornerRadius": "radius/xl", + "paddingTop": "spacing/4", + "paddingRight": "spacing/4", + "paddingBottom": "spacing/4", + "paddingLeft": "spacing/4", + "fills/0/color": "surface/surface", + "strokes/0/color": "border/border" + }, + "children": [ + { + "name": "Cover", + "type": "FRAME", + "x": 16, + "y": 16, + "width": 36, + "height": 36, + "fills": [{"type": "SOLID", "color": "#00000000", "opacity": 0}], + "cornerRadius": 4, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "CENTER", + "counter": "CENTER", + "sizing": ["FIXED", "FIXED"] + }, + "children": [ + { + "name": "Icon", + "type": "FRAME", + "x": 8, + "y": 8, + "width": 20, + "height": 20, + "variables": {"fills/0/color": "muted"}, + "children": [ + { + "name": "path", + "type": "VECTOR", + "x": 2.5, + "y": 1.67, + "width": 15, + "height": 16.67, + "strokes": [{"type": "SOLID", "color": "#9E98A6"}], + "strokeWeight": 1.67 + }, + { + "name": "path", + "type": "VECTOR", + "x": 2.74, + "y": 3.56, + "width": 14.52, + "height": 6.44, + "strokes": [{"type": "SOLID", "color": "#9E98A6"}], + "strokeWeight": 1.67 + } + ] + } + ] + }, + { + "name": "Info", + "type": "FRAME", + "x": 64, + "y": 17, + "width": 404, + "height": 34, + "layout": { + "mode": "VERTICAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutGrow": 1, + "children": [ + { + "name": "text", + "type": "TEXT", + "x": 0, + "y": 0, + "width": 112, + "height": 18, + "fills": [{"type": "SOLID", "color": "#F5F3F7"}], + "text": "Vanilla Perfected", + "font": ["Geist", 500, 14], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + }, + { + "name": "text", + "type": "TEXT", + "x": 0, + "y": 18, + "width": 157, + "height": 16, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "text": "demonjoeTV · 2M downloads", + "font": ["Geist", 400, 12], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "muted"} + } + ] + }, + { + "name": "Btn Install", + "type": "INSTANCE", + "x": 480, + "y": 18, + "width": 66, + "height": 32, + "component": "Gameplane/Button/Small/Default", + "componentId": "1:709", + "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": ["Install…"] + } + ] + } + ] + }, + { + "name": "Row 2", + "type": "FRAME", + "x": 0, + "y": 76, + "width": 1132, + "height": 68, + "layout": { + "mode": "HORIZONTAL", + "gap": 8, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "name": "Card OptiFabric", + "type": "FRAME", + "x": 0, + "y": 0, + "width": 562, + "height": 68, + "fills": [{"type": "SOLID", "color": "#1C1A20"}], + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "cornerRadius": 12, + "layout": { + "mode": "HORIZONTAL", + "gap": 12, + "padding": [16, 16, 16, 16], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutGrow": 1, + "variables": { + "cornerRadius": "radius/xl", + "paddingTop": "spacing/4", + "paddingRight": "spacing/4", + "paddingBottom": "spacing/4", + "paddingLeft": "spacing/4", + "fills/0/color": "surface/surface", + "strokes/0/color": "border/border" + }, + "children": [ + { + "name": "Cover", + "type": "FRAME", + "x": 16, + "y": 16, + "width": 36, + "height": 36, + "fills": [{"type": "SOLID", "color": "#00000000", "opacity": 0}], + "cornerRadius": 4, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "CENTER", + "counter": "CENTER", + "sizing": ["FIXED", "FIXED"] + }, + "children": [ + { + "name": "Icon", + "type": "FRAME", + "x": 8, + "y": 8, + "width": 20, + "height": 20, + "variables": {"fills/0/color": "muted"}, + "children": [ + { + "name": "path", + "type": "VECTOR", + "x": 2.5, + "y": 1.67, + "width": 15, + "height": 16.67, + "strokes": [{"type": "SOLID", "color": "#9E98A6"}], + "strokeWeight": 1.67 + }, + { + "name": "path", + "type": "VECTOR", + "x": 2.74, + "y": 3.56, + "width": 14.52, + "height": 6.44, + "strokes": [{"type": "SOLID", "color": "#9E98A6"}], + "strokeWeight": 1.67 + } + ] + } + ] + }, + { + "name": "Info", + "type": "FRAME", + "x": 64, + "y": 17, + "width": 404, + "height": 34, + "layout": { + "mode": "VERTICAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutGrow": 1, + "children": [ + { + "name": "text", + "type": "TEXT", + "x": 0, + "y": 0, + "width": 69, + "height": 18, + "fills": [{"type": "SOLID", "color": "#F5F3F7"}], + "text": "OptiFabric", + "font": ["Geist", 500, 14], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + }, + { + "name": "text", + "type": "TEXT", + "x": 0, + "y": 18, + "width": 144, + "height": 16, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "text": "Creamer · 1.5M downloads", + "font": ["Geist", 400, 12], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "muted"} + } + ] + }, + { + "name": "Btn Install", + "type": "INSTANCE", + "x": 480, + "y": 18, + "width": 66, + "height": 32, + "component": "Gameplane/Button/Small/Default", + "componentId": "1:709", + "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": ["Install…"] + } + ] + }, + { + "name": "Card Remarkably Optimized", + "type": "FRAME", + "x": 570, + "y": 0, + "width": 562, + "height": 68, + "fills": [{"type": "SOLID", "color": "#1C1A20"}], + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "cornerRadius": 12, + "layout": { + "mode": "HORIZONTAL", + "gap": 12, + "padding": [16, 16, 16, 16], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutGrow": 1, + "variables": { + "cornerRadius": "radius/xl", + "paddingTop": "spacing/4", + "paddingRight": "spacing/4", + "paddingBottom": "spacing/4", + "paddingLeft": "spacing/4", + "fills/0/color": "surface/surface", + "strokes/0/color": "border/border" + }, + "children": [ + { + "name": "Cover", + "type": "FRAME", + "x": 16, + "y": 16, + "width": 36, + "height": 36, + "fills": [{"type": "SOLID", "color": "#00000000", "opacity": 0}], + "cornerRadius": 4, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "CENTER", + "counter": "CENTER", + "sizing": ["FIXED", "FIXED"] + }, + "children": [ + { + "name": "Icon", + "type": "FRAME", + "x": 8, + "y": 8, + "width": 20, + "height": 20, + "variables": {"fills/0/color": "muted"}, + "children": [ + { + "name": "path", + "type": "VECTOR", + "x": 2.5, + "y": 1.67, + "width": 15, + "height": 16.67, + "strokes": [{"type": "SOLID", "color": "#9E98A6"}], + "strokeWeight": 1.67 + }, + { + "name": "path", + "type": "VECTOR", + "x": 2.74, + "y": 3.56, + "width": 14.52, + "height": 6.44, + "strokes": [{"type": "SOLID", "color": "#9E98A6"}], + "strokeWeight": 1.67 + } + ] + } + ] + }, + { + "name": "Info", + "type": "FRAME", + "x": 64, + "y": 17, + "width": 404, + "height": 34, + "layout": { + "mode": "VERTICAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutGrow": 1, + "children": [ + { + "name": "text", + "type": "TEXT", + "x": 0, + "y": 0, + "width": 149, + "height": 18, + "fills": [{"type": "SOLID", "color": "#F5F3F7"}], + "text": "Remarkably Optimized", + "font": ["Geist", 500, 14], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + }, + { + "name": "text", + "type": "TEXT", + "x": 0, + "y": 18, + "width": 159, + "height": 16, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "text": "ThatOneJay · 1.1M downloads", + "font": ["Geist", 400, 12], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "muted"} + } + ] + }, + { + "name": "Btn Install", + "type": "INSTANCE", + "x": 480, + "y": 18, + "width": 66, + "height": 32, + "component": "Gameplane/Button/Small/Default", + "componentId": "1:709", + "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": ["Install…"] + } + ] + } + ] + }, + { + "name": "Row 3", + "type": "FRAME", + "x": 0, + "y": 152, + "width": 1132, + "height": 68, + "layout": { + "mode": "HORIZONTAL", + "gap": 8, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "name": "Card FPS Modpack", + "type": "FRAME", + "x": 0, + "y": 0, + "width": 562, + "height": 68, + "fills": [{"type": "SOLID", "color": "#1C1A20"}], + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "cornerRadius": 12, + "layout": { + "mode": "HORIZONTAL", + "gap": 12, + "padding": [16, 16, 16, 16], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutGrow": 1, + "variables": { + "cornerRadius": "radius/xl", + "paddingTop": "spacing/4", + "paddingRight": "spacing/4", + "paddingBottom": "spacing/4", + "paddingLeft": "spacing/4", + "fills/0/color": "surface/surface", + "strokes/0/color": "border/border" + }, + "children": [ + { + "name": "Cover", + "type": "FRAME", + "x": 16, + "y": 16, + "width": 36, + "height": 36, + "fills": [{"type": "SOLID", "color": "#00000000", "opacity": 0}], + "cornerRadius": 4, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "CENTER", + "counter": "CENTER", + "sizing": ["FIXED", "FIXED"] + }, + "children": [ + { + "name": "Icon", + "type": "FRAME", + "x": 8, + "y": 8, + "width": 20, + "height": 20, + "variables": {"fills/0/color": "muted"}, + "children": [ + { + "name": "path", + "type": "VECTOR", + "x": 2.5, + "y": 1.67, + "width": 15, + "height": 16.67, + "strokes": [{"type": "SOLID", "color": "#9E98A6"}], + "strokeWeight": 1.67 + }, + { + "name": "path", + "type": "VECTOR", + "x": 2.74, + "y": 3.56, + "width": 14.52, + "height": 6.44, + "strokes": [{"type": "SOLID", "color": "#9E98A6"}], + "strokeWeight": 1.67 + } + ] + } + ] + }, + { + "name": "Info", + "type": "FRAME", + "x": 64, + "y": 17, + "width": 404, + "height": 34, + "layout": { + "mode": "VERTICAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutGrow": 1, + "children": [ + { + "name": "text", + "type": "TEXT", + "x": 0, + "y": 0, + "width": 92, + "height": 18, + "fills": [{"type": "SOLID", "color": "#F5F3F7"}], + "text": "FPS Modpack", + "font": ["Geist", 500, 14], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + }, + { + "name": "text", + "type": "TEXT", + "x": 0, + "y": 18, + "width": 163, + "height": 16, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "text": "MIRRONAKE · 1.1M downloads", + "font": ["Geist", 400, 12], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "muted"} + } + ] + }, + { + "name": "Btn Install", + "type": "INSTANCE", + "x": 480, + "y": 18, + "width": 66, + "height": 32, + "component": "Gameplane/Button/Small/Default", + "componentId": "1:709", + "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": ["Install…"] + } + ] + }, + { + "name": "Card Fresh & Smooth", + "type": "FRAME", + "x": 570, + "y": 0, + "width": 562, + "height": 68, + "fills": [{"type": "SOLID", "color": "#1C1A20"}], + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "cornerRadius": 12, + "layout": { + "mode": "HORIZONTAL", + "gap": 12, + "padding": [16, 16, 16, 16], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutGrow": 1, + "variables": { + "cornerRadius": "radius/xl", + "paddingTop": "spacing/4", + "paddingRight": "spacing/4", + "paddingBottom": "spacing/4", + "paddingLeft": "spacing/4", + "fills/0/color": "surface/surface", + "strokes/0/color": "border/border" + }, + "children": [ + { + "name": "Cover", + "type": "FRAME", + "x": 16, + "y": 16, + "width": 36, + "height": 36, + "fills": [{"type": "SOLID", "color": "#00000000", "opacity": 0}], + "cornerRadius": 4, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "CENTER", + "counter": "CENTER", + "sizing": ["FIXED", "FIXED"] + }, + "children": [ + { + "name": "Icon", + "type": "FRAME", + "x": 8, + "y": 8, + "width": 20, + "height": 20, + "variables": {"fills/0/color": "muted"}, + "children": [ + { + "name": "path", + "type": "VECTOR", + "x": 2.5, + "y": 1.67, + "width": 15, + "height": 16.67, + "strokes": [{"type": "SOLID", "color": "#9E98A6"}], + "strokeWeight": 1.67 + }, + { + "name": "path", + "type": "VECTOR", + "x": 2.74, + "y": 3.56, + "width": 14.52, + "height": 6.44, + "strokes": [{"type": "SOLID", "color": "#9E98A6"}], + "strokeWeight": 1.67 + } + ] + } + ] + }, + { + "name": "Info", + "type": "FRAME", + "x": 64, + "y": 17, + "width": 404, + "height": 34, + "layout": { + "mode": "VERTICAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutGrow": 1, + "children": [ + { + "name": "text", + "type": "TEXT", + "x": 0, + "y": 0, + "width": 104, + "height": 18, + "fills": [{"type": "SOLID", "color": "#F5F3F7"}], + "text": "Fresh & Smooth", + "font": ["Geist", 500, 14], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + }, + { + "name": "text", + "type": "TEXT", + "x": 0, + "y": 18, + "width": 176, + "height": 16, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "text": "EndarPacks · 864.3K downloads", + "font": ["Geist", 400, 12], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "muted"} + } + ] + }, + { + "name": "Btn Install", + "type": "INSTANCE", + "x": 480, + "y": 18, + "width": 66, + "height": 32, + "component": "Gameplane/Button/Small/Default", + "componentId": "1:709", + "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": ["Install…"] + } + ] + } + ] + } + ] + }, + { + "name": "Load More Row", + "type": "FRAME", + "x": 24, + "y": 678, + "width": 1132, + "height": 32, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "CENTER", + "counter": "MIN", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "name": "Btn Load More", + "type": "INSTANCE", + "x": 521.5, + "y": 0, + "width": 89, + "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": ["HUG", "HUG"] + }, + "variables": {"strokes/0/color": "border/border"}, + "texts": ["Load more"] + } + ] + } + ] + } + ] + }, + { + "name": "Dim Overlay", + "type": "RECTANGLE", + "x": 0, + "y": 0, + "width": 1440, + "height": 900, + "fills": [{"type": "SOLID", "color": "#000000", "opacity": 0.8}], + "absolute": true + }, + { + "name": "Change Version Dialog", + "type": "FRAME", + "x": 440, + "y": 80, + "width": 560, + "height": 479, + "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"] + }, + "absolute": true, + "variables": { + "cornerRadius": "radius/xl", + "fills/0/color": "surface/surface", + "strokes/0/color": "border/border" + }, + "children": [ + { + "name": "mTitle", + "type": "TEXT", + "x": 20, + "y": 20, + "width": 119, + "height": 24, + "fills": [{"type": "SOLID", "color": "#F5F3F7"}], + "text": "Change version", + "font": ["Geist", 600, 16], + "lineHeight": {"value": 150, "unit": "PERCENT"}, + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + }, + { + "name": "mDescWrap", + "type": "FRAME", + "x": 20, + "y": 44, + "width": 520, + "height": 25, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [4, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "name": "mDesc", + "type": "TEXT", + "x": 0, + "y": 4, + "width": 520, + "height": 21, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "layoutGrow": 1, + "text": "Fabulously Optimized · Modrinth", + "font": ["Geist", 400, 14], + "lineHeight": {"value": 150, "unit": "PERCENT"}, + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "muted"} + } + ] + }, + { + "name": "mBody", + "type": "FRAME", + "x": 20, + "y": 69, + "width": 520, + "height": 338, + "layout": { + "mode": "VERTICAL", + "gap": 16, + "padding": [16, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "name": "Text", + "type": "TEXT", + "x": 0, + "y": 16, + "width": 314, + "height": 16, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "text": "Showing versions for Minecraft 1.21.1 · Fabric, newest first.", + "font": ["Geist", 400, 12], + "variables": {"fills/0/color": "muted"} + }, + { + "name": "Version List", + "type": "FRAME", + "x": 0, + "y": 48, + "width": 520, + "height": 290, + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "cornerRadius": 8, + "layout": { + "mode": "VERTICAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "clips": true, + "variables": {"strokes/0/color": "border/border"}, + "children": [ + { + "name": "Version 6.5.0", + "type": "INSTANCE", + "x": 0, + "y": 0, + "width": 520, + "height": 58, + "component": "Gameplane/Modpack Version Row", + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "layout": { + "mode": "HORIZONTAL", + "gap": 12, + "padding": [10, 12, 10, 12], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"strokes/0/color": "border/border"}, + "texts": ["6.5.0", "Published 16 Nov 2026 · Fabric 0.17.2", "Release"] + }, + { + "name": "Version 6.5.0-beta.3", + "type": "INSTANCE", + "x": 0, + "y": 58, + "width": 520, + "height": 58, + "component": "Gameplane/Modpack Version Row", + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "layout": { + "mode": "HORIZONTAL", + "gap": 12, + "padding": [10, 12, 10, 12], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"strokes/0/color": "border/border"}, + "texts": ["6.5.0-beta.3", "Published 8 Nov 2026 · Fabric 0.17.1", "Beta"] + }, + { + "name": "Version 6.4.0", + "type": "INSTANCE", + "x": 0, + "y": 116, + "width": 520, + "height": 58, + "component": "Gameplane/Modpack Version Row", + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "layout": { + "mode": "HORIZONTAL", + "gap": 12, + "padding": [10, 12, 10, 12], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"strokes/0/color": "border/border"}, + "texts": ["6.4.0", "Published 2 Nov 2026 · Fabric 0.16.9", "Pinned", "Release"] + }, + { + "name": "Version 6.3.1", + "type": "INSTANCE", + "x": 0, + "y": 174, + "width": 520, + "height": 58, + "component": "Gameplane/Modpack Version Row", + "fills": [{"type": "SOLID", "color": "#2C1926"}], + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "layout": { + "mode": "HORIZONTAL", + "gap": 12, + "padding": [10, 12, 10, 12], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"fills/0/color": "accent/soft", "strokes/0/color": "border/border"}, + "texts": ["6.3.1", "Published 12 Oct 2026 · Fabric 0.16.9", "Older than pinned", "Release"] + }, + { + "name": "Version 6.3.0", + "type": "INSTANCE", + "x": 0, + "y": 232, + "width": 520, + "height": 58, + "component": "Gameplane/Modpack Version Row", + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "layout": { + "mode": "HORIZONTAL", + "gap": 12, + "padding": [10, 12, 10, 12], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"strokes/0/color": "border/border"}, + "texts": ["6.3.0", "Published 1 Oct 2026 · Fabric 0.16.7", "Older than pinned", "Release"] + } + ] + } + ] + }, + { + "name": "mFooter", + "type": "FRAME", + "x": 20, + "y": 407, + "width": 520, + "height": 52, + "layout": { + "mode": "HORIZONTAL", + "gap": 8, + "padding": [20, 0, 0, 0], + "primary": "MAX", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "name": "btnCancel", + "type": "FRAME", + "x": 373, + "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": [ + { + "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"} + } + ] + }, + { + "name": "btnPrimary", + "type": "FRAME", + "x": 445, + "y": 20, + "width": 75, + "height": 32, + "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": [ + { + "name": "text", + "type": "TEXT", + "x": 12, + "y": 8, + "width": 51, + "height": 16, + "fills": [{"type": "SOLID", "color": "#FFFFFF"}], + "text": "Continue", + "font": ["Geist", 500, 12], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "accent/foreground"} + } + ] + } + ] + } + ] + } + ] +} diff --git a/assets/design-export/json/1274632774-130.json b/assets/design-export/json/1274632774-130.json new file mode 100644 index 000000000..0c287a67b --- /dev/null +++ b/assets/design-export/json/1274632774-130.json @@ -0,0 +1,1523 @@ +{ + "file": "1274632774-130", + "name": "Screen/Server Detail — Modpacks (Active pack)", + "type": "FRAME", + "x": 1640, + "y": 32970, + "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" + ] + }, + { + "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", "test-server-02", "Search servers…", "AD"] + }, + { + "name": "Body", + "type": "FRAME", + "x": 0, + "y": 64, + "width": 1180, + "height": 836, + "fills": [{"type": "SOLID", "color": "#121114"}], + "layout": { + "mode": "VERTICAL", + "gap": 16, + "padding": [24, 24, 24, 24], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "FIXED"] + }, + "layoutGrow": 1, + "layoutAlignSelf": "STRETCH", + "variables": {"fills/0/color": "background/background"}, + "children": [ + { + "name": "Detail Header", + "type": "INSTANCE", + "x": 24, + "y": 24, + "width": 1132, + "height": 78, + "component": "Gameplane/Server Detail Header", + "componentId": "1:447", + "fills": [{"type": "SOLID", "color": "#121114"}], + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [8, 0, 16, 0], + "primary": "SPACE_BETWEEN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"fills/0/color": "background/background"}, + "texts": [ + "MI", + "test-server-02", + "Running", + "minecraft-java · fabric 1.21.1 · ns: default · up 13d 4h", + "Restart", + "Stop", + "Open console" + ] + }, + { + "name": "Tabs Bar", + "type": "INSTANCE", + "x": 24, + "y": 118, + "width": 1132, + "height": 40, + "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": [0, 0, 0, 0], + "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" + ] + }, + { + "name": "Active Modpack Card", + "type": "INSTANCE", + "x": 24, + "y": 174, + "width": 1132, + "height": 106, + "component": "Gameplane/Active Modpack Card", + "fills": [{"type": "SOLID", "color": "#1C1A20"}], + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "cornerRadius": 12, + "layout": { + "mode": "VERTICAL", + "gap": 12, + "padding": [16, 16, 16, 16], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"fills/0/color": "surface/surface", "strokes/0/color": "border/border"}, + "texts": [ + "Active modpack", + "Fabulously Optimized", + "Modrinth", + "Applied", + "Version 6.4.0 · pinned · Minecraft 1.21.1 · Fabric", + "Change version", + "Remove" + ] + }, + { + "name": "Modpacks Heading", + "type": "FRAME", + "x": 24, + "y": 296, + "width": 1132, + "height": 34, + "layout": { + "mode": "VERTICAL", + "gap": 2, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "name": "heading", + "type": "TEXT", + "x": 0, + "y": 0, + "width": 119, + "height": 18, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "text": "Browse modpacks", + "font": ["Geist", 400, 14], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "muted"} + }, + { + "name": "subheading", + "type": "TEXT", + "x": 0, + "y": 20, + "width": 1132, + "height": 14, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "layoutAlignSelf": "STRETCH", + "text": "Pick a pack and a version. The server pins that version and restarts to install it; a restart never upgrades it.", + "font": ["Geist", 400, 11], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "muted"} + } + ] + }, + { + "name": "Filters Row", + "type": "FRAME", + "x": 24, + "y": 346, + "width": 1132, + "height": 40, + "layout": { + "mode": "HORIZONTAL", + "gap": 8, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "name": "Provider Switch", + "type": "INSTANCE", + "x": 0, + "y": 0, + "width": 266, + "height": 40, + "component": "Gameplane/Provider Switch", + "fills": [{"type": "SOLID", "color": "#232128"}], + "cornerRadius": 20, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [4, 4, 4, 4], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "HUG"] + }, + "variables": {"fills/0/color": "default/default"}, + "texts": ["Modrinth", "CurseForge", "FTB"] + }, + { + "name": "Search", + "type": "INSTANCE", + "x": 274, + "y": 2, + "width": 630, + "height": 36, + "component": "Gameplane/Search Input", + "componentId": "1:975", + "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": 6, + "padding": [0, 12, 0, 12], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "FIXED"] + }, + "layoutGrow": 1, + "variables": { + "cornerRadius": "radius/xl", + "fills/0/color": "field/background", + "strokes/0/color": "field/border" + }, + "texts": ["Search modpacks…"] + }, + { + "name": "Select", + "type": "INSTANCE", + "x": 912, + "y": 2, + "width": 220, + "height": 36, + "component": "Gameplane/Select", + "componentId": "1:311", + "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": "SPACE_BETWEEN", + "counter": "CENTER", + "sizing": ["FIXED", "FIXED"] + }, + "variables": { + "cornerRadius": "radius/xl", + "fills/0/color": "field/background", + "strokes/0/color": "field/border" + }, + "texts": ["Sort: Downloads"] + } + ] + }, + { + "name": "Category Chips", + "type": "FRAME", + "x": 24, + "y": 402, + "width": 1132, + "height": 24, + "layout": { + "mode": "HORIZONTAL", + "gap": 6, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "name": "chipAll", + "type": "INSTANCE", + "x": 0, + "y": 3.5, + "width": 22, + "height": 17, + "component": "Chip/Primary/Accent/SM", + "componentId": "1:981", + "fills": [{"type": "SOLID", "color": "#FF4FA3"}], + "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": "accent/accent"}, + "texts": ["All"] + }, + { + "name": "chipAdventure", + "type": "INSTANCE", + "x": 28, + "y": 0, + "width": 77, + "height": 24, + "component": "Gameplane/Tag", + "componentId": "1:1142", + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "cornerRadius": 999, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [4, 10, 4, 10], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "HUG"] + }, + "variables": {"strokes/0/color": "border/border"}, + "texts": ["Adventure"] + }, + { + "name": "chipTech", + "type": "INSTANCE", + "x": 111, + "y": 0, + "width": 46, + "height": 24, + "component": "Gameplane/Tag", + "componentId": "1:1142", + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "cornerRadius": 999, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [4, 10, 4, 10], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "HUG"] + }, + "variables": {"strokes/0/color": "border/border"}, + "texts": ["Tech"] + }, + { + "name": "chipMagic", + "type": "INSTANCE", + "x": 163, + "y": 0, + "width": 54, + "height": 24, + "component": "Gameplane/Tag", + "componentId": "1:1142", + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "cornerRadius": 999, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [4, 10, 4, 10], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "HUG"] + }, + "variables": {"strokes/0/color": "border/border"}, + "texts": ["Magic"] + }, + { + "name": "chipOptimized", + "type": "INSTANCE", + "x": 223, + "y": 0, + "width": 77, + "height": 24, + "component": "Gameplane/Tag", + "componentId": "1:1142", + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "cornerRadius": 999, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [4, 10, 4, 10], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "HUG"] + }, + "variables": {"strokes/0/color": "border/border"}, + "texts": ["Optimized"] + }, + { + "name": "chipMultiplayer", + "type": "INSTANCE", + "x": 306, + "y": 0, + "width": 82, + "height": 24, + "component": "Gameplane/Tag", + "componentId": "1:1142", + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "cornerRadius": 999, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [4, 10, 4, 10], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "HUG"] + }, + "variables": {"strokes/0/color": "border/border"}, + "texts": ["Multiplayer"] + } + ] + }, + { + "name": "Modpacks Grid", + "type": "FRAME", + "x": 24, + "y": 442, + "width": 1132, + "height": 220, + "layout": { + "mode": "VERTICAL", + "gap": 8, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "name": "Row 1", + "type": "FRAME", + "x": 0, + "y": 0, + "width": 1132, + "height": 68, + "layout": { + "mode": "HORIZONTAL", + "gap": 8, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "name": "Card Fabulously Optimized", + "type": "FRAME", + "x": 0, + "y": 0, + "width": 562, + "height": 68, + "fills": [{"type": "SOLID", "color": "#1C1A20"}], + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "cornerRadius": 12, + "layout": { + "mode": "HORIZONTAL", + "gap": 12, + "padding": [16, 16, 16, 16], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutGrow": 1, + "variables": { + "cornerRadius": "radius/xl", + "paddingTop": "spacing/4", + "paddingRight": "spacing/4", + "paddingBottom": "spacing/4", + "paddingLeft": "spacing/4", + "fills/0/color": "surface/surface", + "strokes/0/color": "border/border" + }, + "children": [ + { + "name": "Cover", + "type": "FRAME", + "x": 16, + "y": 16, + "width": 36, + "height": 36, + "fills": [{"type": "SOLID", "color": "#00000000", "opacity": 0}], + "cornerRadius": 4, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "CENTER", + "counter": "CENTER", + "sizing": ["FIXED", "FIXED"] + }, + "children": [ + { + "name": "Icon", + "type": "FRAME", + "x": 8, + "y": 8, + "width": 20, + "height": 20, + "variables": {"fills/0/color": "muted"}, + "children": [ + { + "name": "path", + "type": "VECTOR", + "x": 2.5, + "y": 1.67, + "width": 15, + "height": 16.67, + "strokes": [{"type": "SOLID", "color": "#9E98A6"}], + "strokeWeight": 1.67 + }, + { + "name": "path", + "type": "VECTOR", + "x": 2.74, + "y": 3.56, + "width": 14.52, + "height": 6.44, + "strokes": [{"type": "SOLID", "color": "#9E98A6"}], + "strokeWeight": 1.67 + } + ] + } + ] + }, + { + "name": "Info", + "type": "FRAME", + "x": 64, + "y": 17, + "width": 404, + "height": 34, + "layout": { + "mode": "VERTICAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutGrow": 1, + "children": [ + { + "name": "text", + "type": "TEXT", + "x": 0, + "y": 0, + "width": 142, + "height": 18, + "fills": [{"type": "SOLID", "color": "#F5F3F7"}], + "text": "Fabulously Optimized", + "font": ["Geist", 500, 14], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + }, + { + "name": "text", + "type": "TEXT", + "x": 0, + "y": 18, + "width": 157, + "height": 16, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "text": "robotkoer · 14.2M downloads", + "font": ["Geist", 400, 12], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "muted"} + } + ] + }, + { + "name": "Btn Install", + "type": "INSTANCE", + "x": 480, + "y": 18, + "width": 66, + "height": 32, + "component": "Gameplane/Button/Small/Default", + "componentId": "1:709", + "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": ["Install…"] + } + ] + }, + { + "name": "Card Vanilla Perfected", + "type": "FRAME", + "x": 570, + "y": 0, + "width": 562, + "height": 68, + "fills": [{"type": "SOLID", "color": "#1C1A20"}], + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "cornerRadius": 12, + "layout": { + "mode": "HORIZONTAL", + "gap": 12, + "padding": [16, 16, 16, 16], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutGrow": 1, + "variables": { + "cornerRadius": "radius/xl", + "paddingTop": "spacing/4", + "paddingRight": "spacing/4", + "paddingBottom": "spacing/4", + "paddingLeft": "spacing/4", + "fills/0/color": "surface/surface", + "strokes/0/color": "border/border" + }, + "children": [ + { + "name": "Cover", + "type": "FRAME", + "x": 16, + "y": 16, + "width": 36, + "height": 36, + "fills": [{"type": "SOLID", "color": "#00000000", "opacity": 0}], + "cornerRadius": 4, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "CENTER", + "counter": "CENTER", + "sizing": ["FIXED", "FIXED"] + }, + "children": [ + { + "name": "Icon", + "type": "FRAME", + "x": 8, + "y": 8, + "width": 20, + "height": 20, + "variables": {"fills/0/color": "muted"}, + "children": [ + { + "name": "path", + "type": "VECTOR", + "x": 2.5, + "y": 1.67, + "width": 15, + "height": 16.67, + "strokes": [{"type": "SOLID", "color": "#9E98A6"}], + "strokeWeight": 1.67 + }, + { + "name": "path", + "type": "VECTOR", + "x": 2.74, + "y": 3.56, + "width": 14.52, + "height": 6.44, + "strokes": [{"type": "SOLID", "color": "#9E98A6"}], + "strokeWeight": 1.67 + } + ] + } + ] + }, + { + "name": "Info", + "type": "FRAME", + "x": 64, + "y": 17, + "width": 404, + "height": 34, + "layout": { + "mode": "VERTICAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutGrow": 1, + "children": [ + { + "name": "text", + "type": "TEXT", + "x": 0, + "y": 0, + "width": 112, + "height": 18, + "fills": [{"type": "SOLID", "color": "#F5F3F7"}], + "text": "Vanilla Perfected", + "font": ["Geist", 500, 14], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + }, + { + "name": "text", + "type": "TEXT", + "x": 0, + "y": 18, + "width": 157, + "height": 16, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "text": "demonjoeTV · 2M downloads", + "font": ["Geist", 400, 12], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "muted"} + } + ] + }, + { + "name": "Btn Install", + "type": "INSTANCE", + "x": 480, + "y": 18, + "width": 66, + "height": 32, + "component": "Gameplane/Button/Small/Default", + "componentId": "1:709", + "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": ["Install…"] + } + ] + } + ] + }, + { + "name": "Row 2", + "type": "FRAME", + "x": 0, + "y": 76, + "width": 1132, + "height": 68, + "layout": { + "mode": "HORIZONTAL", + "gap": 8, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "name": "Card OptiFabric", + "type": "FRAME", + "x": 0, + "y": 0, + "width": 562, + "height": 68, + "fills": [{"type": "SOLID", "color": "#1C1A20"}], + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "cornerRadius": 12, + "layout": { + "mode": "HORIZONTAL", + "gap": 12, + "padding": [16, 16, 16, 16], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutGrow": 1, + "variables": { + "cornerRadius": "radius/xl", + "paddingTop": "spacing/4", + "paddingRight": "spacing/4", + "paddingBottom": "spacing/4", + "paddingLeft": "spacing/4", + "fills/0/color": "surface/surface", + "strokes/0/color": "border/border" + }, + "children": [ + { + "name": "Cover", + "type": "FRAME", + "x": 16, + "y": 16, + "width": 36, + "height": 36, + "fills": [{"type": "SOLID", "color": "#00000000", "opacity": 0}], + "cornerRadius": 4, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "CENTER", + "counter": "CENTER", + "sizing": ["FIXED", "FIXED"] + }, + "children": [ + { + "name": "Icon", + "type": "FRAME", + "x": 8, + "y": 8, + "width": 20, + "height": 20, + "variables": {"fills/0/color": "muted"}, + "children": [ + { + "name": "path", + "type": "VECTOR", + "x": 2.5, + "y": 1.67, + "width": 15, + "height": 16.67, + "strokes": [{"type": "SOLID", "color": "#9E98A6"}], + "strokeWeight": 1.67 + }, + { + "name": "path", + "type": "VECTOR", + "x": 2.74, + "y": 3.56, + "width": 14.52, + "height": 6.44, + "strokes": [{"type": "SOLID", "color": "#9E98A6"}], + "strokeWeight": 1.67 + } + ] + } + ] + }, + { + "name": "Info", + "type": "FRAME", + "x": 64, + "y": 17, + "width": 404, + "height": 34, + "layout": { + "mode": "VERTICAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutGrow": 1, + "children": [ + { + "name": "text", + "type": "TEXT", + "x": 0, + "y": 0, + "width": 69, + "height": 18, + "fills": [{"type": "SOLID", "color": "#F5F3F7"}], + "text": "OptiFabric", + "font": ["Geist", 500, 14], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + }, + { + "name": "text", + "type": "TEXT", + "x": 0, + "y": 18, + "width": 144, + "height": 16, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "text": "Creamer · 1.5M downloads", + "font": ["Geist", 400, 12], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "muted"} + } + ] + }, + { + "name": "Btn Install", + "type": "INSTANCE", + "x": 480, + "y": 18, + "width": 66, + "height": 32, + "component": "Gameplane/Button/Small/Default", + "componentId": "1:709", + "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": ["Install…"] + } + ] + }, + { + "name": "Card Remarkably Optimized", + "type": "FRAME", + "x": 570, + "y": 0, + "width": 562, + "height": 68, + "fills": [{"type": "SOLID", "color": "#1C1A20"}], + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "cornerRadius": 12, + "layout": { + "mode": "HORIZONTAL", + "gap": 12, + "padding": [16, 16, 16, 16], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutGrow": 1, + "variables": { + "cornerRadius": "radius/xl", + "paddingTop": "spacing/4", + "paddingRight": "spacing/4", + "paddingBottom": "spacing/4", + "paddingLeft": "spacing/4", + "fills/0/color": "surface/surface", + "strokes/0/color": "border/border" + }, + "children": [ + { + "name": "Cover", + "type": "FRAME", + "x": 16, + "y": 16, + "width": 36, + "height": 36, + "fills": [{"type": "SOLID", "color": "#00000000", "opacity": 0}], + "cornerRadius": 4, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "CENTER", + "counter": "CENTER", + "sizing": ["FIXED", "FIXED"] + }, + "children": [ + { + "name": "Icon", + "type": "FRAME", + "x": 8, + "y": 8, + "width": 20, + "height": 20, + "variables": {"fills/0/color": "muted"}, + "children": [ + { + "name": "path", + "type": "VECTOR", + "x": 2.5, + "y": 1.67, + "width": 15, + "height": 16.67, + "strokes": [{"type": "SOLID", "color": "#9E98A6"}], + "strokeWeight": 1.67 + }, + { + "name": "path", + "type": "VECTOR", + "x": 2.74, + "y": 3.56, + "width": 14.52, + "height": 6.44, + "strokes": [{"type": "SOLID", "color": "#9E98A6"}], + "strokeWeight": 1.67 + } + ] + } + ] + }, + { + "name": "Info", + "type": "FRAME", + "x": 64, + "y": 17, + "width": 404, + "height": 34, + "layout": { + "mode": "VERTICAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutGrow": 1, + "children": [ + { + "name": "text", + "type": "TEXT", + "x": 0, + "y": 0, + "width": 149, + "height": 18, + "fills": [{"type": "SOLID", "color": "#F5F3F7"}], + "text": "Remarkably Optimized", + "font": ["Geist", 500, 14], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + }, + { + "name": "text", + "type": "TEXT", + "x": 0, + "y": 18, + "width": 159, + "height": 16, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "text": "ThatOneJay · 1.1M downloads", + "font": ["Geist", 400, 12], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "muted"} + } + ] + }, + { + "name": "Btn Install", + "type": "INSTANCE", + "x": 480, + "y": 18, + "width": 66, + "height": 32, + "component": "Gameplane/Button/Small/Default", + "componentId": "1:709", + "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": ["Install…"] + } + ] + } + ] + }, + { + "name": "Row 3", + "type": "FRAME", + "x": 0, + "y": 152, + "width": 1132, + "height": 68, + "layout": { + "mode": "HORIZONTAL", + "gap": 8, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "name": "Card FPS Modpack", + "type": "FRAME", + "x": 0, + "y": 0, + "width": 562, + "height": 68, + "fills": [{"type": "SOLID", "color": "#1C1A20"}], + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "cornerRadius": 12, + "layout": { + "mode": "HORIZONTAL", + "gap": 12, + "padding": [16, 16, 16, 16], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutGrow": 1, + "variables": { + "cornerRadius": "radius/xl", + "paddingTop": "spacing/4", + "paddingRight": "spacing/4", + "paddingBottom": "spacing/4", + "paddingLeft": "spacing/4", + "fills/0/color": "surface/surface", + "strokes/0/color": "border/border" + }, + "children": [ + { + "name": "Cover", + "type": "FRAME", + "x": 16, + "y": 16, + "width": 36, + "height": 36, + "fills": [{"type": "SOLID", "color": "#00000000", "opacity": 0}], + "cornerRadius": 4, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "CENTER", + "counter": "CENTER", + "sizing": ["FIXED", "FIXED"] + }, + "children": [ + { + "name": "Icon", + "type": "FRAME", + "x": 8, + "y": 8, + "width": 20, + "height": 20, + "variables": {"fills/0/color": "muted"}, + "children": [ + { + "name": "path", + "type": "VECTOR", + "x": 2.5, + "y": 1.67, + "width": 15, + "height": 16.67, + "strokes": [{"type": "SOLID", "color": "#9E98A6"}], + "strokeWeight": 1.67 + }, + { + "name": "path", + "type": "VECTOR", + "x": 2.74, + "y": 3.56, + "width": 14.52, + "height": 6.44, + "strokes": [{"type": "SOLID", "color": "#9E98A6"}], + "strokeWeight": 1.67 + } + ] + } + ] + }, + { + "name": "Info", + "type": "FRAME", + "x": 64, + "y": 17, + "width": 404, + "height": 34, + "layout": { + "mode": "VERTICAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutGrow": 1, + "children": [ + { + "name": "text", + "type": "TEXT", + "x": 0, + "y": 0, + "width": 92, + "height": 18, + "fills": [{"type": "SOLID", "color": "#F5F3F7"}], + "text": "FPS Modpack", + "font": ["Geist", 500, 14], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + }, + { + "name": "text", + "type": "TEXT", + "x": 0, + "y": 18, + "width": 163, + "height": 16, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "text": "MIRRONAKE · 1.1M downloads", + "font": ["Geist", 400, 12], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "muted"} + } + ] + }, + { + "name": "Btn Install", + "type": "INSTANCE", + "x": 480, + "y": 18, + "width": 66, + "height": 32, + "component": "Gameplane/Button/Small/Default", + "componentId": "1:709", + "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": ["Install…"] + } + ] + }, + { + "name": "Card Fresh & Smooth", + "type": "FRAME", + "x": 570, + "y": 0, + "width": 562, + "height": 68, + "fills": [{"type": "SOLID", "color": "#1C1A20"}], + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "cornerRadius": 12, + "layout": { + "mode": "HORIZONTAL", + "gap": 12, + "padding": [16, 16, 16, 16], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutGrow": 1, + "variables": { + "cornerRadius": "radius/xl", + "paddingTop": "spacing/4", + "paddingRight": "spacing/4", + "paddingBottom": "spacing/4", + "paddingLeft": "spacing/4", + "fills/0/color": "surface/surface", + "strokes/0/color": "border/border" + }, + "children": [ + { + "name": "Cover", + "type": "FRAME", + "x": 16, + "y": 16, + "width": 36, + "height": 36, + "fills": [{"type": "SOLID", "color": "#00000000", "opacity": 0}], + "cornerRadius": 4, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "CENTER", + "counter": "CENTER", + "sizing": ["FIXED", "FIXED"] + }, + "children": [ + { + "name": "Icon", + "type": "FRAME", + "x": 8, + "y": 8, + "width": 20, + "height": 20, + "variables": {"fills/0/color": "muted"}, + "children": [ + { + "name": "path", + "type": "VECTOR", + "x": 2.5, + "y": 1.67, + "width": 15, + "height": 16.67, + "strokes": [{"type": "SOLID", "color": "#9E98A6"}], + "strokeWeight": 1.67 + }, + { + "name": "path", + "type": "VECTOR", + "x": 2.74, + "y": 3.56, + "width": 14.52, + "height": 6.44, + "strokes": [{"type": "SOLID", "color": "#9E98A6"}], + "strokeWeight": 1.67 + } + ] + } + ] + }, + { + "name": "Info", + "type": "FRAME", + "x": 64, + "y": 17, + "width": 404, + "height": 34, + "layout": { + "mode": "VERTICAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutGrow": 1, + "children": [ + { + "name": "text", + "type": "TEXT", + "x": 0, + "y": 0, + "width": 104, + "height": 18, + "fills": [{"type": "SOLID", "color": "#F5F3F7"}], + "text": "Fresh & Smooth", + "font": ["Geist", 500, 14], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + }, + { + "name": "text", + "type": "TEXT", + "x": 0, + "y": 18, + "width": 176, + "height": 16, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "text": "EndarPacks · 864.3K downloads", + "font": ["Geist", 400, 12], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "muted"} + } + ] + }, + { + "name": "Btn Install", + "type": "INSTANCE", + "x": 480, + "y": 18, + "width": 66, + "height": 32, + "component": "Gameplane/Button/Small/Default", + "componentId": "1:709", + "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": ["Install…"] + } + ] + } + ] + } + ] + }, + { + "name": "Load More Row", + "type": "FRAME", + "x": 24, + "y": 678, + "width": 1132, + "height": 32, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "CENTER", + "counter": "MIN", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "name": "Btn Load More", + "type": "INSTANCE", + "x": 521.5, + "y": 0, + "width": 89, + "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": ["HUG", "HUG"] + }, + "variables": {"strokes/0/color": "border/border"}, + "texts": ["Load more"] + } + ] + } + ] + } + ] + } + ] +} diff --git a/assets/design-export/json/1274632774-1722.json b/assets/design-export/json/1274632774-1722.json new file mode 100644 index 000000000..d4f85da54 --- /dev/null +++ b/assets/design-export/json/1274632774-1722.json @@ -0,0 +1,1783 @@ +{ + "file": "1274632774-1722", + "name": "Screen/Server Detail — Modpacks — Confirm downgrade", + "type": "FRAME", + "x": 8200, + "y": 32970, + "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" + ] + }, + { + "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", "test-server-02", "Search servers…", "AD"] + }, + { + "name": "Body", + "type": "FRAME", + "x": 0, + "y": 64, + "width": 1180, + "height": 836, + "fills": [{"type": "SOLID", "color": "#121114"}], + "layout": { + "mode": "VERTICAL", + "gap": 16, + "padding": [24, 24, 24, 24], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "FIXED"] + }, + "layoutGrow": 1, + "layoutAlignSelf": "STRETCH", + "variables": {"fills/0/color": "background/background"}, + "children": [ + { + "name": "Detail Header", + "type": "INSTANCE", + "x": 24, + "y": 24, + "width": 1132, + "height": 78, + "component": "Gameplane/Server Detail Header", + "componentId": "1:447", + "fills": [{"type": "SOLID", "color": "#121114"}], + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [8, 0, 16, 0], + "primary": "SPACE_BETWEEN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"fills/0/color": "background/background"}, + "texts": [ + "MI", + "test-server-02", + "Running", + "minecraft-java · fabric 1.21.1 · ns: default · up 13d 4h", + "Restart", + "Stop", + "Open console" + ] + }, + { + "name": "Tabs Bar", + "type": "INSTANCE", + "x": 24, + "y": 118, + "width": 1132, + "height": 40, + "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": [0, 0, 0, 0], + "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" + ] + }, + { + "name": "Active Modpack Card", + "type": "INSTANCE", + "x": 24, + "y": 174, + "width": 1132, + "height": 106, + "component": "Gameplane/Active Modpack Card", + "fills": [{"type": "SOLID", "color": "#1C1A20"}], + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "cornerRadius": 12, + "layout": { + "mode": "VERTICAL", + "gap": 12, + "padding": [16, 16, 16, 16], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"fills/0/color": "surface/surface", "strokes/0/color": "border/border"}, + "texts": [ + "Active modpack", + "Fabulously Optimized", + "Modrinth", + "Applied", + "Version 6.4.0 · pinned · Minecraft 1.21.1 · Fabric", + "Change version", + "Remove" + ] + }, + { + "name": "Modpacks Heading", + "type": "FRAME", + "x": 24, + "y": 296, + "width": 1132, + "height": 34, + "layout": { + "mode": "VERTICAL", + "gap": 2, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "name": "heading", + "type": "TEXT", + "x": 0, + "y": 0, + "width": 119, + "height": 18, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "text": "Browse modpacks", + "font": ["Geist", 400, 14], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "muted"} + }, + { + "name": "subheading", + "type": "TEXT", + "x": 0, + "y": 20, + "width": 1132, + "height": 14, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "layoutAlignSelf": "STRETCH", + "text": "Pick a pack and a version. The server pins that version and restarts to install it; a restart never upgrades it.", + "font": ["Geist", 400, 11], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "muted"} + } + ] + }, + { + "name": "Filters Row", + "type": "FRAME", + "x": 24, + "y": 346, + "width": 1132, + "height": 40, + "layout": { + "mode": "HORIZONTAL", + "gap": 8, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "name": "Provider Switch", + "type": "INSTANCE", + "x": 0, + "y": 0, + "width": 266, + "height": 40, + "component": "Gameplane/Provider Switch", + "fills": [{"type": "SOLID", "color": "#232128"}], + "cornerRadius": 20, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [4, 4, 4, 4], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "HUG"] + }, + "variables": {"fills/0/color": "default/default"}, + "texts": ["Modrinth", "CurseForge", "FTB"] + }, + { + "name": "Search", + "type": "INSTANCE", + "x": 274, + "y": 2, + "width": 630, + "height": 36, + "component": "Gameplane/Search Input", + "componentId": "1:975", + "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": 6, + "padding": [0, 12, 0, 12], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "FIXED"] + }, + "layoutGrow": 1, + "variables": { + "cornerRadius": "radius/xl", + "fills/0/color": "field/background", + "strokes/0/color": "field/border" + }, + "texts": ["Search modpacks…"] + }, + { + "name": "Select", + "type": "INSTANCE", + "x": 912, + "y": 2, + "width": 220, + "height": 36, + "component": "Gameplane/Select", + "componentId": "1:311", + "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": "SPACE_BETWEEN", + "counter": "CENTER", + "sizing": ["FIXED", "FIXED"] + }, + "variables": { + "cornerRadius": "radius/xl", + "fills/0/color": "field/background", + "strokes/0/color": "field/border" + }, + "texts": ["Sort: Downloads"] + } + ] + }, + { + "name": "Category Chips", + "type": "FRAME", + "x": 24, + "y": 402, + "width": 1132, + "height": 24, + "layout": { + "mode": "HORIZONTAL", + "gap": 6, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "name": "chipAll", + "type": "INSTANCE", + "x": 0, + "y": 3.5, + "width": 22, + "height": 17, + "component": "Chip/Primary/Accent/SM", + "componentId": "1:981", + "fills": [{"type": "SOLID", "color": "#FF4FA3"}], + "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": "accent/accent"}, + "texts": ["All"] + }, + { + "name": "chipAdventure", + "type": "INSTANCE", + "x": 28, + "y": 0, + "width": 77, + "height": 24, + "component": "Gameplane/Tag", + "componentId": "1:1142", + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "cornerRadius": 999, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [4, 10, 4, 10], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "HUG"] + }, + "variables": {"strokes/0/color": "border/border"}, + "texts": ["Adventure"] + }, + { + "name": "chipTech", + "type": "INSTANCE", + "x": 111, + "y": 0, + "width": 46, + "height": 24, + "component": "Gameplane/Tag", + "componentId": "1:1142", + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "cornerRadius": 999, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [4, 10, 4, 10], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "HUG"] + }, + "variables": {"strokes/0/color": "border/border"}, + "texts": ["Tech"] + }, + { + "name": "chipMagic", + "type": "INSTANCE", + "x": 163, + "y": 0, + "width": 54, + "height": 24, + "component": "Gameplane/Tag", + "componentId": "1:1142", + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "cornerRadius": 999, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [4, 10, 4, 10], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "HUG"] + }, + "variables": {"strokes/0/color": "border/border"}, + "texts": ["Magic"] + }, + { + "name": "chipOptimized", + "type": "INSTANCE", + "x": 223, + "y": 0, + "width": 77, + "height": 24, + "component": "Gameplane/Tag", + "componentId": "1:1142", + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "cornerRadius": 999, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [4, 10, 4, 10], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "HUG"] + }, + "variables": {"strokes/0/color": "border/border"}, + "texts": ["Optimized"] + }, + { + "name": "chipMultiplayer", + "type": "INSTANCE", + "x": 306, + "y": 0, + "width": 82, + "height": 24, + "component": "Gameplane/Tag", + "componentId": "1:1142", + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "cornerRadius": 999, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [4, 10, 4, 10], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "HUG"] + }, + "variables": {"strokes/0/color": "border/border"}, + "texts": ["Multiplayer"] + } + ] + }, + { + "name": "Modpacks Grid", + "type": "FRAME", + "x": 24, + "y": 442, + "width": 1132, + "height": 220, + "layout": { + "mode": "VERTICAL", + "gap": 8, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "name": "Row 1", + "type": "FRAME", + "x": 0, + "y": 0, + "width": 1132, + "height": 68, + "layout": { + "mode": "HORIZONTAL", + "gap": 8, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "name": "Card Fabulously Optimized", + "type": "FRAME", + "x": 0, + "y": 0, + "width": 562, + "height": 68, + "fills": [{"type": "SOLID", "color": "#1C1A20"}], + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "cornerRadius": 12, + "layout": { + "mode": "HORIZONTAL", + "gap": 12, + "padding": [16, 16, 16, 16], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutGrow": 1, + "variables": { + "cornerRadius": "radius/xl", + "paddingTop": "spacing/4", + "paddingRight": "spacing/4", + "paddingBottom": "spacing/4", + "paddingLeft": "spacing/4", + "fills/0/color": "surface/surface", + "strokes/0/color": "border/border" + }, + "children": [ + { + "name": "Cover", + "type": "FRAME", + "x": 16, + "y": 16, + "width": 36, + "height": 36, + "fills": [{"type": "SOLID", "color": "#00000000", "opacity": 0}], + "cornerRadius": 4, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "CENTER", + "counter": "CENTER", + "sizing": ["FIXED", "FIXED"] + }, + "children": [ + { + "name": "Icon", + "type": "FRAME", + "x": 8, + "y": 8, + "width": 20, + "height": 20, + "variables": {"fills/0/color": "muted"}, + "children": [ + { + "name": "path", + "type": "VECTOR", + "x": 2.5, + "y": 1.67, + "width": 15, + "height": 16.67, + "strokes": [{"type": "SOLID", "color": "#9E98A6"}], + "strokeWeight": 1.67 + }, + { + "name": "path", + "type": "VECTOR", + "x": 2.74, + "y": 3.56, + "width": 14.52, + "height": 6.44, + "strokes": [{"type": "SOLID", "color": "#9E98A6"}], + "strokeWeight": 1.67 + } + ] + } + ] + }, + { + "name": "Info", + "type": "FRAME", + "x": 64, + "y": 17, + "width": 404, + "height": 34, + "layout": { + "mode": "VERTICAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutGrow": 1, + "children": [ + { + "name": "text", + "type": "TEXT", + "x": 0, + "y": 0, + "width": 142, + "height": 18, + "fills": [{"type": "SOLID", "color": "#F5F3F7"}], + "text": "Fabulously Optimized", + "font": ["Geist", 500, 14], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + }, + { + "name": "text", + "type": "TEXT", + "x": 0, + "y": 18, + "width": 157, + "height": 16, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "text": "robotkoer · 14.2M downloads", + "font": ["Geist", 400, 12], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "muted"} + } + ] + }, + { + "name": "Btn Install", + "type": "INSTANCE", + "x": 480, + "y": 18, + "width": 66, + "height": 32, + "component": "Gameplane/Button/Small/Default", + "componentId": "1:709", + "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": ["Install…"] + } + ] + }, + { + "name": "Card Vanilla Perfected", + "type": "FRAME", + "x": 570, + "y": 0, + "width": 562, + "height": 68, + "fills": [{"type": "SOLID", "color": "#1C1A20"}], + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "cornerRadius": 12, + "layout": { + "mode": "HORIZONTAL", + "gap": 12, + "padding": [16, 16, 16, 16], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutGrow": 1, + "variables": { + "cornerRadius": "radius/xl", + "paddingTop": "spacing/4", + "paddingRight": "spacing/4", + "paddingBottom": "spacing/4", + "paddingLeft": "spacing/4", + "fills/0/color": "surface/surface", + "strokes/0/color": "border/border" + }, + "children": [ + { + "name": "Cover", + "type": "FRAME", + "x": 16, + "y": 16, + "width": 36, + "height": 36, + "fills": [{"type": "SOLID", "color": "#00000000", "opacity": 0}], + "cornerRadius": 4, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "CENTER", + "counter": "CENTER", + "sizing": ["FIXED", "FIXED"] + }, + "children": [ + { + "name": "Icon", + "type": "FRAME", + "x": 8, + "y": 8, + "width": 20, + "height": 20, + "variables": {"fills/0/color": "muted"}, + "children": [ + { + "name": "path", + "type": "VECTOR", + "x": 2.5, + "y": 1.67, + "width": 15, + "height": 16.67, + "strokes": [{"type": "SOLID", "color": "#9E98A6"}], + "strokeWeight": 1.67 + }, + { + "name": "path", + "type": "VECTOR", + "x": 2.74, + "y": 3.56, + "width": 14.52, + "height": 6.44, + "strokes": [{"type": "SOLID", "color": "#9E98A6"}], + "strokeWeight": 1.67 + } + ] + } + ] + }, + { + "name": "Info", + "type": "FRAME", + "x": 64, + "y": 17, + "width": 404, + "height": 34, + "layout": { + "mode": "VERTICAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutGrow": 1, + "children": [ + { + "name": "text", + "type": "TEXT", + "x": 0, + "y": 0, + "width": 112, + "height": 18, + "fills": [{"type": "SOLID", "color": "#F5F3F7"}], + "text": "Vanilla Perfected", + "font": ["Geist", 500, 14], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + }, + { + "name": "text", + "type": "TEXT", + "x": 0, + "y": 18, + "width": 157, + "height": 16, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "text": "demonjoeTV · 2M downloads", + "font": ["Geist", 400, 12], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "muted"} + } + ] + }, + { + "name": "Btn Install", + "type": "INSTANCE", + "x": 480, + "y": 18, + "width": 66, + "height": 32, + "component": "Gameplane/Button/Small/Default", + "componentId": "1:709", + "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": ["Install…"] + } + ] + } + ] + }, + { + "name": "Row 2", + "type": "FRAME", + "x": 0, + "y": 76, + "width": 1132, + "height": 68, + "layout": { + "mode": "HORIZONTAL", + "gap": 8, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "name": "Card OptiFabric", + "type": "FRAME", + "x": 0, + "y": 0, + "width": 562, + "height": 68, + "fills": [{"type": "SOLID", "color": "#1C1A20"}], + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "cornerRadius": 12, + "layout": { + "mode": "HORIZONTAL", + "gap": 12, + "padding": [16, 16, 16, 16], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutGrow": 1, + "variables": { + "cornerRadius": "radius/xl", + "paddingTop": "spacing/4", + "paddingRight": "spacing/4", + "paddingBottom": "spacing/4", + "paddingLeft": "spacing/4", + "fills/0/color": "surface/surface", + "strokes/0/color": "border/border" + }, + "children": [ + { + "name": "Cover", + "type": "FRAME", + "x": 16, + "y": 16, + "width": 36, + "height": 36, + "fills": [{"type": "SOLID", "color": "#00000000", "opacity": 0}], + "cornerRadius": 4, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "CENTER", + "counter": "CENTER", + "sizing": ["FIXED", "FIXED"] + }, + "children": [ + { + "name": "Icon", + "type": "FRAME", + "x": 8, + "y": 8, + "width": 20, + "height": 20, + "variables": {"fills/0/color": "muted"}, + "children": [ + { + "name": "path", + "type": "VECTOR", + "x": 2.5, + "y": 1.67, + "width": 15, + "height": 16.67, + "strokes": [{"type": "SOLID", "color": "#9E98A6"}], + "strokeWeight": 1.67 + }, + { + "name": "path", + "type": "VECTOR", + "x": 2.74, + "y": 3.56, + "width": 14.52, + "height": 6.44, + "strokes": [{"type": "SOLID", "color": "#9E98A6"}], + "strokeWeight": 1.67 + } + ] + } + ] + }, + { + "name": "Info", + "type": "FRAME", + "x": 64, + "y": 17, + "width": 404, + "height": 34, + "layout": { + "mode": "VERTICAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutGrow": 1, + "children": [ + { + "name": "text", + "type": "TEXT", + "x": 0, + "y": 0, + "width": 69, + "height": 18, + "fills": [{"type": "SOLID", "color": "#F5F3F7"}], + "text": "OptiFabric", + "font": ["Geist", 500, 14], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + }, + { + "name": "text", + "type": "TEXT", + "x": 0, + "y": 18, + "width": 144, + "height": 16, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "text": "Creamer · 1.5M downloads", + "font": ["Geist", 400, 12], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "muted"} + } + ] + }, + { + "name": "Btn Install", + "type": "INSTANCE", + "x": 480, + "y": 18, + "width": 66, + "height": 32, + "component": "Gameplane/Button/Small/Default", + "componentId": "1:709", + "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": ["Install…"] + } + ] + }, + { + "name": "Card Remarkably Optimized", + "type": "FRAME", + "x": 570, + "y": 0, + "width": 562, + "height": 68, + "fills": [{"type": "SOLID", "color": "#1C1A20"}], + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "cornerRadius": 12, + "layout": { + "mode": "HORIZONTAL", + "gap": 12, + "padding": [16, 16, 16, 16], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutGrow": 1, + "variables": { + "cornerRadius": "radius/xl", + "paddingTop": "spacing/4", + "paddingRight": "spacing/4", + "paddingBottom": "spacing/4", + "paddingLeft": "spacing/4", + "fills/0/color": "surface/surface", + "strokes/0/color": "border/border" + }, + "children": [ + { + "name": "Cover", + "type": "FRAME", + "x": 16, + "y": 16, + "width": 36, + "height": 36, + "fills": [{"type": "SOLID", "color": "#00000000", "opacity": 0}], + "cornerRadius": 4, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "CENTER", + "counter": "CENTER", + "sizing": ["FIXED", "FIXED"] + }, + "children": [ + { + "name": "Icon", + "type": "FRAME", + "x": 8, + "y": 8, + "width": 20, + "height": 20, + "variables": {"fills/0/color": "muted"}, + "children": [ + { + "name": "path", + "type": "VECTOR", + "x": 2.5, + "y": 1.67, + "width": 15, + "height": 16.67, + "strokes": [{"type": "SOLID", "color": "#9E98A6"}], + "strokeWeight": 1.67 + }, + { + "name": "path", + "type": "VECTOR", + "x": 2.74, + "y": 3.56, + "width": 14.52, + "height": 6.44, + "strokes": [{"type": "SOLID", "color": "#9E98A6"}], + "strokeWeight": 1.67 + } + ] + } + ] + }, + { + "name": "Info", + "type": "FRAME", + "x": 64, + "y": 17, + "width": 404, + "height": 34, + "layout": { + "mode": "VERTICAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutGrow": 1, + "children": [ + { + "name": "text", + "type": "TEXT", + "x": 0, + "y": 0, + "width": 149, + "height": 18, + "fills": [{"type": "SOLID", "color": "#F5F3F7"}], + "text": "Remarkably Optimized", + "font": ["Geist", 500, 14], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + }, + { + "name": "text", + "type": "TEXT", + "x": 0, + "y": 18, + "width": 159, + "height": 16, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "text": "ThatOneJay · 1.1M downloads", + "font": ["Geist", 400, 12], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "muted"} + } + ] + }, + { + "name": "Btn Install", + "type": "INSTANCE", + "x": 480, + "y": 18, + "width": 66, + "height": 32, + "component": "Gameplane/Button/Small/Default", + "componentId": "1:709", + "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": ["Install…"] + } + ] + } + ] + }, + { + "name": "Row 3", + "type": "FRAME", + "x": 0, + "y": 152, + "width": 1132, + "height": 68, + "layout": { + "mode": "HORIZONTAL", + "gap": 8, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "name": "Card FPS Modpack", + "type": "FRAME", + "x": 0, + "y": 0, + "width": 562, + "height": 68, + "fills": [{"type": "SOLID", "color": "#1C1A20"}], + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "cornerRadius": 12, + "layout": { + "mode": "HORIZONTAL", + "gap": 12, + "padding": [16, 16, 16, 16], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutGrow": 1, + "variables": { + "cornerRadius": "radius/xl", + "paddingTop": "spacing/4", + "paddingRight": "spacing/4", + "paddingBottom": "spacing/4", + "paddingLeft": "spacing/4", + "fills/0/color": "surface/surface", + "strokes/0/color": "border/border" + }, + "children": [ + { + "name": "Cover", + "type": "FRAME", + "x": 16, + "y": 16, + "width": 36, + "height": 36, + "fills": [{"type": "SOLID", "color": "#00000000", "opacity": 0}], + "cornerRadius": 4, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "CENTER", + "counter": "CENTER", + "sizing": ["FIXED", "FIXED"] + }, + "children": [ + { + "name": "Icon", + "type": "FRAME", + "x": 8, + "y": 8, + "width": 20, + "height": 20, + "variables": {"fills/0/color": "muted"}, + "children": [ + { + "name": "path", + "type": "VECTOR", + "x": 2.5, + "y": 1.67, + "width": 15, + "height": 16.67, + "strokes": [{"type": "SOLID", "color": "#9E98A6"}], + "strokeWeight": 1.67 + }, + { + "name": "path", + "type": "VECTOR", + "x": 2.74, + "y": 3.56, + "width": 14.52, + "height": 6.44, + "strokes": [{"type": "SOLID", "color": "#9E98A6"}], + "strokeWeight": 1.67 + } + ] + } + ] + }, + { + "name": "Info", + "type": "FRAME", + "x": 64, + "y": 17, + "width": 404, + "height": 34, + "layout": { + "mode": "VERTICAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutGrow": 1, + "children": [ + { + "name": "text", + "type": "TEXT", + "x": 0, + "y": 0, + "width": 92, + "height": 18, + "fills": [{"type": "SOLID", "color": "#F5F3F7"}], + "text": "FPS Modpack", + "font": ["Geist", 500, 14], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + }, + { + "name": "text", + "type": "TEXT", + "x": 0, + "y": 18, + "width": 163, + "height": 16, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "text": "MIRRONAKE · 1.1M downloads", + "font": ["Geist", 400, 12], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "muted"} + } + ] + }, + { + "name": "Btn Install", + "type": "INSTANCE", + "x": 480, + "y": 18, + "width": 66, + "height": 32, + "component": "Gameplane/Button/Small/Default", + "componentId": "1:709", + "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": ["Install…"] + } + ] + }, + { + "name": "Card Fresh & Smooth", + "type": "FRAME", + "x": 570, + "y": 0, + "width": 562, + "height": 68, + "fills": [{"type": "SOLID", "color": "#1C1A20"}], + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "cornerRadius": 12, + "layout": { + "mode": "HORIZONTAL", + "gap": 12, + "padding": [16, 16, 16, 16], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutGrow": 1, + "variables": { + "cornerRadius": "radius/xl", + "paddingTop": "spacing/4", + "paddingRight": "spacing/4", + "paddingBottom": "spacing/4", + "paddingLeft": "spacing/4", + "fills/0/color": "surface/surface", + "strokes/0/color": "border/border" + }, + "children": [ + { + "name": "Cover", + "type": "FRAME", + "x": 16, + "y": 16, + "width": 36, + "height": 36, + "fills": [{"type": "SOLID", "color": "#00000000", "opacity": 0}], + "cornerRadius": 4, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "CENTER", + "counter": "CENTER", + "sizing": ["FIXED", "FIXED"] + }, + "children": [ + { + "name": "Icon", + "type": "FRAME", + "x": 8, + "y": 8, + "width": 20, + "height": 20, + "variables": {"fills/0/color": "muted"}, + "children": [ + { + "name": "path", + "type": "VECTOR", + "x": 2.5, + "y": 1.67, + "width": 15, + "height": 16.67, + "strokes": [{"type": "SOLID", "color": "#9E98A6"}], + "strokeWeight": 1.67 + }, + { + "name": "path", + "type": "VECTOR", + "x": 2.74, + "y": 3.56, + "width": 14.52, + "height": 6.44, + "strokes": [{"type": "SOLID", "color": "#9E98A6"}], + "strokeWeight": 1.67 + } + ] + } + ] + }, + { + "name": "Info", + "type": "FRAME", + "x": 64, + "y": 17, + "width": 404, + "height": 34, + "layout": { + "mode": "VERTICAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutGrow": 1, + "children": [ + { + "name": "text", + "type": "TEXT", + "x": 0, + "y": 0, + "width": 104, + "height": 18, + "fills": [{"type": "SOLID", "color": "#F5F3F7"}], + "text": "Fresh & Smooth", + "font": ["Geist", 500, 14], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + }, + { + "name": "text", + "type": "TEXT", + "x": 0, + "y": 18, + "width": 176, + "height": 16, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "text": "EndarPacks · 864.3K downloads", + "font": ["Geist", 400, 12], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "muted"} + } + ] + }, + { + "name": "Btn Install", + "type": "INSTANCE", + "x": 480, + "y": 18, + "width": 66, + "height": 32, + "component": "Gameplane/Button/Small/Default", + "componentId": "1:709", + "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": ["Install…"] + } + ] + } + ] + } + ] + }, + { + "name": "Load More Row", + "type": "FRAME", + "x": 24, + "y": 678, + "width": 1132, + "height": 32, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "CENTER", + "counter": "MIN", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "name": "Btn Load More", + "type": "INSTANCE", + "x": 521.5, + "y": 0, + "width": 89, + "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": ["HUG", "HUG"] + }, + "variables": {"strokes/0/color": "border/border"}, + "texts": ["Load more"] + } + ] + } + ] + } + ] + }, + { + "name": "Dim Overlay", + "type": "RECTANGLE", + "x": 0, + "y": 0, + "width": 1440, + "height": 900, + "fills": [{"type": "SOLID", "color": "#000000", "opacity": 0.8}], + "absolute": true + }, + { + "name": "Confirm Downgrade Dialog", + "type": "FRAME", + "x": 460, + "y": 110, + "width": 520, + "height": 415, + "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"] + }, + "absolute": true, + "variables": { + "cornerRadius": "radius/xl", + "fills/0/color": "surface/surface", + "strokes/0/color": "border/border" + }, + "children": [ + { + "name": "mTitle", + "type": "TEXT", + "x": 20, + "y": 20, + "width": 130, + "height": 24, + "fills": [{"type": "SOLID", "color": "#F5F3F7"}], + "text": "Go back to 6.3.1?", + "font": ["Geist", 600, 16], + "lineHeight": {"value": 150, "unit": "PERCENT"}, + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + }, + { + "name": "mDescWrap", + "type": "FRAME", + "x": 20, + "y": 44, + "width": 480, + "height": 25, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [4, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "name": "mDesc", + "type": "TEXT", + "x": 0, + "y": 4, + "width": 480, + "height": 21, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "layoutGrow": 1, + "text": "mc-modded restarts on Fabulously Optimized 6.3.1 instead of 6.4.0.", + "font": ["Geist", 400, 14], + "lineHeight": {"value": 150, "unit": "PERCENT"}, + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "muted"} + } + ] + }, + { + "name": "mBody", + "type": "FRAME", + "x": 20, + "y": 69, + "width": 480, + "height": 274, + "layout": { + "mode": "VERTICAL", + "gap": 16, + "padding": [16, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "name": "Downgrade Warning", + "type": "INSTANCE", + "x": 0, + "y": 16, + "width": 480, + "height": 102, + "component": "Alert/Warning", + "componentId": "1:2268", + "fills": [{"type": "SOLID", "color": "#F7B750", "opacity": 0.15}], + "strokes": [{"type": "SOLID", "color": "#F7B750"}], + "strokeWeight": 1, + "effects": [{"type": "DROP_SHADOW", "radius": 4, "visible": true}], + "cornerRadius": 8, + "layout": { + "mode": "HORIZONTAL", + "gap": 16, + "padding": [12, 16, 12, 16], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"fills/0/color": "warning/soft", "strokes/0/color": "warning/soft-foreground"}, + "texts": [ + "This is an older version", + "Going back to an older version can break the world, for example when it removes blocks or items the world already uses. Keep the backup." + ] + }, + { + "name": "Pack Summary", + "type": "INSTANCE", + "x": 0, + "y": 134, + "width": 480, + "height": 64, + "component": "Gameplane/Modpack Summary", + "fills": [{"type": "SOLID", "color": "#17151A"}], + "cornerRadius": 8, + "layout": { + "mode": "HORIZONTAL", + "gap": 12, + "padding": [12, 12, 12, 12], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"fills/0/color": "surface/secondary"}, + "texts": ["Fabulously Optimized", "Modrinth · 6.3.1", "Release"] + }, + { + "name": "Backup First", + "type": "INSTANCE", + "x": 0, + "y": 214, + "width": 480, + "height": 60, + "component": "Gameplane/Backup First Option", + "layout": { + "mode": "VERTICAL", + "gap": 4, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "texts": [ + "Back up first", + "Takes a backup to the cluster’s backup destination (s3-backups) before the change. If the backup fails, nothing changes." + ] + } + ] + }, + { + "name": "mFooter", + "type": "FRAME", + "x": 20, + "y": 343, + "width": 480, + "height": 52, + "layout": { + "mode": "HORIZONTAL", + "gap": 8, + "padding": [20, 0, 0, 0], + "primary": "MAX", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "name": "btnCancel", + "type": "FRAME", + "x": 255, + "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": [ + { + "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"} + } + ] + }, + { + "name": "btnPrimary", + "type": "FRAME", + "x": 327, + "y": 20, + "width": 153, + "height": 32, + "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": [ + { + "name": "text", + "type": "TEXT", + "x": 12, + "y": 8, + "width": 129, + "height": 16, + "fills": [{"type": "SOLID", "color": "#FFFFFF"}], + "text": "Downgrade and restart", + "font": ["Geist", 500, 12], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "accent/foreground"} + } + ] + } + ] + } + ] + } + ] +} diff --git a/assets/design-export/json/1274632774-2112.json b/assets/design-export/json/1274632774-2112.json new file mode 100644 index 000000000..dbec1556d --- /dev/null +++ b/assets/design-export/json/1274632774-2112.json @@ -0,0 +1,1759 @@ +{ + "file": "1274632774-2112", + "name": "Screen/Server Detail — Modpacks — Remove", + "type": "FRAME", + "x": 9840, + "y": 32970, + "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" + ] + }, + { + "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", "test-server-02", "Search servers…", "AD"] + }, + { + "name": "Body", + "type": "FRAME", + "x": 0, + "y": 64, + "width": 1180, + "height": 836, + "fills": [{"type": "SOLID", "color": "#121114"}], + "layout": { + "mode": "VERTICAL", + "gap": 16, + "padding": [24, 24, 24, 24], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "FIXED"] + }, + "layoutGrow": 1, + "layoutAlignSelf": "STRETCH", + "variables": {"fills/0/color": "background/background"}, + "children": [ + { + "name": "Detail Header", + "type": "INSTANCE", + "x": 24, + "y": 24, + "width": 1132, + "height": 78, + "component": "Gameplane/Server Detail Header", + "componentId": "1:447", + "fills": [{"type": "SOLID", "color": "#121114"}], + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [8, 0, 16, 0], + "primary": "SPACE_BETWEEN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"fills/0/color": "background/background"}, + "texts": [ + "MI", + "test-server-02", + "Running", + "minecraft-java · fabric 1.21.1 · ns: default · up 13d 4h", + "Restart", + "Stop", + "Open console" + ] + }, + { + "name": "Tabs Bar", + "type": "INSTANCE", + "x": 24, + "y": 118, + "width": 1132, + "height": 40, + "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": [0, 0, 0, 0], + "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" + ] + }, + { + "name": "Active Modpack Card", + "type": "INSTANCE", + "x": 24, + "y": 174, + "width": 1132, + "height": 106, + "component": "Gameplane/Active Modpack Card", + "fills": [{"type": "SOLID", "color": "#1C1A20"}], + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "cornerRadius": 12, + "layout": { + "mode": "VERTICAL", + "gap": 12, + "padding": [16, 16, 16, 16], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"fills/0/color": "surface/surface", "strokes/0/color": "border/border"}, + "texts": [ + "Active modpack", + "Fabulously Optimized", + "Modrinth", + "Applied", + "Version 6.4.0 · pinned · Minecraft 1.21.1 · Fabric", + "Change version", + "Remove" + ] + }, + { + "name": "Modpacks Heading", + "type": "FRAME", + "x": 24, + "y": 296, + "width": 1132, + "height": 34, + "layout": { + "mode": "VERTICAL", + "gap": 2, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "name": "heading", + "type": "TEXT", + "x": 0, + "y": 0, + "width": 119, + "height": 18, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "text": "Browse modpacks", + "font": ["Geist", 400, 14], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "muted"} + }, + { + "name": "subheading", + "type": "TEXT", + "x": 0, + "y": 20, + "width": 1132, + "height": 14, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "layoutAlignSelf": "STRETCH", + "text": "Pick a pack and a version. The server pins that version and restarts to install it; a restart never upgrades it.", + "font": ["Geist", 400, 11], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "muted"} + } + ] + }, + { + "name": "Filters Row", + "type": "FRAME", + "x": 24, + "y": 346, + "width": 1132, + "height": 40, + "layout": { + "mode": "HORIZONTAL", + "gap": 8, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "name": "Provider Switch", + "type": "INSTANCE", + "x": 0, + "y": 0, + "width": 266, + "height": 40, + "component": "Gameplane/Provider Switch", + "fills": [{"type": "SOLID", "color": "#232128"}], + "cornerRadius": 20, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [4, 4, 4, 4], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "HUG"] + }, + "variables": {"fills/0/color": "default/default"}, + "texts": ["Modrinth", "CurseForge", "FTB"] + }, + { + "name": "Search", + "type": "INSTANCE", + "x": 274, + "y": 2, + "width": 630, + "height": 36, + "component": "Gameplane/Search Input", + "componentId": "1:975", + "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": 6, + "padding": [0, 12, 0, 12], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "FIXED"] + }, + "layoutGrow": 1, + "variables": { + "cornerRadius": "radius/xl", + "fills/0/color": "field/background", + "strokes/0/color": "field/border" + }, + "texts": ["Search modpacks…"] + }, + { + "name": "Select", + "type": "INSTANCE", + "x": 912, + "y": 2, + "width": 220, + "height": 36, + "component": "Gameplane/Select", + "componentId": "1:311", + "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": "SPACE_BETWEEN", + "counter": "CENTER", + "sizing": ["FIXED", "FIXED"] + }, + "variables": { + "cornerRadius": "radius/xl", + "fills/0/color": "field/background", + "strokes/0/color": "field/border" + }, + "texts": ["Sort: Downloads"] + } + ] + }, + { + "name": "Category Chips", + "type": "FRAME", + "x": 24, + "y": 402, + "width": 1132, + "height": 24, + "layout": { + "mode": "HORIZONTAL", + "gap": 6, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "name": "chipAll", + "type": "INSTANCE", + "x": 0, + "y": 3.5, + "width": 22, + "height": 17, + "component": "Chip/Primary/Accent/SM", + "componentId": "1:981", + "fills": [{"type": "SOLID", "color": "#FF4FA3"}], + "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": "accent/accent"}, + "texts": ["All"] + }, + { + "name": "chipAdventure", + "type": "INSTANCE", + "x": 28, + "y": 0, + "width": 77, + "height": 24, + "component": "Gameplane/Tag", + "componentId": "1:1142", + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "cornerRadius": 999, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [4, 10, 4, 10], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "HUG"] + }, + "variables": {"strokes/0/color": "border/border"}, + "texts": ["Adventure"] + }, + { + "name": "chipTech", + "type": "INSTANCE", + "x": 111, + "y": 0, + "width": 46, + "height": 24, + "component": "Gameplane/Tag", + "componentId": "1:1142", + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "cornerRadius": 999, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [4, 10, 4, 10], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "HUG"] + }, + "variables": {"strokes/0/color": "border/border"}, + "texts": ["Tech"] + }, + { + "name": "chipMagic", + "type": "INSTANCE", + "x": 163, + "y": 0, + "width": 54, + "height": 24, + "component": "Gameplane/Tag", + "componentId": "1:1142", + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "cornerRadius": 999, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [4, 10, 4, 10], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "HUG"] + }, + "variables": {"strokes/0/color": "border/border"}, + "texts": ["Magic"] + }, + { + "name": "chipOptimized", + "type": "INSTANCE", + "x": 223, + "y": 0, + "width": 77, + "height": 24, + "component": "Gameplane/Tag", + "componentId": "1:1142", + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "cornerRadius": 999, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [4, 10, 4, 10], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "HUG"] + }, + "variables": {"strokes/0/color": "border/border"}, + "texts": ["Optimized"] + }, + { + "name": "chipMultiplayer", + "type": "INSTANCE", + "x": 306, + "y": 0, + "width": 82, + "height": 24, + "component": "Gameplane/Tag", + "componentId": "1:1142", + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "cornerRadius": 999, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [4, 10, 4, 10], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "HUG"] + }, + "variables": {"strokes/0/color": "border/border"}, + "texts": ["Multiplayer"] + } + ] + }, + { + "name": "Modpacks Grid", + "type": "FRAME", + "x": 24, + "y": 442, + "width": 1132, + "height": 220, + "layout": { + "mode": "VERTICAL", + "gap": 8, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "name": "Row 1", + "type": "FRAME", + "x": 0, + "y": 0, + "width": 1132, + "height": 68, + "layout": { + "mode": "HORIZONTAL", + "gap": 8, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "name": "Card Fabulously Optimized", + "type": "FRAME", + "x": 0, + "y": 0, + "width": 562, + "height": 68, + "fills": [{"type": "SOLID", "color": "#1C1A20"}], + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "cornerRadius": 12, + "layout": { + "mode": "HORIZONTAL", + "gap": 12, + "padding": [16, 16, 16, 16], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutGrow": 1, + "variables": { + "cornerRadius": "radius/xl", + "paddingTop": "spacing/4", + "paddingRight": "spacing/4", + "paddingBottom": "spacing/4", + "paddingLeft": "spacing/4", + "fills/0/color": "surface/surface", + "strokes/0/color": "border/border" + }, + "children": [ + { + "name": "Cover", + "type": "FRAME", + "x": 16, + "y": 16, + "width": 36, + "height": 36, + "fills": [{"type": "SOLID", "color": "#00000000", "opacity": 0}], + "cornerRadius": 4, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "CENTER", + "counter": "CENTER", + "sizing": ["FIXED", "FIXED"] + }, + "children": [ + { + "name": "Icon", + "type": "FRAME", + "x": 8, + "y": 8, + "width": 20, + "height": 20, + "variables": {"fills/0/color": "muted"}, + "children": [ + { + "name": "path", + "type": "VECTOR", + "x": 2.5, + "y": 1.67, + "width": 15, + "height": 16.67, + "strokes": [{"type": "SOLID", "color": "#9E98A6"}], + "strokeWeight": 1.67 + }, + { + "name": "path", + "type": "VECTOR", + "x": 2.74, + "y": 3.56, + "width": 14.52, + "height": 6.44, + "strokes": [{"type": "SOLID", "color": "#9E98A6"}], + "strokeWeight": 1.67 + } + ] + } + ] + }, + { + "name": "Info", + "type": "FRAME", + "x": 64, + "y": 17, + "width": 404, + "height": 34, + "layout": { + "mode": "VERTICAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutGrow": 1, + "children": [ + { + "name": "text", + "type": "TEXT", + "x": 0, + "y": 0, + "width": 142, + "height": 18, + "fills": [{"type": "SOLID", "color": "#F5F3F7"}], + "text": "Fabulously Optimized", + "font": ["Geist", 500, 14], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + }, + { + "name": "text", + "type": "TEXT", + "x": 0, + "y": 18, + "width": 157, + "height": 16, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "text": "robotkoer · 14.2M downloads", + "font": ["Geist", 400, 12], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "muted"} + } + ] + }, + { + "name": "Btn Install", + "type": "INSTANCE", + "x": 480, + "y": 18, + "width": 66, + "height": 32, + "component": "Gameplane/Button/Small/Default", + "componentId": "1:709", + "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": ["Install…"] + } + ] + }, + { + "name": "Card Vanilla Perfected", + "type": "FRAME", + "x": 570, + "y": 0, + "width": 562, + "height": 68, + "fills": [{"type": "SOLID", "color": "#1C1A20"}], + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "cornerRadius": 12, + "layout": { + "mode": "HORIZONTAL", + "gap": 12, + "padding": [16, 16, 16, 16], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutGrow": 1, + "variables": { + "cornerRadius": "radius/xl", + "paddingTop": "spacing/4", + "paddingRight": "spacing/4", + "paddingBottom": "spacing/4", + "paddingLeft": "spacing/4", + "fills/0/color": "surface/surface", + "strokes/0/color": "border/border" + }, + "children": [ + { + "name": "Cover", + "type": "FRAME", + "x": 16, + "y": 16, + "width": 36, + "height": 36, + "fills": [{"type": "SOLID", "color": "#00000000", "opacity": 0}], + "cornerRadius": 4, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "CENTER", + "counter": "CENTER", + "sizing": ["FIXED", "FIXED"] + }, + "children": [ + { + "name": "Icon", + "type": "FRAME", + "x": 8, + "y": 8, + "width": 20, + "height": 20, + "variables": {"fills/0/color": "muted"}, + "children": [ + { + "name": "path", + "type": "VECTOR", + "x": 2.5, + "y": 1.67, + "width": 15, + "height": 16.67, + "strokes": [{"type": "SOLID", "color": "#9E98A6"}], + "strokeWeight": 1.67 + }, + { + "name": "path", + "type": "VECTOR", + "x": 2.74, + "y": 3.56, + "width": 14.52, + "height": 6.44, + "strokes": [{"type": "SOLID", "color": "#9E98A6"}], + "strokeWeight": 1.67 + } + ] + } + ] + }, + { + "name": "Info", + "type": "FRAME", + "x": 64, + "y": 17, + "width": 404, + "height": 34, + "layout": { + "mode": "VERTICAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutGrow": 1, + "children": [ + { + "name": "text", + "type": "TEXT", + "x": 0, + "y": 0, + "width": 112, + "height": 18, + "fills": [{"type": "SOLID", "color": "#F5F3F7"}], + "text": "Vanilla Perfected", + "font": ["Geist", 500, 14], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + }, + { + "name": "text", + "type": "TEXT", + "x": 0, + "y": 18, + "width": 157, + "height": 16, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "text": "demonjoeTV · 2M downloads", + "font": ["Geist", 400, 12], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "muted"} + } + ] + }, + { + "name": "Btn Install", + "type": "INSTANCE", + "x": 480, + "y": 18, + "width": 66, + "height": 32, + "component": "Gameplane/Button/Small/Default", + "componentId": "1:709", + "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": ["Install…"] + } + ] + } + ] + }, + { + "name": "Row 2", + "type": "FRAME", + "x": 0, + "y": 76, + "width": 1132, + "height": 68, + "layout": { + "mode": "HORIZONTAL", + "gap": 8, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "name": "Card OptiFabric", + "type": "FRAME", + "x": 0, + "y": 0, + "width": 562, + "height": 68, + "fills": [{"type": "SOLID", "color": "#1C1A20"}], + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "cornerRadius": 12, + "layout": { + "mode": "HORIZONTAL", + "gap": 12, + "padding": [16, 16, 16, 16], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutGrow": 1, + "variables": { + "cornerRadius": "radius/xl", + "paddingTop": "spacing/4", + "paddingRight": "spacing/4", + "paddingBottom": "spacing/4", + "paddingLeft": "spacing/4", + "fills/0/color": "surface/surface", + "strokes/0/color": "border/border" + }, + "children": [ + { + "name": "Cover", + "type": "FRAME", + "x": 16, + "y": 16, + "width": 36, + "height": 36, + "fills": [{"type": "SOLID", "color": "#00000000", "opacity": 0}], + "cornerRadius": 4, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "CENTER", + "counter": "CENTER", + "sizing": ["FIXED", "FIXED"] + }, + "children": [ + { + "name": "Icon", + "type": "FRAME", + "x": 8, + "y": 8, + "width": 20, + "height": 20, + "variables": {"fills/0/color": "muted"}, + "children": [ + { + "name": "path", + "type": "VECTOR", + "x": 2.5, + "y": 1.67, + "width": 15, + "height": 16.67, + "strokes": [{"type": "SOLID", "color": "#9E98A6"}], + "strokeWeight": 1.67 + }, + { + "name": "path", + "type": "VECTOR", + "x": 2.74, + "y": 3.56, + "width": 14.52, + "height": 6.44, + "strokes": [{"type": "SOLID", "color": "#9E98A6"}], + "strokeWeight": 1.67 + } + ] + } + ] + }, + { + "name": "Info", + "type": "FRAME", + "x": 64, + "y": 17, + "width": 404, + "height": 34, + "layout": { + "mode": "VERTICAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutGrow": 1, + "children": [ + { + "name": "text", + "type": "TEXT", + "x": 0, + "y": 0, + "width": 69, + "height": 18, + "fills": [{"type": "SOLID", "color": "#F5F3F7"}], + "text": "OptiFabric", + "font": ["Geist", 500, 14], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + }, + { + "name": "text", + "type": "TEXT", + "x": 0, + "y": 18, + "width": 144, + "height": 16, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "text": "Creamer · 1.5M downloads", + "font": ["Geist", 400, 12], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "muted"} + } + ] + }, + { + "name": "Btn Install", + "type": "INSTANCE", + "x": 480, + "y": 18, + "width": 66, + "height": 32, + "component": "Gameplane/Button/Small/Default", + "componentId": "1:709", + "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": ["Install…"] + } + ] + }, + { + "name": "Card Remarkably Optimized", + "type": "FRAME", + "x": 570, + "y": 0, + "width": 562, + "height": 68, + "fills": [{"type": "SOLID", "color": "#1C1A20"}], + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "cornerRadius": 12, + "layout": { + "mode": "HORIZONTAL", + "gap": 12, + "padding": [16, 16, 16, 16], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutGrow": 1, + "variables": { + "cornerRadius": "radius/xl", + "paddingTop": "spacing/4", + "paddingRight": "spacing/4", + "paddingBottom": "spacing/4", + "paddingLeft": "spacing/4", + "fills/0/color": "surface/surface", + "strokes/0/color": "border/border" + }, + "children": [ + { + "name": "Cover", + "type": "FRAME", + "x": 16, + "y": 16, + "width": 36, + "height": 36, + "fills": [{"type": "SOLID", "color": "#00000000", "opacity": 0}], + "cornerRadius": 4, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "CENTER", + "counter": "CENTER", + "sizing": ["FIXED", "FIXED"] + }, + "children": [ + { + "name": "Icon", + "type": "FRAME", + "x": 8, + "y": 8, + "width": 20, + "height": 20, + "variables": {"fills/0/color": "muted"}, + "children": [ + { + "name": "path", + "type": "VECTOR", + "x": 2.5, + "y": 1.67, + "width": 15, + "height": 16.67, + "strokes": [{"type": "SOLID", "color": "#9E98A6"}], + "strokeWeight": 1.67 + }, + { + "name": "path", + "type": "VECTOR", + "x": 2.74, + "y": 3.56, + "width": 14.52, + "height": 6.44, + "strokes": [{"type": "SOLID", "color": "#9E98A6"}], + "strokeWeight": 1.67 + } + ] + } + ] + }, + { + "name": "Info", + "type": "FRAME", + "x": 64, + "y": 17, + "width": 404, + "height": 34, + "layout": { + "mode": "VERTICAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutGrow": 1, + "children": [ + { + "name": "text", + "type": "TEXT", + "x": 0, + "y": 0, + "width": 149, + "height": 18, + "fills": [{"type": "SOLID", "color": "#F5F3F7"}], + "text": "Remarkably Optimized", + "font": ["Geist", 500, 14], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + }, + { + "name": "text", + "type": "TEXT", + "x": 0, + "y": 18, + "width": 159, + "height": 16, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "text": "ThatOneJay · 1.1M downloads", + "font": ["Geist", 400, 12], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "muted"} + } + ] + }, + { + "name": "Btn Install", + "type": "INSTANCE", + "x": 480, + "y": 18, + "width": 66, + "height": 32, + "component": "Gameplane/Button/Small/Default", + "componentId": "1:709", + "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": ["Install…"] + } + ] + } + ] + }, + { + "name": "Row 3", + "type": "FRAME", + "x": 0, + "y": 152, + "width": 1132, + "height": 68, + "layout": { + "mode": "HORIZONTAL", + "gap": 8, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "name": "Card FPS Modpack", + "type": "FRAME", + "x": 0, + "y": 0, + "width": 562, + "height": 68, + "fills": [{"type": "SOLID", "color": "#1C1A20"}], + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "cornerRadius": 12, + "layout": { + "mode": "HORIZONTAL", + "gap": 12, + "padding": [16, 16, 16, 16], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutGrow": 1, + "variables": { + "cornerRadius": "radius/xl", + "paddingTop": "spacing/4", + "paddingRight": "spacing/4", + "paddingBottom": "spacing/4", + "paddingLeft": "spacing/4", + "fills/0/color": "surface/surface", + "strokes/0/color": "border/border" + }, + "children": [ + { + "name": "Cover", + "type": "FRAME", + "x": 16, + "y": 16, + "width": 36, + "height": 36, + "fills": [{"type": "SOLID", "color": "#00000000", "opacity": 0}], + "cornerRadius": 4, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "CENTER", + "counter": "CENTER", + "sizing": ["FIXED", "FIXED"] + }, + "children": [ + { + "name": "Icon", + "type": "FRAME", + "x": 8, + "y": 8, + "width": 20, + "height": 20, + "variables": {"fills/0/color": "muted"}, + "children": [ + { + "name": "path", + "type": "VECTOR", + "x": 2.5, + "y": 1.67, + "width": 15, + "height": 16.67, + "strokes": [{"type": "SOLID", "color": "#9E98A6"}], + "strokeWeight": 1.67 + }, + { + "name": "path", + "type": "VECTOR", + "x": 2.74, + "y": 3.56, + "width": 14.52, + "height": 6.44, + "strokes": [{"type": "SOLID", "color": "#9E98A6"}], + "strokeWeight": 1.67 + } + ] + } + ] + }, + { + "name": "Info", + "type": "FRAME", + "x": 64, + "y": 17, + "width": 404, + "height": 34, + "layout": { + "mode": "VERTICAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutGrow": 1, + "children": [ + { + "name": "text", + "type": "TEXT", + "x": 0, + "y": 0, + "width": 92, + "height": 18, + "fills": [{"type": "SOLID", "color": "#F5F3F7"}], + "text": "FPS Modpack", + "font": ["Geist", 500, 14], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + }, + { + "name": "text", + "type": "TEXT", + "x": 0, + "y": 18, + "width": 163, + "height": 16, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "text": "MIRRONAKE · 1.1M downloads", + "font": ["Geist", 400, 12], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "muted"} + } + ] + }, + { + "name": "Btn Install", + "type": "INSTANCE", + "x": 480, + "y": 18, + "width": 66, + "height": 32, + "component": "Gameplane/Button/Small/Default", + "componentId": "1:709", + "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": ["Install…"] + } + ] + }, + { + "name": "Card Fresh & Smooth", + "type": "FRAME", + "x": 570, + "y": 0, + "width": 562, + "height": 68, + "fills": [{"type": "SOLID", "color": "#1C1A20"}], + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "cornerRadius": 12, + "layout": { + "mode": "HORIZONTAL", + "gap": 12, + "padding": [16, 16, 16, 16], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutGrow": 1, + "variables": { + "cornerRadius": "radius/xl", + "paddingTop": "spacing/4", + "paddingRight": "spacing/4", + "paddingBottom": "spacing/4", + "paddingLeft": "spacing/4", + "fills/0/color": "surface/surface", + "strokes/0/color": "border/border" + }, + "children": [ + { + "name": "Cover", + "type": "FRAME", + "x": 16, + "y": 16, + "width": 36, + "height": 36, + "fills": [{"type": "SOLID", "color": "#00000000", "opacity": 0}], + "cornerRadius": 4, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "CENTER", + "counter": "CENTER", + "sizing": ["FIXED", "FIXED"] + }, + "children": [ + { + "name": "Icon", + "type": "FRAME", + "x": 8, + "y": 8, + "width": 20, + "height": 20, + "variables": {"fills/0/color": "muted"}, + "children": [ + { + "name": "path", + "type": "VECTOR", + "x": 2.5, + "y": 1.67, + "width": 15, + "height": 16.67, + "strokes": [{"type": "SOLID", "color": "#9E98A6"}], + "strokeWeight": 1.67 + }, + { + "name": "path", + "type": "VECTOR", + "x": 2.74, + "y": 3.56, + "width": 14.52, + "height": 6.44, + "strokes": [{"type": "SOLID", "color": "#9E98A6"}], + "strokeWeight": 1.67 + } + ] + } + ] + }, + { + "name": "Info", + "type": "FRAME", + "x": 64, + "y": 17, + "width": 404, + "height": 34, + "layout": { + "mode": "VERTICAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutGrow": 1, + "children": [ + { + "name": "text", + "type": "TEXT", + "x": 0, + "y": 0, + "width": 104, + "height": 18, + "fills": [{"type": "SOLID", "color": "#F5F3F7"}], + "text": "Fresh & Smooth", + "font": ["Geist", 500, 14], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + }, + { + "name": "text", + "type": "TEXT", + "x": 0, + "y": 18, + "width": 176, + "height": 16, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "text": "EndarPacks · 864.3K downloads", + "font": ["Geist", 400, 12], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "muted"} + } + ] + }, + { + "name": "Btn Install", + "type": "INSTANCE", + "x": 480, + "y": 18, + "width": 66, + "height": 32, + "component": "Gameplane/Button/Small/Default", + "componentId": "1:709", + "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": ["Install…"] + } + ] + } + ] + } + ] + }, + { + "name": "Load More Row", + "type": "FRAME", + "x": 24, + "y": 678, + "width": 1132, + "height": 32, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "CENTER", + "counter": "MIN", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "name": "Btn Load More", + "type": "INSTANCE", + "x": 521.5, + "y": 0, + "width": 89, + "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": ["HUG", "HUG"] + }, + "variables": {"strokes/0/color": "border/border"}, + "texts": ["Load more"] + } + ] + } + ] + } + ] + }, + { + "name": "Dim Overlay", + "type": "RECTANGLE", + "x": 0, + "y": 0, + "width": 1440, + "height": 900, + "fills": [{"type": "SOLID", "color": "#000000", "opacity": 0.8}], + "absolute": true + }, + { + "name": "Remove Modpack Dialog", + "type": "FRAME", + "x": 480, + "y": 160, + "width": 480, + "height": 329, + "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"] + }, + "absolute": true, + "variables": { + "cornerRadius": "radius/xl", + "fills/0/color": "surface/surface", + "strokes/0/color": "border/border" + }, + "children": [ + { + "name": "mTitle", + "type": "TEXT", + "x": 20, + "y": 20, + "width": 241, + "height": 24, + "fills": [{"type": "SOLID", "color": "#F5F3F7"}], + "text": "Remove Fabulously Optimized?", + "font": ["Geist", 600, 16], + "lineHeight": {"value": 150, "unit": "PERCENT"}, + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + }, + { + "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": [ + { + "name": "mDesc", + "type": "TEXT", + "x": 0, + "y": 4, + "width": 440, + "height": 21, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "layoutGrow": 1, + "text": "mc-modded restarts without a modpack.", + "font": ["Geist", 400, 14], + "lineHeight": {"value": 150, "unit": "PERCENT"}, + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "muted"} + } + ] + }, + { + "name": "mBody", + "type": "FRAME", + "x": 20, + "y": 69, + "width": 440, + "height": 188, + "layout": { + "mode": "VERTICAL", + "gap": 16, + "padding": [16, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "name": "Remove Warning", + "type": "INSTANCE", + "x": 0, + "y": 16, + "width": 440, + "height": 96, + "component": "Alert/Danger", + "componentId": "1:5528", + "fills": [{"type": "SOLID", "color": "#17151A"}], + "effects": [{"type": "DROP_SHADOW", "radius": 4, "visible": true}], + "cornerRadius": 24, + "layout": { + "mode": "HORIZONTAL", + "gap": 16, + "padding": [12, 16, 12, 16], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"cornerRadius": "radius/3xl", "fills/0/color": "surface/secondary"}, + "texts": [ + "Every mod in the mods folder is deleted", + "This includes mods you added by hand. World data and config files stay." + ] + }, + { + "name": "Backup First", + "type": "INSTANCE", + "x": 0, + "y": 128, + "width": 440, + "height": 60, + "component": "Gameplane/Backup First Option", + "layout": { + "mode": "VERTICAL", + "gap": 4, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "texts": [ + "Back up first", + "Takes a backup to the cluster’s backup destination (s3-backups) before the change. If the backup fails, nothing changes." + ] + } + ] + }, + { + "name": "mFooter", + "type": "FRAME", + "x": 20, + "y": 257, + "width": 440, + "height": 52, + "layout": { + "mode": "HORIZONTAL", + "gap": 8, + "padding": [20, 0, 0, 0], + "primary": "MAX", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "name": "btnCancel", + "type": "FRAME", + "x": 234, + "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": [ + { + "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"} + } + ] + }, + { + "name": "btnPrimary", + "type": "FRAME", + "x": 306, + "y": 20, + "width": 134, + "height": 32, + "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": {"fills/0/color": "danger/danger"}, + "children": [ + { + "name": "text", + "type": "TEXT", + "x": 12, + "y": 8, + "width": 110, + "height": 16, + "fills": [{"type": "SOLID", "color": "#FCFCFC"}], + "text": "Remove and restart", + "font": ["Geist", 500, 12], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "danger/foreground"} + } + ] + } + ] + } + ] + } + ] +} diff --git a/assets/design-export/json/1274632774-2492.json b/assets/design-export/json/1274632774-2492.json new file mode 100644 index 000000000..4e62af02b --- /dev/null +++ b/assets/design-export/json/1274632774-2492.json @@ -0,0 +1,1869 @@ +{ + "file": "1274632774-2492", + "name": "Screen/Server Detail — Modpacks (Missing files)", + "type": "FRAME", + "x": 11480, + "y": 32970, + "width": 1440, + "height": 1080, + "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": 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" + ] + }, + { + "name": "Main", + "type": "FRAME", + "x": 260, + "y": 0, + "width": 1180, + "height": 1080, + "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", "test-server-02", "Search servers…", "AD"] + }, + { + "name": "Body", + "type": "FRAME", + "x": 0, + "y": 64, + "width": 1180, + "height": 936, + "fills": [{"type": "SOLID", "color": "#121114"}], + "layout": { + "mode": "VERTICAL", + "gap": 16, + "padding": [24, 24, 24, 24], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "FIXED"] + }, + "layoutGrow": 1, + "layoutAlignSelf": "STRETCH", + "variables": {"fills/0/color": "background/background"}, + "children": [ + { + "name": "Detail Header", + "type": "INSTANCE", + "x": 24, + "y": 24, + "width": 1132, + "height": 78, + "component": "Gameplane/Server Detail Header", + "componentId": "1:447", + "fills": [{"type": "SOLID", "color": "#121114"}], + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [8, 0, 16, 0], + "primary": "SPACE_BETWEEN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"fills/0/color": "background/background"}, + "texts": [ + "MI", + "test-server-02", + "Running", + "minecraft-java · forge 1.20.1 · ns: default · up 2h 10m", + "Restart", + "Stop", + "Open console" + ] + }, + { + "name": "Tabs Bar", + "type": "INSTANCE", + "x": 24, + "y": 118, + "width": 1132, + "height": 40, + "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": [0, 0, 0, 0], + "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" + ] + }, + { + "name": "Active Modpack Card", + "type": "INSTANCE", + "x": 24, + "y": 174, + "width": 1132, + "height": 106, + "component": "Gameplane/Active Modpack Card", + "fills": [{"type": "SOLID", "color": "#1C1A20"}], + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "cornerRadius": 12, + "layout": { + "mode": "VERTICAL", + "gap": 12, + "padding": [16, 16, 16, 16], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"fills/0/color": "surface/surface", "strokes/0/color": "border/border"}, + "texts": [ + "Active modpack", + "All the Mods 9", + "CurseForge", + "Needs files", + "Version 1.0.14 · pinned · Minecraft 1.20.1 · Forge", + "Change version", + "Remove" + ] + }, + { + "name": "Missing Files Notice", + "type": "FRAME", + "x": 24, + "y": 296, + "width": 1132, + "height": 221, + "fills": [{"type": "SOLID", "color": "#F7B750", "opacity": 0.15}], + "strokes": [{"type": "SOLID", "color": "#F7B750"}], + "strokeWeight": 1, + "cornerRadius": 12, + "layout": { + "mode": "VERTICAL", + "gap": 12, + "padding": [16, 16, 16, 16], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"fills/0/color": "warning/soft", "strokes/0/color": "warning/soft-foreground"}, + "children": [ + { + "name": "Header", + "type": "FRAME", + "x": 16, + "y": 16, + "width": 1100, + "height": 36, + "layout": { + "mode": "HORIZONTAL", + "gap": 10, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "name": "lucide/triangle-alert/16x16", + "type": "INSTANCE", + "x": 0, + "y": 0, + "width": 16, + "height": 16, + "component": "lucide/triangle-alert/16x16" + }, + { + "name": "Text", + "type": "FRAME", + "x": 26, + "y": 0, + "width": 956, + "height": 36, + "layout": { + "mode": "VERTICAL", + "gap": 2, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutGrow": 1, + "children": [ + { + "name": "Text", + "type": "TEXT", + "x": 0, + "y": 0, + "width": 207, + "height": 18, + "fills": [{"type": "SOLID", "color": "#F7B750"}], + "text": "3 files need a manual download", + "font": ["Geist", 500, 14], + "variables": {"fills/0/color": "warning/soft-foreground"} + }, + { + "name": "Text", + "type": "TEXT", + "x": 0, + "y": 20, + "width": 956, + "height": 16, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "layoutAlignSelf": "STRETCH", + "text": "Their authors block automatic downloads, so the install stopped. Download each file from its page, upload it to downloads/ in the Files tab, then restart the server.", + "font": ["Geist", 400, 12], + "variables": {"fills/0/color": "muted"} + } + ] + }, + { + "name": "Btn Open Files", + "type": "INSTANCE", + "x": 992, + "y": 0, + "width": 108, + "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": ["HUG", "HUG"] + }, + "variables": {"strokes/0/color": "border/border"}, + "texts": ["Open Files"] + } + ] + }, + { + "name": "Table", + "type": "FRAME", + "x": 16, + "y": 64, + "width": 1100, + "height": 141, + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "cornerRadius": 8, + "layout": { + "mode": "VERTICAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "clips": true, + "variables": {"strokes/0/color": "border/border"}, + "children": [ + { + "name": "Head", + "type": "FRAME", + "x": 0, + "y": 0, + "width": 1100, + "height": 30, + "fills": [{"type": "SOLID", "color": "#17151A"}], + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "layout": { + "mode": "HORIZONTAL", + "gap": 16, + "padding": [8, 12, 8, 12], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"fills/0/color": "surface/secondary", "strokes/0/color": "border/border"}, + "children": [ + { + "name": "Text", + "type": "TEXT", + "x": 12, + "y": 8, + "width": 220, + "height": 14, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "text": "Mod", + "font": ["Geist", 500, 11], + "variables": {"fills/0/color": "muted"} + }, + { + "name": "Text", + "type": "TEXT", + "x": 248, + "y": 8, + "width": 772, + "height": 14, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "layoutGrow": 1, + "text": "File name", + "font": ["Geist", 500, 11], + "variables": {"fills/0/color": "muted"} + }, + { + "name": "Text", + "type": "TEXT", + "x": 1036, + "y": 8, + "width": 52, + "height": 14, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "text": "Download", + "font": ["Geist", 500, 11], + "variables": {"fills/0/color": "muted"} + } + ] + }, + { + "name": "Row OptiFine", + "type": "FRAME", + "x": 0, + "y": 30, + "width": 1100, + "height": 37, + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "layout": { + "mode": "HORIZONTAL", + "gap": 16, + "padding": [10, 12, 10, 12], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"strokes/0/color": "border/border"}, + "children": [ + { + "name": "Text", + "type": "TEXT", + "x": 12, + "y": 10, + "width": 220, + "height": 17, + "fills": [{"type": "SOLID", "color": "#F5F3F7"}], + "text": "OptiFine", + "font": ["Geist", 500, 13], + "variables": {"fills/0/color": "foreground/foreground"} + }, + { + "name": "Text", + "type": "TEXT", + "x": 248, + "y": 10.5, + "width": 720, + "height": 16, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "layoutGrow": 1, + "text": "OptiFine_1.20.1_HD_U_I6.jar", + "font": ["Geist", 400, 12], + "variables": {"fills/0/color": "muted"} + }, + { + "name": "Link", + "type": "FRAME", + "x": 984, + "y": 10.5, + "width": 104, + "height": 16, + "layout": { + "mode": "HORIZONTAL", + "gap": 4, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["HUG", "HUG"] + }, + "children": [ + { + "name": "Text", + "type": "TEXT", + "x": 0, + "y": 0, + "width": 88, + "height": 16, + "fills": [{"type": "SOLID", "color": "#FF4FA3"}], + "text": "Download page", + "font": ["Geist", 500, 12], + "variables": {"fills/0/color": "accent/accent"} + }, + { + "name": "lucide/external-link/12x12", + "type": "INSTANCE", + "x": 92, + "y": 2, + "width": 12, + "height": 12, + "component": "lucide/external-link/12x12" + } + ] + } + ] + }, + { + "name": "Row Flan's Mod", + "type": "FRAME", + "x": 0, + "y": 67, + "width": 1100, + "height": 37, + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "layout": { + "mode": "HORIZONTAL", + "gap": 16, + "padding": [10, 12, 10, 12], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"strokes/0/color": "border/border"}, + "children": [ + { + "name": "Text", + "type": "TEXT", + "x": 12, + "y": 10, + "width": 220, + "height": 17, + "fills": [{"type": "SOLID", "color": "#F5F3F7"}], + "text": "Flan's Mod", + "font": ["Geist", 500, 13], + "variables": {"fills/0/color": "foreground/foreground"} + }, + { + "name": "Text", + "type": "TEXT", + "x": 248, + "y": 10.5, + "width": 720, + "height": 16, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "layoutGrow": 1, + "text": "flansmod-1.20.1-6.1.4.jar", + "font": ["Geist", 400, 12], + "variables": {"fills/0/color": "muted"} + }, + { + "name": "Link", + "type": "FRAME", + "x": 984, + "y": 10.5, + "width": 104, + "height": 16, + "layout": { + "mode": "HORIZONTAL", + "gap": 4, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["HUG", "HUG"] + }, + "children": [ + { + "name": "Text", + "type": "TEXT", + "x": 0, + "y": 0, + "width": 88, + "height": 16, + "fills": [{"type": "SOLID", "color": "#FF4FA3"}], + "text": "Download page", + "font": ["Geist", 500, 12], + "variables": {"fills/0/color": "accent/accent"} + }, + { + "name": "lucide/external-link/12x12", + "type": "INSTANCE", + "x": 92, + "y": 2, + "width": 12, + "height": 12, + "component": "lucide/external-link/12x12" + } + ] + } + ] + }, + { + "name": "Row Ice and Fire: Dragons", + "type": "FRAME", + "x": 0, + "y": 104, + "width": 1100, + "height": 37, + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "layout": { + "mode": "HORIZONTAL", + "gap": 16, + "padding": [10, 12, 10, 12], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"strokes/0/color": "border/border"}, + "children": [ + { + "name": "Text", + "type": "TEXT", + "x": 12, + "y": 10, + "width": 220, + "height": 17, + "fills": [{"type": "SOLID", "color": "#F5F3F7"}], + "text": "Ice and Fire: Dragons", + "font": ["Geist", 500, 13], + "variables": {"fills/0/color": "foreground/foreground"} + }, + { + "name": "Text", + "type": "TEXT", + "x": 248, + "y": 10.5, + "width": 720, + "height": 16, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "layoutGrow": 1, + "text": "iceandfire-2.1.13-1.20.1.jar", + "font": ["Geist", 400, 12], + "variables": {"fills/0/color": "muted"} + }, + { + "name": "Link", + "type": "FRAME", + "x": 984, + "y": 10.5, + "width": 104, + "height": 16, + "layout": { + "mode": "HORIZONTAL", + "gap": 4, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["HUG", "HUG"] + }, + "children": [ + { + "name": "Text", + "type": "TEXT", + "x": 0, + "y": 0, + "width": 88, + "height": 16, + "fills": [{"type": "SOLID", "color": "#FF4FA3"}], + "text": "Download page", + "font": ["Geist", 500, 12], + "variables": {"fills/0/color": "accent/accent"} + }, + { + "name": "lucide/external-link/12x12", + "type": "INSTANCE", + "x": 92, + "y": 2, + "width": 12, + "height": 12, + "component": "lucide/external-link/12x12" + } + ] + } + ] + } + ] + } + ] + }, + { + "name": "Modpacks Heading", + "type": "FRAME", + "x": 24, + "y": 533, + "width": 1132, + "height": 34, + "layout": { + "mode": "VERTICAL", + "gap": 2, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "name": "heading", + "type": "TEXT", + "x": 0, + "y": 0, + "width": 119, + "height": 18, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "text": "Browse modpacks", + "font": ["Geist", 400, 14], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "muted"} + }, + { + "name": "subheading", + "type": "TEXT", + "x": 0, + "y": 20, + "width": 1132, + "height": 14, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "layoutAlignSelf": "STRETCH", + "text": "Pick a pack and a version. The server pins that version and restarts to install it; a restart never upgrades it.", + "font": ["Geist", 400, 11], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "muted"} + } + ] + }, + { + "name": "Filters Row", + "type": "FRAME", + "x": 24, + "y": 583, + "width": 1132, + "height": 40, + "layout": { + "mode": "HORIZONTAL", + "gap": 8, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "name": "Provider Switch", + "type": "INSTANCE", + "x": 0, + "y": 0, + "width": 266, + "height": 40, + "component": "Gameplane/Provider Switch", + "fills": [{"type": "SOLID", "color": "#232128"}], + "cornerRadius": 20, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [4, 4, 4, 4], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "HUG"] + }, + "variables": {"fills/0/color": "default/default"}, + "texts": ["Modrinth", "CurseForge", "FTB"] + }, + { + "name": "Search", + "type": "INSTANCE", + "x": 274, + "y": 2, + "width": 630, + "height": 36, + "component": "Gameplane/Search Input", + "componentId": "1:975", + "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": 6, + "padding": [0, 12, 0, 12], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "FIXED"] + }, + "layoutGrow": 1, + "variables": { + "cornerRadius": "radius/xl", + "fills/0/color": "field/background", + "strokes/0/color": "field/border" + }, + "texts": ["Search modpacks…"] + }, + { + "name": "Select", + "type": "INSTANCE", + "x": 912, + "y": 2, + "width": 220, + "height": 36, + "component": "Gameplane/Select", + "componentId": "1:311", + "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": "SPACE_BETWEEN", + "counter": "CENTER", + "sizing": ["FIXED", "FIXED"] + }, + "variables": { + "cornerRadius": "radius/xl", + "fills/0/color": "field/background", + "strokes/0/color": "field/border" + }, + "texts": ["Sort: Downloads"] + } + ] + }, + { + "name": "Category Chips", + "type": "FRAME", + "x": 24, + "y": 639, + "width": 1132, + "height": 17, + "layout": { + "mode": "HORIZONTAL", + "gap": 6, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "name": "chipAll", + "type": "INSTANCE", + "x": 0, + "y": 0, + "width": 22, + "height": 17, + "component": "Chip/Primary/Accent/SM", + "componentId": "1:981", + "fills": [{"type": "SOLID", "color": "#FF4FA3"}], + "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": "accent/accent"}, + "texts": ["All"] + } + ] + }, + { + "name": "Modpacks Grid", + "type": "FRAME", + "x": 24, + "y": 672, + "width": 1132, + "height": 220, + "layout": { + "mode": "VERTICAL", + "gap": 8, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "name": "Row 1", + "type": "FRAME", + "x": 0, + "y": 0, + "width": 1132, + "height": 68, + "layout": { + "mode": "HORIZONTAL", + "gap": 8, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "name": "Card All the Mods 9", + "type": "FRAME", + "x": 0, + "y": 0, + "width": 562, + "height": 68, + "fills": [{"type": "SOLID", "color": "#1C1A20"}], + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "cornerRadius": 12, + "layout": { + "mode": "HORIZONTAL", + "gap": 12, + "padding": [16, 16, 16, 16], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutGrow": 1, + "variables": { + "cornerRadius": "radius/xl", + "paddingTop": "spacing/4", + "paddingRight": "spacing/4", + "paddingBottom": "spacing/4", + "paddingLeft": "spacing/4", + "fills/0/color": "surface/surface", + "strokes/0/color": "border/border" + }, + "children": [ + { + "name": "Cover", + "type": "FRAME", + "x": 16, + "y": 16, + "width": 36, + "height": 36, + "fills": [{"type": "SOLID", "color": "#00000000", "opacity": 0}], + "cornerRadius": 4, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "CENTER", + "counter": "CENTER", + "sizing": ["FIXED", "FIXED"] + }, + "children": [ + { + "name": "Icon", + "type": "FRAME", + "x": 8, + "y": 8, + "width": 20, + "height": 20, + "variables": {"fills/0/color": "muted"}, + "children": [ + { + "name": "path", + "type": "VECTOR", + "x": 2.5, + "y": 1.67, + "width": 15, + "height": 16.67, + "strokes": [{"type": "SOLID", "color": "#9E98A6"}], + "strokeWeight": 1.67 + }, + { + "name": "path", + "type": "VECTOR", + "x": 2.74, + "y": 3.56, + "width": 14.52, + "height": 6.44, + "strokes": [{"type": "SOLID", "color": "#9E98A6"}], + "strokeWeight": 1.67 + } + ] + } + ] + }, + { + "name": "Info", + "type": "FRAME", + "x": 64, + "y": 17, + "width": 404, + "height": 34, + "layout": { + "mode": "VERTICAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutGrow": 1, + "children": [ + { + "name": "text", + "type": "TEXT", + "x": 0, + "y": 0, + "width": 94, + "height": 18, + "fills": [{"type": "SOLID", "color": "#F5F3F7"}], + "text": "All the Mods 9", + "font": ["Geist", 500, 14], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + }, + { + "name": "text", + "type": "TEXT", + "x": 0, + "y": 18, + "width": 157, + "height": 16, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "text": "ATMTeam · 21.4M downloads", + "font": ["Geist", 400, 12], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "muted"} + } + ] + }, + { + "name": "Btn Install", + "type": "INSTANCE", + "x": 480, + "y": 18, + "width": 66, + "height": 32, + "component": "Gameplane/Button/Small/Default", + "componentId": "1:709", + "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": ["Install…"] + } + ] + }, + { + "name": "Card Better MC [FORGE]", + "type": "FRAME", + "x": 570, + "y": 0, + "width": 562, + "height": 68, + "fills": [{"type": "SOLID", "color": "#1C1A20"}], + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "cornerRadius": 12, + "layout": { + "mode": "HORIZONTAL", + "gap": 12, + "padding": [16, 16, 16, 16], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutGrow": 1, + "variables": { + "cornerRadius": "radius/xl", + "paddingTop": "spacing/4", + "paddingRight": "spacing/4", + "paddingBottom": "spacing/4", + "paddingLeft": "spacing/4", + "fills/0/color": "surface/surface", + "strokes/0/color": "border/border" + }, + "children": [ + { + "name": "Cover", + "type": "FRAME", + "x": 16, + "y": 16, + "width": 36, + "height": 36, + "fills": [{"type": "SOLID", "color": "#00000000", "opacity": 0}], + "cornerRadius": 4, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "CENTER", + "counter": "CENTER", + "sizing": ["FIXED", "FIXED"] + }, + "children": [ + { + "name": "Icon", + "type": "FRAME", + "x": 8, + "y": 8, + "width": 20, + "height": 20, + "variables": {"fills/0/color": "muted"}, + "children": [ + { + "name": "path", + "type": "VECTOR", + "x": 2.5, + "y": 1.67, + "width": 15, + "height": 16.67, + "strokes": [{"type": "SOLID", "color": "#9E98A6"}], + "strokeWeight": 1.67 + }, + { + "name": "path", + "type": "VECTOR", + "x": 2.74, + "y": 3.56, + "width": 14.52, + "height": 6.44, + "strokes": [{"type": "SOLID", "color": "#9E98A6"}], + "strokeWeight": 1.67 + } + ] + } + ] + }, + { + "name": "Info", + "type": "FRAME", + "x": 64, + "y": 17, + "width": 404, + "height": 34, + "layout": { + "mode": "VERTICAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutGrow": 1, + "children": [ + { + "name": "text", + "type": "TEXT", + "x": 0, + "y": 0, + "width": 127, + "height": 18, + "fills": [{"type": "SOLID", "color": "#F5F3F7"}], + "text": "Better MC [FORGE]", + "font": ["Geist", 500, 14], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + }, + { + "name": "text", + "type": "TEXT", + "x": 0, + "y": 18, + "width": 198, + "height": 16, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "text": "LunaPixelStudios · 12.6M downloads", + "font": ["Geist", 400, 12], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "muted"} + } + ] + }, + { + "name": "Btn Install", + "type": "INSTANCE", + "x": 480, + "y": 18, + "width": 66, + "height": 32, + "component": "Gameplane/Button/Small/Default", + "componentId": "1:709", + "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": ["Install…"] + } + ] + } + ] + }, + { + "name": "Row 2", + "type": "FRAME", + "x": 0, + "y": 76, + "width": 1132, + "height": 68, + "layout": { + "mode": "HORIZONTAL", + "gap": 8, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "name": "Card RLCraft Dregora", + "type": "FRAME", + "x": 0, + "y": 0, + "width": 562, + "height": 68, + "fills": [{"type": "SOLID", "color": "#1C1A20"}], + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "cornerRadius": 12, + "layout": { + "mode": "HORIZONTAL", + "gap": 12, + "padding": [16, 16, 16, 16], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutGrow": 1, + "variables": { + "cornerRadius": "radius/xl", + "paddingTop": "spacing/4", + "paddingRight": "spacing/4", + "paddingBottom": "spacing/4", + "paddingLeft": "spacing/4", + "fills/0/color": "surface/surface", + "strokes/0/color": "border/border" + }, + "children": [ + { + "name": "Cover", + "type": "FRAME", + "x": 16, + "y": 16, + "width": 36, + "height": 36, + "fills": [{"type": "SOLID", "color": "#00000000", "opacity": 0}], + "cornerRadius": 4, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "CENTER", + "counter": "CENTER", + "sizing": ["FIXED", "FIXED"] + }, + "children": [ + { + "name": "Icon", + "type": "FRAME", + "x": 8, + "y": 8, + "width": 20, + "height": 20, + "variables": {"fills/0/color": "muted"}, + "children": [ + { + "name": "path", + "type": "VECTOR", + "x": 2.5, + "y": 1.67, + "width": 15, + "height": 16.67, + "strokes": [{"type": "SOLID", "color": "#9E98A6"}], + "strokeWeight": 1.67 + }, + { + "name": "path", + "type": "VECTOR", + "x": 2.74, + "y": 3.56, + "width": 14.52, + "height": 6.44, + "strokes": [{"type": "SOLID", "color": "#9E98A6"}], + "strokeWeight": 1.67 + } + ] + } + ] + }, + { + "name": "Info", + "type": "FRAME", + "x": 64, + "y": 17, + "width": 404, + "height": 34, + "layout": { + "mode": "VERTICAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutGrow": 1, + "children": [ + { + "name": "text", + "type": "TEXT", + "x": 0, + "y": 0, + "width": 106, + "height": 18, + "fills": [{"type": "SOLID", "color": "#F5F3F7"}], + "text": "RLCraft Dregora", + "font": ["Geist", 500, 14], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + }, + { + "name": "text", + "type": "TEXT", + "x": 0, + "y": 18, + "width": 140, + "height": 16, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "text": "Dregora · 1.9M downloads", + "font": ["Geist", 400, 12], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "muted"} + } + ] + }, + { + "name": "Btn Install", + "type": "INSTANCE", + "x": 480, + "y": 18, + "width": 66, + "height": 32, + "component": "Gameplane/Button/Small/Default", + "componentId": "1:709", + "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": ["Install…"] + } + ] + }, + { + "name": "Card Create: Arcane Engineering", + "type": "FRAME", + "x": 570, + "y": 0, + "width": 562, + "height": 68, + "fills": [{"type": "SOLID", "color": "#1C1A20"}], + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "cornerRadius": 12, + "layout": { + "mode": "HORIZONTAL", + "gap": 12, + "padding": [16, 16, 16, 16], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutGrow": 1, + "variables": { + "cornerRadius": "radius/xl", + "paddingTop": "spacing/4", + "paddingRight": "spacing/4", + "paddingBottom": "spacing/4", + "paddingLeft": "spacing/4", + "fills/0/color": "surface/surface", + "strokes/0/color": "border/border" + }, + "children": [ + { + "name": "Cover", + "type": "FRAME", + "x": 16, + "y": 16, + "width": 36, + "height": 36, + "fills": [{"type": "SOLID", "color": "#00000000", "opacity": 0}], + "cornerRadius": 4, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "CENTER", + "counter": "CENTER", + "sizing": ["FIXED", "FIXED"] + }, + "children": [ + { + "name": "Icon", + "type": "FRAME", + "x": 8, + "y": 8, + "width": 20, + "height": 20, + "variables": {"fills/0/color": "muted"}, + "children": [ + { + "name": "path", + "type": "VECTOR", + "x": 2.5, + "y": 1.67, + "width": 15, + "height": 16.67, + "strokes": [{"type": "SOLID", "color": "#9E98A6"}], + "strokeWeight": 1.67 + }, + { + "name": "path", + "type": "VECTOR", + "x": 2.74, + "y": 3.56, + "width": 14.52, + "height": 6.44, + "strokes": [{"type": "SOLID", "color": "#9E98A6"}], + "strokeWeight": 1.67 + } + ] + } + ] + }, + { + "name": "Info", + "type": "FRAME", + "x": 64, + "y": 17, + "width": 404, + "height": 34, + "layout": { + "mode": "VERTICAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutGrow": 1, + "children": [ + { + "name": "text", + "type": "TEXT", + "x": 0, + "y": 0, + "width": 179, + "height": 18, + "fills": [{"type": "SOLID", "color": "#F5F3F7"}], + "text": "Create: Arcane Engineering", + "font": ["Geist", 500, 14], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + }, + { + "name": "text", + "type": "TEXT", + "x": 0, + "y": 18, + "width": 167, + "height": 16, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "text": "Lightman314 · 1.2M downloads", + "font": ["Geist", 400, 12], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "muted"} + } + ] + }, + { + "name": "Btn Install", + "type": "INSTANCE", + "x": 480, + "y": 18, + "width": 66, + "height": 32, + "component": "Gameplane/Button/Small/Default", + "componentId": "1:709", + "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": ["Install…"] + } + ] + } + ] + }, + { + "name": "Row 3", + "type": "FRAME", + "x": 0, + "y": 152, + "width": 1132, + "height": 68, + "layout": { + "mode": "HORIZONTAL", + "gap": 8, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "name": "Card Vault Hunters 3rd Edition", + "type": "FRAME", + "x": 0, + "y": 0, + "width": 562, + "height": 68, + "fills": [{"type": "SOLID", "color": "#1C1A20"}], + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "cornerRadius": 12, + "layout": { + "mode": "HORIZONTAL", + "gap": 12, + "padding": [16, 16, 16, 16], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutGrow": 1, + "variables": { + "cornerRadius": "radius/xl", + "paddingTop": "spacing/4", + "paddingRight": "spacing/4", + "paddingBottom": "spacing/4", + "paddingLeft": "spacing/4", + "fills/0/color": "surface/surface", + "strokes/0/color": "border/border" + }, + "children": [ + { + "name": "Cover", + "type": "FRAME", + "x": 16, + "y": 16, + "width": 36, + "height": 36, + "fills": [{"type": "SOLID", "color": "#00000000", "opacity": 0}], + "cornerRadius": 4, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "CENTER", + "counter": "CENTER", + "sizing": ["FIXED", "FIXED"] + }, + "children": [ + { + "name": "Icon", + "type": "FRAME", + "x": 8, + "y": 8, + "width": 20, + "height": 20, + "variables": {"fills/0/color": "muted"}, + "children": [ + { + "name": "path", + "type": "VECTOR", + "x": 2.5, + "y": 1.67, + "width": 15, + "height": 16.67, + "strokes": [{"type": "SOLID", "color": "#9E98A6"}], + "strokeWeight": 1.67 + }, + { + "name": "path", + "type": "VECTOR", + "x": 2.74, + "y": 3.56, + "width": 14.52, + "height": 6.44, + "strokes": [{"type": "SOLID", "color": "#9E98A6"}], + "strokeWeight": 1.67 + } + ] + } + ] + }, + { + "name": "Info", + "type": "FRAME", + "x": 64, + "y": 17, + "width": 404, + "height": 34, + "layout": { + "mode": "VERTICAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutGrow": 1, + "children": [ + { + "name": "text", + "type": "TEXT", + "x": 0, + "y": 0, + "width": 163, + "height": 18, + "fills": [{"type": "SOLID", "color": "#F5F3F7"}], + "text": "Vault Hunters 3rd Edition", + "font": ["Geist", 500, 14], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + }, + { + "name": "text", + "type": "TEXT", + "x": 0, + "y": 18, + "width": 143, + "height": 16, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "text": "Iskall85 · 5.5M downloads", + "font": ["Geist", 400, 12], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "muted"} + } + ] + }, + { + "name": "Btn Install", + "type": "INSTANCE", + "x": 480, + "y": 18, + "width": 66, + "height": 32, + "component": "Gameplane/Button/Small/Default", + "componentId": "1:709", + "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": ["Install…"] + } + ] + }, + { + "name": "Card Prominence II [Forge]", + "type": "FRAME", + "x": 570, + "y": 0, + "width": 562, + "height": 68, + "fills": [{"type": "SOLID", "color": "#1C1A20"}], + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "cornerRadius": 12, + "layout": { + "mode": "HORIZONTAL", + "gap": 12, + "padding": [16, 16, 16, 16], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutGrow": 1, + "variables": { + "cornerRadius": "radius/xl", + "paddingTop": "spacing/4", + "paddingRight": "spacing/4", + "paddingBottom": "spacing/4", + "paddingLeft": "spacing/4", + "fills/0/color": "surface/surface", + "strokes/0/color": "border/border" + }, + "children": [ + { + "name": "Cover", + "type": "FRAME", + "x": 16, + "y": 16, + "width": 36, + "height": 36, + "fills": [{"type": "SOLID", "color": "#00000000", "opacity": 0}], + "cornerRadius": 4, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "CENTER", + "counter": "CENTER", + "sizing": ["FIXED", "FIXED"] + }, + "children": [ + { + "name": "Icon", + "type": "FRAME", + "x": 8, + "y": 8, + "width": 20, + "height": 20, + "variables": {"fills/0/color": "muted"}, + "children": [ + { + "name": "path", + "type": "VECTOR", + "x": 2.5, + "y": 1.67, + "width": 15, + "height": 16.67, + "strokes": [{"type": "SOLID", "color": "#9E98A6"}], + "strokeWeight": 1.67 + }, + { + "name": "path", + "type": "VECTOR", + "x": 2.74, + "y": 3.56, + "width": 14.52, + "height": 6.44, + "strokes": [{"type": "SOLID", "color": "#9E98A6"}], + "strokeWeight": 1.67 + } + ] + } + ] + }, + { + "name": "Info", + "type": "FRAME", + "x": 64, + "y": 17, + "width": 404, + "height": 34, + "layout": { + "mode": "VERTICAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutGrow": 1, + "children": [ + { + "name": "text", + "type": "TEXT", + "x": 0, + "y": 0, + "width": 140, + "height": 18, + "fills": [{"type": "SOLID", "color": "#F5F3F7"}], + "text": "Prominence II [Forge]", + "font": ["Geist", 500, 14], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + }, + { + "name": "text", + "type": "TEXT", + "x": 0, + "y": 18, + "width": 153, + "height": 16, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "text": "Elocindev · 2.2M downloads", + "font": ["Geist", 400, 12], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "muted"} + } + ] + }, + { + "name": "Btn Install", + "type": "INSTANCE", + "x": 480, + "y": 18, + "width": 66, + "height": 32, + "component": "Gameplane/Button/Small/Default", + "componentId": "1:709", + "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": ["Install…"] + } + ] + } + ] + } + ] + }, + { + "name": "Load More Row", + "type": "FRAME", + "x": 24, + "y": 908, + "width": 1132, + "height": 32, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "CENTER", + "counter": "MIN", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "name": "Btn Load More", + "type": "INSTANCE", + "x": 521.5, + "y": 0, + "width": 89, + "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": ["HUG", "HUG"] + }, + "variables": {"strokes/0/color": "border/border"}, + "texts": ["Load more"] + } + ] + } + ] + } + ] + } + ] +} diff --git a/assets/design-export/json/1274632774-2877.json b/assets/design-export/json/1274632774-2877.json new file mode 100644 index 000000000..c95dd9d82 --- /dev/null +++ b/assets/design-export/json/1274632774-2877.json @@ -0,0 +1,1523 @@ +{ + "file": "1274632774-2877", + "name": "Screen/Server Detail — Modpacks (Active pack, Light)", + "type": "FRAME", + "x": 13120, + "y": 32970, + "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" + ] + }, + { + "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", "test-server-02", "Search servers…", "AD"] + }, + { + "name": "Body", + "type": "FRAME", + "x": 0, + "y": 64, + "width": 1180, + "height": 836, + "fills": [{"type": "SOLID", "color": "#FFFFFF"}], + "layout": { + "mode": "VERTICAL", + "gap": 16, + "padding": [24, 24, 24, 24], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "FIXED"] + }, + "layoutGrow": 1, + "layoutAlignSelf": "STRETCH", + "variables": {"fills/0/color": "background/background"}, + "children": [ + { + "name": "Detail Header", + "type": "INSTANCE", + "x": 24, + "y": 24, + "width": 1132, + "height": 78, + "component": "Gameplane/Server Detail Header", + "componentId": "1:447", + "fills": [{"type": "SOLID", "color": "#FFFFFF"}], + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [8, 0, 16, 0], + "primary": "SPACE_BETWEEN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"fills/0/color": "background/background"}, + "texts": [ + "MI", + "test-server-02", + "Running", + "minecraft-java · fabric 1.21.1 · ns: default · up 13d 4h", + "Restart", + "Stop", + "Open console" + ] + }, + { + "name": "Tabs Bar", + "type": "INSTANCE", + "x": 24, + "y": 118, + "width": 1132, + "height": 40, + "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": [0, 0, 0, 0], + "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" + ] + }, + { + "name": "Active Modpack Card", + "type": "INSTANCE", + "x": 24, + "y": 174, + "width": 1132, + "height": 106, + "component": "Gameplane/Active Modpack Card", + "fills": [{"type": "SOLID", "color": "#FFF7FB"}], + "strokes": [{"type": "SOLID", "color": "#EFC3D6"}], + "strokeWeight": 1, + "cornerRadius": 12, + "layout": { + "mode": "VERTICAL", + "gap": 12, + "padding": [16, 16, 16, 16], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"fills/0/color": "surface/surface", "strokes/0/color": "border/border"}, + "texts": [ + "Active modpack", + "Fabulously Optimized", + "Modrinth", + "Applied", + "Version 6.4.0 · pinned · Minecraft 1.21.1 · Fabric", + "Change version", + "Remove" + ] + }, + { + "name": "Modpacks Heading", + "type": "FRAME", + "x": 24, + "y": 296, + "width": 1132, + "height": 34, + "layout": { + "mode": "VERTICAL", + "gap": 2, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "name": "heading", + "type": "TEXT", + "x": 0, + "y": 0, + "width": 119, + "height": 18, + "fills": [{"type": "SOLID", "color": "#6E5262"}], + "text": "Browse modpacks", + "font": ["Geist", 400, 14], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "muted"} + }, + { + "name": "subheading", + "type": "TEXT", + "x": 0, + "y": 20, + "width": 1132, + "height": 14, + "fills": [{"type": "SOLID", "color": "#6E5262"}], + "layoutAlignSelf": "STRETCH", + "text": "Pick a pack and a version. The server pins that version and restarts to install it; a restart never upgrades it.", + "font": ["Geist", 400, 11], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "muted"} + } + ] + }, + { + "name": "Filters Row", + "type": "FRAME", + "x": 24, + "y": 346, + "width": 1132, + "height": 40, + "layout": { + "mode": "HORIZONTAL", + "gap": 8, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "name": "Provider Switch", + "type": "INSTANCE", + "x": 0, + "y": 0, + "width": 266, + "height": 40, + "component": "Gameplane/Provider Switch", + "fills": [{"type": "SOLID", "color": "#F6DCE7"}], + "cornerRadius": 20, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [4, 4, 4, 4], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "HUG"] + }, + "variables": {"fills/0/color": "default/default"}, + "texts": ["Modrinth", "CurseForge", "FTB"] + }, + { + "name": "Search", + "type": "INSTANCE", + "x": 274, + "y": 2, + "width": 630, + "height": 36, + "component": "Gameplane/Search Input", + "componentId": "1:975", + "fills": [{"type": "SOLID", "color": "#FFFFFF"}], + "strokes": [{"type": "SOLID", "color": "#EFC3D6"}], + "strokeWeight": 1, + "effects": [{"type": "DROP_SHADOW", "radius": 2, "visible": true}], + "cornerRadius": 12, + "layout": { + "mode": "HORIZONTAL", + "gap": 6, + "padding": [0, 12, 0, 12], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "FIXED"] + }, + "layoutGrow": 1, + "variables": { + "cornerRadius": "radius/xl", + "fills/0/color": "field/background", + "strokes/0/color": "field/border" + }, + "texts": ["Search modpacks…"] + }, + { + "name": "Select", + "type": "INSTANCE", + "x": 912, + "y": 2, + "width": 220, + "height": 36, + "component": "Gameplane/Select", + "componentId": "1:311", + "fills": [{"type": "SOLID", "color": "#FFFFFF"}], + "strokes": [{"type": "SOLID", "color": "#EFC3D6"}], + "strokeWeight": 1, + "effects": [{"type": "DROP_SHADOW", "radius": 2, "visible": true}], + "cornerRadius": 12, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [8, 12, 8, 12], + "primary": "SPACE_BETWEEN", + "counter": "CENTER", + "sizing": ["FIXED", "FIXED"] + }, + "variables": { + "cornerRadius": "radius/xl", + "fills/0/color": "field/background", + "strokes/0/color": "field/border" + }, + "texts": ["Sort: Downloads"] + } + ] + }, + { + "name": "Category Chips", + "type": "FRAME", + "x": 24, + "y": 402, + "width": 1132, + "height": 24, + "layout": { + "mode": "HORIZONTAL", + "gap": 6, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "name": "chipAll", + "type": "INSTANCE", + "x": 0, + "y": 3.5, + "width": 22, + "height": 17, + "component": "Chip/Primary/Accent/SM", + "componentId": "1:981", + "fills": [{"type": "SOLID", "color": "#DB2777"}], + "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": "accent/accent"}, + "texts": ["All"] + }, + { + "name": "chipAdventure", + "type": "INSTANCE", + "x": 28, + "y": 0, + "width": 77, + "height": 24, + "component": "Gameplane/Tag", + "componentId": "1:1142", + "strokes": [{"type": "SOLID", "color": "#EFC3D6"}], + "strokeWeight": 1, + "cornerRadius": 999, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [4, 10, 4, 10], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "HUG"] + }, + "variables": {"strokes/0/color": "border/border"}, + "texts": ["Adventure"] + }, + { + "name": "chipTech", + "type": "INSTANCE", + "x": 111, + "y": 0, + "width": 46, + "height": 24, + "component": "Gameplane/Tag", + "componentId": "1:1142", + "strokes": [{"type": "SOLID", "color": "#EFC3D6"}], + "strokeWeight": 1, + "cornerRadius": 999, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [4, 10, 4, 10], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "HUG"] + }, + "variables": {"strokes/0/color": "border/border"}, + "texts": ["Tech"] + }, + { + "name": "chipMagic", + "type": "INSTANCE", + "x": 163, + "y": 0, + "width": 54, + "height": 24, + "component": "Gameplane/Tag", + "componentId": "1:1142", + "strokes": [{"type": "SOLID", "color": "#EFC3D6"}], + "strokeWeight": 1, + "cornerRadius": 999, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [4, 10, 4, 10], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "HUG"] + }, + "variables": {"strokes/0/color": "border/border"}, + "texts": ["Magic"] + }, + { + "name": "chipOptimized", + "type": "INSTANCE", + "x": 223, + "y": 0, + "width": 77, + "height": 24, + "component": "Gameplane/Tag", + "componentId": "1:1142", + "strokes": [{"type": "SOLID", "color": "#EFC3D6"}], + "strokeWeight": 1, + "cornerRadius": 999, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [4, 10, 4, 10], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "HUG"] + }, + "variables": {"strokes/0/color": "border/border"}, + "texts": ["Optimized"] + }, + { + "name": "chipMultiplayer", + "type": "INSTANCE", + "x": 306, + "y": 0, + "width": 82, + "height": 24, + "component": "Gameplane/Tag", + "componentId": "1:1142", + "strokes": [{"type": "SOLID", "color": "#EFC3D6"}], + "strokeWeight": 1, + "cornerRadius": 999, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [4, 10, 4, 10], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "HUG"] + }, + "variables": {"strokes/0/color": "border/border"}, + "texts": ["Multiplayer"] + } + ] + }, + { + "name": "Modpacks Grid", + "type": "FRAME", + "x": 24, + "y": 442, + "width": 1132, + "height": 220, + "layout": { + "mode": "VERTICAL", + "gap": 8, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "name": "Row 1", + "type": "FRAME", + "x": 0, + "y": 0, + "width": 1132, + "height": 68, + "layout": { + "mode": "HORIZONTAL", + "gap": 8, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "name": "Card Fabulously Optimized", + "type": "FRAME", + "x": 0, + "y": 0, + "width": 562, + "height": 68, + "fills": [{"type": "SOLID", "color": "#FFF7FB"}], + "strokes": [{"type": "SOLID", "color": "#EFC3D6"}], + "strokeWeight": 1, + "cornerRadius": 12, + "layout": { + "mode": "HORIZONTAL", + "gap": 12, + "padding": [16, 16, 16, 16], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutGrow": 1, + "variables": { + "cornerRadius": "radius/xl", + "paddingTop": "spacing/4", + "paddingRight": "spacing/4", + "paddingBottom": "spacing/4", + "paddingLeft": "spacing/4", + "fills/0/color": "surface/surface", + "strokes/0/color": "border/border" + }, + "children": [ + { + "name": "Cover", + "type": "FRAME", + "x": 16, + "y": 16, + "width": 36, + "height": 36, + "fills": [{"type": "SOLID", "color": "#00000000", "opacity": 0}], + "cornerRadius": 4, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "CENTER", + "counter": "CENTER", + "sizing": ["FIXED", "FIXED"] + }, + "children": [ + { + "name": "Icon", + "type": "FRAME", + "x": 8, + "y": 8, + "width": 20, + "height": 20, + "variables": {"fills/0/color": "muted"}, + "children": [ + { + "name": "path", + "type": "VECTOR", + "x": 2.5, + "y": 1.67, + "width": 15, + "height": 16.67, + "strokes": [{"type": "SOLID", "color": "#6E5262"}], + "strokeWeight": 1.67 + }, + { + "name": "path", + "type": "VECTOR", + "x": 2.74, + "y": 3.56, + "width": 14.52, + "height": 6.44, + "strokes": [{"type": "SOLID", "color": "#6E5262"}], + "strokeWeight": 1.67 + } + ] + } + ] + }, + { + "name": "Info", + "type": "FRAME", + "x": 64, + "y": 17, + "width": 404, + "height": 34, + "layout": { + "mode": "VERTICAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutGrow": 1, + "children": [ + { + "name": "text", + "type": "TEXT", + "x": 0, + "y": 0, + "width": 142, + "height": 18, + "fills": [{"type": "SOLID", "color": "#2A0F1E"}], + "text": "Fabulously Optimized", + "font": ["Geist", 500, 14], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + }, + { + "name": "text", + "type": "TEXT", + "x": 0, + "y": 18, + "width": 157, + "height": 16, + "fills": [{"type": "SOLID", "color": "#6E5262"}], + "text": "robotkoer · 14.2M downloads", + "font": ["Geist", 400, 12], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "muted"} + } + ] + }, + { + "name": "Btn Install", + "type": "INSTANCE", + "x": 480, + "y": 18, + "width": 66, + "height": 32, + "component": "Gameplane/Button/Small/Default", + "componentId": "1:709", + "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": ["Install…"] + } + ] + }, + { + "name": "Card Vanilla Perfected", + "type": "FRAME", + "x": 570, + "y": 0, + "width": 562, + "height": 68, + "fills": [{"type": "SOLID", "color": "#FFF7FB"}], + "strokes": [{"type": "SOLID", "color": "#EFC3D6"}], + "strokeWeight": 1, + "cornerRadius": 12, + "layout": { + "mode": "HORIZONTAL", + "gap": 12, + "padding": [16, 16, 16, 16], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutGrow": 1, + "variables": { + "cornerRadius": "radius/xl", + "paddingTop": "spacing/4", + "paddingRight": "spacing/4", + "paddingBottom": "spacing/4", + "paddingLeft": "spacing/4", + "fills/0/color": "surface/surface", + "strokes/0/color": "border/border" + }, + "children": [ + { + "name": "Cover", + "type": "FRAME", + "x": 16, + "y": 16, + "width": 36, + "height": 36, + "fills": [{"type": "SOLID", "color": "#00000000", "opacity": 0}], + "cornerRadius": 4, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "CENTER", + "counter": "CENTER", + "sizing": ["FIXED", "FIXED"] + }, + "children": [ + { + "name": "Icon", + "type": "FRAME", + "x": 8, + "y": 8, + "width": 20, + "height": 20, + "variables": {"fills/0/color": "muted"}, + "children": [ + { + "name": "path", + "type": "VECTOR", + "x": 2.5, + "y": 1.67, + "width": 15, + "height": 16.67, + "strokes": [{"type": "SOLID", "color": "#6E5262"}], + "strokeWeight": 1.67 + }, + { + "name": "path", + "type": "VECTOR", + "x": 2.74, + "y": 3.56, + "width": 14.52, + "height": 6.44, + "strokes": [{"type": "SOLID", "color": "#6E5262"}], + "strokeWeight": 1.67 + } + ] + } + ] + }, + { + "name": "Info", + "type": "FRAME", + "x": 64, + "y": 17, + "width": 404, + "height": 34, + "layout": { + "mode": "VERTICAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutGrow": 1, + "children": [ + { + "name": "text", + "type": "TEXT", + "x": 0, + "y": 0, + "width": 112, + "height": 18, + "fills": [{"type": "SOLID", "color": "#2A0F1E"}], + "text": "Vanilla Perfected", + "font": ["Geist", 500, 14], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + }, + { + "name": "text", + "type": "TEXT", + "x": 0, + "y": 18, + "width": 157, + "height": 16, + "fills": [{"type": "SOLID", "color": "#6E5262"}], + "text": "demonjoeTV · 2M downloads", + "font": ["Geist", 400, 12], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "muted"} + } + ] + }, + { + "name": "Btn Install", + "type": "INSTANCE", + "x": 480, + "y": 18, + "width": 66, + "height": 32, + "component": "Gameplane/Button/Small/Default", + "componentId": "1:709", + "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": ["Install…"] + } + ] + } + ] + }, + { + "name": "Row 2", + "type": "FRAME", + "x": 0, + "y": 76, + "width": 1132, + "height": 68, + "layout": { + "mode": "HORIZONTAL", + "gap": 8, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "name": "Card OptiFabric", + "type": "FRAME", + "x": 0, + "y": 0, + "width": 562, + "height": 68, + "fills": [{"type": "SOLID", "color": "#FFF7FB"}], + "strokes": [{"type": "SOLID", "color": "#EFC3D6"}], + "strokeWeight": 1, + "cornerRadius": 12, + "layout": { + "mode": "HORIZONTAL", + "gap": 12, + "padding": [16, 16, 16, 16], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutGrow": 1, + "variables": { + "cornerRadius": "radius/xl", + "paddingTop": "spacing/4", + "paddingRight": "spacing/4", + "paddingBottom": "spacing/4", + "paddingLeft": "spacing/4", + "fills/0/color": "surface/surface", + "strokes/0/color": "border/border" + }, + "children": [ + { + "name": "Cover", + "type": "FRAME", + "x": 16, + "y": 16, + "width": 36, + "height": 36, + "fills": [{"type": "SOLID", "color": "#00000000", "opacity": 0}], + "cornerRadius": 4, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "CENTER", + "counter": "CENTER", + "sizing": ["FIXED", "FIXED"] + }, + "children": [ + { + "name": "Icon", + "type": "FRAME", + "x": 8, + "y": 8, + "width": 20, + "height": 20, + "variables": {"fills/0/color": "muted"}, + "children": [ + { + "name": "path", + "type": "VECTOR", + "x": 2.5, + "y": 1.67, + "width": 15, + "height": 16.67, + "strokes": [{"type": "SOLID", "color": "#6E5262"}], + "strokeWeight": 1.67 + }, + { + "name": "path", + "type": "VECTOR", + "x": 2.74, + "y": 3.56, + "width": 14.52, + "height": 6.44, + "strokes": [{"type": "SOLID", "color": "#6E5262"}], + "strokeWeight": 1.67 + } + ] + } + ] + }, + { + "name": "Info", + "type": "FRAME", + "x": 64, + "y": 17, + "width": 404, + "height": 34, + "layout": { + "mode": "VERTICAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutGrow": 1, + "children": [ + { + "name": "text", + "type": "TEXT", + "x": 0, + "y": 0, + "width": 69, + "height": 18, + "fills": [{"type": "SOLID", "color": "#2A0F1E"}], + "text": "OptiFabric", + "font": ["Geist", 500, 14], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + }, + { + "name": "text", + "type": "TEXT", + "x": 0, + "y": 18, + "width": 144, + "height": 16, + "fills": [{"type": "SOLID", "color": "#6E5262"}], + "text": "Creamer · 1.5M downloads", + "font": ["Geist", 400, 12], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "muted"} + } + ] + }, + { + "name": "Btn Install", + "type": "INSTANCE", + "x": 480, + "y": 18, + "width": 66, + "height": 32, + "component": "Gameplane/Button/Small/Default", + "componentId": "1:709", + "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": ["Install…"] + } + ] + }, + { + "name": "Card Remarkably Optimized", + "type": "FRAME", + "x": 570, + "y": 0, + "width": 562, + "height": 68, + "fills": [{"type": "SOLID", "color": "#FFF7FB"}], + "strokes": [{"type": "SOLID", "color": "#EFC3D6"}], + "strokeWeight": 1, + "cornerRadius": 12, + "layout": { + "mode": "HORIZONTAL", + "gap": 12, + "padding": [16, 16, 16, 16], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutGrow": 1, + "variables": { + "cornerRadius": "radius/xl", + "paddingTop": "spacing/4", + "paddingRight": "spacing/4", + "paddingBottom": "spacing/4", + "paddingLeft": "spacing/4", + "fills/0/color": "surface/surface", + "strokes/0/color": "border/border" + }, + "children": [ + { + "name": "Cover", + "type": "FRAME", + "x": 16, + "y": 16, + "width": 36, + "height": 36, + "fills": [{"type": "SOLID", "color": "#00000000", "opacity": 0}], + "cornerRadius": 4, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "CENTER", + "counter": "CENTER", + "sizing": ["FIXED", "FIXED"] + }, + "children": [ + { + "name": "Icon", + "type": "FRAME", + "x": 8, + "y": 8, + "width": 20, + "height": 20, + "variables": {"fills/0/color": "muted"}, + "children": [ + { + "name": "path", + "type": "VECTOR", + "x": 2.5, + "y": 1.67, + "width": 15, + "height": 16.67, + "strokes": [{"type": "SOLID", "color": "#6E5262"}], + "strokeWeight": 1.67 + }, + { + "name": "path", + "type": "VECTOR", + "x": 2.74, + "y": 3.56, + "width": 14.52, + "height": 6.44, + "strokes": [{"type": "SOLID", "color": "#6E5262"}], + "strokeWeight": 1.67 + } + ] + } + ] + }, + { + "name": "Info", + "type": "FRAME", + "x": 64, + "y": 17, + "width": 404, + "height": 34, + "layout": { + "mode": "VERTICAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutGrow": 1, + "children": [ + { + "name": "text", + "type": "TEXT", + "x": 0, + "y": 0, + "width": 149, + "height": 18, + "fills": [{"type": "SOLID", "color": "#2A0F1E"}], + "text": "Remarkably Optimized", + "font": ["Geist", 500, 14], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + }, + { + "name": "text", + "type": "TEXT", + "x": 0, + "y": 18, + "width": 159, + "height": 16, + "fills": [{"type": "SOLID", "color": "#6E5262"}], + "text": "ThatOneJay · 1.1M downloads", + "font": ["Geist", 400, 12], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "muted"} + } + ] + }, + { + "name": "Btn Install", + "type": "INSTANCE", + "x": 480, + "y": 18, + "width": 66, + "height": 32, + "component": "Gameplane/Button/Small/Default", + "componentId": "1:709", + "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": ["Install…"] + } + ] + } + ] + }, + { + "name": "Row 3", + "type": "FRAME", + "x": 0, + "y": 152, + "width": 1132, + "height": 68, + "layout": { + "mode": "HORIZONTAL", + "gap": 8, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "name": "Card FPS Modpack", + "type": "FRAME", + "x": 0, + "y": 0, + "width": 562, + "height": 68, + "fills": [{"type": "SOLID", "color": "#FFF7FB"}], + "strokes": [{"type": "SOLID", "color": "#EFC3D6"}], + "strokeWeight": 1, + "cornerRadius": 12, + "layout": { + "mode": "HORIZONTAL", + "gap": 12, + "padding": [16, 16, 16, 16], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutGrow": 1, + "variables": { + "cornerRadius": "radius/xl", + "paddingTop": "spacing/4", + "paddingRight": "spacing/4", + "paddingBottom": "spacing/4", + "paddingLeft": "spacing/4", + "fills/0/color": "surface/surface", + "strokes/0/color": "border/border" + }, + "children": [ + { + "name": "Cover", + "type": "FRAME", + "x": 16, + "y": 16, + "width": 36, + "height": 36, + "fills": [{"type": "SOLID", "color": "#00000000", "opacity": 0}], + "cornerRadius": 4, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "CENTER", + "counter": "CENTER", + "sizing": ["FIXED", "FIXED"] + }, + "children": [ + { + "name": "Icon", + "type": "FRAME", + "x": 8, + "y": 8, + "width": 20, + "height": 20, + "variables": {"fills/0/color": "muted"}, + "children": [ + { + "name": "path", + "type": "VECTOR", + "x": 2.5, + "y": 1.67, + "width": 15, + "height": 16.67, + "strokes": [{"type": "SOLID", "color": "#6E5262"}], + "strokeWeight": 1.67 + }, + { + "name": "path", + "type": "VECTOR", + "x": 2.74, + "y": 3.56, + "width": 14.52, + "height": 6.44, + "strokes": [{"type": "SOLID", "color": "#6E5262"}], + "strokeWeight": 1.67 + } + ] + } + ] + }, + { + "name": "Info", + "type": "FRAME", + "x": 64, + "y": 17, + "width": 404, + "height": 34, + "layout": { + "mode": "VERTICAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutGrow": 1, + "children": [ + { + "name": "text", + "type": "TEXT", + "x": 0, + "y": 0, + "width": 92, + "height": 18, + "fills": [{"type": "SOLID", "color": "#2A0F1E"}], + "text": "FPS Modpack", + "font": ["Geist", 500, 14], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + }, + { + "name": "text", + "type": "TEXT", + "x": 0, + "y": 18, + "width": 163, + "height": 16, + "fills": [{"type": "SOLID", "color": "#6E5262"}], + "text": "MIRRONAKE · 1.1M downloads", + "font": ["Geist", 400, 12], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "muted"} + } + ] + }, + { + "name": "Btn Install", + "type": "INSTANCE", + "x": 480, + "y": 18, + "width": 66, + "height": 32, + "component": "Gameplane/Button/Small/Default", + "componentId": "1:709", + "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": ["Install…"] + } + ] + }, + { + "name": "Card Fresh & Smooth", + "type": "FRAME", + "x": 570, + "y": 0, + "width": 562, + "height": 68, + "fills": [{"type": "SOLID", "color": "#FFF7FB"}], + "strokes": [{"type": "SOLID", "color": "#EFC3D6"}], + "strokeWeight": 1, + "cornerRadius": 12, + "layout": { + "mode": "HORIZONTAL", + "gap": 12, + "padding": [16, 16, 16, 16], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutGrow": 1, + "variables": { + "cornerRadius": "radius/xl", + "paddingTop": "spacing/4", + "paddingRight": "spacing/4", + "paddingBottom": "spacing/4", + "paddingLeft": "spacing/4", + "fills/0/color": "surface/surface", + "strokes/0/color": "border/border" + }, + "children": [ + { + "name": "Cover", + "type": "FRAME", + "x": 16, + "y": 16, + "width": 36, + "height": 36, + "fills": [{"type": "SOLID", "color": "#00000000", "opacity": 0}], + "cornerRadius": 4, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "CENTER", + "counter": "CENTER", + "sizing": ["FIXED", "FIXED"] + }, + "children": [ + { + "name": "Icon", + "type": "FRAME", + "x": 8, + "y": 8, + "width": 20, + "height": 20, + "variables": {"fills/0/color": "muted"}, + "children": [ + { + "name": "path", + "type": "VECTOR", + "x": 2.5, + "y": 1.67, + "width": 15, + "height": 16.67, + "strokes": [{"type": "SOLID", "color": "#6E5262"}], + "strokeWeight": 1.67 + }, + { + "name": "path", + "type": "VECTOR", + "x": 2.74, + "y": 3.56, + "width": 14.52, + "height": 6.44, + "strokes": [{"type": "SOLID", "color": "#6E5262"}], + "strokeWeight": 1.67 + } + ] + } + ] + }, + { + "name": "Info", + "type": "FRAME", + "x": 64, + "y": 17, + "width": 404, + "height": 34, + "layout": { + "mode": "VERTICAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutGrow": 1, + "children": [ + { + "name": "text", + "type": "TEXT", + "x": 0, + "y": 0, + "width": 104, + "height": 18, + "fills": [{"type": "SOLID", "color": "#2A0F1E"}], + "text": "Fresh & Smooth", + "font": ["Geist", 500, 14], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + }, + { + "name": "text", + "type": "TEXT", + "x": 0, + "y": 18, + "width": 176, + "height": 16, + "fills": [{"type": "SOLID", "color": "#6E5262"}], + "text": "EndarPacks · 864.3K downloads", + "font": ["Geist", 400, 12], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "muted"} + } + ] + }, + { + "name": "Btn Install", + "type": "INSTANCE", + "x": 480, + "y": 18, + "width": 66, + "height": 32, + "component": "Gameplane/Button/Small/Default", + "componentId": "1:709", + "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": ["Install…"] + } + ] + } + ] + } + ] + }, + { + "name": "Load More Row", + "type": "FRAME", + "x": 24, + "y": 678, + "width": 1132, + "height": 32, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "CENTER", + "counter": "MIN", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "name": "Btn Load More", + "type": "INSTANCE", + "x": 521.5, + "y": 0, + "width": 89, + "height": 32, + "component": "Gameplane/Button/Small/Outline", + "componentId": "1:740", + "fills": [{"type": "SOLID", "color": "#00000000", "opacity": 0}], + "strokes": [{"type": "SOLID", "color": "#EFC3D6"}], + "strokeWeight": 1, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "CENTER", + "counter": "CENTER", + "sizing": ["HUG", "HUG"] + }, + "variables": {"strokes/0/color": "border/border"}, + "texts": ["Load more"] + } + ] + } + ] + } + ] + } + ] +} diff --git a/assets/design-export/json/1274632774-3217.json b/assets/design-export/json/1274632774-3217.json new file mode 100644 index 000000000..d91c812fe --- /dev/null +++ b/assets/design-export/json/1274632774-3217.json @@ -0,0 +1,1553 @@ +{ + "file": "1274632774-3217", + "name": "Screen/Server Detail — Modpacks (Read-only)", + "type": "FRAME", + "x": 14760, + "y": 32970, + "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" + ] + }, + { + "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", "test-server-02", "Search servers…", "AD"] + }, + { + "name": "Body", + "type": "FRAME", + "x": 0, + "y": 64, + "width": 1180, + "height": 836, + "fills": [{"type": "SOLID", "color": "#121114"}], + "layout": { + "mode": "VERTICAL", + "gap": 16, + "padding": [24, 24, 24, 24], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "FIXED"] + }, + "layoutGrow": 1, + "layoutAlignSelf": "STRETCH", + "variables": {"fills/0/color": "background/background"}, + "children": [ + { + "name": "Detail Header", + "type": "INSTANCE", + "x": 24, + "y": 24, + "width": 1132, + "height": 78, + "component": "Gameplane/Server Detail Header", + "componentId": "1:447", + "fills": [{"type": "SOLID", "color": "#121114"}], + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [8, 0, 16, 0], + "primary": "SPACE_BETWEEN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"fills/0/color": "background/background"}, + "texts": [ + "MI", + "test-server-02", + "Running", + "minecraft-java · fabric 1.21.1 · ns: default · up 13d 4h", + "Restart", + "Stop", + "Open console" + ] + }, + { + "name": "Tabs Bar", + "type": "INSTANCE", + "x": 24, + "y": 118, + "width": 1132, + "height": 40, + "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": [0, 0, 0, 0], + "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" + ] + }, + { + "name": "Active Modpack Card", + "type": "INSTANCE", + "x": 24, + "y": 174, + "width": 1132, + "height": 106, + "component": "Gameplane/Active Modpack Card", + "fills": [{"type": "SOLID", "color": "#1C1A20"}], + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "cornerRadius": 12, + "layout": { + "mode": "VERTICAL", + "gap": 12, + "padding": [16, 16, 16, 16], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"fills/0/color": "surface/surface", "strokes/0/color": "border/border"}, + "texts": [ + "Active modpack", + "Fabulously Optimized", + "Modrinth", + "Applied", + "Version 6.4.0 · pinned · Minecraft 1.21.1 · Fabric", + "Change version", + "Remove" + ] + }, + { + "name": "Modpacks Heading", + "type": "FRAME", + "x": 24, + "y": 296, + "width": 1132, + "height": 34, + "layout": { + "mode": "VERTICAL", + "gap": 2, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "name": "heading", + "type": "TEXT", + "x": 0, + "y": 0, + "width": 119, + "height": 18, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "text": "Browse modpacks", + "font": ["Geist", 400, 14], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "muted"} + }, + { + "name": "subheading", + "type": "TEXT", + "x": 0, + "y": 20, + "width": 1132, + "height": 14, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "layoutAlignSelf": "STRETCH", + "text": "Pick a pack and a version. The server pins that version and restarts to install it; a restart never upgrades it.", + "font": ["Geist", 400, 11], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "muted"} + } + ] + }, + { + "name": "Filters Row", + "type": "FRAME", + "x": 24, + "y": 346, + "width": 1132, + "height": 40, + "layout": { + "mode": "HORIZONTAL", + "gap": 8, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "name": "Provider Switch", + "type": "INSTANCE", + "x": 0, + "y": 0, + "width": 266, + "height": 40, + "component": "Gameplane/Provider Switch", + "fills": [{"type": "SOLID", "color": "#232128"}], + "cornerRadius": 20, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [4, 4, 4, 4], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "HUG"] + }, + "variables": {"fills/0/color": "default/default"}, + "texts": ["Modrinth", "CurseForge", "FTB"] + }, + { + "name": "Search", + "type": "INSTANCE", + "x": 274, + "y": 2, + "width": 630, + "height": 36, + "component": "Gameplane/Search Input", + "componentId": "1:975", + "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": 6, + "padding": [0, 12, 0, 12], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "FIXED"] + }, + "layoutGrow": 1, + "variables": { + "cornerRadius": "radius/xl", + "fills/0/color": "field/background", + "strokes/0/color": "field/border" + }, + "texts": ["Search modpacks…"] + }, + { + "name": "Select", + "type": "INSTANCE", + "x": 912, + "y": 2, + "width": 220, + "height": 36, + "component": "Gameplane/Select", + "componentId": "1:311", + "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": "SPACE_BETWEEN", + "counter": "CENTER", + "sizing": ["FIXED", "FIXED"] + }, + "variables": { + "cornerRadius": "radius/xl", + "fills/0/color": "field/background", + "strokes/0/color": "field/border" + }, + "texts": ["Sort: Downloads"] + } + ] + }, + { + "name": "Category Chips", + "type": "FRAME", + "x": 24, + "y": 402, + "width": 1132, + "height": 24, + "layout": { + "mode": "HORIZONTAL", + "gap": 6, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "name": "chipAll", + "type": "INSTANCE", + "x": 0, + "y": 3.5, + "width": 22, + "height": 17, + "component": "Chip/Primary/Accent/SM", + "componentId": "1:981", + "fills": [{"type": "SOLID", "color": "#FF4FA3"}], + "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": "accent/accent"}, + "texts": ["All"] + }, + { + "name": "chipAdventure", + "type": "INSTANCE", + "x": 28, + "y": 0, + "width": 77, + "height": 24, + "component": "Gameplane/Tag", + "componentId": "1:1142", + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "cornerRadius": 999, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [4, 10, 4, 10], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "HUG"] + }, + "variables": {"strokes/0/color": "border/border"}, + "texts": ["Adventure"] + }, + { + "name": "chipTech", + "type": "INSTANCE", + "x": 111, + "y": 0, + "width": 46, + "height": 24, + "component": "Gameplane/Tag", + "componentId": "1:1142", + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "cornerRadius": 999, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [4, 10, 4, 10], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "HUG"] + }, + "variables": {"strokes/0/color": "border/border"}, + "texts": ["Tech"] + }, + { + "name": "chipMagic", + "type": "INSTANCE", + "x": 163, + "y": 0, + "width": 54, + "height": 24, + "component": "Gameplane/Tag", + "componentId": "1:1142", + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "cornerRadius": 999, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [4, 10, 4, 10], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "HUG"] + }, + "variables": {"strokes/0/color": "border/border"}, + "texts": ["Magic"] + }, + { + "name": "chipOptimized", + "type": "INSTANCE", + "x": 223, + "y": 0, + "width": 77, + "height": 24, + "component": "Gameplane/Tag", + "componentId": "1:1142", + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "cornerRadius": 999, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [4, 10, 4, 10], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "HUG"] + }, + "variables": {"strokes/0/color": "border/border"}, + "texts": ["Optimized"] + }, + { + "name": "chipMultiplayer", + "type": "INSTANCE", + "x": 306, + "y": 0, + "width": 82, + "height": 24, + "component": "Gameplane/Tag", + "componentId": "1:1142", + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "cornerRadius": 999, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [4, 10, 4, 10], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "HUG"] + }, + "variables": {"strokes/0/color": "border/border"}, + "texts": ["Multiplayer"] + } + ] + }, + { + "name": "Modpacks Grid", + "type": "FRAME", + "x": 24, + "y": 442, + "width": 1132, + "height": 220, + "layout": { + "mode": "VERTICAL", + "gap": 8, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "name": "Row 1", + "type": "FRAME", + "x": 0, + "y": 0, + "width": 1132, + "height": 68, + "layout": { + "mode": "HORIZONTAL", + "gap": 8, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "name": "Card Fabulously Optimized", + "type": "FRAME", + "x": 0, + "y": 0, + "width": 562, + "height": 68, + "fills": [{"type": "SOLID", "color": "#1C1A20"}], + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "cornerRadius": 12, + "layout": { + "mode": "HORIZONTAL", + "gap": 12, + "padding": [16, 16, 16, 16], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutGrow": 1, + "variables": { + "cornerRadius": "radius/xl", + "paddingTop": "spacing/4", + "paddingRight": "spacing/4", + "paddingBottom": "spacing/4", + "paddingLeft": "spacing/4", + "fills/0/color": "surface/surface", + "strokes/0/color": "border/border" + }, + "children": [ + { + "name": "Cover", + "type": "FRAME", + "x": 16, + "y": 16, + "width": 36, + "height": 36, + "fills": [{"type": "SOLID", "color": "#00000000", "opacity": 0}], + "cornerRadius": 4, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "CENTER", + "counter": "CENTER", + "sizing": ["FIXED", "FIXED"] + }, + "children": [ + { + "name": "Icon", + "type": "FRAME", + "x": 8, + "y": 8, + "width": 20, + "height": 20, + "variables": {"fills/0/color": "muted"}, + "children": [ + { + "name": "path", + "type": "VECTOR", + "x": 2.5, + "y": 1.67, + "width": 15, + "height": 16.67, + "strokes": [{"type": "SOLID", "color": "#9E98A6"}], + "strokeWeight": 1.67 + }, + { + "name": "path", + "type": "VECTOR", + "x": 2.74, + "y": 3.56, + "width": 14.52, + "height": 6.44, + "strokes": [{"type": "SOLID", "color": "#9E98A6"}], + "strokeWeight": 1.67 + } + ] + } + ] + }, + { + "name": "Info", + "type": "FRAME", + "x": 64, + "y": 17, + "width": 404, + "height": 34, + "layout": { + "mode": "VERTICAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutGrow": 1, + "children": [ + { + "name": "text", + "type": "TEXT", + "x": 0, + "y": 0, + "width": 142, + "height": 18, + "fills": [{"type": "SOLID", "color": "#F5F3F7"}], + "text": "Fabulously Optimized", + "font": ["Geist", 500, 14], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + }, + { + "name": "text", + "type": "TEXT", + "x": 0, + "y": 18, + "width": 157, + "height": 16, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "text": "robotkoer · 14.2M downloads", + "font": ["Geist", 400, 12], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "muted"} + } + ] + }, + { + "name": "Btn Install", + "type": "INSTANCE", + "x": 480, + "y": 18, + "width": 66, + "height": 32, + "opacity": 0.5, + "component": "Gameplane/Button/Small/Default", + "componentId": "1:709", + "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": ["Install…"] + } + ] + }, + { + "name": "Card Vanilla Perfected", + "type": "FRAME", + "x": 570, + "y": 0, + "width": 562, + "height": 68, + "fills": [{"type": "SOLID", "color": "#1C1A20"}], + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "cornerRadius": 12, + "layout": { + "mode": "HORIZONTAL", + "gap": 12, + "padding": [16, 16, 16, 16], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutGrow": 1, + "variables": { + "cornerRadius": "radius/xl", + "paddingTop": "spacing/4", + "paddingRight": "spacing/4", + "paddingBottom": "spacing/4", + "paddingLeft": "spacing/4", + "fills/0/color": "surface/surface", + "strokes/0/color": "border/border" + }, + "children": [ + { + "name": "Cover", + "type": "FRAME", + "x": 16, + "y": 16, + "width": 36, + "height": 36, + "fills": [{"type": "SOLID", "color": "#00000000", "opacity": 0}], + "cornerRadius": 4, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "CENTER", + "counter": "CENTER", + "sizing": ["FIXED", "FIXED"] + }, + "children": [ + { + "name": "Icon", + "type": "FRAME", + "x": 8, + "y": 8, + "width": 20, + "height": 20, + "variables": {"fills/0/color": "muted"}, + "children": [ + { + "name": "path", + "type": "VECTOR", + "x": 2.5, + "y": 1.67, + "width": 15, + "height": 16.67, + "strokes": [{"type": "SOLID", "color": "#9E98A6"}], + "strokeWeight": 1.67 + }, + { + "name": "path", + "type": "VECTOR", + "x": 2.74, + "y": 3.56, + "width": 14.52, + "height": 6.44, + "strokes": [{"type": "SOLID", "color": "#9E98A6"}], + "strokeWeight": 1.67 + } + ] + } + ] + }, + { + "name": "Info", + "type": "FRAME", + "x": 64, + "y": 17, + "width": 404, + "height": 34, + "layout": { + "mode": "VERTICAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutGrow": 1, + "children": [ + { + "name": "text", + "type": "TEXT", + "x": 0, + "y": 0, + "width": 112, + "height": 18, + "fills": [{"type": "SOLID", "color": "#F5F3F7"}], + "text": "Vanilla Perfected", + "font": ["Geist", 500, 14], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + }, + { + "name": "text", + "type": "TEXT", + "x": 0, + "y": 18, + "width": 157, + "height": 16, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "text": "demonjoeTV · 2M downloads", + "font": ["Geist", 400, 12], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "muted"} + } + ] + }, + { + "name": "Btn Install", + "type": "INSTANCE", + "x": 480, + "y": 18, + "width": 66, + "height": 32, + "opacity": 0.5, + "component": "Gameplane/Button/Small/Default", + "componentId": "1:709", + "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": ["Install…"] + } + ] + } + ] + }, + { + "name": "Row 2", + "type": "FRAME", + "x": 0, + "y": 76, + "width": 1132, + "height": 68, + "layout": { + "mode": "HORIZONTAL", + "gap": 8, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "name": "Card OptiFabric", + "type": "FRAME", + "x": 0, + "y": 0, + "width": 562, + "height": 68, + "fills": [{"type": "SOLID", "color": "#1C1A20"}], + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "cornerRadius": 12, + "layout": { + "mode": "HORIZONTAL", + "gap": 12, + "padding": [16, 16, 16, 16], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutGrow": 1, + "variables": { + "cornerRadius": "radius/xl", + "paddingTop": "spacing/4", + "paddingRight": "spacing/4", + "paddingBottom": "spacing/4", + "paddingLeft": "spacing/4", + "fills/0/color": "surface/surface", + "strokes/0/color": "border/border" + }, + "children": [ + { + "name": "Cover", + "type": "FRAME", + "x": 16, + "y": 16, + "width": 36, + "height": 36, + "fills": [{"type": "SOLID", "color": "#00000000", "opacity": 0}], + "cornerRadius": 4, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "CENTER", + "counter": "CENTER", + "sizing": ["FIXED", "FIXED"] + }, + "children": [ + { + "name": "Icon", + "type": "FRAME", + "x": 8, + "y": 8, + "width": 20, + "height": 20, + "variables": {"fills/0/color": "muted"}, + "children": [ + { + "name": "path", + "type": "VECTOR", + "x": 2.5, + "y": 1.67, + "width": 15, + "height": 16.67, + "strokes": [{"type": "SOLID", "color": "#9E98A6"}], + "strokeWeight": 1.67 + }, + { + "name": "path", + "type": "VECTOR", + "x": 2.74, + "y": 3.56, + "width": 14.52, + "height": 6.44, + "strokes": [{"type": "SOLID", "color": "#9E98A6"}], + "strokeWeight": 1.67 + } + ] + } + ] + }, + { + "name": "Info", + "type": "FRAME", + "x": 64, + "y": 17, + "width": 404, + "height": 34, + "layout": { + "mode": "VERTICAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutGrow": 1, + "children": [ + { + "name": "text", + "type": "TEXT", + "x": 0, + "y": 0, + "width": 69, + "height": 18, + "fills": [{"type": "SOLID", "color": "#F5F3F7"}], + "text": "OptiFabric", + "font": ["Geist", 500, 14], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + }, + { + "name": "text", + "type": "TEXT", + "x": 0, + "y": 18, + "width": 144, + "height": 16, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "text": "Creamer · 1.5M downloads", + "font": ["Geist", 400, 12], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "muted"} + } + ] + }, + { + "name": "Btn Install", + "type": "INSTANCE", + "x": 480, + "y": 18, + "width": 66, + "height": 32, + "opacity": 0.5, + "component": "Gameplane/Button/Small/Default", + "componentId": "1:709", + "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": ["Install…"] + } + ] + }, + { + "name": "Card Remarkably Optimized", + "type": "FRAME", + "x": 570, + "y": 0, + "width": 562, + "height": 68, + "fills": [{"type": "SOLID", "color": "#1C1A20"}], + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "cornerRadius": 12, + "layout": { + "mode": "HORIZONTAL", + "gap": 12, + "padding": [16, 16, 16, 16], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutGrow": 1, + "variables": { + "cornerRadius": "radius/xl", + "paddingTop": "spacing/4", + "paddingRight": "spacing/4", + "paddingBottom": "spacing/4", + "paddingLeft": "spacing/4", + "fills/0/color": "surface/surface", + "strokes/0/color": "border/border" + }, + "children": [ + { + "name": "Cover", + "type": "FRAME", + "x": 16, + "y": 16, + "width": 36, + "height": 36, + "fills": [{"type": "SOLID", "color": "#00000000", "opacity": 0}], + "cornerRadius": 4, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "CENTER", + "counter": "CENTER", + "sizing": ["FIXED", "FIXED"] + }, + "children": [ + { + "name": "Icon", + "type": "FRAME", + "x": 8, + "y": 8, + "width": 20, + "height": 20, + "variables": {"fills/0/color": "muted"}, + "children": [ + { + "name": "path", + "type": "VECTOR", + "x": 2.5, + "y": 1.67, + "width": 15, + "height": 16.67, + "strokes": [{"type": "SOLID", "color": "#9E98A6"}], + "strokeWeight": 1.67 + }, + { + "name": "path", + "type": "VECTOR", + "x": 2.74, + "y": 3.56, + "width": 14.52, + "height": 6.44, + "strokes": [{"type": "SOLID", "color": "#9E98A6"}], + "strokeWeight": 1.67 + } + ] + } + ] + }, + { + "name": "Info", + "type": "FRAME", + "x": 64, + "y": 17, + "width": 404, + "height": 34, + "layout": { + "mode": "VERTICAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutGrow": 1, + "children": [ + { + "name": "text", + "type": "TEXT", + "x": 0, + "y": 0, + "width": 149, + "height": 18, + "fills": [{"type": "SOLID", "color": "#F5F3F7"}], + "text": "Remarkably Optimized", + "font": ["Geist", 500, 14], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + }, + { + "name": "text", + "type": "TEXT", + "x": 0, + "y": 18, + "width": 159, + "height": 16, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "text": "ThatOneJay · 1.1M downloads", + "font": ["Geist", 400, 12], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "muted"} + } + ] + }, + { + "name": "Btn Install", + "type": "INSTANCE", + "x": 480, + "y": 18, + "width": 66, + "height": 32, + "opacity": 0.5, + "component": "Gameplane/Button/Small/Default", + "componentId": "1:709", + "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": ["Install…"] + } + ] + } + ] + }, + { + "name": "Row 3", + "type": "FRAME", + "x": 0, + "y": 152, + "width": 1132, + "height": 68, + "layout": { + "mode": "HORIZONTAL", + "gap": 8, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "name": "Card FPS Modpack", + "type": "FRAME", + "x": 0, + "y": 0, + "width": 562, + "height": 68, + "fills": [{"type": "SOLID", "color": "#1C1A20"}], + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "cornerRadius": 12, + "layout": { + "mode": "HORIZONTAL", + "gap": 12, + "padding": [16, 16, 16, 16], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutGrow": 1, + "variables": { + "cornerRadius": "radius/xl", + "paddingTop": "spacing/4", + "paddingRight": "spacing/4", + "paddingBottom": "spacing/4", + "paddingLeft": "spacing/4", + "fills/0/color": "surface/surface", + "strokes/0/color": "border/border" + }, + "children": [ + { + "name": "Cover", + "type": "FRAME", + "x": 16, + "y": 16, + "width": 36, + "height": 36, + "fills": [{"type": "SOLID", "color": "#00000000", "opacity": 0}], + "cornerRadius": 4, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "CENTER", + "counter": "CENTER", + "sizing": ["FIXED", "FIXED"] + }, + "children": [ + { + "name": "Icon", + "type": "FRAME", + "x": 8, + "y": 8, + "width": 20, + "height": 20, + "variables": {"fills/0/color": "muted"}, + "children": [ + { + "name": "path", + "type": "VECTOR", + "x": 2.5, + "y": 1.67, + "width": 15, + "height": 16.67, + "strokes": [{"type": "SOLID", "color": "#9E98A6"}], + "strokeWeight": 1.67 + }, + { + "name": "path", + "type": "VECTOR", + "x": 2.74, + "y": 3.56, + "width": 14.52, + "height": 6.44, + "strokes": [{"type": "SOLID", "color": "#9E98A6"}], + "strokeWeight": 1.67 + } + ] + } + ] + }, + { + "name": "Info", + "type": "FRAME", + "x": 64, + "y": 17, + "width": 404, + "height": 34, + "layout": { + "mode": "VERTICAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutGrow": 1, + "children": [ + { + "name": "text", + "type": "TEXT", + "x": 0, + "y": 0, + "width": 92, + "height": 18, + "fills": [{"type": "SOLID", "color": "#F5F3F7"}], + "text": "FPS Modpack", + "font": ["Geist", 500, 14], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + }, + { + "name": "text", + "type": "TEXT", + "x": 0, + "y": 18, + "width": 163, + "height": 16, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "text": "MIRRONAKE · 1.1M downloads", + "font": ["Geist", 400, 12], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "muted"} + } + ] + }, + { + "name": "Btn Install", + "type": "INSTANCE", + "x": 480, + "y": 18, + "width": 66, + "height": 32, + "opacity": 0.5, + "component": "Gameplane/Button/Small/Default", + "componentId": "1:709", + "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": ["Install…"] + } + ] + }, + { + "name": "Card Fresh & Smooth", + "type": "FRAME", + "x": 570, + "y": 0, + "width": 562, + "height": 68, + "fills": [{"type": "SOLID", "color": "#1C1A20"}], + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "cornerRadius": 12, + "layout": { + "mode": "HORIZONTAL", + "gap": 12, + "padding": [16, 16, 16, 16], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutGrow": 1, + "variables": { + "cornerRadius": "radius/xl", + "paddingTop": "spacing/4", + "paddingRight": "spacing/4", + "paddingBottom": "spacing/4", + "paddingLeft": "spacing/4", + "fills/0/color": "surface/surface", + "strokes/0/color": "border/border" + }, + "children": [ + { + "name": "Cover", + "type": "FRAME", + "x": 16, + "y": 16, + "width": 36, + "height": 36, + "fills": [{"type": "SOLID", "color": "#00000000", "opacity": 0}], + "cornerRadius": 4, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "CENTER", + "counter": "CENTER", + "sizing": ["FIXED", "FIXED"] + }, + "children": [ + { + "name": "Icon", + "type": "FRAME", + "x": 8, + "y": 8, + "width": 20, + "height": 20, + "variables": {"fills/0/color": "muted"}, + "children": [ + { + "name": "path", + "type": "VECTOR", + "x": 2.5, + "y": 1.67, + "width": 15, + "height": 16.67, + "strokes": [{"type": "SOLID", "color": "#9E98A6"}], + "strokeWeight": 1.67 + }, + { + "name": "path", + "type": "VECTOR", + "x": 2.74, + "y": 3.56, + "width": 14.52, + "height": 6.44, + "strokes": [{"type": "SOLID", "color": "#9E98A6"}], + "strokeWeight": 1.67 + } + ] + } + ] + }, + { + "name": "Info", + "type": "FRAME", + "x": 64, + "y": 17, + "width": 404, + "height": 34, + "layout": { + "mode": "VERTICAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutGrow": 1, + "children": [ + { + "name": "text", + "type": "TEXT", + "x": 0, + "y": 0, + "width": 104, + "height": 18, + "fills": [{"type": "SOLID", "color": "#F5F3F7"}], + "text": "Fresh & Smooth", + "font": ["Geist", 500, 14], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + }, + { + "name": "text", + "type": "TEXT", + "x": 0, + "y": 18, + "width": 176, + "height": 16, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "text": "EndarPacks · 864.3K downloads", + "font": ["Geist", 400, 12], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "muted"} + } + ] + }, + { + "name": "Btn Install", + "type": "INSTANCE", + "x": 480, + "y": 18, + "width": 66, + "height": 32, + "opacity": 0.5, + "component": "Gameplane/Button/Small/Default", + "componentId": "1:709", + "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": ["Install…"] + } + ] + } + ] + } + ] + }, + { + "name": "Load More Row", + "type": "FRAME", + "x": 24, + "y": 678, + "width": 1132, + "height": 32, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "CENTER", + "counter": "MIN", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "name": "Btn Load More", + "type": "INSTANCE", + "x": 521.5, + "y": 0, + "width": 89, + "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": ["HUG", "HUG"] + }, + "variables": {"strokes/0/color": "border/border"}, + "texts": ["Load more"] + } + ] + } + ] + } + ] + }, + { + "name": "Requires operator role tooltip", + "type": "INSTANCE", + "x": 1170, + "y": 250, + "width": 138, + "height": 24, + "component": "Tooltip", + "componentId": "1:5495", + "fills": [{"type": "SOLID", "color": "#201E24"}], + "effects": [{"type": "DROP_SHADOW", "radius": 8, "visible": true}], + "cornerRadius": 12, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [4, 8, 4, 8], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["HUG", "HUG"] + }, + "absolute": true, + "variables": {"cornerRadius": "radius/xl", "fills/0/color": "overlay"}, + "texts": ["Requires operator role"] + } + ] +} diff --git a/assets/design-export/json/1274632774-3559.json b/assets/design-export/json/1274632774-3559.json new file mode 100644 index 000000000..e0f08ec81 --- /dev/null +++ b/assets/design-export/json/1274632774-3559.json @@ -0,0 +1,1122 @@ +{ + "file": "1274632774-3559", + "name": "States/Modpacks — Active card and tab states (reference)", + "type": "FRAME", + "x": 16400, + "y": 32970, + "width": 2280, + "height": 1158, + "fills": [{"type": "SOLID", "color": "#121114"}], + "layout": { + "mode": "HORIZONTAL", + "gap": 32, + "padding": [32, 32, 32, 32], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "HUG"] + }, + "variables": {"fills/0/color": "background/background"}, + "children": [ + { + "name": "Active card states", + "type": "FRAME", + "x": 32, + "y": 32, + "width": 1120, + "height": 1094, + "layout": { + "mode": "VERTICAL", + "gap": 20, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "children": [ + { + "name": "State — Backing up", + "type": "FRAME", + "x": 0, + "y": 0, + "width": 1120, + "height": 141, + "layout": { + "mode": "VERTICAL", + "gap": 6, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "name": "Text", + "type": "TEXT", + "x": 0, + "y": 0, + "width": 65, + "height": 16, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "text": "Backing up", + "font": ["Geist", 600, 12], + "variables": {"fills/0/color": "muted"} + }, + { + "name": "Active Modpack Card", + "type": "INSTANCE", + "x": 0, + "y": 22, + "width": 1120, + "height": 119, + "component": "Gameplane/Active Modpack Card", + "fills": [{"type": "SOLID", "color": "#1C1A20"}], + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "cornerRadius": 12, + "layout": { + "mode": "VERTICAL", + "gap": 12, + "padding": [16, 16, 16, 16], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"fills/0/color": "surface/surface", "strokes/0/color": "border/border"}, + "texts": [ + "Active modpack", + "Fabulously Optimized", + "Modrinth", + "Backing up", + "Version 6.4.0 · pinned · Minecraft 1.21.1 · Fabric", + "Backing up before switching to 6.5.0. The server keeps running 6.4.0.", + "Change version", + "Remove" + ] + } + ] + }, + { + "name": "State — Applying", + "type": "FRAME", + "x": 0, + "y": 161, + "width": 1120, + "height": 141, + "layout": { + "mode": "VERTICAL", + "gap": 6, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "name": "Text", + "type": "TEXT", + "x": 0, + "y": 0, + "width": 51, + "height": 16, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "text": "Applying", + "font": ["Geist", 600, 12], + "variables": {"fills/0/color": "muted"} + }, + { + "name": "Active Modpack Card", + "type": "INSTANCE", + "x": 0, + "y": 22, + "width": 1120, + "height": 119, + "component": "Gameplane/Active Modpack Card", + "fills": [{"type": "SOLID", "color": "#1C1A20"}], + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "cornerRadius": 12, + "layout": { + "mode": "VERTICAL", + "gap": 12, + "padding": [16, 16, 16, 16], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"fills/0/color": "surface/surface", "strokes/0/color": "border/border"}, + "texts": [ + "Active modpack", + "Fabulously Optimized", + "Modrinth", + "Applying", + "Version 6.5.0 · pinned · Minecraft 1.21.1 · Fabric", + "Restarting with 6.5.0…", + "Change version", + "Remove" + ] + } + ] + }, + { + "name": "State — Backup failed", + "type": "FRAME", + "x": 0, + "y": 322, + "width": 1120, + "height": 141, + "layout": { + "mode": "VERTICAL", + "gap": 6, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "name": "Text", + "type": "TEXT", + "x": 0, + "y": 0, + "width": 80, + "height": 16, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "text": "Backup failed", + "font": ["Geist", 600, 12], + "variables": {"fills/0/color": "muted"} + }, + { + "name": "Active Modpack Card", + "type": "INSTANCE", + "x": 0, + "y": 22, + "width": 1120, + "height": 119, + "component": "Gameplane/Active Modpack Card", + "fills": [{"type": "SOLID", "color": "#1C1A20"}], + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "cornerRadius": 12, + "layout": { + "mode": "VERTICAL", + "gap": 12, + "padding": [16, 16, 16, 16], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"fills/0/color": "surface/surface", "strokes/0/color": "border/border"}, + "texts": [ + "Active modpack", + "Fabulously Optimized", + "Modrinth", + "Backup failed", + "Version 6.4.0 · pinned · Minecraft 1.21.1 · Fabric", + "Backup mc-modded-modpack-12 failed: repository is locked. Nothing changed; the server still runs 6.4.0.", + "Change version", + "Remove" + ] + } + ] + }, + { + "name": "State — Not pinned (adopted)", + "type": "FRAME", + "x": 0, + "y": 483, + "width": 1120, + "height": 141, + "layout": { + "mode": "VERTICAL", + "gap": 6, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "name": "Text", + "type": "TEXT", + "x": 0, + "y": 0, + "width": 121, + "height": 16, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "text": "Not pinned (adopted)", + "font": ["Geist", 600, 12], + "variables": {"fills/0/color": "muted"} + }, + { + "name": "Active Modpack Card", + "type": "INSTANCE", + "x": 0, + "y": 22, + "width": 1120, + "height": 119, + "component": "Gameplane/Active Modpack Card", + "fills": [{"type": "SOLID", "color": "#1C1A20"}], + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "cornerRadius": 12, + "layout": { + "mode": "VERTICAL", + "gap": 12, + "padding": [16, 16, 16, 16], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"fills/0/color": "surface/surface", "strokes/0/color": "border/border"}, + "texts": [ + "Active modpack", + "Fabulously Optimized", + "Modrinth", + "Not pinned", + "Version unknown · Minecraft 1.21.1 · Fabric", + "The installed version could not be read. Pick a version to pin this pack; until then a restart may upgrade it.", + "Pick version", + "Remove" + ] + } + ] + }, + { + "name": "State — Removing", + "type": "FRAME", + "x": 0, + "y": 644, + "width": 1120, + "height": 141, + "layout": { + "mode": "VERTICAL", + "gap": 6, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "name": "Text", + "type": "TEXT", + "x": 0, + "y": 0, + "width": 58, + "height": 16, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "text": "Removing", + "font": ["Geist", 600, 12], + "variables": {"fills/0/color": "muted"} + }, + { + "name": "Active Modpack Card", + "type": "INSTANCE", + "x": 0, + "y": 22, + "width": 1120, + "height": 119, + "component": "Gameplane/Active Modpack Card", + "fills": [{"type": "SOLID", "color": "#1C1A20"}], + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "cornerRadius": 12, + "layout": { + "mode": "VERTICAL", + "gap": 12, + "padding": [16, 16, 16, 16], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"fills/0/color": "surface/surface", "strokes/0/color": "border/border"}, + "texts": [ + "Active modpack", + "Fabulously Optimized", + "Modrinth", + "Removing", + "Version 6.4.0 · pinned · Minecraft 1.21.1 · Fabric", + "Removing the pack and emptying the mods folder at the next start…", + "Change version", + "Remove" + ] + } + ] + }, + { + "name": "State — Removal backup failed", + "type": "FRAME", + "x": 0, + "y": 805, + "width": 1120, + "height": 141, + "layout": { + "mode": "VERTICAL", + "gap": 6, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "name": "Text", + "type": "TEXT", + "x": 0, + "y": 0, + "width": 131, + "height": 16, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "text": "Removal backup failed", + "font": ["Geist", 600, 12], + "variables": {"fills/0/color": "muted"} + }, + { + "name": "Active Modpack Card", + "type": "INSTANCE", + "x": 0, + "y": 22, + "width": 1120, + "height": 119, + "component": "Gameplane/Active Modpack Card", + "fills": [{"type": "SOLID", "color": "#1C1A20"}], + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "cornerRadius": 12, + "layout": { + "mode": "VERTICAL", + "gap": 12, + "padding": [16, 16, 16, 16], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"fills/0/color": "surface/surface", "strokes/0/color": "border/border"}, + "texts": [ + "Active modpack", + "Fabulously Optimized", + "Modrinth", + "Backup failed", + "Version 6.4.0 · pinned · Minecraft 1.21.1 · Fabric", + "The backup before removal failed: destination unreachable. The pack is still installed.", + "Change version", + "Retry remove" + ] + } + ] + }, + { + "name": "State — FTB pack", + "type": "FRAME", + "x": 0, + "y": 966, + "width": 1120, + "height": 128, + "layout": { + "mode": "VERTICAL", + "gap": 6, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "name": "Text", + "type": "TEXT", + "x": 0, + "y": 0, + "width": 54, + "height": 16, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "text": "FTB pack", + "font": ["Geist", 600, 12], + "variables": {"fills/0/color": "muted"} + }, + { + "name": "Active Modpack Card", + "type": "INSTANCE", + "x": 0, + "y": 22, + "width": 1120, + "height": 106, + "component": "Gameplane/Active Modpack Card", + "fills": [{"type": "SOLID", "color": "#1C1A20"}], + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "cornerRadius": 12, + "layout": { + "mode": "VERTICAL", + "gap": 12, + "padding": [16, 16, 16, 16], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"fills/0/color": "surface/surface", "strokes/0/color": "border/border"}, + "texts": [ + "Active modpack", + "FTB StoneBlock 4", + "FTB", + "Applied", + "Version 1.6.2 · pinned · Minecraft 1.21.1 · NeoForge", + "Change version", + "Remove" + ] + } + ] + } + ] + }, + { + "name": "Tab states", + "type": "FRAME", + "x": 1184, + "y": 32, + "width": 1064, + "height": 861, + "layout": { + "mode": "VERTICAL", + "gap": 20, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "children": [ + { + "name": "State — Missing files unknown (server stopped)", + "type": "FRAME", + "x": 0, + "y": 0, + "width": 1064, + "height": 58, + "layout": { + "mode": "VERTICAL", + "gap": 6, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "name": "Text", + "type": "TEXT", + "x": 0, + "y": 0, + "width": 225, + "height": 16, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "text": "Missing files unknown (server stopped)", + "font": ["Geist", 600, 12], + "variables": {"fills/0/color": "muted"} + }, + { + "name": "Missing files unknown", + "type": "FRAME", + "x": 0, + "y": 22, + "width": 1064, + "height": 36, + "fills": [{"type": "SOLID", "color": "#1C1A20"}], + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "cornerRadius": 8, + "layout": { + "mode": "HORIZONTAL", + "gap": 8, + "padding": [10, 12, 10, 12], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"fills/0/color": "surface/surface", "strokes/0/color": "border/border"}, + "children": [ + { + "name": "lucide/info/14x14", + "type": "INSTANCE", + "x": 12, + "y": 11, + "width": 14, + "height": 14, + "component": "lucide/info/14x14" + }, + { + "name": "Text", + "type": "TEXT", + "x": 34, + "y": 10, + "width": 1018, + "height": 16, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "layoutGrow": 1, + "text": "Start the server to check whether this pack needs files you have to download yourself.", + "font": ["Geist", 400, 12], + "variables": {"fills/0/color": "muted"} + } + ] + } + ] + }, + { + "name": "State — Loading", + "type": "FRAME", + "x": 0, + "y": 78, + "width": 1064, + "height": 80, + "layout": { + "mode": "VERTICAL", + "gap": 6, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "name": "Text", + "type": "TEXT", + "x": 0, + "y": 0, + "width": 46, + "height": 16, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "text": "Loading", + "font": ["Geist", 600, 12], + "variables": {"fills/0/color": "muted"} + }, + { + "name": "Loading", + "type": "INSTANCE", + "x": 0, + "y": 22, + "width": 1064, + "height": 58, + "component": "Gameplane/Loading Card", + "componentId": "1:10058", + "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"] + }, + "layoutAlignSelf": "STRETCH", + "variables": { + "cornerRadius": "radius/3xl", + "fills/0/color": "surface/surface", + "strokes/0/color": "border/border" + }, + "texts": ["Loading modpacks…"] + } + ] + }, + { + "name": "State — Empty search", + "type": "FRAME", + "x": 0, + "y": 178, + "width": 1064, + "height": 152, + "layout": { + "mode": "VERTICAL", + "gap": 6, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "name": "Text", + "type": "TEXT", + "x": 0, + "y": 0, + "width": 79, + "height": 16, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "text": "Empty search", + "font": ["Geist", 600, 12], + "variables": {"fills/0/color": "muted"} + }, + { + "name": "Empty search", + "type": "FRAME", + "x": 0, + "y": 22, + "width": 1064, + "height": 130, + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "cornerRadius": 10, + "layout": { + "mode": "VERTICAL", + "gap": 8, + "padding": [32, 0, 32, 0], + "primary": "CENTER", + "counter": "CENTER", + "sizing": ["HUG", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"strokes/0/color": "border/border"}, + "children": [ + { + "name": "lucide/search/16x16", + "type": "INSTANCE", + "x": 524, + "y": 32, + "width": 16, + "height": 16, + "component": "lucide/search/16x16" + }, + { + "name": "Text", + "type": "TEXT", + "x": 412.5, + "y": 56, + "width": 239, + "height": 18, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "text": "No modpacks match “skyblock tech”.", + "font": ["Geist", 400, 14], + "variables": {"fills/0/color": "muted"} + }, + { + "name": "Text", + "type": "TEXT", + "x": 352, + "y": 82, + "width": 360, + "height": 16, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "text": "Only packs with a version for Minecraft 1.21.1 · Fabric are listed.", + "font": ["Geist", 400, 12], + "align": "CENTER", + "variables": {"fills/0/color": "muted"} + } + ] + } + ] + }, + { + "name": "State — Provider error", + "type": "FRAME", + "x": 0, + "y": 350, + "width": 1064, + "height": 66, + "layout": { + "mode": "VERTICAL", + "gap": 6, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "name": "Text", + "type": "TEXT", + "x": 0, + "y": 0, + "width": 80, + "height": 16, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "text": "Provider error", + "font": ["Geist", 600, 12], + "variables": {"fills/0/color": "muted"} + }, + { + "name": "Provider error", + "type": "INSTANCE", + "x": 0, + "y": 22, + "width": 1064, + "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"] + }, + "layoutAlignSelf": "STRETCH", + "variables": { + "cornerRadius": "radius/md", + "fills/0/color": "surface/surface", + "strokes/0/color": "border/border" + }, + "texts": ["CurseForge didn’t answer (502). Try again in a moment."] + } + ] + }, + { + "name": "State — CurseForge hidden without the shared key", + "type": "FRAME", + "x": 0, + "y": 436, + "width": 1064, + "height": 86, + "layout": { + "mode": "VERTICAL", + "gap": 6, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "name": "Text", + "type": "TEXT", + "x": 0, + "y": 0, + "width": 243, + "height": 16, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "text": "CurseForge hidden without the shared key", + "font": ["Geist", 600, 12], + "variables": {"fills/0/color": "muted"} + }, + { + "name": "CurseForge hidden (java8 image)", + "type": "FRAME", + "x": 0, + "y": 22, + "width": 1064, + "height": 64, + "layout": { + "mode": "VERTICAL", + "gap": 8, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "name": "Provider Switch", + "type": "INSTANCE", + "x": 0, + "y": 0, + "width": 158, + "height": 40, + "component": "Gameplane/Provider Switch", + "fills": [{"type": "SOLID", "color": "#232128"}], + "cornerRadius": 20, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [4, 4, 4, 4], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "HUG"] + }, + "variables": {"fills/0/color": "default/default"}, + "texts": ["Modrinth", "FTB"] + }, + { + "name": "Text", + "type": "TEXT", + "x": 0, + "y": 48, + "width": 1064, + "height": 16, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "layoutAlignSelf": "STRETCH", + "text": "CurseForge packs for Minecraft 1.16.5 need the shared CurseForge key. An admin can turn on “Share the CurseForge key with game servers” in Settings → Mod registries.", + "font": ["Geist", 400, 12], + "variables": {"fills/0/color": "muted"} + } + ] + } + ] + }, + { + "name": "State — Confirm with no backup destination", + "type": "FRAME", + "x": 0, + "y": 542, + "width": 1064, + "height": 319, + "layout": { + "mode": "VERTICAL", + "gap": 6, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "name": "Text", + "type": "TEXT", + "x": 0, + "y": 0, + "width": 205, + "height": 16, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "text": "Confirm with no backup destination", + "font": ["Geist", 600, 12], + "variables": {"fills/0/color": "muted"} + }, + { + "name": "Confirm Install Dialog (No backup destination)", + "type": "FRAME", + "x": 0, + "y": 22, + "width": 1064, + "height": 297, + "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"] + }, + "layoutAlignSelf": "STRETCH", + "variables": { + "cornerRadius": "radius/xl", + "fills/0/color": "surface/surface", + "strokes/0/color": "border/border" + }, + "children": [ + { + "name": "mTitle", + "type": "TEXT", + "x": 20, + "y": 20, + "width": 178, + "height": 24, + "fills": [{"type": "SOLID", "color": "#F5F3F7"}], + "text": "Install All the Mods 10?", + "font": ["Geist", 600, 16], + "lineHeight": {"value": 150, "unit": "PERCENT"}, + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + }, + { + "name": "mDescWrap", + "type": "FRAME", + "x": 20, + "y": 44, + "width": 1024, + "height": 25, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [4, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "name": "mDesc", + "type": "TEXT", + "x": 0, + "y": 4, + "width": 1024, + "height": 21, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "layoutGrow": 1, + "text": "mc-modded restarts to install the pack. It stays on this version until you change it.", + "font": ["Geist", 400, 14], + "lineHeight": {"value": 150, "unit": "PERCENT"}, + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "muted"} + } + ] + }, + { + "name": "mBody", + "type": "FRAME", + "x": 20, + "y": 69, + "width": 1024, + "height": 156, + "layout": { + "mode": "VERTICAL", + "gap": 16, + "padding": [16, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "name": "Pack Summary", + "type": "INSTANCE", + "x": 0, + "y": 16, + "width": 1024, + "height": 64, + "component": "Gameplane/Modpack Summary", + "fills": [{"type": "SOLID", "color": "#17151A"}], + "cornerRadius": 8, + "layout": { + "mode": "HORIZONTAL", + "gap": 12, + "padding": [12, 12, 12, 12], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"fills/0/color": "surface/secondary"}, + "texts": ["All the Mods 10", "CurseForge · 2.36", "Release"] + }, + { + "name": "Backup First", + "type": "INSTANCE", + "x": 0, + "y": 96, + "width": 1024, + "height": 60, + "component": "Gameplane/Backup First Option", + "layout": { + "mode": "VERTICAL", + "gap": 4, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "texts": ["Back up first", "No backup destination is set for this server’s cluster."] + } + ] + }, + { + "name": "mFooter", + "type": "FRAME", + "x": 20, + "y": 225, + "width": 1024, + "height": 52, + "layout": { + "mode": "HORIZONTAL", + "gap": 8, + "padding": [20, 0, 0, 0], + "primary": "MAX", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "name": "btnCancel", + "type": "FRAME", + "x": 828, + "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": [ + { + "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"} + } + ] + }, + { + "name": "btnPrimary", + "type": "FRAME", + "x": 900, + "y": 20, + "width": 124, + "height": 32, + "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": [ + { + "name": "text", + "type": "TEXT", + "x": 12, + "y": 8, + "width": 100, + "height": 16, + "fills": [{"type": "SOLID", "color": "#FFFFFF"}], + "text": "Install and restart", + "font": ["Geist", 500, 12], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "accent/foreground"} + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] +} diff --git a/assets/design-export/json/1274632774-3890.json b/assets/design-export/json/1274632774-3890.json new file mode 100644 index 000000000..21ad4d80b --- /dev/null +++ b/assets/design-export/json/1274632774-3890.json @@ -0,0 +1,777 @@ +{ + "file": "1274632774-3890", + "name": "Screen/Mobile — Server Detail — Modpacks", + "type": "FRAME", + "x": 18880, + "y": 32970, + "width": 390, + "height": 1100, + "fills": [{"type": "SOLID", "color": "#121114"}], + "layout": { + "mode": "VERTICAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "FIXED"] + }, + "clips": true, + "variables": {"fills/0/color": "background/background"}, + "children": [ + { + "name": "Mobile TopBar", + "type": "INSTANCE", + "x": 0, + "y": 0, + "width": 390, + "height": 64, + "component": "Gameplane/Mobile TopBar", + "componentId": "1:1782", + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 16, 0, 16], + "primary": "SPACE_BETWEEN", + "counter": "CENTER", + "sizing": ["FIXED", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"strokes/0/color": "border/border"}, + "texts": ["mc-modded", "AD"] + }, + { + "name": "Body", + "type": "FRAME", + "x": 0, + "y": 64, + "width": 390, + "height": 1036, + "fills": [{"type": "SOLID", "color": "#121114"}], + "layout": { + "mode": "VERTICAL", + "gap": 16, + "padding": [16, 16, 16, 16], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "FIXED"] + }, + "layoutGrow": 1, + "layoutAlignSelf": "STRETCH", + "variables": {"fills/0/color": "background/background"}, + "children": [ + { + "name": "Text", + "type": "TEXT", + "x": 16, + "y": 16, + "width": 80, + "height": 21, + "fills": [{"type": "SOLID", "color": "#F5F3F7"}], + "text": "Modpacks", + "font": ["Geist", 600, 16], + "variables": {"fills/0/color": "foreground/foreground"} + }, + { + "name": "Active Modpack Card", + "type": "INSTANCE", + "x": 16, + "y": 53, + "width": 358, + "height": 224, + "component": "Gameplane/Active Modpack Card/Mobile", + "fills": [{"type": "SOLID", "color": "#1C1A20"}], + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "cornerRadius": 12, + "layout": { + "mode": "VERTICAL", + "gap": 12, + "padding": [16, 16, 16, 16], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"fills/0/color": "surface/surface", "strokes/0/color": "border/border"}, + "texts": [ + "Active modpack", + "Fabulously Optimized", + "Modrinth", + "Applied", + "Version 6.4.0 · pinned · Minecraft 1.21.1 · Fabric", + "Change version", + "Remove" + ] + }, + { + "name": "Provider Switch", + "type": "INSTANCE", + "x": 16, + "y": 293, + "width": 266, + "height": 40, + "component": "Gameplane/Provider Switch", + "fills": [{"type": "SOLID", "color": "#232128"}], + "cornerRadius": 20, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [4, 4, 4, 4], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "HUG"] + }, + "variables": {"fills/0/color": "default/default"}, + "texts": ["Modrinth", "CurseForge", "FTB"] + }, + { + "name": "Search", + "type": "INSTANCE", + "x": 16, + "y": 349, + "width": 358, + "height": 36, + "component": "Gameplane/Search Input", + "componentId": "1:975", + "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": 6, + "padding": [0, 12, 0, 12], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "variables": { + "cornerRadius": "radius/xl", + "fills/0/color": "field/background", + "strokes/0/color": "field/border" + }, + "texts": ["Search modpacks…"] + }, + { + "name": "Modpacks List", + "type": "FRAME", + "x": 16, + "y": 401, + "width": 358, + "height": 296, + "layout": { + "mode": "VERTICAL", + "gap": 8, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "name": "Card All the Mods 10", + "type": "FRAME", + "x": 0, + "y": 0, + "width": 358, + "height": 68, + "fills": [{"type": "SOLID", "color": "#1C1A20"}], + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "cornerRadius": 12, + "layout": { + "mode": "HORIZONTAL", + "gap": 12, + "padding": [16, 16, 16, 16], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "FIXED"] + }, + "layoutGrow": 1, + "layoutAlignSelf": "STRETCH", + "variables": { + "cornerRadius": "radius/xl", + "paddingTop": "spacing/4", + "paddingRight": "spacing/4", + "paddingBottom": "spacing/4", + "paddingLeft": "spacing/4", + "fills/0/color": "surface/surface", + "strokes/0/color": "border/border" + }, + "children": [ + { + "name": "Cover", + "type": "FRAME", + "x": 16, + "y": 16, + "width": 36, + "height": 36, + "fills": [{"type": "SOLID", "color": "#00000000", "opacity": 0}], + "cornerRadius": 4, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "CENTER", + "counter": "CENTER", + "sizing": ["FIXED", "FIXED"] + }, + "children": [ + { + "name": "Icon", + "type": "FRAME", + "x": 8, + "y": 8, + "width": 20, + "height": 20, + "variables": {"fills/0/color": "muted"}, + "children": [ + { + "name": "path", + "type": "VECTOR", + "x": 2.5, + "y": 1.67, + "width": 15, + "height": 16.67, + "strokes": [{"type": "SOLID", "color": "#9E98A6"}], + "strokeWeight": 1.67 + }, + { + "name": "path", + "type": "VECTOR", + "x": 2.74, + "y": 3.56, + "width": 14.52, + "height": 6.44, + "strokes": [{"type": "SOLID", "color": "#9E98A6"}], + "strokeWeight": 1.67 + } + ] + } + ] + }, + { + "name": "Info", + "type": "FRAME", + "x": 64, + "y": 17, + "width": 200, + "height": 34, + "layout": { + "mode": "VERTICAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutGrow": 1, + "children": [ + { + "name": "text", + "type": "TEXT", + "x": 0, + "y": 0, + "width": 200, + "height": 18, + "fills": [{"type": "SOLID", "color": "#F5F3F7"}], + "layoutAlignSelf": "STRETCH", + "text": "All the Mods 10", + "font": ["Geist", 500, 14], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + }, + { + "name": "text", + "type": "TEXT", + "x": 0, + "y": 18, + "width": 200, + "height": 16, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "layoutAlignSelf": "STRETCH", + "text": "ATMTeam · 18.9M downloads", + "font": ["Geist", 400, 12], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "muted"} + } + ] + }, + { + "name": "Btn Install", + "type": "INSTANCE", + "x": 276, + "y": 18, + "width": 66, + "height": 32, + "component": "Gameplane/Button/Small/Default", + "componentId": "1:709", + "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": ["Install…"] + } + ] + }, + { + "name": "Card Prominence II", + "type": "FRAME", + "x": 0, + "y": 76, + "width": 358, + "height": 68, + "fills": [{"type": "SOLID", "color": "#1C1A20"}], + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "cornerRadius": 12, + "layout": { + "mode": "HORIZONTAL", + "gap": 12, + "padding": [16, 16, 16, 16], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "FIXED"] + }, + "layoutGrow": 1, + "layoutAlignSelf": "STRETCH", + "variables": { + "cornerRadius": "radius/xl", + "paddingTop": "spacing/4", + "paddingRight": "spacing/4", + "paddingBottom": "spacing/4", + "paddingLeft": "spacing/4", + "fills/0/color": "surface/surface", + "strokes/0/color": "border/border" + }, + "children": [ + { + "name": "Cover", + "type": "FRAME", + "x": 16, + "y": 16, + "width": 36, + "height": 36, + "fills": [{"type": "SOLID", "color": "#00000000", "opacity": 0}], + "cornerRadius": 4, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "CENTER", + "counter": "CENTER", + "sizing": ["FIXED", "FIXED"] + }, + "children": [ + { + "name": "Icon", + "type": "FRAME", + "x": 8, + "y": 8, + "width": 20, + "height": 20, + "variables": {"fills/0/color": "muted"}, + "children": [ + { + "name": "path", + "type": "VECTOR", + "x": 2.5, + "y": 1.67, + "width": 15, + "height": 16.67, + "strokes": [{"type": "SOLID", "color": "#9E98A6"}], + "strokeWeight": 1.67 + }, + { + "name": "path", + "type": "VECTOR", + "x": 2.74, + "y": 3.56, + "width": 14.52, + "height": 6.44, + "strokes": [{"type": "SOLID", "color": "#9E98A6"}], + "strokeWeight": 1.67 + } + ] + } + ] + }, + { + "name": "Info", + "type": "FRAME", + "x": 64, + "y": 17, + "width": 200, + "height": 34, + "layout": { + "mode": "VERTICAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutGrow": 1, + "children": [ + { + "name": "text", + "type": "TEXT", + "x": 0, + "y": 0, + "width": 200, + "height": 18, + "fills": [{"type": "SOLID", "color": "#F5F3F7"}], + "layoutAlignSelf": "STRETCH", + "text": "Prominence II", + "font": ["Geist", 500, 14], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + }, + { + "name": "text", + "type": "TEXT", + "x": 0, + "y": 18, + "width": 200, + "height": 16, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "layoutAlignSelf": "STRETCH", + "text": "Elocindev · 4.1M downloads", + "font": ["Geist", 400, 12], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "muted"} + } + ] + }, + { + "name": "Btn Install", + "type": "INSTANCE", + "x": 276, + "y": 18, + "width": 66, + "height": 32, + "component": "Gameplane/Button/Small/Default", + "componentId": "1:709", + "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": ["Install…"] + } + ] + }, + { + "name": "Card Better MC [FABRIC]", + "type": "FRAME", + "x": 0, + "y": 152, + "width": 358, + "height": 68, + "fills": [{"type": "SOLID", "color": "#1C1A20"}], + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "cornerRadius": 12, + "layout": { + "mode": "HORIZONTAL", + "gap": 12, + "padding": [16, 16, 16, 16], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "FIXED"] + }, + "layoutGrow": 1, + "layoutAlignSelf": "STRETCH", + "variables": { + "cornerRadius": "radius/xl", + "paddingTop": "spacing/4", + "paddingRight": "spacing/4", + "paddingBottom": "spacing/4", + "paddingLeft": "spacing/4", + "fills/0/color": "surface/surface", + "strokes/0/color": "border/border" + }, + "children": [ + { + "name": "Cover", + "type": "FRAME", + "x": 16, + "y": 16, + "width": 36, + "height": 36, + "fills": [{"type": "SOLID", "color": "#00000000", "opacity": 0}], + "cornerRadius": 4, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "CENTER", + "counter": "CENTER", + "sizing": ["FIXED", "FIXED"] + }, + "children": [ + { + "name": "Icon", + "type": "FRAME", + "x": 8, + "y": 8, + "width": 20, + "height": 20, + "variables": {"fills/0/color": "muted"}, + "children": [ + { + "name": "path", + "type": "VECTOR", + "x": 2.5, + "y": 1.67, + "width": 15, + "height": 16.67, + "strokes": [{"type": "SOLID", "color": "#9E98A6"}], + "strokeWeight": 1.67 + }, + { + "name": "path", + "type": "VECTOR", + "x": 2.74, + "y": 3.56, + "width": 14.52, + "height": 6.44, + "strokes": [{"type": "SOLID", "color": "#9E98A6"}], + "strokeWeight": 1.67 + } + ] + } + ] + }, + { + "name": "Info", + "type": "FRAME", + "x": 64, + "y": 17, + "width": 200, + "height": 34, + "layout": { + "mode": "VERTICAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutGrow": 1, + "children": [ + { + "name": "text", + "type": "TEXT", + "x": 0, + "y": 0, + "width": 200, + "height": 18, + "fills": [{"type": "SOLID", "color": "#F5F3F7"}], + "layoutAlignSelf": "STRETCH", + "text": "Better MC [FABRIC]", + "font": ["Geist", 500, 14], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + }, + { + "name": "text", + "type": "TEXT", + "x": 0, + "y": 18, + "width": 200, + "height": 16, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "layoutAlignSelf": "STRETCH", + "text": "LunaPixelStudios · 9.7M downloads", + "font": ["Geist", 400, 12], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "muted"} + } + ] + }, + { + "name": "Btn Install", + "type": "INSTANCE", + "x": 276, + "y": 18, + "width": 66, + "height": 32, + "component": "Gameplane/Button/Small/Default", + "componentId": "1:709", + "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": ["Install…"] + } + ] + }, + { + "name": "Card Cobblemon Official Modpack", + "type": "FRAME", + "x": 0, + "y": 228, + "width": 358, + "height": 68, + "fills": [{"type": "SOLID", "color": "#1C1A20"}], + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "cornerRadius": 12, + "layout": { + "mode": "HORIZONTAL", + "gap": 12, + "padding": [16, 16, 16, 16], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "FIXED"] + }, + "layoutGrow": 1, + "layoutAlignSelf": "STRETCH", + "variables": { + "cornerRadius": "radius/xl", + "paddingTop": "spacing/4", + "paddingRight": "spacing/4", + "paddingBottom": "spacing/4", + "paddingLeft": "spacing/4", + "fills/0/color": "surface/surface", + "strokes/0/color": "border/border" + }, + "children": [ + { + "name": "Cover", + "type": "FRAME", + "x": 16, + "y": 16, + "width": 36, + "height": 36, + "fills": [{"type": "SOLID", "color": "#00000000", "opacity": 0}], + "cornerRadius": 4, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "CENTER", + "counter": "CENTER", + "sizing": ["FIXED", "FIXED"] + }, + "children": [ + { + "name": "Icon", + "type": "FRAME", + "x": 8, + "y": 8, + "width": 20, + "height": 20, + "variables": {"fills/0/color": "muted"}, + "children": [ + { + "name": "path", + "type": "VECTOR", + "x": 2.5, + "y": 1.67, + "width": 15, + "height": 16.67, + "strokes": [{"type": "SOLID", "color": "#9E98A6"}], + "strokeWeight": 1.67 + }, + { + "name": "path", + "type": "VECTOR", + "x": 2.74, + "y": 3.56, + "width": 14.52, + "height": 6.44, + "strokes": [{"type": "SOLID", "color": "#9E98A6"}], + "strokeWeight": 1.67 + } + ] + } + ] + }, + { + "name": "Info", + "type": "FRAME", + "x": 64, + "y": 17, + "width": 200, + "height": 34, + "layout": { + "mode": "VERTICAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutGrow": 1, + "children": [ + { + "name": "text", + "type": "TEXT", + "x": 0, + "y": 0, + "width": 200, + "height": 18, + "fills": [{"type": "SOLID", "color": "#F5F3F7"}], + "layoutAlignSelf": "STRETCH", + "text": "Cobblemon Official Modpack", + "font": ["Geist", 500, 14], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + }, + { + "name": "text", + "type": "TEXT", + "x": 0, + "y": 18, + "width": 200, + "height": 16, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "layoutAlignSelf": "STRETCH", + "text": "The Cobblemon Team · 3.3M downloads", + "font": ["Geist", 400, 12], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "muted"} + } + ] + }, + { + "name": "Btn Install", + "type": "INSTANCE", + "x": 276, + "y": 18, + "width": 66, + "height": 32, + "component": "Gameplane/Button/Small/Default", + "componentId": "1:709", + "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": ["Install…"] + } + ] + } + ] + } + ] + } + ] +} diff --git a/assets/design-export/json/1274632774-4001.json b/assets/design-export/json/1274632774-4001.json new file mode 100644 index 000000000..24d8810d9 --- /dev/null +++ b/assets/design-export/json/1274632774-4001.json @@ -0,0 +1,1656 @@ +{ + "file": "1274632774-4001", + "name": "Screen/Admin Settings — Mod registries (Share CurseForge key)", + "type": "FRAME", + "x": 3280, + "y": 85089, + "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": "Gameplane/App Sidebar", + "type": "FRAME", + "x": 0, + "y": 0, + "width": 260, + "height": 900, + "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"}, + "children": [ + { + "name": "Brand Header", + "type": "FRAME", + "x": 0, + "y": 0, + "width": 260, + "height": 70, + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "layout": { + "mode": "VERTICAL", + "gap": 8, + "padding": [16, 20, 16, 20], + "primary": "CENTER", + "counter": "MIN", + "sizing": ["FIXED", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"strokes/0/color": "border/border"}, + "children": [ + { + "name": "Logo", + "type": "FRAME", + "x": 20, + "y": 17.5, + "width": 146, + "height": 35, + "layout": { + "mode": "HORIZONTAL", + "gap": 8, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["HUG", "HUG"] + }, + "children": [ + { + "name": "logoMark", + "type": "FRAME", + "x": 0, + "y": 1.5, + "width": 32, + "height": 32, + "fills": [{"type": "SOLID", "color": "#2C1926"}], + "cornerRadius": 6, + "layout": { + "mode": "VERTICAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "CENTER", + "counter": "CENTER", + "sizing": ["FIXED", "FIXED"] + }, + "variables": {"fills/0/color": "accent/soft"}, + "children": [ + { + "name": "shield", + "type": "INSTANCE", + "x": 8, + "y": 8, + "width": 16, + "height": 16, + "component": "lucide/shield-check/16x16", + "variables": {"fills/0/color": "accent/accent"} + } + ] + }, + { + "name": "logoCol", + "type": "FRAME", + "x": 40, + "y": 0, + "width": 106, + "height": 35, + "layout": { + "mode": "VERTICAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "HUG"] + }, + "children": [ + { + "name": "Wordmark", + "type": "TEXT", + "x": 0, + "y": 0, + "width": 87, + "height": 21, + "fills": [{"type": "SOLID", "color": "#F5F3F7"}], + "text": "gameplane", + "font": ["JetBrains Mono", 600, 16], + "variables": {"fontFamily": "typography/font-mono", "fills/0/color": "foreground/foreground"} + }, + { + "name": "ClusterLine", + "type": "TEXT", + "x": 0, + "y": 21, + "width": 106, + "height": 14, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "text": "Central management", + "font": ["Geist", 400, 11], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "muted"} + } + ] + } + ] + } + ] + }, + { + "name": "Nav Content", + "type": "FRAME", + "x": 0, + "y": 70, + "width": 260, + "height": 714, + "layout": { + "mode": "VERTICAL", + "gap": 2, + "padding": [8, 12, 8, 12], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "FIXED"] + }, + "layoutGrow": 1, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "name": "Section General", + "type": "INSTANCE", + "x": 12, + "y": 8, + "width": 236, + "height": 28, + "component": "Menu Title", + "componentId": "1:2389", + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [6, 8, 6, 8], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "texts": ["GENERAL"] + }, + { + "name": "navDashboard", + "type": "INSTANCE", + "x": 12, + "y": 38, + "width": 236, + "height": 36, + "component": "Menu Item/Active", + "componentId": "1:2391", + "fills": [{"type": "SOLID", "color": "#00000000", "opacity": 0}], + "cornerRadius": 16, + "layout": { + "mode": "HORIZONTAL", + "gap": 12, + "padding": [8, 12, 8, 12], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"cornerRadius": "radius/2xl"}, + "texts": ["Dashboard"] + }, + { + "name": "navServers", + "type": "INSTANCE", + "x": 12, + "y": 76, + "width": 236, + "height": 36, + "component": "Menu Item/Default", + "componentId": "1:2393", + "fills": [{"type": "SOLID", "color": "#00000000", "opacity": 0}], + "cornerRadius": 16, + "layout": { + "mode": "HORIZONTAL", + "gap": 12, + "padding": [8, 12, 8, 12], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"cornerRadius": "radius/2xl"}, + "texts": ["Servers"] + }, + { + "name": "navModules", + "type": "INSTANCE", + "x": 12, + "y": 114, + "width": 236, + "height": 36, + "component": "Menu Item/Default", + "componentId": "1:2393", + "fills": [{"type": "SOLID", "color": "#00000000", "opacity": 0}], + "cornerRadius": 16, + "layout": { + "mode": "HORIZONTAL", + "gap": 12, + "padding": [8, 12, 8, 12], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"cornerRadius": "radius/2xl"}, + "texts": ["Modules"] + }, + { + "name": "navBackups", + "type": "INSTANCE", + "x": 12, + "y": 152, + "width": 236, + "height": 36, + "component": "Menu Item/Default", + "componentId": "1:2393", + "fills": [{"type": "SOLID", "color": "#00000000", "opacity": 0}], + "cornerRadius": 16, + "layout": { + "mode": "HORIZONTAL", + "gap": 12, + "padding": [8, 12, 8, 12], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"cornerRadius": "radius/2xl"}, + "texts": ["Backups"] + }, + { + "name": "Section Admin", + "type": "INSTANCE", + "x": 12, + "y": 190, + "width": 236, + "height": 28, + "component": "Menu Title", + "componentId": "1:2389", + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [6, 8, 6, 8], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "texts": ["ADMIN"] + }, + { + "name": "navCluster", + "type": "INSTANCE", + "x": 12, + "y": 220, + "width": 236, + "height": 36, + "component": "Menu Item/Default", + "componentId": "1:2393", + "fills": [{"type": "SOLID", "color": "#00000000", "opacity": 0}], + "cornerRadius": 16, + "layout": { + "mode": "HORIZONTAL", + "gap": 12, + "padding": [8, 12, 8, 12], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"cornerRadius": "radius/2xl"}, + "texts": ["Clusters"] + }, + { + "name": "Cluster inventory navigation", + "type": "INSTANCE", + "x": 12, + "y": 258, + "width": 236, + "height": 36, + "component": "Menu Item/Default", + "componentId": "1:2393", + "fills": [{"type": "SOLID", "color": "#00000000", "opacity": 0}], + "cornerRadius": 16, + "layout": { + "mode": "HORIZONTAL", + "gap": 12, + "padding": [8, 12, 8, 12], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"cornerRadius": "radius/2xl"}, + "texts": ["Cluster"] + }, + { + "name": "navUsers", + "type": "INSTANCE", + "x": 12, + "y": 296, + "width": 236, + "height": 36, + "component": "Menu Item/Default", + "componentId": "1:2393", + "fills": [{"type": "SOLID", "color": "#00000000", "opacity": 0}], + "cornerRadius": 16, + "layout": { + "mode": "HORIZONTAL", + "gap": 12, + "padding": [8, 12, 8, 12], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"cornerRadius": "radius/2xl"}, + "texts": ["Users & RBAC"] + }, + { + "name": "navAudit", + "type": "INSTANCE", + "x": 12, + "y": 334, + "width": 236, + "height": 36, + "component": "Menu Item/Default", + "componentId": "1:2393", + "fills": [{"type": "SOLID", "color": "#00000000", "opacity": 0}], + "cornerRadius": 16, + "layout": { + "mode": "HORIZONTAL", + "gap": 12, + "padding": [8, 12, 8, 12], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"cornerRadius": "radius/2xl"}, + "texts": ["Audit log"] + }, + { + "name": "navLogs", + "type": "INSTANCE", + "x": 12, + "y": 372, + "width": 236, + "height": 36, + "component": "Menu Item/Default", + "componentId": "1:2393", + "fills": [{"type": "SOLID", "color": "#00000000", "opacity": 0}], + "cornerRadius": 16, + "layout": { + "mode": "HORIZONTAL", + "gap": 12, + "padding": [8, 12, 8, 12], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"cornerRadius": "radius/2xl"}, + "texts": ["System logs"] + }, + { + "name": "navSettings", + "type": "INSTANCE", + "x": 12, + "y": 410, + "width": 236, + "height": 36, + "component": "Menu Item/Default", + "componentId": "1:2393", + "fills": [{"type": "SOLID", "color": "#2C1926"}], + "cornerRadius": 16, + "layout": { + "mode": "HORIZONTAL", + "gap": 12, + "padding": [8, 12, 8, 12], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"cornerRadius": "radius/2xl", "fills/0/color": "accent/soft"}, + "texts": ["Settings"] + } + ] + }, + { + "name": "Footer", + "type": "FRAME", + "x": 0, + "y": 784, + "width": 260, + "height": 116, + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "layout": { + "mode": "VERTICAL", + "gap": 8, + "padding": [16, 16, 16, 16], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"strokes/0/color": "border/border"}, + "children": [ + { + "name": "Toggle Row", + "type": "FRAME", + "x": 16, + "y": 16, + "width": 228, + "height": 36, + "layout": { + "mode": "HORIZONTAL", + "gap": 8, + "padding": [0, 0, 0, 0], + "primary": "CENTER", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "name": "Appearance Toggle", + "type": "INSTANCE", + "x": 44, + "y": 2, + "width": 96, + "height": 32, + "component": "Gameplane/Appearance Toggle", + "componentId": "1:2405", + "fills": [{"type": "SOLID", "color": "#17151A"}], + "cornerRadius": 6, + "layout": { + "mode": "HORIZONTAL", + "gap": 4, + "padding": [2, 2, 2, 2], + "primary": "CENTER", + "counter": "CENTER", + "sizing": ["FIXED", "FIXED"] + }, + "variables": {"fills/0/color": "surface/secondary"} + }, + { + "name": "Customize Theme", + "type": "INSTANCE", + "x": 148, + "y": 0, + "width": 36, + "height": 36, + "component": "Button/Ghost/Icon/MD", + "componentId": "1:942", + "cornerRadius": 24, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "CENTER", + "counter": "CENTER", + "sizing": ["FIXED", "FIXED"] + }, + "variables": {"cornerRadius": "radius/3xl"} + } + ] + }, + { + "name": "Bottom Row", + "type": "FRAME", + "x": 16, + "y": 60, + "width": 228, + "height": 40, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "SPACE_BETWEEN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "name": "ProfileRow", + "type": "FRAME", + "x": 0, + "y": 0, + "width": 93, + "height": 40, + "layout": { + "mode": "HORIZONTAL", + "gap": 12, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["HUG", "HUG"] + }, + "children": [ + { + "name": "Avatar", + "type": "INSTANCE", + "x": 0, + "y": 0, + "width": 40, + "height": 40, + "component": "Avatar/Text", + "componentId": "1:2407", + "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"] + }, + { + "name": "ProfileText", + "type": "FRAME", + "x": 52, + "y": 2, + "width": 41, + "height": 36, + "layout": { + "mode": "VERTICAL", + "gap": 2, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "HUG"] + }, + "children": [ + { + "name": "Name", + "type": "TEXT", + "x": 0, + "y": 0, + "width": 41, + "height": 18, + "fills": [{"type": "SOLID", "color": "#F5F3F7"}], + "text": "admin", + "font": ["Geist", 500, 14], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + }, + { + "name": "Role", + "type": "TEXT", + "x": 0, + "y": 20, + "width": 35, + "height": 16, + "fills": [{"type": "SOLID", "color": "#F5F3F7"}], + "text": "admin", + "font": ["Geist", 400, 12], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + } + ] + } + ] + }, + { + "name": "logout", + "type": "INSTANCE", + "x": 204, + "y": 8, + "width": 24, + "height": 24, + "component": "Button/Ghost/Icon/MD", + "componentId": "1:942", + "cornerRadius": 24, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [10, 0, 10, 0], + "primary": "CENTER", + "counter": "CENTER", + "sizing": ["FIXED", "FIXED"] + }, + "variables": {"cornerRadius": "radius/3xl"} + } + ] + } + ] + } + ] + }, + { + "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": "Gameplane/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", "Settings", "Search servers…", "AD"] + }, + { + "name": "Central management notice", + "type": "FRAME", + "x": 0, + "y": 64, + "width": 1180, + "height": 45, + "fills": [{"type": "SOLID", "color": "#1C1A20"}], + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "layout": { + "mode": "HORIZONTAL", + "gap": 4, + "padding": [12, 24, 12, 24], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"fills/0/color": "surface/surface", "strokes/0/color": "border/border"}, + "children": [ + { + "name": "Central management label", + "type": "TEXT", + "x": 24, + "y": 12.5, + "width": 141, + "height": 20, + "fills": [{"type": "SOLID", "color": "#F5F3F7"}], + "text": "Central management.", + "font": ["Geist", 500, 14], + "lineHeight": {"value": 142.85714626312256, "unit": "PERCENT"}, + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + }, + { + "name": "Central management explanation", + "type": "TEXT", + "x": 169, + "y": 12.5, + "width": 830, + "height": 20, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "text": "This catalog, account or installation setting belongs to the central Gameplane installation. Server actions use each server’s cluster.", + "font": ["Geist", 400, 14], + "lineHeight": {"value": 142.85714626312256, "unit": "PERCENT"}, + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "muted"} + } + ] + }, + { + "name": "Body", + "type": "FRAME", + "x": 0, + "y": 109, + "width": 1180, + "height": 791, + "layout": { + "mode": "VERTICAL", + "gap": 24, + "padding": [24, 24, 24, 24], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "FIXED"] + }, + "layoutGrow": 1, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "name": "Gameplane/Page Header", + "type": "INSTANCE", + "x": 24, + "y": 24, + "width": 1132, + "height": 64, + "component": "Gameplane/Page Header", + "componentId": "1:3282", + "fills": [{"type": "SOLID", "color": "#121114"}], + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 8, 0], + "primary": "SPACE_BETWEEN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"fills/0/color": "background/background"}, + "texts": ["Admin settings", "Platform-wide configuration for this Gameplane instance."] + }, + { + "name": "Settings Layout", + "type": "FRAME", + "x": 24, + "y": 112, + "width": 1132, + "height": 655, + "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": 356, + "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": [ + "General", + "Theme", + "Authentication", + "Module sources", + "Mod registries", + "Notifications", + "Telemetry", + "Updates", + "About" + ] + }, + { + "name": "Settings Panel", + "type": "FRAME", + "x": 244, + "y": 0, + "width": 888, + "height": 422, + "fills": [{"type": "SOLID", "color": "#1C1A20"}], + "effects": [{"type": "DROP_SHADOW", "radius": 4, "visible": true}], + "cornerRadius": 12, + "layout": { + "mode": "VERTICAL", + "gap": 28, + "padding": [16, 16, 16, 16], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutGrow": 1, + "clips": true, + "variables": {"fills/0/color": "surface/surface"}, + "children": [ + { + "name": "Card Header", + "type": "FRAME", + "x": 16, + "y": 16, + "width": 856, + "height": 56, + "layout": { + "mode": "VERTICAL", + "gap": 8, + "padding": [0, 0, 8, 0], + "primary": "CENTER", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "name": "Title", + "type": "TEXT", + "x": 0, + "y": 0, + "width": 108, + "height": 24, + "fills": [{"type": "SOLID", "color": "#F5F3F7"}], + "text": "Mod registries", + "font": ["Geist", 500, 16], + "lineHeight": {"value": 150, "unit": "PERCENT"}, + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + }, + { + "name": "Description", + "type": "TEXT", + "x": 0, + "y": 32, + "width": 856, + "height": 16, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "layoutAlignSelf": "STRETCH", + "text": "Registries that require an API key stay hidden from the Mods browser until a key is configured.", + "font": ["Geist", 400, 12], + "lineHeight": {"value": 133.33333730697632, "unit": "PERCENT"}, + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "muted"} + } + ] + }, + { + "name": "Card Content", + "type": "FRAME", + "x": 16, + "y": 100, + "width": 856, + "height": 306, + "layout": { + "mode": "VERTICAL", + "gap": 16, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "name": "registryList", + "type": "FRAME", + "x": 0, + "y": 0, + "width": 856, + "height": 274, + "layout": { + "mode": "VERTICAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "name": "registry0", + "type": "FRAME", + "x": 0, + "y": 0, + "width": 856, + "height": 60, + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "layout": { + "mode": "HORIZONTAL", + "gap": 12, + "padding": [12, 0, 12, 0], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"strokes/0/color": "border/border"}, + "children": [ + { + "name": "iconBox", + "type": "FRAME", + "x": 0, + "y": 14, + "width": 32, + "height": 32, + "fills": [{"type": "SOLID", "color": "#1C1A20"}], + "cornerRadius": 6, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "CENTER", + "counter": "CENTER", + "sizing": ["FIXED", "FIXED"] + }, + "variables": {"fills/0/color": "surface/surface"}, + "children": [ + { + "name": "pkgIcon0", + "type": "FRAME", + "x": 8, + "y": 8, + "width": 16, + "height": 16, + "variables": {"fills/0/color": "muted"}, + "children": [ + { + "name": "path", + "type": "VECTOR", + "x": 3.33, + "y": 2, + "width": 9.33, + "height": 12.67, + "strokes": [{"type": "SOLID", "color": "#9E98A6"}], + "strokeWeight": 1.33 + } + ] + } + ] + }, + { + "name": "nameCol0", + "type": "FRAME", + "x": 44, + "y": 12, + "width": 528, + "height": 36, + "layout": { + "mode": "VERTICAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutGrow": 1, + "children": [ + { + "name": "regName0", + "type": "TEXT", + "x": 0, + "y": 0, + "width": 74, + "height": 20, + "fills": [{"type": "SOLID", "color": "#F5F3F7"}], + "text": "CurseForge", + "font": ["Geist", 400, 14], + "lineHeight": {"value": 142.85714626312256, "unit": "PERCENT"}, + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + }, + { + "name": "regDesc0", + "type": "TEXT", + "x": 0, + "y": 20, + "width": 150, + "height": 16, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "text": "Active in the Mods browser", + "font": ["Geist", 400, 12], + "lineHeight": {"value": 133.33333730697632, "unit": "PERCENT"}, + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "muted"} + } + ] + }, + { + "name": "badgeFrame0", + "type": "FRAME", + "x": 584, + "y": 18, + "width": 93, + "height": 24, + "fills": [{"type": "SOLID", "color": "#2C1926"}], + "cornerRadius": 12, + "layout": { + "mode": "HORIZONTAL", + "gap": 6, + "padding": [4, 10, 4, 10], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["HUG", "FIXED"] + }, + "variables": {"fills/0/color": "accent/soft"}, + "children": [ + { + "name": "badgeDot0", + "type": "ELLIPSE", + "x": 10, + "y": 9, + "width": 6, + "height": 6, + "fills": [{"type": "SOLID", "color": "#FF4FA3"}], + "variables": {"fills/0/color": "accent/accent"} + }, + { + "name": "badgeText0", + "type": "TEXT", + "x": 22, + "y": 4, + "width": 61, + "height": 16, + "fills": [{"type": "SOLID", "color": "#FF4FA3"}], + "text": "Configured", + "font": ["Geist", 400, 12], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "accent/accent"} + } + ] + }, + { + "name": "actionsBtns0", + "type": "FRAME", + "x": 689, + "y": 14, + "width": 167, + "height": 32, + "layout": { + "mode": "HORIZONTAL", + "gap": 12, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "HUG"] + }, + "children": [ + { + "name": "btnRepl0", + "type": "INSTANCE", + "x": 0, + "y": 0, + "width": 78, + "height": 32, + "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", "FIXED"] + }, + "texts": ["Replace"] + }, + { + "name": "btnRem0", + "type": "INSTANCE", + "x": 90, + "y": 0, + "width": 77, + "height": 32, + "component": "Gameplane/Button/Danger", + "componentId": "1:3975", + "fills": [{"type": "SOLID", "color": "#00000000", "opacity": 0}], + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "CENTER", + "counter": "CENTER", + "sizing": ["HUG", "FIXED"] + }, + "texts": ["Remove"] + } + ] + } + ] + }, + { + "name": "shareRow", + "type": "FRAME", + "x": 0, + "y": 60, + "width": 856, + "height": 94, + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "layout": { + "mode": "HORIZONTAL", + "gap": 16, + "padding": [12, 0, 12, 44], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"strokes/0/color": "border/border"}, + "children": [ + { + "name": "shareText", + "type": "FRAME", + "x": 44, + "y": 12, + "width": 760, + "height": 70, + "layout": { + "mode": "VERTICAL", + "gap": 2, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutGrow": 1, + "children": [ + { + "name": "Text", + "type": "TEXT", + "x": 0, + "y": 0, + "width": 287, + "height": 18, + "fills": [{"type": "SOLID", "color": "#F5F3F7"}], + "text": "Share the CurseForge key with game servers", + "font": ["Geist", 400, 14], + "variables": {"fills/0/color": "foreground/foreground"} + }, + { + "name": "Text", + "type": "TEXT", + "x": 0, + "y": 20, + "width": 760, + "height": 32, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "layoutAlignSelf": "STRETCH", + "text": "Lets servers on images without a built-in key (Minecraft 1.16.5 and older) install CurseForge packs. Mods running on those servers can read the key.", + "font": ["Geist", 400, 12], + "variables": {"fills/0/color": "muted"} + }, + { + "name": "Text", + "type": "TEXT", + "x": 0, + "y": 54, + "width": 760, + "height": 16, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "layoutAlignSelf": "STRETCH", + "text": "Changes apply to a server when it has 0 players, so nobody is kicked by a restart.", + "font": ["Geist", 400, 12], + "variables": {"fills/0/color": "muted"} + } + ] + }, + { + "name": "shareSwitch", + "type": "INSTANCE", + "x": 820, + "y": 37, + "width": 36, + "height": 20, + "component": "Gameplane/Switch/On", + "componentId": "1:1532", + "fills": [{"type": "SOLID", "color": "#FF4FA3"}], + "cornerRadius": 24, + "variables": {"cornerRadius": "radius/3xl", "fills/0/color": "accent/accent"} + } + ] + }, + { + "name": "registry1", + "type": "FRAME", + "x": 0, + "y": 154, + "width": 856, + "height": 60, + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "layout": { + "mode": "HORIZONTAL", + "gap": 12, + "padding": [12, 0, 12, 0], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"strokes/0/color": "border/border"}, + "children": [ + { + "name": "iconBox", + "type": "FRAME", + "x": 0, + "y": 14, + "width": 32, + "height": 32, + "fills": [{"type": "SOLID", "color": "#1C1A20"}], + "cornerRadius": 6, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "CENTER", + "counter": "CENTER", + "sizing": ["FIXED", "FIXED"] + }, + "variables": {"fills/0/color": "surface/surface"}, + "children": [ + { + "name": "pkgIcon1", + "type": "FRAME", + "x": 8, + "y": 8, + "width": 16, + "height": 16, + "variables": {"fills/0/color": "muted"}, + "children": [ + { + "name": "path", + "type": "VECTOR", + "x": 1.33, + "y": 3.33, + "width": 13.33, + "height": 9.33, + "strokes": [{"type": "SOLID", "color": "#9E98A6"}], + "strokeWeight": 1.33 + } + ] + } + ] + }, + { + "name": "nameCol1", + "type": "FRAME", + "x": 44, + "y": 12, + "width": 575, + "height": 36, + "layout": { + "mode": "VERTICAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutGrow": 1, + "children": [ + { + "name": "regName1", + "type": "TEXT", + "x": 0, + "y": 0, + "width": 110, + "height": 20, + "fills": [{"type": "SOLID", "color": "#F5F3F7"}], + "text": "Steam Workshop", + "font": ["Geist", 400, 14], + "lineHeight": {"value": 142.85714626312256, "unit": "PERCENT"}, + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + }, + { + "name": "regDesc1", + "type": "TEXT", + "x": 0, + "y": 20, + "width": 170, + "height": 16, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "text": "Hidden from the Mods browser", + "font": ["Geist", 400, 12], + "lineHeight": {"value": 133.33333730697632, "unit": "PERCENT"}, + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "muted"} + } + ] + }, + { + "name": "badgeFrame1", + "type": "FRAME", + "x": 631, + "y": 18, + "width": 114, + "height": 24, + "fills": [{"type": "SOLID", "color": "#232128"}], + "cornerRadius": 12, + "layout": { + "mode": "HORIZONTAL", + "gap": 6, + "padding": [4, 10, 4, 10], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["HUG", "FIXED"] + }, + "variables": {"fills/0/color": "default/default"}, + "children": [ + { + "name": "badgeDot1", + "type": "ELLIPSE", + "x": 10, + "y": 9, + "width": 6, + "height": 6, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "variables": {"fills/0/color": "muted"} + }, + { + "name": "badgeText1", + "type": "TEXT", + "x": 22, + "y": 4, + "width": 82, + "height": 16, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "text": "Not configured", + "font": ["Geist", 400, 12], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "muted"} + } + ] + }, + { + "name": "actionsBtns1", + "type": "FRAME", + "x": 757, + "y": 14, + "width": 99, + "height": 32, + "layout": { + "mode": "HORIZONTAL", + "gap": 8, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "HUG"] + }, + "children": [ + { + "name": "btnSet1", + "type": "INSTANCE", + "x": 0, + "y": 0, + "width": 99, + "height": 32, + "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", "FIXED"] + }, + "texts": ["Set API key"] + } + ] + } + ] + }, + { + "name": "registry2", + "type": "FRAME", + "x": 0, + "y": 214, + "width": 856, + "height": 60, + "layout": { + "mode": "HORIZONTAL", + "gap": 12, + "padding": [12, 0, 12, 0], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "name": "iconBox", + "type": "FRAME", + "x": 0, + "y": 14, + "width": 32, + "height": 32, + "fills": [{"type": "SOLID", "color": "#1C1A20"}], + "cornerRadius": 6, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "CENTER", + "counter": "CENTER", + "sizing": ["FIXED", "FIXED"] + }, + "variables": {"fills/0/color": "surface/surface"}, + "children": [ + { + "name": "pkgIcon2", + "type": "FRAME", + "x": 8, + "y": 8, + "width": 16, + "height": 16, + "variables": {"fills/0/color": "muted"}, + "children": [ + { + "name": "path", + "type": "VECTOR", + "x": 1.33, + "y": 1.33, + "width": 13.33, + "height": 13.33, + "strokes": [{"type": "SOLID", "color": "#9E98A6"}], + "strokeWeight": 1.33 + } + ] + } + ] + }, + { + "name": "nameCol2", + "type": "FRAME", + "x": 44, + "y": 12, + "width": 575, + "height": 36, + "layout": { + "mode": "VERTICAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutGrow": 1, + "children": [ + { + "name": "regName2", + "type": "TEXT", + "x": 0, + "y": 0, + "width": 80, + "height": 20, + "fills": [{"type": "SOLID", "color": "#F5F3F7"}], + "text": "Nexus Mods", + "font": ["Geist", 400, 14], + "lineHeight": {"value": 142.85714626312256, "unit": "PERCENT"}, + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + }, + { + "name": "regDesc2", + "type": "TEXT", + "x": 0, + "y": 20, + "width": 170, + "height": 16, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "text": "Hidden from the Mods browser", + "font": ["Geist", 400, 12], + "lineHeight": {"value": 133.33333730697632, "unit": "PERCENT"}, + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "muted"} + } + ] + }, + { + "name": "badgeFrame2", + "type": "FRAME", + "x": 631, + "y": 18, + "width": 114, + "height": 24, + "fills": [{"type": "SOLID", "color": "#232128"}], + "cornerRadius": 12, + "layout": { + "mode": "HORIZONTAL", + "gap": 6, + "padding": [4, 10, 4, 10], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["HUG", "FIXED"] + }, + "variables": {"fills/0/color": "default/default"}, + "children": [ + { + "name": "badgeDot2", + "type": "ELLIPSE", + "x": 10, + "y": 9, + "width": 6, + "height": 6, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "variables": {"fills/0/color": "muted"} + }, + { + "name": "badgeText2", + "type": "TEXT", + "x": 22, + "y": 4, + "width": 82, + "height": 16, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "text": "Not configured", + "font": ["Geist", 400, 12], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "muted"} + } + ] + }, + { + "name": "actionsBtns2", + "type": "FRAME", + "x": 757, + "y": 14, + "width": 99, + "height": 32, + "layout": { + "mode": "HORIZONTAL", + "gap": 8, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "HUG"] + }, + "children": [ + { + "name": "btnSet2", + "type": "INSTANCE", + "x": 0, + "y": 0, + "width": 99, + "height": 32, + "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", "FIXED"] + }, + "texts": ["Set API key"] + } + ] + } + ] + } + ] + }, + { + "name": "footerFrame", + "type": "FRAME", + "x": 0, + "y": 290, + "width": 856, + "height": 16, + "layout": { + "mode": "VERTICAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "name": "footerText", + "type": "TEXT", + "x": 0, + "y": 0, + "width": 441, + "height": 16, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "text": "Always available: Modrinth, Thunderstore, Hangar, Factorio, Spigot, GitHub, uMod", + "font": ["Geist", 400, 12], + "lineHeight": {"value": 133.33333730697632, "unit": "PERCENT"}, + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "muted"} + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] +} diff --git a/assets/design-export/json/1274632774-4260.json b/assets/design-export/json/1274632774-4260.json new file mode 100644 index 000000000..b01afcd64 --- /dev/null +++ b/assets/design-export/json/1274632774-4260.json @@ -0,0 +1,1645 @@ +{ + "file": "1274632774-4260", + "name": "Screen/Admin Settings — Mod registries (Key from startup flag)", + "type": "FRAME", + "x": 4920, + "y": 85089, + "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": "Gameplane/App Sidebar", + "type": "FRAME", + "x": 0, + "y": 0, + "width": 260, + "height": 900, + "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"}, + "children": [ + { + "name": "Brand Header", + "type": "FRAME", + "x": 0, + "y": 0, + "width": 260, + "height": 70, + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "layout": { + "mode": "VERTICAL", + "gap": 8, + "padding": [16, 20, 16, 20], + "primary": "CENTER", + "counter": "MIN", + "sizing": ["FIXED", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"strokes/0/color": "border/border"}, + "children": [ + { + "name": "Logo", + "type": "FRAME", + "x": 20, + "y": 17.5, + "width": 146, + "height": 35, + "layout": { + "mode": "HORIZONTAL", + "gap": 8, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["HUG", "HUG"] + }, + "children": [ + { + "name": "logoMark", + "type": "FRAME", + "x": 0, + "y": 1.5, + "width": 32, + "height": 32, + "fills": [{"type": "SOLID", "color": "#2C1926"}], + "cornerRadius": 6, + "layout": { + "mode": "VERTICAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "CENTER", + "counter": "CENTER", + "sizing": ["FIXED", "FIXED"] + }, + "variables": {"fills/0/color": "accent/soft"}, + "children": [ + { + "name": "shield", + "type": "INSTANCE", + "x": 8, + "y": 8, + "width": 16, + "height": 16, + "component": "lucide/shield-check/16x16", + "variables": {"fills/0/color": "accent/accent"} + } + ] + }, + { + "name": "logoCol", + "type": "FRAME", + "x": 40, + "y": 0, + "width": 106, + "height": 35, + "layout": { + "mode": "VERTICAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "HUG"] + }, + "children": [ + { + "name": "Wordmark", + "type": "TEXT", + "x": 0, + "y": 0, + "width": 87, + "height": 21, + "fills": [{"type": "SOLID", "color": "#F5F3F7"}], + "text": "gameplane", + "font": ["JetBrains Mono", 600, 16], + "variables": {"fontFamily": "typography/font-mono", "fills/0/color": "foreground/foreground"} + }, + { + "name": "ClusterLine", + "type": "TEXT", + "x": 0, + "y": 21, + "width": 106, + "height": 14, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "text": "Central management", + "font": ["Geist", 400, 11], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "muted"} + } + ] + } + ] + } + ] + }, + { + "name": "Nav Content", + "type": "FRAME", + "x": 0, + "y": 70, + "width": 260, + "height": 714, + "layout": { + "mode": "VERTICAL", + "gap": 2, + "padding": [8, 12, 8, 12], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "FIXED"] + }, + "layoutGrow": 1, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "name": "Section General", + "type": "INSTANCE", + "x": 12, + "y": 8, + "width": 236, + "height": 28, + "component": "Menu Title", + "componentId": "1:2389", + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [6, 8, 6, 8], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "texts": ["GENERAL"] + }, + { + "name": "navDashboard", + "type": "INSTANCE", + "x": 12, + "y": 38, + "width": 236, + "height": 36, + "component": "Menu Item/Active", + "componentId": "1:2391", + "fills": [{"type": "SOLID", "color": "#00000000", "opacity": 0}], + "cornerRadius": 16, + "layout": { + "mode": "HORIZONTAL", + "gap": 12, + "padding": [8, 12, 8, 12], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"cornerRadius": "radius/2xl"}, + "texts": ["Dashboard"] + }, + { + "name": "navServers", + "type": "INSTANCE", + "x": 12, + "y": 76, + "width": 236, + "height": 36, + "component": "Menu Item/Default", + "componentId": "1:2393", + "fills": [{"type": "SOLID", "color": "#00000000", "opacity": 0}], + "cornerRadius": 16, + "layout": { + "mode": "HORIZONTAL", + "gap": 12, + "padding": [8, 12, 8, 12], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"cornerRadius": "radius/2xl"}, + "texts": ["Servers"] + }, + { + "name": "navModules", + "type": "INSTANCE", + "x": 12, + "y": 114, + "width": 236, + "height": 36, + "component": "Menu Item/Default", + "componentId": "1:2393", + "fills": [{"type": "SOLID", "color": "#00000000", "opacity": 0}], + "cornerRadius": 16, + "layout": { + "mode": "HORIZONTAL", + "gap": 12, + "padding": [8, 12, 8, 12], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"cornerRadius": "radius/2xl"}, + "texts": ["Modules"] + }, + { + "name": "navBackups", + "type": "INSTANCE", + "x": 12, + "y": 152, + "width": 236, + "height": 36, + "component": "Menu Item/Default", + "componentId": "1:2393", + "fills": [{"type": "SOLID", "color": "#00000000", "opacity": 0}], + "cornerRadius": 16, + "layout": { + "mode": "HORIZONTAL", + "gap": 12, + "padding": [8, 12, 8, 12], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"cornerRadius": "radius/2xl"}, + "texts": ["Backups"] + }, + { + "name": "Section Admin", + "type": "INSTANCE", + "x": 12, + "y": 190, + "width": 236, + "height": 28, + "component": "Menu Title", + "componentId": "1:2389", + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [6, 8, 6, 8], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "texts": ["ADMIN"] + }, + { + "name": "navCluster", + "type": "INSTANCE", + "x": 12, + "y": 220, + "width": 236, + "height": 36, + "component": "Menu Item/Default", + "componentId": "1:2393", + "fills": [{"type": "SOLID", "color": "#00000000", "opacity": 0}], + "cornerRadius": 16, + "layout": { + "mode": "HORIZONTAL", + "gap": 12, + "padding": [8, 12, 8, 12], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"cornerRadius": "radius/2xl"}, + "texts": ["Clusters"] + }, + { + "name": "Cluster inventory navigation", + "type": "INSTANCE", + "x": 12, + "y": 258, + "width": 236, + "height": 36, + "component": "Menu Item/Default", + "componentId": "1:2393", + "fills": [{"type": "SOLID", "color": "#00000000", "opacity": 0}], + "cornerRadius": 16, + "layout": { + "mode": "HORIZONTAL", + "gap": 12, + "padding": [8, 12, 8, 12], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"cornerRadius": "radius/2xl"}, + "texts": ["Cluster"] + }, + { + "name": "navUsers", + "type": "INSTANCE", + "x": 12, + "y": 296, + "width": 236, + "height": 36, + "component": "Menu Item/Default", + "componentId": "1:2393", + "fills": [{"type": "SOLID", "color": "#00000000", "opacity": 0}], + "cornerRadius": 16, + "layout": { + "mode": "HORIZONTAL", + "gap": 12, + "padding": [8, 12, 8, 12], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"cornerRadius": "radius/2xl"}, + "texts": ["Users & RBAC"] + }, + { + "name": "navAudit", + "type": "INSTANCE", + "x": 12, + "y": 334, + "width": 236, + "height": 36, + "component": "Menu Item/Default", + "componentId": "1:2393", + "fills": [{"type": "SOLID", "color": "#00000000", "opacity": 0}], + "cornerRadius": 16, + "layout": { + "mode": "HORIZONTAL", + "gap": 12, + "padding": [8, 12, 8, 12], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"cornerRadius": "radius/2xl"}, + "texts": ["Audit log"] + }, + { + "name": "navLogs", + "type": "INSTANCE", + "x": 12, + "y": 372, + "width": 236, + "height": 36, + "component": "Menu Item/Default", + "componentId": "1:2393", + "fills": [{"type": "SOLID", "color": "#00000000", "opacity": 0}], + "cornerRadius": 16, + "layout": { + "mode": "HORIZONTAL", + "gap": 12, + "padding": [8, 12, 8, 12], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"cornerRadius": "radius/2xl"}, + "texts": ["System logs"] + }, + { + "name": "navSettings", + "type": "INSTANCE", + "x": 12, + "y": 410, + "width": 236, + "height": 36, + "component": "Menu Item/Default", + "componentId": "1:2393", + "fills": [{"type": "SOLID", "color": "#2C1926"}], + "cornerRadius": 16, + "layout": { + "mode": "HORIZONTAL", + "gap": 12, + "padding": [8, 12, 8, 12], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"cornerRadius": "radius/2xl", "fills/0/color": "accent/soft"}, + "texts": ["Settings"] + } + ] + }, + { + "name": "Footer", + "type": "FRAME", + "x": 0, + "y": 784, + "width": 260, + "height": 116, + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "layout": { + "mode": "VERTICAL", + "gap": 8, + "padding": [16, 16, 16, 16], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"strokes/0/color": "border/border"}, + "children": [ + { + "name": "Toggle Row", + "type": "FRAME", + "x": 16, + "y": 16, + "width": 228, + "height": 36, + "layout": { + "mode": "HORIZONTAL", + "gap": 8, + "padding": [0, 0, 0, 0], + "primary": "CENTER", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "name": "Appearance Toggle", + "type": "INSTANCE", + "x": 44, + "y": 2, + "width": 96, + "height": 32, + "component": "Gameplane/Appearance Toggle", + "componentId": "1:2405", + "fills": [{"type": "SOLID", "color": "#17151A"}], + "cornerRadius": 6, + "layout": { + "mode": "HORIZONTAL", + "gap": 4, + "padding": [2, 2, 2, 2], + "primary": "CENTER", + "counter": "CENTER", + "sizing": ["FIXED", "FIXED"] + }, + "variables": {"fills/0/color": "surface/secondary"} + }, + { + "name": "Customize Theme", + "type": "INSTANCE", + "x": 148, + "y": 0, + "width": 36, + "height": 36, + "component": "Button/Ghost/Icon/MD", + "componentId": "1:942", + "cornerRadius": 24, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "CENTER", + "counter": "CENTER", + "sizing": ["FIXED", "FIXED"] + }, + "variables": {"cornerRadius": "radius/3xl"} + } + ] + }, + { + "name": "Bottom Row", + "type": "FRAME", + "x": 16, + "y": 60, + "width": 228, + "height": 40, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "SPACE_BETWEEN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "name": "ProfileRow", + "type": "FRAME", + "x": 0, + "y": 0, + "width": 93, + "height": 40, + "layout": { + "mode": "HORIZONTAL", + "gap": 12, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["HUG", "HUG"] + }, + "children": [ + { + "name": "Avatar", + "type": "INSTANCE", + "x": 0, + "y": 0, + "width": 40, + "height": 40, + "component": "Avatar/Text", + "componentId": "1:2407", + "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"] + }, + { + "name": "ProfileText", + "type": "FRAME", + "x": 52, + "y": 2, + "width": 41, + "height": 36, + "layout": { + "mode": "VERTICAL", + "gap": 2, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "HUG"] + }, + "children": [ + { + "name": "Name", + "type": "TEXT", + "x": 0, + "y": 0, + "width": 41, + "height": 18, + "fills": [{"type": "SOLID", "color": "#F5F3F7"}], + "text": "admin", + "font": ["Geist", 500, 14], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + }, + { + "name": "Role", + "type": "TEXT", + "x": 0, + "y": 20, + "width": 35, + "height": 16, + "fills": [{"type": "SOLID", "color": "#F5F3F7"}], + "text": "admin", + "font": ["Geist", 400, 12], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + } + ] + } + ] + }, + { + "name": "logout", + "type": "INSTANCE", + "x": 204, + "y": 8, + "width": 24, + "height": 24, + "component": "Button/Ghost/Icon/MD", + "componentId": "1:942", + "cornerRadius": 24, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [10, 0, 10, 0], + "primary": "CENTER", + "counter": "CENTER", + "sizing": ["FIXED", "FIXED"] + }, + "variables": {"cornerRadius": "radius/3xl"} + } + ] + } + ] + } + ] + }, + { + "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": "Gameplane/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", "Settings", "Search servers…", "AD"] + }, + { + "name": "Central management notice", + "type": "FRAME", + "x": 0, + "y": 64, + "width": 1180, + "height": 45, + "fills": [{"type": "SOLID", "color": "#1C1A20"}], + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "layout": { + "mode": "HORIZONTAL", + "gap": 4, + "padding": [12, 24, 12, 24], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"fills/0/color": "surface/surface", "strokes/0/color": "border/border"}, + "children": [ + { + "name": "Central management label", + "type": "TEXT", + "x": 24, + "y": 12.5, + "width": 141, + "height": 20, + "fills": [{"type": "SOLID", "color": "#F5F3F7"}], + "text": "Central management.", + "font": ["Geist", 500, 14], + "lineHeight": {"value": 142.85714626312256, "unit": "PERCENT"}, + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + }, + { + "name": "Central management explanation", + "type": "TEXT", + "x": 169, + "y": 12.5, + "width": 830, + "height": 20, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "text": "This catalog, account or installation setting belongs to the central Gameplane installation. Server actions use each server’s cluster.", + "font": ["Geist", 400, 14], + "lineHeight": {"value": 142.85714626312256, "unit": "PERCENT"}, + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "muted"} + } + ] + }, + { + "name": "Body", + "type": "FRAME", + "x": 0, + "y": 109, + "width": 1180, + "height": 791, + "layout": { + "mode": "VERTICAL", + "gap": 24, + "padding": [24, 24, 24, 24], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "FIXED"] + }, + "layoutGrow": 1, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "name": "Gameplane/Page Header", + "type": "INSTANCE", + "x": 24, + "y": 24, + "width": 1132, + "height": 64, + "component": "Gameplane/Page Header", + "componentId": "1:3282", + "fills": [{"type": "SOLID", "color": "#121114"}], + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 8, 0], + "primary": "SPACE_BETWEEN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"fills/0/color": "background/background"}, + "texts": ["Admin settings", "Platform-wide configuration for this Gameplane instance."] + }, + { + "name": "Settings Layout", + "type": "FRAME", + "x": 24, + "y": 112, + "width": 1132, + "height": 655, + "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": 356, + "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": [ + "General", + "Theme", + "Authentication", + "Module sources", + "Mod registries", + "Notifications", + "Telemetry", + "Updates", + "About" + ] + }, + { + "name": "Settings Panel", + "type": "FRAME", + "x": 244, + "y": 0, + "width": 888, + "height": 388, + "fills": [{"type": "SOLID", "color": "#1C1A20"}], + "effects": [{"type": "DROP_SHADOW", "radius": 4, "visible": true}], + "cornerRadius": 12, + "layout": { + "mode": "VERTICAL", + "gap": 28, + "padding": [16, 16, 16, 16], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutGrow": 1, + "clips": true, + "variables": {"fills/0/color": "surface/surface"}, + "children": [ + { + "name": "Card Header", + "type": "FRAME", + "x": 16, + "y": 16, + "width": 856, + "height": 56, + "layout": { + "mode": "VERTICAL", + "gap": 8, + "padding": [0, 0, 8, 0], + "primary": "CENTER", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "name": "Title", + "type": "TEXT", + "x": 0, + "y": 0, + "width": 108, + "height": 24, + "fills": [{"type": "SOLID", "color": "#F5F3F7"}], + "text": "Mod registries", + "font": ["Geist", 500, 16], + "lineHeight": {"value": 150, "unit": "PERCENT"}, + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + }, + { + "name": "Description", + "type": "TEXT", + "x": 0, + "y": 32, + "width": 856, + "height": 16, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "layoutAlignSelf": "STRETCH", + "text": "Registries that require an API key stay hidden from the Mods browser until a key is configured.", + "font": ["Geist", 400, 12], + "lineHeight": {"value": 133.33333730697632, "unit": "PERCENT"}, + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "muted"} + } + ] + }, + { + "name": "Card Content", + "type": "FRAME", + "x": 16, + "y": 100, + "width": 856, + "height": 272, + "layout": { + "mode": "VERTICAL", + "gap": 16, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "name": "registryList", + "type": "FRAME", + "x": 0, + "y": 0, + "width": 856, + "height": 240, + "layout": { + "mode": "VERTICAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "name": "registry0", + "type": "FRAME", + "x": 0, + "y": 0, + "width": 856, + "height": 60, + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "layout": { + "mode": "HORIZONTAL", + "gap": 12, + "padding": [12, 0, 12, 0], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"strokes/0/color": "border/border"}, + "children": [ + { + "name": "iconBox", + "type": "FRAME", + "x": 0, + "y": 14, + "width": 32, + "height": 32, + "fills": [{"type": "SOLID", "color": "#1C1A20"}], + "cornerRadius": 6, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "CENTER", + "counter": "CENTER", + "sizing": ["FIXED", "FIXED"] + }, + "variables": {"fills/0/color": "surface/surface"}, + "children": [ + { + "name": "pkgIcon0", + "type": "FRAME", + "x": 8, + "y": 8, + "width": 16, + "height": 16, + "variables": {"fills/0/color": "muted"}, + "children": [ + { + "name": "path", + "type": "VECTOR", + "x": 3.33, + "y": 2, + "width": 9.33, + "height": 12.67, + "strokes": [{"type": "SOLID", "color": "#9E98A6"}], + "strokeWeight": 1.33 + } + ] + } + ] + }, + { + "name": "nameCol0", + "type": "FRAME", + "x": 44, + "y": 12, + "width": 493, + "height": 36, + "layout": { + "mode": "VERTICAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutGrow": 1, + "children": [ + { + "name": "regName0", + "type": "TEXT", + "x": 0, + "y": 0, + "width": 74, + "height": 20, + "fills": [{"type": "SOLID", "color": "#F5F3F7"}], + "text": "CurseForge", + "font": ["Geist", 400, 14], + "lineHeight": {"value": 142.85714626312256, "unit": "PERCENT"}, + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + }, + { + "name": "regDesc0", + "type": "TEXT", + "x": 0, + "y": 20, + "width": 241, + "height": 16, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "text": "Set by the --curseforge-api-key startup flag", + "font": ["Geist", 400, 12], + "lineHeight": {"value": 133.33333730697632, "unit": "PERCENT"}, + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "muted"} + } + ] + }, + { + "name": "badgeFrame0", + "type": "FRAME", + "x": 549, + "y": 18, + "width": 128, + "height": 24, + "fills": [{"type": "SOLID", "color": "#2C1926"}], + "cornerRadius": 12, + "layout": { + "mode": "HORIZONTAL", + "gap": 6, + "padding": [4, 10, 4, 10], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["HUG", "FIXED"] + }, + "variables": {"fills/0/color": "accent/soft"}, + "children": [ + { + "name": "badgeDot0", + "type": "ELLIPSE", + "x": 10, + "y": 9, + "width": 6, + "height": 6, + "fills": [{"type": "SOLID", "color": "#FF4FA3"}], + "variables": {"fills/0/color": "accent/accent"} + }, + { + "name": "badgeText0", + "type": "TEXT", + "x": 22, + "y": 4, + "width": 96, + "height": 16, + "fills": [{"type": "SOLID", "color": "#FF4FA3"}], + "text": "From startup flag", + "font": ["Geist", 400, 12], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "accent/accent"} + } + ] + }, + { + "name": "actionsBtns0", + "type": "FRAME", + "x": 689, + "y": 14, + "width": 167, + "height": 32, + "layout": { + "mode": "HORIZONTAL", + "gap": 12, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "HUG"] + }, + "children": [ + { + "name": "btnRepl0", + "type": "INSTANCE", + "x": 0, + "y": 0, + "width": 78, + "height": 32, + "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", "FIXED"] + }, + "texts": ["Replace"] + }, + { + "name": "btnRem0", + "type": "INSTANCE", + "x": 90, + "y": 0, + "width": 77, + "height": 32, + "component": "Gameplane/Button/Danger", + "componentId": "1:3975", + "fills": [{"type": "SOLID", "color": "#00000000", "opacity": 0}], + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "CENTER", + "counter": "CENTER", + "sizing": ["HUG", "FIXED"] + }, + "texts": ["Remove"] + } + ] + } + ] + }, + { + "name": "shareRow", + "type": "FRAME", + "x": 0, + "y": 60, + "width": 856, + "height": 60, + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "layout": { + "mode": "HORIZONTAL", + "gap": 16, + "padding": [12, 0, 12, 44], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"strokes/0/color": "border/border"}, + "children": [ + { + "name": "shareText", + "type": "FRAME", + "x": 44, + "y": 12, + "width": 760, + "height": 36, + "layout": { + "mode": "VERTICAL", + "gap": 2, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutGrow": 1, + "children": [ + { + "name": "Text", + "type": "TEXT", + "x": 0, + "y": 0, + "width": 287, + "height": 18, + "opacity": 0.5, + "fills": [{"type": "SOLID", "color": "#F5F3F7"}], + "text": "Share the CurseForge key with game servers", + "font": ["Geist", 400, 14], + "variables": {"fills/0/color": "foreground/foreground"} + }, + { + "name": "Text", + "type": "TEXT", + "x": 0, + "y": 20, + "width": 760, + "height": 16, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "layoutAlignSelf": "STRETCH", + "text": "Store the key here to share it. A key from the startup flag stays inside the API.", + "font": ["Geist", 400, 12], + "variables": {"fills/0/color": "muted"} + } + ] + }, + { + "name": "shareSwitch", + "type": "INSTANCE", + "x": 820, + "y": 20, + "width": 36, + "height": 20, + "opacity": 0.5, + "component": "Gameplane/Switch/Off", + "componentId": "1:1470", + "fills": [{"type": "SOLID", "color": "#2C2932"}], + "cornerRadius": 24, + "variables": {"cornerRadius": "radius/3xl", "fills/0/color": "border/border"} + } + ] + }, + { + "name": "registry1", + "type": "FRAME", + "x": 0, + "y": 120, + "width": 856, + "height": 60, + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "layout": { + "mode": "HORIZONTAL", + "gap": 12, + "padding": [12, 0, 12, 0], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"strokes/0/color": "border/border"}, + "children": [ + { + "name": "iconBox", + "type": "FRAME", + "x": 0, + "y": 14, + "width": 32, + "height": 32, + "fills": [{"type": "SOLID", "color": "#1C1A20"}], + "cornerRadius": 6, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "CENTER", + "counter": "CENTER", + "sizing": ["FIXED", "FIXED"] + }, + "variables": {"fills/0/color": "surface/surface"}, + "children": [ + { + "name": "pkgIcon1", + "type": "FRAME", + "x": 8, + "y": 8, + "width": 16, + "height": 16, + "variables": {"fills/0/color": "muted"}, + "children": [ + { + "name": "path", + "type": "VECTOR", + "x": 1.33, + "y": 3.33, + "width": 13.33, + "height": 9.33, + "strokes": [{"type": "SOLID", "color": "#9E98A6"}], + "strokeWeight": 1.33 + } + ] + } + ] + }, + { + "name": "nameCol1", + "type": "FRAME", + "x": 44, + "y": 12, + "width": 575, + "height": 36, + "layout": { + "mode": "VERTICAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutGrow": 1, + "children": [ + { + "name": "regName1", + "type": "TEXT", + "x": 0, + "y": 0, + "width": 110, + "height": 20, + "fills": [{"type": "SOLID", "color": "#F5F3F7"}], + "text": "Steam Workshop", + "font": ["Geist", 400, 14], + "lineHeight": {"value": 142.85714626312256, "unit": "PERCENT"}, + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + }, + { + "name": "regDesc1", + "type": "TEXT", + "x": 0, + "y": 20, + "width": 170, + "height": 16, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "text": "Hidden from the Mods browser", + "font": ["Geist", 400, 12], + "lineHeight": {"value": 133.33333730697632, "unit": "PERCENT"}, + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "muted"} + } + ] + }, + { + "name": "badgeFrame1", + "type": "FRAME", + "x": 631, + "y": 18, + "width": 114, + "height": 24, + "fills": [{"type": "SOLID", "color": "#232128"}], + "cornerRadius": 12, + "layout": { + "mode": "HORIZONTAL", + "gap": 6, + "padding": [4, 10, 4, 10], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["HUG", "FIXED"] + }, + "variables": {"fills/0/color": "default/default"}, + "children": [ + { + "name": "badgeDot1", + "type": "ELLIPSE", + "x": 10, + "y": 9, + "width": 6, + "height": 6, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "variables": {"fills/0/color": "muted"} + }, + { + "name": "badgeText1", + "type": "TEXT", + "x": 22, + "y": 4, + "width": 82, + "height": 16, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "text": "Not configured", + "font": ["Geist", 400, 12], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "muted"} + } + ] + }, + { + "name": "actionsBtns1", + "type": "FRAME", + "x": 757, + "y": 14, + "width": 99, + "height": 32, + "layout": { + "mode": "HORIZONTAL", + "gap": 8, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "HUG"] + }, + "children": [ + { + "name": "btnSet1", + "type": "INSTANCE", + "x": 0, + "y": 0, + "width": 99, + "height": 32, + "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", "FIXED"] + }, + "texts": ["Set API key"] + } + ] + } + ] + }, + { + "name": "registry2", + "type": "FRAME", + "x": 0, + "y": 180, + "width": 856, + "height": 60, + "layout": { + "mode": "HORIZONTAL", + "gap": 12, + "padding": [12, 0, 12, 0], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "name": "iconBox", + "type": "FRAME", + "x": 0, + "y": 14, + "width": 32, + "height": 32, + "fills": [{"type": "SOLID", "color": "#1C1A20"}], + "cornerRadius": 6, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "CENTER", + "counter": "CENTER", + "sizing": ["FIXED", "FIXED"] + }, + "variables": {"fills/0/color": "surface/surface"}, + "children": [ + { + "name": "pkgIcon2", + "type": "FRAME", + "x": 8, + "y": 8, + "width": 16, + "height": 16, + "variables": {"fills/0/color": "muted"}, + "children": [ + { + "name": "path", + "type": "VECTOR", + "x": 1.33, + "y": 1.33, + "width": 13.33, + "height": 13.33, + "strokes": [{"type": "SOLID", "color": "#9E98A6"}], + "strokeWeight": 1.33 + } + ] + } + ] + }, + { + "name": "nameCol2", + "type": "FRAME", + "x": 44, + "y": 12, + "width": 575, + "height": 36, + "layout": { + "mode": "VERTICAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutGrow": 1, + "children": [ + { + "name": "regName2", + "type": "TEXT", + "x": 0, + "y": 0, + "width": 80, + "height": 20, + "fills": [{"type": "SOLID", "color": "#F5F3F7"}], + "text": "Nexus Mods", + "font": ["Geist", 400, 14], + "lineHeight": {"value": 142.85714626312256, "unit": "PERCENT"}, + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + }, + { + "name": "regDesc2", + "type": "TEXT", + "x": 0, + "y": 20, + "width": 170, + "height": 16, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "text": "Hidden from the Mods browser", + "font": ["Geist", 400, 12], + "lineHeight": {"value": 133.33333730697632, "unit": "PERCENT"}, + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "muted"} + } + ] + }, + { + "name": "badgeFrame2", + "type": "FRAME", + "x": 631, + "y": 18, + "width": 114, + "height": 24, + "fills": [{"type": "SOLID", "color": "#232128"}], + "cornerRadius": 12, + "layout": { + "mode": "HORIZONTAL", + "gap": 6, + "padding": [4, 10, 4, 10], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["HUG", "FIXED"] + }, + "variables": {"fills/0/color": "default/default"}, + "children": [ + { + "name": "badgeDot2", + "type": "ELLIPSE", + "x": 10, + "y": 9, + "width": 6, + "height": 6, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "variables": {"fills/0/color": "muted"} + }, + { + "name": "badgeText2", + "type": "TEXT", + "x": 22, + "y": 4, + "width": 82, + "height": 16, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "text": "Not configured", + "font": ["Geist", 400, 12], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "muted"} + } + ] + }, + { + "name": "actionsBtns2", + "type": "FRAME", + "x": 757, + "y": 14, + "width": 99, + "height": 32, + "layout": { + "mode": "HORIZONTAL", + "gap": 8, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "HUG"] + }, + "children": [ + { + "name": "btnSet2", + "type": "INSTANCE", + "x": 0, + "y": 0, + "width": 99, + "height": 32, + "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", "FIXED"] + }, + "texts": ["Set API key"] + } + ] + } + ] + } + ] + }, + { + "name": "footerFrame", + "type": "FRAME", + "x": 0, + "y": 256, + "width": 856, + "height": 16, + "layout": { + "mode": "VERTICAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "name": "footerText", + "type": "TEXT", + "x": 0, + "y": 0, + "width": 441, + "height": 16, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "text": "Always available: Modrinth, Thunderstore, Hangar, Factorio, Spigot, GitHub, uMod", + "font": ["Geist", 400, 12], + "lineHeight": {"value": 133.33333730697632, "unit": "PERCENT"}, + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "muted"} + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] +} diff --git a/assets/design-export/json/1274632774-470.json b/assets/design-export/json/1274632774-470.json new file mode 100644 index 000000000..365442e44 --- /dev/null +++ b/assets/design-export/json/1274632774-470.json @@ -0,0 +1,1709 @@ +{ + "file": "1274632774-470", + "name": "Screen/Server Detail — Modpacks — Choose version", + "type": "FRAME", + "x": 3280, + "y": 32970, + "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" + ] + }, + { + "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", "test-server-02", "Search servers…", "AD"] + }, + { + "name": "Body", + "type": "FRAME", + "x": 0, + "y": 64, + "width": 1180, + "height": 836, + "fills": [{"type": "SOLID", "color": "#121114"}], + "layout": { + "mode": "VERTICAL", + "gap": 16, + "padding": [24, 24, 24, 24], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "FIXED"] + }, + "layoutGrow": 1, + "layoutAlignSelf": "STRETCH", + "variables": {"fills/0/color": "background/background"}, + "children": [ + { + "name": "Detail Header", + "type": "INSTANCE", + "x": 24, + "y": 24, + "width": 1132, + "height": 78, + "component": "Gameplane/Server Detail Header", + "componentId": "1:447", + "fills": [{"type": "SOLID", "color": "#121114"}], + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [8, 0, 16, 0], + "primary": "SPACE_BETWEEN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"fills/0/color": "background/background"}, + "texts": [ + "MI", + "test-server-02", + "Running", + "minecraft-java · neoforge 1.21.1 · ns: default · up 13d 4h", + "Restart", + "Stop", + "Open console" + ] + }, + { + "name": "Tabs Bar", + "type": "INSTANCE", + "x": 24, + "y": 118, + "width": 1132, + "height": 40, + "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": [0, 0, 0, 0], + "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" + ] + }, + { + "name": "Modpacks Heading", + "type": "FRAME", + "x": 24, + "y": 174, + "width": 1132, + "height": 34, + "layout": { + "mode": "VERTICAL", + "gap": 2, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "name": "heading", + "type": "TEXT", + "x": 0, + "y": 0, + "width": 119, + "height": 18, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "text": "Browse modpacks", + "font": ["Geist", 400, 14], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "muted"} + }, + { + "name": "subheading", + "type": "TEXT", + "x": 0, + "y": 20, + "width": 1132, + "height": 14, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "layoutAlignSelf": "STRETCH", + "text": "Pick a pack and a version. The server pins that version and restarts to install it; a restart never upgrades it.", + "font": ["Geist", 400, 11], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "muted"} + } + ] + }, + { + "name": "Filters Row", + "type": "FRAME", + "x": 24, + "y": 224, + "width": 1132, + "height": 40, + "layout": { + "mode": "HORIZONTAL", + "gap": 8, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "name": "Provider Switch", + "type": "INSTANCE", + "x": 0, + "y": 0, + "width": 266, + "height": 40, + "component": "Gameplane/Provider Switch", + "fills": [{"type": "SOLID", "color": "#232128"}], + "cornerRadius": 20, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [4, 4, 4, 4], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "HUG"] + }, + "variables": {"fills/0/color": "default/default"}, + "texts": ["Modrinth", "CurseForge", "FTB"] + }, + { + "name": "Search", + "type": "INSTANCE", + "x": 274, + "y": 2, + "width": 630, + "height": 36, + "component": "Gameplane/Search Input", + "componentId": "1:975", + "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": 6, + "padding": [0, 12, 0, 12], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "FIXED"] + }, + "layoutGrow": 1, + "variables": { + "cornerRadius": "radius/xl", + "fills/0/color": "field/background", + "strokes/0/color": "field/border" + }, + "texts": ["Search modpacks…"] + }, + { + "name": "Select", + "type": "INSTANCE", + "x": 912, + "y": 2, + "width": 220, + "height": 36, + "component": "Gameplane/Select", + "componentId": "1:311", + "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": "SPACE_BETWEEN", + "counter": "CENTER", + "sizing": ["FIXED", "FIXED"] + }, + "variables": { + "cornerRadius": "radius/xl", + "fills/0/color": "field/background", + "strokes/0/color": "field/border" + }, + "texts": ["Sort: Downloads"] + } + ] + }, + { + "name": "Category Chips", + "type": "FRAME", + "x": 24, + "y": 280, + "width": 1132, + "height": 17, + "layout": { + "mode": "HORIZONTAL", + "gap": 6, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "name": "chipAll", + "type": "INSTANCE", + "x": 0, + "y": 0, + "width": 22, + "height": 17, + "component": "Chip/Primary/Accent/SM", + "componentId": "1:981", + "fills": [{"type": "SOLID", "color": "#FF4FA3"}], + "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": "accent/accent"}, + "texts": ["All"] + } + ] + }, + { + "name": "Modpacks Grid", + "type": "FRAME", + "x": 24, + "y": 313, + "width": 1132, + "height": 220, + "layout": { + "mode": "VERTICAL", + "gap": 8, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "name": "Row 1", + "type": "FRAME", + "x": 0, + "y": 0, + "width": 1132, + "height": 68, + "layout": { + "mode": "HORIZONTAL", + "gap": 8, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "name": "Card All the Mods 10", + "type": "FRAME", + "x": 0, + "y": 0, + "width": 562, + "height": 68, + "fills": [{"type": "SOLID", "color": "#1C1A20"}], + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "cornerRadius": 12, + "layout": { + "mode": "HORIZONTAL", + "gap": 12, + "padding": [16, 16, 16, 16], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutGrow": 1, + "variables": { + "cornerRadius": "radius/xl", + "paddingTop": "spacing/4", + "paddingRight": "spacing/4", + "paddingBottom": "spacing/4", + "paddingLeft": "spacing/4", + "fills/0/color": "surface/surface", + "strokes/0/color": "border/border" + }, + "children": [ + { + "name": "Cover", + "type": "FRAME", + "x": 16, + "y": 16, + "width": 36, + "height": 36, + "fills": [{"type": "SOLID", "color": "#00000000", "opacity": 0}], + "cornerRadius": 4, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "CENTER", + "counter": "CENTER", + "sizing": ["FIXED", "FIXED"] + }, + "children": [ + { + "name": "Icon", + "type": "FRAME", + "x": 8, + "y": 8, + "width": 20, + "height": 20, + "variables": {"fills/0/color": "muted"}, + "children": [ + { + "name": "path", + "type": "VECTOR", + "x": 2.5, + "y": 1.67, + "width": 15, + "height": 16.67, + "strokes": [{"type": "SOLID", "color": "#9E98A6"}], + "strokeWeight": 1.67 + }, + { + "name": "path", + "type": "VECTOR", + "x": 2.74, + "y": 3.56, + "width": 14.52, + "height": 6.44, + "strokes": [{"type": "SOLID", "color": "#9E98A6"}], + "strokeWeight": 1.67 + } + ] + } + ] + }, + { + "name": "Info", + "type": "FRAME", + "x": 64, + "y": 17, + "width": 404, + "height": 34, + "layout": { + "mode": "VERTICAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutGrow": 1, + "children": [ + { + "name": "text", + "type": "TEXT", + "x": 0, + "y": 0, + "width": 101, + "height": 18, + "fills": [{"type": "SOLID", "color": "#F5F3F7"}], + "text": "All the Mods 10", + "font": ["Geist", 500, 14], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + }, + { + "name": "text", + "type": "TEXT", + "x": 0, + "y": 18, + "width": 156, + "height": 16, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "text": "ATMTeam · 18.9M downloads", + "font": ["Geist", 400, 12], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "muted"} + } + ] + }, + { + "name": "Btn Install", + "type": "INSTANCE", + "x": 480, + "y": 18, + "width": 66, + "height": 32, + "component": "Gameplane/Button/Small/Default", + "componentId": "1:709", + "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": ["Install…"] + } + ] + }, + { + "name": "Card Prominence II", + "type": "FRAME", + "x": 570, + "y": 0, + "width": 562, + "height": 68, + "fills": [{"type": "SOLID", "color": "#1C1A20"}], + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "cornerRadius": 12, + "layout": { + "mode": "HORIZONTAL", + "gap": 12, + "padding": [16, 16, 16, 16], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutGrow": 1, + "variables": { + "cornerRadius": "radius/xl", + "paddingTop": "spacing/4", + "paddingRight": "spacing/4", + "paddingBottom": "spacing/4", + "paddingLeft": "spacing/4", + "fills/0/color": "surface/surface", + "strokes/0/color": "border/border" + }, + "children": [ + { + "name": "Cover", + "type": "FRAME", + "x": 16, + "y": 16, + "width": 36, + "height": 36, + "fills": [{"type": "SOLID", "color": "#00000000", "opacity": 0}], + "cornerRadius": 4, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "CENTER", + "counter": "CENTER", + "sizing": ["FIXED", "FIXED"] + }, + "children": [ + { + "name": "Icon", + "type": "FRAME", + "x": 8, + "y": 8, + "width": 20, + "height": 20, + "variables": {"fills/0/color": "muted"}, + "children": [ + { + "name": "path", + "type": "VECTOR", + "x": 2.5, + "y": 1.67, + "width": 15, + "height": 16.67, + "strokes": [{"type": "SOLID", "color": "#9E98A6"}], + "strokeWeight": 1.67 + }, + { + "name": "path", + "type": "VECTOR", + "x": 2.74, + "y": 3.56, + "width": 14.52, + "height": 6.44, + "strokes": [{"type": "SOLID", "color": "#9E98A6"}], + "strokeWeight": 1.67 + } + ] + } + ] + }, + { + "name": "Info", + "type": "FRAME", + "x": 64, + "y": 17, + "width": 404, + "height": 34, + "layout": { + "mode": "VERTICAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutGrow": 1, + "children": [ + { + "name": "text", + "type": "TEXT", + "x": 0, + "y": 0, + "width": 90, + "height": 18, + "fills": [{"type": "SOLID", "color": "#F5F3F7"}], + "text": "Prominence II", + "font": ["Geist", 500, 14], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + }, + { + "name": "text", + "type": "TEXT", + "x": 0, + "y": 18, + "width": 149, + "height": 16, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "text": "Elocindev · 4.1M downloads", + "font": ["Geist", 400, 12], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "muted"} + } + ] + }, + { + "name": "Btn Install", + "type": "INSTANCE", + "x": 480, + "y": 18, + "width": 66, + "height": 32, + "component": "Gameplane/Button/Small/Default", + "componentId": "1:709", + "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": ["Install…"] + } + ] + } + ] + }, + { + "name": "Row 2", + "type": "FRAME", + "x": 0, + "y": 76, + "width": 1132, + "height": 68, + "layout": { + "mode": "HORIZONTAL", + "gap": 8, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "name": "Card Better MC [FABRIC]", + "type": "FRAME", + "x": 0, + "y": 0, + "width": 562, + "height": 68, + "fills": [{"type": "SOLID", "color": "#1C1A20"}], + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "cornerRadius": 12, + "layout": { + "mode": "HORIZONTAL", + "gap": 12, + "padding": [16, 16, 16, 16], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutGrow": 1, + "variables": { + "cornerRadius": "radius/xl", + "paddingTop": "spacing/4", + "paddingRight": "spacing/4", + "paddingBottom": "spacing/4", + "paddingLeft": "spacing/4", + "fills/0/color": "surface/surface", + "strokes/0/color": "border/border" + }, + "children": [ + { + "name": "Cover", + "type": "FRAME", + "x": 16, + "y": 16, + "width": 36, + "height": 36, + "fills": [{"type": "SOLID", "color": "#00000000", "opacity": 0}], + "cornerRadius": 4, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "CENTER", + "counter": "CENTER", + "sizing": ["FIXED", "FIXED"] + }, + "children": [ + { + "name": "Icon", + "type": "FRAME", + "x": 8, + "y": 8, + "width": 20, + "height": 20, + "variables": {"fills/0/color": "muted"}, + "children": [ + { + "name": "path", + "type": "VECTOR", + "x": 2.5, + "y": 1.67, + "width": 15, + "height": 16.67, + "strokes": [{"type": "SOLID", "color": "#9E98A6"}], + "strokeWeight": 1.67 + }, + { + "name": "path", + "type": "VECTOR", + "x": 2.74, + "y": 3.56, + "width": 14.52, + "height": 6.44, + "strokes": [{"type": "SOLID", "color": "#9E98A6"}], + "strokeWeight": 1.67 + } + ] + } + ] + }, + { + "name": "Info", + "type": "FRAME", + "x": 64, + "y": 17, + "width": 404, + "height": 34, + "layout": { + "mode": "VERTICAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutGrow": 1, + "children": [ + { + "name": "text", + "type": "TEXT", + "x": 0, + "y": 0, + "width": 130, + "height": 18, + "fills": [{"type": "SOLID", "color": "#F5F3F7"}], + "text": "Better MC [FABRIC]", + "font": ["Geist", 500, 14], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + }, + { + "name": "text", + "type": "TEXT", + "x": 0, + "y": 18, + "width": 192, + "height": 16, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "text": "LunaPixelStudios · 9.7M downloads", + "font": ["Geist", 400, 12], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "muted"} + } + ] + }, + { + "name": "Btn Install", + "type": "INSTANCE", + "x": 480, + "y": 18, + "width": 66, + "height": 32, + "component": "Gameplane/Button/Small/Default", + "componentId": "1:709", + "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": ["Install…"] + } + ] + }, + { + "name": "Card Cobblemon Official Modpack", + "type": "FRAME", + "x": 570, + "y": 0, + "width": 562, + "height": 68, + "fills": [{"type": "SOLID", "color": "#1C1A20"}], + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "cornerRadius": 12, + "layout": { + "mode": "HORIZONTAL", + "gap": 12, + "padding": [16, 16, 16, 16], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutGrow": 1, + "variables": { + "cornerRadius": "radius/xl", + "paddingTop": "spacing/4", + "paddingRight": "spacing/4", + "paddingBottom": "spacing/4", + "paddingLeft": "spacing/4", + "fills/0/color": "surface/surface", + "strokes/0/color": "border/border" + }, + "children": [ + { + "name": "Cover", + "type": "FRAME", + "x": 16, + "y": 16, + "width": 36, + "height": 36, + "fills": [{"type": "SOLID", "color": "#00000000", "opacity": 0}], + "cornerRadius": 4, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "CENTER", + "counter": "CENTER", + "sizing": ["FIXED", "FIXED"] + }, + "children": [ + { + "name": "Icon", + "type": "FRAME", + "x": 8, + "y": 8, + "width": 20, + "height": 20, + "variables": {"fills/0/color": "muted"}, + "children": [ + { + "name": "path", + "type": "VECTOR", + "x": 2.5, + "y": 1.67, + "width": 15, + "height": 16.67, + "strokes": [{"type": "SOLID", "color": "#9E98A6"}], + "strokeWeight": 1.67 + }, + { + "name": "path", + "type": "VECTOR", + "x": 2.74, + "y": 3.56, + "width": 14.52, + "height": 6.44, + "strokes": [{"type": "SOLID", "color": "#9E98A6"}], + "strokeWeight": 1.67 + } + ] + } + ] + }, + { + "name": "Info", + "type": "FRAME", + "x": 64, + "y": 17, + "width": 404, + "height": 34, + "layout": { + "mode": "VERTICAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutGrow": 1, + "children": [ + { + "name": "text", + "type": "TEXT", + "x": 0, + "y": 0, + "width": 190, + "height": 18, + "fills": [{"type": "SOLID", "color": "#F5F3F7"}], + "text": "Cobblemon Official Modpack", + "font": ["Geist", 500, 14], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + }, + { + "name": "text", + "type": "TEXT", + "x": 0, + "y": 18, + "width": 218, + "height": 16, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "text": "The Cobblemon Team · 3.3M downloads", + "font": ["Geist", 400, 12], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "muted"} + } + ] + }, + { + "name": "Btn Install", + "type": "INSTANCE", + "x": 480, + "y": 18, + "width": 66, + "height": 32, + "component": "Gameplane/Button/Small/Default", + "componentId": "1:709", + "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": ["Install…"] + } + ] + } + ] + }, + { + "name": "Row 3", + "type": "FRAME", + "x": 0, + "y": 152, + "width": 1132, + "height": 68, + "layout": { + "mode": "HORIZONTAL", + "gap": 8, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "name": "Card Fabulously Optimized", + "type": "FRAME", + "x": 0, + "y": 0, + "width": 562, + "height": 68, + "fills": [{"type": "SOLID", "color": "#1C1A20"}], + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "cornerRadius": 12, + "layout": { + "mode": "HORIZONTAL", + "gap": 12, + "padding": [16, 16, 16, 16], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutGrow": 1, + "variables": { + "cornerRadius": "radius/xl", + "paddingTop": "spacing/4", + "paddingRight": "spacing/4", + "paddingBottom": "spacing/4", + "paddingLeft": "spacing/4", + "fills/0/color": "surface/surface", + "strokes/0/color": "border/border" + }, + "children": [ + { + "name": "Cover", + "type": "FRAME", + "x": 16, + "y": 16, + "width": 36, + "height": 36, + "fills": [{"type": "SOLID", "color": "#00000000", "opacity": 0}], + "cornerRadius": 4, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "CENTER", + "counter": "CENTER", + "sizing": ["FIXED", "FIXED"] + }, + "children": [ + { + "name": "Icon", + "type": "FRAME", + "x": 8, + "y": 8, + "width": 20, + "height": 20, + "variables": {"fills/0/color": "muted"}, + "children": [ + { + "name": "path", + "type": "VECTOR", + "x": 2.5, + "y": 1.67, + "width": 15, + "height": 16.67, + "strokes": [{"type": "SOLID", "color": "#9E98A6"}], + "strokeWeight": 1.67 + }, + { + "name": "path", + "type": "VECTOR", + "x": 2.74, + "y": 3.56, + "width": 14.52, + "height": 6.44, + "strokes": [{"type": "SOLID", "color": "#9E98A6"}], + "strokeWeight": 1.67 + } + ] + } + ] + }, + { + "name": "Info", + "type": "FRAME", + "x": 64, + "y": 17, + "width": 404, + "height": 34, + "layout": { + "mode": "VERTICAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutGrow": 1, + "children": [ + { + "name": "text", + "type": "TEXT", + "x": 0, + "y": 0, + "width": 142, + "height": 18, + "fills": [{"type": "SOLID", "color": "#F5F3F7"}], + "text": "Fabulously Optimized", + "font": ["Geist", 500, 14], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + }, + { + "name": "text", + "type": "TEXT", + "x": 0, + "y": 18, + "width": 157, + "height": 16, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "text": "robotkoer · 14.2M downloads", + "font": ["Geist", 400, 12], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "muted"} + } + ] + }, + { + "name": "Btn Install", + "type": "INSTANCE", + "x": 480, + "y": 18, + "width": 66, + "height": 32, + "component": "Gameplane/Button/Small/Default", + "componentId": "1:709", + "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": ["Install…"] + } + ] + }, + { + "name": "Card Create: Above and Beyond", + "type": "FRAME", + "x": 570, + "y": 0, + "width": 562, + "height": 68, + "fills": [{"type": "SOLID", "color": "#1C1A20"}], + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "cornerRadius": 12, + "layout": { + "mode": "HORIZONTAL", + "gap": 12, + "padding": [16, 16, 16, 16], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutGrow": 1, + "variables": { + "cornerRadius": "radius/xl", + "paddingTop": "spacing/4", + "paddingRight": "spacing/4", + "paddingBottom": "spacing/4", + "paddingLeft": "spacing/4", + "fills/0/color": "surface/surface", + "strokes/0/color": "border/border" + }, + "children": [ + { + "name": "Cover", + "type": "FRAME", + "x": 16, + "y": 16, + "width": 36, + "height": 36, + "fills": [{"type": "SOLID", "color": "#00000000", "opacity": 0}], + "cornerRadius": 4, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "CENTER", + "counter": "CENTER", + "sizing": ["FIXED", "FIXED"] + }, + "children": [ + { + "name": "Icon", + "type": "FRAME", + "x": 8, + "y": 8, + "width": 20, + "height": 20, + "variables": {"fills/0/color": "muted"}, + "children": [ + { + "name": "path", + "type": "VECTOR", + "x": 2.5, + "y": 1.67, + "width": 15, + "height": 16.67, + "strokes": [{"type": "SOLID", "color": "#9E98A6"}], + "strokeWeight": 1.67 + }, + { + "name": "path", + "type": "VECTOR", + "x": 2.74, + "y": 3.56, + "width": 14.52, + "height": 6.44, + "strokes": [{"type": "SOLID", "color": "#9E98A6"}], + "strokeWeight": 1.67 + } + ] + } + ] + }, + { + "name": "Info", + "type": "FRAME", + "x": 64, + "y": 17, + "width": 404, + "height": 34, + "layout": { + "mode": "VERTICAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutGrow": 1, + "children": [ + { + "name": "text", + "type": "TEXT", + "x": 0, + "y": 0, + "width": 174, + "height": 18, + "fills": [{"type": "SOLID", "color": "#F5F3F7"}], + "text": "Create: Above and Beyond", + "font": ["Geist", 500, 14], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + }, + { + "name": "text", + "type": "TEXT", + "x": 0, + "y": 18, + "width": 145, + "height": 16, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "text": "simibubi · 2.8M downloads", + "font": ["Geist", 400, 12], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "muted"} + } + ] + }, + { + "name": "Btn Install", + "type": "INSTANCE", + "x": 480, + "y": 18, + "width": 66, + "height": 32, + "component": "Gameplane/Button/Small/Default", + "componentId": "1:709", + "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": ["Install…"] + } + ] + } + ] + } + ] + }, + { + "name": "Load More Row", + "type": "FRAME", + "x": 24, + "y": 549, + "width": 1132, + "height": 32, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "CENTER", + "counter": "MIN", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "name": "Btn Load More", + "type": "INSTANCE", + "x": 521.5, + "y": 0, + "width": 89, + "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": ["HUG", "HUG"] + }, + "variables": {"strokes/0/color": "border/border"}, + "texts": ["Load more"] + } + ] + } + ] + } + ] + }, + { + "name": "Dim Overlay", + "type": "RECTANGLE", + "x": 0, + "y": 0, + "width": 1440, + "height": 900, + "fills": [{"type": "SOLID", "color": "#000000", "opacity": 0.8}], + "absolute": true + }, + { + "name": "Choose Version Dialog", + "type": "FRAME", + "x": 440, + "y": 80, + "width": 560, + "height": 479, + "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"] + }, + "absolute": true, + "variables": { + "cornerRadius": "radius/xl", + "fills/0/color": "surface/surface", + "strokes/0/color": "border/border" + }, + "children": [ + { + "name": "mTitle", + "type": "TEXT", + "x": 20, + "y": 20, + "width": 131, + "height": 24, + "fills": [{"type": "SOLID", "color": "#F5F3F7"}], + "text": "Choose a version", + "font": ["Geist", 600, 16], + "lineHeight": {"value": 150, "unit": "PERCENT"}, + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + }, + { + "name": "mDescWrap", + "type": "FRAME", + "x": 20, + "y": 44, + "width": 520, + "height": 25, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [4, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "name": "mDesc", + "type": "TEXT", + "x": 0, + "y": 4, + "width": 520, + "height": 21, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "layoutGrow": 1, + "text": "All the Mods 10 · CurseForge", + "font": ["Geist", 400, 14], + "lineHeight": {"value": 150, "unit": "PERCENT"}, + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "muted"} + } + ] + }, + { + "name": "mBody", + "type": "FRAME", + "x": 20, + "y": 69, + "width": 520, + "height": 338, + "layout": { + "mode": "VERTICAL", + "gap": 16, + "padding": [16, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "name": "Text", + "type": "TEXT", + "x": 0, + "y": 16, + "width": 334, + "height": 16, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "text": "Showing versions for Minecraft 1.21.1 · NeoForge, newest first.", + "font": ["Geist", 400, 12], + "variables": {"fills/0/color": "muted"} + }, + { + "name": "Version List", + "type": "FRAME", + "x": 0, + "y": 48, + "width": 520, + "height": 290, + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "cornerRadius": 8, + "layout": { + "mode": "VERTICAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "clips": true, + "variables": {"strokes/0/color": "border/border"}, + "children": [ + { + "name": "Version All the Mods 10 - 2.36", + "type": "INSTANCE", + "x": 0, + "y": 0, + "width": 520, + "height": 58, + "component": "Gameplane/Modpack Version Row", + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "layout": { + "mode": "HORIZONTAL", + "gap": 12, + "padding": [10, 12, 10, 12], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"strokes/0/color": "border/border"}, + "texts": ["All the Mods 10 - 2.36", "Published 14 Nov 2026 · NeoForge 21.1.208", "Release"] + }, + { + "name": "Version All the Mods 10 - 2.35", + "type": "INSTANCE", + "x": 0, + "y": 58, + "width": 520, + "height": 58, + "component": "Gameplane/Modpack Version Row", + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "layout": { + "mode": "HORIZONTAL", + "gap": 12, + "padding": [10, 12, 10, 12], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"strokes/0/color": "border/border"}, + "texts": ["All the Mods 10 - 2.35", "Published 30 Oct 2026 · NeoForge 21.1.205", "Release"] + }, + { + "name": "Version All the Mods 10 - 2.35-beta.2", + "type": "INSTANCE", + "x": 0, + "y": 116, + "width": 520, + "height": 58, + "component": "Gameplane/Modpack Version Row", + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "layout": { + "mode": "HORIZONTAL", + "gap": 12, + "padding": [10, 12, 10, 12], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"strokes/0/color": "border/border"}, + "texts": ["All the Mods 10 - 2.35-beta.2", "Published 24 Oct 2026 · NeoForge 21.1.203", "Beta"] + }, + { + "name": "Version All the Mods 10 - 2.34", + "type": "INSTANCE", + "x": 0, + "y": 174, + "width": 520, + "height": 58, + "component": "Gameplane/Modpack Version Row", + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "layout": { + "mode": "HORIZONTAL", + "gap": 12, + "padding": [10, 12, 10, 12], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"strokes/0/color": "border/border"}, + "texts": ["All the Mods 10 - 2.34", "Published 9 Oct 2026 · NeoForge 21.1.199", "Release"] + }, + { + "name": "Version All the Mods 10 - 2.33", + "type": "INSTANCE", + "x": 0, + "y": 232, + "width": 520, + "height": 58, + "component": "Gameplane/Modpack Version Row", + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "layout": { + "mode": "HORIZONTAL", + "gap": 12, + "padding": [10, 12, 10, 12], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"strokes/0/color": "border/border"}, + "texts": ["All the Mods 10 - 2.33", "Published 18 Sep 2026 · NeoForge 21.1.194", "Release"] + } + ] + } + ] + }, + { + "name": "mFooter", + "type": "FRAME", + "x": 20, + "y": 407, + "width": 520, + "height": 52, + "layout": { + "mode": "HORIZONTAL", + "gap": 8, + "padding": [20, 0, 0, 0], + "primary": "MAX", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "name": "btnCancel", + "type": "FRAME", + "x": 373, + "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": [ + { + "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"} + } + ] + }, + { + "name": "btnPrimary", + "type": "FRAME", + "x": 445, + "y": 20, + "width": 75, + "height": 32, + "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": [ + { + "name": "text", + "type": "TEXT", + "x": 12, + "y": 8, + "width": 51, + "height": 16, + "fills": [{"type": "SOLID", "color": "#FFFFFF"}], + "text": "Continue", + "font": ["Geist", 500, 12], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "accent/foreground"} + } + ] + } + ] + } + ] + } + ] +} diff --git a/assets/design-export/json/1274632774-907.json b/assets/design-export/json/1274632774-907.json new file mode 100644 index 000000000..30dbbcc88 --- /dev/null +++ b/assets/design-export/json/1274632774-907.json @@ -0,0 +1,1607 @@ +{ + "file": "1274632774-907", + "name": "Screen/Server Detail — Modpacks — Confirm install", + "type": "FRAME", + "x": 4920, + "y": 32970, + "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" + ] + }, + { + "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", "test-server-02", "Search servers…", "AD"] + }, + { + "name": "Body", + "type": "FRAME", + "x": 0, + "y": 64, + "width": 1180, + "height": 836, + "fills": [{"type": "SOLID", "color": "#121114"}], + "layout": { + "mode": "VERTICAL", + "gap": 16, + "padding": [24, 24, 24, 24], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "FIXED"] + }, + "layoutGrow": 1, + "layoutAlignSelf": "STRETCH", + "variables": {"fills/0/color": "background/background"}, + "children": [ + { + "name": "Detail Header", + "type": "INSTANCE", + "x": 24, + "y": 24, + "width": 1132, + "height": 78, + "component": "Gameplane/Server Detail Header", + "componentId": "1:447", + "fills": [{"type": "SOLID", "color": "#121114"}], + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [8, 0, 16, 0], + "primary": "SPACE_BETWEEN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"fills/0/color": "background/background"}, + "texts": [ + "MI", + "test-server-02", + "Running", + "minecraft-java · neoforge 1.21.1 · ns: default · up 13d 4h", + "Restart", + "Stop", + "Open console" + ] + }, + { + "name": "Tabs Bar", + "type": "INSTANCE", + "x": 24, + "y": 118, + "width": 1132, + "height": 40, + "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": [0, 0, 0, 0], + "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" + ] + }, + { + "name": "Modpacks Heading", + "type": "FRAME", + "x": 24, + "y": 174, + "width": 1132, + "height": 34, + "layout": { + "mode": "VERTICAL", + "gap": 2, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "name": "heading", + "type": "TEXT", + "x": 0, + "y": 0, + "width": 119, + "height": 18, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "text": "Browse modpacks", + "font": ["Geist", 400, 14], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "muted"} + }, + { + "name": "subheading", + "type": "TEXT", + "x": 0, + "y": 20, + "width": 1132, + "height": 14, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "layoutAlignSelf": "STRETCH", + "text": "Pick a pack and a version. The server pins that version and restarts to install it; a restart never upgrades it.", + "font": ["Geist", 400, 11], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "muted"} + } + ] + }, + { + "name": "Filters Row", + "type": "FRAME", + "x": 24, + "y": 224, + "width": 1132, + "height": 40, + "layout": { + "mode": "HORIZONTAL", + "gap": 8, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "name": "Provider Switch", + "type": "INSTANCE", + "x": 0, + "y": 0, + "width": 266, + "height": 40, + "component": "Gameplane/Provider Switch", + "fills": [{"type": "SOLID", "color": "#232128"}], + "cornerRadius": 20, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [4, 4, 4, 4], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "HUG"] + }, + "variables": {"fills/0/color": "default/default"}, + "texts": ["Modrinth", "CurseForge", "FTB"] + }, + { + "name": "Search", + "type": "INSTANCE", + "x": 274, + "y": 2, + "width": 630, + "height": 36, + "component": "Gameplane/Search Input", + "componentId": "1:975", + "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": 6, + "padding": [0, 12, 0, 12], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "FIXED"] + }, + "layoutGrow": 1, + "variables": { + "cornerRadius": "radius/xl", + "fills/0/color": "field/background", + "strokes/0/color": "field/border" + }, + "texts": ["Search modpacks…"] + }, + { + "name": "Select", + "type": "INSTANCE", + "x": 912, + "y": 2, + "width": 220, + "height": 36, + "component": "Gameplane/Select", + "componentId": "1:311", + "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": "SPACE_BETWEEN", + "counter": "CENTER", + "sizing": ["FIXED", "FIXED"] + }, + "variables": { + "cornerRadius": "radius/xl", + "fills/0/color": "field/background", + "strokes/0/color": "field/border" + }, + "texts": ["Sort: Downloads"] + } + ] + }, + { + "name": "Category Chips", + "type": "FRAME", + "x": 24, + "y": 280, + "width": 1132, + "height": 17, + "layout": { + "mode": "HORIZONTAL", + "gap": 6, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "name": "chipAll", + "type": "INSTANCE", + "x": 0, + "y": 0, + "width": 22, + "height": 17, + "component": "Chip/Primary/Accent/SM", + "componentId": "1:981", + "fills": [{"type": "SOLID", "color": "#FF4FA3"}], + "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": "accent/accent"}, + "texts": ["All"] + } + ] + }, + { + "name": "Modpacks Grid", + "type": "FRAME", + "x": 24, + "y": 313, + "width": 1132, + "height": 220, + "layout": { + "mode": "VERTICAL", + "gap": 8, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "name": "Row 1", + "type": "FRAME", + "x": 0, + "y": 0, + "width": 1132, + "height": 68, + "layout": { + "mode": "HORIZONTAL", + "gap": 8, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "name": "Card All the Mods 10", + "type": "FRAME", + "x": 0, + "y": 0, + "width": 562, + "height": 68, + "fills": [{"type": "SOLID", "color": "#1C1A20"}], + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "cornerRadius": 12, + "layout": { + "mode": "HORIZONTAL", + "gap": 12, + "padding": [16, 16, 16, 16], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutGrow": 1, + "variables": { + "cornerRadius": "radius/xl", + "paddingTop": "spacing/4", + "paddingRight": "spacing/4", + "paddingBottom": "spacing/4", + "paddingLeft": "spacing/4", + "fills/0/color": "surface/surface", + "strokes/0/color": "border/border" + }, + "children": [ + { + "name": "Cover", + "type": "FRAME", + "x": 16, + "y": 16, + "width": 36, + "height": 36, + "fills": [{"type": "SOLID", "color": "#00000000", "opacity": 0}], + "cornerRadius": 4, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "CENTER", + "counter": "CENTER", + "sizing": ["FIXED", "FIXED"] + }, + "children": [ + { + "name": "Icon", + "type": "FRAME", + "x": 8, + "y": 8, + "width": 20, + "height": 20, + "variables": {"fills/0/color": "muted"}, + "children": [ + { + "name": "path", + "type": "VECTOR", + "x": 2.5, + "y": 1.67, + "width": 15, + "height": 16.67, + "strokes": [{"type": "SOLID", "color": "#9E98A6"}], + "strokeWeight": 1.67 + }, + { + "name": "path", + "type": "VECTOR", + "x": 2.74, + "y": 3.56, + "width": 14.52, + "height": 6.44, + "strokes": [{"type": "SOLID", "color": "#9E98A6"}], + "strokeWeight": 1.67 + } + ] + } + ] + }, + { + "name": "Info", + "type": "FRAME", + "x": 64, + "y": 17, + "width": 404, + "height": 34, + "layout": { + "mode": "VERTICAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutGrow": 1, + "children": [ + { + "name": "text", + "type": "TEXT", + "x": 0, + "y": 0, + "width": 101, + "height": 18, + "fills": [{"type": "SOLID", "color": "#F5F3F7"}], + "text": "All the Mods 10", + "font": ["Geist", 500, 14], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + }, + { + "name": "text", + "type": "TEXT", + "x": 0, + "y": 18, + "width": 156, + "height": 16, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "text": "ATMTeam · 18.9M downloads", + "font": ["Geist", 400, 12], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "muted"} + } + ] + }, + { + "name": "Btn Install", + "type": "INSTANCE", + "x": 480, + "y": 18, + "width": 66, + "height": 32, + "component": "Gameplane/Button/Small/Default", + "componentId": "1:709", + "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": ["Install…"] + } + ] + }, + { + "name": "Card Prominence II", + "type": "FRAME", + "x": 570, + "y": 0, + "width": 562, + "height": 68, + "fills": [{"type": "SOLID", "color": "#1C1A20"}], + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "cornerRadius": 12, + "layout": { + "mode": "HORIZONTAL", + "gap": 12, + "padding": [16, 16, 16, 16], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutGrow": 1, + "variables": { + "cornerRadius": "radius/xl", + "paddingTop": "spacing/4", + "paddingRight": "spacing/4", + "paddingBottom": "spacing/4", + "paddingLeft": "spacing/4", + "fills/0/color": "surface/surface", + "strokes/0/color": "border/border" + }, + "children": [ + { + "name": "Cover", + "type": "FRAME", + "x": 16, + "y": 16, + "width": 36, + "height": 36, + "fills": [{"type": "SOLID", "color": "#00000000", "opacity": 0}], + "cornerRadius": 4, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "CENTER", + "counter": "CENTER", + "sizing": ["FIXED", "FIXED"] + }, + "children": [ + { + "name": "Icon", + "type": "FRAME", + "x": 8, + "y": 8, + "width": 20, + "height": 20, + "variables": {"fills/0/color": "muted"}, + "children": [ + { + "name": "path", + "type": "VECTOR", + "x": 2.5, + "y": 1.67, + "width": 15, + "height": 16.67, + "strokes": [{"type": "SOLID", "color": "#9E98A6"}], + "strokeWeight": 1.67 + }, + { + "name": "path", + "type": "VECTOR", + "x": 2.74, + "y": 3.56, + "width": 14.52, + "height": 6.44, + "strokes": [{"type": "SOLID", "color": "#9E98A6"}], + "strokeWeight": 1.67 + } + ] + } + ] + }, + { + "name": "Info", + "type": "FRAME", + "x": 64, + "y": 17, + "width": 404, + "height": 34, + "layout": { + "mode": "VERTICAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutGrow": 1, + "children": [ + { + "name": "text", + "type": "TEXT", + "x": 0, + "y": 0, + "width": 90, + "height": 18, + "fills": [{"type": "SOLID", "color": "#F5F3F7"}], + "text": "Prominence II", + "font": ["Geist", 500, 14], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + }, + { + "name": "text", + "type": "TEXT", + "x": 0, + "y": 18, + "width": 149, + "height": 16, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "text": "Elocindev · 4.1M downloads", + "font": ["Geist", 400, 12], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "muted"} + } + ] + }, + { + "name": "Btn Install", + "type": "INSTANCE", + "x": 480, + "y": 18, + "width": 66, + "height": 32, + "component": "Gameplane/Button/Small/Default", + "componentId": "1:709", + "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": ["Install…"] + } + ] + } + ] + }, + { + "name": "Row 2", + "type": "FRAME", + "x": 0, + "y": 76, + "width": 1132, + "height": 68, + "layout": { + "mode": "HORIZONTAL", + "gap": 8, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "name": "Card Better MC [FABRIC]", + "type": "FRAME", + "x": 0, + "y": 0, + "width": 562, + "height": 68, + "fills": [{"type": "SOLID", "color": "#1C1A20"}], + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "cornerRadius": 12, + "layout": { + "mode": "HORIZONTAL", + "gap": 12, + "padding": [16, 16, 16, 16], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutGrow": 1, + "variables": { + "cornerRadius": "radius/xl", + "paddingTop": "spacing/4", + "paddingRight": "spacing/4", + "paddingBottom": "spacing/4", + "paddingLeft": "spacing/4", + "fills/0/color": "surface/surface", + "strokes/0/color": "border/border" + }, + "children": [ + { + "name": "Cover", + "type": "FRAME", + "x": 16, + "y": 16, + "width": 36, + "height": 36, + "fills": [{"type": "SOLID", "color": "#00000000", "opacity": 0}], + "cornerRadius": 4, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "CENTER", + "counter": "CENTER", + "sizing": ["FIXED", "FIXED"] + }, + "children": [ + { + "name": "Icon", + "type": "FRAME", + "x": 8, + "y": 8, + "width": 20, + "height": 20, + "variables": {"fills/0/color": "muted"}, + "children": [ + { + "name": "path", + "type": "VECTOR", + "x": 2.5, + "y": 1.67, + "width": 15, + "height": 16.67, + "strokes": [{"type": "SOLID", "color": "#9E98A6"}], + "strokeWeight": 1.67 + }, + { + "name": "path", + "type": "VECTOR", + "x": 2.74, + "y": 3.56, + "width": 14.52, + "height": 6.44, + "strokes": [{"type": "SOLID", "color": "#9E98A6"}], + "strokeWeight": 1.67 + } + ] + } + ] + }, + { + "name": "Info", + "type": "FRAME", + "x": 64, + "y": 17, + "width": 404, + "height": 34, + "layout": { + "mode": "VERTICAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutGrow": 1, + "children": [ + { + "name": "text", + "type": "TEXT", + "x": 0, + "y": 0, + "width": 130, + "height": 18, + "fills": [{"type": "SOLID", "color": "#F5F3F7"}], + "text": "Better MC [FABRIC]", + "font": ["Geist", 500, 14], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + }, + { + "name": "text", + "type": "TEXT", + "x": 0, + "y": 18, + "width": 192, + "height": 16, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "text": "LunaPixelStudios · 9.7M downloads", + "font": ["Geist", 400, 12], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "muted"} + } + ] + }, + { + "name": "Btn Install", + "type": "INSTANCE", + "x": 480, + "y": 18, + "width": 66, + "height": 32, + "component": "Gameplane/Button/Small/Default", + "componentId": "1:709", + "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": ["Install…"] + } + ] + }, + { + "name": "Card Cobblemon Official Modpack", + "type": "FRAME", + "x": 570, + "y": 0, + "width": 562, + "height": 68, + "fills": [{"type": "SOLID", "color": "#1C1A20"}], + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "cornerRadius": 12, + "layout": { + "mode": "HORIZONTAL", + "gap": 12, + "padding": [16, 16, 16, 16], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutGrow": 1, + "variables": { + "cornerRadius": "radius/xl", + "paddingTop": "spacing/4", + "paddingRight": "spacing/4", + "paddingBottom": "spacing/4", + "paddingLeft": "spacing/4", + "fills/0/color": "surface/surface", + "strokes/0/color": "border/border" + }, + "children": [ + { + "name": "Cover", + "type": "FRAME", + "x": 16, + "y": 16, + "width": 36, + "height": 36, + "fills": [{"type": "SOLID", "color": "#00000000", "opacity": 0}], + "cornerRadius": 4, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "CENTER", + "counter": "CENTER", + "sizing": ["FIXED", "FIXED"] + }, + "children": [ + { + "name": "Icon", + "type": "FRAME", + "x": 8, + "y": 8, + "width": 20, + "height": 20, + "variables": {"fills/0/color": "muted"}, + "children": [ + { + "name": "path", + "type": "VECTOR", + "x": 2.5, + "y": 1.67, + "width": 15, + "height": 16.67, + "strokes": [{"type": "SOLID", "color": "#9E98A6"}], + "strokeWeight": 1.67 + }, + { + "name": "path", + "type": "VECTOR", + "x": 2.74, + "y": 3.56, + "width": 14.52, + "height": 6.44, + "strokes": [{"type": "SOLID", "color": "#9E98A6"}], + "strokeWeight": 1.67 + } + ] + } + ] + }, + { + "name": "Info", + "type": "FRAME", + "x": 64, + "y": 17, + "width": 404, + "height": 34, + "layout": { + "mode": "VERTICAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutGrow": 1, + "children": [ + { + "name": "text", + "type": "TEXT", + "x": 0, + "y": 0, + "width": 190, + "height": 18, + "fills": [{"type": "SOLID", "color": "#F5F3F7"}], + "text": "Cobblemon Official Modpack", + "font": ["Geist", 500, 14], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + }, + { + "name": "text", + "type": "TEXT", + "x": 0, + "y": 18, + "width": 218, + "height": 16, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "text": "The Cobblemon Team · 3.3M downloads", + "font": ["Geist", 400, 12], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "muted"} + } + ] + }, + { + "name": "Btn Install", + "type": "INSTANCE", + "x": 480, + "y": 18, + "width": 66, + "height": 32, + "component": "Gameplane/Button/Small/Default", + "componentId": "1:709", + "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": ["Install…"] + } + ] + } + ] + }, + { + "name": "Row 3", + "type": "FRAME", + "x": 0, + "y": 152, + "width": 1132, + "height": 68, + "layout": { + "mode": "HORIZONTAL", + "gap": 8, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "name": "Card Fabulously Optimized", + "type": "FRAME", + "x": 0, + "y": 0, + "width": 562, + "height": 68, + "fills": [{"type": "SOLID", "color": "#1C1A20"}], + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "cornerRadius": 12, + "layout": { + "mode": "HORIZONTAL", + "gap": 12, + "padding": [16, 16, 16, 16], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutGrow": 1, + "variables": { + "cornerRadius": "radius/xl", + "paddingTop": "spacing/4", + "paddingRight": "spacing/4", + "paddingBottom": "spacing/4", + "paddingLeft": "spacing/4", + "fills/0/color": "surface/surface", + "strokes/0/color": "border/border" + }, + "children": [ + { + "name": "Cover", + "type": "FRAME", + "x": 16, + "y": 16, + "width": 36, + "height": 36, + "fills": [{"type": "SOLID", "color": "#00000000", "opacity": 0}], + "cornerRadius": 4, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "CENTER", + "counter": "CENTER", + "sizing": ["FIXED", "FIXED"] + }, + "children": [ + { + "name": "Icon", + "type": "FRAME", + "x": 8, + "y": 8, + "width": 20, + "height": 20, + "variables": {"fills/0/color": "muted"}, + "children": [ + { + "name": "path", + "type": "VECTOR", + "x": 2.5, + "y": 1.67, + "width": 15, + "height": 16.67, + "strokes": [{"type": "SOLID", "color": "#9E98A6"}], + "strokeWeight": 1.67 + }, + { + "name": "path", + "type": "VECTOR", + "x": 2.74, + "y": 3.56, + "width": 14.52, + "height": 6.44, + "strokes": [{"type": "SOLID", "color": "#9E98A6"}], + "strokeWeight": 1.67 + } + ] + } + ] + }, + { + "name": "Info", + "type": "FRAME", + "x": 64, + "y": 17, + "width": 404, + "height": 34, + "layout": { + "mode": "VERTICAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutGrow": 1, + "children": [ + { + "name": "text", + "type": "TEXT", + "x": 0, + "y": 0, + "width": 142, + "height": 18, + "fills": [{"type": "SOLID", "color": "#F5F3F7"}], + "text": "Fabulously Optimized", + "font": ["Geist", 500, 14], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + }, + { + "name": "text", + "type": "TEXT", + "x": 0, + "y": 18, + "width": 157, + "height": 16, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "text": "robotkoer · 14.2M downloads", + "font": ["Geist", 400, 12], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "muted"} + } + ] + }, + { + "name": "Btn Install", + "type": "INSTANCE", + "x": 480, + "y": 18, + "width": 66, + "height": 32, + "component": "Gameplane/Button/Small/Default", + "componentId": "1:709", + "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": ["Install…"] + } + ] + }, + { + "name": "Card Create: Above and Beyond", + "type": "FRAME", + "x": 570, + "y": 0, + "width": 562, + "height": 68, + "fills": [{"type": "SOLID", "color": "#1C1A20"}], + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "cornerRadius": 12, + "layout": { + "mode": "HORIZONTAL", + "gap": 12, + "padding": [16, 16, 16, 16], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutGrow": 1, + "variables": { + "cornerRadius": "radius/xl", + "paddingTop": "spacing/4", + "paddingRight": "spacing/4", + "paddingBottom": "spacing/4", + "paddingLeft": "spacing/4", + "fills/0/color": "surface/surface", + "strokes/0/color": "border/border" + }, + "children": [ + { + "name": "Cover", + "type": "FRAME", + "x": 16, + "y": 16, + "width": 36, + "height": 36, + "fills": [{"type": "SOLID", "color": "#00000000", "opacity": 0}], + "cornerRadius": 4, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "CENTER", + "counter": "CENTER", + "sizing": ["FIXED", "FIXED"] + }, + "children": [ + { + "name": "Icon", + "type": "FRAME", + "x": 8, + "y": 8, + "width": 20, + "height": 20, + "variables": {"fills/0/color": "muted"}, + "children": [ + { + "name": "path", + "type": "VECTOR", + "x": 2.5, + "y": 1.67, + "width": 15, + "height": 16.67, + "strokes": [{"type": "SOLID", "color": "#9E98A6"}], + "strokeWeight": 1.67 + }, + { + "name": "path", + "type": "VECTOR", + "x": 2.74, + "y": 3.56, + "width": 14.52, + "height": 6.44, + "strokes": [{"type": "SOLID", "color": "#9E98A6"}], + "strokeWeight": 1.67 + } + ] + } + ] + }, + { + "name": "Info", + "type": "FRAME", + "x": 64, + "y": 17, + "width": 404, + "height": 34, + "layout": { + "mode": "VERTICAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutGrow": 1, + "children": [ + { + "name": "text", + "type": "TEXT", + "x": 0, + "y": 0, + "width": 174, + "height": 18, + "fills": [{"type": "SOLID", "color": "#F5F3F7"}], + "text": "Create: Above and Beyond", + "font": ["Geist", 500, 14], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + }, + { + "name": "text", + "type": "TEXT", + "x": 0, + "y": 18, + "width": 145, + "height": 16, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "text": "simibubi · 2.8M downloads", + "font": ["Geist", 400, 12], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "muted"} + } + ] + }, + { + "name": "Btn Install", + "type": "INSTANCE", + "x": 480, + "y": 18, + "width": 66, + "height": 32, + "component": "Gameplane/Button/Small/Default", + "componentId": "1:709", + "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": ["Install…"] + } + ] + } + ] + } + ] + }, + { + "name": "Load More Row", + "type": "FRAME", + "x": 24, + "y": 549, + "width": 1132, + "height": 32, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "CENTER", + "counter": "MIN", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "name": "Btn Load More", + "type": "INSTANCE", + "x": 521.5, + "y": 0, + "width": 89, + "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": ["HUG", "HUG"] + }, + "variables": {"strokes/0/color": "border/border"}, + "texts": ["Load more"] + } + ] + } + ] + } + ] + }, + { + "name": "Dim Overlay", + "type": "RECTANGLE", + "x": 0, + "y": 0, + "width": 1440, + "height": 900, + "fills": [{"type": "SOLID", "color": "#000000", "opacity": 0.8}], + "absolute": true + }, + { + "name": "Confirm Install Dialog", + "type": "FRAME", + "x": 460, + "y": 140, + "width": 520, + "height": 318, + "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"] + }, + "absolute": true, + "variables": { + "cornerRadius": "radius/xl", + "fills/0/color": "surface/surface", + "strokes/0/color": "border/border" + }, + "children": [ + { + "name": "mTitle", + "type": "TEXT", + "x": 20, + "y": 20, + "width": 178, + "height": 24, + "fills": [{"type": "SOLID", "color": "#F5F3F7"}], + "text": "Install All the Mods 10?", + "font": ["Geist", 600, 16], + "lineHeight": {"value": 150, "unit": "PERCENT"}, + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + }, + { + "name": "mDescWrap", + "type": "FRAME", + "x": 20, + "y": 44, + "width": 480, + "height": 46, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [4, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "name": "mDesc", + "type": "TEXT", + "x": 0, + "y": 4, + "width": 480, + "height": 42, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "layoutGrow": 1, + "text": "mc-modded restarts to install the pack. It stays on this version until you change it.", + "font": ["Geist", 400, 14], + "lineHeight": {"value": 150, "unit": "PERCENT"}, + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "muted"} + } + ] + }, + { + "name": "mBody", + "type": "FRAME", + "x": 20, + "y": 90, + "width": 480, + "height": 156, + "layout": { + "mode": "VERTICAL", + "gap": 16, + "padding": [16, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "name": "Pack Summary", + "type": "INSTANCE", + "x": 0, + "y": 16, + "width": 480, + "height": 64, + "component": "Gameplane/Modpack Summary", + "fills": [{"type": "SOLID", "color": "#17151A"}], + "cornerRadius": 8, + "layout": { + "mode": "HORIZONTAL", + "gap": 12, + "padding": [12, 12, 12, 12], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"fills/0/color": "surface/secondary"}, + "texts": ["All the Mods 10", "CurseForge · 2.36", "Release"] + }, + { + "name": "Backup First", + "type": "INSTANCE", + "x": 0, + "y": 96, + "width": 480, + "height": 60, + "component": "Gameplane/Backup First Option", + "layout": { + "mode": "VERTICAL", + "gap": 4, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "texts": [ + "Back up first", + "Takes a backup to the cluster’s backup destination (s3-backups) before the change. If the backup fails, nothing changes." + ] + } + ] + }, + { + "name": "mFooter", + "type": "FRAME", + "x": 20, + "y": 246, + "width": 480, + "height": 52, + "layout": { + "mode": "HORIZONTAL", + "gap": 8, + "padding": [20, 0, 0, 0], + "primary": "MAX", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "name": "btnCancel", + "type": "FRAME", + "x": 284, + "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": [ + { + "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"} + } + ] + }, + { + "name": "btnPrimary", + "type": "FRAME", + "x": 356, + "y": 20, + "width": 124, + "height": 32, + "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": [ + { + "name": "text", + "type": "TEXT", + "x": 12, + "y": 8, + "width": 100, + "height": 16, + "fills": [{"type": "SOLID", "color": "#FFFFFF"}], + "text": "Install and restart", + "font": ["Geist", 500, 12], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "accent/foreground"} + } + ] + } + ] + } + ] + } + ] +} diff --git a/assets/design-export/json/9dBXM.json b/assets/design-export/json/9dBXM.json index 36a996b96..71025301e 100644 --- a/assets/design-export/json/9dBXM.json +++ b/assets/design-export/json/9dBXM.json @@ -4,7 +4,7 @@ "name": "Screen/Backups — Index (Empty)", "type": "FRAME", "x": 1640, - "y": 59782, + "y": 60040, "width": 1440, "height": 900, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/A8vGwM.json b/assets/design-export/json/A8vGwM.json index 5ba1bf7e7..8cf49ee24 100644 --- a/assets/design-export/json/A8vGwM.json +++ b/assets/design-export/json/A8vGwM.json @@ -4,7 +4,7 @@ "name": "Screen/Server Detail — Settings · Lifecycle (Wake on connect unavailable)", "type": "FRAME", "x": 1640, - "y": 46130, + "y": 46388, "width": 1440, "height": 1620, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/B57dG.json b/assets/design-export/json/B57dG.json index 21e186467..141454a82 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": 91528, + "y": 91786, "width": 1440, "height": 900, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/Bbnga.json b/assets/design-export/json/Bbnga.json index e923f0993..3c2c0cb48 100644 --- a/assets/design-export/json/Bbnga.json +++ b/assets/design-export/json/Bbnga.json @@ -4,7 +4,7 @@ "name": "Screen/Server Detail — Capture (Not enabled)", "type": "FRAME", "x": 0, - "y": 36870, + "y": 37128, "width": 1440, "height": 900, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/BdmAW.json b/assets/design-export/json/BdmAW.json index c454e4ea7..ced79216f 100644 --- a/assets/design-export/json/BdmAW.json +++ b/assets/design-export/json/BdmAW.json @@ -4,7 +4,7 @@ "name": "Screen/Nodes — All clusters", "type": "FRAME", "x": 11480, - "y": 63932, + "y": 64190, "width": 1440, "height": 900, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/Be7ZW.json b/assets/design-export/json/Be7ZW.json index 927a4b0ce..b62dab9d1 100644 --- a/assets/design-export/json/Be7ZW.json +++ b/assets/design-export/json/Be7ZW.json @@ -4,7 +4,7 @@ "name": "Legacy/Standalone — Cluster inventory selection — Superseded", "type": "FRAME", "x": 4920, - "y": 63932, + "y": 64190, "width": 1440, "height": 900, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/BguST.json b/assets/design-export/json/BguST.json index 2f9e0c3e9..242c874d6 100644 --- a/assets/design-export/json/BguST.json +++ b/assets/design-export/json/BguST.json @@ -4,7 +4,7 @@ "name": "Screen/Server Detail — Settings · Game configuration (Password will be removed)", "type": "FRAME", "x": 6560, - "y": 40770, + "y": 41028, "width": 1440, "height": 900, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/Bq2Yg.json b/assets/design-export/json/Bq2Yg.json index 545d686a6..460d04863 100644 --- a/assets/design-export/json/Bq2Yg.json +++ b/assets/design-export/json/Bq2Yg.json @@ -4,7 +4,7 @@ "name": "Screen/Admin — System Logs", "type": "FRAME", "x": 0, - "y": 73032, + "y": 73290, "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 f7624ce8e..dc70026fb 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": 91528, + "y": 91786, "width": 1440, "height": 900, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/C9bR6.json b/assets/design-export/json/C9bR6.json index b035c9d41..64ee88958 100644 --- a/assets/design-export/json/C9bR6.json +++ b/assets/design-export/json/C9bR6.json @@ -4,7 +4,7 @@ "name": "Gameplane/Dialog/Edit user — Standalone (Remote grant)", "type": "FRAME", "x": 2320, - "y": 66532, + "y": 66790, "width": 480, "height": 643, "fills": [{"type": "SOLID", "color": "#1C1A20"}], diff --git a/assets/design-export/json/Cb3eC.json b/assets/design-export/json/Cb3eC.json index eaa81c71d..49400cbb1 100644 --- a/assets/design-export/json/Cb3eC.json +++ b/assets/design-export/json/Cb3eC.json @@ -4,7 +4,7 @@ "name": "Screen/Backups — Schedules filters open", "type": "FRAME", "x": 3280, - "y": 61082, + "y": 61340, "width": 1440, "height": 1150, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/D9QYZ.json b/assets/design-export/json/D9QYZ.json index 79264cfc7..ae1d1f275 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": 82231, + "y": 82489, "width": 1440, "height": 900, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/DBQyF.json b/assets/design-export/json/DBQyF.json index b58edd961..202dbc76d 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": 87496, + "y": 87754, "width": 1440, "height": 641, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/DPrYX.json b/assets/design-export/json/DPrYX.json index 80e942db1..103c0e33f 100644 --- a/assets/design-export/json/DPrYX.json +++ b/assets/design-export/json/DPrYX.json @@ -4,7 +4,7 @@ "name": "Screen/Backups — Index", "type": "FRAME", "x": 0, - "y": 59782, + "y": 60040, "width": 1440, "height": 900, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/Dpb9f.json b/assets/design-export/json/Dpb9f.json index 44c3bb5bb..43756f399 100644 --- a/assets/design-export/json/Dpb9f.json +++ b/assets/design-export/json/Dpb9f.json @@ -4,7 +4,7 @@ "name": "Screen/Users & RBAC — Identity providers", "type": "FRAME", "x": 0, - "y": 70432, + "y": 70690, "width": 1440, "height": 900, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/DxKOh.json b/assets/design-export/json/DxKOh.json index 1cdf00331..7b98cbfc9 100644 --- a/assets/design-export/json/DxKOh.json +++ b/assets/design-export/json/DxKOh.json @@ -4,7 +4,7 @@ "name": "Screen/Audit Log", "type": "FRAME", "x": 0, - "y": 71732, + "y": 71990, "width": 1440, "height": 900, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/E0ypH.json b/assets/design-export/json/E0ypH.json index 3cf3c2147..d81f08e1d 100644 --- a/assets/design-export/json/E0ypH.json +++ b/assets/design-export/json/E0ypH.json @@ -4,7 +4,7 @@ "name": "Screen/Server Detail — Settings · Resources", "type": "FRAME", "x": 0, - "y": 42130, + "y": 42388, "width": 1440, "height": 900, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/EKJyM.json b/assets/design-export/json/EKJyM.json index 0338a7ec8..a0145c489 100644 --- a/assets/design-export/json/EKJyM.json +++ b/assets/design-export/json/EKJyM.json @@ -4,7 +4,7 @@ "name": "Server Detail · Settings · Networking · Provider + credentials complete", "type": "FRAME", "x": 8200, - "y": 43530, + "y": 43788, "width": 1440, "height": 900, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/EWrn0.json b/assets/design-export/json/EWrn0.json index 456d23f96..f67286681 100644 --- a/assets/design-export/json/EWrn0.json +++ b/assets/design-export/json/EWrn0.json @@ -4,7 +4,7 @@ "name": "Screen/Standalone — Modules (East selected)", "type": "FRAME", "x": 4920, - "y": 55950, + "y": 56208, "width": 1440, "height": 1900, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/EcoGD.json b/assets/design-export/json/EcoGD.json index 657e7510c..d02594514 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": 91528, + "y": 91786, "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 8bda54fa3..e42ac1340 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": 91528, + "y": 91786, "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 88d55b1d1..0d5975163 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": 90228, + "y": 90486, "width": 1440, "height": 900, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/HVhmb.json b/assets/design-export/json/HVhmb.json index 09af430b8..fbbd3f120 100644 --- a/assets/design-export/json/HVhmb.json +++ b/assets/design-export/json/HVhmb.json @@ -4,7 +4,7 @@ "name": "Legacy/Clusters list — Remove registration — Moved", "type": "FRAME", "x": 8200, - "y": 63932, + "y": 64190, "width": 1440, "height": 900, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/IBUqJ.json b/assets/design-export/json/IBUqJ.json index bb0c5fefa..5f00ebddc 100644 --- a/assets/design-export/json/IBUqJ.json +++ b/assets/design-export/json/IBUqJ.json @@ -4,7 +4,7 @@ "name": "Screen/Nodes — Add node target", "type": "FRAME", "x": 19680, - "y": 63932, + "y": 64190, "width": 1440, "height": 900, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/IMSD5.json b/assets/design-export/json/IMSD5.json index 50b3730d2..e085ed986 100644 --- a/assets/design-export/json/IMSD5.json +++ b/assets/design-export/json/IMSD5.json @@ -4,7 +4,7 @@ "name": "Screen/Server Detail — Settings · Danger zone (Owner-only)", "type": "FRAME", "x": 3280, - "y": 54650, + "y": 54908, "width": 1440, "height": 900, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/IdbiB.json b/assets/design-export/json/IdbiB.json index 594abcf9c..47758e84d 100644 --- a/assets/design-export/json/IdbiB.json +++ b/assets/design-export/json/IdbiB.json @@ -4,7 +4,7 @@ "name": "Screen/Dialog/Build Module — Step 1 (Preset & Metadata)", "type": "FRAME", "x": 0, - "y": 58400, + "y": 58658, "width": 800, "height": 977, "fills": [{"type": "SOLID", "color": "#1C1A20"}], diff --git a/assets/design-export/json/IyMFM.json b/assets/design-export/json/IyMFM.json index 4e3f4a5b4..05192b749 100644 --- a/assets/design-export/json/IyMFM.json +++ b/assets/design-export/json/IyMFM.json @@ -4,7 +4,7 @@ "name": "J5pjJ3 states/Tunnel enabled", "type": "FRAME", "x": 9840, - "y": 43530, + "y": 43788, "width": 500, "height": 476, "fills": [{"type": "SOLID", "color": "#1C1A20"}], diff --git a/assets/design-export/json/J5pjJ3.json b/assets/design-export/json/J5pjJ3.json index 3fea7fe27..eb79afcd2 100644 --- a/assets/design-export/json/J5pjJ3.json +++ b/assets/design-export/json/J5pjJ3.json @@ -4,7 +4,7 @@ "name": "Server Detail · Settings · Networking · Complete", "type": "FRAME", "x": 0, - "y": 43530, + "y": 43788, "width": 1440, "height": 900, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/J8GzM9.json b/assets/design-export/json/J8GzM9.json index 972358e77..e5aab219e 100644 --- a/assets/design-export/json/J8GzM9.json +++ b/assets/design-export/json/J8GzM9.json @@ -4,7 +4,7 @@ "name": "Screen/Cluster Details — Nodes", "type": "FRAME", "x": 14760, - "y": 63932, + "y": 64190, "width": 1440, "height": 900, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/K5XinZ.json b/assets/design-export/json/K5XinZ.json index 0ff4456e4..86d7db19c 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": 87496, + "y": 87754, "width": 1440, "height": 605, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/KJdxg.json b/assets/design-export/json/KJdxg.json index 42ee4d59f..37a573113 100644 --- a/assets/design-export/json/KJdxg.json +++ b/assets/design-export/json/KJdxg.json @@ -4,7 +4,7 @@ "name": "Screen/Server Detail — Settings · Minecraft JVM startup", "type": "FRAME", "x": 9740, - "y": 40770, + "y": 41028, "width": 1440, "height": 980, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/KaRFX.json b/assets/design-export/json/KaRFX.json index cff108337..a6f5e7264 100644 --- a/assets/design-export/json/KaRFX.json +++ b/assets/design-export/json/KaRFX.json @@ -4,7 +4,7 @@ "name": "Screen/Server Detail — Settings · Scheduled backups", "type": "FRAME", "x": 0, - "y": 48150, + "y": 48408, "width": 1440, "height": 900, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/LYPXU.json b/assets/design-export/json/LYPXU.json index 3dc695bec..333ba70a0 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": 91528, + "y": 91786, "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 2eba7fea7..ec027c914 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": 88928, + "y": 89186, "width": 1440, "height": 900, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/N2nTf.json b/assets/design-export/json/N2nTf.json index 5238d8640..3b73a5c03 100644 --- a/assets/design-export/json/N2nTf.json +++ b/assets/design-export/json/N2nTf.json @@ -4,7 +4,7 @@ "name": "Screen/Mobile — Nodes — All clusters", "type": "FRAME", "x": 21280, - "y": 63932, + "y": 64190, "width": 390, "height": 1620, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/NKiqf.json b/assets/design-export/json/NKiqf.json index be7b6ae0f..d90a43a95 100644 --- a/assets/design-export/json/NKiqf.json +++ b/assets/design-export/json/NKiqf.json @@ -4,7 +4,7 @@ "name": "Screen/Mobile — Backups filters open", "type": "FRAME", "x": 4920, - "y": 59782, + "y": 60040, "width": 375, "height": 844, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/Ne5TA.json b/assets/design-export/json/Ne5TA.json index 6ec99ddc8..27e0a9b18 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": 92828, + "y": 93086, "width": 1440, "height": 900, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/NqaaU.json b/assets/design-export/json/NqaaU.json index 8f5d0b31d..541c115fb 100644 --- a/assets/design-export/json/NqaaU.json +++ b/assets/design-export/json/NqaaU.json @@ -4,7 +4,7 @@ "name": "Screen/Server Detail — Settings · Resources (Reserve less on)", "type": "FRAME", "x": 1640, - "y": 42130, + "y": 42388, "width": 1440, "height": 1000, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/O08uaD.json b/assets/design-export/json/O08uaD.json index a57544199..7a781b4b0 100644 --- a/assets/design-export/json/O08uaD.json +++ b/assets/design-export/json/O08uaD.json @@ -4,7 +4,7 @@ "name": "Screen/Server Detail — Capture — Start capture", "type": "FRAME", "x": 6560, - "y": 36870, + "y": 37128, "width": 1440, "height": 900, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/O5kaV.json b/assets/design-export/json/O5kaV.json index f634a6b8a..2ac869e92 100644 --- a/assets/design-export/json/O5kaV.json +++ b/assets/design-export/json/O5kaV.json @@ -4,7 +4,7 @@ "name": "Screen/Dialog/Build Module — Step 2 (Container & Ports)", "type": "FRAME", "x": 1000, - "y": 58400, + "y": 58658, "width": 800, "height": 546, "fills": [{"type": "SOLID", "color": "#1C1A20"}], diff --git a/assets/design-export/json/OC804.json b/assets/design-export/json/OC804.json index a835e5c24..42c266fcb 100644 --- a/assets/design-export/json/OC804.json +++ b/assets/design-export/json/OC804.json @@ -4,7 +4,7 @@ "name": "Screen/Server Detail — Settings · Game configuration", "type": "FRAME", "x": 0, - "y": 40770, + "y": 41028, "width": 1440, "height": 900, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/OecJ5.json b/assets/design-export/json/OecJ5.json index 75ab67acd..d075becc6 100644 --- a/assets/design-export/json/OecJ5.json +++ b/assets/design-export/json/OecJ5.json @@ -4,7 +4,7 @@ "name": "Screen/Cluster Details — Configuration — Local", "type": "FRAME", "x": 16400, - "y": 63932, + "y": 64190, "width": 1440, "height": 1060, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/QFEg9.json b/assets/design-export/json/QFEg9.json index cfad05150..241c2772d 100644 --- a/assets/design-export/json/QFEg9.json +++ b/assets/design-export/json/QFEg9.json @@ -4,7 +4,7 @@ "name": "Screen/Server Detail — Settings · Game configuration (Invalid value)", "type": "FRAME", "x": 1640, - "y": 40770, + "y": 41028, "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 f2f359ac1..f7b3714f5 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": 78522, + "y": 78780, "width": 1440, "height": 1660, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/QpEvu.json b/assets/design-export/json/QpEvu.json index 417863d02..d3e474d67 100644 --- a/assets/design-export/json/QpEvu.json +++ b/assets/design-export/json/QpEvu.json @@ -4,7 +4,7 @@ "name": "Screen/Server Detail — Settings · Access", "type": "FRAME", "x": 1640, - "y": 52050, + "y": 52308, "width": 1440, "height": 900, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/RC3Kf.json b/assets/design-export/json/RC3Kf.json index 7c983de3e..e401bbacf 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": 82231, + "y": 82489, "width": 1440, "height": 900, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/RS0KZ.json b/assets/design-export/json/RS0KZ.json index 2b6ea9326..81ee8e65f 100644 --- a/assets/design-export/json/RS0KZ.json +++ b/assets/design-export/json/RS0KZ.json @@ -4,7 +4,7 @@ "name": "State/Standalone — Cluster selection and request states", "type": "FRAME", "x": 9840, - "y": 63932, + "y": 64190, "width": 1440, "height": 732, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/RodrS.json b/assets/design-export/json/RodrS.json index 50fd8a9ef..1ef68f0b8 100644 --- a/assets/design-export/json/RodrS.json +++ b/assets/design-export/json/RodrS.json @@ -4,7 +4,7 @@ "name": "Screen/Server Detail — Settings · Network capture", "type": "FRAME", "x": 0, - "y": 49450, + "y": 49708, "width": 1440, "height": 900, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/RpHBg.json b/assets/design-export/json/RpHBg.json index 9f1d3544c..049e852e0 100644 --- a/assets/design-export/json/RpHBg.json +++ b/assets/design-export/json/RpHBg.json @@ -4,7 +4,7 @@ "name": "Screen/Standalone — Register cluster", "type": "FRAME", "x": 6560, - "y": 63932, + "y": 64190, "width": 1440, "height": 900, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/SUcad.json b/assets/design-export/json/SUcad.json index d229a84e1..722668be8 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": 86131, + "y": 86389, "width": 1440, "height": 965, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/SUtGZ.json b/assets/design-export/json/SUtGZ.json index 980bfdd54..338a3f7b8 100644 --- a/assets/design-export/json/SUtGZ.json +++ b/assets/design-export/json/SUtGZ.json @@ -4,7 +4,7 @@ "name": "Screen/Mobile — Remote server Capture", "type": "FRAME", "x": 12840, - "y": 36870, + "y": 37128, "width": 375, "height": 900, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/T1wkiT.json b/assets/design-export/json/T1wkiT.json index c15ff4f30..b60a1413d 100644 --- a/assets/design-export/json/T1wkiT.json +++ b/assets/design-export/json/T1wkiT.json @@ -4,7 +4,7 @@ "name": "Screen/Theme Settings — Warnings", "type": "FRAME", "x": 1640, - "y": 75632, + "y": 75890, "width": 1440, "height": 2490, "fills": [{"type": "SOLID", "color": "#FFFFFF"}], diff --git a/assets/design-export/json/T70dJ.json b/assets/design-export/json/T70dJ.json index de0639503..61c072e7e 100644 --- a/assets/design-export/json/T70dJ.json +++ b/assets/design-export/json/T70dJ.json @@ -4,7 +4,7 @@ "name": "Screen/Cluster Details — Configuration — Default storage", "type": "FRAME", "x": 21830, - "y": 63932, + "y": 64190, "width": 1440, "height": 1060, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/TBvTC.json b/assets/design-export/json/TBvTC.json index 74d33c33a..2e2c556df 100644 --- a/assets/design-export/json/TBvTC.json +++ b/assets/design-export/json/TBvTC.json @@ -4,7 +4,7 @@ "name": "Screen/Users & RBAC — Service accounts", "type": "FRAME", "x": 0, - "y": 69132, + "y": 69390, "width": 1440, "height": 900, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/U9xSg.json b/assets/design-export/json/U9xSg.json index beae80d1a..79bb677a4 100644 --- a/assets/design-export/json/U9xSg.json +++ b/assets/design-export/json/U9xSg.json @@ -4,7 +4,7 @@ "name": "Screen/Server Detail — Players (Nuclear Option)", "type": "FRAME", "x": 1640, - "y": 34270, + "y": 34528, "width": 1440, "height": 900, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/UdnBT.json b/assets/design-export/json/UdnBT.json index 0fc27199c..141a42d4b 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": 78522, + "y": 78780, "width": 1440, "height": 2600, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/Uzzje.json b/assets/design-export/json/Uzzje.json index aad3465f5..157843e8b 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": 88928, + "y": 89186, "width": 1440, "height": 900, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/VctzT.json b/assets/design-export/json/VctzT.json index e1b2c1495..96d71ab33 100644 --- a/assets/design-export/json/VctzT.json +++ b/assets/design-export/json/VctzT.json @@ -4,7 +4,7 @@ "name": "Screen/Server Detail — Settings · Version", "type": "FRAME", "x": 1640, - "y": 39470, + "y": 39728, "width": 1440, "height": 900, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/VfB0Y.json b/assets/design-export/json/VfB0Y.json index 14f1f3e6c..737193977 100644 --- a/assets/design-export/json/VfB0Y.json +++ b/assets/design-export/json/VfB0Y.json @@ -4,7 +4,7 @@ "name": "Screen/Server Detail — Settings · RBAC & access", "type": "FRAME", "x": 0, - "y": 52050, + "y": 52308, "width": 1440, "height": 900, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/WZdnw.json b/assets/design-export/json/WZdnw.json index 3a2fdd62b..36c9798b0 100644 --- a/assets/design-export/json/WZdnw.json +++ b/assets/design-export/json/WZdnw.json @@ -4,7 +4,7 @@ "name": "Screen/Admin Settings", "type": "FRAME", "x": 0, - "y": 74332, + "y": 74590, "width": 1440, "height": 900, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/Wj0V4.json b/assets/design-export/json/Wj0V4.json index 4a893463f..61e122038 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": 84831, + "y": 85089, "width": 1440, "height": 900, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/WrmU5.json b/assets/design-export/json/WrmU5.json index b0d1e0bd1..83ec817b1 100644 --- a/assets/design-export/json/WrmU5.json +++ b/assets/design-export/json/WrmU5.json @@ -4,7 +4,7 @@ "name": "Screen/Standalone — Clusters (Registered)", "type": "FRAME", "x": 3280, - "y": 63932, + "y": 64190, "width": 1440, "height": 900, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/XR0f9.json b/assets/design-export/json/XR0f9.json index f904f49a3..95428c27d 100644 --- a/assets/design-export/json/XR0f9.json +++ b/assets/design-export/json/XR0f9.json @@ -4,7 +4,7 @@ "name": "Screen/Server Detail — Settings · Danger zone", "type": "FRAME", "x": 1640, - "y": 54650, + "y": 54908, "width": 1440, "height": 900, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/Y5cmvI.json b/assets/design-export/json/Y5cmvI.json index 0c57ff8d1..fd3297285 100644 --- a/assets/design-export/json/Y5cmvI.json +++ b/assets/design-export/json/Y5cmvI.json @@ -4,7 +4,7 @@ "name": "Screen/Server Detail — Settings · Placement", "type": "FRAME", "x": 0, - "y": 50750, + "y": 51008, "width": 1440, "height": 900, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/YN8cE.json b/assets/design-export/json/YN8cE.json index bd272e374..fa092b0b5 100644 --- a/assets/design-export/json/YN8cE.json +++ b/assets/design-export/json/YN8cE.json @@ -4,7 +4,7 @@ "name": "Screen/Server Detail — Settings · Game configuration (New password typed)", "type": "FRAME", "x": 8200, - "y": 40770, + "y": 41028, "width": 1440, "height": 900, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/Z0oyh.json b/assets/design-export/json/Z0oyh.json index 1e2ab668c..e337e8c20 100644 --- a/assets/design-export/json/Z0oyh.json +++ b/assets/design-export/json/Z0oyh.json @@ -4,7 +4,7 @@ "name": "Screen/Standalone — Modules (No selection)", "type": "FRAME", "x": 1640, - "y": 55950, + "y": 56208, "width": 1440, "height": 900, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/ZUAq1.json b/assets/design-export/json/ZUAq1.json index d1841c52e..46582abac 100644 --- a/assets/design-export/json/ZUAq1.json +++ b/assets/design-export/json/ZUAq1.json @@ -4,7 +4,7 @@ "name": "Screen/Server Detail — Settings · Minecraft JVM heap validation", "type": "FRAME", "x": 11280, - "y": 40770, + "y": 41028, "width": 1440, "height": 980, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/ZlLf0.json b/assets/design-export/json/ZlLf0.json index 1b657dbca..4182eff53 100644 --- a/assets/design-export/json/ZlLf0.json +++ b/assets/design-export/json/ZlLf0.json @@ -4,7 +4,7 @@ "name": "Screen/Standalone — Modules (Permission denied)", "type": "FRAME", "x": 3280, - "y": 55950, + "y": 56208, "width": 1440, "height": 900, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/aMU7O.json b/assets/design-export/json/aMU7O.json index c91380ee6..3b0809e12 100644 --- a/assets/design-export/json/aMU7O.json +++ b/assets/design-export/json/aMU7O.json @@ -4,7 +4,7 @@ "name": "Gameplane/Dialog/Edit user — Standalone (No target)", "type": "FRAME", "x": 1640, - "y": 66532, + "y": 66790, "width": 480, "height": 643, "fills": [{"type": "SOLID", "color": "#1C1A20"}], diff --git a/assets/design-export/json/akr4I.json b/assets/design-export/json/akr4I.json index 0333054f2..2603f2277 100644 --- a/assets/design-export/json/akr4I.json +++ b/assets/design-export/json/akr4I.json @@ -4,7 +4,7 @@ "name": "Screen/Server Detail — Capture (No access)", "type": "FRAME", "x": 9840, - "y": 36870, + "y": 37128, "width": 1440, "height": 900, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/b4eaUf.json b/assets/design-export/json/b4eaUf.json index f13835d5d..e85789f5d 100644 --- a/assets/design-export/json/b4eaUf.json +++ b/assets/design-export/json/b4eaUf.json @@ -4,7 +4,7 @@ "name": "Screen/Server Detail — Capture — Start capture (Invalid filter)", "type": "FRAME", "x": 8200, - "y": 36870, + "y": 37128, "width": 1440, "height": 900, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/bYDHC.json b/assets/design-export/json/bYDHC.json index 4840d2907..2835e0579 100644 --- a/assets/design-export/json/bYDHC.json +++ b/assets/design-export/json/bYDHC.json @@ -4,7 +4,7 @@ "name": "Screen/Users & RBAC", "type": "FRAME", "x": 0, - "y": 66532, + "y": 66790, "width": 1440, "height": 900, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/cDiNb.json b/assets/design-export/json/cDiNb.json index ffdd0b982..c3315b3bd 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": 87496, + "y": 87754, "width": 1440, "height": 777, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/dBILX.json b/assets/design-export/json/dBILX.json index 421acc8c1..6dd1b1394 100644 --- a/assets/design-export/json/dBILX.json +++ b/assets/design-export/json/dBILX.json @@ -4,7 +4,7 @@ "name": "Screen/Server Detail — Capture (Empty)", "type": "FRAME", "x": 1640, - "y": 36870, + "y": 37128, "width": 1440, "height": 900, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/dPP50.json b/assets/design-export/json/dPP50.json index 7ca2dcc07..83fe317d9 100644 --- a/assets/design-export/json/dPP50.json +++ b/assets/design-export/json/dPP50.json @@ -4,7 +4,7 @@ "name": "Screen/Server Detail — Players", "type": "FRAME", "x": 0, - "y": 34270, + "y": 34528, "width": 1440, "height": 900, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/dQV9N.json b/assets/design-export/json/dQV9N.json index 485622a1f..563aaa9e9 100644 --- a/assets/design-export/json/dQV9N.json +++ b/assets/design-export/json/dQV9N.json @@ -4,7 +4,7 @@ "name": "Screen/Server Detail — Settings · Share links (Empty)", "type": "FRAME", "x": 1640, - "y": 53350, + "y": 53608, "width": 1440, "height": 900, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/dhPtX.json b/assets/design-export/json/dhPtX.json index d91cf1d07..4a74913db 100644 --- a/assets/design-export/json/dhPtX.json +++ b/assets/design-export/json/dhPtX.json @@ -4,7 +4,7 @@ "name": "Server Detail · Settings · Networking · Tunnel initial enable", "type": "FRAME", "x": 3280, - "y": 43530, + "y": 43788, "width": 1440, "height": 900, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/dxdEi.json b/assets/design-export/json/dxdEi.json index d958260a1..bd6341077 100644 --- a/assets/design-export/json/dxdEi.json +++ b/assets/design-export/json/dxdEi.json @@ -4,7 +4,7 @@ "name": "Legacy/Cluster Settings — Default storage — Superseded", "type": "FRAME", "x": 1640, - "y": 65232, + "y": 65490, "width": 1440, "height": 900, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/e9FnC.json b/assets/design-export/json/e9FnC.json index d2f786b1f..aeab3a5d0 100644 --- a/assets/design-export/json/e9FnC.json +++ b/assets/design-export/json/e9FnC.json @@ -4,7 +4,7 @@ "name": "Screen/Server Detail — Settings · Game configuration (Orphaned key)", "type": "FRAME", "x": 4920, - "y": 40770, + "y": 41028, "width": 1440, "height": 960, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/e9lV4.json b/assets/design-export/json/e9lV4.json index 15a134ee3..98e47eeb9 100644 --- a/assets/design-export/json/e9lV4.json +++ b/assets/design-export/json/e9lV4.json @@ -4,7 +4,7 @@ "name": "Screen/Users & RBAC — Roles", "type": "FRAME", "x": 0, - "y": 67832, + "y": 68090, "width": 1440, "height": 900, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/epZO2.json b/assets/design-export/json/epZO2.json index 207260d73..32241e4ac 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": 91528, + "y": 91786, "width": 1440, "height": 900, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/fK8Bi.json b/assets/design-export/json/fK8Bi.json index e859747e4..f07e6f088 100644 --- a/assets/design-export/json/fK8Bi.json +++ b/assets/design-export/json/fK8Bi.json @@ -4,7 +4,7 @@ "name": "Screen/Backups — Schedules", "type": "FRAME", "x": 0, - "y": 61082, + "y": 61340, "width": 1440, "height": 1150, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/fbBqA.json b/assets/design-export/json/fbBqA.json index 23febb309..5485c8cb0 100644 --- a/assets/design-export/json/fbBqA.json +++ b/assets/design-export/json/fbBqA.json @@ -4,7 +4,7 @@ "name": "Screen/Backups — Restores filters open", "type": "FRAME", "x": 3280, - "y": 62632, + "y": 62890, "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 d8dc9bb79..c29f91699 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": 83531, + "y": 83789, "width": 1440, "height": 900, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/gWqMD.json b/assets/design-export/json/gWqMD.json index 3f6a7e0ac..090b87639 100644 --- a/assets/design-export/json/gWqMD.json +++ b/assets/design-export/json/gWqMD.json @@ -4,7 +4,7 @@ "name": "Screen/Server Detail — Settings · Access (Read-only)", "type": "FRAME", "x": 3280, - "y": 52050, + "y": 52308, "width": 1440, "height": 900, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/hLB9Z.json b/assets/design-export/json/hLB9Z.json index 88f11567f..5ea8a6cdb 100644 --- a/assets/design-export/json/hLB9Z.json +++ b/assets/design-export/json/hLB9Z.json @@ -4,7 +4,7 @@ "name": "Screen/Server Detail — Settings", "type": "FRAME", "x": 0, - "y": 38170, + "y": 38428, "width": 1440, "height": 900, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/hmPL7.json b/assets/design-export/json/hmPL7.json index d18c01bc7..55d70252c 100644 --- a/assets/design-export/json/hmPL7.json +++ b/assets/design-export/json/hmPL7.json @@ -4,7 +4,7 @@ "name": "Screen/Dialog/Build Module — Step 3 (Review & Export)", "type": "FRAME", "x": 2000, - "y": 58400, + "y": 58658, "width": 840, "height": 593, "fills": [{"type": "SOLID", "color": "#1C1A20"}], diff --git a/assets/design-export/json/i1bLR.json b/assets/design-export/json/i1bLR.json index 9dbbbbfa0..840901af1 100644 --- a/assets/design-export/json/i1bLR.json +++ b/assets/design-export/json/i1bLR.json @@ -4,7 +4,7 @@ "name": "Screen/Server Detail — Settings · Lifecycle", "type": "FRAME", "x": 0, - "y": 46130, + "y": 46388, "width": 1440, "height": 1620, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/i4L0M.json b/assets/design-export/json/i4L0M.json index c7449e910..eef2bb6bf 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": 84831, + "y": 85089, "width": 1440, "height": 900, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/i8wib.json b/assets/design-export/json/i8wib.json index eb48f8bb6..d6ddb8b1c 100644 --- a/assets/design-export/json/i8wib.json +++ b/assets/design-export/json/i8wib.json @@ -4,7 +4,7 @@ "name": "Screen/Server Detail — Settings · Danger zone", "type": "FRAME", "x": 0, - "y": 54650, + "y": 54908, "width": 1440, "height": 900, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/iLm38.json b/assets/design-export/json/iLm38.json index 68dda1041..131ff7eec 100644 --- a/assets/design-export/json/iLm38.json +++ b/assets/design-export/json/iLm38.json @@ -4,7 +4,7 @@ "name": "Screen/Server Detail — Settings · Environment", "type": "FRAME", "x": 1640, - "y": 44830, + "y": 45088, "width": 1440, "height": 900, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/iSA6R.json b/assets/design-export/json/iSA6R.json index 8ff7f3d27..f0bc631b4 100644 --- a/assets/design-export/json/iSA6R.json +++ b/assets/design-export/json/iSA6R.json @@ -4,7 +4,7 @@ "name": "Screen/Mobile — Server Detail — Settings · Placement", "type": "FRAME", "x": 1640, - "y": 50750, + "y": 51008, "width": 375, "height": 900, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/iYUWc.json b/assets/design-export/json/iYUWc.json index d0f1999e5..7074d92f1 100644 --- a/assets/design-export/json/iYUWc.json +++ b/assets/design-export/json/iYUWc.json @@ -4,7 +4,7 @@ "name": "Screen/Clusters — Registered clusters", "type": "FRAME", "x": 0, - "y": 63932, + "y": 64190, "width": 1440, "height": 900, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/j9W8A.json b/assets/design-export/json/j9W8A.json index e181cf2c6..d056b9eef 100644 --- a/assets/design-export/json/j9W8A.json +++ b/assets/design-export/json/j9W8A.json @@ -4,7 +4,7 @@ "name": "Legacy/Cluster Settings — Superseded", "type": "FRAME", "x": 0, - "y": 65232, + "y": 65490, "width": 1440, "height": 900, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/jXykV.json b/assets/design-export/json/jXykV.json index 7d6110c60..a9a917f88 100644 --- a/assets/design-export/json/jXykV.json +++ b/assets/design-export/json/jXykV.json @@ -4,7 +4,7 @@ "name": "J5pjJ3 states/Alerts", "type": "FRAME", "x": 10540, - "y": 43530, + "y": 43788, "width": 700, "height": 246, "fills": [{"type": "SOLID", "color": "#1C1A20"}], diff --git a/assets/design-export/json/kK8Ji.json b/assets/design-export/json/kK8Ji.json index df2a77da8..dd4dce127 100644 --- a/assets/design-export/json/kK8Ji.json +++ b/assets/design-export/json/kK8Ji.json @@ -4,7 +4,7 @@ "name": "Screen/Modules Catalog", "type": "FRAME", "x": 0, - "y": 55950, + "y": 56208, "width": 1440, "height": 1320, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/l64bd.json b/assets/design-export/json/l64bd.json index 04ccb1d74..8948400ba 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": 83531, + "y": 83789, "width": 1440, "height": 900, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/l7TRz9.json b/assets/design-export/json/l7TRz9.json index 665cddc87..585eced24 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": 87496, + "y": 87754, "width": 1440, "height": 1031, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/lCTci.json b/assets/design-export/json/lCTci.json index c27219af8..b42e326eb 100644 --- a/assets/design-export/json/lCTci.json +++ b/assets/design-export/json/lCTci.json @@ -4,7 +4,7 @@ "name": "Screen/Mobile — Theme Settings · Language", "type": "FRAME", "x": 3280, - "y": 75632, + "y": 75890, "width": 390, "height": 972, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/lWvcv.json b/assets/design-export/json/lWvcv.json index e7c270229..b45fbcdbd 100644 --- a/assets/design-export/json/lWvcv.json +++ b/assets/design-export/json/lWvcv.json @@ -4,7 +4,7 @@ "name": "Screen/Theme Settings", "type": "FRAME", "x": 0, - "y": 75632, + "y": 75890, "width": 1440, "height": 2344, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/m5kOm4.json b/assets/design-export/json/m5kOm4.json index 69e1521a3..ccc50abf6 100644 --- a/assets/design-export/json/m5kOm4.json +++ b/assets/design-export/json/m5kOm4.json @@ -4,7 +4,7 @@ "name": "Screen/Server Detail — Capture (List)", "type": "FRAME", "x": 4920, - "y": 36870, + "y": 37128, "width": 1440, "height": 900, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/mrF6f.json b/assets/design-export/json/mrF6f.json index 39e3c336c..cff62f1ae 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": 78522, + "y": 78780, "width": 888, "height": 649, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/n2qdi.json b/assets/design-export/json/n2qdi.json index f6213b987..255f12533 100644 --- a/assets/design-export/json/n2qdi.json +++ b/assets/design-export/json/n2qdi.json @@ -4,7 +4,7 @@ "name": "Screen/Standalone — Clusters (Empty)", "type": "FRAME", "x": 1640, - "y": 63932, + "y": 64190, "width": 1440, "height": 900, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/n6Xlo.json b/assets/design-export/json/n6Xlo.json index 4b44e659e..723d19543 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": 86131, + "y": 86389, "width": 1440, "height": 900, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/nGJE1.json b/assets/design-export/json/nGJE1.json index fff2f2b49..99d0213c9 100644 --- a/assets/design-export/json/nGJE1.json +++ b/assets/design-export/json/nGJE1.json @@ -4,7 +4,7 @@ "name": "Server Detail · Settings · Networking · Tunnel disabled", "type": "FRAME", "x": 1640, - "y": 43530, + "y": 43788, "width": 1440, "height": 900, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/nNGDX.json b/assets/design-export/json/nNGDX.json index 0ca5c8aa4..e6a03ff69 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": 78522, + "y": 78780, "width": 1440, "height": 1463, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/nfMMj.json b/assets/design-export/json/nfMMj.json index 6bfa0792d..449573fc7 100644 --- a/assets/design-export/json/nfMMj.json +++ b/assets/design-export/json/nfMMj.json @@ -4,7 +4,7 @@ "name": "Screen/Backups — Restores (Empty)", "type": "FRAME", "x": 1640, - "y": 62632, + "y": 62890, "width": 1440, "height": 900, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/oPF1n.json b/assets/design-export/json/oPF1n.json index 16bf63be1..fc60ed74a 100644 --- a/assets/design-export/json/oPF1n.json +++ b/assets/design-export/json/oPF1n.json @@ -4,7 +4,7 @@ "name": "Screen/Share links — Create link (Custom date)", "type": "FRAME", "x": 3960, - "y": 53350, + "y": 53608, "width": 480, "height": 382, "fills": [{"type": "SOLID", "color": "#FFF7FB"}], diff --git a/assets/design-export/json/p8QSPq.json b/assets/design-export/json/p8QSPq.json index 8b966dc88..2c5cfb660 100644 --- a/assets/design-export/json/p8QSPq.json +++ b/assets/design-export/json/p8QSPq.json @@ -4,7 +4,7 @@ "name": "Screen/Standalone — Modules (Manage sources)", "type": "FRAME", "x": 6560, - "y": 55950, + "y": 56208, "width": 1440, "height": 2050, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/pnAbF.json b/assets/design-export/json/pnAbF.json index 7bdead149..6bfba81d4 100644 --- a/assets/design-export/json/pnAbF.json +++ b/assets/design-export/json/pnAbF.json @@ -4,7 +4,7 @@ "name": "Screen/Backups — Filters open", "type": "FRAME", "x": 3280, - "y": 59782, + "y": 60040, "width": 1440, "height": 900, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/pssCT.json b/assets/design-export/json/pssCT.json index d7df5d3c8..1feebe169 100644 --- a/assets/design-export/json/pssCT.json +++ b/assets/design-export/json/pssCT.json @@ -4,7 +4,7 @@ "name": "Screen/Server Detail — Backups", "type": "FRAME", "x": 0, - "y": 35570, + "y": 35828, "width": 1440, "height": 900, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/pszxE.json b/assets/design-export/json/pszxE.json index 39885c43a..7d59b8922 100644 --- a/assets/design-export/json/pszxE.json +++ b/assets/design-export/json/pszxE.json @@ -4,7 +4,7 @@ "name": "Users & RBAC — Return to SSO control dialogs", "type": "FRAME", "x": 4640, - "y": 66532, + "y": 66790, "width": 1040, "height": 721, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/q31B6w.json b/assets/design-export/json/q31B6w.json index 4e8194d4d..96812ee3a 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": 91528, + "y": 91786, "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 d9c4ee0fc..262d87324 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": 91528, + "y": 91786, "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 6bf986c50..826abe3f3 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": 87496, + "y": 87754, "width": 1440, "height": 1032, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/r139UP.json b/assets/design-export/json/r139UP.json index f58a9276e..88018fc50 100644 --- a/assets/design-export/json/r139UP.json +++ b/assets/design-export/json/r139UP.json @@ -4,7 +4,7 @@ "name": "Screen/Standalone — System logs", "type": "FRAME", "x": 1640, - "y": 73032, + "y": 73290, "width": 1440, "height": 900, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/rJt1I.json b/assets/design-export/json/rJt1I.json index fe20e0fd7..b6dbc4f74 100644 --- a/assets/design-export/json/rJt1I.json +++ b/assets/design-export/json/rJt1I.json @@ -4,7 +4,7 @@ "name": "Screen/Users & RBAC — Role source", "type": "FRAME", "x": 3000, - "y": 66532, + "y": 66790, "width": 1440, "height": 900, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/swxkJ.json b/assets/design-export/json/swxkJ.json index 6aafa4877..b3f233fa5 100644 --- a/assets/design-export/json/swxkJ.json +++ b/assets/design-export/json/swxkJ.json @@ -4,7 +4,7 @@ "name": "Screen/Server Detail — Settings · Version", "type": "FRAME", "x": 0, - "y": 39470, + "y": 39728, "width": 1440, "height": 900, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/t56aLu.json b/assets/design-export/json/t56aLu.json index f2fcef737..8a69cc4cd 100644 --- a/assets/design-export/json/t56aLu.json +++ b/assets/design-export/json/t56aLu.json @@ -4,7 +4,7 @@ "name": "Screen/Cluster Details — Configuration — Remote", "type": "FRAME", "x": 18040, - "y": 63932, + "y": 64190, "width": 1440, "height": 1060, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/tSOeI.json b/assets/design-export/json/tSOeI.json index df9cc3c61..242ea2370 100644 --- a/assets/design-export/json/tSOeI.json +++ b/assets/design-export/json/tSOeI.json @@ -4,7 +4,7 @@ "name": "Server Detail · Settings · Networking · Provider selected", "type": "FRAME", "x": 4920, - "y": 43530, + "y": 43788, "width": 1440, "height": 900, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/tTSdi.json b/assets/design-export/json/tTSdi.json index df6a0fbb0..e31f7f508 100644 --- a/assets/design-export/json/tTSdi.json +++ b/assets/design-export/json/tTSdi.json @@ -4,7 +4,7 @@ "name": "Screen/Backups — Restores", "type": "FRAME", "x": 0, - "y": 62632, + "y": 62890, "width": 1440, "height": 900, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/tY6RD.json b/assets/design-export/json/tY6RD.json index c3a475900..64a50625b 100644 --- a/assets/design-export/json/tY6RD.json +++ b/assets/design-export/json/tY6RD.json @@ -154,7 +154,7 @@ "MI", "test-server-02", "Running", - "minecraft-modded · ns: default · up 13d 4h", + "minecraft-java · fabric 1.21.1 · ns: default · up 13d 4h", "Restart", "Stop", "Open console" @@ -238,7 +238,7 @@ "height": 14, "fills": [{"type": "SOLID", "color": "#9E98A6"}], "layoutAlignSelf": "STRETCH", - "text": "Installing a modpack either pins it on the server (and restarts) or adds all of its mods, depending on the registry.", + "text": "Pick a pack and a version. The server pins that version and restarts to install it; a restart never upgrades it.", "font": ["Geist", 400, 11], "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "muted"} } @@ -251,7 +251,7 @@ "x": 24, "y": 224, "width": 1132, - "height": 36, + "height": 40, "layout": { "mode": "HORIZONTAL", "gap": 8, @@ -263,12 +263,33 @@ "layoutAlignSelf": "STRETCH", "children": [ { - "id": "1:1137", - "name": "Search", + "name": "Provider Switch", "type": "INSTANCE", "x": 0, "y": 0, - "width": 904, + "width": 266, + "height": 40, + "component": "Gameplane/Provider Switch", + "fills": [{"type": "SOLID", "color": "#232128"}], + "cornerRadius": 20, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [4, 4, 4, 4], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "HUG"] + }, + "variables": {"fills/0/color": "default/default"}, + "texts": ["Modrinth", "CurseForge", "FTB"] + }, + { + "id": "1:1137", + "name": "Search", + "type": "INSTANCE", + "x": 274, + "y": 2, + "width": 630, "height": 36, "component": "Gameplane/Search Input", "componentId": "1:975", @@ -298,7 +319,7 @@ "name": "Select", "type": "INSTANCE", "x": 912, - "y": 0, + "y": 2, "width": 220, "height": 36, "component": "Gameplane/Select", @@ -330,7 +351,7 @@ "name": "Category Chips", "type": "FRAME", "x": 24, - "y": 276, + "y": 280, "width": 1132, "height": 24, "layout": { @@ -493,7 +514,7 @@ "name": "Modpacks Grid", "type": "FRAME", "x": 24, - "y": 316, + "y": 320, "width": 1132, "height": 220, "layout": { @@ -614,7 +635,7 @@ "type": "FRAME", "x": 64, "y": 17, - "width": 412, + "width": 404, "height": 34, "layout": { "mode": "VERTICAL", @@ -658,9 +679,9 @@ "id": "1:1156", "name": "Btn Install", "type": "INSTANCE", - "x": 488, + "x": 480, "y": 18, - "width": 58, + "width": 66, "height": 32, "component": "Gameplane/Button/Small/Default", "componentId": "1:709", @@ -673,7 +694,7 @@ "counter": "CENTER", "sizing": ["HUG", "HUG"] }, - "texts": ["Install"] + "texts": ["Install…"] } ] }, @@ -767,7 +788,7 @@ "type": "FRAME", "x": 64, "y": 17, - "width": 412, + "width": 404, "height": 34, "layout": { "mode": "VERTICAL", @@ -811,9 +832,9 @@ "id": "1:1163", "name": "Btn Install", "type": "INSTANCE", - "x": 488, + "x": 480, "y": 18, - "width": 58, + "width": 66, "height": 32, "component": "Gameplane/Button/Small/Default", "componentId": "1:709", @@ -826,7 +847,7 @@ "counter": "CENTER", "sizing": ["HUG", "HUG"] }, - "texts": ["Install"] + "texts": ["Install…"] } ] } @@ -940,7 +961,7 @@ "type": "FRAME", "x": 64, "y": 17, - "width": 412, + "width": 404, "height": 34, "layout": { "mode": "VERTICAL", @@ -984,9 +1005,9 @@ "id": "1:1171", "name": "Btn Install", "type": "INSTANCE", - "x": 488, + "x": 480, "y": 18, - "width": 58, + "width": 66, "height": 32, "component": "Gameplane/Button/Small/Default", "componentId": "1:709", @@ -999,7 +1020,7 @@ "counter": "CENTER", "sizing": ["HUG", "HUG"] }, - "texts": ["Install"] + "texts": ["Install…"] } ] }, @@ -1093,7 +1114,7 @@ "type": "FRAME", "x": 64, "y": 17, - "width": 412, + "width": 404, "height": 34, "layout": { "mode": "VERTICAL", @@ -1137,9 +1158,9 @@ "id": "1:1178", "name": "Btn Install", "type": "INSTANCE", - "x": 488, + "x": 480, "y": 18, - "width": 58, + "width": 66, "height": 32, "component": "Gameplane/Button/Small/Default", "componentId": "1:709", @@ -1152,7 +1173,7 @@ "counter": "CENTER", "sizing": ["HUG", "HUG"] }, - "texts": ["Install"] + "texts": ["Install…"] } ] } @@ -1266,7 +1287,7 @@ "type": "FRAME", "x": 64, "y": 17, - "width": 412, + "width": 404, "height": 34, "layout": { "mode": "VERTICAL", @@ -1310,9 +1331,9 @@ "id": "1:1186", "name": "Btn Install", "type": "INSTANCE", - "x": 488, + "x": 480, "y": 18, - "width": 58, + "width": 66, "height": 32, "component": "Gameplane/Button/Small/Default", "componentId": "1:709", @@ -1325,7 +1346,7 @@ "counter": "CENTER", "sizing": ["HUG", "HUG"] }, - "texts": ["Install"] + "texts": ["Install…"] } ] }, @@ -1419,7 +1440,7 @@ "type": "FRAME", "x": 64, "y": 17, - "width": 412, + "width": 404, "height": 34, "layout": { "mode": "VERTICAL", @@ -1463,9 +1484,9 @@ "id": "1:1193", "name": "Btn Install", "type": "INSTANCE", - "x": 488, + "x": 480, "y": 18, - "width": 58, + "width": 66, "height": 32, "component": "Gameplane/Button/Small/Default", "componentId": "1:709", @@ -1478,7 +1499,7 @@ "counter": "CENTER", "sizing": ["HUG", "HUG"] }, - "texts": ["Install"] + "texts": ["Install…"] } ] } @@ -1491,7 +1512,7 @@ "name": "Load More Row", "type": "FRAME", "x": 24, - "y": 552, + "y": 556, "width": 1132, "height": 32, "layout": { diff --git a/assets/design-export/json/tr6cE.json b/assets/design-export/json/tr6cE.json index 2ce19b618..b3d820c28 100644 --- a/assets/design-export/json/tr6cE.json +++ b/assets/design-export/json/tr6cE.json @@ -4,7 +4,7 @@ "name": "Screen/Share links — Create link (No expiry)", "type": "FRAME", "x": 3280, - "y": 53350, + "y": 53608, "width": 480, "height": 322, "fills": [{"type": "SOLID", "color": "#FFF7FB"}], diff --git a/assets/design-export/json/uCA23.json b/assets/design-export/json/uCA23.json index d02b93c2d..827893358 100644 --- a/assets/design-export/json/uCA23.json +++ b/assets/design-export/json/uCA23.json @@ -4,7 +4,7 @@ "name": "Screen/Server Detail — Settings · General", "type": "FRAME", "x": 1640, - "y": 38170, + "y": 38428, "width": 1440, "height": 900, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/uMiwd.json b/assets/design-export/json/uMiwd.json index b2b24c3e8..0cf50ae76 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": 78522, + "y": 78780, "width": 1440, "height": 1636, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/ugDSa.json b/assets/design-export/json/ugDSa.json index 52399165f..8ef261ddb 100644 --- a/assets/design-export/json/ugDSa.json +++ b/assets/design-export/json/ugDSa.json @@ -4,7 +4,7 @@ "name": "Screen/Server Detail — Settings · Environment", "type": "FRAME", "x": 0, - "y": 44830, + "y": 45088, "width": 1440, "height": 900, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/uoxQW.json b/assets/design-export/json/uoxQW.json index 82712a02d..e396044c2 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": 87496, + "y": 87754, "width": 1440, "height": 900, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/vtExV.json b/assets/design-export/json/vtExV.json index 8afebda7b..4ff482cd8 100644 --- a/assets/design-export/json/vtExV.json +++ b/assets/design-export/json/vtExV.json @@ -4,7 +4,7 @@ "name": "Screen/Backups — Schedules (Empty)", "type": "FRAME", "x": 1640, - "y": 61082, + "y": 61340, "width": 1440, "height": 1150, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/w1QYmf.json b/assets/design-export/json/w1QYmf.json index 26479f133..6a2312470 100644 --- a/assets/design-export/json/w1QYmf.json +++ b/assets/design-export/json/w1QYmf.json @@ -4,7 +4,7 @@ "name": "States/Remote Capture — Access and capability", "type": "FRAME", "x": 11480, - "y": 36870, + "y": 37128, "width": 1160, "height": 559, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/wqnM9.json b/assets/design-export/json/wqnM9.json index baa84a238..5d1b1780b 100644 --- a/assets/design-export/json/wqnM9.json +++ b/assets/design-export/json/wqnM9.json @@ -4,7 +4,7 @@ "name": "Screen/Cluster Details — Overview", "type": "FRAME", "x": 13120, - "y": 63932, + "y": 64190, "width": 1440, "height": 900, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/wxINm.json b/assets/design-export/json/wxINm.json index e1cc759c2..3ff9f1473 100644 --- a/assets/design-export/json/wxINm.json +++ b/assets/design-export/json/wxINm.json @@ -4,7 +4,7 @@ "name": "Screen/Server Detail — Settings · Game configuration (Read-only)", "type": "FRAME", "x": 3280, - "y": 40770, + "y": 41028, "width": 1440, "height": 900, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/xCJlu.json b/assets/design-export/json/xCJlu.json index e9fcc7cc5..e853877c2 100644 --- a/assets/design-export/json/xCJlu.json +++ b/assets/design-export/json/xCJlu.json @@ -4,7 +4,7 @@ "name": "Screen/Server Detail — Settings · Share links", "type": "FRAME", "x": 0, - "y": 53350, + "y": 53608, "width": 1440, "height": 900, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/xvlB6.json b/assets/design-export/json/xvlB6.json index 34187b045..e76eabef5 100644 --- a/assets/design-export/json/xvlB6.json +++ b/assets/design-export/json/xvlB6.json @@ -4,7 +4,7 @@ "name": "Screen/Server Detail — Capture (Running)", "type": "FRAME", "x": 3280, - "y": 36870, + "y": 37128, "width": 1440, "height": 900, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/y3YcQ.json b/assets/design-export/json/y3YcQ.json index ce08e35b4..aabf610b2 100644 --- a/assets/design-export/json/y3YcQ.json +++ b/assets/design-export/json/y3YcQ.json @@ -4,7 +4,7 @@ "name": "Server Detail · Settings · Networking · Credentials entering", "type": "FRAME", "x": 6560, - "y": 43530, + "y": 43788, "width": 1440, "height": 900, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/yrxK2.json b/assets/design-export/json/yrxK2.json index 2a33189f8..4754829e0 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": 87496, + "y": 87754, "width": 1440, "height": 1031, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/zM0VF.json b/assets/design-export/json/zM0VF.json index 23f1c8785..6db1d0009 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": 90228, + "y": 90486, "width": 1440, "height": 900, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/zqzr4.json b/assets/design-export/json/zqzr4.json index 5b5fbc141..f9068d003 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": 78522, + "y": 78780, "width": 1440, "height": 2488, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/screens.json b/assets/design-export/screens.json index 7c1d15b1d..46458d702 100644 --- a/assets/design-export/screens.json +++ b/assets/design-export/screens.json @@ -1321,5 +1321,96 @@ "name": "Users & RBAC — Return to SSO control dialogs", "width": 1040, "height": 721 + }, + { + "file": "1274632774-130", + "figId": "1274632774:130", + "name": "Screen/Server Detail — Modpacks (Active pack)", + "width": 1440, + "height": 900 + }, + { + "file": "1274632774-470", + "figId": "1274632774:470", + "name": "Screen/Server Detail — Modpacks — Choose version", + "width": 1440, + "height": 900 + }, + { + "file": "1274632774-907", + "figId": "1274632774:907", + "name": "Screen/Server Detail — Modpacks — Confirm install", + "width": 1440, + "height": 900 + }, + { + "file": "1274632774-1258", + "figId": "1274632774:1258", + "name": "Screen/Server Detail — Modpacks — Change version", + "width": 1440, + "height": 900 + }, + { + "file": "1274632774-1722", + "figId": "1274632774:1722", + "name": "Screen/Server Detail — Modpacks — Confirm downgrade", + "width": 1440, + "height": 900 + }, + { + "file": "1274632774-2112", + "figId": "1274632774:2112", + "name": "Screen/Server Detail — Modpacks — Remove", + "width": 1440, + "height": 900 + }, + { + "file": "1274632774-2492", + "figId": "1274632774:2492", + "name": "Screen/Server Detail — Modpacks (Missing files)", + "width": 1440, + "height": 1080 + }, + { + "file": "1274632774-2877", + "figId": "1274632774:2877", + "name": "Screen/Server Detail — Modpacks (Active pack, Light)", + "width": 1440, + "height": 900 + }, + { + "file": "1274632774-3217", + "figId": "1274632774:3217", + "name": "Screen/Server Detail — Modpacks (Read-only)", + "width": 1440, + "height": 900 + }, + { + "file": "1274632774-3559", + "figId": "1274632774:3559", + "name": "States/Modpacks — Active card and tab states (reference)", + "width": 2280, + "height": 1158 + }, + { + "file": "1274632774-3890", + "figId": "1274632774:3890", + "name": "Screen/Mobile — Server Detail — Modpacks", + "width": 390, + "height": 1100 + }, + { + "file": "1274632774-4001", + "figId": "1274632774:4001", + "name": "Screen/Admin Settings — Mod registries (Share CurseForge key)", + "width": 1440, + "height": 900 + }, + { + "file": "1274632774-4260", + "figId": "1274632774:4260", + "name": "Screen/Admin Settings — Mod registries (Key from startup flag)", + "width": 1440, + "height": 900 } ] diff --git a/assets/design-export/screenshots/1274632774-1258.png b/assets/design-export/screenshots/1274632774-1258.png new file mode 100644 index 000000000..5b9816cfd Binary files /dev/null and b/assets/design-export/screenshots/1274632774-1258.png differ diff --git a/assets/design-export/screenshots/1274632774-130.png b/assets/design-export/screenshots/1274632774-130.png new file mode 100644 index 000000000..fa99865b2 Binary files /dev/null and b/assets/design-export/screenshots/1274632774-130.png differ diff --git a/assets/design-export/screenshots/1274632774-1722.png b/assets/design-export/screenshots/1274632774-1722.png new file mode 100644 index 000000000..394588d26 Binary files /dev/null and b/assets/design-export/screenshots/1274632774-1722.png differ diff --git a/assets/design-export/screenshots/1274632774-2112.png b/assets/design-export/screenshots/1274632774-2112.png new file mode 100644 index 000000000..5d1459d0f Binary files /dev/null and b/assets/design-export/screenshots/1274632774-2112.png differ diff --git a/assets/design-export/screenshots/1274632774-2492.png b/assets/design-export/screenshots/1274632774-2492.png new file mode 100644 index 000000000..736a88639 Binary files /dev/null and b/assets/design-export/screenshots/1274632774-2492.png differ diff --git a/assets/design-export/screenshots/1274632774-2877.png b/assets/design-export/screenshots/1274632774-2877.png new file mode 100644 index 000000000..b1bbe2fa4 Binary files /dev/null and b/assets/design-export/screenshots/1274632774-2877.png differ diff --git a/assets/design-export/screenshots/1274632774-3217.png b/assets/design-export/screenshots/1274632774-3217.png new file mode 100644 index 000000000..8ac644548 Binary files /dev/null and b/assets/design-export/screenshots/1274632774-3217.png differ diff --git a/assets/design-export/screenshots/1274632774-3559.png b/assets/design-export/screenshots/1274632774-3559.png new file mode 100644 index 000000000..55d3a5f5f Binary files /dev/null and b/assets/design-export/screenshots/1274632774-3559.png differ diff --git a/assets/design-export/screenshots/1274632774-3890.png b/assets/design-export/screenshots/1274632774-3890.png new file mode 100644 index 000000000..9c029a65c Binary files /dev/null and b/assets/design-export/screenshots/1274632774-3890.png differ diff --git a/assets/design-export/screenshots/1274632774-4001.png b/assets/design-export/screenshots/1274632774-4001.png new file mode 100644 index 000000000..b448667fb Binary files /dev/null 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 new file mode 100644 index 000000000..0d8898320 Binary files /dev/null and b/assets/design-export/screenshots/1274632774-4260.png differ diff --git a/assets/design-export/screenshots/1274632774-470.png b/assets/design-export/screenshots/1274632774-470.png new file mode 100644 index 000000000..1cea91026 Binary files /dev/null and b/assets/design-export/screenshots/1274632774-470.png differ diff --git a/assets/design-export/screenshots/1274632774-907.png b/assets/design-export/screenshots/1274632774-907.png new file mode 100644 index 000000000..041172a58 Binary files /dev/null and b/assets/design-export/screenshots/1274632774-907.png differ diff --git a/assets/design-export/screenshots/tY6RD.png b/assets/design-export/screenshots/tY6RD.png index a010e558d..0c6ae95ad 100644 Binary files a/assets/design-export/screenshots/tY6RD.png and b/assets/design-export/screenshots/tY6RD.png differ diff --git a/changelog/unreleased/1055-curseforge-ftb-modpacks.md b/changelog/unreleased/1055-curseforge-ftb-modpacks.md new file mode 100644 index 000000000..992feed67 --- /dev/null +++ b/changelog/unreleased/1055-curseforge-ftb-modpacks.md @@ -0,0 +1,5 @@ +# CurseForge and FTB modpacks with pinned versions + +The server's Modpacks tab can now install, pin and remove modpacks from Modrinth, CurseForge and Feed The Beast (FTB), each pinned to a chosen version so a restart never upgrades a pack by surprise. The operator applies a pack recorded in the new `GameServer.spec.modpack` field, with an optional backup first; removing a pack empties the mods folder and keeps the world. Packs with files CurseForge blocks from automatic download are listed with links and the `downloads/` path to upload them to. Servers already running an unpinned Modrinth pack are pinned to their installed version at the next quiet moment (no players online), with one restart. Admins can switch on sharing the CurseForge key with servers on images without a built-in key in Admin settings, under Mod registries; see [the residual risk](../../docs/security.md#sharing-the-curseforge-key-with-game-servers). Turning sharing on or off reaches a running server when it has no players online (or is stopped or asleep), because the change restarts its pod. Module authors get new template fields and the `ftb` provider, see [Modpacks](../../docs/module-authoring.md). + +API change: `POST /servers/{name}/modpack` now answers `202 Accepted` with the modpack view (phase `Pending`) instead of `200 {"ok":true}`, and answers `409` while a previous change is still in progress. [PR #1055](https://github.com/GameplanePanel/Gameplane/pull/1055) diff --git a/charts/gameplane/charts/gameplane-crds/crds/gameplane.local_backups.yaml b/charts/gameplane/charts/gameplane-crds/crds/gameplane.local_backups.yaml index 13a80d58b..548b42eb7 100644 --- a/charts/gameplane/charts/gameplane-crds/crds/gameplane.local_backups.yaml +++ b/charts/gameplane/charts/gameplane-crds/crds/gameplane.local_backups.yaml @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - gameplane.local/crd-bundle-sha256: f46b83a4e39db8e78fa5d9374dffaffcf62f548ad8dfe14255dcdbf7fa2381ba + gameplane.local/crd-bundle-sha256: 71756d153338338b9589c840329595524591d3ef80fd7c4069ade51077609ed1 controller-gen.kubebuilder.io/version: v0.22.0 name: backups.gameplane.local spec: diff --git a/charts/gameplane/charts/gameplane-crds/crds/gameplane.local_backupschedules.yaml b/charts/gameplane/charts/gameplane-crds/crds/gameplane.local_backupschedules.yaml index cca6cae1a..c332297c1 100644 --- a/charts/gameplane/charts/gameplane-crds/crds/gameplane.local_backupschedules.yaml +++ b/charts/gameplane/charts/gameplane-crds/crds/gameplane.local_backupschedules.yaml @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - gameplane.local/crd-bundle-sha256: f46b83a4e39db8e78fa5d9374dffaffcf62f548ad8dfe14255dcdbf7fa2381ba + gameplane.local/crd-bundle-sha256: 71756d153338338b9589c840329595524591d3ef80fd7c4069ade51077609ed1 controller-gen.kubebuilder.io/version: v0.22.0 name: backupschedules.gameplane.local spec: diff --git a/charts/gameplane/charts/gameplane-crds/crds/gameplane.local_clusters.yaml b/charts/gameplane/charts/gameplane-crds/crds/gameplane.local_clusters.yaml index 40a27e0d6..fdd333d65 100644 --- a/charts/gameplane/charts/gameplane-crds/crds/gameplane.local_clusters.yaml +++ b/charts/gameplane/charts/gameplane-crds/crds/gameplane.local_clusters.yaml @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - gameplane.local/crd-bundle-sha256: f46b83a4e39db8e78fa5d9374dffaffcf62f548ad8dfe14255dcdbf7fa2381ba + gameplane.local/crd-bundle-sha256: 71756d153338338b9589c840329595524591d3ef80fd7c4069ade51077609ed1 controller-gen.kubebuilder.io/version: v0.22.0 name: clusters.gameplane.local spec: diff --git a/charts/gameplane/charts/gameplane-crds/crds/gameplane.local_gameservers.yaml b/charts/gameplane/charts/gameplane-crds/crds/gameplane.local_gameservers.yaml index 090527771..cfaf81c74 100644 --- a/charts/gameplane/charts/gameplane-crds/crds/gameplane.local_gameservers.yaml +++ b/charts/gameplane/charts/gameplane-crds/crds/gameplane.local_gameservers.yaml @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - gameplane.local/crd-bundle-sha256: f46b83a4e39db8e78fa5d9374dffaffcf62f548ad8dfe14255dcdbf7fa2381ba + gameplane.local/crd-bundle-sha256: 71756d153338338b9589c840329595524591d3ef80fd7c4069ade51077609ed1 controller-gen.kubebuilder.io/version: v0.22.0 name: gameservers.gameplane.local spec: @@ -1308,6 +1308,60 @@ spec: resolved from Version). Useful for pinning a specific build or running a fork. type: string + modpack: + description: |- + Modpack is the modpack this server runs. Absent means no pack. The + operator renders the pack's env from this field (it never lives in + spec.env) and applies changes through status.modpack. Remove deletes + this field and sets the gameplane.local/modpack-remove annotation. + properties: + backupFirst: + description: |- + BackupFirst asks for a backup before the change is applied. Honoured + only when the server has a backup destination. + type: boolean + project: + description: Project is the pack's slug (Modrinth, CurseForge) + or numeric id (FTB). + maxLength: 128 + minLength: 1 + pattern: ^[A-Za-z0-9._-]+$ + type: string + provider: + description: |- + Provider names the registry (a provider of the template's registry + list that declares modpacks), e.g. "modrinth", "curseforge", "ftb". + The operator renders nothing for a provider the template does not + declare with modpacks. + maxLength: 32 + minLength: 1 + pattern: ^[a-z0-9-]+$ + type: string + requestId: + description: RequestID is a fresh id the API sets on every install + request, so a retry of the same choice (for example after BackupFailed) + is a new change. + type: string + title: + description: Title is the pack's display name; display only. + maxLength: 128 + type: string + version: + description: |- + Version is the pinned pack version id. Empty only for adopted packs + whose installed version could not be read ("Not pinned"). + maxLength: 64 + pattern: ^[A-Za-z0-9._-]*$ + type: string + versionName: + description: VersionName is the version's display name; display + only. + maxLength: 128 + type: string + required: + - project + - provider + type: object mods: description: |- Mods pins the mods this server loads, for games whose server downloads @@ -2707,6 +2761,129 @@ spec: successful backup of this server. format: date-time type: string + modpack: + description: |- + Modpack reports the progress and result of spec.modpack changes. + Missing-download files are not stored here; the API reads them live. + properties: + applied: + description: Applied is the pack the pod renders now; nil when + none. + properties: + project: + description: Project is the pack's slug (Modrinth, CurseForge) + or numeric id (FTB). + maxLength: 128 + minLength: 1 + pattern: ^[A-Za-z0-9._-]+$ + type: string + provider: + description: |- + Provider names the registry (a provider of the template's registry + list that declares modpacks), e.g. "modrinth", "curseforge", "ftb". + The operator renders nothing for a provider the template does not + declare with modpacks. + maxLength: 32 + minLength: 1 + pattern: ^[a-z0-9-]+$ + type: string + title: + description: Title is the pack's display name; display only. + maxLength: 128 + type: string + version: + description: |- + Version is the pinned pack version id. Empty only for adopted packs + whose installed version could not be read ("Not pinned"). + maxLength: 64 + pattern: ^[A-Za-z0-9._-]*$ + type: string + versionName: + description: VersionName is the version's display name; display + only. + maxLength: 128 + type: string + required: + - project + - provider + type: object + backupName: + description: BackupName is the Backup created for this change. + type: string + keyShared: + description: |- + KeyShared reports the game container currently gets a shared CurseForge + key from the server-owned Secret through the template's apiKeyEnv + (valueFrom.secretKeyRef). + type: boolean + message: + description: Message is a human-readable reason for BackupFailed. + maxLength: 512 + type: string + observedGeneration: + description: ObservedGeneration is the generation of the last + change handled. + format: int64 + type: integer + phase: + description: Phase is the progress of the current change. + enum: + - Pending + - BackingUp + - Applying + - Applied + - BackupFailed + type: string + requestId: + description: |- + RequestID is the install or removal request id the in-flight change + started from. + type: string + target: + description: |- + Target is the spec.modpack the in-flight change (BackingUp or + BackupFailed) started from; nil for a removal. A change is superseded + when spec.modpack or the request id no longer match it, not when the + generation moves. + properties: + project: + description: Project is the pack's slug (Modrinth, CurseForge) + or numeric id (FTB). + maxLength: 128 + minLength: 1 + pattern: ^[A-Za-z0-9._-]+$ + type: string + provider: + description: |- + Provider names the registry (a provider of the template's registry + list that declares modpacks), e.g. "modrinth", "curseforge", "ftb". + The operator renders nothing for a provider the template does not + declare with modpacks. + maxLength: 32 + minLength: 1 + pattern: ^[a-z0-9-]+$ + type: string + title: + description: Title is the pack's display name; display only. + maxLength: 128 + type: string + version: + description: |- + Version is the pinned pack version id. Empty only for adopted packs + whose installed version could not be read ("Not pinned"). + maxLength: 64 + pattern: ^[A-Za-z0-9._-]*$ + type: string + versionName: + description: VersionName is the version's display name; display + only. + maxLength: 128 + type: string + required: + - project + - provider + type: object + type: object observedGeneration: format: int64 type: integer diff --git a/charts/gameplane/charts/gameplane-crds/crds/gameplane.local_gametemplates.yaml b/charts/gameplane/charts/gameplane-crds/crds/gameplane.local_gametemplates.yaml index 3824f74f5..3ea1ae809 100644 --- a/charts/gameplane/charts/gameplane-crds/crds/gameplane.local_gametemplates.yaml +++ b/charts/gameplane/charts/gameplane-crds/crds/gameplane.local_gametemplates.yaml @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - gameplane.local/crd-bundle-sha256: f46b83a4e39db8e78fa5d9374dffaffcf62f548ad8dfe14255dcdbf7fa2381ba + gameplane.local/crd-bundle-sha256: 71756d153338338b9589c840329595524591d3ef80fd7c4069ade51077609ed1 controller-gen.kubebuilder.io/version: v0.22.0 name: gametemplates.gameplane.local spec: @@ -573,6 +573,41 @@ spec: image's collection-id variable (e.g. "WORKSHOP_COLLECTION") since steamcmd resolves a collection's members itself inside the container. properties: + adoptVersionFile: + description: |- + AdoptVersionFile says where the image records the installed pack + version, so legacy unpinned packs can be adopted with their version. + properties: + field: + description: Field is the top-level JSON + field holding the version (e.g. "versionId"). + maxLength: 64 + minLength: 1 + type: string + path: + description: |- + Path is the JSON file, relative to the data mount + (e.g. ".modrinth-modpack-manifest.json"). + maxLength: 128 + minLength: 1 + type: string + x-kubernetes-validations: + - message: path must be relative to the + data mount and must not contain '..' + rule: '!self.startsWith(''/'') && !self.contains(''..'')' + required: + - field + - path + type: object + apiKeyEnv: + description: |- + APIKeyEnv is the game-image env that receives the shared CurseForge + API key (e.g. "CF_API_KEY") through a secretKeyRef to a server-owned + Secret, while the admin has key sharing on. Only valid when the + provider is curseforge. + maxLength: 64 + pattern: ^[A-Za-z_][A-Za-z0-9_]*$ + type: string env: description: |- Env are additional fixed env applied alongside RefEnv when a modpack @@ -745,6 +780,27 @@ spec: type: object maxItems: 16 type: array + missingFilesPath: + description: |- + MissingFilesPath is the file, relative to the data mount, where the + image lists files that need a manual download + (e.g. "MODS_NEED_DOWNLOAD.txt"). + maxLength: 128 + type: string + x-kubernetes-validations: + - message: missingFilesPath must be relative + to the data mount and must not contain '..' + rule: '!self.startsWith(''/'') && !self.contains(''..'')' + needsKeyImageTags: + description: |- + NeedsKeyImageTags lists image tags (the part after ":" and before "@") + that have no built-in CurseForge key. Servers on these images get this + provider only while key sharing is on. + items: + maxLength: 64 + type: string + maxItems: 8 + type: array refEnv: description: |- RefEnv, when set, is the game-image env the operator points at the @@ -755,7 +811,22 @@ spec: Thunderstore/BepInEx pack). maxLength: 64 type: string + versionEnv: + description: |- + VersionEnv is the game-image env the operator sets to the pinned pack + version id (e.g. "MODRINTH_VERSION", "CF_FILE_ID", + "FTB_MODPACK_VERSION_ID"). Required for env-mode packs that support + pinning; when empty the registry is not offered for pinned install. + maxLength: 64 + pattern: ^[A-Za-z_][A-Za-z0-9_]*$ + type: string type: object + modpacksOnly: + description: |- + ModpacksOnly hides this provider from the Mods tab: it is offered only + in the Modpacks tab (e.g. "ftb", whose registry has packs but no + single-mod listing). Requires Modpacks to be set to be useful. + type: boolean provider: description: |- Provider names the built-in registry engine: "modrinth" (Minecraft @@ -773,7 +844,8 @@ spec: "spigot" (SpigotMC plugins via the Spiget API, keyless), "github" (one repository's Releases stand in for versions, keyless but rate-limited — see GitHub), or "umod" (Rust/Hurtworld/7 Days to - Die's Oxide/uMod plugin ecosystem, keyless). + Die's Oxide/uMod plugin ecosystem, keyless), or "ftb" (Feed The Beast + modpacks, keyless, modpack-only: it has no single-mod browse). enum: - modrinth - thunderstore @@ -785,6 +857,7 @@ spec: - github - umod - nexus + - ftb type: string steamAppID: description: |- @@ -808,6 +881,10 @@ spec: is curseforge rule: self.provider != 'curseforge' || (has(self.curseforgeGameID) && self.curseforgeGameID > 0) + - message: modpacks.apiKeyEnv is only valid when provider + is curseforge + rule: '!has(self.modpacks) || !has(self.modpacks.apiKeyEnv) + || self.provider == ''curseforge''' maxItems: 8 minItems: 1 type: array diff --git a/charts/gameplane/charts/gameplane-crds/crds/gameplane.local_modules.yaml b/charts/gameplane/charts/gameplane-crds/crds/gameplane.local_modules.yaml index 276765692..b224e0c9b 100644 --- a/charts/gameplane/charts/gameplane-crds/crds/gameplane.local_modules.yaml +++ b/charts/gameplane/charts/gameplane-crds/crds/gameplane.local_modules.yaml @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - gameplane.local/crd-bundle-sha256: f46b83a4e39db8e78fa5d9374dffaffcf62f548ad8dfe14255dcdbf7fa2381ba + gameplane.local/crd-bundle-sha256: 71756d153338338b9589c840329595524591d3ef80fd7c4069ade51077609ed1 controller-gen.kubebuilder.io/version: v0.22.0 name: modules.gameplane.local spec: diff --git a/charts/gameplane/charts/gameplane-crds/crds/gameplane.local_modulesources.yaml b/charts/gameplane/charts/gameplane-crds/crds/gameplane.local_modulesources.yaml index 6e9903b21..e81733ef1 100644 --- a/charts/gameplane/charts/gameplane-crds/crds/gameplane.local_modulesources.yaml +++ b/charts/gameplane/charts/gameplane-crds/crds/gameplane.local_modulesources.yaml @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - gameplane.local/crd-bundle-sha256: f46b83a4e39db8e78fa5d9374dffaffcf62f548ad8dfe14255dcdbf7fa2381ba + gameplane.local/crd-bundle-sha256: 71756d153338338b9589c840329595524591d3ef80fd7c4069ade51077609ed1 controller-gen.kubebuilder.io/version: v0.22.0 name: modulesources.gameplane.local spec: diff --git a/charts/gameplane/charts/gameplane-crds/crds/gameplane.local_networkcaptures.yaml b/charts/gameplane/charts/gameplane-crds/crds/gameplane.local_networkcaptures.yaml index a1b3cb641..50753e1bc 100644 --- a/charts/gameplane/charts/gameplane-crds/crds/gameplane.local_networkcaptures.yaml +++ b/charts/gameplane/charts/gameplane-crds/crds/gameplane.local_networkcaptures.yaml @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - gameplane.local/crd-bundle-sha256: f46b83a4e39db8e78fa5d9374dffaffcf62f548ad8dfe14255dcdbf7fa2381ba + gameplane.local/crd-bundle-sha256: 71756d153338338b9589c840329595524591d3ef80fd7c4069ade51077609ed1 controller-gen.kubebuilder.io/version: v0.22.0 name: networkcaptures.gameplane.local spec: diff --git a/charts/gameplane/charts/gameplane-crds/crds/gameplane.local_restores.yaml b/charts/gameplane/charts/gameplane-crds/crds/gameplane.local_restores.yaml index 0a6661683..32c1b2609 100644 --- a/charts/gameplane/charts/gameplane-crds/crds/gameplane.local_restores.yaml +++ b/charts/gameplane/charts/gameplane-crds/crds/gameplane.local_restores.yaml @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - gameplane.local/crd-bundle-sha256: f46b83a4e39db8e78fa5d9374dffaffcf62f548ad8dfe14255dcdbf7fa2381ba + gameplane.local/crd-bundle-sha256: 71756d153338338b9589c840329595524591d3ef80fd7c4069ade51077609ed1 controller-gen.kubebuilder.io/version: v0.22.0 name: restores.gameplane.local spec: diff --git a/charts/gameplane/crd-manifests/gameplane.local_backups.yaml b/charts/gameplane/crd-manifests/gameplane.local_backups.yaml index 13a80d58b..548b42eb7 100644 --- a/charts/gameplane/crd-manifests/gameplane.local_backups.yaml +++ b/charts/gameplane/crd-manifests/gameplane.local_backups.yaml @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - gameplane.local/crd-bundle-sha256: f46b83a4e39db8e78fa5d9374dffaffcf62f548ad8dfe14255dcdbf7fa2381ba + gameplane.local/crd-bundle-sha256: 71756d153338338b9589c840329595524591d3ef80fd7c4069ade51077609ed1 controller-gen.kubebuilder.io/version: v0.22.0 name: backups.gameplane.local spec: diff --git a/charts/gameplane/crd-manifests/gameplane.local_backupschedules.yaml b/charts/gameplane/crd-manifests/gameplane.local_backupschedules.yaml index cca6cae1a..c332297c1 100644 --- a/charts/gameplane/crd-manifests/gameplane.local_backupschedules.yaml +++ b/charts/gameplane/crd-manifests/gameplane.local_backupschedules.yaml @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - gameplane.local/crd-bundle-sha256: f46b83a4e39db8e78fa5d9374dffaffcf62f548ad8dfe14255dcdbf7fa2381ba + gameplane.local/crd-bundle-sha256: 71756d153338338b9589c840329595524591d3ef80fd7c4069ade51077609ed1 controller-gen.kubebuilder.io/version: v0.22.0 name: backupschedules.gameplane.local spec: diff --git a/charts/gameplane/crd-manifests/gameplane.local_clusters.yaml b/charts/gameplane/crd-manifests/gameplane.local_clusters.yaml index 40a27e0d6..fdd333d65 100644 --- a/charts/gameplane/crd-manifests/gameplane.local_clusters.yaml +++ b/charts/gameplane/crd-manifests/gameplane.local_clusters.yaml @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - gameplane.local/crd-bundle-sha256: f46b83a4e39db8e78fa5d9374dffaffcf62f548ad8dfe14255dcdbf7fa2381ba + gameplane.local/crd-bundle-sha256: 71756d153338338b9589c840329595524591d3ef80fd7c4069ade51077609ed1 controller-gen.kubebuilder.io/version: v0.22.0 name: clusters.gameplane.local spec: diff --git a/charts/gameplane/crd-manifests/gameplane.local_gameservers.yaml b/charts/gameplane/crd-manifests/gameplane.local_gameservers.yaml index 090527771..cfaf81c74 100644 --- a/charts/gameplane/crd-manifests/gameplane.local_gameservers.yaml +++ b/charts/gameplane/crd-manifests/gameplane.local_gameservers.yaml @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - gameplane.local/crd-bundle-sha256: f46b83a4e39db8e78fa5d9374dffaffcf62f548ad8dfe14255dcdbf7fa2381ba + gameplane.local/crd-bundle-sha256: 71756d153338338b9589c840329595524591d3ef80fd7c4069ade51077609ed1 controller-gen.kubebuilder.io/version: v0.22.0 name: gameservers.gameplane.local spec: @@ -1308,6 +1308,60 @@ spec: resolved from Version). Useful for pinning a specific build or running a fork. type: string + modpack: + description: |- + Modpack is the modpack this server runs. Absent means no pack. The + operator renders the pack's env from this field (it never lives in + spec.env) and applies changes through status.modpack. Remove deletes + this field and sets the gameplane.local/modpack-remove annotation. + properties: + backupFirst: + description: |- + BackupFirst asks for a backup before the change is applied. Honoured + only when the server has a backup destination. + type: boolean + project: + description: Project is the pack's slug (Modrinth, CurseForge) + or numeric id (FTB). + maxLength: 128 + minLength: 1 + pattern: ^[A-Za-z0-9._-]+$ + type: string + provider: + description: |- + Provider names the registry (a provider of the template's registry + list that declares modpacks), e.g. "modrinth", "curseforge", "ftb". + The operator renders nothing for a provider the template does not + declare with modpacks. + maxLength: 32 + minLength: 1 + pattern: ^[a-z0-9-]+$ + type: string + requestId: + description: RequestID is a fresh id the API sets on every install + request, so a retry of the same choice (for example after BackupFailed) + is a new change. + type: string + title: + description: Title is the pack's display name; display only. + maxLength: 128 + type: string + version: + description: |- + Version is the pinned pack version id. Empty only for adopted packs + whose installed version could not be read ("Not pinned"). + maxLength: 64 + pattern: ^[A-Za-z0-9._-]*$ + type: string + versionName: + description: VersionName is the version's display name; display + only. + maxLength: 128 + type: string + required: + - project + - provider + type: object mods: description: |- Mods pins the mods this server loads, for games whose server downloads @@ -2707,6 +2761,129 @@ spec: successful backup of this server. format: date-time type: string + modpack: + description: |- + Modpack reports the progress and result of spec.modpack changes. + Missing-download files are not stored here; the API reads them live. + properties: + applied: + description: Applied is the pack the pod renders now; nil when + none. + properties: + project: + description: Project is the pack's slug (Modrinth, CurseForge) + or numeric id (FTB). + maxLength: 128 + minLength: 1 + pattern: ^[A-Za-z0-9._-]+$ + type: string + provider: + description: |- + Provider names the registry (a provider of the template's registry + list that declares modpacks), e.g. "modrinth", "curseforge", "ftb". + The operator renders nothing for a provider the template does not + declare with modpacks. + maxLength: 32 + minLength: 1 + pattern: ^[a-z0-9-]+$ + type: string + title: + description: Title is the pack's display name; display only. + maxLength: 128 + type: string + version: + description: |- + Version is the pinned pack version id. Empty only for adopted packs + whose installed version could not be read ("Not pinned"). + maxLength: 64 + pattern: ^[A-Za-z0-9._-]*$ + type: string + versionName: + description: VersionName is the version's display name; display + only. + maxLength: 128 + type: string + required: + - project + - provider + type: object + backupName: + description: BackupName is the Backup created for this change. + type: string + keyShared: + description: |- + KeyShared reports the game container currently gets a shared CurseForge + key from the server-owned Secret through the template's apiKeyEnv + (valueFrom.secretKeyRef). + type: boolean + message: + description: Message is a human-readable reason for BackupFailed. + maxLength: 512 + type: string + observedGeneration: + description: ObservedGeneration is the generation of the last + change handled. + format: int64 + type: integer + phase: + description: Phase is the progress of the current change. + enum: + - Pending + - BackingUp + - Applying + - Applied + - BackupFailed + type: string + requestId: + description: |- + RequestID is the install or removal request id the in-flight change + started from. + type: string + target: + description: |- + Target is the spec.modpack the in-flight change (BackingUp or + BackupFailed) started from; nil for a removal. A change is superseded + when spec.modpack or the request id no longer match it, not when the + generation moves. + properties: + project: + description: Project is the pack's slug (Modrinth, CurseForge) + or numeric id (FTB). + maxLength: 128 + minLength: 1 + pattern: ^[A-Za-z0-9._-]+$ + type: string + provider: + description: |- + Provider names the registry (a provider of the template's registry + list that declares modpacks), e.g. "modrinth", "curseforge", "ftb". + The operator renders nothing for a provider the template does not + declare with modpacks. + maxLength: 32 + minLength: 1 + pattern: ^[a-z0-9-]+$ + type: string + title: + description: Title is the pack's display name; display only. + maxLength: 128 + type: string + version: + description: |- + Version is the pinned pack version id. Empty only for adopted packs + whose installed version could not be read ("Not pinned"). + maxLength: 64 + pattern: ^[A-Za-z0-9._-]*$ + type: string + versionName: + description: VersionName is the version's display name; display + only. + maxLength: 128 + type: string + required: + - project + - provider + type: object + type: object observedGeneration: format: int64 type: integer diff --git a/charts/gameplane/crd-manifests/gameplane.local_gametemplates.yaml b/charts/gameplane/crd-manifests/gameplane.local_gametemplates.yaml index 3824f74f5..3ea1ae809 100644 --- a/charts/gameplane/crd-manifests/gameplane.local_gametemplates.yaml +++ b/charts/gameplane/crd-manifests/gameplane.local_gametemplates.yaml @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - gameplane.local/crd-bundle-sha256: f46b83a4e39db8e78fa5d9374dffaffcf62f548ad8dfe14255dcdbf7fa2381ba + gameplane.local/crd-bundle-sha256: 71756d153338338b9589c840329595524591d3ef80fd7c4069ade51077609ed1 controller-gen.kubebuilder.io/version: v0.22.0 name: gametemplates.gameplane.local spec: @@ -573,6 +573,41 @@ spec: image's collection-id variable (e.g. "WORKSHOP_COLLECTION") since steamcmd resolves a collection's members itself inside the container. properties: + adoptVersionFile: + description: |- + AdoptVersionFile says where the image records the installed pack + version, so legacy unpinned packs can be adopted with their version. + properties: + field: + description: Field is the top-level JSON + field holding the version (e.g. "versionId"). + maxLength: 64 + minLength: 1 + type: string + path: + description: |- + Path is the JSON file, relative to the data mount + (e.g. ".modrinth-modpack-manifest.json"). + maxLength: 128 + minLength: 1 + type: string + x-kubernetes-validations: + - message: path must be relative to the + data mount and must not contain '..' + rule: '!self.startsWith(''/'') && !self.contains(''..'')' + required: + - field + - path + type: object + apiKeyEnv: + description: |- + APIKeyEnv is the game-image env that receives the shared CurseForge + API key (e.g. "CF_API_KEY") through a secretKeyRef to a server-owned + Secret, while the admin has key sharing on. Only valid when the + provider is curseforge. + maxLength: 64 + pattern: ^[A-Za-z_][A-Za-z0-9_]*$ + type: string env: description: |- Env are additional fixed env applied alongside RefEnv when a modpack @@ -745,6 +780,27 @@ spec: type: object maxItems: 16 type: array + missingFilesPath: + description: |- + MissingFilesPath is the file, relative to the data mount, where the + image lists files that need a manual download + (e.g. "MODS_NEED_DOWNLOAD.txt"). + maxLength: 128 + type: string + x-kubernetes-validations: + - message: missingFilesPath must be relative + to the data mount and must not contain '..' + rule: '!self.startsWith(''/'') && !self.contains(''..'')' + needsKeyImageTags: + description: |- + NeedsKeyImageTags lists image tags (the part after ":" and before "@") + that have no built-in CurseForge key. Servers on these images get this + provider only while key sharing is on. + items: + maxLength: 64 + type: string + maxItems: 8 + type: array refEnv: description: |- RefEnv, when set, is the game-image env the operator points at the @@ -755,7 +811,22 @@ spec: Thunderstore/BepInEx pack). maxLength: 64 type: string + versionEnv: + description: |- + VersionEnv is the game-image env the operator sets to the pinned pack + version id (e.g. "MODRINTH_VERSION", "CF_FILE_ID", + "FTB_MODPACK_VERSION_ID"). Required for env-mode packs that support + pinning; when empty the registry is not offered for pinned install. + maxLength: 64 + pattern: ^[A-Za-z_][A-Za-z0-9_]*$ + type: string type: object + modpacksOnly: + description: |- + ModpacksOnly hides this provider from the Mods tab: it is offered only + in the Modpacks tab (e.g. "ftb", whose registry has packs but no + single-mod listing). Requires Modpacks to be set to be useful. + type: boolean provider: description: |- Provider names the built-in registry engine: "modrinth" (Minecraft @@ -773,7 +844,8 @@ spec: "spigot" (SpigotMC plugins via the Spiget API, keyless), "github" (one repository's Releases stand in for versions, keyless but rate-limited — see GitHub), or "umod" (Rust/Hurtworld/7 Days to - Die's Oxide/uMod plugin ecosystem, keyless). + Die's Oxide/uMod plugin ecosystem, keyless), or "ftb" (Feed The Beast + modpacks, keyless, modpack-only: it has no single-mod browse). enum: - modrinth - thunderstore @@ -785,6 +857,7 @@ spec: - github - umod - nexus + - ftb type: string steamAppID: description: |- @@ -808,6 +881,10 @@ spec: is curseforge rule: self.provider != 'curseforge' || (has(self.curseforgeGameID) && self.curseforgeGameID > 0) + - message: modpacks.apiKeyEnv is only valid when provider + is curseforge + rule: '!has(self.modpacks) || !has(self.modpacks.apiKeyEnv) + || self.provider == ''curseforge''' maxItems: 8 minItems: 1 type: array diff --git a/charts/gameplane/crd-manifests/gameplane.local_modules.yaml b/charts/gameplane/crd-manifests/gameplane.local_modules.yaml index 276765692..b224e0c9b 100644 --- a/charts/gameplane/crd-manifests/gameplane.local_modules.yaml +++ b/charts/gameplane/crd-manifests/gameplane.local_modules.yaml @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - gameplane.local/crd-bundle-sha256: f46b83a4e39db8e78fa5d9374dffaffcf62f548ad8dfe14255dcdbf7fa2381ba + gameplane.local/crd-bundle-sha256: 71756d153338338b9589c840329595524591d3ef80fd7c4069ade51077609ed1 controller-gen.kubebuilder.io/version: v0.22.0 name: modules.gameplane.local spec: diff --git a/charts/gameplane/crd-manifests/gameplane.local_modulesources.yaml b/charts/gameplane/crd-manifests/gameplane.local_modulesources.yaml index 6e9903b21..e81733ef1 100644 --- a/charts/gameplane/crd-manifests/gameplane.local_modulesources.yaml +++ b/charts/gameplane/crd-manifests/gameplane.local_modulesources.yaml @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - gameplane.local/crd-bundle-sha256: f46b83a4e39db8e78fa5d9374dffaffcf62f548ad8dfe14255dcdbf7fa2381ba + gameplane.local/crd-bundle-sha256: 71756d153338338b9589c840329595524591d3ef80fd7c4069ade51077609ed1 controller-gen.kubebuilder.io/version: v0.22.0 name: modulesources.gameplane.local spec: diff --git a/charts/gameplane/crd-manifests/gameplane.local_networkcaptures.yaml b/charts/gameplane/crd-manifests/gameplane.local_networkcaptures.yaml index a1b3cb641..50753e1bc 100644 --- a/charts/gameplane/crd-manifests/gameplane.local_networkcaptures.yaml +++ b/charts/gameplane/crd-manifests/gameplane.local_networkcaptures.yaml @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - gameplane.local/crd-bundle-sha256: f46b83a4e39db8e78fa5d9374dffaffcf62f548ad8dfe14255dcdbf7fa2381ba + gameplane.local/crd-bundle-sha256: 71756d153338338b9589c840329595524591d3ef80fd7c4069ade51077609ed1 controller-gen.kubebuilder.io/version: v0.22.0 name: networkcaptures.gameplane.local spec: diff --git a/charts/gameplane/crd-manifests/gameplane.local_restores.yaml b/charts/gameplane/crd-manifests/gameplane.local_restores.yaml index 0a6661683..32c1b2609 100644 --- a/charts/gameplane/crd-manifests/gameplane.local_restores.yaml +++ b/charts/gameplane/crd-manifests/gameplane.local_restores.yaml @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - gameplane.local/crd-bundle-sha256: f46b83a4e39db8e78fa5d9374dffaffcf62f548ad8dfe14255dcdbf7fa2381ba + gameplane.local/crd-bundle-sha256: 71756d153338338b9589c840329595524591d3ef80fd7c4069ade51077609ed1 controller-gen.kubebuilder.io/version: v0.22.0 name: restores.gameplane.local spec: diff --git a/charts/gameplane/templates/operator.yaml b/charts/gameplane/templates/operator.yaml index eb61d308f..6fe7a5e9e 100644 --- a/charts/gameplane/templates/operator.yaml +++ b/charts/gameplane/templates/operator.yaml @@ -244,6 +244,38 @@ subjects: namespace: {{ $.Release.Namespace }} --- {{- end }} +# Spec 035 key sharing: the operator reads exactly one managed Secret (the +# CurseForge key the API stores) in the credentials namespace, uncached via the +# API reader. resourceNames-scoped, get only, so no list/watch and no +# namespace-wide Secret access (contrast {{ .Release.Name }}-operator-secrets, +# which renders there only when nativeRBAC.remoteClusters is true). +apiVersion: rbac.authorization.k8s.io/v1 +kind: Role +metadata: + name: {{ .Release.Name }}-operator-modreg-key + namespace: {{ include "gameplane.operatorClusterCredentialsNamespace" . }} + labels: {{- include "gameplane.labels" . | nindent 4 }} +rules: + - apiGroups: [""] + resources: [secrets] + resourceNames: [gameplane-modreg-curseforge] + verbs: [get] +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: RoleBinding +metadata: + name: {{ .Release.Name }}-operator-modreg-key + namespace: {{ include "gameplane.operatorClusterCredentialsNamespace" . }} + labels: {{- include "gameplane.labels" . | nindent 4 }} +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: Role + name: {{ .Release.Name }}-operator-modreg-key +subjects: + - kind: ServiceAccount + name: gameplane-operator + namespace: {{ .Release.Namespace }} +--- apiVersion: rbac.authorization.k8s.io/v1 kind: Role metadata: diff --git a/design.fig b/design.fig index c9574717d..c0ace598f 100644 Binary files a/design.fig and b/design.fig differ diff --git a/docs/module-authoring.md b/docs/module-authoring.md index bf654cbf0..8a9ba7394 100644 --- a/docs/module-authoring.md +++ b/docs/module-authoring.md @@ -1763,6 +1763,40 @@ modes, chosen by `refEnv`: dependency mods, which install one-by-one through the normal install path (Thunderstore/BepInEx packs). +Env-mode providers can also declare these `modpacks` fields (all optional): + +| Field | Meaning | +|---|---| +| `versionEnv` | Env the operator sets to the pinned pack version id (`MODRINTH_VERSION`, `CF_FILE_ID`, `FTB_MODPACK_VERSION_ID`). Without it the registry is not offered for pinned install. Max 64 characters, env-name pattern. | +| `apiKeyEnv` | Env that receives the admin-shared CurseForge API key (for example `CF_API_KEY`) through a `secretKeyRef` to a server-owned Secret, only while the admin has "Share the CurseForge key with game servers" on. Valid only when `provider: curseforge`. This replaces the earlier draft name `apiKeyFileEnv` (file mount): the `java8` images' mc-image-helper cannot read a key file. Delivery is pending open decision OD-9 (`specs/035-curseforge-modpacks/OPEN-DECISIONS.md`), so the field is declared and its env name is reserved, but nothing sets it yet. | +| `needsKeyImageTags` | Image tags (the part after `:` and before `@`) with no built-in CurseForge key, for example `[java8-multiarch, java8]`. Servers on these images get the provider only while key sharing is on (max 8). | +| `missingFilesPath` | File relative to the data mount where the image lists files that need a manual download (`MODS_NEED_DOWNLOAD.txt`). The Modpacks tab shows its rows and tells the operator to upload the files to `downloads/`. No absolute path, no `..`. | +| `adoptVersionFile` | `{ path, field }`: JSON file and top-level field where the image records the installed pack version (`.modrinth-modpack-manifest.json`, `versionId`). Lets Gameplane adopt servers that already run an unpinned pack and pin them to that version. | + +Provider-level `modpacksOnly: true` hides the provider from the Mods tab and offers it only in Modpacks (FTB has packs but no single-mod listing). `provider: ftb` is a keyless, modpack-only registry; pair it with `modpacksOnly: true`, `refEnv: FTB_MODPACK_ID`, `versionEnv: FTB_MODPACK_VERSION_ID` and `env: [{ name: TYPE, value: FTBA }]` on the itzg image. + +The operator strips every env name declared in any provider's `modpacks` block (`refEnv`, `versionEnv`, `apiKeyEnv`, `env[].name`) from the merged env and renders only the active pack's set, so a module never needs to guard against two packs. The active pack lives in `GameServer.spec.modpack`, not `spec.env`. + +```yaml +- provider: curseforge + curseforgeGameID: 432 + modpacks: + refEnv: CF_SLUG + versionEnv: CF_FILE_ID + apiKeyEnv: CF_API_KEY + needsKeyImageTags: [java8-multiarch, java8] + missingFilesPath: MODS_NEED_DOWNLOAD.txt + env: + - { name: TYPE, value: AUTO_CURSEFORGE } + - { name: CF_DOWNLOADS_REPO, value: /data/downloads } +- provider: ftb + modpacksOnly: true + modpacks: + refEnv: FTB_MODPACK_ID + versionEnv: FTB_MODPACK_VERSION_ID + env: [{ name: TYPE, value: FTBA }] +``` + ### Probes ```yaml diff --git a/docs/security.md b/docs/security.md index 8b9e21367..7eb667f90 100644 --- a/docs/security.md +++ b/docs/security.md @@ -711,6 +711,14 @@ machinery in the `netguard/` module; its package doc explains why the two policies (`IsAllowed` vs `IsPublic`) stay separately selectable rather than being collapsed into one. +## Sharing the CurseForge key with game servers + +CurseForge modpacks on Java 17+ images use a key built into the image, so by default no CurseForge key ever reaches a game server. Images without a built-in key (the `java8` tags, Minecraft 1.16.5 and older) need the admin's key. An admin can opt in through the API (`PUT /admin/registries/curseforge/share`, `config:manage`; the dashboard switch **Share the CurseForge key with game servers** is planned and not yet built), which sets annotation `gameplane.local/share-with-game-servers` on the managed Secret `gameplane-modreg-curseforge`. Only a key stored through admin config can be shared; a key supplied only by the `--curseforge-api-key` flag cannot, and the planned dashboard switch will be disabled in that case. Server-scoped roles can neither read nor change the setting, and the key is never returned by the API or written to the audit log. + +**Residual risk.** While sharing is on, anything that runs inside the game container can read the key: every mod and plugin on a CurseForge server, and any console user who can run commands there. This is the reason sharing is off by default. Treat the shared key as exposed to all server owners and mod authors on the cluster: use a key dedicated to Gameplane, scoped and rate-limited by CurseForge, and rotate it if a server runs an untrusted mod. Turning sharing off (or deleting the admin key) removes the per-server copies, but only once each server has 0 players online (or is stopped or asleep). Until then the copy Secret and the `CF_API_KEY` env stay on every server with players online, so the key remains readable there. To revoke it at once, stop the server. + +**Delivery.** The operator keeps a server-owned copy Secret `-curseforge-key` for each game server that has sharing applied, and passes it to the game container as an env var (`apiKeyEnv`, for example `CF_API_KEY`) using `valueFrom.secretKeyRef`. The value stays out of the pod spec and `kubectl describe`, but is visible in the container's process environment, which widens the risk above to anything that can read `/proc//environ` in the container. The operator reads only the managed Secret `gameplane-modreg-curseforge`, through a get-only Role scoped by `resourceNames` to that Secret. A rotated admin key reaches the copies within about a minute. Turning sharing on or off is applied to a server when it next has 0 players online (or is stopped or asleep), and turning sharing off then removes the copy. Because the image reads the key only at start, a rotated key applies at the next restart. The earlier file-mount design (`CF_API_KEY_FILE`) is not used because the `java8` images cannot read it. + ## Notifications Notification sinks ([docs](notifications.md)) are a third outbound-dial diff --git a/i18n/locales/en/app.json b/i18n/locales/en/app.json index 6f32582a5..ec385e958 100644 --- a/i18n/locales/en/app.json +++ b/i18n/locales/en/app.json @@ -1039,6 +1039,26 @@ "defaultMessage": "token not found", "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)." }, + "server.modpack.backup_unavailable": { + "defaultMessage": "no backup destination is configured for this server", + "description": "API error from the modpack API (registry.go:installModpack, registry_modpack.go:removeModpack) when backupFirst is requested but the server has no backup destination." + }, + "server.modpack.change_in_progress": { + "defaultMessage": "a modpack change is already in progress; wait for it to finish", + "description": "API error from the modpack API (registry.go:installModpack, registry_modpack.go:removeModpack) while the previous modpack change is still pending, backing up or applying." + }, + "server.modpack.key_required": { + "defaultMessage": "this modpack registry needs the CurseForge key to be shared with game servers; ask an administrator to turn on key sharing", + "description": "API error from the modpack API (registry.go:installModpack) when the server's game image has no built-in CurseForge key and the administrator has not enabled key sharing." + }, + "server.modpack.not_found": { + "defaultMessage": "this server has no modpack", + "description": "API error from the modpack API (registry_modpack.go:removeModpack) when there is no modpack to remove." + }, + "server.modpack.version_required": { + "defaultMessage": "version is required", + "description": "API error from the modpack API (registry.go:installModpack) when a modpack is installed without choosing a version." + }, "server.namespace_forbidden": { "defaultMessage": "namespace not permitted", "description": "API error when the user's role does not cover the requested namespace." @@ -1067,6 +1087,10 @@ "defaultMessage": "apiKey is required", "description": "API error from the mod-registry credentials API (registry_secret.go:put)." }, + "server.registry.share_needs_managed_key": { + "defaultMessage": "the CurseForge key must be saved in the panel before it can be shared with game servers", + "description": "API error from the mod-registry credentials API (registry_secret.go:putShare) when key sharing is turned on but the key comes only from a startup flag, not from a saved Secret." + }, "server.remote_cluster_not_implemented": { "defaultMessage": "not implemented: no cross-cluster agent yet; this route only serves the home cluster", "description": "API response for a home-cluster-only route called with a ?cluster= value that names another cluster. No cross-cluster agent exists yet." @@ -2263,6 +2287,266 @@ "defaultMessage": "Unavailable.", "description": "Fleet scope: warning shown when a cluster cannot be queried" }, + "web.components.modpack_active_card.change_version": { + "defaultMessage": "Change version", + "description": "Modpack active card: button that opens the version picker to switch the modpack version" + }, + "web.components.modpack_active_card.chip_applied": { + "defaultMessage": "Applied", + "description": "Modpack active card: status chip when the modpack is pinned and applied" + }, + "web.components.modpack_active_card.chip_applying": { + "defaultMessage": "Applying", + "description": "Modpack active card: status chip while the modpack change is being applied" + }, + "web.components.modpack_active_card.chip_backing_up": { + "defaultMessage": "Backing up", + "description": "Modpack active card: status chip while a backup is taken before the modpack changes" + }, + "web.components.modpack_active_card.chip_backup_failed": { + "defaultMessage": "Backup failed", + "description": "Modpack active card: status chip when the backup taken before a change or removal failed" + }, + "web.components.modpack_active_card.chip_not_pinned": { + "defaultMessage": "Not pinned", + "description": "Modpack active card: status chip when the installed modpack version could not be read" + }, + "web.components.modpack_active_card.chip_removing": { + "defaultMessage": "Removing", + "description": "Modpack active card: status chip while the modpack removal is queued" + }, + "web.components.modpack_active_card.label": { + "defaultMessage": "Active modpack", + "description": "Modpack active card: small label above the active modpack summary" + }, + "web.components.modpack_active_card.message_applying": { + "defaultMessage": "Restarting with the new version…", + "description": "Modpack active card: default line shown while the server restarts with the new modpack version" + }, + "web.components.modpack_active_card.message_backing_up": { + "defaultMessage": "Backing up before switching. The server keeps running.", + "description": "Modpack active card: default line shown while the backup before a modpack change runs" + }, + "web.components.modpack_active_card.message_not_pinned": { + "defaultMessage": "The installed version could not be read. Pick a version to pin this pack; until then a restart may upgrade it.", + "description": "Modpack active card: line explaining that the installed modpack version is unknown and a restart may upgrade it" + }, + "web.components.modpack_active_card.message_removing": { + "defaultMessage": "Removing the pack and emptying the mods folder at the next start…", + "description": "Modpack active card: line shown while a modpack removal is queued for the next server start" + }, + "web.components.modpack_active_card.pick_version": { + "defaultMessage": "Pick version", + "description": "Modpack active card: button that opens the version picker when the installed version is unknown" + }, + "web.components.modpack_active_card.remove": { + "defaultMessage": "Remove", + "description": "Modpack active card: button that removes the active modpack" + }, + "web.components.modpack_active_card.retry_remove": { + "defaultMessage": "Retry remove", + "description": "Modpack active card: button that retries removing the modpack after its backup failed" + }, + "web.components.modpack_active_card.version_pinned": { + "defaultMessage": "Version {version} · pinned · {mc}", + "description": "Modpack active card: second line with the pinned modpack version; {version} is the version name, {mc} the Minecraft version and loader label" + }, + "web.components.modpack_active_card.version_unknown": { + "defaultMessage": "Version unknown · {mc}", + "description": "Modpack active card: second line when the installed version is unknown; {mc} is the Minecraft version and loader label" + }, + "web.components.modpack_confirm_dialog.back_up_first": { + "defaultMessage": "Back up first", + "description": "Modpack confirm dialog: checkbox label that takes a backup before the change" + }, + "web.components.modpack_confirm_dialog.backup_help": { + "defaultMessage": "Takes a backup to this server's backup destination before the change. If the backup fails, nothing changes.", + "description": "Modpack confirm dialog: help text under the back-up checkbox explaining the backup is taken first and the change is cancelled if it fails" + }, + "web.components.modpack_confirm_dialog.backup_help_destination": { + "defaultMessage": "Takes a backup to the cluster’s backup destination ({destination}) before the change. If the backup fails, nothing changes.", + "description": "Modpack confirm dialog: help text under the back-up checkbox naming the backup destination; the backup is taken first and the change is cancelled if it fails; {destination} is the destination name" + }, + "web.components.modpack_confirm_dialog.cancel": { + "defaultMessage": "Cancel", + "description": "Modpack confirm dialog: button that closes the dialog without changing the modpack" + }, + "web.components.modpack_confirm_dialog.change_and_restart": { + "defaultMessage": "Change version and restart", + "description": "Modpack confirm dialog: primary button that switches the modpack version and restarts the server" + }, + "web.components.modpack_confirm_dialog.change_title": { + "defaultMessage": "Switch to {versionName}?", + "description": "Modpack confirm dialog: title when switching the modpack to a newer version; {versionName} is the version name" + }, + "web.components.modpack_confirm_dialog.downgrade_and_restart": { + "defaultMessage": "Downgrade and restart", + "description": "Modpack confirm dialog: primary button that moves to an older modpack version and restarts the server" + }, + "web.components.modpack_confirm_dialog.downgrade_title": { + "defaultMessage": "Go back to {versionName}?", + "description": "Modpack confirm dialog: title when moving the modpack to an older version; {versionName} is the version name" + }, + "web.components.modpack_confirm_dialog.downgrade_warning_body": { + "defaultMessage": "Going back to an older version can break the world, for example when it removes blocks or items the world already uses. Keep the backup.", + "description": "Modpack confirm dialog: body of the downgrade warning explaining older versions can break the world; keep the backup" + }, + "web.components.modpack_confirm_dialog.downgrade_warning_title": { + "defaultMessage": "This is an older version", + "description": "Modpack confirm dialog: heading of the warning shown when the chosen version is older than the current one" + }, + "web.components.modpack_confirm_dialog.install_and_restart": { + "defaultMessage": "Install and restart", + "description": "Modpack confirm dialog: primary button that installs the modpack and restarts the server" + }, + "web.components.modpack_confirm_dialog.install_desc": { + "defaultMessage": "{serverName} restarts to install the pack. It stays on this version until you change it.", + "description": "Modpack confirm dialog: explains the server restarts to install the pack and keeps this version until changed; {serverName} is the server name" + }, + "web.components.modpack_confirm_dialog.install_title": { + "defaultMessage": "Install {packTitle}?", + "description": "Modpack confirm dialog: title when installing a modpack; {packTitle} is the modpack title" + }, + "web.components.modpack_confirm_dialog.no_backup_destination": { + "defaultMessage": "No backup destination is set for this server's cluster.", + "description": "Modpack confirm dialog: help text under the disabled back-up checkbox when the cluster has no backup destination" + }, + "web.components.modpack_confirm_dialog.provider_version": { + "defaultMessage": "{providerLabel} · {versionName}", + "description": "Modpack confirm dialog: pack summary line with the registry label and the version name; {providerLabel} is the registry, {versionName} the version" + }, + "web.components.modpack_confirm_dialog.remove_desc": { + "defaultMessage": "The pack is removed and {serverName} restarts as a plain server.", + "description": "Modpack confirm dialog: explains the modpack is removed and the server restarts without it; {serverName} is the server name" + }, + "web.components.modpack_confirm_dialog.remove_modpack": { + "defaultMessage": "Remove modpack", + "description": "Modpack confirm dialog: danger primary button that removes the modpack" + }, + "web.components.modpack_confirm_dialog.remove_title": { + "defaultMessage": "Remove {packTitle}?", + "description": "Modpack confirm dialog: title when removing the modpack from the server; {packTitle} is the modpack title" + }, + "web.components.modpack_confirm_dialog.remove_warning": { + "defaultMessage": "Every mod in the mods folder is deleted, including ones added by hand. The world folder is not touched.", + "description": "Modpack confirm dialog: danger warning when removing the modpack; every mod in the mods folder is deleted, including hand-added ones, and the world folder is kept" + }, + "web.components.modpack_confirm_dialog.switch_desc": { + "defaultMessage": "{serverName} restarts on {packTitle} {versionName}.", + "description": "Modpack confirm dialog: explains the server restarts on the chosen modpack version; {serverName}, {packTitle} and {versionName} are names" + }, + "web.components.modpack_confirm_dialog.switch_desc_from": { + "defaultMessage": "{serverName} restarts on {packTitle} {versionName} instead of {fromVersionName}.", + "description": "Modpack confirm dialog: explains the server restarts on the new version instead of the current one; {serverName}, {packTitle}, {versionName} and {fromVersionName} are names" + }, + "web.components.modpack_confirm_dialog.working": { + "defaultMessage": "Working…", + "description": "Modpack confirm dialog: label of the primary button while the change is being submitted" + }, + "web.components.modpack_missing_files.body": { + "defaultMessage": "Their authors block automatic downloads, so the install stopped. Download each file from its page, upload it to {path} in the Files tab, then restart the server.", + "description": "Modpack missing files: explains that files blocked by their authors must be downloaded and uploaded by hand; {path} is the downloads folder, shown in code style" + }, + "web.components.modpack_missing_files.download": { + "defaultMessage": "Download", + "description": "Modpack missing files: column heading for the link to the file's download page; keep it short" + }, + "web.components.modpack_missing_files.download_page": { + "defaultMessage": "Download page", + "description": "Modpack missing files: link text that opens the file's download page in a new tab" + }, + "web.components.modpack_missing_files.file_name": { + "defaultMessage": "File name", + "description": "Modpack missing files: column heading for the file name to upload; keep it short" + }, + "web.components.modpack_missing_files.mod": { + "defaultMessage": "Mod", + "description": "Modpack missing files: column heading for the mod name; keep it short" + }, + "web.components.modpack_missing_files.open_files": { + "defaultMessage": "Open Files", + "description": "Modpack missing files: button that switches to the Files tab so the operator can upload the files" + }, + "web.components.modpack_missing_files.table": { + "defaultMessage": "Missing files table", + "description": "Modpack missing files: accessible label of the table listing the files to download, read by screen readers; not shown as text" + }, + "web.components.modpack_missing_files.title": { + "defaultMessage": "{count, plural, one {# file needs} other {# files need}} a manual download", + "description": "Modpack missing files: panel title saying how many files must be downloaded by hand; {count} is the number of files" + }, + "web.components.modpack_missing_files.unknown": { + "defaultMessage": "Start the server to check whether this pack needs files you have to download yourself.", + "description": "Modpack missing files: info note shown when the server must start before the missing files can be known" + }, + "web.components.modpack_version_picker.cancel": { + "defaultMessage": "Cancel", + "description": "Modpack version picker: button that closes the picker without choosing a version" + }, + "web.components.modpack_version_picker.change_version": { + "defaultMessage": "Change version", + "description": "Modpack version picker: dialog title when changing the version of the modpack already on the server" + }, + "web.components.modpack_version_picker.choose_a_version": { + "defaultMessage": "Choose a version", + "description": "Modpack version picker: dialog title when choosing a version of a modpack to install" + }, + "web.components.modpack_version_picker.continue": { + "defaultMessage": "Continue", + "description": "Modpack version picker: default primary button that continues with the chosen version" + }, + "web.components.modpack_version_picker.load_failed": { + "defaultMessage": "Couldn't load versions.", + "description": "Modpack version picker: fallback error when the versions of the modpack cannot be loaded" + }, + "web.components.modpack_version_picker.loading_versions": { + "defaultMessage": "Loading versions…", + "description": "Modpack version picker: shown while the versions of the modpack are loading" + }, + "web.components.modpack_version_picker.no_versions": { + "defaultMessage": "No versions of this pack match {mcLabel}.", + "description": "Modpack version picker: empty state when the modpack has no version for the server's game version and loader; {mcLabel} is that label" + }, + "web.components.modpack_version_picker.older": { + "defaultMessage": "Older", + "description": "Modpack version picker: chip marking a version older than the one pinned on the server" + }, + "web.components.modpack_version_picker.pinned": { + "defaultMessage": "Pinned", + "description": "Modpack version picker: chip marking the version currently pinned on the server" + }, + "web.components.modpack_version_picker.published": { + "defaultMessage": "Published {date}", + "description": "Modpack version picker: version row line giving the publish date; {date} is a formatted date" + }, + "web.components.modpack_version_picker.published_with_details": { + "defaultMessage": "Published {date} · {details}", + "description": "Modpack version picker: version row line giving the publish date and the loader and game version; {date} is a formatted date, {details} the loader and game version" + }, + "web.components.modpack_version_picker.release_type_alpha": { + "defaultMessage": "Alpha", + "description": "Modpack version picker: chip for an alpha release of the modpack version" + }, + "web.components.modpack_version_picker.release_type_beta": { + "defaultMessage": "Beta", + "description": "Modpack version picker: chip for a beta release of the modpack version" + }, + "web.components.modpack_version_picker.release_type_release": { + "defaultMessage": "Release", + "description": "Modpack version picker: chip for a stable release of the modpack version" + }, + "web.components.modpack_version_picker.showing_versions": { + "defaultMessage": "Showing versions for {mcLabel}, newest first.", + "description": "Modpack version picker: explains which Minecraft or game version and loader the listed versions match; {mcLabel} is that label" + }, + "web.components.modpack_version_picker.title_provider": { + "defaultMessage": "{title} · {provider}", + "description": "Modpack version picker: subtitle with the modpack title and its registry name; {title} is the modpack title, {provider} the registry label" + }, + "web.components.modpack_version_picker.version_list": { + "defaultMessage": "Version list", + "description": "Modpack version picker: accessible name of the radio list of versions" + }, "web.components.module_target.couldn_t_load_installation_capabilities": { "defaultMessage": "Couldn't load installation capabilities.", "description": "Module target: error card message shown when the installation's capabilities cannot be loaded; the card has a retry button" @@ -3207,6 +3491,10 @@ "defaultMessage": "Category filtering isn't available for {provider}.", "description": "Registry browser: tooltip when a provider has no category filter; {provider} is the provider label" }, + "web.components.registry_browser.curseforge_needs_shared_key": { + "defaultMessage": "CurseForge packs for Minecraft 1.16.5 need the shared CurseForge key. An admin can turn on “Share the CurseForge key with game servers” in Settings → Mod registries.", + "description": "Registry browser: muted hint under the modpack switch explaining CurseForge is hidden until an admin shares the CurseForge key with game servers" + }, "web.components.registry_browser.in_app_browse_isn_t_available_for_this": { "defaultMessage": "In-app browse isn’t available for this server.", "description": "Registry browser: message shown instead of the results when no usable registry provider exists for this server, so in-app browsing is unavailable" @@ -5811,6 +6099,38 @@ "defaultMessage": "Set", "description": "Admin settings: verb on the button that sets an API key for the first time" }, + "web.routes.admin_settings.share_curseforge_key": { + "defaultMessage": "Share the CurseForge key with game servers", + "description": "Admin settings: title of the switch that lets game servers use the managed CurseForge key" + }, + "web.routes.admin_settings.share_curseforge_key_apply": { + "defaultMessage": "Changes apply to a server when it has 0 players, so nobody is kicked by a restart.", + "description": "Admin settings: note under the CurseForge key share switch when it is on; changes only apply to servers with 0 players" + }, + "web.routes.admin_settings.share_curseforge_key_aria": { + "defaultMessage": "Share the CurseForge key with game servers", + "description": "Admin settings: aria-label of the CurseForge key share switch" + }, + "web.routes.admin_settings.share_curseforge_key_flag": { + "defaultMessage": "Store the key here to share it. A key from the startup flag stays inside the API.", + "description": "Admin settings: reason shown under the disabled CurseForge key share switch when the key comes from the startup flag, not from this page" + }, + "web.routes.admin_settings.share_curseforge_key_flag_set": { + "defaultMessage": "Set by the --curseforge-api-key startup flag", + "description": "Admin settings: CurseForge registry description when the key comes from the --curseforge-api-key startup flag" + }, + "web.routes.admin_settings.share_curseforge_key_from_flag": { + "defaultMessage": "From startup flag", + "description": "Admin settings: badge shown next to the CurseForge registry name when the key comes from the --curseforge-api-key startup flag" + }, + "web.routes.admin_settings.share_curseforge_key_help": { + "defaultMessage": "Lets servers on images without a built-in key (Minecraft 1.16.5 and older) install CurseForge packs.", + "description": "Admin settings: first description line under the CurseForge key share switch" + }, + "web.routes.admin_settings.share_curseforge_key_risk": { + "defaultMessage": "Mods running on those servers can read the key.", + "description": "Admin settings: second description line under the CurseForge key share switch; it warns that mods can read the shared key" + }, "web.routes.admin_settings.sink_kind": { "defaultMessage": "Sink kind", "description": "Admin settings: accessible name of the dropdown that picks the notification sink type, such as Discord, Slack, ntfy, email or webhook" @@ -8511,6 +8831,10 @@ "defaultMessage": "Tech", "description": "Modpacks: category filter chip for technology modpacks" }, + "web.routes.tabs.modpacks.continue": { + "defaultMessage": "Continue", + "description": "Modpacks: button that continues from the version picker to the confirmation step" + }, "web.routes.tabs.modpacks.dismiss": { "defaultMessage": "dismiss", "description": "Modpacks tab: icon-only button that closes the result banner; read by screen readers; keep it short" @@ -8531,6 +8855,10 @@ "defaultMessage": "Install", "description": "Modpacks: label of the button that installs a modpack" }, + "web.routes.tabs.modpacks.install_ellipsis": { + "defaultMessage": "Install…", + "description": "Modpacks: label of the button that opens the version picker to install a modpack; the ellipsis means more steps follow" + }, "web.routes.tabs.modpacks.installing": { "defaultMessage": "Installing…", "description": "Modpacks: label of the install button while this modpack is installing" @@ -8539,6 +8867,14 @@ "defaultMessage": "Installing a modpack either pins it on the server (and restarts) or adds all of its mods, depending on the registry.", "description": "Modpacks tab: hint under the modpacks heading saying an install either pins the modpack and restarts the server, or adds all its mods, depending on the registry" }, + "web.routes.tabs.modpacks.minecraft_version": { + "defaultMessage": "Minecraft {version}", + "description": "Modpacks: label for the server's Minecraft version in the active modpack card; {version} is the version number" + }, + "web.routes.tabs.modpacks.pick_a_pack_and_a_version": { + "defaultMessage": "Pick a pack and a version. The server pins that version and restarts to install it; a restart never upgrades it.", + "description": "Modpacks tab: hint under the modpacks heading for registries that pin one version of a pack; the server restarts to install it and a restart never upgrades it" + }, "web.routes.tabs.modpacks.requires_operator_role": { "defaultMessage": "Requires operator role", "description": "Modpacks: tooltip on a disabled install control for users without the operator role" diff --git a/operator/api/v1alpha1/gameserver_types.go b/operator/api/v1alpha1/gameserver_types.go index 917bdbe63..b7a3dd59b 100644 --- a/operator/api/v1alpha1/gameserver_types.go +++ b/operator/api/v1alpha1/gameserver_types.go @@ -42,6 +42,27 @@ const ( // has no free block, in which case the server has no Service. Absent // when the template draws from no pool. GameServerConditionPortAllocation = "PortAllocation" + + // GameServerConditionModpackReady reports the progress of the current + // modpack change (spec.modpack): True once status.modpack.phase is + // Applied; False with Reason BackingUp, Applying or BackupFailed + // otherwise. Absent while the server has never had a managed modpack. + GameServerConditionModpackReady = "ModpackReady" +) + +// Modpack annotations on a GameServer. +const ( + // ModpackAdoptedAnnotation ("true") is set by the API's legacy sweep on a + // server whose pre-spec.modpack pack was adopted into spec.modpack; the + // operator keeps rendering the legacy env until the next pod start it + // drives, then removes the annotation. + ModpackAdoptedAnnotation = "gameplane.local/modpack-adopted" + + // ModpackRemoveAnnotation holds JSON {"requestId": string, "backupFirst": + // bool}. Set by the API on Remove, cleared by the operator once applied; + // kept with status.modpack.applied when the removal's backup fails so a + // retry (new requestId) runs it again. + ModpackRemoveAnnotation = "gameplane.local/modpack-remove" ) // GameServerSpec is the desired state of a single game server instance. @@ -166,6 +187,117 @@ type GameServerSpec struct { // Capture configures optional packet-capture capability for this GameServer. // +optional Capture *CaptureConfiguration `json:"capture,omitempty"` + + // Modpack is the modpack this server runs. Absent means no pack. The + // operator renders the pack's env from this field (it never lives in + // spec.env) and applies changes through status.modpack. Remove deletes + // this field and sets the gameplane.local/modpack-remove annotation. + // +optional + Modpack *GameServerModpackSpec `json:"modpack,omitempty"` +} + +// ModpackRef identifies one modpack version from a registry. +type ModpackRef struct { + // Provider names the registry (a provider of the template's registry + // list that declares modpacks), e.g. "modrinth", "curseforge", "ftb". + // The operator renders nothing for a provider the template does not + // declare with modpacks. + // +kubebuilder:validation:MinLength=1 + // +kubebuilder:validation:MaxLength=32 + // +kubebuilder:validation:Pattern=`^[a-z0-9-]+$` + Provider string `json:"provider"` + + // Project is the pack's slug (Modrinth, CurseForge) or numeric id (FTB). + // +kubebuilder:validation:MinLength=1 + // +kubebuilder:validation:MaxLength=128 + // +kubebuilder:validation:Pattern=`^[A-Za-z0-9._-]+$` + Project string `json:"project"` + + // Version is the pinned pack version id. Empty only for adopted packs + // whose installed version could not be read ("Not pinned"). + // +kubebuilder:validation:MaxLength=64 + // +kubebuilder:validation:Pattern=`^[A-Za-z0-9._-]*$` + // +optional + Version string `json:"version,omitempty"` + + // Title is the pack's display name; display only. + // +kubebuilder:validation:MaxLength=128 + // +optional + Title string `json:"title,omitempty"` + + // VersionName is the version's display name; display only. + // +kubebuilder:validation:MaxLength=128 + // +optional + VersionName string `json:"versionName,omitempty"` +} + +// GameServerModpackSpec is the desired modpack for a server. +type GameServerModpackSpec struct { + ModpackRef `json:",inline"` + + // BackupFirst asks for a backup before the change is applied. Honoured + // only when the server has a backup destination. + // +optional + BackupFirst bool `json:"backupFirst,omitempty"` + + // RequestID is a fresh id the API sets on every install request, so a retry of the same choice (for example after BackupFailed) is a new change. + // +optional + RequestID string `json:"requestId,omitempty"` +} + +// ModpackPhase is the progress of the current modpack change. +// +kubebuilder:validation:Enum=Pending;BackingUp;Applying;Applied;BackupFailed +type ModpackPhase string + +// ModpackPhase constants. +const ( + ModpackPhasePending ModpackPhase = "Pending" + ModpackPhaseBackingUp ModpackPhase = "BackingUp" + ModpackPhaseApplying ModpackPhase = "Applying" + ModpackPhaseApplied ModpackPhase = "Applied" + ModpackPhaseBackupFailed ModpackPhase = "BackupFailed" +) + +// GameServerModpackStatus is the observed state of spec.modpack. +type GameServerModpackStatus struct { + // ObservedGeneration is the generation of the last change handled. + // +optional + ObservedGeneration int64 `json:"observedGeneration,omitempty"` + + // Phase is the progress of the current change. + // +optional + Phase ModpackPhase `json:"phase,omitempty"` + + // Applied is the pack the pod renders now; nil when none. + // +optional + Applied *ModpackRef `json:"applied,omitempty"` + + // BackupName is the Backup created for this change. + // +optional + BackupName string `json:"backupName,omitempty"` + + // Message is a human-readable reason for BackupFailed. + // +kubebuilder:validation:MaxLength=512 + // +optional + Message string `json:"message,omitempty"` + + // Target is the spec.modpack the in-flight change (BackingUp or + // BackupFailed) started from; nil for a removal. A change is superseded + // when spec.modpack or the request id no longer match it, not when the + // generation moves. + // +optional + Target *ModpackRef `json:"target,omitempty"` + + // RequestID is the install or removal request id the in-flight change + // started from. + // +optional + RequestID string `json:"requestId,omitempty"` + + // KeyShared reports the game container currently gets a shared CurseForge + // key from the server-owned Secret through the template's apiKeyEnv + // (valueFrom.secretKeyRef). + // +optional + KeyShared bool `json:"keyShared,omitempty"` } // IdleSpec configures idle auto-sleep: the operator scales the server down @@ -643,6 +775,11 @@ type GameServerStatus struct { // +kubebuilder:validation:MaxItems=32 // +optional TunnelEndpoints []GameServerEndpoint `json:"tunnelEndpoints,omitempty"` + + // Modpack reports the progress and result of spec.modpack changes. + // Missing-download files are not stored here; the API reads them live. + // +optional + Modpack *GameServerModpackStatus `json:"modpack,omitempty"` } // IdleStatus is the observed state of idle auto-sleep. It is a read model: diff --git a/operator/api/v1alpha1/gametemplate_types.go b/operator/api/v1alpha1/gametemplate_types.go index ceb38e7c2..fbfb9f5c2 100644 --- a/operator/api/v1alpha1/gametemplate_types.go +++ b/operator/api/v1alpha1/gametemplate_types.go @@ -454,6 +454,7 @@ type ModRegistrySpec struct { // +kubebuilder:validation:XValidation:rule="self.provider != 'steam' || (has(self.steamAppID) && self.steamAppID > 0)",message="steamAppID is required when provider is steam" // +kubebuilder:validation:XValidation:rule="self.provider != 'github' || has(self.github)",message="github is required when provider is github" // +kubebuilder:validation:XValidation:rule="self.provider != 'curseforge' || (has(self.curseforgeGameID) && self.curseforgeGameID > 0)",message="curseforgeGameID is required when provider is curseforge" +// +kubebuilder:validation:XValidation:rule="!has(self.modpacks) || !has(self.modpacks.apiKeyEnv) || self.provider == 'curseforge'",message="modpacks.apiKeyEnv is only valid when provider is curseforge" type ModProvider struct { // Provider names the built-in registry engine: "modrinth" (Minecraft // mods/plugins, keyless), "thunderstore" (BepInEx games, keyless, @@ -470,8 +471,9 @@ type ModProvider struct { // "spigot" (SpigotMC plugins via the Spiget API, keyless), "github" // (one repository's Releases stand in for versions, keyless but // rate-limited — see GitHub), or "umod" (Rust/Hurtworld/7 Days to - // Die's Oxide/uMod plugin ecosystem, keyless). - // +kubebuilder:validation:Enum=modrinth;thunderstore;curseforge;hangar;factorio;steam;spigot;github;umod;nexus + // Die's Oxide/uMod plugin ecosystem, keyless), or "ftb" (Feed The Beast + // modpacks, keyless, modpack-only: it has no single-mod browse). + // +kubebuilder:validation:Enum=modrinth;thunderstore;curseforge;hangar;factorio;steam;spigot;github;umod;nexus;ftb Provider string `json:"provider"` // Community is the Thunderstore community slug whose package index to @@ -523,6 +525,12 @@ type ModProvider struct { // steamcmd resolves a collection's members itself inside the container. // +optional Modpacks *ModpackSpec `json:"modpacks,omitempty"` + + // ModpacksOnly hides this provider from the Mods tab: it is offered only + // in the Modpacks tab (e.g. "ftb", whose registry has packs but no + // single-mod listing). Requires Modpacks to be set to be useful. + // +optional + ModpacksOnly bool `json:"modpacksOnly,omitempty"` } // GitHubRepoSpec identifies the single GitHub repository the "github" mod @@ -561,6 +569,61 @@ type ModpackSpec struct { // +kubebuilder:validation:MaxItems=16 // +optional Env []corev1.EnvVar `json:"env,omitempty"` + + // VersionEnv is the game-image env the operator sets to the pinned pack + // version id (e.g. "MODRINTH_VERSION", "CF_FILE_ID", + // "FTB_MODPACK_VERSION_ID"). Required for env-mode packs that support + // pinning; when empty the registry is not offered for pinned install. + // +kubebuilder:validation:MaxLength=64 + // +kubebuilder:validation:Pattern=`^[A-Za-z_][A-Za-z0-9_]*$` + // +optional + VersionEnv string `json:"versionEnv,omitempty"` + + // APIKeyEnv is the game-image env that receives the shared CurseForge + // API key (e.g. "CF_API_KEY") through a secretKeyRef to a server-owned + // Secret, while the admin has key sharing on. Only valid when the + // provider is curseforge. + // +kubebuilder:validation:MaxLength=64 + // +kubebuilder:validation:Pattern=`^[A-Za-z_][A-Za-z0-9_]*$` + // +optional + APIKeyEnv string `json:"apiKeyEnv,omitempty"` + + // NeedsKeyImageTags lists image tags (the part after ":" and before "@") + // that have no built-in CurseForge key. Servers on these images get this + // provider only while key sharing is on. + // +kubebuilder:validation:MaxItems=8 + // +kubebuilder:validation:items:MaxLength=64 + // +optional + NeedsKeyImageTags []string `json:"needsKeyImageTags,omitempty"` + + // MissingFilesPath is the file, relative to the data mount, where the + // image lists files that need a manual download + // (e.g. "MODS_NEED_DOWNLOAD.txt"). + // +kubebuilder:validation:MaxLength=128 + // +kubebuilder:validation:XValidation:rule="!self.startsWith('/') && !self.contains('..')",message="missingFilesPath must be relative to the data mount and must not contain '..'" + // +optional + MissingFilesPath string `json:"missingFilesPath,omitempty"` + + // AdoptVersionFile says where the image records the installed pack + // version, so legacy unpinned packs can be adopted with their version. + // +optional + AdoptVersionFile *AdoptVersionFileSpec `json:"adoptVersionFile,omitempty"` +} + +// AdoptVersionFileSpec locates the installed pack version recorded by the +// game image: a JSON file under the data mount and the field holding it. +type AdoptVersionFileSpec struct { + // Path is the JSON file, relative to the data mount + // (e.g. ".modrinth-modpack-manifest.json"). + // +kubebuilder:validation:MinLength=1 + // +kubebuilder:validation:MaxLength=128 + // +kubebuilder:validation:XValidation:rule="!self.startsWith('/') && !self.contains('..')",message="path must be relative to the data mount and must not contain '..'" + Path string `json:"path"` + + // Field is the top-level JSON field holding the version (e.g. "versionId"). + // +kubebuilder:validation:MinLength=1 + // +kubebuilder:validation:MaxLength=64 + Field string `json:"field"` } // ModLoaderSpec is the mods directory for one loader / server-type, diff --git a/operator/api/v1alpha1/zz_generated.deepcopy.go b/operator/api/v1alpha1/zz_generated.deepcopy.go index b10d634f5..b65dc4551 100644 --- a/operator/api/v1alpha1/zz_generated.deepcopy.go +++ b/operator/api/v1alpha1/zz_generated.deepcopy.go @@ -30,6 +30,21 @@ func (in *ActionParamSpec) DeepCopy() *ActionParamSpec { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AdoptVersionFileSpec) DeepCopyInto(out *AdoptVersionFileSpec) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AdoptVersionFileSpec. +func (in *AdoptVersionFileSpec) DeepCopy() *AdoptVersionFileSpec { + if in == nil { + return nil + } + out := new(AdoptVersionFileSpec) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *AgentGatewaySpec) DeepCopyInto(out *AgentGatewaySpec) { *out = *in @@ -948,6 +963,47 @@ func (in *GameServerList) DeepCopyObject() runtime.Object { return nil } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GameServerModpackSpec) DeepCopyInto(out *GameServerModpackSpec) { + *out = *in + out.ModpackRef = in.ModpackRef +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GameServerModpackSpec. +func (in *GameServerModpackSpec) DeepCopy() *GameServerModpackSpec { + if in == nil { + return nil + } + out := new(GameServerModpackSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GameServerModpackStatus) DeepCopyInto(out *GameServerModpackStatus) { + *out = *in + if in.Applied != nil { + in, out := &in.Applied, &out.Applied + *out = new(ModpackRef) + **out = **in + } + if in.Target != nil { + in, out := &in.Target, &out.Target + *out = new(ModpackRef) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GameServerModpackStatus. +func (in *GameServerModpackStatus) DeepCopy() *GameServerModpackStatus { + if in == nil { + return nil + } + out := new(GameServerModpackStatus) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *GameServerModsSpec) DeepCopyInto(out *GameServerModsSpec) { *out = *in @@ -1093,6 +1149,11 @@ func (in *GameServerSpec) DeepCopyInto(out *GameServerSpec) { *out = new(CaptureConfiguration) (*in).DeepCopyInto(*out) } + if in.Modpack != nil { + in, out := &in.Modpack, &out.Modpack + *out = new(GameServerModpackSpec) + **out = **in + } } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GameServerSpec. @@ -1171,6 +1232,11 @@ func (in *GameServerStatus) DeepCopyInto(out *GameServerStatus) { *out = make([]GameServerEndpoint, len(*in)) copy(*out, *in) } + if in.Modpack != nil { + in, out := &in.Modpack, &out.Modpack + *out = new(GameServerModpackStatus) + (*in).DeepCopyInto(*out) + } } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GameServerStatus. @@ -1792,6 +1858,21 @@ func (in *ModRegistrySpec) DeepCopy() *ModRegistrySpec { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ModpackRef) DeepCopyInto(out *ModpackRef) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ModpackRef. +func (in *ModpackRef) DeepCopy() *ModpackRef { + if in == nil { + return nil + } + out := new(ModpackRef) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *ModpackSpec) DeepCopyInto(out *ModpackSpec) { *out = *in @@ -1802,6 +1883,16 @@ func (in *ModpackSpec) DeepCopyInto(out *ModpackSpec) { (*in)[i].DeepCopyInto(&(*out)[i]) } } + if in.NeedsKeyImageTags != nil { + in, out := &in.NeedsKeyImageTags, &out.NeedsKeyImageTags + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.AdoptVersionFile != nil { + in, out := &in.AdoptVersionFile, &out.AdoptVersionFile + *out = new(AdoptVersionFileSpec) + **out = **in + } } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ModpackSpec. diff --git a/operator/cmd/main.go b/operator/cmd/main.go index c6bd1ee8f..f5cdc0c3d 100644 --- a/operator/cmd/main.go +++ b/operator/cmd/main.go @@ -549,6 +549,7 @@ func main() { AgentCASecretNamespace: agentCASecretNamespace, WakeStartLimit: wakeStartLimit, WakeStartNamespace: controlPlaneNamespaceDefault, + ControlPlaneNamespace: controlPlaneNamespace, AgentClient: agentClient, OperationQuiescer: agentClient, PodAttacher: &controller.StopAttachClient{ diff --git a/operator/config/crd/gameplane.local_gameservers.yaml b/operator/config/crd/gameplane.local_gameservers.yaml index 580e908ae..86a2c4d40 100644 --- a/operator/config/crd/gameplane.local_gameservers.yaml +++ b/operator/config/crd/gameplane.local_gameservers.yaml @@ -1307,6 +1307,60 @@ spec: resolved from Version). Useful for pinning a specific build or running a fork. type: string + modpack: + description: |- + Modpack is the modpack this server runs. Absent means no pack. The + operator renders the pack's env from this field (it never lives in + spec.env) and applies changes through status.modpack. Remove deletes + this field and sets the gameplane.local/modpack-remove annotation. + properties: + backupFirst: + description: |- + BackupFirst asks for a backup before the change is applied. Honoured + only when the server has a backup destination. + type: boolean + project: + description: Project is the pack's slug (Modrinth, CurseForge) + or numeric id (FTB). + maxLength: 128 + minLength: 1 + pattern: ^[A-Za-z0-9._-]+$ + type: string + provider: + description: |- + Provider names the registry (a provider of the template's registry + list that declares modpacks), e.g. "modrinth", "curseforge", "ftb". + The operator renders nothing for a provider the template does not + declare with modpacks. + maxLength: 32 + minLength: 1 + pattern: ^[a-z0-9-]+$ + type: string + requestId: + description: RequestID is a fresh id the API sets on every install + request, so a retry of the same choice (for example after BackupFailed) + is a new change. + type: string + title: + description: Title is the pack's display name; display only. + maxLength: 128 + type: string + version: + description: |- + Version is the pinned pack version id. Empty only for adopted packs + whose installed version could not be read ("Not pinned"). + maxLength: 64 + pattern: ^[A-Za-z0-9._-]*$ + type: string + versionName: + description: VersionName is the version's display name; display + only. + maxLength: 128 + type: string + required: + - project + - provider + type: object mods: description: |- Mods pins the mods this server loads, for games whose server downloads @@ -2706,6 +2760,129 @@ spec: successful backup of this server. format: date-time type: string + modpack: + description: |- + Modpack reports the progress and result of spec.modpack changes. + Missing-download files are not stored here; the API reads them live. + properties: + applied: + description: Applied is the pack the pod renders now; nil when + none. + properties: + project: + description: Project is the pack's slug (Modrinth, CurseForge) + or numeric id (FTB). + maxLength: 128 + minLength: 1 + pattern: ^[A-Za-z0-9._-]+$ + type: string + provider: + description: |- + Provider names the registry (a provider of the template's registry + list that declares modpacks), e.g. "modrinth", "curseforge", "ftb". + The operator renders nothing for a provider the template does not + declare with modpacks. + maxLength: 32 + minLength: 1 + pattern: ^[a-z0-9-]+$ + type: string + title: + description: Title is the pack's display name; display only. + maxLength: 128 + type: string + version: + description: |- + Version is the pinned pack version id. Empty only for adopted packs + whose installed version could not be read ("Not pinned"). + maxLength: 64 + pattern: ^[A-Za-z0-9._-]*$ + type: string + versionName: + description: VersionName is the version's display name; display + only. + maxLength: 128 + type: string + required: + - project + - provider + type: object + backupName: + description: BackupName is the Backup created for this change. + type: string + keyShared: + description: |- + KeyShared reports the game container currently gets a shared CurseForge + key from the server-owned Secret through the template's apiKeyEnv + (valueFrom.secretKeyRef). + type: boolean + message: + description: Message is a human-readable reason for BackupFailed. + maxLength: 512 + type: string + observedGeneration: + description: ObservedGeneration is the generation of the last + change handled. + format: int64 + type: integer + phase: + description: Phase is the progress of the current change. + enum: + - Pending + - BackingUp + - Applying + - Applied + - BackupFailed + type: string + requestId: + description: |- + RequestID is the install or removal request id the in-flight change + started from. + type: string + target: + description: |- + Target is the spec.modpack the in-flight change (BackingUp or + BackupFailed) started from; nil for a removal. A change is superseded + when spec.modpack or the request id no longer match it, not when the + generation moves. + properties: + project: + description: Project is the pack's slug (Modrinth, CurseForge) + or numeric id (FTB). + maxLength: 128 + minLength: 1 + pattern: ^[A-Za-z0-9._-]+$ + type: string + provider: + description: |- + Provider names the registry (a provider of the template's registry + list that declares modpacks), e.g. "modrinth", "curseforge", "ftb". + The operator renders nothing for a provider the template does not + declare with modpacks. + maxLength: 32 + minLength: 1 + pattern: ^[a-z0-9-]+$ + type: string + title: + description: Title is the pack's display name; display only. + maxLength: 128 + type: string + version: + description: |- + Version is the pinned pack version id. Empty only for adopted packs + whose installed version could not be read ("Not pinned"). + maxLength: 64 + pattern: ^[A-Za-z0-9._-]*$ + type: string + versionName: + description: VersionName is the version's display name; display + only. + maxLength: 128 + type: string + required: + - project + - provider + type: object + type: object observedGeneration: format: int64 type: integer diff --git a/operator/config/crd/gameplane.local_gametemplates.yaml b/operator/config/crd/gameplane.local_gametemplates.yaml index ab6673ed7..80a33c3c0 100644 --- a/operator/config/crd/gameplane.local_gametemplates.yaml +++ b/operator/config/crd/gameplane.local_gametemplates.yaml @@ -572,6 +572,41 @@ spec: image's collection-id variable (e.g. "WORKSHOP_COLLECTION") since steamcmd resolves a collection's members itself inside the container. properties: + adoptVersionFile: + description: |- + AdoptVersionFile says where the image records the installed pack + version, so legacy unpinned packs can be adopted with their version. + properties: + field: + description: Field is the top-level JSON + field holding the version (e.g. "versionId"). + maxLength: 64 + minLength: 1 + type: string + path: + description: |- + Path is the JSON file, relative to the data mount + (e.g. ".modrinth-modpack-manifest.json"). + maxLength: 128 + minLength: 1 + type: string + x-kubernetes-validations: + - message: path must be relative to the + data mount and must not contain '..' + rule: '!self.startsWith(''/'') && !self.contains(''..'')' + required: + - field + - path + type: object + apiKeyEnv: + description: |- + APIKeyEnv is the game-image env that receives the shared CurseForge + API key (e.g. "CF_API_KEY") through a secretKeyRef to a server-owned + Secret, while the admin has key sharing on. Only valid when the + provider is curseforge. + maxLength: 64 + pattern: ^[A-Za-z_][A-Za-z0-9_]*$ + type: string env: description: |- Env are additional fixed env applied alongside RefEnv when a modpack @@ -744,6 +779,27 @@ spec: type: object maxItems: 16 type: array + missingFilesPath: + description: |- + MissingFilesPath is the file, relative to the data mount, where the + image lists files that need a manual download + (e.g. "MODS_NEED_DOWNLOAD.txt"). + maxLength: 128 + type: string + x-kubernetes-validations: + - message: missingFilesPath must be relative + to the data mount and must not contain '..' + rule: '!self.startsWith(''/'') && !self.contains(''..'')' + needsKeyImageTags: + description: |- + NeedsKeyImageTags lists image tags (the part after ":" and before "@") + that have no built-in CurseForge key. Servers on these images get this + provider only while key sharing is on. + items: + maxLength: 64 + type: string + maxItems: 8 + type: array refEnv: description: |- RefEnv, when set, is the game-image env the operator points at the @@ -754,7 +810,22 @@ spec: Thunderstore/BepInEx pack). maxLength: 64 type: string + versionEnv: + description: |- + VersionEnv is the game-image env the operator sets to the pinned pack + version id (e.g. "MODRINTH_VERSION", "CF_FILE_ID", + "FTB_MODPACK_VERSION_ID"). Required for env-mode packs that support + pinning; when empty the registry is not offered for pinned install. + maxLength: 64 + pattern: ^[A-Za-z_][A-Za-z0-9_]*$ + type: string type: object + modpacksOnly: + description: |- + ModpacksOnly hides this provider from the Mods tab: it is offered only + in the Modpacks tab (e.g. "ftb", whose registry has packs but no + single-mod listing). Requires Modpacks to be set to be useful. + type: boolean provider: description: |- Provider names the built-in registry engine: "modrinth" (Minecraft @@ -772,7 +843,8 @@ spec: "spigot" (SpigotMC plugins via the Spiget API, keyless), "github" (one repository's Releases stand in for versions, keyless but rate-limited — see GitHub), or "umod" (Rust/Hurtworld/7 Days to - Die's Oxide/uMod plugin ecosystem, keyless). + Die's Oxide/uMod plugin ecosystem, keyless), or "ftb" (Feed The Beast + modpacks, keyless, modpack-only: it has no single-mod browse). enum: - modrinth - thunderstore @@ -784,6 +856,7 @@ spec: - github - umod - nexus + - ftb type: string steamAppID: description: |- @@ -807,6 +880,10 @@ spec: is curseforge rule: self.provider != 'curseforge' || (has(self.curseforgeGameID) && self.curseforgeGameID > 0) + - message: modpacks.apiKeyEnv is only valid when provider + is curseforge + rule: '!has(self.modpacks) || !has(self.modpacks.apiKeyEnv) + || self.provider == ''curseforge''' maxItems: 8 minItems: 1 type: array diff --git a/operator/internal/controller/gameserver_controller.go b/operator/internal/controller/gameserver_controller.go index c482f9879..c948f1900 100644 --- a/operator/internal/controller/gameserver_controller.go +++ b/operator/internal/controller/gameserver_controller.go @@ -53,7 +53,10 @@ type GameServerReconciler struct { // WakeStartLimit caps simultaneous idle cold starts across managed namespaces. WakeStartLimit int WakeStartNamespace string - Scheme *runtime.Scheme + // ControlPlaneNamespace holds the managed mod-registry key Secret that + // modpack servers receive a CurseForge key from. Empty disables key sharing. + ControlPlaneNamespace string + Scheme *runtime.Scheme // AgentImage is the container image used for the sidecar agent // injected into every game pod. Set from an operator flag so the @@ -263,11 +266,14 @@ const ( // // +kubebuilder:rbac:groups=gameplane.local,resources=gameservers,verbs=get;list;watch // +kubebuilder:rbac:groups=gameplane.local,resources=gametemplates,verbs=get;list;watch +// +kubebuilder:rbac:groups=gameplane.local,resources=backups,verbs=get;list;watch // +kubebuilder:rbac:groups=apps,resources=statefulsets,verbs=get;list;watch // +kubebuilder:rbac:groups=apps,resources=deployments,verbs=get;list;watch // +kubebuilder:rbac:groups=batch,resources=jobs,verbs=get;list;watch // Secret reads/writes are granted only by namespace Roles in config/rbac and // the chart, matching cmd/main.go's per-object Secret cache namespace set. +// Key sharing reads gameplane-modreg-curseforge from the control-plane +// namespace (same namespace Role). // +kubebuilder:rbac:groups=core,resources=services;persistentvolumeclaims;configmaps,verbs=get;list;watch // +kubebuilder:rbac:groups=core,resources=pods;pods/log,verbs=get;list;watch // +kubebuilder:rbac:groups="",resources=pods/ephemeralcontainers,verbs=get;list;watch @@ -384,6 +390,16 @@ func (r *GameServerReconciler) Reconcile(ctx context.Context, req ctrl.Request) return ctrl.Result{}, r.setPhase(ctx, &gs, err.Error()) } + // Spec 035: start a modpack change before any pod template is built, so + // this pass already renders status.modpack.applied. + if err := r.reconcileModpackChange(ctx, &gs, &tmpl); err != nil { + if apierrors.IsConflict(err) { + return requeueOnConflict(ctrl.Result{}, err) + } + logger.Error(err, "reconcile modpack change") + return ctrl.Result{}, err + } + if err := r.reconcilePVC(ctx, &gs, &tmpl); err != nil { logger.Error(err, "reconcile PVC") return ctrl.Result{}, err @@ -441,6 +457,13 @@ func (r *GameServerReconciler) Reconcile(ctx context.Context, req ctrl.Request) logger.Error(err, "reconcile rcon Secret") return ctrl.Result{}, err } + if err := r.reconcileModpackKey(ctx, &gs, &tmpl); err != nil { + if apierrors.IsConflict(err) { + return requeueOnConflict(ctrl.Result{}, err) + } + logger.Error(err, "reconcile modpack key Secret") + return ctrl.Result{}, err + } // Idle policy runs before the replica computation so a sleep or wake // decided this pass is already reflected in the count below. It writes // only annotations; its status read model is folded into reconcileStatus' @@ -550,6 +573,20 @@ func (r *GameServerReconciler) Reconcile(ctx context.Context, req ctrl.Request) logger.Error(err, "reconcile StatefulSet") return ctrl.Result{}, err } + if err := r.reconcileModpackRollout(ctx, &gs); err != nil { + if apierrors.IsConflict(err) { + return requeueOnConflict(ctrl.Result{}, err) + } + logger.Error(err, "reconcile modpack rollout") + return ctrl.Result{}, err + } + if err := r.reconcileModpackAnnotations(ctx, &gs); err != nil { + if apierrors.IsConflict(err) { + return requeueOnConflict(ctrl.Result{}, err) + } + logger.Error(err, "reconcile modpack annotations") + return ctrl.Result{}, err + } var recoveryRetry time.Duration if replicas == 1 && stopRequeue == 0 { recoveryRetry, err = r.recoverObsoleteFailedPod(ctx, &gs) @@ -616,7 +653,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} + hints := []time.Duration{stopRequeue, idleRequeue, recoveryRetry, modpackKeyRequeue(&gs)} if _, held, _ := lifecycleOwner(&gs); held { hints = append(hints, 5*time.Second) } @@ -655,17 +692,32 @@ func (r *GameServerReconciler) SetupWithManager(mgr ctrl.Manager) error { Owns(&corev1.PersistentVolumeClaim{}). Owns(&networkingv1.NetworkPolicy{}). Owns(&gameplanev1alpha1.BackupSchedule{}). + Owns(&gameplanev1alpha1.Backup{}). Owns(&corev1.Secret{}). Owns(&corev1.ConfigMap{}). Owns(&corev1.ServiceAccount{}). Owns(&rbacv1.Role{}). Owns(&rbacv1.RoleBinding{}). Watches(&corev1.Pod{}, handler.EnqueueRequestsFromMapFunc(r.mapPodToGameServer)). + // Modpack backups carry no owner reference (they outlive the server), so + // Owns(&Backup{}) never fires for them; map them to spec.serverRef instead. + Watches(&gameplanev1alpha1.Backup{}, handler.EnqueueRequestsFromMapFunc(mapModpackBackupToGameServer)). Watches(&gameplanev1alpha1.GameTemplate{}, handler.EnqueueRequestsFromMapFunc(r.mapTemplateToGameServers), builder.WithPredicates(predicate.GenerationChangedPredicate{})). Complete(r) } +// mapModpackBackupToGameServer maps a Backup carrying the modpack-change label +// to the server named by spec.serverRef in the same namespace. Other Backups +// map to nothing: their GameServer is woken through Owns(&Backup{}) as before. +func mapModpackBackupToGameServer(_ context.Context, obj client.Object) []reconcile.Request { + b, ok := obj.(*gameplanev1alpha1.Backup) + if !ok || b.Labels[modpackBackupLabel] == "" || b.Spec.ServerRef.Name == "" { + return nil + } + return []reconcile.Request{{NamespacedName: types.NamespacedName{Namespace: b.Namespace, Name: b.Spec.ServerRef.Name}}} +} + // Template creation and spec changes must wake servers that failed before any // child workload existed. Status-only template updates need no reconciliation. func (r *GameServerReconciler) mapTemplateToGameServers(ctx context.Context, obj client.Object) []reconcile.Request { @@ -2010,6 +2062,12 @@ func (r *GameServerReconciler) reconcileStatefulSet( } // Volumes and InitContainers are assigned wholesale so removing // configFiles from the template strips them on the next reconcile. + // Spec 035 R5: a removal empties the active loader's mods mount once + // (before the game starts); nil for every other state. + var initContainers []corev1.Container + if wipe := modpackWipeInit(r.ConfigInitImage, gs, tmpl, ver, r.AgentResources); wipe != nil { + initContainers = append(initContainers, *wipe) + } if len(mc.files) > 0 { items := make([]corev1.KeyToPath, 0, len(mc.files)) for _, f := range mc.files { @@ -2024,10 +2082,9 @@ func (r *GameServerReconciler) reconcileStatefulSet( }, }, }) - ss.Spec.Template.Spec.InitContainers = []corev1.Container{buildConfigInitContainer(r.ConfigInitImage, tmpl, r.AgentResources)} - } else { - ss.Spec.Template.Spec.InitContainers = nil + initContainers = append(initContainers, buildConfigInitContainer(r.ConfigInitImage, tmpl, r.AgentResources)) } + ss.Spec.Template.Spec.InitContainers = initContainers // Per-(version+loader) mod volume, nested at storage.mountPath/ // so the game image reads mods from its usual dir while they persist // on their own PVC. Assigned wholesale with the rest, so switching to @@ -2574,7 +2631,14 @@ func buildGameContainer( if e := modIDListEnv(tmpl, gs, env); e != nil { env = append(env, *e) } - env = append(env, gs.Spec.Env...) + // Spec 035: for a server with a managed modpack spec.env is stripped of + // every modpack-declared env name and the applied pack's env follows it + // (legacy servers are returned unchanged); see gameserver_modpack.go. + env = append(env, modpackSpecEnv(gs, tmpl)...) + env = append(env, modpackPackEnv(gs, tmpl)...) + if e := modpackKeyEnv(gs, tmpl); e != nil { + env = append(env, *e) + } // The operator-managed RCON password wins, so the game and the agent // sidecar always agree on it. if e := rconGameEnv(gs, tmpl); e != nil { diff --git a/operator/internal/controller/gameserver_modpack.go b/operator/internal/controller/gameserver_modpack.go new file mode 100644 index 000000000..546384070 --- /dev/null +++ b/operator/internal/controller/gameserver_modpack.go @@ -0,0 +1,686 @@ +package controller + +import ( + "context" + "crypto/sha256" + "encoding/hex" + "encoding/json" + "fmt" + "path" + "reflect" + "regexp" + "sort" + + 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" + "sigs.k8s.io/controller-runtime/pkg/client" + + gameplanev1alpha1 "github.com/GameplanePanel/gameplane/operator/api/v1alpha1" +) + +// Spec 035 (specs/035-curseforge-modpacks/contracts/operator-modpack.md). +// +// The API writes GameServer.spec.modpack and never touches spec.env. The +// operator owns two things here: rendering the pack's env into the game +// container (rule 1) and the change state machine that moves +// status.modpack through Pending -> BackingUp -> Applying -> Applied. Key +// sharing (rule 5) is not in this change (OD-9: the key reaches pods through +// apiKeyEnv/secretKeyRef, handled elsewhere). + +// modpackProviders returns the template's registry providers that declare a +// modpacks block, in template order. +func modpackProviders(tmpl *gameplanev1alpha1.GameTemplate) []gameplanev1alpha1.ModProvider { + if tmpl == nil || tmpl.Spec.Capabilities == nil || tmpl.Spec.Capabilities.Mods == nil || + tmpl.Spec.Capabilities.Mods.Registry == nil { + return nil + } + var out []gameplanev1alpha1.ModProvider + for _, p := range tmpl.Spec.Capabilities.Mods.Registry.Providers { + if p.Modpacks != nil { + out = append(out, p) + } + } + return out +} + +// modpackDeclaredEnvNames is every env name any provider's modpacks block owns: +// refEnv, versionEnv, apiKeyEnv and each fixed env[].name. +func modpackDeclaredEnvNames(tmpl *gameplanev1alpha1.GameTemplate) map[string]struct{} { + names := map[string]struct{}{} + for _, p := range modpackProviders(tmpl) { + for _, n := range []string{p.Modpacks.RefEnv, p.Modpacks.VersionEnv, p.Modpacks.APIKeyEnv} { + if n != "" { + names[n] = struct{}{} + } + } + for _, e := range p.Modpacks.Env { + names[e.Name] = struct{}{} + } + } + return names +} + +const ( + // modpackRequestAnnotation is stamped on the Backup of a change with the + // removal or install request id (empty when absent), so a retry that only changes + // the remove annotation is told apart from the attempt that failed. + modpackRequestAnnotation = "gameplane.local/modpack-request-id" + // modpackBackupLabel marks Backups created by a modpack change. + modpackBackupLabel = "gameplane.local/modpack-change" + // backupDestinationLabel is the discovery label of a restic destination + // Secret (api/internal/handlers/destinations.go); keys: repo, password. + backupDestinationLabel = "gameplane.local/backup-destination" + // modpackWipeInitName is the one-shot init container that empties the mods mount. + modpackWipeInitName = "modpack-wipe" + // modpackWipeMarkerPrefix + generation names the marker file in the mods mount. + modpackWipeMarkerPrefix = ".gameplane-mods-wiped-" + modpackMessageMax = 512 +) + +var modpackProjectRe = regexp.MustCompile(`^[A-Za-z0-9._-]{1,128}$`) + +// modpackRemoval is the JSON in the gameplane.local/modpack-remove annotation. +type modpackRemoval struct { + RequestID string `json:"requestId"` + BackupFirst bool `json:"backupFirst"` +} + +// modpackRemovalRequest parses the remove annotation. ok is false when it is +// absent. Malformed JSON still counts as a removal request, without a backup, +// with the raw text as its id. +func modpackRemovalRequest(gs *gameplanev1alpha1.GameServer) (req modpackRemoval, ok bool) { + raw := gs.Annotations[gameplanev1alpha1.ModpackRemoveAnnotation] + if raw == "" { + return modpackRemoval{}, false + } + if err := json.Unmarshal([]byte(raw), &req); err != nil { + return modpackRemoval{RequestID: raw}, true + } + return req, true +} + +// modpackWantsBackup reports whether the current change asks for a backup first. +func modpackWantsBackup(gs *gameplanev1alpha1.GameServer) bool { + if gs.Spec.Modpack != nil { + return gs.Spec.Modpack.BackupFirst + } + req, ok := modpackRemovalRequest(gs) + return ok && req.BackupFirst +} + +// modpackRequestID is the removal request id when a removal is requested, +// otherwise spec.modpack.requestId, the id the API sets on each install ("" when +// absent). +func modpackRequestID(gs *gameplanev1alpha1.GameServer) string { + if req, ok := modpackRemovalRequest(gs); ok { + return req.RequestID + } + if gs.Spec.Modpack == nil { + return "" + } + return gs.Spec.Modpack.RequestID +} + +// modpackLegacyRender reports that the pod must keep rendering the pre-035 env +// (spec.env verbatim, no pack env): the server is adopted and the pack is not +// applied yet, or an adopted server's change is still waiting on its backup. +// Rendering switches the moment the change reaches Applying. +func modpackLegacyRender(gs *gameplanev1alpha1.GameServer) bool { + if gs.Annotations[gameplanev1alpha1.ModpackAdoptedAnnotation] != "true" { + return false + } + st := gs.Status.Modpack + if st == nil { + return true + } + switch st.Phase { + case gameplanev1alpha1.ModpackPhasePending, + gameplanev1alpha1.ModpackPhaseBackingUp, + gameplanev1alpha1.ModpackPhaseBackupFailed: + return true + } + return false +} + +// modpackAdoptedHold reports an adopted server whose pin is still held back: +// adopted annotation, spec.modpack recorded by the API sweep, nothing applied +// yet, and no removal requested. +func modpackAdoptedHold(gs *gameplanev1alpha1.GameServer) bool { + if gs.Annotations[gameplanev1alpha1.ModpackAdoptedAnnotation] != "true" || + gs.Status.Modpack != nil || gs.Spec.Modpack == nil { + return false + } + _, removing := modpackRemovalRequest(gs) + return !removing +} + +// modpackAdoptedRemovalRef recovers the identity of an adopted, never-pinned +// pack from spec.env when its removal is requested (status.modpack is nil, so +// there is no applied record). Nil when the server is not adopted, no removal +// is requested, or no provider's refEnv has a value. +func modpackAdoptedRemovalRef(gs *gameplanev1alpha1.GameServer, tmpl *gameplanev1alpha1.GameTemplate) *gameplanev1alpha1.ModpackRef { + if gs.Annotations[gameplanev1alpha1.ModpackAdoptedAnnotation] != "true" { + return nil + } + if _, removing := modpackRemovalRequest(gs); !removing { + return nil + } + for _, p := range modpackProviders(tmpl) { + if p.Modpacks.RefEnv == "" { + continue + } + for _, e := range gs.Spec.Env { + if e.Name == p.Modpacks.RefEnv && e.Value != "" { + project := e.Value + if !modpackProjectRe.MatchString(project) { + project = "unknown" // refEnv may hold a URL; the CRD pattern forbids it + } + return &gameplanev1alpha1.ModpackRef{Provider: p.Provider, Project: project} + } + } + } + return nil +} + +// modpackSpecMatchesApplied reports that spec.modpack equals status.modpack.applied +// (both absent counts as equal). +func modpackSpecMatchesApplied(gs *gameplanev1alpha1.GameServer) bool { + var applied *gameplanev1alpha1.ModpackRef + if gs.Status.Modpack != nil { + applied = gs.Status.Modpack.Applied + } + if gs.Spec.Modpack == nil || applied == nil { + return gs.Spec.Modpack == nil && applied == nil + } + return gs.Spec.Modpack.ModpackRef == *applied +} + +// modpackManaged reports whether the operator owns this server's pack env. +// A server that has never had spec.modpack and has no status.modpack is a +// legacy server whose pack env still lives in spec.env (written by the +// pre-035 API); it must render exactly as before so the first reconcile after +// an operator upgrade never rolls its pod. status.modpack, once created, is +// never dropped, so a removed pack (applied == nil) stays managed and its +// stale spec.env entries cannot come back. An adopted server keeps the legacy +// rendering until its pin is applied (modpackLegacyRender). +func modpackManaged(gs *gameplanev1alpha1.GameServer) bool { + if modpackLegacyRender(gs) { + return false + } + return gs.Spec.Modpack != nil || gs.Status.Modpack != nil +} + +// modpackSpecEnv returns spec.env as the game container sees it: unchanged for +// a legacy server, otherwise without any entry named like a modpack-declared +// env, so a stale MODRINTH_MODPACK / CF_SLUG / TYPE=MODRINTH left in spec.env +// can never run a second pack (FR-004). +// +// Only spec.env is filtered, not the whole merged env: template and version +// env legitimately define names that are also fixed pack env (every +// minecraft-java version sets TYPE=PAPER/FORGE/...), and removing a pack must +// leave that loader TYPE in place. +func modpackSpecEnv(gs *gameplanev1alpha1.GameServer, tmpl *gameplanev1alpha1.GameTemplate) []corev1.EnvVar { + if !modpackManaged(gs) { + return gs.Spec.Env + } + declared := modpackDeclaredEnvNames(tmpl) + out := make([]corev1.EnvVar, 0, len(gs.Spec.Env)) + for _, e := range gs.Spec.Env { + if _, drop := declared[e.Name]; !drop { + out = append(out, e) + } + } + return out +} + +// modpackPackEnv is the env of the pack the pod renders now +// (status.modpack.applied): the provider's fixed env, refEnv=project and, +// when a version is pinned, versionEnv=version. Nil for a legacy server, no +// applied pack, or an applied provider the template no longer declares with +// modpacks. It is appended after spec.env so it wins on duplicate names. +func modpackPackEnv(gs *gameplanev1alpha1.GameServer, tmpl *gameplanev1alpha1.GameTemplate) []corev1.EnvVar { + if gs.Status.Modpack == nil || gs.Status.Modpack.Applied == nil || modpackLegacyRender(gs) { + return nil + } + applied := gs.Status.Modpack.Applied + for _, p := range modpackProviders(tmpl) { + if p.Provider != applied.Provider { + continue + } + mp := p.Modpacks + out := make([]corev1.EnvVar, 0, len(mp.Env)+2) + for i := range mp.Env { + out = append(out, *mp.Env[i].DeepCopy()) + } + if mp.RefEnv != "" { + out = append(out, corev1.EnvVar{Name: mp.RefEnv, Value: applied.Project}) + } + if mp.VersionEnv != "" && applied.Version != "" { + out = append(out, corev1.EnvVar{Name: mp.VersionEnv, Value: applied.Version}) + } + return out + } + return nil +} + +// modpackStart decides whether spec.modpack differs from what the pod renders +// (status.modpack.applied) and, if so, returns the next status. changed is +// false when nothing needs to move. Pure. +// +// backupName "" starts the change as Applying (applied = desired, the pod +// renders it); a non-empty backupName parks it in BackingUp with applied +// unchanged, so the old pack keeps rendering until the backup succeeds. +// When spec has gone back to what is applied while a change was waiting +// (Pending/BackingUp/BackupFailed) the change is abandoned: phase Applied. +// observedGeneration records the generation of the change handled, so it +// moves only when a change starts. +func modpackStart( + gs *gameplanev1alpha1.GameServer, tmpl *gameplanev1alpha1.GameTemplate, backupName string, +) (next *gameplanev1alpha1.GameServerModpackStatus, changed bool) { + var desired *gameplanev1alpha1.ModpackRef + if gs.Spec.Modpack != nil { + ref := gs.Spec.Modpack.ModpackRef + desired = &ref + } + cur := gs.Status.Modpack + var applied *gameplanev1alpha1.ModpackRef + next = &gameplanev1alpha1.GameServerModpackStatus{} + switch { + case cur != nil: + applied = cur.Applied + next = cur.DeepCopy() + case desired == nil: + // An adopted pack removed before it was ever pinned has no applied + // record; recover its identity from spec.env (rule 2 + removal). + applied = modpackAdoptedRemovalRef(gs, tmpl) + if applied == nil { + return nil, false + } + } + if reflect.DeepEqual(desired, applied) { + switch next.Phase { + case gameplanev1alpha1.ModpackPhasePending, + gameplanev1alpha1.ModpackPhaseBackingUp, + gameplanev1alpha1.ModpackPhaseBackupFailed: + next.Phase = gameplanev1alpha1.ModpackPhaseApplied + next.BackupName = "" + next.Message = "" + return next, true + } + return next, false + } + next.ObservedGeneration = gs.Generation + next.Message = "" + if backupName != "" { + next.Applied = applied + next.Phase = gameplanev1alpha1.ModpackPhaseBackingUp + next.BackupName = backupName + next.Target = desired + next.RequestID = modpackRequestID(gs) + return next, true + } + next.Target = nil + next.RequestID = "" + next.Applied = desired + next.Phase = gameplanev1alpha1.ModpackPhaseApplying + next.BackupName = "" + return next, true +} + +// modpackReadyCondition derives ModpackReady from status.modpack.phase: True +// when Applied, otherwise False with the phase as Reason. Nil (no condition) +// while the server has never had a managed pack. +func modpackReadyCondition(gs *gameplanev1alpha1.GameServer) *metav1.Condition { + st := gs.Status.Modpack + if st == nil || st.Phase == "" { + return nil + } + c := &metav1.Condition{ + Type: gameplanev1alpha1.GameServerConditionModpackReady, + ObservedGeneration: gs.Generation, + Reason: string(st.Phase), + } + if st.Phase == gameplanev1alpha1.ModpackPhaseApplied { + c.Status = metav1.ConditionTrue + c.Message = "the modpack is applied" + return c + } + c.Status = metav1.ConditionFalse + c.Message = st.Message + if c.Message == "" { + c.Message = "the modpack change is " + string(st.Phase) + } + return c +} + +// statefulSetRolledOut reports that the StatefulSet controller has seen the +// latest pod template and every pod is on the update revision. Ready is +// deliberately not required: a pack whose install blocks on a manual download +// crash-loops, and the change must still read Applied so the operator can pick +// another version. +func statefulSetRolledOut(ss *appsv1.StatefulSet) bool { + return ss.Generation > 0 && + ss.Status.ObservedGeneration >= ss.Generation && + ss.Status.UpdateRevision != "" && + ss.Status.UpdatedReplicas == ss.Status.Replicas +} + +// patchModpackStatus stores next in gs.Status.Modpack, refreshes the +// ModpackReady condition and issues a JSON merge patch of only status. The +// patch target is a copy so the caller's gs keeps the in-memory values the +// rest of this reconcile (env rendering, reconcileStatus' own base copy) reads, +// the same pattern as patchCaptureStatus. +func (r *GameServerReconciler) patchModpackStatus( + ctx context.Context, gs *gameplanev1alpha1.GameServer, next *gameplanev1alpha1.GameServerModpackStatus, +) error { + base := gs.DeepCopy() + gs.Status.Modpack = next + if c := modpackReadyCondition(gs); c != nil { + gs.Status.Conditions = upsertCondition(gs.Status.Conditions, *c) + } + if reflect.DeepEqual(base.Status, gs.Status) { + return nil + } + if err := r.Status().Patch(ctx, gs.DeepCopy(), client.MergeFrom(base)); err != nil { + return fmt.Errorf("patch modpack status for %s: %w", gs.Name, err) + } + return nil +} + +// reconcileModpackChange moves a modpack change forward. It runs before the +// StatefulSet is built, and updates gs in memory, so the same pass renders the +// new applied pack into the pod template. +// +// Order: (1) a change parked in BackingUp/BackupFailed is driven first; +// (2) an adopted server's pin stays held until the pod is stopped or no +// players are online (rule 2, OD-8 B); (3) a new change starts, creating a +// Backup first when the change asks for one and a destination exists. +func (r *GameServerReconciler) reconcileModpackChange( + ctx context.Context, gs *gameplanev1alpha1.GameServer, tmpl *gameplanev1alpha1.GameTemplate, +) error { + if st := gs.Status.Modpack; st != nil && + (st.Phase == gameplanev1alpha1.ModpackPhaseBackingUp || st.Phase == gameplanev1alpha1.ModpackPhaseBackupFailed) { + done, err := r.driveModpackBackup(ctx, gs, tmpl) + if err != nil || done { + return err + } + } + if modpackAdoptedHold(gs) { + released, err := r.modpackHoldReleased(ctx, gs) + if err != nil || !released { + return err + } + } + first, changed := modpackStart(gs, tmpl, "") + if !changed { + return nil + } + if first.Phase == gameplanev1alpha1.ModpackPhaseApplying && modpackWantsBackup(gs) { + name, err := r.createModpackBackup(ctx, gs) + if err != nil { + return err + } + if name != "" { + next, _ := modpackStart(gs, tmpl, name) + return r.patchModpackStatus(ctx, gs, next) + } + } + return r.patchModpackStatus(ctx, gs, first) +} + +// driveModpackBackup advances a change parked in BackingUp or BackupFailed. +// done is true when this pass must not start or apply anything else. It +// returns done=false when the change was superseded (spec.modpack or the +// request id moved on from the recorded target, or the Backup is gone) so the +// caller restarts the flow from the top. +func (r *GameServerReconciler) driveModpackBackup( + ctx context.Context, gs *gameplanev1alpha1.GameServer, tmpl *gameplanev1alpha1.GameTemplate, +) (done bool, err error) { + st := gs.Status.Modpack + if st.BackupName == "" || st.RequestID != modpackRequestID(gs) { + return false, nil + } + // Superseded only when the desired pack moved on from what this change + // started from; unrelated spec edits (env, resources, suspend) bump the + // generation without changing the change. + var desired *gameplanev1alpha1.ModpackRef + if gs.Spec.Modpack != nil { + ref := gs.Spec.Modpack.ModpackRef + desired = &ref + } + if !reflect.DeepEqual(desired, st.Target) { + return false, nil + } + var b gameplanev1alpha1.Backup + switch err := r.wipeReader().Get(ctx, client.ObjectKey{Namespace: gs.Namespace, Name: st.BackupName}, &b); { + case apierrors.IsNotFound(err): + return false, nil + case err != nil: + return false, fmt.Errorf("get modpack backup %s/%s: %w", gs.Namespace, st.BackupName, err) + } + if b.Annotations[modpackRequestAnnotation] != modpackRequestID(gs) { + return false, nil + } + if st.Phase == gameplanev1alpha1.ModpackPhaseBackupFailed { + return true, nil // keep applied + the remove annotation; a new change or request id retries + } + switch b.Status.Phase { + case gameplanev1alpha1.BackupPhaseSucceeded: + next, changed := modpackStart(gs, tmpl, "") + if !changed { + return false, nil + } + next.BackupName = st.BackupName + return true, r.patchModpackStatus(ctx, gs, next) + case gameplanev1alpha1.BackupPhaseFailed: + next := st.DeepCopy() + next.Phase = gameplanev1alpha1.ModpackPhaseBackupFailed + next.Message = b.Status.Message + if next.Message == "" { + next.Message = "the backup before the modpack change failed" + } + if m := []rune(next.Message); len(m) > modpackMessageMax { + next.Message = string(m[:modpackMessageMax]) + } + return true, r.patchModpackStatus(ctx, gs, next) + } + return true, nil // Pending/Running/unset: keep waiting; the Backup watch wakes us +} + +// modpackBackupRepo returns the name of the namespace's backup destination +// Secret (first by name), or "" when there is none. +func (r *GameServerReconciler) modpackBackupRepo(ctx context.Context, namespace string) (string, error) { + var list corev1.SecretList + if err := r.wipeReader().List(ctx, &list, client.InNamespace(namespace), + client.MatchingLabels{backupDestinationLabel: "true"}); err != nil { + return "", fmt.Errorf("list backup destinations in %s: %w", namespace, err) + } + if len(list.Items) == 0 { + return "", nil + } + names := make([]string, 0, len(list.Items)) + for i := range list.Items { + names = append(names, list.Items[i].Name) + } + sort.Strings(names) + return names[0], nil +} + +// createModpackBackup creates (or finds) the Backup for the current change and +// returns its name; "" with a nil error when the namespace has no destination +// (backupFirst is then skipped). The name is -modpack-; a retry +// of a removal at the same generation, told apart by request id, gets a +// request-id suffix instead. +func (r *GameServerReconciler) createModpackBackup( + ctx context.Context, gs *gameplanev1alpha1.GameServer, +) (string, error) { + repo, err := r.modpackBackupRepo(ctx, gs.Namespace) + if err != nil || repo == "" { + return "", err + } + requestID := modpackRequestID(gs) + name := fmt.Sprintf("%s-modpack-%d", gs.Name, gs.Generation) + var existing gameplanev1alpha1.Backup + switch err := r.wipeReader().Get(ctx, client.ObjectKey{Namespace: gs.Namespace, Name: name}, &existing); { + case err == nil: + if existing.Annotations[modpackRequestAnnotation] == requestID { + return name, nil + } + sum := sha256.Sum256([]byte(requestID)) + name += "-" + hex.EncodeToString(sum[:])[:8] + case !apierrors.IsNotFound(err): + return "", fmt.Errorf("get modpack backup %s/%s: %w", gs.Namespace, name, err) + } + b := &gameplanev1alpha1.Backup{ + ObjectMeta: metav1.ObjectMeta{ + Name: name, + Namespace: gs.Namespace, + Labels: map[string]string{modpackBackupLabel: "true"}, + }, + Spec: gameplanev1alpha1.BackupSpec{ + ServerRef: gameplanev1alpha1.LocalObjectRef{Name: gs.Name}, + RepoRef: &gameplanev1alpha1.SecretKeySelector{Name: repo, Key: "repo"}, + // No omitempty on the field: an unset false would override the CRD default. + Quiesce: true, + }, + } + if requestID != "" { + b.Annotations = map[string]string{modpackRequestAnnotation: requestID} + } + // Deliberately no owner reference (valgul, OD-11 A): like scheduled backups, + // the Backup and its restic snapshot survive deleting the server. The modpack + // label and serverRef tie it to the server. + if err := r.Create(ctx, b); err != nil { + if apierrors.IsAlreadyExists(err) { + return name, nil // an earlier pass created it before its status patch landed + } + return "", fmt.Errorf("create modpack backup %s: %w", name, err) + } + return name, nil +} + +// modpackHoldReleased reports whether an adopted server's pin may be applied now +// (OD-8 B): right away when the server is stopped or asleep (no StatefulSet, or +// live spec.replicas == 0), otherwise only when the pack has a version and the +// agent reports a known player count of 0. An unknown count never releases. +func (r *GameServerReconciler) modpackHoldReleased(ctx context.Context, gs *gameplanev1alpha1.GameServer) (bool, error) { + return r.modpackServerQuiet(ctx, gs, true) +} + +// modpackServerQuiet reports whether a pod template change may roll the server +// now (OD-8 B, OD-10 A): right away when stopped or asleep (no StatefulSet, or +// live replicas 0), otherwise only on a known player count of 0. An unknown +// count never counts as quiet. needVersion additionally requires the adopted +// pack to have a version (OD-8 only). +func (r *GameServerReconciler) modpackServerQuiet(ctx context.Context, gs *gameplanev1alpha1.GameServer, needVersion bool) (bool, error) { + var ss appsv1.StatefulSet + switch err := r.wipeReader().Get(ctx, client.ObjectKeyFromObject(gs), &ss); { + case apierrors.IsNotFound(err): + return true, nil + case err != nil: + return false, fmt.Errorf("get StatefulSet for modpack restart gate of %s: %w", gs.Name, err) + } + if ss.Spec.Replicas != nil && *ss.Spec.Replicas == 0 { + return true, nil + } + if needVersion && gs.Spec.Modpack.Version == "" { + return false, nil + } + a := gs.Status.Agent + return a != nil && a.PlayersOnline != nil && *a.PlayersOnline == 0, nil +} + +// reconcileModpackRollout finishes a change: Applying becomes Applied once the +// StatefulSet has rolled the new pod template. It runs after the StatefulSet is +// written and reads it live, because the informer cache may still hold the +// pre-write object and would report an old, finished rollout. +func (r *GameServerReconciler) reconcileModpackRollout(ctx context.Context, gs *gameplanev1alpha1.GameServer) error { + st := gs.Status.Modpack + if st == nil || st.Phase != gameplanev1alpha1.ModpackPhaseApplying { + return nil + } + var ss appsv1.StatefulSet + if err := r.wipeReader().Get(ctx, client.ObjectKeyFromObject(gs), &ss); err != nil { + if apierrors.IsNotFound(err) { + return nil + } + return fmt.Errorf("get StatefulSet for modpack rollout of %s: %w", gs.Name, err) + } + if !statefulSetRolledOut(&ss) { + return nil + } + next := st.DeepCopy() + next.Phase = gameplanev1alpha1.ModpackPhaseApplied + return r.patchModpackStatus(ctx, gs, next) +} + +// reconcileModpackAnnotations runs after the StatefulSet is written. It drops +// the adopted annotation once the pin (or removal) is rendered (Applying or +// Applied), and the remove annotation once the removal is Applied. A removal +// whose backup failed keeps it (phase BackupFailed) so the API can retry. +func (r *GameServerReconciler) reconcileModpackAnnotations(ctx context.Context, gs *gameplanev1alpha1.GameServer) error { + st := gs.Status.Modpack + if st == nil { + return nil + } + var drop []string + if _, ok := gs.Annotations[gameplanev1alpha1.ModpackAdoptedAnnotation]; ok && + (st.Phase == gameplanev1alpha1.ModpackPhaseApplying || st.Phase == gameplanev1alpha1.ModpackPhaseApplied) { + drop = append(drop, gameplanev1alpha1.ModpackAdoptedAnnotation) + } + if _, ok := modpackRemovalRequest(gs); ok && + st.Phase == gameplanev1alpha1.ModpackPhaseApplied && modpackSpecMatchesApplied(gs) { + drop = append(drop, gameplanev1alpha1.ModpackRemoveAnnotation) + } + if len(drop) == 0 { + return nil + } + base := gs.DeepCopy() + patched := gs.DeepCopy() + for _, k := range drop { + delete(patched.Annotations, k) + } + if err := r.Patch(ctx, patched, client.MergeFrom(base)); err != nil { + return fmt.Errorf("clear modpack annotations on %s: %w", gs.Name, err) + } + for _, k := range drop { + delete(gs.Annotations, k) + } + return nil +} + +// modpackWipeInit is the one-shot init step of a removal (R5): it empties the +// active loader's mods mount (and only that mount, never the data volume) unless +// the marker file for this removal's generation already exists. Rendered while +// status.modpack has no applied pack and the removal is Applying/Applied; nil +// otherwise, so installing or switching packs never wipes. Nil too when the +// active version has no per-loader mod volume (nothing safe to empty). +func modpackWipeInit( + image string, gs *gameplanev1alpha1.GameServer, tmpl *gameplanev1alpha1.GameTemplate, + ver *gameplanev1alpha1.GameVersion, defaults ...*corev1.ResourceRequirements, +) *corev1.Container { + st := gs.Status.Modpack + if st == nil || st.Applied != nil || + (st.Phase != gameplanev1alpha1.ModpackPhaseApplying && st.Phase != gameplanev1alpha1.ModpackPhaseApplied) { + return nil + } + mount := modVolumeMount(tmpl, ver) + if mount == nil { + return nil + } + marker := path.Join(mount.MountPath, fmt.Sprintf("%s%d", modpackWipeMarkerPrefix, st.ObservedGeneration)) + return &corev1.Container{ + Name: modpackWipeInitName, + Image: configInitImageOrDefault(image), + Resources: auxiliaryResources(optionalResources(defaults), "25m", "64Mi"), + Command: []string{"/bin/sh", "-c"}, + // $1 = mods mount, $2 = marker. Paths are positional args, never interpolated. + Args: []string{ + `[ -e "$2" ] && exit 0; find "$1" -mindepth 1 -maxdepth 1 -exec rm -rf {} + && touch "$2"`, + modpackWipeInitName, mount.MountPath, marker, + }, + VolumeMounts: []corev1.VolumeMount{{Name: mount.Name, MountPath: mount.MountPath}}, + } +} diff --git a/operator/internal/controller/gameserver_modpack_adopt_envtest_test.go b/operator/internal/controller/gameserver_modpack_adopt_envtest_test.go new file mode 100644 index 000000000..53cbd26d3 --- /dev/null +++ b/operator/internal/controller/gameserver_modpack_adopt_envtest_test.go @@ -0,0 +1,190 @@ +//go:build envtest + +package controller + +import ( + "context" + "encoding/json" + "fmt" + "testing" + "time" + + appsv1 "k8s.io/api/apps/v1" + corev1 "k8s.io/api/core/v1" + "k8s.io/apimachinery/pkg/types" + + gameplanev1alpha1 "github.com/GameplanePanel/gameplane/operator/api/v1alpha1" +) + +// ssOf returns the server's StatefulSet. +func ssOf(t *testing.T, ns, name string) *appsv1.StatefulSet { + t.Helper() + var ss appsv1.StatefulSet + if err := k8sClient.Get(context.Background(), types.NamespacedName{Namespace: ns, Name: name}, &ss); err != nil { + t.Fatalf("get statefulset: %v", err) + } + return &ss +} + +// podTemplateJSON is the pod template as a comparable string. +func podTemplateJSON(t *testing.T, ns, name string) string { + t.Helper() + b, err := json.Marshal(ssOf(t, ns, name).Spec.Template) + if err != nil { + t.Fatalf("marshal pod template: %v", err) + } + return string(b) +} + +// startLegacyModrinthServer creates a running (replicas 1) server whose pre-035 +// pack env lives in spec.env, with no spec.modpack. +func startLegacyModrinthServer(t *testing.T, ns, name string) { + t.Helper() + tmpl := buildModpackTemplate(uniqueName("minecraft")) + if err := k8sClient.Create(context.Background(), tmpl); err != nil { + t.Fatalf("create template: %v", err) + } + deleteCleanup(t, tmpl) + gs := buildGameServer(ns, name, tmpl.Name) + gs.Spec.Version = "1.21.4-forge" + gs.Spec.Env = []corev1.EnvVar{ + {Name: "MODRINTH_MODPACK", Value: "legacy-slug"}, + {Name: "TYPE", Value: "MODRINTH"}, + } + if err := k8sClient.Create(context.Background(), gs); err != nil { + t.Fatalf("create gameserver: %v", err) + } + eventually(t, func() (bool, string) { + env, why := gameEnvOf(ns, name) + if why != "" { + return false, why + } + if got, _ := envValue(env, "MODRINTH_MODPACK"); got != "legacy-slug" { + return false, "MODRINTH_MODPACK=" + got + } + ss := ssOf(t, ns, name) + if ss.Spec.Replicas == nil || *ss.Spec.Replicas != 1 { + return false, "statefulset not at replicas 1" + } + return true, "" + }) +} + +// adoptServer simulates the API's legacy sweep: spec.modpack plus the adopted annotation. +func adoptServer(t *testing.T, ns, name, version string) { + t.Helper() + mutateGameServer(t, ns, name, func(g *gameplanev1alpha1.GameServer) { + g.Spec.Modpack = modpackSpecOf("modrinth", "legacy-slug", version) + if g.Annotations == nil { + g.Annotations = map[string]string{} + } + g.Annotations[gameplanev1alpha1.ModpackAdoptedAnnotation] = "true" + }) +} + +func assertPinRendered(t *testing.T, ns, name string) { + t.Helper() + eventually(t, func() (bool, string) { + env, why := gameEnvOf(ns, name) + if why != "" { + return false, why + } + if got, _ := envValue(env, "MODRINTH_VERSION"); got != "v-abc" { + return false, "MODRINTH_VERSION=" + got + } + if n := envCount(env, "MODRINTH_MODPACK"); n != 1 { + return false, fmt.Sprintf("MODRINTH_MODPACK appears %d times, want 1", n) + } + return true, "" + }) +} + +// TestGameServer_ModpackAdoptedKeepsLegacyEnvUntilQuiet covers spec 035 T029 +// (rule 2, OD-8 B): a legacy server and an adopted server whose pod runs keep an +// identical pod template while players are online or unknown; with a known 0 +// players the pin is rendered (one rollout) and the adopted annotation removed. +func TestGameServer_ModpackAdoptedKeepsLegacyEnvUntilQuiet(t *testing.T) { + ns := newNamespace(t) + startMgr(t, ns, withGameServerReconciler(t, ns)) + startLegacyModrinthServer(t, ns, "pack") + legacy := podTemplateJSON(t, ns, "pack") + + // Not-yet-swept legacy server: nothing moves. + consistently(t, time.Second, func() (bool, string) { + if got := podTemplateJSON(t, ns, "pack"); got != legacy { + return false, "pod template changed for a legacy server" + } + if getGameServer(t, ns, "pack").Status.Modpack != nil { + return false, "status.modpack created for a legacy server" + } + return true, "" + }) + + // Sweep: adopted with a version. Players unknown, then online: still no roll. + adoptServer(t, ns, "pack", "v-abc") + setAgentPlayers(t, ns, "pack", nil) + consistently(t, 2*time.Second, func() (bool, string) { + if got := podTemplateJSON(t, ns, "pack"); got != legacy { + return false, "pod template changed while players are unknown" + } + return true, "" + }) + setAgentPlayers(t, ns, "pack", int32Ptr(3)) + consistently(t, 2*time.Second, func() (bool, string) { + if got := podTemplateJSON(t, ns, "pack"); got != legacy { + return false, "pod template changed while players are online" + } + live := getGameServer(t, ns, "pack") + if live.Status.Modpack != nil { + return false, fmt.Sprintf("status.modpack = %+v while players are online", live.Status.Modpack) + } + if live.Annotations[gameplanev1alpha1.ModpackAdoptedAnnotation] != "true" { + return false, "adopted annotation removed before the pin was rendered" + } + return true, "" + }) + + // Quiet: the pin is rendered, exactly one rollout, annotation removed. + before := ssOf(t, ns, "pack").Generation + setAgentPlayers(t, ns, "pack", int32Ptr(0)) + assertPinRendered(t, ns, "pack") + modpackReadyIs(t, ns, "pack", "True") + eventually(t, func() (bool, string) { + if _, ok := getGameServer(t, ns, "pack").Annotations[gameplanev1alpha1.ModpackAdoptedAnnotation]; ok { + return false, "adopted annotation still set" + } + return true, "" + }) + after := ssOf(t, ns, "pack").Generation + if after != before+1 { + t.Fatalf("statefulset generation %d -> %d, want exactly one rollout", before, after) + } + consistently(t, time.Second, func() (bool, string) { + if g := ssOf(t, ns, "pack").Generation; g != after { + return false, fmt.Sprintf("statefulset generation moved to %d after the pin", g) + } + return true, "" + }) +} + +// TestGameServer_ModpackAdoptedStoppedPinsImmediately: an adopted server that is +// stopped (replicas 0) gets the pin right away, whatever the player count. +func TestGameServer_ModpackAdoptedStoppedPinsImmediately(t *testing.T) { + ns := newNamespace(t) + startMgr(t, ns, withGameServerReconciler(t, ns)) + startLegacyModrinthServer(t, ns, "pack") + setAgentPlayers(t, ns, "pack", int32Ptr(5)) + + mutateGameServer(t, ns, "pack", func(g *gameplanev1alpha1.GameServer) { g.Spec.Suspend = true }) + eventually(t, func() (bool, string) { + ss := ssOf(t, ns, "pack") + if ss.Spec.Replicas == nil || *ss.Spec.Replicas != 0 { + return false, "statefulset not scaled to zero" + } + return true, "" + }) + + adoptServer(t, ns, "pack", "v-abc") + assertPinRendered(t, ns, "pack") + modpackReadyIs(t, ns, "pack", "True") +} diff --git a/operator/internal/controller/gameserver_modpack_backup_envtest_test.go b/operator/internal/controller/gameserver_modpack_backup_envtest_test.go new file mode 100644 index 000000000..08fdf925f --- /dev/null +++ b/operator/internal/controller/gameserver_modpack_backup_envtest_test.go @@ -0,0 +1,260 @@ +//go:build envtest + +package controller + +import ( + "context" + "fmt" + "strings" + "testing" + "time" + + corev1 "k8s.io/api/core/v1" + "k8s.io/apimachinery/pkg/api/meta" + 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/client" + + gameplanev1alpha1 "github.com/GameplanePanel/gameplane/operator/api/v1alpha1" +) + +// seedBackupDestination creates the labelled restic destination Secret the +// operator discovers in a server's namespace. +func seedBackupDestination(t *testing.T, ns, name string) { + t.Helper() + s := &corev1.Secret{ + ObjectMeta: metav1.ObjectMeta{Name: name, Namespace: ns, Labels: map[string]string{backupDestinationLabel: "true"}}, + StringData: map[string]string{"repo": "rest:http://restic.local/repo", "password": "test-secret"}, + } + if err := k8sClient.Create(context.Background(), s); err != nil { + t.Fatalf("create backup destination: %v", err) + } +} + +// markBackupFailed fakes the Backup controller reporting a failed run. +func markBackupFailed(t *testing.T, ns, name, msg string) { + t.Helper() + if err := retry.RetryOnConflict(retry.DefaultRetry, func() error { + var b gameplanev1alpha1.Backup + if err := k8sClient.Get(context.Background(), types.NamespacedName{Namespace: ns, Name: name}, &b); err != nil { + return err + } + b.Status.Phase = gameplanev1alpha1.BackupPhaseFailed + b.Status.Message = msg + return k8sClient.Status().Update(context.Background(), &b) + }); err != nil { + t.Fatalf("mark backup failed: %v", err) + } +} + +// mutateGameServer applies mut to a fresh copy and updates it, retrying conflicts +// (the reconciler writes status and annotations concurrently). +func mutateGameServer(t *testing.T, ns, name string, mut func(gs *gameplanev1alpha1.GameServer)) { + t.Helper() + if err := retry.RetryOnConflict(retry.DefaultRetry, func() error { + gs := getGameServer(t, ns, name) + mut(gs) + return k8sClient.Update(context.Background(), gs) + }); err != nil { + t.Fatalf("update gameserver %s: %v", name, err) + } +} + +// waitModpackPhase polls until status.modpack.phase is want and returns that status. +func waitModpackPhase(t *testing.T, ns, name string, want gameplanev1alpha1.ModpackPhase) *gameplanev1alpha1.GameServerModpackStatus { + t.Helper() + var got *gameplanev1alpha1.GameServerModpackStatus + eventually(t, func() (bool, string) { + st := getGameServer(t, ns, name).Status.Modpack + if st == nil || st.Phase != want { + return false, fmt.Sprintf("status.modpack = %+v, want phase %s", st, want) + } + got = st + return true, "" + }) + return got +} + +// waitGameEnv polls until the game container env has key=want. +func waitGameEnv(t *testing.T, ns, name, key, want string) { + t.Helper() + eventually(t, func() (bool, string) { + env, why := gameEnvOf(ns, name) + if why != "" { + return false, why + } + if got, _ := envValue(env, key); got != want { + return false, fmt.Sprintf("%s=%q, want %q", key, got, want) + } + return true, "" + }) +} + +func readyCondition(ns, name string, t *testing.T) *metav1.Condition { + t.Helper() + return meta.FindStatusCondition(getGameServer(t, ns, name).Status.Conditions, gameplanev1alpha1.GameServerConditionModpackReady) +} + +// TestGameServer_ModpackBackupFirstThenApply covers spec 035 T028: backupFirst +// creates Backup -modpack- with no owner (it outlives the server) and the env +// stays on the old version until it succeeds; a failed backup parks the change +// in BackupFailed with the message and applied unchanged; a new change after +// BackupFailed restarts the flow. +func TestGameServer_ModpackBackupFirstThenApply(t *testing.T) { + ns := newNamespace(t) + startMgr(t, ns, withGameServerReconciler(t, ns)) + seedBackupDestination(t, ns, "dest") + + tmpl := buildModpackTemplate(uniqueName("minecraft")) + if err := k8sClient.Create(context.Background(), tmpl); err != nil { + t.Fatalf("create template: %v", err) + } + deleteCleanup(t, tmpl) + + gs := buildGameServer(ns, "pack", tmpl.Name) + gs.Spec.Version = "1.21.4-forge" + gs.Spec.Modpack = modpackSpecOf("curseforge", "all-the-mods-10", "100") + if err := k8sClient.Create(context.Background(), gs); err != nil { + t.Fatalf("create gameserver: %v", err) + } + modpackReadyIs(t, ns, "pack", "True") + waitGameEnv(t, ns, "pack", "CF_FILE_ID", "100") + + // Change with a backup: Backup created, old env keeps rendering. + mutateGameServer(t, ns, "pack", func(g *gameplanev1alpha1.GameServer) { + g.Spec.Modpack = modpackSpecOf("curseforge", "all-the-mods-10", "200") + g.Spec.Modpack.BackupFirst = true + }) + st := waitModpackPhase(t, ns, "pack", gameplanev1alpha1.ModpackPhaseBackingUp) + firstName := fmt.Sprintf("pack-modpack-%d", st.ObservedGeneration) + if st.BackupName != firstName { + t.Fatalf("status.modpack.backupName = %q, want %q", st.BackupName, firstName) + } + if gen := getGameServer(t, ns, "pack").Generation; st.ObservedGeneration != gen { + t.Fatalf("observedGeneration = %d, want %d", st.ObservedGeneration, gen) + } + b := getBackup(t, ns, firstName) + if len(b.OwnerReferences) != 0 { + t.Fatalf("backup ownerReferences = %+v, want none (survives deleting the server)", b.OwnerReferences) + } + if b.Labels[modpackBackupLabel] != "true" { + t.Fatalf("backup labels = %v, want %s=true", b.Labels, modpackBackupLabel) + } + if b.Spec.ServerRef.Name != "pack" || b.Spec.RepoRef == nil || b.Spec.RepoRef.Name != "dest" || b.Spec.RepoRef.Key != "repo" { + t.Fatalf("backup spec = %+v, want serverRef pack, repoRef dest/repo", b.Spec) + } + consistently(t, 2*time.Second, func() (bool, string) { + env, why := gameEnvOf(ns, "pack") + if why != "" { + return false, why + } + if got, _ := envValue(env, "CF_FILE_ID"); got != "100" { + return false, "CF_FILE_ID=" + got + " while the backup runs, want 100" + } + live := getGameServer(t, ns, "pack").Status.Modpack + if live == nil || live.Phase != gameplanev1alpha1.ModpackPhaseBackingUp || live.Applied == nil || live.Applied.Version != "100" { + return false, fmt.Sprintf("status.modpack = %+v, want BackingUp with applied 100", live) + } + if c := readyCondition(ns, "pack", t); c == nil || c.Status != metav1.ConditionFalse || c.Reason != "BackingUp" { + return false, fmt.Sprintf("ModpackReady = %+v, want False/BackingUp", c) + } + return true, "" + }) + + markBackupSucceeded(t, ns, firstName, "snap-1", "") + waitGameEnv(t, ns, "pack", "CF_FILE_ID", "200") + modpackReadyIs(t, ns, "pack", "True") + if st := getGameServer(t, ns, "pack").Status.Modpack; st == nil || st.Applied == nil || st.Applied.Version != "200" || st.BackupName != firstName { + t.Fatalf("status.modpack after backup = %+v, want applied 200, backupName %s", st, firstName) + } + + // Failed backup: BackupFailed, message set, env and applied unchanged. + mutateGameServer(t, ns, "pack", func(g *gameplanev1alpha1.GameServer) { + g.Spec.Modpack = modpackSpecOf("curseforge", "all-the-mods-10", "300") + g.Spec.Modpack.BackupFirst = true + }) + var failedName string + eventually(t, func() (bool, string) { + st := getGameServer(t, ns, "pack").Status.Modpack + if st == nil || st.Phase != gameplanev1alpha1.ModpackPhaseBackingUp || st.BackupName == firstName { + return false, fmt.Sprintf("status.modpack = %+v, want BackingUp with a new backup", st) + } + failedName = st.BackupName + return true, "" + }) + markBackupFailed(t, ns, failedName, "restic: repository unreachable") + st = waitModpackPhase(t, ns, "pack", gameplanev1alpha1.ModpackPhaseBackupFailed) + if !strings.Contains(st.Message, "repository unreachable") { + t.Fatalf("message = %q, want the backup's reason", st.Message) + } + if st.Applied == nil || st.Applied.Version != "200" { + t.Fatalf("applied after failed backup = %+v, want version 200", st.Applied) + } + consistently(t, 1500*time.Millisecond, func() (bool, string) { + env, why := gameEnvOf(ns, "pack") + if why != "" { + return false, why + } + if got, _ := envValue(env, "CF_FILE_ID"); got != "200" { + return false, "CF_FILE_ID=" + got + " after a failed backup, want 200" + } + if live := getGameServer(t, ns, "pack").Status.Modpack; live == nil || live.Phase != gameplanev1alpha1.ModpackPhaseBackupFailed { + return false, fmt.Sprintf("status.modpack = %+v, want BackupFailed", live) + } + return true, "" + }) + if c := readyCondition(ns, "pack", t); c == nil || c.Status != metav1.ConditionFalse || c.Reason != "BackupFailed" || + !strings.Contains(c.Message, "repository unreachable") { + t.Fatalf("ModpackReady = %+v, want False/BackupFailed with the message", c) + } + + // A new change restarts the flow with a new Backup. + mutateGameServer(t, ns, "pack", func(g *gameplanev1alpha1.GameServer) { + g.Spec.Modpack = modpackSpecOf("curseforge", "all-the-mods-10", "400") + g.Spec.Modpack.BackupFirst = true + }) + var retryName string + eventually(t, func() (bool, string) { + st := getGameServer(t, ns, "pack").Status.Modpack + if st == nil || st.Phase != gameplanev1alpha1.ModpackPhaseBackingUp || st.BackupName == failedName || st.BackupName == "" { + return false, fmt.Sprintf("status.modpack = %+v, want BackingUp with a newer backup", st) + } + retryName = st.BackupName + return true, "" + }) + markBackupSucceeded(t, ns, retryName, "snap-2", "") + waitGameEnv(t, ns, "pack", "CF_FILE_ID", "400") + modpackReadyIs(t, ns, "pack", "True") +} + +// TestGameServer_ModpackBackupFirstWithoutDestinationApplies: backupFirst is +// honoured only when a destination exists; without one the change applies +// directly and no Backup is created. +func TestGameServer_ModpackBackupFirstWithoutDestinationApplies(t *testing.T) { + ns := newNamespace(t) + startMgr(t, ns, withGameServerReconciler(t, ns)) + + tmpl := buildModpackTemplate(uniqueName("minecraft")) + if err := k8sClient.Create(context.Background(), tmpl); err != nil { + t.Fatalf("create template: %v", err) + } + deleteCleanup(t, tmpl) + + gs := buildGameServer(ns, "pack", tmpl.Name) + gs.Spec.Version = "1.21.4-forge" + gs.Spec.Modpack = modpackSpecOf("curseforge", "all-the-mods-10", "100") + gs.Spec.Modpack.BackupFirst = true + if err := k8sClient.Create(context.Background(), gs); err != nil { + t.Fatalf("create gameserver: %v", err) + } + waitGameEnv(t, ns, "pack", "CF_FILE_ID", "100") + modpackReadyIs(t, ns, "pack", "True") + var backups gameplanev1alpha1.BackupList + if err := k8sClient.List(context.Background(), &backups, client.InNamespace(ns)); err != nil { + t.Fatalf("list backups: %v", err) + } + if len(backups.Items) != 0 { + t.Fatalf("created %d backups without a destination, want 0", len(backups.Items)) + } +} diff --git a/operator/internal/controller/gameserver_modpack_envtest_test.go b/operator/internal/controller/gameserver_modpack_envtest_test.go new file mode 100644 index 000000000..0f1575c2f --- /dev/null +++ b/operator/internal/controller/gameserver_modpack_envtest_test.go @@ -0,0 +1,282 @@ +//go:build envtest + +package controller + +import ( + "context" + "fmt" + "testing" + "time" + + appsv1 "k8s.io/api/apps/v1" + corev1 "k8s.io/api/core/v1" + "k8s.io/apimachinery/pkg/api/meta" + "k8s.io/apimachinery/pkg/types" + "k8s.io/client-go/util/retry" + + gameplanev1alpha1 "github.com/GameplanePanel/gameplane/operator/api/v1alpha1" +) + +// buildModpackTemplate is the versioned minecraft-like template plus the three +// registry providers spec 035 declares in the minecraft-java module. +func buildModpackTemplate(name string) *gameplanev1alpha1.GameTemplate { + t := buildVersionedTemplate(name) + gameID := int32(432) + t.Spec.Capabilities.Mods.Registry = &gameplanev1alpha1.ModRegistrySpec{ + Providers: []gameplanev1alpha1.ModProvider{ + { + Provider: "modrinth", + Modpacks: &gameplanev1alpha1.ModpackSpec{ + RefEnv: "MODRINTH_MODPACK", + VersionEnv: "MODRINTH_VERSION", + Env: []corev1.EnvVar{{Name: "TYPE", Value: "MODRINTH"}}, + }, + }, + { + Provider: "curseforge", + CurseForgeGameID: &gameID, + Modpacks: &gameplanev1alpha1.ModpackSpec{ + RefEnv: "CF_SLUG", + VersionEnv: "CF_FILE_ID", + APIKeyEnv: "CF_API_KEY", + Env: []corev1.EnvVar{ + {Name: "TYPE", Value: "AUTO_CURSEFORGE"}, + {Name: "CF_DOWNLOADS_REPO", Value: "/data/downloads"}, + }, + }, + }, + { + Provider: "ftb", + ModpacksOnly: true, + Modpacks: &gameplanev1alpha1.ModpackSpec{ + RefEnv: "FTB_MODPACK_ID", + VersionEnv: "FTB_MODPACK_VERSION_ID", + Env: []corev1.EnvVar{{Name: "TYPE", Value: "FTBA"}}, + }, + }, + }, + } + return t +} + +// gameEnvOf returns the game container's env from the server's StatefulSet. +func gameEnvOf(ns, name string) ([]corev1.EnvVar, string) { + var ss appsv1.StatefulSet + if err := k8sClient.Get(context.Background(), types.NamespacedName{Namespace: ns, Name: name}, &ss); err != nil { + return nil, "statefulset: " + err.Error() + } + game := containerByName(ss.Spec.Template.Spec.Containers, gameContainerName) + if game == nil { + return nil, "no game container" + } + return game.Env, "" +} + +// markStatefulSetRolledOut fakes the StatefulSet controller (envtest has none): +// it reports the latest template generation as observed and every pod updated. +func markStatefulSetRolledOut(ns, name string) error { + return retry.RetryOnConflict(retry.DefaultRetry, func() error { + var ss appsv1.StatefulSet + if err := k8sClient.Get(context.Background(), types.NamespacedName{Namespace: ns, Name: name}, &ss); err != nil { + return err + } + ss.Status.ObservedGeneration = ss.Generation + ss.Status.UpdateRevision = fmt.Sprintf("%s-rev-%d", name, ss.Generation) + ss.Status.Replicas, ss.Status.UpdatedReplicas = 1, 1 + return k8sClient.Status().Update(context.Background(), &ss) + }) +} + +// modpackReadyIs polls until ModpackReady has the wanted status, faking a +// finished rollout on every poll (a reconcile may bump the StatefulSet +// generation between polls). +func modpackReadyIs(t *testing.T, ns, name string, want string) { + t.Helper() + eventually(t, func() (bool, string) { + if err := markStatefulSetRolledOut(ns, name); err != nil { + return false, "mark rolled out: " + err.Error() + } + gs := getGameServer(t, ns, name) + c := meta.FindStatusCondition(gs.Status.Conditions, gameplanev1alpha1.GameServerConditionModpackReady) + if c == nil { + return false, "no ModpackReady condition" + } + if string(c.Status) != want { + return false, fmt.Sprintf("ModpackReady=%s reason=%s", c.Status, c.Reason) + } + return true, "" + }) +} + +func setModpack(t *testing.T, ns, name string, mp *gameplanev1alpha1.GameServerModpackSpec) { + t.Helper() + if err := retry.RetryOnConflict(retry.DefaultRetry, func() error { + gs := getGameServer(t, ns, name) + gs.Spec.Modpack = mp + return k8sClient.Update(context.Background(), gs) + }); err != nil { + t.Fatalf("set spec.modpack: %v", err) + } +} + +func modpackSpecOf(provider, project, version string) *gameplanev1alpha1.GameServerModpackSpec { + return &gameplanev1alpha1.GameServerModpackSpec{ + ModpackRef: gameplanev1alpha1.ModpackRef{Provider: provider, Project: project, Version: version}, + } +} + +// TestGameServer_ModpackEnvRenderingAndReady covers spec 035 rule 1 and the +// backup-less state machine: stale pack env in spec.env is stripped, each +// provider's fixed env + refEnv + versionEnv is rendered, switching providers +// leaves no trace of the previous one, removal returns the version's loader +// TYPE, and ModpackReady reaches True once the StatefulSet has rolled. +func TestGameServer_ModpackEnvRenderingAndReady(t *testing.T) { + ns := newNamespace(t) + startMgr(t, ns, withGameServerReconciler(t, ns)) + + tmpl := buildModpackTemplate(uniqueName("minecraft")) + if err := k8sClient.Create(context.Background(), tmpl); err != nil { + t.Fatalf("create template: %v", err) + } + deleteCleanup(t, tmpl) + + gs := buildGameServer(ns, "pack", tmpl.Name) + gs.Spec.Version = "1.21.4-forge" + gs.Spec.Env = []corev1.EnvVar{ + {Name: "FOO", Value: "bar"}, + // Stale pack env a pre-035 API write (or a user) left in spec.env. + {Name: "MODRINTH_MODPACK", Value: "stale-slug"}, + {Name: "FTB_MODPACK_ID", Value: "9"}, + {Name: "TYPE", Value: "MODRINTH"}, + } + gs.Spec.Modpack = modpackSpecOf("curseforge", "all-the-mods-10", "6512345") + if err := k8sClient.Create(context.Background(), gs); err != nil { + t.Fatalf("create gameserver: %v", err) + } + + // CurseForge applied: its set is rendered, every other provider's names are gone. + eventually(t, func() (bool, string) { + env, why := gameEnvOf(ns, "pack") + if why != "" { + return false, why + } + for name, want := range map[string]string{ + "CF_SLUG": "all-the-mods-10", "CF_FILE_ID": "6512345", + "TYPE": "AUTO_CURSEFORGE", "CF_DOWNLOADS_REPO": "/data/downloads", "FOO": "bar", + } { + if got, ok := envValue(env, name); !ok || got != want { + return false, fmt.Sprintf("%s=%q (present=%v), want %q", name, got, ok, want) + } + } + for _, gone := range []string{"MODRINTH_MODPACK", "FTB_MODPACK_ID", "MODRINTH_VERSION"} { + if envCount(env, gone) != 0 { + return false, gone + " still rendered" + } + } + // spec.env's stale TYPE=MODRINTH is stripped; the version's TYPE=FORGE stays + // before the pack's, so TYPE appears exactly twice with the pack's last. + if envCount(env, "TYPE") != 2 { + return false, fmt.Sprintf("TYPE appears %d times, want 2", envCount(env, "TYPE")) + } + return true, "" + }) + modpackReadyIs(t, ns, "pack", "True") + if st := getGameServer(t, ns, "pack").Status.Modpack; st == nil || st.Phase != gameplanev1alpha1.ModpackPhaseApplied || + st.Applied == nil || st.Applied.Project != "all-the-mods-10" { + t.Fatalf("status.modpack = %+v, want Applied all-the-mods-10", st) + } + + // Switch to FTB: no CurseForge name survives. + setModpack(t, ns, "pack", modpackSpecOf("ftb", "777", "4242")) + eventually(t, func() (bool, string) { + env, why := gameEnvOf(ns, "pack") + if why != "" { + return false, why + } + for name, want := range map[string]string{ + "FTB_MODPACK_ID": "777", "FTB_MODPACK_VERSION_ID": "4242", "TYPE": "FTBA", + } { + if got, ok := envValue(env, name); !ok || got != want { + return false, fmt.Sprintf("%s=%q (present=%v), want %q", name, got, ok, want) + } + } + for _, gone := range []string{"CF_SLUG", "CF_FILE_ID", "CF_DOWNLOADS_REPO"} { + if envCount(env, gone) != 0 { + return false, gone + " still rendered" + } + } + return true, "" + }) + + // Remove: nothing of any provider remains and the loader's TYPE is back. + setModpack(t, ns, "pack", nil) + eventually(t, func() (bool, string) { + env, why := gameEnvOf(ns, "pack") + if why != "" { + return false, why + } + for _, gone := range []string{"FTB_MODPACK_ID", "FTB_MODPACK_VERSION_ID", "CF_SLUG", "MODRINTH_MODPACK"} { + if envCount(env, gone) != 0 { + return false, gone + " still rendered" + } + } + if got, _ := envValue(env, "TYPE"); got != "FORGE" { + return false, "TYPE=" + got + ", want the version's FORGE" + } + if got, _ := envValue(env, "FOO"); got != "bar" { + return false, "unrelated spec.env FOO lost" + } + return true, "" + }) + modpackReadyIs(t, ns, "pack", "True") + if st := getGameServer(t, ns, "pack").Status.Modpack; st == nil || st.Applied != nil { + t.Fatalf("status.modpack after removal = %+v, want applied nil", st) + } +} + +// TestGameServer_ModpackLegacyEnvUnchanged proves a server that never had +// spec.modpack keeps rendering its spec.env verbatim (no stripping, no +// status.modpack, no ModpackReady) so an operator upgrade never rolls it. +func TestGameServer_ModpackLegacyEnvUnchanged(t *testing.T) { + ns := newNamespace(t) + startMgr(t, ns, withGameServerReconciler(t, ns)) + + tmpl := buildModpackTemplate(uniqueName("minecraft")) + if err := k8sClient.Create(context.Background(), tmpl); err != nil { + t.Fatalf("create template: %v", err) + } + deleteCleanup(t, tmpl) + + gs := buildGameServer(ns, "legacy", tmpl.Name) + gs.Spec.Env = []corev1.EnvVar{ + {Name: "MODRINTH_MODPACK", Value: "legacy-slug"}, + {Name: "TYPE", Value: "MODRINTH"}, + } + if err := k8sClient.Create(context.Background(), gs); err != nil { + t.Fatalf("create gameserver: %v", err) + } + + eventually(t, func() (bool, string) { + env, why := gameEnvOf(ns, "legacy") + if why != "" { + return false, why + } + if got, _ := envValue(env, "MODRINTH_MODPACK"); got != "legacy-slug" { + return false, "MODRINTH_MODPACK=" + got + } + if got, _ := envValue(env, "TYPE"); got != "MODRINTH" { + return false, "TYPE=" + got + } + return true, "" + }) + consistently(t, 2*time.Second, func() (bool, string) { + live := getGameServer(t, ns, "legacy") + if live.Status.Modpack != nil { + return false, "status.modpack was created for a legacy server" + } + if meta.FindStatusCondition(live.Status.Conditions, gameplanev1alpha1.GameServerConditionModpackReady) != nil { + return false, "ModpackReady set for a legacy server" + } + return true, "" + }) +} diff --git a/operator/internal/controller/gameserver_modpack_key.go b/operator/internal/controller/gameserver_modpack_key.go new file mode 100644 index 000000000..4d7f424a1 --- /dev/null +++ b/operator/internal/controller/gameserver_modpack_key.go @@ -0,0 +1,225 @@ +package controller + +import ( + "context" + "fmt" + "time" + + corev1 "k8s.io/api/core/v1" + apierrors "k8s.io/apimachinery/pkg/api/errors" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/utils/ptr" + "sigs.k8s.io/controller-runtime/pkg/client" + "sigs.k8s.io/controller-runtime/pkg/controller/controllerutil" + "sigs.k8s.io/controller-runtime/pkg/log" + + gameplanev1alpha1 "github.com/GameplanePanel/gameplane/operator/api/v1alpha1" +) + +// modpackKeyRecheck bounds how long a rotation, key deletion or share toggle on +// the managed Secret takes to be read by CurseForge modpack servers. The operator +// cannot watch that Secret (resourceNames-scoped get only, spec 035 contract +// item 7), so it reads the Secret on each reconcile and requeues at this +// interval. A toggle that rolls the pod also waits for the server's quiet +// moment (OD-10 A), which the status heartbeat watch re-checks. +const modpackKeyRecheck = 60 * time.Second + +// modpackKeyRequeue is modpackKeyRecheck for a server with an applied +// CurseForge pack, else 0. +func modpackKeyRequeue(gs *gameplanev1alpha1.GameServer) time.Duration { + if gs.Status.Modpack != nil && gs.Status.Modpack.Applied != nil && + gs.Status.Modpack.Applied.Provider == "curseforge" { + return modpackKeyRecheck + } + return 0 +} + +// Spec 035 key sharing (rule 5, specs/035-curseforge-modpacks/contracts/ +// operator-modpack.md item 5/7, data-model.md "Secrets"). +// +// The API owns the managed Secret gameplane-modreg-curseforge in the +// control-plane namespace. When it is shared, each modpack server with an +// applied CurseForge pack gets a copy Secret -curseforge-key in its own +// namespace and the game container reads the key through a secretKeyRef. +// The key value never reaches the pod template, the config hash or the agent. +const ( + curseforgeKeyCopySuffix = "-curseforge-key" + curseforgeKeyCopyLabel = "gameplane.local/curseforge-key-copy" + curseforgeManagedName = "gameplane-modreg-curseforge" + curseforgeShareAnnotation = "gameplane.local/share-with-game-servers" + modRegistryLabel = "gameplane.local/mod-registry" + curseforgeKeyDataKey = "apiKey" +) + +func curseforgeKeySecretName(gs *gameplanev1alpha1.GameServer) string { + return gs.Name + curseforgeKeyCopySuffix +} + +// modpackKeyEnvName returns the apiKeyEnv of the applied provider when it is +// curseforge, else "". Legacy-rendered servers get no key env. +func modpackKeyEnvName(gs *gameplanev1alpha1.GameServer, tmpl *gameplanev1alpha1.GameTemplate) string { + if modpackLegacyRender(gs) || gs.Status.Modpack == nil || gs.Status.Modpack.Applied == nil { + return "" + } + applied := gs.Status.Modpack.Applied + if applied.Provider != "curseforge" { + return "" + } + for _, p := range modpackProviders(tmpl) { + if p.Provider == "curseforge" && p.Modpacks.APIKeyEnv != "" { + return p.Modpacks.APIKeyEnv + } + } + return "" +} + +// managedCurseForgeKey reads the managed key Secret from the control-plane +// namespace. It returns shared=false (no error) when the Secret is absent or +// sharing is off: label mod-registry=true, a non-empty apiKey and the share +// annotation set to "true" must all hold. +func (r *GameServerReconciler) managedCurseForgeKey(ctx context.Context) ([]byte, bool, error) { + if r.ControlPlaneNamespace == "" { + return nil, false, nil + } + // Uncached read: the chart grants get on this one Secret name only, and the + // manager cache does not watch the credentials namespace. + reader := r.APIReader + if reader == nil { + reader = r.Client + } + var sec corev1.Secret + if err := reader.Get(ctx, client.ObjectKey{Namespace: r.ControlPlaneNamespace, Name: curseforgeManagedName}, &sec); err != nil { + if apierrors.IsNotFound(err) { + log.FromContext(ctx).V(1).Info("managed mod-registry key not shared", + "namespace", r.ControlPlaneNamespace, "name", curseforgeManagedName, "reason", string(apierrors.ReasonForError(err))) + return nil, false, nil + } + if apierrors.IsForbidden(err) { + // Info level: a forbidden read means the operator Role is missing or + // misconfigured, which an operator should see without debug logging. + log.FromContext(ctx).Info("managed mod-registry key read forbidden; treating as not shared", + "namespace", r.ControlPlaneNamespace, "name", curseforgeManagedName, "reason", string(apierrors.ReasonForError(err))) + return nil, false, nil + } + return nil, false, fmt.Errorf("get managed key Secret %s/%s: %w", r.ControlPlaneNamespace, curseforgeManagedName, err) + } + key := sec.Data[curseforgeKeyDataKey] + if sec.Labels[modRegistryLabel] != "true" || len(key) == 0 || sec.Annotations[curseforgeShareAnnotation] != "true" { + return nil, false, nil + } + return key, true, nil +} + +// reconcileModpackKey creates, updates or deletes the per-server copy Secret +// and keeps status.modpack.keyShared in step with it. It runs after +// reconcileModpackChange, so an applied CurseForge pack is already in memory. +// The status patch mutates gs, so the same pass renders the key env. +func (r *GameServerReconciler) reconcileModpackKey( + ctx context.Context, gs *gameplanev1alpha1.GameServer, tmpl *gameplanev1alpha1.GameTemplate, +) error { + key, shared, err := r.managedCurseForgeKey(ctx) + if err != nil { + return err + } + envName := modpackKeyEnvName(gs, tmpl) + desired := envName != "" && shared + applied := gs.Status.Modpack != nil && gs.Status.Modpack.KeyShared + want := desired + // OD-10 A: a share toggle adds or removes the env in the pod template, which + // rolls the pod, so it takes effect only when the server is quiet (same gate + // as OD-8 B) or a pack change is already rolling it. Rotation (desired == + // applied) needs no restart and is not gated. Until the flip, the applied + // state and the env stay as they are. + if envName != "" && desired != applied { + quiet, err := r.modpackKeyFlipReady(ctx, gs) + if err != nil { + return err + } + if !quiet { + log.FromContext(ctx).V(1).Info("curseforge key share change waits for 0 players", + "server", gs.Name, "sharing", desired) + want = applied + } + } + sec := &corev1.Secret{ + ObjectMeta: metav1.ObjectMeta{Name: curseforgeKeySecretName(gs), Namespace: gs.Namespace}, + } + switch { + case desired: + // Also runs for a share-on change still pending: the copy is harmless + // before the env names it, and the env finds it the moment it flips. + err := r.upsertCurseForgeKeyCopy(ctx, gs, sec, key) + if err != nil { + return err + } + case want: + // Share-off change pending: keep the copy until the flip, so the running + // pod and any in-place container restart still resolve the env. + default: + if err := r.deleteIfControlledBy(ctx, gs, sec); err != nil { + return fmt.Errorf("delete curseforge key Secret %s/%s: %w", gs.Namespace, sec.Name, err) + } + } + if gs.Status.Modpack != nil && gs.Status.Modpack.KeyShared != want { + next := gs.Status.Modpack.DeepCopy() + next.KeyShared = want + return r.patchModpackStatus(ctx, gs, next) + } + return nil +} + +// modpackKeyFlipReady reports whether a share toggle may roll the server now: +// a pack change is already rolling it (phase Applying, the only phase in which +// the new pack renders), or the server is quiet (OD-8 B gate, without the +// version requirement). Pending, BackingUp and BackupFailed roll no pod, so +// they do not release a held toggle. A toggle landing during Applying after the +// pod already rolled causes one extra restart; accepted under OD-10. +func (r *GameServerReconciler) modpackKeyFlipReady(ctx context.Context, gs *gameplanev1alpha1.GameServer) (bool, error) { + if gs.Status.Modpack != nil && gs.Status.Modpack.Phase == gameplanev1alpha1.ModpackPhaseApplying { + return true, nil + } + return r.modpackServerQuiet(ctx, gs, false) +} + +// upsertCurseForgeKeyCopy creates or updates the per-server copy Secret with key. +func (r *GameServerReconciler) upsertCurseForgeKeyCopy( + ctx context.Context, gs *gameplanev1alpha1.GameServer, sec *corev1.Secret, key []byte, +) error { + _, err := controllerutil.CreateOrUpdate(ctx, r.Client, sec, func() error { + sec.Type = corev1.SecretTypeOpaque + if sec.Labels == nil { + sec.Labels = map[string]string{} + } + sec.Labels[curseforgeKeyCopyLabel] = "true" + sec.Data = map[string][]byte{curseforgeKeyDataKey: key} + return controllerutil.SetControllerReference(gs, sec, r.Scheme) + }) + if err != nil { + return fmt.Errorf("reconcile curseforge key Secret %s/%s: %w", gs.Namespace, sec.Name, err) + } + return nil +} + +// modpackKeyEnv returns the secretKeyRef env var for the applied CurseForge +// key, or nil unless the key is currently shared. The value is never inlined. +func modpackKeyEnv(gs *gameplanev1alpha1.GameServer, tmpl *gameplanev1alpha1.GameTemplate) *corev1.EnvVar { + if gs.Status.Modpack == nil || !gs.Status.Modpack.KeyShared { + return nil + } + name := modpackKeyEnvName(gs, tmpl) + if name == "" { + return nil + } + return &corev1.EnvVar{ + Name: name, + ValueFrom: &corev1.EnvVarSource{ + SecretKeyRef: &corev1.SecretKeySelector{ + LocalObjectReference: corev1.LocalObjectReference{Name: curseforgeKeySecretName(gs)}, + Key: curseforgeKeyDataKey, + // Optional: the pod still starts if the copy Secret is briefly + // missing during a share toggle. + Optional: ptr.To(true), + }, + }, + } +} diff --git a/operator/internal/controller/gameserver_modpack_key_envtest_test.go b/operator/internal/controller/gameserver_modpack_key_envtest_test.go new file mode 100644 index 000000000..8b32c88dd --- /dev/null +++ b/operator/internal/controller/gameserver_modpack_key_envtest_test.go @@ -0,0 +1,797 @@ +//go:build envtest + +package controller + +import ( + "context" + "encoding/json" + "fmt" + "strings" + "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" +) + +// Spec 035 key sharing envtest (rule 5). The managed key Secret lives in a +// control-plane namespace separate from the game namespace; it is read through the manager's API reader (uncached), and the operator does +// not watch that Secret, so tests kickGameServer after changing it. + +// withGameServerReconcilerKeyShare is withGameServerReconciler with the +// control-plane namespace set, so the reconciler reads the managed key there. +func withGameServerReconcilerKeyShare(t *testing.T, ns, ctrlNS string) 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, + ControlPlaneNamespace: ctrlNS, + }).SetupWithManager(mgr) + } +} + +// kickGameServer forces a reconcile without waiting for the 60s key recheck +// (the operator no longer watches the managed Secret): it bumps an annotation, +// and the For(&GameServer{}) watch enqueues the server. +func kickGameServer(t *testing.T, ns, name string) { + t.Helper() + if err := retry.RetryOnConflict(retry.DefaultRetry, func() error { + var gs gameplanev1alpha1.GameServer + if err := k8sClient.Get(context.Background(), types.NamespacedName{Namespace: ns, Name: name}, &gs); err != nil { + return err + } + if gs.Annotations == nil { + gs.Annotations = map[string]string{} + } + gs.Annotations["test.gameplane.local/kick"] = fmt.Sprint(time.Now().UnixNano()) + return k8sClient.Update(context.Background(), &gs) + }); err != nil { + t.Fatalf("kick GameServer: %v", err) + } +} + +// buildManagedCFKey is the API-owned managed key Secret, shared when share is true. +func buildManagedCFKey(ns, key string, share bool) *corev1.Secret { + ann := map[string]string{} + if share { + ann[curseforgeShareAnnotation] = "true" + } + return &corev1.Secret{ + ObjectMeta: metav1.ObjectMeta{ + Name: curseforgeManagedName, + Namespace: ns, + Labels: map[string]string{modRegistryLabel: "true"}, + Annotations: ann, + }, + Type: corev1.SecretTypeOpaque, + Data: map[string][]byte{"apiKey": []byte(key)}, + } +} + +// mutateManagedCFKey applies mut to the managed key Secret with a fresh read +// and retries on conflict. +func mutateManagedCFKey(t *testing.T, ns string, mut func(sec *corev1.Secret)) { + t.Helper() + if err := retry.RetryOnConflict(retry.DefaultRetry, func() error { + var sec corev1.Secret + if err := k8sClient.Get(context.Background(), types.NamespacedName{Namespace: ns, Name: curseforgeManagedName}, &sec); err != nil { + return err + } + if sec.Annotations == nil { + sec.Annotations = map[string]string{} + } + mut(&sec) + return k8sClient.Update(context.Background(), &sec) + }); err != nil { + t.Fatalf("update managed key Secret: %v", err) + } +} + +// keyCopyOf reads the per-server key copy with the uncached client. found is +// false when the copy does not exist. +func keyCopyOf(t *testing.T, ns, gsName string) (*corev1.Secret, bool) { + t.Helper() + var sec corev1.Secret + err := k8sClient.Get(context.Background(), types.NamespacedName{Namespace: ns, Name: gsName + curseforgeKeyCopySuffix}, &sec) + if apierrors.IsNotFound(err) { + return nil, false + } + if err != nil { + t.Fatalf("get key copy: %v", err) + } + return &sec, true +} + +// keyRefOf returns the secretKeyRef of the named env var, or nil when the +// var is absent or not sourced from a Secret. +func keyRefOf(env []corev1.EnvVar, name string) *corev1.SecretKeySelector { + for _, e := range env { + if e.Name == name && e.ValueFrom != nil { + return e.ValueFrom.SecretKeyRef + } + } + return nil +} + +// statefulSetOf returns the server's StatefulSet, or nil when absent. +func statefulSetOf(t *testing.T, ns, name string) *appsv1.StatefulSet { + t.Helper() + var ss appsv1.StatefulSet + if err := k8sClient.Get(context.Background(), types.NamespacedName{Namespace: ns, Name: name}, &ss); err != nil { + return nil + } + return &ss +} + +// keyShareStatus returns status.modpack.keyShared for the server. +func keyShareStatus(t *testing.T, ns, name string) bool { + t.Helper() + gs := getGameServer(t, ns, name) + return gs.Status.Modpack != nil && gs.Status.Modpack.KeyShared +} + +// TestGameServer_ModpackKeyShare_OnOff covers spec 035 rule 5 on a CurseForge +// pack: the copy Secret exists and is owned by the server, the game container +// reads CF_API_KEY only through a secretKeyRef (no literal value anywhere in +// the pod template), rotating the managed key updates only the copy without +// touching the pod template or its config hash, and turning sharing off and +// on removes and restores the copy and the env. +func TestGameServer_ModpackKeyShare_OnOff(t *testing.T) { + ns := newNamespace(t) + ctrlNS := newNamespace(t) + startMgr(t, ns, withGameServerReconcilerKeyShare(t, ns, ctrlNS)) + + if err := k8sClient.Create(context.Background(), buildManagedCFKey(ctrlNS, "key-one", true)); err != nil { + t.Fatalf("create managed key Secret: %v", err) + } + tmpl := buildModpackTemplate(uniqueName("minecraft")) + if err := k8sClient.Create(context.Background(), tmpl); err != nil { + t.Fatalf("create template: %v", err) + } + deleteCleanup(t, tmpl) + + gs := buildGameServer(ns, "keyed", tmpl.Name) + gs.Spec.Version = "1.21.4-forge" + gs.Spec.Modpack = modpackSpecOf("curseforge", "all-the-mods-10", "6512345") + if err := k8sClient.Create(context.Background(), gs); err != nil { + t.Fatalf("create gameserver: %v", err) + } + + eventually(t, func() (bool, string) { + sec, found := keyCopyOf(t, ns, "keyed") + if !found { + return false, "key copy Secret missing" + } + if got := string(sec.Data["apiKey"]); got != "key-one" { + return false, fmt.Sprintf("copy apiKey=%q, want key-one", got) + } + if !metav1.IsControlledBy(sec, getGameServer(t, ns, "keyed")) { + return false, "key copy is not controlled by the GameServer" + } + env, why := gameEnvOf(ns, "keyed") + if why != "" { + return false, why + } + ref := keyRefOf(env, "CF_API_KEY") + if ref == nil || ref.Name != "keyed-curseforge-key" || ref.Key != "apiKey" { + return false, fmt.Sprintf("CF_API_KEY secretKeyRef = %+v", ref) + } + if envCount(env, "CF_API_KEY") != 1 { + return false, "CF_API_KEY appears more than once" + } + if v, _ := envValue(env, "CF_API_KEY"); v != "" { + return false, "CF_API_KEY has a literal value" + } + if !keyShareStatus(t, ns, "keyed") { + return false, "status.modpack.keyShared is false" + } + return true, "" + }) + + ss := statefulSetOf(t, ns, "keyed") + if ss == nil { + t.Fatalf("statefulset missing after key share") + } + podJSON, err := json.Marshal(ss.Spec.Template.Spec) + if err != nil { + t.Fatalf("marshal pod spec: %v", err) + } + if strings.Contains(string(podJSON), "key-one") { + t.Fatalf("shared key value leaked into the pod template") + } + agent := containerByName(ss.Spec.Template.Spec.Containers, "agent") + if agent == nil { + t.Fatalf("agent container missing") + } + if envCount(agent.Env, "CF_API_KEY") != 0 { + t.Fatalf("agent container received CF_API_KEY") + } + + // Rotation: only the copy changes; the pod template and config hash stay. + hashBefore, hadHash := ss.Spec.Template.Annotations[configHashAnnotation] + envBefore, _ := json.Marshal(ss.Spec.Template.Spec.Containers) + + mutateManagedCFKey(t, ctrlNS, func(sec *corev1.Secret) { sec.Data["apiKey"] = []byte("key-two") }) + kickGameServer(t, ns, "keyed") + eventually(t, func() (bool, string) { + sec, found := keyCopyOf(t, ns, "keyed") + if !found { + return false, "key copy Secret missing after rotation" + } + if got := string(sec.Data["apiKey"]); got != "key-two" { + return false, fmt.Sprintf("copy apiKey=%q, want key-two", got) + } + return true, "" + }) + consistently(t, time.Second, func() (bool, string) { + cur := statefulSetOf(t, ns, "keyed") + if cur == nil { + return false, "statefulset missing" + } + got, had := cur.Spec.Template.Annotations[configHashAnnotation] + if got != hashBefore || had != hadHash { + return false, fmt.Sprintf("config hash changed on rotation: %q -> %q", hashBefore, got) + } + envNow, _ := json.Marshal(cur.Spec.Template.Spec.Containers) + if string(envNow) != string(envBefore) { + return false, "pod template changed on key rotation" + } + return true, "" + }) + + // Sharing off: copy and env go away once the server is quiet (OD-10 A). + modpackReadyIs(t, ns, "keyed", "True") + setAgentPlayers(t, ns, "keyed", int32Ptr(0)) + mutateManagedCFKey(t, ctrlNS, func(sec *corev1.Secret) { delete(sec.Annotations, curseforgeShareAnnotation) }) + kickGameServer(t, ns, "keyed") + eventually(t, func() (bool, string) { + if _, found := keyCopyOf(t, ns, "keyed"); found { + return false, "key copy Secret still present with sharing off" + } + cur := statefulSetOf(t, ns, "keyed") + if cur == nil { + return false, "statefulset missing" + } + game := containerByName(cur.Spec.Template.Spec.Containers, gameContainerName) + if game == nil { + return false, "no game container" + } + if envCount(game.Env, "CF_API_KEY") != 0 { + return false, "CF_API_KEY still rendered with sharing off" + } + if keyShareStatus(t, ns, "keyed") { + return false, "status.modpack.keyShared still true" + } + return true, "" + }) + + // Sharing on again: a kicked reconcile re-reads the managed Secret and restores copy and env. + mutateManagedCFKey(t, ctrlNS, func(sec *corev1.Secret) { + if sec.Annotations == nil { + sec.Annotations = map[string]string{} + } + sec.Annotations[curseforgeShareAnnotation] = "true" + }) + kickGameServer(t, ns, "keyed") + eventually(t, func() (bool, string) { + sec, found := keyCopyOf(t, ns, "keyed") + if !found { + return false, "key copy Secret not restored" + } + if got := string(sec.Data["apiKey"]); got != "key-two" { + return false, fmt.Sprintf("restored copy apiKey=%q, want key-two", got) + } + env, why := gameEnvOf(ns, "keyed") + if why != "" { + return false, why + } + if ref := keyRefOf(env, "CF_API_KEY"); ref == nil || ref.Name != "keyed-curseforge-key" { + return false, "CF_API_KEY secretKeyRef not restored" + } + if !keyShareStatus(t, ns, "keyed") { + return false, "status.modpack.keyShared not restored" + } + return true, "" + }) +} + +// TestGameServer_ModpackKeyShare_KeyDeletedAndPackRemoved covers the managed +// Secret disappearing and the pack leaving CurseForge: the copy and env follow +// the managed key in both directions, and a switch to another provider removes +// the copy and env entirely. +func TestGameServer_ModpackKeyShare_KeyDeletedAndPackRemoved(t *testing.T) { + ns := newNamespace(t) + ctrlNS := newNamespace(t) + startMgr(t, ns, withGameServerReconcilerKeyShare(t, ns, ctrlNS)) + + managed := buildManagedCFKey(ctrlNS, "key-one", true) + if err := k8sClient.Create(context.Background(), managed); err != nil { + t.Fatalf("create managed key Secret: %v", err) + } + tmpl := buildModpackTemplate(uniqueName("minecraft")) + if err := k8sClient.Create(context.Background(), tmpl); err != nil { + t.Fatalf("create template: %v", err) + } + deleteCleanup(t, tmpl) + + gs := buildGameServer(ns, "dropkey", tmpl.Name) + gs.Spec.Version = "1.21.4-forge" + gs.Spec.Modpack = modpackSpecOf("curseforge", "all-the-mods-10", "6512345") + if err := k8sClient.Create(context.Background(), gs); err != nil { + t.Fatalf("create gameserver: %v", err) + } + + copyPresent := func(want bool) func() (bool, string) { + return func() (bool, string) { + _, found := keyCopyOf(t, ns, "dropkey") + if found != want { + return false, fmt.Sprintf("key copy present=%v, want %v", found, want) + } + env, why := gameEnvOf(ns, "dropkey") + if why != "" { + return false, why + } + if want && keyRefOf(env, "CF_API_KEY") == nil { + return false, "CF_API_KEY secretKeyRef missing" + } + if !want && envCount(env, "CF_API_KEY") != 0 { + return false, "CF_API_KEY still rendered" + } + if keyShareStatus(t, ns, "dropkey") != want { + return false, fmt.Sprintf("status.modpack.keyShared, want %v", want) + } + return true, "" + } + } + eventually(t, copyPresent(true)) + + // The managed Secret is deleted: copy and env go away. + setAgentPlayers(t, ns, "dropkey", int32Ptr(0)) + if err := k8sClient.Delete(context.Background(), managed); err != nil { + t.Fatalf("delete managed key Secret: %v", err) + } + kickGameServer(t, ns, "dropkey") + eventually(t, copyPresent(false)) + + // Recreated: copy and env come back. + if err := k8sClient.Create(context.Background(), buildManagedCFKey(ctrlNS, "key-one", true)); err != nil { + t.Fatalf("recreate managed key Secret: %v", err) + } + kickGameServer(t, ns, "dropkey") + eventually(t, copyPresent(true)) + + // Pack moves off CurseForge: copy and env are removed. + modpackReadyIs(t, ns, "dropkey", "True") + setModpack(t, ns, "dropkey", modpackSpecOf("modrinth", "some-pack", "1.0.0")) + eventually(t, func() (bool, string) { + if _, found := keyCopyOf(t, ns, "dropkey"); found { + return false, "key copy Secret still present after leaving CurseForge" + } + env, why := gameEnvOf(ns, "dropkey") + if why != "" { + return false, why + } + if envCount(env, "CF_API_KEY") != 0 { + return false, "CF_API_KEY still rendered after leaving CurseForge" + } + if keyShareStatus(t, ns, "dropkey") { + return false, "status.modpack.keyShared still true after leaving CurseForge" + } + return true, "" + }) +} + +// TestGameServer_ModpackKeyShare_NoPackNoCopy proves a sharing-enabled managed +// key creates no copy for a server that has no modpack. +func TestGameServer_ModpackKeyShare_NoPackNoCopy(t *testing.T) { + ns := newNamespace(t) + ctrlNS := newNamespace(t) + startMgr(t, ns, withGameServerReconcilerKeyShare(t, ns, ctrlNS)) + + if err := k8sClient.Create(context.Background(), buildManagedCFKey(ctrlNS, "key-one", true)); err != nil { + t.Fatalf("create managed key Secret: %v", err) + } + tmpl := buildModpackTemplate(uniqueName("minecraft")) + if err := k8sClient.Create(context.Background(), tmpl); err != nil { + t.Fatalf("create template: %v", err) + } + deleteCleanup(t, tmpl) + + gs := buildGameServer(ns, "nopack", tmpl.Name) + gs.Spec.Version = "1.21.4-forge" + if err := k8sClient.Create(context.Background(), gs); err != nil { + t.Fatalf("create gameserver: %v", err) + } + + // Wait for the server to reconcile into a StatefulSet, then check no copy exists. + eventually(t, func() (bool, string) { + if _, why := gameEnvOf(ns, "nopack"); why != "" { + return false, why + } + return true, "" + }) + if _, found := keyCopyOf(t, ns, "nopack"); found { + t.Fatalf("key copy Secret created for a server with no modpack") + } +} + +// keyShareStateIs reports whether the copy Secret, the secretKeyRef env and +// status.modpack.keyShared all show sharing as want. +func keyShareStateIs(t *testing.T, ns, name string, want bool) func() (bool, string) { + return func() (bool, string) { + if _, found := keyCopyOf(t, ns, name); found != want { + return false, fmt.Sprintf("key copy present=%v, want %v", found, want) + } + env, why := gameEnvOf(ns, name) + if why != "" { + return false, why + } + if (keyRefOf(env, "CF_API_KEY") != nil) != want { + return false, fmt.Sprintf("CF_API_KEY secretKeyRef present, want %v", want) + } + if keyShareStatus(t, ns, name) != want { + return false, fmt.Sprintf("status.modpack.keyShared, want %v", want) + } + return true, "" + } +} + +// TestGameServer_ModpackKeyShare_ToggleWaitsForZeroPlayers covers spec 035 +// OD-10 A: turning sharing off on an applied CurseForge pack rolls the pod, so +// it applies only at a known 0 players. While players are online or unknown the +// copy, env and applied state stay put and the pod template does not move; at +// 0 the change applies with exactly one rollout. +func TestGameServer_ModpackKeyShare_ToggleWaitsForZeroPlayers(t *testing.T) { + ns := newNamespace(t) + ctrlNS := newNamespace(t) + startMgr(t, ns, withGameServerReconcilerKeyShare(t, ns, ctrlNS)) + + if err := k8sClient.Create(context.Background(), buildManagedCFKey(ctrlNS, "key-one", true)); err != nil { + t.Fatalf("create managed key Secret: %v", err) + } + tmpl := buildModpackTemplate(uniqueName("minecraft")) + if err := k8sClient.Create(context.Background(), tmpl); err != nil { + t.Fatalf("create template: %v", err) + } + deleteCleanup(t, tmpl) + + gs := buildGameServer(ns, "waitkey", tmpl.Name) + gs.Spec.Version = "1.21.4-forge" + gs.Spec.Modpack = modpackSpecOf("curseforge", "all-the-mods-10", "6512345") + if err := k8sClient.Create(context.Background(), gs); err != nil { + t.Fatalf("create gameserver: %v", err) + } + eventually(t, keyShareStateIs(t, ns, "waitkey", true)) + modpackReadyIs(t, ns, "waitkey", "True") + setAgentPlayers(t, ns, "waitkey", int32Ptr(3)) + before := ssOf(t, ns, "waitkey").Generation + podBefore := podTemplateJSON(t, ns, "waitkey") + + held := func() (bool, string) { + if ok, why := keyShareStateIs(t, ns, "waitkey", true)(); !ok { + return false, why + } + if got := podTemplateJSON(t, ns, "waitkey"); got != podBefore { + return false, "pod template changed while the toggle waits" + } + return true, "" + } + + // Sharing off with 3 players online: held. + mutateManagedCFKey(t, ctrlNS, func(sec *corev1.Secret) { delete(sec.Annotations, curseforgeShareAnnotation) }) + kickGameServer(t, ns, "waitkey") + consistently(t, 2*time.Second, held) + + // Unknown player count is never quiet: still held. + setAgentPlayers(t, ns, "waitkey", nil) + kickGameServer(t, ns, "waitkey") + consistently(t, 2*time.Second, held) + + // Known 0 players: the toggle applies once. + setAgentPlayers(t, ns, "waitkey", int32Ptr(0)) + kickGameServer(t, ns, "waitkey") + eventually(t, keyShareStateIs(t, ns, "waitkey", false)) + if after := ssOf(t, ns, "waitkey").Generation; after != before+1 { + t.Fatalf("statefulset generation %d -> %d, want exactly one rollout", before, after) + } + consistently(t, time.Second, func() (bool, string) { + if g := ssOf(t, ns, "waitkey").Generation; g != before+1 { + return false, fmt.Sprintf("statefulset generation moved to %d after the toggle", g) + } + return true, "" + }) +} + +// TestGameServer_ModpackKeyShare_ShareOnWaitsForZeroPlayers covers OD-10 A for +// turning sharing on: the copy Secret is created at once (nothing names it +// yet), but the env and the applied state wait for a known 0 players. +func TestGameServer_ModpackKeyShare_ShareOnWaitsForZeroPlayers(t *testing.T) { + ns := newNamespace(t) + ctrlNS := newNamespace(t) + startMgr(t, ns, withGameServerReconcilerKeyShare(t, ns, ctrlNS)) + + if err := k8sClient.Create(context.Background(), buildManagedCFKey(ctrlNS, "key-one", false)); err != nil { + t.Fatalf("create managed key Secret: %v", err) + } + tmpl := buildModpackTemplate(uniqueName("minecraft")) + if err := k8sClient.Create(context.Background(), tmpl); err != nil { + t.Fatalf("create template: %v", err) + } + deleteCleanup(t, tmpl) + + gs := buildGameServer(ns, "onwait", tmpl.Name) + gs.Spec.Version = "1.21.4-forge" + gs.Spec.Modpack = modpackSpecOf("curseforge", "all-the-mods-10", "6512345") + if err := k8sClient.Create(context.Background(), gs); err != nil { + t.Fatalf("create gameserver: %v", err) + } + eventually(t, keyShareStateIs(t, ns, "onwait", false)) + modpackReadyIs(t, ns, "onwait", "True") + setAgentPlayers(t, ns, "onwait", int32Ptr(4)) + before := ssOf(t, ns, "onwait").Generation + podBefore := podTemplateJSON(t, ns, "onwait") + + mutateManagedCFKey(t, ctrlNS, func(sec *corev1.Secret) { sec.Annotations[curseforgeShareAnnotation] = "true" }) + kickGameServer(t, ns, "onwait") + eventually(t, func() (bool, string) { + if _, found := keyCopyOf(t, ns, "onwait"); !found { + return false, "share-on copy not created early" + } + return true, "" + }) + consistently(t, 2*time.Second, func() (bool, string) { + if _, found := keyCopyOf(t, ns, "onwait"); !found { + return false, "share-on copy removed while players are online" + } + if keyShareStatus(t, ns, "onwait") { + return false, "status.modpack.keyShared true while players are online" + } + if keyRefOf(mustGameEnv(t, ns, "onwait"), "CF_API_KEY") != nil { + return false, "CF_API_KEY env rendered while players are online" + } + if got := podTemplateJSON(t, ns, "onwait"); got != podBefore { + return false, "pod template changed while the share-on waits" + } + return true, "" + }) + + setAgentPlayers(t, ns, "onwait", int32Ptr(0)) + kickGameServer(t, ns, "onwait") + eventually(t, keyShareStateIs(t, ns, "onwait", true)) + if after := ssOf(t, ns, "onwait").Generation; after != before+1 { + t.Fatalf("statefulset generation %d -> %d, want exactly one rollout", before, after) + } +} + +// mustGameEnv returns the game container env, failing the test when unreadable. +func mustGameEnv(t *testing.T, ns, name string) []corev1.EnvVar { + t.Helper() + env, why := gameEnvOf(ns, name) + if why != "" { + t.Fatalf("game env: %s", why) + } + return env +} + +// TestGameServer_ModpackKeyShare_ToggleStoppedAppliesImmediately covers OD-10 A +// with OD-8 B's stopped rule: a stopped (suspended) server applies a sharing +// toggle at once, whatever the player count. +func TestGameServer_ModpackKeyShare_ToggleStoppedAppliesImmediately(t *testing.T) { + ns := newNamespace(t) + ctrlNS := newNamespace(t) + startMgr(t, ns, withGameServerReconcilerKeyShare(t, ns, ctrlNS)) + + if err := k8sClient.Create(context.Background(), buildManagedCFKey(ctrlNS, "key-one", true)); err != nil { + t.Fatalf("create managed key Secret: %v", err) + } + tmpl := buildModpackTemplate(uniqueName("minecraft")) + if err := k8sClient.Create(context.Background(), tmpl); err != nil { + t.Fatalf("create template: %v", err) + } + deleteCleanup(t, tmpl) + + gs := buildGameServer(ns, "stopkey", tmpl.Name) + gs.Spec.Version = "1.21.4-forge" + gs.Spec.Modpack = modpackSpecOf("curseforge", "all-the-mods-10", "6512345") + if err := k8sClient.Create(context.Background(), gs); err != nil { + t.Fatalf("create gameserver: %v", err) + } + eventually(t, keyShareStateIs(t, ns, "stopkey", true)) + modpackReadyIs(t, ns, "stopkey", "True") + setAgentPlayers(t, ns, "stopkey", int32Ptr(5)) + + mutateGameServer(t, ns, "stopkey", func(g *gameplanev1alpha1.GameServer) { g.Spec.Suspend = true }) + eventually(t, func() (bool, string) { + ss := ssOf(t, ns, "stopkey") + if ss.Spec.Replicas == nil || *ss.Spec.Replicas != 0 { + return false, "statefulset not scaled to zero" + } + return true, "" + }) + + mutateManagedCFKey(t, ctrlNS, func(sec *corev1.Secret) { delete(sec.Annotations, curseforgeShareAnnotation) }) + kickGameServer(t, ns, "stopkey") + eventually(t, keyShareStateIs(t, ns, "stopkey", false)) +} + +// forceModpackPhase sets status.modpack.phase directly, for phases the +// envtest cannot reach through the Backup controller in this suite. +func forceModpackPhase(t *testing.T, ns, name string, phase gameplanev1alpha1.ModpackPhase) { + t.Helper() + if err := retry.RetryOnConflict(retry.DefaultRetry, func() error { + gs := getGameServer(t, ns, name) + if gs.Status.Modpack == nil { + return fmt.Errorf("status.modpack is nil on %s", name) + } + gs.Status.Modpack.Phase = phase + return k8sClient.Status().Update(context.Background(), gs) + }); err != nil { + t.Fatalf("force phase %s: %v", phase, err) + } +} + +// TestGameServer_ModpackKeyShare_BackupFailedHoldsToggle covers OD-10 A: a +// share-off toggle on a server whose pack change failed its backup (no pod +// roll is under way) stays held while players are online. +func TestGameServer_ModpackKeyShare_BackupFailedHoldsToggle(t *testing.T) { + ns := newNamespace(t) + ctrlNS := newNamespace(t) + startMgr(t, ns, withGameServerReconcilerKeyShare(t, ns, ctrlNS)) + + if err := k8sClient.Create(context.Background(), buildManagedCFKey(ctrlNS, "key-one", true)); err != nil { + t.Fatalf("create managed key Secret: %v", err) + } + tmpl := buildModpackTemplate(uniqueName("minecraft")) + if err := k8sClient.Create(context.Background(), tmpl); err != nil { + t.Fatalf("create template: %v", err) + } + deleteCleanup(t, tmpl) + + gs := buildGameServer(ns, "failheld", tmpl.Name) + gs.Spec.Version = "1.21.4-forge" + gs.Spec.Modpack = modpackSpecOf("curseforge", "all-the-mods-10", "6512345") + if err := k8sClient.Create(context.Background(), gs); err != nil { + t.Fatalf("create gameserver: %v", err) + } + eventually(t, keyShareStateIs(t, ns, "failheld", true)) + modpackReadyIs(t, ns, "failheld", "True") + setAgentPlayers(t, ns, "failheld", int32Ptr(3)) + before := ssOf(t, ns, "failheld").Generation + podBefore := podTemplateJSON(t, ns, "failheld") + + forceModpackPhase(t, ns, "failheld", gameplanev1alpha1.ModpackPhaseBackupFailed) + waitModpackPhase(t, ns, "failheld", gameplanev1alpha1.ModpackPhaseBackupFailed) + + mutateManagedCFKey(t, ctrlNS, func(sec *corev1.Secret) { delete(sec.Annotations, curseforgeShareAnnotation) }) + kickGameServer(t, ns, "failheld") + consistently(t, 2*time.Second, func() (bool, string) { + if ok, why := keyShareStateIs(t, ns, "failheld", true)(); !ok { + return false, why + } + if got := podTemplateJSON(t, ns, "failheld"); got != podBefore { + return false, "pod template changed while BackupFailed holds the toggle" + } + if g := ssOf(t, ns, "failheld").Generation; g != before { + return false, fmt.Sprintf("statefulset generation %d -> %d while held", before, g) + } + return true, "" + }) +} + +// TestGameServer_ModpackKeyShare_RotationWithPlayersOnline covers rule 5 +// rotation under load: a rotated managed key reaches the copy Secret at once +// with 3 players online, and the StatefulSet generation does not move. +func TestGameServer_ModpackKeyShare_RotationWithPlayersOnline(t *testing.T) { + ns := newNamespace(t) + ctrlNS := newNamespace(t) + startMgr(t, ns, withGameServerReconcilerKeyShare(t, ns, ctrlNS)) + + if err := k8sClient.Create(context.Background(), buildManagedCFKey(ctrlNS, "key-one", true)); err != nil { + t.Fatalf("create managed key Secret: %v", err) + } + tmpl := buildModpackTemplate(uniqueName("minecraft")) + if err := k8sClient.Create(context.Background(), tmpl); err != nil { + t.Fatalf("create template: %v", err) + } + deleteCleanup(t, tmpl) + + gs := buildGameServer(ns, "rotateload", tmpl.Name) + gs.Spec.Version = "1.21.4-forge" + gs.Spec.Modpack = modpackSpecOf("curseforge", "all-the-mods-10", "6512345") + if err := k8sClient.Create(context.Background(), gs); err != nil { + t.Fatalf("create gameserver: %v", err) + } + eventually(t, keyShareStateIs(t, ns, "rotateload", true)) + modpackReadyIs(t, ns, "rotateload", "True") + setAgentPlayers(t, ns, "rotateload", int32Ptr(3)) + before := ssOf(t, ns, "rotateload").Generation + podBefore := podTemplateJSON(t, ns, "rotateload") + + mutateManagedCFKey(t, ctrlNS, func(sec *corev1.Secret) { sec.Data["apiKey"] = []byte("key-two") }) + kickGameServer(t, ns, "rotateload") + eventually(t, func() (bool, string) { + sec, found := keyCopyOf(t, ns, "rotateload") + if !found { + return false, "key copy Secret missing after rotation" + } + if got := string(sec.Data["apiKey"]); got != "key-two" { + return false, fmt.Sprintf("copy apiKey=%q, want key-two", got) + } + return true, "" + }) + consistently(t, 2*time.Second, func() (bool, string) { + if g := ssOf(t, ns, "rotateload").Generation; g != before { + return false, fmt.Sprintf("statefulset generation %d -> %d on rotation with players online", before, g) + } + if got := podTemplateJSON(t, ns, "rotateload"); got != podBefore { + return false, "pod template changed on rotation with players online" + } + return true, "" + }) +} + +// TestGameServer_ModpackKeyShare_OffOnThenZeroPlayers covers OD-10 A for a +// toggle that is held, then reverted: share off with 3 players is held, share +// on again matches the applied state, and reaching 0 players causes no rollout +// and leaves the env in place. +func TestGameServer_ModpackKeyShare_OffOnThenZeroPlayers(t *testing.T) { + ns := newNamespace(t) + ctrlNS := newNamespace(t) + startMgr(t, ns, withGameServerReconcilerKeyShare(t, ns, ctrlNS)) + + if err := k8sClient.Create(context.Background(), buildManagedCFKey(ctrlNS, "key-one", true)); err != nil { + t.Fatalf("create managed key Secret: %v", err) + } + tmpl := buildModpackTemplate(uniqueName("minecraft")) + if err := k8sClient.Create(context.Background(), tmpl); err != nil { + t.Fatalf("create template: %v", err) + } + deleteCleanup(t, tmpl) + + gs := buildGameServer(ns, "offon", tmpl.Name) + gs.Spec.Version = "1.21.4-forge" + gs.Spec.Modpack = modpackSpecOf("curseforge", "all-the-mods-10", "6512345") + if err := k8sClient.Create(context.Background(), gs); err != nil { + t.Fatalf("create gameserver: %v", err) + } + eventually(t, keyShareStateIs(t, ns, "offon", true)) + modpackReadyIs(t, ns, "offon", "True") + setAgentPlayers(t, ns, "offon", int32Ptr(3)) + before := ssOf(t, ns, "offon").Generation + + // Share off with 3 players: held. + mutateManagedCFKey(t, ctrlNS, func(sec *corev1.Secret) { delete(sec.Annotations, curseforgeShareAnnotation) }) + kickGameServer(t, ns, "offon") + consistently(t, 2*time.Second, keyShareStateIs(t, ns, "offon", true)) + + // Share on again: the desired state equals the applied state, so nothing flips. + mutateManagedCFKey(t, ctrlNS, func(sec *corev1.Secret) { sec.Annotations[curseforgeShareAnnotation] = "true" }) + kickGameServer(t, ns, "offon") + consistently(t, 2*time.Second, keyShareStateIs(t, ns, "offon", true)) + + // Reaching 0 players must not roll the pod for a toggle that was reverted. + setAgentPlayers(t, ns, "offon", int32Ptr(0)) + kickGameServer(t, ns, "offon") + consistently(t, 2*time.Second, func() (bool, string) { + if ok, why := keyShareStateIs(t, ns, "offon", true)(); !ok { + return false, why + } + if g := ssOf(t, ns, "offon").Generation; g != before { + return false, fmt.Sprintf("statefulset generation %d -> %d after a reverted toggle", before, g) + } + return true, "" + }) +} diff --git a/operator/internal/controller/gameserver_modpack_remove_envtest_test.go b/operator/internal/controller/gameserver_modpack_remove_envtest_test.go new file mode 100644 index 000000000..55e1feedb --- /dev/null +++ b/operator/internal/controller/gameserver_modpack_remove_envtest_test.go @@ -0,0 +1,260 @@ +//go:build envtest + +package controller + +import ( + "context" + "fmt" + "path" + "strings" + "testing" + "time" + + corev1 "k8s.io/api/core/v1" + + gameplanev1alpha1 "github.com/GameplanePanel/gameplane/operator/api/v1alpha1" +) + +// wipeInitOf returns the modpack wipe init container of the server's StatefulSet, or nil. +func wipeInitOf(t *testing.T, ns, name string) *corev1.Container { + t.Helper() + return containerByName(ssOf(t, ns, name).Spec.Template.Spec.InitContainers, modpackWipeInitName) +} + +func setRemoveAnnotation(t *testing.T, ns, name, value string) { + t.Helper() + mutateGameServer(t, ns, name, func(g *gameplanev1alpha1.GameServer) { + if g.Annotations == nil { + g.Annotations = map[string]string{} + } + g.Annotations[gameplanev1alpha1.ModpackRemoveAnnotation] = value + }) +} + +func removePack(t *testing.T, ns, name, annotation string) { + t.Helper() + mutateGameServer(t, ns, name, func(g *gameplanev1alpha1.GameServer) { + g.Spec.Modpack = nil + if g.Annotations == nil { + g.Annotations = map[string]string{} + } + g.Annotations[gameplanev1alpha1.ModpackRemoveAnnotation] = annotation + }) +} + +// startPackServer creates a forge server running a CurseForge pack, Applied. +func startPackServer(t *testing.T, ns, name string) *gameplanev1alpha1.GameTemplate { + t.Helper() + tmpl := buildModpackTemplate(uniqueName("minecraft")) + if err := k8sClient.Create(context.Background(), tmpl); err != nil { + t.Fatalf("create template: %v", err) + } + deleteCleanup(t, tmpl) + gs := buildGameServer(ns, name, tmpl.Name) + gs.Spec.Version = "1.21.4-forge" + gs.Spec.Modpack = modpackSpecOf("curseforge", "all-the-mods-10", "100") + if err := k8sClient.Create(context.Background(), gs); err != nil { + t.Fatalf("create gameserver: %v", err) + } + modpackReadyIs(t, ns, name, "True") + return tmpl +} + +func annotationGone(t *testing.T, ns, name, key string) { + t.Helper() + eventually(t, func() (bool, string) { + if _, ok := getGameServer(t, ns, name).Annotations[key]; ok { + return false, key + " still set" + } + return true, "" + }) +} + +// TestGameServer_ModpackRemovalWipesActiveModsMountOnly covers spec 035 T039: +// removal adds the one-shot wipe init step for the active loader's mods mount +// only (no data mount), guarded by .gameplane-mods-wiped-, and +// consumes the remove annotation once applied; installing or switching packs +// adds no wipe step. +func TestGameServer_ModpackRemovalWipesActiveModsMountOnly(t *testing.T) { + ns := newNamespace(t) + startMgr(t, ns, withGameServerReconciler(t, ns)) + tmpl := startPackServer(t, ns, "pack") + if wipeInitOf(t, ns, "pack") != nil { + t.Fatal("wipe init step present for an installed pack") + } + + // Switching packs never wipes. + setModpack(t, ns, "pack", modpackSpecOf("ftb", "777", "4242")) + waitGameEnv(t, ns, "pack", "FTB_MODPACK_ID", "777") + consistently(t, time.Second, func() (bool, string) { + if wipeInitOf(t, ns, "pack") != nil { + return false, "wipe init step rendered when switching packs" + } + return true, "" + }) + + // Removal: wipe step for the mods mount only, marker = observedGeneration. + removePack(t, ns, "pack", `{"requestId":"r1","backupFirst":false}`) + var wipe *corev1.Container + eventually(t, func() (bool, string) { + if wipe = wipeInitOf(t, ns, "pack"); wipe == nil { + return false, "no wipe init step yet" + } + return true, "" + }) + st := getGameServer(t, ns, "pack").Status.Modpack + if st == nil || st.Applied != nil { + t.Fatalf("status.modpack = %+v, want applied nil after removal", st) + } + modsMount := path.Join(effectiveMountPath(tmpl), "mods") + marker := path.Join(modsMount, fmt.Sprintf(".gameplane-mods-wiped-%d", st.ObservedGeneration)) + if len(wipe.VolumeMounts) != 1 || wipe.VolumeMounts[0].MountPath != modsMount || wipe.VolumeMounts[0].Name != modVolumeName("1.21.4-forge") { + t.Fatalf("wipe mounts = %+v, want only the forge mods volume at %s", wipe.VolumeMounts, modsMount) + } + if mountPathOf(wipe, "data") != "" { + t.Fatal("wipe step mounts the data volume") + } + if !strings.Contains(strings.Join(wipe.Args, " "), marker) { + t.Fatalf("wipe args = %v, want marker %s", wipe.Args, marker) + } + if !strings.Contains(wipe.Args[0], "[ -e") { + t.Fatalf("wipe script %q is not guarded by the marker", wipe.Args[0]) + } + env, _ := gameEnvOf(ns, "pack") + if envCount(env, "FTB_MODPACK_ID") != 0 { + t.Fatal("FTB env still rendered after removal") + } + + // Applied: annotation consumed, step stays (no second rollout), marker unchanged. + modpackReadyIs(t, ns, "pack", "True") + annotationGone(t, ns, "pack", gameplanev1alpha1.ModpackRemoveAnnotation) + if wipeInitOf(t, ns, "pack") == nil { + t.Fatal("wipe step dropped after Applied") + } + + // A later install drops the step. + setModpack(t, ns, "pack", modpackSpecOf("modrinth", "another-pack", "v1")) + waitGameEnv(t, ns, "pack", "MODRINTH_MODPACK", "another-pack") + eventually(t, func() (bool, string) { + if wipeInitOf(t, ns, "pack") != nil { + return false, "wipe step still rendered after installing a pack" + } + return true, "" + }) +} + +// TestGameServer_ModpackRemovalBackupFailureKeepsPackAndRetries covers T042 with +// T032: a removal with backupFirst waits for its Backup; a failed backup keeps +// status.modpack.applied and the remove annotation (no wipe, pack env intact); a +// retry (new requestId, same generation) creates a new Backup and, once it +// succeeds, removes the pack and clears the annotation. +func TestGameServer_ModpackRemovalBackupFailureKeepsPackAndRetries(t *testing.T) { + ns := newNamespace(t) + startMgr(t, ns, withGameServerReconciler(t, ns)) + seedBackupDestination(t, ns, "dest") + startPackServer(t, ns, "pack") + + removePack(t, ns, "pack", `{"requestId":"r1","backupFirst":true}`) + st := waitModpackPhase(t, ns, "pack", gameplanev1alpha1.ModpackPhaseBackingUp) + firstName := fmt.Sprintf("pack-modpack-%d", st.ObservedGeneration) + if st.BackupName != firstName || st.Applied == nil || st.Applied.Project != "all-the-mods-10" { + t.Fatalf("status.modpack = %+v, want BackingUp, backup %s, applied pack kept", st, firstName) + } + if refs := getBackup(t, ns, firstName).OwnerReferences; len(refs) != 0 { + t.Fatalf("backup ownerReferences = %+v, want none", refs) + } + consistently(t, time.Second, func() (bool, string) { + env, why := gameEnvOf(ns, "pack") + if why != "" { + return false, why + } + if got, _ := envValue(env, "CF_SLUG"); got != "all-the-mods-10" { + return false, "pack env changed before the backup finished" + } + if wipeInitOf(t, ns, "pack") != nil { + return false, "wipe step rendered before the backup finished" + } + return true, "" + }) + + markBackupFailed(t, ns, firstName, "restic: out of space") + st = waitModpackPhase(t, ns, "pack", gameplanev1alpha1.ModpackPhaseBackupFailed) + if !strings.Contains(st.Message, "out of space") || st.Applied == nil { + t.Fatalf("status.modpack = %+v, want BackupFailed with message and applied kept", st) + } + consistently(t, time.Second, func() (bool, string) { + live := getGameServer(t, ns, "pack") + if _, ok := live.Annotations[gameplanev1alpha1.ModpackRemoveAnnotation]; !ok { + return false, "remove annotation cleared after a failed backup" + } + if wipeInitOf(t, ns, "pack") != nil { + return false, "wipe step rendered after a failed backup" + } + return true, "" + }) + + // Retry: only the annotation changes (generation stays). + genBefore := getGameServer(t, ns, "pack").Generation + setRemoveAnnotation(t, ns, "pack", `{"requestId":"r2","backupFirst":true}`) + var retryName string + eventually(t, func() (bool, string) { + st := getGameServer(t, ns, "pack").Status.Modpack + if st == nil || st.Phase != gameplanev1alpha1.ModpackPhaseBackingUp || st.BackupName == firstName || st.BackupName == "" { + return false, fmt.Sprintf("status.modpack = %+v, want BackingUp with a new backup", st) + } + retryName = st.BackupName + return true, "" + }) + if getGameServer(t, ns, "pack").Generation != genBefore || !strings.HasPrefix(retryName, firstName+"-") { + t.Fatalf("retry backup %q, want %s- at the same generation", retryName, firstName) + } + markBackupSucceeded(t, ns, retryName, "snap-1", "") + eventually(t, func() (bool, string) { + if wipeInitOf(t, ns, "pack") == nil { + return false, "no wipe step after the backup succeeded" + } + return true, "" + }) + modpackReadyIs(t, ns, "pack", "True") + annotationGone(t, ns, "pack", gameplanev1alpha1.ModpackRemoveAnnotation) + env, _ := gameEnvOf(ns, "pack") + if envCount(env, "CF_SLUG") != 0 { + t.Fatal("pack env still rendered after the removal applied") + } +} + +// TestGameServer_ModpackRemovalOfAdoptedUnpinnedPack: an adopted server that was +// never pinned (status.modpack nil) is removed too: the pack identity comes from +// spec.env, its legacy env stops rendering, the mods are wiped and both +// annotations are consumed. +func TestGameServer_ModpackRemovalOfAdoptedUnpinnedPack(t *testing.T) { + ns := newNamespace(t) + startMgr(t, ns, withGameServerReconciler(t, ns)) + startLegacyModrinthServer(t, ns, "pack") + setAgentPlayers(t, ns, "pack", int32Ptr(2)) // keep the pin held + adoptServer(t, ns, "pack", "v-abc") + + removePack(t, ns, "pack", `{"requestId":"r1","backupFirst":false}`) + eventually(t, func() (bool, string) { + env, why := gameEnvOf(ns, "pack") + if why != "" { + return false, why + } + if envCount(env, "MODRINTH_MODPACK") != 0 { + return false, "legacy pack env still rendered" + } + if got, _ := envValue(env, "TYPE"); got != "FORGE" { + return false, "TYPE=" + got + ", want the version's FORGE" + } + if wipeInitOf(t, ns, "pack") == nil { + return false, "no wipe init step" + } + return true, "" + }) + modpackReadyIs(t, ns, "pack", "True") + annotationGone(t, ns, "pack", gameplanev1alpha1.ModpackRemoveAnnotation) + annotationGone(t, ns, "pack", gameplanev1alpha1.ModpackAdoptedAnnotation) + if st := getGameServer(t, ns, "pack").Status.Modpack; st == nil || st.Applied != nil { + t.Fatalf("status.modpack = %+v, want applied nil", st) + } +} diff --git a/operator/internal/controller/gameserver_modpack_supersede_envtest_test.go b/operator/internal/controller/gameserver_modpack_supersede_envtest_test.go new file mode 100644 index 000000000..e846eb376 --- /dev/null +++ b/operator/internal/controller/gameserver_modpack_supersede_envtest_test.go @@ -0,0 +1,114 @@ +//go:build envtest + +package controller + +import ( + "context" + "fmt" + "testing" + "time" + + corev1 "k8s.io/api/core/v1" + "sigs.k8s.io/controller-runtime/pkg/client" + + gameplanev1alpha1 "github.com/GameplanePanel/gameplane/operator/api/v1alpha1" +) + +func modpackBackupCount(t *testing.T, ns string) int { + t.Helper() + var backups gameplanev1alpha1.BackupList + if err := k8sClient.List(context.Background(), &backups, client.InNamespace(ns)); err != nil { + t.Fatalf("list backups: %v", err) + } + return len(backups.Items) +} + +// startBackingUpInstall creates a server running pack version 100 and moves it +// to version 200 with backupFirst and install request id req-1, returning the +// name of the Backup of that change. +func startBackingUpInstall(t *testing.T, ns string) string { + t.Helper() + startMgr(t, ns, withGameServerReconciler(t, ns)) + seedBackupDestination(t, ns, "dest") + tmpl := buildModpackTemplate(uniqueName("minecraft")) + if err := k8sClient.Create(context.Background(), tmpl); err != nil { + t.Fatalf("create template: %v", err) + } + deleteCleanup(t, tmpl) + gs := buildGameServer(ns, "pack", tmpl.Name) + gs.Spec.Version = "1.21.4-forge" + gs.Spec.Modpack = modpackSpecOf("curseforge", "all-the-mods-10", "100") + if err := k8sClient.Create(context.Background(), gs); err != nil { + t.Fatalf("create gameserver: %v", err) + } + modpackReadyIs(t, ns, "pack", "True") + mutateGameServer(t, ns, "pack", func(g *gameplanev1alpha1.GameServer) { + g.Spec.Modpack = modpackSpecOf("curseforge", "all-the-mods-10", "200") + g.Spec.Modpack.BackupFirst = true + g.Spec.Modpack.RequestID = "req-1" + }) + st := waitModpackPhase(t, ns, "pack", gameplanev1alpha1.ModpackPhaseBackingUp) + if st.RequestID != "req-1" || st.Target == nil || st.Target.Version != "200" { + t.Fatalf("status.modpack = %+v, want target 200 and requestId req-1", st) + } + return st.BackupName +} + +// A BackupFailed install retried with the identical choice carries a new +// spec.modpack.requestId and starts a new Backup. +func TestGameServer_ModpackInstallRetryAfterBackupFailed(t *testing.T) { + ns := newNamespace(t) + firstName := startBackingUpInstall(t, ns) + markBackupFailed(t, ns, firstName, "restic: repository unreachable") + waitModpackPhase(t, ns, "pack", gameplanev1alpha1.ModpackPhaseBackupFailed) + + mutateGameServer(t, ns, "pack", func(g *gameplanev1alpha1.GameServer) { + g.Spec.Modpack.RequestID = "req-2" + }) + eventually(t, func() (bool, string) { + st := getGameServer(t, ns, "pack").Status.Modpack + if st == nil || st.Phase != gameplanev1alpha1.ModpackPhaseBackingUp || st.RequestID != "req-2" || + st.BackupName == "" || st.BackupName == firstName { + return false, fmt.Sprintf("status.modpack = %+v, want BackingUp with a new backup for req-2", st) + } + return true, "" + }) +} + +// An unrelated spec edit while BackingUp or BackupFailed does not supersede the +// change: no second Backup is started. +func TestGameServer_ModpackUnrelatedEditDoesNotSupersede(t *testing.T) { + ns := newNamespace(t) + firstName := startBackingUpInstall(t, ns) + + edit := func(name string) { + mutateGameServer(t, ns, "pack", func(g *gameplanev1alpha1.GameServer) { + g.Spec.Env = append(g.Spec.Env, corev1.EnvVar{Name: name, Value: "1"}) + }) + } + edit("UNRELATED_ONE") + consistently(t, 2*time.Second, func() (bool, string) { + st := getGameServer(t, ns, "pack").Status.Modpack + if st == nil || st.Phase != gameplanev1alpha1.ModpackPhaseBackingUp || st.BackupName != firstName { + return false, fmt.Sprintf("status.modpack = %+v, want BackingUp with backup %s", st, firstName) + } + if n := modpackBackupCount(t, ns); n != 1 { + return false, fmt.Sprintf("%d backups after an unrelated edit, want 1", n) + } + return true, "" + }) + + markBackupFailed(t, ns, firstName, "restic: repository unreachable") + waitModpackPhase(t, ns, "pack", gameplanev1alpha1.ModpackPhaseBackupFailed) + edit("UNRELATED_TWO") + consistently(t, 2*time.Second, func() (bool, string) { + st := getGameServer(t, ns, "pack").Status.Modpack + if st == nil || st.Phase != gameplanev1alpha1.ModpackPhaseBackupFailed { + return false, fmt.Sprintf("status.modpack = %+v, want BackupFailed", st) + } + if n := modpackBackupCount(t, ns); n != 1 { + return false, fmt.Sprintf("%d backups after an unrelated edit, want 1", n) + } + return true, "" + }) +} diff --git a/operator/specs.md b/operator/specs.md index e587d0610..f69227898 100644 --- a/operator/specs.md +++ b/operator/specs.md @@ -486,6 +486,18 @@ 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. +### GameServer modpacks (spec 035) + +Source: `operator/internal/controller/gameserver_modpack.go`. Contract: `specs/035-curseforge-modpacks/contracts/operator-modpack.md`. + +- **Desired and observed state:** the API writes only `spec.modpack` (provider, project, pinned version, display labels, `backupFirst`, `requestId`); the pack never lives in `spec.env`. Every install POST sets a fresh `spec.modpack.requestId` (removals use the id in the remove annotation); a change parked in BackingUp or BackupFailed is superseded only when `spec.modpack` or that request id differs from `status.modpack.target`/`requestId`, never by an unrelated spec edit. The operator reports `status.modpack` (`phase`, `applied`, `backupName`, `message`, `target` and `requestId` of the in-flight change) and the `ModpackReady` condition (True when `phase=Applied`; False with reason `BackingUp`, `Applying` or `BackupFailed`; absent for servers that never had a managed pack). +- **Env rendering:** from the merged env (template, version, config, `spec.env`) the operator removes every env name any provider's `modpacks` block owns (`refEnv`, `versionEnv`, `apiKeyEnv`, each `env[].name`), so a stale `MODRINTH_MODPACK` in `spec.env` can never run a second pack. If `status.modpack.applied` is set it then appends that provider's fixed `env`, `refEnv=project` and, when `version` is set, `versionEnv=version`. While a change is not `Applied` the pod keeps rendering the previous `applied` pack. +- **State machine:** per `metadata.generation`: `Pending`, then `BackingUp` (only when `backupFirst` and the namespace has a restic backup destination; a `Backup` named `-modpack-`, with no owner reference, so it survives deleting the server like scheduled backups, labelled `gameplane.local/modpack-change` and tied to the server by `spec.serverRef`; the GameServer reconciler watches such Backups and maps them to `spec.serverRef`), then `Applying` (render new env, StatefulSet rolls), then `Applied`. A failed backup sets `BackupFailed` with `message` and leaves `applied` unchanged; a new spec change starts again. +- **Removal:** the API deletes `spec.modpack` and sets annotation `gameplane.local/modpack-remove` (JSON `requestId`, `backupFirst`). The operator adds the one-shot init container `modpack-wipe` that empties the active loader's mods mount, guarded by marker file `.gameplane-mods-wiped-`, then clears `applied`. A removal whose backup fails keeps `applied` and the annotation so the API can accept a retry with a new `requestId`. Only removal wipes the mods folder; installing or switching packs does not (OD-7 B). +- **Legacy and adopted packs:** a server whose `spec.env` holds a `refEnv` value with no `spec.modpack`, or that carries `gameplane.local/modpack-adopted`, keeps the pre-035 env while its pod runs, so upgrading never rolls a pod whatever the order of operator and API sweep. For an adopted server with a known version the operator applies the pin with one restart once `status.agent.playersOnline` is 0, or at once when stopped or asleep (OD-8 B); never with players online. The annotation is removed when the pin is rendered. +- **Key sharing:** Built (`gameserver_modpack_key.go`). An admin opts in with annotation `gameplane.local/share-with-game-servers: "true"` on the managed Secret `gameplane-modreg-curseforge` in the control-plane credentials namespace; the Secret must also carry label `gameplane.local/mod-registry: "true"` and a non-empty `apiKey`. The operator reads that one Secret through the uncached APIReader using the get-only Role `-operator-modreg-key`, scoped by `resourceNames`. For each server with an applied CurseForge pack it keeps a server-owned copy Secret `-curseforge-key` (key `apiKey`) in the server's namespace and sets the env named by the template's `capabilities.mods.registry.providers[].modpacks.apiKeyEnv` (for example `CF_API_KEY`) through an optional `secretKeyRef`. The key value never enters the pod template or the config hash. NotFound and Forbidden both mean not shared. Key sharing needs the chart's `-operator-modreg-key` Role; a kustomize install (`operator/config/rbac`) has no such Role, so the read is Forbidden and the key is never shared. The operator re-reads the managed Secret every 60s (requeue). A rotation updates the copy within 60s without a restart. A share toggle or key deletion changes the env, which rolls the pod, so it applies only when the server has a known 0 players online, is stopped or asleep, or a pack change is already rolling it (OD-10 A); until then the copy and env stay as they were (a share-on copy is created early). `status.modpack.keyShared` reports the applied state. The env name is stripped from the merged env like the other pack env names. +- **Tests:** `gameserver_modpack_envtest_test.go`, `gameserver_modpack_backup_envtest_test.go`, `gameserver_modpack_adopt_envtest_test.go`, `gameserver_modpack_remove_envtest_test.go`. + ### GameTemplateReconciler - **Responsibility:** Lightweight; only maintains status.inUseCount (how many GameServers ref this template). - **Watches:** GameServer creations/deletions to recompute count on every reconcile. @@ -855,7 +867,7 @@ Forgetting codegen leaves the YAML out of sync with types — CI's `make manifes 4. **Agent RBAC:** Each GameServer gets a unique ServiceAccount + Role (verb:exec on that Pod only). Agent token is bound to that SA and verified by the operator before accepting quiesce/unquiesce calls. -5. **Operator Secret boundary:** The generated ClusterRole (`manager-role`) and the chart's operator watch ClusterRole grant no Secret access. Namespace-local Roles grant Secret reads in the same explicit namespace union as the manager cache. Managed game namespace Roles also retain Secret writes for RCON passwords, rendered configuration, restore copies and agent certificates. Non-Secret resource permissions retain their existing scope. `operator/config/rbac/role_namespace.yaml` and `role_secrets.yaml` are hand-maintained development Roles; removing Secret RBAC generation markers prevents regeneration from restoring broad access. **Agent authentication direction:** The operator creates per-GameServer ServiceAccounts, Roles and RoleBindings in managed game namespaces. Agents use their ServiceAccounts to patch their own GameServer status; the operator calls agents over mTLS. +5. **Operator Secret boundary:** The generated ClusterRole (`manager-role`) and the chart's operator watch ClusterRole grant no Secret access. Namespace-local Roles grant Secret reads in the same explicit namespace union as the manager cache. Managed game namespace Roles also retain Secret writes for RCON passwords, rendered configuration, restore copies and agent certificates. Non-Secret resource permissions retain their existing scope. The one exception is the chart's `-operator-modreg-key` Role, which grants `get` on the single Secret `gameplane-modreg-curseforge` in the credentials namespace outside the cache union, and the operator reads it uncached through the API reader. `operator/config/rbac/role_namespace.yaml` and `role_secrets.yaml` are hand-maintained development Roles; removing Secret RBAC generation markers prevents regeneration from restoring broad access. **Agent authentication direction:** The operator creates per-GameServer ServiceAccounts, Roles and RoleBindings in managed game namespaces. Agents use their ServiceAccounts to patch their own GameServer status; the operator calls agents over mTLS. 6. **Network policies:** Per-GameServer ingress NetworkPolicy admits only the advertised game ports from declared CIDR(s) (default 0.0.0.0/0, customizable via `--game-ingress-from-cidr`). diff --git a/specs/035-curseforge-modpacks/OPEN-DECISIONS.md b/specs/035-curseforge-modpacks/OPEN-DECISIONS.md index 5fe1b7c32..8bb7947fe 100644 --- a/specs/035-curseforge-modpacks/OPEN-DECISIONS.md +++ b/specs/035-curseforge-modpacks/OPEN-DECISIONS.md @@ -1,6 +1,6 @@ # Open decisions: spec 035 CurseForge modpacks -OD-1 to OD-6 were answered by valgul on 2026-11-11 (decision cards). OD-7 was raised by planning and answered by valgul on 2026-11-16. OD-8 was raised by PR review and answered by valgul on 2026-11-17. None are open. +OD-1 to OD-6 were answered by valgul on 2026-11-11 (decision cards). OD-7 was raised by planning and answered by valgul on 2026-11-16. OD-8 was raised by PR review and answered by valgul on 2026-11-17. OD-9 was raised by T001 and answered by valgul on 2026-11-19. OD-10 was raised during implementation and answered by valgul on 2026-11-19. OD-11 was raised during implementation and answered by valgul on 2026-11-22. ## OD-1: How do game servers get a CurseForge key? (SETTLED: C, valgul 2026-11-11) @@ -93,3 +93,50 @@ a newer pack version came out in that window). when it has no players online (or right away if it is stopped or asleep). (Recommended: closes the window within hours without kicking players.) - C. Restart every adopted server once right after the upgrade. + +## OD-9: How does the shared CurseForge key reach java8 servers? (SETTLED: A, valgul 2026-11-19) + +**Ruling: option A** (valgul, 2026-11-19). Where an option below says "Recommended", that was the recommendation before the ruling, not the ruling. + +Raised by T001 on 2026-11-19. + +T001 found that the `java8` / `java8-multiarch` images pin mc-image-helper `1.51.7-java8`, which has +`--api-key` (`CF_API_KEY`) but no `--api-key-file`; `CF_API_KEY_FILE` arrived in a later helper. +Those images are the only ones that need the shared key (Java 17+ images ship one), so the file +mount in OD-1 C / research R2 would never be read. + +- A. Keep OD-1 C's server-owned Secret copy, but pass it as `CF_API_KEY` with `valueFrom.secretKeyRef` + instead of a file. The value stays out of the pod spec and `kubectl describe` (only the Secret + name shows); the module field becomes `apiKeyEnv: CF_API_KEY`. A rotated key applies at the next + restart, which is also when the image reads it today. (Recommended: works on every image tag.) +- B. Keep the file mount and also set `LOAD_ENV_FROM_FILE` to a mounted env file holding + `CF_API_KEY=…`; relies on the image's start scripts supporting that variable in the pinned digest. +- C. Drop key sharing: CurseForge packs only on Java 17+ images (Minecraft 1.17+). + +## OD-10: When does a server pick up a CurseForge key-sharing toggle? (SETTLED: A, valgul 2026-11-19) + +**Ruling: option A** (valgul, 2026-11-19). Where an option below says "Recommended", that was the recommendation before the ruling, not the ruling. + +Raised during implementation on 2026-11-19. + +Turning key sharing on or off adds or removes the key env var (OD-9 A) in the pod template, which rolls the +pod of every server with an applied CurseForge pack. Doing that for all servers at once would kick every player. + +- A. Wait until 0 players: each server picks up the change at its next quiet moment, like OD-8 B (right away if + the server is stopped or asleep, and never while the player count is unknown). Key rotation needs no restart and + is unaffected. (Recommended: no player is kicked and no manual step is needed.) +- B. Restart right away: every affected server rolls within about a minute of the toggle. +- C. Next manual restart: no operator restart; the change applies at the server's next stop/start, sleep/wake or crash restart. + +## OD-11: Should the backup taken before a modpack change survive deleting the server? (SETTLED: A, valgul 2026-11-22) + +**Ruling: option A** (valgul, 2026-11-22). + +Raised during implementation on 2026-11-22. + +The operator creates a Backup before a modpack change (`-modpack-`). Owning it by the GameServer +would garbage-collect it, and the restic snapshot, when the server is deleted; scheduled backups have no owner. + +- A. Keep (no owner): the Backup carries no ownerReference, only the `gameplane.local/modpack-change` label and + `spec.serverRef`, so it and its restic snapshot survive deleting the server, like scheduled backups. +- B. Delete with the server: the Backup is controller-owned by the GameServer and is garbage-collected with it. diff --git a/specs/035-curseforge-modpacks/contracts/api-modpack.md b/specs/035-curseforge-modpacks/contracts/api-modpack.md index b544527ca..8e0f0bb94 100644 --- a/specs/035-curseforge-modpacks/contracts/api-modpack.md +++ b/specs/035-curseforge-modpacks/contracts/api-modpack.md @@ -22,6 +22,12 @@ Adds two fields per provider: `type=modpack` makes FTB and CurseForge return pack versions. Only versions matching the server's selected Minecraft version and loader are returned, newest first (Clarification Q5). +Each versions entry also carries two optional fields (both omitted when the provider does not say): + +- `releaseType` (string): one of `"release"`, `"beta"`, `"alpha"`. CurseForge maps its numeric + release type (1, 2, 3) to these; FTB passes its type through only when it is one of the three. +- `publishedAt` (string): RFC 3339, UTC (for example `"2026-11-02T14:03:09Z"`). + ## GET /servers/{name}/modpack (new) ```json @@ -38,7 +44,8 @@ server's selected Minecraft version and loader are returned, newest first (Clari ], "missingFilesUnknown": false, "downloadsPath": "downloads/", - "backupAvailable": true + "backupAvailable": true, + "backupDestination": "offsite" } ``` @@ -52,6 +59,10 @@ server's selected Minecraft version and loader are returned, newest first (Clari - `missingFilesUnknown` true when no pod exists (server stopped or asleep), so the file cannot be read; the tab then says to start the server to check for missing files. - `backupAvailable` true when the server has a backup destination. +- `backupDestination` (string, omitted when there is none): the name of the backup destination + (a Secret labelled `gameplane.local/backup-destination=true` in the server's namespace) the + pre-change backup goes to; the alphabetically first name when several exist, matching the + operator's choice. `backupAvailable` is true exactly when it is non-empty. - Triggers the lazy legacy adoption (research R6) when needed. ## POST /servers/{name}/modpack (changed) @@ -69,8 +80,11 @@ Request: - 409 `server.modpack.key_required` when the provider is blocked for this server (see `modpacksBlockedReason`). - 400 `server.modpack.backup_unavailable` when `backupFirst` and no destination. -- 409 `server.modpack.change_in_progress` while `phase` is `BackingUp` or `Applying`. -- 202 with the GET body. Writes `spec.modpack` only; the operator applies it. +- 409 `server.modpack.change_in_progress` while `phase` is `Pending`, `BackingUp` or `Applying` + (a change the operator has not picked up yet reads `Pending`). +- 202 with the GET body (built from the server object just written, without the agent read, so + `missingFiles` is `[]`). Its `phase` is `Pending` until the operator picks the change up. + Writes `spec.modpack` only; the operator applies it. ## DELETE /servers/{name}/modpack?backupFirst=true|false (new) @@ -85,4 +99,16 @@ neither `spec.modpack` nor `status.modpack.applied` is set; same 400/409 rules a `{ "share": true }` sets/clears the share annotation on the managed key Secret. 409 `server.registry.share_needs_managed_key` when no managed key exists (only the startup flag). -GET on the same path returns `{ "share": bool, "managedKey": bool }`. +GET on the same path returns the same shape, and so does a successful PUT: + +```json +{ "share": false, "managedKey": true, "keySource": "admin" } +``` + +- `share` (bool): true only when a managed key exists and the share annotation is `"true"`. +- `managedKey` (bool): true when the managed key Secret holds a non-empty `apiKey`. +- `keySource` (string): where the CurseForge key comes from. `"admin"` when a managed key + exists, `"startup-flag"` when only the startup flag supplies one, `""` when there is no key. + Never the key itself. + +PUT `{ "share": false }` with no managed key answers 200 with `share` and `managedKey` false. diff --git a/specs/035-curseforge-modpacks/contracts/operator-modpack.md b/specs/035-curseforge-modpacks/contracts/operator-modpack.md index 32f26f3a7..471eafed3 100644 --- a/specs/035-curseforge-modpacks/contracts/operator-modpack.md +++ b/specs/035-curseforge-modpacks/contracts/operator-modpack.md @@ -2,11 +2,13 @@ Owner: `operator/internal/controller/` (new file `gameserver_modpack.go`). -1. **Env rendering** (FR-003, FR-004): from the merged env (template < version < config < - `spec.env`), remove every env name that appears in any provider's `modpacks` block - (`refEnv`, `versionEnv`, `apiKeyFileEnv`, each `env[].name`). Then, if - `status.modpack.applied` is set, append that provider's fixed `env`, `refEnv=project` - and, when `version` is set, `versionEnv=version`. +1. **Env rendering** (FR-003, FR-004): from `spec.env` only (not template, version or config + env), remove every env name declared in any provider's `modpacks` block (`refEnv`, + `versionEnv`, `apiKeyEnv`, each `env[].name`). Then, if `status.modpack.applied` is set, + append that provider's fixed `env`, `refEnv=project` and, when `version` is set, + `versionEnv=version` after `spec.env`, so the pack's values win on duplicate names + (kubelet last-wins). When no pack is applied, the version's own env (for example `TYPE`) + stays as rendered. 2. **Legacy and adopted packs** (R6): a server is legacy when `spec.env` holds a value for any provider's `refEnv` and `spec.modpack` is absent (not yet swept), or adopted when annotation `gameplane.local/modpack-adopted` is set. For both, while the pod is running, @@ -17,15 +19,29 @@ Owner: `operator/internal/controller/` (new file `gameserver_modpack.go`). is stopped or asleep (OD-8 B); never while players are online. Remove the annotation, and render rule 1, at the next pod start the operator drives. 3. **Change state machine** (R4): see data-model.md. A removal whose backup fails keeps - `status.modpack.applied` and the remove annotation, so the API can accept a retry. Backup CRs created here are owned by - the GameServer and named `-modpack-`. + `status.modpack.applied` and the remove annotation, so the API can accept a retry. Backup CRs created here have no owner (OD-11 A), so + they survive deleting the server, like scheduled backups. They are named `-modpack-` and carry the + `gameplane.local/modpack-change` label and `spec.serverRef`; the GameServer reconciler watches them through that label. 4. **Mods wipe** (R5): on a removal only (OD-7 B), add the one-shot init step for the active loader's mods mount, guarded by the marker file. -5. **Key sharing** (R2): watch the managed key Secret (control namespace); maintain - `-curseforge-key` and the read-only mount + `apiKeyFileEnv` only while sharing is on - and the applied provider is curseforge. Not part of the config hash. +5. **Key sharing** (R2, OD-9 A, OD-10 A): read the managed key Secret `gameplane-modreg-curseforge` + (control namespace) with an uncached get on every reconcile; the operator does not watch it, so + a CurseForge modpack server is requeued every 60s to re-read it. Maintain the server-owned `-curseforge-key` (key `apiKey`) only while + sharing is on and the applied provider is curseforge. Set the game container env named by + the module's `apiKeyEnv` (`CF_API_KEY` for minecraft-java) via `valueFrom.secretKeyRef` to + that Secret. No volume or mount. The key value is never in the config hash (only the + secretKeyRef is). Toggling sharing adds or removes the env var in the pod template, which rolls + the server's pod; the operator applies a toggle only when the server has a known 0 players online, is stopped or + asleep, or a pack change is already rolling it (OD-10 A, same gate as OD-8 B), and meanwhile keeps + `status.modpack.keyShared` (the applied state) and the pod template as they are. A share-on copy Secret is + created at once; a share-off copy is deleted together with the env removal. Rotating the key alone changes only the copy Secret and leaves the pod + template (and its hash) unchanged, because the secretKeyRef (name and key) is stable, so the + new value applies at the next container start. The secretKeyRef is `optional: true`. + `status.modpack.keyShared` reflects whether the env is set (the applied state, not the admin's setting). 6. **Conditions**: `ModpackReady` True when `phase=Applied`; False with reason `BackingUp|Applying|BackupFailed`. -7. **RBAC**: get/list/watch on the one managed key Secret name in the control namespace - (resourceNames-scoped where the existing role layout allows); create/update/delete on - Secrets with the copy label in server namespaces. +7. **RBAC**: `get` only, resourceNames `gameplane-modreg-curseforge`, in the control namespace, + via the chart Role/RoleBinding `-operator-modreg-key` (always rendered with the + operator; separate from `-operator-secrets`, which exists there only with + nativeRBAC.remoteClusters); create/update/delete on Secrets with the copy label in server + namespaces (existing operator-manage Role). diff --git a/specs/035-curseforge-modpacks/data-model.md b/specs/035-curseforge-modpacks/data-model.md index 80c0d8f53..013fec774 100644 --- a/specs/035-curseforge-modpacks/data-model.md +++ b/specs/035-curseforge-modpacks/data-model.md @@ -11,7 +11,7 @@ No database tables change. All state lives on Kubernetes objects. | Field | Type | Rules | Meaning | |---|---|---|---| | `versionEnv` | string | max 64, env-name pattern | Env the operator sets to the pinned version id (`MODRINTH_VERSION`, `CF_FILE_ID`, `FTB_MODPACK_VERSION_ID`). Required for env-mode packs that support pinning; when empty the registry is not offered for pinned install. | -| `apiKeyFileEnv` | string | max 64, env-name pattern, only valid when `provider: curseforge` | Env that receives the mounted key path when key sharing is on (`CF_API_KEY_FILE`). | +| `apiKeyEnv` | string | max 64, env-name pattern, only valid when `provider: curseforge` | Env the operator sets on the game container, via `valueFrom.secretKeyRef` to the server-owned key Secret, when key sharing is on (`CF_API_KEY` for minecraft-java). | | `needsKeyImageTags` | []string | max 8 items, each max 64 | Image tags (the part after `:` and before `@`) that have no built-in key. Servers on these images get the provider only while key sharing is on. | | `missingFilesPath` | string | max 128, relative path, no `..` | File (relative to the data mount) where the image lists files needing a manual download (`MODS_NEED_DOWNLOAD.txt`). | | `adoptVersionFile` | object {`path`, `field`} | path relative, no `..`; field max 64 | Where the image records the installed version, used to adopt legacy unpinned packs (`.modrinth-modpack-manifest.json` / `versionId`). | @@ -28,6 +28,7 @@ No database tables change. All state lives on Kubernetes objects. | `title` | string | 0–128, display only | | `versionName` | string | 0–128, display only | | `backupFirst` | bool | honoured only when a backup destination exists | +| `requestId` | string | set by the API on every install request, so a retry of the same choice (for example after BackupFailed) is a new change | Absent `spec.modpack` = no pack. Remove deletes `spec.modpack` and sets the annotation `gameplane.local/modpack-remove` (below), which tells the operator whether to back up first. @@ -47,7 +48,7 @@ Annotations: | `applied` | object (same shape as `spec.modpack` without `backupFirst`) or null | what the pod renders now | | `backupName` | string | Backup CR created for this change | | `message` | string, max 512 | human-readable reason for `BackupFailed` | -| `keyShared` | bool | the pod currently mounts a shared CurseForge key | +| `keyShared` | bool | the game container currently gets a shared CurseForge key from the server-owned Secret via the `apiKeyEnv` env | Missing-download files are NOT stored in status (the API reads them live, research R7). @@ -68,8 +69,10 @@ BackupFailed + new spec change → starts again from the top - `gameplane-modreg-curseforge` (existing, control namespace): gains annotation `gameplane.local/share-with-game-servers: "true"` when the admin opts in. - `-curseforge-key` (new, server namespace, owned by the GameServer, label - `gameplane.local/curseforge-key-copy: "true"`): key `apiKey`. Exists only while sharing is - on and the applied pack is CurseForge. + `gameplane.local/curseforge-key-copy: "true"`): key `apiKey`, copied from the managed Secret + `gameplane-modreg-curseforge`. The game container reads it through an env + `valueFrom.secretKeyRef` (no volume or mount). Exists only while sharing is on and the + applied pack is CurseForge. The value never enters the config hash. ## Module (`GameplanePanel/module`, `minecraft-java/template.yaml`) @@ -86,7 +89,7 @@ providers: modpacks: refEnv: CF_SLUG versionEnv: CF_FILE_ID - apiKeyFileEnv: CF_API_KEY_FILE + apiKeyEnv: CF_API_KEY needsKeyImageTags: [java8-multiarch, java8] missingFilesPath: MODS_NEED_DOWNLOAD.txt env: diff --git a/specs/035-curseforge-modpacks/plan.md b/specs/035-curseforge-modpacks/plan.md index 07ec46e70..b23b07cf8 100644 --- a/specs/035-curseforge-modpacks/plan.md +++ b/specs/035-curseforge-modpacks/plan.md @@ -12,7 +12,7 @@ every pack change, and a list of files that need a manual download. The game ima installing (itzg `AUTO_CURSEFORGE`, `FTBA`, `MODRINTH`). The API stops patching `spec.env` and writes a new `GameServer.spec.modpack`; the operator renders the pack env, runs the backup-then-apply state machine, empties the mods folder on removal, and, only when an admin -opts in, mounts a server-owned copy of the CurseForge key as a file. A new keyless FTB +opts in, gives the game container an env var (`CF_API_KEY`) from a server-owned copy of the CurseForge key via `valueFrom.secretKeyRef`. A new keyless FTB registry engine feeds search and versions. See [research.md](./research.md). ## Technical Context @@ -78,7 +78,7 @@ operator/ ├── api/v1alpha1/gameserver_types.go # spec.modpack, status.modpack ├── internal/controller/gameserver_modpack.go # new: env rendering, state machine, wipe, key copy ├── internal/controller/gameserver_modpack_envtest_test.go -├── internal/controller/gameserver_controller.go # call sites, watch on managed key Secret +├── internal/controller/gameserver_controller.go # call sites, 60s requeue for CurseForge servers (managed key Secret is read, not watched) └── config/{crd,rbac}/ + charts/gameplane/{charts/gameplane-crds/crds,crd-manifests}/ # generated api/ ├── internal/registry/ftb.go (+ _test.go, testdata/) # new keyless engine diff --git a/specs/035-curseforge-modpacks/quickstart.md b/specs/035-curseforge-modpacks/quickstart.md index b6aa12d32..d69af3ff3 100644 --- a/specs/035-curseforge-modpacks/quickstart.md +++ b/specs/035-curseforge-modpacks/quickstart.md @@ -23,7 +23,7 @@ prove and how to repeat a scenario by hand on a dev cluster (`make dev-up`). | 6 | Downgrade | Pick an older version | Confirmation shows the downgrade warning; server boots on the older file | Q4 | | 7 | Blocked files | Install a pack known to contain a no-third-party-download mod | Card lists the files with download links; upload to `downloads/`, restart → Applied | US4, FR-008 | | 8 | FTB | Modpacks → FTB → small pack → Install | `TYPE=FTBA`, `FTB_MODPACK_ID`, `FTB_MODPACK_VERSION_ID`; server Running | US5, FR-012 | -| 9 | Key sharing | Admin → share key on; Minecraft 1.16.5 Forge server → CurseForge pack | `-curseforge-key` Secret owned by the server; mount at `/run/gameplane/curseforge/api-key`; `kubectl get pod -o yaml` shows no key value; sharing off → copy deleted | FR-005, SC-003 | +| 9 | Key sharing | Admin → share key on; Minecraft 1.16.5 Forge server → CurseForge pack | `-curseforge-key` Secret owned by the server; game container env `CF_API_KEY` from `valueFrom.secretKeyRef` on that Secret; `kubectl get pod -o yaml` shows the secretKeyRef name only, no key value; sharing off → copy deleted and env removed | FR-005, SC-003 | | 10 | Legacy adoption | Server created with `MODRINTH_MODPACK` in `spec.env` by the old API → upgrade panel | `spec.modpack.version` = installed `versionId`, pod not restarted, pin env appears after the next restart | Q2 | | 11 | Picker filter | Open versions on a 1.20.1 Forge server | only 1.20.1 + Forge versions listed | Q5 | diff --git a/specs/035-curseforge-modpacks/research.md b/specs/035-curseforge-modpacks/research.md index 717d2107b..9089d9fd7 100644 --- a/specs/035-curseforge-modpacks/research.md +++ b/specs/035-curseforge-modpacks/research.md @@ -25,22 +25,36 @@ implementation task re-checks every itzg fact below against the image digests th ## R2: CurseForge key for game servers (OD-1 C) +- **T001 re-check (2026-11-19)**: env names in R1 match itzg `master` scripts + (`start-deployAutoCF`, `start-deployModrinth`, `start-deployFTBA`) and mc-image-helper 1.78.2 + (`--slug`, `--file-id`, `--downloads-repo`, `--missing-mods-filename` default + `MODS_NEED_DOWNLOAD.txt`, `--api-key-file` = `CF_API_KEY_FILE`). The `java8` build matrix pins + mc-image-helper `1.51.7-java8`, which has `--api-key` (`CF_API_KEY`) but **no** `--api-key-file`. + A file mount would therefore not be read on the images that need the key. OD-9 A (valgul, + 2026-11-19) replaces the file mount with an env var: see decision 3. + - **Facts**: itzg Java 17+ tags include a CurseForge key in mc-image-helper; `java8`, - `java8-multiarch`, `java11`, `java16` do not (itzg `docs/versions/java.md`). The image reads - `CF_API_KEY_FILE`. The module uses `java8-multiarch` for Minecraft ≤1.16.5. + `java8-multiarch`, `java11`, `java16` do not (itzg `docs/versions/java.md`). Newer helpers read + `CF_API_KEY_FILE`; the pinned `java8` helper reads `CF_API_KEY`. The module uses + `java8-multiarch` for Minecraft ≤1.16.5. - **Decision**: 1. Default: no key in the pod; the image's built-in key is used. 2. Admin opt-in "Share the CurseForge key with game servers" is stored as an annotation on the managed key Secret `gameplane-modreg-curseforge` in the control namespace (`gameplane.local/share-with-game-servers: "true"`). The API sets/clears it from the admin registry settings; it is never readable or writable by server-scoped roles. - 3. The operator watches that Secret. For each GameServer whose active pack is CurseForge, - while sharing is on, it reconciles a server-owned Secret `-curseforge-key` (key - `apiKey`), mounts it read-only at `/run/gameplane/curseforge/api-key` in the game - container only (not the agent, not init containers), and sets `CF_API_KEY_FILE` to that - path. Sharing off or admin key deleted: the operator deletes the copy and drops the mount. - 4. The key copy is NOT part of the config hash: kubelet refreshes mounted Secret files in - place and the image reads the key only at boot, so a rotation never restarts servers. + 3. The operator reads that Secret on each reconcile (60s requeue, no watch). For each GameServer whose active pack is CurseForge, + while sharing is on, it keeps a server-owned Secret `-curseforge-key` (key `apiKey`) + copied from the managed Secret `gameplane-modreg-curseforge`, and sets the game container + env named by the module's `providers.curseforge.apiKeyEnv` (`CF_API_KEY` for + minecraft-java) via `valueFrom.secretKeyRef` to that Secret. The env is set on the game + container only (not the agent, not init containers). Sharing off or admin key deleted: the + operator deletes the copy and drops the env. + 4. The key value is NOT part of the config hash: the hash covers only the secretKeyRef + (Secret name and key), never the value. A rotated key changes only the copy Secret, not the + pod template, so it does not restart servers and applies at the next container start. + Toggling share on/off adds or removes the env var, which changes the pod template and rolls + that server's pod. OD-10 A (valgul, 2026-11-19): a share toggle rolls the pod only when the server has 0 players online (or is stopped or asleep), reusing the OD-8 B gate; rotation needs no restart. 5. The module marks images without a built-in key (`needsKeyImageTags: [java8-multiarch, java8]`). While sharing is off, the API hides CurseForge in the Modpacks registry switch for servers whose selected version uses such an image, and refuses install with 409. @@ -49,7 +63,8 @@ implementation task re-checks every itzg fact below against the image digests th reason in that case. - **Rationale**: the operator stays the only writer of pod specs (core rule 10) and the copy is a server-owned Secret, so `validateServerEnvSources`/the ownership rule holds unchanged. - File mount instead of env keeps the key out of `kubectl describe pod` and the pod spec. + The env `valueFrom` keeps the key value out of the pod spec and `kubectl describe pod` + (only the Secret name shows) and works on every image tag, including the pinned `java8` helper. - **Alternatives**: env `valueFrom` the control-namespace Secret (cross-namespace refs are impossible and the ownership rule forbids it); API writes the copy (bypasses the operator); a key-injecting HTTP proxy (mc-image-helper has `--api-base-url`, but running a @@ -75,7 +90,7 @@ implementation task re-checks every itzg fact below against the image digests th - **Decision**: the operator runs a small state machine per pack change, keyed by `metadata.generation`: - `Pending → BackingUp (Backup CR created, owner = GameServer) → Applying → Applied`, or + `Pending → BackingUp (Backup CR created, no owner (OD-11 A)) → Applying → Applied`, or `BackupFailed` (nothing applied; message from the Backup's status). While not `Applied`, the pod keeps rendering `status.modpack.applied` (the previous pack). `backupFirst` is honoured only when the server has a backup destination; the API rejects `backupFirst: true` without diff --git a/specs/035-curseforge-modpacks/spec.md b/specs/035-curseforge-modpacks/spec.md index 87496c079..8d533469f 100644 --- a/specs/035-curseforge-modpacks/spec.md +++ b/specs/035-curseforge-modpacks/spec.md @@ -133,7 +133,7 @@ The operator switches the Modpacks registry to FTB, searches FTB's own pack list - **FR-002**: CurseForge MUST appear in the Modpacks registry switch only when a CurseForge key is configured, as in the Mods tab today. - **FR-003**: Installing a CurseForge pack MUST set the server to install that pack on boot through the game image's own CurseForge modpack mode, and MUST restart the server through the operator like the Modrinth install does today. - **FR-004**: Installing a pack from one registry MUST clear every setting of a pack from the other registries, so at most one pack is active per server. -- **FR-005**: Game servers MUST use the image's built-in CurseForge key by default (OD-1 C). An admin setting "Share the CurseForge key with game servers" (off by default) MUST make the operator give each server with a CurseForge pack its own server-owned copy of the admin key, mounted as a file, kept in sync on rotation and removed when the admin key is removed or the setting is turned off. While the setting is off, CurseForge packs for Minecraft versions whose image has no built-in key (java8, ≤1.16.5) MUST NOT be offered. The key MUST NOT be written into GameServer env as plain text, into server logs, or into API responses. +- **FR-005**: Game servers MUST use the image's built-in CurseForge key by default (OD-1 C). An admin setting "Share the CurseForge key with game servers" (off by default) MUST make the operator give each server with a CurseForge pack its own server-owned copy of the admin key, exposed to the game container as an env var (`CF_API_KEY`) read via `valueFrom.secretKeyRef`, kept in sync on rotation and removed when the admin key is removed or the setting is turned off. While the setting is off, CurseForge packs for Minecraft versions whose image has no built-in key (java8, ≤1.16.5) MUST NOT be offered. The key MUST NOT be written into GameServer env as plain text, into server logs, or into API responses. - **FR-006**: Installing a pack MUST open a version picker that lists only the pack's versions for the server's selected Minecraft version and loader, defaulting to the newest of them; the server MUST stay pinned to the chosen file across restarts until the operator picks another (OD-2 B). Older versions MAY be picked; the confirmation MUST warn that a downgrade can break the world (Clarifications 2026-11-13). There is no "always latest" mode. Servers with a Modrinth pack installed before this feature MUST be pinned to their currently installed version on upgrade, without restarting them while players are online; the pin takes effect at the next restart, or through one operator restart as soon as the server has no players online (right away when stopped or asleep) (OD-8 B). If that version cannot be read they show "Not pinned" (Clarifications 2026-11-13). The same picker and pinning apply to Modrinth packs (OD-3 A) and FTB packs (OD-6 B). - **FR-007**: The Modpacks tab MUST show an "Active modpack" card (name, registry, pinned version) with Change version and Remove actions, for every registry (OD-4 A). Remove MUST ask for confirmation, clear all pack settings, delete everything in the server's mods folder for the active loader (including mods added by hand), and restart the server; world data and configs stay. - **FR-008**: The server's data volume MUST have a `downloads/` folder that the image reads for manually downloaded files. When a pack install stops because files need a manual download, the Modpacks tab MUST list each missing file with a link to its download page and tell the operator to upload it to `downloads/` in the Files tab and restart (OD-5 A). diff --git a/specs/035-curseforge-modpacks/tasks.md b/specs/035-curseforge-modpacks/tasks.md index 5d0fa4387..11f6bef0b 100644 --- a/specs/035-curseforge-modpacks/tasks.md +++ b/specs/035-curseforge-modpacks/tasks.md @@ -23,7 +23,7 @@ description: "Task list for spec 035: CurseForge and FTB modpacks for Minecraft" **Purpose**: confirm the upstream facts the design rests on before changing types. - [ ] T001 Re-check research.md R1, R2 and R7 against the itzg image digests pinned in modules/minecraft-java/template.yaml (env names `AUTO_CURSEFORGE`, `CF_SLUG`, `CF_FILE_ID`, `CF_API_KEY_FILE`, `CF_DOWNLOADS_REPO`, `MODRINTH_VERSION`, `FTBA`, `FTB_MODPACK_ID`, `FTB_MODPACK_VERSION_ID`; manifest files `.modrinth-modpack-manifest.json`, `.curseforge-manifest.json`; `MODS_NEED_DOWNLOAD.txt`; built-in key present on java17/java21/java25 and absent on java8-multiarch); record any difference in specs/035-curseforge-modpacks/research.md and stop if one breaks the plan -- [ ] T002 [P] Record recorded-response fixtures for the FTB API (search, pack detail, version detail) and a CurseForge modpack files response (class 4471) in api/internal/registry/testdata/ftb/ and api/internal/registry/testdata/curseforge/modpack-files.json +- [X] T002 [P] Record recorded-response fixtures for the FTB API (search, pack detail, version detail) and a CurseForge modpack files response (class 4471) in api/internal/registry/testdata/ftb/ and api/internal/registry/testdata/curseforge/modpack-files.json --- @@ -31,17 +31,17 @@ description: "Task list for spec 035: CurseForge and FTB modpacks for Minecraft" **Purpose**: CRD shape, operator env rendering, module declaration and design. Nothing in Phase 3+ starts before T003–T010; web tasks also wait for T011–T013. -- [ ] T003 Add `ftb` to the `ModProvider.provider` enum, add `ModProvider.modpacksOnly`, and add `ModpackSpec.versionEnv`, `apiKeyFileEnv` (CEL: only when provider is curseforge), `needsKeyImageTags`, `missingFilesPath`, `adoptVersionFile{path,field}` with the validation in data-model.md to operator/api/v1alpha1/gametemplate_types.go -- [ ] T004 Add `GameServerSpec.Modpack *GameServerModpackSpec` (provider, project, version, title, versionName, backupFirst) and `GameServerStatus.Modpack` (observedGeneration, phase enum, applied, backupName, message, keyShared) plus annotation constants `gameplane.local/modpack-adopted` and `gameplane.local/modpack-remove` to operator/api/v1alpha1/gameserver_types.go -- [ ] T005 Run `make generate && make manifests`; commit operator/api/v1alpha1/zz_generated.deepcopy.go, operator/config/crd/, operator/config/rbac/, charts/gameplane/charts/gameplane-crds/crds/ and charts/gameplane/crd-manifests/ with T003–T004 (core rule 7) -- [ ] T006 Implement env rendering rule 1 of contracts/operator-modpack.md (strip every modpack-declared env name from the merged env, then add the applied provider's fixed env, `refEnv=project`, `versionEnv=version`) in new operator/internal/controller/gameserver_modpack.go and call it from the env build in operator/internal/controller/gameserver_controller.go -- [ ] T007 Implement the change state machine without backups (`Pending → Applying → Applied`, `status.modpack.applied`, `ModpackReady` condition) in operator/internal/controller/gameserver_modpack.go -- [ ] T008 [P] envtest: rendering strips stale `MODRINTH_MODPACK`/`CF_*`/`FTB_*` from `spec.env`, renders each provider's set, and `ModpackReady` reaches True, in operator/internal/controller/gameserver_modpack_envtest_test.go +- [X] T003 Add `ftb` to the `ModProvider.provider` enum, add `ModProvider.modpacksOnly`, and add `ModpackSpec.versionEnv`, `apiKeyEnv` (CEL: only when provider is curseforge), `needsKeyImageTags`, `missingFilesPath`, `adoptVersionFile{path,field}` with the validation in data-model.md to operator/api/v1alpha1/gametemplate_types.go +- [X] T004 Add `GameServerSpec.Modpack *GameServerModpackSpec` (provider, project, version, title, versionName, backupFirst) and `GameServerStatus.Modpack` (observedGeneration, phase enum, applied, backupName, message, keyShared) plus annotation constants `gameplane.local/modpack-adopted` and `gameplane.local/modpack-remove` to operator/api/v1alpha1/gameserver_types.go +- [X] T005 Run `make generate && make manifests`; commit operator/api/v1alpha1/zz_generated.deepcopy.go, operator/config/crd/, operator/config/rbac/, charts/gameplane/charts/gameplane-crds/crds/ and charts/gameplane/crd-manifests/ with T003–T004 (core rule 7) +- [X] T006 Implement env rendering rule 1 of contracts/operator-modpack.md (strip every modpack-declared env name from the merged env, then add the applied provider's fixed env, `refEnv=project`, `versionEnv=version`) in new operator/internal/controller/gameserver_modpack.go and call it from the env build in operator/internal/controller/gameserver_controller.go +- [X] T007 Implement the change state machine without backups (`Pending → Applying → Applied`, `status.modpack.applied`, `ModpackReady` condition) in operator/internal/controller/gameserver_modpack.go +- [X] T008 [P] envtest: rendering strips stale `MODRINTH_MODPACK`/`CF_*`/`FTB_*` from `spec.env`, renders each provider's set, and `ModpackReady` reaches True, in operator/internal/controller/gameserver_modpack_envtest_test.go - [ ] T009 [P] Update the minecraft-java template to the providers block in data-model.md (modrinth, curseforge, ftb, hangar), raise `gameplaneMinVersion` to the release that ships this spec and bump the module minor version in modules/minecraft-java/template.yaml and modules/minecraft-java/module.yaml (module repo PR; root pointer bump only after it merges) -- [ ] T010 Replace the `spec.env` patch in `installModpack` with a `spec.modpack` write and add `GET /servers/{name}/modpack` (active, phase, message, backupName, keyShared, backupAvailable; missingFiles empty for now) per contracts/api-modpack.md in api/internal/handlers/registry.go +- [X] T010 Replace the `spec.env` patch in `installModpack` with a `spec.modpack` write and add `GET /servers/{name}/modpack` (active, phase, message, backupName, keyShared, backupAvailable; missingFiles empty for now) per contracts/api-modpack.md in api/internal/handlers/registry.go - [X] T011 Write the local Pencil prompt for the six surfaces in contracts/ui-modpacks-tab.md (repo `local-prompt` skill) and save it as notes/design-prompts/035-modpacks-tab.md in the project files -- [ ] T012 (valgul's machine, pencil-designer) Design the six surfaces in design.pen and export touched nodes to assets/design-export/json/ and assets/design-export/screenshots/ in the same commit -- [ ] T013 (valgul) Approve the T012 screenshots; record the approval in this file +- [X] T012 (valgul's machine, pencil-designer) Design the six surfaces in design.pen and export touched nodes to assets/design-export/json/ and assets/design-export/screenshots/ in the same commit (redone in design.fig) +- [X] T013 (valgul) Approve the T012 screenshots; record the approval in this file (approved by valgul 2026-11-22) **Checkpoint**: CRDs regenerated, operator renders pack env from `spec.modpack`, module declares all three registries, design approved. @@ -55,23 +55,23 @@ description: "Task list for spec 035: CurseForge and FTB modpacks for Minecraft" ### Tests for US1 -- [ ] T014 [P] [US1] Unit test CurseForge modpack versions filtered by game version and loader using the T002 fixture in api/internal/registry/curseforge_test.go -- [ ] T015 [P] [US1] envtest: POST install writes `spec.modpack`, needs manage permission, writes an audit entry without the key, returns 409 `server.modpack.key_required` on a java8-multiarch version while sharing is off, in api/internal/handlers/registry_modpack_envtest_test.go -- [ ] T016 [P] [US1] envtest: share on → `-curseforge-key` owned by the GameServer, mounted read-only at `/run/gameplane/curseforge/api-key` in the game container only, `CF_API_KEY_FILE` set, no key value in the pod spec, no config-hash change on key rotation; share off or key deleted → copy and mount removed, in operator/internal/controller/gameserver_modpack_key_envtest_test.go +- [X] T014 [P] [US1] Unit test CurseForge modpack versions filtered by game version and loader using the T002 fixture in api/internal/registry/curseforge_modpack_test.go +- [X] T015 [P] [US1] envtest: POST install writes `spec.modpack`, needs manage permission, writes an audit entry without the key, returns 409 `server.modpack.key_required` on a java8-multiarch version while sharing is off, in api/internal/handlers/registry_modpack_envtest_test.go +- [X] T016 [P] [US1] envtest: share on → `-curseforge-key` owned by the GameServer, game container only gets env `CF_API_KEY` (apiKeyEnv) via `valueFrom.secretKeyRef` to it, no key value in the pod spec, no config-hash change on key rotation; share off or key deleted → copy deleted and env removed, in operator/internal/controller/gameserver_modpack_key_envtest_test.go - [ ] T017 [US1] E2E: install a small CurseForge Fabric pack by slug + file id through the API (image built-in key, no browse key in CI), assert `Applied`, Running and the pack env; then install a Modrinth pack and assert no `CF_*` env remains (SC-004); one admin login; register in a bucket with login headroom per the comments in test/e2e/buckets.sh (not api-auth, api-roles, api-mods, api-rbac, api-agent) in test/e2e/modpack_e2e_test.go ### Implementation for US1 -- [ ] T018 [US1] Make CurseForge `Versions` honour `type=modpack` (class 4471 files, game version + loader filter) and update the `ModpackDeps` comments in api/internal/registry/curseforge.go -- [ ] T019 [US1] Add `modsBrowse` and `modpacksBlockedReason` to the providers listing (needsKeyImageTags vs the selected version's image tag and the share annotation) in api/internal/handlers/registry.go -- [ ] T020 [US1] Add `PUT/GET /admin/registries/curseforge/share` (annotation on the managed key Secret; 409 `server.registry.share_needs_managed_key` when only the startup flag holds a key) in api/internal/handlers/registry_secret.go and mount it with admin RBAC in api/cmd/main.go -- [ ] T021 [US1] Implement key sharing (watch the managed key Secret in the control namespace, maintain the server-owned copy, mount, `apiKeyFileEnv`, `status.modpack.keyShared`, kept out of the config hash) per contracts/operator-modpack.md item 5 in operator/internal/controller/gameserver_modpack_key.go, with kubebuilder RBAC markers, then `make manifests` -- [ ] T022 [P] [US1] Add the new API message ids (`server.modpack.*`, `server.registry.share_needs_managed_key`) to i18n/locales/en/app.json -- [ ] T023 [US1] Add `Servers.modpack`, `Servers.installModpack` (new body), `Admin.curseforgeShare` and the new types to web/src/lib/api.ts and web/src/types.ts -- [ ] T024 [US1] Filter the Mods tab to `modsBrowse` providers and the Modpacks switch to unblocked modpack providers in web/src/components/registry-browser.tsx -- [ ] T025 [US1] Build the install flow from the approved design (registry switch with CurseForge, version picker defaulting to newest, confirmation) in web/src/routes/tabs/Modpacks.tsx and new web/src/components/modpack-version-picker.tsx, web/src/components/modpack-confirm-dialog.tsx -- [ ] T026 [US1] Build the "Share the CurseForge key with game servers" switch from the approved design in web/src/routes/AdminSettings.tsx -- [ ] T027 [P] [US1] vitest for the install flow and the share switch in web/src/routes/tabs/Modpacks.test.tsx and web/src/routes/AdminSettings.test.tsx +- [X] T018 [US1] Make CurseForge `Versions` honour `type=modpack` (class 4471 files, game version + loader filter) and update the `ModpackDeps` comments in api/internal/registry/curseforge.go +- [X] T019 [US1] Add `modsBrowse` and `modpacksBlockedReason` to the providers listing (needsKeyImageTags vs the selected version's image tag and the share annotation) in api/internal/handlers/registry.go +- [X] T020 [US1] Add `PUT/GET /admin/registries/curseforge/share` (annotation on the managed key Secret; 409 `server.registry.share_needs_managed_key` when only the startup flag holds a key) in api/internal/handlers/registry_secret.go and mount it with admin RBAC in api/cmd/main.go +- [X] T021 [US1] Implement key sharing (read the managed key Secret in the control namespace (uncached, 60s requeue), maintain the server-owned copy, set the `apiKeyEnv` env via `valueFrom.secretKeyRef` (no mount), `status.modpack.keyShared`, kept out of the config hash) per contracts/operator-modpack.md item 5 in operator/internal/controller/gameserver_modpack_key.go, with the resourceNames-scoped `-operator-modreg-key` Role/RoleBinding in charts/gameplane/templates/operator.yaml (no kubebuilder markers, no manifests regen) +- [X] T022 [P] [US1] Add the new API message ids (`server.modpack.*`, `server.registry.share_needs_managed_key`) to i18n/locales/en/app.json +- [x] T023 [US1] Add `Servers.modpack`, `Servers.installModpack` (new body), `Admin.curseforgeShare` and the new types to web/src/lib/api.ts and web/src/types.ts +- [x] T024 [US1] Filter the Mods tab to `modsBrowse` providers and the Modpacks switch to unblocked modpack providers in web/src/components/registry-browser.tsx +- [x] T025 [US1] Build the install flow from the approved design (registry switch with CurseForge, version picker defaulting to newest, confirmation) in web/src/routes/tabs/Modpacks.tsx and new web/src/components/modpack-version-picker.tsx, web/src/components/modpack-confirm-dialog.tsx +- [x] T026 [US1] Build the "Share the CurseForge key with game servers" switch from the approved design in web/src/routes/AdminSettings.tsx +- [x] T027 [P] [US1] vitest for the install flow and the share switch in web/src/routes/tabs/Modpacks.test.tsx and web/src/routes/AdminSettings_share.test.tsx **Checkpoint**: US1 deliverable on its own: CurseForge packs install and boot; Modrinth install keeps working through `spec.modpack`. @@ -85,19 +85,19 @@ description: "Task list for spec 035: CurseForge and FTB modpacks for Minecraft" ### Tests for US2 -- [ ] T028 [P] [US2] envtest: `backupFirst` → Backup CR `-modpack-` owned by the GameServer, env unchanged until it succeeds; failed backup → `BackupFailed`, message set, env unchanged; a new change after `BackupFailed` restarts the flow, in operator/internal/controller/gameserver_modpack_envtest_test.go -- [ ] T029 [P] [US2] envtest: adopted legacy server (annotation set, pod running) and a not-yet-swept legacy server (`refEnv` value in `spec.env`, no `spec.modpack`) both keep an identical pod template (no roll) while players are online; an adopted server with a version gets the pin with one restart once `status.agent.playersOnline` is 0, or right away when stopped or asleep (OD-8 B); after an operator-driven restart the pin env is rendered and the annotation removed, in operator/internal/controller/gameserver_modpack_envtest_test.go -- [ ] T030 [P] [US2] envtest: legacy sweep reads `versionId` through the agent and writes `spec.modpack` + adopted annotation; unreadable → no `version` and `pinned: false`; 400 `server.modpack.backup_unavailable`; 409 `server.modpack.change_in_progress`, in api/internal/handlers/modpack_adopt_envtest_test.go +- [X] T028 [P] [US2] envtest: `backupFirst` → Backup CR `-modpack-` owned by the GameServer, env unchanged until it succeeds; failed backup → `BackupFailed`, message set, env unchanged; a new change after `BackupFailed` restarts the flow, in operator/internal/controller/gameserver_modpack_backup_envtest_test.go +- [X] T029 [P] [US2] envtest: adopted legacy server (annotation set, pod running) and a not-yet-swept legacy server (`refEnv` value in `spec.env`, no `spec.modpack`) both keep an identical pod template (no roll) while players are online; an adopted server with a version gets the pin with one restart once `status.agent.playersOnline` is 0, or right away when stopped or asleep (OD-8 B); after an operator-driven restart the pin env is rendered and the annotation removed, in operator/internal/controller/gameserver_modpack_adopt_envtest_test.go +- [X] T030 [P] [US2] envtest: legacy sweep reads `versionId` through the agent and writes `spec.modpack` + adopted annotation; unreadable → no `version` and `pinned: false`; 400 `server.modpack.backup_unavailable`; 409 `server.modpack.change_in_progress`, in api/internal/handlers/modpack_adopt_envtest_test.go - [ ] T031 [US2] E2E: pinned version survives 3 restarts (read `.curseforge-manifest.json` `fileId` through the agent) in test/e2e/modpack_e2e_test.go ### Implementation for US2 -- [ ] T032 [US2] Add the backup step to the state machine (`BackingUp`, Backup CR creation and watch, `BackupFailed`) in operator/internal/controller/gameserver_modpack.go, with RBAC markers and `make manifests` -- [ ] T033 [US2] Implement adopted-pack rendering (rule 2 of contracts/operator-modpack.md) in operator/internal/controller/gameserver_modpack.go -- [ ] T034 [US2] Implement the legacy sweep at API startup plus the lazy retry on `GET /servers/{name}/modpack` (research R6) in new api/internal/handlers/modpack_adopt.go and wire it in api/cmd/main.go -- [ ] T035 [US2] Validate `version` required, `backupFirst` vs destination, change-in-progress on POST in api/internal/handlers/registry.go -- [ ] T036 [US2] Build version change, older-version marking, downgrade warning and the "Back up first" checkbox from the approved design in web/src/components/modpack-version-picker.tsx and web/src/components/modpack-confirm-dialog.tsx -- [ ] T037 [P] [US2] vitest for downgrade warning and backup checkbox states (destination / no destination) in web/src/components/modpack-confirm-dialog.test.tsx +- [X] T032 [US2] Add the backup step to the state machine (`BackingUp`, Backup CR creation and watch, `BackupFailed`) in operator/internal/controller/gameserver_modpack.go, with RBAC markers and `make manifests` +- [X] T033 [US2] Implement adopted-pack rendering (rule 2 of contracts/operator-modpack.md) in operator/internal/controller/gameserver_modpack.go +- [X] T034 [US2] Implement the legacy sweep at API startup plus the lazy retry on `GET /servers/{name}/modpack` (research R6) in new api/internal/handlers/modpack_adopt.go and wire it in api/cmd/main.go +- [X] T035 [US2] Validate `version` required, `backupFirst` vs destination, change-in-progress on POST in api/internal/handlers/registry.go +- [X] T036 [US2] Build version change, older-version marking, downgrade warning and the "Back up first" checkbox from the approved design in web/src/components/modpack-version-picker.tsx and web/src/components/modpack-confirm-dialog.tsx +- [X] T037 [P] [US2] vitest for downgrade warning and backup checkbox states (destination / no destination) in web/src/components/modpack-confirm-dialog.test.tsx **Checkpoint**: versions are pinned for every registry; legacy servers are adopted without restarting while players are online (OD-8 B). @@ -111,16 +111,16 @@ description: "Task list for spec 035: CurseForge and FTB modpacks for Minecraft" ### Tests for US3 -- [ ] T038 [P] [US3] envtest: DELETE removes `spec.modpack`, sets the remove annotation with a request id, accepts a retry after a removal's backup failed, returns 404 only when neither `spec.modpack` nor `status.modpack.applied` is set, GET shows `pendingRemoval`, writes an audit entry, in api/internal/handlers/registry_modpack_envtest_test.go -- [ ] T039 [P] [US3] envtest: removal adds the one-shot wipe init step for the active loader's mods mount only, guarded by `.gameplane-mods-wiped-`; install of a different pack adds no wipe step, in operator/internal/controller/gameserver_modpack_envtest_test.go +- [X] T038 [P] [US3] envtest: DELETE removes `spec.modpack`, sets the remove annotation with a request id, accepts a retry after a removal's backup failed, returns 404 only when neither `spec.modpack` nor `status.modpack.applied` is set, GET shows `pendingRemoval`, writes an audit entry, in api/internal/handlers/registry_modpack_envtest_test.go +- [X] T039 [P] [US3] envtest: removal adds the one-shot wipe init step for the active loader's mods mount only, guarded by `.gameplane-mods-wiped-`; install of a different pack adds no wipe step, in operator/internal/controller/gameserver_modpack_remove_envtest_test.go - [ ] T040 [US3] E2E: remove the pack; mods folder empty, world folder unchanged, server Running as plain loader, in test/e2e/modpack_e2e_test.go ### Implementation for US3 -- [ ] T041 [US3] Add `DELETE /servers/{name}/modpack?backupFirst=` per contracts/api-modpack.md in api/internal/handlers/registry.go -- [ ] T042 [US3] Implement removal handling (annotation consume, optional backup, wipe init step with marker, annotation cleared once applied) in operator/internal/controller/gameserver_modpack.go -- [ ] T043 [US3] Build the Active modpack card (title, registry, version or "Not pinned", phase and message, Change version, Remove with the "every mod is deleted, including ones added by hand" confirmation) from the approved design in new web/src/components/modpack-active-card.tsx and web/src/routes/tabs/Modpacks.tsx -- [ ] T044 [P] [US3] vitest for card states (Applied, BackingUp, Applying, BackupFailed, Not pinned, read-only) in web/src/components/modpack-active-card.test.tsx +- [X] T041 [US3] Add `DELETE /servers/{name}/modpack?backupFirst=` per contracts/api-modpack.md in api/internal/handlers/registry.go +- [X] T042 [US3] Implement removal handling (annotation consume, optional backup, wipe init step with marker, annotation cleared once applied) in operator/internal/controller/gameserver_modpack.go +- [x] T043 [US3] Build the Active modpack card (title, registry, version or "Not pinned", phase and message, Change version, Remove with the "every mod is deleted, including ones added by hand" confirmation) from the approved design in new web/src/components/modpack-active-card.tsx and web/src/routes/tabs/Modpacks.tsx +- [x] T044 [P] [US3] vitest for card states (Applied, BackingUp, Applying, BackupFailed, Not pinned, read-only) in web/src/components/modpack-active-card.test.tsx **Checkpoint**: operators can see and remove packs from any registry. @@ -134,14 +134,14 @@ description: "Task list for spec 035: CurseForge and FTB modpacks for Minecraft" ### Tests for US4 -- [ ] T045 [P] [US4] Unit test the `MODS_NEED_DOWNLOAD.txt` parser (rows, 2+ space columns, URL last, non-CurseForge URLs dropped, size cap) with a captured sample, and `missingFilesUnknown` when no pod exists, in api/internal/handlers/modpack_missing_test.go +- [X] T045 [P] [US4] Unit test the `MODS_NEED_DOWNLOAD.txt` parser (rows, 2+ space columns, URL last, non-CurseForge URLs dropped, size cap) with a captured sample, and `missingFilesUnknown` when no pod exists, in api/internal/handlers/modpack_missing_test.go - [ ] T046 [US4] E2E (written, excluded from every CI bucket with a comment: needs a manual browser download) for a pack with a blocked mod in test/e2e/modpack_blocked_e2e_test.go and test/e2e/buckets.sh ### Implementation for US4 -- [ ] T047 [US4] Implement the parser and fill `missingFiles` + `downloadsPath` from `missingFilesPath` via the agent files API in new api/internal/handlers/modpack_missing.go and api/internal/handlers/registry.go -- [ ] T048 [US4] Build the missing files notice from the approved design in new web/src/components/modpack-missing-files.tsx and web/src/routes/tabs/Modpacks.tsx -- [ ] T049 [P] [US4] vitest for the notice in web/src/components/modpack-missing-files.test.tsx +- [X] T047 [US4] Implement the parser and fill `missingFiles` + `downloadsPath` from `missingFilesPath` via the agent files API in new api/internal/handlers/modpack_missing.go and api/internal/handlers/registry.go +- [x] T048 [US4] Build the missing files notice from the approved design in new web/src/components/modpack-missing-files.tsx and web/src/routes/tabs/Modpacks.tsx +- [x] T049 [P] [US4] vitest for the notice in web/src/components/modpack-missing-files.test.tsx **Checkpoint**: blocked-file packs are usable with the Files tab. @@ -155,15 +155,15 @@ description: "Task list for spec 035: CurseForge and FTB modpacks for Minecraft" ### Tests for US5 -- [ ] T050 [P] [US5] Unit test the FTB engine with the T002 fixtures (search resolves ids in batches, filters before the page limit so a match after the first 20 candidates is found, stops at 100 details, cache, bounded concurrency, upstream error) in api/internal/registry/ftb_test.go -- [ ] T051 [P] [US5] Add an FTB case to the dial-guard test in api/internal/registry/registry_dialguard_test.go +- [X] T050 [P] [US5] Unit test the FTB engine with the T002 fixtures (search resolves ids in batches, filters before the page limit so a match after the first 20 candidates is found, stops at 100 details, cache, bounded concurrency, upstream error) in api/internal/registry/ftb_test.go +- [X] T051 [P] [US5] Add an FTB case to the dial-guard test in api/internal/registry/registry_ftb_dialguard_test.go - [ ] T052 [US5] E2E (written, excluded from every CI bucket with a comment: FTB packs exceed CI runner budget) installing a small FTB pack in test/e2e/modpack_ftb_e2e_test.go and test/e2e/buckets.sh ### Implementation for US5 -- [ ] T053 [US5] Implement the keyless FTB engine (research R8) in new api/internal/registry/ftb.go -- [ ] T054 [US5] Register `ftb` in the engine set and `For()` in api/internal/registry/registry.go -- [ ] T055 [US5] Show FTB in the Modpacks switch (no new screens; uses the US1 flow) and add its label to i18n/locales/en/app.json and web/src/routes/tabs/Modpacks.tsx +- [X] T053 [US5] Implement the keyless FTB engine (research R8) in new api/internal/registry/ftb.go +- [X] T054 [US5] Register `ftb` in the engine set and `For()` in api/internal/registry/registry.go +- [x] T055 [US5] Show FTB in the Modpacks switch (no new screens; uses the US1 flow) and add its label to i18n/locales/en/app.json and web/src/routes/tabs/Modpacks.tsx **Checkpoint**: all three registries install pinned packs. @@ -171,15 +171,16 @@ description: "Task list for spec 035: CurseForge and FTB modpacks for Minecraft" ## Phase 8: Polish & cross-cutting -- [ ] T056 [P] Update operator/specs.md (spec.modpack rendering, state machine, wipe, key copies) -- [ ] T057 [P] Update api/specs.md (modpack routes, FTB engine, adoption sweep, share toggle) -- [ ] T058 [P] Update web/specs.md (Modpacks tab surfaces, admin share switch) -- [ ] T059 [P] Update modules/minecraft-java/specs.md and modules/minecraft-java/README.md (three registries, pinning, downloads folder, java8 key note) in the module repo -- [ ] T060 [P] Document `versionEnv`, `apiKeyFileEnv`, `needsKeyImageTags`, `missingFilesPath`, `adoptVersionFile`, `modpacksOnly` and `ftb` in docs/module-authoring.md -- [ ] T061 [P] Add the shared-key residual risk (research R2) to docs/security.md -- [ ] T062 [P] Add a CHANGELOG entry for CurseForge and FTB modpacks in CHANGELOG.md +- [X] T056 [P] Update operator/specs.md (spec.modpack rendering, state machine, wipe, key copies) +- [X] T057 [P] Update api/specs.md (modpack routes, FTB engine, adoption sweep, share toggle) +- [X] T058 [P] Update web/specs.md (Modpacks tab surfaces, admin share switch) +- [X] T059 [P] Update modules/minecraft-java/specs.md and modules/minecraft-java/README.md (three registries, pinning, downloads folder, java8 key note) in the module repo +- [X] T060 [P] Document `versionEnv`, `apiKeyEnv`, `needsKeyImageTags`, `missingFilesPath`, `adoptVersionFile`, `modpacksOnly` and `ftb` in docs/module-authoring.md +- [X] T061 [P] Add the shared-key residual risk (research R2) to docs/security.md +- [X] T062 [P] Add a CHANGELOG entry for CurseForge and FTB modpacks in CHANGELOG.md (changelog/unreleased/1055-curseforge-ftb-modpacks.md) - [ ] T063 Bump the modules submodule pointer after the module PR merges (`submodule-bump` skill), in modules - [ ] T064 Walk quickstart.md scenarios 1–11 against the CI results and a dev cluster if valgul provides one; record results in specs/035-curseforge-modpacks/quickstart.md +- [X] T065 Apply a CurseForge key-sharing toggle only when the server has 0 players online, is stopped or asleep, or a pack change is rolling it, reusing the OD-8 B gate (OD-10 A), in operator/internal/controller/gameserver_modpack_key.go, gameserver_modpack.go and gameserver_modpack_key_envtest_test.go --- diff --git a/test/e2e/buckets.sh b/test/e2e/buckets.sh index aae7a9502..3a299d793 100755 --- a/test/e2e/buckets.sh +++ b/test/e2e/buckets.sh @@ -270,9 +270,19 @@ TestGameServer_WakeOnConnect_PingDoesNotWake TestGameServer_WakeOnConnect_LoginWakes TestColdWakeFleet_ConcurrentJoins TestGameServer_WakeOnConnect_UnarmedNoSentinel +TestGameServer_Modpack_CurseForgeThenModrinth +TestGameServer_Modpack_PinSurvivesRestarts +TestGameServer_Modpack_RemoveKeepsWorld EOF } +# The three TestGameServer_Modpack_* tests (spec 035: T017, T031, T040) boot a +# real itzg Minecraft server with a CurseForge or Modrinth pack, so they sit +# here with the other real-Minecraft tests. Every bot-fast test runs on its own +# runner (hack/ci_scope.py bots), so each one's single admin login spends a +# fresh login budget; none of the api buckets has headroom. They need public +# egress to CurseForge and Modrinth and the module 2.13.0 providers block. + # Games with heavy resource requirements, excluded from default CI execution. # This bucket is DELIBERATELY never run in CI — not on PRs, not nightly, not # on `schedule:`, not via `workflow_dispatch:`. It is validated only by a @@ -489,7 +499,18 @@ TestBackup_PreparationAndSameNodeCopy EOF } -unbucketed() { :; } +# TestGameServer_Modpack_BlockedModManualDownload (spec 035, T046) is excluded +# from every CI bucket: its last step needs a jar the operator downloads by +# hand in a browser (CurseForge serves a blocked mod only to a browser +# session), and it skips unless GAMEPLANE_E2E_CF_BLOCKED_* is set. +# TestGameServer_Modpack_FTBInstall (spec 035, T052) is excluded because even +# the smallest modern FTB pack is ~170 MB of mods plus a heavy first boot, +# which exceeds the CI runner budget. Both are hand runs only. +unbucketed() { cat <<'EOF' +TestGameServer_Modpack_BlockedModManualDownload +TestGameServer_Modpack_FTBInstall +EOF +} bucket_monitoring() { cat <<'EOF' TestMonitoring_DiscoveryPerformanceAndPolicy diff --git a/test/e2e/gatewayparity_e2e_test.go b/test/e2e/gatewayparity_e2e_test.go index e47738304..a8ee34acd 100644 --- a/test/e2e/gatewayparity_e2e_test.go +++ b/test/e2e/gatewayparity_e2e_test.go @@ -550,7 +550,8 @@ func (p *gatewayParity) operations(t *testing.T) { if len(providers) != 1 || providers[0].Provider != "modrinth" || !providers[0].Available || !providers[0].Modpacks { t.Fatalf("remote template provider: %+v", providers) } - p.expect(t, p.client, http.MethodPost, p.route("/modpack?provider=modrinth"), map[string]string{"ref": "gateway-parity-pack"}, http.StatusOK) + p.expect(t, p.client, http.MethodPost, p.route("/modpack?provider=modrinth"), + map[string]string{"provider": "modrinth", "project": "gateway-parity-pack", "version": "v1"}, http.StatusAccepted) p.expect(t, p.client, http.MethodPut, p.route("/mods/ids"), []map[string]string{{"id": "remote-parity-id", "name": "Remote parity"}}, http.StatusOK) ids := p.expect(t, p.client, http.MethodGet, p.route("/mods/ids"), nil, http.StatusOK) if !bytes.Contains(ids, []byte("remote-parity-id")) { @@ -564,16 +565,9 @@ func (p *gatewayParity) operations(t *testing.T) { if err != nil { t.Fatal(err) } - envs, _, _ := unstructured.NestedSlice(gs.Object, "spec", "env") - gotPack := false - for _, entry := range envs { - item := entry.(map[string]any) - if item["name"] == "E2E_MODPACK" && item["value"] == "gateway-parity-pack" { - gotPack = true - } - } + gotPack, _, _ := unstructured.NestedString(gs.Object, "spec", "modpack", "project") modIDs, _, _ := unstructured.NestedSlice(gs.Object, "spec", "mods", "ids") - if gotPack != site.remote || (len(modIDs) == 1) != site.remote { + if (gotPack == "gateway-parity-pack") != site.remote || (len(modIDs) == 1) != site.remote { t.Fatal("modpack/ID-list update reached the wrong Kubernetes cluster") } } diff --git a/test/e2e/modpack_blocked_e2e_test.go b/test/e2e/modpack_blocked_e2e_test.go new file mode 100644 index 000000000..3f6079adc --- /dev/null +++ b/test/e2e/modpack_blocked_e2e_test.go @@ -0,0 +1,112 @@ +//go:build e2e + +package e2e + +import ( + "net/http" + "os" + "strings" + "testing" + "time" +) + +// TestGameServer_Modpack_BlockedModManualDownload (T046, US4) installs a +// CurseForge pack that contains a mod its author does not allow to be +// downloaded automatically, and checks that the Modpacks tab data lists it +// (GET /servers/{name}/modpack missingFiles, read from MODS_NEED_DOWNLOAD.txt +// through the agent) and that uploading the file to downloads/ is accepted. +// +// It is in NO CI bucket (see the comment above unbucketed() in buckets.sh): +// the last step is a manual browser download, because CurseForge only serves +// a blocked file to a browser session. The test therefore pauses for the +// operator: set GAMEPLANE_E2E_CF_BLOCKED_SLUG and GAMEPLANE_E2E_CF_BLOCKED_FILE_ID +// to a pack whose files page lists a "needs manual download" mod, and +// GAMEPLANE_E2E_CF_BLOCKED_JAR to the path of the jar downloaded in a browser +// from the downloadPage this test logs. A hand run: +// +// GAMEPLANE_E2E_GAME_BOT=1 GAMEPLANE_E2E_CF_BLOCKED_SLUG= \ +// GAMEPLANE_E2E_CF_BLOCKED_FILE_ID= GAMEPLANE_E2E_CF_BLOCKED_JAR=/path/mod.jar \ +// make test-e2e-keep # with -run TestGameServer_Modpack_BlockedModManualDownload +// +// Without the jar the test stops after asserting the list and logs the link. +func TestGameServer_Modpack_BlockedModManualDownload(t *testing.T) { + skipUnlessGameInScope(t, "minecraft-java") + requireModuleProviders(t) + slug := os.Getenv("GAMEPLANE_E2E_CF_BLOCKED_SLUG") + fileID := os.Getenv("GAMEPLANE_E2E_CF_BLOCKED_FILE_ID") + if slug == "" || fileID == "" { + t.Skip("set GAMEPLANE_E2E_CF_BLOCKED_SLUG and GAMEPLANE_E2E_CF_BLOCKED_FILE_ID to a CurseForge pack with a mod that needs a manual download") + } + t.Parallel() + + const name = "modpack-blocked" + tmpl := "e2e-" + name + "-tmpl" + gs := "e2e-" + name + "-gs" + + envInstance.BootstrapAdmin(t, adminUsername, adminPassword) + cli := envInstance.APIClient(t, adminUsername, adminPassword) + defer cli.Close() + + applyModpackTemplate(t, tmpl, modpackImage, modpackGameVersion) + applyModpackServer(t, gs, tmpl) + waitPVCBound(t, modpackNamespace, gs+"-data", 90*time.Second) + requireAgentReady(t, modpackNamespace, gs) + + installModpack(t, cli, gs, "curseforge", slug, fileID, slug, fileID) + waitModpackApplied(t, cli, gs, slug, fileID) + + // The image stops on the blocked file and writes MODS_NEED_DOWNLOAD.txt; + // the agent sidecar keeps it readable while the game container is down. + var missing []string + envInstance.Eventually(t, modpackBootTimeout, func() (bool, string) { + v, err := getModpack(t, cli, gs) + if err != nil { + return false, err.Error() + } + if len(v.MissingFiles) == 0 { + return false, "missingFiles empty" + } + if v.DownloadsPath != "downloads/" { + return false, "downloadsPath=" + v.DownloadsPath + } + for _, m := range v.MissingFiles { + if !strings.HasPrefix(m.DownloadPage, "https://www.curseforge.com/") { + return false, "downloadPage=" + m.DownloadPage + } + t.Logf("blocked mod %q file %q: download it in a browser from %s", m.Mod, m.Filename, m.DownloadPage) + missing = append(missing, m.Filename) + } + return true, "" + }) + + jar := os.Getenv("GAMEPLANE_E2E_CF_BLOCKED_JAR") + if jar == "" { + t.Skip("blocked mods listed; set GAMEPLANE_E2E_CF_BLOCKED_JAR to the manually downloaded jar to continue") + } + data, err := os.ReadFile(jar) + if err != nil { + t.Fatalf("read %s: %v", jar, err) + } + // Upload into downloads/ (where CF_DOWNLOADS_REPO points), restart, and + // expect the list to clear and the server to run. + writeDataFile(t, cli, gs, "/downloads/"+missing[0], string(data)) + resp, body, err := cli.Post("/servers/"+gs+":restart", nil) + if err != nil { + t.Fatalf("restart: %v", err) + } + defer resp.Body.Close() + if resp.StatusCode != http.StatusAccepted { + t.Fatalf("restart expected 202, got %d body=%q", resp.StatusCode, string(body)) + } + waitServerRunning(t, gs) + envInstance.Eventually(t, time.Minute, func() (bool, string) { + v, err := getModpack(t, cli, gs) + if err != nil { + return false, err.Error() + } + if len(v.MissingFiles) != 0 { + return false, "missingFiles still listed" + } + return true, "" + }) +} diff --git a/test/e2e/modpack_e2e_test.go b/test/e2e/modpack_e2e_test.go new file mode 100644 index 000000000..fdf727f9a --- /dev/null +++ b/test/e2e/modpack_e2e_test.go @@ -0,0 +1,756 @@ +//go:build e2e + +package e2e + +import ( + "bytes" + "context" + "encoding/json" + "fmt" + "io" + "net/http" + "net/url" + "os" + "path/filepath" + "strconv" + "strings" + "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/apis/meta/v1/unstructured" +) + +// Spec 035 (CurseForge and FTB modpacks) end-to-end tests: T017, T031, T040. +// T046 (blocked mod) and T052 (FTB pack) live in modpack_blocked_e2e_test.go +// and modpack_ftb_e2e_test.go and are in no CI bucket; see buckets.sh. +// +// The three tests here run in the bot-fast bucket. Every bot-fast test gets +// its own runner and cluster (hack/ci_scope.py bots), so the one admin login +// each test makes is its own login budget. They are gated like the other +// Minecraft bot tests: GAMEPLANE_E2E_GAME_BOT=1 and minecraft-java in scope. +// +// Pack choice (the suite never pushes the real module, so each test builds a +// template that mirrors the minecraft-java 2.13.0 providers block): +// +// - CurseForge: "Essentials Mods [FABRIC]" (slug essentials-mods-fabric, +// project 446581), file 8021547 = "Essentials Mods [FABRIC] - MC 26.1.2 - +// 1.0.0", Fabric (https://www.curseforge.com/minecraft/modpacks/ +// essentials-mods-fabric/files). It boots as a dedicated server on +// modpackImage with only TYPE, CF_SLUG, CF_FILE_ID and VERSION set (itzg +// drops its client-only mods; checked with docker run, "Done" in about a +// minute). A client pack such as Fabulously Optimized does not: itzg +// excludes YACL as client-only but keeps Controlify and Zoomify, which +// need it, so Fabric refuses to start. No key is needed in CI: the itzg +// image (Java 17+ tags) ships a built-in CurseForge key, and the API +// install route never calls CurseForge (it only records spec.modpack). +// - Modrinth: "FPS Modpack" (slug fps, project nJ2Rn3SV), version kedIKix5 = +// 3.2 for 26.1.2, Fabric, a 5 KB .mrpack. Found with the keyless search +// https://api.modrinth.com/v2/search?facets=[["project_type:modpack"], +// ["categories:fabric"]]&index=downloads and its /project/fps/version list, +// picking the smallest file that matches the same Minecraft version as the +// CurseForge pack. +const ( + modpackNamespace = "gameplane-games" + + // modpackImage is the image the minecraft-java 2.13.0 module pins for + // Minecraft 26.x (Java 25). + modpackImage = "itzg/minecraft-server:java25@sha256:9faa6aefeedd5a883c3ee241653fd1421529bdbafc428d0513e43cae0f2b7d68" + + modpackVersionID = "e2e-fabric" + modpackGameVersion = "26.1.2" + + cfPackSlug = "essentials-mods-fabric" + cfPackFileID = "8021547" + cfPackFileName = "Essentials Mods [FABRIC] - MC 26.1.2 - 1.0.0" + cfPackTitle = "Essentials Mods [FABRIC]" + + mrPackSlug = "fps" + mrPackVersion = "kedIKix5" + mrPackName = "3.2" + mrPackTitle = "FPS Modpack" + + modpackBootTimeout = 12 * time.Minute + modpackApplyTimeout = 4 * time.Minute + clearModsTimeout = 5 * time.Minute +) + +// requireModuleProviders skips the test when the checked-out minecraft-java +// module predates the CurseForge and FTB providers (module 2.13.0, on its own +// branch until merged). When the submodule is absent the inline template below +// is the only source, so the test runs. +func requireModuleProviders(t *testing.T) { + t.Helper() + data, err := os.ReadFile(filepath.Join("..", "..", "modules", "minecraft-java", "template.yaml")) + if err != nil { + return + } + if !strings.Contains(string(data), "refEnv: CF_SLUG") { + t.Skip("modules/minecraft-java/template.yaml has no curseforge modpacks block (module 2.13.0 not merged); " + + "the providers block is required, skipping") + } +} + +// modpackProviders mirrors capabilities.mods.registry.providers of the +// minecraft-java 2.13.0 template (modules/minecraft-java/template.yaml). +func modpackProviders() []any { + return []any{ + map[string]any{ + "provider": "modrinth", + "modpacks": map[string]any{ + "refEnv": "MODRINTH_MODPACK", + "versionEnv": "MODRINTH_VERSION", + "adoptVersionFile": map[string]any{ + "path": ".modrinth-modpack-manifest.json", "field": "versionId", + }, + "env": []any{map[string]any{"name": "TYPE", "value": "MODRINTH"}}, + }, + }, + map[string]any{ + "provider": "curseforge", + "curseforgeGameID": int64(432), + "modpacks": map[string]any{ + "refEnv": "CF_SLUG", + "versionEnv": "CF_FILE_ID", + "apiKeyEnv": "CF_API_KEY", + "needsKeyImageTags": []any{"java8-multiarch", "java8"}, + "missingFilesPath": "MODS_NEED_DOWNLOAD.txt", + "env": []any{ + map[string]any{"name": "TYPE", "value": "AUTO_CURSEFORGE"}, + map[string]any{"name": "CF_DOWNLOADS_REPO", "value": "/data/downloads"}, + }, + }, + }, + map[string]any{ + "provider": "ftb", + "modpacksOnly": true, + "modpacks": map[string]any{ + "refEnv": "FTB_MODPACK_ID", + "versionEnv": "FTB_MODPACK_VERSION_ID", + "env": []any{map[string]any{"name": "TYPE", "value": "FTBA"}}, + }, + }, + } +} + +// applyModpackTemplate creates a trimmed minecraft-java template: one Fabric +// version entry (so the operator provisions the per-loader mods volume the +// removal wipe needs) plus the 2.13.0 providers block. +func applyModpackTemplate(t *testing.T, name, image, gameVersion string) { + t.Helper() + tmpl := &unstructured.Unstructured{Object: map[string]any{ + "apiVersion": "gameplane.local/v1alpha1", + "kind": "GameTemplate", + "metadata": map[string]any{"name": name}, + "spec": map[string]any{ + "displayName": "E2E modpacks (" + name + ")", + "game": "minecraft-java", + "version": "1", + "image": image, + "security": map[string]any{ + "runAsUser": int64(1000), "runAsGroup": int64(1000), "fsGroup": int64(1000), + }, + "env": []any{ + map[string]any{"name": "EULA", "value": "TRUE"}, + map[string]any{"name": "ONLINE_MODE", "value": "FALSE"}, + map[string]any{"name": "INIT_MEMORY", "value": "512M"}, + map[string]any{"name": "MAX_MEMORY", "value": "1536M"}, + map[string]any{"name": "USE_AIKAR_FLAGS", "value": "false"}, + map[string]any{"name": "VIEW_DISTANCE", "value": "4"}, + map[string]any{"name": "ENABLE_RCON", "value": "false"}, + }, + "ports": []any{ + map[string]any{"name": "game", "containerPort": int64(25565), "advertise": true, "protocol": "TCP"}, + }, + "storage": map[string]any{"size": "4Gi", "mountPath": "/data"}, + "resources": map[string]any{ + "requests": map[string]any{"cpu": "250m", "memory": "1Gi"}, + "limits": map[string]any{"cpu": "2", "memory": "2560Mi"}, + }, + "probes": map[string]any{ + "readiness": map[string]any{ + "exec": map[string]any{"command": []any{"mc-health"}}, + "initialDelaySeconds": int64(30), + "periodSeconds": int64(10), + "failureThreshold": int64(60), + }, + }, + "versions": []any{ + map[string]any{ + "id": modpackVersionID, + "displayName": "E2E Fabric " + gameVersion, + "image": image, + "loader": "fabric", + "gameVersion": gameVersion, + "env": []any{ + map[string]any{"name": "TYPE", "value": "FABRIC"}, + map[string]any{"name": "VERSION", "value": gameVersion}, + }, + }, + }, + "capabilities": map[string]any{ + "mods": map[string]any{ + "loaders": map[string]any{ + "fabric": map[string]any{ + "displayName": "Mods (Fabric)", "path": "mods", + "extensions": []any{".jar"}, + }, + }, + "install": map[string]any{ + "allowedHosts": []any{".modrinth.com", ".curseforge.com", ".forgecdn.net"}, + "maxSizeMB": int64(512), + }, + "registry": map[string]any{"providers": modpackProviders()}, + }, + }, + }, + }} + if _, err := envInstance.Dyn.Resource(gameTemplateGVR). + Create(context.Background(), tmpl, metav1.CreateOptions{}); err != nil && !apierrors.IsAlreadyExists(err) { + t.Fatalf("create template %s: %v", name, err) + } + t.Cleanup(func() { + _ = envInstance.Dyn.Resource(gameTemplateGVR). + Delete(context.Background(), name, metav1.DeleteOptions{}) + }) +} + +// applyModpackServer creates the GameServer on the Fabric version entry. +func applyModpackServer(t *testing.T, gs, tmpl string) { + t.Helper() + obj := &unstructured.Unstructured{Object: map[string]any{ + "apiVersion": "gameplane.local/v1alpha1", + "kind": "GameServer", + "metadata": map[string]any{"name": gs, "namespace": modpackNamespace}, + "spec": map[string]any{ + "templateRef": map[string]any{"name": tmpl}, + "version": modpackVersionID, + }, + }} + if _, err := envInstance.Dyn.Resource(gameServerGVR).Namespace(modpackNamespace). + Create(context.Background(), obj, metav1.CreateOptions{}); err != nil { + t.Fatalf("create gameserver %s: %v", gs, err) + } + t.Cleanup(func() { + _ = envInstance.Dyn.Resource(gameServerGVR).Namespace(modpackNamespace). + Delete(context.Background(), gs, metav1.DeleteOptions{}) + }) +} + +// modpackView is the GET /servers/{name}/modpack body (contracts/api-modpack.md). +type modpackView struct { + Active *struct { + Provider string `json:"provider"` + Project string `json:"project"` + Version string `json:"version"` + Pinned bool `json:"pinned"` + PendingRemoval bool `json:"pendingRemoval"` + } `json:"active"` + Phase string `json:"phase"` + Message string `json:"message"` + MissingFiles []struct { + Mod string `json:"mod"` + Filename string `json:"filename"` + DownloadPage string `json:"downloadPage"` + } `json:"missingFiles"` + DownloadsPath string `json:"downloadsPath"` +} + +func getModpack(t *testing.T, cli *APIClient, gs string) (modpackView, error) { + t.Helper() + var v modpackView + resp, body, err := cli.Get("/servers/" + gs + "/modpack") + if err != nil { + return v, err + } + defer resp.Body.Close() + if resp.StatusCode != http.StatusOK { + return v, fmt.Errorf("GET /modpack status %d body=%q", resp.StatusCode, string(body)) + } + if err := json.Unmarshal(body, &v); err != nil { + return v, fmt.Errorf("decode /modpack: %w body=%q", err, string(body)) + } + return v, nil +} + +// installModpack POSTs the install body and requires 202 (the API only writes +// spec.modpack; the operator applies it). +func installModpack(t *testing.T, cli *APIClient, gs, provider, project, version, title, versionName string) { + t.Helper() + resp, body, err := cli.Post("/servers/"+gs+"/modpack", map[string]any{ + "provider": provider, "project": project, "version": version, + "title": title, "versionName": versionName, "backupFirst": false, + }) + if err != nil { + t.Fatalf("POST /modpack (%s/%s): %v", provider, project, err) + } + defer resp.Body.Close() + if resp.StatusCode != http.StatusAccepted { + t.Fatalf("POST /modpack (%s/%s) expected 202, got %d body=%q", provider, project, resp.StatusCode, string(body)) + } +} + +// waitModpackApplied waits for the operator to finish applying the change: +// phase Applied and the active pack matching wantProject ("" means no pack). +func waitModpackApplied(t *testing.T, cli *APIClient, gs, wantProject, wantVersion string) { + t.Helper() + envInstance.Eventually(t, modpackApplyTimeout, func() (bool, string) { + v, err := getModpack(t, cli, gs) + if err != nil { + return false, err.Error() + } + if v.Phase == "BackupFailed" { + t.Fatalf("modpack phase BackupFailed: %s", v.Message) + } + if v.Phase != "Applied" { + return false, "phase=" + v.Phase + } + if wantProject == "" { + if v.Active != nil { + return false, "active pack still set" + } + return true, "" + } + if v.Active == nil || v.Active.Project != wantProject || v.Active.Version != wantVersion || !v.Active.Pinned { + return false, fmt.Sprintf("active=%+v", v.Active) + } + return true, "" + }) +} + +// waitServerRunning waits for status.phase == Running and a Ready game pod. +// Using the pod too matters after a restart, where the GameServer phase can +// still read Running from before the pod went away. +func waitServerRunning(t *testing.T, gs string) { + t.Helper() + ctx := context.Background() + envInstance.Eventually(t, modpackBootTimeout, func() (bool, string) { + obj, err := envInstance.Dyn.Resource(gameServerGVR).Namespace(modpackNamespace). + Get(ctx, gs, metav1.GetOptions{}) + if err != nil { + return false, "get gs: " + err.Error() + } + phase, _, _ := unstructured.NestedString(obj.Object, "status", "phase") + if phase != "Running" { + return false, "phase=" + phase + } + pod, err := envInstance.K8s.CoreV1().Pods(modpackNamespace).Get(ctx, gs+"-0", metav1.GetOptions{}) + if err != nil { + return false, "get pod: " + err.Error() + } + if pod.DeletionTimestamp != nil { + return false, "pod terminating" + } + for _, c := range pod.Status.Conditions { + if c.Type == corev1.PodReady && c.Status == corev1.ConditionTrue { + return true, "" + } + } + return false, "pod not Ready" + }) +} + +// gameEnv returns the env of every non-agent container of the game pod. +func gameEnv(t *testing.T, gs string) map[string]string { + t.Helper() + pod, err := envInstance.K8s.CoreV1().Pods(modpackNamespace).Get(context.Background(), gs+"-0", metav1.GetOptions{}) + if err != nil { + t.Fatalf("get pod %s-0: %v", gs, err) + } + out := map[string]string{} + for _, c := range pod.Spec.Containers { + if c.Name == "agent" { + continue + } + for _, e := range c.Env { + out[e.Name] = e.Value + } + } + return out +} + +// eventuallyGameEnv polls until check returns "" for the pod env; the pod is +// replaced while the operator applies a change, so the first reads can still +// show the previous env. +func eventuallyGameEnv(t *testing.T, gs string, check func(env map[string]string) string) { + t.Helper() + envInstance.Eventually(t, modpackApplyTimeout, func() (bool, string) { + pod, err := envInstance.K8s.CoreV1().Pods(modpackNamespace).Get(context.Background(), gs+"-0", metav1.GetOptions{}) + if err != nil { + return false, "get pod: " + err.Error() + } + env := map[string]string{} + for _, c := range pod.Spec.Containers { + if c.Name == "agent" { + continue + } + for _, e := range c.Env { + env[e.Name] = e.Value + } + } + if msg := check(env); msg != "" { + return false, msg + } + return true, "" + }) +} + +type fileEntry struct { + Name string `json:"name"` + Dir bool `json:"dir"` +} + +// listFiles lists a directory of the data volume through the agent. +func listFiles(t *testing.T, cli *APIClient, gs, dir string) []fileEntry { + t.Helper() + resp, body, err := cli.Get("/servers/" + gs + "/files/list?path=" + url.QueryEscape(dir)) + if err != nil { + t.Fatalf("list %s: %v", dir, err) + } + defer resp.Body.Close() + if resp.StatusCode != http.StatusOK { + t.Fatalf("list %s expected 200, got %d body=%q", dir, resp.StatusCode, string(body)) + } + var entries []fileEntry + if err := json.Unmarshal(body, &entries); err != nil { + t.Fatalf("decode list %s: %v body=%q", dir, err, string(body)) + } + return entries +} + +// visibleEntries drops dotfiles: the removal wipe leaves its marker +// (.gameplane-mods-wiped-) inside the mods folder. +func visibleEntries(entries []fileEntry) []string { + var names []string + for _, e := range entries { + if !strings.HasPrefix(e.Name, ".") { + names = append(names, e.Name) + } + } + return names +} + +func writeDataFile(t *testing.T, cli *APIClient, gs, path, payload string) { + t.Helper() + req, err := http.NewRequestWithContext(t.Context(), http.MethodPost, + cli.BaseURL+"/servers/"+gs+"/files/write?path="+url.QueryEscape(path), bytes.NewReader([]byte(payload))) + if err != nil { + t.Fatalf("build write req: %v", err) + } + req.Header.Set("Content-Type", "application/octet-stream") + req.Header.Set("X-Gameplane-CSRF", cli.CSRF) + resp, err := cli.HTTP.Do(req) + if err != nil { + t.Fatalf("POST /files/write %s: %v", path, err) + } + body, _ := io.ReadAll(resp.Body) + _ = resp.Body.Close() + if resp.StatusCode/100 != 2 { + t.Fatalf("/files/write %s expected 2xx, got %d body=%q", path, resp.StatusCode, string(body)) + } +} + +func readDataFile(cli *APIClient, gs, path string) (string, error) { + resp, body, err := cli.Get("/servers/" + gs + "/files/read?path=" + url.QueryEscape(path)) + if err != nil { + return "", err + } + defer resp.Body.Close() + if resp.StatusCode != http.StatusOK { + return "", fmt.Errorf("read %s status %d body=%q", path, resp.StatusCode, string(body)) + } + return string(body), nil +} + +// clearModsFolder empties /mods by hand: switching to another pack does not +// empty it (OD-7 B, only Remove does), so a leg that moves between packs does +// it itself, as the spec tells operators to. +func clearModsFolder(t *testing.T, cli *APIClient, gs string) { + t.Helper() + for _, name := range visibleEntries(listFiles(t, cli, gs, "/mods")) { + deleteModsEntry(t, cli, gs, name) + } +} + +// deleteModsEntry deletes one entry of the mods folder. A CurseForge pack +// can hold more than a hundred jars, more than the API's mutation bucket +// (60 burst, 1/s refill) allows at once, so a 429 waits for Retry-After and +// tries again, for at most clearModsTimeout in all. +func deleteModsEntry(t *testing.T, cli *APIClient, gs, name string) { + t.Helper() + deadline := time.Now().Add(clearModsTimeout) + for { + resp, body, err := cli.Delete("/servers/" + gs + "/files/delete?recursive=true&path=" + url.QueryEscape("/mods/"+name)) + if err != nil { + t.Fatalf("delete /mods/%s: %v", name, err) + } + _ = resp.Body.Close() + if resp.StatusCode == http.StatusTooManyRequests && time.Now().Before(deadline) { + wait := 2 * time.Second + if secs, convErr := strconv.Atoi(resp.Header.Get("Retry-After")); convErr == nil && secs > 0 { + wait = time.Duration(secs) * time.Second + } + time.Sleep(wait) + continue + } + if resp.StatusCode/100 != 2 { + t.Fatalf("delete /mods/%s expected 2xx, got %d body=%q", name, resp.StatusCode, string(body)) + } + return + } +} + +// findFileID returns the first "fileId" value found anywhere in the JSON of +// the image's .curseforge-manifest.json, as a string. +func findFileID(v any) (string, bool) { + switch x := v.(type) { + case map[string]any: + if id, ok := x["fileId"]; ok { + return jsonNumberString(id), true + } + for _, child := range x { + if s, ok := findFileID(child); ok { + return s, true + } + } + case []any: + for _, child := range x { + if s, ok := findFileID(child); ok { + return s, true + } + } + } + return "", false +} + +func jsonNumberString(v any) string { + if f, ok := v.(float64); ok { + return fmt.Sprintf("%d", int64(f)) + } + return fmt.Sprint(v) +} + +// manifestFileID reads the installed CurseForge file id through the agent. +func manifestFileID(cli *APIClient, gs string) (string, error) { + raw, err := readDataFile(cli, gs, "/.curseforge-manifest.json") + if err != nil { + return "", err + } + var doc any + if err := json.Unmarshal([]byte(raw), &doc); err != nil { + return "", fmt.Errorf("decode .curseforge-manifest.json: %w", err) + } + id, ok := findFileID(doc) + if !ok { + return "", fmt.Errorf(".curseforge-manifest.json has no fileId") + } + return id, nil +} + +// bootCurseForgePack creates the template and server, installs the pinned +// CurseForge pack through the API before the first boot (so no throwaway +// vanilla boot is needed) and waits until the pack is Applied and the server +// Running. It returns the logged-in client (one admin login). +func bootCurseForgePack(t *testing.T, name string) (*APIClient, string) { + t.Helper() + tmpl := "e2e-" + name + "-tmpl" + gs := "e2e-" + name + "-gs" + + envInstance.BootstrapAdmin(t, adminUsername, adminPassword) + cli := envInstance.APIClient(t, adminUsername, adminPassword) + t.Cleanup(cli.Close) + + applyModpackTemplate(t, tmpl, modpackImage, modpackGameVersion) + applyModpackServer(t, gs, tmpl) + t.Cleanup(func() { logGameContainerOnFailure(t, gs) }) + waitPVCBound(t, modpackNamespace, gs+"-data", 90*time.Second) + + installModpack(t, cli, gs, "curseforge", cfPackSlug, cfPackFileID, cfPackTitle, cfPackFileName) + waitModpackApplied(t, cli, gs, cfPackSlug, cfPackFileID) + waitServerRunning(t, gs) + return cli, gs +} + +// TestGameServer_Modpack_CurseForgeThenModrinth (T017, SC-004) installs a +// small CurseForge Fabric pack by slug and file id through the API, asserts +// Applied, Running and the pack env, then switches to a Modrinth pack and +// asserts no CF_* env remains. +func TestGameServer_Modpack_CurseForgeThenModrinth(t *testing.T) { + skipUnlessGameInScope(t, "minecraft-java") + requireModuleProviders(t) + t.Parallel() + + cli, gs := bootCurseForgePack(t, "modpack-install") + + eventuallyGameEnv(t, gs, func(env map[string]string) string { + want := map[string]string{"TYPE": "AUTO_CURSEFORGE", "CF_SLUG": cfPackSlug, "CF_FILE_ID": cfPackFileID} + for k, v := range want { + if env[k] != v { + return fmt.Sprintf("env %s=%q want %q", k, env[k], v) + } + } + for k := range env { + if strings.HasPrefix(k, "MODRINTH_") { + return "unexpected " + k + } + } + return "" + }) + if id, err := manifestFileID(cli, gs); err != nil || id != cfPackFileID { + t.Fatalf("manifest fileId = %q, err=%v, want %s", id, err, cfPackFileID) + } + + // Switch to Modrinth. The mods folder is emptied by hand first (OD-7 B). + clearModsFolder(t, cli, gs) + installModpack(t, cli, gs, "modrinth", mrPackSlug, mrPackVersion, mrPackTitle, mrPackName) + waitModpackApplied(t, cli, gs, mrPackSlug, mrPackVersion) + waitServerRunning(t, gs) + + eventuallyGameEnv(t, gs, func(env map[string]string) string { + want := map[string]string{"TYPE": "MODRINTH", "MODRINTH_MODPACK": mrPackSlug, "MODRINTH_VERSION": mrPackVersion} + for k, v := range want { + if env[k] != v { + return fmt.Sprintf("env %s=%q want %q", k, env[k], v) + } + } + for k := range env { + if strings.HasPrefix(k, "CF_") { + return "stale " + k + " after switching to Modrinth" + } + } + return "" + }) +} + +// TestGameServer_Modpack_PinSurvivesRestarts (T031) proves a pinned CurseForge +// file is not upgraded by restarts: after three restarts the API, the pod env +// and the image's own .curseforge-manifest.json still say the pinned file id. +func TestGameServer_Modpack_PinSurvivesRestarts(t *testing.T) { + skipUnlessGameInScope(t, "minecraft-java") + requireModuleProviders(t) + t.Parallel() + + cli, gs := bootCurseForgePack(t, "modpack-pin") + ctx := context.Background() + + for i := 1; i <= 3; i++ { + pod, err := envInstance.K8s.CoreV1().Pods(modpackNamespace).Get(ctx, gs+"-0", metav1.GetOptions{}) + if err != nil { + t.Fatalf("restart %d: get pod: %v", i, err) + } + oldUID := pod.UID + + resp, body, err := cli.Post("/servers/"+gs+":restart", nil) + if err != nil { + t.Fatalf("restart %d: POST :restart: %v", i, err) + } + _ = resp.Body.Close() + if resp.StatusCode != http.StatusAccepted { + t.Fatalf("restart %d: expected 202, got %d body=%q", i, resp.StatusCode, string(body)) + } + envInstance.Eventually(t, modpackBootTimeout, func() (bool, string) { + p, err := envInstance.K8s.CoreV1().Pods(modpackNamespace).Get(ctx, gs+"-0", metav1.GetOptions{}) + if err != nil { + return false, "get pod: " + err.Error() + } + if p.UID == oldUID { + return false, "pod not replaced yet" + } + return true, "" + }) + waitServerRunning(t, gs) + + if got := gameEnv(t, gs)["CF_FILE_ID"]; got != cfPackFileID { + t.Fatalf("restart %d: pod CF_FILE_ID = %q, want %s", i, got, cfPackFileID) + } + v, err := getModpack(t, cli, gs) + if err != nil { + t.Fatalf("restart %d: %v", i, err) + } + if v.Active == nil || v.Active.Version != cfPackFileID || !v.Active.Pinned { + t.Fatalf("restart %d: active = %+v, want pinned %s", i, v.Active, cfPackFileID) + } + envInstance.Eventually(t, time.Minute, func() (bool, string) { + id, err := manifestFileID(cli, gs) + if err != nil { + return false, err.Error() + } + if id != cfPackFileID { + return false, fmt.Sprintf("restart %d: .curseforge-manifest.json fileId = %s, want %s", i, id, cfPackFileID) + } + return true, "" + }) + } +} + +// TestGameServer_Modpack_RemoveKeepsWorld (T040) removes the pack: the mods +// folder ends empty, a file planted in the world folder is unchanged and the +// server runs again as the plain Fabric loader. +func TestGameServer_Modpack_RemoveKeepsWorld(t *testing.T) { + skipUnlessGameInScope(t, "minecraft-java") + requireModuleProviders(t) + t.Parallel() + + cli, gs := bootCurseForgePack(t, "modpack-remove") + + if len(visibleEntries(listFiles(t, cli, gs, "/mods"))) == 0 { + t.Fatalf("mods folder is empty before removal; the pack installed no mods") + } + const worldFile = "/world/e2e-world-marker.txt" + const worldPayload = "world data must survive removing the pack" + writeDataFile(t, cli, gs, worldFile, worldPayload) + + resp, body, err := cli.Delete("/servers/" + gs + "/modpack?backupFirst=false") + if err != nil { + t.Fatalf("DELETE /modpack: %v", err) + } + defer resp.Body.Close() + if resp.StatusCode != http.StatusAccepted { + t.Fatalf("DELETE /modpack expected 202, got %d body=%q", resp.StatusCode, string(body)) + } + waitModpackApplied(t, cli, gs, "", "") + waitServerRunning(t, gs) + + eventuallyGameEnv(t, gs, func(env map[string]string) string { + if env["TYPE"] != "FABRIC" { + return fmt.Sprintf("TYPE=%q, want FABRIC (plain loader)", env["TYPE"]) + } + for _, k := range []string{"CF_SLUG", "CF_FILE_ID", "CF_DOWNLOADS_REPO"} { + if _, ok := env[k]; ok { + return "stale " + k + } + } + return "" + }) + + if names := visibleEntries(listFiles(t, cli, gs, "/mods")); len(names) != 0 { + t.Fatalf("mods folder after removal = %v, want empty", names) + } + got, err := readDataFile(cli, gs, worldFile) + if err != nil || got != worldPayload { + t.Fatalf("world marker after removal = %q, err=%v, want %q", got, err, worldPayload) + } +} + +// logGameContainerOnFailure prints the tail of the game container's current +// and previous logs when the test failed, so a crash-looping image (for +// example a CurseForge install error) shows its own error in the test output. +func logGameContainerOnFailure(t *testing.T, gs string) { + t.Helper() + if !t.Failed() { + return + } + pods := envInstance.K8s.CoreV1().Pods(modpackNamespace) + tail := int64(200) + for _, previous := range []bool{true, false} { + opts := &corev1.PodLogOptions{Container: "game", Previous: previous, TailLines: &tail} + out, err := pods.GetLogs(gs+"-0", opts).DoRaw(context.Background()) + if err != nil { + t.Logf("game container logs (previous=%t): %v", previous, err) + continue + } + t.Logf("game container logs (previous=%t):\n%s", previous, out) + } +} diff --git a/test/e2e/modpack_ftb_e2e_test.go b/test/e2e/modpack_ftb_e2e_test.go new file mode 100644 index 000000000..2b73b66ae --- /dev/null +++ b/test/e2e/modpack_ftb_e2e_test.go @@ -0,0 +1,68 @@ +//go:build e2e + +package e2e + +import ( + "fmt" + "testing" + "time" +) + +// FTB pack for T052, from the keyless FTB API (https://api.feed-the-beast.com): +// "FTB Unstable 1.20: Fabric", pack id 109, version 1.3.0 = version id 6571 +// (Minecraft 1.20.1, Fabric, 157 files, about 169 MB). Chosen by listing +// /v1/modpacks/public/modpack/all, summing each newest release's file sizes +// from /modpack/{id}/{version}, and keeping the smallest pack on a Minecraft +// version a current itzg image can still run (the smaller ones target 1.4.7). +const ( + ftbPackID = "109" + ftbPackVersion = "6571" + ftbPackTitle = "FTB Unstable 1.20: Fabric" + ftbPackName = "1.3.0" + ftbGameVersion = "1.20.1" + // Java 21 image of the minecraft-java module (runs Minecraft 1.20.1). + ftbImage = "itzg/minecraft-server:java21@sha256:f71555873bdaa6f4b663563de58678cca334bc51bdfbe548f7958ee9f516cf4a" +) + +// TestGameServer_Modpack_FTBInstall (T052, US5) installs a small FTB pack +// through the keyless FTB registry route and asserts Applied, Running and the +// FTBA env (TYPE, FTB_MODPACK_ID, FTB_MODPACK_VERSION_ID). +// +// It is in NO CI bucket (see the comment above unbucketed() in buckets.sh): +// even the smallest modern FTB pack downloads about 170 MB of files and runs +// a heavy first boot, which exceeds the CI runner budget. Hand run: +// +// GAMEPLANE_E2E_GAME_BOT=1 make test-e2e-keep # with -run TestGameServer_Modpack_FTBInstall +func TestGameServer_Modpack_FTBInstall(t *testing.T) { + skipUnlessGameInScope(t, "minecraft-java") + requireModuleProviders(t) + t.Parallel() + + const name = "modpack-ftb" + tmpl := "e2e-" + name + "-tmpl" + gs := "e2e-" + name + "-gs" + + envInstance.BootstrapAdmin(t, adminUsername, adminPassword) + cli := envInstance.APIClient(t, adminUsername, adminPassword) + defer cli.Close() + + applyModpackTemplate(t, tmpl, ftbImage, ftbGameVersion) + applyModpackServer(t, gs, tmpl) + waitPVCBound(t, modpackNamespace, gs+"-data", 90*time.Second) + + installModpack(t, cli, gs, "ftb", ftbPackID, ftbPackVersion, ftbPackTitle, ftbPackName) + waitModpackApplied(t, cli, gs, ftbPackID, ftbPackVersion) + waitServerRunning(t, gs) + + eventuallyGameEnv(t, gs, func(env map[string]string) string { + want := map[string]string{ + "TYPE": "FTBA", "FTB_MODPACK_ID": ftbPackID, "FTB_MODPACK_VERSION_ID": ftbPackVersion, + } + for k, v := range want { + if env[k] != v { + return fmt.Sprintf("env %s=%q want %q", k, env[k], v) + } + } + return "" + }) +} diff --git a/test/e2e/multicluster_e2e_test.go b/test/e2e/multicluster_e2e_test.go index bba636e57..77a02b174 100644 --- a/test/e2e/multicluster_e2e_test.go +++ b/test/e2e/multicluster_e2e_test.go @@ -622,6 +622,9 @@ func checkMissingRemoteTargetsDoNotReachHome(t *testing.T, admin *APIClient, clu t.Errorf("home gameserver %s/%s spec.env gained %s: %v", ns, homeGS, modpackEnv, env) } } + if mp, found, _ := unstructured.NestedMap(live.Object, "spec", "modpack"); found { + t.Errorf("home gameserver %s/%s gained spec.modpack: %v", ns, homeGS, mp) + } // The capture download outcome is audited with its reason. resp, body, err = admin.Get("/admin/audit?limit=500") diff --git a/test/e2e/specs.md b/test/e2e/specs.md index 3f9dd1eb4..8db08dfcf 100644 --- a/test/e2e/specs.md +++ b/test/e2e/specs.md @@ -46,6 +46,19 @@ The `test/e2e` module is Gameplane's end-to-end test suite: it stands up a real It was one of three `go.work` modules without CI lint coverage until this feature (`api`, `agent`, and `test/e2e` — see FR-001); all 13 `go.work` members (`netguard`, `gameaction`, `gameproto`, `operator`, `agent`, `api`, `sentinel`, `audit-syslog-bridge`, `telemetry-receiver`, `mcp-server`, `svcutil`, `tunnel`, and `test/e2e`) are golangci-lint gated in CI now — see the `lint` job's matrix in `.github/workflows/ci.yaml`. `test/e2e` lints with `--build-tags=e2e`, same tier as `operator`/`api`'s `--build-tags=envtest`, run as their own step so the catch-all lint step excludes all three and nothing is linted twice. +### Modpack drills (spec 035) + +`TestGameServer_Modpack_CurseForgeThenModrinth`, `TestGameServer_Modpack_PinSurvivesRestarts` and +`TestGameServer_Modpack_RemoveKeepsWorld` run in `bot-fast` (one runner per test, one admin login each, game-bot gate: +`GAMEPLANE_E2E_GAME_BOT=1`). They install a small CurseForge Fabric pack (Essentials Mods [FABRIC], file 8021547) and a +Modrinth pack (FPS Modpack, `kedIKix5`) through `POST /servers/{name}/modpack` with the itzg image's built-in CurseForge +key, and assert the operator's `Applied` phase, a Ready game pod and the rendered env (no `CF_*` after switching to +Modrinth), a pinned `CF_FILE_ID` and `.curseforge-manifest.json` `fileId` across three restarts, and an empty mods +folder with an untouched world folder and a plain Fabric server after removal. The tests build a template mirroring the +minecraft-java 2.13.0 providers block and skip when `modules/minecraft-java` is checked out without it. +`TestGameServer_Modpack_BlockedModManualDownload` (manual browser download) and `TestGameServer_Modpack_FTBInstall` +(~170 MB pack) are in no bucket; run them by hand with `GAMEPLANE_E2E_GAME_BOT=1`. + ## Responsibilities The operator bucket includes `TestGameServer_TemplateOnRequestRetainsData`: a diff --git a/web/specs.md b/web/specs.md index efd36942d..b6d47ee42 100644 --- a/web/specs.md +++ b/web/specs.md @@ -415,6 +415,14 @@ CloneServerDialog, TransferServerDialog and WipeServerDialog do not route throug - Layout: left sidebar with section buttons, right panel for section content - Each section maintains independent form state, save/discard flow, per-field validation +### Modpacks tab (spec 035, planned) + +Status: the API and CRD side has landed; the web work (specs/035-curseforge-modpacks tasks, not yet implemented) has not. Contracts: `specs/035-curseforge-modpacks/contracts/ui-modpacks-tab.md` and `api-modpack.md`; designs are in `design.pen`. + +- **Types and client (planned):** `web/src/types.ts` gains `ModpackDecl` fields `versionEnv`, `apiKeyEnv`, `needsKeyImageTags`, `missingFilesPath`, `adoptVersionFile`, the provider fields `modpacksOnly` and `ftb`, and the `GET /servers/{name}/modpack` view (`active`, `phase`, `message`, `backupName`, `keyShared`, `missingFiles`, `missingFilesUnknown`, `downloadsPath`, `backupAvailable`). `Servers.installModpack` moves from `{ ref }` to `{ provider, project, version, title, versionName, backupFirst }`; new `Servers.modpack`, `Servers.removeModpack(name, backupFirst)` and an admin `Registries.curseforgeShare` get/put. The install call returns 202; the tab polls the GET view until `phase` is `Applied`. +- **Surfaces (planned):** registry switch (Modrinth, CurseForge, FTB; CurseForge hidden when `modpacksBlockedReason` is set); version picker for the server's Minecraft version and loader with newest preselected and release/beta badges; confirmation dialog with "Back up first" and a downgrade warning; Active modpack card (title, registry, version or "Not pinned", phase, Change version, Remove, "Retry remove" after a failed removal backup); missing-files notice with links and the `downloads/` upload instructions, or a start-the-server note when `missingFilesUnknown`; admin Mod registries "Share the CurseForge key with game servers" switch, disabled with a reason when only the startup flag supplies the key. +- Mods tab hides providers with `modsBrowse=false`. Until these land, the existing Modpacks tab (`Modpacks.tsx`) is unchanged. + ### Settings Sub-Sections (T101–T111) All 11 sections render form controls from HeroUI (TextField, Select, Slider, Switch, Checkbox) with independent state management: diff --git a/web/src/components/modpack-active-card.test.tsx b/web/src/components/modpack-active-card.test.tsx new file mode 100644 index 000000000..441a63f03 --- /dev/null +++ b/web/src/components/modpack-active-card.test.tsx @@ -0,0 +1,146 @@ +import { describe, expect, it, vi } from "vitest"; +import { fireEvent, render, screen } from "@testing-library/react"; +import type { ModpackActive, ModpackPhase, ModpackView } from "@/types"; +import { ModpackActiveCard } from "./modpack-active-card"; + +const active: ModpackActive = { + provider: "curseforge", + project: "1234", + version: "5678", + title: "All The Mods 9", + versionName: "0.2.1", + pinned: true, +}; + +function view(over: Partial = {}, act: Partial | null = {}): ModpackView { + return { + active: act === null ? null : { ...active, ...act }, + phase: "Applied" as ModpackPhase, + message: "", + backupName: "", + keyShared: true, + missingFiles: [], + missingFilesUnknown: false, + downloadsPath: "/data/mods-downloads", + backupAvailable: true, + ...over, + }; +} + +function renderCard(v: ModpackView, opts: { canManage?: boolean; onChangeVersion?: () => void; onRemove?: () => void } = {}) { + const onChangeVersion = opts.onChangeVersion ?? vi.fn(); + const onRemove = opts.onRemove ?? vi.fn(); + render( + , + ); + return { onChangeVersion, onRemove }; +} + +describe("ModpackActiveCard", () => { + it("renders nothing when no pack is active", () => { + const { container } = render( + , + ); + expect(container).toBeEmptyDOMElement(); + }); + + it("shows the applied state with version, provider and Minecraft label", () => { + renderCard(view()); + expect(screen.getByText("Active modpack")).toBeInTheDocument(); + expect(screen.getByText("All The Mods 9")).toBeInTheDocument(); + expect(screen.getByText("Applied")).toBeInTheDocument(); + expect(screen.getByText("Version 0.2.1 · pinned · Minecraft 1.21.1 · Neoforge")).toBeInTheDocument(); + expect(screen.getByRole("button", { name: /change version/i })).toBeEnabled(); + expect(screen.getByRole("button", { name: /remove/i })).toBeEnabled(); + }); + + it("shows the backing up state with its default message and disables actions", () => { + renderCard(view({ phase: "BackingUp" })); + expect(screen.getByText("Backing up")).toBeInTheDocument(); + expect(screen.getByText("Backing up before switching. The server keeps running.")).toBeInTheDocument(); + expect(screen.getByRole("button", { name: /change version/i })).toBeDisabled(); + expect(screen.getByRole("button", { name: /remove/i })).toBeDisabled(); + }); + + it("shows the applying state with the restart message and disables actions", () => { + renderCard(view({ phase: "Applying" })); + expect(screen.getByText("Applying")).toBeInTheDocument(); + expect(screen.getByText("Restarting with the new version…")).toBeInTheDocument(); + expect(screen.getByRole("button", { name: /change version/i })).toBeDisabled(); + }); + + it("prefers the server message over the default when one is set", () => { + renderCard(view({ phase: "Applying", message: "Custom server message" })); + expect(screen.getByText("Custom server message")).toBeInTheDocument(); + expect(screen.queryByText("Restarting with the new version…")).not.toBeInTheDocument(); + }); + + it("shows backup failure in danger text and keeps remove enabled for managers", () => { + renderCard(view({ phase: "BackupFailed", message: "Backup could not be written" })); + expect(screen.getByText("Backup failed")).toBeInTheDocument(); + expect(screen.getByText("Backup could not be written")).toHaveClass("text-danger"); + expect(screen.getByRole("button", { name: /change version/i })).toBeEnabled(); + }); + + it("offers Pick version when the installed version is not pinned", () => { + const onChangeVersion = vi.fn(); + renderCard(view({}, { pinned: false }), { onChangeVersion }); + expect(screen.getByText("Not pinned")).toBeInTheDocument(); + expect(screen.getByText(/The installed version could not be read/)).toBeInTheDocument(); + expect(screen.getByText("Version unknown · Minecraft 1.21.1 · Neoforge")).toBeInTheDocument(); + fireEvent.click(screen.getByRole("button", { name: /pick version/i })); + expect(onChangeVersion).toHaveBeenCalledTimes(1); + }); + + it("shows the removing state and disables actions until the removal fails", () => { + renderCard(view({}, { pendingRemoval: true })); + expect(screen.getByText("Removing")).toBeInTheDocument(); + expect(screen.getByText("Removing the pack and emptying the mods folder at the next start…")).toBeInTheDocument(); + expect(screen.getByRole("button", { name: /change version/i })).toBeDisabled(); + expect(screen.getByRole("button", { name: /remove/i })).toBeDisabled(); + }); + + it("turns a removal whose backup failed into Retry remove", () => { + const onRemove = vi.fn(); + renderCard(view({ phase: "BackupFailed", message: "Disk full" }, { pendingRemoval: true }), { onRemove }); + expect(screen.getByText("Backup failed")).toBeInTheDocument(); + expect(screen.getByText("Disk full")).toHaveClass("text-danger"); + const retry = screen.getByRole("button", { name: /retry remove/i }); + expect(retry).toBeEnabled(); + fireEvent.click(retry); + expect(onRemove).toHaveBeenCalledTimes(1); + }); + + it("renders an FTB pack with its provider label", () => { + renderCard(view({}, { provider: "ftb", title: "Vault Hunters", versionName: "3.0" })); + expect(screen.getByText("Vault Hunters")).toBeInTheDocument(); + expect(screen.getByText("FTB")).toBeInTheDocument(); + }); + + it("disables both actions for read-only users and explains why", () => { + renderCard(view(), { canManage: false }); + expect(screen.getByRole("button", { name: /change version/i })).toBeDisabled(); + expect(screen.getByRole("button", { name: /remove/i })).toBeDisabled(); + expect(screen.getAllByTitle("Requires operator role").length).toBeGreaterThan(0); + }); + + it("calls onRemove when Remove is pressed", () => { + const { onRemove, onChangeVersion } = renderCard(view()); + fireEvent.click(screen.getByRole("button", { name: /remove/i })); + expect(onRemove).toHaveBeenCalledTimes(1); + expect(onChangeVersion).not.toHaveBeenCalled(); + }); + + it("calls onChangeVersion when Change version is pressed", () => { + const { onChangeVersion, onRemove } = renderCard(view()); + fireEvent.click(screen.getByRole("button", { name: /change version/i })); + expect(onChangeVersion).toHaveBeenCalledTimes(1); + expect(onRemove).not.toHaveBeenCalled(); + }); +}); diff --git a/web/src/components/modpack-active-card.tsx b/web/src/components/modpack-active-card.tsx new file mode 100644 index 000000000..fc6cbbc7a --- /dev/null +++ b/web/src/components/modpack-active-card.tsx @@ -0,0 +1,111 @@ +import { Button, Chip } from "@heroui/react"; +import { Package, RotateCcw, Trash2 } from "lucide-react"; +import type { ModpackView } from "@/types"; +import { useOptionalIntl } from "@/lib/i18n/format"; +import { providerLabel } from "@/components/registry-browser"; + +type ChipColor = "default" | "accent" | "success" | "warning" | "danger"; + +// ModpackActiveCard summarises the pack the server is running: its version, +// the phase of the last change and the actions that are allowed right now. +// It renders nothing when no pack is active. +export function ModpackActiveCard({ + view, + mcLabel, + canManage, + onChangeVersion, + onRemove, +}: { + view: ModpackView; + mcLabel: string; + canManage: boolean; + onChangeVersion(): void; + onRemove(): void; +}) { + const intl = useOptionalIntl(); + const active = view.active; + if (!active) return null; + + const phase = view.phase; + const removing = active.pendingRemoval === true; + const backupFailed = phase === "BackupFailed"; + const transitional = phase === "Pending" || phase === "BackingUp" || phase === "Applying"; + // While a removal is queued the only useful action is retrying a failed backup. + const removalBlocksActions = removing && !backupFailed; + const actionsDisabled = !canManage || transitional || removalBlocksActions; + const notPinned = !active.pinned; + + let chip: { label: string; color: ChipColor }; + let message = view.message; + let messageClass = "text-muted"; + if (removing && !backupFailed) { + chip = { label: intl.formatMessage({ id: "web.components.modpack_active_card.chip_removing", defaultMessage: "Removing", description: "Modpack active card: status chip while the modpack removal is queued" }), color: "warning" }; + message = intl.formatMessage({ id: "web.components.modpack_active_card.message_removing", defaultMessage: "Removing the pack and emptying the mods folder at the next start…", description: "Modpack active card: line shown while a modpack removal is queued for the next server start" }); + } else if (backupFailed) { + chip = { label: intl.formatMessage({ id: "web.components.modpack_active_card.chip_backup_failed", defaultMessage: "Backup failed", description: "Modpack active card: status chip when the backup taken before a change or removal failed" }), color: "danger" }; + messageClass = "text-danger"; + } else if (phase === "BackingUp") { + chip = { label: intl.formatMessage({ id: "web.components.modpack_active_card.chip_backing_up", defaultMessage: "Backing up", description: "Modpack active card: status chip while a backup is taken before the modpack changes" }), color: "accent" }; + message = message || intl.formatMessage({ id: "web.components.modpack_active_card.message_backing_up", defaultMessage: "Backing up before switching. The server keeps running.", description: "Modpack active card: default line shown while the backup before a modpack change runs" }); + } else if (phase === "Applying" || phase === "Pending") { + chip = { label: intl.formatMessage({ id: "web.components.modpack_active_card.chip_applying", defaultMessage: "Applying", description: "Modpack active card: status chip while the modpack change is being applied" }), color: "accent" }; + if (phase === "Applying") { + message = message || intl.formatMessage({ id: "web.components.modpack_active_card.message_applying", defaultMessage: "Restarting with the new version…", description: "Modpack active card: default line shown while the server restarts with the new modpack version" }); + } + } else if (notPinned) { + chip = { label: intl.formatMessage({ id: "web.components.modpack_active_card.chip_not_pinned", defaultMessage: "Not pinned", description: "Modpack active card: status chip when the installed modpack version could not be read" }), color: "warning" }; + message = intl.formatMessage({ id: "web.components.modpack_active_card.message_not_pinned", defaultMessage: "The installed version could not be read. Pick a version to pin this pack; until then a restart may upgrade it.", description: "Modpack active card: line explaining that the installed modpack version is unknown and a restart may upgrade it" }); + } else { + chip = { label: intl.formatMessage({ id: "web.components.modpack_active_card.chip_applied", defaultMessage: "Applied", description: "Modpack active card: status chip when the modpack is pinned and applied" }), color: "success" }; + } + + const versionText = notPinned + ? intl.formatMessage({ id: "web.components.modpack_active_card.version_unknown", defaultMessage: "Version unknown · {mc}", description: "Modpack active card: second line when the installed version is unknown; {mc} is the Minecraft version and loader label" }, { mc: mcLabel }) + : intl.formatMessage({ id: "web.components.modpack_active_card.version_pinned", defaultMessage: "Version {version} · pinned · {mc}", description: "Modpack active card: second line with the pinned modpack version; {version} is the version name, {mc} the Minecraft version and loader label" }, { version: active.versionName || active.version, mc: mcLabel }); + + const providerChip = providerLabel(active.provider); + const changeLabel = notPinned + ? intl.formatMessage({ id: "web.components.modpack_active_card.pick_version", defaultMessage: "Pick version", description: "Modpack active card: button that opens the version picker when the installed version is unknown" }) + : intl.formatMessage({ id: "web.components.modpack_active_card.change_version", defaultMessage: "Change version", description: "Modpack active card: button that opens the version picker to switch the modpack version" }); + const removeLabel = backupFailed && removing + ? intl.formatMessage({ id: "web.components.modpack_active_card.retry_remove", defaultMessage: "Retry remove", description: "Modpack active card: button that retries removing the modpack after its backup failed" }) + : intl.formatMessage({ id: "web.components.modpack_active_card.remove", defaultMessage: "Remove", description: "Modpack active card: button that removes the active modpack" }); + + const tooltip = canManage ? undefined : intl.formatMessage({ id: "web.routes.tabs.modpacks.requires_operator_role", defaultMessage: "Requires operator role", description: "Modpacks: tooltip on a disabled install control for users without the operator role" }); + + return ( +
+
+ {intl.formatMessage({ id: "web.components.modpack_active_card.label", defaultMessage: "Active modpack", description: "Modpack active card: small label above the active modpack summary" })} +
+
+
+
+
+
+

{active.title}

+ {providerChip} + {chip.label} +
+

{versionText}

+ {message &&

{message}

} +
+
+
+ + + + + + +
+
+ ); +} diff --git a/web/src/components/modpack-confirm-dialog.test.tsx b/web/src/components/modpack-confirm-dialog.test.tsx new file mode 100644 index 000000000..37f336cef --- /dev/null +++ b/web/src/components/modpack-confirm-dialog.test.tsx @@ -0,0 +1,121 @@ +import { describe, it, expect, vi } from "vitest"; +import { render, screen } from "@testing-library/react"; +import userEvent from "@testing-library/user-event"; +import { ModpackConfirmDialog } from "./modpack-confirm-dialog"; + +type Props = Parameters[0]; + +function base(overrides: Partial = {}): Props { + return { + open: true, + onOpenChange: vi.fn(), + mode: "install", + packTitle: "All the Mods", + providerLabel: "CurseForge", + versionName: "2.0.0", + serverName: "survival", + backupAvailable: true, + pending: false, + onConfirm: vi.fn(), + ...overrides, + }; +} + +describe("ModpackConfirmDialog", () => { + it.each([ + ["install", "Install All the Mods?", "Install and restart"], + ["change", "Switch to 2.0.0?", "Change version and restart"], + ["downgrade", "Go back to 2.0.0?", "Downgrade and restart"], + ["remove", "Remove All the Mods?", "Remove modpack"], + ] as const)("shows the %s title and primary label", (mode, title, label) => { + render(); + expect(screen.getByText(title)).toBeInTheDocument(); + expect(screen.getByRole("button", { name: label })).toBeEnabled(); + }); + + it("shows the downgrade warning only in downgrade mode", () => { + const { unmount } = render(); + expect(screen.getByText("This is an older version")).toBeInTheDocument(); + unmount(); + for (const mode of ["install", "change", "remove"] as const) { + const r = render(); + expect(screen.queryByText("This is an older version")).toBeNull(); + r.unmount(); + } + }); + + it("names the version it replaces in change mode", () => { + render(); + expect(screen.getByText("survival restarts on All the Mods 2.0.0 instead of 1.0.0.")).toBeInTheDocument(); + }); + + it("explains the restart without a from version", () => { + render(); + expect(screen.getByText("survival restarts on All the Mods 2.0.0.")).toBeInTheDocument(); + }); + + it("omits the pack summary version in remove mode and warns about hand-added mods", () => { + render(); + expect(screen.queryByText("CurseForge · 2.0.0")).toBeNull(); + expect(screen.getByText(/including ones added by hand/)).toBeInTheDocument(); + expect(screen.getByText("The pack is removed and survival restarts as a plain server.")).toBeInTheDocument(); + }); + + it("shows the pack summary with the provider and version outside remove mode", () => { + render(); + expect(screen.getByText("CurseForge · 2.0.0")).toBeInTheDocument(); + }); + + it("ticks back up first and passes backupFirst true when a destination exists", async () => { + const onConfirm = vi.fn(); + render(); + expect(screen.getByRole("checkbox")).toBeChecked(); + await userEvent.click(screen.getByRole("button", { name: "Install and restart" })); + expect(onConfirm).toHaveBeenCalledWith({ backupFirst: true }); + }); + + it("passes backupFirst false once the box is unticked", async () => { + const onConfirm = vi.fn(); + render(); + await userEvent.click(screen.getByRole("checkbox")); + expect(screen.getByRole("checkbox")).not.toBeChecked(); + await userEvent.click(screen.getByRole("button", { name: "Install and restart" })); + expect(onConfirm).toHaveBeenCalledWith({ backupFirst: false }); + }); + + it("re-ticks the backup box when the dialog reopens", () => { + const { rerender } = render(); + rerender(); + rerender(); + expect(screen.getByRole("checkbox")).toBeChecked(); + }); + + it("disables the backup box with a reason and passes false when no destination exists", async () => { + const onConfirm = vi.fn(); + render(); + const box = screen.getByRole("checkbox"); + expect(box).toBeDisabled(); + expect(box).not.toBeChecked(); + expect(screen.getByText("No backup destination is set for this server's cluster.")).toBeInTheDocument(); + await userEvent.click(screen.getByRole("button", { name: "Install and restart" })); + expect(onConfirm).toHaveBeenCalledWith({ backupFirst: false }); + }); + + it("disables both buttons and shows working while pending", () => { + render(); + expect(screen.getByRole("button", { name: "Working…" })).toBeDisabled(); + expect(screen.getByRole("button", { name: "Cancel" })).toBeDisabled(); + }); + + it("closes through Cancel when not pending", async () => { + const onOpenChange = vi.fn(); + render(); + await userEvent.click(screen.getByRole("button", { name: "Cancel" })); + expect(onOpenChange).toHaveBeenCalledWith(false); + }); + + it("shows the error text", () => { + render(); + expect(screen.getByRole("alert")).toHaveTextContent("Backup failed"); + }); +}); diff --git a/web/src/components/modpack-confirm-dialog.tsx b/web/src/components/modpack-confirm-dialog.tsx new file mode 100644 index 000000000..3fda9eba3 --- /dev/null +++ b/web/src/components/modpack-confirm-dialog.tsx @@ -0,0 +1,197 @@ +import { useState } from "react"; +import { + Alert, + Button, + Checkbox, + Modal, + ModalBackdrop, + ModalBody, + ModalContainer, + ModalDialog, + ModalFooter, + ModalHeader, + ModalHeading, +} from "@heroui/react"; +import { AlertTriangle, Package } from "lucide-react"; +import { useOptionalIntl } from "@/lib/i18n/format"; + +// ModpackConfirmDialog asks for confirmation before a modpack is installed, +// switched, downgraded or removed. It reports whether the backup box is +// ticked; the caller performs the change. +export function ModpackConfirmDialog({ + open, + onOpenChange, + mode, + packTitle, + providerLabel, + versionName, + fromVersionName, + serverName, + backupAvailable, + backupDestination, + pending, + error, + onConfirm, +}: { + open: boolean; + onOpenChange(o: boolean): void; + mode: "install" | "change" | "downgrade" | "remove"; + packTitle: string; + providerLabel: string; + versionName?: string; + fromVersionName?: string; + serverName: string; + backupAvailable: boolean; + // Name of the backup destination the backup goes to, when known. + backupDestination?: string; + pending: boolean; + error?: string; + onConfirm(opts: { backupFirst: boolean }): void; +}) { + const intl = useOptionalIntl(); + // Backup is ticked by default when a destination exists. Re-initialised + // every time the dialog opens so a previous untick does not stick. + const [backupWanted, setBackupWanted] = useState(backupAvailable); + + const [prevInit, setPrevInit] = useState({ open, backupAvailable }); + if (prevInit.open !== open || prevInit.backupAvailable !== backupAvailable) { + setPrevInit({ open, backupAvailable }); + if (open) setBackupWanted(backupAvailable); + } + + const backupFirst = backupAvailable && backupWanted; + const isRemove = mode === "remove"; + const isDowngrade = mode === "downgrade"; + + const title = (() => { + switch (mode) { + case "install": + return intl.formatMessage({ id: "web.components.modpack_confirm_dialog.install_title", defaultMessage: "Install {packTitle}?", description: "Modpack confirm dialog: title when installing a modpack; {packTitle} is the modpack title" }, { packTitle }); + case "change": + return intl.formatMessage({ id: "web.components.modpack_confirm_dialog.change_title", defaultMessage: "Switch to {versionName}?", description: "Modpack confirm dialog: title when switching the modpack to a newer version; {versionName} is the version name" }, { versionName: versionName ?? "" }); + case "downgrade": + return intl.formatMessage({ id: "web.components.modpack_confirm_dialog.downgrade_title", defaultMessage: "Go back to {versionName}?", description: "Modpack confirm dialog: title when moving the modpack to an older version; {versionName} is the version name" }, { versionName: versionName ?? "" }); + case "remove": + return intl.formatMessage({ id: "web.components.modpack_confirm_dialog.remove_title", defaultMessage: "Remove {packTitle}?", description: "Modpack confirm dialog: title when removing the modpack from the server; {packTitle} is the modpack title" }, { packTitle }); + } + })(); + + const description = (() => { + switch (mode) { + case "install": + return intl.formatMessage({ id: "web.components.modpack_confirm_dialog.install_desc", defaultMessage: "{serverName} restarts to install the pack. It stays on this version until you change it.", description: "Modpack confirm dialog: explains the server restarts to install the pack and keeps this version until changed; {serverName} is the server name" }, { serverName }); + case "remove": + return intl.formatMessage({ id: "web.components.modpack_confirm_dialog.remove_desc", defaultMessage: "The pack is removed and {serverName} restarts as a plain server.", description: "Modpack confirm dialog: explains the modpack is removed and the server restarts without it; {serverName} is the server name" }, { serverName }); + case "change": + case "downgrade": + if (fromVersionName) { + return intl.formatMessage({ id: "web.components.modpack_confirm_dialog.switch_desc_from", defaultMessage: "{serverName} restarts on {packTitle} {versionName} instead of {fromVersionName}.", description: "Modpack confirm dialog: explains the server restarts on the new version instead of the current one; {serverName}, {packTitle}, {versionName} and {fromVersionName} are names" }, { serverName, packTitle, versionName: versionName ?? "", fromVersionName }); + } + return intl.formatMessage({ id: "web.components.modpack_confirm_dialog.switch_desc", defaultMessage: "{serverName} restarts on {packTitle} {versionName}.", description: "Modpack confirm dialog: explains the server restarts on the chosen modpack version; {serverName}, {packTitle} and {versionName} are names" }, { serverName, packTitle, versionName: versionName ?? "" }); + } + })(); + + const primaryLabel = pending + ? intl.formatMessage({ id: "web.components.modpack_confirm_dialog.working", defaultMessage: "Working…", description: "Modpack confirm dialog: label of the primary button while the change is being submitted" }) + : (() => { + switch (mode) { + case "install": + return intl.formatMessage({ id: "web.components.modpack_confirm_dialog.install_and_restart", defaultMessage: "Install and restart", description: "Modpack confirm dialog: primary button that installs the modpack and restarts the server" }); + case "change": + return intl.formatMessage({ id: "web.components.modpack_confirm_dialog.change_and_restart", defaultMessage: "Change version and restart", description: "Modpack confirm dialog: primary button that switches the modpack version and restarts the server" }); + case "downgrade": + return intl.formatMessage({ id: "web.components.modpack_confirm_dialog.downgrade_and_restart", defaultMessage: "Downgrade and restart", description: "Modpack confirm dialog: primary button that moves to an older modpack version and restarts the server" }); + case "remove": + return intl.formatMessage({ id: "web.components.modpack_confirm_dialog.remove_modpack", defaultMessage: "Remove modpack", description: "Modpack confirm dialog: danger primary button that removes the modpack" }); + } + })(); + + const backupHelp = backupAvailable && backupDestination + ? intl.formatMessage({ id: "web.components.modpack_confirm_dialog.backup_help_destination", defaultMessage: "Takes a backup to the cluster’s backup destination ({destination}) before the change. If the backup fails, nothing changes.", description: "Modpack confirm dialog: help text under the back-up checkbox naming the backup destination; the backup is taken first and the change is cancelled if it fails; {destination} is the destination name" }, { destination: backupDestination }) + : backupAvailable + ? intl.formatMessage({ id: "web.components.modpack_confirm_dialog.backup_help", defaultMessage: "Takes a backup to this server's backup destination before the change. If the backup fails, nothing changes.", description: "Modpack confirm dialog: help text under the back-up checkbox explaining the backup is taken first and the change is cancelled if it fails" }) + : intl.formatMessage({ id: "web.components.modpack_confirm_dialog.no_backup_destination", defaultMessage: "No backup destination is set for this server's cluster.", description: "Modpack confirm dialog: help text under the disabled back-up checkbox when the cluster has no backup destination" }); + + return ( + + + + + + {title} + + +

{description}

+ {!isRemove && ( +
+ + +
+

{packTitle}

+

+ {versionName + ? intl.formatMessage({ id: "web.components.modpack_confirm_dialog.provider_version", defaultMessage: "{providerLabel} · {versionName}", description: "Modpack confirm dialog: pack summary line with the registry label and the version name; {providerLabel} is the registry, {versionName} the version" }, { providerLabel, versionName }) + : providerLabel} +

+
+
+ )} + {isDowngrade && ( + +
+
+
+ )} + {isRemove && ( + +
+
+
+ )} +
+ setBackupWanted(isSelected)} + isDisabled={!backupAvailable || pending} + className="flex-row items-center gap-2" + > + + + + + {intl.formatMessage({ id: "web.components.modpack_confirm_dialog.back_up_first", defaultMessage: "Back up first", description: "Modpack confirm dialog: checkbox label that takes a backup before the change" })} + + +

{backupHelp}

+
+ {error &&

{error}

} +
+ + + + +
+
+
+
+ ); +} diff --git a/web/src/components/modpack-confirm-dialog_destination.test.tsx b/web/src/components/modpack-confirm-dialog_destination.test.tsx new file mode 100644 index 000000000..4eede5c46 --- /dev/null +++ b/web/src/components/modpack-confirm-dialog_destination.test.tsx @@ -0,0 +1,35 @@ +import { describe, it, expect, vi } from "vitest"; +import { render, screen } from "@testing-library/react"; +import { ModpackConfirmDialog } from "./modpack-confirm-dialog"; + +type Props = Parameters[0]; + +function base(overrides: Partial = {}): Props { + return { + open: true, + onOpenChange: vi.fn(), + mode: "install", + packTitle: "All the Mods", + providerLabel: "CurseForge", + versionName: "2.0.0", + serverName: "survival", + backupAvailable: true, + pending: false, + onConfirm: vi.fn(), + ...overrides, + }; +} + +describe("ModpackConfirmDialog backup destination", () => { + it("names the backup destination when one is known", () => { + render(); + expect(screen.getByText(/\(s3-backups\)/)).toBeInTheDocument(); + expect(screen.getByText(/backup destination \(s3-backups\) before the change/)).toBeInTheDocument(); + }); + + it("keeps the generic backup text when no name is given", () => { + render(); + expect(screen.getByText("Takes a backup to this server's backup destination before the change. If the backup fails, nothing changes.")).toBeInTheDocument(); + expect(screen.queryByText(/s3-backups/)).not.toBeInTheDocument(); + }); +}); diff --git a/web/src/components/modpack-missing-files.test.tsx b/web/src/components/modpack-missing-files.test.tsx new file mode 100644 index 000000000..37259b2c7 --- /dev/null +++ b/web/src/components/modpack-missing-files.test.tsx @@ -0,0 +1,91 @@ +import { describe, expect, it, vi } from "vitest"; +import { fireEvent, render, screen } from "@testing-library/react"; +import type { ModpackMissingFile, ModpackView } from "@/types"; +import { ModpackMissingFiles } from "./modpack-missing-files"; + +const files: ModpackMissingFile[] = [ + { mod: "Jei", versionName: "1.0", filename: "jei-1.0.jar", downloadPage: "https://www.curseforge.com/minecraft/mc-mods/jei/files/1" }, + { mod: "Sodium", versionName: "0.5", filename: "sodium-0.5.jar", downloadPage: "http://insecure.example/sodium" }, +]; + +function view(over: Partial = {}): ModpackView { + return { + active: null, + phase: "", + message: "", + backupName: "", + keyShared: true, + missingFiles: files, + missingFilesUnknown: false, + downloadsPath: "/data/mods-downloads", + backupAvailable: false, + ...over, + }; +} + +describe("ModpackMissingFiles", () => { + it("renders nothing when there are no missing files", () => { + const { container } = render(); + expect(container).toBeEmptyDOMElement(); + }); + + it("shows the unknown-state note instead of the table", () => { + render(); + expect( + screen.getByText("Start the server to check whether this pack needs files you have to download yourself."), + ).toBeInTheDocument(); + expect(screen.queryByRole("table")).not.toBeInTheDocument(); + }); + + it("uses the plural title for several files and the singular for one", () => { + const { unmount } = render(); + expect(screen.getByText("2 files need a manual download")).toBeInTheDocument(); + unmount(); + render(); + expect(screen.getByText("1 file needs a manual download")).toBeInTheDocument(); + }); + + it("shows the downloads path in code style", () => { + const { container } = render(); + const code = container.querySelector("code"); + expect(code).not.toBeNull(); + expect(code).toHaveTextContent("/data/mods-downloads"); + }); + + it("lists each mod and file name in the table", () => { + render(); + expect(screen.getByRole("grid")).toBeInTheDocument(); + expect(screen.getByText("Jei")).toBeInTheDocument(); + expect(screen.getByText("jei-1.0.jar")).toBeInTheDocument(); + expect(screen.getByText("Sodium")).toBeInTheDocument(); + expect(screen.getByText("sodium-0.5.jar")).toBeInTheDocument(); + }); + + it("renders https download pages as external links with safe rel and target", () => { + render(); + const link = screen.getByRole("link", { name: /download page/i }); + expect(link).toHaveAttribute("href", files[0].downloadPage); + expect(link).toHaveAttribute("target", "_blank"); + expect(link).toHaveAttribute("rel", "noopener noreferrer"); + }); + + it("renders a non-https download page as plain text, not a link", () => { + render(); + const links = screen.getAllByRole("link"); + expect(links).toHaveLength(1); + expect(links[0]).toHaveAttribute("href", files[0].downloadPage); + expect(screen.getAllByText("Download page")).toHaveLength(2); + }); + + it("calls onOpenFiles when Open Files is pressed", () => { + const onOpenFiles = vi.fn(); + render(); + fireEvent.click(screen.getByRole("button", { name: "Open Files" })); + expect(onOpenFiles).toHaveBeenCalledTimes(1); + }); + + it("hides the Open Files button when no handler is passed", () => { + render(); + expect(screen.queryByRole("button", { name: "Open Files" })).not.toBeInTheDocument(); + }); +}); diff --git a/web/src/components/modpack-missing-files.tsx b/web/src/components/modpack-missing-files.tsx new file mode 100644 index 000000000..42fe4da5f --- /dev/null +++ b/web/src/components/modpack-missing-files.tsx @@ -0,0 +1,86 @@ +import type { ReactNode } from "react"; +import { Button, Table } from "@heroui/react"; +import { ExternalLink } from "lucide-react"; +import type { ModpackView } from "@/types"; +import { useOptionalIntl } from "@/lib/i18n/format"; + +// ModpackMissingFiles tells the operator which files of a CurseForge modpack +// the server cannot download itself (the author blocks third-party downloads), +// and where to upload them. Renders nothing when there is nothing to report. +export function ModpackMissingFiles({ + view, + onOpenFiles, +}: { + view: ModpackView; + onOpenFiles?: () => void; +}) { + const intl = useOptionalIntl(); + + if (view.missingFilesUnknown) { + return ( +

+ {intl.formatMessage({ id: "web.components.modpack_missing_files.unknown", defaultMessage: "Start the server to check whether this pack needs files you have to download yourself.", description: "Modpack missing files: info note shown when the server must start before the missing files can be known" })} +

+ ); + } + // The view can arrive without the list (an older or partial response); treat + // that as "nothing to report" rather than crashing the tab. + const files = view.missingFiles ?? []; + if (files.length === 0) return null; + + const count = files.length; + + return ( +
+
+
+

+ {intl.formatMessage({ id: "web.components.modpack_missing_files.title", defaultMessage: "{count, plural, one {# file needs} other {# files need}} a manual download", description: "Modpack missing files: panel title saying how many files must be downloaded by hand; {count} is the number of files", }, { count })} +

+

+ {intl.formatMessage( + { id: "web.components.modpack_missing_files.body", defaultMessage: "Their authors block automatic downloads, so the install stopped. Download each file from its page, upload it to {path} in the Files tab, then restart the server.", description: "Modpack missing files: explains that files blocked by their authors must be downloaded and uploaded by hand; {path} is the downloads folder, shown in code style" }, + { path: view.downloadsPath, b: (chunks: ReactNode) => {chunks} }, + )} +

+
+ {onOpenFiles && ( + + )} +
+ + + + + {intl.formatMessage({ id: "web.components.modpack_missing_files.mod", defaultMessage: "Mod", description: "Modpack missing files: column heading for the mod name; keep it short" })} + {intl.formatMessage({ id: "web.components.modpack_missing_files.file_name", defaultMessage: "File name", description: "Modpack missing files: column heading for the file name to upload; keep it short" })} + {intl.formatMessage({ id: "web.components.modpack_missing_files.download", defaultMessage: "Download", description: "Modpack missing files: column heading for the link to the file's download page; keep it short" })} + + + {files.map((f) => ( + + {f.mod} + {f.filename} + + {f.downloadPage.startsWith("https://") ? ( + + {intl.formatMessage({ id: "web.components.modpack_missing_files.download_page", defaultMessage: "Download page", description: "Modpack missing files: link text that opens the file's download page in a new tab" })} + + ) : ( + + {intl.formatMessage({ id: "web.components.modpack_missing_files.download_page", defaultMessage: "Download page", description: "Modpack missing files: link text that opens the file's download page in a new tab" })} + + )} + + + ))} + + + + +
+ ); +} diff --git a/web/src/components/modpack-missing-files_guard.test.tsx b/web/src/components/modpack-missing-files_guard.test.tsx new file mode 100644 index 000000000..7af095551 --- /dev/null +++ b/web/src/components/modpack-missing-files_guard.test.tsx @@ -0,0 +1,21 @@ +import { describe, it, expect } from "vitest"; +import { render } from "@testing-library/react"; +import type { ModpackView } from "@/types"; +import { ModpackMissingFiles } from "./modpack-missing-files"; + +describe("ModpackMissingFiles without a missingFiles list", () => { + it("renders nothing when the view omits missingFiles", () => { + const view = { + active: null, + phase: "", + message: "", + backupName: "", + keyShared: false, + missingFilesUnknown: false, + downloadsPath: "", + backupAvailable: false, + } as unknown as ModpackView; + const { container } = render(); + expect(container).toBeEmptyDOMElement(); + }); +}); diff --git a/web/src/components/modpack-version-picker.test.tsx b/web/src/components/modpack-version-picker.test.tsx new file mode 100644 index 000000000..05eba6d29 --- /dev/null +++ b/web/src/components/modpack-version-picker.test.tsx @@ -0,0 +1,143 @@ +import { describe, it, expect, vi } from "vitest"; +import { http, HttpResponse } from "msw"; +import { screen } from "@testing-library/react"; +import userEvent from "@testing-library/user-event"; +import { server } from "@/test/server"; +import { renderWithQuery } from "@/test/render"; +import { ModpackVersionPicker, isOlderThan } from "./modpack-version-picker"; +import type { RegistryVersion } from "@/types"; + +const version = (id: string): RegistryVersion => ({ + id, + name: `Pack ${id}`, + versionNumber: id, + gameVersions: ["1.21.1"], + loaders: ["neoforge"], + files: [], +}); + +// Newest first, as the API returns them. +const versions = [version("3"), version("2"), version("1")]; +const MC = "Minecraft 1.21.1 · NeoForge"; +const VERSIONS_PATH = "/servers/test/mods/registry/projects/proj-1/versions"; + +function mount(props: Partial[0]> = {}) { + const onContinue = vi.fn(); + const onOpenChange = vi.fn(); + renderWithQuery( + , + ); + return { onContinue, onOpenChange }; +} + +describe("isOlderThan", () => { + it("is true only when the candidate is further down the newest-first list", () => { + expect(isOlderThan(versions, "1", "2")).toBe(true); + expect(isOlderThan(versions, "2", "2")).toBe(false); + expect(isOlderThan(versions, "3", "2")).toBe(false); + }); + + it("is false when either id is missing or there is no pin", () => { + expect(isOlderThan(versions, "1", undefined)).toBe(false); + expect(isOlderThan(versions, "1", "")).toBe(false); + expect(isOlderThan(versions, "missing", "2")).toBe(false); + expect(isOlderThan(versions, "1", "missing")).toBe(false); + expect(isOlderThan([], "1", "2")).toBe(false); + }); +}); + +describe("ModpackVersionPicker", () => { + it("preselects the newest version and continues with it", async () => { + server.use(http.get(VERSIONS_PATH, () => HttpResponse.json(versions))); + const { onContinue } = mount(); + const radios = await screen.findAllByRole("radio"); + expect(radios).toHaveLength(3); + expect(radios[0]).toBeChecked(); + await userEvent.click(screen.getByRole("button", { name: "Continue" })); + expect(onContinue).toHaveBeenCalledWith(versions[0], false); + }); + + it("requests CurseForge modpack versions for the project", async () => { + let seen: URL | undefined; + server.use( + http.get(VERSIONS_PATH, ({ request }) => { + seen = new URL(request.url); + return HttpResponse.json(versions); + }), + ); + mount(); + await screen.findAllByRole("radio"); + expect(seen?.searchParams.get("provider")).toBe("curseforge"); + expect(seen?.searchParams.get("type")).toBe("modpack"); + }); + + it("marks the pinned and older rows and passes isOlder for an older choice", async () => { + server.use(http.get(VERSIONS_PATH, () => HttpResponse.json(versions))); + const { onContinue } = mount({ pinnedVersionId: "2" }); + const radios = await screen.findAllByRole("radio"); + expect(screen.getByText("Pinned")).toBeInTheDocument(); + expect(screen.getAllByText("Older")).toHaveLength(1); + await userEvent.click(radios[2]); + expect(radios[2]).toBeChecked(); + await userEvent.click(screen.getByRole("button", { name: "Continue" })); + expect(onContinue).toHaveBeenCalledWith(versions[2], true); + }); + + it("uses the confirm label and change title in change mode", async () => { + server.use(http.get(VERSIONS_PATH, () => HttpResponse.json(versions))); + mount({ confirmLabel: "Switch version" }); + await screen.findAllByRole("radio"); + expect(screen.getByText("Change version")).toBeInTheDocument(); + expect(screen.getByRole("button", { name: "Switch version" })).toBeEnabled(); + }); + + it("shows the choose title and the default label outside change mode", async () => { + server.use(http.get(VERSIONS_PATH, () => HttpResponse.json(versions))); + mount(); + await screen.findAllByRole("radio"); + expect(screen.getByText("Choose a version")).toBeInTheDocument(); + expect(screen.getByRole("button", { name: "Continue" })).toBeEnabled(); + }); + + it("shows the loading state while versions are requested", () => { + server.use(http.get(VERSIONS_PATH, () => new Promise(() => {}))); + mount(); + expect(screen.getByText("Loading versions…")).toBeInTheDocument(); + }); + + it("shows the empty state and disables Continue when nothing matches", async () => { + server.use(http.get(VERSIONS_PATH, () => HttpResponse.json([]))); + mount(); + expect(await screen.findByText(`No versions of this pack match ${MC}.`)).toBeInTheDocument(); + expect(screen.getByRole("button", { name: "Continue" })).toBeDisabled(); + }); + + it("shows an error message when versions cannot be loaded", async () => { + server.use(http.get(VERSIONS_PATH, () => HttpResponse.json({ title: "boom" }, { status: 500 }))); + mount(); + expect(await screen.findByRole("alert")).toBeInTheDocument(); + expect(screen.getByRole("button", { name: "Continue" })).toBeDisabled(); + }); + + it("does not request versions while closed", () => { + let requested = false; + server.use( + http.get(VERSIONS_PATH, () => { + requested = true; + return HttpResponse.json(versions); + }), + ); + mount({ open: false }); + expect(requested).toBe(false); + }); +}); diff --git a/web/src/components/modpack-version-picker.tsx b/web/src/components/modpack-version-picker.tsx new file mode 100644 index 000000000..5980306e6 --- /dev/null +++ b/web/src/components/modpack-version-picker.tsx @@ -0,0 +1,197 @@ +import { useState } from "react"; +import { useQuery } from "@tanstack/react-query"; +import { + Button, + Chip, + Modal, + ModalBackdrop, + ModalBody, + ModalContainer, + ModalDialog, + ModalFooter, + ModalHeader, + ModalHeading, + Radio, + RadioGroup, +} from "@heroui/react"; +import type { RegistryVersion } from "@/types"; +import { useResourceClient, useResourceTarget, resourceKey } from "@/lib/resourceTarget"; +import { errorTextIntl } from "@/lib/errors"; +import { useFormat, useOptionalIntl } from "@/lib/i18n/format"; +import { providerLabel } from "@/components/registry-browser"; + +// isOlderThan reports whether candidateId sits further down the newest-first +// list than pinnedId. Missing ids (or no pin) mean "not older". +export function isOlderThan(versions: RegistryVersion[], candidateId: string, pinnedId?: string): boolean { + if (!pinnedId) return false; + const candidate = versions.findIndex((v) => v.id === candidateId); + const pinned = versions.findIndex((v) => v.id === pinnedId); + if (candidate < 0 || pinned < 0) return false; + return candidate > pinned; +} + +// versionDetailLine is the second line of a version row: the publish date +// (when known) followed by the loader and game version the row matches. +function versionDetailLine(v: RegistryVersion, fmt: ReturnType, intl: ReturnType): string { + const details = [(v.loaders ?? []).join(", "), v.gameVersions?.[0] ?? ""].filter(Boolean).join(" "); + const published = v.publishedAt ? new Date(v.publishedAt) : null; + if (!published || Number.isNaN(published.getTime())) return details; + const date = fmt.date(published, { day: "numeric", month: "short", year: "numeric" }); + if (!details) { + return intl.formatMessage({ id: "web.components.modpack_version_picker.published", defaultMessage: "Published {date}", description: "Modpack version picker: version row line giving the publish date; {date} is a formatted date" }, { date }); + } + return intl.formatMessage({ id: "web.components.modpack_version_picker.published_with_details", defaultMessage: "Published {date} · {details}", description: "Modpack version picker: version row line giving the publish date and the loader and game version; {date} is a formatted date, {details} the loader and game version" }, { date, details }); +} + +// releaseChip marks the release channel: Release, Beta or Alpha. Versions +// without a reported channel get no chip. +function releaseChip(v: RegistryVersion, intl: ReturnType) { + switch (v.releaseType) { + case "release": + return {intl.formatMessage({ id: "web.components.modpack_version_picker.release_type_release", defaultMessage: "Release", description: "Modpack version picker: chip for a stable release of the modpack version" })}; + case "beta": + return {intl.formatMessage({ id: "web.components.modpack_version_picker.release_type_beta", defaultMessage: "Beta", description: "Modpack version picker: chip for a beta release of the modpack version" })}; + case "alpha": + return {intl.formatMessage({ id: "web.components.modpack_version_picker.release_type_alpha", defaultMessage: "Alpha", description: "Modpack version picker: chip for an alpha release of the modpack version" })}; + default: + return null; + } +} + +// ModpackVersionPicker lists the versions of one modpack (newest first) and +// hands the chosen one back to the caller. The caller decides what happens +// next (usually the confirmation dialog). +export function ModpackVersionPicker({ + open, + onOpenChange, + name, + ns, + provider, + project, + title, + mcLabel, + pinnedVersionId, + onContinue, + confirmLabel, +}: { + open: boolean; + onOpenChange(o: boolean): void; + name: string; + ns?: string; + provider: string; + project: string; + title: string; + mcLabel: string; + pinnedVersionId?: string; + onContinue(v: RegistryVersion, isOlder: boolean): void; + confirmLabel?: string; +}) { + const intl = useOptionalIntl(); + const fmt = useFormat(); + const target = useResourceTarget({ name, namespace: ns }); + const client = useResourceClient(target); + // undefined means "the newest version", so the selection resets on each open. + const [selectedId, setSelectedId] = useState(undefined); + + const [prevOpen, setPrevOpen] = useState(open); + if (prevOpen !== open) { + setPrevOpen(open); + if (open) setSelectedId(undefined); + } + + const versionsQ = useQuery({ + queryKey: resourceKey(target, "modpack-versions", provider, project), + queryFn: ({ signal }) => client.withSignal(signal).Servers.modpackVersions(name, project, provider, ns), + enabled: open, + }); + + const versions = versionsQ.data ?? []; + const selected = versions.find((v) => v.id === selectedId) ?? versions[0]; + const selectedOlder = selected ? isOlderThan(versions, selected.id, pinnedVersionId) : false; + const dialogTitle = confirmLabel + ? intl.formatMessage({ id: "web.components.modpack_version_picker.change_version", defaultMessage: "Change version", description: "Modpack version picker: dialog title when changing the version of the modpack already on the server" }) + : intl.formatMessage({ id: "web.components.modpack_version_picker.choose_a_version", defaultMessage: "Choose a version", description: "Modpack version picker: dialog title when choosing a version of a modpack to install" }); + + return ( + + + + + + {dialogTitle} +

+ {intl.formatMessage({ id: "web.components.modpack_version_picker.title_provider", defaultMessage: "{title} · {provider}", description: "Modpack version picker: subtitle with the modpack title and its registry name; {title} is the modpack title, {provider} the registry label" }, { title, provider: providerLabel(provider) })} +

+
+ +

+ {intl.formatMessage({ id: "web.components.modpack_version_picker.showing_versions", defaultMessage: "Showing versions for {mcLabel}, newest first.", description: "Modpack version picker: explains which Minecraft or game version and loader the listed versions match; {mcLabel} is that label" }, { mcLabel })} +

+ {versionsQ.isPending && ( +

+ {intl.formatMessage({ id: "web.components.modpack_version_picker.loading_versions", defaultMessage: "Loading versions…", description: "Modpack version picker: shown while the versions of the modpack are loading" })} +

+ )} + {versionsQ.isError && ( +

+ {errorTextIntl(intl, versionsQ.error, intl.formatMessage({ id: "web.components.modpack_version_picker.load_failed", defaultMessage: "Couldn't load versions.", description: "Modpack version picker: fallback error when the versions of the modpack cannot be loaded" }))} +

+ )} + {versionsQ.isSuccess && versions.length === 0 && ( +

+ {intl.formatMessage({ id: "web.components.modpack_version_picker.no_versions", defaultMessage: "No versions of this pack match {mcLabel}.", description: "Modpack version picker: empty state when the modpack has no version for the server's game version and loader; {mcLabel} is that label" }, { mcLabel })} +

+ )} + {versions.length > 0 && ( + setSelectedId(String(value))} + className="grid gap-2" + > + {versions.map((v) => ( + + + + + {v.name || v.versionNumber || v.id} + + {versionDetailLine(v, fmt, intl)} + + + {v.id === pinnedVersionId && ( + + {intl.formatMessage({ id: "web.components.modpack_version_picker.pinned", defaultMessage: "Pinned", description: "Modpack version picker: chip marking the version currently pinned on the server" })} + + )} + {isOlderThan(versions, v.id, pinnedVersionId) && ( + + {intl.formatMessage({ id: "web.components.modpack_version_picker.older", defaultMessage: "Older", description: "Modpack version picker: chip marking a version older than the one pinned on the server" })} + + )} + {releaseChip(v, intl)} + + + ))} + + )} +
+ + + + +
+
+
+
+ ); +} diff --git a/web/src/components/modpack-version-picker_meta.test.tsx b/web/src/components/modpack-version-picker_meta.test.tsx new file mode 100644 index 000000000..c2e7a62d7 --- /dev/null +++ b/web/src/components/modpack-version-picker_meta.test.tsx @@ -0,0 +1,62 @@ +import { describe, it, expect, vi } from "vitest"; +import { http, HttpResponse } from "msw"; +import { screen } from "@testing-library/react"; +import { server } from "@/test/server"; +import { renderWithQuery } from "@/test/render"; +import { ModpackVersionPicker } from "./modpack-version-picker"; +import type { RegistryVersion } from "@/types"; + +const VERSIONS_PATH = "/servers/test/mods/registry/projects/proj-1/versions"; +const MC = "Minecraft 1.21.1 · NeoForge"; + +const base = (id: string): RegistryVersion => ({ + id, + name: `Pack ${id}`, + versionNumber: id, + gameVersions: ["1.21.1"], + loaders: ["neoforge"], + files: [], +}); + +function mount() { + renderWithQuery( + , + ); +} + +describe("ModpackVersionPicker release metadata", () => { + it("shows release and beta chips and the publish date", async () => { + server.use( + http.get(VERSIONS_PATH, () => + HttpResponse.json([ + { ...base("3"), releaseType: "release", publishedAt: "2026-11-14T10:00:00Z" }, + { ...base("2"), releaseType: "beta", publishedAt: "2026-10-24T10:00:00Z" }, + ]), + ), + ); + mount(); + expect(await screen.findByText("Release")).toBeInTheDocument(); + expect(screen.getByText("Beta")).toBeInTheDocument(); + expect(screen.getByText(/Published Nov 14, 2026/, { selector: "span" })).toBeInTheDocument(); + expect(screen.getByText(/Published Oct 24, 2026/, { selector: "span" })).toBeInTheDocument(); + }); + + it("renders neither chip nor a publish line without metadata", async () => { + server.use(http.get(VERSIONS_PATH, () => HttpResponse.json([base("1")]))); + mount(); + await screen.findByRole("radio"); + expect(screen.queryByText("Release")).not.toBeInTheDocument(); + expect(screen.queryByText("Beta")).not.toBeInTheDocument(); + expect(screen.queryByText(/Published/)).not.toBeInTheDocument(); + expect(screen.getByText("neoforge 1.21.1")).toBeInTheDocument(); + }); +}); diff --git a/web/src/components/registry-browser.tsx b/web/src/components/registry-browser.tsx index 1dd384151..56bfbf088 100644 --- a/web/src/components/registry-browser.tsx +++ b/web/src/components/registry-browser.tsx @@ -45,6 +45,7 @@ const PROVIDER_LABELS: Record = { hangar: "Hangar", factorio: "Factorio Mod Portal", steam: "Steam Workshop", + ftb: "FTB", spigot: "SpigotMC", github: "GitHub Releases", umod: "uMod", @@ -109,8 +110,17 @@ export function RegistryBrowser({ queryFn: ({ signal }) => client.withSignal(signal).Servers.registryProviders(name, ns), }); const available = (providersQ.data ?? []).filter( - (p) => p.available && (type !== "modpack" || p.modpacks), + (p) => + p.available && + (type === "modpack" ? p.modpacks && !p.modpacksBlockedReason : p.modsBrowse !== false), ); + // CurseForge is hidden from the Modpacks switch until an admin shares the key. + const curseForgeNeedsSharedKey = + type === "modpack" && + (providersQ.data ?? []).some( + (p) => + p.available && p.modpacks && p.modpacksBlockedReason === "curseforge_key_not_shared", + ); // Fall back to the first available provider until one is picked (or if a // stale pick is no longer offered). const provider = picked && available.some((p) => p.provider === picked) ? picked : available[0]?.provider; @@ -146,9 +156,18 @@ export function RegistryBrowser({ const showChips = !!categories && categories.length > 0; const chipsInteractive = !!provider && CATEGORY_FILTERABLE_PROVIDERS.has(provider); + const sharedKeyHint = curseForgeNeedsSharedKey ? ( +

{intl.formatMessage({ id: "web.components.registry_browser.curseforge_needs_shared_key", defaultMessage: "CurseForge packs for Minecraft 1.16.5 need the shared CurseForge key. An admin can turn on “Share the CurseForge key with game servers” in Settings → Mod registries.", description: "Registry browser: muted hint under the modpack switch explaining CurseForge is hidden until an admin shares the CurseForge key with game servers" })}

+ ) : null; + // No usable provider (none declared, or all need config like a CurseForge key). if (!providersQ.isLoading && available.length === 0) { - return

{intl.formatMessage({ id: "web.components.registry_browser.in_app_browse_isn_t_available_for_this", defaultMessage: "In-app browse isn’t available for this server.", description: "Registry browser: message shown instead of the results when no usable registry provider exists for this server, so in-app browsing is unavailable" })}

; + return ( +
+

{intl.formatMessage({ id: "web.components.registry_browser.in_app_browse_isn_t_available_for_this", defaultMessage: "In-app browse isn’t available for this server.", description: "Registry browser: message shown instead of the results when no usable registry provider exists for this server, so in-app browsing is unavailable" })}

+ {sharedKeyHint} +
+ ); } return ( @@ -168,6 +187,7 @@ export function RegistryBrowser({ )} + {sharedKeyHint}
[]) { + server.use( + http.get("/servers/test/mods/registry/providers", () => HttpResponse.json(providers)), + http.get("/servers/test/mods/registry/search", () => HttpResponse.json([])), + ); +} + +const renderItem = () => null; + +describe("RegistryBrowser provider filtering", () => { + it("hides providers with modsBrowse:false from the mod browser", async () => { + seed([ + { provider: "modrinth", available: true, mods: true, modpacks: true }, + { provider: "curseforge", available: true, mods: true, modpacks: true, modsBrowse: false }, + ]); + renderWithQuery(); + await screen.findByPlaceholderText(/search/i); + expect(screen.queryByRole("tab", { name: "CurseForge" })).not.toBeInTheDocument(); + }); + + it("still shows providers whose modsBrowse is undefined", async () => { + seed([ + { provider: "modrinth", available: true, mods: true, modpacks: true }, + { provider: "curseforge", available: true, mods: true, modpacks: true }, + ]); + renderWithQuery(); + expect(await screen.findByRole("tab", { name: "CurseForge" })).toBeInTheDocument(); + }); + + it("hides a blocked provider from the modpack switch and shows the hint", async () => { + seed([ + { provider: "modrinth", available: true, mods: true, modpacks: true }, + { + provider: "curseforge", + available: true, + mods: true, + modpacks: true, + modpacksBlockedReason: "curseforge_key_not_shared", + }, + ]); + renderWithQuery(); + expect(await screen.findByText(/need the shared CurseForge key/i)).toBeInTheDocument(); + expect(screen.queryByRole("tab", { name: "CurseForge" })).not.toBeInTheDocument(); + }); + + it("does not show the hint on the mod browser", async () => { + seed([ + { provider: "curseforge", available: true, mods: true, modpacks: true, modpacksBlockedReason: "curseforge_key_not_shared" }, + ]); + renderWithQuery(); + await screen.findByPlaceholderText(/search/i); + expect(screen.queryByText(/need the shared CurseForge key/i)).not.toBeInTheDocument(); + }); +}); diff --git a/web/src/lib/endpoints.ts b/web/src/lib/endpoints.ts index 50fc4311f..4a66469e4 100644 --- a/web/src/lib/endpoints.ts +++ b/web/src/lib/endpoints.ts @@ -5,6 +5,9 @@ import type { AuditVerifyResult, AppearanceMode, Backup, + CurseForgeShare, + ModpackInstallBody, + ModpackView, BackupDestination, BackupSchedule, BannedPlayer, @@ -406,6 +409,11 @@ export const ModRegistries = { api(`/admin/registries/${encodeURIComponent(provider)}/secret`, { method: "DELETE", }), + // Whether game servers may use the managed CurseForge key (409 + // server.registry.share_needs_managed_key when no managed key is stored). + getShare: () => api("/admin/registries/curseforge/share"), + putShare: (share: boolean) => + api("/admin/registries/curseforge/share", { method: "PUT", body: { share } }), }; // FileEntry mirrors the agent's response shape (agent/openapi.yaml). The @@ -798,12 +806,22 @@ function makeResourceEndpoints(request: RequestClient, expectedUID?: string) { ns, ), ), - // Apply an env-mode modpack (e.g. Minecraft/itzg): pins the pack on the - // server and restarts it. - installModpack: (name: string, body: { ref: string }, provider?: string, ns?: string) => - api<{ ok: boolean }>( - withNS(`/servers/${name}/modpack` + (provider ? `?provider=${encodeURIComponent(provider)}` : ""), ns), - { method: "POST", body }, + // Modpack state for the server (active pack, phase, missing CurseForge files). + modpack: (name: string, ns?: string) => api(withNS(`/servers/${name}/modpack`, ns)), + // Install or change the server's modpack (202 + the new view). + installModpack: (name: string, body: ModpackInstallBody, ns?: string) => + api(withNS(`/servers/${name}/modpack`, ns), { method: "POST", body }), + // Remove the active modpack; backupFirst takes a backup before deleting mods (202). + removeModpack: (name: string, backupFirst: boolean, ns?: string) => + api(withNS(`/servers/${name}/modpack?backupFirst=${backupFirst}`, ns), { method: "DELETE" }), + // Versions of a modpack, pre-filtered server-side to the MC version and loader (newest first). + modpackVersions: (name: string, project: string, provider: string, ns?: string) => + api( + withNS( + `/servers/${name}/mods/registry/projects/${encodeURIComponent(project)}/versions` + + `?provider=${encodeURIComponent(provider)}&type=modpack`, + ns, + ), ), // Mods-by-id (spec.capabilities.mods.idList): games whose server // downloads its own mods given a list of ids (ARK CurseForge ids, diff --git a/web/src/lib/endpoints_modpack.test.ts b/web/src/lib/endpoints_modpack.test.ts new file mode 100644 index 000000000..2d030fb18 --- /dev/null +++ b/web/src/lib/endpoints_modpack.test.ts @@ -0,0 +1,73 @@ +import { afterEach, beforeEach, describe, expect, it, vi } from "vitest"; +import { ModRegistries, Servers } from "./endpoints"; + +const fetchMock = vi.fn(); + +beforeEach(() => { + vi.stubGlobal("fetch", fetchMock); + fetchMock.mockImplementation( + async () => new Response(JSON.stringify({}), { status: 200, headers: { "Content-Type": "application/json" } }), + ); +}); + +afterEach(() => { + fetchMock.mockReset(); + vi.unstubAllGlobals(); +}); + +interface FetchInit { + method?: string; + body?: BodyInit; +} + +function last(): { url: string; init: FetchInit } { + const c = fetchMock.mock.calls.at(-1); + expect(c).toBeDefined(); + return { url: c![0] as string, init: (c![1] ?? {}) as FetchInit }; +} + +describe("modpack client", () => { + it("modpack GETs the server modpack view", async () => { + await Servers.modpack("srv"); + const c = last(); + expect(c.url).toBe("/servers/srv/modpack"); + expect(c.init.method ?? "GET").toBe("GET"); + }); + + it("installModpack POSTs the body", async () => { + await Servers.installModpack("srv", { provider: "curseforge", project: "42", version: "7", backupFirst: true }); + const c = last(); + expect(c.url).toBe("/servers/srv/modpack"); + expect(c.init.method).toBe("POST"); + expect(JSON.parse(String(c.init.body))).toEqual({ + provider: "curseforge", + project: "42", + version: "7", + backupFirst: true, + }); + }); + + it("removeModpack DELETEs with backupFirst in the query", async () => { + await Servers.removeModpack("srv", true); + const c = last(); + expect(c.url).toBe("/servers/srv/modpack?backupFirst=true"); + expect(c.init.method).toBe("DELETE"); + }); + + it("modpackVersions encodes the project and asks for type=modpack", async () => { + await Servers.modpackVersions("srv", "a/b c", "curseforge"); + expect(last().url).toBe( + "/servers/srv/mods/registry/projects/a%2Fb%20c/versions?provider=curseforge&type=modpack", + ); + }); + + it("getShare and putShare hit the CurseForge share endpoint", async () => { + await ModRegistries.getShare(); + expect(last().url).toBe("/admin/registries/curseforge/share"); + await ModRegistries.putShare(true); + const c = last(); + expect(c.url).toBe("/admin/registries/curseforge/share"); + expect(c.init.method).toBe("PUT"); + expect(JSON.parse(String(c.init.body))).toEqual({ share: true }); + }); +}); diff --git a/web/src/lib/endpoints_more.test.ts b/web/src/lib/endpoints_more.test.ts index be0d8fb65..6b4584e06 100644 --- a/web/src/lib/endpoints_more.test.ts +++ b/web/src/lib/endpoints_more.test.ts @@ -231,15 +231,16 @@ describe("Servers mods endpoints (uncovered branches)", () => { expect(last().url).toBe("/servers/s1/mods/registry/projects/packname/modpack"); }); - it("installModpack with provider includes provider query param", async () => { - await Servers.installModpack("s1", { ref: "1.0" }, "modrinth"); - expect(last().url).toBe("/servers/s1/modpack?provider=modrinth"); + it("installModpack carries the provider in the body, not the query", async () => { + await Servers.installModpack("s1", { provider: "modrinth", project: "p", version: "1.0" }); + expect(last().url).toBe("/servers/s1/modpack"); expect(last().init.method).toBe("POST"); + expect(JSON.parse(String(last().init.body))).toEqual({ provider: "modrinth", project: "p", version: "1.0" }); }); - it("installModpack without provider omits provider query param", async () => { - await Servers.installModpack("s1", { ref: "1.0" }); - expect(last().url).toBe("/servers/s1/modpack"); + it("installModpack appends the namespace query when given", async () => { + await Servers.installModpack("s1", { provider: "modrinth", project: "p", version: "1.0" }, "ns1"); + expect(last().url).toBe("/servers/s1/modpack?namespace=ns1"); expect(last().init.method).toBe("POST"); }); diff --git a/web/src/lib/useModRegistrySave.ts b/web/src/lib/useModRegistrySave.ts index 7f365f0bc..8875d11c7 100644 --- a/web/src/lib/useModRegistrySave.ts +++ b/web/src/lib/useModRegistrySave.ts @@ -43,6 +43,12 @@ export function useModRegistrySave() { } return next; }, - onSettled: () => qc.invalidateQueries({ queryKey: ["config"] }), + // The share switch reads the managed key's state, which a save or delete changes. + onSettled: async () => { + await Promise.all([ + qc.invalidateQueries({ queryKey: ["config"] }), + qc.invalidateQueries({ queryKey: ["admin", "curseforge-share"] }), + ]); + }, }); } diff --git a/web/src/routes/AdminSettings.tsx b/web/src/routes/AdminSettings.tsx index 0962717d7..0ae50ed49 100644 --- a/web/src/routes/AdminSettings.tsx +++ b/web/src/routes/AdminSettings.tsx @@ -1,6 +1,6 @@ import { useModRegistrySave, type RegistryChange } from "@/lib/useModRegistrySave"; import { useInstallation } from "@/lib/useInstallation"; -import { useState, useEffect, useRef, type ChangeEvent, type ComponentType, type ReactNode, type SetStateAction } from "react"; +import { Fragment, useState, useEffect, useRef, type ChangeEvent, type ComponentType, type ReactNode, type SetStateAction } from "react"; import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query"; import { Bell, @@ -61,7 +61,7 @@ import { cn } from "@/lib/utils"; import { errorTextIntl } from "@/lib/errors"; import { Telemetry, type TelemetryInfo } from "@/lib/api"; import { TELEMETRY_STATEMENT_URL } from "@/lib/links"; -import { Auth, AuthProviders, Cluster, Notifications, type SinkSecretBody } from "@/lib/endpoints"; +import { Auth, AuthProviders, Cluster, ModRegistries, Notifications, type SinkSecretBody } from "@/lib/endpoints"; import { LegacyBackupSettings } from "@/components/clusters/LegacyBackupSettings"; import { can, useMe } from "@/lib/auth"; import type { ClusterInfo } from "@/types"; @@ -943,12 +943,67 @@ function SetRegistryKeyForm({ ); } +// Admin switch that lets game servers use the managed CurseForge key (design +// 4001: share on; 4260: key from the startup flag, switch disabled). Only a +// key stored here can be shared; a flag-set key stays inside the API. +function CurseForgeShareRow() { + const intl = useOptionalIntl(); + const queryClient = useQueryClient(); + const shareQ = useQuery({ + queryKey: ["admin", "curseforge-share"], + queryFn: ModRegistries.getShare, + }); + const shareMutation = useMutation({ + mutationFn: (share: boolean) => ModRegistries.putShare(share), + onSuccess: (body) => { + queryClient.setQueryData(["admin", "curseforge-share"], body); + }, + }); + + // Hidden while loading so the row does not flicker in. + const data = shareQ.data; + if (!data) return null; + const off = !data.managedKey; + const error = shareMutation.error ? errorTextIntl(intl, shareMutation.error) : null; + + return ( +
  • +
    +
    + {intl.formatMessage({ id: "web.routes.admin_settings.share_curseforge_key", defaultMessage: "Share the CurseForge key with game servers", description: "Admin settings: title of the switch that lets game servers use the managed CurseForge key" })} +
    +
    {intl.formatMessage({ id: "web.routes.admin_settings.share_curseforge_key_help", defaultMessage: "Lets servers on images without a built-in key (Minecraft 1.16.5 and older) install CurseForge packs.", description: "Admin settings: first description line under the CurseForge key share switch" })}
    +
    {intl.formatMessage({ id: "web.routes.admin_settings.share_curseforge_key_risk", defaultMessage: "Mods running on those servers can read the key.", description: "Admin settings: second description line under the CurseForge key share switch; it warns that mods can read the shared key" })}
    + {data.share && ( +
    {intl.formatMessage({ id: "web.routes.admin_settings.share_curseforge_key_apply", defaultMessage: "Changes apply to a server when it has 0 players, so nobody is kicked by a restart.", description: "Admin settings: note under the CurseForge key share switch when it is on; changes only apply to servers with 0 players" })}
    + )} + {off && ( +
    {intl.formatMessage({ id: "web.routes.admin_settings.share_curseforge_key_flag", defaultMessage: "Store the key here to share it. A key from the startup flag stays inside the API.", description: "Admin settings: reason shown under the disabled CurseForge key share switch when the key comes from the startup flag, not from this page" })}
    + )} + {error &&

    {error}

    } +
    + { shareMutation.mutate(value); }} + /> +
  • + ); +} + function ModRegistriesSection({ initial }: { initial?: ModRegistriesCfg }) { const intl = useOptionalIntl(); const save = useModRegistrySave(); const saving = useRef(false); const [editing, setEditing] = useState<{ provider: KeyedRegistryProvider; expected?: ModRegistryEntry } | null>(null); const entryFor = (provider: KeyedRegistryProvider) => initial?.registries.find((entry) => entry.provider === provider); + // Same query key as CurseForgeShareRow, so react-query shares one request. + const curseForgeFromFlag = useQuery({ + queryKey: ["admin", "curseforge-share"], + queryFn: ModRegistries.getShare, + select: (body) => body.keySource === "startup-flag", + }).data === true; const openEditor = (provider: KeyedRegistryProvider) => { save.reset(); @@ -978,25 +1033,29 @@ function ModRegistriesSection({ initial }: { initial?: ModRegistriesCfg }) { {keyedRegistryProviders.map(({ provider, label, icon: Icon }) => { const entry = entryFor(provider); const configured = Boolean(entry); + const fromFlag = provider === "curseforge" && curseForgeFromFlag; return ( -
  • + +
  • -
    {label}
    +
    + {label} +
    - {configured ? intl.formatMessage({ id: "web.routes.admin_settings.active_in_mods_browser", defaultMessage: "Active in the Mods browser", description: "Admin settings: registry status when a key is configured and the provider shows in the Mods browser" }) : intl.formatMessage({ id: "web.routes.admin_settings.hidden_from_mods_browser", defaultMessage: "Hidden from the Mods browser", description: "Admin settings: registry status when no key is configured and the provider is hidden from the Mods browser" })} + {provider === "curseforge" && curseForgeFromFlag ? intl.formatMessage({ id: "web.routes.admin_settings.share_curseforge_key_flag_set", defaultMessage: "Set by the --curseforge-api-key startup flag", description: "Admin settings: CurseForge registry description when the key comes from the --curseforge-api-key startup flag" }) : configured ? intl.formatMessage({ id: "web.routes.admin_settings.active_in_mods_browser", defaultMessage: "Active in the Mods browser", description: "Admin settings: registry status when a key is configured and the provider shows in the Mods browser" }) : intl.formatMessage({ id: "web.routes.admin_settings.hidden_from_mods_browser", defaultMessage: "Hidden from the Mods browser", description: "Admin settings: registry status when no key is configured and the provider is hidden from the Mods browser" })}
    - {configured ? intl.formatMessage({ id: "web.routes.admin_settings.configured", defaultMessage: "Configured", description: "Admin settings: badge on a mod registry whose API key is set" }) : intl.formatMessage({ id: "web.routes.admin_settings.not_configured", defaultMessage: "Not configured", description: "Admin settings: badge on a mod registry whose API key is not set" })} + {fromFlag ? intl.formatMessage({ id: "web.routes.admin_settings.share_curseforge_key_from_flag", defaultMessage: "From startup flag", description: "Admin settings: badge shown next to the CurseForge registry name when the key comes from the --curseforge-api-key startup flag" }) : configured ? intl.formatMessage({ id: "web.routes.admin_settings.configured", defaultMessage: "Configured", description: "Admin settings: badge on a mod registry whose API key is set" }) : intl.formatMessage({ id: "web.routes.admin_settings.not_configured", defaultMessage: "Not configured", description: "Admin settings: badge on a mod registry whose API key is not set" })} {editing?.provider !== provider && ( configured ? ( @@ -1009,6 +1068,8 @@ function ModRegistriesSection({ initial }: { initial?: ModRegistriesCfg }) { ) )}
  • + {provider === "curseforge" && } + ); })} diff --git a/web/src/routes/AdminSettings_share.test.tsx b/web/src/routes/AdminSettings_share.test.tsx new file mode 100644 index 000000000..61ef618dc --- /dev/null +++ b/web/src/routes/AdminSettings_share.test.tsx @@ -0,0 +1,100 @@ +import { describe, it, expect, vi } from "vitest"; +import type { ReactNode } from "react"; +import { http, HttpResponse } from "msw"; +import { screen, waitFor } from "@testing-library/react"; +import userEvent from "@testing-library/user-event"; +import { server } from "@/test/server"; +import { renderWithQuery } from "@/test/render"; +import { makeConfig } from "@/test/factories"; + +vi.mock("@tanstack/react-router", () => ({ + Link: ({ children, to, ...rest }: { children: ReactNode; to: string } & Record) => ( + {children} + ), +})); + +import { AdminSettingsPage } from "./AdminSettings"; + +async function gotoModRegistries() { + await screen.findByRole("heading", { name: /Admin settings/i }); + await userEvent.click(await screen.findByRole("button", { name: /Mod registries/i })); +} + +function seed(initial: { share: boolean; managedKey: boolean }, putStatus = 200) { + const puts: unknown[] = []; + server.use( + http.get("/admin/config", () => + HttpResponse.json(makeConfig({ modRegistries: { registries: [{ provider: "curseforge", configRef: "gameplane-modreg-curseforge" }] } })), + ), + http.get("/admin/registries/curseforge/share", () => HttpResponse.json(initial)), + http.put("/admin/registries/curseforge/share", async ({ request }) => { + puts.push(await request.json()); + if (putStatus === 409) { + return HttpResponse.json( + { type: "about:blank", status: 409, title: "Conflict", detail: "share needs a managed key", messageId: "server.registry.share_needs_managed_key" }, + { status: 409, headers: { "Content-Type": "application/problem+json" } }, + ); + } + return HttpResponse.json({ share: true, managedKey: true }); + }), + ); + return puts; +} + +describe("AdminSettings CurseForge key share switch", () => { + it("turns sharing on and shows the 0 players note", async () => { + const puts = seed({ share: false, managedKey: true }); + renderWithQuery(); + await gotoModRegistries(); + const sw = await screen.findByRole("switch", { name: /Share the CurseForge key with game servers/i }); + expect(sw).not.toBeDisabled(); + expect(sw).not.toBeChecked(); + expect(screen.queryByText(/0 players/i)).not.toBeInTheDocument(); + await userEvent.click(sw); + await waitFor(() => expect(puts).toEqual([{ share: true }])); + await waitFor(() => expect(screen.getByRole("switch", { name: /Share the CurseForge key/i })).toBeChecked()); + expect(screen.getByText(/0 players/i)).toBeInTheDocument(); + }); + + it("disables the switch with a reason when the key is not managed", async () => { + const puts = seed({ share: false, managedKey: false }); + renderWithQuery(); + await gotoModRegistries(); + const sw = await screen.findByRole("switch", { name: /Share the CurseForge key with game servers/i }); + expect(sw).toBeDisabled(); + expect(screen.getByText(/A key from the startup flag stays inside the API/i)).toBeInTheDocument(); + await userEvent.click(sw); + expect(puts).toEqual([]); + }); + + it("shows the error and keeps the switch off when the PUT is rejected", async () => { + seed({ share: false, managedKey: true }, 409); + renderWithQuery(); + await gotoModRegistries(); + const sw = await screen.findByRole("switch", { name: /Share the CurseForge key with game servers/i }); + await userEvent.click(sw); + await waitFor(() => expect(document.body.textContent).toMatch(/share needs a managed key|managed/i)); + expect(screen.getByRole("switch", { name: /Share the CurseForge key/i })).not.toBeChecked(); + }); + + it("refreshes the switch when the key is removed", async () => { + let managedKey = true; + server.use( + http.get("/admin/config", () => + HttpResponse.json(makeConfig({ modRegistries: { registries: managedKey ? [{ provider: "curseforge", configRef: "gameplane-modreg-curseforge" }] : [] } })), + ), + http.put("/admin/config/modRegistries", () => new HttpResponse(null, { status: 204 })), + http.delete("/admin/registries/:provider/secret", () => { + managedKey = false; + return new HttpResponse(null, { status: 204 }); + }), + http.get("/admin/registries/curseforge/share", () => HttpResponse.json({ share: false, managedKey })), + ); + renderWithQuery(); + await gotoModRegistries(); + const sw = await screen.findByRole("switch", { name: /Share the CurseForge key with game servers/i }); + expect(sw).not.toBeDisabled(); + await userEvent.click(await screen.findByRole("button", { name: /Remove/i })); + await waitFor(() => expect(screen.getByRole("switch", { name: /Share the CurseForge key/i })).toBeDisabled()); + }); +}); diff --git a/web/src/routes/AdminSettings_share_keysource.test.tsx b/web/src/routes/AdminSettings_share_keysource.test.tsx new file mode 100644 index 000000000..626b077b1 --- /dev/null +++ b/web/src/routes/AdminSettings_share_keysource.test.tsx @@ -0,0 +1,40 @@ +import { describe, it, expect, vi } from "vitest"; +import type { ReactNode } from "react"; +import { http, HttpResponse } from "msw"; +import { screen, within } from "@testing-library/react"; +import userEvent from "@testing-library/user-event"; +import { server } from "@/test/server"; +import { renderWithQuery } from "@/test/render"; +import { makeConfig } from "@/test/factories"; + +vi.mock("@tanstack/react-router", () => ({ + Link: ({ children, to, ...rest }: { children: ReactNode; to: string } & Record) => ( + {children} + ), +})); + +import { AdminSettingsPage } from "./AdminSettings"; + +describe("AdminSettings CurseForge share key source", () => { + it("names the startup flag as the key source and keeps the switch disabled", async () => { + server.use( + http.get("/admin/config", () => + HttpResponse.json(makeConfig({ modRegistries: { registries: [{ provider: "curseforge", configRef: "gameplane-modreg-curseforge" }] } })), + ), + http.get("/admin/registries/curseforge/share", () => + HttpResponse.json({ share: false, managedKey: false, keySource: "startup-flag" }), + ), + ); + renderWithQuery(); + await screen.findByRole("heading", { name: /Admin settings/i }); + await userEvent.click(await screen.findByRole("button", { name: /Mod registries/i })); + + // The badge and source line belong to the CurseForge registry row, not the share row. + const registryRow = (await screen.findByText("CurseForge")).closest("li"); + expect(registryRow).not.toBeNull(); + expect(within(registryRow as HTMLElement).getByText("From startup flag")).toBeInTheDocument(); + expect(within(registryRow as HTMLElement).queryByText("Configured")).not.toBeInTheDocument(); + expect(within(registryRow as HTMLElement).getByText("Set by the --curseforge-api-key startup flag")).toBeInTheDocument(); + expect(screen.getByRole("switch", { name: /Share the CurseForge key with game servers/i })).toBeDisabled(); + }); +}); diff --git a/web/src/routes/ServerDetail.tsx b/web/src/routes/ServerDetail.tsx index 5356ea492..b24d20fa8 100644 --- a/web/src/routes/ServerDetail.tsx +++ b/web/src/routes/ServerDetail.tsx @@ -381,7 +381,7 @@ function ServerDetailView({ lookupTarget, file }: { lookupTarget: ResourceTarget )} {tab === "files" && } {tab === "mods" && } - {tab === "modpacks" && } + {tab === "modpacks" && selectTab("files")} />} {tab === "players" && } {tab === "backups" && } {tab === "capture" && } diff --git a/web/src/routes/ServerDetail_modpack_files.test.tsx b/web/src/routes/ServerDetail_modpack_files.test.tsx new file mode 100644 index 000000000..c6fbc69b6 --- /dev/null +++ b/web/src/routes/ServerDetail_modpack_files.test.tsx @@ -0,0 +1,98 @@ +import { describe, it, expect, vi, beforeEach } from "vitest"; +import type { ReactNode } from "react"; +import { http, HttpResponse } from "msw"; +import { screen, waitFor } from "@testing-library/react"; +import userEvent from "@testing-library/user-event"; +import { server } from "@/test/server"; +import { renderWithQuery } from "@/test/render"; +import { makeServer, makeTemplate, makeUser } from "@/test/factories"; + +// Router APIs the route reaches into. The search params stay static, so the +// assertion is on the navigation that switching to the Files tab performs. +const navigate = vi.fn(); +let searchParams = {}; +vi.mock("@tanstack/react-router", () => ({ + Link: ({ children, to, ...rest }: { children: ReactNode; to: string } & Record) => ( + {children} + ), + useParams: () => ({ name: "alpha" }), + useSearch: () => searchParams, + useNavigate: () => navigate, +})); + +vi.mock("./tabs/Console", () => ({ ConsoleTab: () =>
    console-tab
    })); +vi.mock("./tabs/Files", () => ({ FilesTab: () =>
    files-tab
    })); +vi.mock("./tabs/Logs", () => ({ LogsTab: () =>
    logs-tab
    })); +vi.mock("./tabs/Mods", () => ({ ModsTab: () =>
    mods-tab
    })); +vi.mock("./tabs/Players", () => ({ PlayersTab: () =>
    players-tab
    })); +vi.mock("./tabs/Backups", () => ({ BackupsTab: () =>
    backups-tab
    })); +vi.mock("./tabs/Overview", () => ({ OverviewTab: () =>
    overview-tab
    })); +vi.mock("./tabs/Settings", () => ({ SettingsTab: () =>
    settings-tab
    })); + +import { ServerDetailPage } from "./ServerDetail"; + +beforeEach(() => { + searchParams = {}; + navigate.mockClear(); + server.use( + http.get("/servers/:name/access", ({ request, params }) => { + const url = new URL(request.url); + return HttpResponse.json({ + target: { cluster: url.searchParams.get("cluster") ?? "local", namespace: url.searchParams.get("namespace") ?? "gameplane-games", name: params.name }, + canWrite: true, canControl: true, canConsole: true, canDelete: true, isOwner: false, isCollaborator: false, + permissions: ["servers:read", "servers:write", "servers:console", "captures:manage"], + }); + }), + http.get("/users/me", () => HttpResponse.json(makeUser({ role: "operator" }))), + ); +}); + +describe("ServerDetailPage modpack Open Files", () => { + it("switches to the Files tab from the missing-files notice", async () => { + server.use( + http.get("/servers/alpha", () => HttpResponse.json(makeServer())), + http.get("/templates/:name", ({ params }) => + HttpResponse.json( + makeTemplate({ + metadata: { name: String(params.name) }, + spec: { + versions: [{ id: "forge", displayName: "Forge", loader: "forge", default: true }], + capabilities: { + mods: { + loaders: { forge: { path: "modpacks" } }, + registry: { providers: [{ provider: "curseforge", modpacks: { refEnv: "CURSEFORGE_MODPACK" } }] }, + }, + }, + }, + }), + ), + ), + http.get("/servers/alpha/mods/registry/providers", () => + HttpResponse.json([{ provider: "curseforge", available: true, modpacks: true }]), + ), + http.get("/servers/alpha/modpack", () => + HttpResponse.json({ + active: null, + phase: "", + message: "", + backupName: "", + keyShared: false, + missingFiles: [ + { mod: "Example Mod", versionName: "1.0", filename: "example-1.0.jar", downloadPage: "https://www.curseforge.com/minecraft/mc-mods/example" }, + ], + missingFilesUnknown: false, + downloadsPath: "/data/downloads", + backupAvailable: false, + }), + ), + ); + renderWithQuery(); + const modpacksTab = await screen.findByRole("tab", { name: "Modpacks" }); + await userEvent.click(modpacksTab); + + await userEvent.click(await screen.findByRole("button", { name: "Open Files" })); + + await waitFor(() => expect(screen.getByText("files-tab")).toBeInTheDocument()); + expect(navigate).toHaveBeenCalledWith(expect.objectContaining({ search: expect.objectContaining({ file: "/" }) })); + }); +}); diff --git a/web/src/routes/tabs/Modpacks.test.tsx b/web/src/routes/tabs/Modpacks.test.tsx index 15e446dae..506d59e7b 100644 --- a/web/src/routes/tabs/Modpacks.test.tsx +++ b/web/src/routes/tabs/Modpacks.test.tsx @@ -4,7 +4,7 @@ import { afterEach, beforeEach, describe, expect, it, vi } from "vitest"; import { fireEvent, screen, waitFor } from "@testing-library/react"; import { renderWithQuery as baseRenderWithQuery } from "@/test/render"; import { ModpacksTab } from "./Modpacks"; -import type { GameTemplate, RegistryProject } from "@/types"; +import type { GameTemplate, ModpackInstallBody, ModpackView, RegistryProject, RegistryVersion } from "@/types"; const fetchMock = vi.fn(); beforeEach(() => { scopedControl = true; vi.stubGlobal("fetch", fetchMock); }); @@ -30,8 +30,9 @@ interface Routes { packs?: RegistryProject[]; deps?: { filename: string; downloadUrl: string }[]; providers?: { provider: string; available: boolean; modpacks: boolean }[]; - onModpack?: (body: { ref: string }, provider: string | null) => void; + onModpack?: (body: ModpackInstallBody, provider: string | null) => void; onInstallMod?: (body: { url: string; name?: string }) => void; + versions?: RegistryVersion[]; } function route(r: Routes) { @@ -42,13 +43,16 @@ function route(r: Routes) { if (url.includes("/mods/registry/providers")) return Promise.resolve(jsonRes(r.providers ?? [{ provider: "modrinth", available: true, modpacks: true }])); if (url.includes("/mods/registry/search")) return Promise.resolve(jsonRes(r.packs ?? [])); + if (url.includes("/versions?")) return Promise.resolve(jsonRes(r.versions ?? [])); if (url.includes("/mods/registry/projects/") && url.includes("/modpack")) return Promise.resolve(jsonRes(r.deps ?? [])); + if (url.endsWith("/servers/s1")) return Promise.resolve(jsonRes({ metadata: { name: "s1" }, spec: {} })); if (url.includes("/modpack") && method === "POST") { const provider = new URL("http://x" + url.slice(url.indexOf("/"))).searchParams.get("provider"); r.onModpack?.(JSON.parse(opts?.body ?? "{}"), provider); - return Promise.resolve(jsonRes({ ok: true })); + return Promise.resolve(jsonRes(modpackView({ phase: "BackingUp" }), 202)); } + if (url.includes("/servers/s1/modpack")) return Promise.resolve(jsonRes(modpackView())); if (url.includes("/mods/install")) { const body = JSON.parse(opts?.body ?? "{}"); r.onInstallMod?.(body); @@ -77,17 +81,38 @@ const pack: RegistryProject = { downloads: 9_100_000, provider: "modrinth", }; +const mrVersions: RegistryVersion[] = [ + { id: "v2", name: "2.0", versionNumber: "2.0", gameVersions: ["1.21.1"], loaders: ["fabric"], files: [] }, + { id: "v1", name: "1.0", versionNumber: "1.0", gameVersions: ["1.21.1"], loaders: ["fabric"], files: [] }, +]; +function modpackView(over: Partial = {}): ModpackView { + return { active: null, phase: "", message: "", backupName: "", keyShared: false, missingFiles: [], + missingFilesUnknown: false, downloadsPath: "downloads/", backupAvailable: true, ...over }; +} +// Install… -> pick newest version -> Continue -> confirm. +async function installNewest() { + fireEvent.click(await screen.findByRole("button", { name: "Install…" })); + await screen.findByText("2.0"); + fireEvent.click(screen.getByRole("button", { name: "Continue" })); + fireEvent.click(await screen.findByRole("button", { name: "Install and restart" })); +} + describe("ModpacksTab", () => { - it("env-mode: installs by setting the modpack ref", async () => { - const calls: { ref: string }[] = []; - route({ packs: [pack], onModpack: (b) => calls.push(b) }); + it("env-mode: installs by pinning the chosen version", async () => { + const calls: ModpackInstallBody[] = []; + const providers: (string | null)[] = []; + route({ packs: [pack], versions: mrVersions, onModpack: (b, p) => { calls.push(b); providers.push(p); } }); renderWithQuery(); await screen.findByText("Cobblemon"); - const install = await screen.findByRole("button", { name: /install/i }); - fireEvent.click(install); - await waitFor(() => expect(calls).toEqual([{ ref: "cobblemon" }])); - expect(await screen.findByText(/Set modpack Cobblemon/)).toBeInTheDocument(); + await installNewest(); + await waitFor(() => + expect(calls).toEqual([ + { provider: "modrinth", project: "cobblemon", version: "v2", title: "Cobblemon", versionName: "2.0", backupFirst: true }, + ]), + ); + expect(providers).toEqual([null]); // provider moved from the query string into the body + expect(await screen.findByText("Set modpack Cobblemon. The server is restarting to install it.")).toBeInTheDocument(); }); it("env-mode: does not show active modpack", async () => { @@ -225,6 +250,7 @@ describe("ModpacksTab", () => { if (url.includes("/mods/registry/providers")) return Promise.resolve(jsonRes(providersOf("modrinth"))); if (url.includes("/mods/registry/search")) return Promise.resolve(jsonRes([pack])); + if (url.includes("/versions?")) return Promise.resolve(jsonRes(mrVersions)); if (url.includes("/modpack") && opts?.method === "POST") return Promise.resolve(jsonRes({ error: "failed to restart server" }, 500)); return Promise.resolve(jsonRes({})); @@ -232,8 +258,9 @@ describe("ModpacksTab", () => { renderWithQuery(); await screen.findByText("Cobblemon"); - fireEvent.click(await screen.findByRole("button", { name: /install/i })); + await installNewest(); expect(await screen.findByText("failed to restart server")).toBeInTheDocument(); + expect(screen.getByRole("button", { name: "Install and restart" })).toBeInTheDocument(); // dialog stays open }); it("deps-mode: surfaces install error for first mod", async () => { @@ -261,18 +288,18 @@ describe("ModpacksTab", () => { }); it("dismisses the error banner when dismiss is clicked", async () => { - fetchMock.mockImplementation((url: string, opts?: { method?: string }) => { + fetchMock.mockImplementation((url: string) => { if (url.endsWith("/users/me")) return Promise.resolve(jsonRes(operator)); - if (url.includes("/mods/registry/providers")) - return Promise.resolve(jsonRes(providersOf("modrinth"))); - if (url.includes("/mods/registry/search")) return Promise.resolve(jsonRes([pack])); - if (url.includes("/modpack") && opts?.method === "POST") - return Promise.resolve(jsonRes({ error: "install failed" }, 500)); + if (url.includes("/mods/registry/providers")) return Promise.resolve(jsonRes(providersOf("thunderstore"))); + if (url.includes("/mods/registry/search")) return Promise.resolve(jsonRes([{ ...pack, id: "packer-Mega", title: "MegaPack" }])); + if (url.includes("/mods/registry/projects")) + return Promise.resolve(jsonRes([{ filename: "a.zip", downloadUrl: "https://cdn/a.zip" }])); + if (url.includes("/mods/install")) return Promise.resolve(jsonRes({ error: "install failed" }, 500)); return Promise.resolve(jsonRes({})); }); - renderWithQuery(); + renderWithQuery(); - await screen.findByText("Cobblemon"); + await screen.findByText("MegaPack"); fireEvent.click(await screen.findByRole("button", { name: /install/i })); expect(await screen.findByText("install failed")).toBeInTheDocument(); @@ -282,33 +309,40 @@ describe("ModpacksTab", () => { it("install button stays disabled while one is being installed", async () => { let delayResolve: () => void; - const delayedPromise = new Promise((resolve) => { - delayResolve = resolve; - }); - - fetchMock.mockImplementation((url: string, opts?: { method?: string }) => { + const delayed = new Promise((resolve) => { delayResolve = resolve; }); + fetchMock.mockImplementation((url: string) => { if (url.endsWith("/users/me")) return Promise.resolve(jsonRes(operator)); - if (url.includes("/mods/registry/providers")) - return Promise.resolve(jsonRes(providersOf("modrinth"))); + if (url.includes("/mods/registry/providers")) return Promise.resolve(jsonRes(providersOf("thunderstore"))); if (url.includes("/mods/registry/search")) return Promise.resolve(jsonRes([pack, { ...pack, id: "pack2", title: "Pack 2" }])); - if (url.includes("/modpack") && opts?.method === "POST") - return delayedPromise.then(() => jsonRes({ ok: true })); + if (url.includes("/mods/registry/projects")) return delayed.then(() => jsonRes([])); return Promise.resolve(jsonRes({})); }); - renderWithQuery(); + renderWithQuery(); await screen.findByText("Cobblemon"); const buttons = screen.getAllByRole("button", { name: /install/i }); expect(buttons).toHaveLength(2); - - // Click first install fireEvent.click(buttons[0]); await waitFor(() => expect(buttons[0]).toHaveTextContent("Installing…")); - - // Second button should also be disabled expect(buttons[1]).toBeDisabled(); + delayResolve!(); + }); + it("env-mode: the confirm button is disabled while the install is submitted", async () => { + let delayResolve: () => void; + const delayed = new Promise((resolve) => { delayResolve = resolve; }); + route({ packs: [pack], versions: mrVersions }); + const base = fetchMock.getMockImplementation()!; + fetchMock.mockImplementation((url: string, opts?: { method?: string }) => + url.includes("/servers/s1/modpack") && opts?.method === "POST" + ? delayed.then(() => jsonRes(modpackView({ phase: "BackingUp" }), 202)) + : base(url, opts)); + renderWithQuery(); + + await screen.findByText("Cobblemon"); + await installNewest(); + expect(await screen.findByRole("button", { name: "Working…" })).toBeDisabled(); delayResolve!(); }); @@ -326,6 +360,7 @@ describe("ModpacksTab", () => { if (url.includes("/mods/registry/providers")) return Promise.resolve(jsonRes(providersOf("modrinth"))); if (url.includes("/mods/registry/search")) return Promise.resolve(jsonRes([pack])); + if (url.includes("/versions?")) return Promise.resolve(jsonRes(mrVersions)); if (url.includes("/modpack") && opts?.method === "POST") return Promise.resolve(jsonRes({ error: "specific error from API" }, 500)); return Promise.resolve(jsonRes({})); @@ -333,16 +368,33 @@ describe("ModpacksTab", () => { renderWithQuery(); await screen.findByText("Cobblemon"); - fireEvent.click(await screen.findByRole("button", { name: /install/i })); + await installNewest(); expect(await screen.findByText("specific error from API")).toBeInTheDocument(); }); - it("handles 403 error with role message", async () => { + it("deps-mode: handles 403 error with role message", async () => { + fetchMock.mockImplementation((url: string) => { + if (url.endsWith("/users/me")) return Promise.resolve(jsonRes(operator)); + if (url.includes("/mods/registry/providers")) return Promise.resolve(jsonRes(providersOf("thunderstore"))); + if (url.includes("/mods/registry/search")) return Promise.resolve(jsonRes([pack])); + if (url.includes("/mods/registry/projects")) + return Promise.resolve(jsonRes([{ filename: "a.zip", downloadUrl: "https://cdn/a.zip" }])); + if (url.includes("/mods/install")) return Promise.resolve(new Response("forbidden", { status: 403 })); + return Promise.resolve(jsonRes({})); + }); + renderWithQuery(); + await screen.findByText("Cobblemon"); + fireEvent.click(await screen.findByRole("button", { name: /install/i })); + expect(await screen.findByText("Your role does not allow managing this server.")).toBeInTheDocument(); + }); + + it("env-mode: handles 403 error with role message", async () => { fetchMock.mockImplementation((url: string, opts?: { method?: string }) => { if (url.endsWith("/users/me")) return Promise.resolve(jsonRes(operator)); if (url.includes("/mods/registry/providers")) return Promise.resolve(jsonRes(providersOf("modrinth"))); if (url.includes("/mods/registry/search")) return Promise.resolve(jsonRes([pack])); + if (url.includes("/versions?")) return Promise.resolve(jsonRes(mrVersions)); if (url.includes("/modpack") && opts?.method === "POST") return Promise.resolve(new Response("forbidden", { status: 403 })); return Promise.resolve(jsonRes({})); @@ -350,17 +402,19 @@ describe("ModpacksTab", () => { renderWithQuery(); await screen.findByText("Cobblemon"); - fireEvent.click(await screen.findByRole("button", { name: /install/i })); + await installNewest(); expect(await screen.findByText("Your role does not allow managing this server.")).toBeInTheDocument(); }); it("shows success banner for env-mode install", async () => { - route({ packs: [pack] }); + route({ packs: [pack], versions: mrVersions }); renderWithQuery(); await screen.findByText("Cobblemon"); - fireEvent.click(await screen.findByRole("button", { name: /install/i })); + await installNewest(); expect(await screen.findByText(/Set modpack Cobblemon/)).toBeInTheDocument(); + fireEvent.click(screen.getByRole("button", { name: "dismiss" })); + await waitFor(() => expect(screen.queryByText(/Set modpack Cobblemon/)).not.toBeInTheDocument()); }); it("shows success banner with mod count for deps-mode install", async () => { @@ -391,27 +445,20 @@ describe("ModpacksTab", () => { expect(await screen.findByText(/Installed Multi — 3 mods\./)).toBeInTheDocument(); }); - it("shows installing state with project id match", async () => { + it("env-mode: shows the working state while submitting", async () => { let delayResolve: () => void; - const delayedPromise = new Promise((resolve) => { - delayResolve = resolve; - }); - - fetchMock.mockImplementation((url: string, opts?: { method?: string }) => { - if (url.endsWith("/users/me")) return Promise.resolve(jsonRes(operator)); - if (url.includes("/mods/registry/providers")) - return Promise.resolve(jsonRes(providersOf("modrinth"))); - if (url.includes("/mods/registry/search")) return Promise.resolve(jsonRes([pack])); - if (url.includes("/modpack") && opts?.method === "POST") - return delayedPromise.then(() => jsonRes({ ok: true })); - return Promise.resolve(jsonRes({})); - }); + const delayed = new Promise((resolve) => { delayResolve = resolve; }); + route({ packs: [pack], versions: mrVersions }); + const base = fetchMock.getMockImplementation()!; + fetchMock.mockImplementation((url: string, opts?: { method?: string }) => + url.includes("/servers/s1/modpack") && opts?.method === "POST" + ? delayed.then(() => jsonRes(modpackView({ phase: "BackingUp" }), 202)) + : base(url, opts)); renderWithQuery(); - const button = await screen.findByRole("button", { name: /install/i }); - fireEvent.click(button); - - expect(await screen.findByRole("button", { name: "Installing…" })).toBeInTheDocument(); + await screen.findByText("Cobblemon"); + await installNewest(); + expect(await screen.findByRole("button", { name: "Working…" })).toBeInTheDocument(); delayResolve!(); }); }); diff --git a/web/src/routes/tabs/Modpacks.tsx b/web/src/routes/tabs/Modpacks.tsx index 5fd8d4914..740aab4af 100644 --- a/web/src/routes/tabs/Modpacks.tsx +++ b/web/src/routes/tabs/Modpacks.tsx @@ -1,19 +1,37 @@ import { useResourceClient, useResourceTarget, resourceKey, useResourceAccess } from "@/lib/resourceTarget"; import { useState } from "react"; -import { useMutation, useQueryClient } from "@tanstack/react-query"; +import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query"; import { Package, X } from "lucide-react"; import { Button, Card, Alert } from "@heroui/react"; -import type { GameTemplate, RegistryProject } from "@/types"; +import type { GameTemplate, ModpackInstallBody, ModpackView, RegistryProject, RegistryVersion } from "@/types"; import { APIError } from "@/lib/api"; import { errorTextIntl } from "@/lib/errors"; -import { RegistryBrowser, RegistryIcon, compactNum } from "@/components/registry-browser"; +import { activeVersion } from "@/lib/capabilities"; +import { RegistryBrowser, RegistryIcon, compactNum, providerLabel } from "@/components/registry-browser"; +import { ModpackActiveCard } from "@/components/modpack-active-card"; +import { ModpackMissingFiles } from "@/components/modpack-missing-files"; +import { ModpackVersionPicker } from "@/components/modpack-version-picker"; +import { ModpackConfirmDialog } from "@/components/modpack-confirm-dialog"; import { useOptionalIntl } from "@/lib/i18n/format"; import { defineMessages, type IntlShape, type MessageDescriptor } from "react-intl"; type Banner = { kind: "ok" | "err"; text: string }; +// A modpack chosen in the registry browser, waiting for a version pick. +// change is true when the picker switches the pack already on the server. +type PickerState = { provider: string; project: string; title: string; pinnedVersionId?: string; change?: boolean }; + +// A chosen version waiting for confirmation. mode is decided by the caller. +type ConfirmState = { + mode: "install" | "change" | "downgrade"; + provider: string; + project: string; + title: string; + version: RegistryVersion; +}; + // Curated Modrinth modpack categories for the filter chips (shown only when // the active provider is Modrinth). const MODPACK_CATEGORY_LABELS = defineMessages({ @@ -32,18 +50,32 @@ const MODPACK_CATEGORIES: { value: string; label: MessageDescriptor }[] = [ { value: "multiplayer", label: MODPACK_CATEGORY_LABELS.multiplayer }, ]; -// ModpacksTab browses whole modpacks and installs one. Install differs by -// the active provider: env-mode (e.g. Modrinth/itzg) pins the pack via the -// server's env and restarts (one active pack); deps-mode (e.g. -// Thunderstore) resolves the pack's dependencies and installs each. +// Phases (and pending removals) during which the view is polled. +function modpackInFlight(v: ModpackView | undefined): boolean { + if (!v) return false; + return v.phase === "Pending" || v.phase === "BackingUp" || v.phase === "Applying" || v.active?.pendingRemoval === true; +} + +function versionNameOf(v: RegistryVersion): string { + return v.name || v.versionNumber || v.id; +} + +// ModpacksTab browses whole modpacks and installs one. Env-mode providers +// (e.g. CurseForge/Modrinth via itzg) pin one version of a pack on the server +// and restart it; the active pack is shown in a card above the browser. +// Deps-mode providers (e.g. Thunderstore) resolve the pack's dependencies and +// install each mod. export function ModpacksTab({ name, tmpl, ns, + onOpenFiles, }: { name: string; tmpl?: GameTemplate; ns?: string; + // Switches to the Files tab; the missing-files notice hides its button without it. + onOpenFiles?: () => void; }) { const intl = useOptionalIntl(); const resourceTarget = useResourceTarget({ name, namespace: ns }); @@ -55,21 +87,56 @@ export function ModpacksTab({ const providers = tmpl?.spec.capabilities?.mods?.registry?.providers ?? []; const declFor = (p: string) => providers.find((x) => x.provider === p); + const hasEnvMode = providers.some((p) => !!p.modpacks?.refEnv); const [banner, setBanner] = useState(null); - const [busy, setBusy] = useState(null); // project id being installed + const [busy, setBusy] = useState(null); // project id being installed (deps mode) + const [picker, setPicker] = useState(null); + const [confirm, setConfirm] = useState(null); + const [confirmRemove, setConfirmRemove] = useState(false); - const installEnv = useMutation({ - mutationFn: (v: { p: RegistryProject; provider: string }) => - Servers.installModpack(name, { ref: v.p.slug || v.p.id }, v.provider, ns), - onMutate: (v) => setBusy(v.p.id), - onSuccess: (_r, v) => { + const modpackKey = resourceKey(resourceTarget, "modpack", name, ns); + const serverKey = resourceKey(resourceTarget, "server", name, ns); + + // Same key ServerDetail uses, so the Minecraft version and loader come from cache. + const { data: server } = useQuery({ + queryKey: serverKey, + queryFn: ({ signal }) => resourceClient.withSignal(signal).Servers.get(name, ns), + }); + + const { data: view, error: viewError } = useQuery({ + queryKey: modpackKey, + queryFn: ({ signal }) => resourceClient.withSignal(signal).Servers.modpack(name, ns), + enabled: hasEnvMode, + refetchInterval: (q) => (modpackInFlight(q.state.data) ? 3000 : false), + }); + + const gv = activeVersion(tmpl, server); + const loaderLabel = gv?.loader ? gv.loader.charAt(0).toUpperCase() + gv.loader.slice(1) : ""; + const mcVersionLabel = gv?.gameVersion + ? intl.formatMessage({ id: "web.routes.tabs.modpacks.minecraft_version", defaultMessage: "Minecraft {version}", description: "Modpacks: label for the server's Minecraft version in the active modpack card; {version} is the version number" }, { version: gv.gameVersion }) + : ""; + const mcLabel = [mcVersionLabel, loaderLabel].filter(Boolean).join(" · "); + + const installMut = useMutation({ + mutationFn: (body: ModpackInstallBody) => Servers.installModpack(name, body, ns), + onSuccess: (nv, body) => { + qc.setQueryData(modpackKey, nv); void qc.invalidateQueries({ queryKey: ["fleet"] }); - setBanner({ kind: "ok", text: intl.formatMessage({ id: "web.routes.tabs.modpacks.banner_set", defaultMessage: "Set modpack {title}. The server is restarting to install it.", description: "Modpacks: banner shown after a modpack is set on the server; {title} is the modpack title" }, { title: v.p.title }) }); - return qc.invalidateQueries({ queryKey: resourceKey(resourceTarget, "server", name, ns) }); + setConfirm(null); + setBanner({ kind: "ok", text: intl.formatMessage({ id: "web.routes.tabs.modpacks.banner_set", defaultMessage: "Set modpack {title}. The server is restarting to install it.", description: "Modpacks: banner shown after a modpack is set on the server; {title} is the modpack title" }, { title: body.title ?? body.project }) }); + return qc.invalidateQueries({ queryKey: serverKey }); + }, + }); + + const removeMut = useMutation({ + mutationFn: (backupFirst: boolean) => Servers.removeModpack(name, backupFirst, ns), + onSuccess: (nv) => { + qc.setQueryData(modpackKey, nv); + void qc.invalidateQueries({ queryKey: ["fleet"] }); + setConfirmRemove(false); + return qc.invalidateQueries({ queryKey: serverKey }); }, - onError: (err) => setBanner({ kind: "err", text: errMsg(err, intl) }), - onSettled: () => setBusy(null), }); const installDeps = useMutation({ @@ -90,20 +157,84 @@ export function ModpacksTab({ onSettled: () => setBusy(null), }); + const activePack = view?.active ?? null; + + // The active pack's version is only a valid "older than" reference for the + // same project, and only when it could be read. + const pinnedFor = (provider: string, project: string): string | undefined => + activePack && activePack.provider === provider && activePack.project === project && activePack.pinned + ? activePack.version + : undefined; + const install = (p: RegistryProject, provider: string) => { - const v = { p, provider }; - if (declFor(provider)?.modpacks?.refEnv) installEnv.mutate(v); - else installDeps.mutate(v); + if (declFor(provider)?.modpacks?.refEnv) { + const project = p.slug || p.id; + setPicker({ provider, project, title: p.title, pinnedVersionId: pinnedFor(provider, project) }); + return; + } + installDeps.mutate({ p, provider }); + }; + + const onPicked = (pk: PickerState, v: RegistryVersion, isOlder: boolean) => { + const sameProject = activePack !== null && activePack.provider === pk.provider && activePack.project === pk.project; + const mode = sameProject ? (isOlder ? "downgrade" : "change") : "install"; + setPicker(null); + installMut.reset(); + setConfirm({ mode, provider: pk.provider, project: pk.project, title: pk.title, version: v }); + }; + + const openChangeVersion = () => { + if (!activePack) return; + setPicker({ + provider: activePack.provider, + project: activePack.project, + title: activePack.title, + pinnedVersionId: activePack.pinned ? activePack.version : undefined, + change: true, + }); }; + const openRemove = () => { + removeMut.reset(); + setConfirmRemove(true); + }; + + const confirmErrorText = (err: unknown): string | undefined => + err ? errorTextIntl(intl, err, intl.formatMessage({ id: "web.routes.tabs.modpacks.error_request_failed", defaultMessage: "request failed", description: "Modpacks: fallback error text when the error has no message" })) : undefined; + + const showSubtitleNew = hasEnvMode; + return (
    + {view?.active && ( + + )} + + {viewError && ( + + + {errMsg(viewError, intl)} + + + )} + + {view && } +

    {intl.formatMessage({ id: "web.routes.tabs.modpacks.browse_modpacks", defaultMessage: "Browse modpacks", description: "Modpacks tab: heading of the section where modpacks are browsed from a registry" })}

    -

    {intl.formatMessage({ id: "web.routes.tabs.modpacks.installing_a_modpack_either_pins_it_on", defaultMessage: "Installing a modpack either pins it on the server (and restarts) or adds all of its mods, depending on the registry.", description: "Modpacks tab: hint under the modpacks heading saying an install either pins the modpack and restarts the server, or adds all its mods, depending on the registry" })}

    +

    + {showSubtitleNew + ? intl.formatMessage({ id: "web.routes.tabs.modpacks.pick_a_pack_and_a_version", defaultMessage: "Pick a pack and a version. The server pins that version and restarts to install it; a restart never upgrades it.", description: "Modpacks tab: hint under the modpacks heading for registries that pin one version of a pack; the server restarts to install it and a restart never upgrades it" }) + : intl.formatMessage({ id: "web.routes.tabs.modpacks.installing_a_modpack_either_pins_it_on", defaultMessage: "Installing a modpack either pins it on the server (and restarts) or adds all of its mods, depending on the registry.", description: "Modpacks tab: hint under the modpacks heading saying an install either pins the modpack and restarts the server, or adds all its mods, depending on the registry" })} +

    - {banner && ( @@ -122,40 +253,109 @@ export function ModpacksTab({ type="modpack" categories={MODPACK_CATEGORIES.map((c) => ({ value: c.value, label: intl.formatMessage(c.label) }))} pillButtons={true} - renderItem={(p, provider) => ( - -
    - } /> -
    -
    -
    {p.title}
    -
    - {[p.author, p.downloads != null ? `${compactNum(p.downloads)} downloads` : null] - .filter(Boolean) - .join(" · ")} + renderItem={(p, provider) => { + const envMode = !!declFor(provider)?.modpacks?.refEnv; + return ( + +
    + } />
    -
    - {/* The disabled reason lives on a wrapping element's title - (not the Button's aria-label) so the button's accessible - name stays its visible text ("Install"/"Installing…") for - role queries and assistive tech alike. */} - - - - - )} +
    +
    {p.title}
    +
    + {[p.author, p.downloads != null ? `${compactNum(p.downloads)} downloads` : null] + .filter(Boolean) + .join(" · ")} +
    +
    + {/* The disabled reason lives on a wrapping element's title + (not the Button's aria-label) so the button's accessible + name stays its visible text for role queries and assistive tech alike. */} + + + + + ); + }} />
    + + {picker && ( + { + if (!o) setPicker(null); + }} + name={name} + ns={ns} + provider={picker.provider} + project={picker.project} + title={picker.title} + mcLabel={mcLabel} + pinnedVersionId={picker.pinnedVersionId} + confirmLabel={picker.change ? intl.formatMessage({ id: "web.routes.tabs.modpacks.continue", defaultMessage: "Continue", description: "Modpacks: button that continues from the version picker to the confirmation step" }) : undefined} + onContinue={(v, isOlder) => onPicked(picker, v, isOlder)} + /> + )} + + {confirm && ( + { + if (!o && !installMut.isPending) setConfirm(null); + }} + mode={confirm.mode} + packTitle={confirm.title} + providerLabel={providerLabel(confirm.provider)} + versionName={versionNameOf(confirm.version)} + fromVersionName={confirm.mode === "install" ? undefined : activePack?.versionName} + serverName={name} + backupAvailable={view?.backupAvailable === true} + backupDestination={view?.backupDestination} + pending={installMut.isPending} + error={installMut.error ? errMsg(installMut.error, intl) : undefined} + onConfirm={({ backupFirst }) => + installMut.mutate({ + provider: confirm.provider, + project: confirm.project, + version: confirm.version.id, + title: confirm.title, + versionName: versionNameOf(confirm.version), + backupFirst, + }) + } + /> + )} + + {confirmRemove && activePack && ( + { + if (!o && !removeMut.isPending) setConfirmRemove(false); + }} + mode="remove" + packTitle={activePack.title} + providerLabel={providerLabel(activePack.provider)} + serverName={name} + backupAvailable={view?.backupAvailable === true} + backupDestination={view?.backupDestination} + pending={removeMut.isPending} + error={confirmErrorText(removeMut.error)} + onConfirm={({ backupFirst }) => removeMut.mutate(backupFirst)} + /> + )}
    ); } diff --git a/web/src/routes/tabs/Modpacks_flow.test.tsx b/web/src/routes/tabs/Modpacks_flow.test.tsx new file mode 100644 index 000000000..926ec00c1 --- /dev/null +++ b/web/src/routes/tabs/Modpacks_flow.test.tsx @@ -0,0 +1,251 @@ +import { ResourceTargetProvider } from "@/lib/resourceTarget"; +import type { ReactElement } from "react"; +import { afterEach, beforeEach, describe, expect, it, vi } from "vitest"; +import { fireEvent, screen, waitFor } from "@testing-library/react"; +import { renderWithQuery as baseRenderWithQuery } from "@/test/render"; +import { ModpacksTab } from "./Modpacks"; +import type { + GameTemplate, + ModpackActive, + ModpackView, + RegistryProject, + RegistryProviderInfo, + RegistryVersion, +} from "@/types"; + +// Flow tests for the env-mode (CurseForge) install, change, downgrade and +// remove paths of the Modpacks tab. Requests are answered by fetchMock. + +const fetchMock = vi.fn(); +let scopedControl = true; +beforeEach(() => { + scopedControl = true; + vi.stubGlobal("fetch", fetchMock); +}); +afterEach(() => { + fetchMock.mockReset(); + vi.unstubAllGlobals(); +}); + +function jsonRes(body: unknown, status = 200): Response { + return new Response(JSON.stringify(body), { status, headers: { "Content-Type": "application/json" } }); +} + +const operator = { + id: 1, username: "u", displayName: "U", email: "", role: "operator", + permissions: { "*": ["servers:read", "servers:write"] }, +}; +const viewer = { ...operator, role: "viewer", permissions: { "*": ["servers:read"] } }; + +const curseforge: RegistryProviderInfo = { provider: "curseforge", available: true, modpacks: true }; + +const pack: RegistryProject = { + id: "1234", slug: "atm9", title: "All The Mods 9", author: "ATM Team", downloads: 1000, provider: "curseforge", +}; + +function version(id: string, name: string): RegistryVersion { + return { id, name, versionNumber: name, gameVersions: ["1.21.1"], loaders: ["neoforge"], files: [] }; +} + +function baseView(over: Partial = {}): ModpackView { + return { + active: null, + phase: "", + message: "", + backupName: "", + keyShared: true, + missingFiles: [], + missingFilesUnknown: false, + downloadsPath: "/data/mods-downloads", + backupAvailable: true, + ...over, + }; +} + +const installed: ModpackActive = { + provider: "curseforge", project: "atm9", version: "2", title: "All The Mods 9", versionName: "2.0.0", pinned: true, +}; + +interface Opts { + asViewer?: boolean; + view?: ModpackView; + versions?: RegistryVersion[]; + providers?: RegistryProviderInfo[]; + installStatus?: number; + installError?: string; + posts?: unknown[]; + deletes?: string[]; +} + +function route(o: Opts) { + scopedControl = !o.asViewer; + fetchMock.mockImplementation((url: string, init?: { method?: string; body?: string }) => { + const method = init?.method ?? "GET"; + if (url.endsWith("/users/me")) return Promise.resolve(jsonRes(o.asViewer ? viewer : operator)); + if (url.includes("/mods/registry/providers")) return Promise.resolve(jsonRes(o.providers ?? [curseforge])); + if (url.includes("/mods/registry/search")) return Promise.resolve(jsonRes([pack])); + if (url.includes("/versions?")) return Promise.resolve(jsonRes(o.versions ?? [])); + if (url.endsWith("/servers/s1")) return Promise.resolve(jsonRes({ metadata: { name: "s1" }, spec: {} })); + if (url.includes("/servers/s1/modpack") && method === "POST") { + o.posts?.push(JSON.parse(init?.body ?? "{}")); + if (o.installError) return Promise.resolve(jsonRes({ error: o.installError }, o.installStatus ?? 409)); + return Promise.resolve(jsonRes(baseView({ phase: "BackingUp" }), 202)); + } + if (url.includes("/servers/s1/modpack") && method === "DELETE") { + o.deletes?.push(url); + return Promise.resolve(jsonRes(baseView({ phase: "Applying" }), 202)); + } + if (url.includes("/servers/s1/modpack")) return Promise.resolve(jsonRes(o.view ?? baseView())); + return Promise.resolve(jsonRes({})); + }); +} + +function curseforgeTmpl(): GameTemplate { + return { + metadata: { name: "t" }, + spec: { + displayName: "T", game: "g", version: "1", image: "img", + capabilities: { + mods: { + loaders: { l: { path: "mods" } }, + registry: { providers: [{ provider: "curseforge" as "modrinth", modpacks: { refEnv: "CF_MODPACK" } }] }, + }, + }, + }, + }; +} + +function renderTab() { + return renderWithQuery(); +} + +function renderWithQuery(ui: ReactElement) { + return baseRenderWithQuery( + + {ui} + , + ); +} + +describe("Modpacks install flow (env-mode)", () => { + it("installs a CurseForge pack: Install, picker, confirm, then POST with backup", async () => { + const posts: unknown[] = []; + route({ posts, versions: [version("3", "3.0.0"), version("2", "2.0.0")] }); + renderTab(); + + fireEvent.click(await screen.findByRole("button", { name: "Install…" })); + expect(await screen.findByText("Choose a version")).toBeInTheDocument(); + await screen.findByText("3.0.0"); + fireEvent.click(screen.getByRole("button", { name: "Continue" })); + + fireEvent.click(await screen.findByRole("button", { name: "Install and restart" })); + await waitFor(() => + expect(posts).toEqual([ + { + provider: "curseforge", + project: "atm9", + version: "3", + title: "All The Mods 9", + versionName: "3.0.0", + backupFirst: true, + }, + ]), + ); + expect(await screen.findByText("Set modpack All The Mods 9. The server is restarting to install it.")).toBeInTheDocument(); + }); + + it("does not let the picker continue without a version", async () => { + route({ versions: [] }); + renderTab(); + + fireEvent.click(await screen.findByRole("button", { name: "Install…" })); + expect(await screen.findByText(/No versions of this pack match/)).toBeInTheDocument(); + expect(screen.getByRole("button", { name: "Continue" })).toBeDisabled(); + }); + + it("shows a 409 change_in_progress error inside the confirm dialog and keeps it open", async () => { + route({ + versions: [version("3", "3.0.0")], + installError: "a modpack change is already in progress; wait for it to finish", + }); + renderTab(); + + fireEvent.click(await screen.findByRole("button", { name: "Install…" })); + await screen.findByText("3.0.0"); + fireEvent.click(screen.getByRole("button", { name: "Continue" })); + fireEvent.click(await screen.findByRole("button", { name: "Install and restart" })); + + expect( + await screen.findByText("a modpack change is already in progress; wait for it to finish"), + ).toBeInTheDocument(); + expect(screen.getByRole("button", { name: "Install and restart" })).toBeInTheDocument(); + }); + + it("uses the change flow for a newer version of the pack already on the server", async () => { + route({ + view: baseView({ active: installed, phase: "Applied" }), + versions: [version("3", "3.0.0"), version("2", "2.0.0"), version("1", "1.0.0")], + }); + renderTab(); + + fireEvent.click(await screen.findByRole("button", { name: "Change version" })); + expect(await screen.findByRole("heading", { name: "Change version" })).toBeInTheDocument(); + await screen.findByText("3.0.0"); + fireEvent.click(screen.getByRole("button", { name: "Continue" })); + + expect(await screen.findByRole("button", { name: "Change version and restart" })).toBeInTheDocument(); + }); + + it("uses the downgrade flow when an older version is picked", async () => { + route({ + view: baseView({ active: installed, phase: "Applied" }), + versions: [version("3", "3.0.0"), version("2", "2.0.0"), version("1", "1.0.0")], + }); + renderTab(); + + fireEvent.click(await screen.findByRole("button", { name: "Change version" })); + fireEvent.click(await screen.findByText("1.0.0")); + fireEvent.click(screen.getByRole("button", { name: "Continue" })); + + expect(await screen.findByRole("button", { name: "Downgrade and restart" })).toBeInTheDocument(); + }); + + it("removes the pack with backupFirst=false when no backup destination is set", async () => { + const deletes: string[] = []; + route({ deletes, view: baseView({ active: installed, phase: "Applied", backupAvailable: false }) }); + renderTab(); + + fireEvent.click(await screen.findByRole("button", { name: "Remove" })); + fireEvent.click(await screen.findByRole("button", { name: "Remove modpack" })); + + await waitFor(() => expect(deletes).toHaveLength(1)); + expect(deletes[0]).toContain("/servers/s1/modpack"); + expect(deletes[0]).toContain("backupFirst=false"); + }); + + it("hides a CurseForge pack whose key is not shared and says why", async () => { + route({ + providers: [{ ...curseforge, modpacksBlockedReason: "curseforge_key_not_shared" }], + }); + renderTab(); + + expect(await screen.findByText(/need the shared CurseForge key/)).toBeInTheDocument(); + expect(screen.queryByRole("button", { name: "Install…" })).not.toBeInTheDocument(); + }); + + it("disables Install and the card actions for a read-only viewer", async () => { + route({ asViewer: true, view: baseView({ active: installed, phase: "Applied" }) }); + renderTab(); + + expect(await screen.findByRole("button", { name: "Install…" })).toBeDisabled(); + expect(screen.getByRole("button", { name: "Change version" })).toBeDisabled(); + expect(screen.getByRole("button", { name: "Remove" })).toBeDisabled(); + }); +}); diff --git a/web/src/types.ts b/web/src/types.ts index 8149fc390..a161d9260 100644 --- a/web/src/types.ts +++ b/web/src/types.ts @@ -122,6 +122,57 @@ export interface RegistryProviderInfo { provider: string; available: boolean; modpacks: boolean; + modsBrowse?: boolean; // false => hide from Mods tab; undefined treated as true (old fixtures) + modpacksBlockedReason?: string; // "curseforge_key_not_shared" => hide from Modpacks switch +} + +export type ModpackPhase = "" | "Pending" | "BackingUp" | "Applying" | "Applied" | "BackupFailed"; + +export interface ModpackActive { + provider: string; + project: string; + version: string; + title: string; + versionName: string; + pinned: boolean; + pendingRemoval?: boolean; +} + +export interface ModpackMissingFile { + mod: string; + versionName: string; + filename: string; + downloadPage: string; +} + +export interface ModpackView { + active: ModpackActive | null; + phase: ModpackPhase; + message: string; + backupName: string; + keyShared: boolean; + missingFiles: ModpackMissingFile[]; + missingFilesUnknown: boolean; + downloadsPath: string; + backupAvailable: boolean; + // Name of the backup destination the pre-change backup uses; absent when none. + backupDestination?: string; +} + +export interface ModpackInstallBody { + provider: string; + project: string; + version: string; + title?: string; + versionName?: string; + backupFirst?: boolean; +} + +export interface CurseForgeShare { + share: boolean; + managedKey: boolean; + // Where the effective CurseForge key comes from; "" when there is none. + keySource?: "admin" | "startup-flag" | ""; } // spec.capabilities.mods.idList — declares that this game's server @@ -298,6 +349,10 @@ export interface RegistryVersion { versionNumber?: string; gameVersions?: string[]; loaders?: string[]; + // Provider-reported release channel; absent when the provider does not say. + releaseType?: "release" | "beta" | "alpha"; + // RFC 3339 publish time; absent when unknown. + publishedAt?: string; files: RegistryFile[]; }