This commit is contained in:
mwiegand 2021-07-01 00:41:20 +02:00
parent fb1c7a2bcc
commit c84467c033
4 changed files with 26 additions and 21 deletions

View file

@ -1,19 +1,24 @@
<?php
# https://docs.nextcloud.com/server/stable/admin_manual/configuration_server/config_sample_php_parameters.html#multiple-config-php-file
$CONFIG = array (
'dbuser' => '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",
);

View file

@ -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',

View file

@ -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

View file

@ -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': {