-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.env.example
More file actions
131 lines (108 loc) · 4.61 KB
/
.env.example
File metadata and controls
131 lines (108 loc) · 4.61 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
131
# Prestige Configuration
# Server
PORT=3000
NODE_ENV=production
# Data storage
DATA_DIR=/data
# Freebird (VOPRF Token System)
# Default issuer/verifier (used if gate-specific URLs not set)
FREEBIRD_ISSUER_URL=http://localhost:8081
FREEBIRD_VERIFIER_URL=http://localhost:8082
# For production: Use separate issuers for ballot and voter gates
# Ballot issuer uses invitation mode (small trusted group)
# Voter issuer uses webauthn/pow mode (scalable sybil resistance)
# Single verifier configured with ISSUER_URLS=<ballot-issuer>,<voter-issuer>
# BALLOT_GATE_FREEBIRD_ISSUER_URL=http://localhost:8081
# VOTER_GATE_FREEBIRD_ISSUER_URL=http://localhost:8083
# Witness (BFT Timestamping)
WITNESS_URL=http://localhost:8080
WITNESS_PORT=8080
# HyperToken Relay (P2P Communication - optional for single-node)
# Only needed if running multiple Prestige nodes in federation
# Leave unset for single-node MVP deployment
# HYPERTOKEN_RELAY_URL=ws://localhost:3001
# RELAY_PORT=3001
# RELAY_MAX_CONNECTIONS=1000
# Ballot defaults
DEFAULT_BALLOT_DURATION_MINUTES=1440 # 24 hours
REVEAL_WINDOW_MINUTES=1440 # 24 hours
MIN_DURATION_MINUTES=1 # Minimum allowed duration
MAX_CHOICES=20
MAX_QUESTION_LENGTH=500
# Security
RATE_LIMIT_WINDOW_MS=60000
RATE_LIMIT_MAX_REQUESTS=100
RATE_LIMIT_REQUESTS=30 # Requests per minute for sensitive endpoints
# ============= Enhanced Privacy Mode =============
# Enable for Tor-friendly, timing-attack resistant operation
# Master switch for enhanced privacy features
PRIVACY_MODE=false
# Timing obfuscation: random delays added to sensitive endpoints
# to prevent timing correlation attacks
PRIVACY_MIN_DELAY_MS=100 # Minimum delay in milliseconds
PRIVACY_MAX_DELAY_MS=2000 # Maximum delay in milliseconds
# Normalized response time: all responses take at least this long
# Set to 0 to disable (uses random delays instead)
PRIVACY_NORMALIZED_RESPONSE_MS=0
# Request batching: process votes/reveals in batches for unlinkability
# WARNING: Increases latency significantly
PRIVACY_BATCHING=false
PRIVACY_BATCH_INTERVAL_MS=5000 # Process batch every N ms
# IP anonymization: strip IP-identifying headers
# Note: Your reverse proxy may still log IPs - configure nginx/caddy appropriately
# IP_ANONYMIZATION is controlled by PRIVACY_MODE
# Disable request logging (for maximum privacy)
DISABLE_LOGGING=false
# Tor hidden service support
# Set to your .onion address to advertise via Onion-Location header
# ONION_LOCATION=http://youronionaddress.onion
# ============= Gate System Configuration =============
# Ballot Gate (who can create ballots)
# Options: open, owner, delegation, freebird, petition
BALLOT_GATE=open # 'open' for MVP, 'freebird' for production
BALLOT_GATE_ADMIN_KEY= # For owner gate (defaults to instance public key)
BALLOT_GATE_DELEGATES=key1,key2 # For delegation gate
# For freebird gate: issuer ID (from /.well-known/issuer -> issuer_id)
# BALLOT_GATE_FREEBIRD_ISSUER=<issuer-id>
# BALLOT_GATE_FREEBIRD_ISSUER_URL=http://localhost:8081 # Separate issuer for ballots
# Voter Gate (who can vote - instance level)
# Options: open, freebird, allowlist
VOTER_GATE=open # 'open' for MVP, 'freebird' for sybil resistance
VOTER_GATE_ALLOWLIST=key1,key2,key3
# For freebird gate: separate issuer URL (webauthn/pow mode)
# VOTER_GATE_FREEBIRD_ISSUER_URL=http://localhost:8083
# Petition Gate Configuration (when BALLOT_GATE=petition)
BALLOT_GATE_PETITION_THRESHOLD=10 # Number of signatures needed to activate
# Proposal Gate (who can open petitions - nested inside petition ballot gate)
# Options: voters, delegation
PETITION_PROPOSAL_GATE=voters # Default: anyone who can vote can propose
# For delegation proposal gate
PETITION_PROPOSAL_DELEGATES=key1,key2,key3
# ============= Tor Hidden Service Deployment =============
# To deploy Prestige as a Tor hidden service for maximum anonymity:
#
# 1. Install Tor on your server:
# apt install tor
#
# 2. Add to /etc/tor/torrc:
# HiddenServiceDir /var/lib/tor/prestige/
# HiddenServicePort 80 127.0.0.1:3000
#
# 3. Restart Tor and get your .onion address:
# systemctl restart tor
# cat /var/lib/tor/prestige/hostname
#
# 4. Set ONION_LOCATION to advertise clearnet -> onion redirect:
# ONION_LOCATION=http://your-address.onion
#
# 5. Enable privacy mode for timing attack protection:
# PRIVACY_MODE=true
# DISABLE_LOGGING=true
#
# 6. Configure nginx/caddy to NOT log IPs if using a reverse proxy
#
# For high-security deployments, consider:
# - Running on an air-gapped machine
# - Using Tails or Whonix as the host OS
# - Enabling batching for additional unlinkability (increases latency)
# - Using separate Tor circuits for each voter gate check