Giter Site home page Giter Site logo

g0v / inviteyoself Goto Github PK

View Code? Open in Web Editor NEW

This project forked from seabre/inviteyoself

2.0 27.0 2.0 782 KB

Allow people to invite themselves to your slack team.

Home Page: http://join.g0v.today

License: MIT License

Clojure 63.11% JavaScript 11.84% CSS 13.30% HTML 11.76%

inviteyoself's Introduction

inviteyoself

Allow people to invite themselves to your Slack team.

This makes a website where users enter their email, and an invite will automatically be mailed to them from your Slack. Users can accept the invitation and join your Slack without needing you (the admin) to do any work.

Note: This is not using the Slack API, it is mechanizing the website. So you have to give Heroku (or your own server) your actual admin email and password, not an API token.

Important Note

This has only been tested with the free plan, but it should work with a paid plan too. If it doesn't, please file a ticket.

Installation

This was setup for Heroku, so that is the suggested platform. Otherwise, you will need to provide leiningen, postgres, and casperjs yourself.

  • Install leiningen using its install script (don't use apt).
  • Clone this project and cd into its directory..
  • Add an application to Heroku.
  • Add a Heroku git remote to this project:
heroku git:remote -a yourherokuapp`
heroku addons:add heroku-postgresql:dev
heroku addons:add scheduler
  • Set the environment variables for the application, substituting your own values for those shown. Start with the Slack details:
heroku config:add SLACK_SUBDOMAIN=yourteam
heroku config:add SLACK_USERNAME=youremail
heroku config:add SLACK_PASSWORD=yourpassword
  • Then set your Postgres details. Find them by visiting your app's Resources tab in Heroku, then clicking the "Heroku Postgres :: Aqua" link. This should take you to a page with your assigned Postgres DB settings.
heroku config:add DB_HOST=yourhost
heroku config:add DB_NAME=yourdatabase
heroku config:add DB_USER_NAME=youruser
heroku config:add DB_USER_PASSWORD=yourpassword
  • Finally, set the buildpack URL to a specific URL:
heroku config:add BUILDPACK_URL=https://github.com/ddollar/heroku-buildpack-multi.git
  • Run the migrations (locally). Substitute the all-caps variables below for the same values you set on your Heroku server in the previous step.
lein ragtime migrate -d "jdbc:postgresql://DB_HOST:5432/DB_NAME?user=DB_USER_NAME&password=DB_USER_PASSWORD&ssl=true&sslfactory=org.postgresql.ssl.NonValidatingFactory"
  • Visit Heroku scheduler in your browser and add the following task to run every 10 minutes: lein send-invites

  • Push to Heroku to deploy the app:

git push heroku master
  • Visit the app in the browser at https://yourappname.herokuapp.com and give it a shot! Test it with something other than your own admin email, of course.

Environment Variables

To set an environment variable, run heroku config:add NAME_OF_VARIABLE=SOMEVALUE in the root of your project.

  • SLACK_SUBDOMAIN
    • The subdomain for your Slack team. e.g. If your Slack team url is https://myslackteam.slack.com, your subdomain is myslackteam.
  • SLACK_USERNAME
    • The username for an admin user on the Slack team. Should be an email address.
  • SLACK_PASSWORD
    • The password for the SLACK_USERNAME.
  • DB_HOST
    • The postgres host.
  • DB_NAME
    • The name of the database in Postgres that the application will be using.
  • DB_USER_NAME
    • The postgres database user to access DB_NAME.
  • DB_USER_PASSWORD
    • The password for DB_USER_NAME.
  • BUILDPACK_URL
    • This should always be: https://github.com/ddollar/heroku-buildpack-multi.git

Local development

If you're developing this app locally, you will need the following: casperjs, postgres, leiningen, java (OpenJDK 6 and 7 both work.)

Styles

I'm using compass to compile sass. Run compass watch from resources/vendor/ and edit the sass files in the sass folder.

Environment Variables

In project.clj, look for {:dev true :db-user-name "postgres" :db-user-password "password" :db-host "localhost" :db-name "inviteyoself"}, these correspond to the environment variables above. Add the correct keys and values for your system.

Running

To start a web server for the application, run: lein ring server.

If you want to run the invite runner, run: lein send-invites.

License

Under the MIT License.

inviteyoself's People

Contributors

seabre avatar yhsiang avatar gasol avatar konklone avatar

Stargazers

Poren Chiang avatar Summit Suen avatar

Watchers

唐鳳 avatar Vanilla Hsu avatar 雨蒼 avatar  avatar Chia-liang Kao avatar ChangZhuo Chen (陳昌倬) avatar Pomin Wu avatar Yao-Po Wang avatar kcliu avatar  avatar jsleetw avatar CoColin avatar  avatar Justin Lee avatar James Cloos avatar Kent Huang avatar Cliff Chao-kuan Lu avatar Wu Min Hsuan avatar zbryikt avatar ipa  avatar  avatar  avatar  avatar starsdog avatar Kirsten Liu avatar  avatar  avatar

Forkers

superbil vh21

inviteyoself's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.