Commit f7dd420b authored by Xavier Thompson's avatar Xavier Thompson

software/nextcloud: Adapt to changes in stack/lamp

Database password in stack/lamp is now randomly generated.
parent 8f05cb4e
...@@ -39,7 +39,6 @@ path = ${template-nextcloud-instance:output} ...@@ -39,7 +39,6 @@ path = ${template-nextcloud-instance:output}
part-list = nextcloud-install.sh part-list = nextcloud-install.sh
db-name = nextcloud db-name = nextcloud
db-user = nextcloud db-user = nextcloud
db-password = insecure
[nc-download-unpacked] [nc-download-unpacked]
recipe = slapos.recipe.build:download-unpacked recipe = slapos.recipe.build:download-unpacked
......
...@@ -31,6 +31,8 @@ import json ...@@ -31,6 +31,8 @@ import json
import glob import glob
import re import re
from six.moves.urllib.parse import urlparse
from slapos.recipe.librecipe import generateHashFromFiles from slapos.recipe.librecipe import generateHashFromFiles
from slapos.testing.testcase import makeModuleSetUpAndTestCaseClass from slapos.testing.testcase import makeModuleSetUpAndTestCaseClass
...@@ -63,13 +65,17 @@ class NextCloudTestCase(InstanceTestCase): ...@@ -63,13 +65,17 @@ class NextCloudTestCase(InstanceTestCase):
self.nextcloud_path, self.nextcloud_path,
"Nextcloud path not found in %r" % (partition_path_list,)) "Nextcloud path not found in %r" % (partition_path_list,))
# parse database info from mariadb url
d = self.computer_partition.getConnectionParameterDict()
db_url = d['mariadb-url-list'][2:-2] # parse <url> out of "['<url>']"
self._db_info = urlparse(db_url)
def getNextcloudConfig(self, config_dict={}): def getNextcloudConfig(self, config_dict={}):
data_dict = dict( data_dict = dict(
datadirectory=self.partition_dir + "/srv/data", datadirectory=self.partition_dir + "/srv/data",
dbhost="%s:2099" % self._ipv4_address, dbhost="%s:2099" % self._ipv4_address,
dbname="nextcloud", dbname="nextcloud",
dbpassword="insecure", dbpassword=self._db_info.password,
dbport="", dbport="",
dbuser="nextcloud", dbuser="nextcloud",
mail_domain="nextcloud@example.com", mail_domain="nextcloud@example.com",
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment