• renz released this 2025-01-01 11:17:18 +01:00 | 19 commits to main since this release

    HMAC File Server 2.5-Stable

    The HMAC File Server ensures secure file uploads and downloads with advanced HMAC authentication, file deduplication, and a suite of features tailored for secure, efficient, and flexible file management. This version introduces robust new capabilities, optimizations, and bug fixes, making it a must-have upgrade for existing users.

    Special thanks to Thomas Leister for inspiration drawn from [prosody-filer](https://github.com/ThomasLeister/prosody-filer).


    Overview

    Key features of HMAC File Server 2.5-Stable include:

    • HMAC-Based Security: Robust authentication for secure file transactions.
    • Redis Integration: Enhanced caching and session management.
    • ClamAV Virus Scanning: Secure file uploads with antivirus protection.
    • Dynamic Worker Management: Optimized performance with auto-scaling worker threads.
    • Prometheus Metrics: Detailed monitoring of file and system activity.
    • ISO Containers: Advanced file handling options for diverse use cases.

    Changelog

    Added

    • File Deduplication: Efficient storage using SHA256 hashing to prevent duplicate files.
    • ISO Container Management: Create and mount ISO containers for specialized storage.
    • Precaching Feature: Faster file access with a startup cache of frequently used files.
    • Prometheus Metrics: Added deduplication and ISO operation monitoring.
    • Redis Enhancements: Optimized metadata caching and state management.
    • Dynamic Workers: Automatically adjusts worker threads based on system resources.

    Changed

    • Worker Pool Scaling: Improved performance with dynamic thread adjustment.
    • Logging Enhancements: Detailed file operation logs, including MIME type data.
    • Temporary Path Configuration: Configurable TempPath parameter for flexibility.

    Fixed

    • Temporary File Handling: Resolved .tmp file warnings with improved MIME detection.
    • MIME Type Detection: Enhanced accuracy during file uploads.

    Removed

    • Previous Thumbnail Support: Streamlined code by dropping outdated processes.

    Installation and Setup

    Installation

    1. Clone the repository:
      git clone https://github.com/PlusOne/hmac-file-server.git
      cd hmac-file-server/cmd/server
      
    2. Build the binary:
      GOOS=linux GOARCH=amd64 go build -o hmac-file-server main.go
      
    3. Create directories:
      mkdir -p /path/to/hmac-file-server/{data,deduplication,thumbnails,iso}
      
    4. Configure and run:
      cp config.example.toml config.toml
      ./hmac-file-server -config config.toml
      

    Reverse Proxy

    Nginx Configuration:

    server {
        listen 80;
        server_name your-domain.com;
    
        location / {
            proxy_pass http://localhost:8080;
            proxy_set_header Host $host;
            proxy_set_header X-Real-IP $remote_addr;
        }
    }
    

    Systemd Service

    [Unit]
    Description=HMAC File Server
    After=network.target
    
    [Service]
    ExecStart=/path/to/hmac-file-server -config /path/to/config.toml
    Restart=always
    
    [Install]
    WantedBy=multi-user.target
    

    Enable the service:

    sudo systemctl daemon-reload
    sudo systemctl enable hmac-file-server
    sudo systemctl start hmac-file-server
    

    Building

    To cross-compile for other platforms:

    GOOS=linux GOARCH=amd64 go build -o hmac-file-server-linux-amd64 main.go
    GOOS=linux GOARCH=arm64 go build -o hmac-file-server-linux-arm64 main.go
    GOOS=windows GOARCH=amd64 go build -o hmac-file-server-windows-amd64.exe main.go
    

    Important Notes

    • Upgrade Steps: Update config.toml with new fields like deduplication and iso to use the latest features.
    • Release Tag: Create a GitHub release with tag v2.6.0 and updated release notes.

    Enjoy streamlined, secure, and high-performance file management with HMAC File Server 2.5-Stable!

    Downloads