Package the service for setup on a new machine:
- install.sh generates a token, writes share.config (mode 600, token
stored as a SHA-256 hash) and installs the systemd user unit from
share.service.template
- share.config is now gitignored, with share.config.example as the
tracked template — the config holds the secret and must not be in
the repo
- warn at startup when token is empty, since that means open access
- SETUP.md documents install, verification and security posture
- get_local_ip: use context manager to prevent socket leak
- _route_files: single stat() per file instead of two
- _safe_path helper: DRY path resolution for download/delete
- load_config: loop over vars(args) instead of 6 repetitive blocks
- Remove stale comment from index.html
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Server-side _file_type() now uses mimetypes for images/known text,
and falls back to null-byte check on first 8KB for everything else.
Client uses the "type" field from /files API instead of local extension sets.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>