-
Notifications
You must be signed in to change notification settings - Fork 737
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Maintenance: Remove feature flag for mobile front end and make Redis …
…a regular dependency.
- Loading branch information
Showing
20 changed files
with
60 additions
and
117 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,42 +1,37 @@ | ||
# Copyright (C) 2012-2023 Zammad Foundation, https://zammad-foundation.org/ | ||
|
||
if ENV['ENABLE_EXPERIMENTAL_MOBILE_FRONTEND'] == 'true' | ||
require 'redis' | ||
require 'hiredis' | ||
# If REDIS_URL is not set, fall back to default port / localhost, to ease configuration | ||
# for simple installations. | ||
redis_url = ENV['REDIS_URL'].presence || 'redis://localhost:6379' | ||
|
||
# If REDIS_URL is not set, fall back to default port / localhost, to ease configuration | ||
# for simple installations. | ||
redis_url = ENV['REDIS_URL'].presence || 'redis://localhost:6379' | ||
|
||
Rails.application.config.action_cable.cable = { | ||
adapter: :redis, | ||
driver: :hiredis, | ||
url: redis_url, | ||
channel_prefix: "zammad_#{Rails.env}", | ||
} | ||
begin | ||
Redis.new(driver: :hiredis, url: redis_url).ping | ||
Rails.logger.info { "ActionCable is using the redis instance at #{redis_url}." } | ||
rescue Redis::CannotConnectError => e | ||
warn "There was an error trying to connect to Redis via #{redis_url}." | ||
if ENV['REDIS_URL'].present? | ||
warn 'Please make sure Redis is available.' | ||
else | ||
warn 'Please provide a Redis instance at localhost:6379 or set REDIS_URL to point to a different location.' | ||
end | ||
warn e.inspect | ||
Zammad::SafeMode.continue_or_exit! | ||
Rails.application.config.action_cable.cable = { | ||
adapter: :redis, | ||
driver: :hiredis, | ||
url: redis_url, | ||
channel_prefix: "zammad_#{Rails.env}", | ||
} | ||
begin | ||
Redis.new(driver: :hiredis, url: redis_url).ping | ||
Rails.logger.info { "ActionCable is using the redis instance at #{redis_url}." } | ||
rescue Redis::CannotConnectError => e | ||
warn "There was an error trying to connect to Redis via #{redis_url}." | ||
if ENV['REDIS_URL'].present? | ||
warn 'Please make sure Redis is available.' | ||
else | ||
warn 'Please provide a Redis instance at localhost:6379 or set REDIS_URL to point to a different location.' | ||
end | ||
warn e.inspect | ||
Zammad::SafeMode.continue_or_exit! | ||
end | ||
|
||
if Rails.env.production? | ||
Rails.application.reloader.to_prepare do | ||
begin | ||
request_origins = ['http://localhost:3000'] | ||
request_origins << "#{Setting.get('http_type')}://#{Setting.get('fqdn')}" | ||
Rails.application.config.action_cable.allowed_request_origins = request_origins | ||
rescue ActiveRecord::NoDatabaseError | ||
Rails.logger.debug("Database doesn't exist. Skipping allowed_request_origins configuration.") | ||
end | ||
if Rails.env.production? | ||
Rails.application.reloader.to_prepare do | ||
begin | ||
request_origins = ['http://localhost:3000'] | ||
request_origins << "#{Setting.get('http_type')}://#{Setting.get('fqdn')}" | ||
Rails.application.config.action_cable.allowed_request_origins = request_origins | ||
rescue ActiveRecord::NoDatabaseError, ActiveRecord::StatementInvalid | ||
Rails.logger.debug("Database doesn't exist. Skipping allowed_request_origins configuration.") | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,5 @@ | ||
# Copyright (C) 2012-2023 Zammad Foundation, https://zammad-foundation.org/ | ||
|
||
# Temporary Hack: only process trigger events if ActionCable is enabled. | ||
# TODO: Remove when this switch is not needed any more. | ||
|
||
if ENV['ENABLE_EXPERIMENTAL_MOBILE_FRONTEND'] == 'true' | ||
Zammad::Application.routes.draw do | ||
match '/graphql', to: 'graphql#execute', via: %i[options post] | ||
end | ||
Zammad::Application.routes.draw do | ||
match '/graphql', to: 'graphql#execute', via: %i[options post] | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,8 @@ | ||
# Copyright (C) 2012-2023 Zammad Foundation, https://zammad-foundation.org/ | ||
|
||
# Temporary Hack: only process trigger events if ActionCable is enabled. | ||
# TODO: Remove when this switch is not needed any more. | ||
|
||
if ENV['ENABLE_EXPERIMENTAL_MOBILE_FRONTEND'] == 'true' | ||
Zammad::Application.routes.draw do | ||
get '/mobile', to: 'mobile#index' | ||
get '/mobile/sw.js', to: 'mobile#service_worker' | ||
get '/mobile/manifest.webmanifest', to: 'mobile#manifest' | ||
get '/mobile/*path', to: 'mobile#index' | ||
end | ||
Zammad::Application.routes.draw do | ||
get '/mobile', to: 'mobile#index' | ||
get '/mobile/sw.js', to: 'mobile#service_worker' | ||
get '/mobile/manifest.webmanifest', to: 'mobile#manifest' | ||
get '/mobile/*path', to: 'mobile#index' | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.