3.1 KiB
3.1 KiB
Internal Drop
Internal Drop is a small LAN text and file transfer app for 2 to 3 internal users. It follows the included PRD's recommended MVP: one Go service, embedded static frontend, WebSocket presence/messages, HTTP upload/download, and temporary local file caching.
Features
- Opens without login and assigns each browser a 6-digit user code.
- Restores an unused local code from
localStorage; issues a new code if the old code is online elsewhere. - Shows online peers and nickname changes in real time.
- Sends short text over WebSocket.
- Uploads one file to the server's temporary cache and notifies the receiver.
- Lets the receiver accept, reject, download, and report completion.
- Removes expired cached files using a TTL cleaner.
- Exposes
GET /api/health. - Displays the current server URL and LAN address candidates in the UI.
Configuration
| Environment variable | Default | Description |
|---|---|---|
INTERNAL_DROP_ADDR |
:10051 |
Listen address |
INTERNAL_DROP_TEMP_DIR |
./tmp/internal-drop |
Temporary file cache |
INTERNAL_DROP_MAX_FILE_SIZE |
1073741824 |
Max single upload bytes |
INTERNAL_DROP_FILE_TTL |
2h |
Transfer expiry duration |
INTERNAL_DROP_ALLOWED_CIDRS |
empty | Optional comma-separated client CIDR allowlist, for example 192.168.1.0/24,10.0.0.0/8 |
INTERNAL_DROP_PUBLIC_URLS |
empty | Optional comma-separated URLs to show first in the UI, for example http://10.20.8.138:10051,https://drop.company.lan |
Local Build
go test ./...
go build -o internal-drop .
./internal-drop
Then open http://localhost:10051 in two browser windows.
One-Click macOS Deployment
Build or include the internal-drop binary, copy this project folder to another Mac, then run:
./scripts/deploy-macos.sh
The default installs a per-user LaunchAgent under ~/Library/LaunchAgents and starts http://127.0.0.1:10051. For a system LaunchDaemon:
sudo ./scripts/deploy-macos.sh --system --addr :10051
Useful options:
./scripts/deploy-macos.sh --addr :9090 --allowed-cidrs 192.168.1.0/24
./scripts/deploy-macos.sh --binary ./internal-drop --no-build
Docker Compose
docker compose up --build -d
For production LAN use, put Caddy or Nginx in front of the service and serve it over HTTPS:
https://drop.company.lan -> Caddy/Nginx -> internal-drop:10051
systemd
sudo useradd --system --home /var/lib/internal-drop --shell /usr/sbin/nologin internal-drop
sudo mkdir -p /var/lib/internal-drop
sudo chown internal-drop:internal-drop /var/lib/internal-drop
sudo cp internal-drop /usr/local/bin/internal-drop
sudo cp internal-drop.service.example /etc/systemd/system/internal-drop.service
sudo systemctl daemon-reload
sudo systemctl enable --now internal-drop
API Sketch
POST /api/sessionPATCH /api/mePOST /api/me/regenerate-codePOST /api/uploadsGET /api/downloads/{id}GET /api/healthGET /api/server-infoGET /ws?session_id=...
The user code is only an identifier. Restrict access with LAN/VPN/firewall/reverse-proxy policy.