commit 1e45b5075fc678bb81809147abfb3ba8e9047afc Author: Arjan Adriaanse Date: Fri Feb 7 19:14:16 2020 +0100 initial commit diff --git a/app.env b/app.env new file mode 100644 index 0000000..9674428 --- /dev/null +++ b/app.env @@ -0,0 +1,3 @@ +NEXTCLOUD_ADMIN_USER=admin +NEXTCLOUD_ADMIN_PASSWORD= +NEXTCLOUD_TRUSTED_DOMAINS=kom.bij1.org diff --git a/config.sh b/config.sh new file mode 100755 index 0000000..0f8f754 --- /dev/null +++ b/config.sh @@ -0,0 +1,9 @@ +#!/bin/sh + +conf() { + docker-compose exec --user www-data app php occ config:system:set "$1" --value "$2" +} + +conf theme bij1 +conf default_language nl +conf default_locale nl_NL diff --git a/db.env b/db.env new file mode 100644 index 0000000..8a1fea1 --- /dev/null +++ b/db.env @@ -0,0 +1,5 @@ +MYSQL_ROOT_PASSWORD= +MYSQL_PASSWORD= +MYSQL_DATABASE=nextcloud +MYSQL_USER=nextcloud + diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..91fb91d --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,40 @@ +version: '3' + +services: + db: + image: mariadb + command: --transaction-isolation=READ-COMMITTED --binlog-format=ROW + restart: always + volumes: + - db:/var/lib/mysql + env_file: + - db.env + + app: + image: nextcloud:fpm-alpine + restart: always + volumes: + - nextcloud:/var/www/html + - ./themes:/var/www/html/themes + environment: + - MYSQL_HOST=db + env_file: + - db.env + - app.env + depends_on: + - db + + web: + image: nginx:alpine + restart: always + ports: + - 8080:80 + volumes: + - nextcloud:/var/www/html:ro + - ./nginx.conf:/etc/nginx/nginx.conf + depends_on: + - app + +volumes: + db: + nextcloud: diff --git a/nginx.conf b/nginx.conf new file mode 100644 index 0000000..d44c059 --- /dev/null +++ b/nginx.conf @@ -0,0 +1,168 @@ +worker_processes auto; + +error_log /var/log/nginx/error.log warn; +pid /var/run/nginx.pid; + + +events { + worker_connections 1024; +} + + +http { + include /etc/nginx/mime.types; + default_type application/octet-stream; + + log_format main '$remote_addr - $remote_user [$time_local] "$request" ' + '$status $body_bytes_sent "$http_referer" ' + '"$http_user_agent" "$http_x_forwarded_for"'; + + access_log /var/log/nginx/access.log main; + + sendfile on; + #tcp_nopush on; + + keepalive_timeout 65; + + #gzip on; + + upstream php-handler { + server app:9000; + } + + server { + listen 80; + + # Add headers to serve security related headers + # Before enabling Strict-Transport-Security headers please read into this + # topic first. + #add_header Strict-Transport-Security "max-age=15768000; includeSubDomains; preload;" always; + # + # WARNING: Only add the preload option once you read about + # the consequences in https://hstspreload.org/. This option + # will add the domain to a hardcoded list that is shipped + # in all major browsers and getting removed from this list + # could take several months. + add_header Referrer-Policy "no-referrer" always; + add_header X-Content-Type-Options "nosniff" always; + add_header X-Download-Options "noopen" always; + add_header X-Frame-Options "SAMEORIGIN" always; + add_header X-Permitted-Cross-Domain-Policies "none" always; + add_header X-Robots-Tag "none" always; + add_header X-XSS-Protection "1; mode=block" always; + + # Remove X-Powered-By, which is an information leak + fastcgi_hide_header X-Powered-By; + + # Path to the root of your installation + root /var/www/html; + + location = /robots.txt { + allow all; + log_not_found off; + access_log off; + } + + # The following 2 rules are only needed for the user_webfinger app. + # Uncomment it if you're planning to use this app. + #rewrite ^/.well-known/host-meta /public.php?service=host-meta last; + #rewrite ^/.well-known/host-meta.json /public.php?service=host-meta-json last; + + # The following rule is only needed for the Social app. + # Uncomment it if you're planning to use this app. + #rewrite ^/.well-known/webfinger /public.php?service=webfinger last; + + location = /.well-known/carddav { + return 301 $scheme://$host:$server_port/remote.php/dav; + } + + location = /.well-known/caldav { + return 301 $scheme://$host:$server_port/remote.php/dav; + } + + # set max upload size + client_max_body_size 10G; + fastcgi_buffers 64 4K; + + # Enable gzip but do not remove ETag headers + gzip on; + gzip_vary on; + gzip_comp_level 4; + gzip_min_length 256; + gzip_proxied expired no-cache no-store private no_last_modified no_etag auth; + gzip_types application/atom+xml application/javascript application/json application/ld+json application/manifest+json application/rss+xml application/vnd.geo+json application/vnd.ms-fontobject application/x-font-ttf application/x-web-app-manifest+json application/xhtml+xml application/xml font/opentype image/bmp image/svg+xml image/x-icon text/cache-manifest text/css text/plain text/vcard text/vnd.rim.location.xloc text/vtt text/x-component text/x-cross-domain-policy; + + # Uncomment if your server is build with the ngx_pagespeed module + # This module is currently not supported. + #pagespeed off; + + location / { + rewrite ^ /index.php; + } + + location ~ ^\/(?:build|tests|config|lib|3rdparty|templates|data)\/ { + deny all; + } + location ~ ^\/(?:\.|autotest|occ|issue|indie|db_|console) { + deny all; + } + + location ~ ^\/(?:index|remote|public|cron|core\/ajax\/update|status|ocs\/v[12]|updater\/.+|oc[ms]-provider\/.+)\.php(?:$|\/) { + fastcgi_split_path_info ^(.+?\.php)(\/.*|)$; + set $path_info $fastcgi_path_info; + try_files $fastcgi_script_name =404; + include fastcgi_params; + fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; + fastcgi_param PATH_INFO $path_info; + # fastcgi_param HTTPS on; + + # Avoid sending the security headers twice + fastcgi_param modHeadersAvailable true; + + # Enable pretty urls + fastcgi_param front_controller_active true; + fastcgi_pass php-handler; + fastcgi_intercept_errors on; + fastcgi_request_buffering off; + } + + location ~ ^\/(?:updater|oc[ms]-provider)(?:$|\/) { + try_files $uri/ =404; + index index.php; + } + + # Adding the cache control header for js, css and map files + # Make sure it is BELOW the PHP block + location ~ \.(?:css|js|woff2?|svg|gif|map)$ { + try_files $uri /index.php$request_uri; + add_header Cache-Control "public, max-age=15778463"; + # Add headers to serve security related headers (It is intended to + # have those duplicated to the ones above) + # Before enabling Strict-Transport-Security headers please read into + # this topic first. + #add_header Strict-Transport-Security "max-age=15768000; includeSubDomains; preload;" always; + # + # WARNING: Only add the preload option once you read about + # the consequences in https://hstspreload.org/. This option + # will add the domain to a hardcoded list that is shipped + # in all major browsers and getting removed from this list + # could take several months. + add_header Referrer-Policy "no-referrer" always; + add_header X-Content-Type-Options "nosniff" always; + add_header X-Download-Options "noopen" always; + add_header X-Frame-Options "SAMEORIGIN" always; + add_header X-Permitted-Cross-Domain-Policies "none" always; + add_header X-Robots-Tag "none" always; + add_header X-XSS-Protection "1; mode=block" always; + + # Optional: Don't log access to assets + access_log off; + } + + location ~ \.(?:png|html|ttf|ico|jpg|jpeg|bcmap)$ { + try_files $uri /index.php$request_uri; + # Optional: Don't log access to other assets + access_log off; + } + } +} diff --git a/themes/README b/themes/README new file mode 100644 index 0000000..5e6ea79 --- /dev/null +++ b/themes/README @@ -0,0 +1,17 @@ +Themes can be used to customize the look and feel without the need to patch the source code. This makes it very easy to: + +* Use your own logo (in the top left, in log in and in emails) +* Customize the text strings to replace »Nextcloud« etc. with your name of choice +* Change the main color (used in header and as log in background) +* And more … + + +The process is simple: + +1. Put a folder here with the name of the theme as foldername +2. Activate it by putting 'theme' => 'themename', into the config.php file + + +The folder structure of a theme is exactly the same as the main structure. CSS files are loaded additionally to the default files so you can override properties. Images are replaced. You can also override JS files and PHP templates but we do not recommend that because you will need to adjust them after every update. + +You can also find a basic example here which you can build upon. diff --git a/themes/bij1/core/css/server.css b/themes/bij1/core/css/server.css new file mode 100644 index 0000000..53fdeda --- /dev/null +++ b/themes/bij1/core/css/server.css @@ -0,0 +1,86 @@ +/** + * @author Jan-Christoph Borchardt, http://jancborchardt.net + * @copyright Copyright (c) 2015, ownCloud, Inc. + * @license AGPL-3.0 + * + * This code is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License, version 3, + * as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License, version 3, + * along with this program. If not, see + */ + + +/* header color */ +/* this is the main brand color */ +#body-user #header, +#body-settings #header, +#body-public #header { + background-color: #745bca; +} + +/* log in screen background color */ +/* gradient of the header color and a brighter shade */ +/* can also be a flat color or an image */ +#body-login { + background: #745bca; /* Old browsers */ + background: -moz-linear-gradient(top, #947bea 0%, #745bca 100%); /* FF3.6+ */ + background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#947bea), color-stop(100%,#745bca)); /* Chrome,Safari4+ */ + background: -webkit-linear-gradient(top, #947bea 0%,#745bca 100%); /* Chrome10+,Safari5.1+ */ + background: -o-linear-gradient(top, #947bea 0%,#745bca 100%); /* Opera11.10+ */ + background: -ms-linear-gradient(top, #947bea 0%,#745bca 100%); /* IE10+ */ + background: linear-gradient(top, #947bea 0%,#745bca 100%); /* W3C */ + filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#947bea', endColorstr='#745bca',GradientType=0 ); /* IE6-9 */ +} + +/* primary action button, use sparingly */ +/* header color as border, brighter shade again, here as background */ +.primary, +input[type="submit"].primary, +input[type="button"].primary, +button.primary, +.button.primary, +.primary:active, +input[type="submit"].primary:active, +input[type="button"].primary:active, +button.primary:active, +.button.primary:active { + border-color: #745bca; + background-color: #947bea; +} +.primary:hover, +input[type="submit"].primary:hover, +input[type="button"].primary:hover, +button.primary:hover, +.button.primary:hover, +.primary:focus, +input[type="submit"].primary:focus, +input[type="button"].primary:focus, +button.primary:focus, +.button.primary:focus { + background-color: #8b75e4; +} +.primary:active, input[type="submit"].primary:active, input[type="button"].primary:active, button.primary:active, .button.primary:active, +.primary:disabled, input[type="submit"].primary:disabled, input[type="button"].primary:disabled, button.primary:disabled, .button.primary:disabled, +.primary:disabled:hover, input[type="submit"].primary:disabled:hover, input[type="button"].primary:disabled:hover, button.primary:disabled:hover, .button.primary:disabled:hover, +.primary:disabled:focus, input[type="submit"].primary:disabled:focus, input[type="button"].primary:disabled:focus, button.primary:disabled:focus, .button.primary:disabled:focus { + background-color: #745bca; +} + +/* use logos from theme */ +#header .logo, +#firstrunwizard .logo { + background-image: url('../img/logo.svg'); + width: 256px; + height: 128px; +} +#header .logo-icon { + width: 62px; + height: 34px; +} diff --git a/themes/bij1/core/img/favicon-touch.png b/themes/bij1/core/img/favicon-touch.png new file mode 100644 index 0000000..e3a61ae Binary files /dev/null and b/themes/bij1/core/img/favicon-touch.png differ diff --git a/themes/bij1/core/img/favicon-touch.svg b/themes/bij1/core/img/favicon-touch.svg new file mode 100644 index 0000000..2c48494 --- /dev/null +++ b/themes/bij1/core/img/favicon-touch.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/themes/bij1/core/img/favicon.ico b/themes/bij1/core/img/favicon.ico new file mode 100644 index 0000000..70b59ad Binary files /dev/null and b/themes/bij1/core/img/favicon.ico differ diff --git a/themes/bij1/core/img/favicon.png b/themes/bij1/core/img/favicon.png new file mode 100644 index 0000000..4394e13 Binary files /dev/null and b/themes/bij1/core/img/favicon.png differ diff --git a/themes/bij1/core/img/favicon.svg b/themes/bij1/core/img/favicon.svg new file mode 100644 index 0000000..e14ea6f --- /dev/null +++ b/themes/bij1/core/img/favicon.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/themes/bij1/core/img/logo-icon.png b/themes/bij1/core/img/logo-icon.png new file mode 100644 index 0000000..4ed7060 Binary files /dev/null and b/themes/bij1/core/img/logo-icon.png differ diff --git a/themes/bij1/core/img/logo-icon.svg b/themes/bij1/core/img/logo-icon.svg new file mode 100644 index 0000000..e944866 --- /dev/null +++ b/themes/bij1/core/img/logo-icon.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/themes/bij1/core/img/logo-mail.gif b/themes/bij1/core/img/logo-mail.gif new file mode 100644 index 0000000..431db4e Binary files /dev/null and b/themes/bij1/core/img/logo-mail.gif differ diff --git a/themes/bij1/core/img/logo.png b/themes/bij1/core/img/logo.png new file mode 100644 index 0000000..ac766e2 Binary files /dev/null and b/themes/bij1/core/img/logo.png differ diff --git a/themes/bij1/core/img/logo.svg b/themes/bij1/core/img/logo.svg new file mode 100644 index 0000000..7461eb5 --- /dev/null +++ b/themes/bij1/core/img/logo.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/themes/bij1/defaults.php b/themes/bij1/defaults.php new file mode 100644 index 0000000..02c2867 --- /dev/null +++ b/themes/bij1/defaults.php @@ -0,0 +1,137 @@ + + * @author Jan-Christoph Borchardt, http://jancborchardt.net + * @copyright Copyright (c) 2016, ownCloud, Inc. + * @license AGPL-3.0 + * + * This code is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License, version 3, + * as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License, version 3, + * along with this program. If not, see + */ + +class OC_Theme { + + /** + * Returns the base URL + * @return string URL + */ + public function getBaseUrl() { + return 'https://kom.bij1.org'; + } + + /** + * Returns the documentation URL + * @return string URL + */ + public function getDocBaseUrl() { + return 'https://docs.nextcloud.com'; + } + + /** + * Returns the title + * @return string title + */ + public function getTitle() { + return 'Kom BIJ1'; + } + + /** + * Returns the short name of the software + * @return string title + */ + public function getName() { + return 'Kom BIJ1'; + } + + /** + * Returns the short name of the software containing HTML strings + * @return string title + */ + public function getHTMLName() { + return 'Kom BIJ1'; + } + + /** + * Returns entity (e.g. company name) - used for footer, copyright + * @return string entity name + */ + public function getEntity() { + return 'BIJ1'; + } + + /** + * Returns slogan + * @return string slogan + */ + public function getSlogan() { + return 'Your custom cloud, personalized for you!'; + } + + /** + * Returns logo claim + * @return string logo claim + * @deprecated 13.0.0 not used anymore + */ + public function getLogoClaim() { + return ''; + } + + /** + * Returns short version of the footer + * @return string short footer + */ + public function getShortFooter() { + $footer = '© ' . date('Y') . ' ' . $this->getEntity() . '' . + '
' . $this->getSlogan(); + + return $footer; + } + + /** + * Returns long version of the footer + * @return string long footer + */ + public function getLongFooter() { + $footer = '© ' . date('Y') . ' ' . $this->getEntity() . '' . + '
' . $this->getSlogan(); + + return $footer; + } + + /** + * Generate a documentation link for a given key + * @return string documentation link + */ + public function buildDocLinkToKey($key) { + return $this->getDocBaseUrl() . '/server/15/go.php?to=' . $key; + } + + + /** + * Returns mail header color + * @return string + */ + public function getColorPrimary() { + return '#745bca'; + } + + /** + * Returns variables to overload defaults from core/css/variables.scss + * @return array + */ + public function getScssVariables() { + return [ + 'color-primary' => '#745bca' + ]; + } + +}