Compare commits

..

6 Commits

Author SHA1 Message Date
e996b5c057 chore: publish 2.1.4+24.0.6-fpm release 2022-10-13 17:12:29 +02:00
0aabef8f7b let app container wait for db init 2022-10-13 16:58:10 +02:00
2be42d0a84 fix frame ancestors 2022-10-11 16:12:04 +02:00
e76454c4fd .env.sample template domain 2022-09-13 16:37:55 +02:00
ec39fd5fed chore: publish 2.1.3+24.0.5-fpm release 2022-09-13 15:44:24 +02:00
16ad6c22ea add headers to embed nextcloud in frame on external site (#28)
This introduces new env variables to configure nextloud to be embedded via
iframe on an external site.
Setting X_FRAME_OPTIONS_ENABLED=1 will configure nginx and nextcloud to
set X-Frame-Options and CSP headers to allow the domain configured in
X_FRAME_OPTIONS_ALLOW_FROM.

I created a PR because I'm not sure if this is helpful for other people or just a custom hack that bloats the recipe :D

Co-authored-by: Philipp Rothmann <philipprothmann@posteo.de>
Reviewed-on: coop-cloud/nextcloud#28
2022-09-02 14:32:04 +00:00
6 changed files with 11 additions and 10 deletions

View File

@ -1,6 +1,6 @@
TYPE=nextcloud
DOMAIN=nextcloud.example.com
DOMAIN={{ .Domain }}
## Domain aliases
#EXTRA_DOMAINS=', `www.nextcloud.example.com`'
LETS_ENCRYPT_ENV=production

View File

@ -1,7 +1,7 @@
export FPM_TUNE_VERSION=v4
export NGINX_CONF_VERSION=v3
export NGINX_CONF_VERSION=v4
export MY_CNF_VERSION=v4
export ENTRYPOINT_VERSION=v1
export ENTRYPOINT_VERSION=v2
NC_APP_DIR="app:/var/www/html"

View File

@ -2,7 +2,6 @@ version: '3.8'
services:
app:
entrypoint: "sh -c 'sleep 10 && /entrypoint.sh php-fpm'" # tries to mitigate this error with postgres https://github.com/nextcloud/docker/issues/1204
environment:
- POSTGRES_HOST=db
- POSTGRES_DB=nextcloud

View File

@ -35,7 +35,7 @@ services:
- "traefik.http.middlewares.${STACK_NAME}-redirect.headers.SSLHost=${DOMAIN}"
app:
image: nextcloud:24.0.3-fpm
image: nextcloud:24.0.6-fpm
depends_on:
- db
configs:
@ -77,12 +77,12 @@ services:
failure_action: rollback
order: start-first
labels:
- "coop-cloud.${STACK_NAME}.version=2.1.2+24.0.3-fpm"
- "coop-cloud.${STACK_NAME}.version=2.1.4+24.0.6-fpm"
- "backupbot.backup=true"
- "backupbot.backup.path=/var/www/html/config/,/var/www/html/data/,/var/www/html/custom_apps/"
cron:
image: nextcloud:24.0.3-fpm
image: nextcloud:24.0.6-fpm
volumes:
- nextcloud:/var/www/html/
- nextapps:/var/www/html/custom_apps:cached
@ -94,7 +94,7 @@ services:
entrypoint: /cron.sh
cache:
image: redis:7.0.4-alpine
image: redis:7.0.5-alpine
networks:
- internal
volumes:

View File

@ -1,5 +1,8 @@
#!/bin/bash
echo "Giving the db container some time to come up"; sleep 20
# see this issue with postgres db https://github.com/nextcloud/docker/issues/1204
{{ if eq (env "X_FRAME_OPTIONS_ENABLED") "1" }}
if ! [[ $(grep {{ env "X_FRAME_OPTIONS_ALLOW_FROM" }} lib/public/AppFramework/Http/ContentSecurityPolicy.php) ]]; then
sed -i "91 a\\\t\t'{{ env "X_FRAME_OPTIONS_ALLOW_FROM" }}', " lib/public/AppFramework/Http/ContentSecurityPolicy.php

View File

@ -67,8 +67,7 @@ http {
add_header X-XSS-Protection "1; mode=block" always;
{{ if eq (env "X_FRAME_OPTIONS_ENABLED") "1" }}
add_header X-Frame-Options "{{ env "X_FRAME_OPTIONS_ALLOW_FROM" }}" always;
add_header Content-Security-Policy "frame-ancestors {{ env "X_FRAME_OPTIONS_ALLOW_FROM" }}";
add_header Content-Security-Policy "frame-ancestors {{ env "X_FRAME_OPTIONS_ALLOW_FROM" }} {{ env "DOMAIN" }}";
{{ else }}
add_header X-Frame-Options "SAMEORIGIN" always;
{{ end }}