### Configure Database Initialization Source: https://github.com/datalens-tech/datalens/blob/main/_autodocs/deployment-configuration.md Controls automatic database setup and extension installation during deployment. ```bash INIT_DEMO_DATA=1 # Initialize with demo data INIT_DB_DEMO=1 # Setup demo database INIT_DB_AUTH=1 # Setup auth database INIT_DB_META_MANAGER=1 # Setup meta-manager database INIT_DB_TEMPORAL=1 # Setup temporal database INIT_EXTERNAL_POSTGRES=0 # Using external PostgreSQL SKIP_INSTALL_DB_EXTENSIONS=1 # Skip automatic extension installation ``` -------------------------------- ### Crypto Utility Execution Example Source: https://github.com/datalens-tech/datalens/blob/main/_autodocs/initialization-scripts.md Example command and output for encrypting a database password. ```bash $ python postgres/crypto.py "your-fernet-key-base64" "database-password" gAAAAABlI7c0...encrypted-value-base64... ``` -------------------------------- ### Pre-deployment Hook Source: https://github.com/datalens-tech/datalens/blob/main/_autodocs/initialization-scripts.md Placeholder for custom setup commands executed before the docker compose stack starts. ```bash # Add custom setup before docker compose up ``` -------------------------------- ### Troubleshooting Dependency Installation Source: https://github.com/datalens-tech/datalens/blob/main/_autodocs/utility-tools.md Commands to inspect or reset the dependency hash file when installation issues occur. ```bash # Check hash file docker exec cat node_modules/.docker-entry.hash # Force reinstall docker exec rm node_modules/.docker-entry.hash docker exec npm install ``` -------------------------------- ### Install Dependencies for pretty-log.py Source: https://github.com/datalens-tech/datalens/blob/main/_autodocs/initialization-scripts.md Install the required rich library to enable color-coded log formatting. ```bash pip install rich ``` -------------------------------- ### Install Cryptography Dependencies Source: https://github.com/datalens-tech/datalens/blob/main/_autodocs/initialization-scripts.md Command to install the required cryptography library for the crypto utility. ```bash pip install cryptography ``` -------------------------------- ### Run Development Configuration Source: https://github.com/datalens-tech/datalens/blob/main/_autodocs/configuration-reference.md Command to start the application using both production and development override files. ```bash docker compose -f docker-compose.yaml -f docker-compose.dev.yaml up ``` -------------------------------- ### Example Generated .env File Source: https://github.com/datalens-tech/datalens/blob/main/_autodocs/initialization-scripts.md Sample configuration file generated by the initialization script containing database, auth, and service settings. ```bash # PostgreSQL POSTGRES_HOST=postgres POSTGRES_PORT=5432 POSTGRES_USER=pg-user POSTGRES_PASSWORD=GeneratedSecurePassword123 # Auth Service AUTH_ADMIN_PASSWORD=GeneratedAdminPassword456 AUTH_TOKEN_PRIVATE_KEY=-----BEGIN RSA PRIVATE KEY----- ... -----END RSA PRIVATE KEY----- AUTH_TOKEN_PUBLIC_KEY=-----BEGIN PUBLIC KEY----- ... -----END PUBLIC KEY----- # United Storage US_MASTER_TOKEN=us-master-token-abc123xyz # Control API CONTROL_API_CRYPTO_KEY=ZGF0YWxlbnN1bnNlY3VyZWZlcm5ldGNyeXB0b2tleQo= # Features HC=1 YANDEX_MAP_ENABLED=0 # Ports UI_PORT=8080 ``` -------------------------------- ### Integration Examples Source: https://github.com/datalens-tech/datalens/blob/main/_autodocs/utility-tools.md Common patterns for tailing, filtering, and saving formatted logs. ```bash docker compose logs -f | python dev/python/pretty-log.py docker compose logs -f control-api | python dev/python/pretty-log.py docker compose logs | python dev/python/pretty-log.py > formatted-logs.txt # Terminal 1 docker compose logs -f ui | python dev/python/pretty-log.py # Terminal 2 (trigger activity) curl http://localhost:8080/api/dashboards docker compose logs | grep -i error | python dev/python/pretty-log.py # or docker compose logs | python dev/python/pretty-log.py | grep ERROR ``` -------------------------------- ### Enable Automatic PostgreSQL Extension Installation Source: https://github.com/datalens-tech/datalens/blob/main/README.md Enable automatic installation of required PostgreSQL extensions by setting SKIP_INSTALL_DB_EXTENSIONS=0 in the .env file. DataLens will attempt to install these extensions on startup if they are missing. ```bash # .env file example SKIP_INSTALL_DB_EXTENSIONS=0 ``` -------------------------------- ### Deploy DataLens with Helm Chart Source: https://github.com/datalens-tech/datalens/blob/main/README.md Install DataLens in a Kubernetes cluster using the Helm chart. This involves generating RSA keys for authentication services and then performing a Helm upgrade or install. ```bash # generating rsa keys for auth service and temporal AUTH_TOKEN_PRIVATE_KEY=$(openssl genpkey -algorithm RSA -pkeyopt "rsa_keygen_bits:4096" 2>/dev/null) AUTH_TOKEN_PUBLIC_KEY=$(echo "${AUTH_TOKEN_PRIVATE_KEY}" | openssl rsa -pubout 2>/dev/null) TEMPORAL_AUTH_PRIVATE_KEY=$(openssl genpkey -algorithm RSA -pkeyopt "rsa_keygen_bits:4096" 2>/dev/null) TEMPORAL_AUTH_PUBLIC_KEY=$(echo "${TEMPORAL_AUTH_PRIVATE_KEY}" | openssl rsa -pubout 2>/dev/null) BI_DYNAMIC_US_AUTH_PRIVATE_KEY=$(openssl genpkey -algorithm RSA -pkeyopt "rsa_keygen_bits:4096" 2>/dev/null) BI_DYNAMIC_US_AUTH_PUBLIC_KEY=$(echo "${BI_DYNAMIC_US_AUTH_PRIVATE_KEY}" | openssl rsa -pubout 2>/dev/null) UI_DYNAMIC_US_AUTH_PRIVATE_KEY=$(openssl genpkey -algorithm RSA -pkeyopt "rsa_keygen_bits:4096" 2>/dev/null) UI_DYNAMIC_US_AUTH_PUBLIC_KEY=$(echo "${UI_DYNAMIC_US_AUTH_PRIVATE_KEY}" | openssl rsa -pubout 2>/dev/null) helm upgrade --install datalens oci://ghcr.io/datalens-tech/helm/datalens \ --namespace datalens --create-namespace \ --set "secrets.AUTH_TOKEN_PRIVATE_KEY=${AUTH_TOKEN_PRIVATE_KEY}" \ --set "secrets.AUTH_TOKEN_PUBLIC_KEY=${AUTH_TOKEN_PUBLIC_KEY}" \ --set "secrets.TEMPORAL_AUTH_PRIVATE_KEY=${TEMPORAL_AUTH_PRIVATE_KEY}" \ --set "secrets.TEMPORAL_AUTH_PUBLIC_KEY=${TEMPORAL_AUTH_PUBLIC_KEY}" \ --set "secrets.BI_DYNAMIC_US_AUTH_PRIVATE_KEY=${BI_DYNAMIC_US_AUTH_PRIVATE_KEY}" \ --set "secrets.BI_DYNAMIC_US_AUTH_PUBLIC_KEY=${BI_DYNAMIC_US_AUTH_PUBLIC_KEY}" \ --set "secrets.UI_DYNAMIC_US_AUTH_PRIVATE_KEY=${UI_DYNAMIC_US_AUTH_PRIVATE_KEY}" \ --set "secrets.UI_DYNAMIC_US_AUTH_PUBLIC_KEY=${UI_DYNAMIC_US_AUTH_PUBLIC_KEY}" ``` -------------------------------- ### Deploy with Let's Encrypt Certificate Source: https://github.com/datalens-tech/datalens/blob/main/_autodocs/deployment-patterns.md References production certificate files and starts the service using the production compose file. ```bash export HTTPS_CERT=$(cat /etc/letsencrypt/live/datalens.company.com/fullchain.pem) export HTTPS_KEY=$(cat /etc/letsencrypt/live/datalens.company.com/privkey.pem) docker compose -f docker-compose.production.yaml up -d ``` -------------------------------- ### Usage Examples for pretty-log.py Source: https://github.com/datalens-tech/datalens/blob/main/_autodocs/initialization-scripts.md Commands for processing logs from docker containers or local files. ```bash # Format logs from docker container docker compose logs ui | python dev/python/pretty-log.py # Real-time log streaming docker compose logs -f control-api | python dev/python/pretty-log.py # Process log file python dev/python/pretty-log.py < combined-logs.json ``` -------------------------------- ### Production Environment Variables Source: https://github.com/datalens-tech/datalens/blob/main/_autodocs/deployment-patterns.md Example configuration for production environment variables including security, database, and service-specific settings. ```bash # Security AUTH_ADMIN_PASSWORD=YourSecurePassword123 AUTH_TOKEN_PRIVATE_KEY= AUTH_TOKEN_PUBLIC_KEY= TEMPORAL_AUTH_PRIVATE_KEY= TEMPORAL_AUTH_PUBLIC_KEY= # Database POSTGRES_HOST=postgres.internal.company.com POSTGRES_PORT=5432 POSTGRES_USER=datalens POSTGRES_PASSWORD=SecureDbPassword456 POSTGRES_MAX_CONNECTIONS=512 # US Service US_MASTER_TOKEN=us-master-token-abc123xyz US_DYNAMIC_AUTH_PRIVATE_KEY= # Control API CONTROL_API_CRYPTO_KEY= DL_CRY_ACTUAL_KEY_ID=KEY # Connector Configuration CONNECTOR_AVAILABILITY_VISIBLE=clickhouse,postgres,mysql,snowflake,trino # Maps and Visualizations HC=1 YANDEX_MAP_ENABLED=0 # Port Configuration UI_PORT=8080 ``` -------------------------------- ### Manually Install PostgreSQL Extensions Source: https://github.com/datalens-tech/datalens/blob/main/README.md Install necessary PostgreSQL extensions for DataLens metadata database if automatic installation is disabled or fails. These extensions are required for DataLens to function correctly. ```sql CREATE EXTENSION IF NOT EXISTS pg_trgm; CREATE EXTENSION IF NOT EXISTS btree_gin; CREATE EXTENSION IF NOT EXISTS btree_gist; CREATE EXTENSION IF NOT EXISTS "uuid-ossp"; ``` -------------------------------- ### Dockerfile Entrypoint Configuration Source: https://github.com/datalens-tech/datalens/blob/main/_autodocs/initialization-scripts.md Example usage of the Node.js development entry script within a Dockerfile. ```dockerfile COPY . /app WORKDIR /app ENTRYPOINT ["node", "dev/nodejs/dev-entry.js"] ``` -------------------------------- ### Minimal Development Configuration Source: https://github.com/datalens-tech/datalens/blob/main/_autodocs/configuration-reference.md Basic environment variables for local development setup without external integrations. ```bash # .env for development POSTGRES_HOST=postgres POSTGRES_USER=pg-user POSTGRES_PASSWORD=password AUTH_TYPE=NATIVE AUTH_ADMIN_PASSWORD=admin HC=0 YANDEX_MAP_ENABLED=0 UI_PORT=8080 ``` -------------------------------- ### Configure Verbose Logging Source: https://github.com/datalens-tech/datalens/blob/main/_autodocs/utility-tools.md Example of setting environment variables for log verbosity. ```bash VERBOSE_LOGS=1 docker compose logs ui | python dev/python/pretty-log.py ``` -------------------------------- ### Install DataLens Helm Chart Source: https://github.com/datalens-tech/datalens/blob/main/_autodocs/deployment-patterns.md Deploys the DataLens Helm chart with required authentication secrets and ingress configuration. ```bash helm upgrade --install datalens oci://ghcr.io/datalens-tech/helm/datalens \ --namespace datalens \ --create-namespace \ --set "secrets.AUTH_TOKEN_PRIVATE_KEY=${AUTH_TOKEN_PRIVATE_KEY}" \ --set "secrets.AUTH_TOKEN_PUBLIC_KEY=${AUTH_TOKEN_PUBLIC_KEY}" \ --set "secrets.TEMPORAL_AUTH_PRIVATE_KEY=${TEMPORAL_AUTH_PRIVATE_KEY}" \ --set "secrets.TEMPORAL_AUTH_PUBLIC_KEY=${TEMPORAL_AUTH_PUBLIC_KEY}" \ --set "secrets.BI_DYNAMIC_US_AUTH_PRIVATE_KEY=${BI_DYNAMIC_US_AUTH_PRIVATE_KEY}" \ --set "secrets.BI_DYNAMIC_US_AUTH_PUBLIC_KEY=${BI_DYNAMIC_US_AUTH_PUBLIC_KEY}" \ --set "secrets.UI_DYNAMIC_US_AUTH_PRIVATE_KEY=${UI_DYNAMIC_US_AUTH_PRIVATE_KEY}" \ --set "secrets.UI_DYNAMIC_US_AUTH_PUBLIC_KEY=${UI_DYNAMIC_US_AUTH_PUBLIC_KEY}" \ --set "ingress.enabled=true" \ --set "ingress.host=datalens.company.com" ``` -------------------------------- ### Configure Multiple UI Instances Source: https://github.com/datalens-tech/datalens/blob/main/_autodocs/deployment-patterns.md Docker Compose setup for running multiple UI instances behind an Nginx load balancer. ```yaml services: ui-1: image: ghcr.io/datalens-tech/datalens-ui:0.3831.0 environment: - UI_PORT=8080 networks: - default ui-2: image: ghcr.io/datalens-tech/datalens-ui:0.3831.0 environment: - UI_PORT=8080 networks: - default ui-3: image: ghcr.io/datalens-tech/datalens-ui:0.3831.0 environment: - UI_PORT=8080 networks: - default nginx: image: nginx:latest ports: - "8080:8080" volumes: - ./nginx.conf:/etc/nginx/nginx.conf:ro depends_on: - ui-1 - ui-2 - ui-3 ``` -------------------------------- ### Helm Chart Configuration Values Source: https://github.com/datalens-tech/datalens/blob/main/_autodocs/deployment-patterns.md Example YAML configuration for customizing replicas, resource limits, PostgreSQL persistence, and ingress settings. ```yaml # Replica counts ui: replicas: 3 controlApi: replicas: 2 dataApi: replicas: 2 # Resource requests/limits resources: requests: memory: "512Mi" cpu: "250m" limits: memory: "1Gi" cpu: "1000m" # PostgreSQL configuration postgresql: enabled: true persistence: size: 50Gi # Ingress ingress: enabled: true host: datalens.company.com tls: enabled: true ``` -------------------------------- ### Run DataLens with Docker Compose Source: https://github.com/datalens-tech/datalens/blob/main/README.md Start all necessary DataLens containers using Docker Compose. The UI will be accessible at http://localhost:8080 with default credentials. ```bash HC=1 docker compose up ``` -------------------------------- ### Post-deployment Hook Source: https://github.com/datalens-tech/datalens/blob/main/_autodocs/initialization-scripts.md Placeholder for custom setup commands executed after the docker compose stack is running. ```bash # Add custom setup after docker compose up ``` -------------------------------- ### Deploy DataLens Locally Source: https://github.com/datalens-tech/datalens/blob/main/_autodocs/README.md Starts the DataLens services in a local Docker environment with health checks enabled. ```bash cd datalens HC=1 docker compose up ``` -------------------------------- ### Check Required Extensions Source: https://github.com/datalens-tech/datalens/blob/main/_autodocs/initialization-scripts.md Query the database to ensure all necessary PostgreSQL extensions are installed. ```bash docker exec datalens-postgres psql -U pg-user -d pg-us-db \ -c "SELECT extname FROM pg_extension;" ``` -------------------------------- ### Example Log Output Format Source: https://github.com/datalens-tech/datalens/blob/main/_autodocs/initialization-scripts.md The structured output format produced by the pretty-log.py utility. ```text [14:35:42.123] INFO (1234) ui/renderer: Rendering dashboard req_id: 550e8400-e29b-41d4-a716-446655440000 location: func=renderDashboard line=42 ``` -------------------------------- ### GET /api/v1/datasources Source: https://github.com/datalens-tech/datalens/blob/main/_autodocs/services-overview.md Retrieves a list of all available datasources configured in the system. ```APIDOC ## GET /api/v1/datasources ### Description List all available datasources. ### Method GET ### Endpoint /api/v1/datasources ``` -------------------------------- ### Deploy with Self-Signed Certificate Source: https://github.com/datalens-tech/datalens/blob/main/_autodocs/deployment-patterns.md Exports certificate contents as environment variables before starting the containers. ```bash # Update reverse proxy with certificate export HTTPS_CERT=$(cat cert.pem) export HTTPS_KEY=$(cat key.pem) docker compose up -d ``` -------------------------------- ### Complete Initialization Sequence Source: https://github.com/datalens-tech/datalens/blob/main/_autodocs/utility-tools.md Demonstrates a full initialization workflow using the utility functions. ```bash #!/bin/bash set -e source postgres/utils.sh # Wait for database to start wait_for_postgres postgres 5432 # Create extension create_extension_if_not_exists "pg-us-db" "pg_trgm" # Execute schema execute_sql_file "pg-us-db" "schema/us-schema.sql" execute_sql_file "pg-us-db" "schema/us-indexes.sql" echo "Initialization complete" ``` -------------------------------- ### Verify PostgreSQL Extensions Source: https://github.com/datalens-tech/datalens/blob/main/_autodocs/deployment-patterns.md Ensures required PostgreSQL extensions are installed on the target database. ```bash psql -h postgres.example.com -U admin -d postgres -c \ "CREATE EXTENSION IF NOT EXISTS pg_trgm; CREATE EXTENSION IF NOT EXISTS btree_gin; CREATE EXTENSION IF NOT EXISTS btree_gist; CREATE EXTENSION IF NOT EXISTS \"uuid-ossp\";" ``` -------------------------------- ### Troubleshoot Service Startup Failures Source: https://github.com/datalens-tech/datalens/blob/main/_autodocs/deployment-patterns.md Use these commands to inspect logs, verify database connectivity, and check port status when a service fails to initialize. ```bash # Check logs docker compose logs control-api # Verify database connectivity docker exec control-api python -c "import psycopg2; psycopg2.connect(...)" # Check port availability netstat -tlnp | grep :8084 ``` -------------------------------- ### Common init.sh usage patterns Source: https://github.com/datalens-tech/datalens/blob/main/_autodocs/initialization-scripts.md Various command-line configurations for deploying DataLens with different features and environments. ```bash ./init.sh --hc --up ``` ```bash ./init.sh --hc --up # Stores secrets in .env file ``` ```bash ./init.sh --domain example.com --https --up ``` ```bash ./init.sh --postgres-external --up ``` ```bash ./init.sh --dev --dev-ui --dev-backend --up ``` ```bash ./init.sh --disable-auth --up ``` -------------------------------- ### Initialize Auth Database Source: https://github.com/datalens-tech/datalens/blob/main/_autodocs/initialization-scripts.md Sets up the authentication service database schema and creates a default admin user. ```bash export AUTH_ADMIN_PASSWORD="SecurePassword123" bash postgres/init-db-auth.sh ``` -------------------------------- ### Basic init.sh usage Source: https://github.com/datalens-tech/datalens/blob/main/_autodocs/initialization-scripts.md General syntax for executing the initialization script with flags and commands. ```bash ./init.sh [flags] [--up | --down | --stop] ``` -------------------------------- ### GET /api/v2/objects/search Source: https://github.com/datalens-tech/datalens/blob/main/_autodocs/api-endpoints.md Searches for objects based on query parameters. ```APIDOC ## GET /api/v2/objects/search ### Description Searches for objects matching the provided criteria. ### Method GET ### Endpoint /api/v2/objects/search ### Parameters #### Query Parameters - **q** (string) - Optional - Search query (name, description) - **type** (string) - Optional - Filter by type (dashboard, chart, dataset, connection) - **parentId** (uuid) - Optional - Filter by collection - **page** (integer) - Optional - Page number (default: 1) - **pageSize** (integer) - Optional - Items per page (default: 20) ### Response #### Success Response (200) - **results** (array) - List of matching objects - **total** (integer) - Total count - **page** (integer) - Current page - **pageSize** (integer) - Items per page ``` -------------------------------- ### GET /api/v1/auth/user Source: https://github.com/datalens-tech/datalens/blob/main/_autodocs/api-endpoints.md Retrieves details for the currently authenticated user. ```APIDOC ## GET /api/v1/auth/user ### Description Fetches profile information for the authenticated user. ### Method GET ### Endpoint /api/v1/auth/user ### Response #### Success Response (200) - **id** (string) - User ID - **username** (string) - Username - **email** (string) - Email address - **displayName** (string) - Display name - **roles** (array) - User roles - **createdAt** (string) - Account creation timestamp - **lastLoginAt** (string) - Last login timestamp #### Response Example { "id": "uuid", "username": "admin", "email": "admin@example.com", "displayName": "Administrator", "roles": ["datalens.admin"], "createdAt": "2024-01-01T00:00:00Z", "lastLoginAt": "2024-08-26T12:34:56Z" } ``` -------------------------------- ### GET /api/v1/queries/:id/result Source: https://github.com/datalens-tech/datalens/blob/main/_autodocs/services-overview.md Retrieves the results of a completed query. ```APIDOC ## GET /api/v1/queries/:id/result ### Description Get query results. ### Method GET ### Endpoint /api/v1/queries/:id/result ### Parameters #### Path Parameters - **id** (string) - Required - The unique identifier of the query. ``` -------------------------------- ### Check Initialization Logs Source: https://github.com/datalens-tech/datalens/blob/main/_autodocs/initialization-scripts.md View logs for core services to identify startup errors. ```bash docker compose logs postgres docker compose logs temporal docker compose logs control-api ``` -------------------------------- ### GET /api/v1/import/{jobId}/status Source: https://github.com/datalens-tech/datalens/blob/main/_autodocs/api-endpoints.md Retrieves the status of an import job. ```APIDOC ## GET /api/v1/import/{jobId}/status ### Description Checks the status and details of an import job. ### Method GET ### Endpoint /api/v1/import/{jobId}/status ### Parameters #### Path Parameters - **jobId** (string) - Required - The UUID of the import job ### Response #### Success Response (200) - **jobId** (string) - Import job UUID - **status** (string) - Job status - **objectCount** (integer) - Total objects processed - **importedObjects** (array) - List of imported objects - **createdAt** (string) - Creation timestamp - **completedAt** (string) - Completion timestamp #### Response Example { "jobId": "import-job-uuid", "status": "completed", "objectCount": 12, "importedObjects": [ {"id": "dashboard-uuid", "name": "Sales Dashboard", "type": "dashboard", "status": "success"} ], "createdAt": "2024-08-26T15:35:00Z", "completedAt": "2024-08-26T15:40:00Z" } ``` -------------------------------- ### Initialize Local Development Environment Source: https://github.com/datalens-tech/datalens/blob/main/_autodocs/deployment-patterns.md Clones necessary repositories and initializes the development environment using the provided script. ```bash # Clone all required repositories git clone https://github.com/datalens-tech/datalens.git git clone https://github.com/datalens-tech/datalens-ui.git git clone https://github.com/datalens-tech/datalens-backend.git # ... other repositories # Configure docker-compose.dev.yaml with volumes ./init.sh --dev --dev-ui --dev-backend --up ``` -------------------------------- ### Verify Database Creation Source: https://github.com/datalens-tech/datalens/blob/main/_autodocs/initialization-scripts.md List existing databases to confirm the initialization script successfully created the required schema. ```bash docker exec datalens-postgres psql -U pg-user -l ``` -------------------------------- ### GET /api/v1/export/{jobId}/download Source: https://github.com/datalens-tech/datalens/blob/main/_autodocs/api-endpoints.md Downloads the exported workbook file. ```APIDOC ## GET /api/v1/export/{jobId}/download ### Description Downloads the binary file associated with a completed export job. ### Method GET ### Endpoint /api/v1/export/{jobId}/download ### Parameters #### Path Parameters - **jobId** (string) - Required - The UUID of the export job ### Response #### Success Response (200) - Binary file content ``` -------------------------------- ### GET /api/v1/export/{jobId}/status Source: https://github.com/datalens-tech/datalens/blob/main/_autodocs/api-endpoints.md Retrieves the status of an export job. ```APIDOC ## GET /api/v1/export/{jobId}/status ### Description Checks the status of an export job and provides a download URL if completed. ### Method GET ### Endpoint /api/v1/export/{jobId}/status ### Parameters #### Path Parameters - **jobId** (string) - Required - The UUID of the export job ### Response #### Success Response (200) - **jobId** (string) - Export job UUID - **status** (string) - Job status - **downloadUrl** (string) - URL to download the exported file - **fileSize** (integer) - Size of the file in bytes - **createdAt** (string) - Creation timestamp - **completedAt** (string) - Completion timestamp #### Response Example { "jobId": "export-job-uuid", "status": "completed", "downloadUrl": "/api/v1/export/export-job-uuid/download", "fileSize": 524288, "createdAt": "2024-08-26T15:30:00Z", "completedAt": "2024-08-26T15:35:00Z" } ``` -------------------------------- ### Deploy DataLens to Production Source: https://github.com/datalens-tech/datalens/blob/main/_autodocs/README.md Initializes the production environment and displays the generated environment secrets. ```bash ./init.sh --hc --up cat .env # Save secrets ``` -------------------------------- ### Create Custom Initialization Script Source: https://github.com/datalens-tech/datalens/blob/main/_autodocs/utility-tools.md Template for initializing PostgreSQL extensions and schemas. Requires the postgres/utils.sh utility script to be present. ```bash #!/bin/bash set -eo pipefail source postgres/utils.sh # Wait for PostgreSQL wait_for_postgres ${POSTGRES_HOST:-postgres} ${POSTGRES_PORT:-5432} # Create extensions create_extension_if_not_exists "${POSTGRES_DB_US}" "pg_trgm" create_extension_if_not_exists "${POSTGRES_DB_US}" "btree_gin" # Execute custom schema execute_sql_file "${POSTGRES_DB_US}" "custom-schema.sql" echo "Initialization complete" ``` ```bash docker exec datalens-postgres bash -c "cd /setup && bash init-custom.sh" ``` -------------------------------- ### GET /api/v2/collections/{collectionId}/contents Source: https://github.com/datalens-tech/datalens/blob/main/_autodocs/api-endpoints.md Retrieves the contents of a specific collection. ```APIDOC ## GET /api/v2/collections/{collectionId}/contents ### Description Retrieves the contents of a specific collection. ### Method GET ### Endpoint /api/v2/collections/{collectionId}/contents ### Parameters #### Path Parameters - **collectionId** (string) - Required - The collection ID. #### Query Parameters - **type** (string) - Optional - Filter by object type. - **page** (integer) - Optional - Page number. - **pageSize** (integer) - Optional - Items per page. ### Response #### Success Response (200) - **items** (array) - List of items in the collection. - **total** (integer) - Total count. - **page** (integer) - Current page. - **pageSize** (integer) - Page size. ``` -------------------------------- ### GET /api/v2/collections Source: https://github.com/datalens-tech/datalens/blob/main/_autodocs/api-endpoints.md Lists collections, optionally filtered by parent ID. ```APIDOC ## GET /api/v2/collections ### Description Lists collections, optionally filtered by parent ID. ### Method GET ### Endpoint /api/v2/collections ### Parameters #### Query Parameters - **parentId** (uuid) - Optional - Parent collection ID. - **page** (integer) - Optional - Page number. ### Response #### Success Response (200) - **collections** (array) - List of collections. - **total** (integer) - Total count. - **page** (integer) - Current page. ``` -------------------------------- ### Initialize External PostgreSQL with SSL Source: https://github.com/datalens-tech/datalens/blob/main/_autodocs/deployment-configuration.md Configures the deployment to use custom SSL certificates for external PostgreSQL connections. ```bash ./init.sh --postgres-external --postgres-ssl --postgres-cert ./ca.pem --up ``` -------------------------------- ### GET /api/v2/objects/{objectId} Source: https://github.com/datalens-tech/datalens/blob/main/_autodocs/api-endpoints.md Retrieves details for a specific object by its ID. ```APIDOC ## GET /api/v2/objects/{objectId} ### Description Fetches the full details of an object using its unique identifier. ### Method GET ### Endpoint /api/v2/objects/{objectId} ### Parameters #### Path Parameters - **objectId** (string) - Required - The unique identifier of the object ### Response #### Success Response (200) - **id** (string) - Object UUID - **name** (string) - Object name - **type** (string) - Object type - **description** (string) - Object description - **parentId** (string) - Parent collection UUID - **ownerId** (string) - Owner UUID - **createdAt** (string) - Creation timestamp - **updatedAt** (string) - Last update timestamp - **version** (integer) - Object version - **data** (object) - Object data #### Response Example { "id": "dashboard-uuid", "name": "Sales Dashboard", "type": "dashboard", "description": "Company sales metrics", "parentId": "collection-uuid", "ownerId": "user-uuid", "createdAt": "2024-08-26T14:30:00Z", "updatedAt": "2024-08-26T14:30:00Z", "version": 1, "data": {} } ``` -------------------------------- ### GET /api/healthz Source: https://github.com/datalens-tech/datalens/blob/main/_autodocs/api-endpoints.md Checks the health status and version of the DataLens service. ```APIDOC ## GET /api/healthz ### Description Returns the current health status and version of the service. ### Method GET ### Endpoint /api/healthz ### Response #### Success Response (200) - **status** (string) - Service status - **version** (string) - Service version #### Response Example { "status": "ok", "version": "0.3831.0" } ``` -------------------------------- ### Initialize Custom Domain with HTTPS Source: https://github.com/datalens-tech/datalens/blob/main/_autodocs/deployment-configuration.md Configures a custom domain and enables HTTPS via the initialization script. ```bash ./init.sh --domain example.com --https --up ``` -------------------------------- ### Get Current User Source: https://github.com/datalens-tech/datalens/blob/main/_autodocs/api-endpoints.md Retrieve profile information for the authenticated user. ```http GET /api/v1/auth/user ``` ```json { "id": "uuid", "username": "admin", "email": "admin@example.com", "displayName": "Administrator", "roles": ["datalens.admin"], "createdAt": "2024-01-01T00:00:00Z", "lastLoginAt": "2024-08-26T12:34:56Z" } ``` -------------------------------- ### GET /api/v1/queries/:id/status Source: https://github.com/datalens-tech/datalens/blob/main/_autodocs/services-overview.md Checks the status of a specific query execution. ```APIDOC ## GET /api/v1/queries/:id/status ### Description Query status. ### Method GET ### Endpoint /api/v1/queries/:id/status ### Parameters #### Path Parameters - **id** (string) - Required - The unique identifier of the query. ``` -------------------------------- ### Configure Database Initialization Flags Source: https://github.com/datalens-tech/datalens/blob/main/_autodocs/configuration-reference.md Environment variables used to control database initialization and external service integration during startup. ```bash INIT_DEMO_DATA=1 # Load demo data (0/1) INIT_DB_DEMO=1 # Initialize demo database (0/1) INIT_DB_AUTH=1 # Initialize auth database (0/1) INIT_DB_META_MANAGER=1 # Initialize meta-manager database (0/1) INIT_DB_TEMPORAL=1 # Initialize temporal database (0/1) INIT_EXTERNAL_POSTGRES=0 # Using external PostgreSQL (0/1) SKIP_INSTALL_DB_EXTENSIONS=1 # Skip extension installation (0/1) ``` -------------------------------- ### GET /api/v1/datasets/:id Source: https://github.com/datalens-tech/datalens/blob/main/_autodocs/services-overview.md Retrieves metadata for a specific dataset by its ID. ```APIDOC ## GET /api/v1/datasets/:id ### Description Get dataset metadata. ### Method GET ### Endpoint /api/v1/datasets/:id ### Parameters #### Path Parameters - **id** (string) - Required - The unique identifier of the dataset. ``` -------------------------------- ### Minimal Local Deployment Source: https://github.com/datalens-tech/datalens/blob/main/_autodocs/deployment-patterns.md Initializes the local environment using Docker Compose with default demo data. ```bash git clone https://github.com/datalens-tech/datalens.git cd datalens # Quick start with default demo data HC=1 docker compose up # Access UI at http://localhost:8080 # Default credentials: admin / admin ``` -------------------------------- ### Get Import Status Endpoint Source: https://github.com/datalens-tech/datalens/blob/main/_autodocs/api-endpoints.md Retrieves the status and details of an import job. ```http GET /api/v1/import/{jobId}/status ``` ```json { "jobId": "import-job-uuid", "status": "completed", "objectCount": 12, "importedObjects": [ { "id": "dashboard-uuid", "name": "Sales Dashboard", "type": "dashboard", "status": "success" } ], "createdAt": "2024-08-26T15:35:00Z", "completedAt": "2024-08-26T15:40:00Z" } ``` -------------------------------- ### GET /api/v2/permissions/{objectId} Source: https://github.com/datalens-tech/datalens/blob/main/_autodocs/api-endpoints.md Retrieves the list of permissions associated with a specific object. ```APIDOC ## GET /api/v2/permissions/{objectId} ### Description Retrieves the list of permissions associated with a specific object. ### Method GET ### Endpoint /api/v2/permissions/{objectId} ### Parameters #### Path Parameters - **objectId** (string) - Required - The unique identifier of the object. ### Response #### Success Response (200) - **objectId** (string) - The object identifier. - **permissions** (array) - List of permission objects. #### Response Example { "objectId": "dashboard-uuid", "permissions": [ { "id": "permission-uuid", "principalId": "user-uuid", "principalType": "user", "permissionType": "read", "createdAt": "2024-08-26T14:30:00Z", "createdBy": "admin-uuid" } ] } ``` -------------------------------- ### Get Collection Contents Source: https://github.com/datalens-tech/datalens/blob/main/_autodocs/api-endpoints.md Fetches the items contained within a specific collection. ```http GET /api/v2/collections/{collectionId}/contents ``` ```json { "items": [ { "id": "dashboard-uuid", "name": "Sales Dashboard", "type": "dashboard", "createdAt": "2024-08-26T14:30:00Z" }, { "id": "chart-uuid", "name": "Revenue Chart", "type": "chart", "createdAt": "2024-08-26T14:35:00Z" } ], "total": 2, "page": 1, "pageSize": 50 } ``` -------------------------------- ### Configure PostgreSQL with Custom SSL Certificate Source: https://github.com/datalens-tech/datalens/blob/main/_autodocs/deployment-patterns.md Initializes DataLens with external PostgreSQL using a custom CA certificate for SSL. ```bash ./init.sh \ --postgres-external \ --postgres-ssl \ --postgres-cert /path/to/ca-certificate.pem \ --up ``` -------------------------------- ### GET /api/v2/objects/{objectId}/revisions Source: https://github.com/datalens-tech/datalens/blob/main/_autodocs/api-endpoints.md Retrieves the revision history for a specific object. ```APIDOC ## GET /api/v2/objects/{objectId}/revisions ### Description Lists all revisions associated with a specific object. ### Method GET ### Endpoint /api/v2/objects/{objectId}/revisions ### Parameters #### Path Parameters - **objectId** (string) - Required - The unique identifier of the object #### Query Parameters - **page** (integer) - Optional - Page number (default: 1) - **pageSize** (integer) - Optional - Items per page (default: 10) ### Response #### Success Response (200) - **revisions** (array) - List of revisions - **total** (integer) - Total count - **page** (integer) - Current page ``` -------------------------------- ### Get Object Endpoint Source: https://github.com/datalens-tech/datalens/blob/main/_autodocs/api-endpoints.md Retrieve details of a specific object by its unique identifier. ```http GET /api/v2/objects/{objectId} ``` ```json { "id": "dashboard-uuid", "name": "Sales Dashboard", "type": "dashboard", "description": "Company sales metrics", "parentId": "collection-uuid", "ownerId": "user-uuid", "createdAt": "2024-08-26T14:30:00Z", "updatedAt": "2024-08-26T14:30:00Z", "version": 1, "data": {} } ``` -------------------------------- ### GET /api/v1/users Source: https://github.com/datalens-tech/datalens/blob/main/_autodocs/api-endpoints.md Retrieves a paginated list of users. This endpoint is restricted to administrators. ```APIDOC ## GET /api/v1/users ### Description Retrieves a paginated list of users. This endpoint is restricted to administrators. ### Method GET ### Endpoint /api/v1/users ### Parameters #### Query Parameters - **page** (integer) - Optional - Page number (1-based, default: 1) - **pageSize** (integer) - Optional - Items per page (default: 20) - **search** (string) - Optional - Search by username or email - **role** (string) - Optional - Filter by role (viewer, editor, admin) ### Response #### Success Response (200) - **users** (array) - List of user objects - **total** (integer) - Total count of users - **page** (integer) - Current page number - **pageSize** (integer) - Items per page #### Response Example { "users": [ { "id": "uuid", "username": "john_doe", "email": "john@example.com", "displayName": "John Doe", "roles": ["datalens.viewer"], "isActive": true, "createdAt": "2024-01-15T10:00:00Z" } ], "total": 42, "page": 1, "pageSize": 20 } ``` -------------------------------- ### Configure Backup Settings Source: https://github.com/datalens-tech/datalens/blob/main/_autodocs/configuration-reference.md Sets the backup schedule, retention period, and storage location. ```bash # Backup schedule BACKUP_ENABLED=false BACKUP_SCHEDULE="0 2 * * *" # 2 AM daily # Retention BACKUP_RETENTION_DAYS=30 BACKUP_LOCATION=/backups ``` -------------------------------- ### Inspect environment configuration Source: https://github.com/datalens-tech/datalens/blob/main/_autodocs/README.md Display the current environment variables for services. ```bash docker compose config | grep -A 20 environment: ``` -------------------------------- ### Process Spawning Implementation Source: https://github.com/datalens-tech/datalens/blob/main/_autodocs/utility-tools.md Spawns the development process using the configured command with inherited stdio. ```javascript const appProcess = spawn(process.env.RUN_DEV || DEV_CMD, { stdio: 'inherit', shell: true, }); ``` -------------------------------- ### Get Query Status Endpoint Source: https://github.com/datalens-tech/datalens/blob/main/_autodocs/api-endpoints.md Retrieves the current status of a specific query execution. ```http GET /api/v1/queries/{queryId}/status ``` ```json { "queryId": "query-uuid", "status": "completed", "progress": 100, "rowCount": 150, "executionTimeMs": 234 } ``` -------------------------------- ### Enable Yandex Maps with init.sh Script Source: https://github.com/datalens-tech/datalens/blob/main/README.md Alternatively, use the init.sh script to enable Yandex Maps and set the API token, then launch the containers with the --up flag. ```bash ./init.sh --yandex-map --yandex-map-token XXXXXXXXX --up ``` -------------------------------- ### Get Object Permissions Source: https://github.com/datalens-tech/datalens/blob/main/_autodocs/api-endpoints.md Retrieves a list of permissions associated with a specific object ID. ```http GET /api/v2/permissions/{objectId} ``` ```json { "objectId": "dashboard-uuid", "permissions": [ { "id": "permission-uuid", "principalId": "user-uuid", "principalType": "user", "permissionType": "read", "createdAt": "2024-08-26T14:30:00Z", "createdBy": "admin-uuid" }, { "id": "permission-uuid", "principalId": "group-uuid", "principalType": "group", "permissionType": "write", "createdAt": "2024-08-26T14:35:00Z" } ] } ``` -------------------------------- ### Configure Authentication Methods Source: https://github.com/datalens-tech/datalens/blob/main/_autodocs/configuration-reference.md Specifies the authentication provider and associated connection parameters. ```bash # Native (default) AUTH_TYPE=NATIVE # LDAP integration AUTH_TYPE=LDAP LDAP_SERVER=ldap.company.com LDAP_PORT=389 LDAP_SEARCH_BASE=cn=users,dc=company,dc=com LDAP_SEARCH_FILTER=(&(objectClass=person)(uid={0})) # OAuth2 AUTH_TYPE=OAUTH OAUTH_PROVIDER=google # or: github, azure, custom OAUTH_CLIENT_ID=... OAUTH_CLIENT_SECRET=... OAUTH_REDIRECT_URI=https://datalens.company.com/callback # SAML AUTH_TYPE=SAML SAML_IDP_URL=https://idp.company.com SAML_CERT_PATH=/etc/ssl/certs/saml-cert.pem ``` -------------------------------- ### Configure Database Scaling Source: https://github.com/datalens-tech/datalens/blob/main/_autodocs/deployment-patterns.md Settings for utilizing external PostgreSQL, read replicas, and PgBouncer connection pooling. ```bash # Use external managed PostgreSQL ./init.sh --postgres-external --up # Enable read replicas for reports export POSTGRES_READ_REPLICA=postgres-replica.example.com # Use connection pooling (PgBouncer) export PGBOUNCER_ENABLED=true export PGBOUNCER_POOL_MODE=transaction ``` -------------------------------- ### Get Object Revisions Endpoint Source: https://github.com/datalens-tech/datalens/blob/main/_autodocs/api-endpoints.md Retrieve a paginated list of revisions for a specific object. ```http GET /api/v2/objects/{objectId}/revisions ``` ```json { "revisions": [ { "id": "revision-uuid", "revisionNumber": 2, "createdAt": "2024-08-26T15:00:00Z", "authorId": "user-uuid", "description": "Updated dashboard layout" }, { "id": "revision-uuid", "revisionNumber": 1, "createdAt": "2024-08-26T14:30:00Z", "authorId": "user-uuid", "description": "Initial creation" } ], "total": 2, "page": 1 } ``` -------------------------------- ### Reset to Clean State Source: https://github.com/datalens-tech/datalens/blob/main/_autodocs/initialization-scripts.md Remove all existing containers and volumes, then re-run the initialization script. ```bash # Remove all containers and volumes docker compose down -v # Regenerate configuration ./init.sh --hc --up ``` -------------------------------- ### Configure CPU Limits Source: https://github.com/datalens-tech/datalens/blob/main/_autodocs/configuration-reference.md Set CPU resource constraints for individual services in Docker or Kubernetes environments. ```bash # CPU limits (Docker/K8s) UI_CPU_LIMIT=1 CONTROL_API_CPU_LIMIT=2 DATA_API_CPU_LIMIT=2 US_CPU_LIMIT=1 POSTGRES_CPU_LIMIT=4 ``` -------------------------------- ### GET /api/v1/users/{userId} Source: https://github.com/datalens-tech/datalens/blob/main/_autodocs/api-endpoints.md Retrieves details for a specific user by ID. This endpoint is restricted to administrators. ```APIDOC ## GET /api/v1/users/{userId} ### Description Retrieves details for a specific user by ID. This endpoint is restricted to administrators. ### Method GET ### Endpoint /api/v1/users/{userId} ### Parameters #### Path Parameters - **userId** (string) - Required - The ID of the user ### Response #### Success Response (200) - **id** (string) - User ID - **username** (string) - Username - **email** (string) - Email address - **displayName** (string) - Display name - **roles** (array) - User roles - **isActive** (boolean) - Active status - **createdAt** (string) - Creation timestamp - **updatedAt** (string) - Last update timestamp - **lastLoginAt** (string) - Last login timestamp #### Response Example { "id": "uuid", "username": "jane_smith", "email": "jane@example.com", "displayName": "Jane Smith", "roles": ["datalens.editor"], "isActive": true, "createdAt": "2024-01-15T10:00:00Z", "updatedAt": "2024-08-26T12:00:00Z", "lastLoginAt": "2024-08-26T09:15:00Z" } ``` -------------------------------- ### Restore Database from Backup Source: https://github.com/datalens-tech/datalens/blob/main/_autodocs/utility-tools.md Commands for importing a database from a SQL file or compressed gzip archive. ```bash bash postgres/us-restore.sh < backup.sql ``` ```bash gunzip < backup.sql.gz | bash postgres/us-restore.sh ``` -------------------------------- ### Get User by ID Endpoint Source: https://github.com/datalens-tech/datalens/blob/main/_autodocs/api-endpoints.md Retrieves details for a specific user by ID. Requires admin privileges. ```http GET /api/v1/users/{userId} ``` ```json { "id": "uuid", "username": "jane_smith", "email": "jane@example.com", "displayName": "Jane Smith", "roles": ["datalens.editor"], "isActive": true, "createdAt": "2024-01-15T10:00:00Z", "updatedAt": "2024-08-26T12:00:00Z", "lastLoginAt": "2024-08-26T09:15:00Z" } ``` -------------------------------- ### Get Object Revision History Source: https://github.com/datalens-tech/datalens/blob/main/_autodocs/database-schema.md Fetch the revision history for a specific object, ordered by the most recent revision. ```sql SELECT revision_number, author_id, description, created_at FROM object_revisions WHERE object_id = 'dashboard-uuid' ORDER BY revision_number DESC; ``` -------------------------------- ### Use External PostgreSQL Source: https://github.com/datalens-tech/datalens/blob/main/_autodocs/README.md Configures the deployment to connect to an existing external PostgreSQL database instance. ```bash ./init.sh --postgres-external --up ``` -------------------------------- ### Lock File Monitoring Source: https://github.com/datalens-tech/datalens/blob/main/_autodocs/utility-tools.md Demonstrates how modifying dependencies triggers the automatic reinstallation process. ```bash # In container, modify package.json or lock file npm install new-package # dev-entry.js detects change and reinstalls ``` -------------------------------- ### Test database connection Source: https://github.com/datalens-tech/datalens/blob/main/_autodocs/README.md Attempt to connect to the database using psql. ```bash psql -h localhost -U pg-user -d pg-us-db ``` -------------------------------- ### Get Export Status Endpoint Source: https://github.com/datalens-tech/datalens/blob/main/_autodocs/api-endpoints.md Checks the status of an export job and retrieves the download URL upon completion. ```http GET /api/v1/export/{jobId}/status ``` ```json { "jobId": "export-job-uuid", "status": "completed", "downloadUrl": "/api/v1/export/export-job-uuid/download", "fileSize": 524288, "createdAt": "2024-08-26T15:30:00Z", "completedAt": "2024-08-26T15:35:00Z" } ``` -------------------------------- ### Define configuration in .env file Source: https://github.com/datalens-tech/datalens/blob/main/_autodocs/configuration-reference.md Use a .env file for persistent configuration, supporting comments and multi-line values like RSA keys. ```bash # Comments use # POSTGRES_HOST=localhost POSTGRES_PORT=5432 POSTGRES_USER=pg-user # Multi-line values (RSA keys) AUTH_TOKEN_PRIVATE_KEY=-----BEGIN PRIVATE KEY----- MIIEvwIBADANBgkqhkiG9w0BAQEFAASCBKkwggSlAgEAAoIBAQC/t8SWhHjhZ9wY ... -----END PRIVATE KEY----- ``` -------------------------------- ### Configure Metrics and Tracing Source: https://github.com/datalens-tech/datalens/blob/main/_autodocs/configuration-reference.md Enable Prometheus metrics collection and distributed tracing settings. ```bash METRICS_ENABLED=true METRICS_PORT=9090 # Prometheus metrics port METRICS_PATH=/metrics TRACING_ENABLED=false # Distributed tracing TRACING_SAMPLE_RATE=0.1 # 10% sampling ``` -------------------------------- ### Configure External PostgreSQL Database Source: https://github.com/datalens-tech/datalens/blob/main/_autodocs/deployment-configuration.md Sets environment variables for an external database and initializes the project without the local PostgreSQL container. ```bash # Set environment variables export POSTGRES_HOST=db.example.com export POSTGRES_PORT=5432 export POSTGRES_USER=pguser export POSTGRES_PASSWORD=pgpass # Generate configuration without postgres container ./init.sh --postgres-external --up ``` -------------------------------- ### Execute SQL File Utility Source: https://github.com/datalens-tech/datalens/blob/main/_autodocs/initialization-scripts.md Executes a specified SQL file against a target database. ```bash source postgres/utils.sh execute_sql_file "pg-us-db" "init-schema.sql" ``` -------------------------------- ### Verify PostgreSQL readiness Source: https://github.com/datalens-tech/datalens/blob/main/_autodocs/README.md Check if the PostgreSQL database is ready to accept connections. ```bash docker exec datalens-postgres pg_isready ``` -------------------------------- ### Update DataLens Installation Source: https://github.com/datalens-tech/datalens/blob/main/README.md To update DataLens, pull the latest git repository and restart the containers. This process preserves user settings, connections, and created objects. ```bash git pull # if you use base compose file docker compose up # if you use init.sh script ./init.sh --up ``` -------------------------------- ### Configure UI Port Source: https://github.com/datalens-tech/datalens/blob/main/_autodocs/deployment-configuration.md Sets the port for the UI service. ```bash UI_PORT=8080 # UI service port ``` -------------------------------- ### Set PostgreSQL Connection SSL Mode Source: https://github.com/datalens-tech/datalens/blob/main/README.md Modify the POSTGRES_ARGS variable in the .env file to 'sslmode=prefer' if containers fail to start even with correct certificates. This adjusts the SSL connection behavior. ```bash # .env file example POSTGRES_ARGS="?sslmode=prefer" ``` -------------------------------- ### Configure Database Environment Variables Source: https://github.com/datalens-tech/datalens/blob/main/_autodocs/utility-tools.md Required environment variables for database connection settings. ```bash POSTGRES_HOST=localhost POSTGRES_PORT=5432 POSTGRES_USER=pg-user POSTGRES_PASSWORD=password POSTGRES_DB_US=pg-us-db ``` -------------------------------- ### Run DataLens on a Custom UI Port Source: https://github.com/datalens-tech/datalens/blob/main/README.md To use a different port for the DataLens UI, set the UI_PORT environment variable before running the docker compose up command. For example, to use port 8081. ```bash UI_PORT=8081 docker compose up ```