- Python 52.4%
- JavaScript 32.3%
- HTML 15.3%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
| src | ||
| .gitignore | ||
| COPYING | ||
| COPYING.LESSER | ||
| MANIFEST.in | ||
| pyproject.toml | ||
| README.md | ||
splent_feature_file_manager
The file_manager feature of a SPLENT product line.
A SPLENT feature is a Python package that a product composes with others:
its models, routes, services, templates and hooks are registered when the
product starts. What this feature provides and requires is listed in the
[tool.splent.contract] section of pyproject.toml, which
splent feature:contract --write keeps in sync with the source.
Use it in a product
splent feature:add splent_feature_file_manager
filesd, in production
The web app never opens a person's folder as itself. With FILE_MANAGER_URL
set it asks filesd, which forks a process per request that becomes the
folder's owner before touching anything, so the kernel (and the NFS server)
apply that person's permissions and quota. filesd needs only the standard
library: copy filesd.py and files.py side by side to the machine that
mounts the folders and run it as root with no capability but SETUID and
SETGID, for instance with systemd:
[Service]
EnvironmentFile=/etc/filesd.env # FILE_MANAGER_TOKEN, FILE_MANAGER_DIR, FILE_MANAGER_HOST
ExecStart=/usr/bin/python3 /opt/filesd/filesd.py
CapabilityBoundingSet=CAP_SETUID CAP_SETGID
AmbientCapabilities=
NoNewPrivileges=yes
Listen only where the web app reaches it (FILE_MANAGER_HOST, the Docker
bridge for instance), and give both sides the same FILE_MANAGER_TOKEN.
Without FILE_MANAGER_URL the app opens the folders itself, which is what
development and tests do.
Develop
splent feature:test splent_feature_file_manager
splent feature:contract splent_feature_file_manager
Release
splent feature:release splent_feature_file_manager --dry-run --bump patch
splent feature:release splent_feature_file_manager
The first command rehearses the release and changes nothing. The second publishes it to the git forge and to PyPI, and a PyPI version is permanent.