feat: 1.5.0 prep — API v1 cutover, LICENSE, CHANGELOG, CI
- Remove legacy /api/ mount; all routes now under /api/v1/ only - Update path matchers (CSRF excludes, public routes, audit log, rate limits) - Move standalone routes (/api/network/ips, /api/docs, /api/docs/spec) to v1 - Update openapi.yaml (110 paths), CA pages, and 4 lingering frontend files - Add LICENSE (proprietary EULA), CHANGELOG.md (Keep a Changelog format) - Add .gitea/workflows/ci.yml (test+lint and security audit jobs) - Fix 9 pre-existing no-empty lint errors so CI starts green - Drop ad-hoc scratch reports and *.bak files from repo root All 739 jest tests pass. Lint is clean. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -446,9 +446,8 @@ async function createApp() {
|
||||
res.json({ success: true, metrics: metrics.getSummary() });
|
||||
});
|
||||
|
||||
// Mount at /api/v1 (canonical) and /api (legacy)
|
||||
// Mount at /api/v1 (canonical, single version)
|
||||
app.use('/api/v1', apiRouter);
|
||||
app.use('/api', apiRouter);
|
||||
|
||||
// Root-level health check
|
||||
app.get('/health', (req, res) => {
|
||||
@@ -548,7 +547,7 @@ async function createApp() {
|
||||
}, 'probe'));
|
||||
|
||||
// Network IPs endpoint
|
||||
app.get('/api/network/ips', (req, res) => {
|
||||
app.get('/api/v1/network/ips', (req, res) => {
|
||||
try {
|
||||
const os = require('os');
|
||||
const envLan = process.env.HOST_LAN_IP;
|
||||
@@ -585,7 +584,7 @@ async function createApp() {
|
||||
});
|
||||
|
||||
// API Documentation
|
||||
app.get('/api/docs', (req, res) => {
|
||||
app.get('/api/v1/docs', (req, res) => {
|
||||
res.setHeader('Content-Security-Policy', "default-src 'self'; script-src 'self' 'unsafe-inline' https://unpkg.com; style-src 'self' 'unsafe-inline' https://unpkg.com; img-src 'self' data: https:; connect-src 'self'; font-src 'self' data: https://unpkg.com;");
|
||||
res.send(`<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
@@ -598,12 +597,12 @@ async function createApp() {
|
||||
<body>
|
||||
<div id="swagger-ui"></div>
|
||||
<script src="https://unpkg.com/swagger-ui-dist@5/swagger-ui-bundle.js"></script>
|
||||
<script>SwaggerUIBundle({url:'/api/docs/spec',dom_id:'#swagger-ui',deepLinking:true})</script>
|
||||
<script>SwaggerUIBundle({url:'/api/v1/docs/spec',dom_id:'#swagger-ui',deepLinking:true})</script>
|
||||
</body>
|
||||
</html>`);
|
||||
});
|
||||
|
||||
app.get('/api/docs/spec', boundAsyncHandler(async (req, res) => {
|
||||
app.get('/api/v1/docs/spec', boundAsyncHandler(async (req, res) => {
|
||||
const path = require('path');
|
||||
const { exists } = require('../fs-helpers');
|
||||
const fsp = require('fs').promises;
|
||||
|
||||
Reference in New Issue
Block a user