Bridge OwnCast chat with IRC!
Find a file
2024-12-12 20:01:00 -05:00
.gitignore ACTION from IRC turns into /me for owncast 2024-08-31 21:14:27 -04:00
LICENSE GIT THIS 2024-08-27 09:26:51 -04:00
myapp.pl comment out Smart::Comments 2024-12-12 20:01:00 -05:00
README.md add readme 2024-12-12 19:57:58 -05:00
start.sh.example fix start.sh.example 2024-12-12 20:00:32 -05:00

Mojo Owncast IRC Bridge

This program bridges Owncast Chat with an IRC channel

Requirements

This program has several requirements

  • Mojolicious
  • Mojo::IRC
  • Mojo::UserAgent

Acquire them.

Usage

Copy config file

cp start.sh.example start.sh

Please edit as necessary; we will acquire access token shortly.

Webhook

On Owncast; go to Admin -> webhooks and add:

http://listening.address/webhook

which responds to ALL events.

Access Tokens

On Owncast; go to Admin -> got to Access Tokens For name; put something short as this will appear every time a message is sent from IRC if you don't supply an admin password file environment variable. Scopes: 'System messages' and 'User chat messages'

Copy that token and put it on the respective line in your start.sh file.

Admin Password File Environment Variable

OWNCAST_ADMIN_PASS_FILE must be readable by the user that the program is running from. This file is the ADMIN password for Owncast. Obviously, this has Owncast related security implications which I won't cover. (Maybe one day Owncast will allow for more 'admin passes' with specific scopes.)

This reads the file and uses that as the admin password which will create a better chatting experience;

  • Automatically creates new access tokens for IRC chatters.
  • Keeps track of these tokens.
  • Will use these tokens to chat in Owncast Chat
  • Will delete these tokens when IRC participants leave channel.
  • Tries to use access tokens that were already present on program restart.

This isn't a perfect program and at times you may need to clear out these 'extra' access tokens manually and restart the program since it won't know that the tokens have been deleted.

OWNCAST_ADMIN_PASS_FILE environment variable doesn't need to exist; this program can chat with just it's own Access Token.

Start program

./start.sh

Tips

Latency

To achieve a 'low-latency' chatting experience, try to get this program on the same box that owncast is on; directly poking Owncast itself (instead of going through the TLS-Apache/Nginx/whatever-proxypass-owncast overhead.)

Create channel

This bot is quite noisy, so its probably a good idea to create a dedicated channel just for this program.