diff --git a/README.md b/README.md index e13abd6e..aec9a737 100644 --- a/README.md +++ b/README.md @@ -26,7 +26,7 @@ See `.tool-versions` file for used django and node version You have to set up at least the following environment variables: ```bash -export IT_APP_ENVIRONMENT=local +export VITE_APP_ENVIRONMENT=local ``` See `.env_secrets/local_daniel.env` for more possible environment variables. diff --git a/caprover_create_app.py b/caprover_create_app.py index 2b615955..d3f2175f 100644 --- a/caprover_create_app.py +++ b/caprover_create_app.py @@ -73,7 +73,7 @@ def main(app_name, image_name, environment_file): container_http_port=7555, environment_variables={ # 'DJANGO_SETTINGS_MODULE': 'config.settings.base', - "IT_APP_ENVIRONMENT": env.str("IT_APP_ENVIRONMENT", "dev-feature"), + "VITE_APP_ENVIRONMENT": env.str("VITE_APP_ENVIRONMENT", "dev-feature"), "IT_DEFAULT_ADMIN_PASSWORD": env.str("fWwoQzreIS5uztLOyF8jJpS9M"), "POSTGRES_HOST": f"srv-captain--{app_name}-postgres", "POSTGRES_PORT": 5432, diff --git a/env/bitbucket/prepare_for_deployment.sh b/env/bitbucket/prepare_for_deployment.sh index 27d16ca5..7db1b2a3 100755 --- a/env/bitbucket/prepare_for_deployment.sh +++ b/env/bitbucket/prepare_for_deployment.sh @@ -13,7 +13,7 @@ export PATH="$PWD/vbvvenv/bin:$PATH" docker login --username=iterativ --password=$DOCKER_PASSWORD_TOKEN # only used for `python manage.py collectstatic` so value doesn't matter -export IT_APP_ENVIRONMENT=dev +export VITE_APP_ENVIRONMENT=dev pip install -r $BITBUCKET_CLONE_DIR/server/requirements/requirements-dev.txt diff --git a/env_secrets/caprover_dev.env b/env_secrets/caprover_dev.env index ce116288..15128702 100644 Binary files a/env_secrets/caprover_dev.env and b/env_secrets/caprover_dev.env differ diff --git a/env_secrets/caprover_prod.env b/env_secrets/caprover_prod.env index 8c8aca70..60c3eede 100644 Binary files a/env_secrets/caprover_prod.env and b/env_secrets/caprover_prod.env differ diff --git a/env_secrets/caprover_stage.env b/env_secrets/caprover_stage.env index 9d4e3c92..e6fbd8fd 100644 Binary files a/env_secrets/caprover_stage.env and b/env_secrets/caprover_stage.env differ diff --git a/env_secrets/local_chrigu.env b/env_secrets/local_chrigu.env index b012626b..021af725 100644 Binary files a/env_secrets/local_chrigu.env and b/env_secrets/local_chrigu.env differ diff --git a/env_secrets/local_daniel.env b/env_secrets/local_daniel.env index 9b641f2e..9bf0493d 100644 Binary files a/env_secrets/local_daniel.env and b/env_secrets/local_daniel.env differ diff --git a/env_secrets/local_elia.env b/env_secrets/local_elia.env index 920f089e..3fa0d8a9 100644 Binary files a/env_secrets/local_elia.env and b/env_secrets/local_elia.env differ diff --git a/env_secrets/local_lorenz.env b/env_secrets/local_lorenz.env index 22665c98..2dec8268 100644 Binary files a/env_secrets/local_lorenz.env and b/env_secrets/local_lorenz.env differ diff --git a/env_secrets/production.env b/env_secrets/production.env index 7169a777..4356f74c 100644 Binary files a/env_secrets/production.env and b/env_secrets/production.env differ diff --git a/env_secrets/production_azure.json b/env_secrets/production_azure.json index 64f9b95c..f7221388 100644 Binary files a/env_secrets/production_azure.json and b/env_secrets/production_azure.json differ diff --git a/example.env b/example.env index cebd3ce6..ccda9030 100644 --- a/example.env +++ b/example.env @@ -1 +1 @@ -export IT_APP_ENVIRONMENT=local +export VITE_APP_ENVIRONMENT=local diff --git a/prepare_server_cypress.sh b/prepare_server_cypress.sh index 0bc71716..68bee3e9 100755 --- a/prepare_server_cypress.sh +++ b/prepare_server_cypress.sh @@ -3,7 +3,7 @@ # set location to script directory cd "${0%/*}" -export IT_APP_ENVIRONMENT=local +export VITE_APP_ENVIRONMENT=local export DJANGO_SETTINGS_MODULE=config.settings.test_cypress export DJANGO_PORT=8001 export PGDATABASE=vbv_lernwelt_cypress diff --git a/scripts/count_queries.py b/scripts/count_queries.py index 905f001e..46318b64 100644 --- a/scripts/count_queries.py +++ b/scripts/count_queries.py @@ -7,7 +7,7 @@ import django sys.path.append("../server") -os.environ.setdefault("IT_APP_ENVIRONMENT", "local") +os.environ.setdefault("VITE_APP_ENVIRONMENT", "local") os.environ.setdefault("DJANGO_SETTINGS_MODULE", "config.settings.base") django.setup() diff --git a/server/config/settings/base.py b/server/config/settings/base.py index fb31f49a..b690a39f 100644 --- a/server/config/settings/base.py +++ b/server/config/settings/base.py @@ -15,7 +15,7 @@ env = Env() env.read_env() # set to "local" for local development -APP_ENVIRONMENT = env("IT_APP_ENVIRONMENT") +APP_ENVIRONMENT = env("VITE_APP_ENVIRONMENT") # GENERAL # ------------------------------------------------------------------------------ @@ -619,7 +619,7 @@ if FILE_UPLOAD_STORAGE == "s3": AWS_PRESIGNED_EXPIRY = env.int("AWS_PRESIGNED_EXPIRY", default=300) # seconds -if APP_ENVIRONMENT.startswith("dev"): +if APP_ENVIRONMENT == "local": # http://whitenoise.evans.io/en/latest/django.html#using-whitenoise-in-development INSTALLED_APPS = ["whitenoise.runserver_nostatic"] + INSTALLED_APPS # noqa F405 @@ -652,10 +652,8 @@ if APP_ENVIRONMENT.startswith("dev"): # ------------------------------------------------------------------------------ # https://django-extensions.readthedocs.io/en/latest/installation_instructions.html#configuration INSTALLED_APPS += ["django_extensions", "django_watchfiles"] # noqa F405 - -if APP_ENVIRONMENT in ["production", "caprover"] or APP_ENVIRONMENT.startswith( - "caprover" -): +else: + # not local # SECURITY # ------------------------------------------------------------------------------ # https://docs.djangoproject.com/en/dev/ref/settings/#secure-proxy-ssl-header diff --git a/server/config/settings/test.py b/server/config/settings/test.py index 5878c8c8..f78911c5 100644 --- a/server/config/settings/test.py +++ b/server/config/settings/test.py @@ -1,7 +1,7 @@ # pylint: disable=unused-wildcard-import,wildcard-import,wrong-import-position import os -os.environ["IT_APP_ENVIRONMENT"] = "local" +os.environ["VITE_APP_ENVIRONMENT"] = "local" from .base import * # noqa diff --git a/server/config/settings/test_cypress.py b/server/config/settings/test_cypress.py index a82cbe93..bba19d71 100644 --- a/server/config/settings/test_cypress.py +++ b/server/config/settings/test_cypress.py @@ -1,7 +1,7 @@ # pylint: disable=unused-wildcard-import,wildcard-import,wrong-import-position import os -os.environ["IT_APP_ENVIRONMENT"] = "local" +os.environ["VITE_APP_ENVIRONMENT"] = "local" from .base import * # noqa