openzim / zimfarm

Farm operated by bots to grow and harvest new zim files
https://farm.openzim.org
GNU General Public License v3.0
81 stars 24 forks source link

Slash in schedule/recipe name is causing issues #896

Open benoit74 opened 6 months ago

benoit74 commented 6 months ago

Problem

When we put a slash / in a recipe name, this seems to be saved to the database properly but afterwards we cannot open the recipe anymore in the UI:

image

What is fun (or not) is that even the preflight OPTIONS request end-up with a 404, while when we just input a wrong recipe name the OPTIONS end-up with a 200 and the GET with a 404

I think that we should probably forbid unusual characters in recipe names at creation / edition. alphanums + underscore is probably enough ; I would even forbid dash to avoid confusion between underscores and dashes.

The other solution (allow mostly any chars) is probably way more complex / not very useful.

rgaudin commented 6 months ago

Keep in mind that we start the recipe name with domain name for which dash - are allowed

benoit74 commented 6 months ago

Good point, dots as well I imagine 🤣 (and probably other chars)

benoit74 commented 6 months ago

There is no other characters allowed in domain names, so I would change my mind:

Is it better?

rgaudin commented 6 months ago

Yes it's probably enough. Domain names can be almost anything now and that will be reflected in Name metadata but zimfarm could use an approximation for the 1% that actually use extended characters. This should probably be discussed in a content meeting. What's the current way of doing with websites that are in non-ASCII charset like Arabic or Chinese?