Repository navigation
Sync a plugin right after it's switched on, and a "Sync now" button #1420
Replies: 2 comments
|
We have been hesitant to give individual users control over the plugin sync schedule precisely for the DDoS reason you mention. Feel free to create a PR for it, but there need to be measures (timeout, max requests, rate limiter etc.) in place that prevent a user from sending a large number of requests at once. This should also be configurable by an admin via an ENV var or similar. |
|
Thanks, that makes sense. I've built it with three limits, each set by an env var:
The limits are kept in server memory, not on the plugin instance, because users can edit their own It builds on the sync fixes in #1423, so I'll open it once that one is in, using the instance lock from slothful-vassal's reference branch. If you'd like other defaults, let me know! Best, Simon |
Uh oh!
There was an error while loading. Please reload this page.
Hi,
I connected the Komoot plugin on my instance today, and nothing came in until the nightly sync. That's the
plugin-synccron atPOCKETBASE_CRON_SYNC_SCHEDULE, 02:00 UTC by default (db/main.go), and it's the only thing that callssyncPluginInstance(db/routes/plugin_system_sync.go). The only manual way I found is the Crons page in the PocketBase dashboard, which needs a superuser and syncs every user at once.For a new user it looks like the plugin doesn't work. Two small things would help:
Both would sync only that user's instance and keep the existing retry backoff (
retry_not_before), so nobody can hammer Komoot or Strava with it. A short cooldown between manual syncs could help too.Would you take a PR for this? I'd add a route in
db/routes, the button onsettings/plugins, and tests for the route. Happy to change the shape to whatever you prefer.Best,
Simon
All reactions