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 originswith your host url (e.g example.com) - Fill
Authorized redirect URIswith your host and appendusers/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
Scopesand Add an OAuth Scope - Add
channels:historyscope forUser Token Scopes - Add
channels:readscope forUser Token Scopes - Add
channels:writescope forUser Token Scopes - Add
chat:writescope forUser Token Scopes - Add
users:readscope forUser Token Scopes - Add
users:read.emailscope forUser Token Scopes - Copy
User OAuth Tokenvalue forSLACK_API_TOKENenvironment variable - Go to menu
Basic Information - Go to
App Credentials - Copy
Verification Tokenvalue forSLACK_VERIFICATION_TOKENenvironment variable - Create channel for change request for
SLACK_CR_CHANNELenvironment variable - Create channel for incident report
SLACK_IR_CHANNELenvironment 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_URLfor environment variable - Put your email as value of
JIRA_USERNAMEfor environment variable - Create API Token on Security Atlassian (
https://id.atlassian.com/manage-profile/security/api-tokens) - Put API Token as
JIRA_PASSWORDfor environment variable
4. Google Calendar
- Enable Google Calendar API
- Visit (https://calendar.google.com/calendar/u/0/r/settings)(https://calendar.google.com/calendar/u/0/r/settings)
- Go to section
Settings for my calendars - Go to menu
Share with specific peopleand invite the users with permissionMake changes to events - Go to menu
Integrate calendar - Copy
Calendar IDvalue forDEPLOY_CALENDAR_IDenvironment variable
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.
- Prepare prerequisites (Google API, Slack, and Jira)
- Create Heroku Application with stack
container - Add adds-on
Heroku PostgresinResources Menu - Create
Config VarsinSettingsmenu
| Key | Value | Description |
|---|---|---|
APP_HOST | http://heroku-app.herokuapp.com | Required, You can fill with heroku app url |
APPROVER_EMAIL | Required, Approver email, you can get from prerequisites | |
DB_HOST | localhost | Required, you can get from Heroku Postgres adds-on |
DB_NAME | vision | Required, you can get from Heroku Postgres adds-on |
DB_USERNAME | postgres | Required, you can get from Heroku Postgres adds-on |
DB_PASSWORD | Required, you can get from Heroku Postgres adds-on | |
DEPLOY_CALENDAR_ID | visionopensource2021@gmail.com | Required, You can get Google Calender ID here |
ENTITY_SOURCES | Required, you can have multiple source combine with comma. (e.g org1,org2) | |
GOOGLE_API_KEY | Required, you can get from prerequisites step | |
GOOGLE_API_SECRET | Required, you can get from prerequisites step | |
INCIDENT_LEVEL_GUIDELINE | ||
JIRA_USERNAME | Required, you can get from prerequisites step | |
JIRA_PASSWORD | Required, you can get from prerequisites step | |
JIRA_URL | Required, you can get from prerequisites step | |
MAIL_ADDRESS | Required | |
MAIL_AUTHENTICATION | Required | |
MAIL_DOMAIN | Required | |
MAIL_USERNAME | Required | |
MAIL_PASSWORD | Required | |
MAIL_PORT | Required | |
RAILS_ENV | staging | Required |
SECRET_KEY_BASE | xx | Required, you can generate with rails secret |
SLACK_API_TOKEN | Required, you can get from prerequisites step | |
SLACK_VERIFICATION_TOKEN | Required, you can get from prerequisites step | |
SLACK_CR_CHANNEL | Slack channel Change Request | |
SLACK_IR_CHANNEL | Slack channel Incident Report | |
VALID_EMAIL | gmail.com | you can fill with your domain google business suite |
- Push docker image to Heroku container registry
heroku container:login
heroku container:push web -a {heroku-app}
- 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.