X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/cbfc8eea7f3fc96f478530c77441b7175a043a17..bdc88877d3b4df3e9196e112b7e0bdce2f731998:/doc/install/install-api-server.html.textile.liquid?ds=sidebyside
diff --git a/doc/install/install-api-server.html.textile.liquid b/doc/install/install-api-server.html.textile.liquid
index ccfc58ecf4..0d721fcb09 100644
--- a/doc/install/install-api-server.html.textile.liquid
+++ b/doc/install/install-api-server.html.textile.liquid
@@ -8,17 +8,40 @@ h2. Prerequisites:
# A GNU/Linux (virtual) machine
# A domain name for your api server
-# Ruby >= 2.0.0
-# Bundler: @gem install bundler@
-# Curl libraries: @sudo apt-get install libcurl3 libcurl3-gnutls libcurl4-openssl-dev@
+
+h2(#dependencies). Install dependencies
+
+~$ sudo apt-get install libcurl3 libcurl3-gnutls libcurl4-openssl-dev \
+ libxslt1.1 zlib1g-dev gettext bison libssl-dev libreadline-dev \
+ libpq-dev sqlite3 libsqlite3-dev build-essential wget postgresql sudo
+
mkdir -p ~/src
+cd ~/src
+wget http://cache.ruby-lang.org/pub/ruby/2.1/ruby-2.1.1.tar.gz
+tar xzf ruby-2.1.1.tar.gz
+cd ruby-2.1.1
+./configure
+make
+sudo make install
+
+sudo gem install bundler
+
~$ git clone https://github.com/curoverse/arvados.git
+
~$ cd $HOME # (or wherever you want to install)
+~$ git clone https://github.com/curoverse/arvados.git
~/arvados/services/api$ rake secret
+
~/arvados/services/api$ rake secret
zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz
~/arvados/services/api$ ruby -e 'puts rand(2**128).to_s(36)'
+6gqa1vu492idd7yca9tfandj3
+
~/arvados/services/api$ sudo -u postgres createuser --createdb --encrypted --pwprompt arvados
+[sudo] password for you: yourpassword
+Enter password for new role: paste-password-you-generated
+Enter it again: paste-password-again
+Shall the new role be a superuser? (y/n) n
+Shall the new role be allowed to create more new roles? (y/n) n
+
~/arvados/services/api$ cp -i config/database.yml.sample config/database.yml
+~/arvados/services/api$ edit config/database.yml
~/arvados/services/api$ RAILS_ENV=development bundle exec rake db:setup
@@ -85,7 +127,7 @@ Edit @config/initializers/omniauth.rb@. Set @APP_SECRET@ to the value of @app_se
You can now run the development server:
~/arvados/services/api$ rails server
+
~/arvados/services/api$ bundle exec rails server --port=3030
~/arvados/services/api$ rails console
-irb(main):001:0> Thread.current[:user] = User.find(1)
-irb(main):002:0> Thread.current[:user].is_admin = true
-irb(main):003:0> User.find(1).update_attributes is_admin: true, is_active: true
-irb(main):004:0> User.find(1).is_admin
-=> true
-
https://localhost:3030/login
+
+
-h2. Create an API token
+Log in with your google account.
-In rails console:
+Use the rails console to give yourself admin privileges:
~/arvados/services/api$ rails console
-irb(main):001:0> a = ApiClient.new(owner_uuid:'0')
-irb(main):002:0> a.save!
-irb(main):003:0> x = ApiClientAuthorization.new(api_client_id:a.id, user_id:1)
-irb(main):004:0> x.save
-irb(main):005:0> x.api_token
+~/arvados/services/api$ bundle exec rails console
+irb(main):001:0> Thread.current[:user] = User.all.select(&:identity_url).last
+irb(main):002:0> Thread.current[:user].is_admin = true
+irb(main):003:0> Thread.current[:user].update_attributes is_admin: true, is_active: true
+irb(main):004:0> User.where(is_admin: true).collect &:email
+=> ["root", "your_address@example.com"]