A file synchronization hub with support for Google Drive and OneDrive, written in Rust.
- Real-time file synchronization
- Support for multiple cloud storage providers
- Terminal user interface (TUI) for monitoring sync progress
- Background service mode
- Configurable file patterns and sync rules
- Efficient chunked file uploads
- Secure OAuth2 authentication
- Clone the repository:
git clone https://github.com/felipepimentel/FileSyncHub.git
cd FileSyncHub
- Build the project:
cargo build --release
- Copy the example configuration file:
cp examples/config/example_config.toml config.toml
-
Edit
config.toml
to set your sync directories and preferences. -
Set up cloud provider credentials:
- Go to the Google Cloud Console
- Create a new project
- Enable the Google Drive API
- Create OAuth 2.0 credentials
- Copy the example credentials file:
cp examples/credentials/google_drive_example.json credentials/google_drive.json
- Update the file with your credentials
- Go to the Microsoft Azure Portal
- Register a new application
- Add Microsoft Graph API permissions for Files.ReadWrite.All
- Copy the example credentials file:
cp examples/credentials/onedrive_example.json credentials/onedrive.json
- Update the file with your credentials
The project includes several examples demonstrating different features:
Test basic file operations with Google Drive:
cargo run --example sync_with_google_drive
Test basic file operations with OneDrive:
cargo run --example sync_with_onedrive
Sync document files between local storage and cloud providers:
cargo run --example sync_documents
Run with the terminal user interface to monitor sync progress:
cargo run --example sync_with_tui
Run as a background service:
cargo run --example run_as_service
Start FileSyncHub as a background service:
filesynchub service start
Stop the service:
filesynchub service stop
Start FileSyncHub with the terminal user interface:
filesynchub tui
filesynchub [OPTIONS] [COMMAND]
Commands:
service Run as a background service
tui Run with terminal user interface
help Print help information
Options:
-c, --config <FILE> Configuration file path
-v, --verbose Enable verbose logging
-h, --help Print help information
-V, --version Print version information
Run the test suite:
cargo test
Run tests with logging:
RUST_LOG=debug cargo test -- --nocapture
Generate and view the documentation:
cargo doc --no-deps --open
- Fork the repository
- Create a feature branch
- Commit your changes
- Push to the branch
- Create a Pull Request
This project is licensed under the Apache License 2.0 - see the LICENSE file for details.