From db5dec4a399b96e4fba8db4f8fe573daa51bc4b3 Mon Sep 17 00:00:00 2001 From: Nordine Bittich Date: Thu, 21 Oct 2021 18:15:29 +0200 Subject: [PATCH] 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: