Compare commits

...

2 Commits

Author SHA1 Message Date
samanhappy
9300814994 Add .git to .dockerignore to prevent Git files from being included in Docker builds (#290) 2025-08-24 15:37:38 +08:00
Rilomilo
9952927a13 remove redundant code (#288) 2025-08-24 11:40:33 +08:00
3 changed files with 1 additions and 32 deletions

1
.dockerignore Normal file
View File

@@ -0,0 +1 @@
.git

View File

@@ -2,7 +2,6 @@ import express, { Request, Response, NextFunction } from 'express';
import { auth } from './auth.js';
import { userContextMiddleware } from './userContext.js';
import { i18nMiddleware } from './i18n.js';
import { initializeDefaultUser } from '../models/User.js';
import config from '../config/index.js';
export const errorHandler = (
@@ -46,11 +45,6 @@ export const initMiddlewares = (app: express.Application): void => {
}
});
// Initialize default admin user if no users exist
initializeDefaultUser().catch((err) => {
console.error('Error initializing default user:', err);
});
// Protect API routes with authentication middleware, but exclude auth endpoints
app.use(`${config.basePath}/api`, (req, res, next) => {
// Skip authentication for login endpoint

View File

@@ -685,32 +685,6 @@ export const removeServer = (name: string): { success: boolean; message?: string
}
};
// Update existing server
export const updateMcpServer = async (
name: string,
config: ServerConfig,
): Promise<{ success: boolean; message?: string }> => {
try {
const settings = loadSettings();
if (!settings.mcpServers[name]) {
return { success: false, message: 'Server not found' };
}
settings.mcpServers[name] = config;
if (!saveSettings(settings)) {
return { success: false, message: 'Failed to save settings' };
}
closeServer(name);
serverInfos = serverInfos.filter((serverInfo) => serverInfo.name !== name);
return { success: true, message: 'Server updated successfully' };
} catch (error) {
console.error(`Failed to update server: ${name}`, error);
return { success: false, message: 'Failed to update server' };
}
};
// Add or update server (supports overriding existing servers for DXT)
export const addOrUpdateServer = async (
name: string,