tickt db übernahme
This commit is contained in:
@@ -4,7 +4,8 @@ SESSION_COOKIE_NAME=webklar_portal_session
|
|||||||
|
|
||||||
APPWRITE_ENDPOINT=https://ticket.webklar.com/v1
|
APPWRITE_ENDPOINT=https://ticket.webklar.com/v1
|
||||||
APPWRITE_PROJECT_ID=6a1058610003c5a13a05
|
APPWRITE_PROJECT_ID=6a1058610003c5a13a05
|
||||||
APPWRITE_DATABASE_ID=woms-database
|
# Fest: nur woms-database (Ticketsystem). Wird bei abweichendem Wert ignoriert.
|
||||||
|
# APPWRITE_DATABASE_ID=woms-database
|
||||||
APPWRITE_API_KEY=
|
APPWRITE_API_KEY=
|
||||||
|
|
||||||
APPWRITE_COLLECTION_CUSTOMERS=customers
|
APPWRITE_COLLECTION_CUSTOMERS=customers
|
||||||
|
|||||||
@@ -1,10 +1,12 @@
|
|||||||
# Appwrite Schema – Kundenportal (woms-database)
|
# Appwrite Schema – Kundenportal (woms-database)
|
||||||
|
|
||||||
|
**Nur diese Datenbank** – keine separate Portal-Datenbank (`appwrite.webklar.com` / Legacy-IDs wie `6943bf0e0003291f8c35` werden nicht verwendet).
|
||||||
|
|
||||||
Endpoint: `https://ticket.webklar.com/v1`
|
Endpoint: `https://ticket.webklar.com/v1`
|
||||||
Project ID: `6a1058610003c5a13a05`
|
Project ID: `6a1058610003c5a13a05`
|
||||||
Database ID: `woms-database`
|
Database ID: **`woms-database`** (fest im Code)
|
||||||
|
|
||||||
Alle Collections: **Read/Create/Update/Delete** nur für API-Key-Rolle (Server) und Admin-Team. Kein `Any`-Read auf Kundendaten.
|
Alle Collections liegen in `woms-database`. **Read/Create/Update/Delete** nur für API-Key-Rolle (Server) und Admin-Team. Kein `Any`-Read auf Kundendaten.
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
# Webklar Kundenbereich
|
# Webklar Kundenbereich
|
||||||
|
|
||||||
Kundenportal für Website-Projekte. Liest ausschließlich aus der **zentralen Appwrite-Datenbank des Ticketsystems** (`woms-database` auf `ticket.webklar.com`).
|
Kundenportal für Website-Projekte. Liest **ausschließlich** aus `woms-database` auf `ticket.webklar.com` (Ticketsystem). Es gibt **keine** eigene Portal-Datenbank mehr.
|
||||||
|
|
||||||
- **Keine** Kundenanlage im Portal
|
- **Keine** Kundenanlage im Portal
|
||||||
- **Keine** Admin-Funktionen
|
- **Keine** Admin-Funktionen
|
||||||
|
|||||||
@@ -1,13 +0,0 @@
|
|||||||
<!DOCTYPE html>
|
|
||||||
<html>
|
|
||||||
<head>
|
|
||||||
<meta charset="UTF-8">
|
|
||||||
<title> Downloads </title>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<h1> Downloads </h1>
|
|
||||||
<ul>
|
|
||||||
<li><a id="https://project.webklar.com/login" href="login.html"> Anmelden <20> Webklar Kundenbereich </a></li>
|
|
||||||
</ul>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
@@ -1,15 +0,0 @@
|
|||||||
<!DOCTYPE html>
|
|
||||||
<html lang="de">
|
|
||||||
<head>
|
|
||||||
<meta charset="utf-8">
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
||||||
<title>Passwort vergessen <20> Webklar Kundenbereich</title>
|
|
||||||
<link rel="stylesheet" href="style.css">
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<header><h1>Webklar Kundenbereich</h1></header>
|
|
||||||
<main><p class="card">Bitte wenden Sie sich an Webklar oder nutzen Sie die Appwrite-Passwort-Wiederherstellung unter
|
|
||||||
<a href="https://appwrite.webklar.com/console">Appwrite Console</a>.</p>
|
|
||||||
<p><a href="login.html">Zur<EFBFBD>ck zum Login</a></p></main>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
@@ -1,20 +0,0 @@
|
|||||||
<!DOCTYPE html>
|
|
||||||
<html lang="de">
|
|
||||||
<head>
|
|
||||||
<meta charset="utf-8">
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
||||||
<title>Anmelden <20> Webklar Kundenbereich</title>
|
|
||||||
<link rel="stylesheet" href="style.css">
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<header><h1>Webklar Kundenbereich</h1></header>
|
|
||||||
<main>
|
|
||||||
<form method="post" action="login.html" class="card">
|
|
||||||
|
|
||||||
<label>E-Mail <input type="email" name="email" required></label>
|
|
||||||
<label>Passwort <input type="password" name="password" required></label>
|
|
||||||
<button type="submit">Anmelden</button>
|
|
||||||
</form>
|
|
||||||
<p><a href="forgot-password.html">Passwort vergessen</a></p></main>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
@@ -1,57 +0,0 @@
|
|||||||
:root {
|
|
||||||
--bg: #0f1419;
|
|
||||||
--card: #1a2332;
|
|
||||||
--text: #e7ecf3;
|
|
||||||
--accent: #3b82f6;
|
|
||||||
--muted: #94a3b8;
|
|
||||||
}
|
|
||||||
|
|
||||||
* { box-sizing: border-box; }
|
|
||||||
body {
|
|
||||||
font-family: system-ui, -apple-system, sans-serif;
|
|
||||||
background: var(--bg);
|
|
||||||
color: var(--text);
|
|
||||||
margin: 0;
|
|
||||||
line-height: 1.5;
|
|
||||||
}
|
|
||||||
header {
|
|
||||||
padding: 1rem 2rem;
|
|
||||||
border-bottom: 1px solid #2d3a4f;
|
|
||||||
display: flex;
|
|
||||||
justify-content: space-between;
|
|
||||||
align-items: center;
|
|
||||||
}
|
|
||||||
header h1 { margin: 0; font-size: 1.25rem; }
|
|
||||||
nav a { color: var(--accent); margin-left: 1rem; text-decoration: none; }
|
|
||||||
main { max-width: 900px; margin: 2rem auto; padding: 0 1.5rem; }
|
|
||||||
.card, .project-card {
|
|
||||||
background: var(--card);
|
|
||||||
border-radius: 8px;
|
|
||||||
padding: 1.25rem;
|
|
||||||
margin-bottom: 1rem;
|
|
||||||
}
|
|
||||||
label { display: block; margin-bottom: 0.75rem; }
|
|
||||||
input, textarea, select {
|
|
||||||
width: 100%;
|
|
||||||
padding: 0.5rem;
|
|
||||||
margin-top: 0.25rem;
|
|
||||||
border-radius: 4px;
|
|
||||||
border: 1px solid #334155;
|
|
||||||
background: #0f172a;
|
|
||||||
color: var(--text);
|
|
||||||
}
|
|
||||||
button, .btn {
|
|
||||||
background: var(--accent);
|
|
||||||
color: #fff;
|
|
||||||
border: none;
|
|
||||||
padding: 0.5rem 1rem;
|
|
||||||
border-radius: 4px;
|
|
||||||
cursor: pointer;
|
|
||||||
text-decoration: none;
|
|
||||||
display: inline-block;
|
|
||||||
}
|
|
||||||
.error { color: #f87171; }
|
|
||||||
.projects { list-style: none; padding: 0; }
|
|
||||||
table { width: 100%; border-collapse: collapse; }
|
|
||||||
td, th { padding: 0.5rem; border-bottom: 1px solid #334155; text-align: left; }
|
|
||||||
form.inline { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; }
|
|
||||||
@@ -1,5 +1,27 @@
|
|||||||
import 'dotenv/config'
|
import 'dotenv/config'
|
||||||
|
|
||||||
|
/** Einzige erlaubte Datenbank (Ticketsystem). Keine separate Portal-DB mehr. */
|
||||||
|
export const WOMS_DATABASE_ID = 'woms-database'
|
||||||
|
|
||||||
|
const DEPRECATED_DATABASE_IDS = new Set([
|
||||||
|
'6943bf0e0003291f8c35', // frühere Portal-/Legacy-DB
|
||||||
|
])
|
||||||
|
|
||||||
|
function resolveDatabaseId() {
|
||||||
|
const fromEnv = (process.env.APPWRITE_DATABASE_ID || '').trim()
|
||||||
|
if (!fromEnv || fromEnv === WOMS_DATABASE_ID) return WOMS_DATABASE_ID
|
||||||
|
if (DEPRECATED_DATABASE_IDS.has(fromEnv)) {
|
||||||
|
console.warn(
|
||||||
|
`[config] Veraltete APPWRITE_DATABASE_ID "${fromEnv}" – es wird nur ${WOMS_DATABASE_ID} verwendet.`
|
||||||
|
)
|
||||||
|
return WOMS_DATABASE_ID
|
||||||
|
}
|
||||||
|
console.warn(
|
||||||
|
`[config] APPWRITE_DATABASE_ID="${fromEnv}" ignoriert – Portal nutzt ausschließlich ${WOMS_DATABASE_ID}.`
|
||||||
|
)
|
||||||
|
return WOMS_DATABASE_ID
|
||||||
|
}
|
||||||
|
|
||||||
export const config = {
|
export const config = {
|
||||||
port: Number(process.env.PORT) || 3000,
|
port: Number(process.env.PORT) || 3000,
|
||||||
sessionSecret: process.env.SESSION_SECRET || '',
|
sessionSecret: process.env.SESSION_SECRET || '',
|
||||||
@@ -12,7 +34,7 @@ export const config = {
|
|||||||
appwrite: {
|
appwrite: {
|
||||||
endpoint: process.env.APPWRITE_ENDPOINT || 'https://ticket.webklar.com/v1',
|
endpoint: process.env.APPWRITE_ENDPOINT || 'https://ticket.webklar.com/v1',
|
||||||
projectId: process.env.APPWRITE_PROJECT_ID || '6a1058610003c5a13a05',
|
projectId: process.env.APPWRITE_PROJECT_ID || '6a1058610003c5a13a05',
|
||||||
databaseId: process.env.APPWRITE_DATABASE_ID || 'woms-database',
|
databaseId: resolveDatabaseId(),
|
||||||
apiKey: process.env.APPWRITE_API_KEY || '',
|
apiKey: process.env.APPWRITE_API_KEY || '',
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import express from 'express'
|
import express from 'express'
|
||||||
import path from 'node:path'
|
import path from 'node:path'
|
||||||
import { fileURLToPath } from 'node:url'
|
import { fileURLToPath } from 'node:url'
|
||||||
import { config, assertServerConfig } from './config.js'
|
import { config, assertServerConfig, WOMS_DATABASE_ID } from './config.js'
|
||||||
import { sessionMiddleware } from './middleware/session.js'
|
import { sessionMiddleware } from './middleware/session.js'
|
||||||
import authRoutes from './routes/auth.js'
|
import authRoutes from './routes/auth.js'
|
||||||
import projectsRoutes from './routes/projects.js'
|
import projectsRoutes from './routes/projects.js'
|
||||||
@@ -23,7 +23,12 @@ app.use('/api/features', featuresRoutes)
|
|||||||
app.use('/webhook', giteaWebhookRoutes)
|
app.use('/webhook', giteaWebhookRoutes)
|
||||||
|
|
||||||
app.get('/api/health', (_req, res) => {
|
app.get('/api/health', (_req, res) => {
|
||||||
res.json({ ok: true, service: 'webklar-kundenbereich' })
|
res.json({
|
||||||
|
ok: true,
|
||||||
|
service: 'webklar-kundenbereich',
|
||||||
|
databaseId: WOMS_DATABASE_ID,
|
||||||
|
endpoint: config.appwrite.endpoint,
|
||||||
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
app.use(express.static(publicDir))
|
app.use(express.static(publicDir))
|
||||||
|
|||||||
Reference in New Issue
Block a user