From c70077e1dc66c65858c3935a0c32ccfd97d63066 Mon Sep 17 00:00:00 2001 From: Keshav Priyadarshi Date: Thu, 12 Nov 2026 17:54:44 +0530 Subject: [PATCH] docs: add details on how to enable PurlDB authentication Signed-off-by: Keshav Priyadarshi --- deploy/README.md | 41 ++++++++++++++++++++++++++++++++++++++++- 1 file changed, 40 insertions(+), 1 deletion(-) diff --git a/deploy/README.md b/deploy/README.md index ce8139a..7f73c0b 100644 --- a/deploy/README.md +++ b/deploy/README.md @@ -152,6 +152,7 @@ make envfile Open `/opt/purldb/.env` in a text editor and populate with this config: ``` +PURLDB_REQUIRE_AUTHENTICATION=False ALLOWED_HOSTS= SITE_URL=https:/// PURLDB_PUBLIC_SETUP=True @@ -164,6 +165,14 @@ sudo docker compose -f /opt/purldb/docker-compose.yml build sudo docker compose -f /opt/purldb/docker-compose.yml up -d ``` +> [!NOTE] +> By default `PURLDB_REQUIRE_AUTHENTICATION` is set to `True`, an authentication token is required to access the PurlDB API. +> +> Once PurlDB is up and running, generate an authentication token by running: +> ```bash +> sudo docker compose -f /opt/purldb/docker-compose.yml exec web ./manage.py create-user --generate-api-key +> ``` + Once completed, make sure that PurlDB is up and running. @@ -205,6 +214,8 @@ sudo vi /opt/scancodeio/.env Populate with this config: ``` +SCANCODEIO_REQUIRE_AUTHENTICATION=False + GRIMOIRELAB_URL="http://grimoirelab-nginx:8000/" GRIMOIRELAB_OPENSEARCH_URL="https://grimoirelab-opensearch:9200/" GRIMOIRELAB_ECOSYSTEM="npmlargerecosystem" @@ -229,6 +240,16 @@ GRIMOIRELAB_OPENSEARCH_USERNAME="" GRIMOIRELAB_OPENSEARCH_PASSWORD="" ``` + +> [!NOTE] +> By default, `SCANCODEIO_REQUIRE_AUTHENTICATION` is set to `True`, which means a username and password are required to log in to ScanCode.io. +> +> Once ScanCode.io is up and running, create a user using the following command: +> ```bash +> docker compose -f /opt/scancodeio/docker-compose.yml exec web ./manage.py scanpipe create-user +> ``` + + #### Expose ScanCode.io on port 8443 This is optional, and enables access to the ScanCode.io scan worker. @@ -335,7 +356,7 @@ docker compose -f /opt/healthycode/deploy/docker-compose/docker-compose-grimoire ## Enable authentication for ScanCode.io (Optional): -Add this to `/opt/scancodeio/.env` +Add/edit this to `/opt/scancodeio/.env` ``` SCANCODEIO_REQUIRE_AUTHENTICATION=True @@ -349,6 +370,24 @@ docker compose -f /opt/scancodeio/docker-compose.yml exec web ./manage.py scanpi Restart ScanCode.io service. + +## Enable authentication for PurlDB (Optional): + +Add/edit this to `/opt/purldb/.env` + +``` +PURLDB_REQUIRE_AUTHENTICATION=True +``` + +Run this command to generate auth token required to access PurlDB API: + +``` +sudo docker compose -f /opt/purldb/docker-compose.yml exec web ./manage.py create-user --generate-api-key +``` + +Restart PurlDB service. + + ## SSL/TLS Configuration Add `fullchain.pem` and `privkey.pem` for your host inside: