Browse Source

borg: include borg binary in repository

Put our own binary in here, so we can keep it updated with local
patches more easily.  Also add build instructions.
This one is built from
https://github.com/borgbackup/borg/pull/6011
master
Jim Paris 2 days ago
parent
commit
69bfecd657
4 changed files with 22 additions and 16 deletions
  1. +0
    -1
      .gitignore
  2. BIN
      Borg.bin
  3. +22
    -0
      README.md
  4. +0
    -15
      initial-setup.sh

+ 0
- 1
.gitignore View File

@@ -1,5 +1,4 @@
*.html
Borg.bin
cache/
config/
key.txt


BIN
Borg.bin View File


+ 22
- 0
README.md View File

@@ -105,3 +105,25 @@ Design
`/opt/borg/config.yaml` to generate our own list of files, excluding
anything that's too large by default. This requires borg 1.2.0b1
or newer, which is why the setup scripts download a specific version.



Notes
=====

# Building Borg.bin binary from git

git clone https://github.com/borgbackup/borg.git
cd borg
virtualenv --python=python3 borg-env
source borg-env/bin/activate
pip install -r requirements.d/development.txt
pip install pyinstaller
pip install llfuse
pip install -e .[llfuse]
pyinstaller --clean --noconfirm scripts/borg.exe.spec

*Note:* This uses the deprecated `llfuse` instead of the newer `pyfuse3`.
`pyfuse3` doesn't work because, at minimum, it pulls in `trio` which
requires `ssl` which is explicitly excluded by
`scripts/borg.exe.spec`.

+ 0
- 15
initial-setup.sh View File

@@ -5,10 +5,6 @@ BACKUP_HOST=${BACKUP_HOST:-backup.jim.sh}
BACKUP_USER=${BACKUP_USER:-jim-backups}
BACKUP_REPO=${BACKUP_REPO:-borg/$(hostname)}

# Borg binary and hash
BORG_URL="https://github.com/borgbackup/borg/releases/download/1.2.0b3/borg-linux64"
BORG_SHA256=8dd6c2769d9bf3ca7a65ebf6781302029fc3b15105aff63d33195c007f897360

# Main dir is where this repo was checked out
BORG_DIR="$(realpath "$(dirname "$0")")"
cd "${BORG_DIR}"
@@ -76,16 +72,6 @@ setup_venv()
pipenv install
}

# Install borg
install_borg()
{
curl -L --progress-bar -o "${BORG_BIN}" "${BORG_URL}"
if ! echo "${BORG_SHA256} ${BORG_BIN}" | sha256sum -c ; then
error "hash error"
fi
chmod +x "${BORG_BIN}"
}

# Create wrapper to execute borg
create_borg_wrapper()
{
@@ -319,7 +305,6 @@ log " Backup server user: ${BACKUP_USER}"
log " Repository path: ${BACKUP_REPO}"

setup_venv
install_borg
create_borg_wrapper
generate_keys
configure_ssh


Loading…
Cancel
Save