Optimized Nextcloud Configuration

This commit is contained in:
2025-02-28 13:19:34 +01:00
parent d24b33f045
commit d20e900ab2
24 changed files with 207 additions and 145 deletions

View File

@@ -0,0 +1,2 @@
This folder contains configuration files which will be loaded direct into the config.php
If you don't use nested configuration, concider to use the vars/system.yml file instead, because it's a cleaner way to set the configuration.

View File

@@ -1,4 +1,8 @@
<?php
# Implementing OICD configuration
{% if applications[application_id].oidc.flavor == "oidc_login" | bool %}
# Check out: https://github.com/pulsejet/nextcloud-oidc-login
return array (
@@ -210,4 +214,7 @@ return array (
// - 'plain'
// The default value is empty, which won't apply the PKCE flow.
'oidc_login_code_challenge_method' => '',
);
);
{% else %}
return [];
{% endif %}

View File

@@ -0,0 +1,11 @@
<?php
# Implementing redis configuration
return array (
'memcache.locking' => '\\OC\\Memcache\\Redis',
'redis' =>
array (
'host' => 'redis',
'port' => 6379,
)
);

View File

@@ -8,12 +8,12 @@ services:
image: "nextcloud:{{applications.nextcloud.version}}-fpm-alpine"
container_name: {{applications.nextcloud.container.application}}
volumes:
- data:{{nextcloud_docker_path}}
- data:{{nextcloud_docker_work_directory}}
{% if applications[application_id].oidc.flavor == "oidc_login" %}
- {{nextcloud_host_oidc_login_path}}:{{nextcloud_docker_oidc_login_config_path}}:ro
- {{nextcloud_host_config_additives_directory}}:{{nextcloud_docker_config_additives_directory}}:ro
{% endif %}
healthcheck:
test: ["CMD", "su", "www-data", "-s", "/bin/sh", "-c", "php {{nextcloud_docker_path}}occ status"]
test: ["CMD", "su", "www-data", "-s", "/bin/sh", "-c", "php {{nextcloud_docker_work_directory}}occ status"]
interval: 1m
timeout: 10s
retries: 3
@@ -50,10 +50,10 @@ services:
logging:
driver: journald
volumes:
- data:{{nextcloud_docker_path}}
- data:{{nextcloud_docker_work_directory}}
entrypoint: /cron.sh
healthcheck:
test: ["CMD", "su", "www-data", "-s", "/bin/sh", "-c", "php {{nextcloud_docker_path}}occ status"]
test: ["CMD", "su", "www-data", "-s", "/bin/sh", "-c", "php {{nextcloud_docker_work_directory}}occ status"]
interval: 1m
timeout: 10s
retries: 3

View File

@@ -2,20 +2,20 @@
# @See https://github.com/nextcloud/docker/blob/master/README.md
# Database Configuration
MYSQL_DATABASE= "{{database_name}}"
MYSQL_USER= "{{database_username}}"
MYSQL_PASSWORD= "{{database_password}}"
MYSQL_HOST= "{{database_host}}:{{database_port}}"
MYSQL_DATABASE= "{{database_name}}"
MYSQL_USER= "{{database_username}}"
MYSQL_PASSWORD= "{{database_password}}"
MYSQL_HOST= "{{database_host}}:{{database_port}}"
# Memory
PHP_MEMORY_LIMIT= 1G # Required for plugin duplicate finder
PHP_MEMORY_LIMIT= 1G # Required for plugin duplicate finder
# Email Configuration
SMTP_HOST= {{system_email.host}}
SMTP_SECURE= {{ 'ssl' if system_email.tls else '' }}
SMTP_PORT= {{system_email.port}}
SMTP_NAME= {{system_email.username}}
SMTP_PASSWORD= {{system_email.password}}
SMTP_HOST= {{system_email.host}}
SMTP_SECURE= {{ 'ssl' if system_email.tls else '' }}
SMTP_PORT= {{system_email.port}}
SMTP_NAME= {{system_email.username}}
SMTP_PASSWORD= {{system_email.password}}
# Email from configuration
MAIL_FROM_ADDRESS= "{{system_email.local}}"

View File

@@ -0,0 +1,11 @@
{% raw %}
// Include and merge all PHP config files from cymais
$CONFIG_EXTRA = [];
foreach (glob("{% endraw %}{{ nextcloud_docker_config_additives_directory }}{% raw %}*.php") as $file) {
$CONFIG_EXTRA = array_merge($CONFIG_EXTRA, include $file);
}
$CONFIG = array_merge($CONFIG, $CONFIG_EXTRA);
{% endraw %}