smeserver-nextcloud/root/etc/e-smith/db/configuration/migrate/nextcloud

17 lines
586 B
Plaintext
Raw Normal View History

{
my $nextcloud = $DB->get('nextcloud') || $DB->new_record('nextcloud', {type => 'service'});
my $dbpass = $nextcloud->prop('DbPassword') ||
$nextcloud->set_prop('DbPassword', `/usr/bin/openssl rand -base64 40 | /usr/bin/tr -c -d '[:graph:]'`);
my $dbAdminPass = $nextcloud->prop('AdminPassword') ||
$nextcloud->set_prop('AdminPassword', `/usr/bin/openssl rand -base64 40 | /usr/bin/tr -c -d '[:graph:]'`);
if (my $CloudDomain = $DB->get_prop_and_delete('nextcloud', 'CloudDomain')) {
$nextcloud->merge_props('VirtualHost', $CloudDomain);
}
}