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

[BUG] Calibre in a SubFolder w/ Reverse Proxy not working #129

Closed
1 task done
feldorn opened this issue Apr 10, 2023 · 5 comments
Closed
1 task done

[BUG] Calibre in a SubFolder w/ Reverse Proxy not working #129

feldorn opened this issue Apr 10, 2023 · 5 comments

Comments

@feldorn
Copy link

feldorn commented Apr 10, 2023

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

Calibre is configured to use a subfolder and is sitting behind SWAG/NGINX. The configuration worked on the prior version, but with KasmVNC produces the error message below.

Configurations Tested:

  • External URL w/ Subfolder: Error per below
  • Local IP Address w/ Subfolder: Error per below
  • Local IP Address using Port #, no subfolder: Works (No Reverse Proxy)
  • Local IP Address using Port #, w/ subfolder: Works (No Reverse Proxy)
  • Subdomain URL, no subfolder: Works (w/ Reverse Proxy)

I can launch the URL for /calibre/vnc/dist/main.bundle.js and it is visible to the browser.

Swag NGINX Reverse Proxy is configured per the latest SWAG sample file.

image

Expected Behavior

Ability to Launch Calibre using an url with a subfolder:
Example: https://www.domain.com/calibre/

Steps To Reproduce

  1. Configure SWAG and Reverse Proxy using all the defaults for Calibre
  2. Configure Calibre Docker Container and use the SUBFOLDER variable to define a subfolder
  3. Launch

Environment

- OS: Linux Mint 24
- How docker service was installed: Docker Compose

CPU architecture

x86-64

Docker creation

Docker Compose:
calibre:
  image: lscr.io/linuxserver/calibre:latest
  container_name: calibre
  environment:
    - PUID=1000
    - PGID=1000
    - TZ=America/Chicago
    - PASSWORD= #optional
    - CLI_ARGS= #optional
    - SUBFOLDER=/calibre/
    - DRINODE=/dev/dri/renderD128
  security_opt:
    - seccomp:unconfined
  ports:
    - 9085:8080
    - 9086:8081
  restart: always

Container logs

[migrations] started
[migrations] no migrations found
───────────────────────────────────────
      ██╗     ███████╗██╗ ██████╗ 
      ██║     ██╔════╝██║██╔═══██╗
      ██║     ███████╗██║██║   ██║
      ██║     ╚════██║██║██║   ██║
      ███████╗███████║██║╚██████╔╝
      ╚══════╝╚══════╝╚═╝ ╚═════╝ 
   Brought to you by linuxserver.io
───────────────────────────────────────
To support LSIO projects visit:
https://www.linuxserver.io/donate/
───────────────────────────────────────
GID/UID
───────────────────────────────────────
User UID:    1000
User GID:    1000
───────────────────────────────────────
**** adding /dev/dri/renderD128 to video group render with id 109 ****
[custom-init] No custom files found, skipping...
[ls.io-init] done.
_XSERVTransmkdir: ERROR: euid != 0,directory /tmp/.X11-unix will not be created.
Xvnc KasmVNC 1.1.0 - built Apr  9 2023 00:38:52
Copyright (C) 1999-2018 KasmVNC Team and many others (see README.me)
See http://kasmweb.com for information on KasmVNC.
Underlying X server release 12014000, The X.Org Foundation
Obt-Message: Xinerama extension is not present on the server
QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-abc'
xvnc_get_formats
@github-actions
Copy link

Thanks for opening your first issue here! Be sure to follow the relevant issue templates, or risk having this issue marked as invalid.

@thelamer
Copy link
Member

does it work with the trailing slash entered ? IE http://www.domain.com/calibre/

@feldorn
Copy link
Author

feldorn commented Apr 10, 2023

The behavior is with the slash. The NGINX proxy rules will rewrite the URL with the trailing slash. I can force it without a slash using the port address (bypassing the reverse proxy), but as stated elsewhere, that gives an error. I'll update the original post to show the slash.

image

@thelamer
Copy link
Member

So I have a solution, you can add the following to your reverse proxy conf: (this is just drop in see my notes below about collision with other apps)

location ^~ /websockify {
    # enable the next two lines for http auth
    #auth_basic "Restricted";
    #auth_basic_user_file /config/nginx/.htpasswd;

    # enable for ldap auth (requires ldap-server.conf in the server block)
    #include /config/nginx/ldap-location.conf;

    # enable for Authelia (requires authelia-server.conf in the server block)
    #include /config/nginx/authelia-location.conf;

    # enable for Authentik (requires authentik-server.conf in the server block)
    #include /config/nginx/authentik-location.conf;

    include /config/nginx/proxy.conf;
    include /config/nginx/resolver.conf;
    set $upstream_app calibre;
    set $upstream_port 6901;
    set $upstream_proto http;
    proxy_pass $upstream_proto://$upstream_app:$upstream_port;
    proxy_buffering          off;
}

This will work, but only for one GUI app, so if you are running anything else off of this base would need a unique path like:

location ^~ /calibre-websockify {

If the path is modified from that websockify path then on your client need to modify the connection settings in the sidebar:

subfolder

I'll get a PR for our example proxy confs with the drop in so people in the future don't run into this.

@feldorn
Copy link
Author

feldorn commented Apr 10, 2023

I can confirm this solution works. I also include authentication (Organizr) w/in the Reverse Proxy configuration and that isn't causing any issues either. I don't have another GUI in the container, so I've not tested modifying the path.

  • External URL w/ Subfolder: Works
  • Local IP Address w/ Subfolder: Works

I appreciate the fast turn around on this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

No branches or pull requests

2 participants