-
Notifications
You must be signed in to change notification settings - Fork 310
Expand file tree
/
Copy path.env.example
More file actions
145 lines (113 loc) · 6.03 KB
/
.env.example
File metadata and controls
145 lines (113 loc) · 6.03 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
132
133
134
135
136
137
138
139
140
141
142
143
144
145
# ==============================================================================
# GitHub Copilot Metrics Viewer Configuration
# ==============================================================================
# ------------------------------------------------------------------------------
# Core Configuration
# ------------------------------------------------------------------------------
# Determines if mocked data should be used instead of making API calls.
NUXT_PUBLIC_IS_DATA_MOCKED=true
# Determines the scope of the API calls.
# Can be 'enterprise' or 'organization'. Legacy values 'team-organization'/'team-enterprise' are auto-normalized.
NUXT_PUBLIC_SCOPE=organization
# Determines the enterprise or organization name to target API calls.
NUXT_PUBLIC_GITHUB_ORG=octodemo
NUXT_PUBLIC_GITHUB_ENT=
# Determines the team name if exists to target API calls.
NUXT_PUBLIC_GITHUB_TEAM=
# ------------------------------------------------------------------------------
# Authentication
# ------------------------------------------------------------------------------
# GitHub Personal Access Token for API calls
# Required permissions: Read access to members, organization copilot metrics, and organization copilot seat management
# NUXT_GITHUB_TOKEN=ghp_your_token_here
# Session password for encrypting user sessions (REQUIRED!)
# Must be at least 32 characters long
NUXT_SESSION_PASSWORD=something_long_and_random_thats_at_least_32_characters
# OAuth login — set AUTH_PROVIDERS to enable (implies authentication required)
# Supported values: github, google, microsoft, auth0, keycloak (comma-separated)
# NUXT_PUBLIC_AUTH_PROVIDERS=github
# GitHub OAuth App credentials
NUXT_OAUTH_GITHUB_CLIENT_ID=
NUXT_OAUTH_GITHUB_CLIENT_SECRET=
# GitHub App credentials (for installation token auth — decoupled from user login)
# Find the App ID at github.com/settings/apps/<slug> or github.com/organizations/<org>/settings/apps/<slug>
# NUXT_GITHUB_APP_ID=123456
# NUXT_GITHUB_APP_PRIVATE_KEY="-----BEGIN RSA PRIVATE KEY-----\n...\n-----END RSA PRIVATE KEY-----"
# ------------------------------------------------------------------------------
# API Migration Configuration (New Features)
# ------------------------------------------------------------------------------
# Use the LEGACY Copilot Metrics API (deprecated, shuts down April 2, 2026)
# Default is false — the new download-based API is used unless this is explicitly set to true.
# Only set USE_LEGACY_API=true if you have a specific reason to use the old /copilot/metrics endpoint.
USE_LEGACY_API=false
# Enable storage-backed historical mode
# Set to 'true' to query storage for date ranges instead of live API calls
# Requires storage backend configuration (see below)
NUXT_PUBLIC_ENABLE_HISTORICAL_MODE=false
# ------------------------------------------------------------------------------
# Storage Configuration
# ------------------------------------------------------------------------------
# Storage backend for metrics data
# Options: filesystem (dev), postgresql (prod), redis, mongodb
# Configured in nuxt.config.ts nitro.storage section
# For PostgreSQL backend (recommended for production):
# DATABASE_URL=postgresql://user:password@localhost:5432/copilot_metrics
# For Redis backend:
# REDIS_URL=redis://localhost:6379
# For filesystem backend (default, development only):
# Data stored in ./.data/metrics directory (already configured)
# ------------------------------------------------------------------------------
# Data Sync Configuration
# ------------------------------------------------------------------------------
# Enable automatic daily sync (for background scheduler)
# Set to 'true' to enable the scheduled task
SYNC_ENABLED=false
# Cron schedule for sync job (default: 2 AM daily)
# Format: minute hour day month weekday
SYNC_SCHEDULE=0 2 * * *
# Number of days to backfill on first sync
SYNC_BACKFILL_DAYS=28
# Data retention period (days)
SYNC_RETENTION_DAYS=365
# ------------------------------------------------------------------------------
# Network Configuration
# ------------------------------------------------------------------------------
# HTTP Proxy (for corporate environments)
# HTTP_PROXY=http://proxy.company.com:8080
# Custom CA certificate path (for corporate proxies with custom CA)
# CUSTOM_CA_PATH=/path/to/ca-cert.pem
# Server port (default: 80 in Docker, 3000 in dev)
# NITRO_PORT=3000
# ------------------------------------------------------------------------------
# Admin API Configuration
# ------------------------------------------------------------------------------
# ⚠️ SECURITY WARNING: Admin endpoints are NOT authenticated by default!
#
# The /api/admin/* endpoints (sync trigger, status) are currently UNPROTECTED.
# If you expose these endpoints publicly, you MUST secure them via:
# - Reverse proxy authentication (nginx, Apache, etc.)
# - API gateway with auth (AWS API Gateway, Azure APIM, etc.)
# - Firewall rules restricting to internal networks only
# - VPN or private network access only
#
# ADMIN_API_SECRET is reserved for future native authentication but has NO EFFECT
# in the current version. Do NOT rely on this variable for security.
# ADMIN_API_SECRET=your_secure_random_secret_here
# ==============================================================================
# Migration Notes
# ==============================================================================
# The legacy GitHub Copilot Metrics API will shut down on April 2, 2026.
# This application uses the new download-based API by default. No configuration needed.
#
# API modes:
# Default (new API) — download-based reports, richer data, model/feature breakdowns
# Legacy (opt-in) — set USE_LEGACY_API=true to use deprecated /copilot/metrics
#
# Recommended setup:
# 1. Test with mock data (IS_DATA_MOCKED=true)
# 2. Set real GitHub token (NUXT_GITHUB_TOKEN)
# 3. Configure PostgreSQL + enable historical mode (ENABLE_HISTORICAL_MODE=true)
# 4. Enable sync (SYNC_ENABLED=true)
#
# See MIGRATION_GUIDE.md for full details
# ==============================================================================