Datalore 2022.2 Help

Use Hub for authentication services

JetBrains Hub supports most popular auth modules. Follow the procedures below to run Hub for Datalore.

Run Hub for Docker

  1. Add following volumes to your docker-compose file:

    volumes: hub-data: { } hub-conf: { } hub-logs: { } hub-backups: { }
  2. Add following service to your docker-compose file:

    services: ... hub: image: jetbrains/hub:2022.2.15039 ports: - "8082:8080" networks: - datalore-backend-network volumes: - "hub-data:/data/hub/data" - "hub-conf:/data/hub/conf" - "hub-logs:/data/hub/logs" - "hub-backups:/data/hub/backups"
  3. Run docker compose up hub to run Hub only (we assume that Datalore is not running at the moment).

If you have already installed Hub, go to the Configuration procedure. You can find more details about the Hub installation process here.

Install Hub

  1. Configure persistent storage by setting the volumes or volumeClaimTemplates helm parameter.

  2. Install the Hub Helm chart using the helm install command.

  3. (Optional) It is assumed that you can access Hub at http://localhost:8082. For it to work, forward the port with the following command:

    kubectl port-forward --address 0.0.0.0 service/hub 8082
  4. Check the container output using the kubectl logs service/hub command. It should contain a line like this:

    JetBrains Hub 2021.1 Configuration Wizard will listen inside the container on {0.0.0.0:8080}/ after start and can be accessed by this URL: [http://<put-your-docker-HOST-name-here>:<put-host-port-mapped-to-container-port-8080-here>/?wizard_token=pPXTShp4NXceXqGYzeAq].

    Copy the wizard_token value to the clipboard.

  5. Go to http://localhost:8082/ and insert the token from the previous step into the Token field.

  6. Click the Log in button.

  7. Click the Set Up link.

  8. Generate a URL (referred to as HUB_ROOT_URL later) to access Hub from Datalore. Consider the following:

    • The URL must be accessible from both the cluster pods and the browser (by the end users of your Datalore installation).

    • The URL must point to the / path of your Hub installation, i.e. http://127.0.0.1:8080/ inside the container where Hub is launched (by default, the hub-0) pod.

    • How you set up your cluster to serve such a URL depends on the specifics of your cluster configuration.

  9. In Base URL, enter HUB_ROOT_URL. Do not change the Application Listen Port setting.

  10. Click the Next button.

  11. Configure the admin account (set the admin password).

  12. Click the Finish button and wait for Hub to start.

Configure Hub

Go to HUB_ROOT_URL and log into Hub via admin account.

Configure the Datalore service

  1. Create one more URL (referred to as DATALORE_ROOT_URL later) to access Datalore. Consider the following:

    • The URL must be accessible from the browser (by the end users of your Datalore installation).

    • The URL must point to the / path of your Datalore installation, i.e. http://127.0.0.1:8080/ inside the container where Datalore will be launched (by default, it is pod datalore-on-premise-0).

    • How you set up your cluster to serve such a URL depends on the specifics of your cluster configuration.

  2. Go to Services(${HUB_ROOT_URL}/hub/services) and click the New service button. Use the name datalore and enter DATALORE_ROOT_URL in Home URL.

  3. Copy the ID field value and save it somewhere: it is used when configuring Datalore ($HUB_DATALORE_SERVICE_ID property).

  4. Click the Change... button next to the Secret label.

  5. Copy the generated secret and save it somewhere: it will be used when configuring Datalore ($HUB_DATALORE_SERVICE_SECRET property).

  6. Click the Change secret button.

  7. Enter DATALORE_ROOT_URL in the Base URLs field.

  8. Enter the line /api/hub/openid/login in the Redirect URIs field.

  9. Click the Trust Service button in the upper right corner.

  10. Click the Save button.

Create a Hub token

  1. Go to Users (${HUB_ROOT_URL}/hub/users).

  2. Click your admin username.

  3. Go to the Authentication tab.

  4. Click the New token... button.

  5. Add Hub and Datalore into Scope. You can use any Name. Click the Create button. Copy the token (with the perm: prefix) and save it somewhere. It will be used when configuring Datalore ($HUB_PERM_TOKEN property).

(Optional) Force email verification

Datalore uses user emails from Hub; so it is recommended to force email verification in Hub. Users with unverified emails will not be able to use Datalore.

  1. Configure the SMTP server:

    • Go to SMTP (${HUB_ROOT_URL}/hub/smtp-settings).

    • Click the Configure SMTP server... button.

    • Configure your SMTP server parameters.

    • Click the Save button.

    • Click the Enable notifications button.

    • (Optional) To make sure your configuration is working, click the Send Test message button.

  2. Enable email verification:

    • Go to Auth Modules (${HUB_ROOT_URL}/hub/authmodules).

    • Open the Common settings page.

    • Enable the Email verification option.

    • Click the Save button.

  3. Set and verify an admin user email:

    • Go to Users (${HUB_ROOT_URL}/hub/users).

    • Click your admin username.

    • Set an email in the Email field.

    • Click the Save button.

    • Click the Send verification email link.

    • Find the verification email in your inbox and click the Verify email address button.

(Optional) Ban a guest user

  1. Go to Users (${HUB_ROOT_URL}/hub/users).

  2. Select a guest user.

  3. Click the Ban button.

(Optional) Enable auth modules

  1. Go to Auth Modules (${HUB_ROOT_URL}/hub/authmodules).

  2. Add or remove auth modules (for example, Google auth, GitHub auth, LDAP, and so on). Find more details here.

Configure the Datalore service

Edit the docker-compose file (for Docker) or values under the dataloreEnv key in the datalore (for Helm).

Define the following environment values:

HUB_PUBLIC_BASE_URL

Base public (accessible via browser) URL of your Hub installation (${HUB_ROOT_URL}/hub from the Install Hub section, for example, https://hub.your.domain/hub).

HUB_DATALORE_SERVICE_ID

ID of the Datalore service in Hub (see Configure the Datalore service).

HUB_DATALORE_SERVICE_SECRET

Token of the Datalore service in Hub (see Configure the Datalore service).

HUB_PERM_TOKEN

Token for accessing Datalore and Hub scopes (see Create a Hub token).

HUB_FORCE_EMAIL_VERIFICATION

Used to specify whether email verification is required from the Datalore user.

Example (Docker):

services: datalore: environment: DB_PASSWORD: "changeme" ADMIN_API_AUTH_TOKEN: "changeme" HUB_PUBLIC_BASE_URL: "http://127.0.0.1:8082/hub" HUB_DATALORE_SERVICE_ID: "9030674b-2679-495a-b606-c554384f42a3" HUB_DATALORE_SERVICE_SECRET: "sHCpaPQfPWco" HUB_PERM_TOKEN: "perm:YWRtaW4=.NDUtMA==.MBJEauHYuzg9nSXS6d1FkJ93zZcZvT" HUB_FORCE_EMAIL_VERIFICATION: "false"
Last modified: 07 September 2023