More flies, please

Posted on Sep 6, 2022

It’s nearly intoxicating to realize how much stuff you can run in 256 MB of RAM! One application at a time, and use only permanent storage if you really need it.

Here are two more applications I’m running on fly.io. I’ve probaby launched even more my now, I’m trying to keep my flyio-apps repository updated so check it out if you want some inspiration. :)

shiori

Pocket-clone, easy to self-host. I’m just using it with a sqlite database, the only thing we need is some permanent storage.

cd directory-where-you-store-your-shiori-flyio-toml
flyctl launch --no-deploy
flyctl volumes create shiori_data --size 1

Add the following sections to your fly.toml:

[build]
  image = "ghcr.io/go-shiori/shiori:latest"

[mounts]
  source="shiori_data" # change me!
  destination="/shiori"

Deploy:

flyctl deploy

Once that is done, run the DB migrations or the app won’t work. Start by issuing a SSH certificate (remove the --agent argument if you don’t use a ssh-agent) and then ssh into your micro-VM, finally run the shiori migrate command:

flyctl ssh issue --agent
flyctl ssh console
shiori migrate

Now the shiori app should run like expected - the default username is shiori and the default password is gopher. This account will be removed when you’ve added a new account through the web-UI.

flyctl open

vaultwarden

An unofficial, Bitwarden compatible server that easily runs on a small VM. Pretty much the same procedure as with shiori:

cd directory-where-you-store-your-vaultwarden-flyio-toml
flyctl launch --no-deploy
flyctl volumes create vaultwarden_data --size 1

Add the following three sections to your fly.toml:

[build]
  image = "vaultwarden/server:latest"

[env]
  SIGNUPS_ALLOWED=true # change me after deploy, and redeploy!
  INVITATIONS_ALLOWED=false
  SHOW_PASSWORD_HINT=false

[mounts]
  source="vaultwarden_data" # change me!
  destination="/data"

Deploy:

flyctl deploy

After deploying, visit the site and register an account:

flyctl open

And, if you don’t want others to freely register accounts with your instance, change SIGNUPS_ALLOWED under [env] in your fly.toml to false:

[env]
  SIGNUPS_ALLOWED=false
  INVITATIONS_ALLOWED=false
  SHOW_PASSWORD_HINT=false

Then deploy again:

flyctl deploy

Done!