-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpages.toml
More file actions
169 lines (144 loc) · 4.02 KB
/
pages.toml
File metadata and controls
169 lines (144 loc) · 4.02 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
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
# 🌟 Cloudflare Pages Configuration for Solo-Spark
# Deploy to brainsait.io with optimal performance
# ===== BUILD CONFIGURATION =====
[build]
command = "npm run build"
publish = "dist"
# Node.js version for build
[build.environment]
NODE_VERSION = "18"
NPM_VERSION = "9"
# ===== DEPLOYMENT SETTINGS =====
[deployment]
# Custom domain configuration
domains = [
"brainsait.io",
"www.brainsait.io"
]
# Subdomain routing
subdomains = [
{ name = "app", target = "/" },
{ name = "api", target = "/api" },
{ name = "docs", target = "/docs" },
{ name = "blog", target = "/blog" }
]
# ===== REDIRECTS & REWRITES =====
[[redirects]]
from = "https://www.brainsait.io/*"
to = "https://brainsait.io/:splat"
status = 301
force = true
[[redirects]]
from = "/app/*"
to = "/:splat"
status = 200
[[redirects]]
from = "/ar/*"
to = "/:splat"
status = 200
headers = { "Accept-Language" = "ar" }
# API routes to Cloudflare Workers
[[redirects]]
from = "/api/*"
to = "https://api.brainsait.io/:splat"
status = 200
# ===== HEADERS =====
# Security and performance headers
[[headers]]
for = "/*"
[headers.values]
X-Frame-Options = "DENY"
X-Content-Type-Options = "nosniff"
X-XSS-Protection = "1; mode=block"
Referrer-Policy = "strict-origin-when-cross-origin"
Permissions-Policy = "geolocation=(), microphone=(), camera=()"
Strict-Transport-Security = "max-age=31536000; includeSubDomains; preload"
Content-Security-Policy = """
default-src 'self';
script-src 'self' 'unsafe-inline' 'unsafe-eval' https://cdn.brainsait.io https://js.stripe.com https://www.googletagmanager.com;
style-src 'self' 'unsafe-inline' https://fonts.googleapis.com;
font-src 'self' https://fonts.gstatic.com;
img-src 'self' data: https: blob:;
connect-src 'self' https://api.brainsait.io https://api.anthropic.com https://api.stripe.com https://api.github.com;
frame-src 'self' https://js.stripe.com;
object-src 'none';
base-uri 'self';
form-action 'self';
"""
# Cache headers for static assets
[[headers]]
for = "/assets/*"
[headers.values]
Cache-Control = "public, max-age=31536000, immutable"
[[headers]]
for = "*.js"
[headers.values]
Cache-Control = "public, max-age=31536000, immutable"
[[headers]]
for = "*.css"
[headers.values]
Cache-Control = "public, max-age=31536000, immutable"
[[headers]]
for = "*.woff2"
[headers.values]
Cache-Control = "public, max-age=31536000, immutable"
# ===== FUNCTIONS =====
# Cloudflare Pages Functions configuration
[functions]
directory = "functions"
# ===== COMPATIBILITY =====
compatibility_date = "2024-08-01"
compatibility_flags = ["nodejs_compat"]
# ===== ENVIRONMENT VARIABLES =====
# These will be set in Cloudflare Dashboard
[vars]
NODE_ENV = "production"
VITE_ENVIRONMENT = "production"
VITE_DOMAIN = "brainsait.io"
VITE_API_URL = "https://api.brainsait.io"
VITE_CDN_URL = "https://cdn.brainsait.io"
# Feature flags
VITE_ENABLE_CLOUDFLARE_ANALYTICS = "true"
VITE_ENABLE_KV_STORAGE = "true"
VITE_ENABLE_R2_STORAGE = "true"
VITE_ENABLE_REAL_TIME = "true"
# ===== PREVIEW DEPLOYMENT =====
[preview]
# Preview deployment settings
compatibility_date = "2024-08-01"
d1_databases = [
{ binding = "DB", database_name = "solo-spark-db-preview", database_id = "preview_db_id" }
]
# ===== AI CONFIGURATION =====
# Cloudflare AI integration
[ai]
binding = "AI"
# ===== KV BINDINGS =====
# Key-Value storage bindings
[[kv_namespaces]]
binding = "USER_DATA"
id = "your_kv_namespace_id"
preview_id = "your_kv_preview_id"
[[kv_namespaces]]
binding = "SESSIONS"
id = "your_sessions_kv_id"
preview_id = "your_sessions_preview_id"
# ===== R2 BINDINGS =====
# Object storage bindings
[[r2_buckets]]
binding = "USER_FILES"
bucket_name = "solo-spark-files"
preview_bucket_name = "solo-spark-files-preview"
# ===== ANALYTICS =====
# Cloudflare Analytics configuration
[analytics]
enabled = true
beacon_path = "/cf-analytics"
# ===== WASM BINDINGS =====
# WebAssembly modules for performance-critical operations
[[wasm_modules]]
binding = "PDF_GENERATOR"
source = "./wasm/pdf-generator.wasm"
[[wasm_modules]]
binding = "IMAGE_PROCESSOR"
source = "./wasm/image-processor.wasm"