Skip to content

nz2o/K4NWS-bot-relay

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Matterbridge Configuration for ALERT/K4NWS

Purpose

Provide a repository to store how to configure Matterbridge from github to connect with Weather.IM IEM Chat. This chat is not an ALERT service, but we are simply relying on a relay for this. This can fail at any time, provided without warranty. Use must comply with the license agreement defined in this repository.

How to install

We're assuming you're either root, or can use sudo before each command.

Get the VM Set Up.

  1. Get a Linux VM with internet access. Ensure it is fully updated on the latest LTS release of Ubuntu, or appropriate Debian distribution, to stay with this guide. Document your work, keep the passwords stored securely and in a location accessible to the ALERT IT Group.

  2. Brute force attacks on VM Servers are a thing. Appropriately harden the Linux installation. See potential guide. In essence, ensure that authentication is based on certificate rather than password. Create sudo logins, allow SSH for those logins, and disable ssh for root login. Arrange for some kind of update cadence, to address any CVE's that might come up. Understand the security risk surface: While this VM is likely not going to store sensitive nonpublic info, you never want a rogue VM using Slack or XMPP credentials on ALERT's behalf.

  3. REVIEW/UPDATE releases, if new versions exist, and and run the INSTALL.sh script. *Always pre-review curl-bash scripts, for security! They can change, no matter how much you trust the repository.

bash -c "$(wget -qLO - https://raw.githubusercontent.com/nz2o/K4NWS-bot-relay/main/PREINSTALL.sh)"

Create your configuration files.

  1. Configure the matterbridge.toml file, and place it in /etc/matterbridge/matterbridge.toml. See this repository's example configuration for a better idea of what needs to happen.
nano /etc/matterbridge/matterbridge.toml
  1. Slack bot setup also has to happen here, using this guide. Note that you might have to tweak oauth scopes, because Slack chose to go granular.

Pre-flight Check.

  1. From anywhere, run matterbridge -version. Expected output is the version number.
  2. From anywhere, run matterbridge -debug -conf /etc/matterbridge/matterbridge.toml Expected output:
[0000]  INFO main:         [setupLogger:matterbridge.go:104] Enabling debug logging.
[0000]  INFO main:         [main:matterbridge.go:44] Running version 1.26.0 6dafebc7
[0000]  INFO config:       [NewConfig:bridge/config/config.go:274] Opening log file /var/log/matterbridge/matterbridge.log
*** It should NOT return you to a shell prompt. Use Ctrl+C to break out/end the app.

Be sure to examine the log. Address any errors.

nano /var/log/matterbridge/matterbridge.log

Your output should look like this:

[0000]  INFO router:       [Start:gateway/router.go:66] Parsing gateway k4nwsbot
[0000]  INFO router:       [Start:gateway/router.go:75] Starting bridge: xmpp.iemchat
[0000]  INFO xmpp:         [Connect:bridge/xmpp/xmpp.go:45] Connecting weather.im:5222

If that's good, it's time to create a SYSTEMD service, to ensure it runs at start, and restarts at error.

  1. Let's make a SYSTEMD service! Use this guide. See example in repository. Once you create the file, run systemctl daemon-reload to refresh SYSTEMD.
  2. Start the service service matterbridge start
  3. Check the service service matterbridge status It should look like this: If it does, you're done!
● matterbridge.service - Matterbridge daemon
     Loaded: loaded (/etc/systemd/system/matterbridge.service; enabled; preset: enabled)
     Active: active (running) since Sun 2024-12-29 18:26:42 UTC; 4s ago
   Main PID: 2264 (matterbridge)
      Tasks: 5 (limit: 2877)
     Memory: 8.4M (peak: 8.8M)
        CPU: 68ms
     CGroup: /system.slice/matterbridge.service
             └─2264 /bin/matterbridge -conf /etc/matterbridge/matterbridge.toml

Dec 29 18:26:42 racknerd-28fca83 systemd[1]: Started matterbridge.service - Matterbridge daemon.
Dec 29 18:26:42 racknerd-28fca83 matterbridge[2264]: time="2024-12-29T18:26:42Z" level=info msg="Running version 1.26.0 6dafebc7" prefix=main
Dec 29 18:26:42 racknerd-28fca83 matterbridge[2264]: time="2024-12-29T18:26:42Z" level=info msg="Opening log file /var/log/matterbridge/matterbridge.log" prefix=config

About

Implementation configuration for 42wim/Matterbridge used to relay Weather.im bmxchat messages to Slack BMX Spotter Chat bot-stream channel

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages