aboutsummaryrefslogtreecommitdiff
path: root/lib (unfollow)
Commit message (Collapse)AuthorFilesLines
2024-05-21Server.GtfsRealtime: yet another TripUpdateTooOldstuebinm1-4/+10
Google really is picky about these … and does not even seem willing to tell which thresholds it uses …
2024-05-21Config: fix OsPath valuesstuebinm1-2/+7
my annoyance with conferer increases. It should really, /really/ be a compile error if a thing used in the config does not have a FromConfig instance. Or at least the documentation should mention that in such cases it will simply always take the default value without telling anyone, instead of just saying "the generic instance has reasonable defaults" (well, /which/ defaults?)
2024-05-20use OsPath instead of FilePath in easy casesstuebinm4-16/+36
this is still far from being supported by most libraries, but does make it possible to remove some uses of String (though most times, there is a conversion back to String later). Note that using the default.nix now only works on nixpkgs-unstable for a bit; using the newer filepath package on stable leads to broken other packages.
2024-05-19Server.Ingest: bugfix (tentative)stuebinm1-12/+12
2024-05-16Persist: add cascade rules to foreign keysstuebinm1-9/+7
It turns out persist does support these, they're just not mentioned in the yesod book. (for future reference, the syntax is defined in Database.Persist.Quasi, which does include some documentation [1]) [1] https://hackage.haskell.org/package/persistent-2.14.6.1/docs/Database-Persist-Quasi.html
2024-05-16new feature: Server.Frontend.Tickerstuebinm7-1/+92
A simple way to have "announcements" available via API, and otherwise distinct from the service announcements which show up in Gtfs Realtime. These are meant to go e.g. be embedded on the operator's website, or in other places where it's not as easy to display per-trip specific messages.
2024-05-15Frontend.Tickets: add a space-time diagram in ticket viewstuebinm1-0/+5
not sure if i'll keep it here — it should probably gain some logic for real-time udpates and be moved to the map view instead.
2024-05-15Frontend.SpaceTime: make diagram's y axis scalablestuebinm2-22/+23
in preparation for using these elsewhere, where they are less cramped
2024-05-15Frontend.Tickets: fix "last call" in ticket viewstuebinm1-1/+1
(same as previous commit, this displayed the wrong ping)
2024-05-15Frontend.Tickets,Server.Ingest: fix map viewstuebinm2-12/+13
this is really two changes: - some leftover lat,long keys in the clientside javascript - the Server.Subscribe module should send a correct ping after a connection has been opened
2024-05-15Server.GtfsRealtime: bugfixstuebinm1-1/+1
can't believe it was this simple … but seems to be all that was wrong. Tracktrain should now automatically remove tripUpdates for tickets whose trip has ended more than five minutes ago (taking delay into account). Nothing in the gtfs-rt spec says you should do this, but google likes to complain if one doesn't do this.
2024-05-15Server.Frontend.SpaceTime: fix lots of bugsstuebinm1-49/+54
also make the code generally look nicer. Turns out I made a lot more fragile assumptions than I thought I did.
2024-05-15Server.Ingest: new handling of unassigned trackersstuebinm4-86/+168
now takes all potential stops along each trip into account when guessing tickets; also checks if a ticket is still likely in case the tracker switched its direction. This should solve many cases where a tracker is accidentally turned off or falls asleep halfway before the last station of one trip, then wakes up in the middle of the next.
2024-05-15config: add a debug mode optionstuebinm2-3/+8
this is meant to be false by default, and otherwise relaxes requirements on e.g. incoming pings, which are inconvenient when testing by hand.
2024-05-10space time diagrams: real time & time zonesstuebinm3-86/+178
2024-05-09rough initial work on space-time diagramsstuebinm3-0/+107
this does svg templating with hamlet. It might be better to use a javascript library instead (templating svgs is a little confusing tbh), but for now i'll see how far i get with this.
2024-05-09restructure: split web frontend into several modulesstuebinm6-302/+479
2024-05-08restructure: split up the server modulestuebinm5-302/+394
2024-05-03fix: tripupdates should not contain old tripsstuebinm1-2/+2
apparently i forgot an if here?
2024-05-02restructure: get the tracker to work againstuebinm8-135/+268
This should hopefully be the final (major) part of the restructuring: a tracker no longer has to know which trip it is on (and indeed it has no idea for now), instead the server keeps state about which trips are currently running and will insert incoming pings in a hopefully reasonable manner, based on their geoposition & time. There's lots of associated TODO items here (especially there should be manual overrides for all this logic in the web ui), but that's work for a future me. (incidentally, this also adds support for sending all log messages out via ntfy-sh)
2024-04-24correct styling on mobile devicesstuebinm1-1/+4
2024-04-24restructure: save a ticket's stop in the databasestuebinm7-327/+502
now mostly independent of the gtfs, but still no live-reloading of it.
2024-04-20restructure: have "tickets" independent of gtfsstuebinm8-192/+305
this is mostly meant to guard against the gtfs changing under tracktrain, and not yet complete (e.g. a ticket does not yet save its expected stops, which it probably should).
2024-04-17general housekeepingstuebinm9-72/+29
jumps to GHC2021 as default language, adds in some fields, moves the old org mode glossary to markdown, etc.
2024-04-17replace protocol-buffers with proto-lensstuebinm3-282/+198
I do not really like either option, but at least the second one seems more likely to be maintained (and a little less clunky to use, too, for what it's worth).
2023-05-26change server timetables apistuebinm1-1/+2
2023-05-26expose sequence length of trip to onboard unitstuebinm1-0/+1
2023-05-23gtfs-rt: discard old trips from tripupdates feedstuebinm1-7/+12
google maps complains about it otherwise
2023-05-20expose the gtfs.zip used in the APIstuebinm5-29/+49
2023-03-11simple on-board toolsstuebinm2-10/+26
these are just enough to send train positions to tracktrain with the current API, but are somewhat brittle (e.g. will fail if not restarted between trips, etc.)
2023-02-23don't hardcode cssstuebinm4-68/+10
2023-01-28better web interface & cssstuebinm3-30/+84
2023-01-22switch to ghc 9.0.2stuebinm2-27/+46
this makes the nix builds /much/ nicer
2023-01-22oauth2 via uffdstuebinm4-48/+210
this is unfortunately uffd-specific, since oauth2 is apparently sort of a vague standard. But since it doesn't actually do much it should probably be possible to make it fully configurable & generic if needed.
2022-12-13simple realtime position mapstuebinm3-2/+58
(what was that about doing the realtime stuff somewhere else and /not/ in this monolithic server thingie? oh well …)
2022-12-12stylish-haskell runstuebinm3-6/+7
2022-12-12a subscribe websocket for real-time location infostuebinm2-7/+37
(for a leaflet map view or sth which isn't implemented yet)
2022-12-03gtfs-rt: set trip_descriptor.schedule_relationshipstuebinm1-1/+2
(hardcoded for now, since we don't have new trips)
2022-12-03unreasonably stupid and probably unnecessary codestuebinm2-5/+18
(but maybe google will like it)
2022-12-03set uncertainty in gtfs-rtstuebinm1-2/+2
2022-12-03always display secondsstuebinm1-2/+2
(this is a hack to make the gtfs rt valid)
2022-12-03this is almost certainly bullshitstuebinm1-6/+6
2022-12-03let's try something else as wellstuebinm1-1/+2
2022-12-03another gtfs rt thingie?stuebinm1-1/+2
2022-12-03fix google warningstuebinm1-1/+1
2022-11-29controlroom: show tripShortName instead of tripIdstuebinm2-8/+20
since the ids really should be internal to the gtfs, and not needed in "normal" contexts.
2022-11-29respect gtfs start/end datestuebinm1-1/+4
not only is this a surprisingly stupid bug, i distinctly remember writing these few lines sometime ago … but they're not in the commit history, so i guess they got lost somehow??
2022-10-16fix gtfs tripupdatesstuebinm1-83/+92
2022-10-16simple prometheus metricsstuebinm3-7/+35
2022-09-14remove some extrapolation bugsstuebinm4-61/+66