hopefully fix workers not kloading the key

This commit is contained in:
C committed 2026-01-05 15:42:54 -08:00
1 parent 199995b947
commit 90aca6cca4
2 files changed
+11 -17

No files matched your search

+9 -2
View File
@@ -6,17 +6,24 @@ BRICKSET_API_KEY = "your_brickset_api_key"
# Square environment - "sandbox" for testing, "production" for live store
SQUARE_ENV = "sandbox" # or "production"
# Public webhook URL that Square will POST events to
SQUARE_WEBHOOK_URL = "https://yourdomain.com/hook"
# Sandbox credentials - test environment (fake data, safe for development)
SANDBOX_SQUARE_APP_ID = "your_sandbox_app_id"
SANDBOX_SQUARE_TOKEN = "your_sandbox_access_token"
SANDBOX_SQUARE_WEBHOOK_INVENTORY_ID = "your_sandbox_webhook_signature_key"
# Sandbox webhook subscription ID and signature key for verifying webhook requests
SANDBOX_SQUARE_WEBHOOK_SUB_ID = "your_sandbox_webhook_subscription_id"
SANDBOX_SQUARE_WEBHOOK_SIGNATURE_KEY = "your_sandbox_webhook_signature_key"
# Production credentials - live store (real inventory and sales)
PROD_SQUARE_APP_ID = "your_production_app_id"
PROD_SQUARE_TOKEN = "your_production_access_token"
PROD_SQUARE_WEBHOOK_INVENTORY_ID = "your_production_webhook_signature_key"
# Production webhook subscription ID and signature key for verifying webhook requests
PROD_SQUARE_WEBHOOK_SUB_ID = "your_production_webhook_subscription_id"
PROD_SQUARE_WEBHOOK_SIGNATURE_KEY = "your_production_webhook_signature_key"
# Category ID for LEGO items in Square catalog (find in Dashboard → Items → Categories)
SQUARE_LEGO_CAT_ID = "your_lego_category_id"
+2 -15
View File
@@ -54,26 +54,13 @@ def on_starting(server):
"""Called just before the master process is initialized."""
print("Studspider WEB starting...")
# Load .env file before workers start
import dotenv
# Verify .env file exists (workers will load it via get_sq_env.py)
from pathlib import Path
env_path = Path(__file__).parent.parent / ".env"
print(f"[@DEBUG] Looking for .env at: {env_path.absolute()}")
if env_path.exists():
dotenv.load_dotenv(env_path)
print(f"✓ Loaded environment from {env_path}")
# Verify key was loaded
import os
key = os.getenv("PROD_SQUARE_WEBHOOK_SIGNATURE_KEY") or os.getenv(
"SANDBOX_SQUARE_WEBHOOK_SIGNATURE_KEY"
)
if key:
print(f"✓ SQUARE_WEBHOOK_SIGNATURE_KEY loaded: {key[:10]}...")
else:
print(f"⚠ SQUARE_WEBHOOK_SIGNATURE_KEY not found in .env")
print(f"✓ .env file found (workers will load via get_sq_env.py)")
else:
print(f"⚠ No .env file found at {env_path.absolute()}")