32 Commits
Author SHA1 Message Date
MachinePainting 4f85fcadfa v1.1.0: Security hardening parity with DropSend (untested)
Mirrors the security architecture of ComfyUI_DropSendNode v1.1.x to close
the same vulnerability classes. The actual Google OAuth grant path is
unchanged from v1.0.1 (same Flow.from_client_config, same OOB redirect,
same fetch_token call), so existing users' OAuth setup continues to work.
What changed is the wrapper around it. Note: this release has not been
runtime-tested end to end; the security logic is a direct port of the
tested DropSend implementation.

Setup Node refactor:
- Removed google_client_id, google_client_secret, auth_code, and the
  service-account JSON from INPUT_TYPES. They no longer enter
  PromptServer.history, workflow JSON, PNG metadata, localStorage, or
  copy-pasted nodes.
- Added a browser-only modal (web/drivesend_oauth.js) and a same-origin
  POST route /drivesend/setup/stash for entry. Hardening: origin check,
  live-WebSocket gate, per-IP rate limit, 32 KB body cap, JSON content
  type lockdown, 60-second TTL, 32-entry capacity, lock-protected access.
- Added COMFYUI_DRIVESEND_ALLOW_SETUP=1 opt-in gate. Without it the node
  refuses to write or clear credentials, blocking remote workflow
  submitters from hijacking or wiping the operator's Drive connection.
- Removed plaintext stdout prints of GOOGLE_CLIENT_ID / GOOGLE_CLIENT_SECRET
  / GOOGLE_REFRESH_TOKEN / COMFYUI_ENCRYPTION_KEY. Replaced with a
  redacted (last-4-chars) banner.
- WebSocket credential delivery is sid-targeted, never broadcast. Refuses
  to send when client_id is None and surfaces a clear error. JS handler
  verifies client_id matches api.clientId before rendering.
- Service-account JSON is entered via a textarea in the same modal,
  base64-encoded into GOOGLE_SERVICE_ACCOUNT_JSON for delivery.

File-system hardening:
- .env and token.json now created via os.open(O_WRONLY|O_CREAT|O_TRUNC,
  0o600), race-free, instead of open('w') with default umask (0o644).
- Added safe_paths.py: clamps watch_folder to ComfyUI's output tree
  (with COMFYUI_DRIVESEND_ALLOWED_WATCH_PATHS opt-in for additional
  roots), rejects symlinks in event paths, validates Drive folder IDs.
- AutoUploader now runs every event path through safe_paths.is_safe_event_path.

Logging:
- Centralized logging in __init__.py with race-free 0o600 creation of
  drivesend.log on the root logger. Removed module-level
  logging.basicConfig duplicates from monitor_output.py, encrypt_file.py,
  drivesend_uploader_node.py.
- Verified: no logger or print call in the codebase emits an access
  token, refresh token, client secret, service-account JSON body, or
  encryption key value.

.gitignore additions:
- token.json, client_secret.json, service_account.json (Google credential
  caches, previously not ignored).
- Editor backups: *.bak, *.backup, *~, *.swp, *.swo, .idea/.
- Encrypted artifacts: *.enc.
- Stray credential material: *.key, *.pem, *.p12, *.pfx.
- .claude/, .pytest_cache/, .coverage, htmlcov/, build artifacts,
  Thumbs.db, Desktop.ini.

README rewrite:
- Linear three-step structure (Google Cloud setup, Setup Node, AutoUploader).
- Cloud / Local / Service-Account sections for the Setup Node.
- Threat model section documenting all enforced protections.
- "Setup is disabled" and "Browser delivery refused" troubleshooting.
- No em dashes per project style.

Tests:
- tests/test_security.py with five regression tests covering: send_sync
  is never called with sid=None for credential events; payload echoes
  client_id for JS-side verification; .env file mode is exactly 0o600;
  client_id pattern rejects malformed input; stash entries expire after
  TTL. Tests run without google-auth, googleapiclient, or watchdog
  installed via ghost modules.

Version: 1.0.1 -> 1.1.0
v1.1.0
2026-05-09 07:52:42 -07:00
MachinePainting 70d62d893c Bump version to 1.0.1 v1.0.1 2026-02-22 21:36:32 -08:00
MachinePainting 7ce5a0a5fb Fix encryption to preserve original file extension
Encryption now appends .enc to the full filename instead of replacing
the extension. This preserves the file format through the encrypt/decrypt
round-trip (e.g., image.png → image.png.enc → image.png).
2026-02-22 21:13:57 -08:00
MachinePainting 2379b0e03d Default enable_encryption to True 2026-02-12 19:38:13 -08:00
MachinePainting 71517aedf2 Update README: fix decryption scripts flow, add platform subfolders, add manual encryption note 2026-02-12 19:26:56 -08:00
MachinePainting 18aacebafd Update README: clarify decryption scripts, RunPod template setup, and node settings 2026-02-12 19:00:10 -08:00
MachinePainting 6b1f323637 Revise README title
Updated project title for clarity and added a reference to Google Drive.
2026-02-01 07:17:35 -08:00
MachinePainting 819f55fd1d Include overview image in README
Add image to README for DriveSend Node overview
2026-02-01 07:11:32 -08:00
MachinePainting 9f87807269 Node Image Display 2026-02-01 07:09:39 -08:00
MachinePainting 1a1f465f07 Update README.md 2026-02-01 06:56:24 -08:00
MachinePainting 6ad746abc1 v1.0.0: Fix encryption architecture, add registry support
- Separate encrypt watcher creates .enc copies (preserves originals)
   - Upload watcher only uploads .enc files when encryption enabled
   - Prevents ComfyUI from overwriting files due to missing sequence numbers
   - Added pyproject.toml and GitHub Actions for ComfyUI Registry
2026-02-01 06:38:38 -08:00
MachinePainting 267620bd98 Fix encryption architecture to preserve ComfyUI sequential naming
- Separate encrypt watcher creates .enc copies (preserves originals)
- Upload watcher only uploads .enc files when encryption enabled
- Matches DropSend architecture
- Prevents ComfyUI from overwriting files due to missing sequence numbers
- Added drivesend.log for logging
v1.0.0
2026-02-01 06:19:00 -08:00
MachinePainting a871fdeec9 Update Readme.md 2026-02-01 05:11:54 -08:00
MachinePainting 765712d6b7 Update Readme.md 2026-02-01 04:51:35 -08:00
MachinePainting b3a87254ce Match DropSend encryption key lookup order 2026-02-01 04:48:21 -08:00
MachinePainting 1227257cb7 Fix encryption key lookup, simplify README 2026-02-01 04:39:30 -08:00
MachinePainting b610b20afb Complete update: OAuth guide, encryption key standardization
- Comprehensive README with step-by-step OAuth setup
- Added link to DropSend at top
- All encryption key references now COMFYUI_ENCRYPTION_KEY (uppercase)
- All files check both uppercase and lowercase for compatibility
- Clearer error messages
- Removed folder_id from AutoUploader (only in Setup)
- Print full credentials in console (not truncated)
2026-02-01 04:08:27 -08:00
MachinePainting adb530e8f2 Fix: Print full credentials, clearer OAuth instructions
- Setup node prints FULL values (not truncated) for RunPod Secrets
- Saves token.json for local users
- Removed redundant folder_id from AutoUploader
- Clearer OAuth instructions: Click URL to authorize
- Better error message for expired/invalid auth codes
- Removed unused webbrowser import
2026-02-01 03:18:30 -08:00
MachinePainting 2cc6c924f4 Fix: Print full credentials, clearer OAuth instructions
- Setup node prints FULL values (not truncated) for RunPod Secrets
- Saves token.json for local users
- Removed redundant folder_id from AutoUploader
- Clearer OAuth instructions: Click URL to authorize
- Removed unused webbrowser import
2026-02-01 03:13:52 -08:00
MachinePainting f11a58322c Fix: Print full credentials in console, remove redundant folder_id from AutoUploader
- Setup node now prints FULL values (not truncated) for easy copy to RunPod Secrets
- Setup node saves token.json for local users
- Removed folder_id from AutoUploader node (only needed in Setup)
- AutoUploader now reads folder_id only from environment variable
2026-02-01 03:07:51 -08:00
MachinePainting 2c49196561 Major update: OAuth support for personal Gmail accounts
- Added OAuth 2.0 authentication with auto-refresh tokens
- OAuth tokens refresh automatically on pod startup (works like DropSend Node)
- Service Account method now clearly marked as Google Workspace only
- Updated README with clear auth requirements
- Added wait_for_complete_write() for reliable file uploads
- Removed broken ownership transfer code
- Default auth method changed to OAuth
- Better error messages for quota and auth issues
2026-02-01 02:34:43 -08:00
MachinePainting 9c253d25d3 changes to add timed delay on uploads to prevent fails 2026-02-01 02:23:20 -08:00
MachinePainting feea1b4634 changes to transfer ownership from service acct to user 2026-02-01 01:57:54 -08:00
MachinePainting 4ee0f31bdf changes to setup workflow and instructions 2026-02-01 01:14:12 -08:00
MachinePainting f20552aecb Revise README for ComfyUI DriveSend Node
Updated README to reflect changes in encryption key naming and script usage instructions for different operating systems.
2026-01-29 03:38:13 -08:00
MachinePainting 2d993e2ad6 updated to universal drop/drive node 2026-01-29 03:37:37 -08:00
MachinePainting 47235efd22 Revise README for Google Drive version and encryption info
Updated README to reflect Google Drive version and clarify encryption options.
2026-01-29 03:10:33 -08:00
MachinePainting a076da5ab6 Add files via upload 2026-01-29 03:02:27 -08:00
MachinePainting a1371f36c0 Create .gitignore with standard exclusions
Add common Python and environment files to .gitignore
2026-01-29 03:01:12 -08:00
MachinePainting 17896dc80c Delete gitignore 2026-01-29 03:00:38 -08:00
MachinePainting ea3be89886 Add .gitignore file for Python and environment files 2026-01-29 02:59:42 -08:00
MachinePainting aa28c63fc9 Initial commit 2026-01-29 02:58:27 -08:00