Skip to content

add ability to extend servers with custom envs - #11

Open
ckocyigit wants to merge 4 commits into
Shakes63:mainfrom
ckocyigit:main
Open

add ability to extend servers with custom envs#11
ckocyigit wants to merge 4 commits into
Shakes63:mainfrom
ckocyigit:main

Conversation

@ckocyigit

Copy link
Copy Markdown

No description provided.

@ckocyigit

Copy link
Copy Markdown
Author

#8 (comment)

@Shakes63

Shakes63 commented Aug 7, 2026

Copy link
Copy Markdown
Owner

Thanks for this — it's a real gap (custom envs unlock things like Palworld TARGET_MANIFEST_ID pinning that the manager can't cover natively), and the implementation approach is right: injection at the buildContainerSpec choke point so every game gets it, a validated DTO (POSIX key names, value caps, max 64), configDirty → Restart prompt, and a UI card that matches the panel's patterns. The conditional UPDATE_ON_BOOT for TARGET_MANIFEST_ID is a nice touch. I'd like to merge this, with a few changes first:

1. Secrets exposure (blocker). extraEnv values are stored unencrypted and returned in ServerSummary, which every role — including viewers — can read. The headline use case makes this acute: locking a Palworld manifest requires STEAM_USERNAME/STEAM_PASSWORD alongside TARGET_MANIFEST_ID, so the feature funnels users into putting a Steam password into a plaintext, viewer-visible field — in a codebase where every other password is encrypted with SECRETS_KEY and never returned by the API. Minimum fix: don't return values to non-admin roles (mask them in the summary); ideally also encrypt extraEnvJson at rest the same way the password fields are. A note in the card ("values are visible to all panel users" — or not, once masked) would help too.

2. Rebase needed. main has moved since July 16 and now touches almost every file this PR does (dto.ts, servers.service.ts, runtime-spec.ts, page.tsx, schema.prisma, Dockerfile), so it needs a rebase before it can merge. Heads-up on two spots: the Overview card region in page.tsx gained a CrashBanner, and the Dockerfile runtime stage gained an npm strip near your sed line.

3. Tests. For a feature whose whole point is env injection, the suite should cover: the append-last/override ordering in buildContainerSpec, DTO validation (bad key names, oversized values rejected), and the TARGET_MANIFEST_IDUPDATE_ON_BOOT conditional. There are existing patterns in runtime-spec.test.ts / version-pinning.test.ts to crib from.

4. create() drops extraEnv. CreateServerBody accepts it, but only update() persists it — creating a server with extraEnv silently loses them. Either persist it in create() too or drop it from the create DTO.

5. Optional, maintainer's caution: appending last means manager-owned keys (RCON_PORT, SERVER_PORT, ADMIN_PASSWORD, …) can be silently overridden and break the panel's own console/player-count/port plumbing. I'm fine keeping full override power for advanced users, but a short warning in the card naming those keys (or a tiny blocklist for the port/RCON ones) would save some support pain.

The .gitattributes/CRLF fixes are welcome — happy for those to stay in (or land separately if you prefer a tighter diff). Thanks again!

This was referenced Aug 7, 2026
@bayshiro bayshiro mentioned this pull request Aug 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants