Git Product home page Git Product logo

traewelling's Introduction

Träwelling is a free check-in service that lets you tell your friends where you are and where you can log your public transit journeys. In short, you can check into trains and get points for it. Check it out at traewelling.de.

Resources build with prod Composer install and test Laravel Gitmoji Codacy Badge Translation status License

Träwelling Screenshot

Features

  • Check into trains, trams, busses and more travel types in most of Europe
  • Track your work trips, e.g. for tax returns and travel expenses
  • Follow other people and see where they're going
  • Meet new friends who are on the same trip
  • Find who's going to an event and is with you in your journey
  • Optional sharing to Mastodon
  • See statistics about your trips
  • Export your trips to CSV, JSON or PDF
  • Create own applications with our API
  • Available in German, English, Polish, French and Dutch

Security

If you have identified a security issue, please refrain from directly creating an issue or PullRequest so that the vulnerability is not exploited.

Instead, please contact [email protected] or use other contact methods.

Developing and contributing

We want to let you know that Träwelling is a leisure project, developed and maintained by a team of volunteers who dedicate their spare time to the project. We do our best to address issues and improve the platform, but please keep in mind that we may not always be able to respond to requests immediately. However, we welcome anyone who wants to contribute to the project! If you find a bug or have an idea for a new feature, please feel free to open an issue / discussion on GitHub. We also encourage you to help us out by fixing bugs and implementing new features yourself.

Please see the contributing guidelines for more information.

License

We are using the Affero General Public License (why?) - you are required to publish changes that you make to this software. Please refrain from creating your own public instance of Träwelling, instead try to create a better version for everyone.

traewelling's People

Contributors

0agentsmith avatar ahmetlii avatar aledjones avatar antvgr avatar d3d9 avatar dependabot[bot] avatar derrobin154 avatar drschlaubi avatar eventhorizon8 avatar hernikplays avatar herrlevin avatar jeyemwey avatar jheubuch avatar m4rcdev avatar marhei avatar mrkriskrisu avatar nilsziegfeld avatar nycodeghg avatar rugk avatar sergio-ferreira avatar stefanhff avatar theonewiththebraid avatar thilobillerbeck avatar timoteosg avatar tobiasreinhard avatar tygyh avatar vainamov avatar vistaus avatar weblate avatar weiland avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

traewelling's Issues

"Last station cancelled" may result in "second to last station cancelled"

Describe the bug
When a train terminates before its last station, it might provoke a false-positive "cancelled station". In this example, the RE 8 19074 terminates in Lauda instead of Würzburg Hbf. Both stops have the cancelled key set to true, however Lauda still has a arrival, a arrivalDelay and a arrivalPlatform, every departure-tag is set to null. I'm guessing that cancelled might only be an indicater whether the train still departs from this stop.

To Reproduce
Find a Train with cancelled last stop.

Expected behavior
Show the correct stops.

Additional context
Tested on 2020-02-21 with 1|262777|0|80|21022020 between 15:50 and 16:10.

API-Response:

{"origin":{"type":"stop","id":"8000096","name":"Stuttgart Hbf","location":{"type":"location","id":"8000096","latitude":48.785052,"longitude":9.182589},"products":{"nationalExpress":true,"national":true,"regionalExp":true,"regional":true,"suburban":true,"bus":true,"ferry":false,"subway":false,"tram":true,"taxi":false}},"destination":{"type":"stop","id":"8000260","name":"Würzburg Hbf","location":{"type":"location","id":"8000260","latitude":49.802163,"longitude":9.93593},"products":{"nationalExpress":true,"national":true,"regionalExp":false,"regional":true,"suburban":false,"bus":true,"ferry":false,"subway":false,"tram":true,"taxi":false}},"departure":"2020-02-21T15:05:00+01:00","arrival":null,"reachable":true,"line":{"type":"line","id":"re-8","fahrtNr":"19074","name":"RE 8","public":true,"mode":"train","product":"regional","operator":{"type":"operator","id":"go-ahead-baden-wurttemberg-gmbh","name":"Go-Ahead Baden-Württemberg GmbH"},"additionalName":"RE 8"},"direction":"Würzburg Hbf","arrivalPlatform":null,"departurePlatform":"5","stopovers":[{"stop":{"type":"stop","id":"8000096","name":"Stuttgart Hbf","location":{"type":"location","id":"8000096","latitude":48.785052,"longitude":9.182589},"products":{"nationalExpress":true,"national":true,"regionalExp":true,"regional":true,"suburban":true,"bus":true,"ferry":false,"subway":false,"tram":true,"taxi":false}},"arrival":null,"arrivalDelay":null,"arrivalPlatform":null,"departure":"2020-02-21T15:05:00+01:00","departureDelay":null,"departurePlatform":"5"},{"stop":{"type":"stop","id":"8000235","name":"Ludwigsburg","location":{"type":"location","id":"8000235","latitude":48.892374,"longitude":9.185115},"products":{"nationalExpress":true,"national":false,"regionalExp":false,"regional":true,"suburban":true,"bus":true,"ferry":false,"subway":false,"tram":false,"taxi":false}},"arrival":"2020-02-21T15:16:00+01:00","arrivalDelay":null,"arrivalPlatform":"1","departure":"2020-02-21T15:19:00+01:00","departureDelay":null,"departurePlatform":"1"},{"stop":{"type":"stop","id":"8000038","name":"Bietigheim-Bissingen","location":{"type":"location","id":"8000038","latitude":48.948044,"longitude":9.137499},"products":{"nationalExpress":false,"national":false,"regionalExp":false,"regional":true,"suburban":true,"bus":true,"ferry":false,"subway":false,"tram":false,"taxi":false}},"arrival":"2020-02-21T15:26:00+01:00","arrivalDelay":null,"arrivalPlatform":"10","departure":"2020-02-21T15:29:00+01:00","departureDelay":null,"departurePlatform":"10"},{"stop":{"type":"stop","id":"8000157","name":"Heilbronn Hbf","location":{"type":"location","id":"8000157","latitude":49.143245,"longitude":9.207579},"products":{"nationalExpress":true,"national":false,"regionalExp":false,"regional":true,"suburban":true,"bus":true,"ferry":false,"subway":false,"tram":false,"taxi":false}},"arrival":"2020-02-21T15:47:00+01:00","arrivalDelay":null,"arrivalPlatform":"3","departure":"2020-02-21T15:48:00+01:00","departureDelay":null,"departurePlatform":"3"},{"stop":{"type":"stop","id":"8004220","name":"Neckarsulm","location":{"type":"location","id":"8004220","latitude":49.188668,"longitude":9.219759},"products":{"nationalExpress":false,"national":false,"regionalExp":false,"regional":true,"suburban":true,"bus":true,"ferry":false,"subway":false,"tram":false,"taxi":false}},"arrival":"2020-02-21T15:52:00+01:00","arrivalDelay":null,"arrivalPlatform":"1","departure":"2020-02-21T15:52:00+01:00","departureDelay":null,"departurePlatform":"1"},{"stop":{"type":"stop","id":"8000017","name":"Bad Friedrichshall Hbf","location":{"type":"location","id":"8000017","latitude":49.231205,"longitude":9.200091},"products":{"nationalExpress":false,"national":false,"regionalExp":false,"regional":true,"suburban":true,"bus":true,"ferry":false,"subway":false,"tram":false,"taxi":false}},"arrival":"2020-02-21T15:57:00+01:00","arrivalDelay":0,"arrivalPlatform":"3","departure":"2020-02-21T15:58:00+01:00","departureDelay":0,"departurePlatform":"3"},{"stop":{"type":"stop","id":"8004050","name":"Möckmühl","location":{"type":"location","id":"8004050","latitude":49.321187,"longitude":9.357977},"products":{"nationalExpress":false,"national":false,"regionalExp":false,"regional":true,"suburban":false,"bus":true,"ferry":false,"subway":false,"tram":false,"taxi":false}},"arrival":"2020-02-21T16:14:00+01:00","arrivalDelay":0,"arrivalPlatform":"2","departure":"2020-02-21T16:15:00+01:00","departureDelay":0,"departurePlatform":"2"},{"stop":{"type":"stop","id":"8000295","name":"Osterburken","location":{"type":"location","id":"8000295","latitude":49.42992,"longitude":9.422996},"products":{"nationalExpress":false,"national":false,"regionalExp":false,"regional":true,"suburban":true,"bus":true,"ferry":false,"subway":false,"tram":false,"taxi":true}},"arrival":"2020-02-21T16:26:00+01:00","arrivalDelay":0,"arrivalPlatform":"4","departure":"2020-02-21T16:27:00+01:00","departureDelay":0,"departurePlatform":"4"},{"stop":{"type":"stop","id":"8000221","name":"Lauda","location":{"type":"location","id":"8000221","latitude":49.56537,"longitude":9.70959},"products":{"nationalExpress":false,"national":false,"regionalExp":false,"regional":true,"suburban":false,"bus":true,"ferry":false,"subway":false,"tram":false,"taxi":true}},"arrival":"2020-02-21T16:49:00+01:00","arrivalDelay":0,"arrivalPlatform":"3","departure":null,"departureDelay":null,"departurePlatform":null,"cancelled":true,"formerDepartureDelay":null,"scheduledDeparture":"2020-02-21T16:50:00+01:00"},{"stop":{"type":"stop","id":"8000260","name":"Würzburg Hbf","location":{"type":"location","id":"8000260","latitude":49.802163,"longitude":9.93593},"products":{"nationalExpress":true,"national":true,"regionalExp":false,"regional":true,"suburban":false,"bus":true,"ferry":false,"subway":false,"tram":true,"taxi":false}},"arrival":null,"arrivalDelay":null,"arrivalPlatform":null,"departure":null,"departureDelay":null,"departurePlatform":null,"cancelled":true,"formerArrivalDelay":null,"scheduledArrival":"2020-02-21T17:20:00+01:00","remarks":[]}],"remarks":[{"text":"Number of bicycles conveyed limited","type":"hint","code":"bicycle-conveyance","summary":"bicycles conveyed"},{"type":"hint","code":"GL","text":"Conveyance of groups is limited"},{"text":"Behindertengerechtes Fahrzeug","type":"hint","code":"barrier-free-vehicle","summary":"barrier-free vehicle"}],"cancelled":true,"arrivalDelay":null,"scheduledArrival":"2020-02-21T17:20:00+01:00","id":"1|262777|0|80|21022020"}

Shortcut to grab avatar from Mastodon

Is your feature request related to a problem? Please describe.
I'd like to set my social avatar as my Träwelling image, but I don't have it handy.

Describe the solution you'd like
If my Träwelling account connected to my Mastodon Account, I'd like to have a shortcut that grabs my avatar and uploads it to Träwelling. It's squared already, so no more steps needed.

Describe alternatives you've considered

Additional context

API: OpenAPI schema errors

StatusPaginate schema:

  • prev_page_url is not marked nullable
  • next_page_url is not marked nullable

Status schema:

  • links_count is send as a integer and not as a string.
  • liked field is missing entirely, there is how ever an undocumented favorited field
  • body not marked as nullable

Station schema:

  • latitude is send as a string and not as a float
  • longitude is send as a string and not as a float

TrainCheck schema:

  • delay is not marked nullable

HafasTrip:

  • polyline is missing and not marked as nullable
  • delay is not marked nullable

En Route map doesn't show journeys from/to FF

Describe the bug
The en route map sometimes doesn't show journeys from/to Frankfurt(Main) Hbf and/or they're longer than 1h. I don't know why, and I don't know how, but that seems to be the only connection between all journeys that are hidden.

To Reproduce
Steps to reproduce the behavior:

  1. Check into any train from/to ds100:FF.
  2. Open the "en route" page.

Expected behavior
The polyline is displayed

Screenshots
grafik

Desktop (please complete the following information):

  • OS: Windows 10
  • Browser Firefox
  • Version 73

Additional context
The issue sometimes happens on other journeys, too - so I guess it's another flaw.

Related Gitlab issue

Duplicate date heading

Describe the bug
The date of the status is shown twice.

To Reproduce
Steps to reproduce the behavior:

  1. Visit a /status/{id} page.

Expected behavior
The date is only shown once.

Screenshots

grafik

Desktop (please complete the following information):
any.

Protect against CSRF attacks

Some routes carry out actions without having checked whether the user really wants to carry them out. A CSRF protection should be used. In addition, the routes from GET to POST
(or PUT, DELETE, ...) change.

Affected e.g.

  • GET: /settings/deltoken/{id}
  • GET: /settings/delsession

The API should use ISO8601

Is your feature request related to a problem? Please describe.
The API returns a non-standardized date format for things like created_at or updated_at.

Describe the solution you'd like
Change non-standardized timestamps to a more common standard like ISO8601 or Unix timestamp.

Notification System

Is your feature request related to a problem? Please describe.
I'd like to be notified whenever something happens on Träwelling that I might be concerned about. Thinking of:

  • Someone followed me
  • Someone liked my status
  • Someone checked into my connection (previously done with Twitter DMs)
  • My Social Post was unsuccessful (Mastodon instance offline, Twitter key revoked, big whale time)

Describe the solution you'd like

  • "bell button" in Träwelling which shows all read and unread notifications of all types, comparable with Facebook and Twitter.
  • Service Worker / PWA-Notifications?

Describe alternatives you've considered
Mail notifications? Telegram messages?

Additional context

Possible UI of notification center

This is a larger project that can be implemented in several steps. Please refer this issue whenever you implement one of the given examples.

Please close this issue once all examples are implemented.

API: /auth/login returns 400 when password is empty

Describe the bug
When sending a request to the /auth/login endpoint with the password field being a empty string, it returns a 400 bad request.

To Reproduce
Steps to reproduce the behavior:
curl 'https://traewelling.de/api/v0/auth/login' -H 'content-type: application/json' --data-raw '{"email":"[email protected]","password":""}'
4. See HTTP status code

Expected behavior
Responses with 401 Unauthorized.

API: /trains/checkin does not report an error when using an unauthorized bearer token

Describe the bug
When checking into a train via /trains/checkin using an unauthorized bearer token, the server does not return an error such as HTTP 401. Instead, it returns an HTTP 302 redirect to the HTML login page.

To Reproduce
Steps to reproduce the behavior:

  1. Obtain a token from the API, e.g. via curl or travelynx.de
  2. Revoke the token from the Träwelling settings page
  3. Use /trains/checkin to check into a train

Expected behavior
The server should return HTTP 401 and preferably a JSON document explaining the error instead of HTML.

Note that I did not test whether this also happens with entirely invalid bearer tokens.

Travelynx Log

-- Non-blocking request (https://traewelling.de/api/v0/trains/checkin)
-- Reusing connection e0813e072e572ed952a845dea5dd99ae (https://traewelling.de:443)
-- Client >>> Server (https://traewelling.de/api/v0/trains/checkin)
POST /api/v0/trains/checkin HTTP/1.1\x0d
Content-Length: 103\x0d
Accept-Encoding: gzip\x0d
Authorization: Bearer [redacted]\x0d
Content-Type: application/json\x0d
Host: traewelling.de\x0d
User-Agent: travelynx/1.17.5-11-g562dd7c-dirty on / +https://finalrewind.org/projects/travelynx\x0d
\x0d
{"destination":"8000142","start":"8000080","toot":false,"tripID":"1|221647|5|80|4102020","tweet":false}
-- Client >>> Server (https://traewelling.de/api/v0/trains/checkin)

-- Client <<< Server (https://traewelling.de/api/v0/trains/checkin)
HTTP/1.1 302 Found\x0d
Date: Sun, 04 Oct 2020 10:33:56 GMT\x0d
Content-Type: text/html; charset=UTF-8\x0d
Transfer-Encoding: chunked\x0d
Connection: keep-alive\x0d
Server: nginx\x0d
Cache-Control: no-cache, private\x0d
X-RateLimit-Limit: 60\x0d
X-RateLimit-Remaining: 56\x0d
Location: https://traewelling.de/login\x0d
X-Xss-Protection: 1; mode=block\x0d
X-Frame-Options: SAMEORIGIN\x0d
Strict-Transport-Security: max-age=31536000\x0d
X-Content-Type-Options: nosniff\x0d
Referrer-Policy: strict-origin-when-cross-origin\x0d
\x0d
166\x0d
<!DOCTYPE html>
<html>
    <head>
        <meta charset="UTF-8" />
        <meta http-equiv="refresh" content="0;url='https://traewelling.de/login'" />

        <title>Redirecting to https://traewelling.de/login</title>
    </head>
    <body>
        Redirecting to <a href="https://traewelling.de/login">https://traewelling.de/login</a>.
    </body>
</html>\x0d

-- Client <<< Server (https://traewelling.de/api/v0/trains/checkin)
0\x0d
\x0d

Wrong Distance in ringlines

This bug results from #37, #38 and possibly #10.

Describe the bug
If travelling in a ringline, the wrong distances are calculated.

To Reproduce
See #37 and #10

Expected behavior
The correct travelled distance

Calculating the real distances (That does not work yet since len(Polyline-Points) != len(Stopovers) and the polyline points don't know when the train stops there).

Display delays in the status card

Is your feature request related to a problem? Please describe.

I'd like to save that my trip was delayed, or even built up a delay during the ride.

Describe the solution you'd like

  • Show the delays (at the departure and the arrival) in the status card.
  • Update the arrival delays (via cron?)
  • Find a way to deal with late-checkins

Describe alternatives you've considered

  • Manual text inputs that I can fill if I care about that stuff.

Additional context

  • After scheduled+delay, Deutsche Bahn won't tell us that this train is delayed. We'd have to check that earlier.
  • There is a delay field in one of the database tables but god knows what it does (how accurate that information is at what time for which station).
  • Related Gitlab issue

Location based Station Search

Is your feature request related to a problem? Please describe.

I don't know the "real" name of the station that I'm departing from, but my phone has a GPS locator that you could use.

Describe the solution you'd like

With the push of a button (in includes/station-autocomplete.blade.php), my phone gives Träwelling its location, Träwelling looks it up and opens the first step to check-in.

Träwelling uses the db-rest station search API to find the closest station.

Describe alternatives you've considered

Träwelling tries to find the closest station out of the known stations in thetrain_stations table.

Additional context

db-rest's location api seems to be broken, related issue in their project

Related Gitlab issue

API: Return status ID on checkin

Is your feature request related to a problem? Please describe.
After performing a checkin via Traewelling's API, I might want to update the status text or delete it. To do so, I need the status ID – however, /trains/checkin does not provide it

Describe the solution you'd like
The object returned by /trains/checkin should include the ID of the status created by the checkin.

Describe alternatives you've considered
Workaround: query /user/{name} after checking in and extract the status ID from the latest checkin.

API: HafasTrip: replace polyline hash with actual polyline polygon data

Is your feature request related to a problem? Please describe.
The HafasTrip that is returned with a status contains a polyline field its seams to be some datebase internal hash. This is quite useless while working with the API

Describe the solution you'd like
Replacing the polyline hash with the actual polyline polygon data

Describe alternatives you've considered
A possible alternative would be a separate endpoint to request this data, but this could create a high request load while loading multiple polylines in a frontend. A possible solution to this problem would be a API that allow to request multiple polyline polygon.

Visiting a profile without linked Mastodon account throws error 500

Describe the bug
Visiting a profile without linked Mastodon account throws error 500.

To Reproduce
Steps to reproduce the behavior:

  1. Create a profile without Mastodon, so that no Mastodon server domain is set (e.g. in local testing)
  2. Go to own profile
  3. See error

Expected behavior
The profile gets displayed.

Screenshots
Screenshot_2020-03-23 Whoops There was an error

Desktop:

  • OS: Debian 10 Buster
  • Browser: Firefox ESR
  • Version: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Firefox/68.0

Additional context
I cannot confirm if this also happens in production, but in every testing and dev installation of mine it happens.

Twitter caches the profile picture after update

Describe the bug
Twitter likes to cache the profile picture which it grabs from the Open Graph tags. Our software does not communicate cache resets when Twitter reaches for https://traewelling.de/profile/{username}/profilepicture.

To Reproduce
0. Connect your Träwelling account with Twitter.

  1. Check into a journey and tweet about it.
  2. See your picture in the tweet card.
  3. Change your profile picture in settings.
  4. Check into another journey and tweet about it again.
  5. The twitter card has the old picture.

Expected behavior
Träwelling communicates the change to Twitter, Twitter fetches a new picture.

Additional context

Sort Dashboard by departure time

Describe the bug

The dashboard should be sorted by departure time and not by the creation-date since you should have the possibility to enter old trains.

But I don't know how, since laravel won't paginate Eloquent-requests sorted by relational columns like in getActiveStatuses() in the StatusController.

Those statuses appear to be in the wrong order

Affected Pages

  • Dashboards (local and global)
  • Profile page
  • En Route
  • Events page

Additional context
Related Gitlab issue

API: /trains/checkin will always post a tweet

Describe the bug
Given that your Traewelling account is linked with your Twitter account, checking into a train using /trains/checkin with valid tripID, start and stop station (with workaround described in #72) will always post a tweet no matter what the "tweet" option is set to.

To Reproduce
Have your Traewelling account linked with your Twitter account. Then:

curl -v https://traewelling.de/api/v0/trains/checkin -H 'authorization: Bearer ...' -H 'content-type: application/json' -d '{"tripID":"...","start":"...","destination":"...","tweet":false,"toot":false,"body":null}'

This will always result in a tweet on Twitter, even if "tweet" is false.

Expected behavior
No tweets should be posted if "tweet" is false.

Check if Account has set an E-Mail Address

Removing the SSO provider checks that the account has a password set, but does not that an email address is set.

It should be checked as a user without an email address but with a password cannot log in... :D

API: /auth/login: Provide a custom clientName for the API token list

Issue:
https://traewelling.de/settings lists all API Tokens as belonging to the "Träwelling Personal Access Client" service. When a user has logged into Traewelling via more than one API client, this makes it hard to revoke access to a specific app. It's also unclear which apps have been granted access to the user's Traewelling account.

Suggestion:
Add clientName and (perhaps) URL parameters to /auth/login and list them in the API Token overview.

"Fix" pwa-fix

Describe the bug
When clicking a link on the laravel debugging bar (in dev-env) i got redirected to another page with "null" in the url.
It's caused by the ressources/js/components/pwa_fix.js, but I don't know how to fix.

To Reproduce
Steps to reproduce the behavior:

  1. Go to any page within dev-environment so you have laravel debugging bar at the bottom
  2. Click on Queries
  3. You will be redirected to another page

Expected behavior
The Debugging Bar will open instead of redirect.

Session dont get destroyed

Describe the bug
When clicking in the Settings on the button to destroy all Sessions I will redirected to the welcome page, but are still logged in.

To Reproduce
See Description.

Expected behavior
I expected to be logged out.

Desktop (please complete the following information):
macOS, Google Chrome. But this is likely a server side bug.

Timezones are hard.

Describe the bug
Träwelling is very CES*T focused, Trains in Romania (UTC+2) seem to depart in the past.

What is even happening with connections that go over borders? France-UK, Spain-Portugal?

To Reproduce
Steps to reproduce the behavior:

  1. Search for a non-CES*T station
  2. Compare the departure times with your request times.

Expected behavior
The results depart in the -5 to +15min interval that is requested.

Screenshots
grafik

Desktop (please complete the following information):

  • OS: macOS 10.14.6
  • Browser Firefox 68.2.0esr
  • System Timezone: UTC+1

Additional context

On the other hand try to check in to a train in London: The returned trains seem okay, but when you select your destination all stations are one hour in the future.

Related Gitlab issue

Set the default visibility for Mastodon Toots

If a user shares their status on Mastodon, it will always post with the visibility "unlisted".

The user should be able to decide for themselves which visibility setting they like.

Negative trip times

Describe the bug
https://traewelling.de/status/129666 (which also seems to suffer from the bug described in #10) and https://traewelling.de/status/129656 are trips with a negative journey time. The bus/train also seems to arrive at the destination before it leaves at the start.

To Reproduce
Steps to reproduce the behavior:

  1. Search for Höhenstr., Potsdam
  2. Select an 603 bus to Platz der Einheit/West, Potsdam
  3. Check-in until Rathaus, Potsdam (any other stop might also work)
  4. Check the logged journey time as well as the arrival and departure times

Alternatively:

  1. Search for Berlin Westkreuz
  2. Select an S 42 train to Berlin Südkreuz (S)
  3. Check-in until Berlin-Tempelhof (any other stop after that might also work)
  4. Check the logged journey time as well as the arrival and departure times

Expected behavior
The logged journey time should not be negative and the bus/train should not arrive before it has started. Also, the arrival time should be correct (the departure time is already correct).

Additional context
The bug seems to happen when two busses (one-way and back) or two trains (two times around the circle) are squeezed into a single hafas trip. When this happens, stations can appear multiple times in one trip. It seems like Traewelling then internally chooses the first time a station appears in the trip as the destination, rather than that one the user really chose.

HTTP 500 if a wrong IBNR is supplied in the checkin-endpoint

Describe the bug
HTTP 500 error occurs if a wrong IBNR is supplied in the checkin-endpoint
"message": "Undefined offset: 0",\n
"exception": "ErrorException",\n
"file": "/home/herrlevin_/PhpstormProjects/traewelling/app/Http/Controllers/Controller.php",\n

To Reproduce
Steps to reproduce the behavior:

  1. Send checkin to /api/v0/trains/checkin with wrong start (e.g. asdf)

Expected behavior
throw HTTP 400

Screenshots
If applicable, add screenshots to help explain your problem.

Additional context
API DEV-Branch

Marking commuter journeys, railroad workers, private trips

Is your feature request related to a problem? Please describe.

  • As a commuter, I'd like to track my journeys for tax reasons.
  • As a railroad worker (Tf, ZuB, KIN, etc.), I'd like to seperate my work from the rest of my trips. I, too, have deducible journeys that I'd like to track for tax reasons.
  • As a private traveller, I'd like to keep my holiday trips out of my tax returns.

Describe the solution you'd like
On check-in (and later), I'd like to flag my status as a commuter trip or as a work trip. When I export my data, I'd like to have a filter.

Describe alternatives you've considered

--

Additional context

TRWL beta had this feature, but it was removed before the release. The feature did not seperate between commuters and rail workers, but rather just splitted between business and private trips. See db9362cf41d08211e4ecb439b2e94dccc2b1d6b4 which reverts the frontend code.

Gitlab issue regarding the feature removal and how we could split trips

Allow entering train number directly

Is your feature request related to a problem? Please describe.
It is way harder for me to look up and find the nearest/last train stop, then look at the big sign or iceportal.de or so top find out my three/four-digit train number.
Also, these are way more characters to write (and make typos). And if you have written these letters completely (and correctly) I may already be at the next train stop… 😜

Describe the solution you'd like
In the search at "Where are you?" it should allow me to enter "ICE 1234" etc.

Describe alternatives you've considered
Current state: I need to enter the station and then additionally select the train.
If you need the station, do it in the reverse way (optionally): If I enter/select a train first, then offer me to select the station afterwards.

Also, I see much more trains at one station usually (if you have a big main station or so), so it is really hard to select the correct one.
Entering the train number seems easy though. Then you can easily select the train stop (there likely are not that much).

Additional context
Of course, you can just implement this in addition to the current mechanism.

Stations "for exit only" resulting in a crash

Describe the bug
If you're trying to check into a train which only stops to let people exit, Träwelling crashes, since there's no departure time.

To Reproduce
Steps to reproduce the behavior:

  1. Go to any train with a "exit only" (e.g. ICE 619 in Frankfurt(M) Flughafen Fernbf, arrival 23:41)
  2. Check in

Expected behavior
Successful checkin

Cannot remove SSO provider even if another is set

Describe the bug
I can't remove one Single Sign-On provider, although another one is set.

To Reproduce
Preconditions:

  • Have more than one SSO provider linked to your profile (e.g. Mastodon and Twitter)
  • Have no e-mail and password set for the account
  1. In your profile settings scroll down to Connected Services
  2. Click Disconnect on one of them

Expected behavior
I can remove one of the SSO providers because a 2nd one is set

Actual behavior
Error message saying I need to set a password before disconnecting an SSO provider

Additional context

API: /auth: Return login token expiration timestamp

Is your feature request related to a problem? Please describe.
According to the user settings page, a bearer token obtained by logging into the API expires one year after it has been obtained. The expiration timestamp or duration is not available via the API itself, so warning users that their login token is about to expire is only possible by hardcoding one year from login into an API client.

Describe the solution you'd like
/auth/signup and /auth/login should return the expiration timestamp in addition to the bearer token.

Describe alternatives you've considered
Alternatively, the swagger docs should state that bearer tokens expire after one year (and this time shouldn't be changed without bumping the API version)

Progressbar and date missing.

Describe the bug
The progressbar and date will not show up in the active statuses or the profile page if you're not logged in.

To Reproduce
Steps to reproduce the behavior:

  1. Log out
  2. Go to "en route" or a profile page

Screenshots
Logged in:
Screen Capture_select-area_20201005105059
Logged out:
Screen Capture_select-area_20201005105052

Expected behavior
See the progress bar progressing and the date above the status.

Desktop (please complete the following information):

  • OS: Arch Linux (5.8.12-arch1-1)
  • Browser Chromium
  • Version 85.0.4183.121 (Official Build) Arch Linux (64-bit)

"Fast checkin" results in a 500 when checking into cancelled last stops

Describe the bug
When checking into a train with cancelled last stop, the "fast checkin"-button results in a 500 since Träwelling tries to check in with the cancelled stop as last stop.

To Reproduce
Steps to reproduce the behavior:

  1. Go to a train with cancelled last stop
  2. Click on the Fast Forward-Button in the top right

Expected behavior
Either hide the button or check in until the last available station.

Desktop (please complete the following information):

  • OS: Ubuntu 18.04.3
  • Browser: Chromium
  • Version: 80.0.3987.87

Smartphone (please complete the following information):

  • Device: iPhone 8
  • OS: iOS 13.3.1
  • Browser: Safari

API doesn't set CORS header in response

Describe the bug
When sending a request to the official traewelling instance at https://traewelling.de/api/. The CORS header Access-Control-Allow-Origin isn't set in the response with causes the browser to block the request. This make it impossible to create any kind of third party web app.

To Reproduce
Steps to reproduce the behavior:

  1. Send a OPTION request to any API endpoint curl -i https://traewelling.de/api/v0/auth/login -X OPTIONS
  2. See missing Access-Control-Allow-Origin header

Expected behavior
The Access-Control-Allow-Origin being set to * for all API endpoints.

Desktop (please complete the following information):

  • OS: FreeBSD
  • Browser firefox, curl
  • Version firefox 81, curl 7.72.0

API: /trains/checkin only works after requesting /trains/trip

Describe the bug
Checking into a train using /trains/checkin and a valid tripID, start and stop station results in HTTP 500 unless a request to /trains/trip is sent first.

To Reproduce

curl  -X POST -H "Content-Type: application/json" -H "Authorization: Bearer ..." https://traewelling.de/api/v0/trains/checkin --data '{"tripID":...}'

-> HTTP 500 "Server Error"

curl  -H "Content-Type: application/json" -H "Authorization: Bearer ..." 'https://traewelling.de/api/v0/trains/trip?tripID=...&lineName=...&start=...'
curl  -X POST -H "Content-Type: application/json" -H "Authorization: Bearer ..." https://traewelling.de/api/v0/trains/checkin --data '{"tripID":...}'

-> works fine

Expected behavior
/trains/checkin should work regardless of previous /trains/trip requests.

Private Accounts

Is your feature request related to a problem? Please describe.

I want to track my public transport journeys, but I don't want to share them.

Describe the solution you'd like

  • New followers need to be accepted (see Twitter's protected accounts).
  • Only those can see my check-ins and everything on my profile page.
    - [ ] I can mark some of my check-ins as unlisted (next to the "tweet" / "toot" checkboxes) (Moved to #305)
  • My private check-ins don't appear on maps ("en route" or event pages)
    - [ ] I can change the visibility of a check-in afterwards. (Moved to #305)

Describe alternatives you've considered

Marking a user account and all of its check-ins as insivible is a good first step.

Additional Context

Related Gitlab issue

Export journeys as ICS

Is your feature request related to a problem? Please describe.
I love myself a tidy calendar that has all my checked-in journeys. I'm using subscribable calendars already and know how to deal with them.

Describe the solution you'd like
Offer .ics files as an export option for a given timespan, comparable with the export options that exist.

Describe alternatives you've considered
Offer a tokenized link that my calendar app of choice can read periodically. Issue here is, that those files become very large. Maybe a mix of both options?

Additional context

Export not working with Firefox Preview (Mobile)

Describe the bug
Trying to export the data of any timespan fails and results in a download of the html source, but with the file name and extension of the expected result.

To Reproduce
Use the Export function in Firefox Preview Mobile

Expected behavior
Exported data as in any other browser

Smartphone (please complete the following information):

  • Device: Samsung Galaxy S8
  • OS: Android 9
  • Browser: Firefox Nightly for Developers
  • Version: 200706 06:01

Hours missing on status

Describe the bug
When travelling exactly 1 hour, the status only displays "0 min"

To Reproduce
Steps to reproduce the behavior:

  1. Travel exactly 1 hour
  2. See "0 min" on status

Expected behavior
Display the time correctly

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: Ubuntu 18.04
  • Browser Chrome
  • Version 80.0.3987.87

Smartphone (please complete the following information):

  • Device: iPhone 8
  • OS: iOS 13.13.1
  • Browser safari

Additional context
Behaviour can be seen here: https://traewelling.de/status/128386

Mastodon link for profile verification

Is your feature request related to a problem? Please describe.
I'd like to link to my Träwelling profile from Mastodon and show that those profiles belong to the same identity.

Describe the solution you'd like
Mastodon can "verify" links, if they have a rel="me" link like this:

<a rel="me" href="https://uelfte.club/@jannik">Mastodon</a>

Describe alternatives you've considered

Additional context

Login redirects to "/notifications/latest"

Describe the bug
After login, the user gets redirected to /notifications/latest. This results in the delivery of the corresponding JSON file.

To Reproduce
Steps to reproduce the behavior:

  1. Go to login page, unauthenticated.
  2. Login with credentials (tested with mail login, not social)
  3. you get served a JSON file.

Expected behavior
After login, the user gets redirected to his dashboard.

Desktop (please complete the following information):

  • OS: Debian 10 Buster
  • Browser: Mozilla Firefox
  • Version: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Firefox/68.0

Additional context
Commit: 1c55723227b1399d623ad3f4906420eebd8bb130

0km bus ride because saarVV is weird

Describe the bug
https://traewelling.de/status/118639 is a 0km bus ride, because the RMV is doing weird things with Hafas.

To Reproduce
Steps to reproduce the behavior:

  1. Search for Homburg Hbf
  2. Select an R7 bus to ZOB (Stadtmitte), Zweibrücken
  3. Check-in until ZOB (Stadtmitte), Zweibrücken.
  4. Check the logged distance

Expected behavior
The distance is correct (~ 13km).

Screenshots
grafik

Additional context

RMV seems to squeeze two busses (one-way and back) into a single hafas trip (see attached screenshot from the API). While this does not explain the error on this particular journey, it certainly contributes to its weirdness.

„Delete profile picture“ option missing

Describe the bug
A button to delete the profile picture is missing until the file is deleted / no avatar is set.

To Reproduce
Steps to reproduce the behavior:

  1. Go to Settings page with active profile picture
  2. See no button
  3. Delete entry in database
  4. See button

Expected behavior
A button to delete you current profile picture is displayed on settings page.

Screenshots

Desktop (please complete the following information):

  • OS: macOS, Debian
  • Browser Firefox, Safari
  • Version NaN

Smartphone (please complete the following information):

  • Device: iPhone 7
  • OS: iOS 13.5
  • Browser Safari, Firefox mobile
  • Version current / NaN

Additional context
The button is hidden in html source via CSS class. The class should be removed if active picture is set in database.

undefined over Blog Posts

Describe the bug
Over blog posts, there is a <h5>undefined</h5> that should not be there.

To Reproduce
Steps to reproduce the behavior:

  1. Go to a blog post.
  2. See the error on top.

Expected behavior
Nothing.

Screenshots
grafik

Desktop (please complete the following information):

  • OS: Windows
  • Browser: Firefox
  • Version: 77

Additional context
Seems to be connected with the JS code in components/status.js.

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.