forked from postalsys/emailengine
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.env.example
More file actions
82 lines (71 loc) · 3.65 KB
/
.env.example
File metadata and controls
82 lines (71 loc) · 3.65 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
# EmailEngine Test Environment Variables
# Copy this file to .env and fill in your actual values
# =============================================================================
# Gmail API OAuth2 Configuration (Full Access)
# =============================================================================
# Required for Gmail API tests with read/write/modify permissions
# Get these credentials from: https://console.cloud.google.com/apis/credentials
# Google Cloud Project ID for Gmail API
GMAIL_API_PROJECT_ID="your-project-id"
# OAuth2 Client credentials (for user authentication)
GMAIL_API_CLIENT_ID="your-client-id.apps.googleusercontent.com"
GMAIL_API_CLIENT_SECRET="your-client-secret"
# Service Account credentials (for Gmail Pub/Sub watch notifications)
GMAIL_API_SERVICE_EMAIL="your-service-account@your-project.iam.gserviceaccount.com"
GMAIL_API_SERVICE_CLIENT="your-service-client-id"
GMAIL_API_SERVICE_KEY="-----BEGIN PRIVATE KEY-----\nyour-service-account-private-key\n-----END PRIVATE KEY-----\n"
# Test Gmail accounts with full access (gmail.modify scope)
GMAIL_API_ACCOUNT_EMAIL_1="test.account.1@example.com"
GMAIL_API_ACCOUNT_REFRESH_1="1//0c-your-refresh-token-1"
GMAIL_API_ACCOUNT_EMAIL_2="test.account.2@example.com"
GMAIL_API_ACCOUNT_REFRESH_2="1//0c-your-refresh-token-2"
# =============================================================================
# Gmail Send-Only Configuration
# =============================================================================
# Required for Gmail send-only account tests (gmail.send scope only)
# This is a separate OAuth2 client configured with only gmail.send permission
# Google Cloud Project ID for send-only Gmail
GMAIL_SENDONLY_PROJECT_ID="your-sendonly-project-id"
# OAuth2 Client credentials for send-only access
GMAIL_SENDONLY_CLIENT_ID="your-sendonly-client-id.apps.googleusercontent.com"
GMAIL_SENDONLY_CLIENT_SECRET="your-sendonly-client-secret"
# Test Gmail account with send-only access
GMAIL_SENDONLY_ACCOUNT_EMAIL="sendonly.test@example.com"
GMAIL_SENDONLY_ACCOUNT_REFRESH="1//0c-your-sendonly-refresh-token"
# =============================================================================
# Setup Instructions
# =============================================================================
#
# 1. Gmail API Full Access Setup:
# a. Create a Google Cloud project
# b. Enable Gmail API
# c. Create OAuth2 credentials (Web application)
# d. Add authorized redirect URI: http://127.0.0.1:3000/oauth
# e. Configure OAuth consent screen
# f. Add scopes: gmail.modify, gmail.labels, gmail.send
# g. Create a Service Account for Pub/Sub notifications
#
# 2. Gmail Send-Only Setup:
# a. Create a separate Google Cloud project (or use the same)
# b. Enable Gmail API
# c. Create separate OAuth2 credentials
# d. Add scopes: gmail.send, openid, email, profile (only)
# e. DO NOT add gmail.modify, gmail.readonly, or gmail.labels
#
# 3. Getting Refresh Tokens:
# - Use OAuth2 authorization flow to authenticate test users
# - Store the refresh tokens in this .env file
# - Refresh tokens start with "1//0c" for Google OAuth2
#
# 4. Getting Service Account Key:
# - Create a Service Account in Google Cloud Console
# - Generate and download JSON key file
# - Extract the private_key field and paste it here
# - Keep newlines as literal "\n" in the string
#
# =============================================================================
# Security Notice
# =============================================================================
# WARNING: Never commit .env file with real credentials to version control!
# Add .env to your .gitignore file
# Only commit this .env.example file with placeholder values