Skip to main content

CLI Configuration

ServerConfigData

This is the configuration JSON structure for the CLI tool

Fields

FieldTypeRequiredDescription
apiAPIConfigYesDocbox API configuration
databaseAdminDatabaseConfigurationYesDatabase configuration
secretsSecretsManagerConfigYesSecrets manager configuration
searchSearchIndexFactoryConfigYesSearch configuration
storageStorageLayerFactoryConfigYesSearch configuration

JSON Example

{
"api": {
// See section docs...
},
"database": {
// See section docs...
},
"secrets": {
// See section docs...
},
"search": {
// See section docs...
},
"storage": {
// See section docs...
}
}

JSON Example (AWS)

{
"api": {
"url": "http://<YOUR DOCBOX SERVER IP AND PORT>",
"api_key": "..."
},
"database": {
"host": "<YOUR DATABASE HOST>",
"port": 5432,
"root_secret_name": "postgres/docbox/config",
"setup_user_secret_name": "docbox-setup-user"
},
"secrets": {
"provider": "aws",
},
"search": {
"provider": "typesense",
"url": "http://<YOUR TYPESENSE SERVER IP AND PORT>",
"api_key_secret_name": "typesense/credentials/docbox"
},
"storage": {
"provider": "s3",
"endpoint": {
"type": "aws"
}
}
}

APIConfig

The API configuration is JSON object which specifies the details of the docbox server being operated on

Fields

FieldTypeRequiredDescription
urlstringYesHTTP(s) URL of the docbox server
api_keystringNoOptional API key if the docbox server is configured to use one

JSON Example (AWS Official)

Example using the AWS secret manager with the official endpoint

{
"url": "http://localhost:8080",
"api_key": "..."
}

AdminDatabaseConfiguration

The database setup user is a high privilege database user with permission to manage databases. This high privilege account is required to perform root and tenant setup actions.

Fields

FieldTypeRequiredDescription
hoststringYesDatabase host
portnumber (Port)YesDatabase port
root_secret_namestringNoSecret name for a secret manager secret that should contain the root database setup (It's recommended you name this postgres/docbox/config if you are using the provided AWS infra scripts to ensure correct access policies)
setup_user_secret_namestringNoSecret name for a secret manager secret that contains a AdminDatabaseSetupUserConfig (Recommended over setup_user if hosting on AWS)
setup_userAdminDatabaseSetupUserConfigNoSetup user if not using a secret to store the user details
important

Must specify either setup_user_secret_name or setup_user

JSON Example (Setup User Secret)

{
"host": "localhost",
"port": 5432,
"root_secret_name": "postgres/docbox/config",
"setup_user_secret_name": "docbox-setup-user"
}

JSON Example (Setup User Inline)

{
"host": "localhost",
"port": 5432,
"root_secret_name": "postgres/docbox/config",
"setup_user": {
"username": "...",
"password": "..."
}
}

AdminDatabaseSetupUserConfig

The database setup user is a high privilege database user with permission to manage databases. This high privilege account is required to perform root and tenant setup actions.

Fields

FieldTypeRequiredDescription
username (or user)stringYesDatabase user username
passwordstringYesDatabase user password

JSON Example

{
"username": "...",
"password": "..."
}

SecretsManagerConfig

Secrets Manager Configuration - This section describes the secret manager configuration options.

The secrets manager configuration is a JSON object with a required provider field that determines which backend is used.

Fields

FieldTypeRequiredDescription
providerSecretsManagerConfigProviderYesThe secret manager provider to use

SecretsManagerConfigProvider

provider valueStructureDescription
"aws" (Default)AwsSecretManagerConfigAWS Secret Manager (or compatible alternative e.g Loker)
"memory"UndocumentedIn-memory only secret manager for testing

JSON Example (AWS Official)

Example using the AWS secret manager with the official endpoint

{
"provider": "aws",
}

JSON Example (AWS Custom)

Example using the AWS secret manager with a custom endpoint

{
"provider": "aws",
"endpoint": {
"type": "custom",
"endpoint": "https://localhost:9090",
"access_key_id": "...",
"access_key_secret": "..."
}
}

AwsSecretManagerConfig

Configuration for the AWS compatible secret manager

Fields

FieldTypeRequiredDescription
endpointAwsSecretsEndpointNoThe secret manager endpoint to use

AwsSecretsEndpoint

AWS secret manager endpoint configuration

Fields

FieldTypeRequiredDescription
typeAwsSecretsEndpointTypeYesThe type of secrets endpoint to use

JSON Example (AWS)

{ 
"type": "aws",
}

JSON Example (Custom)

{ 
"type": "custom",
"endpoint": "https://localhost:9090",
"access_key_id": "...",
"access_key_secret": "..."
}

AwsSecretsEndpointType

Available endpoints for AwsSecretsEndpoint

type valueStructureDescription
"aws" (Default)No additional fieldsAWS official secrets endpoint
"custom"CustomAwsSecretEndpointCustom AWS secrets manager endpoint for compatible alternative servers

CustomAwsSecretEndpoint

Custom endpoint configuration AWS secret manager

Fields

FieldTypeRequiredDescription
endpointstring (URL)YesURL of the secret manager endpoint
access_key_idstringYesAccess key ID for accessing the secret manager
access_key_secretstringYesAccess key secret for accessing the secret manager

SearchIndexFactoryConfig

Fields

FieldTypeRequiredDescription
providerSearchIndexFactoryConfigProviderYesThe search provider to use

SearchIndexFactoryConfigProvider

provider valueStructureDescription
"typesense"TypesenseSearchConfigSearch backed by a Typesense compatible server
"open_search"OpenSearchConfigSearch backed by an OpenSearch compatible server
"database"No additional configurationDatabase backed searching

JSON Example (Typesense)

Example using the AWS secret manager with the official endpoint

{
"provider": "typesense",
"url": "http://localhost:8000",
"api_key_secret_name": "typesense/credentials/docbox"
}

JSON Example (OpenSearch)

Example using the AWS secret manager with the official endpoint

{
"provider": "open_search",
"url": "http://localhost:8000"
}

JSON Example (Database)

Example using the AWS secret manager with the official endpoint

{
"provider": "database"
}

TypesenseSearchConfig

Fields

FieldTypeRequiredDescription
urlstring (URL)YesURL for the typesense server
api_key_secret_namestringNoName of the secret manager secret containing the typesense API key, the secret should contain the value directly (Ensure the docbox server has permission to access this secret, it's recommended you name this typesense/credentials/docbox if you are using the official AWS infra)
api_keystringNoAPI key if not using api_key_secret_name to store the API key
important

Must specify either api_key_secret_name or api_key

JSON Example (Secret)

Example using the AWS secret manager with the official endpoint

{
"url": "http://localhost:8000",
"api_key_secret_name": "typesense/credentials/docbox"
}

JSON Example (Inline)

Example using the AWS secret manager with the official endpoint

{
"url": "http://localhost:8000",
"api_key": "..."
}

OpenSearchConfig

Fields

FieldTypeRequiredDescription
urlstring (URL)YesURL of the OpenSearch server

JSON Example

Example using the AWS secret manager with the official endpoint

{
"url": "http://localhost:8000"
}

StorageLayerFactoryConfig

Fields

FieldTypeRequiredDescription
providerStorageLayerFactoryConfigProviderYesThe storage provider to use

StorageLayerFactoryConfigProvider

provider valueStructureDescription
"s3" (Default)S3StorageLayerFactoryConfigStorage backed by S3 or a S3 compatible provider

JSON Example (AWS Official)

Example using the AWS secret manager with the official endpoint

{
"provider": "s3",
"endpoint": {
"type": "aws"
}
}

JSON Example (AWS Custom)

Example using the AWS secret manager with a custom endpoint

{
"provider": "s3",
"endpoint": {
"type": "custom",
"endpoint": "https://storage:9090",
"external_endpoint": "https://localhost:9090",
"access_key_id": "...",
"access_key_secret": "..."
}
}

S3StorageLayerFactoryConfig

Fields

FieldTypeRequiredDescription
endpointS3EndpointNoEndpoint to use for S3 requests

S3Endpoint

FieldTypeRequiredDescription
typeS3EndpointTypeNoType of endpoint to use

S3EndpointType

Available endpoints for S3Endpoint

type valueStructureDescription
"aws" (Default)No additional fieldsAWS official S3 endpoint
"custom"S3CustomEndpointCustom S3 endpoint for compatible alternative servers

JSON Example (AWS Official)

{
"type": "aws"
}

JSON Example (AWS Custom)

Example using the AWS secret manager with a custom endpoint

{
"type": "custom",
"endpoint": "https://storage:9090",
"access_key_id": "...",
"access_key_secret": "..."
}

S3CustomEndpoint

Custom endpoint configuration for S3

Fields

FieldTypeRequiredDescription
endpointstring (URL)YesURL of the S3 endpoint
external_endpointstring (URL)NoOptional external facing URL for the S3 endpoint, required for system behind docker where the public facing S3 endpoint URL is different to the one that the server should use (For presigned URLs)
access_key_idstringYesAccess key ID for accessing the S3 server
access_key_secretstringYesAccess key secret for accessing the S3 server

JSON Example

Example using the AWS secret manager with a custom endpoint

{
"type": "custom",
"endpoint": "https://storage:9090",
"external_endpoint": "https://localhost:9090",
"access_key_id": "...",
"access_key_secret": "..."
}