mirror of
https://github.com/PhyreApps/PhyrePanel.git
synced 2024-11-21 23:20:24 +00:00
update
This commit is contained in:
parent
28a9f2392d
commit
35d8bf58a5
11 changed files with 18 additions and 12 deletions
|
@ -98,7 +98,7 @@ RUN cp .env.example .env \
|
|||
&& sed -i "s/^DB_USERNAME=.*/DB_USERNAME=$PANEL_DB_USER/" .env \
|
||||
&& sed -i "s/^DB_PASSWORD=.*/DB_PASSWORD=$PANEL_DB_PASSWORD/" .env \
|
||||
&& sed -i "s/^DB_CONNECTION=.*/DB_CONNECTION=mysql/" .env \
|
||||
&& sed -i "s/^MYSQl_ROOT_USERNAME=.*/MYSQl_ROOT_USERNAME=$MYSQL_ROOT_USERNAME/" .env \
|
||||
&& sed -i "s/^MYSQL_ROOT_USERNAME=.*/MYSQL_ROOT_USERNAME=$MYSQL_ROOT_USERNAME/" .env \
|
||||
&& sed -i "s/^MYSQL_ROOT_PASSWORD=.*/MYSQL_ROOT_PASSWORD=$MYSQL_ROOT_PASSWORD/" .env
|
||||
|
||||
# Generate application key and migrate database
|
||||
|
|
|
@ -130,7 +130,7 @@ sed -i "s/^DB_USERNAME=.*/DB_USERNAME=$PANEL_DB_USER/" .env
|
|||
sed -i "s/^DB_PASSWORD=.*/DB_PASSWORD=$PANEL_DB_PASSWORD/" .env
|
||||
sed -i "s/^DB_CONNECTION=.*/DB_CONNECTION=mysql/" .env
|
||||
|
||||
sed -i "s/^MYSQl_ROOT_USERNAME=.*/MYSQl_ROOT_USERNAME=$MYSQL_ROOT_USERNAME/" .env
|
||||
sed -i "s/^MYSQL_ROOT_USERNAME=.*/MYSQL_ROOT_USERNAME=$MYSQL_ROOT_USERNAME/" .env
|
||||
sed -i "s/^MYSQL_ROOT_PASSWORD=.*/MYSQL_ROOT_PASSWORD=$MYSQL_ROOT_PASSWORD/" .env
|
||||
|
||||
phyre-php artisan key:generate
|
||||
|
|
|
@ -54,7 +54,7 @@ sed -i "s/^DB_USERNAME=.*/DB_USERNAME=$PHYRE_PANEL_DB_USER/" .env
|
|||
sed -i "s/^DB_PASSWORD=.*/DB_PASSWORD=$PHYRE_PANEL_DB_PASSWORD/" .env
|
||||
sed -i "s/^DB_CONNECTION=.*/DB_CONNECTION=mysql/" .env
|
||||
|
||||
sed -i "s/^MYSQl_ROOT_USERNAME=.*/MYSQl_ROOT_USERNAME=$MYSQL_PHYRE_ROOT_USERNAME/" .env
|
||||
sed -i "s/^MYSQL_ROOT_USERNAME=.*/MYSQL_ROOT_USERNAME=$MYSQL_PHYRE_ROOT_USERNAME/" .env
|
||||
sed -i "s/^MYSQL_ROOT_PASSWORD=.*/MYSQL_ROOT_PASSWORD=$MYSQL_PHYRE_ROOT_PASSWORD/" .env
|
||||
|
||||
phyre-php artisan key:generate
|
||||
|
|
|
@ -135,7 +135,7 @@ sed -i "s/^DB_USERNAME=.*/DB_USERNAME=$PHYRE_PANEL_DB_USER/" .env
|
|||
sed -i "s/^DB_PASSWORD=.*/DB_PASSWORD=$PHYRE_PANEL_DB_PASSWORD/" .env
|
||||
sed -i "s/^DB_CONNECTION=.*/DB_CONNECTION=mysql/" .env
|
||||
|
||||
sed -i "s/^MYSQl_ROOT_USERNAME=.*/MYSQl_ROOT_USERNAME=$MYSQL_PHYRE_ROOT_USERNAME/" .env
|
||||
sed -i "s/^MYSQL_ROOT_USERNAME=.*/MYSQL_ROOT_USERNAME=$MYSQL_PHYRE_ROOT_USERNAME/" .env
|
||||
sed -i "s/^MYSQL_ROOT_PASSWORD=.*/MYSQL_ROOT_PASSWORD=$MYSQL_PHYRE_ROOT_PASSWORD/" .env
|
||||
|
||||
phyre-php artisan key:generate
|
||||
|
|
|
@ -54,7 +54,7 @@ sed -i "s/^DB_USERNAME=.*/DB_USERNAME=$PHYRE_PANEL_DB_USER/" .env
|
|||
sed -i "s/^DB_PASSWORD=.*/DB_PASSWORD=$PHYRE_PANEL_DB_PASSWORD/" .env
|
||||
sed -i "s/^DB_CONNECTION=.*/DB_CONNECTION=mysql/" .env
|
||||
|
||||
sed -i "s/^MYSQl_ROOT_USERNAME=.*/MYSQl_ROOT_USERNAME=$MYSQL_PHYRE_ROOT_USERNAME/" .env
|
||||
sed -i "s/^MYSQL_ROOT_USERNAME=.*/MYSQL_ROOT_USERNAME=$MYSQL_PHYRE_ROOT_USERNAME/" .env
|
||||
sed -i "s/^MYSQL_ROOT_PASSWORD=.*/MYSQL_ROOT_PASSWORD=$MYSQL_PHYRE_ROOT_PASSWORD/" .env
|
||||
|
||||
phyre-php artisan key:generate
|
||||
|
|
|
@ -137,7 +137,7 @@ sed -i "s/^DB_USERNAME=.*/DB_USERNAME=$PHYRE_PANEL_DB_USER/" .env
|
|||
sed -i "s/^DB_PASSWORD=.*/DB_PASSWORD=$PHYRE_PANEL_DB_PASSWORD/" .env
|
||||
sed -i "s/^DB_CONNECTION=.*/DB_CONNECTION=mysql/" .env
|
||||
|
||||
sed -i "s/^MYSQl_ROOT_USERNAME=.*/MYSQl_ROOT_USERNAME=$MYSQL_PHYRE_ROOT_USERNAME/" .env
|
||||
sed -i "s/^MYSQL_ROOT_USERNAME=.*/MYSQL_ROOT_USERNAME=$MYSQL_PHYRE_ROOT_USERNAME/" .env
|
||||
sed -i "s/^MYSQL_ROOT_PASSWORD=.*/MYSQL_ROOT_PASSWORD=$MYSQL_PHYRE_ROOT_PASSWORD/" .env
|
||||
|
||||
phyre-php artisan key:generate
|
||||
|
|
|
@ -17,7 +17,7 @@ DB_PASSWORD=
|
|||
|
||||
MYSQL_HOST=127.0.0.1
|
||||
MYSQL_PORT=3306
|
||||
MYSQl_ROOT_USERNAME=root
|
||||
MYSQL_ROOT_USERNAME=root
|
||||
MYSQL_ROOT_PASSWORD=root
|
||||
|
||||
BROADCAST_DRIVER=log
|
||||
|
|
|
@ -206,7 +206,13 @@ class Backup extends Model
|
|||
$shellFileContent .= 'echo "Backup Phyre Panel files"'. PHP_EOL;
|
||||
|
||||
// Export Phyre Panel database
|
||||
$shellFileContent .= 'mysqldump -u "'.env('MYSQl_ROOT_USERNAME').'" -p"'.env('MYSQL_ROOT_PASSWORD').'" "'.env('DB_DATABASE').'" > '.$databaseBackupPath . PHP_EOL;
|
||||
$mysqlAuthConf = '/root/.phyre-mysql.cnf';
|
||||
$mysqlAuthContent = '[client]' . PHP_EOL;
|
||||
$mysqlAuthContent .= 'user="' . env('MYSQL_ROOT_USERNAME') .'"'. PHP_EOL;
|
||||
$mysqlAuthContent .= 'password="' . env('MYSQL_ROOT_PASSWORD') . '"' . PHP_EOL;
|
||||
file_put_contents($mysqlAuthConf, $mysqlAuthContent);
|
||||
|
||||
$shellFileContent .= 'mysqldump --defaults-extra-file='.$mysqlAuthConf.' "'.env('DB_DATABASE').'" > '.$databaseBackupPath . PHP_EOL;
|
||||
|
||||
// Export Phyre Panel ENV
|
||||
$getEnv = Dotenv::createArrayBacked(base_path())->load();
|
||||
|
@ -244,7 +250,7 @@ class Backup extends Model
|
|||
$databaseName = $database->database_name_prefix . $database->database_name;
|
||||
$shellFileContent .= 'echo "Backup up database: ' . $databaseName . '" ' . PHP_EOL;
|
||||
$databaseBackupPath = $hostingSubscriptionPath . '/databases/' . $databaseName . '.sql';
|
||||
$shellFileContent .= 'mysqldump -u "' . env('MYSQl_ROOT_USERNAME') . '" -p"' . env('MYSQL_ROOT_PASSWORD') . '" "' . $databaseName . '" > ' . $databaseBackupPath . PHP_EOL;
|
||||
$shellFileContent .= 'mysqldump --defaults-extra-file='.$mysqlAuthConf.' "' . $databaseName . '" > ' . $databaseBackupPath . PHP_EOL;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -62,7 +62,7 @@ class Database extends Model
|
|||
$universalDatabaseExecutor = new UniversalDatabaseExecutor(
|
||||
env('MYSQL_HOST'),
|
||||
env('MYSQL_PORT'),
|
||||
env('MYSQl_ROOT_USERNAME'),
|
||||
env('MYSQL_ROOT_USERNAME'),
|
||||
env('MYSQL_ROOT_PASSWORD'),
|
||||
);
|
||||
$createDatabase = $universalDatabaseExecutor->createDatabase($databaseName);
|
||||
|
|
|
@ -58,7 +58,7 @@ class DatabaseUser extends Model
|
|||
$universalDatabaseExecutor = new UniversalDatabaseExecutor(
|
||||
env('MYSQL_HOST'),
|
||||
env('MYSQL_PORT'),
|
||||
env('MYSQl_ROOT_USERNAME'),
|
||||
env('MYSQL_ROOT_USERNAME'),
|
||||
env('MYSQL_ROOT_PASSWORD'),
|
||||
$findDatabase->database_name_prefix . $findDatabase->database_name
|
||||
);
|
||||
|
|
|
@ -218,7 +218,7 @@ class HostingSubscriptionBackup extends Model
|
|||
$shellFileContent .= 'echo "Backup up database: ' . $databaseName .'" '. PHP_EOL;
|
||||
$shellFileContent .= 'mkdir -p '.$backupTempPath . '/databases' . PHP_EOL;
|
||||
$databaseBackupPath = $backupTempPath . '/databases/' . $databaseName . '.sql';
|
||||
$shellFileContent .= 'mysqldump -u "'.env('MYSQl_ROOT_USERNAME').'" -p"'.env('MYSQL_ROOT_PASSWORD').'" "'.$databaseName.'" > '.$databaseBackupPath . PHP_EOL;
|
||||
$shellFileContent .= 'mysqldump -u "'.env('MYSQL_ROOT_USERNAME').'" -p"'.env('MYSQL_ROOT_PASSWORD').'" "'.$databaseName.'" > '.$databaseBackupPath . PHP_EOL;
|
||||
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue