Skip to content

Self‐Hosting: B. Cloud Buddy

Kevin edited this page Aug 3, 2023 · 1 revision

To self-host Buddy in the cloud, you will:

  1. ✅ Create a Slack app through the Slack website (this creates the access tokens so you can talk to Slack).
  2. 📌 Run a server at a cloud provider.
  3. Update Slack connection info.
  4. Use the bot through your regular Slack desktop! 💃

If you get stuck, check out your 💡 support resources.

Cloud: Fly.io

You will need to create an account with cc details💳, though this should run on the free tier. You will then need to install the flyctl tool and flyctl auth login so it gets connected.

  • Copy fly.template.toml to fly.toml.
  • Choose a name for your app. https://< your app name>.fly.dev is where it will be hosted, and labeled in the Fly dashboard.
  • 🥂 Run flyctl launch --name < your app name> --no-deploy to get the app initialized with Fly.io. It will write an updated config to the fly.toml file, so don't be alarmed when it does.
  • If you want your data to persist between deployments:
    • Create a volume for your instance. I set this to 1 GB, but you get up to 3 GB on the free tier. I also picked ord since I'm in the US, but pick any region near you. flyctl -a <your app name > volumes create workflowbuddy_vol --size 1 -r ord

    • (Optional) Ensure fly.toml has the mount added (Optional since this has already been implemented in the template. Remove it if you don't want persistence.):

      [mounts]
          source="workflowbuddy_vol"
          destination="/usr/app/data/"
      
    • (Optional) update fly.toml config settings.

  • Add secrets from .env (documented in Slack App Setup) to the Fly environnment using flyctl secrets.
    • run: flyctl secrets -a <your app name > set <name>='<secret>' <name2>='<secret2>'....
  • 🚀 Finally, get a running app with flyctl deploy -a < your app name >!
    • If you run into issues with remote builders, you can always do it on Docker locally with flyctl deploy --local-only.

Updating Workflow Buddy on Fly

Currently the recommended best practice for updating Workflow Buddy:

  • (Optional) Backup the DB.
    • Run flyctl ssh sftp shell -a < your app name >, then > get /usr/app/data/workflow_buddy.db.
    • Automated backups are on the roadmap.
  • (if necessary) manually create any volumes that hadn't existed before. See notes above^.
  • cd to your cloned WB repo. Run git fetch --all --tags so you're local knows about all versions that have been tagged, then change to a specific version with git checkout tags/v0.0.x -b v0.0.x-branch.

    ⚠️ If you were using Workflow Buddy prior to v1.0.0, your Event Configuration settings (what you created from the App Home) are stored in the old storage schema and will NOT be automatically imported. Recommended approach to upgrade is to make sure to Export those settings before you change versions of Workflow Buddy, then manually create matching ones once you have the new version running. Most users will only have 1 or 2, if you have many that need to be migrated feel free to reach out to our support for assistance.

    • If there were changes to slack_app_manifest.template.yml, you'll need to update your Slack app with the latest and greatest.
    • If there were changes to the secrets in Setup, you will need to add those like was done above in Cloud: Fly.io.
  • Run fly deploy -a < your app name > to put your changes in to the wild!

Cloud: Other hosting providers

Clone this wiki locally