-
Notifications
You must be signed in to change notification settings - Fork 161
feat(jans-linux-setup): activate proxy_http2 for jans-lock #13167
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
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Mustafa Baser <mbaser@mail.com>
📝 WalkthroughWalkthroughRefactors Apache module management in HttpdInstaller: adds an Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related issues
Suggested reviewers
🚥 Pre-merge checks | ✅ 2 | ❌ 3❌ Failed checks (1 warning, 2 inconclusive)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Error: Hi @devrimyatar, You did not reference an open issue in your PR. I attempted to create an issue for you. |
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
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
🤖 Fix all issues with AI agents
In `@jans-linux-setup/jans_setup/setup_app/installers/httpd.py`:
- Line 154: Replace the non-idiomatic membership test "if not module in
mods_enabled:" with the PEP8-preferred form "if module not in mods_enabled:" in
the httpd installer code where the variables module and mods_enabled are used
(search for the membership check in jans_setup/setup_app/installers/httpd.py to
locate the conditional).
- Line 39: The enabled_modules list uses the wrong module name "mod_dir"; update
the entry in self.enabled_modules to "dir" so it matches Apache's module naming
(and the httpd_2.4.conf LoadModule dir_module pattern) and so the Debian check
for /etc/apache2/mods-available/{amod}.load will find the correct file; locate
the list assigned to self.enabled_modules in the httpd installer (the list
containing 'env', 'log_config', ..., 'rewrite', 'mod_dir', 'auth_openidc') and
replace 'mod_dir' with 'dir'.
Signed-off-by: Mustafa Baser <mbaser@mail.com>
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
🤖 Fix all issues with AI agents
In `@jans-linux-setup/jans_setup/setup_app/installers/httpd.py`:
- Around line 103-110: The enable_modules method uses copy.deepcopy on
self.enabled_modules unnecessarily; replace copy.deepcopy(self.enabled_modules)
with a shallow copy (e.g., list(self.enabled_modules) or
self.enabled_modules.copy()) to avoid overhead, keep the rest of the logic that
appends 'http2' and 'proxy_http2' when Config.install_jans_lock is true, and
remove the import copy if it is no longer referenced elsewhere.
| def enable_modules(self): | ||
|
|
||
| mods_enabled = copy.deepcopy(self.enabled_modules) | ||
| if Config.install_jans_lock: | ||
| mods_enabled.append('http2') | ||
| mods_enabled.append('proxy_http2') | ||
|
|
||
| self.logIt(f"Apache modules to be enabled: {' '.join(mods_enabled)}") |
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.
🧹 Nitpick | 🔵 Trivial
Use shallow copy instead of deepcopy for a flat list of strings.
copy.deepcopy() is unnecessary overhead here since self.enabled_modules is a flat list of immutable strings. A shallow copy is sufficient and more idiomatic.
♻️ Proposed fix
def enable_modules(self):
- mods_enabled = copy.deepcopy(self.enabled_modules)
+ mods_enabled = self.enabled_modules.copy()
if Config.install_jans_lock:
mods_enabled.append('http2')
mods_enabled.append('proxy_http2')With this change, the import copy at line 2 can also be removed if not used elsewhere.
🤖 Prompt for AI Agents
In `@jans-linux-setup/jans_setup/setup_app/installers/httpd.py` around lines 103 -
110, The enable_modules method uses copy.deepcopy on self.enabled_modules
unnecessarily; replace copy.deepcopy(self.enabled_modules) with a shallow copy
(e.g., list(self.enabled_modules) or self.enabled_modules.copy()) to avoid
overhead, keep the rest of the logic that appends 'http2' and 'proxy_http2' when
Config.install_jans_lock is true, and remove the import copy if it is no longer
referenced elsewhere.
Signed-off-by: Mustafa Baser <mbaser@mail.com>
|




Prepare
Description
Target issue
closes #13128
Implementation Details
Test and Document the changes
Please check the below before submitting your PR. The PR will not be merged if there are no commits that start with
docs:to indicate documentation changes or if the below checklist is not selected.Closes #13168,
Summary by CodeRabbit