Skip to content

Conversation

@NoamGaash
Copy link
Member

will let the user make an official complaint to the Israeli MOT

@NoamGaash NoamGaash requested review from OriHoch and xoRmalka January 20, 2024 14:54
Copy link
Contributor

@OriHoch OriHoch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Running a browser is very resource intensive, giving end user control over starting a browser is very risky and potential for problems like very easy DDOS. At a minimum this should be a different container, but need to see how much resources it needs

I would suggest the following changes:

  • The API endpoint only saves the complaints locally in DB
  • Daily cronjob takes the complaints from DB and runs the browser to send them
  • Have some limitation over the number of complaints and/or length of time the cronjob runs - to prevent denial of service.
  • Code can remain in this repo if you want but we should not include all the playwright dependencies in the backend api as it will make a huge container, should seperate to 2 containers - 1 with playwright and 1 without

regarding implementation - can do it using a Kubernetes cronjob - I can create that for you if you have a container which does the job

@OriHoch
Copy link
Contributor

OriHoch commented Jan 21, 2024

I think we might also encounter rate limiting / security blocks from the MOT side, but we will see, we have some whitelisted IPs on gov sites so it might not block them

@NoamGaash
Copy link
Member Author

@OriHoch I've used the isBusy flag to prevent DDOS attacks - there will be only one browser instance at a time, and until one complaint is finished, others can't be started. I thought about having the complaints raw data stored in SQS, and getting a worker to pull from the queue. Anyway, maybe we should consider placing a captcha to prevent abusing this service

AvivAbachi added a commit that referenced this pull request Jun 30, 2025
AvivAbachi added a commit that referenced this pull request Jul 1, 2025
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.

3 participants