mod_welcome

Greet users with a message of the day. Part of the bundled plug-ins.

mod_welcome sends a message of the day (MOTD) to each user when they log in, and optionally publishes hub rules. Each configured file also gets a command so users can re-read it on demand.

Loading

plugin /var/lib/uhub/mod_welcome.so "motd=/etc/uhub/motd.txt rules=/etc/uhub/rules.txt rtf0=true"

Configuration

OptionDefaultDescription
motdFile whose contents are sent to each user on login. Enables the !motd command.
rulesFile with the hub rules. Enables the !rules command (not sent automatically).
rtf0falseSend the MOTD and rules as rich text, so clients supporting the RTF0 extension render them. 0.8.0

Commands

CommandAccessDescription
!motdguestShow the message of the day (when motd is configured).
!rulesguestShow the hub rules (when rules is configured).

Substitutions

The following placeholders are expanded in the MOTD and rules text:

TokenExpands to
%nthe user's nick
%athe user's IP address
%cthe user's credentials (guest, user, operator, …)
%tthe TLS version protecting the user's connection 0.8.0
%%a literal percent sign
%H %I %M %S %p %Pcurrent time fields (hour 24h / hour 12h / minute / second / am-pm)

Rich text

With rtf0=true, the MOTD and rules are sent as rich text and clients that negotiated the RTF0 extension render them as CommonMark — headings, emphasis, links, and images embedded by URL with ![description](url):

## Welcome to **My Hub**, %n!

You are connected over %t as *%c*.
See the [rules](https://example.org/rules) before sharing.

![hub banner](https://example.org/banner.png)

Clients without RTF0 support receive the plain text either way, so the file should still read sensibly unrendered. Nothing is sent as rich text when the hub is configured with chat_rich_text set to no, regardless of this option.

Embedded images are fetched by the client from the URL you write, which exposes each connecting user's IP address to that host. Only reference images you control.