Skip to content
/ roar Public

Takes a directory of RAR archives and presents the files within those archives as if there was no RAR

License

Notifications You must be signed in to change notification settings

yamatt/roar

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

97 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

roar 🦁

CI Go Version Go Report Card License Release Docker Image

A FUSE filesystem that takes directories containing RAR archives and presents the files within those archives as if there were no RAR files.

Features

  • Present RAR archive contents as a transparent virtual filesystem
  • Support for split RAR archives:
    • New style: .part1.rar, .part2.rar, etc.
    • Old style: .rar, .r00, .r01, etc.
  • Support for RAR5 format
  • Read-only access to archive contents
  • Pass-through for non-RAR files (files that aren't RAR archives are accessible in the mounted filesystem)
  • Efficient file caching for repeated reads
  • Automatic change detection: Uses inotify to watch for changes in the source directory and automatically updates the mounted filesystem when any files or directories are added, removed, renamed, or modified

Requirements

Runtime Requirements

  • Linux with FUSE support
  • FUSE libraries installed on your system

Installing FUSE Libraries

Debian/Ubuntu:

sudo apt-get install fuse libfuse2

Fedora/RHEL/CentOS:

sudo dnf install fuse fuse-libs

Arch Linux:

sudo pacman -S fuse2

Build Requirements

  • Go 1.25 or later
  • FUSE development headers (for building)

Debian/Ubuntu:

sudo apt-get install libfuse-dev

Fedora/RHEL/CentOS:

sudo dnf install fuse-devel

Arch Linux:

sudo pacman -S fuse2

Installation

From Source

go install github.com/yamatt/roar/cmd/roar@latest

Building Locally

git clone https://github.com/yamatt/roar.git
cd roar
go build -o roar ./cmd/roar

Using Docker

Pre-built Docker images are available on GitHub Container Registry:

docker pull ghcr.io/yamatt/roar:latest

Usage

roar [options] <source_directory> <mount_point>

Options

  • -v, --version: Show version and exit
  • --allow-other: Allow other users to access the mounted filesystem (requires user_allow_other in /etc/fuse.conf)

Environment Variables

  • ROAR_LOG_LEVEL: Set the log level (debug, info, warn, error). Default: info

Example

Suppose you have a directory structure like this:

/data/archives/
β”œβ”€β”€ archive1/
β”‚   β”œβ”€β”€ compressed-1.rar
β”‚   β”œβ”€β”€ compressed-1.r00
β”‚   └── compressed-1.r01
β”œβ”€β”€ archive2/
β”‚   β”œβ”€β”€ compressed-2.part1.rar
β”‚   β”œβ”€β”€ compressed-2.part2.rar
β”‚   └── compressed-2.part3.rar
└── archive3/
    β”œβ”€β”€ compressed-3.rar
    └── info.txt

Mount it with roar:

mkdir /mnt/unarchived
roar /data/archives /mnt/unarchived

Now you can access the contents directly:

/mnt/unarchived/
β”œβ”€β”€ archive1/
β”‚   └── home-movie.mkv
β”œβ”€β”€ archive2/
β”‚   └── video.mp4
└── archive3/
    β”œβ”€β”€ my-project.avi
    └── info.txt    # Non-RAR files are passed through

To unmount:

fusermount -u /mnt/movies
# or press Ctrl+C if running in foreground

Running as a Service

When running roar as a system service (e.g., with systemd, Horust, or similar), you'll typically need to use the --allow-other flag to allow users other than the service user to access the mounted filesystem.

Prerequisites

First, ensure that /etc/fuse.conf has user_allow_other enabled:

sudo nano /etc/fuse.conf

Uncomment or add this line:

user_allow_other

Example Service Configuration

When starting roar as a service, include the --allow-other flag:

roar --allow-other /data/archives /mnt/movies

Without this flag, only the user running the service will be able to see the mounted filesystem contents. Other users (including when you SSH in) will see an empty directory.

How It Works

roar uses the FUSE (Filesystem in Userspace) interface to present a virtual filesystem. When you mount a source directory:

  1. roar discovers only the immediate children of the source directory (lazy loading)
  2. Subdirectories are discovered lazily when you navigate into them
  3. RAR archives are scanned only when their containing directory is accessed
  4. File reads are serviced by extracting the requested portion from the archive
  5. Non-RAR files in the source directories are passed through and accessible directly

This lazy loading approach means roar starts quickly even with large directory structures containing many subdirectories.

The filesystem is read-only to protect your archive data.

Testing

Run the test suite:

go test ./...

Run tests with verbose output:

go test ./internal/rarfs -v

The test suite includes:

  • Unit tests for RAR file detection and archive scanning
  • Integration tests with real RAR archives (in tests/data/)
  • Filesystem watcher tests for inotify functionality
  • Lazy loading and concurrent access tests

License

MIT

About

Takes a directory of RAR archives and presents the files within those archives as if there was no RAR

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors 2

  •  
  •