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:
@@ -59,7 +59,7 @@ async function makeRequest(url, options = {}) {
|
||||
}
|
||||
|
||||
// Get current Caddy configuration
|
||||
app.get('/api/caddy/config', async (req, res) => {
|
||||
app.get('/api/v1/caddy/config', async (req, res) => {
|
||||
try {
|
||||
const response = await makeRequest(`${CADDY_ADMIN_API}/config/`);
|
||||
|
||||
@@ -85,7 +85,7 @@ app.get('/api/caddy/config', async (req, res) => {
|
||||
});
|
||||
|
||||
// Get list of services (from apps.json + custom apps)
|
||||
app.get('/api/services', async (req, res) => {
|
||||
app.get('/api/v1/services', async (req, res) => {
|
||||
try {
|
||||
const servicesPath = path.join(__dirname, '../apps.json');
|
||||
|
||||
@@ -184,7 +184,7 @@ async function addCaddyRoute(domain, upstreamUrl, useTls = true) {
|
||||
}
|
||||
|
||||
// Deploy app endpoint - handles DNS and Caddy configuration via APIs
|
||||
app.post('/api/apps/deploy', async (req, res) => {
|
||||
app.post('/api/v1/apps/deploy', async (req, res) => {
|
||||
try {
|
||||
const { appId, config } = req.body;
|
||||
const { subdomain, ip, createDns, port, sslType, dnsType } = config;
|
||||
@@ -264,7 +264,7 @@ app.post('/api/apps/deploy', async (req, res) => {
|
||||
});
|
||||
|
||||
// Delete app endpoint - removes DNS and Caddy configuration
|
||||
app.post('/api/apps/delete', async (req, res) => {
|
||||
app.post('/api/v1/apps/delete', async (req, res) => {
|
||||
try {
|
||||
const { domain, ip } = req.body;
|
||||
|
||||
@@ -324,7 +324,7 @@ app.post('/api/apps/delete', async (req, res) => {
|
||||
});
|
||||
|
||||
// Test endpoint
|
||||
app.get('/api/caddy/test', (req, res) => {
|
||||
app.get('/api/v1/caddy/test', (req, res) => {
|
||||
res.json({
|
||||
status: 'success',
|
||||
message: 'Caddy API is running',
|
||||
|
||||
@@ -38,7 +38,7 @@ async function runTests() {
|
||||
// Test 2: API Test Endpoint
|
||||
console.log('\n2. Testing API test endpoint...');
|
||||
try {
|
||||
const test = await makeRequest('/api/caddy/test');
|
||||
const test = await makeRequest('/api/v1/caddy/test');
|
||||
if (test.status === 200) {
|
||||
console.log(' ✓ API test passed');
|
||||
console.log(' Platform:', test.data.platform);
|
||||
@@ -55,7 +55,7 @@ async function runTests() {
|
||||
// Test 3: Services Endpoint
|
||||
console.log('\n3. Testing services endpoint...');
|
||||
try {
|
||||
const services = await makeRequest('/api/services');
|
||||
const services = await makeRequest('/api/v1/services');
|
||||
if (services.status === 200) {
|
||||
console.log(' ✓ Services endpoint passed');
|
||||
console.log(' Found', services.data.services.length, 'services');
|
||||
|
||||
Reference in New Issue
Block a user