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

log_stdout #409

Merged
merged 2 commits into from
May 21, 2024
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
6 changes: 2 additions & 4 deletions .docker/nginx.conf
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
worker_processes auto;

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

events {
Expand All @@ -26,11 +26,9 @@ http {
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';

access_log /var/log/nginx/access.log main;
access_log /dev/stdout main;

sendfile on;
#tcp_nopush on;

keepalive_timeout 65;

gzip on;
Expand Down
94 changes: 94 additions & 0 deletions .docker/templates/default.conf.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
server {
listen ${NGINX_PORT};
server_name localhost;

root ${NGINX_WEB_ROOT};

client_max_body_size ${NGINX_MAX_BODY_SIZE};

location = /favicon.ico {
log_not_found off;
access_log off;
}

location = /robots.txt {
allow all;
log_not_found off;
access_log off;
}

location ~* \.(txt|log)$ {
deny all;
}

location ~ \..*/.*\.php$ {
return 403;
}

location ~ ^/sites/.*/private/ {
return 403;
}

# Block access to scripts in site files directory
location ~ ^/sites/[^/]+/files/.*\.php$ {
deny all;
}

# Block access to "hidden" files and directories whose names begin with a
# period.
location ~ (^|/)\. {
return 403;
}

location / {
try_files $uri /index.php?$query_string;
}

location @rewrite {
rewrite ^ /index.php;
}

# Don't allow direct access to PHP files in the vendor directory.
location ~ /vendor/.*\.php$ {
deny all;
return 404;
}

# Protect files and directories from prying eyes.
location ~* \.(engine|inc|install|make|module|profile|po|sh|.*sql|.tar|.gz|.bz2|theme|twig|tpl(\.php)?|xtmpl|yml)(~|\.sw[op]|\.bak|\.orig|\.save)?$|^(\.(?!well-known).*|Entries.*|Repository|Root|Tag|Template|composer\.(json|lock)|web\.config)$|^#.*#$|\.php(~|\.sw[op]|\.bak|\.orig|\.save)$ {
deny all;
return 404;
}

location ~ '\.php$|^/update.php' {
include fastcgi_params;

fastcgi_buffers 16 32k;
fastcgi_buffer_size 64k;
fastcgi_busy_buffers_size 64k;

fastcgi_split_path_info ^(.+?\.php)(|/.*)$;

# Ensure the php file exists. Mitigates CVE-2019-11043
try_files $fastcgi_script_name =404;

fastcgi_param HTTP_PROXY "";
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param QUERY_STRING $query_string;

fastcgi_intercept_errors on;
fastcgi_pass ${NGINX_FPM_SERVICE};
}

# Enforce clean URLs
#
# Removes index.php from urls like www.example.com/index.php/my-page --> www.example.com/my-page
# Could be done with 301 for permanent or other redirect codes.
if ($request_uri ~* "^(.*/)index\.php/(.*)") {
return 307 $1$2;
}

error_log /dev/stderr;
access_log /dev/stdout main;
}
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

* [PR-409](https://github.com/itk-dev/hoeringsportal/pull/409)
Enabled and configured log_stdout

## [4.4.0] - 2024-05-14

* [PR-407](https://github.com/itk-dev/hoeringsportal/pull/407)
Expand Down
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@
"drupal/image_widget_crop": "^2.2",
"drupal/inline_entity_form": "^3.0",
"drupal/jquery_ui_accordion": "^2.0",
"drupal/log_stdout": "^1.5",
"drupal/maxlength": "^2.1",
"drupal/openid_connect": "^3.0@alpha",
"drupal/paragraphs": "^1.3",
Expand Down
60 changes: 59 additions & 1 deletion composer.lock

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

1 change: 1 addition & 0 deletions config/sync/core.extension.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ module:
layout_discovery: 0
link: 0
locale: 0
log_stdout: 0
maxlength: 0
media: 0
menu_ui: 0
Expand Down
5 changes: 5 additions & 0 deletions config/sync/log_stdout.settings.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
_core:
default_config_hash: CkmpJe8_0UrxS99diNYffcf6SJcbRtIxgQTeCOxeOhQ
format: '[@severity] [@type] [@date] @message | uid: @uid | request-uri: @request_uri | refer: @referer | ip: @ip | link: @link'
use_stderr: '1'
langcode: da
4 changes: 1 addition & 3 deletions docker-compose.dev.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
# itk-version: 3.1.0
version: "3"

# itk-version: 3.2.1
services:
phpfpm:
environment:
Expand Down
4 changes: 1 addition & 3 deletions docker-compose.redirect.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
# itk-version: 3.1.0
version: "3"

# itk-version: 3.2.1
services:
nginx:
labels:
Expand Down
15 changes: 8 additions & 7 deletions docker-compose.server.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
# itk-version: 3.1.1
version: "3"

# itk-version: 3.2.1
networks:
frontend:
external: true
Expand Down Expand Up @@ -33,12 +31,15 @@ services:
- frontend
depends_on:
- phpfpm
ports:
- '8080'
volumes:
- ./.docker/vhost.conf:/etc/nginx/conf.d/default.conf:ro
- ./.docker/templates:/etc/nginx/templates:ro
- ./.docker/nginx.conf:/etc/nginx/nginx.conf:ro
- ./:/app:rw
- .:/app
environment:
NGINX_FPM_SERVICE: ${COMPOSE_PROJECT_NAME}-phpfpm-1:9000
NGINX_WEB_ROOT: /app/web
NGINX_PORT: 8080
NGINX_MAX_BODY_SIZE: 5M
labels:
- "traefik.enable=true"
- "traefik.docker.network=frontend"
Expand Down
13 changes: 8 additions & 5 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
# itk-version: 3.1.1
version: "3"

# itk-version: 3.2.1
networks:
frontend:
external: true
Expand Down Expand Up @@ -35,7 +33,7 @@ services:
- PHP_XDEBUG_MODE=${PHP_XDEBUG_MODE:-off}
- PHP_MAX_EXECUTION_TIME=30
- PHP_MEMORY_LIMIT=256M
# Depending on the setup you may have to remove --read-envelope-from from msmtp (cf. https://marlam.de/msmtp/msmtp.html) or use SMTP to send mail
# Depending on the setup, you may have to remove --read-envelope-from from msmtp (cf. https://marlam.de/msmtp/msmtp.html) or use SMTP to send mail
- PHP_SENDMAIL_PATH=/usr/bin/msmtp --host=mail --port=1025 --read-recipients --read-envelope-from
- DOCKER_HOST_DOMAIN=${COMPOSE_DOMAIN}
- COMPOSER_VERSION=2
Expand All @@ -56,8 +54,13 @@ services:
ports:
- '8080'
volumes:
- ./.docker/vhost.conf:/etc/nginx/conf.d/default.conf:ro
- ./.docker/templates:/etc/nginx/templates:ro
- .:/app
environment:
NGINX_FPM_SERVICE: ${COMPOSE_PROJECT_NAME}-phpfpm-1:9000
NGINX_WEB_ROOT: /app/web
NGINX_PORT: 8080
NGINX_MAX_BODY_SIZE: 5M
labels:
- "traefik.enable=true"
- "traefik.docker.network=frontend"
Expand Down
Loading