Refactored lightweight file sharing server with explicit runtime modes and optional Cloudflare tunnel.
local: bind to loopback only, tunnel disabled.lan: bind to LAN interface (0.0.0.0by default), tunnel disabled by default.public: tunnel enabled by default.
User settings are now persisted as JSON (not YAML).
- Default settings path on Windows:
%APPDATA%\63xkyFileServer\settings.json
- Override settings path:
--config C:\path\to\settings.json
CLI arguments override persisted settings for the current run.
Use --save to write current effective settings back to JSON.
python fileserver.py --mode localOr:
python -m fileshare_app.app --mode lan --host 0.0.0.0 --port 8080 --directory .\files--mode {local,lan,public}--host <ip-or-localhost>--port <0-65535>--directory <path>--tunnel {on,off,auto}--no-browser--config <path-to-settings-json>--save--admin-routes--no-monitor--threads <int>--max-downloads <int>
Defaults:
threads=16max_downloads=12max_downloadsmust be lower thanthreadsso lightweight web requests retain worker capacity during large downloads.
- Admin routes are disabled by default and only allowed from loopback when enabled.
- Download path resolution is locked to the shared root to prevent path traversal.
- Cloudflare tunnel startup has explicit timeout/failure handling.
- In monitor mode, hotkeys are available:
Qquit (with Y/N confirmation)Pchange shared folder path liveTtoggle subdirectory traversalOswitch server port live (in-process restart)Lcycle request logging verbosity:no->basic->medium->full
- Web file list includes one-click command copy buttons per file:
curl.exe -L "<url>" -o "<filename>"Invoke-WebRequest -Uri "<url>" -OutFile "<filename>"
python -m unittest discover -s tests -v