11167: Refuse to start when keep-web isn't configured.
authorLucas Di Pentima <lucas@curoverse.com>
Fri, 21 Jul 2017 15:15:08 +0000 (12:15 -0300)
committerLucas Di Pentima <lucas@curoverse.com>
Fri, 21 Jul 2017 15:15:08 +0000 (12:15 -0300)
Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima <lucas@curoverse.com>

apps/workbench/config/application.default.yml
apps/workbench/config/load_config.rb

index 6998b17c9ebbac847bdee224162417d26b7fe033..9d0419c1b816d7edb29da95521ec7ee7e028d522 100644 (file)
@@ -99,6 +99,7 @@ test:
   profiling_enabled: true
   secret_token: <%= rand(2**256).to_s(36) %>
   secret_key_base: <%= rand(2**256).to_s(36) %>
+  keep_web_url: http://example/c=%{uuid_or_pdh}
 
   # When you run the Workbench's integration tests, it starts the API
   # server as a dependency.  These settings should match the API
@@ -243,8 +244,8 @@ common:
   shell_in_a_box_url: false
 
   # Format of preview links. If false, use keep_web_download_url
-  # instead, and disable inline preview. If both are false, use
-  # Workbench's built-in file download/preview mechanism.
+  # instead, and disable inline preview.
+  # If both are false, Workbench won't start, this is a mandatory configuration.
   #
   # Examples:
   # keep_web_url: https://%{uuid_or_pdh}.collections.uuid_prefix.arvadosapi.com
index e2185a896963c23f9d2cd2c2036c885e196ae62f..441a437e21c4a566b6f8d95d92ef8a80ab1c11b6 100644 (file)
@@ -54,6 +54,17 @@ The following configuration settings must be specified in
 config/application.yml:
 * #{nils.join "\n* "}
 
+EOS
+  end
+  # Refuse to start if keep-web isn't configured
+  if not (config.keep_web_url or config.keep_web_download_url)
+    raise <<EOS
+Refusing to start in #{::Rails.env.to_s} mode with missing configuration.
+
+Keep-web service must be configured in config/application.yml:
+* keep_web_url
+* keep_web_download_url
+
 EOS
   end
 end