diff --git a/installers/centos-stream-9/install-partial/install_web.sh b/installers/centos-stream-9/install-partial/install_web.sh index 98eb2af..8201b85 100644 --- a/installers/centos-stream-9/install-partial/install_web.sh +++ b/installers/centos-stream-9/install-partial/install_web.sh @@ -45,19 +45,17 @@ MYSQL_SCRIPT echo "$MYSQL_ROOT_PASSWORD" > /root/.mysql_root_password # Configure the application -cp phyre-config.ini.example phyre-config.ini +phyre-php artisan phyre:set-ini-settings APP_URL "127.0.0.1:8443" +phyre-php artisan phyre:set-ini-settings APP_ENV "production" +phyre-php artisan phyre:set-ini-settings APP_NAME "PHYRE_PANEL" +phyre-php artisan phyre:set-ini-settings DB_DATABASE "$PHYRE_PANEL_DB_NAME" +phyre-php artisan phyre:set-ini-settings DB_USERNAME "$PHYRE_PANEL_DB_USER" +phyre-php artisan phyre:set-ini-settings DB_PASSWORD "$PHYRE_PANEL_DB_PASSWORD" +phyre-php artisan phyre:set-ini-settings DB_CONNECTION "mysql" +phyre-php artisan phyre:set-ini-settings MYSQL_ROOT_USERNAME "$MYSQL_PHYRE_ROOT_USERNAME" +phyre-php artisan phyre:set-ini-settings MYSQL_ROOT_PASSWORD "$MYSQL_PHYRE_ROOT_PASSWORD" +phyre-php artisan phyre:key-generate -sed -i "s/^APP_URL=.*/APP_URL=127.0.0.1:8443" phyre-config.ini -sed -i "s/^APP_NAME=.*/APP_NAME=PHYRE_PANEL/" phyre-config.ini -sed -i "s/^DB_DATABASE=.*/DB_DATABASE=$PHYRE_PANEL_DB_NAME/" phyre-config.ini -sed -i "s/^DB_USERNAME=.*/DB_USERNAME=$PHYRE_PANEL_DB_USER/" phyre-config.ini -sed -i "s/^DB_PASSWORD=.*/DB_PASSWORD=$PHYRE_PANEL_DB_PASSWORD/" phyre-config.ini -sed -i "s/^DB_CONNECTION=.*/DB_CONNECTION=mysql/" phyre-config.ini - -sed -i "s/^MYSQL_ROOT_USERNAME=.*/MYSQL_ROOT_USERNAME=$MYSQL_PHYRE_ROOT_USERNAME/" phyre-config.ini -sed -i "s/^MYSQL_ROOT_PASSWORD=.*/MYSQL_ROOT_PASSWORD=$MYSQL_PHYRE_ROOT_PASSWORD/" phyre-config.ini - -phyre-php artisan key:generate phyre-php artisan migrate phyre-php artisan db:seed diff --git a/installers/ubuntu-20.04/install-partial/install_web.sh b/installers/ubuntu-20.04/install-partial/install_web.sh index 98eb2af..8201b85 100644 --- a/installers/ubuntu-20.04/install-partial/install_web.sh +++ b/installers/ubuntu-20.04/install-partial/install_web.sh @@ -45,19 +45,17 @@ MYSQL_SCRIPT echo "$MYSQL_ROOT_PASSWORD" > /root/.mysql_root_password # Configure the application -cp phyre-config.ini.example phyre-config.ini +phyre-php artisan phyre:set-ini-settings APP_URL "127.0.0.1:8443" +phyre-php artisan phyre:set-ini-settings APP_ENV "production" +phyre-php artisan phyre:set-ini-settings APP_NAME "PHYRE_PANEL" +phyre-php artisan phyre:set-ini-settings DB_DATABASE "$PHYRE_PANEL_DB_NAME" +phyre-php artisan phyre:set-ini-settings DB_USERNAME "$PHYRE_PANEL_DB_USER" +phyre-php artisan phyre:set-ini-settings DB_PASSWORD "$PHYRE_PANEL_DB_PASSWORD" +phyre-php artisan phyre:set-ini-settings DB_CONNECTION "mysql" +phyre-php artisan phyre:set-ini-settings MYSQL_ROOT_USERNAME "$MYSQL_PHYRE_ROOT_USERNAME" +phyre-php artisan phyre:set-ini-settings MYSQL_ROOT_PASSWORD "$MYSQL_PHYRE_ROOT_PASSWORD" +phyre-php artisan phyre:key-generate -sed -i "s/^APP_URL=.*/APP_URL=127.0.0.1:8443" phyre-config.ini -sed -i "s/^APP_NAME=.*/APP_NAME=PHYRE_PANEL/" phyre-config.ini -sed -i "s/^DB_DATABASE=.*/DB_DATABASE=$PHYRE_PANEL_DB_NAME/" phyre-config.ini -sed -i "s/^DB_USERNAME=.*/DB_USERNAME=$PHYRE_PANEL_DB_USER/" phyre-config.ini -sed -i "s/^DB_PASSWORD=.*/DB_PASSWORD=$PHYRE_PANEL_DB_PASSWORD/" phyre-config.ini -sed -i "s/^DB_CONNECTION=.*/DB_CONNECTION=mysql/" phyre-config.ini - -sed -i "s/^MYSQL_ROOT_USERNAME=.*/MYSQL_ROOT_USERNAME=$MYSQL_PHYRE_ROOT_USERNAME/" phyre-config.ini -sed -i "s/^MYSQL_ROOT_PASSWORD=.*/MYSQL_ROOT_PASSWORD=$MYSQL_PHYRE_ROOT_PASSWORD/" phyre-config.ini - -phyre-php artisan key:generate phyre-php artisan migrate phyre-php artisan db:seed diff --git a/installers/ubuntu-20.04/install.sh b/installers/ubuntu-20.04/install.sh index 9333f40..1a5d62e 100644 --- a/installers/ubuntu-20.04/install.sh +++ b/installers/ubuntu-20.04/install.sh @@ -126,19 +126,17 @@ MYSQL_SCRIPT echo "$MYSQL_ROOT_PASSWORD" > /root/.mysql_root_password # Configure the application -cp phyre-config.ini.example phyre-config.ini +phyre-php artisan phyre:set-ini-settings APP_URL "127.0.0.1:8443" +phyre-php artisan phyre:set-ini-settings APP_ENV "production" +phyre-php artisan phyre:set-ini-settings APP_NAME "PHYRE_PANEL" +phyre-php artisan phyre:set-ini-settings DB_DATABASE "$PHYRE_PANEL_DB_NAME" +phyre-php artisan phyre:set-ini-settings DB_USERNAME "$PHYRE_PANEL_DB_USER" +phyre-php artisan phyre:set-ini-settings DB_PASSWORD "$PHYRE_PANEL_DB_PASSWORD" +phyre-php artisan phyre:set-ini-settings DB_CONNECTION "mysql" +phyre-php artisan phyre:set-ini-settings MYSQL_ROOT_USERNAME "$MYSQL_PHYRE_ROOT_USERNAME" +phyre-php artisan phyre:set-ini-settings MYSQL_ROOT_PASSWORD "$MYSQL_PHYRE_ROOT_PASSWORD" +phyre-php artisan phyre:key-generate -sed -i "s/^APP_URL=.*/APP_URL=127.0.0.1:8443" phyre-config.ini -sed -i "s/^APP_NAME=.*/APP_NAME=PHYRE_PANEL/" phyre-config.ini -sed -i "s/^DB_DATABASE=.*/DB_DATABASE=$PHYRE_PANEL_DB_NAME/" phyre-config.ini -sed -i "s/^DB_USERNAME=.*/DB_USERNAME=$PHYRE_PANEL_DB_USER/" phyre-config.ini -sed -i "s/^DB_PASSWORD=.*/DB_PASSWORD=$PHYRE_PANEL_DB_PASSWORD/" phyre-config.ini -sed -i "s/^DB_CONNECTION=.*/DB_CONNECTION=mysql/" phyre-config.ini - -sed -i "s/^MYSQL_ROOT_USERNAME=.*/MYSQL_ROOT_USERNAME=$MYSQL_PHYRE_ROOT_USERNAME/" phyre-config.ini -sed -i "s/^MYSQL_ROOT_PASSWORD=.*/MYSQL_ROOT_PASSWORD=$MYSQL_PHYRE_ROOT_PASSWORD/" phyre-config.ini - -phyre-php artisan key:generate phyre-php artisan migrate phyre-php artisan db:seed diff --git a/installers/ubuntu-22.04/install-partial/install_web.sh b/installers/ubuntu-22.04/install-partial/install_web.sh index 98eb2af..8201b85 100644 --- a/installers/ubuntu-22.04/install-partial/install_web.sh +++ b/installers/ubuntu-22.04/install-partial/install_web.sh @@ -45,19 +45,17 @@ MYSQL_SCRIPT echo "$MYSQL_ROOT_PASSWORD" > /root/.mysql_root_password # Configure the application -cp phyre-config.ini.example phyre-config.ini +phyre-php artisan phyre:set-ini-settings APP_URL "127.0.0.1:8443" +phyre-php artisan phyre:set-ini-settings APP_ENV "production" +phyre-php artisan phyre:set-ini-settings APP_NAME "PHYRE_PANEL" +phyre-php artisan phyre:set-ini-settings DB_DATABASE "$PHYRE_PANEL_DB_NAME" +phyre-php artisan phyre:set-ini-settings DB_USERNAME "$PHYRE_PANEL_DB_USER" +phyre-php artisan phyre:set-ini-settings DB_PASSWORD "$PHYRE_PANEL_DB_PASSWORD" +phyre-php artisan phyre:set-ini-settings DB_CONNECTION "mysql" +phyre-php artisan phyre:set-ini-settings MYSQL_ROOT_USERNAME "$MYSQL_PHYRE_ROOT_USERNAME" +phyre-php artisan phyre:set-ini-settings MYSQL_ROOT_PASSWORD "$MYSQL_PHYRE_ROOT_PASSWORD" +phyre-php artisan phyre:key-generate -sed -i "s/^APP_URL=.*/APP_URL=127.0.0.1:8443" phyre-config.ini -sed -i "s/^APP_NAME=.*/APP_NAME=PHYRE_PANEL/" phyre-config.ini -sed -i "s/^DB_DATABASE=.*/DB_DATABASE=$PHYRE_PANEL_DB_NAME/" phyre-config.ini -sed -i "s/^DB_USERNAME=.*/DB_USERNAME=$PHYRE_PANEL_DB_USER/" phyre-config.ini -sed -i "s/^DB_PASSWORD=.*/DB_PASSWORD=$PHYRE_PANEL_DB_PASSWORD/" phyre-config.ini -sed -i "s/^DB_CONNECTION=.*/DB_CONNECTION=mysql/" phyre-config.ini - -sed -i "s/^MYSQL_ROOT_USERNAME=.*/MYSQL_ROOT_USERNAME=$MYSQL_PHYRE_ROOT_USERNAME/" phyre-config.ini -sed -i "s/^MYSQL_ROOT_PASSWORD=.*/MYSQL_ROOT_PASSWORD=$MYSQL_PHYRE_ROOT_PASSWORD/" phyre-config.ini - -phyre-php artisan key:generate phyre-php artisan migrate phyre-php artisan db:seed diff --git a/installers/ubuntu-22.04/install.sh b/installers/ubuntu-22.04/install.sh index 1c426a7..6928bcc 100644 --- a/installers/ubuntu-22.04/install.sh +++ b/installers/ubuntu-22.04/install.sh @@ -128,19 +128,17 @@ MYSQL_SCRIPT echo "$MYSQL_ROOT_PASSWORD" > /root/.mysql_root_password # Configure the application -cp phyre-config.ini.example phyre-config.ini +phyre-php artisan phyre:set-ini-settings APP_URL "127.0.0.1:8443" +phyre-php artisan phyre:set-ini-settings APP_ENV "production" +phyre-php artisan phyre:set-ini-settings APP_NAME "PHYRE_PANEL" +phyre-php artisan phyre:set-ini-settings DB_DATABASE "$PHYRE_PANEL_DB_NAME" +phyre-php artisan phyre:set-ini-settings DB_USERNAME "$PHYRE_PANEL_DB_USER" +phyre-php artisan phyre:set-ini-settings DB_PASSWORD "$PHYRE_PANEL_DB_PASSWORD" +phyre-php artisan phyre:set-ini-settings DB_CONNECTION "mysql" +phyre-php artisan phyre:set-ini-settings MYSQL_ROOT_USERNAME "$MYSQL_PHYRE_ROOT_USERNAME" +phyre-php artisan phyre:set-ini-settings MYSQL_ROOT_PASSWORD "$MYSQL_PHYRE_ROOT_PASSWORD" +phyre-php artisan phyre:key-generate -sed -i "s/^APP_URL=.*/APP_URL=127.0.0.1:8443" phyre-config.ini -sed -i "s/^APP_NAME=.*/APP_NAME=PHYRE_PANEL/" phyre-config.ini -sed -i "s/^DB_DATABASE=.*/DB_DATABASE=$PHYRE_PANEL_DB_NAME/" phyre-config.ini -sed -i "s/^DB_USERNAME=.*/DB_USERNAME=$PHYRE_PANEL_DB_USER/" phyre-config.ini -sed -i "s/^DB_PASSWORD=.*/DB_PASSWORD=$PHYRE_PANEL_DB_PASSWORD/" phyre-config.ini -sed -i "s/^DB_CONNECTION=.*/DB_CONNECTION=mysql/" phyre-config.ini - -sed -i "s/^MYSQL_ROOT_USERNAME=.*/MYSQL_ROOT_USERNAME=$MYSQL_PHYRE_ROOT_USERNAME/" phyre-config.ini -sed -i "s/^MYSQL_ROOT_PASSWORD=.*/MYSQL_ROOT_PASSWORD=$MYSQL_PHYRE_ROOT_PASSWORD/" phyre-config.ini - -phyre-php artisan key:generate phyre-php artisan migrate phyre-php artisan db:seed diff --git a/web/app/Console/Commands/KeyGenerate.php b/web/app/Console/Commands/KeyGenerate.php new file mode 100644 index 0000000..e0d4253 --- /dev/null +++ b/web/app/Console/Commands/KeyGenerate.php @@ -0,0 +1,38 @@ +setValue('APP_KEY', $randomAppKey, 'phyre'); + $ini->save(); + + $this->info('Application key set successfully.'); + + } +} diff --git a/web/app/Console/Commands/SetIniSettings.php b/web/app/Console/Commands/SetIniSettings.php index c668ad6..b8a4a0b 100644 --- a/web/app/Console/Commands/SetIniSettings.php +++ b/web/app/Console/Commands/SetIniSettings.php @@ -13,7 +13,7 @@ class SetIniSettings extends Command * * @var string */ - protected $signature = 'phyre:set-ini-settings'; + protected $signature = 'phyre:set-ini-settings {key} {value}'; /** * The console command description. @@ -27,9 +27,12 @@ class SetIniSettings extends Command */ public function handle() { -// $ini = new IniModifier('phyre-config.ini'); -// $ini->setValue($key, $value, 'phyre'); -// $ini->save(); + $key = $this->argument('key'); + $value = $this->argument('value'); + + $ini = new IniModifier('phyre-config.ini'); + $ini->setValue($key, $value, 'phyre'); + $ini->save(); } }