From c84467c03373400379dd1f4b73df8af0c7ace3df Mon Sep 17 00:00:00 2001 From: mwiegand Date: Thu, 1 Jul 2021 00:41:20 +0200 Subject: [PATCH] wip --- bundles/nextcloud/files/managed.config.php | 29 +++++++++++++--------- bundles/nextcloud/items.py | 12 ++++----- items/download.py | 3 ++- nodes/htz.mails.py | 3 +-- 4 files changed, 26 insertions(+), 21 deletions(-) diff --git a/bundles/nextcloud/files/managed.config.php b/bundles/nextcloud/files/managed.config.php index c6404e5..e186d1b 100644 --- a/bundles/nextcloud/files/managed.config.php +++ b/bundles/nextcloud/files/managed.config.php @@ -1,19 +1,24 @@ 'nextcloud', - 'dbpassword' => '${db_password}', - 'dbname' => 'nextcloud', - 'dbhost' => 'localhost', - 'dbtype' => 'pgsql', - 'datadirectory' => '/var/lib/nextcloud', - 'dbport' => '5432', - 'apps_paths' => [ + "dbuser" => "nextcloud", + "dbpassword" => "${db_password}", + "dbname" => "nextcloud", + "dbhost" => "localhost", + "dbtype" => "pgsql", + "datadirectory" => "/var/lib/nextcloud", + "dbport" => "5432", + "apps_paths" => [ [ - 'path'=> '/var/lib/nextcloud/.apps', - 'url' => '/userapps', - 'writable' => true, + "path" => "/opt/nextcloud/apps", + "url" => "/apps", + "writable" => false, + ], + [ + "path" => "/var/lib/nextcloud/.userapps", + "url" => "/userapps", + "writable" => true, ], ], - 'cache_path' => '/var/lib/nextcloud/.cache', + "cache_path" => "/var/lib/nextcloud/.cache", ); diff --git a/bundles/nextcloud/items.py b/bundles/nextcloud/items.py index bed230a..c64e610 100644 --- a/bundles/nextcloud/items.py +++ b/bundles/nextcloud/items.py @@ -17,7 +17,7 @@ directories = { 'group': 'www-data', 'mode': '770', }, - '/var/lib/nextcloud/.apps': { + '/var/lib/nextcloud/.userapps': { 'owner': 'www-data', 'group': 'www-data', }, @@ -29,15 +29,15 @@ directories = { downloads[f'/tmp/nextcloud-{version}.tar.bz2'] = { 'url': f'https://download.nextcloud.com/server/releases/nextcloud-{version}.tar.bz2', - 'sha256_url': f'https://download.nextcloud.com/server/releases/nextcloud-{version}.tar.bz2.sha256', + 'sha256_url': '{url}.sha256', 'triggered': True, } actions['delete_nextcloud'] = { - 'command': 'rm -rf /opt/nextcloud/{.*,*}', + 'command': 'rm -rf /opt/nextcloud/*', 'triggered': True, } actions['extract_nextcloud'] = { - 'command': f'tar xfvj /tmp/nextcloud-{version}.tar.bz2 --skip-old-files --strip 1 -C /opt/nextcloud nextcloud', + 'command': f'tar xfvj /tmp/nextcloud-{version}.tar.bz2 --strip 1 -C /opt/nextcloud nextcloud', 'unless': f"""php -r 'include "/opt/nextcloud/version.php"; echo "$OC_VersionString";' | grep -q '^{version}$'""", 'preceded_by': [ 'action:delete_nextcloud', @@ -58,7 +58,7 @@ symlinks = { ], }, '/opt/nextcloud/userapps': { - 'target': '/var/lib/nextcloud/.apps', + 'target': '/var/lib/nextcloud/.userapps', 'owner': 'www-data', 'group': 'www-data', 'needs': [ @@ -116,7 +116,7 @@ actions['install_nextcloud'] = { 'directory:/etc/nextcloud', 'directory:/opt/nextcloud', 'directory:/var/lib/nextcloud', - 'directory:/var/lib/nextcloud/.apps', + 'directory:/var/lib/nextcloud/.userapps', 'directory:/var/lib/nextcloud/.cache', 'symlink:/opt/nextcloud/config', 'symlink:/opt/nextcloud/userapps', diff --git a/items/download.py b/items/download.py index 80066eb..8d52e50 100644 --- a/items/download.py +++ b/items/download.py @@ -84,8 +84,9 @@ class Download(Item): if 'sha256' in self.attributes: sdict['sha256'] = self.attributes['sha256'] elif 'sha256_url' in self.attributes: + sha256_url = self.attributes['sha256_url'].format(url=self.attributes['url']) sdict['sha256'] = force_text( - self.node.run(f"curl -L -s -- {quote(self.attributes['sha256_url'])}").stdout + self.node.run(f"curl -L -s -- {quote(sha256_url)}").stdout ).strip().split()[0] return sdict diff --git a/nodes/htz.mails.py b/nodes/htz.mails.py index 4240627..a2f9918 100644 --- a/nodes/htz.mails.py +++ b/nodes/htz.mails.py @@ -18,8 +18,7 @@ 'metadata': { 'nextcloud': { 'domain': 'cloud.sublimity.de', - 'version': '20.0.5', - 'sha256': '5e5b38109a3485db5fd2d248f24478eabe6c0790ec10b030acbbee207d5511fe', + 'version': '20.0.0', }, 'id': 'ea29bdf0-0b47-4bf4-8346-67d60c9dc4ae', 'bind': {