Skip to content

Commit 9154604

Browse files
committed
Update docs to include an migration guide and changes
1 parent e58545d commit 9154604

File tree

3 files changed

+62
-2
lines changed

3 files changed

+62
-2
lines changed

docs/dev-guide/index.rst

+1
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,4 @@ Rodhaj offers a developer guide so future developers can easily get started with
1010
intro
1111
contributing
1212
faq
13+
migrating-to-yaml

docs/dev-guide/intro.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,11 @@ Setup
5353
poetry install \
5454
&& poetry run pre-commit install
5555
56-
3. Copy over the ``.env`` template over to the ``bot`` directory. Modify the values as appropriate.
56+
3. Copy over the ``config-example.yml`` template over to the ``bot`` directory. Modify the values as appropriate.
5757

5858
.. code-block:: bash
5959
60-
cp envs/dev.env bot/.env
60+
cp config-example.yml bot/config.yml
6161
6262
4. Run the SQL migrations
6363

docs/dev-guide/migrating-to-yaml.rst

+59
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
=================
2+
Migrating to YAML
3+
=================
4+
5+
Rodhaj now uses an new config format, YAML.
6+
Previously, the project utilized an ENV file for configuration, but
7+
due to issues such as the inability for better structured data and others,
8+
the project has migrated to YAML.
9+
10+
The details of the motivation can be found in
11+
`PR #59 <https://github.com/transprogrammer/rodhaj/pull/59>`_.
12+
13+
.. note::
14+
15+
- ``*.yaml`` files are ignored and not read by the config loader. Ensure that your YAML file uses the ``*.yml`` file extension.
16+
- The config file is stored in the same location as the ``.env`` file. It will always be read under ``bot/config.yml``.
17+
18+
Changes
19+
=======
20+
21+
Grouped entries
22+
---------------
23+
24+
The bot token, and others are merged into one mapping. This mapping key is denoted
25+
by ``rodhaj``. Any and all configuration options in relation to the bot can be found
26+
under that mapping.
27+
28+
To illustrate, an example comparison of the old and new config format is shown below:
29+
30+
``.env``
31+
32+
.. code-block:: bash
33+
34+
TOKEN=...
35+
DEV_MODE=False
36+
37+
``config.yml``
38+
39+
.. code-block:: yaml
40+
41+
rodhaj:
42+
token: ...
43+
dev_mode: False # This key-value pair can also be removed to disable the dev mode feature
44+
45+
Rodhaj's Guild ID can now be set via the config
46+
-----------------------------------------------
47+
48+
Instead of hardcoding the Guild ID into the code, to allow for flexibity in development,
49+
the Guild ID can now be set via the config. This is acheived through the ``guild_id`` entry as illustrated.
50+
51+
.. code-block:: yaml
52+
53+
rodhaj:
54+
guild_id: 1234567890 # This ID is the guild that is associated with Rodhaj for operations
55+
56+
PostgreSQL Connection URI
57+
-------------------------
58+
59+
The PostgreSQL URI is mostly the same, but is now under the ``postgres_uri`` entry.

0 commit comments

Comments
 (0)