mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2024-11-14 21:24:54 +08:00
21 lines
624 B
Ruby
21 lines
624 B
Ruby
# frozen_string_literal: true
|
|
|
|
# Only check if connection works when server starts, and if WOPI is
|
|
# enabled
|
|
if defined?(Rails::Server).present? && ENV['WOPI_ENABLED'] == 'true'
|
|
missing_vars = []
|
|
%w(
|
|
WOPI_TEST_ENABLED WOPI_DISCOVERY_URL WOPI_ENDPOINT_URL USER_SUBDOMAIN
|
|
WOPI_SUBDOMAIN WOPI_USER_HOST
|
|
).each do |var_name|
|
|
missing_vars << var_name if ENV[var_name].blank?
|
|
end
|
|
|
|
unless missing_vars.empty?
|
|
puts "WARNING: Due to WOPI_ENABLED == 'true', " \
|
|
"following env. variables MUST also be specified: " \
|
|
"#{missing_vars.join(', ')}; " \
|
|
"aborting."
|
|
abort
|
|
end
|
|
end
|