basecamp / kamal

Deploy web apps anywhere.
https://kamal-deploy.org
MIT License
10.66k stars 410 forks source link

ActionCable not working #693

Closed initseis closed 7 months ago

initseis commented 7 months ago

Hi guys, I’m so sorry, English is not my first language,

I deployed my app with Kamal but ActionCable (I am using Turbo Broadcast) is not working, any of you went through this?

image: k3vin/atenas

traefik: options: publish:

servers: web: hosts:

registry: username: k3vin

password:

env: clear: HOSTNAME: atenas.app DB_HOST: 5.78.78.254 RAILS_LOG_TO_STDOUT: true REDIS_URL: "redis://atenas-redis:6379/0" secret:

accessories: db: image: postgres:15 host: 5.78.78.254 port: 5432 env: clear: POSTGRES_USER: "atenas" POSTGRES_DB: "atenas_production" secret:

Thanks in advance.

initseis commented 7 months ago

I think ActionCable failed when I upgraded from 7.0.6 to 7.1 so I had to start a new project and copy all my files and now it is working.

germanotm commented 6 months ago

I encountered the same error and was able to resolve it by setting allowed_request_origins in production.rb as follows:

config.action_cable.allowed_request_origins = ['https://rubyonrails.com', %r{http://ruby.*}]

ActionClable permits connections from specified origins. For more information, see the Ruby on Rails Guides on Action Cable. https://guides.rubyonrails.org/action_cable_overview.html#allowed-request-origins