Commit graph

6 commits

Author SHA1 Message Date
Franciszek Stachura
6559c597c8 web: Update Jinja to v3.1.5
Changelog: https://jinja.palletsprojects.com/en/stable/changes/
2025-02-14 09:51:11 +01:00
Franciszek Stachura
60213dddfa web: Update Falcon from dev to v4.0.2
Changelog: https://falcon.readthedocs.io/en/stable/changes/4.0.0.html

It mentions PathConverter, which was the feature we depended in the
development branch.
2025-02-14 09:50:34 +01:00
Franciszek Stachura
5e8eb77912 Migrate from bsddb3 to berkeleydb
Following official documentation, move away from bsddb3 to berkeleydb.
https://www.jcea.es/programacion/pybsddb.htm

Main change: key and values are now bytes and not strings.

The code diff is really simple because all operations on keys/values is
done from elixir/data.py and that works fine with both bytes and
strings (it does explicit casting).
2024-11-07 16:55:14 +01:00
Franciszek Stachura
4779965e0f Fix styles for latest version of Pygments
Pygments 2.12.0 slightly changed the order of HTML elements which
makes line numbers look weird with current CSS styles.

Quoting changelog:
> When linenos=table is used, the <table> itself is now wrapped
> with a <div class="highlight"> tag instead of placing it
> inside the <td class="code"> cell (#632.) With this change,
> the output matches the documented behavior.

https://pygments.org/docs/changelog/#version-2-12-0
Related issue: https://github.com/pygments/pygments/issues/632

This commit aims to fix this by further restricting CSS selectors
that selected everything under .highlight to only select source code
related elements - descendants of .code in the new layout.

This was also tested on Pygemnts 2.14.0, version currently packaged
for Debian Bookworm
https://packages.debian.org/bookworm/armel/python3-pygments
2024-11-05 23:20:51 +01:00
Franciszek Stachura
6e01f3b023 Dockerfile: update to support WSGI Elixir
* Build bsddb in a separate stage to avoid using system packages in venv
* Update Docker Apache config to support WSGI
2024-08-27 11:33:19 +02:00
Franciszek Stachura
bcc76c521b web.py: Refactor to use the Falcon framework
* Add requirements.txt with packages used by WSGI Elixir
* Make API compatible with latest Falcon
* Remove remaining global variables from web.py
* Remove Parsed__Path

Falcon passes parsed path segments as arguments to handler methods.
I think it really does not make sense anymore to put that information
back into a tuple just to unpack it again.

* Add RawPathComponent middleware to support encoded slashes

Some paths previously accepted by Elixir can contain encoded slashes.
For example:
/arm-trusted-firmware/sandbox%2Flts-v2.10.3-20240405T0714/source

Falcon by default uses a version of URL that is already decoded. This
default makes parsing said paths impossible.

https://falcon.readthedocs.io/en/v3.1.2/user/recipes/raw-url-path.html

* Move request context building to middleware
* Move validation and unquoting to path converters
* Move base url generation to new functions
2024-08-27 11:32:17 +02:00