initial commit of file from CVS for smeserver-onlyoffice on Sat Sep 7 20:48:46 AEST 2024
This commit is contained in:
27
root/etc/e-smith/db/configuration/migrate/50onlyoffice
Normal file
27
root/etc/e-smith/db/configuration/migrate/50onlyoffice
Normal file
@@ -0,0 +1,27 @@
|
||||
{
|
||||
my $onlyoffice = $DB->get('onlyoffice') || $DB->new_record('onlyoffice', {type => 'configuration'});
|
||||
my $token = $onlyoffice->prop('token') || '';
|
||||
my $secretString = $onlyoffice->prop('secretString') || '';
|
||||
# If the management interface is already defined, return nothing
|
||||
|
||||
if ($token eq '') {
|
||||
# Else, we generate a random password
|
||||
my $pass=`/usr/bin/openssl rand -base64 32 | tr -c -d '[:alnum:]'`;
|
||||
$onlyoffice->set_prop('token',"$pass");
|
||||
}
|
||||
|
||||
if ($secretString eq '') {
|
||||
# Else, we generate a random password
|
||||
my $pass=`/usr/bin/openssl rand -base64 60 | tr -c -d '[:alnum:]'`;
|
||||
$onlyoffice->set_prop('secretString',"$pass");
|
||||
}
|
||||
|
||||
|
||||
#dbpass
|
||||
my $dbpass = $onlyoffice->prop('dbpass') || '';
|
||||
if ($dbpass eq '') {
|
||||
my $pass=`/usr/bin/openssl rand -base64 60 | tr -c -d '[:alnum:]'`;
|
||||
$onlyoffice->set_prop('dbpass',"$pass");
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user