diff --git a/api/.gitignore b/api/.gitignore index c4b3735..0baee91 100644 --- a/api/.gitignore +++ b/api/.gitignore @@ -43,3 +43,5 @@ local/ # both, because then developers will only update one of them and they'll # contradict. For now, npm shall be the canonical default (compare README.md). yarn.lock + +config.overrides.py diff --git a/api/obs/api/app.py b/api/obs/api/app.py index 68f35ac..e491799 100644 --- a/api/obs/api/app.py +++ b/api/obs/api/app.py @@ -31,6 +31,10 @@ app = Sanic("OpenBikeSensor Portal API", load_env="OBS_", log_config={}) if isfile("./config.py"): app.update_config("./config.py") +# For developers to override the config without committing it +if isfile("./config.overrides.py"): + app.update_config("./config.overrides.py") + c = app.config api = Blueprint("api", url_prefix="/api") diff --git a/docker-compose.yaml b/docker-compose.yaml index 084e940..9bff49e 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -28,6 +28,7 @@ services: - ./api/scripts/obs:/opt/obs/scripts/obs - ./api/tools:/opt/obs/api/tools - ./api/config.dev.py:/opt/obs/api/config.py + - ./api/config.overrides.py:/opt/obs/api/config.overrides.py - ./frontend/build:/opt/obs/frontend/build - ./tile-generator:/opt/obs/tile-generator - ./local/api-data:/data @@ -51,6 +52,7 @@ services: - ./api/scripts/obs:/opt/obs/scripts/obs - ./api/tools:/opt/obs/api/tools - ./api/config.dev.py:/opt/obs/api/config.py + - ./api/config.overrides.py:/opt/obs/api/config.overrides.py - ./local/api-data:/data depends_on: - postgres