# `webls`
Simple file browser over HTTP
Demo: https://webls.x4204.xyz/fs/
## Prerequisites
- `python 3.12`
- `poetry`
## Setup
- create virtual environment
```
poetry env use 3.12
```
- enter virtual environment
```
poetry shell
```
- install dependencies
```
poetry install
```
- setup `storage/` directory for development and testing
```
sudo bash scripts/setup-storage.sh
```
- run tests
```
python -m tests -v
```
- run app
```
python -m webls --help
python -m webls
```
## Docker
- build image
```
docker build \
--build-arg UID=$(id -u) \
--build-arg GID=$(id -g) \
--tag webls:local .
```
- run container and serve a specific host directory
```
docker run \
--rm \
--network=host \
--volume /path/to/dir:/app/storage \
webls:local
```
## TODO
- ?migrate to werkzeug
- https://werkzeug.palletsprojects.com/en/3.0.x/
- ?support downloading a directory (with confirmation; zip)
## NOTES
- export pip requirements
```
bash scripts/export-pip-requirements.sh
```
- `templates/highlight.css` is generated by:
```python
from pygments.formatters import HtmlFormatter
print(HtmlFormatter().get_style_defs('.highlight'))
```