API Token

To enable API token for DAGU, follow these steps:

  1. Set the environment variables to configure basic authentication:

    export DAGU_IS_AUTHTOKEN=1
    export DAGU_AUTHTOKEN="<arbitrary token string>"

    Replace <arbitrary token string> with a random string of your choice. This string will be used as the API token for DAGU.

  2. Alternatively, create an admin.yaml file in the $DAGU_HOME directory (default: $HOME/.dagu/) to override the default configuration values.

    # API Token
    isAuthToken: true
    authToken: "<arbitrary token string>"
  3. You can enable HTTPS by configuring the following environment variables:

    export DAGU_CERT_FILE="<path-to-cert-file>"
    export DAGU_KEY_FILE="<path-to-key-file>"

    Replace <path-to-cert-file> and <path-to-key-file> with the paths to your certificate and key files.

    See Configurations for more information on the configuration file.

  4. Enable Basic Authentication as well if you want to use the Web UI along with the API token. Without basic authentication config, you will not be able to access the Web UI.

    export DAGU_IS_BASICAUTH=1
    export DAGU_BASICAUTH_USERNAME="<username>"
    export DAGU_BASICAUTH_PASSWORD="<password>"

    Replace <username> and <password> with your username and password.

    See Basic Authentication for more information on the basic authentication.

    See REST API Docs for more information on the REST API.