diff --git a/lib/docuseal.rb b/lib/docuseal.rb index fc3ea6fc7..502829757 100644 --- a/lib/docuseal.rb +++ b/lib/docuseal.rb @@ -6,7 +6,7 @@ module Docuseal NEWSLETTER_URL = "#{PRODUCT_URL}/newsletters".freeze ENQUIRIES_URL = "#{PRODUCT_URL}/enquiries".freeze PRODUCT_NAME = 'DocuSeal' - DEFAULT_APP_URL = 'http://localhost:3000' + DEFAULT_APP_URL = ENV.fetch('APP_URL', 'http://localhost:3000') GITHUB_URL = 'https://github.com/docusealco/docuseal' DISCORD_URL = 'https://discord.gg/qygYCDGck9' TWITTER_URL = 'https://twitter.com/docusealco' @@ -76,7 +76,7 @@ def default_url_options return DEFAULT_URL_OPTIONS if multitenant? @default_url_options ||= begin - value = EncryptedConfig.find_by(key: EncryptedConfig::APP_URL_KEY)&.value + value = EncryptedConfig.find_by(key: EncryptedConfig::APP_URL_KEY)&.value if ENV['APP_URL'].blank? value ||= DEFAULT_APP_URL url = Addressable::URI.parse(value) { host: url.host, port: url.port, protocol: url.scheme }