-
-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathenv.example
More file actions
130 lines (106 loc) · 5.89 KB
/
Copy pathenv.example
File metadata and controls
130 lines (106 loc) · 5.89 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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
# =============================================================================
# marchat Server Environment Configuration
# =============================================================================
#
# Copy this file to your server config directory as .env (e.g. config/.env):
# cp env.example config/.env
#
# Server precedence (marchat-server): if {CONFIG_DIR}/.env exists, the server
# loads it with godotenv.Overload. Every KEY=value present in that file overwrites
# the same MARCHAT_* (or other) name already set in the process environment.
# Keys you set only in the environment and do NOT list in .env are left unchanged.
# Legacy JSON config files are separate; prefer env + .env for new deployments.
#
# For Docker deployments, set variables in compose/run, or mount .env. If both
# are used and the same key appears in the mounted file, the file value wins at
# server process start. Restart the server after changing .env.
# =============================================================================
# =============================================================================
# Server Configuration
# =============================================================================
# Server port for WebSocket connections (default: 8080)
# Change this if you need to use a different port or have conflicts
MARCHAT_PORT=8080
# Admin authentication key (REQUIRED)
# This key is used to authenticate admin users when they connect with --admin flag
# IMPORTANT: Change this to a secure value in production!
MARCHAT_ADMIN_KEY=your-secret-admin-key-change-this
# Comma-separated list of admin usernames (REQUIRED)
# These users can use admin commands like :cleardb when authenticated
# No spaces between usernames, case-insensitive
MARCHAT_USERS=alice,bob
# Optional: username for scripts/connect-local-wss.ps1 / connect-local-wss.sh when using --admin (defaults to first MARCHAT_USERS)
# MARCHAT_CLIENT_USERNAME=alice
# =============================================================================
# Database Configuration
# =============================================================================
# SQLite database file path (default: $CONFIG_DIR/marchat.db)
# The database stores messages, user sessions, and server state
# Use absolute paths for production deployments
# MARCHAT_DB_PATH=./config/marchat.db
# =============================================================================
# Logging Configuration
# =============================================================================
# Log level for server output (default: info)
# Options: debug, info, warn, error
# Use debug for troubleshooting, info for normal operation
MARCHAT_LOG_LEVEL=info
# =============================================================================
# Session Secret Configuration
# =============================================================================
# Session secret for authentication (auto-generated randomly if not set)
# MARCHAT_SESSION_SECRET is preferred; MARCHAT_JWT_SECRET is accepted for backward compatibility
MARCHAT_SESSION_SECRET=your-session-secret
# MARCHAT_JWT_SECRET=your-jwt-secret # deprecated alias, still supported
# =============================================================================
# Advanced Configuration (Optional)
# =============================================================================
# Custom config directory path (optional)
# Override the default config directory location
# Default: ./config (development) or $XDG_CONFIG_HOME/marchat (production)
# MARCHAT_CONFIG_DIR=/custom/config/path
# =============================================================================
# Advanced Features (Optional)
# =============================================================================
# Ban history gaps feature (default: false)
# When enabled, shows gaps in message history for banned users
# MARCHAT_BAN_HISTORY_GAPS=false
# TLS certificate and key files (optional, enables HTTPS/WSS)
# MARCHAT_TLS_CERT_FILE=/path/to/cert.pem
# MARCHAT_TLS_KEY_FILE=/path/to/key.pem
# Maximum file size for file transfers (default: 1MB)
# Can be specified in bytes or with MB suffix
# MARCHAT_MAX_FILE_BYTES=1048576
# MARCHAT_MAX_FILE_MB=1
# Maximum chat message content (default: 32 KiB)
# UTF-8 byte length of the wire content string. MARCHAT_MAX_MESSAGE_BYTES wins over MB.
# MARCHAT_MAX_MESSAGE_BYTES=32768
# MARCHAT_MAX_MESSAGE_MB=1
# Username allowlist (optional, comma-separated)
# When set, only these users can connect to the server
# MARCHAT_ALLOWED_USERS=alice,bob,charlie
# Extra WebSocket Origin allowlist (optional, comma-separated URLs or hostnames)
# MARCHAT_ALLOWED_ORIGINS=https://app.example.com
# Trusted reverse-proxy IPs/CIDRs (optional, comma-separated)
# Required behind Caddy/nginx so X-Forwarded-For is used for client IP and admin login rate limits
# MARCHAT_TRUSTED_PROXIES=127.0.0.1,::1
# Global E2E encryption key (optional, base64-encoded)
# When set, enables global end-to-end encryption for all messages
# MARCHAT_GLOBAL_E2E_KEY=base64-encoded-key
# Plugin registry URL (default: GitHub registry)
# Custom plugin registry for downloading plugins
# MARCHAT_PLUGIN_REGISTRY_URL=https://raw.githubusercontent.com/Cod-e-Codes/marchat-plugins/main/registry.json
# =============================================================================
# Docker-Specific Notes
# =============================================================================
#
# For Docker deployments, you may want to use these paths:
# MARCHAT_DB_PATH=/marchat/config/marchat.db
# MARCHAT_CONFIG_DIR=/marchat/config
#
# For production deployments, consider:
# - Using Docker secrets for sensitive values
# - Setting MARCHAT_LOG_LEVEL=warn or error
# - Using absolute paths for MARCHAT_DB_PATH
# - Changing all default secrets to secure values
# =============================================================================