Skip to content

Commit 79d2627

Browse files
committed
chore(updater): tidy up updater.secret instruction output
Signed-off-by: Josh Richards <josh.t.richards@gmail.com>
1 parent 99e17c2 commit 79d2627

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

index.php

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1987,7 +1987,15 @@ public function isAuthenticated(): bool {
19871987
<p>To login you need to provide the unhashed value of "updater.secret" in your config file.</p>
19881988
<p>If you don't know that value, you can access this updater directly via the Nextcloud admin screen or generate
19891989
your own secret:</p>
1990-
<code>php -r '$password = trim(shell_exec("openssl rand -base64 48"));if(strlen($password) === 64) {$hash = password_hash($password, PASSWORD_DEFAULT); echo "Insert this line in your config.php: \n\n'" 'updater.secret' => '"'.$hash'"',\n\n"'"; echo "The plaintext value is: ".$password."\n";;}else{echo "Could not execute OpenSSL.\n";};'</code>
1990+
<code>php -r '$password = trim(shell_exec("openssl rand -base64 48"));
1991+
if (strlen($password) === 64) {
1992+
$hash = password_hash($password, PASSWORD_DEFAULT);
1993+
echo "Insert this line in your config.php:\n\n";
1994+
echo "'\''updater.secret'\'' => '\''" . $hash . "'\'',\n\n";
1995+
echo "The plaintext value is: " . $password . "\n";
1996+
} else {
1997+
echo "Could not execute OpenSSL.\n";
1998+
}'</code>
19911999
<form method="post" name="login">
19922000
<fieldset>
19932001
<input type="password" name="updater-secret-input" value=""

0 commit comments

Comments
 (0)