linuxserver / docker-digikam

GNU General Public License v3.0
54 stars 5 forks source link

[BUG] Not working under reverse proxy #37

Closed joinso closed 1 year ago

joinso commented 1 year ago

Is there an existing issue for this?

Current Behavior

Digikam not showing when using under a reverse proxy domain.

Expected Behavior

Show Digikam using VNC.

Steps To Reproduce

1.- Setup a proxy reverse that points mydomain.tld:443 to localhost:3000 2.- When we visit https://mydomain.tld:443, VNC is loaded but it shows this error:

noVNC encountered an error: TypeError : UI.rfb is undefined.

And in browser console, a lot of connection errors are shown:

Firefox can’t establish a connection to the server at ws://mydomain.tld/audio/socket.io/?EIO=4&transport=websocket&sid=6QcJUJldSGp7dbD1AAAc. websocket.js:44:26 Firefox can’t establish a connection to the server at ws://mydomain.tld/websockify. main.bundle.js:13489:18 WebSocket on-error event main.bundle.js:16523:14 Failed when connecting: Connection closed (code: 1006) main.bundle.js:17981:24 Firefox can’t establish a connection to the server at ws://mydomain.tld/files/socket.io/?EIO=4&transport=websocket&sid=DO_x8LFbgoRLDiy0AAAe. websocket.js:44:26 Uncaught TypeError: UI.rfb is undefined _sessionTimeoutInterval http://mydomain.tld/vnc/dist/main.bundle.js:22629

Environment

- OS: Synology DSM 7.2
- How docker service was installed:ghrc.io/linuxserver/digikam

CPU architecture

x86-64

Docker creation

Docker config:

{
   "CapAdd" : null,
   "CapDrop" : null,
   "cmd" : "",
   "cpu_priority" : 50,
   "enable_publish_all_ports" : false,
   "enable_restart_policy" : true,
   "enable_service_portal" : null,
   "enabled" : true,
   "env_variables" : [
      {
         "key" : "PATH",
         "value" : "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
      },
      {
         "key" : "PS1",
         "value" : "$(whoami)@$(hostname):$(pwd)\\$ "
      },
      {
         "key" : "HOME",
         "value" : "/config"
      },
      {
         "key" : "TERM",
         "value" : "xterm"
      },
      {
         "key" : "S6_CMD_WAIT_FOR_SERVICES_MAXTIME",
         "value" : "0"
      },
      {
         "key" : "S6_VERBOSITY",
         "value" : "1"
      },
      {
         "key" : "S6_STAGE2_HOOK",
         "value" : "/docker-mods"
      },
      {
         "key" : "DISPLAY",
         "value" : ":1"
      },
      {
         "key" : "PERL5LIB",
         "value" : "/usr/local/bin"
      },
      {
         "key" : "OMP_WAIT_POLICY",
         "value" : "PASSIVE"
      },
      {
         "key" : "GOMP_SPINCOUNT",
         "value" : "0"
      },
      {
         "key" : "START_DOCKER",
         "value" : "true"
      },
      {
         "key" : "PULSE_RUNTIME_PATH",
         "value" : "/defaults"
      },
      {
         "key" : "NVIDIA_DRIVER_CAPABILITIES",
         "value" : "graphics,compat32,utility"
      },
      {
         "key" : "LSIO_FIRST_PARTY",
         "value" : "true"
      },
      {
         "key" : "TITLE",
         "value" : "DigiKam"
      },
      {
         "key" : "PUID",
         "value" : "1026"
      },
      {
         "key" : "PGID",
         "value" : "100"
      },
      {
         "key" : "TZ",
         "value" : "Europe/Madrid"
      },
      {
         "key" : "KEYBOARD",
         "value" : "es-es-qwerty"
      },
      {
         "key" : "SUBFOLDER",
         "value" : "/"
      }
   ],
   "exporting" : false,
   "id" : "da8f23123ba3c91eb2964735eb732b463a614ee67169dfeb4acfe5c8bf9fe0dd",
   "image" : "ghcr.io/linuxserver/digikam",
   "is_ddsm" : false,
   "is_package" : false,
   "labels" : {
      "build_version" : "Linuxserver.io version:- 2023-04-21-ls139 Build-date:- 2023-04-21T18:42:44+00:00",
      "maintainer" : "hackerman",
      "org.opencontainers.image.authors" : "linuxserver.io",
      "org.opencontainers.image.created" : "2023-04-21T18:42:44+00:00",
      "org.opencontainers.image.description" : "[digiKam](https://www.digikam.org/): Professional Photo Management with the Power of Open Source",
      "org.opencontainers.image.documentation" : "https://docs.linuxserver.io/images/docker-digikam",
      "org.opencontainers.image.licenses" : "GPL-3.0-only",
      "org.opencontainers.image.ref.name" : "d27a4f940d9fc01638dd81b8f124447297a1b090",
      "org.opencontainers.image.revision" : "d27a4f940d9fc01638dd81b8f124447297a1b090",
      "org.opencontainers.image.source" : "https://github.com/linuxserver/docker-digikam",
      "org.opencontainers.image.title" : "Digikam",
      "org.opencontainers.image.url" : "https://github.com/linuxserver/docker-digikam/packages",
      "org.opencontainers.image.vendor" : "linuxserver.io",
      "org.opencontainers.image.version" : "2023-04-21-ls139"
   },
   "links" : [],
   "memory_limit" : 0,
   "name" : "digikam",
   "network" : [
      {
         "driver" : "bridge",
         "name" : "bridge"
      }
   ],
   "network_mode" : "default",
   "port_bindings" : [
      {
         "container_port" : 3000,
         "host_port" : 3000,
         "type" : "tcp"
      },
      {
         "container_port" : 3001,
         "host_port" : 3001,
         "type" : "tcp"
      }
   ],
   "privileged" : false,
   "service_portals" : [],
   "shortcut" : {
      "enable_shortcut" : false,
      "enable_status_page" : false,
      "enable_web_page" : false,
      "web_page_url" : ""
   },
   "use_host_network" : false,
   "version" : 2,
   "volume_bindings" : [
      {
         "host_volume_file" : "/docker/volumes/digikam",
         "is_directory" : true,
         "mount_point" : "/config",
         "type" : "rw"
      },
      {
         "host_volume_file" : "/photo",
         "is_directory" : true,
         "mount_point" : "/config/Pictures",
         "type" : "rw"
      }
   ]
}

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:    1026
User GID:    100
───────────────────────────────────────

[custom-init] No custom files found, skipping...
[ls.io-init] done.
Obt-Message: Xinerama extension is not present on the server
 2023-07-16 10:43:15,710 [PRIO] Connections: accepted: @172.17.0.1_1689496995.697467::websocket
 2023-07-16 10:44:42,995 [PRIO] Connections: closed: @172.17.0.1_1689496995.697467::websocket (Clean disconnection)
[migrations] started
[migrations] no migrations found
usermod: no changes
───────────────────────────────────────

      ██╗     ███████╗██╗ ██████╗ 
      ██║     ██╔════╝██║██╔═══██╗
      ██║     ███████╗██║██║   ██║
      ██║     ╚════██║██║██║   ██║
      ███████╗███████║██║╚██████╔╝
      ╚══════╝╚══════╝╚═╝ ╚═════╝ 

   Brought to you by linuxserver.io
───────────────────────────────────────

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

───────────────────────────────────────
GID/UID
───────────────────────────────────────

User UID:    1026
User GID:    100
───────────────────────────────────────

[custom-init] No custom files found, skipping...
[ls.io-init] done.
Obt-Message: Xinerama extension is not present on the server
 2023-07-16 10:45:29,343 [PRIO] Connections: accepted: @172.17.0.1_1689497129.330215::websocket
 2023-07-16 10:46:27,232 [PRIO] Connections: closed: @172.17.0.1_1689497129.330215::websocket (Clean disconnection)
[migrations] started
[migrations] no migrations found
usermod: no changes
───────────────────────────────────────

      ██╗     ███████╗██╗ ██████╗ 
      ██║     ██╔════╝██║██╔═══██╗
      ██║     ███████╗██║██║   ██║
      ██║     ╚════██║██║██║   ██║
      ███████╗███████║██║╚██████╔╝
      ╚══════╝╚══════╝╚═╝ ╚═════╝ 

   Brought to you by linuxserver.io
───────────────────────────────────────

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

───────────────────────────────────────
GID/UID
───────────────────────────────────────

User UID:    1026
User GID:    100
───────────────────────────────────────

[custom-init] No custom files found, skipping...
[ls.io-init] done.
Obt-Message: Xinerama extension is not present on the server
 2023-07-16 10:55:08,580 [PRIO] Connections: accepted: @172.17.0.1_1689497708.567712::websocket
 2023-07-16 11:04:28,487 [PRIO] Connections: closed: @172.17.0.1_1689497708.567712::websocket (Clean disconnection)
 2023-07-16 11:16:26,503 [PRIO] Connections: accepted: @172.17.0.1_1689498986.489589::websocket
 2023-07-16 11:22:17,589 [PRIO] Connections: closed: @172.17.0.1_1689498986.489589::websocket (Clean disconnection)
[migrations] started
[migrations] no migrations found
usermod: no changes
───────────────────────────────────────

      ██╗     ███████╗██╗ ██████╗ 
      ██║     ██╔════╝██║██╔═══██╗
      ██║     ███████╗██║██║   ██║
      ██║     ╚════██║██║██║   ██║
      ███████╗███████║██║╚██████╔╝
      ╚══════╝╚══════╝╚═╝ ╚═════╝ 

   Brought to you by linuxserver.io
───────────────────────────────────────

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

───────────────────────────────────────
GID/UID
───────────────────────────────────────

User UID:    1026
User GID:    100
───────────────────────────────────────

[custom-init] No custom files found, skipping...
[ls.io-init] done.
Obt-Message: Xinerama extension is not present on the server
 2023-07-16 11:28:55,899 [PRIO] Connections: accepted: @172.17.0.1_1689499735.886915::websocket
 2023-07-16 11:34:09,795 [PRIO] Connections: closed: @172.17.0.1_1689499735.886915::websocket (Clean disconnection)
 2023-07-16 11:34:10,258 [PRIO] Connections: accepted: @172.17.0.1_1689500050.245722::websocket
 2023-07-16 11:34:22,771 [PRIO] Connections: closed: @172.17.0.1_1689500050.245722::websocket (Clean disconnection)
 2023-07-16 11:34:23,195 [PRIO] Connections: accepted: @172.17.0.1_1689500063.182562::websocket
 2023-07-16 11:34:26,964 [PRIO] Connections: closed: @172.17.0.1_1689500063.182562::websocket (Clean disconnection)
 2023-07-16 11:34:27,244 [PRIO] Connections: accepted: @172.17.0.1_1689500067.231506::websocket
 2023-07-16 11:34:37,920 [PRIO] Connections: closed: @172.17.0.1_1689500067.231506::websocket (Clean disconnection)
 2023-07-16 11:34:40,466 [PRIO] Connections: accepted: @172.17.0.1_1689500080.453419::websocket
 2023-07-16 11:34:44,794 [PRIO] Connections: closed: @172.17.0.1_1689500080.453419::websocket (Clean disconnection)
 2023-07-16 11:34:45,095 [PRIO] Connections: accepted: @172.17.0.1_1689500085.82734::websocket
 2023-07-16 11:34:48,483 [PRIO] Connections: closed: @172.17.0.1_1689500085.82734::websocket (Clean disconnection)
 2023-07-16 11:35:00,113 [PRIO] Connections: accepted: @172.17.0.1_1689500100.99367::websocket
 2023-07-16 11:35:50,990 [PRIO] Connections: closed: @172.17.0.1_1689500100.99367::websocket (Clean disconnection)
 2023-07-16 11:35:51,359 [PRIO] Connections: accepted: @172.17.0.1_1689500151.346733::websocket
 2023-07-16 11:36:27,006 [PRIO] Connections: closed: @172.17.0.1_1689500151.346733::websocket (Clean disconnection)
 2023-07-16 11:36:29,606 [PRIO] Connections: accepted: @172.17.0.1_1689500189.593933::websocket
 2023-07-16 11:36:32,579 [PRIO] Connections: closed: @172.17.0.1_1689500189.593933::websocket (Clean disconnection)
 2023-07-16 11:36:47,316 [PRIO] Connections: accepted: @172.17.0.1_1689500207.303190::websocket
 2023-07-16 11:37:14,224 [PRIO] Connections: closed: @172.17.0.1_1689500207.303190::websocket (Clean disconnection)
[migrations] started
[migrations] no migrations found
usermod: no changes
───────────────────────────────────────

      ██╗     ███████╗██╗ ██████╗ 
      ██║     ██╔════╝██║██╔═══██╗
      ██║     ███████╗██║██║   ██║
      ██║     ╚════██║██║██║   ██║
      ███████╗███████║██║╚██████╔╝
      ╚══════╝╚══════╝╚═╝ ╚═════╝ 

   Brought to you by linuxserver.io
───────────────────────────────────────

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

───────────────────────────────────────
GID/UID
───────────────────────────────────────

User UID:    1026
User GID:    100
───────────────────────────────────────

[custom-init] No custom files found, skipping...
[ls.io-init] done.
Obt-Message: Xinerama extension is not present on the server
 2023-07-16 11:37:36,147 [PRIO] Connections: accepted: @172.17.0.1_1689500256.133467::websocket
 2023-07-16 11:42:20,517 [PRIO] Connections: closed: @172.17.0.1_1689500256.133467::websocket (Clean disconnection)
[migrations] started
[migrations] no migrations found
usermod: no changes
───────────────────────────────────────

      ██╗     ███████╗██╗ ██████╗ 
      ██║     ██╔════╝██║██╔═══██╗
      ██║     ███████╗██║██║   ██║
      ██║     ╚════██║██║██║   ██║
      ███████╗███████║██║╚██████╔╝
      ╚══════╝╚══════╝╚═╝ ╚═════╝ 

   Brought to you by linuxserver.io
───────────────────────────────────────

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

───────────────────────────────────────
GID/UID
───────────────────────────────────────

User UID:    1026
User GID:    100
───────────────────────────────────────

[custom-init] No custom files found, skipping...
[ls.io-init] done.
Obt-Message: Xinerama extension is not present on the server
[migrations] started
[migrations] no migrations found
usermod: no changes
───────────────────────────────────────

      ██╗     ███████╗██╗ ██████╗ 
      ██║     ██╔════╝██║██╔═══██╗
      ██║     ███████╗██║██║   ██║
      ██║     ╚════██║██║██║   ██║
      ███████╗███████║██║╚██████╔╝
      ╚══════╝╚══════╝╚═╝ ╚═════╝ 

   Brought to you by linuxserver.io
───────────────────────────────────────

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

───────────────────────────────────────
GID/UID
───────────────────────────────────────

User UID:    1026
User GID:    100
───────────────────────────────────────

[custom-init] No custom files found, skipping...
Obt-Message: Xinerama extension is not present on the server
[ls.io-init] done.
github-actions[bot] commented 1 year ago

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

LinuxServer-CI commented 1 year ago

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

drizuid commented 1 year ago

looks like whatever reverse proxy you use doesnt properly support websockets. It works fine with ours.

joinso commented 1 year ago

Hi! I solved doing this: In /etc/nginx/sites-enabled I just add this file: digikam.conf: server { listen 443 ssl; listen [::]:443 ssl;

server_name YOUR_DOMAIN;

if ( $host !~ "(^YOUR_DOMAIN$)" ) { return 404; }

include /usr/syno/etc/www/certificate/ReverseProxy_713c2ab0-3816-48b9-b34c-1dca2e567ecc/cert.conf*;

include /usr/syno/etc/security-profile/tls-profile/config/ReverseProxy_713c2ab0-3816-48b9-b34c-1dca2e567ecc.conf*;

add_header Strict-Transport-Security "max-age=15768000; includeSubdomains; preload" always;

proxy_ssl_protocols TLSv1 TLSv1.1 TLSv1.2 TLSv1.3;

location / {

    proxy_connect_timeout 60;

    proxy_read_timeout 60;

    proxy_send_timeout 60;

    proxy_intercept_errors off;

    proxy_http_version 1.1;

    proxy_set_header        Cross-Origin-Embedder-Policy            require-corp;

    proxy_set_header        Cross-Origin-Opener-Policy            same-origin;

    proxy_set_header        Cross-Origin-Resource-Policy            same-site;

    proxy_set_header        Host            $http_host;

    proxy_set_header        X-Real-IP            $remote_addr;

    proxy_set_header        X-Forwarded-For            $proxy_add_x_forwarded_for;

    proxy_set_header        X-Forwarded-Proto            $scheme;

    proxy_pass https://localhost:3001;

}
      location /websockify {
        proxy_pass https://localhost:3001;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "Upgrade";
      }

location /vnc { proxy_pass https://localhost:3001; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "Upgrade"; }
error_page 403 404 500 502 503 504 /dsm_error_page;

location /dsm_error_page {
    internal;
    root /usr/syno/share/nginx;
    rewrite (.*) /error.html break;
    allow all;
}

} But there is still and issue with "lastActivity": When timeout fires, it show this error:

Uncaught TypeError: Cannot read properties of undefined (reading 'lastActiveAt') in: https://MY_DOMAIN/vnc/dist/main.bundle.js:22919:61

TypeError: Cannot read properties of undefined (reading 'lastActiveAt') at https://MY_DOMAIN/vnc/dist/main.bundle.js:22919:61

Any idea?

Regards, Jordi

drizuid commented 1 year ago

Unfortunately, we do not support reverse proxies other than our own. Further, this github issue section is specifically for digikam, not whatever reverse proxy you're using.