This commit is contained in:
Bozhidar 2024-05-10 19:12:23 +03:00
parent 3bd7dc7c6c
commit 6dac390f67
7 changed files with 51 additions and 112 deletions

View file

@ -45,17 +45,17 @@ MYSQL_SCRIPT
echo "$MYSQL_ROOT_PASSWORD" > /root/.mysql_root_password
# Configure the application
cp .env.example .env
cp phyre-config.ini.example phyre-config.ini
sed -i "s/^APP_URL=.*/APP_URL=127.0.0.1:8443" .env
sed -i "s/^APP_NAME=.*/APP_NAME=PHYRE_PANEL/" .env
sed -i "s/^DB_DATABASE=.*/DB_DATABASE=$PHYRE_PANEL_DB_NAME/" .env
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/^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/" .env
sed -i "s/^MYSQL_ROOT_PASSWORD=.*/MYSQL_ROOT_PASSWORD=$MYSQL_PHYRE_ROOT_PASSWORD/" .env
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

View file

@ -48,17 +48,17 @@ MYSQL_SCRIPT
echo "$MYSQL_ROOT_PASSWORD" > /root/.mysql_root_password
# Configure the application
cp .env.example .env
cp phyre-config.ini.example phyre-config.ini
sed -i "s/^APP_URL=.*/APP_URL=127.0.0.1:8443" .env
sed -i "s/^APP_NAME=.*/APP_NAME=PHYRE_PANEL/" .env
sed -i "s/^DB_DATABASE=.*/DB_DATABASE=$PHYRE_PANEL_DB_NAME/" .env
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/^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/" .env
sed -i "s/^MYSQL_ROOT_PASSWORD=.*/MYSQL_ROOT_PASSWORD=$MYSQL_PHYRE_ROOT_PASSWORD/" .env
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

View file

@ -129,17 +129,17 @@ MYSQL_SCRIPT
echo "$MYSQL_ROOT_PASSWORD" > /root/.mysql_root_password
# Configure the application
cp .env.example .env
cp phyre-config.ini.example phyre-config.ini
sed -i "s/^APP_URL=.*/APP_URL=127.0.0.1:8443" .env
sed -i "s/^APP_NAME=.*/APP_NAME=PHYRE_PANEL/" .env
sed -i "s/^DB_DATABASE=.*/DB_DATABASE=$PHYRE_PANEL_DB_NAME/" .env
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/^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/" .env
sed -i "s/^MYSQL_ROOT_PASSWORD=.*/MYSQL_ROOT_PASSWORD=$MYSQL_PHYRE_ROOT_PASSWORD/" .env
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

View file

@ -48,17 +48,17 @@ MYSQL_SCRIPT
echo "$MYSQL_ROOT_PASSWORD" > /root/.mysql_root_password
# Configure the application
cp .env.example .env
cp phyre-config.ini.example phyre-config.ini
sed -i "s/^APP_URL=.*/APP_URL=127.0.0.1:8443" .env
sed -i "s/^APP_NAME=.*/APP_NAME=PHYRE_PANEL/" .env
sed -i "s/^DB_DATABASE=.*/DB_DATABASE=$PHYRE_PANEL_DB_NAME/" .env
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/^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/" .env
sed -i "s/^MYSQL_ROOT_PASSWORD=.*/MYSQL_ROOT_PASSWORD=$MYSQL_PHYRE_ROOT_PASSWORD/" .env
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

View file

@ -131,17 +131,17 @@ MYSQL_SCRIPT
echo "$MYSQL_ROOT_PASSWORD" > /root/.mysql_root_password
# Configure the application
cp .env.example .env
cp phyre-config.ini.example phyre-config.ini
sed -i "s/^APP_URL=.*/APP_URL=127.0.0.1:8443" .env
sed -i "s/^APP_NAME=.*/APP_NAME=PHYRE_PANEL/" .env
sed -i "s/^DB_DATABASE=.*/DB_DATABASE=$PHYRE_PANEL_DB_NAME/" .env
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/^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/" .env
sed -i "s/^MYSQL_ROOT_PASSWORD=.*/MYSQL_ROOT_PASSWORD=$MYSQL_PHYRE_ROOT_PASSWORD/" .env
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

View file

@ -1,64 +0,0 @@
APP_NAME=Laravel
APP_ENV=local
APP_KEY=
APP_DEBUG=true
APP_URL=http://localhost
LOG_CHANNEL=stack
LOG_DEPRECATIONS_CHANNEL=null
LOG_LEVEL=debug
DB_CONNECTION=sqlite
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=laravel
DB_USERNAME=root
DB_PASSWORD=
MYSQL_HOST=127.0.0.1
MYSQL_PORT=3306
MYSQL_ROOT_USERNAME=root
MYSQL_ROOT_PASSWORD=root
BROADCAST_DRIVER=log
CACHE_DRIVER=file
FILESYSTEM_DISK=local
QUEUE_CONNECTION=sync
SESSION_DRIVER=file
SESSION_LIFETIME=120
MEMCACHED_HOST=127.0.0.1
REDIS_HOST=127.0.0.1
REDIS_PASSWORD=null
REDIS_PORT=6379
MAIL_MAILER=smtp
MAIL_HOST=mailpit
MAIL_PORT=1025
MAIL_USERNAME=null
MAIL_PASSWORD=null
MAIL_ENCRYPTION=null
MAIL_FROM_ADDRESS="hello@example.com"
MAIL_FROM_NAME="${APP_NAME}"
AWS_ACCESS_KEY_ID=
AWS_SECRET_ACCESS_KEY=
AWS_DEFAULT_REGION=us-east-1
AWS_BUCKET=
AWS_USE_PATH_STYLE_ENDPOINT=false
PUSHER_APP_ID=
PUSHER_APP_KEY=
PUSHER_APP_SECRET=
PUSHER_HOST=
PUSHER_PORT=443
PUSHER_SCHEME=https
PUSHER_APP_CLUSTER=mt1
VITE_APP_NAME="${APP_NAME}"
VITE_PUSHER_APP_KEY="${PUSHER_APP_KEY}"
VITE_PUSHER_HOST="${PUSHER_HOST}"
VITE_PUSHER_PORT="${PUSHER_PORT}"
VITE_PUSHER_SCHEME="${PUSHER_SCHEME}"
VITE_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}"

View file

@ -7,9 +7,12 @@ class PhyreConfig
public static function get($key, $default = null)
{
// Parse without sections
$iniArray = parse_ini_file(base_path() . "/phyre-config.ini");
if (isset($iniArray[$key])) {
return $iniArray[$key];
$configIni = base_path() . "/phyre-config.ini";
if (file_exists($configIni)) {
$iniArray = parse_ini_file($configIni);
if (isset($iniArray[$key])) {
return $iniArray[$key];
}
}
return $default;