No description
Find a file
2025-03-25 23:01:05 -06:00
man add draft man page 2025-03-25 23:01:05 -06:00
src starting to add ctrlc checks for main run fn 2025-03-25 21:45:09 -06:00
.gitignore init 2025-02-11 23:32:28 -07:00
.rustfmt.toml fix formatting, use git2 fork until/if merged in 2025-03-20 22:01:50 -06:00
build build major docker images, change fast forward params 2025-03-23 22:27:22 -06:00
Cargo.lock add draft man page 2025-03-25 23:01:05 -06:00
Cargo.toml bump patch 2025-03-23 21:41:31 -06:00
Dockerfile move dockerfile for building packages to different location 2025-03-06 19:09:05 -07:00
LICENSE add license 2025-03-16 19:23:47 -06:00
package.Dockerfile bump version, add notices, update build script 2025-03-16 21:05:33 -06:00
README.md update readme, example config 2025-03-18 23:14:28 -06:00

refractr

refractr is an automated push mirroring utility that clones one repository and can push it's branches to multiple different remotes. It can be ran once or over an interval using built-in scheduling or using cron jobs. Designed to be flexible on it's use, multiple repositories can be mirrored using several different configuration TOML files, or by running multiple instances of refractr with one configuration each.

How does it work?

refractr reads a configuration file that you specify to clone a repository over HTTP(S) or SSH to a location on your disk and push to update repositories that already exist on one or more remotes using SSH.

With the above procedure, refractr can be used to mirror public repositories to copies of your own (such as a fork or to make available on alternative hosting services), to mirror internal corporate repositories on a public network to please FOSS licensing agreements, or whatever your mind can think of!

Installation

Cargo

To install refractr using Cargo, run:

cargo install --git https://git.brysonsteck.xyz/brysonsteck/refractr

Docker

To run refractr using Docker, run:

docker run -it git.brysonsteck.xyz/brysonsteck/refractr refractr

You can build custom images with your configs using a Dockerfile, or you can build the image entirely from source using the package Dockerfile that is used to create the base images:

git clone https://git.brysonsteck.xyz/brysonsteck/refractr && cd refractr
docker build -t refractr --build-arg UID=$(id -u) --build-arg GID=$(id -g) -f package.Dockerfile .

Windows

You can download pre-built binaries from the Releases page or from my package mirror:

# Download the exe with PowerShell
Invoke-WebRequest -Uri https://pkg.brysonsteck.xyz/dist/refractr/latest/windows/x86_64/refractr.exe -OutFile refractr.exe
# Download the SHA256 checksum
Invoke-WebRequest -Uri https://pkg.brysonsteck.xyz/dist/refractr/latest/windows/x86_64/refractr.exe.sha256.txt -OutFile refractr.exe.sha256.txt
# Verify hashes match (should return "True")
(Get-Content .\refractr.exe.sha256.txt) -eq (Get-FileHash .\refractr.exe).hash

macOS

Coming soon...

Build from Source

To build and run refractr from source, you may need some packages installed on your system. On vanilla installations of FreeBSD, OpenBSD, Windows and macOS, you should be able to compile refractr without issue. On Linux, however, you may need to install additional packages that provide the pkg-config binary and OpenSSL headers. Refer to your package manager for the correct package names that you will need to verify are installed.

# clone the repository
git clone https://git.brysonsteck.xyz/brysonsteck/refractr && cd refractr
# build the release binary
cargo build --release
# build the debug binary (not recommended for normal use)
cargo build
# you can run the binary in the target directory
# or move it wherever you wish
./target/release/refractr

FAQ

Couldn't I do this with a shell script and a cron job or (insert alternative method here)?

Yes.

Then why reinvent the wheel?

Stop asking such asinine questions.