19217: Silence SQL logs during database reset.
[arvados.git] / services / api / app / controllers / static_controller.rb
index d624ea8c35983dfe745610a195b40c6418a53434..4b2b985e023679b783bb358543eac8d7c8f54829 100644 (file)
@@ -1,15 +1,19 @@
+# Copyright (C) The Arvados Authors. All rights reserved.
+#
+# SPDX-License-Identifier: AGPL-3.0
+
 class StaticController < ApplicationController
   respond_to :json, :html
 
-  skip_before_filter :find_object_by_uuid
-  skip_before_filter :render_404_if_no_object
-  skip_before_filter :require_auth_scope, :only => [ :home, :login_failure ]
+  skip_before_action :find_object_by_uuid
+  skip_before_action :render_404_if_no_object
+  skip_before_action :require_auth_scope, only: [:home, :empty, :login_failure]
 
   def home
     respond_to do |f|
       f.html do
-        if Rails.configuration.workbench_address
-          redirect_to Rails.configuration.workbench_address
+        if !Rails.configuration.Services.Workbench1.ExternalURL.to_s.empty?
+          redirect_to Rails.configuration.Services.Workbench1.ExternalURL.to_s
         else
           render_not_found "Oops, this is an API endpoint. You probably want to point your browser to an Arvados Workbench site instead."
         end
@@ -20,4 +24,8 @@ class StaticController < ApplicationController
     end
   end
 
+  def empty
+    render plain: ""
+  end
+
 end