-
-
Notifications
You must be signed in to change notification settings - Fork 421
Expand file tree
/
Copy path.env
More file actions
111 lines (99 loc) · 4.68 KB
/
Copy path.env
File metadata and controls
111 lines (99 loc) · 4.68 KB
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
99
100
101
102
103
104
105
106
107
108
109
110
111
# Chitchatter Environment Configuration Example
# Copy this file to .env and update the values as needed
# =============================================================================
# API CONFIGURATION
# =============================================================================
# API Base URL (Development only)
# This overrides the default API endpoint used by the frontend
#
# SCENARIOS:
# 1. Using "npm run dev" (default): Leave commented out
# - Vite proxy forwards /api requests to localhost:3001 (Vercel dev server)
#
# 2. Using simple API server: Uncomment and set to http://localhost:3003
# - First run: node simple-api-server.js
# - Then run: npm start (with VITE_API_BASE_URL set)
#
# 3. Custom API server: Set to your custom server URL
#
# VITE_API_BASE_URL=http://localhost:3001
# VITE_API_BASE_URL=http://localhost:3003
# RTC Config API Endpoint (Frontend Configuration)
# The API endpoint path used to fetch TURN server configuration
# Defaults to /api/get-config if not specified
#
# IMPORTANT: This environment variable controls whether the "Enhanced Connectivity"
# feature is available to users in the Settings page:
#
# - SET: Users see a "Networking" section with Enhanced Connectivity toggle
# - NOT SET: Feature is hidden and permanently disabled (uses fallback TURN only)
#
# This conditional behavior prevents confusion for self-hosters who don't have
# external TURN server configuration available.
#
# Examples:
# VITE_RTC_CONFIG_ENDPOINT=/api/get-config
# VITE_RTC_CONFIG_ENDPOINT=/api/rtc-config
# VITE_RTC_CONFIG_ENDPOINT=/custom/turn-server-endpoint
#
# Uncomment to enable Enhanced Connectivity feature:
# VITE_RTC_CONFIG_ENDPOINT=/api/get-config
# =============================================================================
# RTC CONFIGURATION (Production/Vercel)
# =============================================================================
# Base64-encoded JSON string containing RTCConfiguration
# This is used by the /api/get-config endpoint to provide STUN/TURN servers
#
# SECURITY IMPORTANT: Never commit real TURN server credentials to version control!
# Generate your own configuration with your own TURN server credentials.
#
# To create a base64 encoded config:
# 1. Use the helper script (RECOMMENDED):
# npm run generate-rtc-config
# Follow the prompts to configure your STUN/TURN servers
# Copy the generated base64 string to replace the placeholder below
#
# 2. Manual creation (advanced users):
# Create JSON: {"iceServers":[{"urls":"stun:stun.l.google.com:19302"}]}
# Base64 encode: echo '{"iceServers":[...]}' | base64 -w 0
# Set the result as RTC_CONFIG value
#
# Example with STUN server only:
# RTC_CONFIG=eyJpY2VTZXJ2ZXJzIjpbeyJ1cmxzIjoic3R1bjpzdHVuLmwuZ29vZ2xlLmNvbToxOTMwMiJ9XX0=
#
# Example with TURN server (replace with your own credentials):
# RTC_CONFIG=eyJpY2VTZXJ2ZXJzIjpbeyJ1cmxzIjoidHVybjp5b3VyLXR1cm4tc2VydmVyLmNvbTozNDc4IiwidXNlcm5hbWUiOiJ1c2VyIiwiY3JlZGVudGlhbCI6InBhc3MifV19
#
# If not set, the API will fall back to a default TURN server configuration.
RTC_CONFIG="<your-base64-encoded-rtc-config-here>"
# =============================================================================
# DEVELOPMENT SERVICES
# =============================================================================
# WebTorrent tracker URL for peer discovery in development
# Used by "npm run dev" - automatically started on port 8000
# VITE_TRACKER_URL=ws://localhost:8000
# StreamSaver service worker URL for file downloads in development
# Used by "npm run dev" - automatically started on port 3015
# VITE_STREAMSAVER_URL=http://localhost:3015/mitm.html
# =============================================================================
# APPLICATION SETTINGS
# =============================================================================
# Router Type (Development and Production)
# Specifies the type of router to use in the application.
#
# - "browser": (Default) Uses BrowserRouter, which requires server-side
# configuration for single-page applications. It uses clean URLs,
# but it allows the server to see the room name.
# - "hash": Uses HashRouter, which uses the hash portion of the URL
# (#) to keep UI in sync with the URL. This is useful for
# static file servers or environments where server-side routing is
# not available or desirable. This also prevents the server from
# seeing the room name.
#
# VITE_ROUTER_TYPE=hash
# Homepage URL - typically set automatically by build scripts
# Override only if needed for custom deployments
# VITE_HOMEPAGE=https://chitchatter.im/
# GitHub Repository URL
# Used for linking to the project repository
VITE_GITHUB_REPO="https://github.com/jeremyckahn/chitchatter"