feat: Add Installation onboarding flow (#1640)
Co-authored-by: Pranav Raj S <pranav@chatwoot.com>
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
class ChatwootHub
|
||||
BASE_URL = 'https://hub.chatwoot.com'.freeze
|
||||
BASE_URL = ENV['CHATWOOT_HUB_URL'] || 'https://hub.chatwoot.com'
|
||||
|
||||
def self.instance_config
|
||||
{
|
||||
@@ -19,4 +19,12 @@ class ChatwootHub
|
||||
end
|
||||
version
|
||||
end
|
||||
|
||||
def self.register_instance(info)
|
||||
RestClient.post("#{BASE_URL}/register_instance", info.merge(instance_config).to_json, { content_type: :json, accept: :json })
|
||||
rescue *ExceptionList::REST_CLIENT_EXCEPTIONS, *ExceptionList::URI_EXCEPTIONS => e
|
||||
Rails.logger.info "Exception: #{e.message}"
|
||||
rescue StandardError => e
|
||||
Raven.capture_exception(e)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -27,5 +27,6 @@ module Redis::RedisKeys
|
||||
REAUTHORIZATION_REQUIRED = 'REAUTHORIZATION_REQUIRED:%<obj_type>s:%<obj_id>d'.freeze
|
||||
|
||||
## Internal Installation related keys
|
||||
CHATWOOT_INSTALLATION_ONBOARDING = 'CHATWOOT_INSTALLATION_ONBOARDING'.freeze
|
||||
LATEST_CHATWOOT_VERSION = 'LATEST_CHATWOOT_VERSION'.freeze
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user