Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes and cleanup for subdirectory serving support #3521

Merged
merged 9 commits into from
Oct 15, 2024

Conversation

mikiher
Copy link
Contributor

@mikiher mikiher commented Oct 15, 2024

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.

@mikiher mikiher changed the title Fixes and cleanup for subdirectory serviing support Fixes and cleanup for subdirectory serving support Oct 15, 2024
@mikiher mikiher marked this pull request as ready for review October 15, 2024 05:25
@advplyr
Copy link
Owner

advplyr commented Oct 15, 2024

That's much better, thanks for cleaning that up. Working well in my tests and with base path set on the server side.

@advplyr advplyr merged commit cb234fe into advplyr:master Oct 15, 2024
5 checks passed
@advplyr
Copy link
Owner

advplyr commented Oct 16, 2024

Found an issue in dev with the endpoints not prefixed with /api/ /public/ and /hls/.

If you logout it will show the init screen because the request to /status doesn't get proxied.

I realize this is why did the /dev proxy with the axios middleware modifying the url. There is probably a better solution though

@mikiher
Copy link
Contributor Author

mikiher commented Oct 16, 2024 via email

Oasis256 added a commit to Oasis256/StoryTeller that referenced this pull request Oct 20, 2024
Oasis256 added a commit to Oasis256/StoryTeller that referenced this pull request Oct 20, 2024
@mikiher mikiher deleted the subdirectory-fixes branch November 18, 2024 07:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants