Skip to content

Release tracker that posts updates into Matrix rooms

License

Notifications You must be signed in to change notification settings

ananace/matrix-releasetracker

Repository files navigation

Matrix Releasetracker

For more information, questions, or just the use of the hosted version, you can visit #releasetracker:kittenface.studio.

Example image

Usage

The tracked repositories can be configured in multiple ways.

Bot-command

Send the message !github <username> to the bot. This would track all repositories starred by the defined user.

State event

A more fine-grained approach is to save the tracked entities in the room state of a room you share with the bot. Send a state event (e.g. via Element with /devtools) containing all the things you want to track. These can be easily updated with another state event.

Example state event for advanced tracking;

{
  "type": "dev.ananace.ReleaseTracker",
  "sender": "@ace:kittenface.studio",
  "content": {
    "type": "m.text", // m.notice by default
    "tracking": [
      // GitHub repositories;
      "github:r/vector-im/element-web",
      "github:r/matrix-org/synapse",

      // GitHub group;
      "github:g/netbox-community",

      // GitHub user (all starred repositories)
      "github:u/ananace",

      // GitLab(.com) repository;
      "gitlab:r/mb-saces/synatainer",
      // GitLab(.com) group;
      "gitlab:g/mb-saces",
      // GitLab(.com) user stars; (with a token for if the tracker doesn't have one configured)
      "gitlab:access_token@u/mb-saces",

      // GitLab (self-hosted) repository;
      "gitlab://dev.funkwhale.audio/r/funkwhale/funkwhale",
      // GitLab (self-hosted) user stars; (with a token for if the tracker doesn't have one configured)
      "gitlab://[email protected]/u/user",
      "gitlab://<user>:[email protected]/u/user",

      // Gitea repository;
      "gitea://git.example.com/r/user/repository",
      // Gitea user stars; (with a token for if the tracker doesn't have one configured)
      "gitea://[email protected]/u/user",

      // Bare git repo;
      "git+https://user:[email protected]/private/repo",
      "git+https://git.zx2c4.com/wireguard-tools",
      "git+ssh://[email protected]/wireguard-tools",
      "git://git.zx2c4.com/wireguard-tools"
    ]
  },
  "state_key": "",
  "origin_server_ts": 1657845040362,
  "event_id": "$Of010lcT1D19peJ9pZFAN4vV6dYwlAXtVYg_0rGSESs",
  "room_id": "!YcpuFlnupDnkbqHuKU:example.com"
}

Installation

The bin/tracker binary will track and post updates on new GitHub releases, it requires a releasetracker.yml configuration file that it can read and write to.

Example releasetracker.yml config-file:

---
:backends:
- :access_token: 0000000000000000000000000000000000000000 # GitHub access token - needs the public_repo scope
  # also acceptable are a :login, :password combination - or :client_id, :client_secret for OAuth - without GraphQL support
  # It's also possible to skip the authentication entirely, to run with heavily reduced limits and only REST API functionality
  :type: github
- :type: gitlab
- :type: gitea
- :type: git
:client:
  :hs_url: https://matrix.org
  :access_token: <token>
:database:
  # Will default to sqlite stored in database.db in the working-directory
  :connection_string: sqlite://database.db

A more fully featured configuration example can be seen in releasetracker.yml.example

Systemd

Example systemd unit:

# ~/.config/systemd/user/matrix-releasetracker.service
[Unit]
Description=Release tracker for Matrix

[Service]
Type=simple
WorkingDirectory=/opt/matrix-releasetracker
ExecStart=/bin/bash -lc 'bundle exec bin/tracker'
Restart=on-failure

[Install]
WantedBy=default.target

Docker-compose

You can use the image from Dockerhub. Example docker-compose.yml

version: "3.7"
services:
  matrix-release-tracker:
    restart: "unless-stopped"
    image: "ananace/matrix-releasetracker:latest"
    volumes:
      - "./releasetracker.yml:/app/releasetracker.yml"

TODO

  • Write a whole bunch of tests
  • Expose configuration for allowed release types (lightweight tag, signed tag, pre-release, full release, etc)
  • Handle multiple releases in a short period (between two ticks) more gracefully
  • Implement bot-like bang commands to act on the configuration
  • Handle PGP signatures better, don't just print the signature

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/ananace/matrix-releasetracker

License

The gem is available as open source under the terms of the MIT License.

About

Release tracker that posts updates into Matrix rooms

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published