Vision

October 17, 2021 ยท View on GitHub

Vision was made with contributions from everyone found in git commit history.

Getting Started

Vision is a tool that will help you to manage change request, incident report, and access/resource request in your organization.

Installation

Install ruby 2.7.4 and Rails 5.2.6

make your system running under that version.

ruby --version #=> ruby 2.7.4
bundle exec rails version # => Rails 5.2.6

Install project dependencies

Install bundler

bundle install

Install bower through NPM. Our assets are managed by bower.

npm install
bower install

Configuration

cp .env.example .env # for development environment
cp .env.example .env.test # for test environment
cp config/database.example.yml config/database.yml

Follow prerequisites step here for fill .env

DB Migration and Seed

bundle exec rake db:setup

For mail interaction in Development environment, install and run Mailcatcher by running

gem install mailcatcher

mailcatcher

Approvers

Follow set Approver here

Run Application

bundle exec rails s

Visit vision in http://localhost:3000

Run with Docker

You can run Vision under docker, if you have problem with version compability

docker-compose build
docker-compose up -d

DB Migration and Seed

docker exec -ti vision_web_1 bash

$ bundle exec rails db:setup

Approvers

Follow set Approver (here)[#5-approvers]

Run Application

Visit http://localhost:3000

Prerequisites

Vision application require some tools to run:

1. Google Oauth 2.0

  • Visit https://console.cloud.google.com/apis/credentials
  • Create Credentials -> OAuth client ID
  • Choose Web Application as Application Type
  • Fill Authorized JavaScript origins with your host url (e.g example.com)
  • Fill Authorized redirect URIs with your host and append users/auth/google_oauth2/callback (e.g example.com/users/auth/google_oauth2/callback)
  • Store your Client ID and Client Secret for next Vision setup in Environment Variable

2. Slack

  • Visit https://api.slack.com/apps
  • Create New App if you don't have app
  • Go to menu OAuth & Permissions
  • Go to section Scopes and Add an OAuth Scope
  • Add channels:history scope for User Token Scopes
  • Add channels:read scope for User Token Scopes
  • Add channels:write scope for User Token Scopes
  • Add chat:write scope for User Token Scopes
  • Add users:read scope for User Token Scopes
  • Add users:read.email scope for User Token Scopes
  • Copy User OAuth Token value for SLACK_API_TOKEN environment variable
  • Go to menu Basic Information
  • Go to App Credentials
  • Copy Verification Token value for SLACK_VERIFICATION_TOKEN environment variable
  • Create channel for change request for SLACK_CR_CHANNEL environment variable
  • Create channel for incident report SLACK_IR_CHANNEL environment variable
  • Go to menu Interactivity & Shortcuts
  • Fill Request URL with format {APP_HOST}/api/change_requests/action

3. JIRA

  • Create your JIRA account if you don't have here
  • Put your Jira site url as value of JIRA_URL for environment variable
  • Put your email as value of JIRA_USERNAME for environment variable
  • Create API Token on Security Atlassian (https://id.atlassian.com/manage-profile/security/api-tokens)
  • Put API Token as JIRA_PASSWORD for environment variable

4. Google Calendar

for more info follow here

5. Approvers

Vision required 2 Approvers, you can create with the seed:

rails vision:approver:seed name="Approver" email="approver@gmail.com"

Deploy

In this example we use will Heroku to deploy vision.

  1. Prepare prerequisites (Google API, Slack, and Jira)
  2. Create Heroku Application with stack container
  3. Add adds-on Heroku Postgres in Resources Menu
  4. Create Config Vars in Settings menu
KeyValueDescription
APP_HOSThttp://heroku-app.herokuapp.comRequired, You can fill with heroku app url
APPROVER_EMAILRequired, Approver email, you can get from prerequisites
DB_HOSTlocalhostRequired, you can get from Heroku Postgres adds-on
DB_NAMEvisionRequired, you can get from Heroku Postgres adds-on
DB_USERNAMEpostgresRequired, you can get from Heroku Postgres adds-on
DB_PASSWORDRequired, you can get from Heroku Postgres adds-on
DEPLOY_CALENDAR_IDvisionopensource2021@gmail.comRequired, You can get Google Calender ID here
ENTITY_SOURCESRequired, you can have multiple source combine with comma. (e.g org1,org2)
GOOGLE_API_KEYRequired, you can get from prerequisites step
GOOGLE_API_SECRETRequired, you can get from prerequisites step
INCIDENT_LEVEL_GUIDELINE
JIRA_USERNAMERequired, you can get from prerequisites step
JIRA_PASSWORDRequired, you can get from prerequisites step
JIRA_URLRequired, you can get from prerequisites step
MAIL_ADDRESSRequired
MAIL_AUTHENTICATIONRequired
MAIL_DOMAINRequired
MAIL_USERNAMERequired
MAIL_PASSWORDRequired
MAIL_PORTRequired
RAILS_ENVstagingRequired
SECRET_KEY_BASExxRequired, you can generate with rails secret
SLACK_API_TOKENRequired, you can get from prerequisites step
SLACK_VERIFICATION_TOKENRequired, you can get from prerequisites step
SLACK_CR_CHANNELSlack channel Change Request
SLACK_IR_CHANNELSlack channel Incident Report
VALID_EMAILgmail.comyou can fill with your domain google business suite
  1. Push docker image to Heroku container registry
heroku container:login
heroku container:push web -a {heroku-app}
  1. Deploy
heroku container:release web -a {heroku-app}

LICENSE

Released under the Apache 2.0 License. Copyright (c) 2021 Vision.

Contributing

Please make sure to read the Contributing Guide before making a pull request. Many improvements and bugfixes were contributed by the open source community.