The Eddie Barraco's blog

From cogito to cogito2

Published 2019-10-18 on Eddie Barraco's blog

I worked on the cogito project one week ago. This is a symfony based micro-service jwt authenticated. I dropped it. Here why !

The cogito was firstly a sandbox to recover my symfony skills. I got fun make jwt/apiplatform works well together. It was a way to got some bases on the sr.ht tools like the builds, todo, etc. But the fact is this is no longer the technology I want to use.

The python way

Python is a more robust programming language than php. It module based approach solve many problems that we encouter with php projects. Some php patterns like dependency injection, composer based autoloading, vendors install builds, nginx web proxies really are a pain in the ass.

Flask

Flask is a python web micro-framework. The documentation and the production application like sr.ht was enough to convince me to give it a try.

The cogito2 project only find markdowns files and transform them into html views. There is no longer an article mangement api. A gap must be closed.

Article managenent - An UNIX philosophy

My goal was to easily manage my blogs articles. The cogito project gave me apis to manage them but I have to trick with rest api client like resty and that annoyed me. An alternative was to write a script to simplify the management. But I get a better idea.

I recently putted in production two webdav servers dav.eddiebarraco.fr and dav.misterbanal.net. Thoses are simple apache webdav servers. A simple cadaver client allowed me to manage my online contents.

My first goal was to allow me to publish some screenshots I take on my sway windows manager. I frequently have to publish them on redmine, slacks, matrix channels and I wanted a simple way to give an http persistent access. I now can only "Super+PrtScr" to have an http uri pasted on my system clipboard (see my dotfiles to have configuration)

This approach gave me the next idea. I can easily put two servers side by side with an union docker volume containing my article files. One of those is the blog service and the other the apache webdav one. This way, I can manage them with an authenticated webdav server and simplify the work of the blog platform.

This methods really is showcased by the Linux community because it seperate the two different tasks in separate programs.

The Unix philosophy emphasizes building simple, short, clear, modular, and extensible code that can be easily maintained and repurposed by developers other than its creators. The Unix philosophy favors composability as opposed to monolithic design. 1

This second articles was uploaded and edited on blog.eddiebarraco.fr this way.