Skip to content

Firefly III: a personal finances manager

Include config for Heroku. [skip ci]

James Cole26ceb9e3be5d
diff --git a/.env.heroku b/.env.heroku
deleted file mode 100755
index 4e43d927b5..0000000000
--- a/.env.heroku
+++ /dev/null
@@ -1,56 +0,0 @@
-APP_ENV=production
-APP_DEBUG=false
-APP_FORCE_SSL=false
-APP_FORCE_ROOT=
-APP_KEY=SomeRandomStringOf32CharsExactly
-APP_LOG=errorlog
-APP_LOG_LEVEL=debug
-APP_URL=http://localhost
-
-DB_CONNECTION=sqlite
-DB_HOST=127.0.0.1
-DB_PORT=3306
-DB_USERNAME=homestead
-DB_PASSWORD=secret
-
-BROADCAST_DRIVER=log
-CACHE_DRIVER=file
-SESSION_DRIVER=file
-QUEUE_DRIVER=sync
-
-COOKIE_PATH="/"
-COOKIE_DOMAIN=
-COOKIE_SECURE=false
-
-REDIS_HOST=127.0.0.1
-REDIS_PASSWORD=null
-REDIS_PORT=6379
-
-MAIL_DRIVER=smtp
-MAIL_HOST=mailtrap.io
-MAIL_PORT=2525
-MAIL_USERNAME=null
-MAIL_PASSWORD=null
-MAIL_ENCRYPTION=null
-
-SEND_REGISTRATION_MAIL=true
-SEND_ERROR_MESSAGE=true
-SHOW_INCOMPLETE_TRANSLATIONS=false
-
-CACHE_PREFIX=firefly
-
-EXCHANGE_RATE_SERVICE=fixerio
-
-GOOGLE_MAPS_API_KEY=
-ANALYTICS_ID=
-USE_ENCRYPTION=true
-
-PUSHER_KEY=
-PUSHER_SECRET=
-PUSHER_APP_ID=
-
-DEMO_USERNAME=
-DEMO_PASSWORD=
-
diff --git a/composer.json b/composer.json
index a4b8b30613..0286006772 100755
--- a/composer.json
+++ b/composer.json
@@ -108,8 +108,6 @@
"php artisan optimize"
],
"compile": [
- "cp .env.heroku .env",
- "touch storage/database/database.sqlite",
"php artisan migrate:refresh --seed --force"
]
},
diff --git a/config/app.php b/config/app.php
index d1cf127ffb..1f0172e6b5 100644
--- a/config/app.php
+++ b/config/app.php
@@ -66,8 +66,8 @@ return [
// own stuff:
- Barryvdh\LaravelIdeHelper\IdeHelperServiceProvider::class,
- Barryvdh\Debugbar\ServiceProvider::class,
+ //Barryvdh\LaravelIdeHelper\IdeHelperServiceProvider::class,
+ //Barryvdh\Debugbar\ServiceProvider::class,
DaveJamesMiller\Breadcrumbs\ServiceProvider::class,
TwigBridge\ServiceProvider::class,
PragmaRX\Google2FA\Vendor\Laravel\ServiceProvider::class,
diff --git a/config/database.php b/config/database.php
index 52a0cd0494..e86461dd81 100644
--- a/config/database.php
+++ b/config/database.php
@@ -9,6 +9,21 @@
* See the LICENSE file for details.
*/
+// for heroku:
+$databaseUrl = getenv('DATABASE_URL');
+$host = '';
+$username = '';
+$password = '';
+$database = '';
+
+if (!($databaseUrl === false)) {
+ $options = parse_url($databaseUrl);
+ $host = $options['host'];
+ $username = $options['user'];
+ $password = $options['pass'];
+ $database = substr($options['path'], 1);
+}
+
return [
'fetch' => PDO::FETCH_OBJ,
@@ -36,11 +51,11 @@ return [
'pgsql' => [
'driver' => 'pgsql',
- 'host' => env('DB_HOST', 'localhost'),
+ 'host' => env('DB_HOST', $host),
'port' => env('DB_PORT', '5432'),
- 'database' => env('DB_DATABASE', 'forge'),
- 'username' => env('DB_USERNAME', 'forge'),
- 'password' => env('DB_PASSWORD', ''),
+ 'database' => env('DB_DATABASE', $database),
+ 'username' => env('DB_USERNAME', $username),
+ 'password' => env('DB_PASSWORD', $password),
'charset' => 'utf8',
'prefix' => '',
'schema' => 'public',