mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[PR #5602] [CLOSED] feat(server): add optional outbound proxy support (MARINARA_PROXY) #6843
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#6843
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?
📋 Pull Request Information
Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/5602
Author: @stbanana
Created: 8/28/2026
Status: ❌ Closed
Base:
staging← Head:feat/5588-outbound-proxy📝 Commits (2)
6b45201feat(server): route non-local outbound fetches through an optional proxy3932e13docs(changelog): note MARINARA_PROXY outbound proxy (#5588)📊 Changes
4 files changed (+54 additions, -4 deletions)
View changed files
📝
.env.example(+12 -0)📝
CHANGELOG.md(+1 -0)📝
docs/CONFIGURATION.md(+3 -0)📝
packages/server/src/utils/security.ts(+38 -4)📄 Description
PR title
feat(server): add optional outbound proxy support (MARINARA_PROXY)
Linked issue
Closes #5588
Why this change
On networks where direct GitHub (or provider) access is blocked, Marinara Engine cannot download agents or capability packages, and provider requests can time out:
safeFetch()is backed by undici'sfetchplus a self-builtAgent, and undici ignores both the OS proxy and theHTTP_PROXY/HTTPS_PROXYenvironment variables.This adds an opt-in outbound proxy so restricted-network installs can route non-local outbound requests through a local SOCKS5 or HTTP(S) proxy. Behavior is unchanged when no proxy is configured.
What changed
packages/server/src/utils/security.tsProxyAgent,Socks5ProxyAgent, andtype Dispatcherfromundici.resolveOutboundProxyUrl()(readsMARINARA_PROXY→HTTPS_PROXY→ALL_PROXY) andcreateOutboundProxyDispatcher()(SOCKS5/SOCKS5H/HTTP/HTTPS).validateOutboundUrlForFetch(), after SSRF validation, return a proxy dispatcher when a proxy is configured; otherwise keep the existing directAgentpath unchanged.readCappedResponse()/capStreamingResponse()fromAgenttoDispatcher..env.example— document the newMARINARA_PROXYsetting.docs/CONFIGURATION.md— document the setting and its scope.Reviewer notes:
policy.allowLocalrequests (Ollama, LM Studio, loopback) never use the proxy.MARINARA_PROXYis unset, the standardHTTPS_PROXY/ALL_PROXYenv vars are honored, so an ambient host proxy is picked up automatically.Validation
pnpm checkpasses locallyCONTRIBUTING.mdManual verification notes
Download Agentslists packages whenMARINARA_PROXY=socks5://...is set on a network that blocks direct GitHub access.MARINARA_PROXYis empty or unset.Docs and release impact
docs-i18nbranch updated to match, or a[docs-i18n]follow-up issue opened (see CONTRIBUTING.md § Translated documentation)UI evidence (if applicable)
No UI changes.
Summary by CodeRabbit
MARINARA_PROXY.HTTPS_PROXYorALL_PROXYwhen the new setting is not configured.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.