feat: Google Drive OAuth via http://localhost redirect (no public domain required)
- Switch redirect URI from server IP to http://localhost (works everywhere) - Add manual code exchange flow: user copies URL from browser, pastes in app - New PHP action gdrive_oauth_exchange to exchange auth code for refresh token - Fix null bug in gdrive_oauth_exchange (was read before initialization) - Add #gdrive-code-section UI with input + submit button in index.html - Update _gdriveAuthorize() to show code section and store redirect_uri - Add _gdriveSubmitCode() JS function for manual code submission - Update setup wizard and backup tab to show http://localhost as redirect URI - Add 5 new translation keys (gdrive_redirect_uri_hint, gdrive_code_title, gdrive_code_hint, gdrive_code_submit, gdrive_code_empty) in all 5 languages - Update gdrive_oauth_steps in all translations to reflect new flow - Document Google Drive OAuth setup in README.md - Dark mode: comprehensive fix for 30+ components with hardcoded light colors
This commit is contained in:
@@ -296,6 +296,24 @@ The included `backup.sh` creates local daily backups of your database:
|
||||
0 3 * * * /path/to/evershelf/backup.sh
|
||||
```
|
||||
|
||||
### Google Drive Backup (Optional)
|
||||
|
||||
EverShelf supports automatic daily backups to Google Drive via OAuth 2.0. This works on any server, including private IP / local network setups (no public domain required).
|
||||
|
||||
**Setup:**
|
||||
|
||||
1. Go to [console.cloud.google.com](https://console.cloud.google.com) and select or create a project.
|
||||
2. Enable the **Google Drive API** (`APIs & Services → Enable APIs → Google Drive API`).
|
||||
3. Go to `APIs & Services → Credentials → Create Credentials → OAuth client ID`.
|
||||
4. Application type: **Web application**.
|
||||
5. Add **`http://localhost`** as an Authorized Redirect URI (this is the key — it works even without a real domain).
|
||||
6. Copy **Client ID** and **Client Secret** into EverShelf Settings → Backup.
|
||||
7. Enter your **Google Drive Folder ID** (the last part of the folder URL).
|
||||
8. Click **Authorize with Google** and sign in.
|
||||
9. The browser will redirect to `http://localhost` and may show a connection error — **this is expected**. Copy the full URL from the address bar (e.g. `http://localhost/?code=4%2F0A...`) and paste it into the field that appears in EverShelf, then click **Submit**.
|
||||
|
||||
> **Note:** While the OAuth app is in *Testing* status in Google Cloud Console, you must add your Google account as a test user under `APIs & Services → OAuth consent screen → Test users`.
|
||||
|
||||
---
|
||||
|
||||
## 🏗️ Architecture
|
||||
|
||||
Reference in New Issue
Block a user