You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-[Persistent history with MySQL](#persistent-history-with-mysql)
44
+
-[Persistent history](#persistent-history)
45
45
-[IP cloaking](#ip-cloaking)
46
46
-[Moderation](#moderation)
47
47
-[Push notifications](#push-notifications)
@@ -429,9 +429,32 @@ Unfortunately, client support for history playback is still patchy. In descendin
429
429
1. You can autoreplay a fixed number of lines (e.g., 25) each time you join a channel using `/msg NickServ set autoreplay-lines 25`.
430
430
431
431
432
-
## Persistent history with MySQL
432
+
## Persistent history
433
433
434
-
On most Linux and POSIX systems, it's straightforward to set up MySQL (or MariaDB) as a backend for persistent history. This increases the amount of history that can be stored, and ensures that message data will be retained on server restart (you can still use the configuration options to set a time limit for retention). Here's a quick start guide for Ubuntu based on [Digital Ocean's documentation](https://www.digitalocean.com/community/tutorials/how-to-install-mysql-on-ubuntu-20-04):
434
+
Persistent history means storing chat history (messages, but also events like JOINs and PARTs) on disk. This increases the amount of history that can be stored, and also ensures that message data will be retained on server restart (you can still use the configuration options to set a time limit for retention). Ergo supports three backends for persistent history: MySQL, PostgreSQL, and SQLite. If you have a default build of Ergo (for example, a release build from our GitHub page, or our official Docker image), all three backends are available.
435
+
436
+
To configure persistent history, you must set `history.persistent.enabled` to `true` in the Ergo config file. You may want to adjust other options in the `history` section at this time. Then you must additionally enable and configure one of the backends. Here are per-backend instructions:
437
+
438
+
### SQLite
439
+
440
+
SQLite is the easiest backend to enable; it's an embedded database that runs inside the Ergo process, without needing to talk to an external database server. Find `datastore.sqlite` in your config (or add it, following an up-to-date `default.yaml` as a guide):
441
+
442
+
```yaml
443
+
sqlite:
444
+
enabled: true
445
+
# path to the SQLite database file
446
+
database-path: "ergo_history.db"
447
+
# timeout when waiting for write lock
448
+
busy-timeout: 5s
449
+
# maximum concurrent connections
450
+
max-conns: 1
451
+
```
452
+
453
+
This creates an on-disk file `ergo_history.db` for the history storage, by default in the same working directory as the Ergo process. We believe SQLite should scale to the needs of most Ergo deployments (in our initial benchmarks, there is a write bottleneck of approximately 1K messages/events per second).
454
+
455
+
### MySQL
456
+
457
+
Here's a quick start guide for MySQL on Ubuntu based on [Digital Ocean's documentation](https://www.digitalocean.com/community/tutorials/how-to-install-mysql-on-ubuntu-20-04). (Ergo is also compatible with MariaDB; a compatible implementation is available on most Linux and POSIX platforms.)
435
458
436
459
1. Install the `mysql-server` package
437
460
1. Run `mysql_secure_installation` as root; this corrects some insecure package defaults
@@ -452,6 +475,10 @@ On most Linux and POSIX systems, it's straightforward to set up MySQL (or MariaD
452
475
timeout: 3s
453
476
```
454
477
478
+
### PostgreSQL
479
+
480
+
If you don't already have a PostgreSQL database, follow [Digital Ocean's quick start guide](https://www.digitalocean.com/community/tutorials/how-to-install-postgresql-on-ubuntu-22-04-quickstart) to set one up, then edit `datastore.postgresql` in the Ergo config file with `enabled: true` and your database parameters.
0 commit comments