No description
| .woodpecker | ||
| src | ||
| tasks | ||
| tests | ||
| .dockerignore | ||
| .gitignore | ||
| AGENTS.md | ||
| Cargo.lock | ||
| Cargo.toml | ||
| CHANGELOG.md | ||
| cog.toml | ||
| Dockerfile | ||
| LICENSE.md | ||
| README.md | ||
| renovate.json | ||
Media File Tracker
A media file tracker that watches directories for new files and keeps track of their metadata, exposing it via a web interface for viewing and performing operations on the media library.
Features
- Directory Watching: Monitors specified directories for new media files
- Metadata Tracking: Tracks file metadata changes over time with rollback capability
- Content Hashing: Maintains hash of media content, preserving history when files are moved
- Web Interface: RESTful API for viewing and managing the media library
- Data Processing: Uses differential dataflow for efficient metadata processing
Quick Start
Prerequisites
- Rust 1.70+ (stable)
- OpenSSL development libraries
Installation
# Clone the repository
git clone https://code.billie.codes/PurpleBooth/media-file-tracker.git
cd media-file-tracker
# Build the project
cargo build --release
# Run tests
cargo test
# Start the server
cargo run
Development Workflow
This project uses a trunk-based development strategy:
- Main Branch: All changes are merged directly to
main - Feature Development:
- Create feature branches from
main - Push changes to trigger Woodpecker CI
- Create pull requests to
main
- Create feature branches from
- Automated Updates:
- Renovate handles dependency updates automatically
- Creates PRs with conventional commit messages
- Auto-merges non-breaking dependency updates
- Testing: All changes must pass CI before merging
- Releases: Automatic when conventional commits are detected
Local Development
# Install development dependencies
cargo install cargo-audit cargo-watch
# Run with automatic reloading
cargo watch -x run
# Run linting
cargo clippy
# Format code
cargo fmt
# Run security audit
cargo audit
API Endpoints
GET /- Root endpointGET /health- Health checkGET /api/files- List files (placeholder)
Architecture
The application is built with:
- Axum: Web framework for HTTP server
- Tokio: Async runtime
- Differential Dataflow: For efficient metadata processing
- Timely Dataflow: Stream processing framework
- Tracing: Structured logging
Testing
# Run all tests
cargo test
# Run integration tests only
cargo test --test integration_tests
# Run with coverage
cargo tarpaulin --out Html
Configuration
The application uses environment variables for configuration. Set RUST_LOG to control logging verbosity:
RUST_LOG=debug cargo run
Contributing
This project follows conventional commits and uses Renovate for automated dependency management and cocogitto for version management.
Commit Format
feat:New featuresfix:Bug fixesdocs:Documentation changesstyle:Code style changesrefactor:Code refactoringtest:Test additions/changeschore:Maintenance tasks
Code Quality
All code must:
- Compile on stable Rust
- Pass
cargo clippywith pedantic lints - Include tests for public functions
- Include documentation for public interfaces
License
This project is licensed under GPL-3.0-or-later. See LICENSE for details.
CI/CD Pipeline
This project uses Woodpecker CI for continuous integration and deployment. The pipeline includes:
Automated Testing
- Build and test on every push and pull request
- Linting with clippy (pedantic mode)
- Mutation testing with cargo-mutants
- Security audit with cargo-audit
- Code formatting checks
Automatic Releases
- Semantic versioning with Renovate
- Automatic dependency updates
- SSH-signed releases
- Binary asset uploads
Container Publishing
- Multi-stage Docker builds
- Container registry publishing to
code.billie.codes/purplebooth/media-file-tracker - Cosign-signed container images
Pipeline Triggers
- Push to main: Runs full test suite
- Pull request: Runs test suite
- Auto-release: Creates new releases when conventional commits are detected
- Dependency updates: Renovate creates PRs for dependency updates
- Tag events: Builds and publishes binaries and containers
Required Secrets
Configure these secrets in your Woodpecker instance:
CBC_TOKEN: Forgejo API token for repository accessGIT_PRIVATE_KEY: SSH private key for signing releases and commitsCOSIGN_PRIVATE_KEY: Cosign private key for container signingCOSIGN_PASSWORD: Password for Cosign private key
Development Workflow
- Fork and clone the repository
- Create feature branch for your changes
- Push changes to trigger CI
- Merge PR after successful tests
- Renovate automatically handles dependency updates
Roadmap
- Directory watching implementation
- Metadata extraction and storage
- Content hashing system
- Web UI for file management
- Rollback functionality
- Real-time updates