[PR #409] [CLOSED] Populate dotenv to config #1238

Closed
opened 2026-02-26 02:35:55 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/koel/koel/pull/409
Author: @BernardGoldberger
Created: 8/17/2016
Status: Closed

Base: masterHead: moveENVtoConfig


📝 Commits (7)

  • 1045edd move env variables to config
  • 3e10fe8 wrote some comments for koel config
  • 6631b02 app key and jwt secret now use config
  • 4df7480 Fix to 408
  • c365400 fix styleci and clean run function
  • 032007b make styleci happy
  • 4e24e05 Update SongController.php

📊 Changes

12 files changed (+145 additions, -30 deletions)

View changed files

📝 app/Application.php (+1 -1)
📝 app/Console/Commands/Init.php (+2 -2)
📝 app/Http/Controllers/API/DataController.php (+1 -1)
📝 app/Http/Controllers/API/SongController.php (+2 -2)
📝 app/Http/Requests/API/Download/Request.php (+1 -1)
📝 app/Http/Streamers/TranscodingStreamer.php (+1 -1)
📝 app/Services/Lastfm.php (+3 -3)
📝 app/Services/Media.php (+1 -1)
📝 app/Services/YouTube.php (+2 -2)
📝 config/jwt.php (+2 -6)
config/koel.php (+112 -0)
📝 database/seeds/UserTableSeeder.php (+17 -10)

📄 Description

I noticed that occasionally I would have an error

[2016-08-10 00:23:08] production.ERROR: PDOException: SQLSTATE[HY000] [1045] Access denied for user 'forge'@'localhost' (using password: NO) in C:\wamp64\www\koel\vendor\laravel\framework\src\Illuminate\Database\Connectors\Connector.php:55

of course this make no sense since I have set the DB and password.

So I did some research and found 2 things

  1. dotenv should only be used in development, once in production it should all be cached.
  2. dotenv should only be populated in the config directory.

Here is a post https://github.com/vlucas/phpdotenv/issues/76#issuecomment-167806230 by @GrahamCampbell about this.

In this PR I created a separate config file koel.php for all Koel specific configurations, and I also fix https://github.com/phanan/koel/issues/408.

Going forward we can tell users to run php artisan config:cache once they finnished setting up Koel, or we could even make part of the koel:init command.

Note

I think this might in fact be the actual issue with https://github.com/phanan/koel/issues/393.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/koel/koel/pull/409 **Author:** [@BernardGoldberger](https://github.com/BernardGoldberger) **Created:** 8/17/2016 **Status:** ❌ Closed **Base:** `master` ← **Head:** `moveENVtoConfig` --- ### 📝 Commits (7) - [`1045edd`](https://github.com/koel/koel/commit/1045edd58b211102a66454a4702706af8b7a8349) move env variables to config - [`3e10fe8`](https://github.com/koel/koel/commit/3e10fe835b1083eff0880df3ce3675320b65afd3) wrote some comments for koel config - [`6631b02`](https://github.com/koel/koel/commit/6631b025f04a1be81b9f86cc4abf52e6e467cbe2) app key and jwt secret now use config - [`4df7480`](https://github.com/koel/koel/commit/4df748031b58578817c2e38c8b572fbe21e0784b) Fix to 408 - [`c365400`](https://github.com/koel/koel/commit/c365400a0d9a0d5be7e0d5b9d01368347c9c2c7f) fix styleci and clean run function - [`032007b`](https://github.com/koel/koel/commit/032007b397119ea2a8d8133c6b14c83c2135d055) make styleci happy - [`4e24e05`](https://github.com/koel/koel/commit/4e24e05fbf554ebd53e6a597e6fbd9c35414de6a) Update SongController.php ### 📊 Changes **12 files changed** (+145 additions, -30 deletions) <details> <summary>View changed files</summary> 📝 `app/Application.php` (+1 -1) 📝 `app/Console/Commands/Init.php` (+2 -2) 📝 `app/Http/Controllers/API/DataController.php` (+1 -1) 📝 `app/Http/Controllers/API/SongController.php` (+2 -2) 📝 `app/Http/Requests/API/Download/Request.php` (+1 -1) 📝 `app/Http/Streamers/TranscodingStreamer.php` (+1 -1) 📝 `app/Services/Lastfm.php` (+3 -3) 📝 `app/Services/Media.php` (+1 -1) 📝 `app/Services/YouTube.php` (+2 -2) 📝 `config/jwt.php` (+2 -6) ➕ `config/koel.php` (+112 -0) 📝 `database/seeds/UserTableSeeder.php` (+17 -10) </details> ### 📄 Description I noticed that occasionally I would have an error ``` [2016-08-10 00:23:08] production.ERROR: PDOException: SQLSTATE[HY000] [1045] Access denied for user 'forge'@'localhost' (using password: NO) in C:\wamp64\www\koel\vendor\laravel\framework\src\Illuminate\Database\Connectors\Connector.php:55 ``` of course this make no sense since I have set the DB and password. So I did some research and found 2 things 1. dotenv should only be used in development, once in production it should all be cached. 2. dotenv should only be populated in the config directory. Here is a post https://github.com/vlucas/phpdotenv/issues/76#issuecomment-167806230 by @GrahamCampbell about this. In this PR I created a separate config file `koel.php` for all Koel specific configurations, and I also fix https://github.com/phanan/koel/issues/408. Going forward we can tell users to run `php artisan config:cache` once they finnished setting up Koel, or we could even make part of the `koel:init` command. **Note** I think this might in fact be the actual issue with https://github.com/phanan/koel/issues/393. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-26 02:35:55 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/koel-koel#1238
No description provided.