Feature Request: Add URL as an argument type
Is your feature request related to a problem? Please describe.
I'm using Archivebox which doesn't have an API yet that can be easily used by an Android app like [HTTP Shortcuts(https://http-shortcuts.rmy.ch/) in order to able to use the share function on Android to send a URL to Archivebox.
OliveTin allows me to get around this by running ArchiveBox's Docker CLI using it's own API as a proxy of sorts, but i need to use the very_dangerous_raw_string argument type, which is obviously undesirable.
Describe the solution you'd like
Add a url argument type which could use govalidator.IsURL() like urlregex.com recommends. I'm not 100% sure but this should reduce the attack surface in most cases where a URL can be used.
Describe alternatives you've considered It's possible to run JavaScript code before sending a request with HTTP Shortcut, so it might be possible to convert URLs into a safer format that's more restrictive on OliveTin's end, which will then need to be decoded (via shell?) to be used with ArchiveBox for example.
Additional context
Example command to add a URL to ArchiveBox when running in Docker:
docker-compose run archivebox add 'https://example.com/some/url/here'
Hey, this totally makes sense and is something I need to do - the regex for URLs is pretty complex though! :-)
I'll take a look.
If the regex is complex, i suggest using an known and proven library instead, like govalidator.
Hey, thanks for reminding me about this. I haven't heard of govalidator before, and I had a quick look, but then I just remembered that of course the Golang standard library has many functions for already validiating URLs - so of course I just used that :-)
Just added it now in commit 08a1ac2591cf1ed90762583b829d4a44279f2650 - so this will make the next release!
I just need to document this; https://github.com/OliveTin/docs.olivetin.app/issues/3
This feature was released in 2022-10-19.