A Rust-based comment server using SQLite and an intuitive REST API.
USAGE:
soudan [OPTIONS] <SITES>...
soudan [OPTIONS] [CONFIG]
ARGS:
<SITES>... Set sites where comments will be posted
<CONFIG> Set configuration file [default: soudan.yaml]
OPTIONS:
-e, --email-required Require email for comment submissions
-h, --help Print help information
-n, --name-required Require name for comment submissions
-p, --port <PORT> Set port where HTTP requests will be received [default: 8080]
-t, --testing Run in testing mode, with in-memory database(s) and permissive CORS
policy
-V, --version Print version information
-h, --help Print help information
-p, --port <PORT> Set port where HTTP requests will be received [default: 8080]
-t, --testing Run in testing mode, with in-memory database(s) and permissive CORS policy
-V, --version Print version information
```
The sites must be prefixed with either `http://` or `https://`. Each site may only use one protocol, so the HTTP and HTTPS versions of each site are considered separate sites. You should redirect HTTPS to HTTP.
Soudan uses a YAML configuration file for most configuration options. By default, this configuration file is `soudan.yaml`, but you can override this by passing in the configuration file path to Soudan as an argument.
For example, to run Soudan on example.com and example.org on port 8081, use the following command. Each site will be stored completely separately, with its own database, `example.com.db` and `example.org.db`, respectively.
For example, to run Soudan on port 8081 with `test.yaml` as the configuration file, use the following command.
In addition, you can add the `-t`/`--testing` flag to run Soudan in testing mode. In this mode, Soudan stores all comments in a fresh in-memory database, and **all comments will be lost once Soudan is closed.** In addition, a permissive CORS policy is used to make testing easier.
Finally, you can also add the `-n`/`--name-required` and/or `-e`/`--email-required` flags to prevent anonymous comments. Keep in mind that the JavaScript in [soudan.js](demo/soudan.js) assumes that these flags are not set, so you would need to manually add the `required` flag to the name and email `<input>` fields respectively.
### Configuration file
### Moderation
Here’s an example configuration file:
```YAML
"localhost:3000":
file: databases/test.db
nameRequired: true
emailRequired: true
"localhost:5000": {}
```
Here, we have two sites, one hosted locally at port 3000 and one hosted locally at port 5000.
For the first site, we specify that we want the SQLite database file to be stored in `databases/test.db`, and we want the name and email fields of each comment to be required to prevent anonymous comments. (Keep in mind that the JavaScript in [soudan.js](demo/soudan.js) assumes that these flags are not set, so you would need to manually add the `required` flag to the name and email `<input>` fields respectively.)
For the second site, we can leave all the configuration fields as their defaults by giving an empty YAML object `{}`. If the database file path isn’t provided, it will default to the domain plus the `.db` extension, so in this case it will be `localhost:3000.db` in the current directory. Name and email are not required by default.
## Moderation
Soudan does not have any spam filtering or moderation built in. However, going into the database manually to browse and remove comments is very easy. If you need an SQLite database browser, I'd recommend [DB Browser for SQLite](https://sqlitebrowser.org/).