inject default Angular SSR environment variables for local builds#10706
Open
falahat wants to merge 9 commits into
Open
inject default Angular SSR environment variables for local builds#10706falahat wants to merge 9 commits into
falahat wants to merge 9 commits into
Conversation
…d validate availability in local builds
Wiz Scan Summary
To detect these findings earlier in the dev lifecycle, try using Wiz Code VS Code Extension. |
Contributor
There was a problem hiding this comment.
Code Review
This pull request replicates the Go buildpack preparer's Angular environment variable injection and validation for NG_TRUST_PROXY_HEADERS and NG_ALLOWED_HOSTS. The feedback recommends adding a defensive check to ensure the parsed package.json is a non-null object before accessing its properties, and extending the NG_TRUST_PROXY_HEADERS validation to check both runtimeEnv and buildEnv to prevent users from bypassing validation.
… local builds preparer
falahat
commented
Jun 24, 2026
| availability: ["RUNTIME"], | ||
| }); | ||
| expect(runtimeEnv["foo"]["NG_ALLOWED_HOSTS"]).to.deep.equal({ | ||
| value: "*.hosted.app,*.run.app,*.firestack.app,localhost", |
Contributor
Author
There was a problem hiding this comment.
this is too permissive, I need to scope it to the user's project/backend, something like
[BACKEND_ID]--[PROJECT_ID].[REGION].[SHARED_DOMAIN],
[BACKEND_ID]--[PROJECT_ID].web.app,
[BACKEND_ID]--[PROJECT_ID].firebaseapp.com
…ict location checks for Angular SSR
de626c2 to
5caf8fa
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This adds NG_ALLOWED_HOSTS and NG_ALLOWED_PROXY_HEADERS similar to Firebase App Hosting Source Deploys. This is required for Angular SSR to work with Firebase Deployments.
Scenarios Tested
I tested Angular v19 through v22 with local vs source deploys and confirmed that the results were correct and the same (not falling back to CSR for local builds.)
Sample Commands