linuxserver / docker-calibre

GNU General Public License v3.0
339 stars 62 forks source link

Calibre does not autostart with the container when subfolder is used #62

Closed peterNordin closed 2 years ago

peterNordin commented 2 years ago

linuxserver.io


Expected Behavior

Calibre and the content server (if activated) should auto start also when SUBFOLDER is used

Current Behavior

Calibre is not started automatically with the container when I have set the SUBFOLDER environment variable.

In my case SUBFOLDER=/calibreui/ It does start when I manually visit, in my case http://mydocker.host:8080/calibreui in my web browser.

The problem seems to be that in the file /etc/services.d/autostart/run the line websocat -q -n ws://localhost:${CUSTOM_PORT:=3000}/guaclite?token=${TOKEN} does not take into account SUBFOLDER

Changing the line to websocat -q -n ws://localhost:${CUSTOM_PORT:=3000}${SUBFOLDER}guaclite?token=${TOKEN} helped in my case, but of course those changes will be lost whenever the container is updated. And I realize that SUBFOLDER is technically not part of the rdesktop-web base image where this file comes from.

Steps to Reproduce

  1. Set SUBFOLDER environment variable in docker compose file
  2. Calibre does not start automatically and the content server is unreachable (not running)
  3. Manually accessing the web interface from a browser makes Calibre start

Environment

OS: Ubuntu 20.04 CPU architecture: x86_64 How docker service was installed: From official Ubuntu repository

Command used to create docker container (run/create/compose/screenshot)

services:
  calibre:
    image: ghcr.io/linuxserver/calibre
    container_name: calibre
    environment:
      - PUID=123
      - PGID=123
      - TZ=Europe/Stockholm
      - PASSWORD=
      - CLI_ARGS= #optional
      - SUBFOLDER=/calibreui/
    volumes:
      - /path/to/docker/configs/calibre:/config
    ports:
      - 8080:8080
      - 8081:8081
    restart: unless-stopped

Docker logs

[s6-init] making user provided files available at /var/run/s6/etc...exited 0.
[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] 01-envfile: executing... 
[cont-init.d] 01-envfile: exited 0.
[cont-init.d] 10-adduser: executing... 

-------------------------------------
          _         ()
         | |  ___   _    __
         | | / __| | |  /  \ 
         | | \__ \ | | | () |
         |_| |___/ |_|  \__/

Brought to you by linuxserver.io
-------------------------------------

To support LSIO projects visit:
https://www.linuxserver.io/donate/
-------------------------------------
GID/UID
-------------------------------------

User uid:    123
User gid:    123
-------------------------------------

[cont-init.d] 10-adduser: exited 0.
[cont-init.d] 12-prep_xrdp: executing... 
[cont-init.d] 12-prep_xrdp: exited 0.
[cont-init.d] 13-keygen: executing... 

Generating 2048 bit rsa key...

ssl_gen_key_xrdp1 ok

saving to rsakeys.ini

Can't load /config/.rnd into RNG
139806021235136:error:2406F079:random number generator:RAND_load_file:Cannot open file:../crypto/rand/randfile.c:88:Filename=/config/.rnd
Generating a RSA private key
......+++++
..+++++
writing new private key to '/etc/xrdp/key.pem'
-----
[cont-init.d] 13-keygen: exited 0.
[cont-init.d] 30-config: executing... 
[cont-init.d] 30-config: exited 1.
[cont-init.d] 50-config: executing... 
No password is set for the interface.
[cont-init.d] 50-config: exited 0.
[cont-init.d] 55-autostart-config: executing... 
[cont-init.d] 55-autostart-config: exited 0.
[cont-init.d] 90-custom-folders: executing... 
[cont-init.d] 90-custom-folders: exited 0.
[cont-init.d] 99-custom-scripts: executing... 
[custom-init] no custom files found exiting...
[cont-init.d] 99-custom-scripts: exited 0.
[cont-init.d] done.
[services.d] starting services
guacd[409]: INFO:       Guacamole proxy daemon (guacd) version 1.1.0 started
guacd[409]: INFO:       Listening on host 0.0.0.0, port 4822
[services.d] done.
guacd[409]: INFO:       Guacamole connection closed during handshake
Starting guacamole-lite websocket server
listening on *:8080
guacd[409]: INFO:       Guacamole connection closed during handshake
[guac-init] Auto start set, starting application

After that last message the websocat call never returns

github-actions[bot] commented 2 years ago

Thanks for opening your first issue here! Be sure to follow the bug or feature issue templates!

davepgreene commented 2 years ago

This is a bug I've noted and have a fix for in gclient

Salvora commented 2 years ago

I don't use the SUBFOLDER but it still does not auto-start in my case. compose

version: "2.1"
services:
  calibre:
    image: linuxserver/calibre
    container_name: calibre
    environment:
      - PUID=1026
      - PGID=100
      - UMASK_SET=002 #optional
    volumes:
      - /volume1/Files/Books:/Files/Books
      - /volume1/docker/Calibre:/config
    ports:
      - 9070:8080
      - 9071:8081
    restart: unless-stopped
aptalca commented 2 years ago

If you're not using subfolder, auto start should work. Please open a new issue and fill out the template.

With regards to subfolder related issue, we'll get it fixed but the gclient maintainer is currently unavailable. When he's back we'll merge the necessary fixes.

github-actions[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

thelamer commented 2 years ago

this is fixed in the latest web desktop base images