Skip to content

Commit

Permalink
Merge pull request #880 from City-of-Helsinki/update-configuration
Browse files Browse the repository at this point in the history
Automatic update
  • Loading branch information
rpnykanen authored May 22, 2024
2 parents fd2110b + 56384a5 commit a40b090
Show file tree
Hide file tree
Showing 12 changed files with 185 additions and 24 deletions.
22 changes: 22 additions & 0 deletions compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,28 @@ services:
- "traefik.http.routers.${COMPOSE_PROJECT_NAME}-varnish.tls=true"
- "traefik.http.services.${COMPOSE_PROJECT_NAME}-varnish.loadbalancer.server.port=6081"
- "traefik.docker.network=stonehenge-network"
elastic-proxy:
container_name: "${COMPOSE_PROJECT_NAME}-elastic-proxy"
image: nginxinc/nginx-unprivileged:alpine-perl
environment:
ELASTICSEARCH_URL: "http://elastic:9200"
volumes:
- ./docker/elastic-proxy/nginx.conf:/etc/nginx/nginx.conf
- ./docker/elastic-proxy/elastic.conf:/etc/nginx/templates/default.conf.template
networks:
- stonehenge-network
- internal
labels:
- "traefik.enable=true"
- "traefik.http.routers.nginx.entrypoints=https"
- "traefik.http.routers.nginx.rule=Host(`elastic-proxy-${DRUPAL_HOSTNAME}`)"
- "traefik.http.services.nginx.loadbalancer.server.port=8080"
- "traefik.http.routers.nginx.tls=true"
- "traefik.docker.network=stonehenge-network"
depends_on:
- elastic
profiles:
- search
elastic:
image: docker.elastic.co/elasticsearch/elasticsearch:8.4.0
container_name: "${COMPOSE_PROJECT_NAME}-elastic"
Expand Down
44 changes: 22 additions & 22 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 22 additions & 0 deletions conf/cmi/block.block.claro_help.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
uuid: 9e41f91f-a982-4241-b53a-0abcf167e3a0
langcode: en
status: true
dependencies:
module:
- help
theme:
- claro
_core:
default_config_hash: jccFSSVqV0WCDb6NtML1VWAWTtDbZ-zn5YgTRMgMrIM
id: claro_help
theme: claro
region: help
weight: 0
provider: null
plugin: help_block
settings:
id: help_block
label: Help
label_display: '0'
provider: help
visibility: { }
22 changes: 22 additions & 0 deletions conf/cmi/block.block.gin_help.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
uuid: 9601d935-8693-48ac-b5e4-98f18812b255
langcode: en
status: true
dependencies:
module:
- help
theme:
- gin
_core:
default_config_hash: 8nOAry2oKqJOr0zbrlJ3sZHDFJLIO6j-0vT0K_TYca4
id: gin_help
theme: gin
region: help
weight: 0
provider: null
plugin: help_block
settings:
id: help_block
label: Help
label_display: '0'
provider: help
visibility: { }
1 change: 1 addition & 0 deletions conf/cmi/core.extension.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ module:
helfi_tpr_config: 0
helfi_tunnistamo: 0
helfi_user_roles: 0
help: 0
image: 0
image_style_quality: 0
imagecache_external: 0
Expand Down
2 changes: 2 additions & 0 deletions conf/cmi/language/fi/block.block.claro_help.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
settings:
label: Ohje
2 changes: 2 additions & 0 deletions conf/cmi/language/fi/block.block.gin_help.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
settings:
label: Ohje
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
label: 'Uutisten kaupunginosat'
label_plural: 'Uutisten kaupunginosat'
label: 'Uutisten tagit'
label_plural: 'Uutisten tagit'
2 changes: 2 additions & 0 deletions conf/cmi/language/sv/block.block.claro_help.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
settings:
label: Hjälp
2 changes: 2 additions & 0 deletions conf/cmi/language/sv/block.block.gin_help.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
settings:
label: Hjälp
26 changes: 26 additions & 0 deletions docker/elastic-proxy/elastic.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
server {
listen 8080 default_server;
server_name _;
client_max_body_size 50m;

location /ping {
add_header Content-Type application/json;
return 200 '{"status":"success","result":"Proxy alive"}';
}

location ~ ^/([a-z][a-z_-]*)/(_search|_msearch)$ {
limit_except GET POST {
deny all;
}
proxy_pass ${ELASTICSEARCH_URL};
proxy_redirect off;
proxy_set_header Authorization $elastic_authorization;
proxy_pass_header Authorization;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_pass_header Access-Control-Allow-Origin;
proxy_pass_header Access-Control-Allow-Methods;
proxy_hide_header Access-Control-Allow-Headers;
}
}
60 changes: 60 additions & 0 deletions docker/elastic-proxy/nginx.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
worker_processes auto;

error_log /var/log/nginx/error.log notice;
pid /tmp/nginx.pid;

env ELASTICSEARCH_URL;
env ELASTIC_PASSWORD;
env ELASTIC_USER;

load_module modules/ngx_http_perl_module.so;

events {
worker_connections 1024;
}

http {
proxy_temp_path /tmp/proxy_temp;
client_body_temp_path /tmp/client_temp;
fastcgi_temp_path /tmp/fastcgi_temp;
uwsgi_temp_path /tmp/uwsgi_temp;
scgi_temp_path /tmp/scgi_temp;

include /etc/nginx/mime.types;
default_type application/octet-stream;
perl_set $elastic_authorization '
sub {
use MIME::Base64;
if (exists($ENV{"ELASTIC_USER"}) && exists($ENV{"ELASTIC_PASSWORD"})) {
return encode_base64($ENV{"ELASTIC_USER"} . ":" . $ENV{"ELASTIC_PASSWORD"});
}
return "";
}
';

# Log in JSON Format
log_format nginxlog_json escape=json '{ "timestamp": "$time_iso8601", '
'"remote_addr": "$remote_addr", '
'"body_bytes_sent": $body_bytes_sent, '
'"request_time": $request_time, '
'"response_status": $status, '
'"request": "$request", '
'"request_method": "$request_method", '
'"host": "$host",'
'"upstream_addr": "$upstream_addr",'
'"http_x_forwarded_for": "$http_x_forwarded_for",'
'"http_referrer": "$http_referer", '
'"http_user_agent": "$http_user_agent", '
'"http_version": "$server_protocol", '
'"nginx_access": true }';
access_log /dev/stdout nginxlog_json;

sendfile on;
#tcp_nopush on;

keepalive_timeout 65;

#gzip on;

include /etc/nginx/conf.d/*.conf;
}

0 comments on commit a40b090

Please sign in to comment.