Forum teuk.org

🪄 Portus DCC: Eggdrop-style Partyline access for Mediabot v3

in Mediabot · started by TeuK · 2w ago

TeuK · 2w ago

🪄 Portus DCC: Eggdrop-style Partyline access for Mediabot v3

Mediabot v3 now has a much cleaner and more complete Partyline access flow.

The goal was simple: make the Mediabot Partyline feel closer to the classic Eggdrop experience, while keeping the current Mediabot rights model and improving security around authentication.

This update includes both the earlier DCC Partyline work and the new CTCP-based access path.


What was already improved

Before this last step, the Partyline had already gained a cleaner login flow inspired by Eggdrop.

Instead of typing everything in one command:

login <user> <password>

the Partyline now asks for the nickname first:

Mediabot Partyline

Please enter your nickname.

Then it asks for the password separately:

Enter your password.

The password is no longer displayed in the terminal while typing.

After a successful login, the user receives a cleaner welcome message:

Connected to Mediabot Partyline.

Hey teuk! Welcome to the Mediabot partyline.
Local time is now ...
You are authenticated as Owner.

Commands start with '.' (like '.quit' or '.help').
Everything else goes out to the partyline.

The Partyline still displays the list of currently connected users after login, keeping the useful Eggdrop-like .whom behavior.


What changed now

The big addition is support for the classic IRC client command:

/ctcp mediabotv3 CHAT

This is the Eggdrop-style passive DCC Chat request.

The bot now understands a raw CTCP CHAT payload, validates the requester against the Mediabot user database, checks the global level, opens a temporary DCC Chat listener, and sends a proper DCC CHAT offer back to the IRC client.

In practice, the flow is now:

/ctcp mediabotv3 CHAT
→ Mediabot receives raw CTCP CHAT
→ Mediabot checks the user and level
→ Mediabot opens a temporary DCC CHAT listener
→ Mediabot sends back the DCC CHAT offer
→ the IRC client connects
→ the Partyline login prompt appears

This makes Mediabot feel much closer to the traditional Eggdrop Partyline workflow.


DCC Chat paths now covered

The Partyline work now covers several access paths:

/dcc chat mediabotv3
/ctcp mediabotv3 CHAT
DCC CHAT chat <ip> <port>
DCC CHAT chat 0 0 <token>

The earlier work made the direct DCC Chat flow functional.

This update completes the classic /ctcp <botnick> CHAT flow.


Public IP handling

For CTCP-based DCC Chat, the bot must advertise an IPv4 address that the IRC client can actually reach.

A new configuration key is used for this:

DCC_PUBLIC_IP=203.0.113.10

On a real server, this should be set to the public IPv4 address of the machine running Mediabot.

The sample configuration now documents this setting.

Without this value, the bot may receive the CTCP request correctly but fail to send a usable DCC offer, because it cannot determine which public IP address to advertise.


Security improvements

This work also improves Partyline safety.

Passwords are no longer logged in clear text.

When the Partyline is waiting for a password:

  • Telnet echo is disabled;
  • the password is not displayed in the terminal;
  • debug logs mask password input;
  • the older login <user> <password> syntax remains handled, but the password is masked.

This avoids the most obvious accidental leak: seeing a Partyline password either in the terminal or in logs.


CTCP handling fix

One important bug was also fixed during this work.

Some IRC clients send:

/ctcp mediabotv3 CHAT

as a raw payload:

\x01CHAT\x01

Mediabot now detects this before the private command parser sees it.

Before the fix, the bot could interpret it as a private command named chat, producing:

Private command 'chat' not found

Now it is correctly handled as a CTCP CHAT request.


Current validated flow

The working flow is now:

/ctcp mediabotv3 CHAT
→ CTCP raw payload detected
→ user found in Mediabot database
→ Owner/Master-level permission checked
→ temporary DCC listener opened
→ DCC CHAT offer sent back
→ IRC client connects
→ Eggdrop-style Partyline login
→ password hidden
→ connected users displayed

That is exactly the behavior expected from an IRC bot Partyline.


Why this matters

The Partyline is one of the most useful administration and debugging tools for an IRC bot.

It should be comfortable for people used to Eggdrop, but it should also fit Mediabot’s own user and rights model.

This update brings Mediabot closer to that balance:

classic IRC bot feeling
modernized Mediabot internals
safer authentication handling

It is a small feature from the user’s point of view, but an important quality improvement for daily administration.


Commit

Suggested commit message:

🪄 Portus DCC: unlock Eggdrop-style CTCP CHAT for the Mediabot Partyline

This commit includes the previous DCC Partyline work, the Eggdrop-style login ritual, hidden password input, and the new /ctcp <botnick> CHAT access path.

You must be logged in to reply.