Files

5.5 KiB

RouterShelf

USB file sharing for small Linux routers, with two independently runnable Go services:

Service Access Start here
routershelf Public, unauthenticated, read-only HTTP/HTTPS Web setup
routershelf-smb Private, authenticated SMB for Finder; read-only by default, optional writes SMB setup

Run either service or both. SMB requires no web configuration, public domain, or certificates. Each service has its own configuration, account policy, supervisor, and update/recovery procedure.

The web service provides NAIS directory listings, downloads, copied links, DPL playlists, static pages, HEAD/byte ranges, and automatic HTTPS for one hostname. The experimental SMB service lets Finder browse and manage explicitly selected storage using macOS's built-in client.

The web root is public. HTTPS protects transport but adds no authentication. Keep private SMB folders separate by default; deliberately overlapping storage can publish uploaded content immediately. Read security boundaries before installation.

Setup and operation

For web sharing, follow network and storage preparation, then installation. Configure a private copy of .env.example; configuration covers environment values, flags and reload. The operations guide covers health checks, troubleshooting, updates, rollback and removal. Static pages explains index precedence and inline assets.

For Finder, follow the SMB guide: build, choose storage, create credentials, configure a private copy of .smb.example.json, and install its independent supervisor. The same guide covers permissions, status, troubleshooting, updates and removal. SMB is private by default and must not inherit public web forwarding.

The Padavan deployment examples are optional and firmware-specific. A gateway such as MikroTik can forward public HTTP/HTTPS; a gateway is not needed for local SMB. No runtime, compiler, package installation, or shared library is required on the router.

Development

Use Go 1.26 and Python 3.10+ on the development computer. From the repository root:

make test          # Go tests, shell/config checks, Python tool tests
make check         # Also formatting, docs/source hygiene, vet and race tests
make build         # Native dist/routershelf and dist/routershelf-smb
make build-router  # Both static Linux/MIPS LE soft-float executables

The existing make build-mipsle and make build-smb-mipsle targets remain available independently. Builds go under ignored dist/; private configurations and local reports stay ignored. Nothing here deploys automatically. See contributing for validation, native-client checks and distribution guidance.

Code and documentation

cmd/routershelf/       Web configuration, startup, TLS and connection limits
cmd/routershelf-smb/   SMB configuration, startup and storage supervision
internal/web/         Public HTTP handlers, listings, static files and tests
internal/theme/       Embedded NAIS assets and their license
internal/smbwire/     Adapted SMB protocol implementation, license and tests
deploy/padavan/       Independent firmware supervisor examples
scripts/              Local checks, gateway planning and test tools
docs/                 User guides, architecture and validation records
examples/             Separate historical LAN status-dashboard tutorial

Read architecture for responsibilities and dependency boundaries. Web deployment history and SMB validation distinguish observed results from remaining hardware checks. The SMB implementation decision records backend tradeoffs and maintenance obligations. Stress testing describes the opt-in bounded load tool; local tests do not authorize live load.

Compatibility and limitations

Observed target: Padavan-derived firmware, MediaTek MT7621 MIPS little-endian, Linux 3.4.113, BusyBox 1.24.2, approximately 128 MiB RAM, no swap, and exFAT USB storage. The recorded toolchain is Go 1.26.5. Other firmware, architectures and toolchains require target testing.

Web HTTPS and read-only operations have been observed on that target. SMB authentication, protected disk-root access, small checksum-verified transfers, Finder copy/Quick Look and independent restart have also been observed. exFAT refused arbitrary timestamp restoration by the non-root SMB account. SMB remains experimental; full reboot, USB-loss recovery, large native transfers, complete Mac metadata compatibility and sustained combined load remain unverified. Compilation and desktop tests alone do not prove device compatibility.

License and distribution

RouterShelf project code is MIT licensed. Embedded SMB code retains Apache-2.0; NAIS retains its MIT license. Preserve third-party notices and module license obligations when distributing.

Keep configuration, NT hashes, passwords, certificates, router exports, USB data and diagnostics out of source archives. Read contribution and distribution guidance before sharing source or binaries. Project identity and compatibility metadata are in project.json; no remote or release is assumed.