8099: 7263: Merge branch 'hgi/7263-even-better-busy-behavior' of github.com:wtsi...
[arvados.git] / doc / install / install-sso.html.textile.liquid
index ca620f478a8d215066fde5a9ffa157032174f4db..aaa6211b461ca3296a6cab157c9ee49bf4488c65 100644 (file)
@@ -94,18 +94,9 @@ On a Red Hat-based system, we also need to initialize the database system:
 </code></pre>
 </notextile>
 
-{% include 'notebox_begin' %}
-
-If you are installing on CentOS6, you will need to modify PostgreSQL's configuration to allow password authentication for local users. The default configuration allows 'ident' only. The following commands will make the configuration change, and restart PostgreSQL for it to take effect.
-<br/>
-<notextile>
-<pre><code>~$ <span class="userinput">sudo sed -i -e "s/127.0.0.1\/32          ident/127.0.0.1\/32          md5/" /var/lib/pgsql/data/pg_hba.conf</span>
-~$ <span class="userinput">sudo sed -i -e "s/::1\/128               ident/::1\/128               md5/" /var/lib/pgsql/data/pg_hba.conf</span>
-~$ <span class="userinput">sudo service postgresql restart</span>
-</code></pre>
-</notextile>
-{% include 'notebox_end' %}
-
+{% assign pg_service = "postgresql" %}
+{% assign pg_hba_path = "/var/lib/pgsql/data/pg_hba.conf" %}
+{% include 'install_redhat_postgres_auth' %}
 
 Next, generate a new database password. Nobody ever needs to memorize it or type it, so make a strong one:
 
@@ -128,7 +119,7 @@ Enter password for new role: <span class="userinput">paste-database-password-you
 Enter it again: <span class="userinput">paste-database-password-you-generated</span>
 </code></pre></notextile>
 
-Rails will take care of creating the database, based on the information from @/etc/arvados/sso/database.yml@. 
+Rails will take care of creating the database, based on the information from @/etc/arvados/sso/database.yml@.
 
 Alternatively, if the database user you intend to use for the SSO server should not be allowed to create new databases, the user and the database can be created like this:
 
@@ -141,35 +132,23 @@ Enter it again: <span class="userinput">paste-database-password-you-generated</s
 
 h2(#reconfigure_package). Reconfigure the package
 
-Now that the @/etc/arvados/sso/application.yml@ and @/etc/arvados/sso/database.yml@ files have been updated, we need to reconfigure our installed package. Doing so will create and/or initialize the database and precompile the assets.
-
-On a Debian-based system:
-
-<notextile>
-<pre><code>~$ <span class="userinput">sudo dpkg-reconfigure arvados-sso-server</span>
-</code></pre>
-</notextile>
-
-On a Red Hat-based system, we need to reinstall the package instead:
-
-<notextile>
-<pre><code>~$ <span class="userinput">sudo yum reinstall arvados-sso-server</span>
-</code></pre>
-</notextile>
+{% assign railspkg = "arvados-sso-server" %}
+{% include 'install_rails_reconfigure' %}
 
 h2(#client). Create arvados-server client
 
-Use @rails console@ to create a @Client@ record that will be used by the Arvados API server.  The values of @app_id@ and @app_secret@ correspond to the values for @sso_app_id@ and @sso_app_secret@ in the "API server's SSO settings.":install-api-server.html#omniauth
+{% assign railshost = "" %}
+{% assign railsdir = "/var/www/arvados-sso/current" %}
+Use @rails console@ to create a @Client@ record that will be used by the Arvados API server.  {% include 'install_rails_command' %}
+
+Enter the following commands at the console.  The values that appear after you assign @app_id@ and @app_secret@ correspond to the values for @sso_app_id@ and @sso_app_secret@, respectively, in the "API server's SSO settings":install-api-server.html#omniauth.
 
 <notextile>
-<pre><code>~$ <span class="userinput">ruby -e 'puts rand(2**400).to_s(36)'</span>
-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
-~$ <span class="userinput">cd /var/www/arvados-sso/current</span>
-/var/www/arvados-sso/current$ <span class="userinput">RAILS_ENV=production bundle exec rails console</span>
-:001 &gt; <span class="userinput">c = Client.new</span>
+<pre><code>:001 &gt; <span class="userinput">c = Client.new</span>
 :002 &gt; <span class="userinput">c.name = "joshid"</span>
 :003 &gt; <span class="userinput">c.app_id = "arvados-server"</span>
-:004 &gt; <span class="userinput">c.app_secret = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"</span>
+:004 &gt; <span class="userinput">c.app_secret = rand(2**400).to_s(36)</span>
+=&gt; "<strong>save this string for your API server's sso_app_secret</strong>"
 :005 &gt; <span class="userinput">c.save!</span>
 :006 &gt; <span class="userinput">quit</span>
 </code></pre>
@@ -245,11 +224,12 @@ There are two configuration options for local accounts:
 
 For more information about configuring backend support for sending email (required to send email confirmations) see "Configuring Action Mailer":http://guides.rubyonrails.org/configuring.html#configuring-action-mailer
 
-If @allow_account_registration@ is false, you may manually create local accounts on the SSO server from the rails console:
+If @allow_account_registration@ is false, you may manually create local accounts on the SSO server from the Rails console.  {% include 'install_rails_command' %}
+
+Enter the following commands at the console.
 
 <notextile>
-<pre><code>~$ <span class="userinput">RAILS_ENV=production bundle exec rails console</span>
-:001 &gt; <span class="userinput">user = User.new(:email =&gt; "test@example.com")</span>
+<pre><code>:001 &gt; <span class="userinput">user = User.new(:email =&gt; "test@example.com")</span>
 :002 &gt; <span class="userinput">user.password = "passw0rd"</span>
 :003 &gt; <span class="userinput">user.save!</span>
 :004 &gt; <span class="userinput">quit</span>
@@ -307,5 +287,3 @@ In order to use Google+ authentication, you must use the <a href="https://consol
 <pre><code>  # Google API tokens required for OAuth2 login.
   google_oauth2_client_id: <span class="userinput">"---YOUR---CLIENT---ID---HERE--"-</span>
   google_oauth2_client_secret: <span class="userinput">"---YOUR---CLIENT---SECRET---HERE--"-</span></code></pre></notextile>
-
-