Skip to content

A simple slack polling app using gcloud functions and datastore

Notifications You must be signed in to change notification settings

alexandre-normand/marcopoller

Repository files navigation

GoDoc Build Test Coverage Latest Version

Marco Poller

Marco Poller

Marco Poller is a slack app that does one thing: manage slack polls. Yes, there are many slack polling applications at the moment. Chances are that you don't need this. But if you're part of an organisation that doesn't allow 3rd party slack apps or if you just feel like having your own version that does its thing a little differently, go ahead and look at Marco Poller.

Demo

Backing Technology

Requirements

  • A bot slack token

    • With the following scopes:

      • chat:write:bot
      • chat:write:user
      • bot
      • commands
      • users.profile:read
    • The following slash commands:

      • /poll:
        • Command: /poll
        • Request URL: <url of the startPoll gcloud function>
        • Short Description: Starts a new poll
        • Usage Hint: "Question?" "Option1" "Option 2"
    • The following interactive components (should be toggled to on):

      • registerVote action URL: This is going to show up in the gcloud functions deploy output for the registerVote function. You only have to do this when you first deploy the registerVote function but you'll have to enter the URL of the registerVote gcloud function in Request URL.
    • A bot user with the recommended info:

      • Display name: Marco Poller
      • Display username: marcopoller
  • A gcloud project ID with the datastore API enabled

  • A way to store secrets (needed for the slack token and the slack signing secret)

Integration

The ready-to-deploy vanilla version of Marco Poller uses berglas to manage secrets and lives at github.com/alexandre-normand/marcopoller-vanilla. Refer to the berglas gcloud functions example and documentation on how to set up berglas with gcloud functions.

Deploy

Vanilla deployment using berglas managed secrets

gcloud functions deploy startPoll --entry-point StartPoll --runtime go111 --trigger-http --project $PROJECT_ID --service-account ${SA_EMAIL} --set-env-vars "PROJECT_ID=${PROJECT_ID},SLACK_TOKEN=berglas://${BUCKET_ID}/slacktoken,SIGNING_SECRET=berglas://${BUCKET_ID}/signingsecret"
gcloud functions deploy registerVote --entry-point RegisterVote --runtime go111 --trigger-http --project $PROJECT_ID --service-account ${SA_EMAIL} --set-env-vars "PROJECT_ID=${PROJECT_ID},SLACK_TOKEN=berglas://${BUCKET_ID}/slacktoken,SIGNING_SECRET=berglas://${BUCKET_ID}/signingsecret"

About

A simple slack polling app using gcloud functions and datastore

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages