Fix 2.4.2 upgrade notes formatting refs #19330
[arvados.git] / apps / workbench / app / views / users / _current_token.html.erb
1 <%# Copyright (C) The Arvados Authors. All rights reserved.
2
3 SPDX-License-Identifier: AGPL-3.0 %>
4
5 <div class="panel panel-default">
6   <div class="panel-heading">
7     <h4 class="panel-title">
8       <a data-parent="#arv-adv-accordion" href="/current_token">
9         Current Token
10       </a>
11     </h4>
12   </div>
13
14 <div id="#manage_current_token" class="panel-body">
15 <p>The Arvados API token is a secret key that enables the Arvados SDKs to access Arvados with the proper permissions. For more information see <%= link_to raw('Getting an API token'), "#{Rails.configuration.Workbench.ArvadosDocsite}/user/reference/api-tokens.html", target: "_blank"%>.</p>
16 <p>Paste the following lines at a shell prompt to set up the necessary environment for Arvados SDKs to authenticate to your <b><%= current_user.username %></b> account.</p>
17 <%
18   wb2_url = nil
19   if Rails.configuration.Services.Workbench2.ExternalURL != URI("")
20     wb2_url = Rails.configuration.Services.Workbench2.ExternalURL.to_s
21     wb2_url += '/' if wb2_url[-1] != '/'
22     wb2_url += "token?api_token=" + Thread.current[:arvados_api_token]
23   end
24 %>
25 <p><b>IMPORTANT:</b> This token will expire when logged out. If you need a token for a long running process, it is recommended to <% if wb2_url %><a href="<%= wb2_url %>">get a token from Workbench2's Get API token dialog</a>. <% else %> create a new token using the CLI tools.<% end %></p>
26
27 <pre>
28 HISTIGNORE=$HISTIGNORE:'export ARVADOS_API_TOKEN=*'
29 export ARVADOS_API_TOKEN=<%= Thread.current[:arvados_api_token] %>
30 export ARVADOS_API_HOST=<%= current_api_host %>
31 <% if Rails.configuration.TLS.Insecure %>
32 export ARVADOS_API_HOST_INSECURE=true
33 <% else %>
34 unset ARVADOS_API_HOST_INSECURE
35 <% end %>
36 </pre>
37 <p>Arvados<%= link_to virtual_machines_user_path(current_user) do%> virtual machines<%end%> do this for you automatically. This setup is needed only when you use the API remotely (e.g., from your own workstation).</p>
38 </div>
39 </div>