docs: remove management system, update docs and disable integration
This commit is contained in:
90
server.js
90
server.js
@@ -12,31 +12,9 @@ const { faker } = require('@faker-js/faker');
|
||||
const app = express();
|
||||
const PORT = process.env.PORT || 80;
|
||||
|
||||
// Management-System Integration (falls verfügbar)
|
||||
let DataSourceManager, CustomTagProcessor;
|
||||
try {
|
||||
const managementModules = require('./management/data-sources');
|
||||
DataSourceManager = managementModules.DataSourceManager;
|
||||
CustomTagProcessor = managementModules.CustomTagProcessor;
|
||||
console.log('✅ Management-System Integration geladen');
|
||||
} catch (error) {
|
||||
console.log('ℹ️ Management-System nicht verfügbar (optional)');
|
||||
}
|
||||
|
||||
// Konfiguration laden
|
||||
function loadManagementConfig() {
|
||||
try {
|
||||
const configPath = path.join(__dirname, 'management', 'config.json');
|
||||
if (fs.existsSync(configPath)) {
|
||||
return JSON.parse(fs.readFileSync(configPath, 'utf8'));
|
||||
}
|
||||
} catch (error) {
|
||||
console.log('ℹ️ Management-Konfiguration nicht verfügbar');
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
const managementConfig = loadManagementConfig();
|
||||
// Management-System Integration removed. Management-related features are disabled.
|
||||
let DataSourceManager = null, CustomTagProcessor = null;
|
||||
const managementConfig = null;
|
||||
|
||||
// Middleware
|
||||
app.use(helmet());
|
||||
@@ -777,6 +755,68 @@ app.get('/create-test-template', (req, res) => {
|
||||
}
|
||||
});
|
||||
|
||||
// API für Management-Server Integration
|
||||
app.get('/api/status', (req, res) => {
|
||||
const uptime = process.uptime();
|
||||
res.json({
|
||||
success: true,
|
||||
status: 'running',
|
||||
uptime: Math.floor(uptime),
|
||||
uptimeString: `${Math.floor(uptime / 3600)}h ${Math.floor((uptime % 3600) / 60)}m ${Math.floor(uptime % 60)}s`,
|
||||
templateCount: fs.existsSync(templateDir) ? fs.readdirSync(templateDir).length : 0,
|
||||
documentCount: fs.existsSync(outputDir) ? fs.readdirSync(outputDir).length : 0,
|
||||
customTagsEnabled: managementConfig && managementConfig.customTags ?
|
||||
managementConfig.customTags.filter(tag => tag.enabled).length : 0,
|
||||
ssl: fs.existsSync(path.join(__dirname, '203_cert.pem')) && fs.existsSync(path.join(__dirname, '203_key.pem')),
|
||||
version: '1.0.0'
|
||||
});
|
||||
});
|
||||
|
||||
app.get('/api/config', (req, res) => {
|
||||
res.json({
|
||||
success: true,
|
||||
config: {
|
||||
templateDir: templateDir,
|
||||
outputDir: outputDir,
|
||||
ssl: fs.existsSync(path.join(__dirname, '203_cert.pem')) && fs.existsSync(path.join(__dirname, '203_key.pem')),
|
||||
managementIntegration: !!managementConfig,
|
||||
customTags: managementConfig ? managementConfig.customTags || [] : [],
|
||||
dataSources: managementConfig ? managementConfig.dataSources || [] : []
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
app.delete('/api/templates/:filename', (req, res) => {
|
||||
try {
|
||||
const filename = req.params.filename;
|
||||
const filePath = path.join(templateDir, filename);
|
||||
|
||||
if (!fs.existsSync(filePath)) {
|
||||
return res.status(404).json({ success: false, message: 'Template nicht gefunden' });
|
||||
}
|
||||
|
||||
fs.unlinkSync(filePath);
|
||||
res.json({ success: true, message: 'Template gelöscht' });
|
||||
} catch (error) {
|
||||
res.status(500).json({ success: false, message: 'Fehler beim Löschen: ' + error.message });
|
||||
}
|
||||
});
|
||||
|
||||
app.get('/api/templates/:filename/download', (req, res) => {
|
||||
try {
|
||||
const filename = req.params.filename;
|
||||
const filePath = path.join(templateDir, filename);
|
||||
|
||||
if (!fs.existsSync(filePath)) {
|
||||
return res.status(404).json({ success: false, message: 'Template nicht gefunden' });
|
||||
}
|
||||
|
||||
res.download(filePath);
|
||||
} catch (error) {
|
||||
res.status(500).json({ success: false, message: 'Download-Fehler: ' + error.message });
|
||||
}
|
||||
});
|
||||
|
||||
// SSL-Unterstützung
|
||||
if (fs.existsSync(path.join(__dirname, '203_cert.pem')) && fs.existsSync(path.join(__dirname, '203_key.pem'))) {
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user