[ARVADOS] updated: 9fbb2bbd4e2a0f1d15e1db3f3d606cdedae825a7

git at public.curoverse.com git at public.curoverse.com
Wed Jul 8 01:37:19 EDT 2015


Summary of changes:
 .../app/assets/javascripts/select_modal.js         |   5 +-
 apps/workbench/app/assets/javascripts/users.js     |   2 +-
 .../app/controllers/actions_controller.rb          |   3 +-
 .../app/controllers/projects_controller.rb         |  20 +-
 apps/workbench/app/controllers/users_controller.rb |   9 +-
 .../app/views/application/_show_recent.html.erb    |  16 +-
 apps/workbench/app/views/layouts/body.html.erb     |   4 +-
 .../app/views/users/_setup_popup.html.erb          |   7 +-
 .../workbench/app/views/users/_show_admin.html.erb |   8 +-
 apps/workbench/config/application.default.yml      |   3 +
 .../test/controllers/projects_controller_test.rb   |  26 +++
 apps/workbench/test/integration/search_box_test.rb |  13 +-
 apps/workbench/test/integration/users_test.rb      |  68 +++---
 crunch_scripts/run-command                         |   9 +-
 doc/_includes/_install_debian_key.liquid           |   4 +
 doc/_includes/_install_redhat_key.liquid           |   6 +
 doc/_includes/_note_python27_sc.liquid             |   5 +
 doc/install/install-api-server.html.textile.liquid | 255 +++++++++++++--------
 .../install-arv-git-httpd.html.textile.liquid      |  20 +-
 .../install-compute-node.html.textile.liquid       |  44 ++--
 .../install-crunch-dispatch.html.textile.liquid    |  34 +--
 doc/install/install-keepproxy.html.textile.liquid  |  18 +-
 doc/install/install-keepstore.html.textile.liquid  |  19 +-
 ...nstall-manual-prerequisites.html.textile.liquid |  52 ++++-
 .../install-shell-server.html.textile.liquid       |  38 ++-
 .../install-workbench-app.html.textile.liquid      | 165 ++++++++-----
 doc/sdk/perl/index.html.textile.liquid             |  40 +++-
 doc/sdk/python/sdk-python.html.textile.liquid      |  61 +++--
 doc/user/topics/run-command.html.textile.liquid    |  13 ++
 docker/api/Dockerfile                              |   4 +-
 docker/api/update-gitolite.rb                      |  11 +-
 docker/base/Dockerfile                             |  14 +-
 docker/compute/Dockerfile                          |   6 +-
 docker/doc/Dockerfile                              |   4 +-
 docker/java-bwa-samtools/Dockerfile                |   4 +-
 docker/keepproxy/Dockerfile                        |   4 +-
 docker/passenger/Dockerfile                        |   4 +-
 docker/postgresql/Dockerfile                       |   2 +-
 docker/shell/Dockerfile                            |   4 +-
 docker/slurm/Dockerfile                            |   4 +-
 docker/workbench/Dockerfile                        |   4 +-
 sdk/cli/bin/crunch-job                             |   4 +-
 sdk/python/arvados/api.py                          |   6 +-
 sdk/python/arvados/commands/put.py                 |   5 +-
 sdk/python/arvados/events.py                       |   6 +-
 sdk/python/arvados/util.py                         |  18 ++
 sdk/python/tests/test_arv_put.py                   |  14 ++
 services/api/Rakefile                              |  31 +++
 .../app/controllers/user_sessions_controller.rb    |   2 +-
 services/api/app/mailers/user_notifier.rb          |   2 +-
 .../api/app/views/static/login_failure.html.erb    |   2 +-
 .../views/user_notifier/account_is_setup.text.erb  |   7 +-
 services/api/config/initializers/load_config.rb    |  22 +-
 services/api/config/initializers/omniauth_init.rb  |  18 +-
 services/api/db/structure.sql                      |   2 +-
 .../functional/arvados/v1/users_controller_test.rb |   8 +-
 services/api/test/unit/user_notifier_test.rb       |   8 +-
 57 files changed, 779 insertions(+), 408 deletions(-)
 create mode 100644 doc/_includes/_install_debian_key.liquid
 create mode 100644 doc/_includes/_install_redhat_key.liquid
 create mode 100644 doc/_includes/_note_python27_sc.liquid

  discards  09ae9c32e9b620ce7518cbe1d8ec843dc54a1678 (commit)
  discards  e6003097c990a0e8044fc7768ad726ad28d93c50 (commit)
  discards  ea3b83da139e08c21e448accc937682a5bf5f88e (commit)
  discards  ab72d767be973bd8f848be6eccca62299277520a (commit)
  discards  222c3bb069a9e0247068eed57b7b3b5d88c8c520 (commit)
  discards  7759a62cbbf18b8572b4fc3b9887558cd3047db0 (commit)
       via  9fbb2bbd4e2a0f1d15e1db3f3d606cdedae825a7 (commit)
       via  e56ea5c6c9244d2baaef9a24efc5eaad5bdf290c (commit)
       via  71ba12ca158c39c17187f15c26279ec00d461dc5 (commit)
       via  85de04ad9268e45bad459a606bfabfca4f6fad8c (commit)
       via  158b18f036fc5f3f5848390d7ef53c6493aeb5a9 (commit)
       via  acfbb64831047dcae895e57ceff3d0a834c91bf2 (commit)
       via  734a66939892064fe9c663fd746cb7371c7d84e4 (commit)
       via  da80f4a198e734313a7991466244083dabd64b00 (commit)
       via  c428f31ab63f8414973848455ab7c44ed4a1d51b (commit)
       via  fdb63be9fde8ea69e78e68f77bb0ab00a79a8d6f (commit)
       via  c0082c57cb7c5e67115e7b03c8c85f74b5b29d0d (commit)
       via  770927dbfa1fb16b3075d1581dc66f4e7a623631 (commit)
       via  fa92bc75955f1a81652241addf3c6b24c594b55e (commit)
       via  80a9fa664c8370436a0190f483410e5af05e26c3 (commit)
       via  f721928e89bb06f6df21432da521c9163ff722e3 (commit)
       via  57922375aa60a80e5af5c1e5baa0205df9dfdfb1 (commit)
       via  09fcf10ff841e5032145936385b406412674a368 (commit)
       via  160aa31a20a754b165f0184d712fba8b65519125 (commit)
       via  0db099d96a60ffafdaf0cdf14e92a4dc579e723e (commit)
       via  cf8786f78aa3d8af225f1eaf2bd7c0a17cfa33fc (commit)
       via  87e9c0e26ff55582a993a8e11902e8657647f59a (commit)
       via  76e74a7feb2142ff48a1189957626cc8f6deb360 (commit)
       via  0ebc3631838c34c0307fe73beb8e8037b0110bcf (commit)
       via  8048e6daaeb0628b243855b606093f95dded9d29 (commit)
       via  15ccbbab5a621a1cbfeaeb7c65ee35f72da3efb2 (commit)
       via  e4895820d9302048cc41e4b119450bbb8c01f70f (commit)
       via  34ec4990bb0deaa6c7bef5b9793da3c6836b79e2 (commit)
       via  59e45dbc9ef35513c9a32785158274b86d4e003d (commit)
       via  26b4ea9922d7d9f6c71595960df1c3d0b6c37fc6 (commit)
       via  18c93ee7a21912e9759b127a3ec73bb81c15f23d (commit)
       via  b17c7d97723d99909868d3435b449ab4e95f1708 (commit)
       via  554300e76561021bd26f9143cdece13dd80341cd (commit)
       via  416a99c2039e879cefc67dd0764b8544ef6c2d53 (commit)
       via  9b910084faf3db6fa2071af604620e7d45d12a6c (commit)
       via  665b0fbe5f57866f9d0183a08e713fe07e8db8de (commit)
       via  2d4198a095e193102daa2710c6b2baba7be7c9ce (commit)
       via  9d9f6578ada5768205150757f241c66009347884 (commit)
       via  e8db6685b64c6853eb3c5d3ee27ba58168c3c8e8 (commit)

This update added new revisions after undoing existing revisions.  That is
to say, the old revision is not a strict subset of the new revision.  This
situation occurs when you --force push a change and generate a repository
containing something like this:

 * -- * -- B -- O -- O -- O (09ae9c32e9b620ce7518cbe1d8ec843dc54a1678)
            \
             N -- N -- N (9fbb2bbd4e2a0f1d15e1db3f3d606cdedae825a7)

When this happens we assume that you've already had alert emails for all
of the O revisions, and so we here report only the revisions in the N
branch from the common base, B.

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


commit 9fbb2bbd4e2a0f1d15e1db3f3d606cdedae825a7
Author: Tom Clegg <tom at curoverse.com>
Date:   Wed Jul 8 01:12:58 2015 -0400

    6377: Fix crash if no asset pipeline.

diff --git a/services/api/app/views/static/login_failure.html.erb b/services/api/app/views/static/login_failure.html.erb
index 830942c..35f4f10 100644
--- a/services/api/app/views/static/login_failure.html.erb
+++ b/services/api/app/views/static/login_failure.html.erb
@@ -6,7 +6,7 @@ $(function(){
 
 
 <div id="intropage">
-  <img class="curoverse-logo" src="<%= asset_path('logo.png') %>" style="display:block; margin:2em auto"/>
+  <img class="curoverse-logo" src="<%= asset_path('logo.png') rescue '/logo.png' %>" style="display:block; margin:2em auto"/>
   <div style="width:30em; margin:2em auto 0 auto">
 
     <h1>Error</h1>

commit e56ea5c6c9244d2baaef9a24efc5eaad5bdf290c
Author: Tom Clegg <tom at curoverse.com>
Date:   Tue Jul 7 16:45:16 2015 -0400

    6377: Update ruby to 2.1.6. Remove bundler version pin (not needed since ca1d997).

diff --git a/doc/install/install-manual-prerequisites-ruby.html.textile.liquid b/doc/install/install-manual-prerequisites-ruby.html.textile.liquid
index a4f71ba..2142aca 100644
--- a/doc/install/install-manual-prerequisites-ruby.html.textile.liquid
+++ b/doc/install/install-manual-prerequisites-ruby.html.textile.liquid
@@ -4,14 +4,14 @@ navsection: installguide
 title: Install Ruby and bundler
 ...
 
-We recommend Ruby >= 2.1.  We currently require Bundler 1.9 (not 1.10 or above) because of a limitation in some of our gem dependencies.
+Currently, only Ruby 2.1 is supported.
 
 h2(#rvm). Option 1: Install with rvm
 
 <notextile>
 <pre><code>~$ <span class="userinput">gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3</span>
 ~$ <span class="userinput">\curl -sSL https://get.rvm.io | bash -s stable --ruby=2.1</span>
-~$ <span class="userinput">gem install -v 1.9.9 bundler
+~$ <span class="userinput">gem install bundler
 </span></code></pre></notextile>
 
 h2(#fromsource). Option 2: Install from source
@@ -19,12 +19,12 @@ h2(#fromsource). Option 2: Install from source
 <notextile>
 <pre><code><span class="userinput">mkdir -p ~/src
 cd ~/src
-wget http://cache.ruby-lang.org/pub/ruby/2.1/ruby-2.1.5.tar.gz
-tar xzf ruby-2.1.5.tar.gz
-cd ruby-2.1.5
-./configure
+wget http://cache.ruby-lang.org/pub/ruby/2.1/ruby-2.1.6.tar.gz
+tar xzf ruby-2.1.6.tar.gz
+cd ruby-2.1.6
+./configure --no-rdoc --no-ri
 make
 sudo make install
 
-sudo gem install -v 1.9.9 bundler</span>
+sudo gem install bundler</span>
 </code></pre></notextile>

commit 71ba12ca158c39c17187f15c26279ec00d461dc5
Author: Tom Clegg <tom at curoverse.com>
Date:   Tue Jun 30 22:47:50 2015 -0400

    6377: Avoid "incompatible encoding" errors by using blank template0 instead of site-specific template1.

diff --git a/services/api/config/database.yml.sample b/services/api/config/database.yml.sample
index 6a27016..f58cc11 100644
--- a/services/api/config/database.yml.sample
+++ b/services/api/config/database.yml.sample
@@ -1,5 +1,6 @@
 development:
   adapter: postgresql
+  template: template0
   encoding: utf8
   database: arvados_development
   username: arvados
@@ -8,6 +9,7 @@ development:
 
 test:
   adapter: postgresql
+  template: template0
   encoding: utf8
   database: arvados_test
   username: arvados
@@ -16,6 +18,7 @@ test:
 
 production:
   adapter: postgresql
+  template: template0
   encoding: utf8
   database: arvados_production
   username: arvados

commit 85de04ad9268e45bad459a606bfabfca4f6fad8c
Author: Tom Clegg <tom at curoverse.com>
Date:   Tue Jun 30 11:20:38 2015 -0400

    6377: Fix reversed condition in "site application.yml is optional" fix.

diff --git a/sdk/python/tests/test_arv_put.py b/sdk/python/tests/test_arv_put.py
index d337023..f4bd8b6 100644
--- a/sdk/python/tests/test_arv_put.py
+++ b/sdk/python/tests/test_arv_put.py
@@ -414,7 +414,7 @@ class ArvPutIntegrationTest(run_test_server.TestCaseWithServers,
                             ArvadosBaseTestCase):
     def _getKeepServerConfig():
         for config_file, mandatory in [
-                ['application.yml', True], ['application.default.yml', False]]:
+                ['application.yml', False], ['application.default.yml', True]]:
             path = os.path.join(run_test_server.SERVICES_SRC_DIR,
                                 "api", "config", config_file)
             if not mandatory and not os.path.exists(path):

commit 158b18f036fc5f3f5848390d7ef53c6493aeb5a9
Author: Tom Clegg <tom at curoverse.com>
Date:   Tue Jun 30 11:19:04 2015 -0400

    6377: Use fork of themes_for_rails with fixed gemspec.
    
    Allows installing with current bundler versions, which treat the invalid
    gemspec as an error.

diff --git a/apps/workbench/Gemfile b/apps/workbench/Gemfile
index d4f5e6c..e35cc83 100644
--- a/apps/workbench/Gemfile
+++ b/apps/workbench/Gemfile
@@ -87,7 +87,7 @@ gem 'piwik_analytics'
 gem 'httpclient', '~> 2.5'
 
 # This fork has Rails 4 compatible routes
-gem 'themes_for_rails', git: 'https://github.com/holtkampw/themes_for_rails', ref: '1fd2d7897d75ae0d6375f4c390df87b8e91ad417'
+gem 'themes_for_rails', git: 'https://github.com/curoverse/themes_for_rails'
 
 gem "deep_merge", :require => 'deep_merge/rails_compat'
 
diff --git a/apps/workbench/Gemfile.lock b/apps/workbench/Gemfile.lock
index 9fc7550..bc7ddaf 100644
--- a/apps/workbench/Gemfile.lock
+++ b/apps/workbench/Gemfile.lock
@@ -1,7 +1,6 @@
 GIT
-  remote: https://github.com/holtkampw/themes_for_rails
-  revision: 1fd2d7897d75ae0d6375f4c390df87b8e91ad417
-  ref: 1fd2d7897d75ae0d6375f4c390df87b8e91ad417
+  remote: https://github.com/curoverse/themes_for_rails
+  revision: 61154877047d2346890bda0b7be5827cf51a6a76
   specs:
     themes_for_rails (0.5.1)
       rails (>= 3.0.0)
@@ -10,29 +9,29 @@ GEM
   remote: https://rubygems.org/
   specs:
     RedCloth (4.2.9)
-    actionmailer (4.1.9)
-      actionpack (= 4.1.9)
-      actionview (= 4.1.9)
+    actionmailer (4.1.12)
+      actionpack (= 4.1.12)
+      actionview (= 4.1.12)
       mail (~> 2.5, >= 2.5.4)
-    actionpack (4.1.9)
-      actionview (= 4.1.9)
-      activesupport (= 4.1.9)
+    actionpack (4.1.12)
+      actionview (= 4.1.12)
+      activesupport (= 4.1.12)
       rack (~> 1.5.2)
       rack-test (~> 0.6.2)
-    actionview (4.1.9)
-      activesupport (= 4.1.9)
+    actionview (4.1.12)
+      activesupport (= 4.1.12)
       builder (~> 3.1)
       erubis (~> 2.7.0)
-    activemodel (4.1.9)
-      activesupport (= 4.1.9)
+    activemodel (4.1.12)
+      activesupport (= 4.1.12)
       builder (~> 3.1)
-    activerecord (4.1.9)
-      activemodel (= 4.1.9)
-      activesupport (= 4.1.9)
+    activerecord (4.1.12)
+      activemodel (= 4.1.12)
+      activesupport (= 4.1.12)
       arel (~> 5.0.0)
     activerecord-nulldb-adapter (0.3.1)
       activerecord (>= 2.0.0)
-    activesupport (4.1.9)
+    activesupport (4.1.12)
       i18n (~> 0.6, >= 0.6.9)
       json (~> 1.7, >= 1.7.7)
       minitest (~> 5.1)
@@ -114,13 +113,12 @@ GEM
       uuidtools (>= 2.1.0)
     headless (1.0.2)
     highline (1.6.21)
-    hike (1.2.3)
     httpclient (2.6.0.1)
     i18n (0.7.0)
     jquery-rails (3.1.2)
       railties (>= 3.0, < 5.0)
       thor (>= 0.14, < 2.0)
-    json (1.8.2)
+    json (1.8.3)
     jwt (0.1.13)
       multi_json (>= 1.5)
     launchy (2.4.3)
@@ -134,14 +132,14 @@ GEM
     mail (2.6.3)
       mime-types (>= 1.16, < 3)
     metaclass (0.0.4)
-    mime-types (2.4.3)
+    mime-types (2.6.1)
     mini_portile (0.6.2)
-    minitest (5.5.1)
+    minitest (5.7.0)
     mocha (1.1.0)
       metaclass (~> 0.0.1)
     morrisjs-rails (0.5.1)
       railties (> 3.1, < 5)
-    multi_json (1.10.1)
+    multi_json (1.11.1)
     multipart-post (1.2.0)
     net-scp (1.2.1)
       net-ssh (>= 2.6.5)
@@ -166,25 +164,25 @@ GEM
       cliver (~> 0.3.1)
       multi_json (~> 1.0)
       websocket-driver (>= 0.2.0)
-    rack (1.5.2)
+    rack (1.5.5)
     rack-mini-profiler (0.9.2)
       rack (>= 1.1.3)
     rack-test (0.6.3)
       rack (>= 1.0)
-    rails (4.1.9)
-      actionmailer (= 4.1.9)
-      actionpack (= 4.1.9)
-      actionview (= 4.1.9)
-      activemodel (= 4.1.9)
-      activerecord (= 4.1.9)
-      activesupport (= 4.1.9)
+    rails (4.1.12)
+      actionmailer (= 4.1.12)
+      actionpack (= 4.1.12)
+      actionview (= 4.1.12)
+      activemodel (= 4.1.12)
+      activerecord (= 4.1.12)
+      activesupport (= 4.1.12)
       bundler (>= 1.3.0, < 2.0)
-      railties (= 4.1.9)
+      railties (= 4.1.12)
       sprockets-rails (~> 2.0)
     rails-perftest (0.0.5)
-    railties (4.1.9)
-      actionpack (= 4.1.9)
-      activesupport (= 4.1.9)
+    railties (4.1.12)
+      actionpack (= 4.1.12)
+      activesupport (= 4.1.12)
       rake (>= 0.8.7)
       thor (>= 0.18.1, < 2.0)
     rake (10.4.2)
@@ -222,12 +220,9 @@ GEM
     simplecov-rcov (0.2.3)
       simplecov (>= 0.4.1)
     slop (3.6.0)
-    sprockets (2.12.3)
-      hike (~> 1.2)
-      multi_json (~> 1.0)
+    sprockets (3.2.0)
       rack (~> 1.0)
-      tilt (~> 1.1, != 1.3.0)
-    sprockets-rails (2.2.2)
+    sprockets-rails (2.3.2)
       actionpack (>= 3.0)
       activesupport (>= 3.0)
       sprockets (>= 2.8, < 4.0)
@@ -236,7 +231,7 @@ GEM
       libv8 (~> 3.16.14.0)
       ref
     thor (0.19.1)
-    thread_safe (0.3.4)
+    thread_safe (0.3.5)
     tilt (1.4.1)
     tzinfo (1.2.2)
       thread_safe (~> 0.1)
@@ -299,3 +294,6 @@ DEPENDENCIES
   therubyracer
   uglifier (>= 1.0.3)
   wiselinks
+
+BUNDLED WITH
+   1.10.5

commit acfbb64831047dcae895e57ceff3d0a834c91bf2
Author: Tom Clegg <tom at curoverse.com>
Date:   Tue Jun 30 11:07:24 2015 -0400

    6377: Support loading omniauth config from application.yml.

diff --git a/services/api/app/controllers/user_sessions_controller.rb b/services/api/app/controllers/user_sessions_controller.rb
index 256a67b..795b114 100644
--- a/services/api/app/controllers/user_sessions_controller.rb
+++ b/services/api/app/controllers/user_sessions_controller.rb
@@ -15,7 +15,7 @@ class UserSessionsController < ApplicationController
     unless identity_url_ok
       # Whoa. This should never happen.
       logger.error "UserSessionsController.create: omniauth object missing/invalid"
-      logger.error "omniauth.pretty_inspect():\n\n#{omniauth.pretty_inspect()}"
+      logger.error "omniauth: "+omniauth.pretty_inspect
 
       return redirect_to login_failure_url
     end
@@ -93,7 +93,7 @@ class UserSessionsController < ApplicationController
 
     flash[:notice] = 'You have logged off'
     return_to = params[:return_to] || root_url
-    redirect_to "#{CUSTOM_PROVIDER_URL}/users/sign_out?redirect_uri=#{CGI.escape return_to}"
+    redirect_to "#{Rails.configuration.sso_provider_url}/users/sign_out?redirect_uri=#{CGI.escape return_to}"
   end
 
   # login - Just bounce to /auth/joshid. The only purpose of this function is
diff --git a/services/api/config/application.default.yml b/services/api/config/application.default.yml
index 9b758e6..409dea6 100644
--- a/services/api/config/application.default.yml
+++ b/services/api/config/application.default.yml
@@ -41,6 +41,9 @@ test:
   active_support.deprecation: :stderr
   active_record.mass_assignment_sanitizer: :strict
   uuid_prefix: zzzzz
+  sso_app_id: arvados-server
+  sso_app_secret: <%= rand(2**512).to_s(36) %>
+  sso_provider_url: http://localhost:3002
   secret_token: <%= rand(2**512).to_s(36) %>
   blob_signing_key: zfhgfenhffzltr9dixws36j1yhksjoll2grmku38mi7yxd66h5j4q9w4jzanezacp8s6q0ro3hxakfye02152hncy6zml2ed0uc
   user_profile_notification_address: arvados at example.com
@@ -291,6 +294,12 @@ common:
   # server is using a self-signed cert.
   sso_insecure: false
 
+  # These settings are provided by your OAuth2 provider (e.g.,
+  # sso-provider).
+  sso_app_id: ~
+  sso_app_secret: ~
+  sso_provider_url: ~
+
   # Default replication level for collections. This is used when a
   # collection's replication_desired attribute is nil.
   default_collection_replication: 2
diff --git a/services/api/config/application.yml.example b/services/api/config/application.yml.example
index c3e599f..ee14c0e 100644
--- a/services/api/config/application.yml.example
+++ b/services/api/config/application.yml.example
@@ -23,6 +23,9 @@ production:
   blob_signing_key: ~
   uuid_prefix: bogus
   workbench_address: https://workbench.bogus.arvadosapi.com
+  sso_app_id: arvados-server
+  sso_app_secret: ~
+  sso_provider_url: https://login.bogus.arvadosapi.com
 
 test:
   # Tests should be able to run without further configuration, but if you do
diff --git a/services/api/config/initializers/load_config.rb b/services/api/config/initializers/load_config.rb
index 3b516da..de9770d 100644
--- a/services/api/config/initializers/load_config.rb
+++ b/services/api/config/initializers/load_config.rb
@@ -6,6 +6,22 @@ rescue LoadError
   # configured by application.yml (i.e., here!) instead.
 end
 
+if (File.exists?(File.expand_path '../omniauth.rb', __FILE__) and
+    not defined? WARNED_OMNIAUTH_CONFIG)
+  Rails.logger.warn <<-EOS
+DEPRECATED CONFIGURATION:
+ Please move your SSO provider config into config/application.yml
+ and delete config/initializers/omniauth.rb.
+EOS
+  # Real values will be copied from globals by omniauth_init.rb. For
+  # now, assign some strings so the generic *.yml config loader
+  # doesn't overwrite them or complain that they're missing.
+  Rails.configuration.sso_app_id = 'xxx'
+  Rails.configuration.sso_app_secret = 'xxx'
+  Rails.configuration.sso_provider_url = '//xxx'
+  WARNED_OMNIAUTH_CONFIG = true
+end
+
 $application_config = {}
 
 %w(application.default application).each do |cfgfile|
diff --git a/services/api/config/initializers/omniauth.rb.example b/services/api/config/initializers/omniauth.rb.example
deleted file mode 100644
index aefcf56..0000000
--- a/services/api/config/initializers/omniauth.rb.example
+++ /dev/null
@@ -1,13 +0,0 @@
-# Change this omniauth configuration to point to your registered provider
-# Since this is a registered application, add the app id and secret here
-APP_ID = 'arvados-server'
-APP_SECRET = rand(2**512).to_s(36) # CHANGE ME!
-
-# Update your custom Omniauth provider URL here
-CUSTOM_PROVIDER_URL = 'http://localhost:3002'
-
-Rails.application.config.middleware.use OmniAuth::Builder do
-  provider :josh_id, APP_ID, APP_SECRET, CUSTOM_PROVIDER_URL
-end
-
-OmniAuth.config.on_failure = StaticController.action(:login_failure)
diff --git a/services/api/config/initializers/omniauth_init.rb b/services/api/config/initializers/omniauth_init.rb
new file mode 100644
index 0000000..3277c2b
--- /dev/null
+++ b/services/api/config/initializers/omniauth_init.rb
@@ -0,0 +1,19 @@
+# This file is called omniauth_init.rb instead of omniauth.rb because
+# older versions had site configuration in omniauth.rb.
+#
+# It must come after omniauth.rb in (lexical) load order.
+
+if defined? CUSTOM_PROVIDER_URL
+  Rails.logger.warn "Copying omniauth from globals in legacy config file."
+  Rails.configuration.sso_app_id = APP_ID
+  Rails.configuration.sso_app_secret = APP_SECRET
+  Rails.configuration.sso_provider_url = CUSTOM_PROVIDER_URL
+else
+  Rails.application.config.middleware.use OmniAuth::Builder do
+    provider(:josh_id,
+             Rails.configuration.sso_app_id,
+             Rails.configuration.sso_app_secret,
+             Rails.configuration.sso_provider_url)
+  end
+  OmniAuth.config.on_failure = StaticController.action(:login_failure)
+end

commit 734a66939892064fe9c663fd746cb7371c7d84e4
Author: Tom Clegg <tom at curoverse.com>
Date:   Fri Jun 26 11:19:54 2015 -0400

    6377: Missing application.yml is not an error.

diff --git a/sdk/python/tests/run_test_server.py b/sdk/python/tests/run_test_server.py
index b25bf62..02f65e6 100644
--- a/sdk/python/tests/run_test_server.py
+++ b/sdk/python/tests/run_test_server.py
@@ -453,10 +453,13 @@ def _getport(program):
 def _apiconfig(key):
     if _cached_config:
         return _cached_config[key]
-    def _load(f):
-        return yaml.load(os.path.join(SERVICES_SRC_DIR, 'api', 'config', f))
+    def _load(f, required=True):
+        fullpath = os.path.join(SERVICES_SRC_DIR, 'api', 'config', f)
+        if not required and not os.path.exists(fullpath):
+            return {}
+        return yaml.load(fullpath)
     cdefault = _load('application.default.yml')
-    csite = _load('application.yml')
+    csite = _load('application.yml', required=False)
     _cached_config = {}
     for section in [cdefault.get('common',{}), cdefault.get('test',{}),
                     csite.get('common',{}), csite.get('test',{})]:

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list