Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow to set a timeout for searches #445

Merged
merged 1 commit into from
Feb 22, 2024

Conversation

jbruechert
Copy link
Contributor

@jbruechert jbruechert commented Feb 18, 2024

If supported by the chosen router, it will stop expanding its search interval after the given timeout.

Depends on motis-project/nigiri#68

Workarounds #443 enough to not be a blocker for public hosting.

Let me know if this is generally something you want, and if I should change anything about the implementation.

If supported by the chosen router, it will stop expanding its search
interval after the given timeout.
@felixguendling
Copy link
Member

If you want to prevent a malicious user from using CPU resources, this won't be sufficient, because this only "protects" the intermodal API, not the routing API. Make sure to have a whitelist of API endpoints (that doesn't contain the /nigiri or /routing endpoint) in some kind of reverse proxy / load balancer in front of MOTIS. You probably also need to have rate limits in your reverse proxy.

@jbruechert
Copy link
Contributor Author

Thanks for the hints.

I may add similar things for more endpoints in the future, but for now I'll only allow tested ones.

Right now I am still worried less about malicious users, but more about well-intending ones causing long running tasks by accident.

@jbruechert
Copy link
Contributor Author

Is there still anything that needs to be done on this?

@felixguendling
Copy link
Member

The CI build is all red, so there seem to be errors in the code.

@jbruechert
Copy link
Contributor Author

The CI builds against nigiri without my changes I think, so that's to be expected

@felixguendling felixguendling merged commit 98e4158 into motis-project:master Feb 22, 2024
5 of 19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants