X-Git-Url: https://jfr.im/git/irc/unrealircd/unrealircd-webpanel.git/blobdiff_plain/65fcaafb427d43932721138c604c8cf706b2a878..cd26522ba6ff68c18e1504b022ca92f4d01827be:/settings/install.php
diff --git a/settings/install.php b/settings/install.php
index 7b0596e..ec05d09 100644
--- a/settings/install.php
+++ b/settings/install.php
@@ -1,6 +1,22 @@
$opts->rpc_user,
- "rpc_password" => $opts->rpc_password,
- "host"=>$opts->rpc_iphost,
- "port"=>$opts->rpc_port,
- "tls_verify_cert"=>isset($opts->rpc_ssl)?true:false,
+ $config["mysql"] = [
+ "host" => $opts->sql_host,
+ "database" => $opts->sql_db,
+ "username" => $opts->sql_user,
+ "password" => $opts->sql_password,
+ "table_prefix" => $opts->sql_table_prefix,
];
- $config["plugins"] = Array("$auth_method");
- if ($auth_method == "sql_auth")
- {
- $config["mysql"] = [
- "host" => $opts->sql_host,
- "database" => $opts->sql_db,
- "username" => $opts->sql_user,
- "password" => $opts->sql_password,
- ];
- }
+ }
- /* First, write only the config file */
- write_config_file();
-
- if ($auth_method == "sql_auth")
- if (!sql_auth::create_tables())
- Message::Fail("Could not create SQL tables");
-
- $user = [
- "user_name" => $opts->account_user,
- "user_pass" => $opts->account_password,
- "fname" => $opts->account_fname,
- "lname" => $opts->account_lname,
- "user_bio" => $opts->account_bio,
- "email" => $opts->account_email
- ];
-
- create_new_user($user);
- $lkup = new PanelUser($opts->account_user);
- if (!$lkup->id)
- {
- Message::Fail("Could not create user");
- return;
- }
- $lkup->add_permission(PERMISSION_MANAGE_USERS);
+ generate_secrets();
- /* Now, write all the config (config.php + settings in DB) */
- write_config();
- ?>
-
- Great! Everything has been completely set up for you, and you can now log in.
- Let's go!
- $opts->account_user,
+ "user_pass" => $opts->account_password,
+ "fname" => $opts->account_fname,
+ "lname" => $opts->account_lname,
+ "user_bio" => $opts->account_bio,
+ "email" => $opts->account_email
+ ];
+
+ create_new_user($user);
+ $lkup = new PanelUser($opts->account_user);
+ if (!$lkup->id)
+ {
+ Message::Fail("Could not create user");
return;
}
+ $lkup->add_meta('role', 'Super-Admin');
+
+ /* Enable lookups on HIBP by default */
+ $config['hibp'] = true;
+
+ /* Now, write all the config (config.php + settings in DB) */
+ write_config();
+ ?>
+
+ The configuration file has been written. Now, log in to the panel to proceed with the rest of the installation.
+ Let's go!
+
@@ -171,88 +181,37 @@ $writable = (is_writable("../config/")) ? true: false;
font-style: italic;
}
+
config
directory called config.php
- sudo chown -R