1. 09 Mar, 2022 1 commit
  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. 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
  4. 29 Nov, 2021 1 commit
  5. 25 Nov, 2021 2 commits
  6. 17 Nov, 2021 1 commit
  7. 10 Nov, 2021 1 commit
  8. 09 Nov, 2021 3 commits
  9. 06 Nov, 2021 2 commits
  10. 25 Oct, 2021 1 commit
    • Kevin Morris's avatar
      feat(fastapi): add configurable commit hash display · 0d734eb0
      Kevin Morris authored
      
      
      Two new options have been added:
      
      - [devel] commit_url
          - URL including an %s format specifier that can be used to link
            to a webpage for the commit.
      - [devel] commit_hash
          - HEAD's commit hash (produced via `git rev-parse HEAD`)
      
      If a `[devel] commit_hash` is configured, a link to the commit based on
      `[devel] commit_url` will be displayed in the aurweb footer in
      the form: `HEAD@<commit_hash>`. If no `[devel] commit_url` is
      configured, a non-linked hash will be displayed.
      Signed-off-by: Kevin Morris's avatarKevin Morris <kevr@0cost.org>
      0d734eb0
  11. 21 Oct, 2021 1 commit
  12. 19 Sep, 2021 1 commit
    • Kevin Morris's avatar
      feat(FastAPI): add /packages (get) search · 5cf70620
      Kevin Morris authored
      In terms of performance, most queries on this page win over
      PHP in query times, with the exception of sorting by Voted or
      Notify (archlinux/aurweb#102
      
      ).
      Otherwise, there are a few modifications: described below.
      
      * Pagination
          * The `paginate` Python module has been used in the FastAPI
            project
            here to implement paging on the packages search page. This
            changes how pagination is displayed, however it serves the
            same purpose. We'll take advantage of this module in other
            places as well.
      * Form action
          * The form action for actions now use `POST /packages` to
            perform. This is currently implemented and will be
            addressed in a follow-up commit.
      * Input names and values
          * Input names and values have been modified to satisfy the
            snake_case naming convention we'd like to use as much as
            possible.
          * Some input names and values were modified to comply with
            FastAPI Forms: (IDs[<id>]) -> (IDs, <id>).
      Signed-off-by: Kevin Morris's avatarKevin Morris <kevr@0cost.org>
      5cf70620
  13. 04 Sep, 2021 1 commit
    • Kevin Morris's avatar
      use Poetry to deal with deps and package install · 2f999480
      Kevin Morris authored
      
      
      As the new-age Python package manager, Poetry brings a lot
      of good additions to the table. It allows us to more easily
      deal with virtualenvs for the project and resolve dependencies.
      
      As of this commit, `requirements.txt` is replaced by Poetry,
      configured at `pyproject.toml`.
      
      In Docker and GitLab, we currently use Poetry in a root fashion.
      We should work toward purely using virtualenvs in Docker, but,
      for now we'd like to move forward with other things. The project
      can still be installed to a virtualenv and used on a user's system
      through Poetry; it is just not yet doing so in Docker.
      
      Modifications:
      
      * docker/scripts/install-deps.sh
          * Remove python dependencies.
      * conf/config.defaults
          * Script paths have been updated to use '/usr/bin'.
      * docker/git-entrypoint.sh
          * Use '/usr/bin/aurweb-git-auth' instead of
            '/usr/local/bin/aurweb-git-auth'.
      
      Additions:
      
      * docker/scripts/install-python-deps.sh
          * A script used purely to install Python dependencies with Poetry.
            This has to be used within the aurweb project directory and
            requires system-wide dependencies are installed beforehand.
          * Also upgrades system-wide pip.
      Signed-off-by: Kevin Morris's avatarKevin Morris <kevr@0cost.org>
      2f999480
  14. 18 Aug, 2021 1 commit
  15. 26 Jun, 2021 1 commit
    • Kevin Morris's avatar
      config: add options.salt_rounds · d8556b0d
      Kevin Morris authored
      
      
      During development, the lower this value is (must be >= 4)
      equals faster User generation. This is particularly useful
      for running tests.
      
      In production, a higher value (like 12 which is used by various
      popular frameworks) should be used.
      Signed-off-by: Kevin Morris's avatarKevin Morris <kevr@0cost.org>
      d8556b0d
  16. 23 Jun, 2021 1 commit
  17. 10 Jun, 2021 1 commit
  18. 06 Jun, 2021 1 commit
  19. 20 Feb, 2021 5 commits
  20. 11 Feb, 2020 3 commits
  21. 07 Oct, 2019 1 commit
  22. 06 Aug, 2018 1 commit
  23. 22 Apr, 2018 1 commit
    • Eli Schwartz's avatar
      config: allow reading both the defaults file and the modified config · 97c5bcec
      Eli Schwartz authored and Lukas Fleischer's avatar Lukas Fleischer committed
      
      
      In the process, rename config.proto to config.defaults (because that is
      what it is now).
      
      Also use dict.get('key', default_value) when querying os.environ, rather
      than an if block, as it is more pythonic/readable/concise, and reduces
      the number of dict lookups.
      
      This change allows aurweb configuration to be done via either:
      - copying config.defaults to config and modifying values
      - creating a new config only containing modified values, next to a
        config.defaults containing unmodified values
      
      The motivation for this change is to enable ansible configuration in our
      flagship deployment by storing only changed values, and deferring to
      config.defaults otherwise.
      
      A side benefit is, it is easier to see what has changed by inspecting
      only the site configuration file.
      
      If a config.defaults file does not exist next to $AUR_CONFIG or in
      $AUR_CONFIG_DEFAULTS, it is ignored and *all* values are expected to
      live in the modified config file.
      Signed-off-by: Eli Schwartz's avatarEli Schwartz <eschwartz@archlinux.org>
      Signed-off-by: Lukas Fleischer's avatarLukas Fleischer <lfleischer@archlinux.org>
      97c5bcec
  24. 10 Mar, 2018 1 commit
  25. 24 Feb, 2018 1 commit
  26. 01 Aug, 2017 1 commit
  27. 24 Apr, 2017 1 commit
  28. 23 Apr, 2017 1 commit
  29. 15 Feb, 2017 1 commit
  30. 12 Feb, 2017 1 commit