From 6dd6f41f8c0bf6ff180357f23a74ee7aa3879eb1 Mon Sep 17 00:00:00 2001 From: klaas Date: Mon, 9 Sep 2024 16:37:28 +0200 Subject: [PATCH] README & License --- LICENSE.md | 21 +++++++++++++++++++++ README.md | 12 ++++-------- app.js | 6 ++---- views/project.ejs | 2 +- 4 files changed, 28 insertions(+), 13 deletions(-) create mode 100644 LICENSE.md diff --git a/LICENSE.md b/LICENSE.md new file mode 100644 index 0000000..b491aa7 --- /dev/null +++ b/LICENSE.md @@ -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. diff --git a/README.md b/README.md index fbd8899..e60e502 100644 --- a/README.md +++ b/README.md @@ -12,6 +12,7 @@ Willkommen auf meiner persönlichen Website! Diese Seite dient als Plattform, um ### 2. **Login-Funktion** - 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. ### 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: - - Erstelle eine `.env` Datei im Hauptverzeichnis und füge die folgenden Variablen hinzu: - - ```plaintext - TELEGRAM_BOT_TOKEN=your-telegram-bot-token - TELEGRAM_CHAT_ID=your-telegram-chat-id - ``` + - Benenne `.env_default` in `.env` um und fülle die Variablen aus 4. Starte die Anwendung: @@ -76,9 +72,9 @@ Die Kontaktseite ist über einen QR-Code zugänglich, der sich im Auto befindet. ## Technologie-Stack -- **Backend:** Node.js, Express +- **Backend:** Node.js, Express, postgresql - **Frontend:** EJS, Bootstrap -- **Authentifizierung:** Passport.js +- **Authentifizierung:** Bcrypt - **QR-Code-Generierung:** `qrcode` npm-Paket - **Benachrichtigungen:** Telegram Bot API - **Hosting:** Kann auf jedem Node.js-fähigen Server betrieben werden diff --git a/app.js b/app.js index baf4193..b403613 100644 --- a/app.js +++ b/app.js @@ -6,7 +6,7 @@ const nodemailer = require("nodemailer"); const { Pool } = require("pg"); const path = require("path"); const moment = require("moment"); -const marked = require("marked"); +const { marked } = require("marked"); const axios = require("axios"); require("dotenv").config(); const log = require("node-file-logger"); @@ -32,7 +32,7 @@ bot.on("text", (msg) => { } }); -bot.start(); +//bot.start(); const options = { folderPath: "./logs/", @@ -144,7 +144,6 @@ app.post("/login", async (req, res) => { req.session.activeRiege = 1; req.session.activeTab = "geraete"; req.session.message = [(title = ""), (message = ""), (type = "none")]; - log.Info(username + " " + password); if (user.admin_status === "expired") { await pool.query( "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 const response = await axios.get(url); - console.log(response.data); // Markdown-Inhalt in HTML umwandeln const htmlContent = marked(response.data); //const htmlContent = "Testdata"; diff --git a/views/project.ejs b/views/project.ejs index 992b32e..94d334f 100644 --- a/views/project.ejs +++ b/views/project.ejs @@ -3,7 +3,7 @@

<%= projekt.name %>

<%= projekt.kurzbeschreibung %>

-

<%= content %>

+

<%- content %>

Repository Link