1. 09 Mar, 2022 2 commits
  2. 10 Feb, 2022 1 commit
    • Kevin Morris's avatar
      change: report unhandled tracebacks to a repository · 7485cc23
      Kevin Morris authored
      
      
      As repeats of these traceback notifications were annoying some of
      the devops staff, and it took coordination to share tracebacks with
      developers, this commit removes that responsibility off of devops
      by reporting tracebacks to Gitlab repositories in the form of issues.
      
      - removed ServerErrorNotification
      - removed notifications.postmaster configuration option
      - added notifications.gitlab-instance option
      - added notifications.error-project option
      - added notifications.error-token option
      - added aurweb.exceptions.handle_form_exceptions, a POST route decorator
      
      Issues are filed confidentially. This change will need updates
      in infrastructure's ansible configuration before this can be
      applied to aur.archlinux.org.
      Signed-off-by: Kevin Morris's avatarKevin Morris <kevr@0cost.org>
      7485cc23
  3. 18 Jan, 2022 1 commit
  4. 10 Jan, 2022 1 commit
    • Kevin Morris's avatar
      feat(python): catch all exceptions thrown through fastapi route paths · d675c0dc
      Kevin Morris authored
      
      
      This commit does quite a bit:
      - Catches unhandled exceptions raised in the route handler and
        produces a 500 Internal Server Error Arch-themed response.
      - Each unhandled exception causes a notification to be sent to new
        `notifications.postmaster` email with a "Traceback ID."
      - Traceback ID is logged to the server along with the traceback which
        caused the 500: `docker-compose logs fastapi | grep '<traceback_id>'`
      - If `options.traceback` is set to `1`, traceback is displayed in
        the new 500.html template.
      Signed-off-by: Kevin Morris's avatarKevin Morris <kevr@0cost.org>
      d675c0dc
  5. 18 Dec, 2021 1 commit
  6. 29 Nov, 2021 1 commit
  7. 19 Oct, 2021 2 commits
  8. 06 Jun, 2021 1 commit
    • Kevin Morris's avatar
      aurweb: Globalize a Translator instance, add more utility · c1e29e90
      Kevin Morris authored
      
      
      + Added SUPPORTED_LANGUAGES, a global constant dictionary of
        language => display pairs for languages we support.
      + Add Translator.get_translator, a function used to retrieve a
        translator after initializing it (if needed). Use `fallback=True`
        while creating languages, in case we setup a language that we
        don't have a translation for, it will noop the translation.
        This is particularly useful for "en," since we do not translate
        it, but doing this will allow us to go through our normal translation
        flow in any case.
      + Added typing.
      + Added get_request_language, a function that grabs the language for
        a request session, defaulting to aurweb.config [options] default_lang.
      + Added get_raw_translator_for_request, a function that retrieves
        the concrete translation object for a given language.
      + Added tr, a jinja2 contextfilter that can be used to inline translate
        strings in jinja2 templates.
      + Added `python-jinja` dep to .gitlab-ci.yml. This needs to be
        included in documentation before this set is merged in.
      + Introduce pytest units (test_l10n.py) in `test` along with
        __init__.py, which marks `test` as a test package.
      + Additionally, fix up notify.py to use the global translator. Also
        reduce its source width to <= 80 by newlining some code.
      + Additionally, prepare locale in .gitlab-ci.yml and add
        aurweb.config [options] localedir to config.dev with YOUR_AUR_ROOT
        like others.
      Signed-off-by: Kevin Morris's avatarKevin Morris <kevr@0cost.org>
      Signed-off-by: Lukas Fleischer's avatarLukas Fleischer <lfleischer@archlinux.org>
      c1e29e90
  9. 20 Feb, 2021 1 commit
  10. 14 Oct, 2020 1 commit
  11. 27 Aug, 2020 1 commit
  12. 26 Aug, 2020 1 commit
  13. 11 Feb, 2020 2 commits
    • Lukas Fleischer's avatar
      Make SMTP port and authentication configurable · b855ce94
      Lukas Fleischer authored
      
      
      Add more options to configure the smtplib implementation for sending
      notification emails.
      
      The port can be changed using the new smtp-port option.
      
      Encryption can be configured using smtp-use-ssl and smtp-use-starttls.
      Keep in mind that you usually also need to change the port when enabling
      either of these options.
      
      Authentication can be configured using smtp-user and smtp-password.
      Authentication is disabled if either of these values is empty.
      Signed-off-by: Lukas Fleischer's avatarLukas Fleischer <lfleischer@archlinux.org>
      b855ce94
    • Lukas Fleischer's avatar
      Support smtplib for sending emails · de549fb2
      Lukas Fleischer authored
      
      
      Support mail delivery without a local MTA. Instead, an SMTP server can
      now be configured using the smtp-server option in the [notifications]
      section. In order to use this option, the value of the sendmail option
      must be empty.
      Signed-off-by: Lukas Fleischer's avatarLukas Fleischer <lfleischer@archlinux.org>
      de549fb2
  14. 02 Feb, 2020 1 commit
  15. 30 Jan, 2020 1 commit
  16. 06 Jan, 2020 1 commit
  17. 19 Aug, 2019 1 commit
  18. 08 Feb, 2019 1 commit
  19. 20 May, 2018 1 commit
  20. 17 May, 2018 3 commits
    • Lukas Fleischer's avatar
      Use modern format strings in notification messages · 6367dfd2
      Lukas Fleischer authored
      
      
      User modern Python format() strings with curly braces. Also, convert all
      placeholders to named arguments. This allows translators to reorder
      messages.
      Signed-off-by: Lukas Fleischer's avatarLukas Fleischer <lfleischer@archlinux.org>
      6367dfd2
    • Lukas Fleischer's avatar
      Localize notification emails · f7a57c82
      Lukas Fleischer authored
      
      
      Add support for translating notification emails and send localized
      notifications, based on the user's language preferences. Also, update
      the translations Makefile to add strings from the notification script
      to the message catalog.
      
      Implements FS#31850.
      Signed-off-by: Lukas Fleischer's avatarLukas Fleischer <lfleischer@archlinux.org>
      f7a57c82
    • Lukas Fleischer's avatar
      Refactor the notification script · f3b4c5c6
      Lukas Fleischer authored
      
      
      Reimplement most of the notification script logic. Create a separate
      class for each notification type. Each class provides methods for
      generating the list of recipients, the message subject, the message
      body, the references to add at the end of the message and the message
      headers. Additionally, a method for sending notification emails is
      provided.
      
      One major benefit of the new implementation is that both the generation
      of recipients and message contents are much more flexible. For example,
      it is now easily possible to make user-specific adjustments to every
      single notification of a batch.
      Signed-off-by: Lukas Fleischer's avatarLukas Fleischer <lfleischer@archlinux.org>
      f3b4c5c6
  21. 16 May, 2018 1 commit
  22. 13 Mar, 2018 1 commit
  23. 25 Aug, 2017 1 commit
  24. 20 Dec, 2016 1 commit
  25. 13 Nov, 2016 1 commit
  26. 17 Oct, 2016 1 commit
  27. 29 Sep, 2016 3 commits
  28. 30 Jun, 2016 1 commit
    • Lukas Fleischer's avatar
      Distinguish auto-accepted requests · 60cdad28
      Lukas Fleischer authored
      Before commit 9746a654
      
       (Port notification routines to Python,
      2015-06-27), notification emails for automatically closed requests
      explicitly stated that the action was taken "automatically by the Arch
      User Repository package request system". When porting the notification
      routines to Python, this feature was overlooked and emails sent by the
      new script always reported that the requester triggered the acceptance
      or rejection of a request.
      
      This patch reimplements the old behavior such that notifications no
      longer look as if the requester had accepted the request himself.
      Reported-by: Johannes Löthberg's avatarJohannes Löthberg <johannes@kyriasis.com>
      Signed-off-by: Lukas Fleischer's avatarLukas Fleischer <lfleischer@archlinux.org>
      60cdad28
  29. 21 Feb, 2016 1 commit
  30. 19 Feb, 2016 2 commits
    • Lukas Fleischer's avatar
      notify: Fix notification of request initiator · 1626d4d2
      Lukas Fleischer authored
      
      
      Reimplement get_request_recipients() such that it always returns the
      email addresses of the package base maintainer and the request
      initiator, instead of the email address of the user triggering the
      request status change.
      
      Fixes FS#48238.
      Signed-off-by: Lukas Fleischer's avatarLukas Fleischer <lfleischer@archlinux.org>
      1626d4d2
    • Lukas Fleischer's avatar
      notify: Reintroduce Message-ID again · 443ccfab
      Lukas Fleischer authored
      In commit 7b57e0e1 (Set Message-ID when sending package request emails,
      2014-07-01), we changed the code responsible for sending notifications
      such that the value of the Message-ID header is set deterministically in
      the first email referring to a request. Unfortunately, this was
      forgotten when porting the notification routines to Python in 9746a654
      (Port notification routines to Python, 2015-06-27) and later fixed by
      092e00f4 (notify: Fix references in request notifications, 2015-10-10).
      However, when fixing another bug, the old behavior of not setting a
      Message-ID was restored by d87b138a
      
       (notify: Fix merging of header dicts,
      2015-10-26). Revert that particular change once more and add a comment
      such that the line gets extra attention, should it be changed in the
      future.
      
      Fixes FS#48239.
      Signed-off-by: Lukas Fleischer's avatarLukas Fleischer <lfleischer@archlinux.org>
      443ccfab
  31. 07 Feb, 2016 2 commits