[PR #886] [MERGED] Non interactive koel:init #1417

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

📋 Pull Request Information

Original PR: https://github.com/koel/koel/pull/886
Author: @javier-lopez
Created: 12/31/2018
Status: Merged
Merged: 1/1/2019
Merged by: @phanan

Base: masterHead: non-interactive-koel-init


📝 Commits (6)

  • 6866663 Use ADMIN_* variables if available to create the admin account
  • 5ee2009 Add APP_MEDIA_PATH for media directory
  • 3ea4bc7 Use the standard --no-interaction flag to koel:init
  • 5b9c034 Undo variable aligment and code formatting
  • cca03c5 Prefer early return over else, add new line before return statements
  • 397b8ff Some fixes

📊 Changes

8 files changed (+98 additions, -36 deletions)

View changed files

📝 .env.example (+13 -0)
📝 app/Console/Commands/InitCommand.php (+66 -18)
📝 app/Repositories/AbstractRepository.php (+10 -2)
📝 app/Repositories/SongRepository.php (+2 -2)
📝 app/Services/MediaMetadataService.php (+2 -2)
📝 app/Services/MediaSyncService.php (+2 -2)
📝 config/koel.php (+2 -0)
📝 tests/Integration/Repositories/SongRepositoryTest.php (+1 -10)

📄 Description

As per github.com/phanan/koel@e1b68cc53f (diff-ac5db72ed5) (Dec 3, 2017), the admin account is NOT set in the .env file and created during initial database seeding anymore, therefore it's required to run:

$ php artisan koel:init

In interactive mode to configure koel, such process can be automatized with expect but IMHO it could be better if it uses environment variables when available.

This PR re enable:

And add:

  • APP_MEDIA_PATH=/music

To be able to run $ php artisan koel:init in non interactive mode


🔄 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/886 **Author:** [@javier-lopez](https://github.com/javier-lopez) **Created:** 12/31/2018 **Status:** ✅ Merged **Merged:** 1/1/2019 **Merged by:** [@phanan](https://github.com/phanan) **Base:** `master` ← **Head:** `non-interactive-koel-init` --- ### 📝 Commits (6) - [`6866663`](https://github.com/koel/koel/commit/68666632aed79d318ed3e6f4eb836be3fe642c25) Use ADMIN_* variables if available to create the admin account - [`5ee2009`](https://github.com/koel/koel/commit/5ee2009655efedb00c775f211301a35df5106097) Add APP_MEDIA_PATH for media directory - [`3ea4bc7`](https://github.com/koel/koel/commit/3ea4bc7b792a41fad8a11078a34126145fc8c031) Use the standard --no-interaction flag to koel:init - [`5b9c034`](https://github.com/koel/koel/commit/5b9c0342097fd311e2cf7301d5b600eb1fb68ebf) Undo variable aligment and code formatting - [`cca03c5`](https://github.com/koel/koel/commit/cca03c599f19c2b5b1e16db22f7d4c33a0244ed1) Prefer early return over else, add new line before return statements - [`397b8ff`](https://github.com/koel/koel/commit/397b8ff6e67b5b0fdac7314643ef0763f32ef2e3) Some fixes ### 📊 Changes **8 files changed** (+98 additions, -36 deletions) <details> <summary>View changed files</summary> 📝 `.env.example` (+13 -0) 📝 `app/Console/Commands/InitCommand.php` (+66 -18) 📝 `app/Repositories/AbstractRepository.php` (+10 -2) 📝 `app/Repositories/SongRepository.php` (+2 -2) 📝 `app/Services/MediaMetadataService.php` (+2 -2) 📝 `app/Services/MediaSyncService.php` (+2 -2) 📝 `config/koel.php` (+2 -0) 📝 `tests/Integration/Repositories/SongRepositoryTest.php` (+1 -10) </details> ### 📄 Description As per https://github.com/phanan/koel/commit/e1b68cc53ff078429a968cb360ea250c1bc1b589#diff-ac5db72ed5e3c5612246e80cb231cacf (Dec 3, 2017), the admin account is NOT set in the `.env` file and created during initial database seeding anymore, therefore it's required to run: $ php artisan koel:init In **interactive mode** to configure koel, such process can be automatized with [expect](https://github.com/binhex/arch-koel/blob/938e4ce2646c180b5ea069f589487be2675eb24f/config/nobody/koel/init.exp) but IMHO it could be better if it uses environment variables when available. This PR re enable: - ADMIN_EMAIL=admin@example.com - ADMIN_NAME=admin - ADMIN_PASSWORD=admin And add: - APP_MEDIA_PATH=/music To be able to run `$ php artisan koel:init` in **non interactive mode** --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-26 03:30:56 +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#1417
No description provided.