[PR #3521] [MERGED] Fixes and cleanup for subdirectory serving support #4000

Closed
opened 2026-04-25 00:17:54 +02:00 by adam · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/advplyr/audiobookshelf/pull/3521
Author: @mikiher
Created: 10/15/2024
Status: Merged
Merged: 10/15/2024
Merged by: @advplyr

Base: masterHead: subdirectory-fixes


📝 Commits (9)

  • 69dd82d Remove unneeded /dev routing
  • 99ffd30 Cleanup: Define routerBasePath constant in nuxt.config.js
  • 241c02b nuxt.config.js: more cleanup and additional proxies
  • 027190b Merge branch 'advplyr:master' into subdirectory-fixes
  • bf16681 Merge branch 'subdirectory-fixes' of https://github.com/mikiher/audiobookshelf into subdirectory-fixes
  • 42616b5 Cleanup: remove explicit localhost:3333 and remove unnessesary if(dev) blocks
  • 2d7b63b Add base path to socket.io connections on client and server
  • cbca560 server.js: add base path to all non-base-path requests
  • cb85e02 Fix share URLs on dev

📊 Changes

12 files changed (+35 additions, -45 deletions)

View changed files

📝 client/components/covers/AuthorImage.vue (+1 -5)
📝 client/components/modals/ShareModal.vue (+2 -2)
📝 client/components/modals/rssfeed/OpenCloseModal.vue (+1 -1)
📝 client/layouts/default.vue (+2 -1)
📝 client/nuxt.config.js (+15 -11)
📝 client/pages/audiobook/_id/chapters.vue (+1 -1)
📝 client/pages/share/_slug.vue (+1 -7)
📝 client/players/AudioTrack.js (+0 -4)
📝 client/plugins/axios.js (+0 -1)
📝 client/store/globals.js (+0 -10)
📝 server/Server.js (+10 -1)
📝 server/SocketAuthority.js (+2 -1)

📄 Description

This PR contains some cleanup and a few fixes to allow for serving Audiobookshelf with a non-empty ROUTER_BASE_PATH, in both development and production environments.

The following modifications are included:

  • Cleanup: removed of /dev routing on the client
    • I'm not sure what it was used for - it seems completely unnessesary.
  • Cleanup: defined of routerBasePath and serverHostUrl constants in nuxt.config.js
  • Cleanup: removed unnessary if(development) blocks
  • Cleanup: removed all explicit server host references (localhost:3333) from the code
  • Fix: added proxies for public and hls
    • These are required for session cookies to be passed correctly in development environment
  • Fix: add $config.routerBasePath in some places where it was required.
  • Fix: fixed socket.io path on both client and server to use the router base path.
  • Fix: when router base path is non-empty, added the base path to all requests that don't start with the base path.
  • Fix: use /healthcheck on the main router rather than the app.

I have tested quite extensively with empty and non-empty ROUTER_BASE_PATH, and with development and production client setups, and it seems to work fine on all setup now.


🔄 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/advplyr/audiobookshelf/pull/3521 **Author:** [@mikiher](https://github.com/mikiher) **Created:** 10/15/2024 **Status:** ✅ Merged **Merged:** 10/15/2024 **Merged by:** [@advplyr](https://github.com/advplyr) **Base:** `master` ← **Head:** `subdirectory-fixes` --- ### 📝 Commits (9) - [`69dd82d`](https://github.com/advplyr/audiobookshelf/commit/69dd82d329f63f54a41ef658b503bb58be3f6ed4) Remove unneeded /dev routing - [`99ffd30`](https://github.com/advplyr/audiobookshelf/commit/99ffd3050c2d5a08efc2cd9dd56eec77fa042083) Cleanup: Define routerBasePath constant in nuxt.config.js - [`241c02b`](https://github.com/advplyr/audiobookshelf/commit/241c02be30f584791a37a542802503c2349e051f) nuxt.config.js: more cleanup and additional proxies - [`027190b`](https://github.com/advplyr/audiobookshelf/commit/027190b5a49ea60d3cce13ca88d58909b2b5289e) Merge branch 'advplyr:master' into subdirectory-fixes - [`bf16681`](https://github.com/advplyr/audiobookshelf/commit/bf16681beaf3c66f2bc04ed56639cec89d902afb) Merge branch 'subdirectory-fixes' of https://github.com/mikiher/audiobookshelf into subdirectory-fixes - [`42616b5`](https://github.com/advplyr/audiobookshelf/commit/42616b59de16c21721137accb3078874ef90008d) Cleanup: remove explicit localhost:3333 and remove unnessesary if(dev) blocks - [`2d7b63b`](https://github.com/advplyr/audiobookshelf/commit/2d7b63b4cf3d5baaa7f229d4669f3d464dba2685) Add base path to socket.io connections on client and server - [`cbca560`](https://github.com/advplyr/audiobookshelf/commit/cbca560f9248d2b1c798c3d014177372bff6b37e) server.js: add base path to all non-base-path requests - [`cb85e02`](https://github.com/advplyr/audiobookshelf/commit/cb85e0255bc4ba2c57cd3b5db466a289f1173dcc) Fix share URLs on dev ### 📊 Changes **12 files changed** (+35 additions, -45 deletions) <details> <summary>View changed files</summary> 📝 `client/components/covers/AuthorImage.vue` (+1 -5) 📝 `client/components/modals/ShareModal.vue` (+2 -2) 📝 `client/components/modals/rssfeed/OpenCloseModal.vue` (+1 -1) 📝 `client/layouts/default.vue` (+2 -1) 📝 `client/nuxt.config.js` (+15 -11) 📝 `client/pages/audiobook/_id/chapters.vue` (+1 -1) 📝 `client/pages/share/_slug.vue` (+1 -7) 📝 `client/players/AudioTrack.js` (+0 -4) 📝 `client/plugins/axios.js` (+0 -1) 📝 `client/store/globals.js` (+0 -10) 📝 `server/Server.js` (+10 -1) 📝 `server/SocketAuthority.js` (+2 -1) </details> ### 📄 Description This PR contains some cleanup and a few fixes to allow for serving Audiobookshelf with a non-empty ROUTER_BASE_PATH, in both development and production environments. The following modifications are included: - Cleanup: removed of `/dev` routing on the client - I'm not sure what it was used for - it seems completely unnessesary. - Cleanup: defined of `routerBasePath` and `serverHostUrl` constants in nuxt.config.js - Cleanup: removed unnessary if(development) blocks - Cleanup: removed all explicit server host references (`localhost:3333`) from the code - Fix: added proxies for `public` and `hls` - These are required for session cookies to be passed correctly in development environment - Fix: add $config.routerBasePath in some places where it was required. - Fix: fixed socket.io path on both client and server to use the router base path. - Fix: when router base path is non-empty, added the base path to all requests that don't start with the base path. - Fix: use `/healthcheck` on the main router rather than the app. I have tested quite extensively with empty and non-empty ROUTER_BASE_PATH, and with development and production client setups, and it seems to work fine on all setup now. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
adam added the pull-request label 2026-04-25 00:17:54 +02:00
adam closed this issue 2026-04-25 00:17:54 +02:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/audiobookshelf#4000