Deploy style: Images

An article, posted 1 day ago filed in deployment, linux, hosting, discussion, unix, yaml, virtualisation, image & vm.

This is an article in a series on Deployment.

This technically what I have been using as the basis of my ‘infrastructure’. On top of these images I would manage the OS semi manual (assisted with Capistrano) and deploy images using Capistrano, in separated user domains different, the application servers.

You can of course completely prepare the desired OS state as an image and deploy that.

Images avant la lettre? WAR

I made this in a separate category.

The next VM? WebAssembly’s VM

WebAssembly runs in a VM. Solomon Hykes, a co-founder of Docker, is quoted on WebAssembly’s Wikipedia page: “If WASM+WASI existed in 2008, we wouldn’t have needed to create Docker. That’s how important it is. WebAssembly on the server is the future of computing.” I’d consider it to be a promising development, but will not bet on this yet.

Properties

See …

Continue reading...

Phoenix’ Channels

An article, posted more than 9 years ago filed in coherence, elixer, erlang, vm, authentication, Phoenix, framework, fast, messaging, rails, ActionCable & websockets.

I started exploring Phoenix for one thing only: Channels (or actually fast real time communication over websockets). In this post I explore how to use them (yes this is a follow up of My first Phoenix-app-post).

Preparing for the authentication problem

Websockets don’t pass session cookies. Because we don’t have access to these we need to transfer the user’s identity in a different way. One of the recommendations I found was passing a user_token using a <meta>-tag (adjusting templates/layout/app.html.eex):

<%= if Coherence.current_user(@conn) do %>
<%= tag :meta, name: "user_token", content: Phoenix.Token.sign(@conn, "user", Coherence.current_user(@conn).id) %>
<% end %>

We can access this with a simple query selector in javascript:

document.querySelector("meta[name=user_token...

Continue reading...

My first Phoenix app

An article, posted more than 9 years ago filed in coherence, elixer, erlang, vm, authentication, Phoenix, framework, fast, messaging & rails.

Some time ago I actually initiated my very first Phoenix app, but was a bit disappointed by the lack of a rich box of gems (like that of ruby’s) and/or I didn’t have the time to invest heavily in researching all the possibilities. One of my new year resolution was to actively pursue more knowledge, hence I’m giving it a second shot.

Why Phoenix?

I’m a full-stack Rails developer, but I needed real time messaging. That is not something Rails is typically good at (although it works), but Elixir (with its Erlang base) is well known for, even in the ruby community. Phoenix wraps Elixir in a nice Rails-like package ready for web and API development.

Requirements

  • Authentication
  • Broadcasting filtered messages based on tags
  • Writing messages

Preparation

  1. Install Elixir (macOS & homebrew: brew install elixir) and make sure you have [node.js](https://nodejs.or…

Continue reading...