Skip to content

Commit

Permalink
docs: update release notes for v2.4-stable and modify configuration s…
Browse files Browse the repository at this point in the history
…ettings
  • Loading branch information
PlusOne committed Dec 30, 2024
1 parent 62ba24f commit e4c2a00
Show file tree
Hide file tree
Showing 2 changed files with 171 additions and 3 deletions.
168 changes: 168 additions & 0 deletions RELEASE-NOTES.MD
Original file line number Diff line number Diff line change
Expand Up @@ -316,3 +316,171 @@ No changes are required for the other files (`RELEASE-NOTES.MD`, `README.MD`, `c
### Changed
- **Configuration:** Updated `globalextensions` in `config.toml` to `["*"]`, allowing all file types globally for uploads. This change simplifies the configuration by removing the need to specify individual file extensions.
## Release Notes
**Release Date:** December 24, 2024 (Happy Holidays!)
## Overview
We are thrilled to announce the release of **hmac-file-server v2.4-stable**. This version builds upon our previous releases with significant enhancements, new features, and crucial bug fixes aimed at boosting the performance, security, and usability of the HMAC File Server.
### **Attention:**
Due to a critical deduplication issue identified in v2.1-stable, which may impact file handling under specific configurations, we recommend users skip v2.1-stable and upgrade directly to v2.4-stable from earlier stable versions.
## New Features
### 1. **Thumbnail Creation**
- **Automated Image Thumbnails:** Generate image thumbnails for uploaded files to provide quick previews and enhance user experience.
- **Scheduled Generation:** Thumbnails are created at configurable intervals to optimize server performance.
- **Configuration:**
```toml
[thumbnails]
enabled = true
directory = "/path/to/hmac-file-server/thumbnails/"
size = "200x200"
thumbnailintervalscan = "1h" # Interval for scheduled thumbnail generation
```
### 2. **ClamAV Integration**
- **Robust Malware Scanning:** Integrated ClamAV for scanning uploaded files, ensuring file integrity and security.
- **Configurable Scan Workers:** Optimize performance with a configurable number of scan workers.
- **Configuration:**
```toml
[clamav]
clamavenabled = true
clamavsocket = "/path/to/clamav/clamd.ctl" # Path to ClamAV socket
numscanworkers = 4 # Number of concurrent scan workers
scanfileextensions = [
".exe", ".dll", ".bin", ".com", ".bat",
".sh", ".php", ".js"
]
```
### 3. **Redis Support**
- **Enhanced Caching and Session Management:** Utilize Redis for efficient caching of file metadata and managing application states.
- **High-Load Scalability:** Supports high-load environments with optimized Redis configurations.
- **Configuration:**
```toml
[redis]
redisenabled = true
redisdbindex = 0
redisaddr = "localhost:6379" # Redis server address
redispassword = "" # Redis password if required
redishealthcheckinterval = "120s" # Interval for Redis health checks
```
### 4. **Enhanced Configuration Management**
- **Expanded Customization Options:** More configuration options for server behavior, including auto-adjusting worker pools and network event logging.
- **Improved Configuration Structure:** Streamlined configuration keys for better clarity and maintainability.
- **Configuration:**
```toml
[server]
autoadjustworkers = true # Automatically adjust worker threads based on load
networkevents = false # Enable detailed network event logging
precaching = true # Pre-cache file structures on startup for faster access
```
### 5. **Improved Logging**
- **JSON-Formatted Logs:** Optional support for JSON-formatted logs for better integration with log management systems.
- **Configurable Log Output:** Direct logs to files with log rotation and compression.
- **Configuration:**
```toml
[server]
loglevel = "debug" # Logging level: "debug", "info", "warn", "error"
logfile = "/path/to/hmac-file-server.log" # Path to log file; leave empty to use stdout
[server]
loggingjson = false # Set to true for JSON-formatted logs
```
## Enhancements
- **Graceful Shutdown:** Ensures data integrity during server restarts by handling OS signals and performing necessary cleanup.
- **Auto-Adjusting Worker Pools:** Optimizes the number of worker threads dynamically based on system resources to maintain optimal performance.
- **Extended Timeouts:** Customizable connection timeouts to handle long-running requests and prevent resource exhaustion.
- **Configuration:**
```toml
[timeouts]
readtimeout = "3600s" # Maximum time to read a request (1 hour)
writetimeout = "3600s" # Maximum time to write a response (1 hour)
idletimeout = "3600s" # Maximum keep-alive time for idle connections (1 hour)
```
## Bug Fixes
- **Deduplication Issue Resolved:** Fixed the critical deduplication bug from v2.1-stable to ensure reliable file handling under all configurations.
- **Syntax Cleanup:** Streamlined codebase by removing unused parameters and functions to enhance code maintainability.
- **Improved Error Handling:** Enhanced startup checks for ClamAV and Redis to provide clearer error messages and prevent server crashes.
- **Configuration Validation:** Added comprehensive configuration validation to catch misconfigurations early during server startup.
## Performance Improvements
- **Optimized File Handling:** Enhanced processing speeds for uploads and downloads, reducing latency and improving user experience.
- **Enhanced Caching Mechanisms:** Improved caching strategies using Redis and in-memory caches to reduce load times and server strain.
- **Thumbnail Generation Optimization:** Scheduled thumbnail generation minimizes performance hits during peak usage times.
## Security Enhancements
- **ClamAV and Redis Secure Integration:** Implemented secure connections and enhanced virus scanning protocols to safeguard against malicious files.
- **HMAC Secret Management:** Enforced the use of strong, unique HMAC secrets to ensure secure authentication and request signing.
## Configuration Changes
- **Removed Duplicate `[iso]` Block:** Consolidated ISO configuration into a single `[iso]` section to prevent configuration conflicts.
- **Updated Configuration Keys:** Renamed `scanInterval` to `thumbnailintervalscan` in the `[thumbnails]` section to align with the codebase.
- **Deprecated Options Removed:** Streamlined configuration by removing outdated or unnecessary options, simplifying the setup process.
- **Example Configuration Updated:** Provided an updated `config.toml` example reflecting the latest configuration structure and keys.
## Known Issues
- **Auto-Adjusting Delays:** Potential delays in worker pool adjustments under extreme load conditions. Monitoring is recommended to ensure optimal performance.
- **JSON Logs Integration:** JSON-formatted logs may require additional tools or configurations for seamless integration with existing log management systems.
- **Thumbnail Generation Overhead:** In environments with high upload rates of large images, thumbnail generation may introduce additional CPU load. Adjust `thumbnailintervalscan` as needed.
## Upgrade Instructions
1. **Backup Current Configuration:**
```bash
cp ./config.toml ./config.toml.backup
```
2. **Pull the Latest Version:**
```bash
git pull origin v2.4-stable
```
3. **Update Dependencies:**
```bash
go mod tidy
```
4. **Review and Merge Configuration Changes:**
- Compare your existing `config.toml` with the example provided in the [Example `config.toml`](#example-configtoml) section.
- Update configuration keys and values as necessary, especially ensuring that `thumbnailintervalscan` is used instead of `scanInterval`.
5. **Build the Server:**
```bash
go build -o hmac-file-server main.go
```
6. **Restart the Server:**
```bash
systemctl restart hmac-file-server
```
- **OR**
```bash
./hmac-file-server -config ./config.toml
```
## Acknowledgments
Thank you to our contributors and the community for their invaluable feedback and support. Special thanks to the developers of [[Thomas Leister's prosody-filer](https://github.com/ThomasLeister/prosody-filer)](https://github.com/ThomasLeister/prosody-filer) for inspiring many of our core features.
## Support
For support, please open an issue on our [[GitHub repository](https://github.com/PlusOne/hmac-file-server/issues)](https://github.com/PlusOne/hmac-file-server/issues).
---
Enjoy the enhanced features and stability of **hmac-file-server v2.4-stable**, and thank you for choosing our solution!
6 changes: 3 additions & 3 deletions config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,17 +27,17 @@ max_age = 30
compress = true

[deduplication]
enabled = true
enabled = false
directory = "./deduplication"

[thumbnails]
enabled = true
enabled = false
directory = "./thumbnails"
size = "200x200"
thumbnailintervalscan = "24h"

[iso]
enabled = true
enabled = false
size = "1GB"
mountpoint = "/mnt/iso"
charset = "utf-8"
Expand Down

0 comments on commit e4c2a00

Please sign in to comment.