Compare commits

..

15 Commits

Author SHA1 Message Date
javielico
8b138eac19
Reverting back gitignore 2022-11-13 00:51:03 +00:00
javielico
819378f3fb
Changes to cron version image 2022-11-12 12:53:29 +00:00
javielico
8dcc2925ea
Version numbers back up 2022-11-11 22:04:50 +00:00
javielico
2ec6f21dd1
Up version on Nginx and Nextcloud to stable 2022-11-11 17:26:15 +00:00
javielico
9a070231c7
Adding some more variables on ignore 2022-11-11 17:18:42 +00:00
63ce9a6fb9 Merge pull request 'Automatically install apps specified via env variable.' (#29) from auto_app_install into main
Reviewed-on: coop-cloud/nextcloud#29
2022-11-09 09:48:22 +00:00
827cb16964 abra.sh post-deployment command to install apps 2022-11-08 16:39:32 +01:00
992992d678 Revert "Automatically install apps specified via env variable." for entrypoint.sh.tmpl
This reverts commit 20f0a45baf110a6b5575b2403f6c8cd5dab714c8 for entrypoint.sh.tmpl
2022-11-08 15:41:37 +01:00
20f0a45baf Automatically install apps specified via env variable. 2022-11-08 12:31:24 +01:00
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
8 changed files with 32 additions and 16 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
@ -19,3 +19,5 @@ EXTRA_VOLUME=/dev/null:/tmp/.dummy
# X_FRAME_OPTIONS_ENABLED=1
# X_FRAME_OPTIONS_ALLOW_FROM=embedding-site.example.org
# APPS="calendar sociallogin onlyoffice"

1
.gitignore vendored
View File

@ -1 +1,2 @@
/.envrc

View File

@ -1,5 +0,0 @@
{
"shellcheck.customArgs": [
"--shell=bash"
]
}

20
abra.sh
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"
@ -13,6 +13,22 @@ sub_occ(){
sub_app_run php /var/www/html/occ "$@"
}
run_occ(){
su -p www-data -s /bin/sh -c "/var/www/html/occ $@"
}
install_apps(){
install_apps="$@"
if [ -z "$install_apps" ]
then
install_apps=$APPS
fi
for app in $install_apps
do
run_occ "app:install $app"
done
}
_backup_app() {
# Copied _abra_backup_dir to make UX better on restore and backup
{

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

@ -1,7 +1,7 @@
version: "3.8"
services:
web:
image: nginx:1.23.1
image: nginx:1.22.1
configs:
- source: nginx_conf
target: /etc/nginx/nginx.conf
@ -35,7 +35,7 @@ services:
- "traefik.http.middlewares.${STACK_NAME}-redirect.headers.SSLHost=${DOMAIN}"
app:
image: nextcloud:24.0.3-fpm
image: nextcloud:25.0.1-fpm
depends_on:
- db
configs:
@ -49,6 +49,7 @@ services:
- db_password
- admin_password
environment:
- APPS
- X_FRAME_OPTIONS_ALLOW_FROM
- X_FRAME_OPTIONS_ENABLED
- DOMAIN
@ -77,12 +78,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.6+25.0.1-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:25.0.1-fpm
volumes:
- nextcloud:/var/www/html/
- nextapps:/var/www/html/custom_apps:cached
@ -94,7 +95,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 }}