-
released this
2025-01-26 09:18:48 +01:00 | 5 commits to main since this releaseHMAC File Server – Release v2.6
What’s New
-
Configurable Filenaming
- Added support for
filenaming=None
to skip the default HMAC-based renaming. - Allows users to keep the original filename instead of hashing, while preserving all HMAC authentication for security.
- Added support for
-
Enhanced Logging
- Improved log level usage (
info
,warn
,error
,debug
) across the login flow and file handling operations. - Added more structured fields (e.g.,
method
,remote
,url
) for easier log analysis. - Better security defaults to avoid exposing sensitive data in logs.
- Improved log level usage (
-
Prometheus Metrics Adjustments
- Refined counters, gauges, and histograms to cover all critical events (upload/download, dedup, ClamAV scanning).
- Ensured consistent increments for success/failure paths.
- Simplified registration to avoid double-registration issues.
-
Deduplication Improvements
- Confirmed that after moving a file to the dedup directory, a hard link is consistently created back to the original location.
- Logs now clearly indicate successful dedup steps and any errors.
-
Worker Pool Enhancements
- Better dynamic scaling logs (e.g., “Added worker. Total workers: X”).
- Ensures no duplicate or redundant worker creation.
- Additional metrics for worker adjustments and re-adjustments.
Bug Fixes
-
Resolved “File Not Found” During GET
- Clarified that when
filenaming=None
, the server does not rename files to HMAC paths, preventing mismatches between upload and download URLs. - Fixed potential race conditions in dedup moving vs. linking.
- Clarified that when
-
Reduced Log Noise
- Eliminated repetitive or misleading error messages around networking events.
- Improved clarity in ClamAV scanning logs to better distinguish scan failures vs. actual malware detections.
Upgrade Notes
- Config File:
- Check your
[server]
section forfilenaming
. If you previously relied on HMAC-based filenames, confirm whether you want to setfilenaming="HMAC"
explicitly.
- Check your
- Metrics:
- If you track Prometheus data, your dashboards may need to be updated for any renamed metrics or new labels.
- Logging:
- Logging defaults remain at
info
level. Increase todebug
only for troubleshooting to avoid excessive detail in production logs.
- Logging defaults remain at
Thank you to everyone who contributed feedback and testing for this release! As always, please report any issues, and we welcome suggestions to further improve the HMAC File Server. Enjoy the streamlined filenames, more comprehensive logging, and robust Prometheus metrics!
-
-
released this
2025-01-01 11:17:18 +01:00 | 19 commits to main since this releaseHMAC 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
- Clone the repository:
git clone https://github.com/PlusOne/hmac-file-server.git cd hmac-file-server/cmd/server
- Build the binary:
GOOS=linux GOARCH=amd64 go build -o hmac-file-server main.go
- Create directories:
mkdir -p /path/to/hmac-file-server/{data,deduplication,thumbnails,iso}
- 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 likededuplication
andiso
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