Auto Subscribe CLI Tool
The integration auto subscribe CLI tool allows you to subscribe a one or more users to one or more specified integrations. Prior to running the script, you should ensure that the integration has been properly configured for all users (i.e., API keys and other required options have been set to "Only Admins can view and edit" or "Users can view only").
If a user does not have access to the specified integration, they will not be subscribed to the integration.
Installation
To install the script, you can download it directly to your Polarity Server and place it inside your /app
directory. You should replace the existing script of the same name. You can use the following commands to install the script into the correct location:
To confirm that you have the correct script installed you can run the --version
command:
You should see the following output:
Options
To quickly view all the available options you can run the following command:
This will output the following:
--env
This is an optional flag you can use to provide an absolute path to your server's default .env
file. For most installations the default value of /app/polarity-server/.env
is correct and this option is not needed.
--config
This is an optional flag you can use to provide an absolute path to your server's default config.js
file. For most installations the default value of /app/polarity-server/config/config.js
is correct and this option is not needed.
--url
This is the URL of the Polarity Server you wish to authenticate to. You should include the scheme https://
.
--username
This is the username of the Polarity user you wish to authenticate to your Polarity server as
--password
This is the password of the Polarity user you wish to authenticate to your Polarity server as
--integrations
One or more integration directory names specified using a comma delimited list.
If specifying a comma delimited list, no spaces should be included between integration directory names.
Example
--subscribeUsernames
A comma delimited list of usernames you would like to subscribe to the integration. If this options is not provided, all users that have explicit access to an integration will be subscribed to the specified integration(s).
Example
Subscribe a single user with the username alice
:
Subscribe multiple users:
If specifying a comma delimited list, no spaces should be included between usernames
--includeAdmins
By default, if you do not specify specific users to subscribe via the --subscribeUsernames
option, the script will subscribe all users that have explicit access to the integration. This means that only users that are listed under the Permissions tab of the integration or users that are in a group listed under the Permissions tab will be subscribed. If you would like to subscribe all "admin" users to the integration (even if they do not have explicit access granted), you can pass in the --includeAdmins
flag.
--rejectUnauthorized
Set this to false
if your Polarity Server has a self signed SSL certificate that is not trusted
--proxy
Set this to a proxy configuration string if you need to use a proxy to access your Polarity Server.
Example Usage
Prior to running any of the below script commands, change into the scripts
directory
In all of these examples we assume we are connecting to our Polarity server hosted at https://my-polarity-server.corp
with the admin
user who has a password of password123!
.
Subscribe a single user named polarity_user
to a single integration arin
polarity_user
to a single integration arin
Subscribe all eligible users to a single integration called arin
arin
Subscribe a single user named polarity_user
to both the arin
and ldap
integrations:
polarity_user
to both the arin
and ldap
integrations:Subscribe a two users named polarity_user
and polarity_user_2
to both the arin
and ldap
integrations:
polarity_user
and polarity_user_2
to both the arin
and ldap
integrations:Subscribe all users to both arin
and ldap
integrations
arin
and ldap
integrationsSubscribe all eligible users including all admins to both arin
and ldap
integrations
Last updated