diff --git a/docker-compose.yml b/docker-compose.yml index 991efa4..b47f2c9 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -6,7 +6,7 @@ services: container_name: nextcloud-full image: nextcloud:16.0.6 build: ./docker/.examples/dockerfiles/full/apache/ - restart: always + restart: unless-stopped networks: - reverse-proxy - mysqlnet @@ -15,7 +15,8 @@ services: - "80/tcp" volumes: - nextcloud:/var/www/html:Z - - ./www-data:/var/spool/cron/crontabs/www-data + - ./supervisord.conf:/etc/supervisor/supervisord.conf + - ./run_elasticsearch.sh:/run_elasticsearch.sh networks: diff --git a/mimetypemapping.json b/mimetypemapping.json new file mode 100644 index 0000000..15d4cdb --- /dev/null +++ b/mimetypemapping.json @@ -0,0 +1,7 @@ +{ + "_comment" : "Array mapping file extensions to mimetypes (in alphabetical order)", + "_comment2": "The first index in the mime type array is the assumed correct mimetype", + "_comment3": "and the second (if present) is a secure alternative", + + "kdbx": ["application/x-keepass2"] +} diff --git a/objectstore.config.php b/objectstore.config.php new file mode 100644 index 0000000..48c8f20 --- /dev/null +++ b/objectstore.config.php @@ -0,0 +1,19 @@ + array( + 'class' => '\\OC\\Files\\ObjectStore\\Swift', + 'arguments' => array( + 'username' => 'FIXME', + 'password' => 'FIXME', + // the container to store the data in + 'bucket' => 'Nextcloud_Files', + 'autocreate' => false, + 'region' => 'GRA7', + // The Identity / Keystone endpoint + 'url' => 'https://auth.cloud.ovh.net/v2.0', + // optional on some swift implementations + 'tenantName' => 'FIXME', + 'serviceName' => 'swift', + ), + ), +); diff --git a/reverse-proxy-cloud.conf b/reverse-proxy-cloud.conf new file mode 100644 index 0000000..4634ee4 --- /dev/null +++ b/reverse-proxy-cloud.conf @@ -0,0 +1,8 @@ + + ServerName cloud.scimetis.net + ServerAdmin postmaster@scimetis.net + ProxyPreserveHost on + ProxyPass / http://nextcloud/ + ProxyPassReverse / http://nextcloud/ + ProxyRequests Off + diff --git a/reverse-proxy.config.php b/reverse-proxy.config.php new file mode 100644 index 0000000..1932b90 --- /dev/null +++ b/reverse-proxy.config.php @@ -0,0 +1,4 @@ + 'https', +); diff --git a/run_elasticsearch.sh b/run_elasticsearch.sh new file mode 100755 index 0000000..4d5fb0c --- /dev/null +++ b/run_elasticsearch.sh @@ -0,0 +1,11 @@ +#!/bin/bash + +pgrep -af fulltextsearch | grep -qv grep || { su -c "php /var/www/html/occ fulltextsearch:index -q" -s "/bin/bash" www-data; } +pgrep -af fulltextsearch | grep -qv grep || nohup su -c "php /var/www/html/occ fulltextsearch:live -q" -s "/bin/bash" www-data &>/dev/null & + +trap "{ echo EXITING; pkill -f -SIGTERM 'fulltextsearch'; }" SIGKILL SIGTERM + +while pgrep -af fulltextsearch | grep -qv grep: +do + sleep 1 # This script is not really doing anything. +done diff --git a/stop.sh b/stop.sh new file mode 100755 index 0000000..ff09c5c --- /dev/null +++ b/stop.sh @@ -0,0 +1,22 @@ +#!/bin/bash + +sudo docker-compose kill -s SIGTERM +COUNT=1 +ATTEMPT=0 + +while [ $COUNT -ne 0 ] && [ $ATTEMPT -lt 10 ] +do + sleep 1 + COUNT=$(sudo docker-compose top | wc -l) + ATTEMPT=$(( $ATTEMPT + 1 )) +done + +if [ $COUNT -eq 0 ] +then + sudo docker-compose down + exit 0 +else + echo "ERROR: Some containers are still running" + sudo docker-compose ps + exit 1 +fi diff --git a/supervisord.conf b/supervisord.conf new file mode 100644 index 0000000..6ed8b9f --- /dev/null +++ b/supervisord.conf @@ -0,0 +1,29 @@ +[supervisord] +nodaemon=true +logfile=/var/log/supervisord/supervisord.log +pidfile=/var/run/supervisord/supervisord.pid +childlogdir=/var/log/supervisord/ +logfile_maxbytes=50MB ; maximum size of logfile before rotation +logfile_backups=10 ; number of backed up logfiles +loglevel=error + +[program:apache2] +stdout_logfile=/dev/stdout +stdout_logfile_maxbytes=0 +stderr_logfile=/dev/stderr +stderr_logfile_maxbytes=0 +command=apache2-foreground + +[program:cron] +stdout_logfile=/dev/stdout +stdout_logfile_maxbytes=0 +stderr_logfile=/dev/stderr +stderr_logfile_maxbytes=0 +command=/cron.sh + +[program:run_elasticsearch] +stdout_logfile=/dev/stdout +stdout_logfile_maxbytes=0 +stderr_logfile=/dev/stderr +stderr_logfile_maxbytes=0 +command=/run_elasticsearch.sh diff --git a/www-data b/www-data deleted file mode 100644 index 5c11678..0000000 --- a/www-data +++ /dev/null @@ -1,2 +0,0 @@ -*/15 * * * * php -f /var/www/html/cron.php -*/1 * * * * pgrep -af fulltextsearch | grep -qv grep || { php /var/www/html/occ fulltextsearch:index -q; php /var/www/html/occ fulltextsearch:live -q; }