Skip to main content

A tool for revision-safe logging of file changes

Project description

historify

A tool for revision-safe logging of file changes with cryptographic integrity verification.

Overview

historify is a command-line utility that tracks file changes in one or multiple data directories while maintaining a secure and verifiable record of all modifications. It logs changes with cryptographic hashes (BLAKE3 and SHA256) and secures logs with minisign signatures, ensuring data authenticity and auditability.

It's particularly well-suited for adding compliance and audit capabilities to cloud storage systems like Nextcloud, where cryptographic proof of file integrity is required for regulatory purposes.

What historify IS

  • A cryptographic audit trail for file changes
  • A tamper-evident logging system
  • A compliance tool for proving file integrity
  • A complement to existing storage and backup systems

What historify is NOT

  • Not a version control system like Git (no branching, merging, code-focused features)
  • Not a protection mechanism that prevents files from being altered
  • Not a backup solution (though it can create snapshots)
  • Not a replacement for access controls (such as those in Nextcloud or filesystem permissions)

historify detects and logs changes but cannot prevent them. It provides evidence of what has changed and when, but relies on other systems for access control and protection.

Key Features

  • Secure Tracking: Uses BLAKE3 and SHA256 hashing with minisign signatures
  • Multiple Categories: Organize content with logical categorization of data
  • Integrity Verification: Full chain verification ensures tamper-evident history
  • Comprehensive Logging: Tracks new files, modifications, moves, deletions, and administrative events
  • Multiple Repositories: Supports managing multiple independent repositories

Installation

pip install historify

Requirements

  • Python 3.13 or later
  • minisign (for signing and verification)
  • b3sum (optional, for BLAKE3 hashing if native implementation is unavailable)

Quick Start

# Setup
historify init /path/to/repository --name "My Repository"
historify config minisign.key /path/to/minisign.key /path/to/repository
historify config minisign.pub /path/to/minisign.pub /path/to/repository
historify add-category documents docs /path/to/repository
historify start /path/to/repository

# Daily operations
historify scan /path/to/repository          # Detect and log changes
historify comment "Updated docs" /path/to/repository  # Add a comment
historify closing /path/to/repository       # Sign and create new log
historify verify /path/to/repository        # Verify integrity

# Information and export
historify status /path/to/repository        # Show repository status
historify log /path/to/repository           # View change history
historify snapshot /path/to/backup/dir /path/to/repository  # Create dated backup archive

Automation

Example of secure daily automated scanning:

# 1. Create a secure credentials file
sudo mkdir -p /etc/historify
echo 'HISTORIFY_PASSWORD="your_password"' | sudo tee /etc/historify/credentials > /dev/null
sudo chmod 600 /etc/historify/credentials

# 2. Create a wrapper script that sources credentials
sudo tee /usr/local/bin/historify-scan > /dev/null << 'EOF'
#!/bin/bash
source /etc/historify/credentials
/usr/local/bin/historify scan "$@"
EOF
sudo chmod 700 /usr/local/bin/historify-scan

# 3. Add to crontab (without exposing password)
# 0 2 * * * /usr/local/bin/historify-scan /path/to/repository

Environment Variables

  • HISTORIFY_PASSWORD: Password for encrypted minisign key

Documentation

For complete documentation on all commands, options, and repository structure, refer to the manual page.

For specific implementation scenarios and deployment patterns, see the use cases guide.

Common Commands

Command Description
init Initialize a new repository
config Set configuration options
add-category Add a data category
start / closing Sign current changelog and create a new one
scan Scan for changes in tracked files
verify Verify repository integrity
log View change history
status Display repository status
snapshot Create a compressed archive of the repository

Concepts

historify provides secure file tracking through:

  • Automatic Change Detection: Identifies new, changed, moved, and deleted files
  • Cryptographic Hashing: Uses BLAKE3 and SHA256 for reliable content verification
  • Signature Chain: Creates a verifiable chain of custody with minisign signatures
  • Logical Categorization: Organizes content through flexible category definitions

Integrity Verification

historify combines file hashing and cryptographic signatures to create a tamper-evident chain of custody:

  • File Integrity: Verifies files against stored hash values
  • Chain Verification: Links changelogs through hash references
  • Cryptographic Signatures: Secures change history with minisign

Contributions

Contributions are welcome! Please feel free to submit a Pull Request.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Project details


Download files

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

Source Distribution

historify-0.3.2.tar.gz (38.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

historify-0.3.2-py3-none-any.whl (50.4 kB view details)

Uploaded Python 3

File details

Details for the file historify-0.3.2.tar.gz.

File metadata

  • Download URL: historify-0.3.2.tar.gz
  • Upload date:
  • Size: 38.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.2 CPython/3.13.3 Linux/6.12.25-2-lts

File hashes

Hashes for historify-0.3.2.tar.gz
Algorithm Hash digest
SHA256 10df2ffa4919cfc7acae7aaa096b8d31ac23ca60e1adcbbe5630ab4f78657457
MD5 7fd07c92d0b84f4552fc2cb8d8a36363
BLAKE2b-256 92330d38563f373f758e49103540fde24088155b033f28cab62a6753fdc3753d

See more details on using hashes here.

File details

Details for the file historify-0.3.2-py3-none-any.whl.

File metadata

  • Download URL: historify-0.3.2-py3-none-any.whl
  • Upload date:
  • Size: 50.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.2 CPython/3.13.3 Linux/6.12.25-2-lts

File hashes

Hashes for historify-0.3.2-py3-none-any.whl
Algorithm Hash digest
SHA256 5a7bb7dcdd514625f270070d0f8c6cf8e66a67af770eb8063feffa08b3a7e224
MD5 40c735ec74ecabcdc0890cdf4ae123b8
BLAKE2b-256 36a9f048d345844313d2111e1ee42ab82a3329e29461aff734eabccf3d583ee2

See more details on using hashes here.

Supported by

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