X-Git-Url: https://jfr.im/git/irc/unrealircd/unrealircd-webpanel.git/blobdiff_plain/af67e31488cf0cc77cb9e45b79ece71338dd4603..89ba7ba42b9f5eeca0e55e62ab2f5cf0494e0be0:/settings/install.php diff --git a/settings/install.php b/settings/install.php index 0ea2526..d215ed9 100644 --- a/settings/install.php +++ b/settings/install.php @@ -1,6 +1,22 @@ $opts->sql_host, + "database" => $opts->sql_db, + "username" => $opts->sql_user, + "password" => $opts->sql_password, + "table_prefix" => $opts->sql_table_prefix, + ]; } - else { - $conf = file_get_contents("../config/config.php.sample"); - $conf = str_replace('$config["base_url"] = \'/unrealircd-webpanel/\'', '$config["base_url"] = \''.BASE_URL.'\'', $conf); - $conf = str_replace('$config["unrealircd"]["rpc_user"] = \'adminpanel\'', '$config["unrealircd"]["rpc_user"] = \''.$opts->rpc_user.'\'', $conf); - $conf = str_replace('$config["unrealircd"]["rpc_password"] = \'securepassword\'', '$config["unrealircd"]["rpc_password"] = \''.$opts->rpc_password.'\'', $conf); - $conf = str_replace('$config["unrealircd"]["host"] = \'127.0.0.1\'', '$config["unrealircd"]["host"] = \''.$opts->rpc_iphost.'\'', $conf); - $conf = str_replace('$config["unrealircd"]["port"] = \'8600\'', '$config["unrealircd"]["port"] = \''.$opts->rpc_port.'\'', $conf); - if (isset($opts->rpc_ssl)) - $conf = str_replace('$config["unrealircd"]["tls_verify_cert"] = false', '$config["unrealircd"]["port"] = true', $conf); - - $conf = str_replace("//\"$auth_method\"", "\"$auth_method\"", $conf); // enable our auth method - - if ($auth_method == "sql_auth") - { - $conf = str_replace('//$config["mysql"]["host"] = "127.0.0.1"', '$config["mysql"]["host"] = "'.$opts->sql_iphost.'"', $conf); - $conf = str_replace('//$config["mysql"]["database"] = "unrealircdwebpanel"', '$config["mysql"]["database"] = "'.$opts->sql_db.'"', $conf); - $conf = str_replace('//$config["mysql"]["username"] = "unrealircdwebpanel"', '$config["mysql"]["username"] = "'.$opts->sql_user.'"', $conf); - $conf = str_replace('//$config["mysql"]["password"] = "replace_this_with_your_sql_password"', '$config["mysql"]["password"] = "'.$opts->sql_password.'"', $conf); - } - $file = fopen("../config/config.php", 'x+'); // only create it if it doesn't already exist even though we checked earlier - if ($file) - { - fwrite($file, $conf); - } - require_once("../config/config.php"); - - 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); - ?> -
- 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_permission(PERMISSION_MANAGE_USERS); + + /* 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 +178,37 @@ $writable = (is_writable("../config/")) ? true: false; font-style: italic; } +

- Welcome to the IRC admin panel setup page. This setup process will guide you through the necessary steps to configure your IRC uplink and choose your preferred authentication method. -

- The first page will ask you for your UnrealIRCd uplink credentials and will test them to ensure that the connection is successful. This step is crucial for the Admin Panel to function properly. -

- Next, you will be asked to choose your preferred authentication method between file-based and SQL. Depending on your choice, additional steps may be required. If you choose SQL, you will be given the option to set up the appropriate tables in the database. -

- After that, we'll take you through a short account creation process where you get to create your first account. Once you're setup and logged in, you'll be able to add more users and choose what they can do on your panel. -

- Finally, the last page will offer additional options that you can customize according to your preferences. Once you have completed all the necessary steps, your IRC admin panel will be fully configured and ready for use. -

- Should you wish to edit your config further, you will find it in the config directory called config.php -

- We recommend that you carefully read each page and fill in all the required information accurately to ensure a seamless setup process. Thank you for choosing UnrealIRCd Admin Panel, and we hope you find it useful for managing your server/network. -

- -
Proceed
' - : 'Before we begin, you must let the shell user who owns the webpanel have permission to create files.
-
Get info
'; ?> -
+ The admin panel needs to be able to write the config file.
+ Please run: sudo chown -R
+ And after that, refresh this webpage.

+ If you have any questions about this, read the installation manual on permissions. +
-
-
RPC Uplink Information
-
- First, let's get you linked with UnrealIRCd. -

- If you don't have your credentials, you will need to create them. This is done in your unrealircd.conf
View instructions
-

- -
- - - The hostname or IP address of your UnrealIRCd server. You should use 127.0.0.1 for the same machine. -
-
- - - The port which you designated for RPC connections in your unrealircd.conf -
-
- - -
-
- - - The name of your rpc-user block as defined in your unrealircd.conf -
-
- - -
-
-
Back
- -
Test connection
-
-
- -
-
Authentication Method
+
Database Backend

- Here's where you can choose which type of authentication mechanism you want to use behind the scenes. + Which database backend would you like to use?

Please choose from the available options:
- -
- -
@@ -260,8 +216,8 @@ $writable = (is_writable("../config/")) ? true: false;
-
Back
Next
@@ -288,8 +248,7 @@ $writable = (is_writable("../config/")) ? true: false;
Create your account

- Great! Everything looks good so far! Just one last thing before we confirm everything and get you set up.
- You need an account! Let's make one.

+ You need an account, let's make one.

@@ -322,65 +281,55 @@ $writable = (is_writable("../config/")) ? true: false;
Back
-
Next
+
+
-
-
Confirm details
-
-
-
-
-

- -

-
- -
-
- -
-
+ +