Google Drive Setup Guide
This guide will walk you through the process of setting up Google Drive authentication for FileSyncHub.
Prerequisites
- A Google Account
- Access to Google Cloud Console
- FileSyncHub installed on your system
Step 1: Create a Google Cloud Project
- Go to the Google Cloud Console
- Click on “Select a Project” at the top of the page
- Click “New Project”
- Enter a project name (e.g., “FileSyncHub”)
- Click “Create”
Step 2: Enable the Google Drive API
- Select your project in the Google Cloud Console
- Go to the API Library
- Search for “Google Drive API”
- Click on “Google Drive API”
- Click “Enable”
Step 3: Configure OAuth Consent Screen
- Go to the OAuth consent screen
- Select “External” user type
- Fill in the required information:
- App name: “FileSyncHub”
- User support email: Your email
- Developer contact information: Your email
- Click “Save and Continue”
- Add the following scope:
https://www.googleapis.com/auth/drive.file
- Click “Save and Continue”
- Add your email address as a test user
- Click “Save and Continue”
Step 4: Create OAuth 2.0 Credentials
- Go to the Credentials page
- Click “Create Credentials”
- Select “OAuth client ID”
- Choose “Desktop app” as the application type
- Name it “FileSyncHub Desktop Client”
- Click “Create”
- Download the client configuration file (JSON)
Step 5: Configure FileSyncHub
- Create a
credentials
directory in your FileSyncHub configuration folder:mkdir -p ~/.config/filesynchub/credentials
- Copy the downloaded JSON file to the credentials directory:
cp ~/Downloads/client_secret_*.json ~/.config/filesynchub/credentials/google_drive.json
Step 6: First-Time Authentication
- Run FileSyncHub with the TUI interface:
filesynchub sync --tui
- The application will show a popup with authentication instructions
- A browser window should open automatically
- If not, copy the provided URL and paste it into your browser
- Sign in with your Google account
- Grant the requested permissions
- Return to FileSyncHub
Troubleshooting
Common Issues
- Authentication Timeout
- Error: “Authentication timed out after 60 seconds”
- Solution: Restart FileSyncHub and try again, being sure to complete the process within 60 seconds
- Invalid Client Configuration
- Error: “Error reading client secret file”
- Solution: Verify that the credentials file is correctly named and placed in the right directory
- Access Denied
- Error: “Access denied” during Google sign-in
- Solution: Make sure your email is added as a test user in the OAuth consent screen
Security Notes
- Keep your
google_drive.json
file secure - Never share your credentials
- Use environment variables for sensitive information in production