aboutsummaryrefslogtreecommitdiff
path: root/src/server.ml
AgeCommit message (Collapse)Author
2022-02-05Introduce a new feature to list events without locationAlban Gruin
This adds a new page listing events without location. Signed-off-by: Alban Gruin <alban@pa1ch.fr>
2022-02-05server: extract the function reading the module id and groupsAlban Gruin
A new function, listing events with no location, will also need to read the module id and groups from request parameters. Extract the function taking care of that to avoid code duplication. This also adds a button on the link page, to access to the page listing events without location. This feature is not yet implemented. Signed-off-by: Alban Gruin <alban@pa1ch.fr>
2022-02-05server: reorganise the codeAlban Gruin
Signed-off-by: Alban Gruin <alban@pa1ch.fr>
2021-09-19server: add charset to the headers when fetching timetablesAlban Gruin
Signed-off-by: Alban Gruin <alban@pa1ch.fr>
2021-09-19server, ics, pages: allow to generate ICS from modulesAlban Gruin
This adds the ability to generate an ICS file from a module ID, and to filter it based on its groups. To do this, you can enter a module ID on the frontpage. Then, µCS will fetch the timetable, then return a page where one can select the group(s) they want to filter (this is enabled by the new Ics.get_all_groups function). Then, µCS is able to generate a link to that calendar, not unlike with a single group ID. Signed-off-by: Alban Gruin <alban@pa1ch.fr>
2021-09-19server, ics: add a facility to filter courses by groupsAlban Gruin
When fetching courses based on their module ID, it is interesting to exclude coruses that do not apply to some groups. This adds the functionnality to apply that filtering, with the Ics.filter_groups function. It also becomes possible to get ICS for modules. URLs and generators are changed accordingly. Signed-off-by: Alban Gruin <alban@pa1ch.fr>
2021-09-19server: allow to fetch module timetables in addition to groupsAlban Gruin
This add a new type, fetch_kind, and a function, kind_to_res_type, to select the type of timetable we want to fetch: Group, or Module. For now, Module is not used, so warning 37 is disabled in fetch_kind. It will be enabled back in the next commit. Signed-off-by: Alban Gruin <alban@pa1ch.fr>
2020-12-30server: cleanupv0.2.0Alban Gruin
Remove the wildcard `open Lwt' and replace it with `open Lwt.Infix'. Signed-off-by: Alban Gruin <alban@pa1ch.fr>
2020-12-30ics: print the timezone name in the ICS fileAlban Gruin
Add the correct timezone in generated ICS files. The timezone is fetched from /etc/timezone. Even though this is not standard, if a tool needs it, it should be able to understand it correctly. Signed-off-by: Alban Gruin <alban@pa1ch.fr>
2020-12-30ucs: properly remove the unix socket when a signal is receivedAlban Gruin
When using a unix socket to serve µCS, the file would not be removed when the server was shut down. Teach µCS to catch sigints and sigterms, and call unlink on the socket if it exists. Signed-off-by: Alban Gruin <alban@pa1ch.fr>
2020-09-13server: set the range to fetch to a year and a monthAlban Gruin
To fetch all interesting courses, the start date is set to a month before today, and the end date is set to a year after today. This should be enough for our iCalendar files. Signed-off-by: Alban Gruin <alban@pa1ch.fr>
2020-09-13ucs: move the server to its own moduleAlban Gruin
Signed-off-by: Alban Gruin <alban@pa1ch.fr>