3 navsection: installguide
4 title: Install the API server
12 1. A GNU/Linux (virtual) machine
13 2. A domain name for your api server
15 4. Bundler: `gem install bundler`
16 5. Curl libraries: `sudo apt-get install libcurl3 libcurl3-gnutls libcurl4-openssl-dev`
18 ## Download the source tree
20 git clone https://github.com/curoverse/arvados.git
23 See also: [Downloading the source code](https://arvados.org/projects/arvados/wiki/Download) on the Arvados wiki.
25 ## Install gem dependencies
27 cd services/api && bundle install
29 ## Configure the API server
31 Configure the database:
33 cp -i config/database.yml.sample config/database.yml
35 Edit `config/database.yml` to your liking and make sure the database
36 and db user exist. Then set up the database:
38 RAILS_ENV=production bundle exec rake db:setup
42 cp -i config/initializers/omniauth.rb.example config/initializers/omniauth.rb
44 Edit `config/initializers/omniauth.rb`. Choose an *APP_SECRET* and
45 *APP_ID*. Also set *CUSTOM_PROVIDER_URL*.
47 Make sure your Omniauth provider knows about your *APP_ID* and *APP_SECRET*
50 Edit the main configuration.
52 cp -i config/application.yml.example config/application.yml
54 First, choose a unique 5-character alphanumeric string to use as your
55 `uuid_prefix`. An example is given that generates a 5-character string
56 based on a hash of your hostname. The `uuid_prefix` is a unique
57 identifier for your API server. It also serves as the first part of
58 the hostname for your API server:
60 {{ site.arvados_api_host }}
62 For a development site, use your own domain instead of arvadosapi.com.
64 You also need to install a secret_token for signing cookies. Generate
69 Put it in `config/application.yml` in the production or common section:
71 secret_token: your-new-secret-here
73 You will also want to change `compute_node_nameservers` to suit your
76 Consult `application.default.yml` for a full list of configuration
77 options. Always put your local configuration in `application.yml`
78 instead of editing `application.default.yml`.
82 Set up Apache and Passenger. Point them to the services/api directory in the source tree.
84 To enable streaming so users can monitor crunch jobs in real time, add
85 to your Apache configuration:
87 PassengerBufferResponse off
91 Point browser to the API endpoint. Log in with a google account.
95 Thread.current[:user] = User.find(1)
96 Thread.current[:user].is_admin = true
97 User.find(1).update_attributes is_admin: true, is_active: true
108 a = ApiClient.new(owner_uuid:'0'); a.save!
109 x = ApiClientAuthorization.new(api_client_id:a.id, user_id:1); x.save; x.api_token