OpenConext / OpenConext-BaseContainers

Docker base images used by all OpenConext projects that use docker containers
Apache License 2.0
0 stars 1 forks source link

Add the CSP headers if they are set as an env variable at startup #15

Closed danakim closed 12 months ago

danakim commented 12 months ago

@quartje - I have tested this with the following command:

docker run -p 8080:80 -e HTTPD_CSP="default-src; object-src 'none'; script-src 'self' 'unsafe-inline'; style-src 'self' 'unsafe-inline'; font-src 'self'; connect-src 'self'; img-src 'self' data:; form-action 'self'; base-uri 'none'" apache2:test and it works, it adds the line to the config.

I think this is similar to what Ansible will add.

danakim commented 12 months ago

@quartje - please test :)

danakim commented 12 months ago

@quartje - took the opportunity in this PR and I also fixed the logging, to make sure the logs go to stdout. The issue was that even if I configured the default log destination to be stdout and stderr, In the virtual host config the destination was still the log file. I had to overwrite the default vhost config as well to make sure we log to stdout. Please test this as well.