From 2e2ca46c0d973e297b9f8ab5553702e2f9df4ada Mon Sep 17 00:00:00 2001 From: eneller Date: Thu, 28 Sep 2023 12:30:56 +0200 Subject: [PATCH] add: nextcloud --- nextcloud/disable-footer.md | 40 ++++++++++++++++++++++++++ nextcloud/docker-compose_nextcloud.yml | 21 ++++++++++++++ nextcloud/env.example | 6 ++++ nextcloud/nextcloud.conf | 38 ++++++++++++++++++++++++ nextcloud/nextcloud.cron | 2 ++ 5 files changed, 107 insertions(+) create mode 100644 nextcloud/disable-footer.md create mode 100644 nextcloud/docker-compose_nextcloud.yml create mode 100644 nextcloud/env.example create mode 100644 nextcloud/nextcloud.conf create mode 100644 nextcloud/nextcloud.cron diff --git a/nextcloud/disable-footer.md b/nextcloud/disable-footer.md new file mode 100644 index 0000000..a0c3fea --- /dev/null +++ b/nextcloud/disable-footer.md @@ -0,0 +1,40 @@ +This footer comes on public shares (share-links) and consists of + + the simple signup link that can be disabled with the config variable + + 'simpleSignUpLink.shown' => false, + + in config.php + +and + + the part that you can manipulate yourself with the theming app. + +If you want to remove the footer COMPLETELY, you must manipulate the file: + +lib/public/AppFramework/Http/Template/PublicTemplateResponse.php + +where you have to change the line 39: + + private $footerVisible = true; + +in + + private $footerVisible = false; + +You can do that with this sed command, where variable NC_DIR must be assigned to the path of your installation first: + +NC_DIR="/var/www/nextcloud" + +Completely remove footer: + +sudo sed -i 's/private \$footerVisible = true;$/private \$footerVisible = false;/1' $NC_DIR/lib/public/AppFramework/Http/Template/PublicTemplateResponse.php + +Make footer visible (default): + +sudo sed -i 's/private \$footerVisible = false;$/private \$footerVisible = true;/1' $NC_DIR/lib/public/AppFramework/Http/Template/PublicTemplateResponse.php + +You need both, to reset it to the default, when you want to run intigrety checks. After that you can switch it back. + +Hope that helps, +much luck! diff --git a/nextcloud/docker-compose_nextcloud.yml b/nextcloud/docker-compose_nextcloud.yml new file mode 100644 index 0000000..b6a4678 --- /dev/null +++ b/nextcloud/docker-compose_nextcloud.yml @@ -0,0 +1,21 @@ +services: + db: + image: mariadb:10.6 + restart: always + command: --transaction-isolation=READ-COMMITTED --binlog-format=ROW + volumes: + - ./db:/var/lib/mysql + env_file: + - env + + app: + image: nextcloud:27 + restart: always + ports: + - 50000:80 + links: + - db + volumes: + - ./nextcloud:/var/www/html + env_file: + - env diff --git a/nextcloud/env.example b/nextcloud/env.example new file mode 100644 index 0000000..0af5ab0 --- /dev/null +++ b/nextcloud/env.example @@ -0,0 +1,6 @@ +MYSQL_DATABASE=nextcloud +MYSQL_USER=nextcloud +MYSQL_HOST=db +# set these +MARIADB_ROOT_PASSWORD= +MYSQL_PASSWORD= diff --git a/nextcloud/nextcloud.conf b/nextcloud/nextcloud.conf new file mode 100644 index 0000000..9ac96c7 --- /dev/null +++ b/nextcloud/nextcloud.conf @@ -0,0 +1,38 @@ +server { + server_name cloud.example.com; + add_header Strict-Transport-Security "max-age=15552000; includeSubDomains; preload"; + location / { + + proxy_pass "http://127.0.0.1:50000/"; + proxy_set_header Host $http_host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Scheme $scheme; + proxy_set_header X-Forwarded-Proto $scheme; + + client_max_body_size 0; + + + } + + listen [::]:443 ssl ipv6only=on; # managed by Certbot + listen 443 ssl; # managed by Certbot + ssl_certificate /etc/letsencrypt/live/cloud.example.com/fullchain.pem; # managed by Certbot + ssl_certificate_key /etc/letsencrypt/live/cloud.example.com/privkey.pem; # managed by Certbot + include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot + ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot + +} +server { + if ($host = cloud.example.com) { + return 301 https://$host$request_uri; + } # managed by Certbot + + + server_name cloud.example.com; + listen [::]:80; + listen 80 ; + return 404; # managed by Certbot + + +} +~ diff --git a/nextcloud/nextcloud.cron b/nextcloud/nextcloud.cron new file mode 100644 index 0000000..dfd8433 --- /dev/null +++ b/nextcloud/nextcloud.cron @@ -0,0 +1,2 @@ +*/5 * * * * docker exec -u www-data nextcloud-app-1 php -f /var/www/html/cron.php +