Overview
The purpose of this page is to list in detail each of the environment variables that are required to launch neosync services. There are three discrete services in Neosync, and each one has its own purpose. See the architecture section of the docs to understand more about the makeup of Neosync.
Backend API
These environment variables are loaded when running the mgmt serve connect
command which starts the main API instance.
Variable | Description | Is Required | Default Value |
---|---|---|---|
DB_HOST | The database host | true | |
DB_PORT | The port used to connect to the database | true | |
DB_NAME | The name of the database | true | |
DB_USER | The username that will be used to connect to the database | true | |
DB_PASS | The password that will be used by the DB_USER to connect to the database | true | |
DB_SSL_DISABLE | Postgres requires SSL by default. Set this to "true" to disable ssl, which is useful for dev environments | false | false |
DB_AUTO_MIGRATE | If true, will automatically run the database migrations prior to startup. Useful for dev environments or if you don't want to run a separate init container for the migrations. If true, must provide "DB_SCHEMA_DIR" | false | false |
DB_SCHEMA_DIR | The directory where the migrations scripts are found. Only loaded if DB_AUTO_MIGRATE is set to "true" | false | |
HOST | The host that will be used when binding the http server. Set this to "0.0.0.0" for production environments | false | 127.0.0.1 |
PORT | The port that will be used to bind the http server | false | 8080 |
NUCLEUS_ENV | The environmet that is being deployed to. Useful for metrics | false | unknown |
SHUTODWN_TIMEOUT_SECONDS | Configures the graceful shutdown of a pod in Kubernetes | false | |
LOGS_FORMAT_JSON | Whether or not to format logs in json or in plaintext to stdout | false | true |
AUTH_ENABLED | Whether or not to enable authentication in the API. Should be required for any production environment | false | false |
AUTH_BASEURL | The base url for the authentication server. This is used to find the JWKS url to validate JWT tokens | false | |
AUTH_AUDIENCE | The audience that is to be used for validating JWT tokens. This corresponds with the "aud" in a JWT token. Can pass multiple values using a comma separator | ||
AUTH_CLIENTID_SECRET | This is a JSON stringified map of clientId:secret that is used to validate authentication requests for JWT tokens. Used today to validate CLI login/refresh requests. | false | |
AUTH_CLI_AUDIENCE | Used to validate which audience the CLI is to use to make requests to the API server. The CLI requests this information from the backend before it logs in. If not provided, falls back to AUTH_AUDIENCE | false | |
TEMPORAL_URL | The url used to connect to the temporal instance | false | localhost:7233 |
TEMPORAL_CERT_KEY_PATH | The path on the filesystem where the API can find the mTLS certificate key it will use to authenticate against Temporal. This will be used over the TEMPORAL_CERT_KEY environment variable | false | |
TEMPORAL_CERT_PATH | The path on the filesystem where the API can find the mTLS certificate that will be used to authenticate against Temporal. This will be used over the TEMPORAL_CERT environment variable | false | |
TEMPORAL_CERT | The Temporal mTLS certificate contents. Use this if you want to load contents directly instead of mounting them to the filesystem | false | |
TEMPORAL_CERT_KEY | The Temporal mTLS certificate key contents. Use this if you want to load the contents directly instead of mounting them to the filesystem | false | |
TEMPORAL_DEFAULT_NAMESPACE | The default temporal namespace used for any new account | false | default |
TEMPORAL_DEFAULT_SYNCJOB_QUEUE | The default Temporal queue name for Neosync jobs | false | sync-job |
AUTH_API_CLIENT_ID | The clientID that the API uses to connect to Auth0 to retrieve user data. This is specifically used by the API and must have the proper scopes | false | |
AUTH_API_CLIENT_SECRET | The client secret that the API uses to connect to Auth0. | false | |
AUTH_API_BASEURL | The base url of the authentication server that is used for management operations by the API. This is a separate url from the AUTH_BASEURL, but generally will be the same value | false |
Backend API Database Migrations
These environment variables are loaded when running the mgmt migrate up
command which runs database migrations.
Variable | Description | Is Required | Default Value |
---|---|---|---|
DB_HOST | The database host | true | |
DB_PORT | The port used to connect to the database | true | |
DB_NAME | The name of the database | true | |
DB_USER | The username that will be used to connect to the database | true | |
DB_PASS | The password that will be used by the DB_USER to connect to the database | true | |
DB_SSL_DISABLE | Postgres requires SSL by default. Set this to "true" to disable ssl, which is useful for dev environments | false | false |
DB_SCHEMA_DIR | The directory where the migrations scripts are found. | false | |
DB_MIGRATIONS_TABLE | The name of the table where the migrations will be tracked. Useful if you want to override the default, or put into a different schema | false | |
DB_MIGRATIONS_TABLE_QUOTED | If the table set in DB_MIGRATIONS_TABLE contains quotes | false |
Frontend App
Variable | Description | Is Required | Default Value |
---|---|---|---|
AUTH_ENABLED | Whether or not to enable authentication in the App. Should be required for any production environment | false | false |
NEXTAUTH_URL | This the base url that the app will be accessible from. Note: this is not the base url for the auth service, but for the app itself. Required if AUTH_ENABLED is true | false | |
AUTH0_CLIENT_ID | The client id that will be used to authenticate via auth0. Required if AUTH_ENABLED is true | false | |
AUTH0_CLIENT_SECRET | The client secret that will be used to authenticate via auth0. Required if AUTH_ENABLED is true | false | |
AUTH0_ISSUER | The issuer url for auth0. This is typically the baseurl for the auth instance. Required if AUTH_ENABLED is true | false | |
AUTH0_SCOPE | The space separated list of scopes that will be requested when issuing an access token. Required if AUTH_ENABLED is true | false | |
AUTH0_AUDIENCE | The audience that will be used when requesting the access token. Required if AUTH_ENABLED is true | false | |
NEXT_PUBLIC_APP_BASE_URL | The url of the app. This is typically the same as NEXTAUTH_URL. Used for generating invite urls, among other things. This is not baked into the HTML or the image. | false |
Worker
These environment variables are loaded when running the worker serve
command which starts the main worker instance.
Variable | Description | Is Required | Default Value |
---|---|---|---|
HOST | The host that will be used when binding the http server. Set this to "0.0.0.0" for production environments | false | 127.0.0.1 |
PORT | The port that will be used to bind the http server | false | 8080 |
TEMPORAL_URL | The url used to connect to the temporal instance | false | localhost:7233 |
TEMPORAL_NAMESPACE | The Temporal namespace to connect to | false | default |
TEMPORAL_TASK_QUEUE | The Temporal task queue name to connect to for Neosync jobs | true | |
TEMPORAL_CERT_KEY_PATH | The path on the filesystem where the worker can find the mTLS certificate key it will use to authenticate against Temporal. This will be used over the TEMPORAL_CERT_KEY environment variable | false | |
TEMPORAL_CERT_PATH | The path on the filesystem where the worker can find the mTLS certificate that will be used to authenticate against Temporal. This will be used over the TEMPORAL_CERT environment variable | false | |
TEMPORAL_CERT | The Temporal mTLS certificate contents. Use this if you want to load contents directly instead of mounting them to the filesystem | false | |
TEMPORAL_CERT_KEY | The Temporal mTLS certificate key contents. Use this if you want to load the contents directly instead of mounting them to the filesystem | false | |
NEOSYNC_URL | The base url of the Neosync API that the worker will use to connect to | false | localhost:8080 |
NEOSYNC_API_KEY | The API key that will be provided as a bearer token in the Authentication header when making requests to the Neosync API | false |
CLI
There are some environment variables that the CLI accepts to override default behavior to accomodate different environments.
Variable | Description | Is Required | Default Value |
---|---|---|---|
NEOSYNC_API_URL | The base url of the Neosync API. This can be overridden to connect to different Neosync API environments | false | http://localhost:8080 |
NEOSYNC_API_KEY | The api key for Neosync API. | false | |
LOGIN_HOST | The http server that is booted up running neosync login via an oauth flow | false | 127.0.0.1 |
LOGIN_REDIRECT_HOST | The redirect host that is sent alongside the oauth flow when running neosync login | false | 127.0.0.1 |
LOGIN_PORT | The port the http server runs on when running neosync login | false | 4242 |
NEOSYNC_CONFIG_DIR | The config directory to store Neosync-specific credentials. For Linux users, $XDG_CONFIG_HOME is also respected. | false | ~/.neosync |