Fix 2.4.2 upgrade notes formatting refs #19330
[arvados.git] / doc / user / topics / arvados-sync-external-sources.html.textile.liquid
1 ---
2 layout: default
3 navsection: admin
4 title: "Synchronizing from external sources"
5 ...
6 {% comment %}
7 Copyright (C) The Arvados Authors. All rights reserved.
8
9 SPDX-License-Identifier: CC-BY-SA-3.0
10 {% endcomment %}
11
12 The @arvados-sync-users@ and @arvados-sync-groups@ tools allow to manage Arvados users & groups from external sources.
13
14 These tools are designed to be run periodically reading a file created by a remote auth system (ie: LDAP) dump script, applying what's included on the file as the source of truth.
15
16 bq. NOTE: Both tools need to perform several administrative tasks on Arvados, so must be run using a superuser token via @ARVADOS_API_HOST@ and @ARVADOS_API_TOKEN@ environment variables or @~/.config/arvados/settings.conf@ file.
17
18 h1. Using arvados-sync-users
19
20 This tool reads a CSV (comma-separated values) file having information about user accounts and their expected state on Arvados.
21
22 Every line on the file should have 5 fields:
23
24 # A user identifier: it could be an email address (default) or a username.
25 # The user's first name.
26 # The user's last name.
27 # The intended user's active state.
28 # The intended user's admin state: will always be read as @false@ when @active=false@.
29
30 The last 2 fields should be represented as @true@/@false@, @yes@/@no@, or @1@/@0@ values.
31
32 h2. Options
33
34 The following command line options are supported:
35
36 table(table table-bordered table-condensed).
37 |_. Option |_. Description |
38 |==--help==|This list of options|
39 |==--case-insensitive==|Uses case-insensitive username matching|
40 |==--deactivate-unlisted==|Deactivate users that aren't listed on the input file. (Current & system users won't be affected)|
41 |==--user-id==|Identifier to use in looking up user. One of 'email' or 'username' (Default: 'email')|
42 |==--verbose==|Log informational messages|
43 |==--version==|Print version and exit|
44
45 The tool will create users when needed, and update those existing records to match the desired state described by the fields on the CSV file.
46 System users like the root and anonymous are unaffected by this tool.
47 In the case of a @LoginCluster@ federation, this tool should be run on the cluster that manages the user accounts, and will fail otherwise.
48
49 h2. Example
50
51 To sync users using the username to identify every account, reading from some @external_users.csv@ file and deactivating existing users that aren't included in it, the command should be called as follows:
52
53 <notextile>
54 <pre><code>~$ <span class="userinput">arvados-sync-users --deactivate-unlisted --user-id username /path/to/external_users.csv </span>
55 </code></pre>
56 </notextile>
57
58 h1. Using arvados-sync-groups
59
60 This tool reads a CSV (comma-separated values) file having information about external groups and their members. When running it for the first time, it'll create a special group named 'Externally synchronized groups' meant to be the parent of all the remote groups.
61
62 Every line on the file should have 3 values: a group name, a local user identifier and a permission level, meaning that the named user is a member of the group with the provided permission. The tool will create the group if it doesn't exist, and add the user to it. If any group member is not present on the input file, it will be removed from the group.
63
64 Users can be identified by their email address or username: the tool will check if every user exist on the system, and report back when not found. Groups on the other hand, are identified by their name.
65
66 Permission level can be one of the following: @can_read@, @can_write@ or @can_manage@, giving the group member read, read/write or managing privileges on the group. For backwards compatibility purposes, if any record omits the third (permission) field, it will default to @can_write@ permission. You can read more about permissions on the "group management admin guide":{{ site.baseurl }}/admin/group-management.html.
67
68 h2. Options
69
70 The following command line options are supported:
71
72 table(table table-bordered table-condensed).
73 |_. Option |_. Description |
74 |==--help==|This list of options|
75 |==--case-insensitive==|Uses case-insensitive username matching|
76 |==--parent-group-uuid==|UUID of group to own all the externally synchronized groups|
77 |==--user-id==|Identifier to use in looking up user. One of 'email' or 'username' (Default: 'email')|
78 |==--verbose==|Log informational messages (Default: False)|
79 |==--version==|Print version and exit|
80
81 h2. Examples
82
83 To sync groups using the username to identify every account, reading from some @external_groups.csv@ file, the command should be called as follows:
84
85 <notextile>
86 <pre><code>~$ <span class="userinput">arvados-sync-groups --user-id username /path/to/external_groups.csv </span>
87 </code></pre>
88 </notextile>
89
90 If you want to use a specific preexisting group as the parent of all the remote groups, you can do it this way:
91
92 <notextile>
93 <pre><code>~$ <span class="userinput">arvados-sync-groups --parent-group-uuid &lt;preexisting group UUID&gt; --user-id username /path/to/external_groups.csv </span>
94 </code></pre>
95 </notextile>