Hi, I would like to tell about my initiative to further maintain and develop Waffle project which is the fork of Arc library.
The progress I made during the last couple of months is that I’ve merged all open pull requests, published the library to the hex.pm. Also, I’m streaming my work on the project on Twitch
The next changes I’m working on right now is to cover all available features in the documentation and also implement the proper file validation with magic bytes.
When it came to making this decision did you weigh the pros and cons vs making a new library instead of forking Arc? In other words, in a best case scenario as of today do you still think the arc model of dealing with file uploads is the way to go?
Also are you currently using this project in a large scale production roll out?
I’m pretty sure the issue was that Arc had a lot of open issues and a lot of open PR’s but no one was managing, merging, or keeping up with Arc for over a year at this point. At that point you can’t do much but fork and continue. ^.^;
We really need a maintained library for files upload mater. So thank you for sharing this one.
Please do you plan also an alternative to arc_ecto ? That would be great!
Yep, and those still exist and are mostly kept up to date. Arc just has a lot of users and the fact it was dead was harmful to those projects when needed bug fixes needed to get in. Thus Waffle is to keep that same code persisting and still updating.
Arc is under Apache license, so, you can’t just fork it and use the old name. It was my first thought to do it, but unfortunately you have to change the name if you want to fork something under Apache license
Also, you want to publish the library to the registry and the old name is already taken. This is how the Waffle name was born.
I just came across this this Arc issue. Since it’s you that opened it I assume you fixed it in waffle.
However it seems that this has not been changed in the documentation:
defmodule Avatar do
use Waffle.Definition
@extension_whitelist ~w(.jpg .jpeg .gif .png)
def validate({file, _}) do
file_extension = file.file_name |> Path.extname() |> String.downcase()
Enum.member?(@extension_whitelist, file_extension)
end
end
I also found a bit empty the docs for waffle_ecto. So to use it, does one just use the same instructions as for arc_ecto but and change arc_ecto by waffle_ecto?
That’s a great work, and it would be ever more if we could have full documentation and maybe some guide about upgrading from Arc to Waffle.
I have made the change from Arc to Waffle, and related ecto packages in a project and just changed Arc to Waffle everywhere I needed it. Tests are ok and release is working fine
Sorry I was wrong. @achempion rather referenced the issue in the Waffle repository here. So in the future he will provide proper instructions for file validation. But for now one could follow the already suggested solution in the initial issue.
Thank you for your feedback. This is really reassuring. ^^
New release of waffle so far. It was all about documentation. We’ve migrated all docs to the hexdocs to the corresponding modules.
If you have any suggestions for improvement please tell me
For now I want to focus and sort out outdated dependencies and implement proper file validations based on content rather than extension. You can follow the progress on placeholder issue here.