x4204 / webls

Simple file browser over HTTP

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

NOTES

  • export pip requirements
bash scripts/export-pip-requirements.sh
  • templates/highlight.css is generated by:
from pygments.formatters import HtmlFormatter
print(HtmlFormatter().get_style_defs('.highlight'))

About

Simple file browser over HTTP

License:MIT License


Languages

Language:Python 74.0%Language:CSS 15.0%Language:HTML 9.4%Language:Shell 1.0%Language:Dockerfile 0.6%