Ramblings about this and that
Using the power of macros for consistent authorization
Recently we had to implement user authorization for one of our apps. In that app a user can belong to many different projects, and users should only ever be able to modify a project if they are also a member of that project.
In our use case the authorization needed to be implemented right in the context modules, i.e. each function that requires authorization needs to be passed the user that should perform the operation and the project the operation is performed on. So let’s try to build this, and maybe we’ll find an actual nice use case for a mini DSL for the first time 😊.
Catching (probably all) email SPAM with a really tasty honeypot
We recently launched one of our projects for a customer of ours where onboarding of new users is to be done manually. So there was a requirement that there should be a very simple sign-up form on the landing page where interested users can enter the email and they will then be contacted by the customers support team.
By the way, you should really check the project out. It’s a really novel way for taking notes, organising your knowledge, your ideas and most importantly visualising the often really complex relations between all those arguments. While at the same time keeping it simple with the option to dive deeper if necessary. Anyway, it’s called Logo Dynamic Cards and you can take a closer look at ld-cards.com.
Multiple Phoenix Instances on Single Server Can Cause Crashes on Upload
I’ve recently encountered a problem with running multiple Phoenix application on a single server. On installation of a new application that was using Phoenix Live Uploads
I was unable to upload files to the server, although everything was working in development locally.
One way to handle static asset files in Phoenix 1.6
So I’ve recently upgraded one of our projects to Phoenix 1.6. While I was at it, I’ve also replaced the legacy
webpack pipeline with the new default esbuild pipeline. One problem
I’ve stumbled across when recreating the new layout for static files, i.e. all static files simply
are put directly into the priv/static
folder, was that it is now easy to accidentally commit
digested files when running git add .; git commit
because those files are no longer ignored by
git, only the files in priv/static/assets
are.