hauxir/imgpush

deleting images

CodeMyst opened this issue · 5 comments

could a feature be added for deleting existing images by their filename?

I guess it could be added but there would need to be a way to authenticate users for that to happen

Could a system with an app_key work? Which could also be required for uploading.

I think authentication should be managed by the API or whatever service using imgpush.

Yes, you are right.
Just an DELETE https://example.com/UUID.png route would be awesome.

Maybe then add a feature flag in ENV to disable the deletion route, for users who haven't implemented authentication.

Good idea ! I'm currently working on it, and will test if for some time.
I'm trying to do as many checks as possible before proceeding the actual delete, to avoid DELETE https://my.host/. removing an entire folder and things like that :

  • checking the param agains basic regex
  • checking if the path exist and is a file

For the authentication, I'm experimenting with Traefik (auth + block call from outside the stack) and will share the working configuration.