ecstatic
Slightly NIH Flask-based app to serve static content. It tries to capture 80% of the use-cases that are normally handled by the likes of nginx and Apache, only much slower =).
Other packages that do similar, but not quite the same things:
https://pypi.python.org/pypi/Flask-Ecstatic (sorry about the name!)
Configuration
Ecstatic has a single configuration file whose location is given via an environment variable “ECSTATIC_EXPORTS”. The file is parsed using Python3’s configparser module, with each section being processed from top to bottom.
Whenever a request comes in, a section is checked for whether or not it matches. If a match is found, no further sections are examined and the configuration in said section is used to serve the request.
A section matches a request if it
Has a match key with a regular expression that matches the request’s path or
Has a root section with no match present.
Any other section is ignored.
match-Sections
Any section that contains a match-key must also contain an fspath-key. If the URL path matches the expression given, fspath is interpolated as a format string, with positional arguments from the expression (missing groups are empty strings instead of None).
The section must still contain a root-entry, also a format string, which is used to jail paths.
root-Sections
Any section containing just a root-entry will simply serve content from the given root path, mapping 1:1 onto URLs.
Examples
A simple configuration that serves content from users public_html-directories (which are assumed to all be inside /home) and /var/www otherwise:
[homes]
# exposes /home/bob/public_html/ on http://example.org/~bob/
match = ^~([a-zA-Z0-9]+)(/.*)?$
fspath = /home/{0}/public_html{1}
root = /home/{0}
dirindex = on
[www]
root = /var/www
Metadata
Release files for ecstatic 0.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| ecstatic-0.4.tar.gz | 3.5 kB | Without provenance | Details for ecstatic-0.4.tar.gz |
Release files / ecstatic-0.4.tar.gz
| Download URL | ecstatic-0.4.tar.gz |
|---|---|
| Size | 3.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
018a841a963d002a443b2e782c47f92121d588ff8f5d91af98d0b0ff874cbab6
|
|
BLAKE2b-256 checksum How to use checksums |
7373e3e272ee7fae9213c7ce507c52137330d6493ae5bd860489064d0781ea3d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for ecstatic 0.4
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.