Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: G Drive integration + integration docs improvements #218

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions docs/user-guide/data-sources.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# Data Sources

Docq supports associating data to a Space is a varierty of ways. These are called Data Sources and are configured on a Space. Below is the list we currently support.
Docq supports associating data to a Space is a variety of ways. These are called Data Sources and are configured on a Space. Below is the list we currently support.

- Manual Upload
- [Azure Blob](./config-spaces.md#data-source-azure-blob-container)
- [Web Scraper](./config-spaces.md#data-source-web-scraper)
- [Knowledgebase Scraper](./config-spaces.md#data-source-knowledgebase-scraper)
- [Knowledge base Scraper](./config-spaces.md#data-source-knowledgebase-scraper)
- [Google Drive](./config-spaces.md#data-source-google-drive)
- [OneDrive](./config-spaces.md#data-source-onedrive)
19 changes: 12 additions & 7 deletions docs/user-guide/file-storage-services.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,28 @@
# File Storage Services

Docq supports multiple cloud file storage services as a data source. This section covers how to set up the supported file storage services.
Audience: Docq Admins

## File storage: Google Drive
Docq can be configured to support multiple cloud file storage services as a data source. This section covers how to set up the supported file storage services.

This guide aims to assist developers in integrating Google Drive with Docq. The focus will be on setting up the Google Drive API and obtaining the necessary credentials.
## File store: Google Drive

### Setup and Configure Google Cloud project
At a high-level this involves setting up an application identity for your running instance of Docq for standard OAuth flow. This enables users of your instance of Docq to safely give permission to access their G Drive files for indexing in a Space.

### Setup an Identity with Google Cloud for your instance of Docq

- [Create a Google Cloud project](https://console.cloud.google.com/projectcreate) for your Docq web application.
- [Enable the Google Drive API](https://console.cloud.google.com/flows/enableapi?apiid=drive.googleapis.com) in the project you just created.
- Go to Menu > APIs & Services > [OAuth consent screen](https://console.cloud.google.com/apis/credentials/consent) then click create and complete the App registration form with the following scopes:
- `https://www.googleapis.com/auth/drive.readonly`
- `https://www.googleapis.com/auth/userinfo.email`
- `openid`

### Configure credentials for G Drive API

- Go to Menu > APIs & Services > [Credentials](https://console.cloud.google.com/apis/credentials) then click create credentials.
- Click `+ CREATE CREDENTIALS` > OAuth client ID then Fill the form with the following details:
- Application type: Web application
- Authorized redirect URIs: `/Admin_Spaces/`, e.g. `http://localhost:8501/Admin_Spaces/`
- Authorized redirect URIs: `/Admin_Section/`, e.g. `http://localhost:8501/Admin_Section/`
- Click create and download the credentials.json file.

The more detailed guide can be found [here](https://developers.google.com/drive/api/quickstart/python).
Expand All @@ -26,12 +31,12 @@ The more detailed guide can be found [here](https://developers.google.com/drive/

After setting up the Google Cloud project and configuring the Google Drive API, you need to configure the Docq web application. This involves configuring the following environment variables:

- `DOCQ_GOOGLE_APPLICATION_CREDENTIALS`: The path to the credentials.json file.
- `DOCQ_GOOGLE_APPLICATION_CREDENTIALS_JSON`: contents of the credentials.json. OR `DOCQ_GOOGLE_APPLICATION_CREDENTIALS`: The path to the credentials.json file. If both are configured `DOCQ_GOOGLE_APPLICATION_CREDENTIALS_JSON` wins.
- `DOCQ_GOOGLE_AUTH_REDIRECT_URL`: The redirect URL, e.g. `http://localhost:8501/Admin_Spaces/`. This must be an exact match to the Authorized redirect URIs in the Google Cloud Console.

Note: The Google Drive data source will be automatically disabled if any of the above environment variables are not set.

## File storage: OneDrive
## File store: OneDrive

This guide aims to assist developers in integrating OneDrive with Docq. The focus will be on setting up the Microsoft Graph API and obtaining the necessary credentials.

Expand Down