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.1.tar.gz (38.6 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.1-py3-none-any.whl (50.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: historify-0.3.1.tar.gz
  • Upload date:
  • Size: 38.6 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.1.tar.gz
Algorithm Hash digest
SHA256 b5f42e0152f5d3da80826f68af8e611b0d6d0638f0734a99cde0dcea8548c2f4
MD5 d95b985c5b3f19f176861efdd465b6e7
BLAKE2b-256 e180d7064847b6c6397f52d1880b3d24890828fd74dc44962266700d0b6766f6

See more details on using hashes here.

File details

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

File metadata

  • Download URL: historify-0.3.1-py3-none-any.whl
  • Upload date:
  • Size: 50.3 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 5e6e1ebb47dce5d62139c637dce3f2884410841f40c68f521ddc51a4f33a1423
MD5 e5c9cbd1875923e63746538c2d1c4897
BLAKE2b-256 3b3832c2af7f21e99f6fcc2da06cfcbf64b0cbeb02d207604b89aacf6bf17640

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