-
-
Notifications
You must be signed in to change notification settings - Fork 638
Fix bundle path resolution and improve server bundle security #1798
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
+471
−106
Merged
Changes from all commits
Commits
Show all changes
31 commits
Select commit
Hold shift + click to select a range
4ee772e
Fix server bundle path resolution in test environments (#1797)
justin808 9e1465a
Improve bundle path resolution with secure server bundle locations
justin808 7aff6da
Apply suggestions from code review
justin808 b0c4963
Update Gemfile.lock and CHANGELOG.md
justin808 61a1254
Add configuration options for secure server bundle management
justin808 d974d82
Fix breaking change: Set server_bundle_output_path default to nil
justin808 60b50d8
Fix CI failures by restoring packer availability check
justin808 6a2035f
Clean solution: Remove redundant using_packer? check with proper test…
justin808 afd06ed
Implement enforce_secure_server_bundles with comprehensive improvements
justin808 ed37a2b
refactor: Use configuration-based approach for server bundle output path
github-actions[bot] fa07c57
refactor: Use configuration-based approach for server bundle output path
github-actions[bot] 55a30c0
Fix CI failures: RuboCop violations and test failures
github-actions[bot] 8936a77
Fix dummy app configuration for test environment
github-actions[bot] 88212b8
refactor: Return configured server_bundle_output_path directly withou…
github-actions[bot] d917bda
Fix CI failures: RuboCop violations and test failures
github-actions[bot] b478d61
refactor: Rename 'secure' to 'private' for server bundles terminology
github-actions[bot] 3cb7cdc
fix: Remove obsolete using_packer? method references
github-actions[bot] 60d498d
update changelog.md
AbanoubGhadban 3d5c7ea
Clarify method naming: rename generated_assets_full_path → public_ass…
justin808 4252368
Improve method naming: use public_bundles_full_path instead of public…
justin808 6c38c6f
Refactor: Update test mocks to use public_bundles_full_path
AbanoubGhadban a9aff90
Enhance configuration documentation and clarify directory structure f…
AbanoubGhadban 92b58ea
Update changelog and configuration to reflect breaking changes and en…
AbanoubGhadban ffa58ac
Don't fall back to public directory if enforce_private_server_bundles…
AbanoubGhadban 369f5a7
Enhance server bundle path resolution logic
AbanoubGhadban b36413d
Update server bundle path resolution to utilize public output path
AbanoubGhadban a0e9656
Fix remaining test failures: update all packer method references
justin808 1c9e45e
Fix CI test failures: update test mocks for enforce_private_server_bu…
justin808 57a3ab9
Correct test expectations for new fallback behavior
justin808 eb7ed67
Add TODO for shakapacker.yml integration enhancement
justin808 fcddead
Change validation error to warning for deprecated generated_assets_dirs
justin808 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
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
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
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -44,13 +44,14 @@ const configureServer = () => { | |
|
|
||
| // Custom output for the server-bundle that matches the config in | ||
| // config/initializers/react_on_rails.rb | ||
| // Server bundles are output to a private directory (not public) for security | ||
| serverWebpackConfig.output = { | ||
| filename: 'server-bundle.js', | ||
| globalObject: 'this', | ||
| // If using the React on Rails Pro node server renderer, uncomment the next line | ||
| // libraryTarget: 'commonjs2', | ||
| path: config.outputPath, | ||
| publicPath: config.publicPath, | ||
| path: require('path').resolve(__dirname, '../../ssr-generated'), | ||
|
||
| // No publicPath needed since server bundles are not served via web | ||
| // https://webpack.js.org/configuration/output/#outputglobalobject | ||
| }; | ||
|
|
||
|
|
||
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The logic adds a leading newline but also a trailing newline, which could result in extra blank lines in .gitignore. The leading newline in the comment line and the trailing newline in the join result could create formatting inconsistencies.