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
17 ## Download the source tree
19 git clone https://github.com/curoverse/arvados.git
21 See also: [Downloading the source code](https://arvados.org/projects/arvados/wiki/Download) on the Arvados wiki.
23 ## Configure the API server
25 First install the gems:
27 cd arvados/services/api
30 Next, configure the database:
32 cp -i config/database.yml.sample config/database.yml
34 Edit `database.yml` to your liking and make sure the database and db user exist.
35 Then set up the database:
37 RAILS_ENV=production rake db:setup
41 cp -i config/initializers/omniauth.rb.example config/initializers/omniauth.rb
43 Edit `config/initializers/omniauth.rb`. Choose an *APP_SECRET* and
44 *APP_ID*. Also set *CUSTOM_PROVIDER_URL*.
46 Make sure your Omniauth provider knows about your *APP_ID* and *APP_SECRET*
49 You also need to update `config/initializers/secret_token.rb`.
50 Generate a new secret with
54 and put it in `config/initializers/secret_token.rb`:
56 Server::Application.config.secret_token = 'your-new-secret-here'
58 Edit the main configuration:
60 cp -i config/config.yml.example config/config.yml
62 First, you want to make sure that
66 is set to a unique 5-character alphanumeric string. An example is
67 given that generates a 5-character string based on a hash of your
70 The `uuid_prefix` is a unique identifier for your API server. It also
71 serves as the first part of the hostname for your API server, for
74 {{ site.arvados_api_host }}
76 For a development site, use your own domain instead of arvadosapi.com.
78 You will also want to change `compute_node_nameservers` to suit your
81 Consult `config.defaults.yml` for a full list of configuration
82 options. Always put your local configuration in `config.yml` instead
83 of editing `config.defaults.yml`.
87 Set up Apache and Passenger. Point them to the services/api directory in the source tree.
89 To enable streaming so users can monitor crunch jobs in real time, add
90 to your Apache configuration:
92 PassengerBufferResponse off
96 Point browser to the API endpoint. Log in with a google account.
100 Thread.current[:user] = User.find(1)
101 Thread.current[:user].is_admin = true
102 User.find(1).update_attributes is_admin: true, is_active: true
103 User.find(1).is_admin
113 a = ApiClient.new(owner_uuid:'0'); a.save!
114 x = ApiClientAuthorization.new(api_client_id:a.id, user_id:1); x.save; x.api_token