Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[#IOCIT-104] working environment for profile data DOWNLOAD/DELETE #61

Merged
merged 2 commits into from
Aug 22, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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
Expand All @@ -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.
2 changes: 1 addition & 1 deletion cosmosdb/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
9 changes: 9 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
5 changes: 3 additions & 2 deletions env.io-backend
Original file line number Diff line number Diff line change
Expand Up @@ -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)\$"
Copy link
Contributor Author

@arcogabbo arcogabbo Aug 19, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The error here was Invalid template: "^([(0-9)|(a-f)|(A-F)]{63}0)|([(0-9)|(a-f)|(A-F)]{62}[(0-7)]{1}1)$" from docker-compose.
This could be related



# ------------------------------------
Expand All @@ -121,7 +121,8 @@ THIRD_PARTY_CONFIG_LIST=""
# ------------------------------------
# APPBACKENDLI
# ------------------------------------
IS_APPBACKENDLI=false
# Enables /notify and /lock endpoints
IS_APPBACKENDLI=true
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interesting. This was the reason because the /notify endpoint and /lock session endpoints returns 404. Documentation over this variable is not sufficient in here and into io-backend. We should remember to update the README in io-backend to explicit more this functionality behavior.
cc. @gquadrati


# ------------------------------------
# PN VARIABLES
Expand Down
1 change: 1 addition & 0 deletions env.io-fixtures
Original file line number Diff line number Diff line change
Expand Up @@ -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
3 changes: 2 additions & 1 deletion env.io-functions-admin
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
2 changes: 2 additions & 0 deletions env.io-functions-app-messages
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,5 @@ AZURE_ENABLE_STRICT_SSL=false
MAILHOG_HOSTNAME=mailhog

REQ_SERVICE_ID=req_id_dev

PN_SERVICE_ID=aPNServiceId
8 changes: 1 addition & 7 deletions env.io-functions-services
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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
Expand Down