From db5dec4a399b96e4fba8db4f8fe573daa51bc4b3 Mon Sep 17 00:00:00 2001 From: Nordine Bittich Date: Thu, 21 Oct 2021 18:15:29 +0200 Subject: [PATCH 1/8] remove proxy for basic auth --- .gitignore | 3 ++ config/kalliope/security-dev.yml | 10 ++++ config/proxy/web.conf | 88 -------------------------------- docker-compose.dev.yml | 8 ++- docker-compose.yml | 15 ++---- 5 files changed, 19 insertions(+), 105 deletions(-) create mode 100644 config/kalliope/security-dev.yml delete mode 100644 config/proxy/web.conf diff --git a/.gitignore b/.gitignore index 2fbc202..5dc2708 100644 --- a/.gitignore +++ b/.gitignore @@ -22,3 +22,6 @@ DS_STORE /config/proxy-https/cert.pem /config/proxy-https/key.pem + +source.json +out.json \ No newline at end of file diff --git a/config/kalliope/security-dev.yml b/config/kalliope/security-dev.yml new file mode 100644 index 0000000..7eba4c8 --- /dev/null +++ b/config/kalliope/security-dev.yml @@ -0,0 +1,10 @@ +application: + security: + enabled: true + source: /config/source.json + output: /config/out.json + allowedIpAddresses: [] +#server: + #forward-headers-strategy: NATIVE + #tomcat: + # remote-ip-header: x-real-ip diff --git a/config/proxy/web.conf b/config/proxy/web.conf deleted file mode 100644 index a79cf44..0000000 --- a/config/proxy/web.conf +++ /dev/null @@ -1,88 +0,0 @@ -events { - -} - -http { - server { - listen 80 default_server; - listen [::]:80 default_server; - server_name dev.contacthub.lblod.info; - - location /v3/api-docs { - auth_basic "Contact Hub realm"; - auth_basic_user_file /etc/nginx/conf.d/nginx.htpasswd; - proxy_http_version 1.1; - proxy_set_header Upgrade $http_upgrade; - proxy_set_header Connection "upgrade"; - proxy_set_header Host $host; - proxy_set_header X-Forwarded-For $remote_addr; - proxy_pass http://identifier; - client_max_body_size 3072m; - } - - location /delta { - auth_basic "Contact Hub realm"; - auth_basic_user_file /etc/nginx/conf.d/nginx.htpasswd; - proxy_http_version 1.1; - proxy_set_header Upgrade $http_upgrade; - proxy_set_header Connection "upgrade"; - proxy_set_header Host $host; - proxy_set_header X-Forwarded-For $remote_addr; - proxy_pass http://identifier; - client_max_body_size 3072m; - } - - location /bulk { - auth_basic "Contact Hub realm"; - auth_basic_user_file /etc/nginx/conf.d/nginx.htpasswd; - proxy_http_version 1.1; - proxy_set_header Upgrade $http_upgrade; - proxy_set_header Connection "upgrade"; - proxy_set_header Host $host; - proxy_set_header X-Forwarded-For $remote_addr; - proxy_pass http://identifier; - client_max_body_size 3072m; - } - - location /changes { - auth_basic "Contact Hub realm"; - auth_basic_user_file /etc/nginx/conf.d/nginx.htpasswd; - proxy_http_version 1.1; - proxy_set_header Upgrade $http_upgrade; - proxy_set_header Connection "upgrade"; - proxy_set_header Host $host; - proxy_set_header X-Forwarded-For $remote_addr; - proxy_pass http://identifier; - client_max_body_size 3072m; - } - - location /consolidated { - auth_basic "Contact Hub realm"; - auth_basic_user_file /etc/nginx/conf.d/nginx.htpasswd; - proxy_http_version 1.1; - proxy_set_header Upgrade $http_upgrade; - proxy_set_header Connection "upgrade"; - proxy_set_header Host $host; - proxy_set_header X-Forwarded-For $remote_addr; - proxy_pass http://identifier; - client_max_body_size 3072m; - } - - - location / { - proxy_http_version 1.1; - proxy_set_header Upgrade $http_upgrade; - proxy_set_header Connection "upgrade"; - proxy_set_header Host $host; - proxy_set_header X-Forwarded-For $remote_addr; - proxy_pass http://identifier; - client_max_body_size 3072m; - } - - location ~ /authorization/callback(.*) { - rewrite ^ /torii/redirect.html permanent; - } - - } - -} \ No newline at end of file diff --git a/docker-compose.dev.yml b/docker-compose.dev.yml index 173bfbe..bb7cee8 100644 --- a/docker-compose.dev.yml +++ b/docker-compose.dev.yml @@ -18,7 +18,9 @@ services: cache: restart: "no" kalliope-api: - restart: "no" + environment: + SPRING_SECURITY_CONFIG: "/config/security-dev.yml" + restart: "no" deltanotifier: restart: "no" mocklogin: @@ -29,10 +31,6 @@ services: restart: "no" login: restart: "no" - web: - ports: - - "80:80" - restart: "no" frontend: restart: "no" uri-info: diff --git a/docker-compose.yml b/docker-compose.yml index 2476098..ba42ee8 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -17,6 +17,8 @@ services: - "logging=true" restart: always logging: *default-logging + ports: + - "80:80" dispatcher: image: semtech/mu-dispatcher:latest volumes: @@ -79,7 +81,7 @@ services: restart: always logging: *default-logging kalliope-api: - image: lblod/jsonld-delta-service:0.2.0 + image: lblod/jsonld-delta-service:latest volumes: - ./config/kalliope:/config - ./data/files:/share @@ -138,17 +140,6 @@ services: - "logging=true" restart: always logging: *default-logging - web: - image: nginx:1.21.3 - volumes: - - ./config/proxy:/etc/nginx/conf.d - - ./config/proxy/web.conf:/etc/nginx/nginx.conf:ro - links: - - identifier:identifier - labels: - - "logging=true" - restart: always - logging: *default-logging frontend: image: lblod/frontend-contact-hub:1.1.0 volumes: From 114df6679bfcc6379f6f55c4e0caa758aec14094 Mon Sep 17 00:00:00 2001 From: Nordine Bittich Date: Thu, 21 Oct 2021 18:38:50 +0200 Subject: [PATCH 2/8] port 80 mapped to dev --- docker-compose.dev.yml | 2 ++ docker-compose.yml | 2 -- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docker-compose.dev.yml b/docker-compose.dev.yml index bb7cee8..ff00bfb 100644 --- a/docker-compose.dev.yml +++ b/docker-compose.dev.yml @@ -3,6 +3,8 @@ version: '3.4' services: identifier: restart: "no" + ports: + - "80:80" dispatcher: restart: "no" triplestore: diff --git a/docker-compose.yml b/docker-compose.yml index ba42ee8..dcd6ade 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -17,8 +17,6 @@ services: - "logging=true" restart: always logging: *default-logging - ports: - - "80:80" dispatcher: image: semtech/mu-dispatcher:latest volumes: From d1227607941ed3916e2873a8378f2701515a3570 Mon Sep 17 00:00:00 2001 From: Nordine Bittich Date: Fri, 22 Oct 2021 09:55:53 +0200 Subject: [PATCH 3/8] bump kalliope & disable security on dev --- config/kalliope/security-dev.yml | 15 +++++++-------- docker-compose.yml | 2 +- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/config/kalliope/security-dev.yml b/config/kalliope/security-dev.yml index 7eba4c8..80aa4b7 100644 --- a/config/kalliope/security-dev.yml +++ b/config/kalliope/security-dev.yml @@ -1,10 +1,9 @@ +# disabled on dev application: security: - enabled: true - source: /config/source.json - output: /config/out.json - allowedIpAddresses: [] -#server: - #forward-headers-strategy: NATIVE - #tomcat: - # remote-ip-header: x-real-ip + enabled: false +spring: + autoconfigure: + exclude: + - org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration + - org.springframework.boot.actuate.autoconfigure.security.servlet.ManagementWebSecurityAutoConfiguration diff --git a/docker-compose.yml b/docker-compose.yml index dcd6ade..9857e35 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -79,7 +79,7 @@ services: restart: always logging: *default-logging kalliope-api: - image: lblod/jsonld-delta-service:latest + image: lblod/jsonld-delta-service:0.3.0 volumes: - ./config/kalliope:/config - ./data/files:/share From 765cc8d9554f00b5be8a76049075f7561699004a Mon Sep 17 00:00:00 2001 From: Nordine Bittich Date: Mon, 25 Oct 2021 14:02:06 +0200 Subject: [PATCH 4/8] bump jsonld-delta-service --- config/kalliope/bulk/.gitkeep | 0 docker-compose.yml | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) create mode 100644 config/kalliope/bulk/.gitkeep diff --git a/config/kalliope/bulk/.gitkeep b/config/kalliope/bulk/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/docker-compose.yml b/docker-compose.yml index 9857e35..526a98e 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -79,7 +79,7 @@ services: restart: always logging: *default-logging kalliope-api: - image: lblod/jsonld-delta-service:0.3.0 + image: lblod/jsonld-delta-service:0.3.1 volumes: - ./config/kalliope:/config - ./data/files:/share From f7979fca31324b008bc3b599faaaf7ede097baa1 Mon Sep 17 00:00:00 2001 From: Nordine Bittich Date: Mon, 25 Oct 2021 14:14:01 +0200 Subject: [PATCH 5/8] remove bulk endpoint --- config/dispatcher/dispatcher.ex | 4 ---- 1 file changed, 4 deletions(-) diff --git a/config/dispatcher/dispatcher.ex b/config/dispatcher/dispatcher.ex index 7544274..c0d7302 100644 --- a/config/dispatcher/dispatcher.ex +++ b/config/dispatcher/dispatcher.ex @@ -219,10 +219,6 @@ defmodule Dispatcher do forward conn, path, "http://kalliope-api/delta/" end - match "/bulk/*path", %{ layer: :api_services, accept: %{ json: true } } do - forward conn, path, "http://kalliope-api/bulk" - end - match "/changes/*path", %{ layer: :api_services, accept: %{ json: true } } do forward conn, path, "http://kalliope-api/changes/" end From 97d066b72395b2d71606729af6064b31ce095f16 Mon Sep 17 00:00:00 2001 From: Nordine Bittich Date: Mon, 25 Oct 2021 14:16:54 +0200 Subject: [PATCH 6/8] remove delta endpoint --- config/dispatcher/dispatcher.ex | 4 ---- 1 file changed, 4 deletions(-) diff --git a/config/dispatcher/dispatcher.ex b/config/dispatcher/dispatcher.ex index c0d7302..1caf3d2 100644 --- a/config/dispatcher/dispatcher.ex +++ b/config/dispatcher/dispatcher.ex @@ -215,10 +215,6 @@ defmodule Dispatcher do forward conn, path, "http://kalliope-api/v3/api-docs/" end - match "/delta/*path", %{ layer: :api_services, accept: %{ json: true } } do - forward conn, path, "http://kalliope-api/delta/" - end - match "/changes/*path", %{ layer: :api_services, accept: %{ json: true } } do forward conn, path, "http://kalliope-api/changes/" end From c7cb1b335cae5777e4808cffafc2843b5c163142 Mon Sep 17 00:00:00 2001 From: Nordine Bittich Date: Mon, 25 Oct 2021 14:32:44 +0200 Subject: [PATCH 7/8] bugfix --- docker-compose.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker-compose.yml b/docker-compose.yml index 526a98e..079fa6f 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -79,7 +79,7 @@ services: restart: always logging: *default-logging kalliope-api: - image: lblod/jsonld-delta-service:0.3.1 + image: lblod/jsonld-delta-service:0.3.2 volumes: - ./config/kalliope:/config - ./data/files:/share From 32f53c258a01e3ab3c9a09ec6f6f21658c2282f0 Mon Sep 17 00:00:00 2001 From: Nordine Bittich Date: Mon, 25 Oct 2021 14:38:22 +0200 Subject: [PATCH 8/8] ignore security.yml --- .gitignore | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 5dc2708..be3b6dc 100644 --- a/.gitignore +++ b/.gitignore @@ -24,4 +24,5 @@ DS_STORE /config/proxy-https/key.pem source.json -out.json \ No newline at end of file +out.json +security.yml \ No newline at end of file