@tamyla/clodo-framework 3.1.21 → 3.1.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +17 -0
- package/README.md +283 -1
- package/dist/{bin → cli}/clodo-service.js +47 -15
- package/dist/cli/commands/assess.js +183 -0
- package/dist/{bin → cli}/commands/create.js +5 -5
- package/dist/{bin → cli}/commands/deploy.js +122 -90
- package/dist/{bin → cli}/commands/diagnose.js +5 -5
- package/dist/cli/commands/helpers/deployment-ui.js +138 -0
- package/dist/cli/commands/helpers/deployment-verification.js +250 -0
- package/dist/cli/commands/helpers/error-recovery.js +80 -0
- package/dist/cli/commands/helpers/resource-detection.js +113 -0
- package/dist/{bin → cli}/commands/helpers.js +0 -28
- package/dist/cli/commands/init-config.js +57 -0
- package/dist/{bin → cli}/commands/update.js +5 -5
- package/dist/{bin → cli}/commands/validate.js +5 -5
- package/dist/cli/security-cli.js +118 -0
- package/dist/config/FeatureManager.js +6 -0
- package/dist/config/clodo-create.example.json +26 -0
- package/dist/config/clodo-deploy.example.json +41 -0
- package/dist/config/clodo-update.example.json +46 -0
- package/dist/config/clodo-validate.example.json +41 -0
- package/dist/config/customers/template/development.env.template +37 -0
- package/dist/config/customers/template/production.env.template +39 -0
- package/dist/config/customers/template/staging.env.template +37 -0
- package/dist/config/customers.js +28 -26
- package/dist/config/domain-examples/README.md +464 -0
- package/dist/config/domain-examples/environment-mapped.json +168 -0
- package/dist/config/domain-examples/multi-domain.json +144 -0
- package/dist/config/domain-examples/single-domain.json +50 -0
- package/dist/config/examples +12 -0
- package/dist/config/features.js +61 -0
- package/dist/config/staging-deployment.json +60 -0
- package/dist/config/validation-config.json +347 -0
- package/dist/deployment/wrangler-deployer.js +1 -1
- package/dist/{bin → lib}/deployment/modules/DeploymentOrchestrator.js +2 -2
- package/dist/{bin → lib}/deployment/modules/EnvironmentManager.js +2 -2
- package/dist/lib/deployment/orchestration/EnterpriseOrchestrator.js +21 -0
- package/dist/lib/shared/cache/configuration-cache.js +82 -0
- package/dist/{bin → lib}/shared/cloudflare/domain-discovery.js +1 -1
- package/dist/{bin → lib}/shared/cloudflare/domain-manager.js +1 -1
- package/dist/{bin → lib}/shared/cloudflare/index.js +1 -1
- package/dist/{bin → lib}/shared/cloudflare/ops.js +10 -8
- package/dist/{bin → lib}/shared/config/ConfigurationManager.js +23 -1
- package/dist/{bin → lib}/shared/config/command-config-manager.js +19 -3
- package/dist/{bin → lib}/shared/config/index.js +1 -1
- package/dist/{bin → lib}/shared/deployment/credential-collector.js +30 -7
- package/dist/lib/shared/deployment/index.js +10 -0
- package/dist/lib/shared/deployment/rollback-manager.js +7 -0
- package/dist/lib/shared/deployment/utilities/d1-error-recovery.js +177 -0
- package/dist/{bin → lib}/shared/deployment/validator.js +40 -10
- package/dist/lib/shared/deployment/workflows/deployment-summary.js +214 -0
- package/dist/lib/shared/deployment/workflows/interactive-confirmation.js +188 -0
- package/dist/lib/shared/deployment/workflows/interactive-database-workflow.js +234 -0
- package/dist/lib/shared/deployment/workflows/interactive-domain-info-gatherer.js +240 -0
- package/dist/lib/shared/deployment/workflows/interactive-secret-workflow.js +228 -0
- package/dist/lib/shared/deployment/workflows/interactive-testing-workflow.js +235 -0
- package/dist/lib/shared/deployment/workflows/interactive-validation.js +218 -0
- package/dist/lib/shared/error-handling/error-classifier.js +46 -0
- package/dist/{bin → lib}/shared/monitoring/health-checker.js +129 -1
- package/dist/{bin → lib}/shared/monitoring/memory-manager.js +17 -6
- package/dist/{bin → lib}/shared/routing/domain-router.js +1 -1
- package/dist/lib/shared/utils/deployment-validator.js +97 -0
- package/dist/{bin → lib}/shared/utils/formatters.js +10 -0
- package/dist/{bin → lib}/shared/utils/index.js +13 -1
- package/dist/{bin → lib}/shared/utils/interactive-prompts.js +34 -18
- package/dist/{bin → lib}/shared/utils/progress-manager.js +2 -2
- package/dist/lib/shared/utils/progress-spinner.js +53 -0
- package/dist/lib/shared/utils/sensitive-redactor.js +91 -0
- package/dist/{bin → lib}/shared/validation/ValidationRegistry.js +1 -1
- package/dist/migration/MigrationAdapters.js +50 -4
- package/dist/orchestration/cross-domain-coordinator.js +5 -5
- package/dist/orchestration/multi-domain-orchestrator.js +63 -22
- package/dist/security/index.js +2 -2
- package/dist/security/patterns/insecure-patterns.js +1 -1
- package/dist/service-management/ConfirmationEngine.js +1 -1
- package/dist/service-management/ErrorTracker.js +1 -1
- package/dist/service-management/InputCollector.js +1 -1
- package/dist/service-management/ServiceCreator.js +11 -255
- package/dist/service-management/ServiceOrchestrator.js +0 -2
- package/dist/service-management/generators/testing/UnitTestsGenerator.js +4 -4
- package/dist/service-management/index.js +1 -1
- package/dist/utils/cloudflare/ops.js +1 -1
- package/dist/utils/constants.js +102 -0
- package/dist/utils/deployment/wrangler-config-manager.js +215 -48
- package/dist/utils/file-manager.js +1 -1
- package/dist/utils/formatters.js +1 -1
- package/dist/utils/framework-config.js +2 -2
- package/dist/utils/interactive-prompts.js +10 -59
- package/dist/utils/logger.js +1 -1
- package/dist/version/VersionDetector.js +99 -9
- package/dist/worker/integration.js +1 -1
- package/package.json +10 -10
- package/dist/bin/clodo-service-old.js +0 -868
- package/dist/bin/clodo-service-test.js +0 -10
- package/dist/bin/commands/assess.js +0 -91
- package/dist/bin/database/enterprise-db-manager.js +0 -457
- package/dist/bin/deployment/enterprise-deploy.js +0 -877
- package/dist/bin/deployment/master-deploy.js +0 -1376
- package/dist/bin/deployment/modular-enterprise-deploy.js +0 -466
- package/dist/bin/deployment/orchestration/EnterpriseOrchestrator.js +0 -401
- package/dist/bin/deployment/test-interactive-utils.js +0 -66
- package/dist/bin/portfolio/portfolio-manager.js +0 -487
- package/dist/bin/security/security-cli.js +0 -108
- package/dist/bin/service-management/create-service.js +0 -122
- package/dist/bin/service-management/init-service.js +0 -79
- package/dist/bin/shared/deployment/index.js +0 -10
- package/dist/bin/shared/deployment/rollback-manager.js +0 -523
- package/dist/deployment/orchestration/EnterpriseOrchestrator.js +0 -401
- package/dist/service-management/ServiceInitializer.js +0 -453
- /package/dist/{bin → lib}/database/deployment-db-manager.js +0 -0
- /package/dist/{bin → lib}/database/wrangler-d1-manager.js +0 -0
- /package/dist/{bin → lib}/deployment/modules/DeploymentConfiguration.js +0 -0
- /package/dist/{bin → lib}/deployment/modules/MonitoringIntegration.js +0 -0
- /package/dist/{bin → lib}/deployment/modules/ValidationManager.js +0 -0
- /package/dist/{bin → lib}/deployment/orchestration/BaseDeploymentOrchestrator.js +0 -0
- /package/dist/{bin → lib}/deployment/orchestration/PortfolioOrchestrator.js +0 -0
- /package/dist/{bin → lib}/deployment/orchestration/SingleServiceOrchestrator.js +0 -0
- /package/dist/{bin → lib}/deployment/orchestration/UnifiedDeploymentOrchestrator.js +0 -0
- /package/dist/{bin → lib}/shared/config/cache.js +0 -0
- /package/dist/{bin → lib}/shared/config/cloudflare-service-validator.js +0 -0
- /package/dist/{bin → lib}/shared/config/manager.js +0 -0
- /package/dist/{bin → lib}/shared/config/manifest-loader.js +0 -0
- /package/dist/{bin → lib}/shared/database/connection-manager.js +0 -0
- /package/dist/{bin → lib}/shared/database/index.js +0 -0
- /package/dist/{bin → lib}/shared/database/orchestrator.js +0 -0
- /package/dist/{bin → lib}/shared/deployment/auditor.js +0 -0
- /package/dist/{bin → lib}/shared/index.js +0 -0
- /package/dist/{bin → lib}/shared/logging/Logger.js +0 -0
- /package/dist/{bin → lib}/shared/monitoring/index.js +0 -0
- /package/dist/{bin → lib}/shared/monitoring/production-monitor.js +0 -0
- /package/dist/{bin → lib}/shared/production-tester/api-tester.js +0 -0
- /package/dist/{bin → lib}/shared/production-tester/auth-tester.js +0 -0
- /package/dist/{bin → lib}/shared/production-tester/core.js +0 -0
- /package/dist/{bin → lib}/shared/production-tester/database-tester.js +0 -0
- /package/dist/{bin → lib}/shared/production-tester/index.js +0 -0
- /package/dist/{bin → lib}/shared/production-tester/load-tester.js +0 -0
- /package/dist/{bin → lib}/shared/production-tester/performance-tester.js +0 -0
- /package/dist/{bin → lib}/shared/security/api-token-manager.js +0 -0
- /package/dist/{bin → lib}/shared/security/index.js +0 -0
- /package/dist/{bin → lib}/shared/security/secret-generator.js +0 -0
- /package/dist/{bin → lib}/shared/security/secure-token-manager.js +0 -0
- /package/dist/{bin → lib}/shared/utils/ErrorHandler.js +0 -0
- /package/dist/{bin → lib}/shared/utils/cli-options.js +0 -0
- /package/dist/{bin → lib}/shared/utils/config-loader.js +0 -0
- /package/dist/{bin → lib}/shared/utils/error-recovery.js +0 -0
- /package/dist/{bin → lib}/shared/utils/file-manager.js +0 -0
- /package/dist/{bin → lib}/shared/utils/graceful-shutdown-manager.js +0 -0
- /package/dist/{bin → lib}/shared/utils/interactive-utils.js +0 -0
- /package/dist/{bin → lib}/shared/utils/output-formatter.js +0 -0
- /package/dist/{bin → lib}/shared/utils/rate-limiter.js +0 -0
|
@@ -0,0 +1,464 @@
|
|
|
1
|
+
# Domain Configuration Examples
|
|
2
|
+
|
|
3
|
+
**Date**: October 28, 2025
|
|
4
|
+
**Purpose**: Example domain configurations for clodo-service deployment
|
|
5
|
+
**Location**: `config/domain-examples/`
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## 📋 Overview
|
|
10
|
+
|
|
11
|
+
This directory contains three comprehensive example domain configuration files that demonstrate different deployment strategies and use cases for the clodo-service framework. These examples show how to configure domains for various scenarios:
|
|
12
|
+
|
|
13
|
+
1. **Single Domain** - Simple production deployment
|
|
14
|
+
2. **Multi-Domain** - Complex multi-service architecture
|
|
15
|
+
3. **Environment-Mapped** - Development, staging, and production environments
|
|
16
|
+
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
## 📁 Configuration Files
|
|
20
|
+
|
|
21
|
+
### 1. `single-domain.json` - Simple Production Setup
|
|
22
|
+
**Use Case**: Single API service in production environment
|
|
23
|
+
**Complexity**: Basic
|
|
24
|
+
**Domains**: 1
|
|
25
|
+
**Environment**: Production only
|
|
26
|
+
|
|
27
|
+
**Key Features**:
|
|
28
|
+
- Single domain configuration
|
|
29
|
+
- Basic health checks
|
|
30
|
+
- CORS and rate limiting
|
|
31
|
+
- API routing rules
|
|
32
|
+
- Production security settings
|
|
33
|
+
|
|
34
|
+
### 2. `multi-domain.json` - Multi-Service Architecture
|
|
35
|
+
**Use Case**: Multiple services with different requirements
|
|
36
|
+
**Complexity**: Advanced
|
|
37
|
+
**Domains**: 3 (API, Admin, CDN)
|
|
38
|
+
**Environment**: Production only
|
|
39
|
+
|
|
40
|
+
**Key Features**:
|
|
41
|
+
- Three different service types
|
|
42
|
+
- Parallel deployment configuration
|
|
43
|
+
- Service-specific security policies
|
|
44
|
+
- Authentication requirements
|
|
45
|
+
- CDN caching configuration
|
|
46
|
+
- Rollback strategies
|
|
47
|
+
|
|
48
|
+
### 3. `environment-mapped.json` - Multi-Environment Setup
|
|
49
|
+
**Use Case**: Development workflow with multiple environments
|
|
50
|
+
**Complexity**: Enterprise
|
|
51
|
+
**Domains**: 3 (one per environment)
|
|
52
|
+
**Environments**: Development, Staging, Production
|
|
53
|
+
|
|
54
|
+
**Key Features**:
|
|
55
|
+
- Environment-specific configurations
|
|
56
|
+
- Different security levels per environment
|
|
57
|
+
- Monitoring and alerting setup
|
|
58
|
+
- Domain suffix mapping
|
|
59
|
+
- Environment-specific routing
|
|
60
|
+
|
|
61
|
+
---
|
|
62
|
+
|
|
63
|
+
## 🚀 Usage Guide
|
|
64
|
+
|
|
65
|
+
### Basic Usage
|
|
66
|
+
|
|
67
|
+
```bash
|
|
68
|
+
# Deploy using a domain configuration
|
|
69
|
+
npx clodo-service deploy --config config/domain-examples/single-domain.json
|
|
70
|
+
|
|
71
|
+
# Deploy to specific environment (for environment-mapped configs)
|
|
72
|
+
npx clodo-service deploy --config config/domain-examples/environment-mapped.json --environment production
|
|
73
|
+
|
|
74
|
+
# Deploy all domains (for multi-domain configs)
|
|
75
|
+
npx clodo-service deploy --config config/domain-examples/multi-domain.json --all-domains
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
### Configuration Structure
|
|
79
|
+
|
|
80
|
+
All configuration files follow this structure:
|
|
81
|
+
|
|
82
|
+
```json
|
|
83
|
+
{
|
|
84
|
+
"domains": {
|
|
85
|
+
"domain-name.com": {
|
|
86
|
+
"environment": "production|staging|development",
|
|
87
|
+
"serviceName": "unique-service-identifier",
|
|
88
|
+
"serviceType": "data-service|web-service|static-site",
|
|
89
|
+
"cloudflareToken": "your-api-token",
|
|
90
|
+
"cloudflareAccountId": "your-account-id",
|
|
91
|
+
"cloudflareZoneId": "your-zone-id",
|
|
92
|
+
"displayName": "Human-readable name",
|
|
93
|
+
"description": "Service description",
|
|
94
|
+
"deploymentStrategy": "rolling|blue-green|instant",
|
|
95
|
+
"healthCheck": { ... },
|
|
96
|
+
"routing": { ... },
|
|
97
|
+
"security": { ... }
|
|
98
|
+
}
|
|
99
|
+
},
|
|
100
|
+
"global": {
|
|
101
|
+
"customer": "your-company",
|
|
102
|
+
"organization": "Your Organization",
|
|
103
|
+
"contact": "devops@yourcompany.com",
|
|
104
|
+
"version": "1.0.0",
|
|
105
|
+
"lastUpdated": "2025-10-28"
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
---
|
|
111
|
+
|
|
112
|
+
## 🔧 Configuration Details
|
|
113
|
+
|
|
114
|
+
### Required Fields
|
|
115
|
+
|
|
116
|
+
| Field | Description | Example |
|
|
117
|
+
|-------|-------------|---------|
|
|
118
|
+
| `serviceName` | Unique identifier for the service | `"api-service-prod"` |
|
|
119
|
+
| `serviceType` | Type of service | `"data-service"` |
|
|
120
|
+
| `cloudflareToken` | Cloudflare API token | `"CLOUDFLARE_TOKEN"` |
|
|
121
|
+
| `cloudflareAccountId` | Cloudflare account ID | `"1234567890abcdef..."` |
|
|
122
|
+
| `cloudflareZoneId` | Cloudflare zone ID | `"0987654321fedcba..."` |
|
|
123
|
+
|
|
124
|
+
### Optional Fields
|
|
125
|
+
|
|
126
|
+
| Field | Description | Default |
|
|
127
|
+
|-------|-------------|---------|
|
|
128
|
+
| `environment` | Target environment | `"production"` |
|
|
129
|
+
| `deploymentStrategy` | Deployment method | `"rolling"` |
|
|
130
|
+
| `displayName` | Human-readable name | Same as serviceName |
|
|
131
|
+
| `description` | Service description | `""` |
|
|
132
|
+
|
|
133
|
+
### Service Types
|
|
134
|
+
|
|
135
|
+
- **`data-service`**: API services with database connectivity
|
|
136
|
+
- **`web-service`**: Web applications with user interfaces
|
|
137
|
+
- **`static-site`**: Static content served via CDN
|
|
138
|
+
|
|
139
|
+
### Deployment Strategies
|
|
140
|
+
|
|
141
|
+
- **`rolling`**: Gradual replacement, zero downtime
|
|
142
|
+
- **`blue-green`**: Complete switch between versions
|
|
143
|
+
- **`instant`**: Immediate deployment (for static sites)
|
|
144
|
+
|
|
145
|
+
---
|
|
146
|
+
|
|
147
|
+
## 🛡️ Security Configuration
|
|
148
|
+
|
|
149
|
+
### CORS Settings
|
|
150
|
+
|
|
151
|
+
```json
|
|
152
|
+
"cors": {
|
|
153
|
+
"enabled": true,
|
|
154
|
+
"origins": ["https://app.example.com"],
|
|
155
|
+
"methods": ["GET", "POST", "PUT", "DELETE"],
|
|
156
|
+
"headers": ["Content-Type", "Authorization"]
|
|
157
|
+
}
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
### Rate Limiting
|
|
161
|
+
|
|
162
|
+
```json
|
|
163
|
+
"rateLimit": {
|
|
164
|
+
"enabled": true,
|
|
165
|
+
"requests": 1000,
|
|
166
|
+
"window": 60
|
|
167
|
+
}
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
### Web Application Firewall (WAF)
|
|
171
|
+
|
|
172
|
+
```json
|
|
173
|
+
"waf": {
|
|
174
|
+
"enabled": true,
|
|
175
|
+
"rules": ["sql-injection", "xss", "csrf", "ddos"]
|
|
176
|
+
}
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
---
|
|
180
|
+
|
|
181
|
+
## 🔍 Health Checks
|
|
182
|
+
|
|
183
|
+
### Basic Health Check
|
|
184
|
+
|
|
185
|
+
```json
|
|
186
|
+
"healthCheck": {
|
|
187
|
+
"enabled": true,
|
|
188
|
+
"path": "/health",
|
|
189
|
+
"interval": 30,
|
|
190
|
+
"timeout": 10
|
|
191
|
+
}
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
### Advanced Health Check
|
|
195
|
+
|
|
196
|
+
```json
|
|
197
|
+
"healthCheck": {
|
|
198
|
+
"enabled": true,
|
|
199
|
+
"path": "/api/health",
|
|
200
|
+
"interval": 60,
|
|
201
|
+
"timeout": 15,
|
|
202
|
+
"headers": {
|
|
203
|
+
"Authorization": "Bearer health-check-token"
|
|
204
|
+
},
|
|
205
|
+
"expectedStatus": 200
|
|
206
|
+
}
|
|
207
|
+
```
|
|
208
|
+
|
|
209
|
+
---
|
|
210
|
+
|
|
211
|
+
## 🛣️ Routing Configuration
|
|
212
|
+
|
|
213
|
+
### Basic Routing
|
|
214
|
+
|
|
215
|
+
```json
|
|
216
|
+
"routing": {
|
|
217
|
+
"rules": [
|
|
218
|
+
{
|
|
219
|
+
"pattern": "/api/*",
|
|
220
|
+
"target": "api-worker",
|
|
221
|
+
"methods": ["GET", "POST", "PUT", "DELETE"]
|
|
222
|
+
}
|
|
223
|
+
]
|
|
224
|
+
}
|
|
225
|
+
```
|
|
226
|
+
|
|
227
|
+
### Advanced Routing with Authentication
|
|
228
|
+
|
|
229
|
+
```json
|
|
230
|
+
"routing": {
|
|
231
|
+
"rules": [
|
|
232
|
+
{
|
|
233
|
+
"pattern": "/admin/*",
|
|
234
|
+
"target": "admin-worker",
|
|
235
|
+
"methods": ["GET", "POST", "PUT", "DELETE"],
|
|
236
|
+
"auth": {
|
|
237
|
+
"required": true,
|
|
238
|
+
"type": "jwt"
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
]
|
|
242
|
+
}
|
|
243
|
+
```
|
|
244
|
+
|
|
245
|
+
### CDN Routing with Caching
|
|
246
|
+
|
|
247
|
+
```json
|
|
248
|
+
"routing": {
|
|
249
|
+
"rules": [
|
|
250
|
+
{
|
|
251
|
+
"pattern": "/*",
|
|
252
|
+
"target": "cdn-worker",
|
|
253
|
+
"methods": ["GET", "HEAD"],
|
|
254
|
+
"cache": {
|
|
255
|
+
"enabled": true,
|
|
256
|
+
"ttl": 3600,
|
|
257
|
+
"purgeOnDeploy": true
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
]
|
|
261
|
+
}
|
|
262
|
+
```
|
|
263
|
+
|
|
264
|
+
---
|
|
265
|
+
|
|
266
|
+
## 🌍 Environment Mapping
|
|
267
|
+
|
|
268
|
+
### Environment Structure
|
|
269
|
+
|
|
270
|
+
```json
|
|
271
|
+
"environments": {
|
|
272
|
+
"production": {
|
|
273
|
+
"domains": { ... }
|
|
274
|
+
},
|
|
275
|
+
"staging": {
|
|
276
|
+
"domains": { ... }
|
|
277
|
+
},
|
|
278
|
+
"development": {
|
|
279
|
+
"domains": { ... }
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
```
|
|
283
|
+
|
|
284
|
+
### Global Environment Configuration
|
|
285
|
+
|
|
286
|
+
```json
|
|
287
|
+
"global": {
|
|
288
|
+
"environmentMapping": {
|
|
289
|
+
"enabled": true,
|
|
290
|
+
"defaultEnvironment": "development",
|
|
291
|
+
"allowedEnvironments": ["development", "staging", "production"],
|
|
292
|
+
"domainSuffixes": {
|
|
293
|
+
"production": "",
|
|
294
|
+
"staging": ".staging",
|
|
295
|
+
"development": ".dev"
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
```
|
|
300
|
+
|
|
301
|
+
---
|
|
302
|
+
|
|
303
|
+
## 📊 Deployment Strategies
|
|
304
|
+
|
|
305
|
+
### Rolling Deployment
|
|
306
|
+
- Gradual replacement of instances
|
|
307
|
+
- Zero downtime
|
|
308
|
+
- Best for stateful services
|
|
309
|
+
- Default strategy
|
|
310
|
+
|
|
311
|
+
### Blue-Green Deployment
|
|
312
|
+
- Complete switch between versions
|
|
313
|
+
- Instant rollback capability
|
|
314
|
+
- Best for critical production services
|
|
315
|
+
- Requires double resources during deployment
|
|
316
|
+
|
|
317
|
+
### Instant Deployment
|
|
318
|
+
- Immediate replacement
|
|
319
|
+
- Fastest deployment
|
|
320
|
+
- Best for static sites and development
|
|
321
|
+
- Potential brief downtime
|
|
322
|
+
|
|
323
|
+
---
|
|
324
|
+
|
|
325
|
+
## 🔧 Customization Guide
|
|
326
|
+
|
|
327
|
+
### Adding a New Domain
|
|
328
|
+
|
|
329
|
+
1. Add domain entry to `domains` object
|
|
330
|
+
2. Configure required Cloudflare credentials
|
|
331
|
+
3. Set service-specific routing rules
|
|
332
|
+
4. Configure security policies
|
|
333
|
+
5. Add health check endpoints
|
|
334
|
+
6. Test configuration with `--dry-run`
|
|
335
|
+
|
|
336
|
+
### Environment-Specific Overrides
|
|
337
|
+
|
|
338
|
+
```json
|
|
339
|
+
"domains": {
|
|
340
|
+
"api.example.com": {
|
|
341
|
+
"environment": "production",
|
|
342
|
+
"security": {
|
|
343
|
+
"rateLimit": {
|
|
344
|
+
"requests": 10000
|
|
345
|
+
}
|
|
346
|
+
}
|
|
347
|
+
}
|
|
348
|
+
}
|
|
349
|
+
```
|
|
350
|
+
|
|
351
|
+
### Service-Specific Routing
|
|
352
|
+
|
|
353
|
+
```json
|
|
354
|
+
"routing": {
|
|
355
|
+
"rules": [
|
|
356
|
+
{
|
|
357
|
+
"pattern": "/api/v1/*",
|
|
358
|
+
"target": "api-v1-worker"
|
|
359
|
+
},
|
|
360
|
+
{
|
|
361
|
+
"pattern": "/api/v2/*",
|
|
362
|
+
"target": "api-v2-worker"
|
|
363
|
+
}
|
|
364
|
+
]
|
|
365
|
+
}
|
|
366
|
+
```
|
|
367
|
+
|
|
368
|
+
---
|
|
369
|
+
|
|
370
|
+
## 🐛 Troubleshooting
|
|
371
|
+
|
|
372
|
+
### Common Issues
|
|
373
|
+
|
|
374
|
+
**Configuration Validation Errors**
|
|
375
|
+
```
|
|
376
|
+
Error: Invalid domain configuration
|
|
377
|
+
Solution: Check required fields (serviceName, cloudflareToken, etc.)
|
|
378
|
+
```
|
|
379
|
+
|
|
380
|
+
**Cloudflare API Errors**
|
|
381
|
+
```
|
|
382
|
+
Error: Invalid API token
|
|
383
|
+
Solution: Verify CLOUDFLARE_API_TOKEN environment variable
|
|
384
|
+
```
|
|
385
|
+
|
|
386
|
+
**Domain Not Found**
|
|
387
|
+
```
|
|
388
|
+
Error: Domain not configured
|
|
389
|
+
Solution: Check domain spelling and configuration structure
|
|
390
|
+
```
|
|
391
|
+
|
|
392
|
+
**Health Check Failures**
|
|
393
|
+
```
|
|
394
|
+
Error: Health check timeout
|
|
395
|
+
Solution: Verify health endpoint exists and is accessible
|
|
396
|
+
```
|
|
397
|
+
|
|
398
|
+
### Debugging Commands
|
|
399
|
+
|
|
400
|
+
```bash
|
|
401
|
+
# Validate configuration
|
|
402
|
+
npx clodo-service deploy --config config/domain-examples/single-domain.json --dry-run
|
|
403
|
+
|
|
404
|
+
# Test specific domain
|
|
405
|
+
npx clodo-service deploy --config config/domain-examples/single-domain.json --domain api.example.com --dry-run
|
|
406
|
+
|
|
407
|
+
# Check environment variables
|
|
408
|
+
echo $CLOUDFLARE_API_TOKEN
|
|
409
|
+
echo $CLOUDFLARE_ACCOUNT_ID
|
|
410
|
+
```
|
|
411
|
+
|
|
412
|
+
---
|
|
413
|
+
|
|
414
|
+
## 📈 Best Practices
|
|
415
|
+
|
|
416
|
+
### Security
|
|
417
|
+
- Use environment variables for sensitive credentials
|
|
418
|
+
- Enable WAF rules for production environments
|
|
419
|
+
- Configure appropriate rate limits
|
|
420
|
+
- Use HTTPS-only origins in CORS
|
|
421
|
+
|
|
422
|
+
### Performance
|
|
423
|
+
- Enable caching for static content
|
|
424
|
+
- Configure appropriate health check intervals
|
|
425
|
+
- Use parallel deployments for multi-domain setups
|
|
426
|
+
- Monitor response times and error rates
|
|
427
|
+
|
|
428
|
+
### Reliability
|
|
429
|
+
- Configure health checks for all services
|
|
430
|
+
- Use blue-green deployments for critical services
|
|
431
|
+
- Enable rollback on failure
|
|
432
|
+
- Set appropriate timeouts
|
|
433
|
+
|
|
434
|
+
### Monitoring
|
|
435
|
+
- Enable monitoring for production environments
|
|
436
|
+
- Configure alerts for error rates and response times
|
|
437
|
+
- Log deployment events and failures
|
|
438
|
+
- Track deployment metrics
|
|
439
|
+
|
|
440
|
+
---
|
|
441
|
+
|
|
442
|
+
## 🔗 Related Documentation
|
|
443
|
+
|
|
444
|
+
- **Deploy Command**: `docs/ORCHESTRATOR_CLI_INTEGRATION.md`
|
|
445
|
+
- **API Reference**: `docs/api-reference.md`
|
|
446
|
+
- **Security Guide**: `docs/SECURITY.md`
|
|
447
|
+
- **Migration Guide**: `docs/MIGRATION_GUIDE.md`
|
|
448
|
+
|
|
449
|
+
---
|
|
450
|
+
|
|
451
|
+
## 📞 Support
|
|
452
|
+
|
|
453
|
+
For questions about domain configuration:
|
|
454
|
+
- Check the troubleshooting section above
|
|
455
|
+
- Review the API documentation
|
|
456
|
+
- Test with `--dry-run` flag first
|
|
457
|
+
- Contact: devops@example.com
|
|
458
|
+
|
|
459
|
+
---
|
|
460
|
+
|
|
461
|
+
**Version**: 1.0.0
|
|
462
|
+
**Last Updated**: October 28, 2025
|
|
463
|
+
**Examples**: 3 configurations
|
|
464
|
+
**Use Cases**: Single domain, multi-domain, environment-mapped
|
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
{
|
|
2
|
+
"environments": {
|
|
3
|
+
"production": {
|
|
4
|
+
"domains": {
|
|
5
|
+
"api.example.com": {
|
|
6
|
+
"serviceName": "api-service-prod",
|
|
7
|
+
"serviceType": "data-service",
|
|
8
|
+
"cloudflareToken": "CLOUDFLARE_PROD_TOKEN_PLACEHOLDER",
|
|
9
|
+
"cloudflareAccountId": "1234567890abcdef1234567890abcdef",
|
|
10
|
+
"cloudflareZoneId": "0987654321fedcba0987654321fedcba",
|
|
11
|
+
"displayName": "Production API Service",
|
|
12
|
+
"description": "Production API service with maximum reliability",
|
|
13
|
+
"deploymentStrategy": "blue-green",
|
|
14
|
+
"healthCheck": {
|
|
15
|
+
"enabled": true,
|
|
16
|
+
"path": "/health",
|
|
17
|
+
"interval": 30,
|
|
18
|
+
"timeout": 10
|
|
19
|
+
},
|
|
20
|
+
"routing": {
|
|
21
|
+
"rules": [
|
|
22
|
+
{
|
|
23
|
+
"pattern": "/api/*",
|
|
24
|
+
"target": "api-prod-worker",
|
|
25
|
+
"methods": ["GET", "POST", "PUT", "DELETE"]
|
|
26
|
+
}
|
|
27
|
+
]
|
|
28
|
+
},
|
|
29
|
+
"security": {
|
|
30
|
+
"cors": {
|
|
31
|
+
"enabled": true,
|
|
32
|
+
"origins": ["https://app.example.com"],
|
|
33
|
+
"methods": ["GET", "POST", "PUT", "DELETE"],
|
|
34
|
+
"headers": ["Content-Type", "Authorization"]
|
|
35
|
+
},
|
|
36
|
+
"rateLimit": {
|
|
37
|
+
"enabled": true,
|
|
38
|
+
"requests": 10000,
|
|
39
|
+
"window": 60
|
|
40
|
+
},
|
|
41
|
+
"waf": {
|
|
42
|
+
"enabled": true,
|
|
43
|
+
"rules": ["sql-injection", "xss", "csrf", "ddos"]
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
"monitoring": {
|
|
47
|
+
"enabled": true,
|
|
48
|
+
"metrics": ["response-time", "error-rate", "throughput"],
|
|
49
|
+
"alerts": {
|
|
50
|
+
"errorRateThreshold": 0.05,
|
|
51
|
+
"responseTimeThreshold": 500
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
"staging": {
|
|
58
|
+
"domains": {
|
|
59
|
+
"api.staging.example.com": {
|
|
60
|
+
"serviceName": "api-service-staging",
|
|
61
|
+
"serviceType": "data-service",
|
|
62
|
+
"cloudflareToken": "CLOUDFLARE_STAGING_TOKEN_PLACEHOLDER",
|
|
63
|
+
"cloudflareAccountId": "1234567890abcdef1234567890abcdef",
|
|
64
|
+
"cloudflareZoneId": "0987654321fedcba0987654321fedcba",
|
|
65
|
+
"displayName": "Staging API Service",
|
|
66
|
+
"description": "Staging environment for testing and validation",
|
|
67
|
+
"deploymentStrategy": "rolling",
|
|
68
|
+
"healthCheck": {
|
|
69
|
+
"enabled": true,
|
|
70
|
+
"path": "/health",
|
|
71
|
+
"interval": 60,
|
|
72
|
+
"timeout": 15
|
|
73
|
+
},
|
|
74
|
+
"routing": {
|
|
75
|
+
"rules": [
|
|
76
|
+
{
|
|
77
|
+
"pattern": "/api/*",
|
|
78
|
+
"target": "api-staging-worker",
|
|
79
|
+
"methods": ["GET", "POST", "PUT", "DELETE"]
|
|
80
|
+
}
|
|
81
|
+
]
|
|
82
|
+
},
|
|
83
|
+
"security": {
|
|
84
|
+
"cors": {
|
|
85
|
+
"enabled": true,
|
|
86
|
+
"origins": ["https://staging.example.com"],
|
|
87
|
+
"methods": ["GET", "POST", "PUT", "DELETE"],
|
|
88
|
+
"headers": ["Content-Type", "Authorization"]
|
|
89
|
+
},
|
|
90
|
+
"rateLimit": {
|
|
91
|
+
"enabled": true,
|
|
92
|
+
"requests": 1000,
|
|
93
|
+
"window": 60
|
|
94
|
+
}
|
|
95
|
+
},
|
|
96
|
+
"monitoring": {
|
|
97
|
+
"enabled": true,
|
|
98
|
+
"metrics": ["response-time", "error-rate"],
|
|
99
|
+
"alerts": {
|
|
100
|
+
"errorRateThreshold": 0.10,
|
|
101
|
+
"responseTimeThreshold": 1000
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
},
|
|
107
|
+
"development": {
|
|
108
|
+
"domains": {
|
|
109
|
+
"api.dev.example.com": {
|
|
110
|
+
"serviceName": "api-service-dev",
|
|
111
|
+
"serviceType": "data-service",
|
|
112
|
+
"cloudflareToken": "CLOUDFLARE_DEV_TOKEN_PLACEHOLDER",
|
|
113
|
+
"cloudflareAccountId": "1234567890abcdef1234567890abcdef",
|
|
114
|
+
"cloudflareZoneId": "0987654321fedcba0987654321fedcba",
|
|
115
|
+
"displayName": "Development API Service",
|
|
116
|
+
"description": "Development environment for active development",
|
|
117
|
+
"deploymentStrategy": "instant",
|
|
118
|
+
"healthCheck": {
|
|
119
|
+
"enabled": true,
|
|
120
|
+
"path": "/health",
|
|
121
|
+
"interval": 120,
|
|
122
|
+
"timeout": 30
|
|
123
|
+
},
|
|
124
|
+
"routing": {
|
|
125
|
+
"rules": [
|
|
126
|
+
{
|
|
127
|
+
"pattern": "/api/*",
|
|
128
|
+
"target": "api-dev-worker",
|
|
129
|
+
"methods": ["GET", "POST", "PUT", "DELETE"]
|
|
130
|
+
}
|
|
131
|
+
]
|
|
132
|
+
},
|
|
133
|
+
"security": {
|
|
134
|
+
"cors": {
|
|
135
|
+
"enabled": true,
|
|
136
|
+
"origins": ["http://localhost:3000", "https://dev.example.com"],
|
|
137
|
+
"methods": ["GET", "POST", "PUT", "DELETE"],
|
|
138
|
+
"headers": ["Content-Type", "Authorization"]
|
|
139
|
+
},
|
|
140
|
+
"rateLimit": {
|
|
141
|
+
"enabled": false
|
|
142
|
+
}
|
|
143
|
+
},
|
|
144
|
+
"monitoring": {
|
|
145
|
+
"enabled": false
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
},
|
|
151
|
+
"global": {
|
|
152
|
+
"customer": "example-company",
|
|
153
|
+
"organization": "Example Corp",
|
|
154
|
+
"contact": "devops@example.com",
|
|
155
|
+
"version": "1.0.0",
|
|
156
|
+
"lastUpdated": "2025-10-28",
|
|
157
|
+
"environmentMapping": {
|
|
158
|
+
"enabled": true,
|
|
159
|
+
"defaultEnvironment": "development",
|
|
160
|
+
"allowedEnvironments": ["development", "staging", "production"],
|
|
161
|
+
"domainSuffixes": {
|
|
162
|
+
"production": "",
|
|
163
|
+
"staging": ".staging",
|
|
164
|
+
"development": ".dev"
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
}
|