fix for os scoping issue
This commit is contained in:
+2
-7
@@ -1,6 +1,6 @@
|
||||
# RunPod OAuth Setup Guide
|
||||
|
||||
## 🚀 Quick Setup for RunPod
|
||||
## Quick Setup for RunPod
|
||||
|
||||
The DropSend node now automatically detects RunPod environments, but for OAuth to work properly, you may need to configure your public URL.
|
||||
|
||||
@@ -26,11 +26,6 @@ export PUBLIC_URL="https://your-runpod-id.runpod.net:8188"
|
||||
export COMFYUI_PUBLIC_URL="https://your-runpod-id.runpod.net:8188"
|
||||
```
|
||||
|
||||
#### Method C: Set RUNPOD_PUBLIC_IP (if available)
|
||||
```bash
|
||||
export RUNPOD_PUBLIC_IP="your-runpod-id.runpod.net"
|
||||
```
|
||||
|
||||
### How to Find Your RunPod URL
|
||||
|
||||
1. **From RunPod Dashboard**: Look for your pod's public URL
|
||||
@@ -70,4 +65,4 @@ export RUNPOD_PUBLIC_IP="your-runpod-id.runpod.net"
|
||||
|
||||
- The enhanced keyring backend now works on RunPod with encrypted file storage
|
||||
- Use `display_only` for maximum flexibility in cloud environments
|
||||
- Set environment variables in your RunPod template for automatic configuration
|
||||
- Set environment variables in your RunPod template for automatic configuration
|
||||
|
||||
+6
-2
@@ -373,6 +373,9 @@ def create_display_only_success_page(session_id, app_key, app_secret, refresh_to
|
||||
|
||||
def get_server_base_url(request=None):
|
||||
"""Dynamically detect the server base URL for OAuth callbacks"""
|
||||
import os
|
||||
import socket
|
||||
|
||||
try:
|
||||
if request:
|
||||
# Try to get from the incoming request
|
||||
@@ -389,13 +392,12 @@ def get_server_base_url(request=None):
|
||||
port = getattr(PromptServer.instance, 'port', 8188)
|
||||
|
||||
# Try to detect if we're on RunPod or similar cloud service
|
||||
import socket
|
||||
hostname = socket.gethostname()
|
||||
print(f"[OAuthHandler] Detected hostname: {hostname}")
|
||||
|
||||
# Check for RunPod-specific hostname patterns
|
||||
if 'runpod' in hostname.lower() or hostname.endswith('.runpod.net'):
|
||||
# For RunPod, try to get the public URL
|
||||
import os
|
||||
runpod_public_ip = os.getenv('RUNPOD_PUBLIC_IP')
|
||||
if runpod_public_ip:
|
||||
base_url = f"https://{runpod_public_ip}:{port}"
|
||||
@@ -416,6 +418,8 @@ def get_server_base_url(request=None):
|
||||
|
||||
except Exception as e:
|
||||
print(f"[OAuthHandler] Error detecting server URL: {e}")
|
||||
import traceback
|
||||
traceback.print_exc()
|
||||
|
||||
# Final fallback
|
||||
base_url = "http://localhost:8188"
|
||||
|
||||
Reference in New Issue
Block a user