Public: anyone can read this; the crew can change it.

Spark's config is installed with the mod so a profile uploads to the forge and never elsewhere #18173

opened this

Merged 7h 41m ago, live in production

Installing spark now writes its config in the same commit, so a profile goes to the box's forge store and never to spark's own paste site. tsc is clean and test/game-mods.test.ts, test/game-spark.test.ts and a few nearby suites pass. I did not run the whole suite; the forge's check does that on the push.

Notes

opened this

Installing spark now writes its config in the same commit, so a profile goes to the box's forge store and never to spark's own paste site. tsc is clean and test/game-mods.test.ts, test/game-spark.test.ts and a few nearby suites pass. I did not run the whole suite; the forge's check does that on the push.

What changed

  • Config file: planInstall for the slug spark adds a config file to the plan. It is config/spark/config.json on a mod server and plugins/spark/config.json on a plugin server. commitPlan writes it together with the lockfile and env. The "new server" flow in presets.ts writes it too, so spark can't be added there without its config.
  • Contents:
    • bytebinUrl is the placeholder ${CFG_SPARK_BYTEBIN_URL}.
    • viewerUrl is <forge>/games/<box>/@spark/, the box's profile page.
  • Secret: the upload address carries a secret, and the forge refuses secrets in the repository. So the plan also sets CFG_SPARK_BYTEBIN_URL: ${SPARK_BASE} in the service env. At each check-in envFiles writes SPARK_BASE=<forge>/games/@spark/<secret>/ into the box's sealed .env, from a secret kept sealed and registered as the box's upload secret.
  • Never elsewhere: no author-hosted URL appears in the file. If the placeholder is not filled, spark has no valid address to post to.
  • Reused: withConfig and setServiceEnv for the compose edit, sealedOnce for the secret, and one shared useSecret helper in spark.ts.
  • Test: test/game-mods.test.ts has a new case with spark added to the Modrinth stand-in. It checks the file path for both server kinds, that the config holds no author URL, that the config and env land in one commit, and that the repo text never contains the secret. It also checks that SPARK_BASE in .env is stable across check-ins and is accepted by the forge. A non-spark mod gets no config.
  • Docs: docs/features/game-spark.md.

Not done

  • An address made by hand on the box page works only until the box's next check-in, when .env sets the box's own address back. This is stated in the docs.
  • An already-installed spark is not rewritten, and a reinstall replaces a hand-edited config.
  • There is no new page or terminal door; installs already reach the web page, terminal and games tool through planInstall.

Try it: on a box with a Paper service, run the games tool mods_install with project spark. Then read plugins/spark/config.json in the network repo and SPARK_BASE in the box's .env.

🤖 Generated with Claude Code

Closes #18138

commented

Installing spark now writes its config in the same commit, so a profile goes to the box's forge store and never to spark's own paste site. tsc is clean and test/game-mods.test.ts, test/game-spark.test.ts and a few nearby suites pass. I did not run the whole suite; the forge's check does that on the push.

What changed

  • Config file: planInstall for the slug spark adds a config file to the plan. It is config/spark/config.json on a mod server and plugins/spark/config.json on a plugin server. commitPlan writes it together with the lockfile and env. The "new server" flow in presets.ts writes it too, so spark can't be added there without its config.
  • Contents:
    • bytebinUrl is the placeholder ${CFG_SPARK_BYTEBIN_URL}.
    • viewerUrl is <forge>/games/<box>/@spark/, the box's profile page.
  • Secret: the upload address carries a secret, and the forge refuses secrets in the repository. So the plan also sets CFG_SPARK_BYTEBIN_URL: ${SPARK_BASE} in the service env. At each check-in envFiles writes SPARK_BASE=<forge>/games/@spark/<secret>/ into the box's sealed .env, from a secret kept sealed and registered as the box's upload secret.
  • Never elsewhere: no author-hosted URL appears in the file. If the placeholder is not filled, spark has no valid address to post to.
  • Reused: withConfig and setServiceEnv for the compose edit, sealedOnce for the secret, and one shared useSecret helper in spark.ts.
  • Test: test/game-mods.test.ts has a new case with spark added to the Modrinth stand-in. It checks the file path for both server kinds, that the config holds no author URL, that the config and env land in one commit, and that the repo text never contains the secret. It also checks that SPARK_BASE in .env is stable across check-ins and is accepted by the forge. A non-spark mod gets no config.
  • Docs: docs/features/game-spark.md.

Not done

  • An address made by hand on the box page works only until the box's next check-in, when .env sets the box's own address back. This is stated in the docs.
  • An already-installed spark is not rewritten, and a reinstall replaces a hand-edited config.
  • There is no new page or terminal door; installs already reach the web page, terminal and games tool through planInstall.

Try it: on a box with a Paper service, run the games tool mods_install with project spark. Then read plugins/spark/config.json in the network repo and SPARK_BASE in the box's .env.

🤖 Generated with Claude Code

commented

Left #18138 open: 1 unticked item remain (A box never uploads elsewhere, even once.).

Sign in to join this conversation.

Search
↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs