[ARVADOS] created: e216c66870a913766fb7a7ab1e6c07cffa784321
git at public.curoverse.com
git at public.curoverse.com
Wed May 14 17:11:47 EDT 2014
at e216c66870a913766fb7a7ab1e6c07cffa784321 (commit)
commit e216c66870a913766fb7a7ab1e6c07cffa784321
Author: Peter Amstutz <peter.amstutz at curoverse.com>
Date: Wed May 14 17:11:39 2014 -0400
2776: Added configuration parameter, logic to detect HTTP header, working on
making @objects usable so that it can return a synthetic result.
diff --git a/services/api/app/controllers/arvados/v1/keep_disks_controller.rb b/services/api/app/controllers/arvados/v1/keep_disks_controller.rb
index 47018d4..2908cbd 100644
--- a/services/api/app/controllers/arvados/v1/keep_disks_controller.rb
+++ b/services/api/app/controllers/arvados/v1/keep_disks_controller.rb
@@ -28,7 +28,29 @@ class Arvados::V1::KeepDisksController < ApplicationController
def find_objects_for_index
# all users can list all keep disks
- @objects = model_class.where('1=1')
+ if request.headers['X-Need-Keep-Proxy'] and Rails.application.config.keep_proxy
+ require 'uri'
+ u = URI.parse(Rails.application.config.keep_proxy)
+ kd = KeepDisk.new
+ kd.service_host = u.hostname
+ kd.service_port = u.port
+ kd.service_ssl_flag = (u.scheme == 'https')
+ @objects = [kd]
+
+ monkeyclass = (class << @objects; self; end)
+ monkeyclass.class_eval {
+ attr_accessor :table_name
+ def order x
+ end
+ def limit x
+ end
+ }
+
+ @objects.table_name = table_name
+ else
+ @objects = model_class.where('1=1')
+ end
+
super
end
diff --git a/services/api/config/application.default.yml b/services/api/config/application.default.yml
index 67aa401..8fd1b98 100644
--- a/services/api/config/application.default.yml
+++ b/services/api/config/application.default.yml
@@ -40,6 +40,7 @@ test:
active_support.deprecation: :stderr
active_record.mass_assignment_sanitizer: :strict
uuid_prefix: zzzzz
+ keep_proxy: http://localhost:25333
common:
secret_token: ~
@@ -113,12 +114,18 @@ common:
arvados_theme: default
- # Default: do not advertise a websocket server.
- websocket_address: false
-
# You can run the websocket server separately from the regular HTTP service
# by setting "ARVADOS_WEBSOCKETS=ws-only" in the environment before running
# the websocket server. When you do this, you need to set the following
# configuration variable so that the primary server can give out the correct
- # address of the dedicated websocket server:
- #websocket_address: wss://127.0.0.1:3333/websocket
+ # address of the dedicated websocket server, for example
+ # wss://ws.example.com:3333/websocket
+ # Default: do not advertise a websocket server.
+ websocket_address: false
+
+ # If Keep servers are firewalled and/or not publically routable (which likely
+ # to be the case in a production deployment) then clients need to use a Keep
+ # proxy. This specifies the Keep proxy address that will be given out, for
+ # example: https://keep.example.com:25333
+ # Default: do not advertise a keep proxy.
+ keep_proxy: false
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list