src | ||
.gitignore | ||
.rustfmt.toml | ||
build | ||
Cargo.lock | ||
Cargo.toml | ||
Dockerfile | ||
package.Dockerfile | ||
README.md |
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
Coming soon...
macOS
Coming soon...
Build from Source
To build and run refractr from source, run:
# the apt command only applies to Ubuntu/Debian
# you will need to install the correct packages using your package manager otherwise
apt install git pkg-config libssl-dev
git clone https://git.brysonsteck.xyz/brysonsteck/refractr && cd refractr
cargo build --release
# you can run the binary in the target directory
# or move it wherever you wish
./target/release/refractr