Convert .env file to env.php to mask critical info
This commit is contained in:
@@ -0,0 +1,40 @@
|
|||||||
|
# Disable index view
|
||||||
|
Options -Indexes
|
||||||
|
|
||||||
|
# Hide a specific file
|
||||||
|
<Files .env>
|
||||||
|
Order allow,deny
|
||||||
|
Deny from all
|
||||||
|
</Files>
|
||||||
|
|
||||||
|
<Files env.php>
|
||||||
|
Order allow,deny
|
||||||
|
Deny from all
|
||||||
|
</Files>
|
||||||
|
|
||||||
|
# Hide a specific file
|
||||||
|
<Files storage>
|
||||||
|
Order allow,deny
|
||||||
|
Deny from all
|
||||||
|
</Files>
|
||||||
|
|
||||||
|
<IfModule mod_rewrite.c>
|
||||||
|
<IfModule mod_negotiation.c>
|
||||||
|
Options -MultiViews
|
||||||
|
</IfModule>
|
||||||
|
|
||||||
|
RewriteEngine On
|
||||||
|
|
||||||
|
# Redirect Trailing Slashes If Not A Folder...
|
||||||
|
RewriteCond %{REQUEST_FILENAME} !-d
|
||||||
|
RewriteRule ^(.*)/$ /$1 [L,R=301]
|
||||||
|
|
||||||
|
# Handle Front Controller...
|
||||||
|
RewriteCond %{REQUEST_FILENAME} !-d
|
||||||
|
RewriteCond %{REQUEST_FILENAME} !-f
|
||||||
|
RewriteRule ^ index.php [L]
|
||||||
|
|
||||||
|
# Handle Authorization Header
|
||||||
|
RewriteCond %{HTTP:Authorization} .
|
||||||
|
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
|
||||||
|
</IfModule>
|
||||||
@@ -18,7 +18,7 @@ class Application extends LaravelApplication
|
|||||||
{
|
{
|
||||||
parent::__construct(dirname(__DIR__) . '/');
|
parent::__construct(dirname(__DIR__) . '/');
|
||||||
|
|
||||||
$this->loadEnvironmentFrom('.env');
|
$this->loadEnvironmentFrom('env.php');
|
||||||
$this->useDatabasePath($this->basePath . '/app/Database');
|
$this->useDatabasePath($this->basePath . '/app/Database');
|
||||||
$this->useStoragePath($this->basePath . '/storage');
|
$this->useStoragePath($this->basePath . '/storage');
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,46 @@
|
|||||||
|
<?php
|
||||||
|
exit();
|
||||||
|
?>
|
||||||
|
|
||||||
|
#
|
||||||
|
# Before you go live, remember to change the APP_ENV to production
|
||||||
|
# and APP_DEBUG to false. Adjust logging to taste
|
||||||
|
#
|
||||||
|
|
||||||
|
APP_ENV=dev
|
||||||
|
APP_URL=http://localhost
|
||||||
|
APP_SKIN=default
|
||||||
|
APP_KEY=base64:zdgcDqu9PM8uGWCtMxd74ZqdGJIrnw812oRMmwDF6KY=
|
||||||
|
APP_DEBUG=true
|
||||||
|
APP_LOCALE=en
|
||||||
|
|
||||||
|
PHPVMS_INSTALLED=true
|
||||||
|
VACENTRAL_API_KEY=
|
||||||
|
|
||||||
|
APP_LOG=daily
|
||||||
|
APP_LOG_LEVEL=debug
|
||||||
|
APP_LOG_MAX_FILES=3
|
||||||
|
|
||||||
|
DB_CONNECTION=sqlite
|
||||||
|
#DB_CONNECTION=mysql
|
||||||
|
DB_HOST=localhost
|
||||||
|
DB_PORT=3306
|
||||||
|
DB_DATABASE=phpvms
|
||||||
|
DB_USERNAME=root
|
||||||
|
DB_PASSWORD=
|
||||||
|
DB_PREFIX=
|
||||||
|
|
||||||
|
MAIL_DRIVER=smtp
|
||||||
|
MAIL_FROM_ADDRESS=no-reply@phpvms.net
|
||||||
|
MAIL_FROM_NAME="phpVMS Admin"
|
||||||
|
MAIL_HOST=smtp.mailgun.org
|
||||||
|
MAIL_PORT=587
|
||||||
|
MAIL_ENCRYPTION=tls
|
||||||
|
MAIL_USERNAME=
|
||||||
|
MAIL_PASSWORD=
|
||||||
|
|
||||||
|
CACHE_DRIVER=file
|
||||||
|
CACHE_PREFIX=
|
||||||
|
|
||||||
|
SESSION_DRIVER=file
|
||||||
|
QUEUE_DRIVER=database
|
||||||
@@ -5,7 +5,7 @@ return [
|
|||||||
'version' => '7.0.0'
|
'version' => '7.0.0'
|
||||||
],
|
],
|
||||||
|
|
||||||
'env_postfix' => '',
|
'env_filename' => 'env.php',
|
||||||
|
|
||||||
'extensions' => [
|
'extensions' => [
|
||||||
'openssl',
|
'openssl',
|
||||||
|
|||||||
@@ -86,8 +86,8 @@ class EnvironmentService
|
|||||||
*/
|
*/
|
||||||
protected function writeEnvFile($opts)
|
protected function writeEnvFile($opts)
|
||||||
{
|
{
|
||||||
$env_file = \App::environmentFilePath();
|
$env_file = \App::environmentPath();
|
||||||
$env_file .= config('installer.env_postfix');
|
$env_file .= config('installer.env_filename');
|
||||||
|
|
||||||
# render it within Blade and log the contents
|
# render it within Blade and log the contents
|
||||||
$env_contents = view('installer::stubs/env', $opts);
|
$env_contents = view('installer::stubs/env', $opts);
|
||||||
|
|||||||
@@ -7,6 +7,11 @@ Options -Indexes
|
|||||||
Deny from all
|
Deny from all
|
||||||
</Files>
|
</Files>
|
||||||
|
|
||||||
|
<Files env.php>
|
||||||
|
Order allow,deny
|
||||||
|
Deny from all
|
||||||
|
</Files>
|
||||||
|
|
||||||
# Hide a specific file
|
# Hide a specific file
|
||||||
<Files storage>
|
<Files storage>
|
||||||
Order allow,deny
|
Order allow,deny
|
||||||
|
|||||||
@@ -14,11 +14,7 @@ $path_to_phpvms_folder = __DIR__.'/../';
|
|||||||
|
|
||||||
require $path_to_phpvms_folder.'/bootstrap/autoload.php';
|
require $path_to_phpvms_folder.'/bootstrap/autoload.php';
|
||||||
|
|
||||||
/**
|
|
||||||
* @var $app Illuminate\Foundation\Application
|
|
||||||
*/
|
|
||||||
$app = require_once $path_to_phpvms_folder.'/bootstrap/app.php';
|
$app = require_once $path_to_phpvms_folder.'/bootstrap/app.php';
|
||||||
|
|
||||||
$app->setPublicPath(__DIR__);
|
$app->setPublicPath(__DIR__);
|
||||||
|
|
||||||
$kernel = $app->make(Illuminate\Contracts\Http\Kernel::class);
|
$kernel = $app->make(Illuminate\Contracts\Http\Kernel::class);
|
||||||
|
|||||||
Reference in New Issue
Block a user