Skip to content

Commit

Permalink
update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
yohamta committed Jan 1, 2024
1 parent afce224 commit 9b8c973
Show file tree
Hide file tree
Showing 5 changed files with 59 additions and 1 deletion.
51 changes: 51 additions & 0 deletions docs/source/api_token.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
.. _API Token:

API Token
=====================

.. contents::
:local:

To enable API token for Dagu, follow these steps:

#. Set the environment variables to configure basic authentication:

.. code-block:: bash
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.

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

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

.. code-block:: bash
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 :ref:`Configuration Options` for more information on the configuration file.

#. 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.**

.. code-block:: bash
export DAGU_IS_BASICAUTH=1
export DAGU_USERNAME="<username>"
export DAGU_PASSWORD="<password>"
Replace ``<username>`` and ``<password>`` with your username and password.

See :ref:`Basic Auth` for more information on the basic authentication.

See :ref:`REST API` for more information on the REST API.
2 changes: 1 addition & 1 deletion docs/source/auth.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ To enable basic authentication for Dagu, follow these steps:
Replace ``<your-username>`` and ``<your-password>`` with your desired username and password.

#. Alternatively, create an ``admin.yaml`` file in the ``$DAGU_HOME`` directory (default: ``$HOME/.dagu/``) to override the default configuration values. Add the following lines under the ``# Basic Auth`` section:
#. Alternatively, create an ``admin.yaml`` file in the ``$DAGU_HOME`` directory (default: ``$HOME/.dagu/``) to override the default configuration values.

.. code-block:: yaml
Expand Down
4 changes: 4 additions & 0 deletions docs/source/config.rst
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,10 @@ You can create ``admin.yaml`` file in the ``$DAGU_HOME`` directory (default: ``$
basicAuthUsername: <username for basic auth of web UI> # basic auth user
basicAuthPassword: <password for basic auth of web UI> # basic auth password
# API Token
isAuthToken: <true|false> # enables API token
authToken: <token for API access> # API token
# Base Config
baseConfig: <base DAG config path> # default: ${DAGU_HOME}/config.yaml
Expand Down
1 change: 1 addition & 0 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ Contents
examples
config
auth
api_token
executors
email
scheduler
Expand Down
2 changes: 2 additions & 0 deletions docs/source/rest.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
.. _REST API:

REST API Docs
=============

Expand Down

0 comments on commit 9b8c973

Please sign in to comment.