85 lines
3.1 KiB
Bash
85 lines
3.1 KiB
Bash
# studspider Environment Configuration
|
|
|
|
# ============================================================================
|
|
# Square API Configuration
|
|
# ============================================================================
|
|
|
|
# Environment: "production" or "sandbox"
|
|
SQUARE_ENV=sandbox
|
|
|
|
# Sandbox credentials
|
|
SANDBOX_SQUARE_APP_ID=your_sandbox_app_id
|
|
SANDBOX_SQUARE_TOKEN=your_sandbox_access_token
|
|
|
|
# Production credentials
|
|
PROD_SQUARE_APP_ID=your_production_app_id
|
|
PROD_SQUARE_TOKEN=your_production_access_token
|
|
|
|
# Square LEGO category ID (find this in Square Dashboard)
|
|
SQUARE_LEGO_CAT_ID=your_lego_category_id
|
|
|
|
# ============================================================================
|
|
# Brickset API Configuration
|
|
# ============================================================================
|
|
|
|
BRICKSET_USERNAME=your_brickset_username
|
|
BRICKSET_PASS=your_brickset_password
|
|
BRICKSET_API_KEY=your_brickset_api_key
|
|
|
|
# ============================================================================
|
|
# SSL Certificate Configuration (Optional)
|
|
# ============================================================================
|
|
|
|
# NOTE: Only needed if running HTTPS directly (not recommended with nginx)
|
|
# For nginx reverse proxy setup, leave these empty
|
|
|
|
# Path to SSL certificate in PEM format
|
|
# SSL_CERT_PATH=/path/to/cert.pem
|
|
|
|
# Path to SSL private key in PEM format
|
|
# SSL_KEY_PATH=/path/to/key.pem
|
|
|
|
# ============================================================================
|
|
# Square Webhook Certificate (P7B Format)
|
|
# ============================================================================
|
|
|
|
# Path to P7B certificate file for Square webhook signature verification
|
|
# This file is UPLOADED to Square Dashboard, not used by your server
|
|
# Generate with: python convert_to_p7b.py
|
|
SQUARE_P7B_PATH=./cert.p7b
|
|
|
|
# ============================================================================
|
|
# Square Webhook Signature Verification
|
|
# ============================================================================
|
|
|
|
# CRITICAL: Get these from Square Developer Dashboard → Webhooks
|
|
# Signature key used to verify webhook authenticity (prevents spoofing)
|
|
SQUARE_WEBHOOK_SIGNATURE_KEY=your_webhook_signature_key_from_square
|
|
|
|
# Your webhook notification URL (must match exactly what's in Square Dashboard)
|
|
# Example: https://studspider.sh/hook
|
|
SQUARE_WEBHOOK_URL=https://yourdomain.com/hook
|
|
|
|
# ============================================================================
|
|
# Server Configuration (Optional)
|
|
# ============================================================================
|
|
|
|
# Default host and port (can override with command line args)
|
|
# SERVER_HOST=0.0.0.0
|
|
# SERVER_PORT=7432
|
|
# SERVER_HOOK_PORT=8080
|
|
|
|
# ============================================================================
|
|
# Usage Examples
|
|
# ============================================================================
|
|
|
|
# Basic HTTP server (recommended with nginx):
|
|
# python src/test_server.py
|
|
#
|
|
# With SSL from .env:
|
|
# Set SSL_CERT_PATH and SSL_KEY_PATH above, then:
|
|
# python src/test_server.py --hook-port 8443 --hook-ssl-only
|
|
#
|
|
# Override SSL from command line:
|
|
# python src/test_server.py --ssl-cert /custom/cert.pem --ssl-key /custom/key.pem
|