@testver/testver 0.2.0
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/README.md +288 -0
- package/bin/testver.js +2 -0
- package/deploy/Dockerfile +40 -0
- package/deploy/docker-compose.yml +57 -0
- package/deploy/nginx.conf +136 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +100161 -0
- package/dist/py-agent/testver_appium.py +433 -0
- package/dist/wdio-attach-service/index.cjs +193 -0
- package/dist/wdio-attach-service/package.json +11 -0
- package/dist/wdio-bootstrap/bootstrap.cjs +627 -0
- package/dist/wdio-json-reporter/index.cjs +165 -0
- package/dist/wdio-json-reporter/package.json +7 -0
- package/package.json +113 -0
- package/src/ui/static/assets/dark-logo-BddlJH8z.svg +1 -0
- package/src/ui/static/assets/index-4OALwN46.js +49 -0
- package/src/ui/static/assets/index-B717Le4X.css +7 -0
- package/src/ui/static/assets/index-D8OX9kxr.js +2075 -0
- package/src/ui/static/assets/logo-DwQCjTm_.svg +1 -0
- package/src/ui/static/dark-logo.svg +1 -0
- package/src/ui/static/favicon.svg +1 -0
- package/src/ui/static/index.html +476 -0
- package/src/ui/static/logo.svg +1 -0
package/README.md
ADDED
|
@@ -0,0 +1,288 @@
|
|
|
1
|
+
<p align="center">
|
|
2
|
+
<img src="https://raw.githubusercontent.com/testver/testver/main/assets/logo.png" alt="Testver" width="120" />
|
|
3
|
+
</p>
|
|
4
|
+
|
|
5
|
+
<h1 align="center">Testver</h1>
|
|
6
|
+
|
|
7
|
+
<p align="center">
|
|
8
|
+
<strong>AI-Powered Test Automation & Management Platform</strong>
|
|
9
|
+
</p>
|
|
10
|
+
|
|
11
|
+
<p align="center">
|
|
12
|
+
<a href="https://www.npmjs.com/package/testver"><img src="https://img.shields.io/npm/v/testver.svg?style=flat-square&color=blue" alt="npm version" /></a>
|
|
13
|
+
<a href="https://www.npmjs.com/package/testver"><img src="https://img.shields.io/npm/dm/testver.svg?style=flat-square&color=green" alt="npm downloads" /></a>
|
|
14
|
+
<a href="https://nodejs.org"><img src="https://img.shields.io/badge/node-%3E%3D20-brightgreen.svg?style=flat-square" alt="node version" /></a>
|
|
15
|
+
<a href="https://opensource.org/licenses/MIT"><img src="https://img.shields.io/badge/license-MIT-blue.svg?style=flat-square" alt="license" /></a>
|
|
16
|
+
</p>
|
|
17
|
+
|
|
18
|
+
<p align="center">
|
|
19
|
+
CLI + Web Dashboard for complete test automation lifecycle — from test creation to execution, reporting, and integrations.
|
|
20
|
+
</p>
|
|
21
|
+
|
|
22
|
+
---
|
|
23
|
+
|
|
24
|
+
## What is Testver?
|
|
25
|
+
|
|
26
|
+
Testver is an all-in-one test automation platform that combines a powerful **CLI** with a professional **Web Dashboard**. It uses AI to generate tests, manage test cases, track coverage, detect defects, and integrate with your favorite tools.
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
npm install -g testver
|
|
30
|
+
cd your-test-project
|
|
31
|
+
testver
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
## Key Features
|
|
35
|
+
|
|
36
|
+
### Test Automation
|
|
37
|
+
- **Test Explorer** — Discover and browse all test files in your project
|
|
38
|
+
- **Test Runner** — Execute tests with real-time streaming output
|
|
39
|
+
- **Results & Reporting** — Detailed results with pass/fail breakdown, screenshots, videos
|
|
40
|
+
- **Script Mapping & Sync** — Map test scripts to test cases, track sync status
|
|
41
|
+
- **Schedules** — Schedule automated test runs (cron-based)
|
|
42
|
+
- **CI/CD Integration** — Jenkins, GitHub Actions, GitLab CI, Azure Pipelines
|
|
43
|
+
- **Self-Healing** — Auto-detect and fix broken selectors
|
|
44
|
+
|
|
45
|
+
### Test Management
|
|
46
|
+
- **Test Cases** — Create, organize, and manage test cases with folders, tags, and versioning
|
|
47
|
+
- **Test Plans & Cycles** — Plan test execution, create cycles, track progress
|
|
48
|
+
- **AI Test Generation** — Generate test cases from requirements, NLP, JIRA tickets, or existing scripts
|
|
49
|
+
- **Sources** — Centralized hub for requirements, documents, and JIRA tickets
|
|
50
|
+
- **Coverage** — Requirements traceability, document-centric mapping, orphan detection
|
|
51
|
+
- **Analytics** — Dashboards, health scores, automation usage statistics
|
|
52
|
+
- **Defect Management** — Professional defect tracking with Kanban board, rich text, attachments
|
|
53
|
+
|
|
54
|
+
### AI-Powered
|
|
55
|
+
- **AI Assistant** — Chat-based AI for test creation, debugging, and analysis
|
|
56
|
+
- **AI Test Generation** — Generate from requirements, NLP, source code, or reverse-engineer from scripts
|
|
57
|
+
- **Automation Script Generation** — Create working automation scripts from manual test cases using existing project code
|
|
58
|
+
- **Quality Scoring** — AI-powered test case quality assessment
|
|
59
|
+
- **Gap Analysis** — Identify missing test coverage
|
|
60
|
+
- **Duplicate Detection** — Find redundant test cases
|
|
61
|
+
|
|
62
|
+
### Integrations & Connectors
|
|
63
|
+
- **JIRA** — Pull stories, push defects, link test cases, sync status
|
|
64
|
+
- **Email** — Send test reports and failure alerts (Gmail, Outlook, Yahoo)
|
|
65
|
+
- **Slack** — Post test results and notifications to channels
|
|
66
|
+
- **MS Teams** — Send adaptive cards with test results
|
|
67
|
+
- **Cloud Providers** — BrowserStack, LambdaTest, Sauce Labs
|
|
68
|
+
- **Webhooks** — Custom integrations via HTTP webhooks
|
|
69
|
+
- **Import/Export** — TestRail, Zephyr, Xray, PractiTest, qTest, CSV, JSON
|
|
70
|
+
|
|
71
|
+
### Frameworks Supported
|
|
72
|
+
- **Playwright** (TypeScript, JavaScript)
|
|
73
|
+
- **Cypress** (TypeScript, JavaScript)
|
|
74
|
+
- **Selenium** (Java, Python, JavaScript)
|
|
75
|
+
- **Jest / Mocha / Vitest**
|
|
76
|
+
- **Any framework** with CLI output
|
|
77
|
+
|
|
78
|
+
## Quick Start
|
|
79
|
+
|
|
80
|
+
### Install
|
|
81
|
+
|
|
82
|
+
```bash
|
|
83
|
+
npm install -g testver
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
### Run CLI
|
|
87
|
+
|
|
88
|
+
```bash
|
|
89
|
+
cd your-test-project
|
|
90
|
+
testver
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
This opens the interactive CLI where you can:
|
|
94
|
+
|
|
95
|
+
```
|
|
96
|
+
testver > /run # Run all tests
|
|
97
|
+
testver > /run tests/login.spec.ts # Run specific test
|
|
98
|
+
testver > /ui # Open web dashboard
|
|
99
|
+
testver > /ai # AI assistant chat
|
|
100
|
+
testver > /results # View test results
|
|
101
|
+
testver > help # See all commands
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
### Open Web Dashboard
|
|
105
|
+
|
|
106
|
+
From the CLI:
|
|
107
|
+
```
|
|
108
|
+
testver > /ui
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
Or directly:
|
|
112
|
+
```bash
|
|
113
|
+
testver serve --port 3700
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
Open browser: `http://localhost:3700`
|
|
117
|
+
|
|
118
|
+
## Dashboard Screenshots
|
|
119
|
+
|
|
120
|
+
The web dashboard provides a professional interface for:
|
|
121
|
+
|
|
122
|
+
- **Dashboard** — Overview of test health, recent runs, and key metrics
|
|
123
|
+
- **Test Explorer** — Browse and run test files with syntax highlighting
|
|
124
|
+
- **Test Management** — CRUD for test cases with folders, tags, version history
|
|
125
|
+
- **Test Plans** — Create plans, cycles, and execute tests step-by-step
|
|
126
|
+
- **AI Test Gen** — Generate test cases from multiple sources using AI
|
|
127
|
+
- **Coverage** — Traceability matrix, requirement mapping, gap detection
|
|
128
|
+
- **Analytics** — Charts, trends, health scores, automation usage
|
|
129
|
+
- **Defects** — Kanban board with full defect lifecycle management
|
|
130
|
+
- **Connectors** — JIRA, Slack, Email, Teams integration
|
|
131
|
+
- **Settings** — LLM providers, themes, user management
|
|
132
|
+
|
|
133
|
+
## AI Configuration
|
|
134
|
+
|
|
135
|
+
Testver uses LLM providers for AI features. Configure in the CLI or dashboard:
|
|
136
|
+
|
|
137
|
+
### Supported Providers
|
|
138
|
+
|
|
139
|
+
| Provider | Models | Setup |
|
|
140
|
+
|---|---|---|
|
|
141
|
+
| **OpenAI** | GPT-4o, GPT-4o-mini | Set `OPENAI_API_KEY` env var |
|
|
142
|
+
| **Anthropic** | Claude Sonnet, Claude Opus | Set `ANTHROPIC_API_KEY` env var |
|
|
143
|
+
| **Google** | Gemini 2.0 Flash | Set `GOOGLE_API_KEY` env var |
|
|
144
|
+
| **xAI** | Grok | Set `XAI_API_KEY` env var |
|
|
145
|
+
| **Ollama** | Any local model | Install Ollama, no key needed |
|
|
146
|
+
|
|
147
|
+
```bash
|
|
148
|
+
# Set your preferred provider
|
|
149
|
+
export OPENAI_API_KEY=sk-your-key-here
|
|
150
|
+
|
|
151
|
+
# Or for Anthropic
|
|
152
|
+
export ANTHROPIC_API_KEY=sk-ant-your-key-here
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
## Deployment
|
|
156
|
+
|
|
157
|
+
### Option 1: Direct (Development/Local)
|
|
158
|
+
|
|
159
|
+
```bash
|
|
160
|
+
testver serve --host 0.0.0.0 --port 3700
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
### Option 2: Docker
|
|
164
|
+
|
|
165
|
+
```bash
|
|
166
|
+
testver deploy docker
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
One command that:
|
|
170
|
+
- Creates Docker container
|
|
171
|
+
- Mounts your test project
|
|
172
|
+
- Starts Testver dashboard
|
|
173
|
+
- Available at `http://localhost:3700`
|
|
174
|
+
|
|
175
|
+
### Option 3: Production (Docker + Nginx + HTTPS)
|
|
176
|
+
|
|
177
|
+
```bash
|
|
178
|
+
testver deploy production --domain testver.yourcompany.com
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
Sets up:
|
|
182
|
+
- Docker container
|
|
183
|
+
- Nginx reverse proxy
|
|
184
|
+
- Free SSL certificate (Let's Encrypt)
|
|
185
|
+
- Available at `https://testver.yourcompany.com`
|
|
186
|
+
|
|
187
|
+
### Docker Manual
|
|
188
|
+
|
|
189
|
+
```bash
|
|
190
|
+
docker run -d \
|
|
191
|
+
--name testver \
|
|
192
|
+
-p 3700:3700 \
|
|
193
|
+
-v /path/to/your/test-project:/project \
|
|
194
|
+
-e OPENAI_API_KEY=sk-your-key \
|
|
195
|
+
testver/dashboard:latest
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
## CLI Commands
|
|
199
|
+
|
|
200
|
+
| Command | Description |
|
|
201
|
+
|---|---|
|
|
202
|
+
| `testver` | Start interactive CLI |
|
|
203
|
+
| `testver serve` | Start headless server (API + Dashboard) |
|
|
204
|
+
| `testver serve --port 3700` | Specify port |
|
|
205
|
+
| `testver serve --host 0.0.0.0` | Listen on all interfaces |
|
|
206
|
+
| `testver deploy docker` | Deploy with Docker |
|
|
207
|
+
| `testver deploy production` | Deploy with Docker + Nginx + SSL |
|
|
208
|
+
| `testver deploy status` | Check deployment status |
|
|
209
|
+
| `testver deploy stop` | Stop deployment |
|
|
210
|
+
| `testver deploy logs` | View deployment logs |
|
|
211
|
+
| `testver --version` | Show version |
|
|
212
|
+
| `testver --help` | Show help |
|
|
213
|
+
|
|
214
|
+
## Interactive CLI Commands
|
|
215
|
+
|
|
216
|
+
| Command | Description |
|
|
217
|
+
|---|---|
|
|
218
|
+
| `/ui` | Open web dashboard in browser |
|
|
219
|
+
| `/results` | View latest test results |
|
|
220
|
+
| `/git` | Git status and operations |
|
|
221
|
+
| `help` | Show all available commands |
|
|
222
|
+
|
|
223
|
+
## Project Structure
|
|
224
|
+
|
|
225
|
+
Testver works with any test project. It auto-detects:
|
|
226
|
+
|
|
227
|
+
```
|
|
228
|
+
your-test-project/
|
|
229
|
+
├── tests/ # Test files (auto-discovered)
|
|
230
|
+
├── page-objects/ # Page objects (analyzed by AI)
|
|
231
|
+
├── playwright.config.ts # Framework config (auto-detected)
|
|
232
|
+
├── .testver/ # Testver data (auto-created)
|
|
233
|
+
│ ├── testver.db # SQLite database
|
|
234
|
+
│ ├── config.json # Project config
|
|
235
|
+
│ └── results/ # Test run results
|
|
236
|
+
└── package.json
|
|
237
|
+
```
|
|
238
|
+
|
|
239
|
+
## System Requirements
|
|
240
|
+
|
|
241
|
+
| Requirement | Minimum | Recommended |
|
|
242
|
+
|---|---|---|
|
|
243
|
+
| **Node.js** | 20.0.0 | 22+ |
|
|
244
|
+
| **RAM** | 2 GB | 4 GB |
|
|
245
|
+
| **Disk** | 500 MB | 2 GB |
|
|
246
|
+
| **OS** | Windows 10+, macOS 12+, Ubuntu 20.04+ | Latest |
|
|
247
|
+
| **Docker** (for deploy) | 20.10+ | Latest |
|
|
248
|
+
|
|
249
|
+
## Environment Variables
|
|
250
|
+
|
|
251
|
+
| Variable | Description | Required |
|
|
252
|
+
|---|---|---|
|
|
253
|
+
| `OPENAI_API_KEY` | OpenAI API key | For AI features |
|
|
254
|
+
| `ANTHROPIC_API_KEY` | Anthropic API key | Alternative AI |
|
|
255
|
+
| `GOOGLE_API_KEY` | Google AI API key | Alternative AI |
|
|
256
|
+
| `XAI_API_KEY` | xAI API key | Alternative AI |
|
|
257
|
+
| `TESTVER_PORT` | Dashboard port (default: 3700) | No |
|
|
258
|
+
| `TESTVER_HOST` | Dashboard host (default: localhost) | No |
|
|
259
|
+
| `TESTVER_DEFAULT_PROVIDER` | Default LLM provider | No |
|
|
260
|
+
|
|
261
|
+
## FAQ
|
|
262
|
+
|
|
263
|
+
**Q: Does Testver modify my test files?**
|
|
264
|
+
A: Only when you explicitly ask AI to generate or fix tests. All changes require your approval.
|
|
265
|
+
|
|
266
|
+
**Q: Where is data stored?**
|
|
267
|
+
A: In `.testver/` directory inside your test project. SQLite database, config, and results.
|
|
268
|
+
|
|
269
|
+
**Q: Can I use it without AI?**
|
|
270
|
+
A: Yes! Test runner, management, and dashboard work without any AI provider. AI features are optional.
|
|
271
|
+
|
|
272
|
+
**Q: Is my data sent to the cloud?**
|
|
273
|
+
A: Only AI prompts go to your configured LLM provider (OpenAI/Anthropic/etc). All other data stays local.
|
|
274
|
+
|
|
275
|
+
**Q: Can multiple users access the dashboard?**
|
|
276
|
+
A: Yes! Use `testver serve --host 0.0.0.0` for network access, or `testver deploy docker` for team deployment.
|
|
277
|
+
|
|
278
|
+
**Q: Which browsers does it support?**
|
|
279
|
+
A: The dashboard works in Chrome, Firefox, Safari, and Edge. Test execution uses your project's configured browser.
|
|
280
|
+
|
|
281
|
+
## License
|
|
282
|
+
|
|
283
|
+
MIT
|
|
284
|
+
|
|
285
|
+
## Support
|
|
286
|
+
|
|
287
|
+
- **Issues**: [GitHub Issues](https://github.com/testver/testver/issues)
|
|
288
|
+
- **Documentation**: [docs.testver.io](https://docs.testver.io)
|
package/bin/testver.js
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
# ─── Testver Dashboard — Production Container ────────────────────────────────
|
|
2
|
+
#
|
|
3
|
+
# Installs Testver from npm (no source code needed)
|
|
4
|
+
#
|
|
5
|
+
# Usage:
|
|
6
|
+
# docker build -t testver/dashboard -f deploy/Dockerfile .
|
|
7
|
+
# docker run -d -p 3700:3700 -v /path/to/test-project:/project testver/dashboard
|
|
8
|
+
#
|
|
9
|
+
# Or via: testver deploy docker
|
|
10
|
+
|
|
11
|
+
FROM node:22-slim
|
|
12
|
+
|
|
13
|
+
# Install system dependencies
|
|
14
|
+
RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
15
|
+
curl git && rm -rf /var/lib/apt/lists/*
|
|
16
|
+
|
|
17
|
+
# Install Testver globally from npm
|
|
18
|
+
RUN npm install -g testver
|
|
19
|
+
|
|
20
|
+
# Install Playwright browsers for automation
|
|
21
|
+
RUN npx playwright install --with-deps chromium 2>/dev/null || true
|
|
22
|
+
|
|
23
|
+
# Create project mount point
|
|
24
|
+
RUN mkdir -p /project
|
|
25
|
+
WORKDIR /project
|
|
26
|
+
|
|
27
|
+
# Expose port
|
|
28
|
+
EXPOSE 3700
|
|
29
|
+
|
|
30
|
+
# Health check
|
|
31
|
+
HEALTHCHECK --interval=30s --timeout=5s --start-period=15s --retries=3 \
|
|
32
|
+
CMD curl -f http://localhost:3700/api/health || exit 1
|
|
33
|
+
|
|
34
|
+
# Environment
|
|
35
|
+
ENV TESTVER_HOST=0.0.0.0
|
|
36
|
+
ENV TESTVER_PORT=3700
|
|
37
|
+
ENV NODE_ENV=production
|
|
38
|
+
|
|
39
|
+
# Start Testver in serve mode
|
|
40
|
+
CMD ["testver", "serve", "--host", "0.0.0.0", "--port", "3700"]
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
# ─── Testver Dashboard — Docker Compose ───────────────────────────────────────
|
|
2
|
+
#
|
|
3
|
+
# Quick Start:
|
|
4
|
+
# cd deploy
|
|
5
|
+
# docker-compose up -d
|
|
6
|
+
#
|
|
7
|
+
# Access at: http://localhost:3700
|
|
8
|
+
#
|
|
9
|
+
# Configuration:
|
|
10
|
+
# - Mount your test project at /project
|
|
11
|
+
# - Testver data persists in the testver-data volume
|
|
12
|
+
# - Set environment variables for LLM API keys
|
|
13
|
+
#
|
|
14
|
+
# Commands:
|
|
15
|
+
# docker-compose up -d Start in background
|
|
16
|
+
# docker-compose logs -f View logs
|
|
17
|
+
# docker-compose down Stop
|
|
18
|
+
# docker-compose restart Restart
|
|
19
|
+
|
|
20
|
+
version: '3.8'
|
|
21
|
+
|
|
22
|
+
services:
|
|
23
|
+
testver:
|
|
24
|
+
build:
|
|
25
|
+
context: ..
|
|
26
|
+
dockerfile: deploy/Dockerfile
|
|
27
|
+
container_name: testver-dashboard
|
|
28
|
+
ports:
|
|
29
|
+
- "${TESTVER_PORT:-3700}:3700"
|
|
30
|
+
volumes:
|
|
31
|
+
# Mount your test project directory
|
|
32
|
+
- ${TEST_PROJECT_PATH:-.}:/project
|
|
33
|
+
# Persist Testver data (SQLite databases, config, etc.)
|
|
34
|
+
- testver-data:/project/.testver
|
|
35
|
+
environment:
|
|
36
|
+
# Server
|
|
37
|
+
- TESTVER_HOST=0.0.0.0
|
|
38
|
+
- TESTVER_PORT=3700
|
|
39
|
+
- NODE_ENV=production
|
|
40
|
+
# LLM Provider API Keys (set in .env or pass directly)
|
|
41
|
+
- OPENAI_API_KEY=${OPENAI_API_KEY:-}
|
|
42
|
+
- ANTHROPIC_API_KEY=${ANTHROPIC_API_KEY:-}
|
|
43
|
+
- GOOGLE_API_KEY=${GOOGLE_API_KEY:-}
|
|
44
|
+
- XAI_API_KEY=${XAI_API_KEY:-}
|
|
45
|
+
# Default provider
|
|
46
|
+
- TESTVER_DEFAULT_PROVIDER=${TESTVER_DEFAULT_PROVIDER:-openai}
|
|
47
|
+
restart: unless-stopped
|
|
48
|
+
healthcheck:
|
|
49
|
+
test: ["CMD", "curl", "-f", "http://localhost:3700/api/health"]
|
|
50
|
+
interval: 30s
|
|
51
|
+
timeout: 5s
|
|
52
|
+
retries: 3
|
|
53
|
+
start_period: 15s
|
|
54
|
+
|
|
55
|
+
volumes:
|
|
56
|
+
testver-data:
|
|
57
|
+
driver: local
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
# ─── Testver Dashboard — Nginx Reverse Proxy Configuration ───────────────────
|
|
2
|
+
#
|
|
3
|
+
# This configuration puts Testver behind Nginx with:
|
|
4
|
+
# - SSL/TLS (HTTPS) via Let's Encrypt
|
|
5
|
+
# - WebSocket support (required for real-time updates)
|
|
6
|
+
# - Gzip compression
|
|
7
|
+
# - Security headers
|
|
8
|
+
# - Rate limiting
|
|
9
|
+
#
|
|
10
|
+
# Setup Steps:
|
|
11
|
+
# 1. Copy this file to /etc/nginx/sites-available/testver
|
|
12
|
+
# 2. Create symlink: ln -s /etc/nginx/sites-available/testver /etc/nginx/sites-enabled/
|
|
13
|
+
# 3. Replace 'testver.yourcompany.com' with your actual domain
|
|
14
|
+
# 4. Get SSL certificate: sudo certbot --nginx -d testver.yourcompany.com
|
|
15
|
+
# 5. Test config: sudo nginx -t
|
|
16
|
+
# 6. Reload: sudo systemctl reload nginx
|
|
17
|
+
|
|
18
|
+
# Rate limiting zone
|
|
19
|
+
limit_req_zone $binary_remote_addr zone=testver_api:10m rate=30r/s;
|
|
20
|
+
limit_req_zone $binary_remote_addr zone=testver_web:10m rate=50r/s;
|
|
21
|
+
|
|
22
|
+
# Upstream — Testver server
|
|
23
|
+
upstream testver_backend {
|
|
24
|
+
server 127.0.0.1:3700;
|
|
25
|
+
keepalive 32;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
# HTTP → HTTPS redirect
|
|
29
|
+
server {
|
|
30
|
+
listen 80;
|
|
31
|
+
listen [::]:80;
|
|
32
|
+
server_name testver.yourcompany.com;
|
|
33
|
+
return 301 https://$host$request_uri;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
# HTTPS server
|
|
37
|
+
server {
|
|
38
|
+
listen 443 ssl http2;
|
|
39
|
+
listen [::]:443 ssl http2;
|
|
40
|
+
server_name testver.yourcompany.com;
|
|
41
|
+
|
|
42
|
+
# ── SSL Configuration ─────────────────────────────────────────────────
|
|
43
|
+
# Managed by Certbot (auto-generated after running certbot)
|
|
44
|
+
ssl_certificate /etc/letsencrypt/live/testver.yourcompany.com/fullchain.pem;
|
|
45
|
+
ssl_certificate_key /etc/letsencrypt/live/testver.yourcompany.com/privkey.pem;
|
|
46
|
+
ssl_protocols TLSv1.2 TLSv1.3;
|
|
47
|
+
ssl_ciphers ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384;
|
|
48
|
+
ssl_prefer_server_ciphers off;
|
|
49
|
+
ssl_session_cache shared:SSL:10m;
|
|
50
|
+
ssl_session_timeout 1d;
|
|
51
|
+
ssl_session_tickets off;
|
|
52
|
+
|
|
53
|
+
# ── Security Headers ──────────────────────────────────────────────────
|
|
54
|
+
add_header X-Frame-Options "SAMEORIGIN" always;
|
|
55
|
+
add_header X-Content-Type-Options "nosniff" always;
|
|
56
|
+
add_header X-XSS-Protection "1; mode=block" always;
|
|
57
|
+
add_header Referrer-Policy "strict-origin-when-cross-origin" always;
|
|
58
|
+
add_header Strict-Transport-Security "max-age=63072000; includeSubDomains" always;
|
|
59
|
+
|
|
60
|
+
# ── Gzip Compression ─────────────────────────────────────────────────
|
|
61
|
+
gzip on;
|
|
62
|
+
gzip_vary on;
|
|
63
|
+
gzip_proxied any;
|
|
64
|
+
gzip_comp_level 6;
|
|
65
|
+
gzip_types text/plain text/css application/json application/javascript text/xml application/xml text/javascript image/svg+xml;
|
|
66
|
+
|
|
67
|
+
# ── Client Settings ───────────────────────────────────────────────────
|
|
68
|
+
client_max_body_size 50M; # For file uploads (attachments, screenshots)
|
|
69
|
+
|
|
70
|
+
# ── API Routes ────────────────────────────────────────────────────────
|
|
71
|
+
location /api/ {
|
|
72
|
+
limit_req zone=testver_api burst=50 nodelay;
|
|
73
|
+
|
|
74
|
+
proxy_pass http://testver_backend;
|
|
75
|
+
proxy_http_version 1.1;
|
|
76
|
+
proxy_set_header Host $host;
|
|
77
|
+
proxy_set_header X-Real-IP $remote_addr;
|
|
78
|
+
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
79
|
+
proxy_set_header X-Forwarded-Proto $scheme;
|
|
80
|
+
|
|
81
|
+
# Timeouts for long-running AI operations
|
|
82
|
+
proxy_read_timeout 300s;
|
|
83
|
+
proxy_send_timeout 300s;
|
|
84
|
+
proxy_connect_timeout 60s;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
# ── WebSocket Support (required for real-time updates) ────────────────
|
|
88
|
+
location /ws {
|
|
89
|
+
proxy_pass http://testver_backend;
|
|
90
|
+
proxy_http_version 1.1;
|
|
91
|
+
proxy_set_header Upgrade $http_upgrade;
|
|
92
|
+
proxy_set_header Connection "upgrade";
|
|
93
|
+
proxy_set_header Host $host;
|
|
94
|
+
proxy_set_header X-Real-IP $remote_addr;
|
|
95
|
+
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
96
|
+
proxy_set_header X-Forwarded-Proto $scheme;
|
|
97
|
+
|
|
98
|
+
# WebSocket timeout — keep connection alive
|
|
99
|
+
proxy_read_timeout 86400s;
|
|
100
|
+
proxy_send_timeout 86400s;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
# ── Health Check (for monitoring) ─────────────────────────────────────
|
|
104
|
+
location /api/health {
|
|
105
|
+
proxy_pass http://testver_backend;
|
|
106
|
+
proxy_http_version 1.1;
|
|
107
|
+
proxy_set_header Host $host;
|
|
108
|
+
access_log off; # Don't log health checks
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
# ── Static Assets (React SPA) ────────────────────────────────────────
|
|
112
|
+
location / {
|
|
113
|
+
limit_req zone=testver_web burst=100 nodelay;
|
|
114
|
+
|
|
115
|
+
proxy_pass http://testver_backend;
|
|
116
|
+
proxy_http_version 1.1;
|
|
117
|
+
proxy_set_header Host $host;
|
|
118
|
+
proxy_set_header X-Real-IP $remote_addr;
|
|
119
|
+
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
120
|
+
proxy_set_header X-Forwarded-Proto $scheme;
|
|
121
|
+
|
|
122
|
+
# Cache static assets
|
|
123
|
+
location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg|woff|woff2|ttf|eot)$ {
|
|
124
|
+
proxy_pass http://testver_backend;
|
|
125
|
+
proxy_cache_valid 200 7d;
|
|
126
|
+
add_header Cache-Control "public, max-age=604800, immutable";
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
# ── Error Pages ───────────────────────────────────────────────────────
|
|
131
|
+
error_page 502 503 504 /50x.html;
|
|
132
|
+
location = /50x.html {
|
|
133
|
+
root /usr/share/nginx/html;
|
|
134
|
+
internal;
|
|
135
|
+
}
|
|
136
|
+
}
|
package/dist/index.d.ts
ADDED