Setup required first — the Picker is not ready yet. No CineNest OAuth client or API key exists, so the Picker cannot open until you complete Step 1 (about 5 minutes). After that, this page is your Picker link: it uses drive.file only, so CineNest can touch just the folder you select here, not your whole Drive. A folder ID on its own is not permission; picking it here is what grants it.
Keep this folder. Do not create a new one.
Private · Already used by the CineNest app. You will re-select this exact folder in Step 2 so the same OAuth app gets drive.file access to it.
drive scope + root_folder_id. That token could see all of Drive.files.create with your OAuth token and parents: [pickedFolderId].drive.file, Google only lets the app see files it created — or files/folders you explicitly open with Picker. Picking CineNest Movies is the grant.No OAuth client or API key exists yet for CineNest — that is why there was no Picker link to send until now. Use a new CineNest project, separate from TWOUZA Cloud, so the grant stays isolated.
CineNest.https://www.googleapis.com/auth/drive.file. Do not add drive or drive.readonly.CineNest Picker. Under Authorised JavaScript origins, add the origin of this page (the URL in your browser address bar, without any path). If Google later rejects sign-in with origin_mismatch, this is the field to fix.Do not reuse the TWOUZA Studio OAuth setup for this — CineNest gets its own project, client, and key, so revoking one never affects the other.
Sign-in requests drive.file only. Then Picker opens — choose CineNest Movies and confirm. That selection is saved in this tab as the upload target.
Pre-filled with the CineNest Web client — the same client the backend uses. The Picker and the backend must use this same client, or the backend will not see the folder you pick. Do not swap in the Desktop client here.
Expected pick: CineNest Movies · 1q1bc4sFj4prS1wMWW5CQrW1sxdFQUtde. If you pick a different folder, the test upload will go there instead — the page warns you.
The Picker test in Step 3 proves the folder grant. This step gives the server its own refresh token, so it can upload later with your browser closed — without ever seeing your password or a full-Drive token.
Exact HTTPS callback URL: https://cinenest-picker.pages.dev/oauth/callback
Scope: https://www.googleapis.com/auth/drive.file only · Offline access: yes (access_type=offline, prompt=consent)
Client secret: stored as a Cloudflare Pages secret (GOOGLE_CLIENT_SECRET) — never in this page, never in code, never in chat.
Refresh token: stored in Cloudflare KV (CINENEST_TOKENS, key refresh_token), encrypted at rest, readable only by the callback Worker. It is never shown in the browser, never logged, and never returned by /oauth/status (that endpoint only says saved: true/false).
The test button runs entirely on the server: it refreshes the saved token in Cloudflare KV and uploads a small cinenest-backend-refresh-test.txt to CineNest Movies, then verifies it with files.get. No token value is ever returned to the browser. If the test file already exists, it is returned instead of uploading a duplicate.
The callback validates a random, single-use state — stored both in an HttpOnly cookie and on the server, so a lost Safari cookie alone no longer rejects a real sign-in. A wrong, missing, or already-used state is still rejected with 403 and no code is exchanged. Do not refresh the callback page, and do not open the sign-in in a different tab or app — complete it in this same Safari tab, within 10 minutes. If you do see “Invalid state”, tap the “Try again” link on that page for a fresh sign-in; refreshing the rejected page will be rejected again. Before any refresh token is saved or replaced, the callback also verifies the signed-in account is adwin.shju@gmail.com and that the existing CineNest Movies folder is writable (canAddChildren). If the folder check returns 404, the token is held pending for 10 minutes only — it is not saved — and you are sent to Step 2 with ?backend_pick=1: pick CineNest Movies again with this same Web client (Picker App ID 308868400448), then the server re-checks write access via /oauth/pick-verify and only then saves the refresh token.
Pick any small file you own (a few MB is ideal — e.g. a short .txt, image, or tiny clip named with 1080p if you want to mirror the bot rule). The page uploads it directly to the folder you just picked, using the same token.
Success means: Drive returns a file ID, and the file appears when you open CineNest Movies above. Delete the test file from Drive afterwards if you don’t want to keep it. Failure means: copy the exact error shown — do not approve wider access to “fix” it.
TWOUZA-TEMP-01 · 129.225.106.227 · 1 OCPU / 1 GB RAM · 46.6 GB boot volume · Ubuntu 24.04 · Last confirmed Running 30 Nov.
Once SSH is set to Ask in Muse Settings → Permissions → Direct network protocols, the read-only check to run is:
free -h swapon --show df -h / uptimeNothing will be installed, restarted, or deployed from that check. Results get reported first; CineNest (in its own ~/cinenest-importer, separate services and state) is only deployed after you approve the numbers.
drive.file + Picker. Account-wide rclone flow rejected.The server keeps the same Telegram logic (Local Bot API, 1080p filter, file-ID de-dupe, confirmation in your private bot chat). Only the Drive leg changes:
POST https://www.googleapis.com/upload/drive/v3/files?uploadType=multipart Authorization: Bearer <your drive.file token> Metadata: { "name": "<filename>", "parents": ["<pickedFolderId>"] }The refresh token on the server must come from this same Picker-granted flow — not from an rclone drive-scope authorisation. If Google returns 404 fileNotFound or 403 insufficientFilePermissions for the picked folder, deployment pauses with that exact error shown to you.