When the King needs to send a message to His allies, He relies on a network of ravens. Recently, a new apparatus has been created that allows Him to draft a secret letter without the use of birds. This mystical device is called a virtual raven and will only work when used by the King.
When the King gazes into the device, it opens up a secret window that lets Him enter a secret message, assign a messenger and a recipient.
The message is safely hidden away in a magical cloud that is inaccessible to anyone but the intended recipient. It cannot be read while in transit, and so it cannot fall into the wrong hands.
The code itself is displayed on the apparatus, and I can assure you that it is unreadable to human eyes. Only by using a magical device entrusted to the rightful Kings can the message be deciphered.
What follows is a technical description of how the messaging system is created. It is of no particular interest to anyone but the practitioners of the arcane arts. It is included here only by the insistence of the device maker.
– King Sven
When deployed it creates a docker container using an Ubuntu image that I maintain and use for most of my web applications. The container is stored in Azure on the container registry.
In order to be able to easily deploy and scale the application, I set up a Kubernetes cluster using the Azure Cloud Shell and deployed it with two replicas. I also used a loadBalancer to expose the application with an external IP.
Setting up a Kubernetes cluster on Azure is amazingly straightforward. I used this guide to quickly get up to speed on the Azure specifics: https://docs.microsoft.com/en-us/azure/aks/kubernetes-walkthrough. Using the Azure Container Registry required me to create a secret to hold my credentials:
kubectl create secret docker-registry <SECRET_NAME> \ --docker-server <REGISTRY_NAME>.azurecr.io \ --docker-email <YOUR_EMAIL> \ --docker-username=<SERVICE_PRINCIPAL_ID> \ --docker-password <YOUR_PASSWORD>
In my deployment.yaml I expose the secret like this:
spec: containers: - name: virtualraven image: <REGISTRY_NAME>.azurecr.io/virtualraven imagePullSecrets: - name: <SECRET_NAME>
When building my docker image I tag and upload it like this:
PKG_VERSION=`node -p "require('./package.json').version"` docker tag svena/virtualraven:$PKG_VERSION svenscontainers.azurecr.io/svena/virtualraven:$PKG_VERSION docker push svenscontainers.azurecr.io/svena/virtualraven:$PKG_VERSION
On the node backend I use Koa to connect to a set of Azure functions that retrieves a set of valid Kings and messengers and encrypts any outgoing messages in combination with the face recognition API.
For instance, the message upload function looks like this (some parts of the receiver address is obfuscated intentionally):
A lot of work also went into the UX design to make it work efficiently on a cellphone. I wanted to use a serif font to fit with the theme and ended up using the free Cormorant Garamond font. I wanted to use a professional TypeKit font, but the licensing costs proved too extreme. The color scheme is carefully selected to project an image of power, while still being pleasant to look at.