From 19b9deccf52be5463ccba83226533ac2655a5acc Mon Sep 17 00:00:00 2001 From: Glenn Thompson Date: Mon, 17 Nov 2025 06:46:45 +0300 Subject: [PATCH 1/4] fix: Use /app/music/ as default music library path for production - Changed hardcoded music/library/ path to /app/music/ (production path) - Added MUSIC_LIBRARY_PATH environment variable for local dev override - Fixes scan library function on production server - Aligns with path structure used in M3U playlists and liquidsoap config --- asteroid.lisp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/asteroid.lisp b/asteroid.lisp index bdd673e..b6655d6 100644 --- a/asteroid.lisp +++ b/asteroid.lisp @@ -16,8 +16,8 @@ ;; configuration logic. Probably using 'ubiquity (defparameter *server-port* 8080) (defparameter *music-library-path* - (merge-pathnames "music/library/" - (asdf:system-source-directory :asteroid))) + (or (uiop:getenv "MUSIC_LIBRARY_PATH") + "/app/music/")) (defparameter *supported-formats* '("mp3" "flac" "ogg" "wav")) (defparameter *stream-base-url* "http://localhost:8000") From 2a505e482ddea22befb528a79baf5f5a50833cea Mon Sep 17 00:00:00 2001 From: Glenn Thompson Date: Mon, 17 Nov 2025 13:21:01 +0300 Subject: [PATCH 2/4] Fix scan-library path to work in both development and production - Auto-detect music library path based on environment - Check for music/library/ directory for local development - Default to /app/music/ for production Docker deployment - Allow MUSIC_LIBRARY_PATH environment variable override - Fixes scan-library function failing on production server --- asteroid.lisp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/asteroid.lisp b/asteroid.lisp index b6655d6..6708dc8 100644 --- a/asteroid.lisp +++ b/asteroid.lisp @@ -17,7 +17,10 @@ (defparameter *server-port* 8080) (defparameter *music-library-path* (or (uiop:getenv "MUSIC_LIBRARY_PATH") - "/app/music/")) + ;; Default to /app/music/ for production Docker, but check if music/library/ exists for local dev + (if (probe-file (merge-pathnames "music/library/" (asdf:system-source-directory :asteroid))) + (merge-pathnames "music/library/" (asdf:system-source-directory :asteroid)) + "/app/music/"))) (defparameter *supported-formats* '("mp3" "flac" "ogg" "wav")) (defparameter *stream-base-url* "http://localhost:8000") From 59076e67b829a6147fc0f56fa73ad8e9037266ce Mon Sep 17 00:00:00 2001 From: Luis Pereira Date: Mon, 17 Nov 2025 06:13:38 +0000 Subject: [PATCH 3/4] fix: profile password change using non existing function --- auth-routes.lisp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/auth-routes.lisp b/auth-routes.lisp index 3095b9a..559d99b 100644 --- a/auth-routes.lisp +++ b/auth-routes.lisp @@ -127,7 +127,7 @@ (error 'authentication-error :message "Not authenticated")) ;; Verify current password - (unless (verify-user-credentials username current-password) + (unless (authenticate-user username current-password) (error 'authentication-error :message "Current password is incorrect")) ;; Update password From 559187df2ea04c7e01ffac1467bbb9c4caadd38f Mon Sep 17 00:00:00 2001 From: Luis Pereira Date: Mon, 17 Nov 2025 06:13:59 +0000 Subject: [PATCH 4/4] fix: with-error-handling using inner message This fix some issues where, on the client, `response.message` was `Ok.` for error responses and real error message needed to be extracted from `response.data.message`, which made a weird API. --- conditions.lisp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/conditions.lisp b/conditions.lisp index f16464a..d010aa6 100644 --- a/conditions.lisp +++ b/conditions.lisp @@ -109,39 +109,47 @@ (not-found-error (e) (api-output `(("status" . "error") ("message" . ,(error-message e))) + :message (error-message e) :status 404)) (authentication-error (e) (api-output `(("status" . "error") ("message" . ,(error-message e))) + :message (error-message e) :status 401)) (authorization-error (e) (api-output `(("status" . "error") ("message" . ,(error-message e))) + :message (error-message e) :status 403)) (validation-error (e) (api-output `(("status" . "error") ("message" . ,(error-message e))) + :message (error-message e) :status 400)) (database-error (e) (format t "Database error: ~a~%" e) (api-output `(("status" . "error") ("message" . "Database operation failed")) + :message "Database operation failed" :status 500)) (asteroid-stream-error (e) (format t "Stream error: ~a~%" e) (api-output `(("status" . "error") ("message" . "Stream operation failed")) + :message "Stream operation failed" :status 500)) (asteroid-error (e) (format t "Asteroid error: ~a~%" e) (api-output `(("status" . "error") ("message" . ,(error-message e))) + :message (error-message e) :status 500)) (error (e) (format t "Unexpected error: ~a~%" e) (api-output `(("status" . "error") ("message" . "An unexpected error occurred")) - :status 500)))) + :status 500 + :message "An unexpected error occurred")))) (defmacro with-db-error-handling (operation &body body) "Wrap database operations with error handling.