This commit is contained in:
Bozhidar 2024-05-10 19:31:28 +03:00
parent 64fe84a660
commit 75782e265a
7 changed files with 95 additions and 64 deletions

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -0,0 +1,38 @@
<?php
namespace App\Console\Commands;
use Illuminate\Console\Command;
use Jelix\IniFile\IniModifier;
class KeyGenerate extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'phyre:key-generate';
/**
* The console command description.
*
* @var string
*/
protected $description = 'Command description';
/**
* Execute the console command.
*/
public function handle()
{
$randomAppKey = 'base64:'.base64_encode(random_bytes(32));
$ini = new IniModifier('phyre-config.ini');
$ini->setValue('APP_KEY', $randomAppKey, 'phyre');
$ini->save();
$this->info('Application key set successfully.');
}
}

View file

@ -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();
}
}