Fix admin user setup instructions, add some missing "bundle exec",
authorTom Clegg <tom@curoverse.com>
Thu, 24 Apr 2014 14:40:59 +0000 (10:40 -0400)
committerTom Clegg <tom@curoverse.com>
Thu, 24 Apr 2014 14:40:59 +0000 (10:40 -0400)
remove unnecessary "Create an API token" section.

doc/install/install-api-server.html.textile.liquid

index 14719e960c7ad0868380f9a2959b33f2cfca6ac0..a1cca3d8b4466b48785dd69abf94f2f798fdf878 100644 (file)
@@ -126,7 +126,7 @@ Edit @config/initializers/omniauth.rb@. Set @APP_SECRET@ to the value of @app_se
 You can now run the development server:
 
 <notextile>
-<pre><code>~/arvados/services/api$ <span class="userinput">bundle exec rails server
+<pre><code>~/arvados/services/api$ <span class="userinput">bundle exec rails server --port=3030
 </code></pre></notextile>
 
 h3. Apache/Passenger (optional)
@@ -142,28 +142,22 @@ To enable streaming so users can monitor crunch jobs in real time, add to your P
 
 h2. Add an admin user
 
-Point browser to the API endpoint. Log in with a google account.
-
-In the rails console:
+Point your browser to the API server's login endpoint:
 
 <notextile>
-<pre><code>~/arvados/services/api$ <span class="userinput">rails console</span>
-irb(main):001:0&gt; <span class="userinput">Thread.current[:user] = User.find(1)</span>
-irb(main):002:0&gt; <span class="userinput">Thread.current[:user].is_admin = true</span>
-irb(main):003:0&gt; <span class="userinput">User.find(1).update_attributes is_admin: true, is_active: true</span>
-irb(main):004:0&gt; <span class="userinput">User.find(1).is_admin</span>
-=&gt; true
-</code></pre></notextile>
+<pre><code><span class="userinput">https://localhost:3030/login</span>
+</code></pre>
+</notextile>
 
-h2. Create an API token
+Log in with your google account.
 
-In rails console:
+Use the rails console to give yourself admin privileges:
 
 <notextile>
-<pre><code>~/arvados/services/api$ <span class="userinput">rails console</span>
-irb(main):001:0&gt; <span class="userinput">a = ApiClient.new(owner_uuid:'0')</span>
-irb(main):002:0&gt; <span class="userinput">a.save!</span>
-irb(main):003:0&gt; <span class="userinput">x = ApiClientAuthorization.new(api_client_id:a.id, user_id:1)</span>
-irb(main):004:0&gt; <span class="userinput">x.save</span>
-irb(main):005:0&gt; <span class="userinput">x.api_token</span>
+<pre><code>~/arvados/services/api$ <span class="userinput">bundle exec rails console</span>
+irb(main):001:0&gt; <span class="userinput">Thread.current[:user] = User.all.select(&:identity_url).last</span>
+irb(main):002:0&gt; <span class="userinput">Thread.current[:user].is_admin = true</span>
+irb(main):003:0&gt; <span class="userinput">Thread.current[:user].update_attributes is_admin: true, is_active: true</span>
+irb(main):004:0&gt; <span class="userinput">User.where(is_admin: true).collect &:email</span>
+=&gt; ["root", "<b>your_address@example.com</b>"]
 </code></pre></notextile>