diff --git a/example.env b/example.env new file mode 100644 index 0000000..16b8311 --- /dev/null +++ b/example.env @@ -0,0 +1,9 @@ +ONLY_SHOW_AVAILABLE=true # Optional, default: true (only show available reports in the UI) +CALDAV_URL=https://example.com/calendars/ # URL to the caldav server +CALDAV_USER=USERNAME # Username for the caldav server +CALDAV_PASSWORD=PASSWORD # Password for the caldav server +CALDAV_CALENDAR=CALENDARNAME # Calendar name from the caldav server +UNTIS_SCHOOLS=School1,School2 # Comma seperated list of schools (find in URL when logging in to untis, replace + with space) +UNTIS_USERNAMES=USERNAME1,USERNAME2 # Usernames for untis schools +UNTIS_PASSWORDS=PASSWORD1,PASSWORD2 # Passwords for untis schools +UNTIS_SERVERS=server1.webuntis.com,server2.webuntis.com # Servers for untis chools \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 398aa23..f3ccc1a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5,6 +5,7 @@ "packages": { "": { "dependencies": { + "dotenv": "^16.3.1", "express": "^4.18.2", "moment": "^2.29.4", "node-cron": "^3.0.2", @@ -234,6 +235,17 @@ "npm": "1.2.8000 || >= 1.4.16" } }, + "node_modules/dotenv": { + "version": "16.3.1", + "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.3.1.tgz", + "integrity": "sha512-IPzF4w4/Rd94bA9imS68tZBaYyBWSCE47V1RGuMrB94iyTOIEwRmVL2x/4An+6mETpLrKJ5hQkB8W4kFAadeIQ==", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/motdotla/dotenv?sponsor=1" + } + }, "node_modules/ee-first": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", @@ -981,6 +993,11 @@ "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.2.0.tgz", "integrity": "sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg==" }, + "dotenv": { + "version": "16.3.1", + "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.3.1.tgz", + "integrity": "sha512-IPzF4w4/Rd94bA9imS68tZBaYyBWSCE47V1RGuMrB94iyTOIEwRmVL2x/4An+6mETpLrKJ5hQkB8W4kFAadeIQ==" + }, "ee-first": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", diff --git a/package.json b/package.json index 8ae662b..256559d 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,6 @@ { "dependencies": { + "dotenv": "^16.3.1", "express": "^4.18.2", "moment": "^2.29.4", "node-cron": "^3.0.2", diff --git a/src/server.js b/src/server.js index deb11ad..403a16b 100644 --- a/src/server.js +++ b/src/server.js @@ -6,6 +6,8 @@ const moment = require('moment'); const { WebUntis } = require('webuntis'); var cron = require('node-cron'); +require('dotenv').config(); + // Befehl für die Skriptausführung const command = process.platform === 'win32' ? 'python' : 'python3'; // Pfad zum Kalender-Skript