Skip to content

Commit a0819c1

Browse files
authored
fix: align image storage with koel/koel#2479 + allow Apache to follow symlinks (#221)
* fix: align image storage with koel/koel#2479 + allow Apache to follow symlinks * fix: pre-create the image storage path so its ownership is correct * docs: warn users on 9.3.x that prior data may be lost --------- Co-authored-by: An Phan <aph@qwello.eu>
1 parent 4f62826 commit a0819c1

7 files changed

Lines changed: 21 additions & 5 deletions

File tree

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,13 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
55

66
Since this docker image only has one tag which is `latest`, there are no versions. However we'll write changes with the date at which they occured.
77

8+
## 2026-05-22
9+
### Fixed
10+
- ⚠ Image storage path moved to follow koel/koel#2479. If you're upgrading from a previous release, update your `docker-compose.yml` so the `image_storage` volume binds to `/var/www/html/storage/app/public/images` instead of `/var/www/html/public/img/storage`. Existing data in your `image_storage` volume / host bind transfers over automatically when you switch the mount point — files inside the volume don't move, only the mount path inside the container does.
11+
- Apache now follows symlinks under the document root, fixing the `Symbolic link not allowed or link target not accessible: /var/www/html/public/storage` error introduced when the new image path was symlinked.
12+
13+
> **Heads-up if you already upgraded to a 9.3.x image before this fix.** koel/koel's `koel:init` ran a one-time `migrateLegacyImages` step that *moved* files (destructive) from `public/img/storage/` into the in-container `storage/app/public/images/`. On Docker that target was ephemeral, so the files were wiped on the next image pull and your `image_storage` volume / host bind is now empty. There's nothing this fix can do to recover that — restore from backup if you have one, or let koel re-fetch album / artist art from your source media on the next scan.
14+
815
## 2022-04-15
916
### Changed
1017
- ⚠ BREAKING CHANGE: Image name has changed, it is now [`phanan/koel`](https://hub.docker.com/r/phanan/koel) instead of `hyzual/koel`.

Dockerfile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,9 @@ RUN apt-get update \
8181
# Create the search-indexes volume so it has the correct permissions
8282
&& mkdir -p /var/www/html/storage/search-indexes \
8383
&& chown www-data:www-data /var/www/html/storage/search-indexes \
84+
# Same for the image storage volume
85+
&& mkdir -p /var/www/html/storage/app/public/images \
86+
&& chown -R www-data:www-data /var/www/html/storage/app \
8487
# Set locale to prevent removal of non-ASCII path characters when transcoding with ffmpeg
8588
# See https://github.com/koel/docker/pull/91
8689
&& echo "en_US.UTF-8 UTF-8" > /etc/locale.gen \
@@ -105,7 +108,7 @@ RUN cp -R /tmp/koel/. /var/www/html \
105108
# This declaration must be AFTER creating the folders and setting their permissions
106109
# and AFTER changing to non-root user.
107110
# Otherwise, they are owned by root and the user cannot write to them.
108-
VOLUME ["/music", "/var/www/html/public/img/storage", "/var/www/html/storage/search-indexes"]
111+
VOLUME ["/music", "/var/www/html/storage/app/public/images", "/var/www/html/storage/search-indexes"]
109112

110113
RUN cd /var/www/html \
111114
&& php artisan route:cache \

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ docker exec --user www-data <koel_container> php artisan koel:sync
114114
| Path | Description |
115115
|---|---|
116116
| `/music` | Your music library. |
117-
| `/var/www/html/public/img/storage` | Uploaded images (album art, user avatars, etc.). |
117+
| `/var/www/html/storage/app/public/images` | Uploaded images (album art, user avatars, etc.). |
118118
| `/var/www/html/storage/search-indexes` | Search indexes for songs, albums, and artists. |
119119

120120
## Ports

apache.conf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,12 @@
1111
ServerAdmin webmaster@localhost
1212
DocumentRoot /var/www/html/public
1313

14+
<Directory /var/www/html/public>
15+
Options +FollowSymLinks
16+
AllowOverride All
17+
Require all granted
18+
</Directory>
19+
1420
# Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
1521
# error, crit, alert, emerg.
1622
# It is also possible to configure the loglevel for particular

docker-compose.dev.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ services:
1717
- DB_PASSWORD=password
1818
volumes:
1919
- music:/music
20-
- image_storage:/var/www/html/public/img/storage
20+
- image_storage:/var/www/html/storage/app/public/images
2121
- search_index:/var/www/html/storage/search-indexes
2222
- ./.env.koel:/var/www/html/.env
2323
- ./sql:/docker-entrypoint-initdb.d

docker-compose.mysql.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ services:
1313
- DB_DATABASE=koel
1414
volumes:
1515
- music:/music
16-
- image_storage:/var/www/html/public/img/storage
16+
- image_storage:/var/www/html/storage/app/public/images
1717
- search_index:/var/www/html/storage/search-indexes
1818
- ./sql:/docker-entrypoint-initdb.d
1919

docker-compose.postgres.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ services:
1414
- DB_DATABASE=koel
1515
volumes:
1616
- music:/music
17-
- image_storage:/var/www/html/public/img/storage
17+
- image_storage:/var/www/html/storage/app/public/images
1818
- search_index:/var/www/html/storage/search-indexes
1919

2020
database:

0 commit comments

Comments
 (0)