Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/deadlysurgeon/memelord79

WIP slackbot shitposter
https://github.com/deadlysurgeon/memelord79

cringe docker github-actions go golang meme memes slack slack-bot

Last synced: 11 days ago
JSON representation

WIP slackbot shitposter

Awesome Lists containing this project

README

        

# MemeLord79

MemeLord79 is a Meme Lord bent on posting images to Slack.
Originally, the application was going to only be built into Github's Actions,
but then I changed my mind because a lot of prepwork needs to be done in the
container to save on time, so I might as well just use Go and package it into
a stratch container.

## Size Matters

One of the thing that I've noticed, is that at the time of writing the
application is slightly bigger than I'd like it to be, and I'm wondering if
using another language could shrink down my footprint so the container gets
loaded into actions faster to save on build minutes. Another thing to contend
with is that we need to run this as fast as possible, so that way we don't take
up build minutes.

## go-git vs apk git

go-get is smaller than regular git. It increases the code footprint, but
decreases the container size in the end.

## GitStore

MemeLord79 uses git as a datastore of sorts to persist data from one call to
the next. I likely can get away without needing to do this, but I felt like it
was a neat thing to do, plus it should help reduce the amount of times I need
to call Reddit's API as I can easily cache the results.

Specify the repository to use with the env `MEMELORD_GIT_REPO`

## Authentication

Generate an RSA keypair.

Put the public key in the git repo's deploy token section, and enable
"Allow write access". This will allow MemeLord to use the git repository and
use the "state" branch as a pseudo database.

The private key should be in the env `MEMELORD_SSH_PRIVATE_KEY`

## Docker

The docker image provided will build using alpine, and then use scratch as the
running image. UPX is used to make the binary smaller, and to help with making
the docker container more compact and faster to move across the wire.