[ARVADOS] created: 1a9643523bb0b8dd00bdeb71dc037cb29fc42358
git at public.curoverse.com
git at public.curoverse.com
Thu Sep 25 12:16:23 EDT 2014
at 1a9643523bb0b8dd00bdeb71dc037cb29fc42358 (commit)
commit 1a9643523bb0b8dd00bdeb71dc037cb29fc42358
Author: Tom Clegg <tom at curoverse.com>
Date: Thu Sep 25 11:36:05 2014 -0400
3991: Add workbench_address to docker configs, remove from default config.
diff --git a/docker/api/application.yml.in b/docker/api/application.yml.in
index 355c4e5..a60b4e6 100644
--- a/docker/api/application.yml.in
+++ b/docker/api/application.yml.in
@@ -56,6 +56,8 @@ production:
action_mailer.raise_delivery_errors: false
action_mailer.perform_deliveries: false
+ workbench_address: @@API_WORKBENCH_ADDRESS@@
+
test:
uuid_prefix: zzzzz
secret_token: <%= rand(2**512).to_s(36) %>
diff --git a/docker/build_tools/build.rb b/docker/build_tools/build.rb
index e7f2b7d..d031280 100755
--- a/docker/build_tools/build.rb
+++ b/docker/build_tools/build.rb
@@ -84,6 +84,7 @@ def main options
config['API_AUTO_ADMIN_USER'] = admin_email_address
config['ARVADOS_USER_NAME'] = user_name
config['API_HOSTNAME'] = generate_api_hostname
+ config['API_WORKBENCH_ADDRESS'] = 'https://localhost:9899'
config['PUBLIC_KEY_PATH'] = find_or_create_ssh_key(config['API_HOSTNAME'])
config.each_key do |var|
config_out.write "#{var}: #{config[var]}\n"
diff --git a/docker/config.yml.example b/docker/config.yml.example
index 0765f2f..6ba5bcf 100644
--- a/docker/config.yml.example
+++ b/docker/config.yml.example
@@ -32,6 +32,11 @@ API_HOSTNAME: # e.g. qr1hi
# should be an address associated with a Google account.
API_AUTO_ADMIN_USER:
+# The location of the Workbench application where users should be
+# redirected if they point their browsers at the API server, e.g.,
+# https://localhost:9899
+API_WORKBENCH_ADDRESS:
+
# If a _PW variable is set to an empty string, a password
# will be chosen randomly at build time. This is the
# recommended setting.
diff --git a/docker/passenger/Dockerfile b/docker/passenger/Dockerfile
index 049ce2d..433e5f8 100644
--- a/docker/passenger/Dockerfile
+++ b/docker/passenger/Dockerfile
@@ -8,7 +8,8 @@ RUN apt-get update && \
apt-get install -q -y apt-utils git curl procps apache2-mpm-worker \
libcurl4-openssl-dev apache2-threaded-dev \
libapr1-dev libaprutil1-dev && \
- /usr/local/rvm/bin/rvm-exec default passenger-install-apache2-module --auto
+ cd /usr/src/arvados/services/api && \
+ /usr/local/rvm/bin/rvm-exec default bundle exec passenger-install-apache2-module --auto
-RUN /usr/local/rvm/bin/rvm-exec default passenger-install-apache2-module --snippet > /etc/apache2/conf.d/passenger
+RUN /usr/local/rvm/bin/rvm-exec default bundle exec passenger-install-apache2-module --snippet > /etc/apache2/conf.d/passenger
diff --git a/services/api/app/controllers/static_controller.rb b/services/api/app/controllers/static_controller.rb
index c71b850..c577964 100644
--- a/services/api/app/controllers/static_controller.rb
+++ b/services/api/app/controllers/static_controller.rb
@@ -6,13 +6,7 @@ class StaticController < ApplicationController
skip_before_filter :require_auth_scope, :only => [ :home, :login_failure ]
def home
- if Rails.configuration.respond_to? :workbench_address
- redirect_to Rails.configuration.workbench_address
- else
- render json: {
- error: ('This is the API server; you probably want to be at the workbench for this installation. Unfortunately, config.workbench_address is not set so I can not redirect you there automatically')
- }
- end
+ redirect_to Rails.configuration.workbench_address
end
end
diff --git a/services/api/app/mailers/user_notifier.rb b/services/api/app/mailers/user_notifier.rb
index 1f9ad8c..055fe3a 100644
--- a/services/api/app/mailers/user_notifier.rb
+++ b/services/api/app/mailers/user_notifier.rb
@@ -2,22 +2,10 @@ class UserNotifier < ActionMailer::Base
include AbstractController::Callbacks
default from: Rails.configuration.user_notifier_email_from
- before_filter :load_variables
def account_is_setup(user)
@user = user
mail(to: user.email, subject: 'Welcome to Curoverse')
end
-private
- def load_variables
- if Rails.configuration.respond_to?('workbench_address') and
- not Rails.configuration.workbench_address.nil? and
- not Rails.configuration.workbench_address.empty? then
- @wb_address = Rails.configuration.workbench_address
- else
- @wb_address = '(Unfortunately, config.workbench_address is not set, please contact your site administrator)'
- end
- end
-
end
diff --git a/services/api/app/views/user_notifier/account_is_setup.text.erb b/services/api/app/views/user_notifier/account_is_setup.text.erb
index a7cca2f..ba360c0 100644
--- a/services/api/app/views/user_notifier/account_is_setup.text.erb
+++ b/services/api/app/views/user_notifier/account_is_setup.text.erb
@@ -7,7 +7,7 @@ Hi there,
Your Arvados account has been set up. You can log in with your Google account
associated with the e-mail address <%= @user.email %> at:
- <%= @wb_address %>
+ <%= Rails.configuration.workbench_address %>
Thanks,
The Arvados team.
diff --git a/services/api/config/application.default.yml b/services/api/config/application.default.yml
index 5526501..9d2f630 100644
--- a/services/api/config/application.default.yml
+++ b/services/api/config/application.default.yml
@@ -17,10 +17,6 @@ development:
assets.debug: true
local_modified: <%= '-modified' if `git status -s` %>
- # Visitors to the API server will be redirected to the workbench
- # By default, workbench_address is unset.
- #workbench_address: https://workbench.local:3031/
-
production:
force_ssl: true
cache_classes: true
@@ -31,10 +27,6 @@ production:
assets.compile: false
assets.digest: true
- # Visitors to the API server will be redirected to the workbench
- # By default, workbench_address is unset.
- #workbench_address: <%= "https://workbench." + `hostname`.strip %>
-
test:
force_ssl: false
cache_classes: true
@@ -51,16 +43,15 @@ test:
uuid_prefix: zzzzz
secret_token: <%= rand(2**512).to_s(36) %>
blob_signing_key: zfhgfenhffzltr9dixws36j1yhksjoll2grmku38mi7yxd66h5j4q9w4jzanezacp8s6q0ro3hxakfye02152hncy6zml2ed0uc
-
- # email address to which mail should be sent when the user creates profile for the first time
user_profile_notification_address: arvados at example.com
-
- # Visitors to the API server will be redirected to the workbench
workbench_address: https://localhost:3001/
common:
uuid_prefix: <%= Digest::MD5.hexdigest(`hostname`).to_i(16).to_s(36)[0..4] %>
+ # Requests at the API server's root URL are redirected to this location
+ workbench_address: ~
+
# Git repositories must be readable by api server, or you won't be
# able to submit crunch jobs. To pass the test suites, put a clone
# of the arvados tree in {git_repositories_dir}/arvados.git or
diff --git a/services/api/config/application.yml.example b/services/api/config/application.yml.example
index d6de1ff..f31820a 100644
--- a/services/api/config/application.yml.example
+++ b/services/api/config/application.yml.example
@@ -14,12 +14,14 @@ development:
# Mandatory site secrets. See application.default.yml for more info.
secret_token: ~
blob_signing_key: ~
+ workbench_address: https://localhost:3031
production:
# Mandatory site secrets. See application.default.yml for more info.
secret_token: ~
blob_signing_key: ~
uuid_prefix: bogus
+ workbench_address: https://workbench.bogus.arvadosapi.com
test:
# Tests should be able to run without further configuration, but if you do
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list