0.01
No release in over 3 years
Low commit activity in last 3 years
A tiny app to allow open-source contributors to opt-in to GitHub teams.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.11
~> 0.10
~> 0.6
~> 10.0
~> 3.1
~> 0.37
~> 1.2

Runtime

 Project Readme

SquadGoals

A tiny app to allow open-source contributors to opt-in to GitHub teams.

What it does

The #SquadGoals app provides an interface whereby community members can see a list of open GitHub teams, and provide them with the ability to freely join any team at the click of a button.

screenshot

Setup

Credentials

You'll need a few different credentials for things to work:

A bot account

You'll need a dedicated "bot" account to add users to the organization:

  1. Create a bot account (a standard GitHub account not used by a human) that has admin rights to your organization.
  2. Create a personal access token for that user, with admin:org scope.

An OAuth application

You'll also need to create an OAuth application to validate users:

  1. Create an OAuth application within your organization via https://github.com/organizations/[YOUR-ORGANIZATION-NAME]/settings/applications/new
  2. The homepage URL should be the URL to your production instance.
  3. You can leave the callback URL blank. The default is fine.

Developing locally and deploying

  1. Create an OAuth app (see above)
  2. Create a personal access token for a user with admin rights to the organization (see above)
  3. Add gem 'squad_goals' to your project's Gemfile
  4. Add the following to your project's config.ru file:
require 'squad_goals'
run SquadGoals::App

Configuration

The following environmental values should be set:

  • GITHUB_ORG_ID - The name of the org to add users to
  • GITHUB_CLIENT_ID - Your OAuth app's client ID
  • GITHUB_CLIENT_SECRET - Your OAuth app's client secret
  • GITHUB_TOKEN - A personal access token for a user with admin rights to the organization
  • GITHUB_TEAMS - Comma-separated list of team names you'd like to allow access to, e.g, red-team,blue-team

Memcache

You'll also need an instance of Memecache running, to cache API calls. If using Herkou, this can be within memcachier's free use tier.

Customizing Views

There are three views, success, forbidden, and error. They're pretty boring by default, so you may want to swap them out for something a bit my snazzy. If you had a views directory along side your config.ru, you can do so like this in your config.ru file:

require 'squad_goals'
SquadGoals.views_dir = File.expand_path("./views", File.dirname(__FILE__))
run SquadGoals::App

These are just sinatra .erb views. Take a look at the default views for an example.

Customizing static assets

You can also do the same with SquadGoals.public_dir for serving static assets (AddToOrg comes bundled with Bootstrap by default).

require 'squad_goals'
SquadGoals.public_dir = File.expand_path("./public", File.dirname(__FILE__))
run SquadGoals::App