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
This commit is contained in:
MachinePainting
2026-02-01 03:07:51 -08:00
parent 2c49196561
commit f11a58322c
2 changed files with 28 additions and 18 deletions
+21 -4
View File
@@ -203,15 +203,32 @@ class DriveSendSetupNode:
print("="*60)
print("\nCopy these values to your Environment Variables:\n")
# Print FULL values (not truncated)
for key, value in env_vars.items():
# Truncate long values for display
display_value = value if len(value) < 50 else value[:47] + "..."
print(f"{key}={display_value}")
print(f"{key}={value}")
print("\n" + "="*60)
print("See console output above for full values to copy")
print("Copy the values above to your RunPod Secrets")
print("="*60 + "\n")
# Save token.json for local use
if auth_method == 'oauth' and 'GOOGLE_REFRESH_TOKEN' in env_vars:
token_file = NODE_DIR / 'token.json'
try:
token_data = {
"token": None,
"refresh_token": env_vars['GOOGLE_REFRESH_TOKEN'],
"token_uri": "https://oauth2.googleapis.com/token",
"client_id": env_vars['GOOGLE_CLIENT_ID'],
"client_secret": env_vars['GOOGLE_CLIENT_SECRET'],
"scopes": ["https://www.googleapis.com/auth/drive.file"]
}
with open(token_file, 'w') as f:
json.dump(token_data, f, indent=2)
results.append(f"✓ Saved token.json for local use")
except Exception as e:
results.append(f"⚠️ Could not save token.json: {e}")
# Save to .env file if requested
if storage_method == 'env_file':
env_file = NODE_DIR / '.env'
+7 -14
View File
@@ -34,16 +34,11 @@ class DriveSendAutoUploaderNode:
"multiline": False,
"tooltip": "Folder to monitor (leave blank for ComfyUI output folder)"
}),
"folder_id": ("STRING", {
"default": "",
"multiline": False,
"tooltip": "Google Drive folder ID (uses env var if blank)"
}),
}
}
def run(self, auth_method, run_process, enable_encryption, Subfolder_Monitor,
Post_Delete_Enc, watch_folder="", folder_id=""):
Post_Delete_Enc, watch_folder=""):
"""
Start or stop the Google Drive upload monitor.
@@ -54,7 +49,6 @@ class DriveSendAutoUploaderNode:
Subfolder_Monitor: Monitor subfolders recursively
Post_Delete_Enc: Delete .enc files after upload
watch_folder: Folder to monitor (default: ComfyUI output)
folder_id: Google Drive folder ID (default: from env var)
"""
# Stop if requested
@@ -90,15 +84,14 @@ class DriveSendAutoUploaderNode:
if not watch_path.exists():
return (f"❌ Error: Watch folder does not exist: {watch_path}",)
# Get folder ID from parameter or environment
effective_folder_id = folder_id or os.environ.get('GOOGLE_DRIVE_FOLDER_ID')
# Get folder ID from environment
effective_folder_id = os.environ.get('GOOGLE_DRIVE_FOLDER_ID')
if not effective_folder_id:
return (
"❌ Error: No folder_id provided.\n\n"
"Either:\n"
"1. Set the folder_id parameter in this node\n"
"2. Set GOOGLE_DRIVE_FOLDER_ID environment variable\n"
"3. Run the DriveSend Setup node first",
"❌ Error: GOOGLE_DRIVE_FOLDER_ID not set.\n\n"
"Run the DriveSend Setup node first, then:\n"
"1. Copy credentials to RunPod Secrets\n"
"2. Restart pod with environment variables loaded",
)
# Check for encryption key if encryption is enabled