- Add new log viewer component in admin tools - Support dynamic log file browsing and content display - Implement custom scrollbar for log content - Add log file refresh, download, and view capabilities - Update environment variables for log configuration - Enhance logging system with more flexible configuration options
15 KiB
GoMFT - Go Managed File Transfer
GoMFT is a web-based managed file transfer application built with Go, leveraging rclone for robust file transfer capabilities. It provides a user-friendly interface for configuring, scheduling, and monitoring file transfers across various storage providers.
Screenshots
Dashboard
Dashboard showing active transfers and system status
Dashboard dark mode showing active transfers and system status
Configuration Interface
Setting up transfer configurations with multiple storage options
Job Management
Scheduling transfers with flexible cron expressions
File Metadata
Track and manage file metadata with detailed information about transferred files
User Management
Create user accounts and manage them
Features
- Multiple Storage Support: Leverage rclone's extensive support for cloud storage providers:
- Amazon S3
- MinIO
- NextCloud
- WebDAV
- SFTP
- FTP
- SMB/CIFS shares
- Local filesystem
- And more via rclone
- Scheduled Transfers: Configure transfers using cron expressions with flexible scheduling options
- Transfer Monitoring: Real-time status updates and detailed transfer logs with bytes and files transferred statistics
- File Metadata Tracking: Complete history and status of all transferred files with detailed information:
- Process status (processed, archived, deleted)
- File size and hash information
- Advanced search and filtering capabilities
- Metadata retention for compliance and auditing
- Detailed file view with processing timestamps and job association
- Powerful filtering by status, filename, job, and date ranges
- Advanced search interface with multiple criteria
- Bulk management and record deletion capabilities
- Responsive design with mobile-friendly interface
- Multi-threaded File Transfers: Significantly improve performance with concurrent file processing:
- Configurable number of concurrent transfers (1-32) per job
- Automatic queue management to prevent system overload
- Independent configuration for each transfer job
- Optimized for both high-volume small files and large file transfers
- Maximizes bandwidth utilization for cloud storage providers
- Web Interface: User-friendly interface for managing transfers, built with Templ components
- File Pattern Matching: Support for file patterns to filter files during transfers
- File Output Patterns: Dynamic naming of destination files using patterns with date variables
- Archive Function: Option to archive transferred files for backup and compliance
- Transfer Configurations: Full control over source and destination connection parameters
- Job Management: Create, edit, and monitor transfer jobs with scheduling
- Security: Role-based access control with admin-managed user accounts and secure password management
- Password Recovery: Self-service password reset via email with secure token-based authentication
- User Profile Management: Personal settings including theme preferences
- Modern UI: Built with Templ, HTMX and Tailwind CSS for a responsive experience
- Docker Support: Easy deployment with Docker images and Docker Compose support
- Portable Deployment: Run on any platform that supports Docker or Go
Prerequisites
- Go 1.21 or later
- rclone installed and configured
- SQLite 3
Installation
Standard Installation
- Clone the repository:
git clone https://github.com/starfleetcptn/gomft.git
cd gomft
- Install dependencies:
go mod download
- Build the application:
go build -o gomft
Docker Installation
GoMFT is available as a Docker image for quick and easy deployment.
- Pull the latest image from Docker Hub:
docker pull starfleetcptn/gomft:latest
- Run the container:
docker run -d \
--name gomft \
-p 8080:8080 \
-v /path/to/data:/app/data \
-v /path/to/backups:/app/backups \
starfleetcptn/gomft:latest
- Access the web interface at
http://localhost:8080
Docker Compose Example
For production deployments, you can use Docker Compose with environment variables:
version: '3'
services:
gomft:
image: starfleetcptn/gomft:latest
container_name: gomft
restart: unless-stopped
ports:
- "8080:8080"
volumes:
- ./data:/app/data
- ./backups:/app/backups
environment:
- TZ=UTC
- SERVER_ADDRESS=:8080
- DATA_DIR=/app/data
- BACKUP_DIR=/app/backups
- JWT_SECRET=change_this_to_a_secure_random_string
- BASE_URL=http://localhost:8080
- EMAIL_ENABLED=true
- EMAIL_HOST=smtp.example.com
- EMAIL_PORT=587
- EMAIL_FROM_EMAIL=gomft@example.com
- EMAIL_FROM_NAME=GoMFT
- EMAIL_ENABLE_TLS=true
- EMAIL_REQUIRE_AUTH=true
- EMAIL_USERNAME=smtp_username
- EMAIL_PASSWORD=smtp_password
# Logging configuration
- LOGS_DIR=/app/data/logs
- LOG_MAX_SIZE=10
- LOG_MAX_BACKUPS=5
- LOG_MAX_AGE=30
- LOG_COMPRESS=true
- LOG_LEVEL=info
Alternatively, you can mount your own .env file to the container:
version: '3'
services:
gomft:
image: starfleetcptn/gomft:latest
container_name: gomft
restart: unless-stopped
ports:
- "8080:8080"
volumes:
- ./data:/app/data
- ./backups:/app/backups
- ./.env:/app/.env
environment:
- TZ=UTC
Save this as docker-compose.yml and run:
docker-compose up -d
For more information and available tags, visit the GoMFT Docker Hub page.
Configuration
GoMFT uses an environment file located at .env in the root directory of the application. On first run, a default configuration will be created:
SERVER_ADDRESS=:8080
DATA_DIR=/app/data
BACKUP_DIR=/app/backups
JWT_SECRET=change_this_to_a_secure_random_string
BASE_URL=http://localhost:8080
# Email configuration
EMAIL_ENABLED=true
EMAIL_HOST=smtp.example.com
EMAIL_PORT=587
EMAIL_FROM_EMAIL=gomft@example.com
EMAIL_FROM_NAME=GoMFT
EMAIL_REPLY_TO=
EMAIL_ENABLE_TLS=true
EMAIL_REQUIRE_AUTH=true
EMAIL_USERNAME=smtp_username
EMAIL_PASSWORD=smtp_password
Configuration Options
SERVER_ADDRESS: The address and port to run the server onDATA_DIR: Directory for storing application data (database and configs)BACKUP_DIR: Directory for storing database backupsJWT_SECRET: Secret key for JWT token generationBASE_URL: Base URL for generating links in emails (e.g., password reset links)- Email configuration settings for system notifications and password resets:
EMAIL_ENABLED: Set totrueto enable email functionalityEMAIL_HOST: SMTP server hostnameEMAIL_PORT: SMTP server port (usually 587 for TLS, 465 for SSL, or 25 for non-secure)EMAIL_USERNAME: Username for SMTP authenticationEMAIL_PASSWORD: Password for SMTP authenticationEMAIL_FROM_EMAIL: Email address used as senderEMAIL_FROM_NAME: Name displayed as the senderEMAIL_REPLY_TO: Optional reply-to email addressEMAIL_ENABLE_TLS: Set totrueto use TLS for secure email transmissionEMAIL_REQUIRE_AUTH: Set totrueto require authentication for SMTP connections, orfalsefor servers that don't need authentication
Logging Configuration
GoMFT provides configurable logging with rotation support through the following environment variables:
LOGS_DIR: Directory where log files are stored (default:./data/logs)LOG_MAX_SIZE: Maximum size in megabytes for each log file before rotation (default:10)LOG_MAX_BACKUPS: Number of old log files to retain (default:5)LOG_MAX_AGE: Maximum number of days to retain old log files (default:30)LOG_COMPRESS: Whether to compress rotated log files (default:true)LOG_LEVEL: Controls verbosity level of logging (values:error,info,debug, default:info)error: Only show errors and critical issuesinfo: Show errors and general operational information (default)debug: Show all messages including detailed debugging information
Log files contain detailed information about file transfers, job execution, and system operations, which can be useful for troubleshooting and auditing.
Usage
- Start the server:
./gomft
-
Access the web interface at
http://localhost:8080 -
Log in with the default admin account:
- Email:
admin@example.com - Password:
admin - Important: Change this password immediately after first login
- Email:
-
Create transfer configurations:
- Navigate to "Transfer Configs" section
- Configure source and destination locations with connection details
- Set file patterns and archive options as needed
- Configure performance settings:
- Set "Concurrent Transfers" slider to optimize throughput
- Use higher values (8-16) for many small files or fast networks
- Use lower values (1-4) for large files or limited bandwidth
- Consider source/destination system capabilities when setting
-
Create jobs using your configurations:
- Navigate to "Jobs" section
- Select an existing transfer config
- Set up a schedule using cron expressions or run manually
- Enable/disable as needed
-
Monitor transfers:
- View active and completed transfers on the Dashboard
- Check detailed transfer history with performance metrics
- View job run details including any error messages
-
Manage file metadata:
- Navigate to the "Files" section to view all processed files
- Use filters to quickly find files by status, job ID, or filename
- Click on any file to view detailed metadata including timestamps, size, and hash
- Use the advanced search page for complex queries with multiple criteria
- Delete file metadata records when no longer needed
- View files associated with specific jobs by navigating from the job details
User Management
GoMFT uses a role-based access control system:
- Administrators: Can create and manage users, access all features
- Regular Users: Can manage transfers and view history
User management features:
- Only administrators can create new user accounts
- User passwords are securely hashed with bcrypt
- Password history tracking prevents reuse of recent passwords
- Account lockout after multiple failed login attempts
- Self-service password reset via secure email links
- JWT-based authentication with tokens
- User theme preference settings (light/dark)
Transfer Configuration Options
-
Source/Destination Types:
- Local filesystem
- Amazon S3
- MinIO (S3-compatible storage)
- Backblaze B2
- SFTP
- FTP
- SMB/CIFS shares
- And many more via rclone
-
Connection Options:
- Host/server addresses
- Authentication (username/password or key files)
- Port configurations
- Cloud credentials (access keys, secret keys)
- Bucket and region settings
- Custom endpoints
- Custom rclone flags
-
File Options:
- File patterns for filtering (e.g.,
*.txt,data_*.csv) - Output patterns for dynamic naming
- Archive options for transferred files
- Skip already processed files to avoid duplicates
- Concurrent file transfers (configurable per job)
- File patterns for filtering (e.g.,
-
Performance Options:
- Multi-threaded File Transfers: Process multiple files simultaneously for higher throughput
- Configurable concurrency level (1-32 concurrent transfers)
- Per-job concurrency settings to optimize for different storage types
- Automatic transfer queue management to prevent overloading systems
- Adaptive processing based on source/destination capabilities
-
Schedule Options:
- Cron expressions for flexible scheduling
- Manual execution
- Enable/disable schedules
Email Notifications
GoMFT supports email notifications for various features:
- Password Reset: Users can request password reset links sent to their registered email
- Styled Emails: Professional HTML emails that match the application's design theme
- Secure Tokens: One-time use secure tokens with 15-minute expiration for enhanced security
- Flexible Configuration: Easily configure your SMTP server settings
- Authentication Options: Support for both authenticated and unauthenticated SMTP servers
- TLS Support: Secure communication with your SMTP server
- Development Mode: When emails are disabled, reset links are logged to the console
To configure email functionality:
- Edit the
.envfile and provide your SMTP server details - Set
EMAIL_ENABLED=truein the email configuration section - Ensure the
BASE_URLsetting is configured correctly for your deployment
Development
Project Structure
.
├── components/ # Templ components for UI
├── internal/
│ ├── api/ # REST API handlers
│ ├── auth/ # Authentication/authorization
│ ├── config/ # Configuration management
│ ├── db/ # Database models and operations
│ ├── email/ # Email service for notifications and password resets
│ ├── scheduler/ # Job scheduling and execution
│ └── web/ # Web interface handlers
├── static/ # Static assets
│ ├── css/
│ └── js/
└── main.go # Application entry point
Technology Stack
- Backend: Go with Gin web framework
- Frontend: Templ for Go HTML components
- UI Enhancement: HTMX for dynamic interactions
- Styling: Tailwind CSS
- Authentication: JWT (JSON Web Tokens)
- Database: GORM with SQLite
- File Transfer: rclone
- Deployment: Docker containerization and traditional installation
Building from Source
- Install development dependencies:
go install github.com/cosmtrek/air@latest # Hot reload for development
go install github.com/a-h/templ/cmd/templ@latest # Templ template compiler
- Generate template code:
templ generate
- Run in development mode:
air
Contributing
- Fork the repository
- Create a feature branch
- Commit your changes
- Push to the branch
- Create a Pull Request
License
MIT License - see LICENSE file for details
Directory Structure
GoMFT uses the following directory structure:
/app/data: Main application data directory- Contains the SQLite database (
gomft.db) - Contains rclone configurations in
/app/data/configs - Contains log files in
/app/data/logs
- Contains the SQLite database (
/app/backups: Database backup directory
When using Docker, you should mount volumes to these locations:
volumes:
- /host/path/data:/app/data # For all application data
- /host/path/backups:/app/backups # For database backups
These paths can be customized using the environment variables DATA_DIR, BACKUP_DIR, and LOGS_DIR.