From cd698336f2b7aebe78517993e0b3b07b45c16c87 Mon Sep 17 00:00:00 2001 From: Lucas Di Pentima Date: Fri, 21 Jul 2017 12:15:08 -0300 Subject: [PATCH] 11167: Refuse to start when keep-web isn't configured. Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima --- apps/workbench/config/application.default.yml | 5 +++-- apps/workbench/config/load_config.rb | 11 +++++++++++ 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/apps/workbench/config/application.default.yml b/apps/workbench/config/application.default.yml index 6998b17c9e..9d0419c1b8 100644 --- a/apps/workbench/config/application.default.yml +++ b/apps/workbench/config/application.default.yml @@ -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 diff --git a/apps/workbench/config/load_config.rb b/apps/workbench/config/load_config.rb index e2185a8969..441a437e21 100644 --- a/apps/workbench/config/load_config.rb +++ b/apps/workbench/config/load_config.rb @@ -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 <