Read in .env file

This commit is contained in:
2023-09-12 09:41:16 +02:00
parent 42ebe789a1
commit 31cbe68244
4 changed files with 29 additions and 0 deletions

9
example.env Normal file
View File

@@ -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

17
package-lock.json generated
View File

@@ -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",

View File

@@ -1,5 +1,6 @@
{
"dependencies": {
"dotenv": "^16.3.1",
"express": "^4.18.2",
"moment": "^2.29.4",
"node-cron": "^3.0.2",

View File

@@ -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