Skip to content

feat(deploy): make the web and admin static asset rate limits configurable - #10385

Open
ashokram-si wants to merge 1 commit into
makeplane:previewfrom
ashokram-si:feat/configurable-asset-rate-limit
Open

ashokram-si wants to merge 1 commit into
makeplane:previewfrom
ashokram-si:feat/configurable-asset-rate-limit

Conversation

@ashokram-si

@ashokram-si ashokram-si commented Nov 24, 2026 •

Copy link
Copy Markdown

Description

The web and admin frontends' Caddy servers allow 300 static asset requests per client IP per minute, fixed in their Caddyfiles. A full page load can fetch several hundred files, and everyone behind one NAT shares the limit, so self hosted installs can hit HTTP 429 on normal page loads (#9977, #10341). As proposed in #10340, this makes the limit configurable and keeps 300 as the default:

  • apps/web/caddy/Caddyfile and apps/admin/caddy/Caddyfile read events {$WEB_ASSET_RATE_LIMIT:300} and {$ADMIN_ASSET_RATE_LIMIT:300}.
  • deployments/cli/community/docker-compose.yml passes WEB_ASSET_RATE_LIMIT and ADMIN_ASSET_RATE_LIMIT to the web and admin services (default 300), and variables.env lists both with a short note on when to raise them.

Nothing changes for an install that doesn't set them, and upgrades through install.sh pick up the new keys with their defaults. Swarm uses the same compose file. The AIO image serves the frontends through its own proxy Caddyfile, which has no such limit. The limit counts per container, so with more than one web replica each keeps its own count. Kubernetes installs (as in #10341) need the two variables in the Helm chart, which lives in its own repository; I can follow up there, and on the self hosting docs, if you'd like.

#9978 raises the fixed number instead. The two fit together: this keeps the default the issue asks for and can carry whatever default you settle on, so whichever lands second only needs the default updated.

Type of Change

  • Feature (non-breaking change which adds functionality)

Test Scenarios

  • Built the caddy-builder stage of apps/web/Dockerfile.web (Caddy with caddy-ratelimit) and ran caddy adapt on both Caddyfiles: unset gives max_events 300, WEB_ASSET_RATE_LIMIT=1200 / ADMIN_ASSET_RATE_LIMIT=1200 give 1200, and a value that isn't a number stops Caddy at startup with "invalid max events integer", naming the line.
  • docker compose --env-file variables.env config on the community compose file renders both variables as 300, and an exported WEB_ASSET_RATE_LIMIT=900 comes through as 900. An empty value in plane.env falls back to 300 through ${...:-300}.

References

Closes #10340
Related #9977, #10341

Summary by CodeRabbit

  • New Features
    • Per-client rate limits for web and admin static asset requests are now configurable, defaulting to 300 requests per minute. Requests exceeding the limit receive an HTTP 429 response.

…rable

WEB_ASSET_RATE_LIMIT and ADMIN_ASSET_RATE_LIMIT set the per client IP
requests per minute of the web and admin Caddy servers (default 300).

Closes makeplane#10340
Refs makeplane#9977, makeplane#10341
@CLAassistant

CLAassistant commented Nov 24, 2026 •

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@coderabbitai

coderabbitai Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The web and admin static-asset rate limits are configurable through separate environment variables. The existing default of 300 requests per client IP per minute remains in place.

Changes: Frontend asset rate limits

Layer / File(s) Summary
Define and pass rate-limit variables
deployments/cli/community/variables.env, deployments/cli/community/docker-compose.yml
The community environment defines WEB_ASSET_RATE_LIMIT and ADMIN_ASSET_RATE_LIMIT as 300. The web and admin services pass their respective variables, with a default of 300.
Use variables in Caddy rate limits
apps/web/caddy/Caddyfile, apps/admin/caddy/Caddyfile
Each Caddy configuration uses its corresponding environment variable for the static-asset event limit and falls back to 300 when it is unset.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Feature · Severity of issue fixed: Medium

Possibly related issues

  • #10341 — Reports HTTP 429 responses during normal web page loads from the static-asset limit. This change makes the limit configurable but keeps the default at 300.
  • #9977 — Reports HTTP 429 responses during normal workspace loads from the static-asset limit. This change makes the web and admin limits configurable but keeps the default at 300.

Possibly related PRs

  • makeplane/plane#10200 — Removes the same web and admin Caddy rate-limit rule that this change makes configurable.
Merge Risk: Minimal · up to 57d54

This change makes the web and admin static-asset rate limits configurable while keeping the existing default of 300 requests per minute per client IP. The installer and upgrade flow carry configured values through to the containers. No merge-blocking risk was found.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the change: the web and admin static asset rate limits become configurable. The changeset adds WEB_ASSET_RATE_LIMIT and ADMIN_ASSET_RATE_LIMIT to both Caddyfiles, the community docker-…
Description check Passed The description follows the template. It has a Description section that explains the problem (300 static asset requests per client IP per minute causing HTTP 429 behind NAT), the proposed change, and …
Linked Issues check Passed Directly linked issue #10340 has coding requirements: (1) make the Web and Admin static-asset rate limits configurable through environment variables, (2) keep 300 requests per client IP per minute as …
Out of Scope Changes check Passed The changed files are apps/web/caddy/Caddyfile, apps/admin/caddy/Caddyfile, deployments/cli/community/docker-compose.yml, and deployments/cli/community/variables.env. Each change directly supports the…
Full details: Title check

Explanation

The title names the change: the web and admin static asset rate limits become configurable. The changeset adds WEB_ASSET_RATE_LIMIT and ADMIN_ASSET_RATE_LIMIT to both Caddyfiles, the community docker-compose.yml, and variables.env, with 300 kept as the default. The conventional-commit prefix 'feat(deploy)' fits the deployment-focused change. The title is short, specific, and matches the main objective of linked issue #10340.

Full details: Description check

Explanation

The description follows the template. It has a Description section that explains the problem (300 static asset requests per client IP per minute causing HTTP 429 behind NAT), the proposed change, and scope notes for Swarm, AIO, replicas, and Kubernetes. The Type of Change section marks Feature. The Test Scenarios section lists concrete commands and results. The References section closes #10340 and relates #9977 and #10341. The Screenshots section is omitted, which is acceptable because it is marked as applicable only when relevant. The description does not use the 'Improvement' or other checkbox categories, but the chosen Feature category is reasonable.

Full details: Linked Issues check

Explanation

Directly linked issue #10340 has coding requirements: (1) make the Web and Admin static-asset rate limits configurable through environment variables, (2) keep 300 requests per client IP per minute as the default, (3) pass each variable to its frontend Caddy container, and (4) document the settings. The PR meets these as follows:

  • apps/web/caddy/Caddyfile reads events {$WEB_ASSET_RATE_LIMIT:300}, and apps/admin/caddy/Caddyfile reads events {$ADMIN_ASSET_RATE_LIMIT:300}. Both keep 300 as the default. The PR author reports caddy adapt results for unset and 1200 values.
  • deployments/cli/community/docker-compose.yml passes both variables to the web and admin services with a default of 300.
  • deployments/cli/community/variables.env lists both variables, sets them to 300, and describes when to raise them.
    The PR description states that Kubernetes Helm configuration and the external self-hosting documentation are separate follow-ups. Those are outside this repository and are not coding requirements for this PR. No unmet coding requirement is found in this repository.
Full details: Out of Scope Changes check

Explanation

The changed files are apps/web/caddy/Caddyfile, apps/admin/caddy/Caddyfile, deployments/cli/community/docker-compose.yml, and deployments/cli/community/variables.env. Each change directly supports the configurable rate-limit objective of #10340. No unrelated functional change is shown in the PR summary. The #9978 default change is not included here, and the PR description says it is a separate, compatible change.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 5399f1d7-4942-4653-9b6b-88af7a9e1ef5
Commits

Reviewing files that changed from the base of the PR and between 723bb17 and 57d546e.

Files selected for processing: 4

  • apps/admin/caddy/Caddyfile
  • apps/web/caddy/Caddyfile
  • deployments/cli/community/docker-compose.yml
  • deployments/cli/community/variables.env

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.

This branch has not been deployed

No deployments
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.

[feature]: Make frontend static asset rate limits configurable through environment variables

2 participants