Skip to content
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

Per-app config from ENV required for devserver #1729

Closed
jace opened this issue May 29, 2023 · 1 comment
Closed

Per-app config from ENV required for devserver #1729

jace opened this issue May 29, 2023 · 1 comment

Comments

@jace
Copy link
Member

jace commented May 29, 2023

Funnel provides multiple apps from a single module. These apps end up sharing configuration that is explicitly meant for a single app. Currently, a special config file hasgeekapp.py is used to isolate config for the main app, but this is a kludge.

We're migrating to config from environment variables. Since a worker (uwsgi) will be bound to only a specific app (currently app or shortlinkapp), it can supply app-specific config in the env and simply ignore the misconfiguration of other apps. However, this doesn't work for development where the apps are multiplexed via a single host app in funnel.devtest:AppByHostWsgi. They will again share a single configuration. Also, the app_url_for helper consults the config of unused apps, so misconfiguration is a problem there.

We can overcome this by using app-specific env prefixes. Flask defaults to FLASK_ prefix, which we can keep for common config, and then apply a second round of config using FLASK_{app_name}_ prefix. This feature needs to be exposed via Coaster's coaster.app.init_app.

jace added a commit to hasgeek/coaster that referenced this issue May 29, 2023
Requirement originally in hasgeek/funnel#1729

Also fix possibly unbound var in KeyRotationWrapper.
jace added a commit to hasgeek/coaster that referenced this issue May 29, 2023
Requirement originally in hasgeek/funnel#1729

Also fix possibly unbound var in KeyRotationWrapper.
@jace
Copy link
Member Author

jace commented May 30, 2023

Implementation in #1732.

@jace jace closed this as completed in 6c00e32 Jun 1, 2023
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

No branches or pull requests

1 participant