From 7e31b5957edbea824894734d4b1471635f379735 Mon Sep 17 00:00:00 2001 From: Moriz Wahl Date: Thu, 30 Jun 2022 16:43:07 +0200 Subject: [PATCH 1/7] explain how .env files are working --- README.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/README.md b/README.md index 289a39109..b98d0f741 100644 --- a/README.md +++ b/README.md @@ -121,6 +121,19 @@ After generating a new version you should commit the changes. This will be the C Note: The Changelog will be regenerated with all tags on release on the external builder tool, but will not be checked in there. The Changelog on the github release will therefore always be correct, on the repo it might be incorrect due to missing tags when executing the `yarn release` command. +## How the different .env work on deploy + +Each component (frontend, admin, backend and database) has its own `.env` file. When running in development you usually do not have to care about the `.env`. The defaults are set by the respetive config file, found in the `src/config/` folder of each component. But if you have a local `.env`, the defaults set in the config are overwritten by the `.env`. + +Each component has a `.env.dist` file. This file contains all environment variables used by the component. If you want to use a local `.env`, copy the `.env.dist` and adjust the variables accordingly. + +Each component has a `.env.template` file. These files are very important on deploy. + +There is one `.env.dist` in the `deployment/bare_metal/` folder. This `.env` contains all variables used by the components. On deploy, we set all variables in this file. The deploy script loads this variables and provides them by the `.env.templates` of each component, creating a `.env` for each component. + +To avoid forgetting to update the global `.env` when deploying, we have a environment version variable inside the codebase of each component. You should update this version, when environment variables must be changed or added on deploy. The code checks, that the environement version provided by the `.env` is the one expected by the codebase. + + ## Troubleshooting | Problem | Issue | Solution | Description | From be7a40be18fe497d7bdf02b6265930ab87c00dc3 Mon Sep 17 00:00:00 2001 From: Moriz Wahl Date: Tue, 5 Jul 2022 11:57:08 +0200 Subject: [PATCH 2/7] fix typo --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index b98d0f741..75a9e7e55 100644 --- a/README.md +++ b/README.md @@ -123,7 +123,7 @@ Note: The Changelog will be regenerated with all tags on release on the external ## How the different .env work on deploy -Each component (frontend, admin, backend and database) has its own `.env` file. When running in development you usually do not have to care about the `.env`. The defaults are set by the respetive config file, found in the `src/config/` folder of each component. But if you have a local `.env`, the defaults set in the config are overwritten by the `.env`. +Each component (frontend, admin, backend and database) has its own `.env` file. When running in development you usually do not have to care about the `.env`. The defaults are set by the respective config file, found in the `src/config/` folder of each component. But if you have a local `.env`, the defaults set in the config are overwritten by the `.env`. Each component has a `.env.dist` file. This file contains all environment variables used by the component. If you want to use a local `.env`, copy the `.env.dist` and adjust the variables accordingly. From 067e7c3ef7540e473bfa8f656803c6aa3234d900 Mon Sep 17 00:00:00 2001 From: Moriz Wahl Date: Wed, 6 Jul 2022 10:56:02 +0200 Subject: [PATCH 3/7] improve documentation --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 75a9e7e55..a707639ac 100644 --- a/README.md +++ b/README.md @@ -125,13 +125,13 @@ Note: The Changelog will be regenerated with all tags on release on the external Each component (frontend, admin, backend and database) has its own `.env` file. When running in development you usually do not have to care about the `.env`. The defaults are set by the respective config file, found in the `src/config/` folder of each component. But if you have a local `.env`, the defaults set in the config are overwritten by the `.env`. -Each component has a `.env.dist` file. This file contains all environment variables used by the component. If you want to use a local `.env`, copy the `.env.dist` and adjust the variables accordingly. +Each component has a `.env.dist` file. This file contains all environment variables used by the component and can be used as pattern. If you want to use a local `.env`, copy the `.env.dist` and adjust the variables accordingly. Each component has a `.env.template` file. These files are very important on deploy. -There is one `.env.dist` in the `deployment/bare_metal/` folder. This `.env` contains all variables used by the components. On deploy, we set all variables in this file. The deploy script loads this variables and provides them by the `.env.templates` of each component, creating a `.env` for each component. +There is one `.env.dist` in the `deployment/bare_metal/` folder. This `.env.dist` contains all variables used by the components, e.g. unites all `.env.dist` from the components. On deploy, we copy this `.env.dist` to `.env` and set all variables in this new file. The deploy script loads this variables and provides them by the `.env.templates` of each component, creating a `.env` for each component (see in `deployment/bare_metal/start.sh` the `envsubst`). -To avoid forgetting to update the global `.env` when deploying, we have a environment version variable inside the codebase of each component. You should update this version, when environment variables must be changed or added on deploy. The code checks, that the environement version provided by the `.env` is the one expected by the codebase. +To avoid forgetting to update an existing `.env` in the `deployment/bare_metal/` folder when deploying, we have a environment version variable inside the codebase of each component. You should update this version, when environment variables must be changed or added on deploy. The code checks, that the environement version provided by the `.env` is the one expected by the codebase. ## Troubleshooting From 1543c568aecce88311f3066a9d4f025d3b5f3e04 Mon Sep 17 00:00:00 2001 From: Moriz Wahl Date: Thu, 7 Jul 2022 13:47:14 +0200 Subject: [PATCH 4/7] Update README.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Wolfgang Huß --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index a707639ac..d12edfb89 100644 --- a/README.md +++ b/README.md @@ -129,7 +129,7 @@ Each component has a `.env.dist` file. This file contains all environment variab Each component has a `.env.template` file. These files are very important on deploy. -There is one `.env.dist` in the `deployment/bare_metal/` folder. This `.env.dist` contains all variables used by the components, e.g. unites all `.env.dist` from the components. On deploy, we copy this `.env.dist` to `.env` and set all variables in this new file. The deploy script loads this variables and provides them by the `.env.templates` of each component, creating a `.env` for each component (see in `deployment/bare_metal/start.sh` the `envsubst`). +There is one `.env.dist` in the `deployment/bare_metal/` folder. This `.env.dist` contains all variables used by the components, e.g. unites all `.env.dist` from the components. On deploy, we copy this `.env.dist` to `.env` and set all variables in this new file. The deploy script loads this variables and provides them by the `.env.templates` of each component, creating an `.env` for each component (see in `deployment/bare_metal/start.sh` the `envsubst`). To avoid forgetting to update an existing `.env` in the `deployment/bare_metal/` folder when deploying, we have a environment version variable inside the codebase of each component. You should update this version, when environment variables must be changed or added on deploy. The code checks, that the environement version provided by the `.env` is the one expected by the codebase. From 9840017f0cd0048ad0bd561ecbb6cc56876632cc Mon Sep 17 00:00:00 2001 From: Moriz Wahl Date: Thu, 7 Jul 2022 13:47:24 +0200 Subject: [PATCH 5/7] Update README.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Wolfgang Huß --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index d12edfb89..145ce4141 100644 --- a/README.md +++ b/README.md @@ -131,7 +131,7 @@ Each component has a `.env.template` file. These files are very important on dep There is one `.env.dist` in the `deployment/bare_metal/` folder. This `.env.dist` contains all variables used by the components, e.g. unites all `.env.dist` from the components. On deploy, we copy this `.env.dist` to `.env` and set all variables in this new file. The deploy script loads this variables and provides them by the `.env.templates` of each component, creating an `.env` for each component (see in `deployment/bare_metal/start.sh` the `envsubst`). -To avoid forgetting to update an existing `.env` in the `deployment/bare_metal/` folder when deploying, we have a environment version variable inside the codebase of each component. You should update this version, when environment variables must be changed or added on deploy. The code checks, that the environement version provided by the `.env` is the one expected by the codebase. +To avoid forgetting to update an existing `.env` in the `deployment/bare_metal/` folder when deploying, we have an environment version variable inside the codebase of each component. You should update this version, when environment variables must be changed or added on deploy. The code checks, that the environement version provided by the `.env` is the one expected by the codebase. ## Troubleshooting From 1691167582e94a8ee7b77269d9867713ebd4636f Mon Sep 17 00:00:00 2001 From: Moriz Wahl Date: Mon, 18 Jul 2022 23:47:24 +0200 Subject: [PATCH 6/7] explain nginx ports with docker --- README.md | 2 +- frontend/.env.old | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) create mode 100644 frontend/.env.old diff --git a/README.md b/README.md index 145ce4141..3d086018e 100644 --- a/README.md +++ b/README.md @@ -123,7 +123,7 @@ Note: The Changelog will be regenerated with all tags on release on the external ## How the different .env work on deploy -Each component (frontend, admin, backend and database) has its own `.env` file. When running in development you usually do not have to care about the `.env`. The defaults are set by the respective config file, found in the `src/config/` folder of each component. But if you have a local `.env`, the defaults set in the config are overwritten by the `.env`. +Each component (frontend, admin, backend and database) has its own `.env` file. When running in development with docker and nginx you usually do not have to care about the `.env`. The defaults are set by the respective config file, found in the `src/config/` folder of each component. But if you have a local `.env`, the defaults set in the config are overwritten by the `.env`. If you do not use docker, you need the `.env` in the frontend and admin interface because nginx is not running in order to find the backend. Each component has a `.env.dist` file. This file contains all environment variables used by the component and can be used as pattern. If you want to use a local `.env`, copy the `.env.dist` and adjust the variables accordingly. diff --git a/frontend/.env.old b/frontend/.env.old new file mode 100644 index 000000000..a22b31307 --- /dev/null +++ b/frontend/.env.old @@ -0,0 +1,4 @@ +LOGIN_API_URL=http://localhost/login_api/ +COMMUNITY_API_URL=http://localhost/api/ +ALLOW_REGISTER=true +GRAPHQL_URI=http://localhost:4000/graphql From b31309f7ef76fb87e4b0ca7d75351d30b73b35ea Mon Sep 17 00:00:00 2001 From: Moriz Wahl Date: Tue, 19 Jul 2022 00:22:47 +0200 Subject: [PATCH 7/7] remove file artifact --- frontend/.env.old | 4 ---- 1 file changed, 4 deletions(-) delete mode 100644 frontend/.env.old diff --git a/frontend/.env.old b/frontend/.env.old deleted file mode 100644 index a22b31307..000000000 --- a/frontend/.env.old +++ /dev/null @@ -1,4 +0,0 @@ -LOGIN_API_URL=http://localhost/login_api/ -COMMUNITY_API_URL=http://localhost/api/ -ALLOW_REGISTER=true -GRAPHQL_URI=http://localhost:4000/graphql