From 656c53f44cee859de5870b2f3b988fdc6d96cb0b Mon Sep 17 00:00:00 2001 From: "Mahadik, Mukul Chandrakant" Date: Mon, 9 Sep 2024 17:13:53 -0700 Subject: [PATCH 1/3] Created environment variables documentation --- docs/dev/back/config_environment_variables.md | 53 +++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 docs/dev/back/config_environment_variables.md diff --git a/docs/dev/back/config_environment_variables.md b/docs/dev/back/config_environment_variables.md new file mode 100644 index 0000000..8459b9c --- /dev/null +++ b/docs/dev/back/config_environment_variables.md @@ -0,0 +1,53 @@ +# Configuring Environment Variables + +## 1. List of Environment Variables + +#### DB, WEBSERVER, PUSH Config +Use this [search](https://github.com/search?q=repo%3Ae-mission%2Fe-mission-server%20config.get&type=code) to obtain usage of `DB, WEBSERVER, PUSH` environment variables. + +#### AWS Cognito Credentials +Use this [search](https://github.com/search?q=repo%3Ae-mission%2Fop-admin-dashboard+%2F.getenv%5C%28%5C%22%5BA-Z%5D%2F&type=code) to obtain usage of COGNITO variables in admin-dashboard repository. + + +#### Overpass, Nominatim + +Use this [search](https://github.com/search?q=repo%3Ae-mission%2Fe-mission-server+%2F.environ.get%5C%28%5C%22%5BA-Z%5D%2F&type=code) to obtain usage of `Overpass, Nominatim, Geofabrik` environment variables. + + +These variables are set using GitHub secrets in the e-mission-server repository: GEOFABRIK_API, GEOFABRIK_OVERPASS_KEY. + + +## 2. Table of Environment Variables +The table lists the environment variables to be added to the deployments of the respective repositories. + +Environment variables with a 'Default Value' already have a value set in a Dockerfile, a docker-compose.yml file, a GitHub workflow file, or directly in the code. + + +| S. No. | Reposistory | Environment Variable | Default Value | Source | +| ------------- | ------------- | ------------- | ------------- | ------------- | +| 1. | e-mission-server, op-admin-dashboard, em-public-dashboard | DB_HOST | db | conf/storage/db.conf | +| 2. | e-mission-server, op-admin-dashboard, em-public-dashboard | DB_RESULT_LIMIT | --- | conf/storage/db.conf | +| 3. | e-mission-server, op-admin-dashboard, em-public-dashboard | WEB_SERVER_HOST | 0.0.0.0 | conf/net/api/webserver.conf | +| 4. | e-mission-server, op-admin-dashboard, em-public-dashboard | WEBSERVER_PORT | --- | conf/net/api/webserver.conf | +| 5. | e-mission-server, op-admin-dashboard, em-public-dashboard | WEBSERVER_TIMEOUT | --- | conf/net/api/webserver.conf | +| 6. | e-mission-server, op-admin-dashboard, em-public-dashboard | WEBSERVER_NOT_FOUND_REDIRECT | --- | conf/net/api/webserver.conf | +| 7. | e-mission-server, op-admin-dashboard, em-public-dashboard | WEBSERVER_AUTH | --- | conf/net/api/webserver.conf | +| 8. | e-mission-server, op-admin-dashboard, em-public-dashboard | WEBSERVER_AGGREGATE_CALL_AUTH | --- | conf/net/api/webserver.conf | +| 9. | e-mission-server, op-admin-dashboard | PUSH_PROVIDER | --- | conf/net/ext_service/push.json | +| 10. | e-mission-server, op-admin-dashboard | PUSH_SERVER_AUTH_TOKEN | --- | conf/net/ext_service/push.json | +| 11. | e-mission-server, op-admin-dashboard | PUSH_APP_PACKAGE_NAME | --- | conf/net/ext_service/push.json | +| 12. | e-mission-server, op-admin-dashboard | PUSH_IOS_TOKEN_FORMAT | --- | conf/net/ext_service/push.json | +| 13. | op-admin-dashboard | COGNITO_CLIENT_ID | --- | AWS Cognito | +| 14. | op-admin-dashboard | COGNITO_CLIENT_SECRET | --- | AWS Cognito | +| 15. | op-admin-dashboard | COGNITO_REDIRECT_URL | --- | AWS Cognito | +| 16. | op-admin-dashboard | COGNITO_TOKEN_ENDPOINT | --- | AWS Cognito | +| 17. | op-admin-dashboard | COGNITO_USER_POOL_ID | --- | AWS Cognito | +| 18. | op-admin-dashboard | COGNITO_REGION | --- | AWS Cognito | +| 19. | op-admin-dashboard | COGNITO_AUTH_URL | --- | AWS Cognito | +| 20. | e-mission-server | GFBK_KEY | --- | .github/workflows/nominatim-docker-test.yml | +| 21. | e-mission-server | GEOFABRIK_OVERPASS_KEY | --- | .github/workflows/test-overpass.yml | +| 22. | e-mission-server | NOMINATIM_QUERY_URL | --- | emission/individual_tests/TestNominatim.py | +| 23. | e-mission-server | OPENSTREETMAP_QUERY_URL | https://nominatim.openstreetmap.org | emission/integrationTests/docker-compose.yml | +| 24. | e-mission-server | GEOFABRIK_QUERY_URL | https://geocoding.geofabrik.de/$GFBK_KEY | emission/integrationTests/docker-compose.yml | +| 25. | e-mission-server | NOMINATIM_CONTAINER_URL | http://rhodeisland-nominatim:8080 | emission/integrationTests/docker-compose.yml | + From 93d21c0957ebe9292d2a12d97270966d36ea9bb1 Mon Sep 17 00:00:00 2001 From: "Mahadik, Mukul Chandrakant" Date: Tue, 10 Sep 2024 10:13:49 -0700 Subject: [PATCH 2/3] Removed table + Listed variable names under respective sections --- docs/dev/back/config_environment_variables.md | 56 +++++-------------- 1 file changed, 15 insertions(+), 41 deletions(-) diff --git a/docs/dev/back/config_environment_variables.md b/docs/dev/back/config_environment_variables.md index 8459b9c..76b5018 100644 --- a/docs/dev/back/config_environment_variables.md +++ b/docs/dev/back/config_environment_variables.md @@ -2,52 +2,26 @@ ## 1. List of Environment Variables -#### DB, WEBSERVER, PUSH Config +### DB, WEBSERVER, PUSH Config Use this [search](https://github.com/search?q=repo%3Ae-mission%2Fe-mission-server%20config.get&type=code) to obtain usage of `DB, WEBSERVER, PUSH` environment variables. -#### AWS Cognito Credentials -Use this [search](https://github.com/search?q=repo%3Ae-mission%2Fop-admin-dashboard+%2F.getenv%5C%28%5C%22%5BA-Z%5D%2F&type=code) to obtain usage of COGNITO variables in admin-dashboard repository. +#### Environment variables: +DB config:
DB_HOST, DB_RESULT_LIMIT

+WEBSERVER config:
WEB_SERVER_HOST, WEBSERVER_PORT, WEBSERVER_TIMEOUT, WEBSERVER_NOT_FOUND_REDIRECT, WEBSERVER_AUTH, WEBSERVER_AGGREGATE_CALL_AUTH

+PUSH config:
PUSH_PROVIDER, PUSH_SERVER_AUTH_TOKEN, PUSH_APP_PACKAGE_NAME, PUSH_IOS_TOKEN_FORMAT

+### AWS Cognito Credentials -#### Overpass, Nominatim +#### Environment variables: +COGNITO_CLIENT_ID, COGNITO_CLIENT_SECRET, COGNITO_REDIRECT_URL, COGNITO_TOKEN_ENDPOINT, COGNITO_USER_POOL_ID, COGNITO_REGION, COGNITO_AUTH_URL -Use this [search](https://github.com/search?q=repo%3Ae-mission%2Fe-mission-server+%2F.environ.get%5C%28%5C%22%5BA-Z%5D%2F&type=code) to obtain usage of `Overpass, Nominatim, Geofabrik` environment variables. +Use this [search](https://github.com/search?q=repo%3Ae-mission%2Fop-admin-dashboard+%2F.getenv%5C%28%5C%22%5BA-Z%5D%2F&type=code) to obtain usage of COGNITO variables in admin-dashboard repository. +### Overpass, Nominatim -These variables are set using GitHub secrets in the e-mission-server repository: GEOFABRIK_API, GEOFABRIK_OVERPASS_KEY. - - -## 2. Table of Environment Variables -The table lists the environment variables to be added to the deployments of the respective repositories. - -Environment variables with a 'Default Value' already have a value set in a Dockerfile, a docker-compose.yml file, a GitHub workflow file, or directly in the code. - - -| S. No. | Reposistory | Environment Variable | Default Value | Source | -| ------------- | ------------- | ------------- | ------------- | ------------- | -| 1. | e-mission-server, op-admin-dashboard, em-public-dashboard | DB_HOST | db | conf/storage/db.conf | -| 2. | e-mission-server, op-admin-dashboard, em-public-dashboard | DB_RESULT_LIMIT | --- | conf/storage/db.conf | -| 3. | e-mission-server, op-admin-dashboard, em-public-dashboard | WEB_SERVER_HOST | 0.0.0.0 | conf/net/api/webserver.conf | -| 4. | e-mission-server, op-admin-dashboard, em-public-dashboard | WEBSERVER_PORT | --- | conf/net/api/webserver.conf | -| 5. | e-mission-server, op-admin-dashboard, em-public-dashboard | WEBSERVER_TIMEOUT | --- | conf/net/api/webserver.conf | -| 6. | e-mission-server, op-admin-dashboard, em-public-dashboard | WEBSERVER_NOT_FOUND_REDIRECT | --- | conf/net/api/webserver.conf | -| 7. | e-mission-server, op-admin-dashboard, em-public-dashboard | WEBSERVER_AUTH | --- | conf/net/api/webserver.conf | -| 8. | e-mission-server, op-admin-dashboard, em-public-dashboard | WEBSERVER_AGGREGATE_CALL_AUTH | --- | conf/net/api/webserver.conf | -| 9. | e-mission-server, op-admin-dashboard | PUSH_PROVIDER | --- | conf/net/ext_service/push.json | -| 10. | e-mission-server, op-admin-dashboard | PUSH_SERVER_AUTH_TOKEN | --- | conf/net/ext_service/push.json | -| 11. | e-mission-server, op-admin-dashboard | PUSH_APP_PACKAGE_NAME | --- | conf/net/ext_service/push.json | -| 12. | e-mission-server, op-admin-dashboard | PUSH_IOS_TOKEN_FORMAT | --- | conf/net/ext_service/push.json | -| 13. | op-admin-dashboard | COGNITO_CLIENT_ID | --- | AWS Cognito | -| 14. | op-admin-dashboard | COGNITO_CLIENT_SECRET | --- | AWS Cognito | -| 15. | op-admin-dashboard | COGNITO_REDIRECT_URL | --- | AWS Cognito | -| 16. | op-admin-dashboard | COGNITO_TOKEN_ENDPOINT | --- | AWS Cognito | -| 17. | op-admin-dashboard | COGNITO_USER_POOL_ID | --- | AWS Cognito | -| 18. | op-admin-dashboard | COGNITO_REGION | --- | AWS Cognito | -| 19. | op-admin-dashboard | COGNITO_AUTH_URL | --- | AWS Cognito | -| 20. | e-mission-server | GFBK_KEY | --- | .github/workflows/nominatim-docker-test.yml | -| 21. | e-mission-server | GEOFABRIK_OVERPASS_KEY | --- | .github/workflows/test-overpass.yml | -| 22. | e-mission-server | NOMINATIM_QUERY_URL | --- | emission/individual_tests/TestNominatim.py | -| 23. | e-mission-server | OPENSTREETMAP_QUERY_URL | https://nominatim.openstreetmap.org | emission/integrationTests/docker-compose.yml | -| 24. | e-mission-server | GEOFABRIK_QUERY_URL | https://geocoding.geofabrik.de/$GFBK_KEY | emission/integrationTests/docker-compose.yml | -| 25. | e-mission-server | NOMINATIM_CONTAINER_URL | http://rhodeisland-nominatim:8080 | emission/integrationTests/docker-compose.yml | +#### Environment variables: +GFBK_KEY, GEOFABRIK_OVERPASS_KEY, NOMINATIM_QUERY_URL, OPENSTREETMAP_QUERY_URL, GEOFABRIK_QUERY_URL, NOMINATIM_CONTAINER_URL + +Use this [search](https://github.com/search?q=repo%3Ae-mission%2Fe-mission-server+%2F.environ.get%5C%28%5C%22%5BA-Z%5D%2F&type=code) to obtain usage of `Overpass, Nominatim, Geofabrik` environment variables. +This [search](https://github.com/search?q=repo%3Ae-mission%2Fe-mission-server+geofabrik&type=code) shows that some variables are set using GitHub secrets in the e-mission-server GitHub workflows: GEOFABRIK_API, GEOFABRIK_OVERPASS_KEY. From 3388eeddd0c5c990a98f7c5e0c0024d5cec97f97 Mon Sep 17 00:00:00 2001 From: "Mahadik, Mukul Chandrakant" Date: Thu, 12 Sep 2024 14:50:30 -0700 Subject: [PATCH 3/3] Removed individually listed environment variables If included, then it won't be up-to-date if we update / remove variables and will need to update this everytime. Hence removing the specific names of environment variables. --- docs/dev/back/config_environment_variables.md | 28 ++++++------------- 1 file changed, 8 insertions(+), 20 deletions(-) diff --git a/docs/dev/back/config_environment_variables.md b/docs/dev/back/config_environment_variables.md index 76b5018..141cd2e 100644 --- a/docs/dev/back/config_environment_variables.md +++ b/docs/dev/back/config_environment_variables.md @@ -1,27 +1,15 @@ # Configuring Environment Variables -## 1. List of Environment Variables +The search results below identify some environment variables that need to be manually configured. -### DB, WEBSERVER, PUSH Config -Use this [search](https://github.com/search?q=repo%3Ae-mission%2Fe-mission-server%20config.get&type=code) to obtain usage of `DB, WEBSERVER, PUSH` environment variables. +#### DB, Webserver, Push Config +- Use this [search](https://github.com/search?q=repo%3Ae-mission%2Fe-mission-server+%2Fconfig.get%5C%28%5C%22%5BA-Z%5D%2F&type=code) to obtain usage of `DB, WEBSERVER, PUSH` environment variables in the [e-mission-server](https://github.com/e-mission/e-mission-server) repository. -#### Environment variables: -DB config:
DB_HOST, DB_RESULT_LIMIT

-WEBSERVER config:
WEB_SERVER_HOST, WEBSERVER_PORT, WEBSERVER_TIMEOUT, WEBSERVER_NOT_FOUND_REDIRECT, WEBSERVER_AUTH, WEBSERVER_AGGREGATE_CALL_AUTH

-PUSH config:
PUSH_PROVIDER, PUSH_SERVER_AUTH_TOKEN, PUSH_APP_PACKAGE_NAME, PUSH_IOS_TOKEN_FORMAT

+#### AWS Cognito Credentials -### AWS Cognito Credentials +- Use this [search](https://github.com/search?q=repo%3Ae-mission%2Fop-admin-dashboard+%2F.getenv%5C%28%5C%22%5BA-Z%5D%2F&type=code) to obtain usage of `COGNITO` variables in the [admin-dashboard](https://github.com/e-mission/op-admin-dashboard) repository. -#### Environment variables: -COGNITO_CLIENT_ID, COGNITO_CLIENT_SECRET, COGNITO_REDIRECT_URL, COGNITO_TOKEN_ENDPOINT, COGNITO_USER_POOL_ID, COGNITO_REGION, COGNITO_AUTH_URL +#### Overpass, Nominatim, Geofabrik -Use this [search](https://github.com/search?q=repo%3Ae-mission%2Fop-admin-dashboard+%2F.getenv%5C%28%5C%22%5BA-Z%5D%2F&type=code) to obtain usage of COGNITO variables in admin-dashboard repository. - -### Overpass, Nominatim - -#### Environment variables: -GFBK_KEY, GEOFABRIK_OVERPASS_KEY, NOMINATIM_QUERY_URL, OPENSTREETMAP_QUERY_URL, GEOFABRIK_QUERY_URL, NOMINATIM_CONTAINER_URL - -Use this [search](https://github.com/search?q=repo%3Ae-mission%2Fe-mission-server+%2F.environ.get%5C%28%5C%22%5BA-Z%5D%2F&type=code) to obtain usage of `Overpass, Nominatim, Geofabrik` environment variables. - -This [search](https://github.com/search?q=repo%3Ae-mission%2Fe-mission-server+geofabrik&type=code) shows that some variables are set using GitHub secrets in the e-mission-server GitHub workflows: GEOFABRIK_API, GEOFABRIK_OVERPASS_KEY. +- Use this [search](https://github.com/search?q=repo%3Ae-mission%2Fe-mission-server+%2F.environ.get%5C%28%5C%22%5BA-Z%5D%2F&type=code) to obtain usage of `Overpass, Nominatim, Geofabrik` environment variables in the [e-mission-server](https://github.com/e-mission/e-mission-server) repository. +- Use this [search](https://github.com/search?q=repo%3Ae-mission%2Fe-mission-server+geofabrik&type=code) to view some variables that are set using GitHub secrets in the [e-mission-server](https://github.com/e-mission/e-mission-server) GitHub workflows. \ No newline at end of file