Skip to content

Consistent configuration with other apps#7

Merged
antoinebhs merged 1 commit into
mainfrom
fix-conf
May 11, 2026
Merged

Consistent configuration with other apps#7
antoinebhs merged 1 commit into
mainfrom
fix-conf

Conversation

@antoinebhs
Copy link
Copy Markdown
Contributor

@antoinebhs antoinebhs commented May 11, 2026

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 11, 2026

Review Change Stack

📝 Walkthrough

Walkthrough

The PR updates Apache HTTPD vhost configuration to migrate asset caching from a /static/ directory block to a new /assets/ block with long-lived immutable cache headers for content-hashed files, and increases the maximum allowed HTTP request line length to 64000 characters.

Changes

HTTPD Vhost Configuration

Layer / File(s) Summary
Assets Directory Caching
app-httpd.conf
Replaces /static/ directory block with /assets/ block. Files are cached as immutable with comments explaining an Apache/mod_deflate ETag behavior caveat.
Request Line Length
app-httpd.conf
Adds LimitRequestLine 64000 directive to vhost to permit longer HTTP request lines.

Suggested reviewers

  • klesaulnier
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title 'Consistent configuration with other apps' is directly related to the PR's stated objective of uniformizing configuration with other Gridsuite applications and is supported by the changes shown in the diff.
Description check ✅ Passed The PR description directly references a specific commit from another Gridsuite app and explains the intent to uniformize configuration across apps, which aligns with the changeset showing Apache HTTPD configuration updates.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a 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

🧹 Nitpick comments (1)
app-httpd.conf (1)

42-52: ⚡ Quick win

Scope immutable caching to hashed filenames only.

Line 51 currently applies 1-year immutable caching to every file in /assets/. If a non-hashed asset ever lands there, clients can get stuck on stale content for a long time. Constrain this header to hashed filenames and set a shorter TTL fallback for others.

Proposed config adjustment
 <Directory /opt/bitnami/apache/htdocs/gridmonitor/assets/>
-    Header set Cache-Control "public, max-age=31536000, immutable"
+    # Immutable cache only for content-hashed build artifacts
+    <FilesMatch "\.[0-9a-fA-F]{8,}\.(js|css|svg|png|jpg|jpeg|webp|woff2?)$">
+        Header set Cache-Control "public, max-age=31536000, immutable"
+    </FilesMatch>
+
+    # Safer fallback for non-hashed files
+    <FilesMatch "^(?!.*\.[0-9a-fA-F]{8,}\.).*$">
+        Header set Cache-Control "public, max-age=300"
+    </FilesMatch>
 </Directory>
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@app-httpd.conf` around lines 42 - 52, The current Header set Cache-Control
inside the <Directory /opt/bitnami/apache/htdocs/gridmonitor/assets/> block
applies immutable 1-year caching to all files; restrict the long-lived immutable
cache to only hashed filenames by adding a FilesMatch (or LocationMatch) that
matches a content-hash pattern (e.g., filenames containing "-[a-f0-9]{8,}"
before the extension) and apply Header set Cache-Control "public,
max-age=31536000, immutable" only there (reference the existing Header set
Cache-Control), then add a second, broader Header set Cache-Control with a much
shorter TTL (e.g., max-age=3600) for all other files in the same Directory to
serve as the fallback for non-hashed assets.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@app-httpd.conf`:
- Line 74: Add a short justification comment and linked documentation for the
Increase of the Apache directive "LimitRequestLine 64000": state the business
requirement (e.g., required max URL/query length for feature X or specific
client behavior), why 64k was chosen, and any security/hardening considerations;
then verify and document that upstream/downstream components (gateway, ingress,
reverse proxies, and backend services) have matching or intentionally
complementary limits and list where those limits are enforced (or note required
config changes). Update the repository docs (or add a note next to the
"LimitRequestLine 64000" line) to reference the justification and the components
checked, and include a short test/verification step to reproduce expected
behavior (or a link to the test plan).

---

Nitpick comments:
In `@app-httpd.conf`:
- Around line 42-52: The current Header set Cache-Control inside the <Directory
/opt/bitnami/apache/htdocs/gridmonitor/assets/> block applies immutable 1-year
caching to all files; restrict the long-lived immutable cache to only hashed
filenames by adding a FilesMatch (or LocationMatch) that matches a content-hash
pattern (e.g., filenames containing "-[a-f0-9]{8,}" before the extension) and
apply Header set Cache-Control "public, max-age=31536000, immutable" only there
(reference the existing Header set Cache-Control), then add a second, broader
Header set Cache-Control with a much shorter TTL (e.g., max-age=3600) for all
other files in the same Directory to serve as the fallback for non-hashed
assets.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: bc5072a8-7e4f-4537-ac0d-44c81b60309d

📥 Commits

Reviewing files that changed from the base of the PR and between 314bfeb and fa1b08a.

📒 Files selected for processing (1)
  • app-httpd.conf

Comment thread app-httpd.conf
ProxyPassMatch "^/api/gateway/(.*)$" http://gateway/$1 nocanon
ProxyPassMatch "^/ws/gateway/(.*)$" ws://gateway/$1 nocanon

LimitRequestLine 64000
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== Apache limit settings =="
rg -n -C2 'LimitRequestLine|LimitRequestFieldSize|LimitRequestFields' .

echo
echo "== Possible upstream/downstream request-size limits =="
rg -n -C2 --iglob '*.{conf,cnf,properties,yml,yaml,json,xml}' \
  'max-http-request-header-size|max-http-header-size|maxHttpHeaderSize|large_client_header_buffers|client_header_buffer_size|414|request.?line' .

Repository: gridsuite/gridmonitor-app

Length of output: 770


Document the business requirement and justify the 64k request-line limit before merge.

Line 74 sets LimitRequestLine to 64000, a significant increase from defaults. The verification found no documented matching limits in gateway, ingress, or backend configurations within this repository. This isolation creates risk of inconsistent behavior with upstream/downstream components (unexpected 400/414 errors) and weakens request-size hardening. Provide explicit justification for why 64000 is needed and confirm that all components in the request handling chain (proxy, ingress, backend services) enforce consistent or intentionally complementary limits.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@app-httpd.conf` at line 74, Add a short justification comment and linked
documentation for the Increase of the Apache directive "LimitRequestLine 64000":
state the business requirement (e.g., required max URL/query length for feature
X or specific client behavior), why 64k was chosen, and any security/hardening
considerations; then verify and document that upstream/downstream components
(gateway, ingress, reverse proxies, and backend services) have matching or
intentionally complementary limits and list where those limits are enforced (or
note required config changes). Update the repository docs (or add a note next to
the "LimitRequestLine 64000" line) to reference the justification and the
components checked, and include a short test/verification step to reproduce
expected behavior (or a link to the test plan).

@antoinebhs antoinebhs changed the title Consistent conf with other apps Consistent configuration with other apps May 11, 2026
@sonarqubecloud
Copy link
Copy Markdown

Copy link
Copy Markdown

@khouadrired khouadrired left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@antoinebhs antoinebhs merged commit f47587e into main May 11, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants