Docs menu

Google Drive

Deskhand reads a Drive folder with a service account that has read-only access.

1. Give the service account access

  1. In the Google Cloud project that owns your service account, enable the Google Drive API. If you set up Google Chat, reuse that service account.
  2. Share the Drive folder with the service account’s email address as Viewer. That sharing is the scope: the account sees nothing else.

Anyone who can message Deskhand can read, through it, any document its docs credentials can see within the configured scope. Share only folders that everyone may read with the service account.

Put the key JSON in a secrets/ folder in your project, uncomment the ../secrets:/app/secrets:ro line in deploy/docker-compose.yml, and set the path in .env:

GOOGLE_SERVICE_ACCOUNT_FILE=secrets/<file>.json

2. Add the source

The folder ID is the last part of the folder’s URL: https://drive.google.com/drive/folders/1AbC....

docs:
  sources:
    - type: google_drive
      name: it-drive
      folder_id: 1AbC...

Scope

The folder and every folder inside it. To index two separate folders, add two google_drive sources.

What gets indexed

  • Google Docs, exported as Markdown
  • Markdown and plain text files
  • Other files, such as Sheets, PDFs, and images, are skipped

Answers link to the file in Drive. Sync works as for every source: on startup and every docs.sync_interval_minutes, re-fetching only files that changed.