MayamaTakeshi / redmine_rt

Redmine plugin for Real-Time notification of events
GNU General Public License v3.0
24 stars 4 forks source link

Websocket error, success PUT, no refresh #62

Open kyvaith opened 1 month ago

kyvaith commented 1 month ago

Hi, I'm trying to enable your plugin but I have a trouble with websockets. I've followed instructions in readme. Installed redis-server, created cable config file, same as in Readme, restarted redis login/logout and checked my webserver confg. I'm using Bitnami stack Redmine so I have an Apache Web Server instead of Nginx. Without redis server started I get in browser: image

Starting server with bundle exec rails server -e production -b 0.0.0.0 gives me:

=> Booting Puma
=> Rails 6.1.7.8 application starting in production
=> Run bin/rails server --help for more startup options
Puma starting in single mode...
* Puma version: 6.4.2 (ruby 3.2.1-p31) ("The Eagle of Durango")
*  Min threads: 0
*  Max threads: 5
*  Environment: production
*          PID: 32067
* Listening on http://0.0.0.0:3000

And after login/logout with redis server up:

image

My Apache config is:

PassengerPreStart https://localhost:443/
<VirtualHost *:443 _default_:443>
  ServerName app
  SSLEngine on
  SSLCertificateFile "/opt/bitnami/apache/conf/app.crt"
  SSLCertificateKeyFile "/opt/bitnami/apache/conf/app.key"
  DocumentRoot /opt/bitnami/redmine/public
  # BEGIN: Configuration for letsencrypt
  Include "/opt/bitnami/apps/letsencrypt/conf/httpd-prefix.conf"
  # END: Configuration for letsencrypt
  # BEGIN: Support domain renewal when using mod_proxy without Location
  <IfModule mod_proxy.c>
    ProxyPass /.well-known !
  </IfModule>
  # END: Support domain renewal when using mod_proxy without Location
  <Directory "/opt/bitnami/redmine/public">
    Options -Indexes +FollowSymLinks -MultiViews
    AllowOverride All
    Require all granted
    PassengerEnabled on
  </Directory>
  RailsEnv production
  # BEGIN: Support domain renewal when using mod_proxy within Location
  <Location /.well-known>
    <IfModule mod_proxy.c>
      ProxyPass !
    </IfModule>
  </Location>
  # END: Support domain renewal when using mod_proxy within Location
</VirtualHost>

In logs I get:

Started GET "/cable" for 127.0.0.1 at 2024-10-24 21:00:30 +0000
Started GET "/cable/" [WebSocket] for 127.0.0.1 at 2024-10-24 21:00:30 +0000
Successfully upgraded to WebSocket (REQUEST_METHOD: GET, HTTP_CONNECTION: upgrade, HTTP_UPGRADE: websocket)

So I assume there is no need to override headers.

What could be wrong?

MayamaTakeshi commented 1 month ago

Hi, I don't know much about apache. But I suppose you should be using this module: https://httpd.apache.org/docs/2.4/mod/mod_proxy_http.html which deprecates this old one: https://httpd.apache.org/docs/2.4/mod/mod_proxy_wstunnel.html