READMS.md erstellt
This commit is contained in:
@@ -0,0 +1,186 @@
|
||||
# ResMan
|
||||
|
||||
Ressourcen- und Infrastruktur-Management Tool für Server, Domains und IPs.
|
||||
|
||||
---
|
||||
|
||||
## 🚀 Features
|
||||
|
||||
- 🖥️ Ressourcenverwaltung (Server, VPS, etc.)
|
||||
- 🌐 Domain Management inkl. DNS Check
|
||||
- 🔗 Subdomain Verwaltung
|
||||
- 🌍 IP Management (CRUD + Validation)
|
||||
- 💰 Kosten Dashboard (monatlich / jährlich)
|
||||
- 🗺️ Infrastruktur Übersicht
|
||||
- 🟢 Server Status Check (Ping)
|
||||
- 🌙 Dark Mode
|
||||
|
||||
---
|
||||
|
||||
## 🧱 Tech Stack
|
||||
|
||||
- Backend: Node.js + Express
|
||||
- Datenbank: MariaDB / MySQL
|
||||
- Frontend: Vanilla JavaScript (modular)
|
||||
- Deployment: Docker + NGINX Reverse Proxy
|
||||
|
||||
---
|
||||
|
||||
## 📁 Projektstruktur
|
||||
|
||||
backend/
|
||||
routes/
|
||||
controllers/
|
||||
public/
|
||||
index.html
|
||||
css/
|
||||
js/
|
||||
api.js
|
||||
main.js
|
||||
resources.js
|
||||
domains.js
|
||||
modals.js
|
||||
costs.js
|
||||
infra.js
|
||||
|
||||
|
||||
---
|
||||
|
||||
## ⚙️ Setup
|
||||
|
||||
### 1. Installation
|
||||
|
||||
```bash
|
||||
git clone <repo>
|
||||
cd resman
|
||||
npm install
|
||||
|
||||
|
||||
🗄️ Datenbank Schema
|
||||
resources
|
||||
|
||||
|
||||
CREATE TABLE resources (
|
||||
id INT AUTO_INCREMENT PRIMARY KEY,
|
||||
name VARCHAR(255),
|
||||
produkt VARCHAR(255),
|
||||
provider VARCHAR(255),
|
||||
art VARCHAR(100),
|
||||
cpu VARCHAR(50),
|
||||
ram VARCHAR(50),
|
||||
disk VARCHAR(50),
|
||||
os VARCHAR(100),
|
||||
ipv6_net VARCHAR(255),
|
||||
providername VARCHAR(255),
|
||||
kosten_monat DECIMAL(10,2),
|
||||
kosten_jahr DECIMAL(10,2),
|
||||
bestelldatum DATE,
|
||||
kuendbar_ab DATE,
|
||||
kuendigungsdatum DATE,
|
||||
status VARCHAR(50),
|
||||
bemerkung TEXT
|
||||
);
|
||||
|
||||
|
||||
resource_ips
|
||||
|
||||
CREATE TABLE resource_ips (
|
||||
id INT AUTO_INCREMENT PRIMARY KEY,
|
||||
resource_id INT,
|
||||
ip VARCHAR(100),
|
||||
type VARCHAR(50),
|
||||
comment VARCHAR(255)
|
||||
);
|
||||
|
||||
domains
|
||||
|
||||
CREATE TABLE domains (
|
||||
id INT AUTO_INCREMENT PRIMARY KEY,
|
||||
domain_name VARCHAR(255),
|
||||
provider VARCHAR(255),
|
||||
ip_address VARCHAR(100),
|
||||
yearly_cost DECIMAL(10,2),
|
||||
notes TEXT,
|
||||
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
|
||||
);
|
||||
|
||||
subdomains
|
||||
|
||||
CREATE TABLE subdomains (
|
||||
id INT AUTO_INCREMENT PRIMARY KEY,
|
||||
domain_id INT,
|
||||
subdomain VARCHAR(100),
|
||||
ip_address VARCHAR(100)
|
||||
);
|
||||
|
||||
|
||||
🔌 API Endpoints (Auszug)
|
||||
Ressourcen
|
||||
|
||||
GET /resman/api/resources/active
|
||||
GET /resman/api/resources/cancelled
|
||||
POST /resman/api/resources
|
||||
PUT /resman/api/resources/:id
|
||||
DELETE /resman/api/resources/:id
|
||||
|
||||
IPs
|
||||
|
||||
GET /resman/api/resources/:id/ips
|
||||
POST /resman/api/resources/:id/ips
|
||||
PUT /resman/api/ips/:id
|
||||
DELETE /resman/api/ips/:id
|
||||
|
||||
Domains
|
||||
|
||||
GET /resman/api/domains
|
||||
POST /resman/api/domains
|
||||
PUT /resman/api/domains/:id
|
||||
DELETE /resman/api/domains/:id
|
||||
|
||||
Subdomains
|
||||
|
||||
GET /resman/api/subdomains
|
||||
POST /resman/api/subdomains
|
||||
PUT /resman/api/subdomains/:id
|
||||
DELETE /resman/api/subdomains/:id
|
||||
|
||||
Sonstiges
|
||||
|
||||
GET /resman/api/domainmap
|
||||
GET /resman/api/dns/:domain
|
||||
GET /resman/api/ping/:ip
|
||||
GET /resman/api/ipcheck/:ip
|
||||
|
||||
🌐 Reverse Proxy
|
||||
NGINX
|
||||
|
||||
location /resman/ {
|
||||
proxy_pass http://127.0.0.1:3000/resman/;
|
||||
}
|
||||
|
||||
Apache
|
||||
|
||||
ProxyPass /resman http://127.0.0.1:3000/resman
|
||||
ProxyPassReverse /resman http://127.0.0.1:3000/resman
|
||||
|
||||
🔒 Sicherheit (optional)
|
||||
Basic Auth via NGINX empfohlen
|
||||
Alternativ: nur im internen Netzwerk betreiben
|
||||
API aktuell ohne Auth → nicht öffentlich exponieren
|
||||
🧠 Architektur
|
||||
|
||||
Frontend ist modular aufgebaut:
|
||||
|
||||
api.js → zentrale API Kommunikation
|
||||
resources.js → Ressourcen + IPs
|
||||
domains.js → Domains + Subdomains
|
||||
modals.js → alle Dialoge
|
||||
costs.js → Kostenberechnung
|
||||
infra.js → Infrastruktur Ansicht
|
||||
main.js → Initialisierung + Refresh
|
||||
⚠️ Bekannte Themen
|
||||
DNS Requests können ohne Cache langsam sein
|
||||
Keine Authentifizierung im Backend
|
||||
Kein Rollen-/Rechtesystem
|
||||
|
||||
|
||||
@@ -163,3 +163,33 @@ color:#555;
|
||||
color:white;
|
||||
font-weight:bold;
|
||||
}
|
||||
body.dark{
|
||||
background:#111827;
|
||||
color:#e5e7eb;
|
||||
}
|
||||
|
||||
body.dark section{
|
||||
background:#1f2937;
|
||||
}
|
||||
|
||||
body.dark th{
|
||||
background:#111827;
|
||||
}
|
||||
|
||||
body.dark td{
|
||||
border-color:#374151;
|
||||
}
|
||||
|
||||
body.dark .provider{
|
||||
background:#1e3a8a;
|
||||
color:white;
|
||||
}
|
||||
|
||||
body.dark .ip{
|
||||
background:#374151;
|
||||
}
|
||||
|
||||
body.dark .ip.public{
|
||||
background:#16a34a;
|
||||
color:white;
|
||||
}
|
||||
|
||||
@@ -13,6 +13,8 @@
|
||||
|
||||
<h1>Ressourcen Verwaltung</h1>
|
||||
|
||||
<button onclick="toggleDarkMode()">🌙 Dark Mode</button>
|
||||
|
||||
<div id="lastUpdate" style="margin-bottom:10px;color:#555;">
|
||||
Letztes Update: -
|
||||
</div>
|
||||
@@ -224,9 +226,6 @@ Domains jährlich: <span id="costDomain">0</span> €<br>
|
||||
<div id="ipList"></div>
|
||||
|
||||
<hr>
|
||||
<input id="new_ip" placeholder="IP">
|
||||
<input id="new_type" placeholder="public / private">
|
||||
<input id="new_comment" placeholder="Beschreibung">
|
||||
|
||||
<button onclick="saveIP()">Add</button>
|
||||
|
||||
|
||||
@@ -58,3 +58,22 @@ function updateLastUpdate(){
|
||||
document.getElementById("lastUpdate").innerText =
|
||||
"🟢 Letztes Update: " + time
|
||||
}
|
||||
|
||||
window.toggleDarkMode = function(){
|
||||
|
||||
document.body.classList.toggle("dark")
|
||||
|
||||
localStorage.setItem(
|
||||
"darkmode",
|
||||
document.body.classList.contains("dark")
|
||||
)
|
||||
}
|
||||
|
||||
// beim Start laden
|
||||
document.addEventListener("DOMContentLoaded", () => {
|
||||
|
||||
if(localStorage.getItem("darkmode") === "true"){
|
||||
document.body.classList.add("dark")
|
||||
}
|
||||
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user