Skip to content

frantsao/tortilla2teams

Repository files navigation

tortilla2teams

Spanish omelette as a Service

What?

This is a minimal icebreaker app sending messages to MS Teams. You can send a json to the tortilla endpoint with a list of people and it will send an invitation to a MS Teams channel with some names of the list randomly elected.

How to build it?

You will need a D compiler installed (DMD/ldc/...), a C compiler and the DUB package manager. You also will need the sources of phobos library, zlib and openssl lib.

With all these elements, you only need to run dub install in this directory.

Alternatively, there is a Dockerfile that you can use to build a container.

How to run it?

In order to run tortilla2teams, you must have installed zlib, openssl library and phobos. Then you can execute the binary:

$ ./tortilla2teams 
[main(----) INF] Listening for requests on http://127.0.0.1:9000

By default, the service will listen at 127.0.0.1:9000 but you can override this value exporting TORTILLA_HOST and TORTILLA_PORT environment variables.

You also can use the Docker image, vg.:

$ docker pull frantsao/tortilla2teams:latest
$ docker run -p 9000:9000 -e TORTILLA_HOST=0.0.0.0 frantsao/tortilla2teams:latest

Then you can send a POST to /api/tortilla path with a json payload like data.json. With this configuration example, the hook will be sent to a test endpoint in the same tortilla service; you must change the notificationUrl with the webhook url you created in your MS Teams channel:

$ http 127.0.0.1:9000/api/tortilla < data.json 
HTTP/1.1 200 OK
Content-Length: 54
Content-Type: application/json
Date: Tue, 04 May 2021 23:25:50 GMT
Keep-Alive: timeout=10
Server: vibe.d/1.16.0

{
    "OK": "Invitations sent, prepare tortilla and coffee"
}

(promised if I continue working in this program I'll improve testing)

I sent the request in the example using the wonderful HTTPie.

Why?

The idea came from a conversation with @dortegau some weeks ago. We were looking to strengthen ties in our remote team at idealista via tiny social meetings. At that time I read a post about D language programming. I had a problem and a tool that I wanted learning about it.

How?

This has been my documentation:

Status

I want to believe it's an MVP ;-)

Built With

DMD DUB vibe.d

About

AGPLv3

This work is under AGPLv3 license (see see the LICENSE file) with the exception of the Spanish omelette photo in the test directory. It has been created by Amasuela - Luis Lafuente Agudín - own job, CC BY-SA 4.0. The original file is at https://commons.wikimedia.org/w/index.php?curid=78914533 I made some cropping and scaling in order to use it as Teams avatar.