From 3bcf3816891be1d3ae4488b032ee39b0ce64332d Mon Sep 17 00:00:00 2001 From: Christian Risi <75698846+CnF-Gris@users.noreply.github.com> Date: Fri, 13 Dec 2024 16:04:45 +0100 Subject: [PATCH] V0.6.0 Arroyo Toad --- .devcontainer/DOCKERFILES/deno.dockerfile | 7 ++++ .devcontainer/IoT-Simulator/devcontainer.json | 11 ++++++ .../Leader-Service/devcontainer.json | 11 ++++++ .../Nginx-Mediator/devcontainer.json | 24 ------------- .../PublicKey-Backend/devcontainer.json | 35 +++++++++++++++++++ .gitmodules | 3 ++ IoT-Simulator | 2 +- PublicKey-Backend | 1 + docker-compose.yaml | 25 ++++++------- nginx/proxy.conf | 33 ----------------- 10 files changed, 79 insertions(+), 73 deletions(-) create mode 100644 .devcontainer/DOCKERFILES/deno.dockerfile delete mode 100644 .devcontainer/Nginx-Mediator/devcontainer.json create mode 100644 .devcontainer/PublicKey-Backend/devcontainer.json create mode 160000 PublicKey-Backend delete mode 100644 nginx/proxy.conf diff --git a/.devcontainer/DOCKERFILES/deno.dockerfile b/.devcontainer/DOCKERFILES/deno.dockerfile new file mode 100644 index 0000000..8f6ab94 --- /dev/null +++ b/.devcontainer/DOCKERFILES/deno.dockerfile @@ -0,0 +1,7 @@ +FROM denoland/deno +RUN apt update -y && \ +apt install \ +git \ +sqlite3 \ +npm \ +-y \ No newline at end of file diff --git a/.devcontainer/IoT-Simulator/devcontainer.json b/.devcontainer/IoT-Simulator/devcontainer.json index 31366ce..943ba12 100644 --- a/.devcontainer/IoT-Simulator/devcontainer.json +++ b/.devcontainer/IoT-Simulator/devcontainer.json @@ -7,6 +7,17 @@ // Compose-File "dockerComposeFile": ["../../docker-compose.yaml"], + + // Customization + "customizations": { + "vscode": { + "extensions": [ + "sswg.swift-lang", + "fabiospampinato.vscode-highlight", + "fabiospampinato.vscode-todo-plus" + ] + } + }, // The WorkspaceFolder inside container "workspaceFolder": "/workspace/IoT-Simulator", diff --git a/.devcontainer/Leader-Service/devcontainer.json b/.devcontainer/Leader-Service/devcontainer.json index c26151b..d3769b6 100644 --- a/.devcontainer/Leader-Service/devcontainer.json +++ b/.devcontainer/Leader-Service/devcontainer.json @@ -7,6 +7,17 @@ // Compose-File "dockerComposeFile": ["../../docker-compose.yaml"], + + // Customization + "customizations": { + "vscode": { + "extensions": [ + "denoland.vscode-deno", + "fabiospampinato.vscode-highlight", + "fabiospampinato.vscode-todo-plus" + ] + } + }, // The WorkspaceFolder inside container "workspaceFolder": "/workspace/Leader-Service", diff --git a/.devcontainer/Nginx-Mediator/devcontainer.json b/.devcontainer/Nginx-Mediator/devcontainer.json deleted file mode 100644 index d84c48d..0000000 --- a/.devcontainer/Nginx-Mediator/devcontainer.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - // Displayed name - "name": "nginx-mediator", - - // Service name from compose file - "service": "nginx-mediator", - - // Compose-File - "dockerComposeFile": ["../../docker-compose.yaml"], - - // The WorkspaceFolder inside container - "workspaceFolder": "/workspace/nginx", - - // Env in container - "containerEnv": { - - } - - - - - - -} \ No newline at end of file diff --git a/.devcontainer/PublicKey-Backend/devcontainer.json b/.devcontainer/PublicKey-Backend/devcontainer.json new file mode 100644 index 0000000..1100c17 --- /dev/null +++ b/.devcontainer/PublicKey-Backend/devcontainer.json @@ -0,0 +1,35 @@ +{ + // Displayed name + "name": "PublicKey-Backend", + + // Service name from compose file + "service": "publickey-backend", + + // Compose-File + "dockerComposeFile": ["../../docker-compose.yaml"], + + // Customization + "customizations": { + "vscode": { + "extensions": [ + "denoland.vscode-deno", + "fabiospampinato.vscode-highlight", + "fabiospampinato.vscode-todo-plus" + ] + } + }, + + // The WorkspaceFolder inside container + "workspaceFolder": "/workspace/PublicKey-Backend", + + // Env in container + "containerEnv": { + + } + + + + + + +} \ No newline at end of file diff --git a/.gitmodules b/.gitmodules index 4b1a52d..a98801a 100644 --- a/.gitmodules +++ b/.gitmodules @@ -7,3 +7,6 @@ [submodule "CA-Provisioners"] path = CA-Provisioners url = https://repositories.communitynotfound.work/PoliBa-Software-Architecture/CA-Provisioners.git +[submodule "PublicKey-Backend"] + path = PublicKey-Backend + url = https://repositories.communitynotfound.work/PoliBa-Software-Architecture/PublicKey-Backend.git diff --git a/IoT-Simulator b/IoT-Simulator index c2539d2..5d78c9b 160000 --- a/IoT-Simulator +++ b/IoT-Simulator @@ -1 +1 @@ -Subproject commit c2539d22500f0c0c43d7627cb3495f05add4b78d +Subproject commit 5d78c9be5855d5541dd07b24d8331c018ddd2c70 diff --git a/PublicKey-Backend b/PublicKey-Backend new file mode 160000 index 0000000..62bb31c --- /dev/null +++ b/PublicKey-Backend @@ -0,0 +1 @@ +Subproject commit 62bb31c69cb2898febc331fd4bae72c988eca478 diff --git a/docker-compose.yaml b/docker-compose.yaml index 63e56a4..8bc23a4 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -1,15 +1,6 @@ name: "IoT-Gatherer-Project" services: - root-ca: - image: "swift:latest" - volumes: - - .:/workspace - hostname: root-ca.internal - networks: - iot-network: - command: sleep infinity - iot-simulator: image: "swift:latest" volumes: @@ -20,23 +11,27 @@ services: command: sleep infinity leader-service: - image: denoland/deno + build: + context: . + dockerfile: .devcontainer/DOCKERFILES/deno.dockerfile volumes: - .:/workspace hostname: leader-service.internal networks: iot-network: command: sleep infinity - - nginx-mediator: - image: "nginx:latest" + + publickey-backend: + build: + context: . + dockerfile: .devcontainer/DOCKERFILES/deno.dockerfile volumes: - .:/workspace - - ./nginx/proxy.conf:/etc/nginx/nginx.conf - hostname: nginx-mediator.internal + hostname: public-key-db.internal networks: iot-network: command: sleep infinity + networks: iot-network: diff --git a/nginx/proxy.conf b/nginx/proxy.conf deleted file mode 100644 index 3e3ea0c..0000000 --- a/nginx/proxy.conf +++ /dev/null @@ -1,33 +0,0 @@ -http { - - # Leader-Service-Proxy - server { - # TODO: Change IP to a well defined one - listen *:80; # This is for testing purposes ONLY, to be changed to 443 - server_name "nginx-mediator.internal"; - - location / { - - proxy_pass "http://leader-service.internal"; - proxy_pass_request_headers on; - proxy_pass_request_body on; - - proxy_set_header X-Forwarded-For $sent_http_x_iot_ip; # X-IoT-IP - } - } - - # IoT-Simulator Proxy - server { - listen *:80; # This is for testing purposes ONLY, to be changed to 443 - - location / { - - proxy_pass "http://iot-simulator.internal"; - proxy_pass_request_headers on; - proxy_pass_request_body on; - - proxy_set_header X-Forwarded-Host $sent_http_x_iot_ip; # Set forwarded host to keep the original IP request - - } - } -} \ No newline at end of file