Skip to content

Latest commit

 

History

History
117 lines (93 loc) · 5.57 KB

configuration-guide.md

File metadata and controls

117 lines (93 loc) · 5.57 KB

Configuration Guide

Zenflows is configured through basic POSIX-compliant shell scripts. When you run mann env.setup, it'll copy the example template, conf/.example-env.sh, to conf/env.sh. You can edit that file according to your needs. The available options are mentioned below.

All available options

The options here might seem a bit much, but it is to allow flexibility. Please also see the Required Options.

  • DB_HOST: The hostname or IP address of the database host. The default is localhost.

  • DB_PORT: The port number of the database host. The default is 5432. It must be an integer between 0 and 65535, inclusive.

  • DB_NAME: The database name of the database host. The default is zenflows if run in production mode; zenflows_dev in development mode; zenflows_test in testing mode.

  • DB_USER: The name of the user/role of the database host.

  • DB_PASS: The passphrane of the user/role of the database host.

  • DB_SOCK: The Unix socket path of the database daemon.

  • DB_URI: The URI connection string. The syntax is scheme://user:pass@host:port/dbname?key0=val0&key1=val1&keyN=valN, where:

    1. scheme is any valid scheme, such as db, a, foo or even http;

    2. user is the name of the user/role of teh database host.

    3. pass is the passphrane of the user/role of the database host.

    4. host is the hostname or IP address of the database host.

    5. port is the port number of the database host.

    6. key0=val0, key1=val1, and keyN=valN query strings are additional, adapter-related options, such as ssl=true and timeout=10000. The list of additional options can be viewed at the PostgreSQL Adapter docs.

      This option should be used if extended configuration is desired (using the options mention in the link above).

  • ROOM_URI: The URI of the Restroom instance. Defaults to http://localhost:3000.

  • ROOM_SALT: The base64-encoded salt to be used with Restroom's keypairoomServer call.

  • DID_URI: The URI of the DID controller instance. Defaults to https://did.dyne.org.

  • DID_KEYRING: Keyring (identity) of the server, it is not defined communication with DID controller is disabled.

  • DID_SPEC: Spec of the newly created dids.

  • DID_SIGNER_SPEC: Spec of the signer did.

  • DID_IDENTITY: Message inside the identity field in the did.

  • ADMIN_KEY: A 64-octect long, lowercase-base16-encoded string used for the authenticating calls from the administrators. Can be generated with openssl rand -hex 64. It is automatically generated when you run mann env.setup.

  • GQL_AUTH_CALLS: Boolean value. It enables the authentication with restroom (each gql request has to be signed). Defaults to true.

  • GQL_DEF_PAGE_SIZE: A non-negative integer. It is used for the default GraphQL page size if the client doesn't provide one.

  • GQL_MAX_PAGE_SIZE: A non-negative integer. It is used for the maximum GraphQL page size if client provides a too-large value. It must be greater than GQL_DEF_PAGE_SIZE.

  • EMAIL_ADDR: The email address used for sending emails to users. It will appear in the From: field of a message.

  • EMAIL_KEY: The Sendgrid API key used for authentication.

  • EMAIL_EXPIRY: The expiry time of a token that is used for recovery/validation links in emails. It is in seconds, and the default is 4 days worth of seconds. It can't be less than a second.

Required Options

Some of the options on how to connect to the database and the Restroom intance are required, along with ADMIN_KEY that is used authenticating admin calls.

For the emails, you'll need to provide both EMAIL_ADDR and EMAIL_KEY as well.

For the Restroom instance, you only need the ROOM_SALT option.

About the database, there are only 2 things you need to setup: how to connect to the database host, and what credentials to use.

To specify what credentials to use, you must set DB_USER and DB_PASS variables accordingly.

To specify how to connect to the database host, you have 3 options:

  • Setting only DB_HOST and DB_PORT. This is the most masic one, and what most people will use. You don't even need to set up any of these, as these have the default values of localhost and 5432.
  • Setting only DB_SOCK. This is to allow people to use Unix sockets.
  • Setting only DB_URI. This is to allow people to provide additional options. It is basically setting DB_HOST and DB_PORT in the same variable, plus additional options (that is, you can't use Unix sockets with this option). These options are mutually-exclusive and the order of precedence is DB_URI > DB_SOCK > DB_HOST and DB_PORT.