diff --git a/surfsense_web/content/docs/connectors/gmail.mdx b/surfsense_web/content/docs/connectors/gmail.mdx index ac5486ce6..6c08804fc 100644 --- a/surfsense_web/content/docs/connectors/gmail.mdx +++ b/surfsense_web/content/docs/connectors/gmail.mdx @@ -3,32 +3,81 @@ title: Gmail description: Connect your Gmail to SurfSense --- -# Gmail Connector +# Gmail OAuth Integration Setup Guide -Index your Gmail emails and make them searchable. +This guide walks you through setting up a Google OAuth 2.0 integration for SurfSense to connect your Gmail account. -## Prerequisites +## Step 1: Access the Google Cloud Console -- A Google account -- Google OAuth configured in SurfSense (see [Prerequisites](/docs)) -- Gmail API enabled in Google Cloud Console +1. Navigate to [Google Cloud Console](https://console.cloud.google.com/) +2. Select an existing project or create a new one -## Setup +## Step 2: Enable Required APIs -1. Navigate to your Search Space settings -2. Click on **Add Connector** -3. Select **Gmail** from the list -4. Authorize SurfSense to access your Gmail -5. Configure which labels/folders to index +1. Go to **APIs & Services** > **Library** +2. Search for and enable the following APIs: + - **People API** (required for Google OAuth) + - **Gmail API** (required for Gmail connector) -## What Gets Indexed +![Google Developer Console People API](/docs/connectors/google/google_oauth_people_api.png) -- Email content -- Email attachments -- Thread conversations -- Labels and categories +## Step 3: Configure OAuth Consent Screen -## Sync Frequency +1. Go to **APIs & Services** > **OAuth consent screen** +2. Select **External** user type (or Internal if using Google Workspace) +3. Fill in the required information: + - **App name**: `SurfSense` + - **User support email**: Your email address + - **Developer contact information**: Your email address +4. Click **Save and Continue** -The Gmail connector supports scheduled syncing to keep your emails indexed. +![Google Developer Console OAuth consent screen](/docs/connectors/google/google_oauth_screen.png) +### Add Scopes + +1. Click **Add or Remove Scopes** +2. Add the following scopes: + - `https://www.googleapis.com/auth/gmail.readonly` - Read Gmail messages + - `https://www.googleapis.com/auth/userinfo.email` - View user email address +3. Click **Update** and then **Save and Continue** + +## Step 4: Create OAuth Client ID + +1. Go to **APIs & Services** > **Credentials** +2. Click **Create Credentials** > **OAuth client ID** +3. Select **Web application** as the application type +4. Enter **Name**: `SurfSense` +5. Under **Authorized redirect URIs**, add: + ``` + http://localhost:8000/api/v1/auth/google/gmail/connector/callback + ``` +6. Click **Create** + +![Google Developer Console OAuth client ID](/docs/connectors/google/google_oauth_client.png) + +## Step 5: Get OAuth Credentials + +1. After creating the OAuth client, you'll see a dialog with your credentials +2. Copy your **Client ID** and **Client Secret** + +> ⚠️ Never share your client secret publicly or include it in code repositories. + +![Google Developer Console Config](/docs/connectors/google/google_oauth_config.png) + +--- + +## Running SurfSense with Gmail Connector + +Add the Google OAuth environment variables to your Docker run command: + +```bash +docker run -d -p 3000:3000 -p 8000:8000 \ + -v surfsense-data:/data \ + # Gmail Connector + -e GOOGLE_OAUTH_CLIENT_ID=your_google_client_id \ + -e GOOGLE_OAUTH_CLIENT_SECRET=your_google_client_secret \ + -e GOOGLE_GMAIL_REDIRECT_URI=http://localhost:8000/api/v1/auth/google/gmail/connector/callback \ + --name surfsense \ + --restart unless-stopped \ + ghcr.io/modsetter/surfsense:latest +``` diff --git a/surfsense_web/content/docs/connectors/google-calendar.mdx b/surfsense_web/content/docs/connectors/google-calendar.mdx index 76b3ea588..e6ae4d593 100644 --- a/surfsense_web/content/docs/connectors/google-calendar.mdx +++ b/surfsense_web/content/docs/connectors/google-calendar.mdx @@ -3,32 +3,80 @@ title: Google Calendar description: Connect your Google Calendar to SurfSense --- -# Google Calendar Connector +# Google Calendar OAuth Integration Setup Guide -Index your Google Calendar events and make them searchable. +This guide walks you through setting up a Google OAuth 2.0 integration for SurfSense to connect your Google Calendar. -## Prerequisites +## Step 1: Access the Google Cloud Console -- A Google account -- Google OAuth configured in SurfSense (see [Prerequisites](/docs)) -- Google Calendar API enabled in Google Cloud Console +1. Navigate to [Google Cloud Console](https://console.cloud.google.com/) +2. Select an existing project or create a new one -## Setup +## Step 2: Enable Required APIs -1. Navigate to your Search Space settings -2. Click on **Add Connector** -3. Select **Google Calendar** from the list -4. Authorize SurfSense to access your Google Calendar -5. Select which calendars to index +1. Go to **APIs & Services** > **Library** +2. Search for and enable the following APIs: + - **People API** (required for Google OAuth) + - **Google Calendar API** (required for Calendar connector) -## What Gets Indexed +![Google Developer Console People API](/docs/connectors/google/google_oauth_people_api.png) -- Event titles and descriptions -- Event attendees -- Meeting notes -- Recurring events +## Step 3: Configure OAuth Consent Screen -## Sync Frequency +1. Go to **APIs & Services** > **OAuth consent screen** +2. Select **External** user type (or Internal if using Google Workspace) +3. Fill in the required information: + - **App name**: `SurfSense` + - **User support email**: Your email address + - **Developer contact information**: Your email address +4. Click **Save and Continue** -The Google Calendar connector supports scheduled syncing to keep your events indexed. +![Google Developer Console OAuth consent screen](/docs/connectors/google/google_oauth_screen.png) +### Add Scopes + +1. Click **Add or Remove Scopes** +2. Add the following scope: + - `https://www.googleapis.com/auth/calendar.readonly` - Read Google Calendar events +3. Click **Update** and then **Save and Continue** + +## Step 4: Create OAuth Client ID + +1. Go to **APIs & Services** > **Credentials** +2. Click **Create Credentials** > **OAuth client ID** +3. Select **Web application** as the application type +4. Enter **Name**: `SurfSense` +5. Under **Authorized redirect URIs**, add: + ``` + http://localhost:8000/api/v1/auth/google/calendar/connector/callback + ``` +6. Click **Create** + +![Google Developer Console OAuth client ID](/docs/connectors/google/google_oauth_client.png) + +## Step 5: Get OAuth Credentials + +1. After creating the OAuth client, you'll see a dialog with your credentials +2. Copy your **Client ID** and **Client Secret** + +> ⚠️ Never share your client secret publicly or include it in code repositories. + +![Google Developer Console Config](/docs/connectors/google/google_oauth_config.png) + +--- + +## Running SurfSense with Google Calendar Connector + +Add the Google OAuth environment variables to your Docker run command: + +```bash +docker run -d -p 3000:3000 -p 8000:8000 \ + -v surfsense-data:/data \ + # Google Calendar Connector + -e GOOGLE_OAUTH_CLIENT_ID=your_google_client_id \ + -e GOOGLE_OAUTH_CLIENT_SECRET=your_google_client_secret \ + -e GOOGLE_CALENDAR_REDIRECT_URI=http://localhost:8000/api/v1/auth/google/calendar/connector/callback \ + --name surfsense \ + --restart unless-stopped \ + ghcr.io/modsetter/surfsense:latest +``` diff --git a/surfsense_web/content/docs/connectors/google-drive.mdx b/surfsense_web/content/docs/connectors/google-drive.mdx index 6538e24b5..f2b0105fc 100644 --- a/surfsense_web/content/docs/connectors/google-drive.mdx +++ b/surfsense_web/content/docs/connectors/google-drive.mdx @@ -3,32 +3,81 @@ title: Google Drive description: Connect your Google Drive to SurfSense --- -# Google Drive Connector +# Google Drive OAuth Integration Setup Guide -Index your Google Drive files, documents, and shared content. +This guide walks you through setting up a Google OAuth 2.0 integration for SurfSense to connect your Google Drive. -## Prerequisites +## Step 1: Access the Google Cloud Console -- A Google account -- Google OAuth configured in SurfSense (see [Prerequisites](/docs)) +1. Navigate to [Google Cloud Console](https://console.cloud.google.com/) +2. Select an existing project or create a new one -## Setup +## Step 2: Enable Required APIs -1. Navigate to your Search Space settings -2. Click on **Add Connector** -3. Select **Google Drive** from the list -4. Authorize SurfSense to access your Google Drive -5. Select the folders you want to index +1. Go to **APIs & Services** > **Library** +2. Search for and enable the following APIs: + - **People API** (required for Google OAuth) + - **Google Drive API** (required for Drive connector) -## What Gets Indexed +![Google Developer Console People API](/docs/connectors/google/google_oauth_people_api.png) -- Google Docs -- Google Sheets -- Google Slides -- PDFs and other documents -- Shared files +## Step 3: Configure OAuth Consent Screen -## Sync Frequency +1. Go to **APIs & Services** > **OAuth consent screen** +2. Select **External** user type (or Internal if using Google Workspace) +3. Fill in the required information: + - **App name**: `SurfSense` + - **User support email**: Your email address + - **Developer contact information**: Your email address +4. Click **Save and Continue** -The Google Drive connector supports scheduled syncing to keep your content up to date. +![Google Developer Console OAuth consent screen](/docs/connectors/google/google_oauth_screen.png) +### Add Scopes + +1. Click **Add or Remove Scopes** +2. Add the following scopes: + - `https://www.googleapis.com/auth/drive.readonly` - Read-only access to Google Drive + - `https://www.googleapis.com/auth/userinfo.email` - View user email address +3. Click **Update** and then **Save and Continue** + +## Step 4: Create OAuth Client ID + +1. Go to **APIs & Services** > **Credentials** +2. Click **Create Credentials** > **OAuth client ID** +3. Select **Web application** as the application type +4. Enter **Name**: `SurfSense` +5. Under **Authorized redirect URIs**, add: + ``` + http://localhost:8000/api/v1/auth/google/drive/connector/callback + ``` +6. Click **Create** + +![Google Developer Console OAuth client ID](/docs/connectors/google/google_oauth_client.png) + +## Step 5: Get OAuth Credentials + +1. After creating the OAuth client, you'll see a dialog with your credentials +2. Copy your **Client ID** and **Client Secret** + +> ⚠️ Never share your client secret publicly or include it in code repositories. + +![Google Developer Console Config](/docs/connectors/google/google_oauth_config.png) + +--- + +## Running SurfSense with Google Drive Connector + +Add the Google OAuth environment variables to your Docker run command: + +```bash +docker run -d -p 3000:3000 -p 8000:8000 \ + -v surfsense-data:/data \ + # Google Drive Connector + -e GOOGLE_OAUTH_CLIENT_ID=your_google_client_id \ + -e GOOGLE_OAUTH_CLIENT_SECRET=your_google_client_secret \ + -e GOOGLE_DRIVE_REDIRECT_URI=http://localhost:8000/api/v1/auth/google/drive/connector/callback \ + --name surfsense \ + --restart unless-stopped \ + ghcr.io/modsetter/surfsense:latest +``` diff --git a/surfsense_web/content/docs/index.mdx b/surfsense_web/content/docs/index.mdx index e5f89621e..bb07c5f68 100644 --- a/surfsense_web/content/docs/index.mdx +++ b/surfsense_web/content/docs/index.mdx @@ -15,8 +15,6 @@ To set up Google OAuth: 1. Login to your [Google Developer Console](https://console.cloud.google.com/) 2. Enable the required APIs: - **People API** (required for basic Google OAuth) - - **Gmail API** (required if you want to use the Gmail connector) - - **Google Calendar API** (required if you want to use the Google Calendar connector) ![Google Developer Console People API](/docs/connectors/google/google_oauth_people_api.png) 3. Set up OAuth consent screen. ![Google Developer Console OAuth consent screen](/docs/connectors/google/google_oauth_screen.png)