Skip to content

Commit

Permalink
Add configuration documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesaoverton committed Apr 25, 2024
1 parent e223d0b commit 4d06536
Showing 1 changed file with 71 additions and 0 deletions.
71 changes: 71 additions & 0 deletions doc/config.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
# Nanobot Configuration

You can configure Nanobot with the `nanobot.toml` file.
See <https://toml.io> for details on the syntax.

## Default Configuration

```toml
[nanobot]
config_version = 1
port = 3000
results_per_page = 20
```

## Full Configuration

```toml
[nanobot]
config_version = 1
port = 3000
results_per_page = 20

[logging]
level = "DEBUG" # ERROR, WARN, INFO (default), DEBUG

[database]
# Database connection string: SQLite file or Postgres URL.
connection = ".nanobot.db"

[valve]
# Path to the VALVE 'table' table.
path = "src/schema/table.tsv"

[assets]
# Path to a directory of static files to serve under <http://localhost:PORT/assets/>.
path = "assets/"

[templates]
# Path to a directory of [Minijinja](https://github.com/mitsuhiko/minijinja) templates.
path = "src/templates/"

# Entries for the "Actions" menu.
# `actions` is a TOML dictionary
# Each action requires a `label` and `command`.
[actions.status]
label = "Status"
command = "git status"

[actions.fetch]
label = "Fetch"
command = "git fetch"

[actions.pull]
label = "Pull"
command = "git pull"

[actions.branch]
label = "Branch"
# Actions can request inputs using an HTML form.
input = [
{ name = "branch_name", label = "Branch Name", default = "{username}-{number}", validate = "\\w+" }
]
# Actions can use a single command or a list of commands.
# Inputs can be used in commands with `{variable}` syntax.
commands = [
"git checkout main",
"git pull",
"git checkout --branch {branch_name}",
"git push --set-upstream origin {branch_name}",
]
```

0 comments on commit 4d06536

Please sign in to comment.