Scan your personal Google Drive or OneDrive through a read-only app you own.
What it scans
| Provider | Scans | Notes |
|---|---|---|
| Personal Google Drive | Files in My Drive | Docs and Slides export as text; Sheets export as CSV |
| Personal OneDrive | Files in your personal Microsoft OneDrive |
An optional folder narrows the scan. Work or school accounts use the Google Workspace or Microsoft 365 guides.
What you need
- Your own agent.
- A personal provider account.
- An OAuth app you control. Myrikeep does not register the app or receive its credentials.
Both providers grant account-wide read-only access. A folder limits scanning, not the OAuth grant.
Alternative: a folder you already sync
App passwords do not work for Google Drive or OneDrive files; those services only accept a sign-in (OAuth).
Already sync your drive to a computer or NAS (Google Drive for desktop, the OneDrive app, rclone, Synology Cloud Sync, TrueNAS cloud sync)? Skip the OAuth app:
- Mount the synced folder into the agent read-only.
- Add a Local/NFS mount connection for it (see Local, NFS and SMB mounts).
| Synced folder | OAuth sign-in (below) | |
|---|---|---|
| Finds sensitive files | Yes | Yes |
| Shows public links and outside sharing | No (a local copy has no sharing information) | Yes |
| Setup | Mount a folder | Create your own OAuth app once, sign in on the agent |
Step 1: Create your OAuth app
- Open Google Cloud Console, open the project menu, then New project. Give it a name you recognize.
- In APIs & Services → Library, find Google Drive API and enable it.
- Open Google Auth Platform (older consoles: OAuth consent screen).
- Set the app name, your support email and developer contact email.
- Select the External audience.
- While the status is Testing, add your own Google account under Test users.
- Under Data Access, add
https://www.googleapis.com/auth/drive.readonly. - Change the publishing status to In production, then sign in again (Step 3) for a new refresh token.
- Under Clients → Create client (or Credentials → Create credentials → OAuth client ID), choose
Desktop app. Copy its client ID and client secret into the local file in
Secret file. If you download JSON, copy just these two fields from its
installedobject; do not paste the whole download.
Important: Testing refresh tokens for this scope expire after seven days. In production avoids that limit, but tokens can still expire or be revoked.
The "Google hasn't verified this app" warning
A personal-use app with fewer than 100 users can be used without verification, so expect this warning: you have not submitted your own app for review. Check that the app shown is yours, then use Advanced → Go to your app if offered. Do not publish this client for general distribution. Myrikeep needs no Google verification.
References: enable APIs, desktop OAuth and PKCE, refresh token expiration, personal-use verification exemption, Drive read-only scope.
- Open Microsoft Entra admin center and select Entra ID → App registrations → New registration.
- Enter a name and choose Personal Microsoft accounts only as the supported account type. Register, then copy the Application (client) ID from Overview.
- Under Authentication → Advanced settings, set Allow public client flows to Yes and save. Device authorization is a public-client flow: no client secret or redirect URI is needed.
- Under API permissions → Add a permission → Microsoft Graph → Delegated permissions, add
Files.Read.All. - Remove unneeded defaults, such as
User.Read. - Do not add application permissions or write permissions.
- The agent also requests
offline_accessso it can refresh your sign-in. - Put only the
client_idin the local file in Secret file.
Do I need an Azure subscription?
Registration uses an Entra directory, and you may need to set one up first. Microsoft's current quickstart requires an Azure account with an active subscription and links to a free-account signup. No paid Entra feature is needed for this flow; free-account eligibility and directory creation can vary by account.
References: register an app and account types, public client configuration, device authorization, Files.Read.All.
Step 2: Save the client file on the agent
Create and mount the client file and catalog entry from Secret file. Keep the existing writable state volume: refresh tokens are stored there.
Step 3: Sign in on the agent
Replace <agent> with the running container's name. The distributed image's binary is datagate-crawler.
docker exec -it <agent> datagate-crawler signin PERSONAL_GOOGLE
- Open the printed authorization URL in any browser and approve read-only Drive access.
- Copy the full redirected
http://127.0.0.1:<port>/...address back into the terminal. Input is hidden.
You should see the CLI confirm the sign-in. On another computer, or outside the container, the final page may say it cannot connect: copy that address anyway.
How the Google sign-in works
- The CLI validates the pasted address's origin and state; it does not fetch your pasted URL.
- A bare authorization code also works through the same session's PKCE verifier, but the full URL includes the state check and is preferred.
- This uses a Desktop loopback redirect, not Google's retired out-of-band redirect.
docker exec -it <agent> datagate-crawler signin PERSONAL_MICROSOFT
- Open the printed verification URL and enter the short code.
- Sign in to your personal Microsoft account.
You should see the CLI finish waiting for authorization and save the refresh token. It uses the consumers
authority; work or school sign-in is not the purpose of this connector.
Other runtimes: source image or local checkout
In a source-runtime image:
docker exec -it <agent> python -m crawler signin PERSONAL_GOOGLE
docker exec -it <agent> python -m crawler signin PERSONAL_MICROSOFT
In a local checkout:
python -m crawler signin PERSONAL_GOOGLE
python -m crawler signin PERSONAL_MICROSOFT
A source checkout can set DG_AGENT_STATE_DIR to a private writable directory. Use the same directory for
sign-in and the running agent.
Step 4: Connect and scan
- In Connections, select Google Drive (personal account) or OneDrive (personal Microsoft account).
- Assign your agent and choose Local credential catalog.
- Enter
PERSONAL_GOOGLEorPERSONAL_MICROSOFTas the credential name. - Optionally limit the folder:
- Google: a folder ID from its folder URL, or
root(the default). - OneDrive: a path under root, such as
Documents/Taxes, without a leading slash or... - Queue a scan from Scans.
Connection settings table
| Console field | Example | Required or optional |
|---|---|---|
| Connection name | Personal taxes |
Required; unique in workspace |
| Type | gdrive_personal or onedrive_personal |
Required |
| Google folder ID (Google) | root or ID after /folders/ in its URL |
Optional; default My Drive root |
| Root folder path (OneDrive) | Documents/Taxes |
Optional; relative to drive root, no leading slash or .. |
| Agent | Home agent |
Required; same workspace |
| Credential mode | Local credential catalog | Required |
| Credential name | PERSONAL_GOOGLE or PERSONAL_MICROSOFT |
Required; must match sign-in alias |
| Exclude patterns (View/edit) | *.tmp |
Optional; one glob per line |
| Enabled (connection row) | Enabled | Disable to stop new scans |
Secret file
On the agent host, create /srv/myrikeep/secrets and the files below. Replace placeholders locally. Never put
secrets in the console or connection config.
| Rule | Value |
|---|---|
| Owner | The agent UID (the image uses 10001) or root, readable by the agent |
| Mode | 0400 / 0600, or 0440 with a dedicated group |
/srv/myrikeep/secrets/personal-google.json:
{"client_id": "<YOUR_DESKTOP_CLIENT_ID>", "client_secret": "<YOUR_DESKTOP_CLIENT_SECRET>"}
/srv/myrikeep/secrets/personal-microsoft.json:
{"client_id": "<YOUR_APPLICATION_CLIENT_ID>"}
Merge the entries you use into /srv/myrikeep/secrets/myrikeep-credentials.json:
{
"version": 1,
"credentials": {
"PERSONAL_GOOGLE": {
"type": "gdrive_personal",
"source": {"kind": "file_json", "path": "/run/secrets/personal-google.json"}
},
"PERSONAL_MICROSOFT": {
"type": "onedrive_personal",
"source": {"kind": "file_json", "path": "/run/secrets/personal-microsoft.json"}
}
}
}
Mount the directory read-only in the agent's docker run command (recreate the container to add a mount):
--mount type=bind,src=/srv/myrikeep/secrets,dst=/run/secrets,readonly
Keep the existing writable state volume at /var/lib/myrikeep. Losing it means signing in again.
Where refresh tokens are stored
- One
oauth-<CREDENTIAL_NAME>.jsonfile per credential name in the state volume, mode0600, replaced atomically on rotation. - Never written into the secret mount, logged or uploaded.
- Access tokens exist only in memory.
Scope, exclusions and schedules
| Provider | Scans | Excludes |
|---|---|---|
| My Drive descendants; a folder must have a verifiable parent chain to My Drive | Shared with me, shared drives, shortcuts | |
| OneDrive | The signed-in user's /me/drive beneath the configured path |
Cross-drive and package items |
- Exclude globs such as
*.tmp,~$*or*.bak(in Connections → View/edit) match item names, not full folder paths. Case matters. - Do not run two agents against the same token state volume.
- See Getting started for schedule cadence.
"Who can see it" support
| OneDrive | ||
|---|---|---|
| Public links and outside grants | Yes | Yes |
| Restricted result | Possible: owner-complete narrow evidence may be restricted | Views stay partial: no broad signal means unknown, not restricted |
| Group membership expansion | No | No |
| Age basis | Modification time | Modification time |
Google viewed-by-me timestamps describe only the caller. A synced folder has no cloud sharing evidence. See Who can see it.
Troubleshooting
| Symptom or state | Fix |
|---|---|
unknown |
Check fresh heartbeat, assignment and current connection revision. |
missing / credential_missing |
Check catalog alias/type and secret mount. Outages can block presence checks without deleting a usable refresh token. |
Invalid / credential_config_invalid |
Use exact client fields, permitted file modes and the mounted path. Extract Google's two fields from installed. |
signin_required / Sign-in required |
Sign in again after a revoked, expired or missing refresh token, a changed OAuth app or a lost state volume. |
present |
Token readiness passed; the folder and file permissions still need a scan. |
| Google Testing token expires after seven days | Switch your own app to In production, then sign in again. Tokens can still expire or be revoked. |
| Unverified app warning | Verify the app shown is your own before continuing. |
| Redirect page cannot connect | Copy its complete loopback URL into the same running CLI session, as in Step 3. |
source_error / access denied / item gone |
Inspect local diagnostics; check folder ID/path, read permission and API enablement. Google needs a My Drive parent chain. |
Sharing access_denied / unknown |
Review read-only metadata permission and rescan; missing evidence never proves restriction. |
| Paused / Migration paused / Disabled | Resume the agent, assign and save a valid connection, or enable it. |
To disconnect: revoke your app's consent in the provider account and disable the console connection. Reconnecting then needs a new sign-in.
Limits
Not scanned: shared drives, Shared with me, shortcuts (Google); cross-drive and package items (OneDrive).
Never done: writes, app-password sign-in, group expansion, all-account search.
| Limit | Value |
|---|---|
| Folder walks | Item, depth, response and time budgets |
| Classification | Bounded samples and exports; see Coverage for skips |
| Parsers | Common text, PDF text and modern Office; other formats get strings-only checks |
| Text in images and scanned PDFs | Needs OCR: an optional premium feature an owner enables; it runs inside your agent with the OCR agent image |
| Network | API and auth hosts are fixed; bearer tokens are not forwarded to redirected download hosts |
Processing and optional AI assist follow the security explanation.