Merge pull request #11867 from murrant/more-install-changes

Fix validation and other issues when config.php is missing
This commit is contained in:
Tony Murray
2020-06-29 17:49:28 -05:00
committed by GitHub
5 changed files with 26 additions and 28 deletions

View File

@@ -78,7 +78,7 @@ class Python extends BaseValidation
$process->run();
if ($process->getExitCode() !== 0) {
$user = Config::get('user', 'librenms');
$user = \config('librenms.user');
$user_mismatch = function_exists('posix_getpwuid') ? (posix_getpwuid(posix_geteuid())['name'] ?? null) !== $user : false;
if ($user_mismatch) {

View File

@@ -44,8 +44,8 @@ class User extends BaseValidation
{
// Check we are running this as the root user
$username = $validator->getUsername();
$lnms_username = Config::get('user', 'librenms');
$lnms_groupname = Config::get('group', $lnms_username); // if group isn't set, fall back to user
$lnms_username = \config('librenms.user');
$lnms_groupname = \config('librenms.group');
if (!($username === 'root' || $username === $lnms_username)) {
if (isCli()) {
@@ -119,7 +119,7 @@ class User extends BaseValidation
}
}
} else {
$validator->warn("You don't have \$config['user'] set, this most likely needs to be set to librenms");
$validator->warn("You don't have LIBRENMS_USER set, this most likely needs to be set to librenms");
}
}
}