Steam Bridge for Beeper

using mx-puppet-steam and bbctl

Jason LaGuidice @shadowdrake:beeper.com Last updated 4/17/2024


This guide will get the old mx-puppet-steam bridge running, connected to Beeper's servers, and available for use. This guide is based on a Proxmox LXC using their latest Ubuntu container image at the time of this guide creation. It is not intended to be comprehensive but should provide coverage and documentation of the sticking points which are missing or not described well enough in the instructions for Beeper's bridge manager or the Steam bridge instructions.

Prerequisites

  • Proxmox 8
  • Ubuntu LXC image available

This guide will use nano as the text editor but any other feasible text editor can be used in its place

If you decide to use a VM instead of an LXC or are otherwise not connected as root add sudo before basically all commands. This guide was intended to be run-as-root though it's not strictly required. Note other changes regarding permissions may be necessary to the update script and throughout the guide if you are not a root user.

  1. Create a new LXC using ubuntu or debian as the base image
  2. Start the container, update it with apt update && apt dist-upgrade -y, fix that annoying locale bug with the Proxmox Ubuntu LXC template
  3. Install docker. Steps below for convenience
    1
    2
    3
    4
    5
    6
    7
    8
    9
    apt-get update
    apt-get install ca-certificates curl
    install -m 0755 -d /etc/apt/keyrings
    curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc
    chmod a+r /etc/apt/keyrings/docker.asc
    
    echo  "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu  $(. /etc/os-release && echo "$VERSION_CODENAME") stable" |  tee /etc/apt/sources.list.d/docker.list > /dev/null
    apt-get update
    apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
    
  4. Install go: apt install golang -y
  5. Install git: apt install git -y
  6. Clone the bridge manager repository: git clone https://github.com/beeper/bridge-manager
  7. Create a convenience update script: nano ./update.sh
    Paste the following into nano:
    1
    2
    3
    4
    5
    6
    7
    8
    #! /bin/bash
    
    cd /root/bridge-manager
    git fetch
    git pull
    ./build.sh
    cp ./bbctl /root/bbctl
    echo "Complete"
    
  8. chmod +x ./update.sh
  9. Run ./update.sh which will build the bridge manager from the latest commit of the repository and copy it to your current directory
  10. mkdir docker-config
  11. Log into the bridge manager
    1. ./bbctl login
    2. Enter your e-mail address
    3. Enter the code sent to your e-mail
  12. Register the new bridge: ./bbctl register sh-mx-puppet-steam. Save the generated output file, an example output is shown below. Replace all values with the ones provided to you by the bridge manager
    a. First is the registration file:

    id: cec4046d-e1e1-4f10-b549-4483897a9546
    url: websocket
    as_token: hua_hcc5Z5YBU60w0bHGuf92OHHkuHHo2XGbjZVf3eUhNDHorl61QnE7P_dTVWm2
    hs_token: huh_oCaeqjO8XTDJ7qIoNqsRncKNwMYFX9eEsHnKGMy5Pnn27TSCIUTSB_0R1WrX
    sender_localpart: sh-mx-puppet-steam
    rate_limited: false
    namespaces:
        users:
            - regex: '@sh-mx-puppet-steam_.+:beeper\.local'
              exclusive: true
    push_ephemeral: true
    

    b. Second is the additional bridge configuration:

    1
    2
    3
    4
    Additional bridge configuration details:
    * Homeserver domain: beeper.local
    * Homeserver URL: https://user.eu-plucky-sparrow.edge.beeper.com/user
    * Your user ID: @user:beeper.com
    
  13. Create an initial configuration file for the bridge
    1. nano ./docker-config/config.yaml and paste the following after changing the details noted in brackets
      bridge:
          port: 6000
          bindAddress: 0.0.0.0
          domain: [YOUR HOMESERVER DOMAIN]
          homeserverUrl: [YOUR HOMESERVER URL]
      
      provisioning:
          whitelist:
              - "[YOUR BEEPER USERNAME]"
          apiPrefix: /_matrix/provision
      
      presence:
          enabled: true
          interval: 5000
      
    2. Save and exit nano
    3. nano ./docker-config/steam-registration.yaml and paste the following after changing the details noted in brackets. Please note the homeserver url is constructed of multiple entries
      id: [YOUR ID]
      url: http://127.0.0.1:6000?access_token=[YOUR hs_token]
      as_token: [YOUR as_token]
      hs_token: [YOUR hs_token]
      sender_localpart: [YOUR sender_localpart]
      rate_limited: false
      namespaces:
          users:
              - regex: '@sh-mx-puppet-steam_.*'
                exclusive: true
      push_ephemeral: true
      de.sorunome.msc2409.push_ephemeral: true
      
  14. Start the docker container: docker run -d -p 6000:6000 --name mx-puppet-steam --restart=always -v /root/docker-config:/data icewind1991/mx-puppet-steam:latest
  15. Start the bridge manager proxy ./bbctl proxy -r /root/docker-config/steam-registration.yaml
  16. Send a message to your bridge bot: @sh-mx-puppet-steambot:beeper.local. The bot should join the room when it is created, and respond to the help command. If this works, close the proxy and move on to the next step
  17. Automate bridge manager proxy startup with systemd
    1. nano /etc/systemd/system/bbctl.sh-mx-puppet-steam.service
    2. Paste the following into nano
      [Unit]
      Description=Beeper Bridge Manager mx-puppet-steam
      After=network-online.target docker.service
      Wants=network-online.target systemd-networkd-wait-online.service
      StartLimitIntervalSec=500
      StartLimitBurst=5
      
      [Service]
      Type=simple
      Restart=on-failure
      RestartSec=5s
      User=root
      ExecStart=/root/bbctl proxy -r /root/docker-config/steam-registration.yaml
      
      [Install]
      WantedBy=multi-user.target
      
    3. systemctl enable bbctl.sh-mx-puppet-steam.service
    4. systemctl start bbctl.sh-mx-puppet-steam.service
  18. Login to the bot by sending it a message with link [steam username] [steam password]. If you have Steam guard enabled it will ask you for a Steam guard code

Double Puppeting

Double puppeting may not work without manually entering a matrix auth token. Without double puppeting, when you are sent a message for the first time a room will be created and you will be invited to it, but not automatically joined. You can use the token which was granted to the copy of the bridge manager running this bridge.

  1. In the LXC running the bridge, run nano ~/.config/bbctl/config.json
  2. Find the access_token tag in the file, and copy it out. It seems to begin with syt_
  3. Send a message to the bridge bot: setmatrixtoken [YOUR access_token] and the bot should respond it was set successfully
Edit
Pub: 04 Mar 2024 20:25 UTC
Edit: 06 May 2024 16:45 UTC
Views: 767