mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[GH-ISSUE #3810] [Issue]: Unix launchers execute .env with Bash semantics #2056
Labels
No labels
android
bug
bugfix
ci
client
code freeze pause
container
dependencies
docs
documentation
duplicate
enhancement
feature
feature
feature
feature-creep
fixed-in-refactor
fixed-in-staging
good first issue
help wanted
in-pr
in-pr
needs-codeowner-decision
normal-scope
old-codebase
old-codebase
pull-request
qol
question
refactor
regression
revisit later
roadmap
scope-risk
scope-risk
server
server
shared
soup
upstream
windows
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Pasta-Devs/Marinara-Engine#2056
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @Xelvanis on GitHub (Jul 19, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/3810
Originally assigned to: @SpicyMarinara on GitHub.
Summary
start.shandstart-termux.shsource the project.envas Bash code. The server and documentation treat the same file as inert dotenvKEY=valuedata, so valid dotenv values can abort startup, expand unexpectedly, or execute shell substitutions.Expected behavior
Unix launchers should read only the settings they need using non-evaluating parsing compatible with the server's dotenv semantics. Values in
.envshould never be executed as shell code.Actual behavior
Both Unix launchers run
set -a; . ./.env; set +a. Bash therefore interprets spaces, substitutions, expansions, redirections, and other shell syntax. Because the launchers useset -e, a shell-incompatible but valid dotenv value can terminate startup.The server independently reads the file with
dotenv.config()inpackages/server/src/config/runtime-config.ts, whiledocs/CONFIGURATION.mddescribes.envas plainKEY=valuetext. The Windows launcher uses a non-evaluating line parser instead.Steps to reproduce
.env:./start.sh --skip-updateor./start-termux.sh --skip-update.command not found.A controlled parser comparison also confirmed that
EXPANDED=$(printf shell-evaluated)executes the substitution when sourced by Bash, whiledotenv.parse()preserves it literally.Environment
Logs, screenshots, or video
Controlled reproduction output:
For the same input, dotenv returned literal values:
Additional context
The sourcing was introduced in commit
a1b7d8320to makeAUTO_UPDATE_ENABLEDavailable before the update decision and reuse server settings later in the launcher. This appears to be an unintended consequence of that intentional behavior.Smallest fix direction: after Node 24 is available, extract only launcher-owned settings (
AUTO_UPDATE_ENABLED,PORT,HOST,SSL_CERT,SSL_KEY, andAUTO_OPEN_BROWSER) through a non-evaluating env-file parser. Do not usesourceoreval. Preserve ambient-environment precedence and test spaces, quotes, comments,$, command-substitution text, and Termux's pre-install startup order.Template check
Please uncheck (untick) the box below before submitting so we know you read the template. It is intentionally pre-checked:
@SpicyMarinara commented on GitHub (Jul 19, 2026):
Claimed by @SpicyMarinara for the assigned issue sweep on
agent/assigned-issue-sweep. I will keep the fix scoped to this issue and link the draft PR once the first proof-backed patch is pushed.@SpicyMarinara commented on GitHub (Jul 19, 2026):
Implementation will continue in draft PR #3814; the launcher fix is the next sweep slice.
@SpicyMarinara commented on GitHub (Jul 19, 2026):
Fixed in draft PR #3814. Both Unix launchers now wait for Node 24, extract only their allowlisted settings through Node dotenv parsing, and assign values without
sourceoreval. Ambient values (including empty values) win.pnpm regression:issuespasses with spaces, quotes, comments, literal$, literal command-substitution text, allowlisting, both launcher orderings, and Bash syntax covered.@SpicyMarinara commented on GitHub (Jul 19, 2026):
Addressed in ready-for-review PR #3814. Unix launchers now parse only their allowlisted dotenv settings as inert data, preserve ambient-variable precedence, and never source or evaluate . Focused launcher regressions and the full local validation gate pass.
@SpicyMarinara commented on GitHub (Jul 19, 2026):
Correction for the close note: Unix launchers now parse only their allowlisted dotenv settings as inert data, preserve ambient-variable precedence, and never source or evaluate
.env. Focused launcher regressions and the full local validation gate pass.