Skip to main content

A tool to auto sync git diffs to a remote server

Project description

Diffsyncer

Diffsyncer is a tool to sync files between two directories using QR codes. It can be used to transfer files between two devices without network connection.

Environment Prerequisites

  • Python 3.10

For MacOS:

brew install zbar

For Ubuntu:

sudo apt-get install libzbar0

Installation

pip install diffsyncer

Usage

diffsyncer --help
Usage: diffsyncer [OPTIONS] COMMAND [ARGS]...

Options:
  --help  Show this message and exit.

Commands:
  aeskey  Generate AES key
  decode  Decode QR codes to get git diff patch data
  encode  Generate QR codes for git diff patch data
  serve   Run the DiffSyncer server
  sync    Sync git repository with the decode diff patch data

1. Generate AES key

diffsyncer aeskey

Notice: The AES key file is used to encrypt the data before generating QR codes, please keep it same between the two devices.

2. Generate QR codes for git diff patch data

diffsyncer encode

3. Decode QR codes to get git diff patch data

diffsyncer decode

4. Sync git repository with the decode diff patch data

diffsyncer sync

5. Run the DiffSyncer server

diffsyncer serve

Configuration

Admin password hash can be generate by running the following command:

diffsyncer pass "your password"

Your can change the configuration by creating a .env file in the current directory. The following is the default configuration:

# admin username, optional, default is admin
ADMIN_USER=admin

# admin password, optional, default is admin
ADMIN_PASSWORD=$2b$12$f9l0H6Atq0cZUo5ceuLvx.ZoD0yxYguaI9u7JVJ8Mk9r8STcAGXXO

# path for git repo, optional, default is ./
REPO_DIR=./git/repo/path

# path for output qr codes, optional, default is ./output
OUTPUT_DIR=./path/for/qr-codes/output/

# path for uploaded qr codes, optional
UPLOAD_DIR=./path/for/uploaded/qr-codes

# aes key file for encrypting data, optional, default is ./ase_key.key
ASE_KEY_FILE=./path/to/ase/key/file

# Optional, default is zstd
COMPRESS_METHOD=ztsd

# Optional, data size in bytes stored in each QR code image, default is 800
CHUNK_SIZE=800

License

Apache License 2.0

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

diffsyncer-1.1.1-py3-none-any.whl (2.9 MB view details)

Uploaded Python 3

File details

Details for the file diffsyncer-1.1.1-py3-none-any.whl.

File metadata

  • Download URL: diffsyncer-1.1.1-py3-none-any.whl
  • Upload date:
  • Size: 2.9 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: pdm/2.17.1 CPython/3.10.10 Darwin/23.5.0

File hashes

Hashes for diffsyncer-1.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 024f8bfe229cb0b786e2e5a0a5763b9ba1142a854e8930c5f201187cd3f82d82
MD5 6f80e2eda6c4c0afaccdf934dc3c6922
BLAKE2b-256 4c1da51923b146c284b4ece7902eae31ac42f3e74a638acd14e2dae9a50e1289

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page