Skip to content

Commit 291487e

Browse files
authored
Merge pull request #309 from Rustmail/308-documentation
docs: add mdBook documentation site
2 parents 1eeb439 + ff8908a commit 291487e

26 files changed

Lines changed: 5045 additions & 122 deletions

.github/workflows/docs.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Deploy Documentation
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
paths:
8+
- 'docs/**'
9+
- '.github/workflows/docs.yml'
10+
workflow_dispatch:
11+
12+
jobs:
13+
build-and-deploy:
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- name: Checkout code
18+
uses: actions/checkout@v4
19+
20+
- name: Setup mdBook
21+
uses: peaceiris/actions-mdbook@v2
22+
with:
23+
mdbook-version: 'latest'
24+
25+
- name: Build documentation
26+
run: mdbook build docs
27+
28+
- name: Setup SSH
29+
uses: webfactory/ssh-agent@v0.9.0
30+
with:
31+
ssh-private-key: ${{ secrets.SSH_KEY }}
32+
33+
- name: Add known hosts
34+
run: ssh-keyscan -H rustmail.rs >> ~/.ssh/known_hosts
35+
36+
- name: Deploy to server via rsync
37+
run: |
38+
rsync -avz --delete book/ ubuntu@rustmail.rs:/var/www/rustmail_docs/

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,5 @@ node_modules
99
package-lock.json
1010
bin
1111
rustmail/static
12-
rustmail_panel/dist
12+
rustmail_panel/dist
13+
/book/

.run/Run.run.xml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<component name="ProjectRunConfigurationManager">
2+
<configuration default="false" name="Run" type="CargoCommandRunConfiguration" factoryName="Cargo Command" nameIsGenerated="true">
3+
<option name="buildProfileId" value="dev" />
4+
<option name="command" value="run -p rustmail" />
5+
<option name="workingDirectory" value="file://$PROJECT_DIR$" />
6+
<envs>
7+
<env name="RUSTFLAGS" value="--cfg tokio_unstable" />
8+
</envs>
9+
<option name="emulateTerminal" value="true" />
10+
<option name="channel" value="DEFAULT" />
11+
<option name="requiredFeatures" value="true" />
12+
<option name="allFeatures" value="false" />
13+
<option name="withSudo" value="false" />
14+
<option name="buildTarget" value="REMOTE" />
15+
<option name="backtrace" value="SHORT" />
16+
<option name="isRedirectInput" value="false" />
17+
<option name="redirectInputPath" value="" />
18+
<method v="2">
19+
<option name="ToolBeforeRunTask" enabled="true" actionId="Tool_External Tools_trunk" />
20+
<option name="CARGO.BUILD_TASK_PROVIDER" enabled="true" />
21+
</method>
22+
</configuration>
23+
</component>

README.md

Lines changed: 63 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,86 @@
1-
[discord-shield]: https://img.shields.io/discord/1407300551686885418?color=5865F2&logo=discord&logoColor=white
1+
<p align="center">
2+
<img src="https://github.com/Rustmail/rustmail/blob/main/docs/static/logo.svg?raw=true" width="200" alt="Rustmail">
3+
</p>
24

3-
[discord-invite]: https://discord.gg/9Bzma6SwtW
5+
<h1 align="center">Rustmail</h1>
46

5-
<div align="center">
6-
<img src="https://github.com/Akinator31/rustmail/blob/main/docs/static/logo.svg?raw=true" width="250" alt="Rustmail Logo">
7-
</div>
7+
<p align="center">
8+
A modern Discord modmail bot written in Rust
9+
</p>
810

9-
# Rustmail - Discord Modmail Bot (Rust)
10-
11-
[ ![discord-shield][] ][discord-invite]
11+
<p align="center">
12+
<a href="https://discord.gg/9Bzma6SwtW"><img src="https://img.shields.io/discord/1407300551686885418?color=5865F2&logo=discord&logoColor=white&label=Discord" alt="Discord"></a>
13+
<a href="https://github.com/Rustmail/rustmail/releases"><img src="https://img.shields.io/github/v/release/Rustmail/rustmail?label=Release" alt="Release"></a>
14+
<a href="https://github.com/Rustmail/rustmail/blob/main/LICENSE"><img src="https://img.shields.io/github/license/Rustmail/rustmail?label=License" alt="License"></a>
15+
</p>
1216

1317
---
14-
A Discord modmail bot written in Rust that allows staff to manage support tickets via channels, with features like
15-
message editing, internationalization, structured error handling, and more.
16-
The bot can operate in single-server or dual-server modes, supports SQLite for data storage, and offers a range of
17-
commands for staff to interact with users efficiently.
18+
19+
## Overview
20+
21+
Rustmail is a Discord modmail bot that enables staff teams to manage support tickets through private channels. Users
22+
send direct messages to the bot, which creates dedicated channels for staff to respond and track conversations.
23+
24+
### Key Features
25+
26+
- **Dual-server or single-server mode** - Separate community and staff servers, or run everything on one server
27+
- **Web administration panel** - Manage tickets, configuration, and permissions through a browser
28+
- **Message editing and deletion** - Full control over ticket messages with change tracking
29+
- **Scheduled closures and reminders** - Automate ticket management workflows
30+
- **Multi-language support** - 10 languages available (EN, FR, ES, DE, IT, PT, RU, ZH, JA, KO)
31+
- **REST API** - Integrate with external tools and automation
1832

1933
---
2034

21-
## ⚠️ Warning ⚠️
35+
## Quick Start
36+
37+
### 1. Generate your configuration
38+
39+
Use the online configurator to create your `config.toml` file:
2240

23-
This is my first major project in Rust; while I have solid experience in C and other languages, I'm learning Rust as I
24-
go — feedback and PRs are welcome.
41+
**[config.rustmail.rs](https://config.rustmail.rs)**
2542

26-
Project documentation is currently being written.
43+
The configurator guides you through all required settings and generates a ready-to-use configuration file.
44+
45+
### 2. Download and run
46+
47+
Download the latest release for your platform from [Releases](https://github.com/Rustmail/rustmail/releases), then:
48+
49+
```bash
50+
# Place config.toml in the same directory as the executable
51+
./rustmail
52+
```
53+
54+
The bot creates its SQLite database automatically on first run.
2755

2856
---
2957

30-
## Getting Started
58+
## Documentation
3159

32-
- 🛠️ [Setting up the bot](https://github.com/Rustmail/rustmail/tree/main/docs/setup.md)
33-
- 📦 [Commands](https://github.com/Rustmail/rustmail/tree/main/docs/commands.md)
60+
| Section | Description |
61+
|--------------------------------------------------------|---------------------------------|
62+
| [Installation](docs/getting-started/installation.md) | Download and setup instructions |
63+
| [Configuration](docs/getting-started/configuration.md) | Detailed configuration guide |
64+
| [Commands](docs/guides/commands.md) | Complete command reference |
65+
| [Server Modes](docs/guides/server-modes.md) | Single vs dual-server setup |
66+
| [Web Panel](docs/guides/panel.md) | Administration panel guide |
67+
| [API Reference](docs/reference/api.md) | REST API documentation |
68+
| [Docker Deployment](docs/deployment/docker.md) | Container deployment |
69+
| [Architecture](docs/development/architecture.md) | Technical overview |
70+
71+
Full documentation is available in the [docs](docs/) directory or on the [website](https://docs.rustmail.rs).
3472

3573
---
3674

3775
## Support
3876

39-
If you need help, join the [Discord server][discord-invite] and ask for assistance in the #support channel.
77+
For help and discussions, join the [Discord server](https://discord.gg/9Bzma6SwtW).
78+
79+
---
4080

4181
## License
4282

43-
This project is licensed under the [AGPLv3 License](https://github.com/Rustmail/rustmail/blob/main/LICENSE).
83+
This project is licensed under the [AGPLv3 License](LICENSE).
4484

45-
> **Note:** The `rustmail-panel` i18n module includes code derived from [i18n-rs](https://github.com/opensass/i18n-rs),
46-
> which is licensed under the MIT License.
85+
The `rustmail_panel` i18n module includes code derived from [i18n-rs](https://github.com/opensass/i18n-rs), licensed
86+
under MIT.

config.example.toml

Lines changed: 41 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,57 +1,72 @@
11
[bot]
2-
token = "TOKEN_HERE"
3-
status = "DM POUR SUPPORT"
4-
welcome_message = "Votre message à bien été reçu par l'équipe Staff ! Nous vous répondrons dès que possible."
5-
close_message = "Merci d'avoir contacté le support ! Ton ticket est désormais clos."
2+
token = "MTQyMjU1OTIyNjIwM.GWv0F5.v9sdNf59KZyWL0jVk_eqokcY-jnQ7X8upVBXYw"
3+
status = "DM FOR SUPPORT"
4+
welcome_message = "Message received! Our staff will get back to you as soon as possible."
5+
close_message = "Thank you for contacting support! Your ticket is now closed."
66
typing_proxy_from_user = true
77
typing_proxy_from_staff = true
88
enable_logs = true
99
enable_features = true
10-
logs_channel_id = 14043597305699
11-
features_channel_id = 14069404548593076
12-
panel_super_admin_users = []
10+
enable_panel = true
11+
client_id = 1422559226685450
12+
client_secret = "YWaq7VQM28PjfoNuWJPVpcs3gWFXI"
13+
redirect_url = "http://192.168.2.92:3002/api/auth/callback"
14+
timezone = "Europe/Paris"
15+
logs_channel_id = 14043597305635899
16+
features_channel_id = 14069404548309076
17+
ip = "http://192.168.2.92"
18+
panel_super_admin_users = [6891484871962727]
1319
panel_super_admin_roles = []
1420

1521
[bot.mode]
16-
type = "dual"
17-
community_guild_id = 12096679805062590
18-
staff_guild_id = 711880297271856
22+
type = "single"
23+
guild_id = 7118802972311856
1924

2025
[command]
2126
prefix = "!"
2227

2328
[thread]
24-
inbox_category_id = 137646043847505960
29+
inbox_category_id = 1376460638505960
2530
embedded_message = true
2631
user_message_color = "3d54ff"
2732
staff_message_color = "ff3126"
2833
system_message_color = "00ff00"
2934
block_quote = true
3035
time_to_close_thread = 5
3136
create_ticket_by_create_channel = true
37+
close_on_leave = false
38+
auto_archive_duration = 10080
39+
40+
[language]
41+
default_language = "fr"
42+
fallback_language = "en"
43+
supported_languages = [
44+
"en",
45+
"fr",
46+
"es",
47+
"de",
48+
]
49+
50+
[error_handling]
51+
show_detailed_errors = false
52+
log_errors = true
53+
send_error_embeds = true
54+
auto_delete_error_messages = true
55+
error_message_ttl = 30
56+
display_errors = true
3257

3358
[notifications]
3459
show_success_on_edit = false
3560
show_partial_success_on_edit = true
3661
show_failure_on_edit = true
3762
show_success_on_reply = false
3863
show_success_on_delete = false
39-
40-
[logs]
41-
show_log_on_edit = true
42-
show_log_on_delete = true
43-
44-
[language]
45-
default_language = "en"
46-
fallback_language = "en"
47-
supported_languages = ["en", "fr", "es", "de"]
64+
show_success = true
65+
show_error = true
4866

4967
[reminders]
5068
embed_color = "ffb800"
5169

52-
[error_handling]
53-
show_detailed_errors = false
54-
log_errors = true
55-
send_error_embeds = true
56-
auto_delete_error_messages = true
57-
error_message_ttl = 30
70+
[logs]
71+
show_log_on_edit = true
72+
show_log_on_delete = true

docs/SUMMARY.md

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# Summary
2+
3+
[Introduction](index.md)
4+
5+
---
6+
7+
# Getting Started
8+
9+
- [Installation](getting-started/installation.md)
10+
- [Configuration](getting-started/configuration.md)
11+
- [First Steps](getting-started/first-steps.md)
12+
13+
---
14+
15+
# User Guides
16+
17+
- [Commands](guides/commands.md)
18+
- [Server Modes](guides/server-modes.md)
19+
- [Tickets](guides/tickets.md)
20+
- [Web Panel](guides/panel.md)
21+
22+
---
23+
24+
# Deployment
25+
26+
- [Docker](deployment/docker.md)
27+
- [Production](deployment/production.md)
28+
29+
---
30+
31+
# Reference
32+
33+
- [Configuration Options](reference/configuration.md)
34+
- [REST API](reference/api.md)
35+
- [Database Schema](reference/database.md)
36+
37+
---
38+
39+
# Development
40+
41+
- [Architecture](development/architecture.md)
42+
- [Building](development/building.md)
43+
- [Contributing](development/contributing.md)

docs/book.toml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
[book]
2+
title = "Rustmail Documentation"
3+
description = "Documentation for Rustmail, a Discord modmail bot"
4+
authors = ["Akinator31"]
5+
language = "en"
6+
src = "."
7+
8+
[build]
9+
build-dir = "../book"
10+
11+
[output.html]
12+
default-theme = "navy"
13+
preferred-dark-theme = "navy"
14+
git-repository-url = "https://github.com/Rustmail/rustmail"
15+
edit-url-template = "https://github.com/Rustmail/rustmail/edit/main/docs/{path}"
16+
site-url = "/"
17+
18+
[output.html.fold]
19+
enable = true
20+
level = 1
21+
22+
[output.html.search]
23+
enable = true
24+
limit-results = 20
25+
boost-hierarchy = 2
26+
27+
[output.html.playground]
28+
editable = false

0 commit comments

Comments
 (0)