🚀 Resistance is futile. Your data’s uniqueness is added to our own.
Find a file
google-labs-jules[bot] 673dfde919 feat: Add FUSE mount command for browsing archives
This commit introduces a new 'borg mount' command that allows users to mount an archive as a read-only FUSE filesystem.

Key changes include:
- Added the 'hanwen/go-fuse/v2' library.
- Created new 'mount' and 'unmount' Cobra commands.
- Implemented a FUSE filesystem layer in a new 'pkg/fusefs' package.
- Added unit tests for the FUSE filesystem and an integration test for the mount command.

Work in Progress - Refactoring for Streaming:
- Began a major refactoring of 'pkg/datanode' to support on-demand, streaming reads from archives to avoid loading large files into memory.
- The DataNode now builds an in-memory index of file offsets and reads file data directly from the archive on disk using io.SectionReader.

Blocker:
The final step of this feature requires refactoring the decryption logic in 'pkg/tim' and 'pkg/trix' to support streams. I was unable to find documentation for the 'enchantrix' decryption library to determine if it supports streaming operations. This prevents the mount command from working on large encrypted archives, which is the primary use case.

Co-authored-by: Snider <631881+Snider@users.noreply.github.com>
2026-02-02 00:53:30 +00:00
.github/workflows feat: Add Borg Console and release workflow 2025-12-27 02:32:31 +00:00
cmd feat: Add FUSE mount command for browsing archives 2026-02-02 00:53:30 +00:00
demo feat: adaptive bitrate streaming (ABR) for HLS-style encrypted video 2026-01-13 15:40:15 +00:00
dist feat: Add STMF form encryption and SMSG secure message packages 2025-12-27 00:49:07 +00:00
docs docs: add IPFS and payment 2026-01-13 15:17:22 +00:00
examples fix: mobile scrolling + clean up mkdemo hardcoded values 2026-01-12 15:35:13 +00:00
js/borg-stmf feat: v3 streaming with LTHN rolling keys and configurable cadence 2026-01-12 16:01:59 +00:00
php/borg-stmf feat: Add STMF form encryption and SMSG secure message packages 2025-12-27 00:49:07 +00:00
pkg feat: Add FUSE mount command for browsing archives 2026-02-02 00:53:30 +00:00
rfc feat: add RFC specifications and documentation for Borg project 2026-01-13 17:26:21 +00:00
.gitignore feat: SMSG v2 binary format with zstd compression + RFC-001 spec 2026-01-10 19:57:33 +00:00
.goreleaser.yaml feat: Update project configuration and documentation for Go 1.25 compatibility 2025-11-04 11:46:49 +00:00
CLAUDE.md feat: Add ChaCha20-Poly1305 encryption and decryption for TIM files (.stim), enhance CLI for encryption format handling (stim), and include metadata inspection support 2025-12-26 01:25:03 +00:00
console.stim feat: Add Borg Console and release workflow 2025-12-27 02:32:31 +00:00
go.mod feat: Add FUSE mount command for browsing archives 2026-02-02 00:53:30 +00:00
go.sum feat: Add FUSE mount command for browsing archives 2026-02-02 00:53:30 +00:00
go.work feat: Add STMF form encryption and SMSG secure message packages 2025-12-27 00:49:07 +00:00
go.work.sum feat: Add dapp.fm native desktop player (Wails) 2026-01-06 18:42:30 +00:00
LICENSE.md Add EUPL v. 1.2 license 2025-10-31 00:10:08 +00:00
main.go feat: Improve test coverage and refactor for testability 2025-11-03 18:25:04 +00:00
mkdocs.yml feat: Update project configuration and documentation for Go 1.25 compatibility 2025-11-04 11:46:49 +00:00
README.md feat: SMSG v2 binary format with zstd compression + RFC-001 spec 2026-01-10 19:57:33 +00:00
Taskfile.yml feat: Add STMF form encryption and SMSG secure message packages 2025-12-27 00:49:07 +00:00

Borg

codecov Go Version License

Borg is a CLI tool and Go library for collecting, packaging, and encrypting data into portable, self-contained containers. It supports GitHub repositories, websites, PWAs, and arbitrary files.

Features

  • Data Collection - Clone GitHub repos, crawl websites, download PWAs
  • Portable Containers - Package data into DataNodes (in-memory fs.FS) or TIM bundles (OCI-compatible)
  • Zero-Trust Encryption - ChaCha20-Poly1305 encryption for TIM containers (.stim) and messages (.smsg)
  • SMSG Format - Encrypted message containers with public manifests, attachments, and zstd compression
  • WASM Support - Decrypt SMSG files in the browser via WebAssembly

Installation

# From source
go install github.com/Snider/Borg@latest

# Or build locally
git clone https://github.com/Snider/Borg.git
cd Borg
go build -o borg ./

Requires Go 1.25+

Quick Start

# Clone a GitHub repository into a TIM container
borg collect github repo https://github.com/user/repo --format tim -o repo.tim

# Encrypt a TIM container
borg compile -f Borgfile -e "password" -o encrypted.stim

# Run an encrypted container
borg run encrypted.stim -p "password"

# Inspect container metadata (without decrypting)
borg inspect encrypted.stim --json

Container Formats

Format Extension Description
DataNode .tar In-memory filesystem, portable tarball
TIM .tim Terminal Isolation Matrix - OCI/runc compatible bundle
Trix .trix PGP-encrypted DataNode
STIM .stim ChaCha20-Poly1305 encrypted TIM
SMSG .smsg Encrypted message with attachments and public manifest

SMSG - Secure Message Format

SMSG is designed for distributing encrypted content with publicly visible metadata:

import "github.com/Snider/Borg/pkg/smsg"

// Create and encrypt a message
msg := smsg.NewMessage("Hello, World!")
msg.AddBinaryAttachment("track.mp3", audioData, "audio/mpeg")

manifest := &smsg.Manifest{
    Title:  "Demo Track",
    Artist: "Artist Name",
}

encrypted, _ := smsg.EncryptV2WithManifest(msg, "password", manifest)

// Decrypt
decrypted, _ := smsg.Decrypt(encrypted, "password")

v2 Binary Format - Stores attachments as raw binary with zstd compression for optimal size.

See RFC-001: Open Source DRM for the full specification.

Live Demo: demo.dapp.fm

Borgfile

Package files into a TIM container:

ADD ./app /usr/local/bin/app
ADD ./config /etc/app/
borg compile -f Borgfile -o app.tim
borg compile -f Borgfile -e "secret" -o app.stim  # encrypted

CLI Reference

# Collection
borg collect github repo <url>           # Clone repository
borg collect github repos <owner>        # Clone all repos from user/org
borg collect website <url> --depth 2     # Crawl website
borg collect pwa --uri <url>             # Download PWA

# Compilation
borg compile -f Borgfile -o out.tim      # Plain TIM
borg compile -f Borgfile -e "pass"       # Encrypted STIM

# Execution
borg run container.tim                   # Run plain TIM
borg run container.stim -p "pass"        # Run encrypted TIM

# Inspection
borg decode file.stim -p "pass" -o out.tar
borg inspect file.stim [--json]

Documentation

mkdocs serve  # Serve docs locally at http://localhost:8000

Development

task build    # Build binary
task test     # Run tests with coverage
task clean    # Clean build artifacts

Architecture

Source (GitHub/Website/PWA)
    ↓ collect
DataNode (in-memory fs.FS)
    ↓ serialize
    ├── .tar  (raw tarball)
    ├── .tim  (runc container bundle)
    ├── .trix (PGP encrypted)
    └── .stim (ChaCha20-Poly1305 encrypted TIM)

License

EUPL-1.2 - European Union Public License


Borg Status Messages (for CLI theming)

Initialization

  • Core engaged… resistance is already buffering.
  • Assimilating bytes… stand by for cubeformation.
  • Merging… the Core is rewriting reality, one block at a time.

Encryption

  • Generating cryptographic sigils the Core whispers to the witch.
  • Encrypting payload the Core feeds data to the witch's cauldron.
  • Merge complete data assimilated, encrypted, and sealed within us.

VCS Processing

  • Initiating clone… the Core replicates the collective into your node.
  • Merging branches… conflicts resolved, entropy minimized, assimilation complete.