# License

### Impulse License

The impulse license file (`license.dat`) will be provided by Motiv to be uploaded to diesel. The license is required to execute any synchronization job. Here are described the steps to upload the provided license file.

### Public Key

Motiv will provide also a public key used to verify the provided license. The public key has to be included in the `sync-manager` docker container(s) using the environment variable  `LICENSE_PUBLIC_KEY`:

```
LICENSE_PUBLIC_KEY=<provided-public-key>
```

Make sure to include this environment variable before starting the impulse application.

### Print License Information

The provided license file is encoded. In order to print the information included in the license, you can use the command line tool `print-license` provided by Motiv:

```
print-license <license-file>
```

### Verify License

You can verify the signature for the provided license by running the command line tool `verify-license` provided by Motiv. This tool will also signal if the license is already expired.

```
verify-license <license-file> <public-key-file>
```

### Upload License to Diesel

Impulse will read the license from `diesel` before starting a new synchronization job, and it will trigger an error if the license is not valid. You can use the command line tool `upload-license` provided by Motiv to upload the license file to `diesel`:

```
upload-license --dieselURL <diesel-URL> --organization <organization> 
    --user <user> --password <password> [--bucket <bucket>] [--target <target>]
    <license-file> 
```

By default, if no bucket and target location are specified, the license file will be uploaded to this default location in diesel:

* Bucket: impulse
* Target location: license.dat

You can also upload the license file by sending an HTTP request directly to `diesel`. For the request payload, you should use the license file content. Also, you should use `janus` for authentication because the diesel service is only accessible through the private path in the Janus gateway. See Janus documentation for more information on how to use Janus to authenticate and send requests through the private path. You should also include an `x-organization` header in the request to include the appropriate organization id. Here is the request to send the license file to `diesel`:

```
PUT /<janus-gateway>:<janus-port>/private/diesel/files/<bucket>/<location>
```

In case you use a bucket or a target location different than the default ones to upload the license file (the default bucket is 'license' and the default location under that bucket is 'license.dat'), you also should use these environment variables in the `sync-manager` docker container:

```
LICENSE_FILE_BUCKET=<diesel-bucket>
LICENSE_FILE_NAME=<diesel-target-location>
```

Make sure to include these environment variables before starting the impulse application.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://motivlabs.gitbook.io/impulse-install-manual/license.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
