Skip to content

Make Flask subdomain matching configurable via SUBDOMAIN_MATCHING #151

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
merged 2 commits into from
May 18, 2025

Conversation

mreid-tt
Copy link
Contributor

@mreid-tt mreid-tt commented May 18, 2025

Background:

In PR #142 we bumped Flask (2.3.3→3.1.0) and Werkzeug (3.0.1→3.1.3), which inadvertently disabled Flask’s default subdomain routing behavior. As a result, our blueprints registered with subdomain="api" and subdomain="packages" no longer matched incoming requests on those hosts, breaking key endpoints in production.

What this PR does:

  • Adds a new SUBDOMAIN_MATCHING flag to config.py, defaulting to False for local development.
  • In the Flask factory (app.py), reads SUBDOMAIN_MATCHING and sets app.subdomain_matching accordingly.

Why this is required:

  • Restores blueprint routes on api.<domain> and packages.<domain> that stopped matching after the Flask/Werkzeug upgrade.
  • Keeps local development flows intact (using localhost) without subdomains.

Usage:

  • Dev: leave SUBDOMAIN_MATCHING=False in config.py.
  • Prod: set SUBDOMAIN_MATCHING=True (via your production config) to re-enable subdomain‐based routing.

Fixes: #144

@mreid-tt mreid-tt self-assigned this May 18, 2025
@mreid-tt mreid-tt merged commit ff48a50 into SynoCommunity:main May 18, 2025
2 checks passed
@mreid-tt mreid-tt deleted the add-subdomain-matching branch May 18, 2025 22:15
@mreid-tt
Copy link
Contributor Author

Hey @publicarray, do you think you might have some time over the weekend to issue a new release and deploy these (and any other pending) fixes to the production server?

@publicarray
Copy link
Member

Yea i'll give it a go tonight

@publicarray
Copy link
Member

publicarray commented May 25, 2025

The new version is live 🚢

@mreid-tt mreid-tt added the python Pull requests that update python code label May 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
python Pull requests that update python code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

repo downloads do not work on v0.2.7
3 participants