-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Allow advanced customization of nginx parameters in addon #3874
base: master
Are you sure you want to change the base?
Allow advanced customization of nginx parameters in addon #3874
Conversation
My use-case is that I want to setup mTLS, except for webhooks endpoints. Because ssl_verify_client cannot be set at the `location` level but needs to be set at the `server` level, and then whether we are authenticated should be checked at the location level, this requires modifying the `location /` directive of the configuration. It follows that [the template](https://github.com/home-assistant/addons/blob/91160e1b5d00e13091b0537d85a3b3112e4a3f60/nginx_proxy/rootfs/etc/nginx/nginx.conf.gtpl) is not customizable enough. To give full flexibility to the user to patch the server config however they like, we allow them to execute arbitrary commands or scripts from within the container before starting nginx, similarly to what is done by the SSH addon and appdaemon.
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.
Please take a look at the requested changes, and use the Ready for review button when you are done, thanks 👍 |
Warning Rate limit exceeded@Ten0 has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 22 minutes and 1 seconds before requesting another review. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe pull request introduces enhancements to the NGINX Home Assistant SSL proxy configuration by adding support for initialization commands. The changes include updating the Changes
Sequence DiagramsequenceDiagram
participant Config as Configuration
participant Script as Startup Script
participant Nginx as Nginx Server
Config->>Script: Provide init_commands
Script->>Script: Validate init_commands
alt Commands exist
Script->>Script: Execute each command
alt Command fails
Script-->>Config: Log error
Script->>Script: Exit with failure
else All commands succeed
Script->>Nginx: Start server
end
else No init_commands
Script->>Nginx: Start server directly
end
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
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.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
nginx_proxy/config.yaml
(2 hunks)nginx_proxy/rootfs/etc/s6-overlay/s6-rc.d/nginx/run
(1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
nginx_proxy/config.yaml (6)
Pattern */**(html|markdown|md)
: - For instructional content in documentation, use a direct and authoritative tone. Avoid expressions of politeness such as 'may' or 'please', and ensure the goal of the instruction is fronted.
- Apply the Microsoft Style Guide to ensure documentation maintains clarity and conciseness.
- In step-by-step instructions, front the location phrase in the instructional sentence.
- In step-by-step instructions, front the 'goal' in the instructional sentence.
- In step-by-step instructions, if in doubt what to front, front the 'goal' before the location phrase in the instructional sentence.
- do not hyphenate terms like 'top-right' or 'bottom-left' with 'corner'
Pattern */**(html|markdown|md)
: - Use bold to mark UI strings.
- If "" are used to mark UI strings, replace them by bold.
Pattern */**(html|markdown|md)
: - Be brief in your replies and don't add fluff like "thank you for..." and "Please let me know if"
Pattern */**(html|markdown|md)
: - Use sentence-style capitalization also in headings.
Pattern */**(html|markdown|md)
: do not comment on HTML used for icons
Pattern */**(html|markdown|md)
: Avoid flagging inline HTML for embedding videos in future reviews for this repository.
🔇 Additional comments (2)
nginx_proxy/config.yaml (2)
30-30
: Good default for optional commands.
Providing an empty list (init_commands: []
) as the default ensures that no commands are executed unless explicitly specified, which is a safe and clear approach for new users.
46-47
: Schema aligns with the new feature.
Defining init_commands
as a list of strings properly reflects the new functionality and ensures valid user input for each command. This is consistent and well-integrated with the rest of the schema.
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.
Actionable comments posted: 2
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
nginx_proxy/DOCS.md
(1 hunks)nginx_proxy/translations/en.yaml
(1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
nginx_proxy/DOCS.md (6)
Pattern */**(html|markdown|md)
: - For instructional content in documentation, use a direct and authoritative tone. Avoid expressions of politeness such as 'may' or 'please', and ensure the goal of the instruction is fronted.
- Apply the Microsoft Style Guide to ensure documentation maintains clarity and conciseness.
- In step-by-step instructions, front the location phrase in the instructional sentence.
- In step-by-step instructions, front the 'goal' in the instructional sentence.
- In step-by-step instructions, if in doubt what to front, front the 'goal' before the location phrase in the instructional sentence.
- do not hyphenate terms like 'top-right' or 'bottom-left' with 'corner'
Pattern */**(html|markdown|md)
: - Use bold to mark UI strings.
- If "" are used to mark UI strings, replace them by bold.
Pattern */**(html|markdown|md)
: - Be brief in your replies and don't add fluff like "thank you for..." and "Please let me know if"
Pattern */**(html|markdown|md)
: - Use sentence-style capitalization also in headings.
Pattern */**(html|markdown|md)
: do not comment on HTML used for icons
Pattern */**(html|markdown|md)
: Avoid flagging inline HTML for embedding videos in future reviews for this repository.
My use-case is that I want to setup mTLS, except for webhooks endpoints.
Because nginx's
ssl_verify_client
cannot be set at thelocation
level but needs to be set at theserver
level, and then whether we are authenticated should be checked at the location level, this requires modifying thelocation /
directive of the configuration.It follows that the template is not customizable enough.
To give full flexibility to the user to patch the server config however they like, we allow them to execute arbitrary commands or scripts from within the container before starting nginx, similarly to what is done by the SSH addon and appdaemon.
Summary by CodeRabbit
New Features
Improvements