File size: 4,753 Bytes
eeb9404
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
# OSW Studio Local Development Environment
# Copy this file to .env and update with your values

# ============================================================================
# Server Mode (SQLite + Publishing)
# ============================================================================
# Enable Server mode for SQLite persistence and static site publishing
NEXT_PUBLIC_SERVER_MODE=false

# Session secret (generate with: openssl rand -base64 32)
SESSION_SECRET=your_session_secret_here

# Admin password — BOOTSTRAP ONLY
# Used for initial setup when no user accounts exist.
# Once the first user account is created, this is ignored.
# For new installs, you can skip this — the first visitor to /admin
# will be prompted to create the admin account via the registration page.
ADMIN_PASSWORD=your_secure_password_here

# Secure cookies (default: true in production)
# Uncomment and set to "false" only when running without HTTPS (e.g., VPS before SSL)
# SECURE_COOKIES=false

# Analytics secret for token signing (generate with: openssl rand -base64 32)
# IMPORTANT: Use a strong random value in production to secure analytics tracking
ANALYTICS_SECRET=your_analytics_secret_here

# Secrets encryption key (generate with: openssl rand -base64 32)
# Must be a base64-encoded 32-byte key for AES-256 encryption
# Required to enable encrypted secrets storage for edge functions
SECRETS_ENCRYPTION_KEY=your_secrets_encryption_key_here

# ============================================================================
# Multitenancy & Workspaces
# ============================================================================
# Control whether public user registration is allowed (default: closed)
# Set to "open" to allow new users to self-register via /admin/register
# Note: registration is ALWAYS allowed when no users exist (initial setup)
# REGISTRATION_MODE=open
# NEXT_PUBLIC_REGISTRATION_MODE=open

# Machine-to-machine API key for automating admin operations (optional)
# When set, requests with header "x-instance-api-key: <key>" bypass session auth
# on admin endpoints. Generate with: openssl rand -base64 32
# INSTANCE_API_KEY=your_instance_api_key_here

# Unique identifier for this instance (shown in admin dashboard, optional)
# INSTANCE_ID=my-production-instance

# ============================================================================
# Usage
# ============================================================================
# Browser Mode (IndexedDB) — Default:
#   - Don't set NEXT_PUBLIC_SERVER_MODE or leave .env file absent
#   - Run: npm run dev
#   - Access at: http://localhost:3000
#   - All data stored in the browser
#
# Server Mode (SQLite + Workspaces + Publishing):
#   1. Copy this file to .env
#   2. Set NEXT_PUBLIC_SERVER_MODE=true
#   3. Generate and set SESSION_SECRET, ANALYTICS_SECRET, SECRETS_ENCRYPTION_KEY
#   4. Run: npm run dev
#   5. Visit http://localhost:3000/admin — create admin account on first visit
#   6. Workspaces, projects, and deployments are stored in data/ directory
#   7. Published sites served at http://localhost:3000/deployments/{id}/

# ============================================================================
# Default Provider
# ============================================================================
# Override the default AI provider (default: openrouter)
# NEXT_PUBLIC_DEFAULT_PROVIDER=openrouter

# ============================================================================
# Telemetry (Anonymous Usage Analytics)
# ============================================================================
# Telemetry is enabled by default and can be toggled in Settings UI.
# Set to "false" to disable telemetry at the environment level.
# NEXT_PUBLIC_TELEMETRY_ENABLED=false

# Analytics endpoint and auth token (defaults to https://stats.oswstudio.com/collect)
# NEXT_PUBLIC_ANALYTICS_ENDPOINT=https://stats.oswstudio.com/collect
# NEXT_PUBLIC_ANALYTICS_TOKEN=your_analytics_token_here

# Enable debug logging of telemetry events in the browser console
# NEXT_PUBLIC_TELEMETRY_DEBUG=true

# Enable debug logging for server-side generation (SSE events, task lifecycle)
# SERVER_GEN_DEBUG=true

# ============================================================================
# Gateway integration (optional — for managed multi-instance deployments)
# ============================================================================
WEBHOOK_URL=                       # Webhook destination URL (e.g., https://oswstudio.com)
WEBHOOK_SECRET=                    # HMAC-SHA256 signing secret for webhooks
INSTANCE_ID=                       # Instance identifier sent in webhook headers
NEXT_PUBLIC_GATEWAY_URL=           # Gateway URL for auth redirect and "Switch workspace" link