Giter Site home page Giter Site logo

koel / docker Goto Github PK

View Code? Open in Web Editor NEW
164.0 5.0 51.0 208 KB

A minimal docker image for the koel music streaming server.

Home Page: https://hub.docker.com/r/phanan/koel/

License: MIT License

Dockerfile 57.45% Shell 3.63% Makefile 27.48% Nix 11.45%
koel docker hacktoberfest

docker's Introduction

koel/docker

docker-pulls-badge Continuous testing and deployment

A docker image with only the bare essentials needed to run koel. It includes apache and a php runtime with required extensions.

See the Changelog to keep track of changes to the image.

โš  Image changed to phanan/koel on 2022-04-15

This repository no longer updates hyzual/koel. The latest version is now at phanan/koel:latest.

Usage

Warning This container does not include a database. It requires another container to handle the database.

Since Koel supports many databases you are free to choose any Docker image that hosts one of those databases.

koel/docker (this image) has been tested with MariaDB/MySQL and PostgreSQL.

Run with docker-compose and MariaDB/MySQL

docker-compose is the easiest way to get started. It will start both the database container and this image. Clone this repository and edit docker-compose.mysql.yml. Make sure to replace passwords !

Check out the ./docker-compose.mysql.yml file for more details.

Then run docker-compose:

docker-compose -f ./docker-compose.mysql.yml up -d

Run with docker-compose and PostgreSQL

Clone this repository and edit docker-compose.postgres.yml. Make sure to replace passwords !

Check out the ./docker-compose.postgres.yml file for more details.

Then run docker-compose:

docker-compose -f ./docker-compose.postgres.yml up -d

First run

On the first run, you will need to:

  1. Generate APP_KEY
  2. Create an admin user
  3. Initialize the database

All these steps are achieved by running koel:init once:

Replace <container_name_for_koel> in the command by the actual container name.

docker exec --user www-data -it <container_name_for_koel> bash
# Once inside the container, you can run commands:
$ php artisan koel:init --no-assets

--no-assets option tells the init command to skip building the front-end assets, as they have been generated by Koel's "Release" GitHub action.

Default admin account

Note From v5.1.0, Koel no longer asks for a username, email and password for the admin account. Instead, it creates one automatically with the following credentials: email: [email protected] password: KoelIsCool

Make sure to change this unsecure password with the user interface (click on your profile picture) or by running the following command:

docker exec -it <container_name_for_koel> php artisan koel:admin:change-password

Run manually with MariaDB/MySQL

Create a docker network. It will be shared by Koel and its database.

docker network create --attachable koel-net

Create a database container. Here we will use mariadb.

docker run -d --name database \
    -e MYSQL_ROOT_PASSWORD=<root_password> \
    -e MYSQL_DATABASE=koel \
    -e MYSQL_USER=koel \
    -e MYSQL_PASSWORD=<koel_password> \
    --network=koel-net \
    -v koel_db:/var/lib/mysql \
    mariadb:10.11

Create the koel container on the same network so they can communicate

docker run -d --name koel \
    -p 80:80 \
    -e DB_CONNECTION=mysql \
    -e DB_HOST=database \
    -e DB_DATABASE=koel \
    -e DB_USERNAME=koel \
    -e DB_PASSWORD=<koel_password> \
    --network=koel-net \
    -v music:/music \
    -v covers:/var/www/html/public/img/covers \
    -v search_index:/var/www/html/storage/search-indexes \
    phanan/koel

The same applies for the first run. See the First run section.

How to bind-mount the .env file

To be sure to preserve APP_KEY you can choose to bind-mount the .env file to your host:

# On your host, create an `.env` file:
touch .env
# Then, you can bind-mount it directly in the container.
docker run -d --name koel \
    -p 80:80 \
    --mount type=bind,source="$(pwd)"/.env,target=/var/www/html/.env \
    phanan/koel
docker exec --user www-data -it koel bash
# In the container, init
$ php artisan koel:init --no-assets

Pass environment variables

Once you have generated an APP_KEY you can provide it as environment variables to your container to preserve it.

# Run a container just to generate the key
docker run -it --rm phanan/koel bash
# In the container, generate APP_KEY
$ php artisan key:generate --force
# Show the modified .env file
$ cat .env
# Copy the APP_KEY variable
$ exit

You can then provide the variables to your real container:

docker run -d --name koel \
    -p 80:80 \
    -e APP_KEY=<your_app_key> \
    phanan/koel
# Even better, write an env-file in your host and pass it to the container
docker run -d --name koel \
    -p 80:80 \
    --env-file .koel.env \
    phanan/koel

Scan media folders

Whenever the music in /music changes, you will need to manually scan it before koel is able to play it. Run the following command:

docker exec --user www-data <container_name_for_koel> php artisan koel:sync

Populate the search indexes

If you were running a version of Koel prior to v5.0.2, the search mechanism has changed and needs a step to index songs, albums and artists. Run the following command:

docker exec --user www-data <container_name_for_koel> php artisan koel:search:import

For all new songs, the search index will be automatically populated by php artisan koel:sync. No need to run the php artisan koel:search:import again ๐Ÿ™‚.

Useful environment variables

See .env.example for reference.

  • DB_CONNECTION: mysql OR pgsql OR sqlsrv OR sqlite-persistent. Corresponds to the type of database being used with Koel.
  • DB_HOST: database. The name of the Docker container hosting the database. Koel needs to be on the same Docker network to find the database by its name.
  • DB_USERNAME: koel. If you change it, also change it in the database container.
  • DB_PASSWORD: The password credential matching DB_USERNAME. If you change it, also change it in the database container.
  • DB_DATABASE: koel. The database name for Koel. If you change it, also change it in the database container.
  • APP_KEY: A base64-encoded string, generated by php artisan koel:init or by php artisan key:generate.
  • FORCE_HTTPS: If set to true, all URLs redirects done by koel will use https. If you have set up a reverse-proxy in front of this container that supports https, set it to true.
  • MEMORY_LIMIT: The amount of memory in MB for the scanning process. Increase this value if php artisan koel:sync runs out of memory.
  • LASTFM_API_KEY and LASTFM_API_SECRET: Enables Last.fm integration. See https://docs.koel.dev/3rd-party.html#last-fm
  • SPOTIFY_CLIENT_ID and SPOTIFY_CLIENT_SECRET: Enables Spotify integration. See https://docs.koel.dev/3rd-party.html#spotify
  • SCOUT_DRIVER, ALGOLIA_APP_ID, ALGOLIA_API_KEY, ALGOLIA_INDEX_NAME, MEILISEARCH_HOST, MEILISEARCH_KEY: Configuration for Koel's instant search.

Volumes

/music

/music will contain the music library. Keep in mind that koel needs to scan music before it's able to play it.

/var/www/html/storage/search-indexes

/var/www/html/storage/search-indexes will contain the search indexes. Searching songs, albums and artists leverages this to provide results.

Ports

80

Only HTTP is provided. Consider setting up a reverse-proxy to provide HTTPS support.

Workdir

/var/www/html

Apache's root directory. All koel files will be here. If you exec into the container, this will be your current directory.

docker's People

Contributors

0xcaff avatar bastidest avatar chengxix avatar christophwurst avatar dependabot-preview[bot] avatar dependabot[bot] avatar filius-patris avatar hyzual avatar neobrain avatar phanan avatar vija02 avatar weijiechai avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

docker's Issues

Nginx Proxy Manager Blocking Loading mixed active content

I can't seem to get koel to work with Nginx Proxy Manager, getting mixed content in console

Blocked loading mixed active content โ€œhttp://website.com/build/assets/Btn.3e44deb8.cssโ€
[website.com](https://website.com/)
Blocked loading mixed active content โ€œhttp://website.com/build/assets/app.fcf8132a.cssโ€
[website.com](https://website.com/)
Blocked loading mixed active content โ€œhttp://website.com/build/assets/app.e36b1e06.jsโ€
[website.com](https://website.com/)
Loading failed for the module with source โ€œhttp://website.com/build/assets/app.e36b1e06.jsโ€. [website.com:30:808](https://website.com/)
Loading mixed (insecure) display content โ€œhttp://website.com/img/icon.pngโ€ on a secure page
[FaviconLoader.sys.mjs:176:19](resource:///modules/FaviconLoader.sys.mjs)
Loading mixed (insecure) display content โ€œhttp://website.com/img/favicon.icoโ€ on a secure page

sh: 1: yarn: not found

Attempting to install or upgrade Koel.
Remember, you can always install/upgrade manually following the guide here:
๐Ÿ“™ https://koel.phanan.net/docs

App key exists -- skipping
JWT secret exists -- skipping
Migrating database
Data seeded -- skipping
Now to front-end stuff
โ”œโ”€โ”€ Installing Node modules in resources/assets directory
sh: 1: yarn: not found
Oops! Koel installation or upgrade didn't finish successfully.
Please try again, or visit https://koel.phanan.net/docs for manual installation.
๐Ÿ˜ฅ Sorry for this. You deserve better.

Looping: WARN Cannot connect to the database. Let's set it up.

I keep getting the error, "WARN Cannot connect to the database. Let's set it up."

relevant output from docker ps:

8351417fe0ad   phanan/koel                       "koel-entrypoint apaโ€ฆ"   18 minutes ago   Up 18 minutes (healthy)             80/tcp, 0.0.0.0:87->87/tcp, :::87->87/tcp                               docker_koel_1
b154ac65a56f   postgres:13                       "docker-entrypoint.sโ€ฆ"   18 minutes ago   Up 18 minutes                       5432/tcp                                                                docker_database_1

docker exec --user www-data -it docker_koel_1 bash
www-data@:~/html$ php artisan koel:init --no-assets:

Your DB driver of choice [MySQL/MariaDB]:
  [mysql     ] MySQL/MariaDB
  [pgsql     ] PostgreSQL
  [sqlsrv    ] SQL Server
  [sqlite-e2e] SQLite
 > pgsql

 DB host:
 > docker_database_1

 DB port (leave empty for default):
 > (tried 5432, 87:87 (what was in compose), and default)

 DB name:
 > koel

 DB user:
 > koel

 DB password:
 > password from compose

   WARN  Cannot connect to the database. Let's set it up.  

docker compose:

services:
  koel:
    image: phanan/koel
    depends_on:
      - database
    ports:
      - 87:87
    environment:
      - DB_CONNECTION=pgsql
      - DB_HOST=database
      - DB_USERNAME=koel
      - DB_PASSWORD=password
      - DB_DATABASE=koel
    volumes:
      - music:/music
      - covers:/var/www/html/public/img/covers
      - search_index:/var/www/html/storage/search-indexes

  database:
    image: postgres:13
    volumes:
      - db:/var/lib/postgresql/data'
    environment:
      - POSTGRES_DB=koel
      - POSTGRES_USER=koel
      - POSTGRES_PASSWORD=password (same as before, not sure if this was supposed to be a different password?)

Music not playing

I have completed the setup and ran php artisan koel:init before running php artisan koel:sync and once the sync had completed, when I clicked on a song it would just hang when loading.

I have tested this in both Firefox and Chrome (vanilla Chrome) and get the same issue. See Console errors from Chrome below

image

In the Docker container logs I found "xsendfile: unable to find file"

Can't log in due to out of memory error despite setting MEMORY_LIMIT

Hi,

I got the docker-compose.yaml running, and database initialised. After adding MEMORY_LIMIT: 5000 to the environment: section of the koel container, koel:sync worked without exiting blindly.

However, when attempting to log in the page just refreshes. Looking at the server log, a request to /api/data failed with a 500 error.

Using developer tools, the error message was:

image

This would seem to indicate that the MEMORY_LIMIT only applies to the php executable and not php-fpm where the main koel process is running.

I suppose the entrypoint could add the memory limit to the fpm config as well to fix this.

Thanks for maintaining this docker-compose project!

Can not initialise the docker stack

Hello,

I use the docker-compose.mysql.yml file with just the password changes
and I cannot finish the koel:init because it cannot communicate with the db
image
I check installing ping on the koel's container and it can reach the db container.

No log dir existent

Just tried to find the laravel.log and looked in the storage dir, but there is no log dir:

root@9b5be6bc99be:/var/www/html# ls storage/
app  dotenv-editor  framework  search-indexes

I'm using docker-compose as recommended.

Database field to small

I get this while trying to import my library in postgresql when running koel:sync

In Connection.php line 692:

SQLSTATE[22001]: String data, right truncated: 7 ERROR: value too long for
type character varying(191) (SQL: insert into "songs" ("id", "title", "len
gth", "track", "disc", "lyrics", "path", "mtime", "album_id", "artist_id",
"updated_at", "created_at") values (7c9798de87fc2598868f279eceb71dba, Suite
From The Trouble With Tribbles: Bartender Bit / They Quibble Over Quibble
/ Kirk Out / Barrel of Trouble / Tribble Hooks Kirk / Poor Jonesy / A Matte
r of Pride / Come on Spock / Hissing Tribbles / Dead Heap, 319.11183333333,
2, 1, , /music/MP3/OST/Star Trek Series/Best of Star Trek - 30th Aniversar
y Special/Best of Star Trek Vol-1 - 02 - (TOS) [The Trouble With Tribbles]
Bartender Bit, They Quibble Over Quibble.mp3, 1621091693, 1359, 5067, 2021-
11-01 13:22:55, 2021-11-01 13:22:55))

In Exception.php line 18:

SQLSTATE[22001]: String data, right truncated: 7 ERROR: value too long for
type character varying(191)

In PDOStatement.php line 112:

SQLSTATE[22001]: String data, right truncated: 7 ERROR: value too long for
type character varying(191)

My solution is simply to change the song field from varchar(191) tot varchar(500)

php artisan koel:init --no-assets fails

Where can I find more information on this error?

www-data@b63d9da11127:~/html$ php artisan koel:init --no-assets
Attempting to install or upgrade Koel.
Remember, you can always install/upgrade manually following the guide here:
๐Ÿ“™ https://docs.koel.dev
App key exists -- skipping
Migrating database
Oops! Koel installation or upgrade didn't finish successfully.
Please try again, or visit https://docs.koel.dev for manual installation.
๐Ÿ˜ฅ Sorry for this. You deserve better.

The following is my docker-compose file.

`version: '3'

services:
koel:
container_name: koel_server
image: hyzual/koel
depends_on:
- database
ports:
- 8080:80
environment:
- DB_CONNECTION=pgsql
- DB_HOST=database
- DB_USERNAME=koel
- DB_PASSWORD=koel
- DB_DATABASE=koel
volumes:
- music:/music
- covers:/var/www/html/public/img/covers
- search_index:/var/www/html/storage/search-indexes

database:
container_name: koel_db
image: postgres:13
volumes:
- db:/var/lib/postgresql/data'
environment:
- POSTGRES_DB=koel
- POSTGRES_USER=koel
- POSTGRES_PASSWORD=koel
ports:
- 5432:5432

volumes:
db:
driver: local
music:
driver: local
covers:
driver: local
search_index:
driver: local
`

Add pgsql support in Docker image

Hello ,
I couln not run php artisan koel:init because the docker image miss psql database support.

Could you add the psql support to the image ?

Thx by advance,

Can't open the web interface

After I did the containers installations and do the First Run on root using Terminal for Mac, it says that everything it's ok and the next step is using the web interface, but can't open it.

Installed on a Docker Synology NAS using Portainer.

Thanks

Uploads via web UI fail, yet show up anyway.

Hello,

When I upload a song via the UI, it says "Upload failed: server error" for every single song. The songs do not show up in the UI. They do however show up in the uploads file. When I sync manually they do show up in the UI. Only thing unique to my setup is that I specified the path to the music to an external drive (to /media/internal1/music). Is there an issue on my end? Thanks!

[2022-03-16 21:17:44] production.ERROR: SQLSTATE[HY000] [14] unable to open database file {"userId":1,"exception":"[object] (PDOException(code: 14): SQLSTATE[HY000] [14] unable to open database file at /var/www/html/vendor/teamtnt/tntsearch/src/Indexer/TNTIndexer.php:178)
[stacktrace]
#0 /var/www/html/vendor/teamtnt/tntsearch/src/Indexer/TNTIndexer.php(178): PDO->__construct()
#1 /var/www/html/vendor/teamtnt/tntsearch/src/TNTSearch.php(68): TeamTNT\\TNTSearch\\Indexer\\TNTIndexer->createIndex()
#2 /var/www/html/vendor/teamtnt/laravel-scout-tntsearch-driver/src/Engines/TNTSearchEngine.php(321): TeamTNT\\TNTSearch\\TNTSearch->createIndex()
#3 /var/www/html/vendor/teamtnt/laravel-scout-tntsearch-driver/src/Engines/TNTSearchEngine.php(55): TeamTNT\\Scout\\Engines\\TNTSearchEngine->initIndex()
#4 /var/www/html/vendor/laravel/scout/src/Searchable.php(62): TeamTNT\\Scout\\Engines\\TNTSearchEngine->update()
#5 /var/www/html/vendor/laravel/scout/src/Searchable.php(41): App\\Models\\Artist->queueMakeSearchable()
#6 /var/www/html/vendor/laravel/framework/src/Illuminate/Macroable/Traits/Macroable.php(124): Illuminate\\Database\\Eloquent\\Collection->Laravel\\Scout\\{closure}()
#7 /var/www/html/vendor/laravel/scout/src/Searchable.php(169): Illuminate\\Support\\Collection->__call()
#8 /var/www/html/vendor/laravel/scout/src/ModelObserver.php(109): App\\Models\\Song->searchable()
#9 /var/www/html/vendor/laravel/framework/src/Illuminate/Events/Dispatcher.php(424): Laravel\\Scout\\ModelObserver->saved()
#10 /var/www/html/vendor/laravel/framework/src/Illuminate/Events/Dispatcher.php(249): Illuminate\\Events\\Dispatcher->Illuminate\\Events\\{closure}()
#11 /var/www/html/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Concerns/HasEvents.php(189): Illuminate\\Events\\Dispatcher->dispatch()
#12 /var/www/html/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php(1035): Illuminate\\Database\\Eloquent\\Model->fireModelEvent()
#13 /var/www/html/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php(1006): Illuminate\\Database\\Eloquent\\Model->finishSave()
#14 /var/www/html/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Builder.php(509): Illuminate\\Database\\Eloquent\\Model->save()
#15 /var/www/html/vendor/laravel/framework/src/Illuminate/Support/helpers.php(263): Illuminate\\Database\\Eloquent\\Builder->Illuminate\\Database\\Eloquent\\{closure}()
#16 /var/www/html/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Builder.php(510): tap()
#17 /var/www/html/vendor/laravel/framework/src/Illuminate/Support/Traits/ForwardsCalls.php(23): Illuminate\\Database\\Eloquent\\Builder->updateOrCreate()
#18 /var/www/html/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php(2132): Illuminate\\Database\\Eloquent\\Model->forwardCallTo()
#19 /var/www/html/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php(2144): Illuminate\\Database\\Eloquent\\Model->__call()
#20 /var/www/html/app/Services/FileSynchronizer.php(198): Illuminate\\Database\\Eloquent\\Model::__callStatic()
#21 /var/www/html/app/Services/UploadService.php(31): App\\Services\\FileSynchronizer->sync()
#22 /var/www/html/app/Http/Controllers/API/UploadController.php(25): App\\Services\\UploadService->handleUploadedFile()
#23 /var/www/html/vendor/laravel/framework/src/Illuminate/Routing/Controller.php(54): App\\Http\\Controllers\\API\\UploadController->store()
#24 /var/www/html/vendor/laravel/framework/src/Illuminate/Routing/ControllerDispatcher.php(45): Illuminate\\Routing\\Controller->callAction()
#25 /var/www/html/vendor/laravel/framework/src/Illuminate/Routing/Route.php(262): Illuminate\\Routing\\ControllerDispatcher->dispatch()
#26 /var/www/html/vendor/laravel/framework/src/Illuminate/Routing/Route.php(205): Illuminate\\Routing\\Route->runController()
#27 /var/www/html/vendor/laravel/framework/src/Illuminate/Routing/Router.php(695): Illuminate\\Routing\\Route->run()
#28 /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(128): Illuminate\\Routing\\Router->Illuminate\\Routing\\{closure}()
#29 /var/www/html/app/Http/Middleware/Authenticate.php(28): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#30 /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): App\\Http\\Middleware\\Authenticate->handle()
#31 /var/www/html/vendor/laravel/framework/src/Illuminate/Routing/Middleware/SubstituteBindings.php(50): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#32 /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\\Routing\\Middleware\\SubstituteBindings->handle()
#33 /var/www/html/vendor/laravel/framework/src/Illuminate/Routing/Middleware/ThrottleRequests.php(127): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#34 /var/www/html/vendor/laravel/framework/src/Illuminate/Routing/Middleware/ThrottleRequests.php(63): Illuminate\\Routing\\Middleware\\ThrottleRequests->handleRequest()
#35 /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\\Routing\\Middleware\\ThrottleRequests->handle()
#36 /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(103): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#37 /var/www/html/vendor/laravel/framework/src/Illuminate/Routing/Router.php(697): Illuminate\\Pipeline\\Pipeline->then()
#38 /var/www/html/vendor/laravel/framework/src/Illuminate/Routing/Router.php(672): Illuminate\\Routing\\Router->runRouteWithinStack()
#39 /var/www/html/vendor/laravel/framework/src/Illuminate/Routing/Router.php(636): Illuminate\\Routing\\Router->runRoute()
#40 /var/www/html/vendor/laravel/framework/src/Illuminate/Routing/Router.php(625): Illuminate\\Routing\\Router->dispatchToRoute()
#41 /var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(167): Illuminate\\Routing\\Router->dispatch()
#42 /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(128): Illuminate\\Foundation\\Http\\Kernel->Illuminate\\Foundation\\Http\\{closure}()
#43 /var/www/html/app/Http/Middleware/ForceHttps.php(31): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#44 /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): App\\Http\\Middleware\\ForceHttps->handle()
#45 /var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php(21): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#46 /var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/ConvertEmptyStringsToNull.php(31): Illuminate\\Foundation\\Http\\Middleware\\TransformsRequest->handle()
#47 /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\\Foundation\\Http\\Middleware\\ConvertEmptyStringsToNull->handle()
#48 /var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php(21): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#49 /var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TrimStrings.php(40): Illuminate\\Foundation\\Http\\Middleware\\TransformsRequest->handle()
#50 /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\\Foundation\\Http\\Middleware\\TrimStrings->handle()
#51 /var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/ValidatePostSize.php(27): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#52 /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\\Foundation\\Http\\Middleware\\ValidatePostSize->handle()
#53 /var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/PreventRequestsDuringMaintenance.php(86): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#54 /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\\Foundation\\Http\\Middleware\\PreventRequestsDuringMaintenance->handle()
#55 /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(103): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#56 /var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(142): Illuminate\\Pipeline\\Pipeline->then()
#57 /var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(111): Illuminate\\Foundation\\Http\\Kernel->sendRequestThroughRouter()
#58 /var/www/html/public/index.php(57): Illuminate\\Foundation\\Http\\Kernel->handle()
#59 {main}

koel:
    image: hyzual/koel
    depends_on:
      - database
    ports:
      - 38060:80
    environment:
      - DB_CONNECTION=mysql
      - DB_HOST=database
      - DB_USERNAME=koel
      - DB_PASSWORD=*KOEL_PASSWORD*
      - DB_DATABASE=koel
    volumes:
      - music:/music
      - covers:/var/www/html/public/img/covers
      - search_index:/var/www/html/storage/search-indexes

  database:
    image: mysql/mysql-server:5.7
    volumes:
      - db:/var/lib/mysql
    environment:
      - MYSQL_ROOT_PASSWORD=*ROOT_PASSWORD*
      - MYSQL_DATABASE=koel
      - MYSQL_USER=koel
      - MYSQL_PASSWORD=*KOEL_PASSWORD*

volumes:
  db:
    driver: local
    driver_opts:
      type: 'none'
      o: 'bind'
      device: '/var/www/koel/mysql'
  music:
    driver: local
    driver_opts:
      type: 'none'
      o: 'bind'
      device: '/media/internal1/music/music'
  covers:
    driver: local
    driver_opts:
      type: 'none'
      o: 'bind'
      device: '/media/internal1/music/covers'
  search_index:
    driver: local
    driver_opts:
      type: 'none'
      o: 'bind'
      device: '/media/internal1/music/search_index'

Can't login on mobile or with an app on my desktop added from my Koel website via the external URL.

Describe the bug
Hi, I've noticed something strange with Koel recently, when I try to login via mobile or with an app on my desktop added from my Koel website via the external URL I can't login. It works fine when using the internal URL.

To reproduce
Steps to reproduce the behavior:

Note: I'm unsure whether this behavior happens to other instances.

  1. Go to your Koel instance via mobile or through your PWA / desktop app from your Koel instance and use the external URL.
  2. Try to login.
  3. For me, you can't login.

Expected behavior
You should be able to login on mobile and through a PWA / desktop app from your Koel instance via the external URL.

Environment

  • Koel version: v6.8.5
  • OS: Arch Linux
  • Browser: LibreWolf v107.0.1
  • PHP version: v8.1.8
  • Node version: When running npm -v and node -v bash replies with npm: command not found and node: command not found

Additional context
I use the official Docker image with Docker Compose.

Migrating database failed

i have tried mySQL, PostgreSQL and now a im at mariaDB.

At php artisan koel:init --no-assets i get following error:

************************************
*     KOEL INSTALLATION WIZARD     *
************************************

As a reminder, you can always install/upgrade manually following the guide at https://docs.koel.dev

  Clearing caches ....................... 28ms DONE
   INFO  .env file exists -- skipping.

  Retrieving app key ....................... 0ms DONE

   INFO  Using app key: H..........................

  Migrating database ....................... 157ms FAIL
   ERROR  Oops! Koel installation or upgrade didn't finish successfully.

   ERROR  Please check the error log at storage/logs/laravel.log and try again.

   ERROR  You can also visit https://docs.koel.dev for other options.

   ERROR  ๐Ÿ˜ฅ Sorry for this. You deserve better.

The "laravel.log" file gives me following error:

Next Illuminate\Database\QueryException: SQLSTATE[HY000]: General error: 1833 Cannot change column 'id': used in a foreign key constraint 'koel/interactions_song_id_foreign' of table 'koel/interactions' (SQL: ALTER TABLE songs CHANGE id id VARCHAR(36) CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci`) in /var/www/html/vendor/laravel/framework/src/Illuminate/Database/Connection.php:760
Stack trace:
#0 /var/www/html/vendor/laravel/framework/src/Illuminate/Database/Connection.php(720): Illuminate\Database\Connection->runQueryCallback()
#1 /var/www/html/vendor/laravel/framework/src/Illuminate/Database/Connection.php(546): Illuminate\Database\Connection->run()
#2 /var/www/html/vendor/laravel/framework/src/Illuminate/Database/Schema/Blueprint.php(109): Illuminate\Database\Connection->statement()
#3 /var/www/html/vendor/laravel/framework/src/Illuminate/Database/Schema/Builder.php(439): Illuminate\Database\Schema\Blueprint->build()
#4 /var/www/html/vendor/laravel/framework/src/Illuminate/Database/Schema/Builder.php(269): Illuminate\Database\Schema\Builder->build()
#5 /var/www/html/vendor/laravel/framework/src/Illuminate/Support/Facades/Facade.php(338): Illuminate\Database\Schema\Builder->table()
#6 /var/www/html/database/migrations/2022_08_01_093952_use_uuids_for_song_ids.php(16): Illuminate\Support\Facades\Facade::__callStatic()
#7 /var/www/html/vendor/laravel/framework/src/Illuminate/Database/Migrations/Migrator.php(488): Illuminate\Database\Migrations\Migration@anonymous->up()
#8 /var/www/html/vendor/laravel/framework/src/Illuminate/Database/Migrations/Migrator.php(406): Illuminate\Database\Migrations\Migrator->runMethod()
#9 /var/www/html/vendor/laravel/framework/src/Illuminate/Database/Migrations/Migrator.php(415): Illuminate\Database\Migrations\Migrator->Illuminate\Database\Migrations\{closure}()
#10 /var/www/html/vendor/laravel/framework/src/Illuminate/Database/Migrations/Migrator.php(216): Illuminate\Database\Migrations\Migrator->runMigration()
#11 /var/www/html/vendor/laravel/framework/src/Illuminate/Console/View/Components/Task.php(36): Illuminate\Database\Migrations\Migrator->Illuminate\Database\Migrations\{closure}()
#12 /var/www/html/vendor/laravel/framework/src/Illuminate/Database/Migrations/Migrator.php(749): Illuminate\Console\View\Components\Task->render()
#13 /var/www/html/vendor/laravel/framework/src/Illuminate/Database/Migrations/Migrator.php(216): Illuminate\Database\Migrations\Migrator->write()
#14 /var/www/html/vendor/laravel/framework/src/Illuminate/Database/Migrations/Migrator.php(181): Illuminate\Database\Migrations\Migrator->runUp()
#15 /var/www/html/vendor/laravel/framework/src/Illuminate/Database/Migrations/Migrator.php(124): Illuminate\Database\Migrations\Migrator->runPending()
#16 /var/www/html/vendor/laravel/framework/src/Illuminate/Database/Console/Migrations/MigrateCommand.php(90): Illuminate\Database\Migrations\Migrator->run()
#17 /var/www/html/vendor/laravel/framework/src/Illuminate/Database/Migrations/Migrator.php(626): Illuminate\Database\Console\Migrations\MigrateCommand->Illuminate\Database\Console\Migrations\{closure}()
#18 /var/www/html/vendor/laravel/framework/src/Illuminate/Database/Console/Migrations/MigrateCommand.php(102): Illuminate\Database\Migrations\Migrator->usingConnection()
#19 /var/www/html/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(36): Illuminate\Database\Console\Migrations\MigrateCommand->handle()
#20 /var/www/html/vendor/laravel/framework/src/Illuminate/Container/Util.php(41): Illuminate\Container\BoundMethod::Illuminate\Container\{closure}()
#21 /var/www/html/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(93): Illuminate\Container\Util::unwrapIfClosure()
#22 /var/www/html/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(37): Illuminate\Container\BoundMethod::callBoundMethod()
#23 /var/www/html/vendor/laravel/framework/src/Illuminate/Container/Container.php(661): Illuminate\Container\BoundMethod::call()
#24 /var/www/html/vendor/laravel/framework/src/Illuminate/Console/Command.php(183): Illuminate\Container\Container->call()
#25 /var/www/html/vendor/symfony/console/Command/Command.php(291): Illuminate\Console\Command->execute()
#26 /var/www/html/vendor/laravel/framework/src/Illuminate/Console/Command.php(153): Symfony\Component\Console\Command\Command->run()

On Stackoverflow i found following answer but i still was not able to connect.

Unfortunately, my skills are also limited, which is why I did not get further.

My docker-compose.yml looks like:

    koelApp:
        container_name: koelApp
        hostname: koelApp
        image: phanan/koel
        depends_on:
          - koelDb
        # environment: (.env file is used with following settings):
          # - APP_KEY=Hxxxxxxxxxxxxxxxx
          # - DB_CONNECTION=mysql
          # - DB_HOST=koelDb
          # - DB_PORT=3306
          # - DB_USERNAME=koel
          # - DB_PASSWORD=xxxxxxxx
          # - DB_DATABASE=koel
        volumes:
          - ./koel/music:/music
          - ./koel/covers:/var/www/html/public/img/covers
          - ./koel/search_index:/var/www/html/storage/search-indexes
          
          # Set Timezone
          - /etc/timezone:/etc/timezone:ro
          - /etc/localtime:/etc/localtime:ro
        env_file:
          - ./koel/app/.env
        labels:
          - "traefik.http.routers.koel.entrypoints=websecure"
          - "traefik.http.routers.koel.rule=Host(`koel.domain.de`)"
          - "traefik.http.services.koel.loadbalancer.server.port=80"
          - "traefik.http.routers.koel.tls=true"
          - "traefik.http.routers.koel.tls.certresolver=myresolver"
        networks:
          - traefik
        logging:
          driver: "json-file"
          options:
            max-size: "200k"
            max-file: "5"

# Koel Db
    koelDb:
        container_name: koelDb
        hostname: koelDb
        image: mariadb:latest
        restart: unless-stopped
        volumes:
          - ./koel/db:/var/lib/mysql
          
          # Set Timezone
          - /etc/timezone:/etc/timezone:ro
          - /etc/localtime:/etc/localtime:ro
        environment:
          - MARIADB_ROOT_PASSWORD=xxxxxxxx
          - MARIADB_DATABASE=koel
          - MARIADB_USER=koel
          - MARIADB_PASSWORD=xxxxxxxx
        labels:
          - "traefik.http.services.koelDb.loadbalancer.server.port=80" # Dummy Port
        networks:
          - traefik
        logging:
          driver: "json-file"
          options:
            max-size: "200k"
            max-file: "5"

My server is a Raspberry pi 4 (8gb)

The only (main) difference between the provided compose file an the file i am using is, that i am using bind mounts instead of volumes. But while using volumes i run into the exact same issue.

Default username and PW not working.

I have run through all of the steps listed in the ReadMe including the Koel:init step. For some reason I still cannot log in to the web GUI. I am running Docker Desktop on Mac. I am not sure if the issue Docker, MacOS, or me. To confirm that I am following the steps correctly I ran the setup in Docker Playground and everything worked as expected so I assume it something local to my machine that is causing the issue.

Any thoughts or suggestions?

Raspberry Pi/Arm compatibility

I'm trying to run this container on my raspberry pi but keep getting an error and wont start.
standard_init_linux.go:211: exec user process caused "exec format error"

storage/framework/cache folder permissions messed out after koel:sync

I was today discovering Koel, so I did go throught the Docker way, as I am running a personal home server with docker setup:

  • Ubuntu 20.04 LTS
  • docker version

image

The first run went all okay. But after doing the koel:sync, somethings weird happens: I cannot login again to Koel.
Reading the logs inside storage/logs/laravel.log I can see this after a login try:

image

So i just checked out this dir, and I can se that almost everything inside the folder "/var/www/html/storage/framework/cache/data" is owned by root, but the folder itself is owned by www-data.

image

So i changed the content of this dir back to www-data owner, and now I can login without issues!

So I suspect something is wrong with the php artisan commands beeing run as user root inside the container and makes all of this folders unreadable by Koel, leaving with this permission issue and then unable to login.

So by now the fix remain on just changing the permissions on this folder after running the koel:sync command. But I think we should find a more "definitive" approach to this.

Can't login after install and configuration (error 500)

Hi,

I'm unable to login into koel, i ran php artisan koel:init into my container, and as mentioned, it fails at the frontend assets.

There seem to be no problem with the database mysql 5.7 running in the same network as koel, it is filled with the good entered Name and email in "users" table, and the others tables are also created (checked with phpmyadmin).

There is the error 500 in Firefox.
500

My configuration :
docker run -d --name koel -p 9004:80 -v /320GB/.koel/.koel.env:/var/www/html/.env --hostname koel --ip 172.18.1.4 --network=koel-net -v /320GB/Music:/music -v /320GB/.koel/covers:/var/www/html/public/img/covers hyzual/koel

In the environment file, there is only the database details (host,port,username,pw).

Thank you.

Error 500 - personal_access_tokens table remains empty

After installation I ssh inside the container and ran php artisan koel:init --no-assets which created a bunch of tables inside the database. I can see the default admin user inside the users table, personal_access_tokens table is empty.

When I try to log in I get error 500 and this is the log:

[2021-10-25 21:53:22] production.ERROR: SQLSTATE[08006] [7] FATAL:  password authentication failed for user "koel" (SQL: select * from "personal_
access_tokens" where "token" = e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 limit 1) {"exception":"[object] (Illuminate\\Data
base\\QueryException(code: 7): SQLSTATE[08006] [7] FATAL:  password authentication failed for user \"koel\" (SQL: select * from \"personal_access
_tokens\" where \"token\" = e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 limit 1) at /var/www/html/vendor/laravel/framework/s
rc/Illuminate/Database/Connection.php:692)
[stacktrace]
#0 /var/www/html/vendor/laravel/framework/src/Illuminate/Database/Connection.php(652): Illuminate\\Database\\Connection->runQueryCallback()
#1 /var/www/html/vendor/laravel/framework/src/Illuminate/Database/Connection.php(360): Illuminate\\Database\\Connection->run()
#2 /var/www/html/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php(2350): Illuminate\\Database\\Connection->select()
#3 /var/www/html/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php(2338): Illuminate\\Database\\Query\\Builder->runSelect()
#4 /var/www/html/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php(2872): Illuminate\\Database\\Query\\Builder->Illuminate\\Data
base\\Query\\{closure}()
#5 /var/www/html/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php(2339): Illuminate\\Database\\Query\\Builder->onceWithColumns(
)
#6 /var/www/html/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Builder.php(602): Illuminate\\Database\\Query\\Builder->get()
#7 /var/www/html/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Builder.php(586): Illuminate\\Database\\Eloquent\\Builder->getModels()
#8 /var/www/html/vendor/laravel/framework/src/Illuminate/Database/Concerns/BuildsQueries.php(259): Illuminate\\Database\\Eloquent\\Builder->get()

It looks like it cannot create the token or something - although the error is different maybe it is related somehow to #54 ?
Since artisan was able to create the tables I doubt it's a read/write permission issue, but to be safe I make the koel user a superuser.

I'm using Postgresql on a Pi 4. This pulled the latest docker version - not sure which one. If you need more info please ask.

Oops! Koel installation or upgrade didn't finish successfully.

Attempting to install or upgrade Koel.
Remember, you can always install/upgrade manually following the guide here:
๐Ÿ“™ https://docs.koel.dev

App key exists -- skipping
Generating JWT secret
Migrating database
Data seeded -- skipping
Now to front-end stuff
Oops! Koel installation or upgrade didn't finish successfully.
Please try again, or visit https://docs.koel.dev for manual installation.
๐Ÿ˜ฅ Sorry for this. You deserve better.

MySQL does not work

Since my system is arm, it seems that sql5.7 does not support it. The following error is prompted๏ผš
standard_init_linux.go:219: exec user process caused "exec format error"

So I changed to the sql8.0 version, but it seems that there is a permission problem. I don't know how to solve it๏ผš
`2022-12-04T06:32:31.687039Z 0 [Warning] [MY-011068] [Server] The syntax '--skip-host-cache' is deprecated and will be removed in a future release. Please use SET GLOBAL host_cache_size=0 instead.

2022-12-04T06:32:31.687463Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.31) starting as process 1
mysqld: File './binlog.index' not found (OS errno 13 - Permission denied)

2022-12-04T06:32:31.690888Z 0 [ERROR] [MY-010119] [Server] Aborting

2022-12-04T06:32:31.690982Z 0 [System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.0.31) MySQL Community Server - GPL.
`

Need to run php artisan koel:init evertime container is restarted

I am using PostgresSQL with koel.

The server works but everytime i restart the server using docker compose down and docker compose up -d, i need to run php artisan koel:init --no-assets again or else login wont work

Any users created prior to restart do not appear either

This is what the docker logs show, im not sure if its related

koel-db  | 2023-05-18 06:24:29.862 UTC [69] ERROR:  relation "personal_access_tokens" does not exist at character 15
koel-db  | 2023-05-18 06:24:29.862 UTC [69] STATEMENT:  select * from "personal_access_tokens" where "token" = $1 limit 1
koel-db  | 2023-05-18 06:24:29.865 UTC [69] ERROR:  relation "personal_access_tokens" does not exist at character 15
koel-db  | 2023-05-18 06:24:29.865 UTC [69] STATEMENT:  select * from "personal_access_tokens" where "token" = $1 limit 1
koel-db  | 2023-05-18 06:24:34.710 UTC [70] ERROR:  relation "personal_access_tokens" does not exist at character 15
koel-db  | 2023-05-18 06:24:34.710 UTC [70] STATEMENT:  select * from "personal_access_tokens" where "token" = $1 limit 1
koel-db  | 2023-05-18 06:24:34.712 UTC [70] ERROR:  relation "personal_access_tokens" does not exist at character 15
koel-db  | 2023-05-18 06:24:34.712 UTC [70] STATEMENT:  select * from "personal_access_tokens" where "token" = $1 limit 1
koel-db  | 2023-05-18 06:24:38.229 UTC [71] ERROR:  relation "personal_access_tokens" does not exist at character 15
koel-db  | 2023-05-18 06:24:38.229 UTC [71] STATEMENT:  select * from "personal_access_tokens" where "token" = $1 limit 1
koel-db  | 2023-05-18 06:24:38.231 UTC [71] ERROR:  relation "personal_access_tokens" does not exist at character 15
koel-db  | 2023-05-18 06:24:38.231 UTC [71] STATEMENT:  select * from "personal_access_tokens" where "token" = $1 limit 1
koel-db  | 2023-05-18 06:24:38.395 UTC [72] ERROR:  relation "personal_access_tokens" does not exist at character 15
koel-db  | 2023-05-18 06:24:38.395 UTC [72] STATEMENT:  select * from "personal_access_tokens" where "token" = $1 limit 1
koel-db  | 2023-05-18 06:24:38.397 UTC [72] ERROR:  relation "personal_access_tokens" does not exist at character 15
koel-db  | 2023-05-18 06:24:38.397 UTC [72] STATEMENT:  select * from "personal_access_tokens" where "token" = $1 limit 1
koel-db  | 2023-05-18 06:26:14.753 UTC [74] ERROR:  relation "personal_access_tokens" does not exist at character 15
koel-db  | 2023-05-18 06:26:14.753 UTC [74] STATEMENT:  select * from "personal_access_tokens" where "token" = $1 limit 1
koel-db  | 2023-05-18 06:26:14.755 UTC [74] ERROR:  relation "personal_access_tokens" does not exist at character 15
koel-db  | 2023-05-18 06:26:14.755 UTC [74] STATEMENT:  select * from "personal_access_tokens" where "token" = $1 limit 1

File size limit when uploading?

When I upload, only my smaller audio files upload. Some of the files are on the larger size being radio shows.

I've deployed into kubernetes and obviously there may be a fix needed there, but I wanted to check if its related to a php value or something that is already known.

Blank Page if connecting using reverse proxy

Hi guys,

I am not being to connect behind a nginx reverse proxy.

Here is my config:

server {

         listen 80;
         server_name koel.eddienetworks.ddnsfree.com *.koel.eddienetworks.ddnsfree.com;
         return 301 https://$host$request_uri;

}

server {

        server_name koel.eddienetworks.ddnsfree.com *.koel.eddienetworks.ddnsfree.com;


        location / {
                proxy_pass http://192.168.1.243;
                proxy_set_header Host $host;
       }

       listen [::]:443 ssl; # managed by Certbot
       listen 443 ssl; # managed by Certbot
       ssl_certificate /etc/letsencrypt/live/eddienetworks.ddnsfree.com/fullchain.pem; # managed by Certbot
       ssl_certificate_key /etc/letsencrypt/live/eddienetworks.ddnsfree.com/privkey.pem; # managed by Certbot
       include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
       ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
       add_header Strict-Transport-Security "max-age=15768000; includeSubDomains; preload;";
}

Here is the message from the proxy:
[25/Feb/2022:11:33:06 +1100] "GET / HTTP/1.1" 200 609 "-" "Mozilla/5.0 (iPhone; CPU iPhone OS 15_3_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.3 Mobile/15E148 Safari/604.1" "-"

And from koel:
192.168.1.249 - - [25/Feb/2022:00:33:10 +0000] "GET / HTTP/1.0" 200 922 "-" "Mozilla/5.0 (iPhone; CPU iPhone OS 15_3_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.3 Mobile/15E148 Safari/604.1"

Note: I know it is pointless using an iPhone to play songs, but I used it just for the sake of testing the connection. The issue is the same on my computer.

Thanks

Missing PHP GD LIbrary Extension

Hello,

I'm using your docker image of koel and I'm unable to get the images of the albums and artists to appear.
After some troubleshooting, it seems that that feature need the PHP GD extension to work.
It seems to be missing from this image last release.

Laravel log:
[2020-07-05 16:03:26] production.ERROR: Intervention\Image\Exception\NotSupportedException: GD Library extension not available with this PHP installation. in /var/www/html/vendor/intervention/image/src/Inter
vention/Image/Gd/Driver.php:19

I tried to modify the Dockerfile to get it installed but I was unable to do so.

Regards,
Pierre-Yves Bouvier

Docker build for 6.0.5

As per title. v6.0.5 has been out for a few days now but there isn't a docker build of it yet.
Thanks!

Koel Sync error - SQLSTATE[HY000]: General error: 1 no such table: info

I am trying to sync media via the command link using php artisan koel:sync and I keep getting the below error. Although I get the below error, music does appear after 5-10 mins in Koel.


  at vendor/teamtnt/tntsearch/src/TNTSearch.php:399
    395โ–• 
    396โ–•     public function getValueFromInfoTable($value)
    397โ–•     {
    398โ–•         $query = "SELECT * FROM info WHERE key = '$value'";
  โžœ 399โ–•         $docs  = $this->index->query($query);
    400โ–• 
    401โ–•         if ($ret = $docs->fetch(PDO::FETCH_ASSOC)) {
    402โ–•             return $ret['value'];
    403โ–•         }

  +20 vendor frames 
  21  app/Services/FileSynchronizer.php:198
      Illuminate\Database\Eloquent\Model::__callStatic()

 22  app/Services/MediaSyncService.php:95
      App\Services\FileSynchronizer::sync()

To reproduce
Steps to reproduce the behavior:

  1. docker exec --user www-data -it koel bash
  2. php artisan koel:sync

Expected behavior
Sync Music to Koel Server without error

Screenshots
Screenshot

Environment

DOCKER Docker version 19.03.13, build 4484c46d9d

Ansible deploys the containers - main config for each below

KOEL

docker_container:
    name: koel
    image: "phanan/koel:latest"
    pull: yes
    published_ports:
      - "127.0.0.1:800:80"
    env:
      BACKUP: "no"
      FORCE_HTTPS : "true"
      DB_CONNECTION: "mysql"
      DB_HOST : "mysql"
      DB_USERNAME : "koel"
      DB_PASSWORD : "samplePW"
      DB_DATABASE : "koel"
      PUID: "{{ uid }}"
      PGID: "{{ gid }}"
      UMASK: 002
      VIRTUAL_HOST: "koel.{{ user.domain }}"
      VIRTUAL_PORT: 80
      LETSENCRYPT_HOST: "koel.{{ user.domain }}"
      LETSENCRYPT_EMAIL: "{{ user.email }}"
      TZ: "{{ tz }}"
    volumes: "{{ default_volumes }}"
    labels:
     "com.github.cloudbox.cloudbox_managed": "true"
   networks:
      - name: koelnetwork
        aliases:
        - koel

MYSQL

docker_container:
    name: mysql
    image: "mysql"
    pull: yes
    env:
      TZ: "{{ tz }}"
      PUID: "{{ uid }}"
      PGID: "{{ gid }}"
      LOG_LEVEL: DEBUG
      MYSQL_DATABASE : "koel"
      MYSQL_USER : "koel"
      MYSQL_PASSWORD : "samplePW"
      MYSQL_ROOT_PASSWORD: "samplePW"
    volumes:
      - /opt/mysql/data:/var/lib/mysql
    labels:
      "com.github.cloudbox.cloudbox_managed": "true"
    networks:
      - name: koelnetwork
        aliases:
          - mysql

RClone Mount - Config

[Unit]
Description=Rclone VFS dibdab-t-en-01 Mount
After=network-online.target

[Service]
User=serveruser
Group=serveruser
Type=notify
ExecStartPre=/bin/sleep 10
ExecStart=/usr/bin/rclone mount \
  --user-agent='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.131 Safari/537.36' \
  --config=/home/serveruser/.config/rclone/rclone.conf \
  --allow-other \
  --allow-non-empty \
  --drive-skip-gdocs \
  --vfs-read-chunk-size=64M \
  --vfs-read-chunk-size-limit=2048M \
  --buffer-size=64M \
  --poll-interval=1m \
  --dir-cache-time=168h \
  --timeout=10m \
  --drive-chunk-size=64M \
  --vfs-cache-mode=writes \
  --umask=002 \
  --syslog \
  --use-mmap \
  -v \
  koel-music: /mnt/remote/koel
ExecStop=/bin/fusermount -uz /mnt/remote/koel
Restart=on-abort
RestartSec=5
StartLimitInterval=60s
StartLimitBurst=3

[Install]
WantedBy=default.target

Additional context
Add any other context about the problem here.

Postgres setup only works when DB_PORT specified explicitly

Tried to setup using docker-compose.postgres.yml. Initialization seems to work but then login is impossible. Looking into log one can find that koel is trying to connect using port 3306 instead of 5432.

Long story short: One has to add env var DB_PORT=5432 to docker-compose.postgres.yml in order to make it work.

Can I use a non-dockerized postgres instance with the koel docker image?

The README makes it appear that you have to use a dockerized DB with Koel:

DB_HOST: database. The name of the Docker container hosting the database. Koel needs to be on the same Docker network to find the database by its name.

Is it not possible to simply pass in an arbitrary Postgres connection string through the environment?

music path

HI, after go to the first run commands, it says: The absolute path to your media directory. If this is skipped (left blank) now, you can set it later via the web interface.
but even if I leave blank or put a path show me a error: ERROR The path does not exist or not readable. Try again?
What can I do?

Provide working nginx reverse proxy config example

FYI: I think it's related to your card https://github.com/koel/docker/projects/1#card-31191171

Using a reverse proxy is a common way of accessing dockerized services outside your local network. Some typical reverse proxy docker images include Traefik and SWAG. The latter, SWAG, is extremely easy to use and I do have a working configuration for Koel (in the case of using Linuxserver's latest SWAG docker container, this config should be placed by default in ~/.config/appdata/swag/nginx/proxy-confs/koel.subdomain.conf):

server {
    listen 443 ssl;
    listen [::]:443 ssl;

    server_name koel.*;

    include /config/nginx/ssl.conf;

    client_max_body_size 0;

    location / {
    
        include /config/nginx/proxy.conf;
        resolver 127.0.0.11 valid=30s;
        set $upstream_app koel;
        set $upstream_port 8090;
        set $upstream_proto http;
        proxy_pass $upstream_proto://<your_server_ip>:$upstream_port;
    }

    location ~ (/koel)?/api {
        include /config/nginx/proxy.conf;
        resolver 127.0.0.11 valid=30s;
        set $upstream_app koel;
        set $upstream_port 8090;
        set $upstream_proto http;
        proxy_pass $upstream_proto://<your_server_ip>:$upstream_port;

   }
}

For this config to work, however, the environment variable FORCE_HTTPS=true needs to be added in the compose file for koel; otherwise, a blank page is served (no error, only a blank, uninformative page). For completion, this is an extract of the docker-compose.yml used for these services: SWAG and Koel:

version: "3.7"

services:
  koel:
    image: hyzual/koel
    container_name: koel
    depends_on:
      - database
    ports:
      - 8090:80
    networks:
      - proxy  
    environment:
      - FORCE_HTTPS=true
      - DB_CONNECTION=pgsql
      - DB_HOST=database
      - DB_USERNAME=koel
      - DB_PASSWORD=<koel_password>
      - DB_DATABASE=koel
    volumes:
      - music:/music
      - covers:/var/www/html/public/img/covers
      - search_index:/var/www/html/storage/search-indexes

  database:
    image: postgres:13
    container_name: koel-db
    volumes:
      - db:/var/lib/postgresql/data'
    environment:
      - POSTGRES_DB=koel
      - POSTGRES_USER=koel
      - POSTGRES_PASSWORD=koel_password_0987

  swag:
    image: ghcr.io/linuxserver/swag
    hostname: ${DOCKERHOSTNAME}
    ports:
      - ${SWAG_PORT_443}:443
      - ${SWAG_PORT_80}:80
    cap_add:
      - NET_ADMIN
    networks:
      - proxy
    container_name: swag
    environment:
      - DNSPLUGIN=${SWAG_DNSPLUGIN}
      - DUCKDNSTOKEN=${SWAG_DUCKDNSTOKEN}
      - EMAIL=${SWAG_EMAIL}
      - EXTRA_DOMAINS=${SWAG_EXTRA_DOMAINS}
      - ONLY_SUBDOMAINS=${SWAG_ONLY_SUBDOMAINS}
      - PGID=${PGID}
      - PUID=${PUID}
      - SUBDOMAINS=${SWAG_SUBDOMAINS}
      - TZ=${TZ}
      - URL=${SWAG_URL}
      - VALIDATION=${SWAG_VALIDATION}
      - MAXMINDDB_LICENSE_KEY=${SWAG_MAXMINDDB_LICENSE_KEY}
    logging:
      driver: json-file
      options:
        max-file: ${DOCKERLOGGING_MAXFILE}
        max-size: ${DOCKERLOGGING_MAXSIZE}
    restart: ${SWAG_RESTART}
    volumes:
      - /etc/localtime:/etc/localtime:ro
      - ${DOCKERCONFDIR}/swag:/config
      - ${DOCKERSTORAGEDIR}:/storage


networks:
  proxy:
    external: true

Default Admin Account Not Working

I picked the MySQL docker-compose for koel if that changes anything- but, I just can't get past the login screen.

image

The readme states that with newer versions, it should automatically create a default admin account of email: [email protected] | KoelIsCool. It just hasn't been working for me, and I copy/pasted it, so I know I didn't mistype it or anything.

Am I missing something really obvious here?

Inconsistent ability to log in

Howdy! I am running Koel in the suggested Docker configuration with Mysql, using Caddy as a reverse proxy with TLS. It seems to be working well, except that 9/10 times it fails to log in. I am definitely providing the correct credentials, and it doesn't actually reject my credentials, it just reloads the login screen. Eventually, after doing this several times and refreshing the page, it will load the user UI. However, this has made it completely impossible for me to use the iOS app.

Here is what the console looks like when it fails to login:

Please let me know if I can provide anything else.

Sync Fails even after increasing MEMORY_LIMIT


   INFO  Scanning /Flac.  

  972/3482 [=======>--------------------]  27%
   ValueError 

  fread(): Argument #2 ($length) must be greater than 0

  at vendor/james-heinrich/getid3/getid3/getid3.php:2215
    2211โ–•                       //if (($this->getid3->memory_limit > 0) && ($bytes > $this->getid3->memory_limit)) {
    2212โ–•                       if (($this->getid3->memory_limit > 0) && (($bytes / $this->getid3->memory_limit) > 0.99)) { // enable a more-fuzzy match to prevent close misses generating errors like "PHP Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 33554464 bytes)"
    2213โ–•                               throw new getid3_exception('cannot fread('.$bytes.' from '.$this->ftell().') that is more than available PHP memory ('.$this->getid3->memory_limit.')', 10);
    2214โ–•                       }
  โžœ 2215โ–•                       $part = fread($this->getid3->fp, $bytes);
    2216โ–•                       $partLength  = strlen($part);
    2217โ–•                       $bytes      -= $partLength;
    2218โ–•                       $contents   .= $part;
    2219โ–•               } while (($bytes > 0) && ($partLength > 0));

      +5 vendor frames 
  6   app/Services/FileSynchronizer.php:52
      getID3::analyze()

  7   app/Services/FileSynchronizer.php:79
      App\Services\FileSynchronizer::getFileScanInformation()

No results after trying all these
- MEMORY_LIMIT=2048
- MEMORY_LIMIT=2048M
- MEMORY_LIMIT="2048"

Initial Sync fails with tag issue

I have just deployed with docker and the initial sync fails:
root@d39bdd6d3cf4:/var/www/html# php artisan koel:sync

INFO Scanning /music.

39465/113064 [=========>------------------] 34%
ValueError

strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)

at vendor/james-heinrich/getid3/getid3/module.tag.id3v2.php:1535
1531โ–• $frame_filename = '';
1532โ–• }
1533โ–• $frame_offset = $frame_terminatorpos + strlen($frame_textencoding_terminator);
1534โ–•
โžœ 1535โ–• $frame_terminatorpos = strpos($parsedFrame['data'], $frame_textencoding_terminator, $frame_offset);
1536โ–• if (ord(substr($parsedFrame['data'], $frame_terminatorpos + strlen($frame_textencoding_terminator), 1)) === 0) {
1537โ–• $frame_terminatorpos++; // strpos() fooled because 2nd byte of Unicode chars are often 0x00
1538โ–• }
1539โ–• $parsedFrame['description'] = substr($parsedFrame['data'], $frame_offset, $frame_terminatorpos - $frame_offset);

  +3 vendor frames 

4 app/Services/FileSynchronizer.php:52
getID3::analyze()

5 app/Services/FileSynchronizer.php:79
App\Services\FileSynchronizer::getFileScanInformation()

There is no more detail in the laravel.log.
Due to the size of my library I am running with MEMORY_LIMIT=2048M.
I get that there may be invalid characters in the tags in one of my files, but there is no detail that might let me find the file which is causing the issue and it would be like trying to find a needle in a haystack...

Error 500 during upload files

Hi

I try since some hours to do an upload from UI but it's impossible

I got always error 500 "server error"

And when I run the following command,
docker exec koel cat storage/logs/laravel.log

I have this log :

[2021-12-05 01:02:41] production.ERROR: Unable to create the "/music/__KOEL_UPLOADS__/" directory. {"userId":1,"exception":"[object] (Symfony\\Component\\HttpFoundation\\File\\Exception\\FileException(code: 0): Unable to create the \"/music/__KOEL_UPLOADS__/\" directory. at /var/www/html/vendor/symfony/http-foundation/File/File.php:125)
[stacktrace]
#0 /var/www/html/vendor/symfony/http-foundation/File/UploadedFile.php(182): Symfony\\Component\\HttpFoundation\\File\\File->getTargetFile()
#1 /var/www/html/app/Services/UploadService.php(27): Symfony\\Component\\HttpFoundation\\File\\UploadedFile->move()
#2 /var/www/html/app/Http/Controllers/API/UploadController.php(25): App\\Services\\UploadService->handleUploadedFile()
#3 /var/www/html/vendor/laravel/framework/src/Illuminate/Routing/Controller.php(54): App\\Http\\Controllers\\API\\UploadController->store()
#4 /var/www/html/vendor/laravel/framework/src/Illuminate/Routing/ControllerDispatcher.php(45): Illuminate\\Routing\\Controller->callAction()
#5 /var/www/html/vendor/laravel/framework/src/Illuminate/Routing/Route.php(261): Illuminate\\Routing\\ControllerDispatcher->dispatch()
#6 /var/www/html/vendor/laravel/framework/src/Illuminate/Routing/Route.php(204): Illuminate\\Routing\\Route->runController()
#7 /var/www/html/vendor/laravel/framework/src/Illuminate/Routing/Router.php(695): Illuminate\\Routing\\Route->run()
#8 /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(128): Illuminate\\Routing\\Router->Illuminate\\Routing\\{closure}()
#9 /var/www/html/app/Http/Middleware/Authenticate.php(28): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#10 /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): App\\Http\\Middleware\\Authenticate->handle()
#11 /var/www/html/vendor/laravel/framework/src/Illuminate/Routing/Middleware/SubstituteBindings.php(50): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#12 /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\\Routing\\Middleware\\SubstituteBindings->handle()
#13 /var/www/html/vendor/laravel/framework/src/Illuminate/Routing/Middleware/ThrottleRequests.php(127): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#14 /var/www/html/vendor/laravel/framework/src/Illuminate/Routing/Middleware/ThrottleRequests.php(63): Illuminate\\Routing\\Middleware\\ThrottleRequests->handleRequest()
#15 /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\\Routing\\Middleware\\ThrottleRequests->handle()
#16 /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(103): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#17 /var/www/html/vendor/laravel/framework/src/Illuminate/Routing/Router.php(697): Illuminate\\Pipeline\\Pipeline->then()
#18 /var/www/html/vendor/laravel/framework/src/Illuminate/Routing/Router.php(672): Illuminate\\Routing\\Router->runRouteWithinStack()
#19 /var/www/html/vendor/laravel/framework/src/Illuminate/Routing/Router.php(636): Illuminate\\Routing\\Router->runRoute()
#20 /var/www/html/vendor/laravel/framework/src/Illuminate/Routing/Router.php(625): Illuminate\\Routing\\Router->dispatchToRoute()
#21 /var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(166): Illuminate\\Routing\\Router->dispatch()
#22 /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(128): Illuminate\\Foundation\\Http\\Kernel->Illuminate\\Foundation\\Http\\{closure}()
#23 /var/www/html/app/Http/Middleware/ForceHttps.php(31): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#24 /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): App\\Http\\Middleware\\ForceHttps->handle()
#25 /var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php(21): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#26 /var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/ConvertEmptyStringsToNull.php(31): Illuminate\\Foundation\\Http\\Middleware\\TransformsRequest->handle()
#27 /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\\Foundation\\Http\\Middleware\\ConvertEmptyStringsToNull->handle()
#28 /var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php(21): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#29 /var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TrimStrings.php(40): Illuminate\\Foundation\\Http\\Middleware\\TransformsRequest->handle()
#30 /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\\Foundation\\Http\\Middleware\\TrimStrings->handle()
#31 /var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/ValidatePostSize.php(27): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#32 /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\\Foundation\\Http\\Middleware\\ValidatePostSize->handle()
#33 /var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/PreventRequestsDuringMaintenance.php(86): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#34 /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\\Foundation\\Http\\Middleware\\PreventRequestsDuringMaintenance->handle()
#35 /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(103): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#36 /var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(141): Illuminate\\Pipeline\\Pipeline->then()
#37 /var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(110): Illuminate\\Foundation\\Http\\Kernel->sendRequestThroughRouter()
#38 /var/www/html/public/index.php(57): Illuminate\\Foundation\\Http\\Kernel->handle()

What is the issue ? I don't understand

Thank you in advance

Regards

NB: I also tried a put endpoint ( edit the nale of music ) and I can't. Same issue error 500.
I checked the rights and eveything is OK. I did a chmod 777 just for the test and same issue.

MySQL database access denied

After having no success with postgres I now tried mysql, but despite MYSQL_USER and PASSWORD being the same as the DB values for koel in docker-compose.mysql.yml, koel is unable to access the mysql database in the container:

SQLSTATE[HY000] [1045] Access denied for user 'koel'@'172.19.0.3' (using password: YES)

I have recreated the containers multiple times, and have no idea how to debug this...

Can not get pass setting up the music folder, keep getting an error

Hi,
I'm trying to setup the docker container on my Synology NAS and I keep getting an error when the setup arrives at setting up the music folder. If I leave it blank I'm getting the error if I specify the path I'm also getting the error.

I have already check permissions and changed them to root but even that didn't help.
Any idea how to solve this? Or what I'm I doing wrong in setting this up?

Screen_Shot

What is the default admin account?

App key exists -- skipping
Migrating database
Creating default admin account
Seeding initial data
The absolute path to your media directory. If this is skipped (left blank) now, you can set it later via the web interface.
 Media path [/music]:
 > 
Now to front-end stuff
Oops! Koel installation or upgrade didn't finish successfully.
Please try again, or visit https://docs.koel.dev for manual installation.
๐Ÿ˜ฅ Sorry for this. You deserve better.

Creating default admin account
What is the default admin account?
The first run didn't let me create a new account

no API_KEY after key:generate

After installing I'm seeing the following error:

PHP Fatal error:  Uncaught RuntimeException: The only supported ciphers are AES-128-CBC and AES-256-CBC with the correct key lengths. in /var/www/html/vendor/laravel/framework/src/Illuminate/Encryption/Encrypter.php:44\nStack trace:\n#0 /var/www/html/vendor/laravel/framework/src/Illuminate/Encryption/EncryptionServiceProvider.php(32): Illuminate\\Encryption\\Encrypter->__construct()\n#1 /var/www/html/vendor/laravel/framework/src/Illuminate/Container/Container.php(869): Illuminate\\Encryption\\EncryptionServiceProvider->Illuminate\\Encryption\\{closure}()\n#2 /var/www/html/vendor/laravel/framework/src/Illuminate/Container/Container.php(754): Illuminate\\Container\\Container->build()\n#3 /var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(841): Illuminate\\Container\\Container->resolve()\n#4 /var/www/html/vendor/laravel/framework/src/Illuminate/Container/Container.php(692): Illuminate\\Foundation\\Application->resolve()\n#5 /var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(826): Illuminat in /var/www/html/vendor/laravel/framework/src/Illuminate/Encryption/Encrypter.php on line 44, referer: https://koel.k-dev.harmony.net/

Could this be because I made up an API_KEY rather than use the utility to generate one? I thought maybe so I tried to generate one using the command:

# php artisan key:generate --force
Application key set successfully.

Looks like it completed successfully but there is nothing new in .env

Unable to init with postgres

โฏ sudo docker-compose -f ./docker-compose.postgres.yml up -d
Starting koel_database_1 ... done
Starting koel_koel_1     ... done
โฏ sudo docker ps
CONTAINER ID   IMAGE         COMMAND                  CREATED             STATUS                    PORTS                                 NAMES
d762f1325c44   hyzual/koel   "koel-entrypoint apaโ€ฆ"   About an hour ago   Up 36 minutes (healthy)   0.0.0.0:380->80/tcp, :::380->80/tcp   koel_koel_1
912a728dd875   postgres:13   "docker-entrypoint.sโ€ฆ"   About an hour ago   Up 36 minutes             5432/tcp                              koel_database_1
โฏ sudo docker exec --user www-data -it koel_koel_1 bash
www-data@d762f1325c44:~/html$ php artisan koel:init --no-assets
Attempting to install or upgrade Koel.
Remember, you can always install/upgrade manually following the guide here:
๐Ÿ“™  https://docs.koel.dev

App key exists -- skipping
Migrating database
Oops! Koel installation or upgrade didn't finish successfully.
Please try again, or visit https://docs.koel.dev for manual installation.
๐Ÿ˜ฅ Sorry for this. You deserve better.

Docker image won't finish startup

The current state is permanently starting and the instance cannot be accessed over the browser.

Setup:

  • Docker-Compose
  • Treafik
  • Koel (w. MySQL)

image

Logs:

APP_KEY exists. Skipping key generation
running docker-php-entrypoint with arguments apache2-foreground
[Tue May 11 10:42:15.298401 2021] [so:warn] [pid 8] AH01574: module xsendfile_module is already loaded, skipping
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 172.26.0.3. Set the 'ServerName' directive globally to suppress this message
[Tue May 11 10:42:15.338772 2021] [so:warn] [pid 8] AH01574: module xsendfile_module is already loaded, skipping
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 172.26.0.3. Set the 'ServerName' directive globally to suppress this message
[Tue May 11 10:42:15.755978 2021] [mpm_prefork:notice] [pid 8] AH00163: Apache/2.4.38 (Debian) PHP/7.4.19 configured -- resuming normal operations
[Tue May 11 10:42:15.756005 2021] [core:notice] [pid 8] AH00094: Command line: 'apache2 -D FOREGROUND'
172.26.0.1 - - [11/May/2021:10:44:55 +0000] "GET / HTTP/1.1" 200 918 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.93 Safari/537.36"
172.26.0.1 - - [11/May/2021:10:44:55 +0000] "\x16\x03\x01\x02" 400 0 "-" "-"
172.26.0.1 - - [11/May/2021:10:44:55 +0000] "\x16\x03\x01\x02" 400 0 "-" "-"
172.26.0.1 - - [11/May/2021:10:44:55 +0000] "\x16\x03\x01\x02" 400 0 "-" "-"
172.26.0.1 - - [11/May/2021:10:44:55 +0000] "\x16\x03\x01\x02" 400 0 "-" "-"
172.26.0.1 - - [11/May/2021:10:44:55 +0000] "\x16\x03\x01\x02" 400 0 "-" "-"
172.26.0.1 - - [11/May/2021:10:44:55 +0000] "\x16\x03\x01\x02" 400 0 "-" "-"
172.26.0.1 - - [11/May/2021:10:44:55 +0000] "\x16\x03\x01\x02" 400 0 "-" "-"
172.26.0.1 - - [11/May/2021:10:44:55 +0000] "\x16\x03\x01\x02" 400 0 "-" "-"

can't connetct last.fm

i see this: https://docs.koel.dev/3rd-party.html#last-fm
my configuration
APP_ENV=production APP_DEBUG=false APP_URL=https://koel.fungit.org/ ADMIN_NAME="Fungit" [email protected] ADMIN_PASSWORD=1234566 APP_MAX_SCAN_TIME=600 MEMORY_LIMIT= FORCE_HTTPS=true LASTFM_API_KEY=9518c0b4b58b6adf5dceaebb2de40b56 LASTFM_API_SECRET=766d2fef444af4532f1e76f9f901f7f4 ALLOW_DOWNLOAD=true
when i click connect button in profile . Whenever I change the API and key, it will be redirected to this address. https://koel.fungit.org/web/lastfm/connect?api_token=1|t2JSsj2RUEMIoGy4vBHXTq9JZPT1KgNeQug30bT2, this token Never change. This https://koel.fungit.org/web/lastfm URL also not found.

image

i try to fill homepage url or not, But it's the same thing

Run docker container as non-root user

It's my understanding that running docker containers as root isn't ideal. The current configuration, which runs internally as www-data and externally as root can create some problems with access to permissions on the /music folder, and it's rather difficult to change the user after the container has been created, so this can't be sorted by simply adding a docker compose line user: $UID:$GID as subsequent access to the contents of the container by www-data (or whatever) is broken. It seems to me that it would be relatively trivial to map www-data onto a custom UID which could then, by extension, map onto a user account on the host OS. Has there been discussion on this before and perhaps some options ruled out? I'm happy to add a pull-request, but am aware there are several was to do it.

Cant Login after Completed the Setup.

Getting Error in Browser (Java is activated), im behind Traefik, do i have to edit something in Traefik?

why is the api request send via http? password and user is sent in cleartext.

unknown

Docker container with koel behind nginx reverse proxy in non-root

Description

I freshly installed Koel using the recommended Docker image and configured it to work under the Nginx reverse proxy in subfolder /koel. The page loads, but the most of the content is missing, and the links to the content are broken (https://example.com/img/icon.png instead of https://example.com/koel/img/icon.png). I tried to provide .env to container with both APP_URL and FORCE_HTTPS, but no luck - page still blank. It feels that variables are not passed properly for some reason.
If I revert my current Nginx config to use / - everything works fine.

Nginx confix

server {
    listen 80;
    server_name example.com;
    return 301 https://$server_name$request_uri;
}

upstream koel {
    server 127.0.0.1:5050;
    keepalive 64;
}

server {
    server_name example.com www.example.com;
    index index.html index.htm index.php;
    listen [::]:443 ssl ipv6only=on; # managed by Certbot
    listen 443 ssl; # managed by Certbot
    ssl_certificate /etc/letsencrypt/live/example.com/fullchain.pem; # managed by Certbot
    ssl_certificate_key /etc/letsencrypt/live/example.com/privkey.pem; # managed by Certbot
    include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
    ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
    client_max_body_size 100M;
    client_body_timeout 30s;
    server_tokens off;

    location /koel {
        proxy_http_version 1.1;
        proxy_pass http://koel;
        proxy_set_header Host $http_host;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Scheme $scheme;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-Proto $scheme;
        proxy_set_header X-Script-Name /koel;

        gzip            on;
        gzip_types      text/plain text/css application/x-javascript text/xml application/xml application/xml+rss text/javascript application/json;
        gzip_comp_level 9;

        location ~ /koel/media/ {
            internal;
            # A 'X-Media-Root' should be set to media_path settings from upstream
            alias       $upstream_http_x_media_root;
            #access_log /var/log/nginx/koel.access.log;
            #error_log  /var/log/nginx/koel.error.log;
        }
        location ~ \.php$ {
            #try_files $uri $uri/ /index.php?$args;

            fastcgi_param     PATH_INFO $fastcgi_path_info;
            fastcgi_param     PATH_TRANSLATED $document_root$fastcgi_path_info;
            fastcgi_param     SCRIPT_FILENAME $document_root$fastcgi_script_name;
            # PHP7
            fastcgi_pass              unix:/var/run/php/php7.0-fpm.sock;
            # PHP5
            #fastcgi_pass             unix:/var/run/php5-fpm.sock;
            fastcgi_index             index.php;
            fastcgi_split_path_info   ^(.+\.php)(/.+)$;
            fastcgi_intercept_errors  on;
            include                   fastcgi_params;
        }
    }
}

Docker-compose.yml

version: '3'

services:
  koel:
    image: hyzual/koel
    depends_on:
      - database
    ports:
      - "${PORT}:80"
    environment:
      - DB_CONNECTION=pgsql
      - DB_HOST=database
      - DB_USERNAME=koel
      - DB_PASSWORD=password
      - DB_DATABASE=koel
    volumes:
      - "${MOUNT_MUSIC}:/music"
      - "${MOUNT_COVERS}:/var/www/html/public/img/covers"
      - "${MOUNT_INDEX}:/var/www/html/storage/search-indexes"
      - "${MOUNT_ENV}:/var/www/html/.env"
  database:
    image: postgres:13
    volumes:
      - "${MOUNT_SQL}:/var/lib/postgresql/data"
    environment:
      - POSTGRES_DB=koel
      - POSTGRES_USER=koel
      - POSTGRES_PASSWORD=password

koel.env

APP_URL=https://example.com/koel
FORCE_HTTPS=true
APP_KEY=key

Docker-compose.env

# Port to expose HTTP service
# Set to 127.0.0.1:port if you wish to reverse-proxy the docker's port,
# otherwise the port specified here will be publicly accessible
PORT=127.0.0.1:5050

# Directory to store koel img covers
MOUNT_COVERS=/var/local/koel/covers

# Directory to store koel music
MOUNT_MUSIC=/var/local/koel/music

# Directory to store koel search index
MOUNT_INDEX=/var/local/koel/index

# Directory to store database files
MOUNT_SQL=/var/local/koel/sql

# Koel .env file
MOUNT_ENV=./koel.env

Environment

  • Koel version v5.1.8
  • OS: Ubuntu 20.04
  • Browser: Firefox
  • PHP version Latest as of writing
  • Node version Latest as of writing

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.