1. 10 May, 2021 1 commit
    • Kevin Morris's avatar
      port over base HTML layout from PHP to FastAPI+Jinja2 · 79cb7632
      Kevin Morris authored
      
      
      + Mounted static files (at web/html) to /static.
      + Added AURWEB_VERSION to aurweb.config (this is used around HTML
        to refer back to aurweb's release on git.archlinux.org), so we
        need it easily accessible in the Python codebase.
      + Implemented basic Jinja2 partials to put together whole aurweb
        pages. This may be missing some things currently and is a WIP
        until this set is ready to be merged.
      + Added config [options] aurwebdir = YOUR_AUR_ROOT; this configuration
        option should specify the root directory of the aurweb project.
        It is used by various parts of the FastAPI codebase to target
        project directories.
      
      Added routes via aurweb.routers.html:
          * POST /language: Set your session language.
          * GET /favicon.ico: Redirect to /static/images/favicon.ico.
              * Some browsers always look for $ROOT/favicon.ico to get an icon
                for the page being loaded, regardless of a specified "shortcut
                icon" given in a <link> directive.
          * GET /: Home page; WIP.
      
      * Updated aurweb.routers.html.language passes query parameters to
        its next redirection.
      
      When calling aurweb.templates.render_template, the context passed should
      be formed via the aurweb.templates.make_context. See
      aurweb.routers.html.index for an example of this.
      Signed-off-by: Kevin Morris's avatarKevin Morris <kevr@0cost.org>
      79cb7632
  2. 02 May, 2021 1 commit
    • Kevin Morris's avatar
      aurweb: Globalize a Translator instance, add more utility · 93bac8ec
      Kevin Morris authored and Lukas Fleischer's avatar Lukas Fleischer committed
      
      
      + 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>
      93bac8ec
  3. 27 Apr, 2021 1 commit
    • Eli Schwartz's avatar
      git update hook: gracefully error on completely broken .SRCINFO · c767b13b
      Eli Schwartz authored
      
      
      I've seen this happen a bunch of times now. Someone cannot push to the
      AUR, and the error report is some traceback with a KeyError which is
      difficult to understand without context:
      
      remote: Traceback (most recent call last):
      remote:   File "/srv/http/aurweb/aur.git/hooks/update", line 33, in <module>
      remote:     sys.exit(load_entry_point('aurweb==5.0.0', 'console_scripts', 'aurweb-git-update')())
      remote:   File "/usr/lib/python3.9/site-packages/aurweb-5.0.0-py3.9.egg/aurweb/git/update.py", line 306, in main
      remote: KeyError: 'pkgbase'
      
      Eventually it turns out that their .SRCINFO file is... badly corrupted.
      Generally, they managed to accidentally commit an *empty* file instead
      of a .SRCINFO, and in all cases, the problem was on the very first
      lookup for 'pkgbase'.
      
      Point people to the actual failing commit, and have a nicely formatted
      message indicating that the .SRCINFO is completely invalid.
      Signed-off-by: Eli Schwartz's avatarEli Schwartz <eschwartz@archlinux.org>
      c767b13b
  4. 20 Feb, 2021 26 commits
  5. 14 Oct, 2020 1 commit
  6. 27 Aug, 2020 1 commit
  7. 26 Aug, 2020 1 commit
  8. 22 Mar, 2020 1 commit
  9. 27 Feb, 2020 3 commits
  10. 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
  11. 02 Feb, 2020 2 commits