docs: remove management system, update docs and disable integration
This commit is contained in:
parent
83d345075b
commit
0abc1442cb
@ -7,7 +7,11 @@ Das Tag-System ermöglicht es, benutzerdefinierte Tags zu erstellen und per REST
|
|||||||
|
|
||||||
### Tags auflisten
|
### Tags auflisten
|
||||||
```
|
```
|
||||||
GET http://localhost:3000/api/tags
|
## Hinweis
|
||||||
|
|
||||||
|
Die in früheren Versionen vorhandene Management-Weboberfläche (Port 3000) und die zugehörigen internen REST-APIs wurden entfernt. Die folgenden Management-APIs sind ohne diese Komponente nicht verfügbar.
|
||||||
|
|
||||||
|
Wenn Sie ähnliche Funktionen benötigen, implementieren Sie bitte separate Endpunkte in Ihrem eigenen Service oder re-integrieren Sie ein Management-Modul.
|
||||||
```
|
```
|
||||||
|
|
||||||
### Neuen Tag erstellen
|
### Neuen Tag erstellen
|
||||||
@ -56,7 +60,9 @@ DELETE http://localhost:3000/api/tags/{id}
|
|||||||
|
|
||||||
### Alle verfügbaren Tags auflisten
|
### Alle verfügbaren Tags auflisten
|
||||||
```
|
```
|
||||||
GET http://localhost:3000/api/public/tags
|
## Externe REST APIs
|
||||||
|
|
||||||
|
Die externen Management-APIs sind nicht Teil dieses Kern-Servers. Falls benötigt, schreiben Sie bitte eine separate Management-API, die mit diesem Server kommuniziert.
|
||||||
|
|
||||||
Response:
|
Response:
|
||||||
[
|
[
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
# DOCX Template Server
|
# DOCX Template Server
|
||||||
|
|
||||||
Ein Node.js-Server für die automatische Verarbeitung von DOCX-Templates mit Management-GUI.
|
Ein Node.js-Server für die automatische Verarbeitung von DOCX-Templates.
|
||||||
|
|
||||||
## ✨ Features
|
## ✨ Features
|
||||||
|
|
||||||
@ -27,7 +27,6 @@ npm start
|
|||||||
|
|
||||||
### 🌐 **Web-Zugriff:**
|
### 🌐 **Web-Zugriff:**
|
||||||
- **Server:** http://localhost:80/
|
- **Server:** http://localhost:80/
|
||||||
- **Management:** http://localhost:3000/
|
|
||||||
- **Templates:** http://localhost:80/templates/
|
- **Templates:** http://localhost:80/templates/
|
||||||
- **Dokumente:** http://localhost:80/documents/
|
- **Dokumente:** http://localhost:80/documents/
|
||||||
|
|
||||||
|
|||||||
90
server.js
90
server.js
@ -12,31 +12,9 @@ const { faker } = require('@faker-js/faker');
|
|||||||
const app = express();
|
const app = express();
|
||||||
const PORT = process.env.PORT || 80;
|
const PORT = process.env.PORT || 80;
|
||||||
|
|
||||||
// Management-System Integration (falls verfügbar)
|
// Management-System Integration removed. Management-related features are disabled.
|
||||||
let DataSourceManager, CustomTagProcessor;
|
let DataSourceManager = null, CustomTagProcessor = null;
|
||||||
try {
|
const managementConfig = null;
|
||||||
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();
|
|
||||||
|
|
||||||
// Middleware
|
// Middleware
|
||||||
app.use(helmet());
|
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
|
// SSL-Unterstützung
|
||||||
if (fs.existsSync(path.join(__dirname, '203_cert.pem')) && fs.existsSync(path.join(__dirname, '203_key.pem'))) {
|
if (fs.existsSync(path.join(__dirname, '203_cert.pem')) && fs.existsSync(path.join(__dirname, '203_key.pem'))) {
|
||||||
try {
|
try {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user