Plug-ins
uhub ships with a set of loadable C plug-ins. Enable them in plugins.conf by
pointing at the built .so file with an optional configuration string.
On Unix systems, a plug-in is loaded like this:
plugin /var/lib/uhub/mod_logging.so "file=/var/log/uhub/uhub.log"
On Windows, point at the .dll instead:
plugin c:\path\to\mod_logging.dll "file=c:\uhub\uhub.log"
Plug-ins are loaded in the order they are listed, which matters when one builds on another —
mod_selfregister needs a storage plug-in above it, and for intercepted events the
first plug-in to give a verdict wins. An optional plugin_dir line sets a base
directory for any plug-in named without an absolute path:
plugin_dir /usr/lib/uhub
plugin mod_logging.so "file=/var/log/uhub/uhub.log"
Bundled plug-ins
Click a module for its configuration options and commands.
Authentication and accounts
| Module | Description |
|---|---|
mod_auth_sqlite | Registered accounts and persisted bans in a SQLite database. |
mod_auth_simple | Registered accounts from a read-only text file. |
mod_selfregister | Self-service !regme / !passwd commands. 0.8.0 |
Chat and moderation
| Module | Description |
|---|---|
mod_welcome | Sends a welcome message (and rules / MOTD) to users when they log in. |
mod_chat_history | Provides a global chat history log. |
mod_chat_history_sqlite | Provides a global chat history log backed by SQLite. |
mod_chat_only | Chat-only hub: disables connection setup, search and results. |
mod_chat_is_privileged | Restricts main chat and private messages by credential. |
mod_no_guest_downloads | Only registered users can search and initiate transfers. |
mod_flood | Disconnects users after repeated hub-detected floods. |
mod_topic | Adds commands for changing the hub topic (description). |
Interface and extensibility
| Module | Description |
|---|---|
mod_ucmd | Publishes hub commands as client right-click context menus. |
mod_javascript | Runs JavaScript scripts as plug-ins, via an embedded QuickJS engine. 0.8.0 |
mod_logging | Logs users entering and leaving the hub. |
mod_example | A simple example plug-in to base your own on. |
mod_javascript is optional and only built when the hub is configured with
-DJAVASCRIPT_SUPPORT=ON; every other module above is built by default.
Example configuration
A typical plugins.conf combining several modules:
plugin /var/lib/uhub/mod_auth_sqlite.so "file=/etc/uhub/users.db"
plugin /var/lib/uhub/mod_selfregister.so
plugin /var/lib/uhub/mod_logging.so "file=/var/log/uhub/uhub.log"
plugin /var/lib/uhub/mod_welcome.so "motd=/etc/uhub/motd.txt rules=/etc/uhub/rules.txt rtf0=true"
plugin /var/lib/uhub/mod_chat_history.so "history_max=200 history_default=10 history_connect=5"
plugin /var/lib/uhub/mod_ucmd.so
Upgrading to 0.8.0? Plug-ins must be rebuilt against plug-in API 8 — the
hub refuses to load older ones. The self_register parameter of
mod_auth_sqlite was removed in favour of
mod_selfregister, and registered accounts no longer
live in the ACL file.
Want to write your own? See the plug-in API for C, or the JavaScript plug-in API for scripts.