Reporting

How to report by email

  1. Install dependencies:

    yay -S --asdeps python-jinja
    
  2. Configure the service:

    [report]
    target = email
    
    [email]
    host = smtp.example.com
    link_path = http://example.com/aur/x86_64
    password = ...
    port = 465
    receivers = me@example.com
    sender = me@example.com
    user = me@example.com
    

How to generate index page

  1. Install dependencies:

    yay -S --asdeps python-jinja
    
  2. Configure the service:

    [report]
    target = html
    
    [html]
    path = ${repository:root}/repository/aur/x86_64/index.html
    link_path = http://example.com/aur/x86_64
    

Having this configuration, the generated index.html will be also automatically synced to remote services (e.g. S3).

How to generate RSS feed for index page

In addition to previous steps, the following configuration is required:

[report]
target = html rss

[html]
rss_url = ${html:link_path}/rss.xml

[rss]
link_path = ${html:link_path}
path = ${repository:root}/repository/ahriman-demo/x86_64/rss.xml
rss_url = ${html:link_path}/rss.xml

With the appended configuration, the service fill also generate rss.xml, link it to generated index.html and put it together.

How to post build report to telegram

  1. It still requires additional dependencies:

    yay -S --asdeps python-jinja
    
  2. Register bot in telegram. You can do it by starting chat with @BotFather. For more details please refer to official documentation.

  3. Optionally (if you want to post message in chat):

    1. Create telegram channel.

    2. Invite your bot into the channel.

    3. Make your channel public

  4. Get chat id if you want to use by numerical id or just use id prefixed with @ (e.g. @ahriman). If you are not using chat the chat id is your user id. If you don’t want to make channel public you can use this guide.

  5. Configure the service:

    [report]
    target = telegram
    
    [telegram]
    api_key = aaAAbbBBccCC
    chat_id = @ahriman
    link_path = http://example.com/aur/x86_64
    

    ${api_key} is the one sent by @BotFather, ${chat_id} is the value retrieved from previous step.

If you did everything fine you should receive the message with the next update. Quick credentials check can be done by using the following command:

curl 'https://api.telegram.org/bot${api_key}/sendMessage?chat_id=${chat_id}&text=hello'

(replace ${chat_id} and ${api_key} with the values from configuration).