tuxpub
The Serverless File Server
tuxpub is a python/flask application which provides a file browsing interface to S3, and is designed to be run serverlessly with Zappa.
An example tuxpub deployment can be found at storage.lkft.org.
Configuration
Configuration is handled through environment variables. The following configuration variables are used.
S3_BUCKET- required: True
- description: S3 bucket name containing the files to serve. Example:
storage.staging.lkft.org
S3_REGION- required: True
- description: Region containing the S3 bucket. Example:
us-east-1
ROOT_INDEX_LISTING- required: False
- description: Defaults to
True. Set toFalseto hide the top level directory/file listing.
SITE_TITLE- required: False
- description: Defaults to
Tuxpub. Set to anything you like for a global site title.
Run Locally
To run locally, install tuxpub, ensure AWS access is available environmentally, and run:
S3_BUCKET=storage.staging.lkft.org S3_REGION=us-east-1 ROOT_INDEX_LISTING=True FLASK_APP=tuxpub flask run
Run with Zappa
This application is intended to be ran and deployed with Zappa and hosted by AWS API Gateway and Lambda.
To use with Zappa, create an app shim named zappa_init.py:
# When using a flask app factory, this file is required.
# See https://github.com/Miserlou/Zappa/issues/1771
# and https://github.com/Miserlou/Zappa/pull/1775
from tuxpub import create_app
app = create_app()
An example zappa_settings.json file may look like:
{
"dev": {
"app_function": "zappa_init.app",
"aws_region": "us-east-1",
"project_name": "lkft-tuxpub",
"runtime": "python3.7",
"s3_bucket": "zappa-tuxpub",
"environment_variables": {
"S3_BUCKET": "storage.dev.lkft.org",
"S3_REGION": "us-east-1",
"ROOT_INDEX_LISTING": "True",
}
}
}
Features
Export Formats
By default pages are served using HTML. If export=json is appended to a
listing URL, a json representation of the page will be provided. This option is
ignored when requesting specific files.
Example:
curl http://localhost/path/to/files/?export=json
Root Index listing
By default this application will display the directories and files on the root
page. However, a user might not want to allow people to crawl through the S3
bucket. You can set ROOT_INDEX_LISTING=False, which will render a empty root
index page.
Metadata
Release files for tuxpub 0.1.11
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 |
|---|---|---|---|---|
| tuxpub-0.1.11.tar.gz | 9.6 kB | Without provenance | Details for tuxpub-0.1.11.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| tuxpub-0.1.11-py3-none-any.whl | Python 3 | none | any | Details for tuxpub-0.1.11-py3-none-any.whl |
Total release size: 19.5 kB
Release files / tuxpub-0.1.11.tar.gz
| Download URL | tuxpub-0.1.11.tar.gz |
|---|---|
| Size | 9.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
27cfb675242232f2f8c0f22ebe75d5f80a8eeae9029ba89dfd465b0d73b7ade0
|
|
BLAKE2b-256 checksum How to use checksums |
2da9ee1c10c40ef0ce169c49459b47bbcbfbc46958fce01ad3f131a9ca2b493a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.9.7
|
Release files / tuxpub-0.1.11-py3-none-any.whl
| Download URL | tuxpub-0.1.11-py3-none-any.whl |
|---|---|
| Size | 9.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
bdfe4c99b2a8496667f5f879ffcc8a42deefb26927478016ff25843ea97e9f16
|
|
BLAKE2b-256 checksum How to use checksums |
86500d56ed9f0d62b5cd1973293f2aab39dcd65763845c7ef55629cfdcd19d3c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.9.7
|
Security for tuxpub 0.1.11
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.