4
0

ratelimiting.adoc 777 B

123456789101112131415161718192021222324252627282930
  1. [#ratelimits]
  2. = Rate limiting
  3. By default, OliveTin allows you to execute actions as fast as you can click the button. This is fine if you are running OliveTin with trusted users in a trusted environment, but otherwise you may want to rate limit actions.
  4. Rate limiting is implemented like this;
  5. [source,yaml]
  6. .`config.yaml`
  7. ----
  8. actions:
  9. - title: date
  10. shell: date
  11. icon: clock
  12. maxRate:
  13. - limit: 3
  14. duration: 5m
  15. ----
  16. If you try to execute `date` more than 3 times in 5 minutes, you will get a log message in the UI that looks like this;
  17. image::maxRate.png[]
  18. Additionally, OliveTin will also output this to it's process log;
  19. ----
  20. INFO Blocked from executing. This action has run 3 out of 3 allowed times in the last 5m. actionTitle="date"
  21. ----