Skip to content

v0.6.6: Termux/Android + FreeBSD support, binary-size refactor - #29

Merged
bethropolis merged 23 commits into
mainfrom
dev
Aug 8, 2026
Merged

v0.6.6: Termux/Android + FreeBSD support, binary-size refactor#29
bethropolis merged 23 commits into
mainfrom
dev

Conversation

@bethropolis

Copy link
Copy Markdown
Owner

Summary

Release prep for v0.6.6.

  • Termux/Android support: clipboard via termux-clipboard-set/get, $PREFIX paths in online-install.sh, android/arm64 GoReleaser target
  • FreeBSD compile support: storage_unix int cast, exec-free notification fallback (notify_unix/notify_darwin/notify_windows)
  • Binary size reduction (no UPX): 15MB → 13MB stripped
    • gorilla/mux → stdlib http.ServeMux (Go 1.22 method patterns)
    • beeep → exec-based notifications (notify-send/osascript/PowerShell)
    • zaplog/slog wrapper
    • viper → hand-rolled config.Source (env > file > default on yaml.v3)
  • -trimpath + strip in release build flags
  • Drop CHANGELOG.md; restore installer box alignment

Verification

  • go build/vet/test ./... green; all cross-compile targets build (linux/darwin/windows/android/freebsd)

…ick flag

- PeerCache: LRU 50-entry cap, 14-day stale eviction, auto-cache on --ip
- SendDiscoveryAnnouncement: 3 UDP bursts 30ms apart to reduce Wi-Fi loss
- ScanNetwork: 150ms TCP pre-probe before HTTP register, semaphore 256
- SendFiles: cache probe (400ms) -> multicast (1.2s) -> subnet scan cascade
  with fast mode skipping the scan tier
- DiscoveryStrategy config field, --quick/-q flag on send command
- Root GET / handler with embedded HTML template fixes browser 404
- Terminal QR code generation via qrterminal for mobile scanning
- Download success notification printed to terminal
- --once flag stops server automatically after first download
- HTTPS default guidance notice for self-signed certs
…n tracking

- Known config key schema with type, range, and enum validation
- Typo detection with Levenshtein 'did you mean?' suggestions
- config unset removes a key from config file
- config open opens config in system editor (nvim)
- config add/remove for list-type config values
- config list shows origin tags [file]/[env]/[default]
- Shell completion helper
…gerprint

- ProtocolVersion bumped 2.0 -> 2.1
- send --ip now stores and verifies fingerprints via PeerCache for TOFU
- Exported VerifyDeviceFingerprint for use by CLI commands
- send --pin <code> adds PIN to prepare-upload and upload URLs
- Receiver already validates PIN on prepare-upload
- Works for both --ip and discovery-based send
- .gitignore: narrow 'config' to '/config' so pkg/config/ is not ignored
- README: add LOCALSEND_CLIPBOARD_READ/WRITE_CMD env vars
- send.go: add PIN query param to prepare-upload URL
- qrterminal.BLACK/WHITE are ANSI full-block sequences, not compatible
  with HalfBlocks mode
- Switched to GenerateHalfBlock() which sets correct unicode characters
- share: --once, --https, --once examples, --iface
- send: --quick/-q, --pin, mDNS --ip example, --iface
- config: subcommand listing (get/set/add/remove/list/unset/open/path)
- Main help: new examples for --quick, --ip, --once, config set/list
- Env vars: DISCOVERY_STRATEGY, FILE_CONFLICT_RESOLUTION, BIND_ADDRESS,
  CONCURRENCY, SHELL, CLIPBOARD_READ/WRITE_CMD, TLS_CERT/KEY, NOTIFICATION_CMD
…aticPeers, TrustedFingerprints)

- BindAddress: server.go binds to configured address instead of 0.0.0.0
- FileConflictResolve: receive_upload.go supports skip/overwrite/rename
- StaticPeers: Config field + viper load + Tier 1 probe in send.go (400ms per peer)
- TrustedFingerprints: Config field + viper load + bypass transfer prompt on match
- Fix duplicate sendpin check in cmd/send.go
- Extract web share code to webshare.go with green monospace theme
- Fix CSP to allow inline styles for web share page
- QR scheme follows actual http/https, HTTPS fingerprint shown in share output
- Add web share tests
The prepare-upload handler was short-circuiting clipboard messages with a
204 No Content response after writing to clipboard. The official LocalSend
mobile app does not handle 204 and remains in a waiting state.

Fix: remove the early return and let clipboard messages fall through to the
normal create-session + upload flow. The upload handler already writes to
clipboard or saves as file when it receives the text/plain upload.
Clipboard send was broken by two issues:
1. prepare-upload handler fell through to create-session + upload flow,
   causing the mobile app to wait for an upload that never came and a
   double-prompt on the receiver.
2. clipboard.Write() used CombinedOutput() which created stdout/stderr
   pipes. xclip/wl-copy fork a background daemon that inherits those
   pipes, causing Go's cmd.Wait() to hang forever. The 204 response was
   never sent until Ctrl+C killed the daemon.

Fix:
- Write clipboard content immediately in prepare-upload (after prompt
  acceptance), print confirmation to stderr, pause 1s for client timing,
  then return 204 No Content. The mobile app receives 204 and closes
  the session immediately. No session is created for clipboard messages.
- Replace CombinedOutput() with CommandContext(3s timeout) + /dev/null
  for stdout/stderr + Run(). The xclip daemon no longer inherits pipes,
  so clipboard.Write returns in <10ms.
- Same timeout guard applied to Read() for consistency.
go mod tidy moves github.com/mdp/qrterminal/v3 from // indirect to
direct dependency. Also fix protocol description in goreleaser.yaml
and README (v2.1 → v2 per spec).
- Expand CLI_REFERENCE.md with --quick, --pin, config add/remove/open/unset
- Add missing env vars to README.md and CONFIGURATION.md
- Fix --probe flag (no -p short flag, conflicts with --private)
- Fix config.go error message showing internal type instead of key name
- Add --no-color, --version to docs, --once/--range examples
- Add android/arm64 build target to GoReleaser (.goreleaser.yaml)
- Ignore android/amd64 (requires CGo, not supported with CGO_ENABLED=0)
- Update online-install.sh: detect Termux via TERMUX_VERSION / uname -o
- Skip systemd service installation on Android
- Update header and platform detection messages
- Fix Bavail type mismatch in storage_unix.go (int64 on FreeBSD)
- Split notification behind build tags: beeep on !freebsd,
  log-based fallback on freebsd (godbus/dbus requires CGo on FreeBSD)
- freebsd/amd64 and freebsd/arm64 both compile with CGO_ENABLED=0
- Add clipboard_android.go: auto-detect termux-clipboard-set/get
- Fix clipboard_unix.go build tag: exclude android (Go sets both
  android and linux tags when GOOS=android)
- Update online-install.sh: use /bin on Termux
- Swap gorilla/mux Router for net/http.ServeMux with Go 1.22 method patterns
  (securityMiddleware now wraps the mux as the server Handler)
- Replace beeep desktop notifications with exec-based fallbacks:
  notify-send (unix), osascript (darwin), PowerShell balloon (windows)
- Delete notify_beeep.go and notify_freebsd.go; drop beeep, godbus/dbus,
  esiqveland/notify, gorilla/mux and their transitive deps from go.mod
- Rewrite pkg/logging on log/slog with a Logger type mirroring the
  zap SugaredLogger surface (Infof/Warnf/Errorf/Debugf/Info/Warn/Error/
  Debug/Infow/Warnw/Errorw/Debugw) so call sites only need type renames
- Add multiHandler fan-out (file + colored console) and a compact
  consoleHandler rendering "15:04:05  LEVEL  message"
- Mechanical rename across 31 files: *zap.SugaredLogger -> *logging.Logger,
  zap.S() -> logging.Global(), zap.NewNop().Sugar() -> logging.NewQuiet()
- httputil/response.go: zap.L()/zap.Error() fallback -> logging.Global()
- Drop go.uber.org/zap and go.uber.org/multierr from go.mod
- Add pkg/config/source.go: Source resolves values with precedence
  overrides > env (LOCALSEND_*) > file > defaults, using gopkg.in/yaml.v3
- Rewrite LoadConfig/getSecurityDir to take *Source; delete viper.go
- root.go: ViperCfg is now *config.Source; --config uses LoadSourceFile
- Rewrite config subcommands (get/set/add/remove/list/unset/open/path)
  against Source; 'config set' now writes only explicitly-set keys
- config_test.go injection seam -> NewSourceFromMap
- Drop viper and its transitive deps (hcl, go-toml, ini, afero, cast,
  mapstructure, gotenv, fsnotify, conc, locafero, slog-shim); promote
  gopkg.in/yaml.v3 to a direct dependency
@bethropolis
bethropolis merged commit e00d46a into main Aug 8, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant