Git Product home page Git Product logo

untis-ics-sync's Introduction

⏰ untis-ics-sync

Node CI Docker CD

Serves a calendar API (ICS) for events provided from Untis.

Banner

Use case

Some schools, universities, or workspaces do not enable the iCalendar API that Untis provides by default. Due to this limitation, I've written my implementation to dynamically sync class schedules to my agenda.

Installation

Using Docker

To deploy a quick Docker environment, fill in the target school credentials in docker-compose.yml and start the service by running docker compose up -d. Do note that if you'd like to use SSL, add any reverse proxy such as Nginx, Caddy or Traefik. View the table below for all possible environment variables.

Using NixOS

Firstly add this repository to your flake's inputs.

{
  inputs = {
    # ...
    untis-ics-sync.url = "github:bddvlpr/untis-ics-sync/<rev/version>";
    untis-ics-sync.inputs.nixpkgs.follows = "nixpkgs";
  };

  # ...
}

Secondly, enable the service. Please DO NOT use a writeText derivation as this will add your credentials to the Nix store. Use agenix or nix-sops. A local Redis service will automatically be started.

{
  inputs,
  ...
}: {
  imports = [
    inputs.untis-ics-sync.nixosModules.default
  ];

  services.untis-ics-sync = {
    enable = true;
    envFile = ./; # Path to your credentials.
  };
}

Environment

Name Type Default Description
UNTIS_SCHOOLNAME string null The school's (Untis) service name.
UNTIS_USERNAME string null The school's user name.
UNTIS_PASSWORD string null The school's password.
UNTIS_BASEURL string null The school's (Untis) base-url.
BULL_REDIS_HOST string null The Redis service hostname or address.
BULL_REDIS_PORT number null The Redis service port.
BULL_REDIS_PATH string null The Redis service path for Unix socket connection.
CORS_ORIGIN string http://localhost:5173 CORS Origin header to be sent for untis-ics-sync-ui.
MAINTENANCE_TITLE string null Maintenance notification title.
MAINTENANCE_DESCRIPTION string null Maintenance notification description.
MAINTENANCE_LOCATION string null Maintenance notification location.
LESSONS_TIMETABLE_BEFORE number 7 The amount of days to fetch before today.
LESSONS_TIMETABLE_AFTER number 14 The amount of days to fetch after today.

untis-ics-sync's People

Contributors

bddvlpr avatar freebreix avatar lenme-exe avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

untis-ics-sync's Issues

cannot get timetable, but classes is working

when trying to get a timetable from /timetables/ i just get {"statusCode":404,"message":"Cannot GET /timetables/777","error":"Not Found"} but getting classes from /classes is working

error querying timetables

Not sure if I figured out the API correctly. Querying classes and a single class works fine but when getting timetables via ID connection is terminated and I get below error message.
To Reproduce

Steps to reproduce the behavior:

http://10.0.0.102:3000/classes/ - works fine
http://10.0.0.102:3000/timetables/1492 - connection gets dropped and below error message is logged

Error Message:
2022-09-30T21:26:28.634Z info: Serving GET /timetables/1492 from ::ffff:10.0.0.28
/app/src/utils/time.js:20
.map((teacher) => teacher.longname)
^
TypeError: Cannot read properties of undefined (reading 'map')
at convertLessonToEvent (/app/src/utils/time.js:20:14)
at /app/src/server/routes/timetables.route.js:77:62
at Array.map ()
at /app/src/server/routes/timetables.route.js:77:14
at Generator.next ()
at /app/src/server/routes/timetables.route.js:8:71
at new Promise ()
at __awaiter (/app/src/server/routes/timetables.route.js:4:12)
at createCalendar (/app/src/server/routes/timetables.route.js:68:74)
at /app/src/server/routes/timetables.route.js:38:25
Node.js v18.9.0

System details:

  • OS: RancherOS
  • Docker version: 19.03.11

Thanks for any advise!

Very slow yarn package pulling on QEMU emulated cross-platform build.

Describe the bug
While compiling from (for e.g.) amd64 to arm64/v8 or arm/v7 using Docker Buildx and QEMU, pulling packages using Yarn takes extremely long. Very likely associated with nodejs/docker-node#1335.

To Reproduce
Steps to reproduce the behavior:

  1. git clone https://github.com/bddvlpr/untis-ics-sync
  2. docker buildx build --platform=linux/amd64,linux/arm/v7,linux/arm64/v8 .

Expected behavior
Yarn to possibly take ~30 seconds to 1 minute to pull the packages.

Screenshots
image

System (please complete the following information):

  • OS: Linux Arch 5.19.9-arch1-1
  • Docker version: 20.10.18
  • Buildx: 0.9.1

Additional context

Async timetable requesting with locks

Describe the bug
Requesting the same timetable at the same time using two or more requests cause unexpected results.

To Reproduce
Steps to reproduce the behavior:

  1. Setup a dev environment.
  2. Send two separate requests to one single endpoint at the same exact time.

Expected behavior
Halt the processing of any further requests until the first one finishes, then serve the (just finished) cache result.

Merging multiple classes that share the same id

Describe the bug
Currently, classes that go on for more than one hour get split up into the same class, two (or more) times continuously.

Expected behavior
Classes (that share the same id or perhaps details) should be grouped into one event taking up the group's hours.

Screenshots
image

where is my ics

ive done it with the docker thing and put the conf in the .env if I go to my IP I get: couldnt get /. also I dont know where the ics file is so I cant add it to my calendar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.