README.md

Package Updates | Centos package updates notification system

Usage

git clone https://pagure.io/centos-sig-hyperscale/package-updates.git
cd package-updates
podman build -t package-updates .
podman run -it \
  --mount type=bind,src=$HOME/.centos-server-ca.cert,dst=/home/app/.centos-server-ca.cert,ro=true,relabel=private \
  --mount type=bind,src=$HOME/.centos.cert,dst=/home/app/.centos.cert,ro=true,relabel=private \
  -e PAGURE_API_KEY=<pagure-api-key> \
  -e CAFILE=/home/app/.centos-server-ca.cert \
  -e CERT=/home/app/.centos.cert \
  -e KEY=/home/app/.centos.cert \
  package-updates

Enviroment variables

The script needs these enviroment variables:

  • PAGURE_API_KEY: Pagure API key, It is necessary to have an API Key with issue_create, issue_comment, issue_change_status and issue_update ACLs for the repo in order to allow the script to work with pagure issues.
  • CAFILE: .centos-server-ca.cert file
  • CERT: .centos.cert file
  • KEY: .centos.cert file

For more information on how to get the centos cert files, see: https://wiki.centos.org/Authentication#TLS_certificate \ Cert files needed for MQTT, see the Message Broker (MQTT) section: https://wiki.centos.org/Sources

Test enviroment

You can use test_mqtt_pub/publish.py to run a mqtt publisher to test the script with a localhost mqtt server.

Note: git.centos.org notifications don't appear very often so if you want to test the git.centos.org server leave the script for a long time running (hours or days).

MQTT payload

To recieve notifications from git.centos.org package updates the script listens to "git.centos.org/git.tag.creation" topic on mqtt, this topic is for git tag release creation. Here is an example of the payload for this topic:

{
  "repo": {
    "custom_keys": [],
    "name": "selinux-policy",
    "parent": null,
    "date_modified": "1553627665",
    "access_users": {
      "owner": [
        "centosrcm"
      ],
      "admin": [],
      "ticket": [],
      "commit": []
    },
    "namespace": "rpms",
    "priorities": {},
    "close_status": [],
    "access_groups": {
      "admin": [],
      "commit": [],
      "ticket": []
    },
    "milestones": {},
    "user": {
      "fullname": "CentOS Sources",
      "name": "centosrcm"
    },
    "date_created": "1553627665",
    "fullname": "rpms/selinux-policy",
    "url_path": "rpms/selinux-policy",
    "id": 6059,
    "tags": [],
    "description": " SELinux policy configuration "
  },
  "tag": "imports/c8s/selinux-policy-3.14.3-93.el8",
  "rev": "56e29e64a64cb48a0889fd502c636b26dc7800e3",
  "agent": "centosrcm",
  "authors": [
    {
      "fullname": "CentOS Sources",
      "name": "centosrcm"
    }
  ]
}

Script flow

Script flow diagram