Skip to content

Repository files navigation

KeePass Sync Daemon

Automatic, intelligent synchronization for KeePassXC databases across Linux, Windows (dual-boot), and Google Drive.

Features

  • 3-Way Sync: Seamlessly merges changes from your local Linux database, a mounted Windows partition, and Google Drive.
  • Smart Detection: Uses hash-based detection to only sync when files actually change.
  • Automated Backups: Creates rolling backups of your database before every merge/update.
  • System Tray Integration: Status icon and notifications for sync events.
  • Interactive Setup: Guided TUI for partition selection, Google Drive auth, and configuration.
  • Conflict Resolution: Leverages keepassxc-cli to merge entries rather than overwriting files.

Prerequisites

The setup script will attempt to install these automatically, but you should have:

  • KeePassXC (specifically keepassxc-cli)
  • Python 3
  • rclone (for Google Drive access)
  • zenity (for GUI password prompts)

Configuration: Google Drive (rclone)

Before running the setup, you must configure rclone to access your Google Drive. The setup script can launch this for you, but you can also do it manually:

  1. Run config wizard:
    rclone config
  2. Create a new remote:
    • Type n for New remote.
    • Name it (e.g., gdrive).
    • Select storage type: Find "Google Drive" (usually number 18 or similar).
    • Client ID/Secret: Leave blank (unless you have your own).
    • Scope: Choose option 1 (Full access).
    • Service Account: Leave blank.
    • Advanced Config: n (No).
    • Web Browser Auth: y (Yes). This will open your browser to log in.

Once authorized, you will see the token. Confirm the configuration.

For setting up your own client ID (recommended for better performance), see Making your own Client ID in the official documentation.

Installation

1. Preparation

Ensure the scripts are executable:

chmod +x setup.sh install.sh uninstall-daemon-service.sh keepass-sync-daemon.py daemon-control.sh

2. Run Setup

The setup.sh script guides you through configuring your database paths, Windows partition mounting, and Google Drive connection.

./setup.sh

This will:

  • Check and install dependencies.
  • Create a sync_data/ directory for local copies and backups.
  • Generate a config.yaml file tailored to your system.

2. Manual Test (Optional)

Before installing the background service, you can run the daemon manually to verify checking works:

python3 keepass-sync-daemon.py

Check the terminal output for "Started file monitoring" and ensure no errors occur.

3. Install Service

Install the daemon as a systemd user service so it starts automatically on login:

./install.sh

Usage

The daemon runs in the background. You can control it using the provided control script:

./daemon-control.sh status   # Check status
./daemon-control.sh stop     # Stop the service
./daemon-control.sh start    # Start the service
./daemon-control.sh logs     # View live logs

Setup Details

Directory Structure

After setup, the project will look like this:

.
├── config.yaml          # Your local configuration (git-ignored)
├── sync_data/           # Working directory (git-ignored)
│   ├── backups/         # Rolling backups of your DB
│   ├── windows_copy...  # Local caches
│   └── merged.kdbx      # Intermediate merge file
├── logs/                # Log files
└── ... scripts ...

Configuration

All settings are stored in config.yaml. The setup script generates this, but you can edit it manually to change:

  • backup_retention_days
  • db_filename
  • Logging levels

Uninstallation

To remove the service:

./uninstall-daemon-service.sh

About

Syncs your stuff between PRIMARILY linux and gdrive, with the addition of windows.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages