Compare commits
No commits in common. "edf7ab423610a3b8541d0964a59e0b1b35687947" and "2afc41a9f481c7326b047434c1e7680f18a52c9c" have entirely different histories.
edf7ab4236
...
2afc41a9f4
3 changed files with 55 additions and 68 deletions
|
@ -1,3 +1,44 @@
|
||||||
<?php
|
<?php
|
||||||
# https://docs.nextcloud.com/server/stable/admin_manual/configuration_server/config_sample_php_parameters.html#multiple-config-php-file
|
# https://docs.nextcloud.com/server/stable/admin_manual/configuration_server/config_sample_php_parameters.html#multiple-config-php-file
|
||||||
$CONFIG = json_decode(file_get_contents("/etc/nextcloud/managed.config.json"), $associative = true);
|
$CONFIG = array (
|
||||||
|
"dbuser" => "nextcloud",
|
||||||
|
"dbpassword" => "${db_password}",
|
||||||
|
"dbname" => "nextcloud",
|
||||||
|
"dbhost" => "localhost",
|
||||||
|
"dbtype" => "pgsql",
|
||||||
|
"datadirectory" => "/var/lib/nextcloud",
|
||||||
|
"dbport" => "5432",
|
||||||
|
"apps_paths" => [
|
||||||
|
[
|
||||||
|
"path" => "/opt/nextcloud/apps",
|
||||||
|
"url" => "/apps",
|
||||||
|
"writable" => false,
|
||||||
|
],
|
||||||
|
[
|
||||||
|
"path" => "/var/lib/nextcloud/.userapps",
|
||||||
|
"url" => "/userapps",
|
||||||
|
"writable" => true,
|
||||||
|
],
|
||||||
|
],
|
||||||
|
"cache_path" => "/var/lib/nextcloud/.cache",
|
||||||
|
"upgrade.disable-web" => true,
|
||||||
|
"memcache.local" => "\\OC\\Memcache\\Redis",
|
||||||
|
"memcache.locking" => "\\OC\\Memcache\\Redis",
|
||||||
|
"memcache.distributed" => "\OC\Memcache\Redis",
|
||||||
|
"redis" => [
|
||||||
|
"host" => "/var/run/redis/nextcloud.sock",
|
||||||
|
],
|
||||||
|
'trusted_domains' =>
|
||||||
|
array (
|
||||||
|
0 => 'localhost',
|
||||||
|
1 => '127.0.0.1',
|
||||||
|
2 => '${hostname}',
|
||||||
|
),
|
||||||
|
"log_type" => "syslog",
|
||||||
|
"syslog_tag" => "nextcloud",
|
||||||
|
"logfile" => "",
|
||||||
|
"loglevel" => 3,
|
||||||
|
"default_phone_region" => "DE",
|
||||||
|
"versions_retention_obligation" => "auto, 90",
|
||||||
|
"simpleSignUpLink.shown" => false,
|
||||||
|
);
|
||||||
|
|
|
@ -1,8 +1,9 @@
|
||||||
import json
|
|
||||||
|
|
||||||
|
|
||||||
assert node.has_bundle('php')
|
assert node.has_bundle('php')
|
||||||
|
|
||||||
|
from shlex import quote
|
||||||
|
from os.path import join
|
||||||
|
from mako.template import Template
|
||||||
|
|
||||||
version = node.metadata.get('nextcloud/version')
|
version = node.metadata.get('nextcloud/version')
|
||||||
|
|
||||||
directories = {
|
directories = {
|
||||||
|
@ -68,22 +69,19 @@ symlinks = {
|
||||||
|
|
||||||
files = {
|
files = {
|
||||||
'/etc/nextcloud/managed.config.php': {
|
'/etc/nextcloud/managed.config.php': {
|
||||||
|
'content_type': 'mako',
|
||||||
'owner': 'www-data',
|
'owner': 'www-data',
|
||||||
'group': 'www-data',
|
'group': 'www-data',
|
||||||
'mode': '640',
|
'mode': '640',
|
||||||
|
'context': {
|
||||||
|
'db_password': node.metadata.get('postgresql/roles/nextcloud/password'),
|
||||||
|
'hostname': node.metadata.get('nextcloud/hostname'),
|
||||||
|
},
|
||||||
'needs': [
|
'needs': [
|
||||||
'directory:/etc/nextcloud',
|
'directory:/etc/nextcloud',
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
'/etc/nextcloud/managed.config.json': {
|
}
|
||||||
'content': json.dumps(node.metadata.get('nextcloud/config'), indent=4, sort_keys=True),
|
|
||||||
'owner': 'www-data',
|
|
||||||
'group': 'www-data',
|
|
||||||
'mode': '640',
|
|
||||||
'needs': [
|
|
||||||
'directory:/etc/nextcloud',
|
|
||||||
],
|
|
||||||
},}
|
|
||||||
|
|
||||||
# SETUP
|
# SETUP
|
||||||
|
|
||||||
|
@ -126,7 +124,7 @@ files['/opt/nextcloud_upgrade_status.php'] = {
|
||||||
'action:extract_nextcloud',
|
'action:extract_nextcloud',
|
||||||
],
|
],
|
||||||
}
|
}
|
||||||
|
|
||||||
actions['upgrade_nextcloud'] = {
|
actions['upgrade_nextcloud'] = {
|
||||||
'command': repo.libs.nextcloud.occ('upgrade'),
|
'command': repo.libs.nextcloud.occ('upgrade'),
|
||||||
'unless': 'sudo -u www-data php /opt/nextcloud_upgrade_status.php; test $? -ne 99',
|
'unless': 'sudo -u www-data php /opt/nextcloud_upgrade_status.php; test $? -ne 99',
|
||||||
|
|
|
@ -45,8 +45,7 @@ defaults = {
|
||||||
},
|
},
|
||||||
'nextcloud': {
|
'nextcloud': {
|
||||||
'admin_user': 'admin',
|
'admin_user': 'admin',
|
||||||
'admin_pass': repo.vault.password_for(f'{node.name} nextcloud admin pw').value,
|
'admin_pass': repo.vault.password_for(f'{node.name} nextcloud admin pw'),
|
||||||
'config': {},
|
|
||||||
},
|
},
|
||||||
'php': {
|
'php': {
|
||||||
'post_max_size': '32G',
|
'post_max_size': '32G',
|
||||||
|
@ -66,7 +65,7 @@ defaults = {
|
||||||
'postgresql': {
|
'postgresql': {
|
||||||
'roles': {
|
'roles': {
|
||||||
'nextcloud': {
|
'nextcloud': {
|
||||||
'password': repo.vault.password_for(f'{node.name} nextcloud db pw').value,
|
'password': repo.vault.password_for(f'{node.name} nextcloud db pw'),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
'databases': {
|
'databases': {
|
||||||
|
@ -94,57 +93,6 @@ defaults = {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@metadata_reactor.provides(
|
|
||||||
'nextcloud/config',
|
|
||||||
)
|
|
||||||
def config(metadata):
|
|
||||||
return {
|
|
||||||
'nextcloud': {
|
|
||||||
'config': {
|
|
||||||
'dbuser': 'nextcloud',
|
|
||||||
'dbpassword': metadata.get('postgresql/roles/nextcloud/password'),
|
|
||||||
'dbname': 'nextcloud',
|
|
||||||
'dbhost': 'localhost',
|
|
||||||
'dbtype': 'pgsql',
|
|
||||||
'datadirectory': '/var/lib/nextcloud',
|
|
||||||
'dbport': '5432',
|
|
||||||
'apps_paths': [
|
|
||||||
{
|
|
||||||
'path': '/opt/nextcloud/apps',
|
|
||||||
'url': '/apps',
|
|
||||||
'writable': False
|
|
||||||
},
|
|
||||||
{
|
|
||||||
'path': '/var/lib/nextcloud/.userapps',
|
|
||||||
'url': '/userapps',
|
|
||||||
'writable': True
|
|
||||||
}
|
|
||||||
],
|
|
||||||
'cache_path': '/var/lib/nextcloud/.cache',
|
|
||||||
'upgrade.disable-web': True,
|
|
||||||
'memcache.local': '\OC\Memcache\Redis',
|
|
||||||
'memcache.locking': '\OC\Memcache\Redis',
|
|
||||||
'memcache.distributed': '\OC\Memcache\Redis',
|
|
||||||
'redis': {
|
|
||||||
'host': '/var/run/redis/nextcloud.sock'
|
|
||||||
},
|
|
||||||
'trusted_domains': [
|
|
||||||
'localhost',
|
|
||||||
'127.0.0.1',
|
|
||||||
metadata.get('nextcloud/hostname'),
|
|
||||||
],
|
|
||||||
'log_type': 'syslog',
|
|
||||||
'syslog_tag': 'nextcloud',
|
|
||||||
'logfile': '',
|
|
||||||
'loglevel': 3,
|
|
||||||
'default_phone_region': 'DE',
|
|
||||||
'versions_retention_obligation': 'auto, 90',
|
|
||||||
'simpleSignUpLink.shown': False,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@metadata_reactor.provides(
|
@metadata_reactor.provides(
|
||||||
'zfs/datasets',
|
'zfs/datasets',
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in a new issue