update readme, example config

This commit is contained in:
Bryson Steck 2025-03-18 23:14:28 -06:00
parent a077d70598
commit 5d06e08f5b
Signed by: bryson
SSH key fingerprint: SHA256:XpKABw/nP4z8UVaH+weLaBnEOD86+cVwif+QjuYLGT4
2 changed files with 40 additions and 23 deletions

View file

@ -37,7 +37,16 @@ docker build -t refractr --build-arg UID=$(id -u) --build-arg GID=$(id -g) -f pa
### Windows ### Windows
Coming soon... You can download pre-built binaries from the [Releases page](https://git.brysonsteck.xyz/brysonsteck/refractr/releases) or from my package mirror:
```powershell
# 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 ### macOS
@ -45,15 +54,26 @@ Coming soon...
### Build from Source ### Build from Source
To build and run refractr from source, run: 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.
```sh ```sh
# the apt command only applies to Ubuntu/Debian # clone the repository
# 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 git clone https://git.brysonsteck.xyz/brysonsteck/refractr && cd refractr
# build the release binary
cargo build --release cargo build --release
# build the debug binary (not recommended for normal use)
cargo build
# you can run the binary in the target directory # you can run the binary in the target directory
# or move it wherever you wish # or move it wherever you wish
./target/release/refractr ./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.

View file

@ -2,40 +2,37 @@
# Example configuration for refractr # Example configuration for refractr
# *********************************** # ***********************************
[config]
# The "from" field is a string of the original/main repository you want to pull # The "from" field is a string of the original/main repository you want to pull
# This field is REQUIRED # This field is REQUIRED and MUST start with "https://" or "ssh://"
#from = "https://git.brysonsteck.xyz/brysonsteck/refractr" #from = "https://git.brysonsteck.xyz/brysonsteck/refractr"
# The "to" field is a list of strings of the repositories you want to push the repo # The "to" field is a list of strings of the remotes you want to push the repo from the "from" field to
# from the "from" field to. These repositories must exist on the remote server # These repositories must exist on the remote server
# It's recommended that you use SSH to avoid HTTPS authentication # This field is REQUIRED and MUST be SSH remotes
# This field is REQUIRED
#to = ["git@codeberg.org:brysonsteck/refractr.git", "git@github.com:brysonsteck/refractr.git"] #to = ["git@codeberg.org:brysonsteck/refractr.git", "git@github.com:brysonsteck/refractr.git"]
# The "branches" field is a list of branches you want to mirror from the original # The "branches" field is a list of branches you want to mirror from the original repository
# repository.
# This field is REQUIRED # This field is REQUIRED
#branches = ["master"] #branches = ["master"]
# The "work_dir" field is where refractr will write the clone to # The "work_dir" field is where refractr will write the clone to
# This field is OPTIONAL, will default to /tmp/refractr on *NIX and # This field is OPTIONAL, will default to /tmp/refractr on *NIX and $env:TEMP\refractr on Windows
# $env:TEMP\refractr on Windows
#work_dir = /tmp/refractr #work_dir = /tmp/refractr
[git] [git]
# The "ssh_identity_file" is your private SSH key that you will use to push updates # The "ssh_identity_file" is your private SSH key that you will use to push updates from the original
# from the original repository. # repository and, if your "from" field is an SSH remote, for cloning the original repository
# This field is REQUIRED if you are using SSH to push, otherwise OPTIONAL # If you are running from Docker, you will need to copy your private key to your container or image
# This field is REQUIRED
#ssh_identity_file = "/path/to/.ssh/id_rsa" #ssh_identity_file = "/path/to/.ssh/id_rsa"
[schedule] [schedule]
# The "enabled" field turns on the schedule feature of refractr. # The "enabled" field turns on the schedule feature of refractr
# This field is REQUIRED. # This field is REQUIRED.
#enabled = false #enabled = false
# The "interval" field is the amount of seconds refractor will wait before # The "interval" field is the amount of seconds refractor will wait before pulling updates from the
# pulling updates from the original repository if the schedule feature is enabled. # original repository if the schedule feature is enabled
# This field is REQUIRED if "enabled" is set to true, otherwise OPTIONAL # To avoid creating a DoS attack, this is set to only accept values of >=60
# To avoid overwhelming servers, this is set to only accept values of >=60 # This field is REQUIRED if "enabled" is set to true, UNUSED if false
#interval = 300 #interval = 300