README & License

This commit is contained in:
klaas 2024-09-09 16:37:28 +02:00
parent 37c1cfd46f
commit 6dd6f41f8c
4 changed files with 28 additions and 13 deletions

21
LICENSE.md Normal file
View File

@ -0,0 +1,21 @@
# The MIT License (MIT)
Copyright (c) 2015-2022 Vladimir Iakovlev
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

View File

@ -12,6 +12,7 @@ Willkommen auf meiner persönlichen Website! Diese Seite dient als Plattform, um
### 2. **Login-Funktion** ### 2. **Login-Funktion**
- Registrierte Nutzer können sich einloggen, um Zugriff auf erweiterte Funktionen zu erhalten. - Registrierte Nutzer können sich einloggen, um Zugriff auf erweiterte Funktionen zu erhalten.
- Die Selbstregistrierung ist nicht Möglich, neue Nutzer müssen durch einen Admin erstellt werden.
- Sicherheit wird durch eine sichere Passwortspeicherung und Authentifizierung gewährleistet. - Sicherheit wird durch eine sichere Passwortspeicherung und Authentifizierung gewährleistet.
### 3. **QR-Code Generator (für angemeldete Nutzer)** ### 3. **QR-Code Generator (für angemeldete Nutzer)**
@ -49,12 +50,7 @@ Willkommen auf meiner persönlichen Website! Diese Seite dient als Plattform, um
3. Konfiguriere die Umgebungsvariablen: 3. Konfiguriere die Umgebungsvariablen:
- Erstelle eine `.env` Datei im Hauptverzeichnis und füge die folgenden Variablen hinzu: - Benenne `.env_default` in `.env` um und fülle die Variablen aus
```plaintext
TELEGRAM_BOT_TOKEN=your-telegram-bot-token
TELEGRAM_CHAT_ID=your-telegram-chat-id
```
4. Starte die Anwendung: 4. Starte die Anwendung:
@ -76,9 +72,9 @@ Die Kontaktseite ist über einen QR-Code zugänglich, der sich im Auto befindet.
## Technologie-Stack ## Technologie-Stack
- **Backend:** Node.js, Express - **Backend:** Node.js, Express, postgresql
- **Frontend:** EJS, Bootstrap - **Frontend:** EJS, Bootstrap
- **Authentifizierung:** Passport.js - **Authentifizierung:** Bcrypt
- **QR-Code-Generierung:** `qrcode` npm-Paket - **QR-Code-Generierung:** `qrcode` npm-Paket
- **Benachrichtigungen:** Telegram Bot API - **Benachrichtigungen:** Telegram Bot API
- **Hosting:** Kann auf jedem Node.js-fähigen Server betrieben werden - **Hosting:** Kann auf jedem Node.js-fähigen Server betrieben werden

6
app.js
View File

@ -6,7 +6,7 @@ const nodemailer = require("nodemailer");
const { Pool } = require("pg"); const { Pool } = require("pg");
const path = require("path"); const path = require("path");
const moment = require("moment"); const moment = require("moment");
const marked = require("marked"); const { marked } = require("marked");
const axios = require("axios"); const axios = require("axios");
require("dotenv").config(); require("dotenv").config();
const log = require("node-file-logger"); const log = require("node-file-logger");
@ -32,7 +32,7 @@ bot.on("text", (msg) => {
} }
}); });
bot.start(); //bot.start();
const options = { const options = {
folderPath: "./logs/", folderPath: "./logs/",
@ -144,7 +144,6 @@ app.post("/login", async (req, res) => {
req.session.activeRiege = 1; req.session.activeRiege = 1;
req.session.activeTab = "geraete"; req.session.activeTab = "geraete";
req.session.message = [(title = ""), (message = ""), (type = "none")]; req.session.message = [(title = ""), (message = ""), (type = "none")];
log.Info(username + " " + password);
if (user.admin_status === "expired") { if (user.admin_status === "expired") {
await pool.query( await pool.query(
"UPDATE users SET role = $1, admin_temp = NULL WHERE id = $2", "UPDATE users SET role = $1, admin_temp = NULL WHERE id = $2",
@ -416,7 +415,6 @@ app.get("/project/:id", async (req, res) => {
// Abrufen der Datei // Abrufen der Datei
const response = await axios.get(url); const response = await axios.get(url);
console.log(response.data);
// Markdown-Inhalt in HTML umwandeln // Markdown-Inhalt in HTML umwandeln
const htmlContent = marked(response.data); const htmlContent = marked(response.data);
//const htmlContent = "Testdata"; //const htmlContent = "Testdata";

View File

@ -3,7 +3,7 @@
<div id="view" class="mt-5"> <div id="view" class="mt-5">
<h1><%= projekt.name %></h1> <h1><%= projekt.name %></h1>
<p><%= projekt.kurzbeschreibung %></p> <p><%= projekt.kurzbeschreibung %></p>
<p><%= content %></p> <p><%- content %></p>
<p> <p>
<a href="<%= projekt.repository_link %>" target="_blank">Repository Link</a> <a href="<%= projekt.repository_link %>" target="_blank">Repository Link</a>
</p> </p>