diff --git a/README.md b/README.md index 2f07684..9aeff8e 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ Before launch the mock the first time, the following steps need to be completed: This is needed to access apps using Traefik virtual hosts. Add the following to your hosts file: ```ini -127.0.0.1 backend.localhost functions-admin.localhost functions-app.localhost functions-public.localhost functions-services.localhost +127.0.0.1 backend.localhost functions-admin.localhost functions-app.localhost functions-cgn.localhost functions-public.localhost functions-services.localhost pn-mock.localhost functions-app-messages.localhost functions-bonus.localhost functions-pushnotif.localhost functions-eucovidcerts.localhost spid-testenv2 ``` ### Setup environment values @@ -84,7 +84,7 @@ In order to do that, add a `docker-compose.override.yml` file in the root dir of with the following content: ```yaml -version: "3.2" +version: "3.8" services: functions-admin: @@ -143,7 +143,7 @@ Ensure that the VSCode debugger port (`5861` in the example above) match the one ## Run tests A set of Postman tests can be found in `postman-test-collections`. -To run them, just run the mock enviroment and then call +To run them, just run the mock environment and then call ``` bash yarn test @@ -153,3 +153,6 @@ yarn test Create a new postman collection within `postman-test-collections` folder and add a new `"test:___` script in `package.json` +### Notes + +On io-mock the difference from the standard backend and the internal one is absent, so the env variable `IS_APPBACKENDLI` is enabled by default to let `/notify` and `/lock` endpoints enabled. diff --git a/cosmosdb/Dockerfile b/cosmosdb/Dockerfile index aff7094..3324b72 100644 --- a/cosmosdb/Dockerfile +++ b/cosmosdb/Dockerfile @@ -2,6 +2,6 @@ FROM node:12-alpine WORKDIR /opt/cosmosdb -RUN npm install -g @zeit/cosmosdb-server@0.7.0 ts-node +RUN npm install -g @zeit/cosmosdb-server@0.13.4 ts-node CMD ["sh", "-c", "cosmosdb-server -p 3000"] diff --git a/docker-compose.yml b/docker-compose.yml index a86ee29..5e5c545 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -120,6 +120,8 @@ services: # apply middleware to route - "traefik.http.routers.functions-admin.middlewares=testHeader,fn-admin-stripprefix" + extra_hosts: + - host.docker.internal:host-gateway functions-app: image: io-functions-app @@ -148,6 +150,8 @@ services: - "traefik.http.routers.functions-app.tls=true" # apply middleware to route - "traefik.http.routers.functions-app.middlewares=fn-app-stripprefix" + extra_hosts: + - host.docker.internal:host-gateway functions-app-messages: image: io-functions-app-messages @@ -175,6 +179,8 @@ services: - "traefik.http.routers.functions-app-messages.tls=true" # apply middleware to route - "traefik.http.routers.functions-app-messages.middlewares=fn-app-messages-stripprefix" + extra_hosts: + - host.docker.internal:host-gateway functions-public: image: io-functions-public @@ -225,6 +231,9 @@ services: # apply middleware to route - "traefik.http.routers.functions-services.middlewares=testHeader,fn-services-stripprefix,htransform" + extra_hosts: + - host.docker.internal:host-gateway + functions-bonus: image: io-functions-bonus diff --git a/env.io-backend b/env.io-backend index 638dbed..2b0d91e 100644 --- a/env.io-backend +++ b/env.io-backend @@ -98,7 +98,7 @@ APP_MESSAGES_API_URL=http://functions-app-messages:7071/api/v1 FF_MESSAGES_TYPE="prod" FF_MESSAGES_BETA_TESTER_LIST="" -FF_MESSAGES_CANARY_USERS_REGEX= "^([(0-9)|(a-f)|(A-F)]{63}0)|([(0-9)|(a-f)|(A-F)]{62}[(0-7)]{1}1)$" +FF_MESSAGES_CANARY_USERS_REGEX= "^([(0-9)|(a-f)|(A-F)]{63}0)|([(0-9)|(a-f)|(A-F)]{62}[(0-7)]{1}1)\$" # ------------------------------------ @@ -121,7 +121,8 @@ THIRD_PARTY_CONFIG_LIST="" # ------------------------------------ # APPBACKENDLI # ------------------------------------ -IS_APPBACKENDLI=false +# Enables /notify and /lock endpoints +IS_APPBACKENDLI=true # ------------------------------------ # PN VARIABLES diff --git a/env.io-fixtures b/env.io-fixtures index 5e1cdc3..638c586 100644 --- a/env.io-fixtures +++ b/env.io-fixtures @@ -6,3 +6,4 @@ COSMOSDB_URI=${COSMOSDB_URI} COSMOSDB_KEY=${COSMOSDB_KEY} COSMOSDB_NAME=${COSMOSDB_NAME} NODE_TLS_REJECT_UNAUTHORIZED=0 +AUTHORIZED_RECIPIENTS=AAABBB01C02D345Z,EEEFFF01C02H345Z,CCCCCC00C00C000C diff --git a/env.io-functions-admin b/env.io-functions-admin index a1bba87..b724337 100644 --- a/env.io-functions-admin +++ b/env.io-functions-admin @@ -35,7 +35,7 @@ USER_DATA_CONTAINER_NAME=user-data-download USER_DATA_BACKUP_CONTAINER_NAME=user-data-backup USER_DATA_DELETE_DELAY_DAYS=0 PUBLIC_API_URL=http://host.docker.internal:${API_GATEWAY_PORT}/functions-services -PUBLIC_API_KEY=api_key +PUBLIC_API_KEY=base SESSION_API_URL=https://host.docker.internal:8000 SESSION_API_KEY=12345 @@ -48,6 +48,7 @@ SLOT_TASK_HUBNAME=IoFunctionAdmin COSMOSDB_URI=${COSMOSDB_URI} COSMOSDB_KEY=${COSMOSDB_KEY} COSMOSDB_NAME=${COSMOSDB_NAME} +COSMOSDB_CONNECTION_STRING=AccountEndpoint=${COSMOSDB_URI};AccountKey=${COSMOSDB_KEY}; FailedUserDataProcessingStorageConnection=${STORAGE_CONNECTION_STRING} FAILED_USER_DATA_PROCESSING_TABLE=FailedUserDataProcessing diff --git a/env.io-functions-app-messages b/env.io-functions-app-messages index 43aa954..be6b013 100644 --- a/env.io-functions-app-messages +++ b/env.io-functions-app-messages @@ -31,3 +31,5 @@ AZURE_ENABLE_STRICT_SSL=false MAILHOG_HOSTNAME=mailhog REQ_SERVICE_ID=req_id_dev + +PN_SERVICE_ID=aPNServiceId diff --git a/env.io-functions-services b/env.io-functions-services index f72b9ee..cc4cf55 100644 --- a/env.io-functions-services +++ b/env.io-functions-services @@ -12,12 +12,6 @@ INTERNAL_STORAGE_CONNECTION_STRING=${STORAGE_CONNECTION_STRING} SUBSCRIPTION_FEED_STORAGE_CONNECTION_STRING=${STORAGE_CONNECTION_STRING} MESSAGE_CONTENT_STORAGE_CONNECTION_STRING=${STORAGE_CONNECTION_STRING} -MESSAGE_CREATED_QUEUE_NAME=message-created -MESSAGE_PROCESSED_QUEUE_NAME=message-processed -NOTIFICATION_CREATED_EMAIL_QUEUE_NAME=notification-created-email -NOTIFICATION_CREATED_WEBHOOK_QUEUE_NAME=notification-created-webhook -PROCESSING_MESSAGE_CONTAINER_NAME=blobprocessingmessage - MESSAGE_CONTAINER_NAME=message-content WEBHOOK_CHANNEL_URL=https://host.docker.internal:8000/api/v1/notify?token=12345 @@ -38,7 +32,7 @@ SUBSCRIPTION_FEED_STORAGE_CONNECTION_STRING=${STORAGE_CONNECTION_STRING} INTERNAL_STORAGE_CONNECTION_STRING=${STORAGE_CONNECTION_STRING} MESSAGE_CONTENT_STORAGE_CONNECTION_STRING=${STORAGE_CONNECTION_STRING} MESSAGE_CREATED_QUEUE_NAME=message-created -MESSAGE_PROCESSED_QUEUE_NAME=message-created +MESSAGE_PROCESSED_QUEUE_NAME=message-processed NOTIFICATION_CREATED_EMAIL_QUEUE_NAME=notification-created-email NOTIFICATION_CREATED_WEBHOOK_QUEUE_NAME=notification-created-webhook PROCESSING_MESSAGE_CONTAINER_NAME=processing-message