mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-15 16:57:09 +00:00
chore: code cleanup.
This commit is contained in:
@@ -91,6 +91,30 @@ class InstallController extends Controller
|
||||
return view('install.index');
|
||||
}
|
||||
|
||||
/**
|
||||
* Create specific RSA keys.
|
||||
*/
|
||||
public function keys(): void
|
||||
{
|
||||
// switch on PHP version.
|
||||
$keys = [];
|
||||
// switch on class existence.
|
||||
Log::info('Will run PHP8 code.');
|
||||
$keys = RSA::createKey(4096);
|
||||
|
||||
[$publicKey, $privateKey] = [
|
||||
Passport::keyPath('oauth-public.key'),
|
||||
Passport::keyPath('oauth-private.key'),
|
||||
];
|
||||
|
||||
if (file_exists($publicKey) || file_exists($privateKey)) {
|
||||
return;
|
||||
}
|
||||
|
||||
file_put_contents($publicKey, $keys['publickey']);
|
||||
file_put_contents($privateKey, $keys['privatekey']);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Request $request
|
||||
*
|
||||
@@ -161,28 +185,4 @@ class InstallController extends Controller
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create specific RSA keys.
|
||||
*/
|
||||
public function keys(): void
|
||||
{
|
||||
// switch on PHP version.
|
||||
$keys = [];
|
||||
// switch on class existence.
|
||||
Log::info('Will run PHP8 code.');
|
||||
$keys = RSA::createKey(4096);
|
||||
|
||||
[$publicKey, $privateKey] = [
|
||||
Passport::keyPath('oauth-public.key'),
|
||||
Passport::keyPath('oauth-private.key'),
|
||||
];
|
||||
|
||||
if (file_exists($publicKey) || file_exists($privateKey)) {
|
||||
return;
|
||||
}
|
||||
|
||||
file_put_contents($publicKey, $keys['publickey']);
|
||||
file_put_contents($privateKey, $keys['privatekey']);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user