├── .codeclimate.yml ├── .gitignore ├── .ruby-version ├── .travis.yml ├── Capfile ├── Dockerfile ├── Gemfile ├── Gemfile.lock ├── LICENSE ├── README.md ├── Rakefile ├── app ├── assets │ └── images │ │ └── .keep ├── controllers │ ├── api │ │ ├── burn_controller.rb │ │ ├── filter_controller.rb │ │ ├── finding_controller.rb │ │ ├── github_controller.rb │ │ ├── oauth_controller.rb │ │ ├── repo_controller.rb │ │ ├── settings_controller.rb │ │ ├── stats_controller.rb │ │ ├── token_controller.rb │ │ └── user_controller.rb │ ├── application_controller.rb │ └── concerns │ │ ├── .keep │ │ └── filterable.rb ├── helpers │ └── codeburner_util.rb ├── mailers │ ├── .keep │ ├── application_mailer.rb │ └── notification_mailer.rb ├── models │ ├── .keep │ ├── branch.rb │ ├── burn.rb │ ├── concerns │ │ └── .keep │ ├── filter.rb │ ├── finding.rb │ ├── notification.rb │ ├── repo.rb │ ├── service_stat.rb │ ├── setting.rb │ ├── system_stat.rb │ ├── token.rb │ └── user.rb ├── validators │ └── filter_validator.rb ├── views │ ├── api │ │ └── finding │ │ │ ├── github.erb │ │ │ └── jira.erb │ ├── burn │ │ └── index.html.haml │ ├── layouts │ │ ├── application.html.erb │ │ ├── mailer.html.erb │ │ └── mailer.text.erb │ └── notification_mailer │ │ ├── failure_email.erb │ │ └── notification_email.erb └── workers │ └── burn_worker.rb ├── bin ├── bundle ├── rails ├── rake ├── setup └── spring ├── client ├── .bowerrc ├── .editorconfig ├── .gitattributes ├── .gitignore ├── .jshintrc ├── .yo-rc.json ├── Gruntfile.js ├── README.md ├── app │ ├── favicon.ico │ ├── images │ │ ├── fire.png │ │ ├── github_logo.png │ │ ├── jira_logo.png │ │ └── loader.gif │ ├── index.html │ ├── scripts │ │ ├── collections │ │ │ ├── burn.coffee │ │ │ ├── filter.coffee │ │ │ ├── finding.coffee │ │ │ └── repo.coffee │ │ ├── helpers │ │ │ └── utilities.coffee │ │ ├── highlight.pack.js │ │ ├── main.coffee │ │ ├── models │ │ │ ├── burn.coffee │ │ │ ├── filter.coffee │ │ │ ├── finding.coffee │ │ │ └── repo.coffee │ │ ├── routers │ │ │ └── main.coffee │ │ ├── templates │ │ │ ├── add_filter.ejs │ │ │ ├── burn.ejs │ │ │ ├── burn_page.ejs │ │ │ ├── burn_stats.ejs │ │ │ ├── burn_submit.ejs │ │ │ ├── default.ejs │ │ │ ├── detail.ejs │ │ │ ├── filter.ejs │ │ │ ├── filter_page.ejs │ │ │ ├── finding.ejs │ │ │ ├── finding_page.ejs │ │ │ ├── finding_publish_jira.ejs │ │ │ ├── finding_publish_results.ejs │ │ │ ├── login_menu.ejs │ │ │ ├── paginater.ejs │ │ │ ├── service_list.ejs │ │ │ ├── settings │ │ │ │ ├── admin.ejs │ │ │ │ ├── email.ejs │ │ │ │ ├── github.ejs │ │ │ │ ├── jira.ejs │ │ │ │ └── pipeline.ejs │ │ │ ├── settings_page.ejs │ │ │ ├── stats_page.ejs │ │ │ ├── user │ │ │ │ ├── repos.ejs │ │ │ │ └── tokens.ejs │ │ │ └── user_page.ejs │ │ └── views │ │ │ ├── burn.coffee │ │ │ ├── default.coffee │ │ │ ├── filter.coffee │ │ │ ├── finding.coffee │ │ │ ├── settings.coffee │ │ │ ├── stats.coffee │ │ │ └── user.coffee │ └── styles │ │ └── main.scss ├── bower.json ├── package.json └── test │ ├── collections │ ├── burn.spec.coffee │ ├── filter.spec.coffee │ ├── finding.spec.coffee │ └── service.spec.coffee │ ├── index.html │ ├── models │ ├── burn.spec.coffee │ ├── filter.spec.coffee │ ├── finding.spec.coffee │ └── service.spec.coffee │ ├── spec │ └── test.js │ └── views │ ├── burn.spec.coffee │ ├── filter.spec.coffee │ ├── finding.spec.coffee │ └── stats.spec.coffee ├── config.ru ├── config ├── app.yml ├── application.rb ├── boot.rb ├── database.yml ├── deploy.rb ├── deploy │ ├── production.rb │ └── staging.rb ├── environment.rb ├── environments │ ├── development.rb │ ├── production.rb │ ├── staging.rb │ └── test.rb ├── initializers │ ├── assets.rb │ ├── backtrace_silencers.rb │ ├── cookies_serializer.rb │ ├── filter_parameter_logging.rb │ ├── inflections.rb │ ├── kaminari_config.rb │ ├── mime_types.rb │ ├── notifications.rb │ ├── paper_trail.rb │ ├── session_store.rb │ ├── sidekiq.rb │ └── wrap_parameters.rb ├── locales │ └── en.yml ├── routes.rb ├── secrets.yml └── sidekiq.yml ├── db ├── migrate │ ├── 20160311195126_change_finding_file_type.rb │ ├── 20160322144611_add_user_to_services.rb │ ├── 20160322161458_create_users.rb │ ├── 20160413184815_add_role_to_users.rb │ ├── 20160413190203_create_settings.rb │ ├── 20160415142013_add_fullname_to_users.rb │ ├── 20160428185129_create_tokens.rb │ ├── 20160428191000_create_branches.rb │ ├── 20160428201000_rename_services_to_repositories.rb │ ├── 20160428201001_rename_columns_for_service_to_repo_change.rb │ ├── 20160429165357_add_html_url_to_services.rb │ ├── 20160429170301_add_languages_to_services.rb │ ├── 20160502162513_add_webhook_user_to_services.rb │ ├── 20160502185108_add_user_to_burn.rb │ ├── 20160502185332_add_report_status_to_burn.rb │ ├── 20160504140816_add_first_appeared_and_latest_to_findings.rb │ ├── 20160504182038_remove_burn_from_findings.rb │ ├── 20160504182039_create_join_table_burn_finding.rb │ ├── 20160504192037_fix_service_names.rb │ ├── 20160506135435_add_branch_and_pull_request_to_burns.rb │ ├── 20160508191001_change_branch_on_services.rb │ ├── 20160512171856_add_branch_to_findings.rb │ ├── 20160517162809_add_log_to_burns.rb │ ├── 20160518213345_change_log_to_medium_text.rb │ ├── 20160520185107_add_forked_to_services.rb │ ├── 20160601190842_add_html_url_to_repos.rb │ ├── 20160603165144_add_default_burn_user.rb │ ├── 20160607153518_add_default_branch_to_findings.rb │ └── 20160922204536_encrypt_tokens.rb ├── schema.rb └── seeds.rb ├── docker-build.sh ├── docker-compose.yml ├── docs ├── css │ └── prism.css ├── developer │ ├── api.md │ ├── backend.md │ ├── client.md │ └── pipeline.md ├── favicon.ico ├── images │ └── fire.png ├── index.md ├── js │ └── prism.js ├── setup │ ├── configuration.md │ ├── installation.md │ ├── quickstart.md │ ├── scanning_tools.md │ └── startup.md ├── theme │ ├── assets │ │ ├── fonts │ │ │ ├── icon.eot │ │ │ ├── icon.svg │ │ │ ├── icon.ttf │ │ │ └── icon.woff │ │ ├── images │ │ │ ├── favicon-e565ddfa3b.ico │ │ │ └── favicon.ico │ │ ├── javascripts │ │ │ ├── application-dfb6964a49.js │ │ │ ├── application.js │ │ │ ├── modernizr-4a5cc7e01e.js │ │ │ └── modernizr.js │ │ └── stylesheets │ │ │ ├── application-366d8f7c09.css │ │ │ ├── application-b0857bc6fe.css │ │ │ ├── application.css │ │ │ ├── palettes-2d6c5d2926.css │ │ │ └── palettes.css │ ├── base.html │ ├── drawer.html │ ├── footer.html │ ├── header.html │ ├── manifest.json │ └── nav.html └── user │ ├── burns.md │ ├── filters.md │ ├── findings.md │ ├── images │ ├── burn_list.png │ ├── burn_submit.png │ ├── burn_submit_form.png │ ├── details_pane.png │ ├── filter_click.png │ ├── filter_collapse.png │ ├── filter_default.png │ ├── filter_delete.png │ ├── filter_expand.png │ ├── filter_finding.png │ ├── filter_more.png │ ├── findings_list.png │ ├── findings_page.png │ ├── github_commit.png │ ├── github_commit_click.png │ ├── github_file_click.png │ ├── github_line.png │ ├── hide_finding.png │ ├── publish_finding.png │ ├── publish_github.png │ ├── publish_jira.png │ ├── service_list.png │ ├── stats_date.png │ ├── stats_datepicker.png │ ├── stats_page.png │ ├── stats_redraw.png │ ├── stats_resolution.png │ └── stats_service_list.png │ └── stats.md ├── lib ├── assets │ └── .keep └── tasks │ ├── .keep │ ├── burn.rake │ └── frontend.rake ├── mkdocs.yml ├── public ├── 404.html ├── 422.html ├── 500.html ├── favicon.ico ├── images │ ├── fire.png │ ├── github_logo.png │ ├── jira_logo.png │ └── loader.gif ├── index.html ├── robots.txt ├── scripts │ ├── main.js │ ├── plugins.js │ └── vendor.js └── styles │ ├── main.css │ ├── octicons-local.ttf │ ├── octicons.svg │ ├── octicons.ttf │ ├── octicons.woff │ └── vendor.css ├── test ├── controllers │ ├── .keep │ └── api │ │ ├── burn_controller_test.rb │ │ ├── filter_controller_test.rb │ │ ├── finding_controller_test.rb │ │ ├── service_controller_test.rb │ │ └── stats_controller_test.rb ├── fixtures │ ├── .keep │ ├── branches.yml │ ├── burn.json │ ├── burns.yml │ ├── filters.yml │ ├── findings.yml │ ├── notification_mailer │ │ └── notification_email │ ├── notifications.yml │ ├── service_stats.yml │ ├── services.yml │ ├── system_stats.yml │ ├── tokens.yml │ └── users.yml ├── helpers │ ├── .keep │ └── codeburner_util_test.rb ├── integration │ └── .keep ├── mailers │ ├── .keep │ ├── notification_mailer_test.rb │ └── previews │ │ └── notification_mailer_preview.rb ├── models │ ├── .keep │ ├── branch_test.rb │ ├── burn_test.rb │ ├── filter_test.rb │ ├── finding_test.rb │ ├── notification_test.rb │ ├── service_stat_test.rb │ ├── service_test.rb │ ├── system_stat_test.rb │ ├── token_test.rb │ └── user_test.rb ├── test_helper.rb ├── validators │ └── filter_validator_test.rb └── workers │ └── burn_worker_test.rb └── vendor └── assets ├── javascripts └── .keep └── stylesheets └── .keep /.codeclimate.yml: -------------------------------------------------------------------------------- 1 | --- 2 | engines: 3 | brakeman: 4 | enabled: true 5 | bundler-audit: 6 | enabled: true 7 | csslint: 8 | enabled: true 9 | coffeelint: 10 | enabled: true 11 | duplication: 12 | enabled: true 13 | config: 14 | languages: 15 | - ruby 16 | - javascript 17 | - python 18 | - php 19 | eslint: 20 | enabled: false 21 | fixme: 22 | enabled: true 23 | rubocop: 24 | enabled: false 25 | ratings: 26 | paths: 27 | - Gemfile.lock 28 | - "**.erb" 29 | - "**.haml" 30 | - "**.rb" 31 | - "**.rhtml" 32 | - "**.slim" 33 | - "**.css" 34 | - "**.coffee" 35 | - "**.inc" 36 | - "**.js" 37 | - "**.jsx" 38 | - "**.module" 39 | - "**.php" 40 | - "**.py" 41 | exclude_paths: 42 | - config/ 43 | - db/ 44 | - test/ 45 | - vendor/ 46 | - docs/ 47 | - public/ 48 | - client/Gruntfile.js 49 | - client/app/scripts/highlight.pack.js 50 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .idea 2 | *.rbc 3 | *.sassc 4 | .sass-cache 5 | capybara-*.html 6 | .rspec 7 | /.bundle 8 | /vendor/bundle 9 | /log/* 10 | /tmp/* 11 | /db/*.sqlite3 12 | /public/system/* 13 | /public/assets/* 14 | /coverage/ 15 | /spec/tmp/* 16 | **.orig 17 | rerun.txt 18 | pickle-email-*.html 19 | REVISION 20 | .DS_Store 21 | gem_graph.png 22 | /site/ 23 | 24 | # redis 25 | dump.rdb 26 | -------------------------------------------------------------------------------- /.ruby-version: -------------------------------------------------------------------------------- 1 | 2.2.3 2 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: ruby 2 | cache: bundler 3 | rvm: 4 | - 2.2.3 5 | repos: 6 | - mysql 7 | - redis 8 | before_script: 9 | - bundle exec rake db:setup 10 | addons: 11 | code_climate: 12 | repo_token: 6ec24938bf86c1e3700fae2b9c6664a3e4dbe7912bcd6ff6c00153f2fbf5fc4b 13 | 14 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ruby:2.2.3 2 | RUN apt-get clean && apt-get update -qq && apt-get install -y --fix-missing build-essential nodejs nodejs-legacy npm default-jdk maven unzip mysql-client 3 | 4 | RUN npm install -g retire 5 | RUN npm install -g nsp 6 | 7 | RUN wget -q https://github.com/find-sec-bugs/find-sec-bugs/releases/download/version-1.4.5/findsecbugs-cli-1.4.5.zip -O findsecbugs.zip 8 | RUN unzip findsecbugs.zip -d /findsecbugs 9 | 10 | RUN wget -q https://github.com/pmd/pmd/releases/download/pmd_releases%2F5.4.1/pmd-bin-5.4.1.zip -O pmd.zip 11 | RUN unzip pmd.zip 12 | 13 | WORKDIR /tmp 14 | COPY Gemfile Gemfile 15 | COPY Gemfile.lock Gemfile.lock 16 | RUN bundle install 17 | 18 | RUN mkdir /codeburner 19 | 20 | ADD . /codeburner 21 | 22 | WORKDIR /codeburner 23 | 24 | CMD bundle exec rails s -b 0.0.0.0 25 | -------------------------------------------------------------------------------- /Gemfile: -------------------------------------------------------------------------------- 1 | source 'http://rubygems.org' 2 | 3 | # sidekiq 4 | gem 'sidekiq', '>= 3.4.2' 5 | gem 'sinatra', :require => false # for the UI 6 | gem 'slim' 7 | 8 | # Bundle edge Rails instead: gem 'rails', github: 'rails/rails' 9 | gem 'rails', '~> 4.2.7.1' 10 | 11 | # mysql db 12 | gem 'mysql2', '~> 0.3.20', '>= 0.3.20' 13 | 14 | # default model attributes 15 | gem 'attribute-defaults' 16 | 17 | # pagination 18 | gem 'kaminari' 19 | 20 | group :development, :test do 21 | gem 'capistrano-bundler' 22 | 23 | # Call 'byebug' anywhere in the code to stop execution and get a debugger console 24 | gem 'byebug' 25 | 26 | # Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring 27 | gem 'spring' 28 | 29 | # capistrano for deployment 30 | gem 'capistrano' 31 | gem 'capistrano-sidekiq' 32 | gem 'capistrano-rails' 33 | gem 'pry-rails' 34 | gem 'pry-byebug' 35 | end 36 | 37 | group :test do 38 | gem 'minitest-reporters' 39 | gem 'mocha' 40 | gem 'simplecov' 41 | gem 'codeclimate-test-reporter', :require => false 42 | end 43 | 44 | # for our global $app_config struct 45 | gem 'deep_struct' 46 | 47 | # respond_to 48 | gem 'responders' 49 | 50 | # rest-client for general use 51 | gem 'rest-client' 52 | 53 | # gems jira and github integration 54 | gem 'jira-ruby' 55 | gem 'octokit' 56 | 57 | # scanning stuff 58 | gem 'owasp-glue', '>= 0.9.0' 59 | gem 'whenever' 60 | gem 'chronic' 61 | 62 | # redis caching 63 | gem 'redis-rails' 64 | 65 | # paper_trail for stats generation/tracking 66 | gem 'paper_trail', '>= 4.0.0' 67 | 68 | # for OAuth 69 | gem 'jwt' 70 | 71 | # for settings 72 | gem 'rails-settings-cached' 73 | 74 | # for eventsource 75 | gem 'puma' 76 | 77 | gem 'capistrano-sidekiq', group: :development 78 | 79 | gem 'attr_encrypted', '~> 3.0.0' 80 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2016, Groupon, Inc. 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /Rakefile: -------------------------------------------------------------------------------- 1 | # Add your own tasks in files placed in lib/tasks ending in .rake, 2 | # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake. 3 | 4 | require File.expand_path('../config/application', __FILE__) 5 | 6 | Rails.application.load_tasks 7 | -------------------------------------------------------------------------------- /app/assets/images/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/groupon/codeburner/4686f5316664ba2851803f20cdcf4466da7401ce/app/assets/images/.keep -------------------------------------------------------------------------------- /app/controllers/api/settings_controller.rb: -------------------------------------------------------------------------------- 1 | #`` 2 | #The MIT License (MIT) 3 | # 4 | #Copyright (c) 2016, Groupon, Inc. 5 | # 6 | #Permission is hereby granted, free of charge, to any person obtaining a copy 7 | #of this software and associated documentation files (the "Software"), to deal 8 | #in the Software without restriction, including without limitation the rights 9 | #to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | #copies of the Software, and to permit persons to whom the Software is 11 | #furnished to do so, subject to the following conditions: 12 | # 13 | #The above copyright notice and this permission notice shall be included in 14 | #all copies or substantial portions of the Software. 15 | # 16 | #THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | #IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | #FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | #AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | #LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | #OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | #THE SOFTWARE. 23 | # 24 | class Api::SettingsController < ApplicationController 25 | respond_to :json 26 | before_filter :authz, only: [:admin_update] 27 | before_filter :authz_no_fail, only: [:index, :update, :admin_list] 28 | before_filter :admin_only 29 | 30 | def index 31 | settings = {} 32 | Setting.get_all.keys.each {|k| settings[k] = Setting[k]} 33 | 34 | render(:json => settings) 35 | end 36 | 37 | def update 38 | results = {} 39 | 40 | params[:settings].each do |setting, value| 41 | Setting.merge!(setting.to_sym, value) 42 | results.merge!({setting.to_sym => value}) 43 | end 44 | 45 | render(:json => results) 46 | end 47 | 48 | def admin_list 49 | render(:json => User.admin.all, :only => [ :name, :fullname, :profile_url, :avatar_url ]) 50 | end 51 | 52 | def admin_update 53 | if params[:admins] 54 | User.admin.update_all(:role => 'user') 55 | params[:admins].each do |admin| 56 | if admin.length > 0 57 | user = User.find_or_create_by(name: admin) 58 | user.role = 'admin' 59 | user.save 60 | end 61 | end 62 | end 63 | 64 | render(:json => User.admin.all, :only => [ :name, :fullname, :profile_url, :avatar_url ]) 65 | end 66 | 67 | end 68 | -------------------------------------------------------------------------------- /app/controllers/api/token_controller.rb: -------------------------------------------------------------------------------- 1 | #`` 2 | #The MIT License (MIT) 3 | # 4 | #Copyright (c) 2016, Groupon, Inc. 5 | # 6 | #Permission is hereby granted, free of charge, to any person obtaining a copy 7 | #of this software and associated documentation files (the "Software"), to deal 8 | #in the Software without restriction, including without limitation the rights 9 | #to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | #copies of the Software, and to permit persons to whom the Software is 11 | #furnished to do so, subject to the following conditions: 12 | # 13 | #The above copyright notice and this permission notice shall be included in 14 | #all copies or substantial portions of the Software. 15 | # 16 | #THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | #IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | #FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | #AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | #LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | #OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | #THE SOFTWARE. 23 | # 24 | require 'securerandom' 25 | 26 | class Api::TokenController < ApplicationController 27 | respond_to :json 28 | before_filter :authz 29 | 30 | def index 31 | render(:json => @current_user.tokens) 32 | end 33 | 34 | def show 35 | render(:json => Token.find(params[:id])) 36 | rescue ActiveRecord::RecordNotFound 37 | render(:json => {error: "no token with that id found}"}, :status => 404) 38 | end 39 | 40 | def create 41 | token = Token.create(:user => @current_user, :name => params[:name], :token => Digest::SHA2.new(256).update(SecureRandom.random_bytes).to_s) 42 | 43 | if token.valid? 44 | render(:json => token) 45 | else 46 | render(:json => {error: "duplicate token name not allowed"}, :status => 409) 47 | end 48 | end 49 | 50 | def destroy 51 | token = Token.find(params[:id]) 52 | 53 | if @current_user == token.user and token.destroy 54 | render(:json => {result: "success"}) 55 | else 56 | render(:json => {result: "failed"}, :status => 500) 57 | end 58 | rescue ActiveRecord::RecordNotFound 59 | render(:json => {error: "no token with that id found}"}, :status => 404) 60 | end 61 | 62 | end 63 | -------------------------------------------------------------------------------- /app/controllers/concerns/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/groupon/codeburner/4686f5316664ba2851803f20cdcf4466da7401ce/app/controllers/concerns/.keep -------------------------------------------------------------------------------- /app/controllers/concerns/filterable.rb: -------------------------------------------------------------------------------- 1 | module Filterable 2 | extend ActiveSupport::Concern 3 | 4 | module ClassMethods 5 | def filter(filtering_params) 6 | results = self.where(nil) 7 | 8 | filtering_params.each do |key, value| 9 | results = results.public_send(key, value) if value.present? and results.respond_to?(key) 10 | end 11 | 12 | results 13 | end 14 | 15 | def scope_multiselect attribute, value 16 | value = value.to_s 17 | where(attribute.to_sym => value.split(',')) 18 | end 19 | end 20 | end 21 | -------------------------------------------------------------------------------- /app/mailers/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/groupon/codeburner/4686f5316664ba2851803f20cdcf4466da7401ce/app/mailers/.keep -------------------------------------------------------------------------------- /app/mailers/application_mailer.rb: -------------------------------------------------------------------------------- 1 | # 2 | #The MIT License (MIT) 3 | # 4 | #Copyright (c) 2016, Groupon, Inc. 5 | # 6 | #Permission is hereby granted, free of charge, to any person obtaining a copy 7 | #of this software and associated documentation files (the "Software"), to deal 8 | #in the Software without restriction, including without limitation the rights 9 | #to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | #copies of the Software, and to permit persons to whom the Software is 11 | #furnished to do so, subject to the following conditions: 12 | # 13 | #The above copyright notice and this permission notice shall be included in 14 | #all copies or substantial portions of the Software. 15 | # 16 | #THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | #IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | #FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | #AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | #LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | #OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | #THE SOFTWARE. 23 | # 24 | class ApplicationMailer < ActionMailer::Base 25 | begin 26 | default from: Setting.email['from'] 27 | rescue ActiveRecord::StatementInvalid 28 | Rails.logger.info "settings table not initialized" 29 | end 30 | 31 | layout 'mailer' 32 | end 33 | -------------------------------------------------------------------------------- /app/mailers/notification_mailer.rb: -------------------------------------------------------------------------------- 1 | # 2 | #The MIT License (MIT) 3 | # 4 | #Copyright (c) 2016, Groupon, Inc. 5 | # 6 | #Permission is hereby granted, free of charge, to any person obtaining a copy 7 | #of this software and associated documentation files (the "Software"), to deal 8 | #in the Software without restriction, including without limitation the rights 9 | #to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | #copies of the Software, and to permit persons to whom the Software is 11 | #furnished to do so, subject to the following conditions: 12 | # 13 | #The above copyright notice and this permission notice shall be included in 14 | #all copies or substantial portions of the Software. 15 | # 16 | #THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | #IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | #FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | #AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | #LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | #OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | #THE SOFTWARE. 23 | # 24 | class NotificationMailer < ApplicationMailer 25 | 26 | def notification_email dest, burn_id, previous_stats 27 | @link_host = Setting.email['link_host'] 28 | @burn = Burn.find(burn_id) 29 | @findings = Finding.burn_id(burn_id) 30 | @previous_stats = previous_stats 31 | @current_stats = CodeburnerUtil.get_repo_stats(@burn.repo_id) 32 | 33 | mail(to: dest, subject: "Codeburner Report: #{@burn.repo.full_name} - #{@burn.revision}") 34 | end 35 | 36 | def failure_email dest, burn_id 37 | @burn = Burn.find(burn_id) 38 | 39 | mail(to: dest, subject: "Codeburner Failed: #{@burn.repo.full_name} - #{@burn.revision}") 40 | end 41 | 42 | end 43 | -------------------------------------------------------------------------------- /app/models/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/groupon/codeburner/4686f5316664ba2851803f20cdcf4466da7401ce/app/models/.keep -------------------------------------------------------------------------------- /app/models/branch.rb: -------------------------------------------------------------------------------- 1 | class Branch < ActiveRecord::Base 2 | validates :name, uniqueness: { scope: :repo_id, message: 'branch must be a unique repo + name combo' } 3 | 4 | belongs_to :repo 5 | has_many :burns 6 | has_many :findings 7 | end 8 | -------------------------------------------------------------------------------- /app/models/concerns/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/groupon/codeburner/4686f5316664ba2851803f20cdcf4466da7401ce/app/models/concerns/.keep -------------------------------------------------------------------------------- /app/models/notification.rb: -------------------------------------------------------------------------------- 1 | # 2 | #The MIT License (MIT) 3 | # 4 | #Copyright (c) 2016, Groupon, Inc. 5 | # 6 | #Permission is hereby granted, free of charge, to any person obtaining a copy 7 | #of this software and associated documentation files (the "Software"), to deal 8 | #in the Software without restriction, including without limitation the rights 9 | #to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | #copies of the Software, and to permit persons to whom the Software is 11 | #furnished to do so, subject to the following conditions: 12 | # 13 | #The above copyright notice and this permission notice shall be included in 14 | #all copies or substantial portions of the Software. 15 | # 16 | #THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | #IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | #FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | #AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | #LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | #OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | #THE SOFTWARE. 23 | # 24 | class Notification < ActiveRecord::Base 25 | validates :burn, presence: true, uniqueness: { scope: :destination } 26 | validates :method, presence: true 27 | validates :destination, presence: true 28 | 29 | def notify burn_id, previous_stats 30 | return false unless self.burn.to_i == burn_id || self.burn == 'all' 31 | 32 | if self.method == 'email' 33 | NotificationMailer.notification_email(self.destination, burn_id, previous_stats).deliver_now 34 | end 35 | 36 | self.destroy unless self.burn == 'all' 37 | end 38 | 39 | def fail burn_id 40 | return false unless self.burn.to_i == burn_id || self.burn == 'all' 41 | 42 | if self.method == 'email' 43 | NotificationMailer.failure_email(self.destination, burn_id).deliver_now 44 | end 45 | 46 | self.destroy unless self.burn == 'all' 47 | end 48 | end 49 | -------------------------------------------------------------------------------- /app/models/service_stat.rb: -------------------------------------------------------------------------------- 1 | # 2 | #The MIT License (MIT) 3 | # 4 | #Copyright (c) 2016, Groupon, Inc. 5 | # 6 | #Permission is hereby granted, free of charge, to any person obtaining a copy 7 | #of this software and associated documentation files (the "Software"), to deal 8 | #in the Software without restriction, including without limitation the rights 9 | #to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | #copies of the Software, and to permit persons to whom the Software is 11 | #furnished to do so, subject to the following conditions: 12 | # 13 | #The above copyright notice and this permission notice shall be included in 14 | #all copies or substantial portions of the Software. 15 | # 16 | #THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | #IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | #FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | #AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | #LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | #OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | #THE SOFTWARE. 23 | # 24 | class ServiceStat < ActiveRecord::Base 25 | belongs_to :repo 26 | has_paper_trail 27 | end 28 | -------------------------------------------------------------------------------- /app/models/setting.rb: -------------------------------------------------------------------------------- 1 | # RailsSettings Model 2 | class Setting < RailsSettings::Base 3 | end 4 | -------------------------------------------------------------------------------- /app/models/system_stat.rb: -------------------------------------------------------------------------------- 1 | # 2 | #The MIT License (MIT) 3 | # 4 | #Copyright (c) 2016, Groupon, Inc. 5 | # 6 | #Permission is hereby granted, free of charge, to any person obtaining a copy 7 | #of this software and associated documentation files (the "Software"), to deal 8 | #in the Software without restriction, including without limitation the rights 9 | #to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | #copies of the Software, and to permit persons to whom the Software is 11 | #furnished to do so, subject to the following conditions: 12 | # 13 | #The above copyright notice and this permission notice shall be included in 14 | #all copies or substantial portions of the Software. 15 | # 16 | #THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | #IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | #FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | #AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | #LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | #OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | #THE SOFTWARE. 23 | # 24 | class SystemStat < ActiveRecord::Base 25 | has_paper_trail 26 | end 27 | -------------------------------------------------------------------------------- /app/models/token.rb: -------------------------------------------------------------------------------- 1 | class Token < ActiveRecord::Base 2 | belongs_to :user 3 | 4 | validates_uniqueness_of :name 5 | end 6 | -------------------------------------------------------------------------------- /app/models/user.rb: -------------------------------------------------------------------------------- 1 | class User < ActiveRecord::Base 2 | has_many :tokens 3 | has_many :burns 4 | has_and_belongs_to_many :repos 5 | 6 | enum role: [:user, :admin] 7 | after_initialize :set_default_role, :if => :new_record? 8 | 9 | attr_encrypted :access_token, key: '2317ae3699811fe0f614ff64a32dfee7cfad7583bbf130f367f2f31348c8b744' 10 | 11 | def set_default_role 12 | self.role ||= :user 13 | end 14 | 15 | def update_repos 16 | self.update(:repos => []) 17 | 18 | github = CodeburnerUtil.user_github(self) 19 | local_repos = CodeburnerUtil.get_repos 20 | 21 | matched_repo_ids = [] 22 | 23 | github.repos.each do |github_repo| 24 | matches = local_repos.select {|r| r['full_name'] == github_repo.full_name} 25 | 26 | if matches.length > 0 27 | matches.each do |match| 28 | matched_repo_ids << match['id'] 29 | end 30 | end 31 | end 32 | 33 | matched_repos = Repo.find(matched_repo_ids) 34 | 35 | self.update(:repos => matched_repos) 36 | 37 | return self.repos 38 | end 39 | end 40 | -------------------------------------------------------------------------------- /app/validators/filter_validator.rb: -------------------------------------------------------------------------------- 1 | # 2 | #The MIT License (MIT) 3 | # 4 | #Copyright (c) 2016, Groupon, Inc. 5 | # 6 | #Permission is hereby granted, free of charge, to any person obtaining a copy 7 | #of this software and associated documentation files (the "Software"), to deal 8 | #in the Software without restriction, including without limitation the rights 9 | #to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | #copies of the Software, and to permit persons to whom the Software is 11 | #furnished to do so, subject to the following conditions: 12 | # 13 | #The above copyright notice and this permission notice shall be included in 14 | #all copies or substantial portions of the Software. 15 | # 16 | #THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | #IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | #FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | #AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | #LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | #OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | #THE SOFTWARE. 23 | # 24 | class FilterValidator < ActiveModel::Validator 25 | def validate record 26 | hit = Filter.repo_id(record.repo_id) \ 27 | .severity(record.severity) \ 28 | .fingerprint(record.fingerprint) \ 29 | .scanner(record.scanner) \ 30 | .description(record.description) \ 31 | .detail(record.detail) \ 32 | .file(record.file) \ 33 | .line(record.line.to_s) \ 34 | .code(record.code) 35 | 36 | if hit.count > 0 37 | record.errors[:base] << "Duplicate filter not allowed" 38 | end 39 | end 40 | end 41 | -------------------------------------------------------------------------------- /app/views/api/finding/github.erb: -------------------------------------------------------------------------------- 1 | Codeburner identified the following vulnerability in <%= @finding.repo.full_name %> release <%= @finding.burns.last.revision %> : 2 | 3 | **Description:** <%= @finding.description %> 4 | **Severity:**       <%= @severity %> 5 | **Details:**         <%= raw(@details) %> 6 | **Scanner:**       <%= @finding.scanner %> 7 | **File:**               [<%= @finding.file %>](<%= "#{@finding.repo.html_url}/blob/#{@finding.burns.last.revision}/#{@finding.file}#L#{@finding.line}" %>)<% unless @finding.line.nil? %>, **Line:** <%= @finding.line %><% end %> 8 | <% unless @finding.code.nil? %> 9 | **Code:** 10 | 11 | ```<%= @finding.burns.last.code_lang.split(',').first.downcase %> 12 | <%= raw(@finding.code) %> 13 | ``` 14 | <% end %> 15 | -------------------------------------------------------------------------------- /app/views/api/finding/jira.erb: -------------------------------------------------------------------------------- 1 | Codeburner identified the following vulnerability in <%= @finding.repo.full_name %> release {html}<%= @finding.burns.last.revision %>{html}: 2 | 3 | *Description:* <%= @finding.description %> 4 | *Severity:* <%= @severity %> 5 | *Details:* <%= raw(@details) %> 6 | *Scanner:* <%= @finding.scanner %> 7 | *File:* {html}<%= @finding.file %>{html} 8 | {code:<%= @finding.burns.last.code_lang %>|title=Line: <%= @finding.line %>|borderStyle=solid}<%= raw(@finding.code) %>{code} 9 | -------------------------------------------------------------------------------- /app/views/burn/index.html.haml: -------------------------------------------------------------------------------- 1 | %h1 THIS IS SOME HTML 2 | -------------------------------------------------------------------------------- /app/views/layouts/application.html.erb: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Codeburner 5 | <%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true %> 6 | <%= javascript_include_tag 'application', 'data-turbolinks-track' => true %> 7 | <%= csrf_meta_tags %> 8 | 9 | 10 | 11 | <%= yield %> 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /app/views/layouts/mailer.html.erb: -------------------------------------------------------------------------------- 1 | 2 | 3 | <%= yield %> 4 | 5 | 6 | -------------------------------------------------------------------------------- /app/views/layouts/mailer.text.erb: -------------------------------------------------------------------------------- 1 | <%= yield %> 2 | -------------------------------------------------------------------------------- /app/views/notification_mailer/failure_email.erb: -------------------------------------------------------------------------------- 1 |

Codeburner Report

2 | Codeburner failed burning <%= @burn.repo.full_name %> - <%= @burn.revision %>.
3 |
4 | Failure Reason: <%= @burn.status_reason %> 5 | -------------------------------------------------------------------------------- /app/workers/burn_worker.rb: -------------------------------------------------------------------------------- 1 | # 2 | #The MIT License (MIT) 3 | # 4 | #Copyright (c) 2016, Groupon, Inc. 5 | # 6 | #Permission is hereby granted, free of charge, to any person obtaining a copy 7 | #of this software and associated documentation files (the "Software"), to deal 8 | #in the Software without restriction, including without limitation the rights 9 | #to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | #copies of the Software, and to permit persons to whom the Software is 11 | #furnished to do so, subject to the following conditions: 12 | # 13 | #The above copyright notice and this permission notice shall be included in 14 | #all copies or substantial portions of the Software. 15 | # 16 | #THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | #IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | #FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | #AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | #LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | #OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | #THE SOFTWARE. 23 | # 24 | class BurnWorker 25 | include Sidekiq::Worker 26 | 27 | sidekiq_options queue: :codeburner, retry: 5, backtrace: true 28 | 29 | def perform(burn_id) 30 | burn = Burn.find(burn_id) 31 | burn.ignite 32 | end 33 | 34 | end 35 | -------------------------------------------------------------------------------- /bin/bundle: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__) 3 | load Gem.bin_path('bundler', 'bundle') 4 | -------------------------------------------------------------------------------- /bin/rails: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | begin 3 | load File.expand_path("../spring", __FILE__) 4 | rescue LoadError 5 | end 6 | APP_PATH = File.expand_path('../../config/application', __FILE__) 7 | require_relative '../config/boot' 8 | require 'rails/commands' 9 | -------------------------------------------------------------------------------- /bin/rake: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | begin 3 | load File.expand_path("../spring", __FILE__) 4 | rescue LoadError 5 | end 6 | require_relative '../config/boot' 7 | require 'rake' 8 | Rake.application.run 9 | -------------------------------------------------------------------------------- /bin/setup: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | require 'pathname' 3 | 4 | # path to your application root. 5 | APP_ROOT = Pathname.new File.expand_path('../../', __FILE__) 6 | 7 | Dir.chdir APP_ROOT do 8 | # This script is a starting point to setup your application. 9 | # Add necessary setup steps to this file: 10 | 11 | puts "== Installing dependencies ==" 12 | system "gem install bundler --conservative" 13 | system "bundle check || bundle install" 14 | 15 | # puts "\n== Copying sample files ==" 16 | # unless File.exist?("config/database.yml") 17 | # system "cp config/database.yml.sample config/database.yml" 18 | # end 19 | 20 | puts "\n== Preparing database ==" 21 | system "bin/rake db:setup" 22 | 23 | puts "\n== Removing old logs and tempfiles ==" 24 | system "rm -f log/*" 25 | system "rm -rf tmp/cache" 26 | 27 | puts "\n== Restarting application server ==" 28 | system "touch tmp/restart.txt" 29 | end 30 | -------------------------------------------------------------------------------- /bin/spring: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | 3 | # This file loads spring without using Bundler, in order to be fast. 4 | # It gets overwritten when you run the `spring binstub` command. 5 | 6 | unless defined?(Spring) 7 | require "rubygems" 8 | require "bundler" 9 | 10 | if match = Bundler.default_lockfile.read.match(/^GEM$.*?^ (?: )*spring \((.*?)\)$.*?^$/m) 11 | Gem.paths = { "GEM_PATH" => [Bundler.bundle_path.to_s, *Gem.path].uniq } 12 | gem "spring", match[1] 13 | require "spring/binstub" 14 | end 15 | end 16 | -------------------------------------------------------------------------------- /client/.bowerrc: -------------------------------------------------------------------------------- 1 | { 2 | "directory": "app/bower_components" 3 | } 4 | -------------------------------------------------------------------------------- /client/.editorconfig: -------------------------------------------------------------------------------- 1 | # EditorConfig helps developers define and maintain consistent 2 | # coding styles between different editors and IDEs 3 | # editorconfig.org 4 | 5 | root = true 6 | 7 | 8 | [*] 9 | 10 | # Change these settings to your own preference 11 | indent_style = space 12 | indent_size = 2 13 | 14 | # We recommend you to keep these unchanged 15 | end_of_line = lf 16 | charset = utf-8 17 | trim_trailing_whitespace = true 18 | insert_final_newline = true 19 | 20 | [*.md] 21 | trim_trailing_whitespace = false 22 | -------------------------------------------------------------------------------- /client/.gitattributes: -------------------------------------------------------------------------------- 1 | * text=auto -------------------------------------------------------------------------------- /client/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | dist 3 | test/temp 4 | .sass-cache 5 | app/bower_components 6 | .tmp 7 | test/bower_components/ 8 | tags 9 | -------------------------------------------------------------------------------- /client/.jshintrc: -------------------------------------------------------------------------------- 1 | { 2 | "node": true, 3 | "browser": true, 4 | "esnext": true, 5 | "bitwise": true, 6 | "camelcase": true, 7 | "curly": true, 8 | "eqeqeq": true, 9 | "immed": true, 10 | "indent": 4, 11 | "latedef": true, 12 | "newcap": true, 13 | "noarg": true, 14 | "quotmark": "single", 15 | "undef": true, 16 | "unused": true, 17 | "strict": true, 18 | "jquery": true, 19 | "globals": { 20 | "Codeburner": true, 21 | "codeburner": true, 22 | "_": false, 23 | "Backbone": false, 24 | "JST": false, 25 | "beforeEach": false, 26 | "describe": false, 27 | "it": false, 28 | "assert": true, 29 | "expect": true, 30 | "should": true, 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /client/.yo-rc.json: -------------------------------------------------------------------------------- 1 | { 2 | "generator-backbone": { 3 | "appPath": "app", 4 | "appName": "Codeburner", 5 | "testFramework": "mocha", 6 | "templateFramework": "lodash", 7 | "sassBootstrap": true, 8 | "coffee": true, 9 | "includeRequireJS": false 10 | }, 11 | "generator-mocha": {} 12 | } -------------------------------------------------------------------------------- /client/README.md: -------------------------------------------------------------------------------- 1 | Codeburner Client 2 | =================== 3 | 4 | ### Frontend development: 5 | As a pre-requisite, you'll need node.js installed and the 'npm' command should work properly. 6 | 7 | ``` 8 | npm install -g bower 9 | npm install -g grunt-cli 10 | npm install 11 | bower install 12 | ``` 13 | 14 | Then you can run 15 | ``` 16 | grunt serve 17 | ``` 18 | 19 | And open http://localhost:9000 20 | -------------------------------------------------------------------------------- /client/app/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/groupon/codeburner/4686f5316664ba2851803f20cdcf4466da7401ce/client/app/favicon.ico -------------------------------------------------------------------------------- /client/app/images/fire.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/groupon/codeburner/4686f5316664ba2851803f20cdcf4466da7401ce/client/app/images/fire.png -------------------------------------------------------------------------------- /client/app/images/github_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/groupon/codeburner/4686f5316664ba2851803f20cdcf4466da7401ce/client/app/images/github_logo.png -------------------------------------------------------------------------------- /client/app/images/jira_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/groupon/codeburner/4686f5316664ba2851803f20cdcf4466da7401ce/client/app/images/jira_logo.png -------------------------------------------------------------------------------- /client/app/images/loader.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/groupon/codeburner/4686f5316664ba2851803f20cdcf4466da7401ce/client/app/images/loader.gif -------------------------------------------------------------------------------- /client/app/scripts/collections/burn.coffee: -------------------------------------------------------------------------------- 1 | # 2 | #The MIT License (MIT) 3 | # 4 | #Copyright (c) 2016, Groupon, Inc. 5 | # 6 | #Permission is hereby granted, free of charge, to any person obtaining a copy 7 | #of this software and associated documentation files (the "Software"), to deal 8 | #in the Software without restriction, including without limitation the rights 9 | #to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | #copies of the Software, and to permit persons to whom the Software is 11 | #furnished to do so, subject to the following conditions: 12 | # 13 | #The above copyright notice and this permission notice shall be included in 14 | #all copies or substantial portions of the Software. 15 | # 16 | #THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | #IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | #FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | #AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | #LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | #OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | #THE SOFTWARE. 23 | # 24 | 'use strict' 25 | 26 | class Codeburner.Collections.Burn extends Backbone.PageableCollection 27 | model: Codeburner.Models.Burn 28 | url: '/api/burn' 29 | mode: 'server' 30 | state: 31 | pageSize: 25 32 | sortKey: 'count' 33 | order: 1 34 | queryParams: 35 | id: null 36 | filters: 37 | id: null 38 | 39 | 40 | parseState: (data) -> 41 | totalRecords: data.count 42 | 43 | parseRecords: (data) -> 44 | data.results 45 | 46 | resetFilter: -> 47 | @filters = 48 | id: null 49 | do @changeFilter 50 | 51 | changeFilter: -> 52 | query = [] 53 | for key, value of @filters 54 | if $.isArray value 55 | data = value.join ',' 56 | else 57 | data = value 58 | 59 | if data 60 | query.push "#{key}=#{data}" 61 | @queryParams[key] = data 62 | else 63 | @queryParams[key] = null 64 | Backbone.history.navigate "burns?#{query.join '&'}" 65 | -------------------------------------------------------------------------------- /client/app/scripts/collections/filter.coffee: -------------------------------------------------------------------------------- 1 | # 2 | #The MIT License (MIT) 3 | # 4 | #Copyright (c) 2016, Groupon, Inc. 5 | # 6 | #Permission is hereby granted, free of charge, to any person obtaining a copy 7 | #of this software and associated documentation files (the "Software"), to deal 8 | #in the Software without restriction, including without limitation the rights 9 | #to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | #copies of the Software, and to permit persons to whom the Software is 11 | #furnished to do so, subject to the following conditions: 12 | # 13 | #The above copyright notice and this permission notice shall be included in 14 | #all copies or substantial portions of the Software. 15 | # 16 | #THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | #IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | #FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | #AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | #LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | #OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | #THE SOFTWARE. 23 | # 24 | 'use strict' 25 | 26 | class Codeburner.Collections.Filter extends Backbone.PageableCollection 27 | model: Codeburner.Models.Filter 28 | url: '/api/filter' 29 | mode: 'server' 30 | state: 31 | pageSize: 10 32 | sortKey: 'finding_count' 33 | order: 1 34 | 35 | parseState: (data) -> 36 | totalRecords: data.count 37 | 38 | parseRecords: (data) -> 39 | data.results 40 | -------------------------------------------------------------------------------- /client/app/scripts/collections/finding.coffee: -------------------------------------------------------------------------------- 1 | # 2 | #The MIT License (MIT) 3 | # 4 | #Copyright (c) 2016, Groupon, Inc. 5 | # 6 | #Permission is hereby granted, free of charge, to any person obtaining a copy 7 | #of this software and associated documentation files (the "Software"), to deal 8 | #in the Software without restriction, including without limitation the rights 9 | #to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | #copies of the Software, and to permit persons to whom the Software is 11 | #furnished to do so, subject to the following conditions: 12 | # 13 | #The above copyright notice and this permission notice shall be included in 14 | #all copies or substantial portions of the Software. 15 | # 16 | #THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | #IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | #FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | #AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | #LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | #OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | #THE SOFTWARE. 23 | # 24 | 'use strict' 25 | 26 | class Codeburner.Collections.Finding extends Backbone.PageableCollection 27 | model: Codeburner.Models.Finding 28 | url: '/api/finding' 29 | mode: 'server' 30 | state: 31 | pageSize: 25 32 | sortKey: 'severity' 33 | order: 1 34 | 35 | queryParams: 36 | status: '0' 37 | 38 | filters: 39 | status: ['0'] 40 | 41 | parseState: (data) -> 42 | totalRecords: data.count 43 | 44 | parseRecords: (data) -> 45 | data.results 46 | 47 | resetFilter: -> 48 | @filters = 49 | status: ['0'] 50 | burn_id: null 51 | repo_id: null 52 | filtered_by: null 53 | branch: 'master' 54 | only_current: true 55 | 56 | changeFilter: -> 57 | query = [] 58 | for key, value of @filters 59 | if $.isArray value 60 | data = value.join ',' 61 | else 62 | data = value 63 | 64 | if data 65 | query.push "#{key}=#{data}" 66 | @queryParams[key] = data 67 | else 68 | @queryParams[key] = null 69 | Backbone.history.navigate "findings?#{query.join '&'}" 70 | -------------------------------------------------------------------------------- /client/app/scripts/collections/repo.coffee: -------------------------------------------------------------------------------- 1 | # 2 | #The MIT License (MIT) 3 | # 4 | #Copyright (c) 2016, Groupon, Inc. 5 | # 6 | #Permission is hereby granted, free of charge, to any person obtaining a copy 7 | #of this software and associated documentation files (the "Software"), to deal 8 | #in the Software without restriction, including without limitation the rights 9 | #to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | #copies of the Software, and to permit persons to whom the Software is 11 | #furnished to do so, subject to the following conditions: 12 | # 13 | #The above copyright notice and this permission notice shall be included in 14 | #all copies or substantial portions of the Software. 15 | # 16 | #THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | #IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | #FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | #AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | #LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | #OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | #THE SOFTWARE. 23 | # 24 | 'use strict' 25 | 26 | class Codeburner.Collections.Repo extends Backbone.Collection 27 | model: Codeburner.Models.Repo 28 | url: '/api/repo' 29 | mode: 'client' 30 | 31 | parse: (data) -> 32 | data.results 33 | -------------------------------------------------------------------------------- /client/app/scripts/main.coffee: -------------------------------------------------------------------------------- 1 | # 2 | #The MIT License (MIT) 3 | # 4 | #Copyright (c) 2016, Groupon, Inc. 5 | # 6 | #Permission is hereby granted, free of charge, to any person obtaining a copy 7 | #of this software and associated documentation files (the "Software"), to deal 8 | #in the Software without restriction, including without limitation the rights 9 | #to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | #copies of the Software, and to permit persons to whom the Software is 11 | #furnished to do so, subject to the following conditions: 12 | # 13 | #The above copyright notice and this permission notice shall be included in 14 | #all copies or substantial portions of the Software. 15 | # 16 | #THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | #IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | #FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | #AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | #LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | #OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | #THE SOFTWARE. 23 | # 24 | window.Codeburner = 25 | Models: {} 26 | Collections: {} 27 | Views: {} 28 | Routers: {} 29 | Utilities: {} 30 | 31 | window.constants = 32 | refresh_interval: 10 * 1000 33 | display_severity: 34 | 0: 'Unknown' 35 | 1: 'Low' 36 | 2: 'Medium' 37 | 3: 'High' 38 | display_status: 39 | 0: 'Open' 40 | 1: 'Hidden' 41 | 2: 'Published' 42 | 3: 'Filtered' 43 | -------------------------------------------------------------------------------- /client/app/scripts/models/burn.coffee: -------------------------------------------------------------------------------- 1 | # 2 | #The MIT License (MIT) 3 | # 4 | #Copyright (c) 2016, Groupon, Inc. 5 | # 6 | #Permission is hereby granted, free of charge, to any person obtaining a copy 7 | #of this software and associated documentation files (the "Software"), to deal 8 | #in the Software without restriction, including without limitation the rights 9 | #to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | #copies of the Software, and to permit persons to whom the Software is 11 | #furnished to do so, subject to the following conditions: 12 | # 13 | #The above copyright notice and this permission notice shall be included in 14 | #all copies or substantial portions of the Software. 15 | # 16 | #THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | #IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | #FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | #AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | #LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | #OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | #THE SOFTWARE. 23 | # 24 | 'use strict' 25 | 26 | Codeburner.Models.Burn = Backbone.Model.extend 27 | idAttribute: 'id' 28 | -------------------------------------------------------------------------------- /client/app/scripts/models/filter.coffee: -------------------------------------------------------------------------------- 1 | # 2 | #The MIT License (MIT) 3 | # 4 | #Copyright (c) 2016, Groupon, Inc. 5 | # 6 | #Permission is hereby granted, free of charge, to any person obtaining a copy 7 | #of this software and associated documentation files (the "Software"), to deal 8 | #in the Software without restriction, including without limitation the rights 9 | #to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | #copies of the Software, and to permit persons to whom the Software is 11 | #furnished to do so, subject to the following conditions: 12 | # 13 | #The above copyright notice and this permission notice shall be included in 14 | #all copies or substantial portions of the Software. 15 | # 16 | #THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | #IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | #FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | #AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | #LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | #OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | #THE SOFTWARE. 23 | # 24 | 'use strict' 25 | 26 | Codeburner.Models.Filter = Backbone.Model.extend 27 | idAttribute: 'id' 28 | -------------------------------------------------------------------------------- /client/app/scripts/models/finding.coffee: -------------------------------------------------------------------------------- 1 | # 2 | #The MIT License (MIT) 3 | # 4 | #Copyright (c) 2016, Groupon, Inc. 5 | # 6 | #Permission is hereby granted, free of charge, to any person obtaining a copy 7 | #of this software and associated documentation files (the "Software"), to deal 8 | #in the Software without restriction, including without limitation the rights 9 | #to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | #copies of the Software, and to permit persons to whom the Software is 11 | #furnished to do so, subject to the following conditions: 12 | # 13 | #The above copyright notice and this permission notice shall be included in 14 | #all copies or substantial portions of the Software. 15 | # 16 | #THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | #IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | #FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | #AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | #LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | #OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | #THE SOFTWARE. 23 | # 24 | 'use strict' 25 | 26 | Codeburner.Models.Finding = Backbone.Model.extend 27 | idAttribute: 'id' 28 | -------------------------------------------------------------------------------- /client/app/scripts/models/repo.coffee: -------------------------------------------------------------------------------- 1 | # 2 | #The MIT License (MIT) 3 | # 4 | #Copyright (c) 2016, Groupon, Inc. 5 | # 6 | #Permission is hereby granted, free of charge, to any person obtaining a copy 7 | #of this software and associated documentation files (the "Software"), to deal 8 | #in the Software without restriction, including without limitation the rights 9 | #to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | #copies of the Software, and to permit persons to whom the Software is 11 | #furnished to do so, subject to the following conditions: 12 | # 13 | #The above copyright notice and this permission notice shall be included in 14 | #all copies or substantial portions of the Software. 15 | # 16 | #THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | #IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | #FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | #AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | #LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | #OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | #THE SOFTWARE. 23 | # 24 | 'use strict' 25 | 26 | Codeburner.Models.Repo = Backbone.Model.extend 27 | idAttribute: 'id' 28 | -------------------------------------------------------------------------------- /client/app/scripts/templates/burn_stats.ejs: -------------------------------------------------------------------------------- 1 | 24 |
25 |
26 |
27 |

<%= stats['burns'].toLocaleString('en') %> burns of <%= stats['repos'].toLocaleString('en') %> repositories run

28 |
29 |
30 | 31 |
32 |
33 |

<%= stats['lines'].toLocaleString('en') %> lines scanned in <%= stats['files'].toLocaleString('en') %> files

34 |
35 |
36 | 37 |
38 |
39 |

<%= stats['total_findings'].toLocaleString('en') %> possible vulnerabilities found

40 |
41 |
42 |
43 | -------------------------------------------------------------------------------- /client/app/scripts/templates/burn_submit.ejs: -------------------------------------------------------------------------------- 1 | 24 |
25 | 26 |
27 | 28 | 31 | 32 |
33 | 34 | 35 | Enter an e-mail address to be notified this burn completes 36 |
37 |
38 | -------------------------------------------------------------------------------- /client/app/scripts/templates/default.ejs: -------------------------------------------------------------------------------- 1 | 24 |
25 | -------------------------------------------------------------------------------- /client/app/scripts/templates/filter_page.ejs: -------------------------------------------------------------------------------- 1 | 24 |
25 |
26 |
27 | 28 | 29 | 30 |
31 |
32 |
33 |
34 | -------------------------------------------------------------------------------- /client/app/scripts/templates/finding_publish_jira.ejs: -------------------------------------------------------------------------------- 1 | 24 |
25 | 26 | 27 | Enter the JIRA project name (not the full URL): http://jira.host/browse/PROJECT-ticket_number 28 |
29 |
30 | -------------------------------------------------------------------------------- /client/app/scripts/templates/finding_publish_results.ejs: -------------------------------------------------------------------------------- 1 | 24 |
25 | Ticket Created:

26 |

29 |
30 | -------------------------------------------------------------------------------- /client/app/scripts/templates/login_menu.ejs: -------------------------------------------------------------------------------- 1 | 14 | -------------------------------------------------------------------------------- /client/app/scripts/templates/paginater.ejs: -------------------------------------------------------------------------------- 1 | 24 | <% if (typeof paginater !== "undefined" && paginater !==null) { %> 25 |
26 | 47 |

<%= (current - 1) * pageSize + 1 %> - <%= (current * pageSize > totalRows) ? totalRows : current * pageSize %> of <%= totalRows %>

48 |
49 | <% } %> 50 | -------------------------------------------------------------------------------- /client/app/scripts/templates/service_list.ejs: -------------------------------------------------------------------------------- 1 | 24 | 25 | 26 | <% repos.forEach(function(repo){ %> 27 | 28 | <% }) %> 29 | 30 |
<%= repo.get('name') %>
31 | -------------------------------------------------------------------------------- /client/app/scripts/templates/settings/admin.ejs: -------------------------------------------------------------------------------- 1 | 24 |
25 |
Administrator Access
26 |
27 |
28 |
29 |
30 | 31 | 32 |
33 |
34 | 35 |
36 |
37 |
38 | -------------------------------------------------------------------------------- /client/app/scripts/templates/settings/email.ejs: -------------------------------------------------------------------------------- 1 | 24 |
25 |
E-mail
26 |
27 |
28 |
29 | General 30 |
31 | 32 |
33 |
34 |

35 |
36 | Link Host 37 |
38 | 39 |
40 |
41 | 42 |
43 |
44 |
45 | -------------------------------------------------------------------------------- /client/app/scripts/templates/settings_page.ejs: -------------------------------------------------------------------------------- 1 | 24 |
25 |
26 |
27 |
28 |
Codeburner Settings
29 |
30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 |
GitHub
Administrator Access
E-mail Notifications
OWASP Pipeline
JIRA
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 | -------------------------------------------------------------------------------- /client/app/scripts/templates/user_page.ejs: -------------------------------------------------------------------------------- 1 | 24 |
25 |
26 |
27 |
28 |
User Preferences - <%= user.name %>
29 |
30 | 31 | 32 | 33 | 34 | 35 |
Repositories
API Tokens
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 | -------------------------------------------------------------------------------- /client/app/scripts/views/default.coffee: -------------------------------------------------------------------------------- 1 | 2 | #The MIT License (MIT) 3 | # 4 | #Copyright (c) 2016, Groupon, Inc. 5 | # 6 | #Permission is hereby granted, free of charge, to any person obtaining a copy 7 | #of this software and associated documentation files (the "Software"), to deal 8 | #in the Software without restriction, including without limitation the rights 9 | #to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | #copies of the Software, and to permit persons to whom the Software is 11 | #furnished to do so, subject to the following conditions: 12 | # 13 | #The above copyright notice and this permission notice shall be included in 14 | #all copies or substantial portions of the Software. 15 | # 16 | #THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | #IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | #FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | #AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | #LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | #OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | #THE SOFTWARE. 23 | # 24 | 'use strict' 25 | 26 | Codeburner.Views.Default = Backbone.View.extend 27 | el: $('#content') 28 | 29 | renderStats: -> 30 | url = '/api/stats' 31 | Codeburner.Utilities.getRequest url, (data) -> 32 | $('#burn_stats').html JST['app/scripts/templates/burn_stats.ejs'] 33 | stats: data 34 | 35 | render: -> 36 | do @delegateEvents 37 | @$el.html JST['app/scripts/templates/default.ejs'] 38 | do @renderStats 39 | -------------------------------------------------------------------------------- /client/bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "codeburner-frontend", 3 | "version": "1.0.0", 4 | "authors": [ 5 | "Alex Lock ", 6 | "Michael Chang " 7 | ], 8 | "description": "dashboard to monitor codeburner", 9 | "ignore": [ 10 | "**/.*", 11 | "node_modules", 12 | "bower_components", 13 | "test", 14 | "tests" 15 | ], 16 | "dependencies": { 17 | "Autolinker.js": "~0.22.0", 18 | "backbone": "~1.2.3", 19 | "backbone.paginator": "~2.0.2", 20 | "bootstrap-sass-official": "~3.3.6", 21 | "highlightjs": "~9.0.0", 22 | "jquery": "~2.2.0", 23 | "moment": "~2.11.0", 24 | "moment-timezone": "~0.5.0", 25 | "lodash": "~3.10.1", 26 | "arrive": "~2.3.0", 27 | "bootstrap-material-design": "~0.5.9", 28 | "bootstrap-material-datetimepicker": "~2.5.3", 29 | "nouislider": "~8.2.1", 30 | "selectize": "~0.12.1", 31 | "octicons": "*" 32 | }, 33 | "resolutions": { 34 | "jquery": "~2.1.4", 35 | "bootstrap-material-design": "~0.5.8" 36 | }, 37 | "devDependencies": { 38 | "chai": "~3.4.2", 39 | "mocha": "~2.3.4" 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /client/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "codeburner-frontend", 3 | "description": "The frontend of codeburner", 4 | "version": "1.0.0", 5 | "author": { 6 | "name": "Michael Chang", 7 | "email": "github@micbase.com" 8 | }, 9 | "repository": { 10 | "type": "git", 11 | "url": "https://github.com/groupon/codeburner" 12 | }, 13 | "scripts": { 14 | "start": "grunt serve", 15 | "test": "grunt test" 16 | }, 17 | "devDependencies": { 18 | "apache-server-configs": "^2.14.0", 19 | "connect-livereload": "^0.5.4", 20 | "grunt": "^0.4.5", 21 | "grunt-connect-proxy": "^0.2.0", 22 | "grunt-contrib-clean": "^0.7.0", 23 | "grunt-contrib-coffee": "^0.13.0", 24 | "grunt-contrib-concat": "^0.5.1", 25 | "grunt-contrib-connect": "^0.11.2", 26 | "grunt-contrib-copy": "^0.8.2", 27 | "grunt-contrib-cssmin": "^0.14.0", 28 | "grunt-contrib-htmlmin": "^0.6.0", 29 | "grunt-contrib-imagemin": "^1.0.0", 30 | "grunt-contrib-jshint": "^0.11.3", 31 | "grunt-contrib-jst": "^0.6.0", 32 | "grunt-contrib-uglify": "^0.11.0", 33 | "grunt-contrib-watch": "^0.6.1", 34 | "grunt-mocha": "^0.4.15", 35 | "grunt-open": "^0.2.3", 36 | "grunt-rev": "^0.1.0", 37 | "grunt-sass": "^1.1.0", 38 | "grunt-usemin": "^3.1.1", 39 | "jit-grunt": "^0.9.1", 40 | "jshint-stylish": "^2.1.0", 41 | "serve-static": "^1.10.0", 42 | "time-grunt": "^1.3.0" 43 | }, 44 | "engines": { 45 | "node": ">=0.10.0" 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /client/test/collections/burn.spec.coffee: -------------------------------------------------------------------------------- 1 | # 2 | #The MIT License (MIT) 3 | # 4 | #Copyright (c) 2016, Groupon, Inc. 5 | # 6 | #Permission is hereby granted, free of charge, to any person obtaining a copy 7 | #of this software and associated documentation files (the "Software"), to deal 8 | #in the Software without restriction, including without limitation the rights 9 | #to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | #copies of the Software, and to permit persons to whom the Software is 11 | #furnished to do so, subject to the following conditions: 12 | # 13 | #The above copyright notice and this permission notice shall be included in 14 | #all copies or substantial portions of the Software. 15 | # 16 | #THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | #IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | #FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | #AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | #LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | #OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | #THE SOFTWARE. 23 | # 24 | # global beforeEach, describe, it, assert, expect 25 | "use strict" 26 | 27 | describe 'Burn Collection', -> 28 | beforeEach -> 29 | @BurnCollection = new Codeburner.Collections.Burn() 30 | -------------------------------------------------------------------------------- /client/test/collections/filter.spec.coffee: -------------------------------------------------------------------------------- 1 | # 2 | #The MIT License (MIT) 3 | # 4 | #Copyright (c) 2016, Groupon, Inc. 5 | # 6 | #Permission is hereby granted, free of charge, to any person obtaining a copy 7 | #of this software and associated documentation files (the "Software"), to deal 8 | #in the Software without restriction, including without limitation the rights 9 | #to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | #copies of the Software, and to permit persons to whom the Software is 11 | #furnished to do so, subject to the following conditions: 12 | # 13 | #The above copyright notice and this permission notice shall be included in 14 | #all copies or substantial portions of the Software. 15 | # 16 | #THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | #IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | #FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | #AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | #LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | #OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | #THE SOFTWARE. 23 | # 24 | # global beforeEach, describe, it, assert, expect 25 | "use strict" 26 | 27 | describe 'Filter Collection', -> 28 | beforeEach -> 29 | @FilterCollection = new Codeburner.Collections.Filter() 30 | -------------------------------------------------------------------------------- /client/test/collections/finding.spec.coffee: -------------------------------------------------------------------------------- 1 | # 2 | #The MIT License (MIT) 3 | # 4 | #Copyright (c) 2016, Groupon, Inc. 5 | # 6 | #Permission is hereby granted, free of charge, to any person obtaining a copy 7 | #of this software and associated documentation files (the "Software"), to deal 8 | #in the Software without restriction, including without limitation the rights 9 | #to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | #copies of the Software, and to permit persons to whom the Software is 11 | #furnished to do so, subject to the following conditions: 12 | # 13 | #The above copyright notice and this permission notice shall be included in 14 | #all copies or substantial portions of the Software. 15 | # 16 | #THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | #IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | #FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | #AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | #LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | #OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | #THE SOFTWARE. 23 | # 24 | # global beforeEach, describe, it, assert, expect 25 | "use strict" 26 | 27 | describe 'Finding Collection', -> 28 | beforeEach -> 29 | @FindingCollection = new Codeburner.Collections.Finding() 30 | -------------------------------------------------------------------------------- /client/test/collections/service.spec.coffee: -------------------------------------------------------------------------------- 1 | # 2 | #The MIT License (MIT) 3 | # 4 | #Copyright (c) 2016, Groupon, Inc. 5 | # 6 | #Permission is hereby granted, free of charge, to any person obtaining a copy 7 | #of this software and associated documentation files (the "Software"), to deal 8 | #in the Software without restriction, including without limitation the rights 9 | #to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | #copies of the Software, and to permit persons to whom the Software is 11 | #furnished to do so, subject to the following conditions: 12 | # 13 | #The above copyright notice and this permission notice shall be included in 14 | #all copies or substantial portions of the Software. 15 | # 16 | #THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | #IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | #FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | #AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | #LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | #OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | #THE SOFTWARE. 23 | # 24 | # global beforeEach, describe, it, assert, expect 25 | "use strict" 26 | 27 | describe 'Service Collection', -> 28 | beforeEach -> 29 | @ServiceCollection = new Codeburner.Collections.Repo() 30 | -------------------------------------------------------------------------------- /client/test/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Mocha Spec Runner 6 | 7 | 8 | 9 |
10 | 11 | 12 | 13 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /client/test/models/burn.spec.coffee: -------------------------------------------------------------------------------- 1 | # 2 | #The MIT License (MIT) 3 | # 4 | #Copyright (c) 2016, Groupon, Inc. 5 | # 6 | #Permission is hereby granted, free of charge, to any person obtaining a copy 7 | #of this software and associated documentation files (the "Software"), to deal 8 | #in the Software without restriction, including without limitation the rights 9 | #to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | #copies of the Software, and to permit persons to whom the Software is 11 | #furnished to do so, subject to the following conditions: 12 | # 13 | #The above copyright notice and this permission notice shall be included in 14 | #all copies or substantial portions of the Software. 15 | # 16 | #THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | #IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | #FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | #AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | #LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | #OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | #THE SOFTWARE. 23 | # 24 | # global beforeEach, describe, it, assert, expect 25 | "use strict" 26 | 27 | describe 'Burn Model', -> 28 | beforeEach -> 29 | @BurnModel = new Codeburner.Models.Burn(); 30 | -------------------------------------------------------------------------------- /client/test/models/filter.spec.coffee: -------------------------------------------------------------------------------- 1 | # 2 | #The MIT License (MIT) 3 | # 4 | #Copyright (c) 2016, Groupon, Inc. 5 | # 6 | #Permission is hereby granted, free of charge, to any person obtaining a copy 7 | #of this software and associated documentation files (the "Software"), to deal 8 | #in the Software without restriction, including without limitation the rights 9 | #to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | #copies of the Software, and to permit persons to whom the Software is 11 | #furnished to do so, subject to the following conditions: 12 | # 13 | #The above copyright notice and this permission notice shall be included in 14 | #all copies or substantial portions of the Software. 15 | # 16 | #THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | #IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | #FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | #AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | #LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | #OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | #THE SOFTWARE. 23 | # 24 | # global beforeEach, describe, it, assert, expect 25 | "use strict" 26 | 27 | describe 'Filter Model', -> 28 | beforeEach -> 29 | @FilterModel = new Codeburner.Models.Filter(); 30 | -------------------------------------------------------------------------------- /client/test/models/finding.spec.coffee: -------------------------------------------------------------------------------- 1 | # 2 | #The MIT License (MIT) 3 | # 4 | #Copyright (c) 2016, Groupon, Inc. 5 | # 6 | #Permission is hereby granted, free of charge, to any person obtaining a copy 7 | #of this software and associated documentation files (the "Software"), to deal 8 | #in the Software without restriction, including without limitation the rights 9 | #to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | #copies of the Software, and to permit persons to whom the Software is 11 | #furnished to do so, subject to the following conditions: 12 | # 13 | #The above copyright notice and this permission notice shall be included in 14 | #all copies or substantial portions of the Software. 15 | # 16 | #THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | #IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | #FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | #AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | #LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | #OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | #THE SOFTWARE. 23 | # 24 | # global beforeEach, describe, it, assert, expect 25 | "use strict" 26 | 27 | describe 'Finding Model', -> 28 | beforeEach -> 29 | @FindingModel = new Codeburner.Models.Finding(); 30 | -------------------------------------------------------------------------------- /client/test/models/service.spec.coffee: -------------------------------------------------------------------------------- 1 | # 2 | #The MIT License (MIT) 3 | # 4 | #Copyright (c) 2016, Groupon, Inc. 5 | # 6 | #Permission is hereby granted, free of charge, to any person obtaining a copy 7 | #of this software and associated documentation files (the "Software"), to deal 8 | #in the Software without restriction, including without limitation the rights 9 | #to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | #copies of the Software, and to permit persons to whom the Software is 11 | #furnished to do so, subject to the following conditions: 12 | # 13 | #The above copyright notice and this permission notice shall be included in 14 | #all copies or substantial portions of the Software. 15 | # 16 | #THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | #IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | #FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | #AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | #LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | #OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | #THE SOFTWARE. 23 | # 24 | # global beforeEach, describe, it, assert, expect 25 | "use strict" 26 | 27 | describe 'Service Model', -> 28 | beforeEach -> 29 | @ServiceModel = new Codeburner.Models.Repo(); 30 | -------------------------------------------------------------------------------- /client/test/spec/test.js: -------------------------------------------------------------------------------- 1 | (function () { 2 | 'use strict'; 3 | 4 | describe('Give it some context', function () { 5 | describe('maybe a bit more context here', function () { 6 | it('should run here few assertions', function () { 7 | 8 | }); 9 | }); 10 | }); 11 | })(); 12 | -------------------------------------------------------------------------------- /client/test/views/burn.spec.coffee: -------------------------------------------------------------------------------- 1 | # 2 | #The MIT License (MIT) 3 | # 4 | #Copyright (c) 2016, Groupon, Inc. 5 | # 6 | #Permission is hereby granted, free of charge, to any person obtaining a copy 7 | #of this software and associated documentation files (the "Software"), to deal 8 | #in the Software without restriction, including without limitation the rights 9 | #to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | #copies of the Software, and to permit persons to whom the Software is 11 | #furnished to do so, subject to the following conditions: 12 | # 13 | #The above copyright notice and this permission notice shall be included in 14 | #all copies or substantial portions of the Software. 15 | # 16 | #THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | #IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | #FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | #AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | #LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | #OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | #THE SOFTWARE. 23 | # 24 | # global beforeEach, describe, it, assert, expect 25 | "use strict" 26 | 27 | describe 'Burn View', -> 28 | beforeEach -> 29 | @BurnView = new Codeburner.Views.Burn(); 30 | -------------------------------------------------------------------------------- /client/test/views/filter.spec.coffee: -------------------------------------------------------------------------------- 1 | # 2 | #The MIT License (MIT) 3 | # 4 | #Copyright (c) 2016, Groupon, Inc. 5 | # 6 | #Permission is hereby granted, free of charge, to any person obtaining a copy 7 | #of this software and associated documentation files (the "Software"), to deal 8 | #in the Software without restriction, including without limitation the rights 9 | #to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | #copies of the Software, and to permit persons to whom the Software is 11 | #furnished to do so, subject to the following conditions: 12 | # 13 | #The above copyright notice and this permission notice shall be included in 14 | #all copies or substantial portions of the Software. 15 | # 16 | #THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | #IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | #FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | #AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | #LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | #OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | #THE SOFTWARE. 23 | # 24 | # global beforeEach, describe, it, assert, expect 25 | "use strict" 26 | 27 | describe 'Filter View', -> 28 | beforeEach -> 29 | @FilterView = new Codeburner.Views.Filter(); 30 | -------------------------------------------------------------------------------- /client/test/views/finding.spec.coffee: -------------------------------------------------------------------------------- 1 | # 2 | #The MIT License (MIT) 3 | # 4 | #Copyright (c) 2016, Groupon, Inc. 5 | # 6 | #Permission is hereby granted, free of charge, to any person obtaining a copy 7 | #of this software and associated documentation files (the "Software"), to deal 8 | #in the Software without restriction, including without limitation the rights 9 | #to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | #copies of the Software, and to permit persons to whom the Software is 11 | #furnished to do so, subject to the following conditions: 12 | # 13 | #The above copyright notice and this permission notice shall be included in 14 | #all copies or substantial portions of the Software. 15 | # 16 | #THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | #IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | #FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | #AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | #LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | #OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | #THE SOFTWARE. 23 | # 24 | # global beforeEach, describe, it, assert, expect 25 | "use strict" 26 | 27 | describe 'Finding View', -> 28 | beforeEach -> 29 | @FindingView = new Codeburner.Views.Finding(); 30 | -------------------------------------------------------------------------------- /client/test/views/stats.spec.coffee: -------------------------------------------------------------------------------- 1 | # 2 | #The MIT License (MIT) 3 | # 4 | #Copyright (c) 2016, Groupon, Inc. 5 | # 6 | #Permission is hereby granted, free of charge, to any person obtaining a copy 7 | #of this software and associated documentation files (the "Software"), to deal 8 | #in the Software without restriction, including without limitation the rights 9 | #to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | #copies of the Software, and to permit persons to whom the Software is 11 | #furnished to do so, subject to the following conditions: 12 | # 13 | #The above copyright notice and this permission notice shall be included in 14 | #all copies or substantial portions of the Software. 15 | # 16 | #THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | #IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | #FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | #AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | #LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | #OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | #THE SOFTWARE. 23 | # 24 | # global beforeEach, describe, it, assert, expect 25 | "use strict" 26 | 27 | describe 'Stats View', -> 28 | beforeEach -> 29 | @StatsView = new Codeburner.Views.Stats(); 30 | -------------------------------------------------------------------------------- /config.ru: -------------------------------------------------------------------------------- 1 | # This file is used by Rack-based servers to start the application. 2 | 3 | require ::File.expand_path('../config/environment', __FILE__) 4 | run Rails.application 5 | -------------------------------------------------------------------------------- /config/app.yml: -------------------------------------------------------------------------------- 1 | # 2 | #The MIT License (MIT) 3 | # 4 | #Copyright (c) 2014, Groupon, Inc. 5 | # 6 | #Permission is hereby granted, free of charge, to any person obtaining a copy 7 | #of this software and associated documentation files (the "Software"), to deal 8 | #in the Software without restriction, including without limitation the rights 9 | #to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | #copies of the Software, and to permit persons to whom the Software is 11 | #furnished to do so, subject to the following conditions: 12 | # 13 | #The above copyright notice and this permission notice shall be included in 14 | #all copies or substantial portions of the Software. 15 | # 16 | #THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | #IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | #FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | #AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | #LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | #OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | #THE SOFTWARE. 23 | # 24 | defaults: &defaults 25 | email: 26 | from: '"Codeburner"' 27 | link_host: http://localhost:9000 28 | github: 29 | api_endpoint: https://api.github.com/ 30 | api_access_token: 31 | link_host: https://github.com 32 | webhook_url: http://localhost:3000/api/github/webhook 33 | oauth: 34 | client_id: 35 | client_secret: 36 | scope: user,repo,read:org,admin:repo_hook 37 | pipeline: 38 | npm_registry: https://registry.npmjs.org/ 39 | tasks_for: 40 | Ruby: BundleAudit,Brakeman,Dawnscanner 41 | JavaScript: NPM,RetireJS,NodeSecurityProject,Snyk 42 | CoffeeScript: NPM,RetireJS,NodeSecurityProject,Snyk 43 | Java: PMD,FindSecurityBugs 44 | pmd_path: /pmd/pmd-bin-5.4.1 45 | findsecbugs_path: /findsecbugs 46 | checkmarx_server: 47 | checkmarx_user: 48 | checkmarx_password: 49 | checkmarx_log: 50 | jira: 51 | username: 52 | password: 53 | host: 54 | context_path: 55 | use_ssl: false 56 | link_host: https://my_jira_host 57 | 58 | development: 59 | <<: *defaults 60 | 61 | test: 62 | <<: *defaults 63 | 64 | production: 65 | <<: *defaults 66 | -------------------------------------------------------------------------------- /config/boot.rb: -------------------------------------------------------------------------------- 1 | # 2 | #The MIT License (MIT) 3 | # 4 | #Copyright (c) 2016, Groupon, Inc. 5 | # 6 | #Permission is hereby granted, free of charge, to any person obtaining a copy 7 | #of this software and associated documentation files (the "Software"), to deal 8 | #in the Software without restriction, including without limitation the rights 9 | #to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | #copies of the Software, and to permit persons to whom the Software is 11 | #furnished to do so, subject to the following conditions: 12 | # 13 | #The above copyright notice and this permission notice shall be included in 14 | #all copies or substantial portions of the Software. 15 | # 16 | #THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | #IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | #FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | #AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | #LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | #OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | #THE SOFTWARE. 23 | # 24 | ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__) 25 | 26 | require 'bundler/setup' # Set up gems listed in the Gemfile. 27 | 28 | # require 'rails/commands/server' 29 | 30 | # module DefaultOptions 31 | # def default_options 32 | # super.merge!(Port: 10000) 33 | # end 34 | # end 35 | 36 | # Rails::Server.send(:prepend, DefaultOptions) 37 | -------------------------------------------------------------------------------- /config/database.yml: -------------------------------------------------------------------------------- 1 | # 2 | #The MIT License (MIT) 3 | # 4 | #Copyright (c) 2016, Groupon, Inc. 5 | # 6 | #Permission is hereby granted, free of charge, to any person obtaining a copy 7 | #of this software and associated documentation files (the "Software"), to deal 8 | #in the Software without restriction, including without limitation the rights 9 | #to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | #copies of the Software, and to permit persons to whom the Software is 11 | #furnished to do so, subject to the following conditions: 12 | # 13 | #The above copyright notice and this permission notice shall be included in 14 | #all copies or substantial portions of the Software. 15 | # 16 | #THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | #IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | #FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | #AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | #LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | #OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | #THE SOFTWARE. 23 | # 24 | common: &common 25 | adapter: mysql2 26 | pool: 5 27 | wait_timeout: 1000 28 | connect_timeout: 500 29 | read_timeout: 2000 30 | write_timeout: 2000 31 | reconnect: true 32 | 33 | local: &local 34 | <<: *common 35 | host: 127.0.0.1 36 | password: 37 | username: root 38 | wait_timeout: 5000 39 | 40 | development: 41 | <<: *local 42 | database: codeburner_development 43 | 44 | test: 45 | <<: *local 46 | database: codeburner_test 47 | 48 | staging: 49 | <<: *common 50 | database: codeburner_staging 51 | host: my_staging_db_host 52 | password: my_staging_db_password 53 | username: my_staging_db_username 54 | 55 | production: 56 | <<: *common 57 | database: codeburner_production 58 | host: <%= ENV['DB_PORT_3306_TCP_ADDR'] %> 59 | port: <%= ENV['DB_PORT_3306_TCP_PORT'] %> 60 | password: 61 | username: root 62 | -------------------------------------------------------------------------------- /config/deploy.rb: -------------------------------------------------------------------------------- 1 | # 2 | #The MIT License (MIT) 3 | # 4 | #Copyright (c) 2016, Groupon, Inc. 5 | # 6 | #Permission is hereby granted, free of charge, to any person obtaining a copy 7 | #of this software and associated documentation files (the "Software"), to deal 8 | #in the Software without restriction, including without limitation the rights 9 | #to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | #copies of the Software, and to permit persons to whom the Software is 11 | #furnished to do so, subject to the following conditions: 12 | # 13 | #The above copyright notice and this permission notice shall be included in 14 | #all copies or substantial portions of the Software. 15 | # 16 | #THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | #IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | #FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | #AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | #LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | #OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | #THE SOFTWARE. 23 | # 24 | #!/bin/env ruby 25 | require 'rubygems' 26 | require 'bundler/capistrano' 27 | require 'capistrano/sidekiq' 28 | require 'whenever/capistrano' 29 | 30 | # set sidekiq timeout to 1hr and do NOT restart workers by default 31 | # NOTE: this means you need to do 'cap sidekiq:restart' if anything significant changes in the backend 32 | set :sidekiq_default_hooks, -> { false } 33 | 34 | set :whenever_roles, ->{ [:web, :app] } 35 | -------------------------------------------------------------------------------- /config/deploy/production.rb: -------------------------------------------------------------------------------- 1 | # server-based syntax 2 | # ====================== 3 | # Defines a single server with a list of roles and multiple properties. 4 | # You can define all roles on a single server, or split them: 5 | 6 | # server 'example.com', user: 'deploy', roles: %w{app db web}, my_property: :my_value 7 | # server 'example.com', user: 'deploy', roles: %w{app web}, other_property: :other_value 8 | # server 'db.example.com', user: 'deploy', roles: %w{db} 9 | 10 | 11 | 12 | # role-based syntax 13 | # ================== 14 | 15 | # Defines a role with one or multiple servers. The primary server in each 16 | # group is considered to be the first unless any hosts have the primary 17 | # property set. Specify the username and a domain or IP for the server. 18 | # Don't use `:all`, it's a meta role. 19 | 20 | # role :app, %w{deploy@example.com}, my_property: :my_value 21 | # role :web, %w{user1@primary.com user2@additional.com}, other_property: :other_value 22 | # role :db, %w{deploy@example.com} 23 | 24 | 25 | 26 | # Configuration 27 | # ============= 28 | # You can set any configuration variable like in config/deploy.rb 29 | # These variables are then only loaded and set in this stage. 30 | # For available Capistrano configuration variables see the documentation page. 31 | # http://capistranorb.com/documentation/getting-started/configuration/ 32 | # Feel free to add new variables to customise your setup. 33 | 34 | 35 | 36 | # Custom SSH Options 37 | # ================== 38 | # You may pass any option but keep in mind that net/ssh understands a 39 | # limited set of options, consult the Net::SSH documentation. 40 | # http://net-ssh.github.io/net-ssh/classes/Net/SSH.html#method-c-start 41 | # 42 | # Global options 43 | # -------------- 44 | # set :ssh_options, { 45 | # keys: %w(/home/rlisowski/.ssh/id_rsa), 46 | # forward_agent: false, 47 | # auth_methods: %w(password) 48 | # } 49 | # 50 | # The server-based syntax can be used to override options: 51 | # ------------------------------------ 52 | # server 'example.com', 53 | # user: 'user_name', 54 | # roles: %w{web app}, 55 | # ssh_options: { 56 | # user: 'user_name', # overrides user setting above 57 | # keys: %w(/home/user_name/.ssh/id_rsa), 58 | # forward_agent: false, 59 | # auth_methods: %w(publickey password) 60 | # # password: 'please use keys' 61 | # } 62 | -------------------------------------------------------------------------------- /config/deploy/staging.rb: -------------------------------------------------------------------------------- 1 | # server-based syntax 2 | # ====================== 3 | # Defines a single server with a list of roles and multiple properties. 4 | # You can define all roles on a single server, or split them: 5 | 6 | # server 'example.com', user: 'deploy', roles: %w{app db web}, my_property: :my_value 7 | # server 'example.com', user: 'deploy', roles: %w{app web}, other_property: :other_value 8 | # server 'db.example.com', user: 'deploy', roles: %w{db} 9 | 10 | 11 | 12 | # role-based syntax 13 | # ================== 14 | 15 | # Defines a role with one or multiple servers. The primary server in each 16 | # group is considered to be the first unless any hosts have the primary 17 | # property set. Specify the username and a domain or IP for the server. 18 | # Don't use `:all`, it's a meta role. 19 | 20 | # role :app, %w{deploy@example.com}, my_property: :my_value 21 | # role :web, %w{user1@primary.com user2@additional.com}, other_property: :other_value 22 | # role :db, %w{deploy@example.com} 23 | 24 | 25 | 26 | # Configuration 27 | # ============= 28 | # You can set any configuration variable like in config/deploy.rb 29 | # These variables are then only loaded and set in this stage. 30 | # For available Capistrano configuration variables see the documentation page. 31 | # http://capistranorb.com/documentation/getting-started/configuration/ 32 | # Feel free to add new variables to customise your setup. 33 | 34 | 35 | 36 | # Custom SSH Options 37 | # ================== 38 | # You may pass any option but keep in mind that net/ssh understands a 39 | # limited set of options, consult the Net::SSH documentation. 40 | # http://net-ssh.github.io/net-ssh/classes/Net/SSH.html#method-c-start 41 | # 42 | # Global options 43 | # -------------- 44 | # set :ssh_options, { 45 | # keys: %w(/home/rlisowski/.ssh/id_rsa), 46 | # forward_agent: false, 47 | # auth_methods: %w(password) 48 | # } 49 | # 50 | # The server-based syntax can be used to override options: 51 | # ------------------------------------ 52 | # server 'example.com', 53 | # user: 'user_name', 54 | # roles: %w{web app}, 55 | # ssh_options: { 56 | # user: 'user_name', # overrides user setting above 57 | # keys: %w(/home/user_name/.ssh/id_rsa), 58 | # forward_agent: false, 59 | # auth_methods: %w(publickey password) 60 | # # password: 'please use keys' 61 | # } 62 | -------------------------------------------------------------------------------- /config/environment.rb: -------------------------------------------------------------------------------- 1 | # 2 | #The MIT License (MIT) 3 | # 4 | #Copyright (c) 2016, Groupon, Inc. 5 | # 6 | #Permission is hereby granted, free of charge, to any person obtaining a copy 7 | #of this software and associated documentation files (the "Software"), to deal 8 | #in the Software without restriction, including without limitation the rights 9 | #to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | #copies of the Software, and to permit persons to whom the Software is 11 | #furnished to do so, subject to the following conditions: 12 | # 13 | #The above copyright notice and this permission notice shall be included in 14 | #all copies or substantial portions of the Software. 15 | # 16 | #THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | #IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | #FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | #AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | #LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | #OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | #THE SOFTWARE. 23 | # 24 | # Load the Rails application. 25 | require File.expand_path('../application', __FILE__) 26 | 27 | # Initialize the Rails application. 28 | Rails.application.initialize! 29 | -------------------------------------------------------------------------------- /config/initializers/assets.rb: -------------------------------------------------------------------------------- 1 | # 2 | #The MIT License (MIT) 3 | # 4 | #Copyright (c) 2016, Groupon, Inc. 5 | # 6 | #Permission is hereby granted, free of charge, to any person obtaining a copy 7 | #of this software and associated documentation files (the "Software"), to deal 8 | #in the Software without restriction, including without limitation the rights 9 | #to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | #copies of the Software, and to permit persons to whom the Software is 11 | #furnished to do so, subject to the following conditions: 12 | # 13 | #The above copyright notice and this permission notice shall be included in 14 | #all copies or substantial portions of the Software. 15 | # 16 | #THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | #IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | #FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | #AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | #LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | #OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | #THE SOFTWARE. 23 | # 24 | # Be sure to restart your server when you modify this file. 25 | 26 | # Version of your assets, change this if you want to expire all your assets. 27 | Rails.application.config.assets.version = '1.0' 28 | 29 | # Add additional assets to the asset load path 30 | # Rails.application.config.assets.paths << Emoji.images_path 31 | 32 | # Precompile additional assets. 33 | # application.js, application.css, and all non-JS/CSS in app/assets folder are already added. 34 | # Rails.application.config.assets.precompile += %w( search.js ) 35 | -------------------------------------------------------------------------------- /config/initializers/backtrace_silencers.rb: -------------------------------------------------------------------------------- 1 | # 2 | #The MIT License (MIT) 3 | # 4 | #Copyright (c) 2016, Groupon, Inc. 5 | # 6 | #Permission is hereby granted, free of charge, to any person obtaining a copy 7 | #of this software and associated documentation files (the "Software"), to deal 8 | #in the Software without restriction, including without limitation the rights 9 | #to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | #copies of the Software, and to permit persons to whom the Software is 11 | #furnished to do so, subject to the following conditions: 12 | # 13 | #The above copyright notice and this permission notice shall be included in 14 | #all copies or substantial portions of the Software. 15 | # 16 | #THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | #IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | #FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | #AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | #LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | #OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | #THE SOFTWARE. 23 | # 24 | # Be sure to restart your server when you modify this file. 25 | 26 | # You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces. 27 | # Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ } 28 | 29 | # You can also remove all the silencers if you're trying to debug a problem that might stem from framework code. 30 | # Rails.backtrace_cleaner.remove_silencers! 31 | -------------------------------------------------------------------------------- /config/initializers/cookies_serializer.rb: -------------------------------------------------------------------------------- 1 | # 2 | #The MIT License (MIT) 3 | # 4 | #Copyright (c) 2016, Groupon, Inc. 5 | # 6 | #Permission is hereby granted, free of charge, to any person obtaining a copy 7 | #of this software and associated documentation files (the "Software"), to deal 8 | #in the Software without restriction, including without limitation the rights 9 | #to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | #copies of the Software, and to permit persons to whom the Software is 11 | #furnished to do so, subject to the following conditions: 12 | # 13 | #The above copyright notice and this permission notice shall be included in 14 | #all copies or substantial portions of the Software. 15 | # 16 | #THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | #IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | #FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | #AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | #LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | #OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | #THE SOFTWARE. 23 | # 24 | # Be sure to restart your server when you modify this file. 25 | 26 | Rails.application.config.action_dispatch.cookies_serializer = :json 27 | -------------------------------------------------------------------------------- /config/initializers/filter_parameter_logging.rb: -------------------------------------------------------------------------------- 1 | # 2 | #The MIT License (MIT) 3 | # 4 | #Copyright (c) 2016, Groupon, Inc. 5 | # 6 | #Permission is hereby granted, free of charge, to any person obtaining a copy 7 | #of this software and associated documentation files (the "Software"), to deal 8 | #in the Software without restriction, including without limitation the rights 9 | #to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | #copies of the Software, and to permit persons to whom the Software is 11 | #furnished to do so, subject to the following conditions: 12 | # 13 | #The above copyright notice and this permission notice shall be included in 14 | #all copies or substantial portions of the Software. 15 | # 16 | #THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | #IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | #FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | #AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | #LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | #OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | #THE SOFTWARE. 23 | # 24 | # Be sure to restart your server when you modify this file. 25 | 26 | # Configure sensitive parameters which will be filtered from the log file. 27 | Rails.application.config.filter_parameters += [:password] 28 | -------------------------------------------------------------------------------- /config/initializers/inflections.rb: -------------------------------------------------------------------------------- 1 | # 2 | #The MIT License (MIT) 3 | # 4 | #Copyright (c) 2016, Groupon, Inc. 5 | # 6 | #Permission is hereby granted, free of charge, to any person obtaining a copy 7 | #of this software and associated documentation files (the "Software"), to deal 8 | #in the Software without restriction, including without limitation the rights 9 | #to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | #copies of the Software, and to permit persons to whom the Software is 11 | #furnished to do so, subject to the following conditions: 12 | # 13 | #The above copyright notice and this permission notice shall be included in 14 | #all copies or substantial portions of the Software. 15 | # 16 | #THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | #IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | #FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | #AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | #LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | #OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | #THE SOFTWARE. 23 | # 24 | # Be sure to restart your server when you modify this file. 25 | 26 | # Add new inflection rules using the following format. Inflections 27 | # are locale specific, and you may define rules for as many different 28 | # locales as you wish. All of these examples are active by default: 29 | # ActiveSupport::Inflector.inflections(:en) do |inflect| 30 | # inflect.plural /^(ox)$/i, '\1en' 31 | # inflect.singular /^(ox)en/i, '\1' 32 | # inflect.irregular 'person', 'people' 33 | # inflect.uncountable %w( fish sheep ) 34 | # end 35 | 36 | # These inflection rules are supported but not enabled by default: 37 | # ActiveSupport::Inflector.inflections(:en) do |inflect| 38 | # inflect.acronym 'RESTful' 39 | # end 40 | -------------------------------------------------------------------------------- /config/initializers/kaminari_config.rb: -------------------------------------------------------------------------------- 1 | # 2 | #The MIT License (MIT) 3 | # 4 | #Copyright (c) 2016, Groupon, Inc. 5 | # 6 | #Permission is hereby granted, free of charge, to any person obtaining a copy 7 | #of this software and associated documentation files (the "Software"), to deal 8 | #in the Software without restriction, including without limitation the rights 9 | #to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | #copies of the Software, and to permit persons to whom the Software is 11 | #furnished to do so, subject to the following conditions: 12 | # 13 | #The above copyright notice and this permission notice shall be included in 14 | #all copies or substantial portions of the Software. 15 | # 16 | #THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | #IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | #FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | #AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | #LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | #OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | #THE SOFTWARE. 23 | # 24 | Kaminari.configure do |config| 25 | config.default_per_page = 100 26 | # config.max_per_page = nil 27 | # config.window = 4 28 | # config.outer_window = 0 29 | # config.left = 0 30 | # config.right = 0 31 | # config.page_method_name = :page 32 | # config.param_name = :page 33 | end 34 | -------------------------------------------------------------------------------- /config/initializers/mime_types.rb: -------------------------------------------------------------------------------- 1 | # 2 | #The MIT License (MIT) 3 | # 4 | #Copyright (c) 2016, Groupon, Inc. 5 | # 6 | #Permission is hereby granted, free of charge, to any person obtaining a copy 7 | #of this software and associated documentation files (the "Software"), to deal 8 | #in the Software without restriction, including without limitation the rights 9 | #to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | #copies of the Software, and to permit persons to whom the Software is 11 | #furnished to do so, subject to the following conditions: 12 | # 13 | #The above copyright notice and this permission notice shall be included in 14 | #all copies or substantial portions of the Software. 15 | # 16 | #THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | #IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | #FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | #AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | #LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | #OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | #THE SOFTWARE. 23 | # 24 | # Be sure to restart your server when you modify this file. 25 | 26 | # Add new mime types for use in respond_to blocks: 27 | # Mime::Type.register "text/richtext", :rtf 28 | -------------------------------------------------------------------------------- /config/initializers/notifications.rb: -------------------------------------------------------------------------------- 1 | # 2 | #The MIT License (MIT) 3 | # 4 | #Copyright (c) 2016, Groupon, Inc. 5 | # 6 | #Permission is hereby granted, free of charge, to any person obtaining a copy 7 | #of this software and associated documentation files (the "Software"), to deal 8 | #in the Software without restriction, including without limitation the rights 9 | #to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | #copies of the Software, and to permit persons to whom the Software is 11 | #furnished to do so, subject to the following conditions: 12 | # 13 | #The above copyright notice and this permission notice shall be included in 14 | #all copies or substantial portions of the Software. 15 | # 16 | #THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | #IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | #FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | #AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | #LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | #OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | #THE SOFTWARE. 23 | # 24 | # ActiveSupport::Notifications.subscribe do |name, start, finish, id, payload| 25 | # Rails.logger.debug(["notification:", name, start, finish, id, payload].join(" ")) 26 | # end 27 | 28 | -------------------------------------------------------------------------------- /config/initializers/paper_trail.rb: -------------------------------------------------------------------------------- 1 | # 2 | #The MIT License (MIT) 3 | # 4 | #Copyright (c) 2016, Groupon, Inc. 5 | # 6 | #Permission is hereby granted, free of charge, to any person obtaining a copy 7 | #of this software and associated documentation files (the "Software"), to deal 8 | #in the Software without restriction, including without limitation the rights 9 | #to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | #copies of the Software, and to permit persons to whom the Software is 11 | #furnished to do so, subject to the following conditions: 12 | # 13 | #The above copyright notice and this permission notice shall be included in 14 | #all copies or substantial portions of the Software. 15 | # 16 | #THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | #IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | #FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | #AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | #LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | #OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | #THE SOFTWARE. 23 | 24 | PaperTrail.config.track_associations = false 25 | -------------------------------------------------------------------------------- /config/initializers/session_store.rb: -------------------------------------------------------------------------------- 1 | # 2 | #The MIT License (MIT) 3 | # 4 | #Copyright (c) 2016, Groupon, Inc. 5 | # 6 | #Permission is hereby granted, free of charge, to any person obtaining a copy 7 | #of this software and associated documentation files (the "Software"), to deal 8 | #in the Software without restriction, including without limitation the rights 9 | #to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | #copies of the Software, and to permit persons to whom the Software is 11 | #furnished to do so, subject to the following conditions: 12 | # 13 | #The above copyright notice and this permission notice shall be included in 14 | #all copies or substantial portions of the Software. 15 | # 16 | #THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | #IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | #FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | #AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | #LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | #OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | #THE SOFTWARE. 23 | # 24 | # Be sure to restart your server when you modify this file. 25 | 26 | Rails.application.config.session_store :cookie_store, key: '_codeburner_session' 27 | -------------------------------------------------------------------------------- /config/initializers/sidekiq.rb: -------------------------------------------------------------------------------- 1 | # 2 | #The MIT License (MIT) 3 | # 4 | #Copyright (c) 2016, Groupon, Inc. 5 | # 6 | #Permission is hereby granted, free of charge, to any person obtaining a copy 7 | #of this software and associated documentation files (the "Software"), to deal 8 | #in the Software without restriction, including without limitation the rights 9 | #to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | #copies of the Software, and to permit persons to whom the Software is 11 | #furnished to do so, subject to the following conditions: 12 | # 13 | #The above copyright notice and this permission notice shall be included in 14 | #all copies or substantial portions of the Software. 15 | # 16 | #THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | #IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | #FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | #AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | #LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | #OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | #THE SOFTWARE. 23 | # 24 | Sidekiq.configure_server do |config| 25 | config.redis = $redis_options 26 | Rails.logger = Sidekiq::Logging.logger 27 | end 28 | 29 | Sidekiq.configure_client do |config| 30 | config.redis = $redis_options 31 | end 32 | -------------------------------------------------------------------------------- /config/initializers/wrap_parameters.rb: -------------------------------------------------------------------------------- 1 | # 2 | #The MIT License (MIT) 3 | # 4 | #Copyright (c) 2016, Groupon, Inc. 5 | # 6 | #Permission is hereby granted, free of charge, to any person obtaining a copy 7 | #of this software and associated documentation files (the "Software"), to deal 8 | #in the Software without restriction, including without limitation the rights 9 | #to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | #copies of the Software, and to permit persons to whom the Software is 11 | #furnished to do so, subject to the following conditions: 12 | # 13 | #The above copyright notice and this permission notice shall be included in 14 | #all copies or substantial portions of the Software. 15 | # 16 | #THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | #IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | #FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | #AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | #LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | #OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | #THE SOFTWARE. 23 | # 24 | # Be sure to restart your server when you modify this file. 25 | 26 | # This file contains settings for ActionController::ParamsWrapper which 27 | # is enabled by default. 28 | 29 | # Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array. 30 | ActiveSupport.on_load(:action_controller) do 31 | wrap_parameters format: [:json] if respond_to?(:wrap_parameters) 32 | end 33 | 34 | # To enable root element in JSON for ActiveRecord objects. 35 | # ActiveSupport.on_load(:active_record) do 36 | # self.include_root_in_json = true 37 | # end 38 | -------------------------------------------------------------------------------- /config/locales/en.yml: -------------------------------------------------------------------------------- 1 | # 2 | #The MIT License (MIT) 3 | # 4 | #Copyright (c) 2016, Groupon, Inc. 5 | # 6 | #Permission is hereby granted, free of charge, to any person obtaining a copy 7 | #of this software and associated documentation files (the "Software"), to deal 8 | #in the Software without restriction, including without limitation the rights 9 | #to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | #copies of the Software, and to permit persons to whom the Software is 11 | #furnished to do so, subject to the following conditions: 12 | # 13 | #The above copyright notice and this permission notice shall be included in 14 | #all copies or substantial portions of the Software. 15 | # 16 | #THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | #IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | #FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | #AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | #LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | #OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | #THE SOFTWARE. 23 | # 24 | # Files in the config/locales directory are used for internationalization 25 | # and are automatically loaded by Rails. If you want to use locales other 26 | # than English, add the necessary files in this directory. 27 | # 28 | # To use the locales, use `I18n.t`: 29 | # 30 | # I18n.t 'hello' 31 | # 32 | # In views, this is aliased to just `t`: 33 | # 34 | # <%= t('hello') %> 35 | # 36 | # To use a different locale, set it with `I18n.locale`: 37 | # 38 | # I18n.locale = :es 39 | # 40 | # This would use the information in config/locales/es.yml. 41 | # 42 | # To learn more, please read the Rails Internationalization guide 43 | # available at http://guides.rubyonrails.org/i18n.html. 44 | 45 | en: 46 | hello: "Hello world" 47 | -------------------------------------------------------------------------------- /config/secrets.yml: -------------------------------------------------------------------------------- 1 | # 2 | #The MIT License (MIT) 3 | # 4 | #Copyright (c) 2016, Groupon, Inc. 5 | # 6 | #Permission is hereby granted, free of charge, to any person obtaining a copy 7 | #of this software and associated documentation files (the "Software"), to deal 8 | #in the Software without restriction, including without limitation the rights 9 | #to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | #copies of the Software, and to permit persons to whom the Software is 11 | #furnished to do so, subject to the following conditions: 12 | # 13 | #The above copyright notice and this permission notice shall be included in 14 | #all copies or substantial portions of the Software. 15 | # 16 | #THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | #IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | #FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | #AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | #LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | #OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | #THE SOFTWARE. 23 | # 24 | # Be sure to restart your server when you modify this file. 25 | 26 | # Your secret key is used for verifying the integrity of signed cookies. 27 | # If you change this key, all old signed cookies will become invalid! 28 | 29 | # Make sure the secret is at least 30 characters and all random, 30 | # no regular words or you'll be exposed to dictionary attacks. 31 | # You can use `rake secret` to generate a secure secret key. 32 | 33 | # Make sure the secrets in this file are kept private 34 | # if you're sharing your code publicly. 35 | 36 | development: 37 | secret_key_base: 858c47445d3f507d7b23879d5c5d816364e515f2f793e64944ec6d121e834180f89337d5953f12438ba3fa2587237dbe7852f1211d1fd89105ffb785088fc463 38 | 39 | test: 40 | secret_key_base: e16e6d631b35b73cde468b4659f4b9df0e8c4137e7356fc617555b3d126f5b82309d33bc5e87889a9a8171ad877f586a1c690a54b2ff30a8bef4fc55475e34ca 41 | 42 | production: 43 | secret_key_base: <%= ENV["SECRET_KEY_BASE"] %> 44 | staging: 45 | secret_key_base: <%= ENV["SECRET_KEY_BASE"] %> 46 | -------------------------------------------------------------------------------- /config/sidekiq.yml: -------------------------------------------------------------------------------- 1 | # 2 | #The MIT License (MIT) 3 | # 4 | #Copyright (c) 2016, Groupon, Inc. 5 | # 6 | #Permission is hereby granted, free of charge, to any person obtaining a copy 7 | #of this software and associated documentation files (the "Software"), to deal 8 | #in the Software without restriction, including without limitation the rights 9 | #to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | #copies of the Software, and to permit persons to whom the Software is 11 | #furnished to do so, subject to the following conditions: 12 | # 13 | #The above copyright notice and this permission notice shall be included in 14 | #all copies or substantial portions of the Software. 15 | # 16 | #THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | #IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | #FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | #AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | #LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | #OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | #THE SOFTWARE. 23 | # 24 | --- 25 | 26 | :concurrency: 10 27 | :pidfile: tmp/pids/sidekiq.pid 28 | :logfile: ./log/sidekiq.log 29 | :timeout: 3600 30 | :queues: 31 | - codeburner 32 | -------------------------------------------------------------------------------- /db/migrate/20160311195126_change_finding_file_type.rb: -------------------------------------------------------------------------------- 1 | class ChangeFindingFileType < ActiveRecord::Migration 2 | def change 3 | change_column :findings, :file, :text 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20160322144611_add_user_to_services.rb: -------------------------------------------------------------------------------- 1 | class AddUserToServices < ActiveRecord::Migration 2 | def change 3 | create_table :repos_users, :id => false do |t| 4 | t.references :service, :user 5 | end 6 | end 7 | end 8 | -------------------------------------------------------------------------------- /db/migrate/20160322161458_create_users.rb: -------------------------------------------------------------------------------- 1 | class CreateUsers < ActiveRecord::Migration 2 | def change 3 | create_table :users do |t| 4 | t.integer :github_uid 5 | t.string :name 6 | t.string :profile_url 7 | t.string :avatar_url 8 | t.string :access_token 9 | 10 | t.timestamps null: false 11 | end 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /db/migrate/20160413184815_add_role_to_users.rb: -------------------------------------------------------------------------------- 1 | class AddRoleToUsers < ActiveRecord::Migration 2 | def change 3 | add_column :users, :role, :integer 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20160413190203_create_settings.rb: -------------------------------------------------------------------------------- 1 | class CreateSettings < ActiveRecord::Migration 2 | def self.up 3 | create_table :settings do |t| 4 | t.string :var, null: false 5 | t.text :value, null: true 6 | t.integer :thing_id, null: true 7 | t.string :thing_type, null: true, limit: 30 8 | t.timestamps 9 | end 10 | 11 | add_index :settings, %i(thing_type thing_id var), unique: true 12 | end 13 | 14 | def self.down 15 | drop_table :settings 16 | end 17 | end 18 | -------------------------------------------------------------------------------- /db/migrate/20160415142013_add_fullname_to_users.rb: -------------------------------------------------------------------------------- 1 | class AddFullnameToUsers < ActiveRecord::Migration 2 | def change 3 | add_column :users, :fullname, :string 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20160428185129_create_tokens.rb: -------------------------------------------------------------------------------- 1 | class CreateTokens < ActiveRecord::Migration 2 | def change 3 | create_table :tokens do |t| 4 | t.references :user, index: true, foreign_key: true 5 | t.string :name 6 | t.string :token 7 | 8 | t.timestamps null: false 9 | end 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /db/migrate/20160428191000_create_branches.rb: -------------------------------------------------------------------------------- 1 | class CreateBranches < ActiveRecord::Migration 2 | def change 3 | create_table :branches do |t| 4 | t.references :service, index: true, foreign_key: true 5 | t.string :name 6 | t.timestamps null: false 7 | end 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /db/migrate/20160428201000_rename_services_to_repositories.rb: -------------------------------------------------------------------------------- 1 | class RenameServicesToRepositories < ActiveRecord::Migration 2 | def change 3 | rename_table :services, :repos 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20160428201001_rename_columns_for_service_to_repo_change.rb: -------------------------------------------------------------------------------- 1 | class RenameColumnsForServiceToRepoChange < ActiveRecord::Migration 2 | def change 3 | rename_column :branches, :service_id, :repo_id 4 | rename_column :burns, :service_id, :repo_id 5 | rename_column :filters, :service_id, :repo_id 6 | rename_column :findings, :service_id, :repo_id 7 | rename_column :repos, :short_name, :name 8 | rename_column :repos, :pretty_name, :full_name 9 | rename_column :repos_users, :service_id, :repo_id 10 | rename_column :system_stats, :services, :repos 11 | rename_column :service_stats, :service_id, :repo_id 12 | 13 | SystemStat.first.versions.each do | version | 14 | o = YAML.load(version.object) 15 | o['repos'] = o.delete 'services' 16 | version.update(:object => o.to_yaml) 17 | end 18 | end 19 | end 20 | -------------------------------------------------------------------------------- /db/migrate/20160429165357_add_html_url_to_services.rb: -------------------------------------------------------------------------------- 1 | class AddHtmlUrlToServices < ActiveRecord::Migration 2 | def change 3 | add_column :repos, :html_url, :string 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20160429170301_add_languages_to_services.rb: -------------------------------------------------------------------------------- 1 | class AddLanguagesToServices < ActiveRecord::Migration 2 | def change 3 | add_column :repos, :languages, :string 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20160502162513_add_webhook_user_to_services.rb: -------------------------------------------------------------------------------- 1 | class AddWebhookUserToServices < ActiveRecord::Migration 2 | def change 3 | add_reference :repos, :webhook_user, references: :users, index: true 4 | add_foreign_key :repos, :users, column: :webhook_user_id 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /db/migrate/20160502185108_add_user_to_burn.rb: -------------------------------------------------------------------------------- 1 | class AddUserToBurn < ActiveRecord::Migration 2 | def change 3 | add_reference :burns, :user, index: true, foreign_key: true 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20160502185332_add_report_status_to_burn.rb: -------------------------------------------------------------------------------- 1 | class AddReportStatusToBurn < ActiveRecord::Migration 2 | def change 3 | add_column :burns, :report_status, :boolean 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20160504140816_add_first_appeared_and_latest_to_findings.rb: -------------------------------------------------------------------------------- 1 | class AddFirstAppearedAndLatestToFindings < ActiveRecord::Migration 2 | def change 3 | add_column :findings, :first_appeared, :string 4 | add_column :findings, :current, :boolean 5 | 6 | Finding.update_all(:current => true) 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /db/migrate/20160504182038_remove_burn_from_findings.rb: -------------------------------------------------------------------------------- 1 | class RemoveBurnFromFindings < ActiveRecord::Migration 2 | def change 3 | remove_reference :findings, :burn, index: true, foreign_key: true 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20160504182039_create_join_table_burn_finding.rb: -------------------------------------------------------------------------------- 1 | class CreateJoinTableBurnFinding < ActiveRecord::Migration 2 | def change 3 | create_join_table :burns, :findings do |t| 4 | t.index [:burn_id, :finding_id] 5 | t.index [:finding_id, :burn_id] 6 | end 7 | 8 | Finding.all.each do |finding| 9 | finding.burns << Burn.where(:repo_id => finding.repo_id, :status => 'done').order('created_at').last 10 | end 11 | 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /db/migrate/20160504192037_fix_service_names.rb: -------------------------------------------------------------------------------- 1 | class FixServiceNames < ActiveRecord::Migration 2 | def change 3 | Repo.all.each do |repo| 4 | burn = Burn.where(:repo_id => repo.id).last 5 | 6 | if burn and burn[:repo_url] 7 | new_name = URI.parse(burn.repo_url).path[1..-1] 8 | repo.name = new_name 9 | repo.full_name = new_name 10 | repo.save 11 | else 12 | Burn.where(:repo_id => repo.id).destroy_all 13 | stat = ServiceStat.where(:repo_id => repo.id).first 14 | ServiceStat.destroy(stat.id) if stat 15 | Repo.destroy(repo.id) if repo 16 | end 17 | end 18 | end 19 | end 20 | -------------------------------------------------------------------------------- /db/migrate/20160506135435_add_branch_and_pull_request_to_burns.rb: -------------------------------------------------------------------------------- 1 | class AddBranchAndPullRequestToBurns < ActiveRecord::Migration 2 | def change 3 | add_column :burns, :branch, :string 4 | add_column :burns, :pull_request, :string 5 | 6 | Burn.update_all(:branch => "master") 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /db/migrate/20160508191001_change_branch_on_services.rb: -------------------------------------------------------------------------------- 1 | class ChangeBranchOnServices < ActiveRecord::Migration 2 | def change 3 | remove_column :burns, :branch 4 | add_column :burns, :branch_id, :integer, references: :branches 5 | 6 | Repo.all.each do |repo| 7 | branch = Branch.create(:repo => repo, :name => 'master') 8 | repo.burns.update_all(:branch_id => branch.id) 9 | end 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /db/migrate/20160512171856_add_branch_to_findings.rb: -------------------------------------------------------------------------------- 1 | class AddBranchToFindings < ActiveRecord::Migration 2 | def change 3 | add_reference :findings, :branch, index: true, foreign_key: true 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20160517162809_add_log_to_burns.rb: -------------------------------------------------------------------------------- 1 | class AddLogToBurns < ActiveRecord::Migration 2 | def change 3 | add_column :burns, :log, :text 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20160518213345_change_log_to_medium_text.rb: -------------------------------------------------------------------------------- 1 | class ChangeLogToMediumText < ActiveRecord::Migration 2 | def change 3 | change_column :burns, :log, :text, limit: 16.megabytes - 1 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20160520185107_add_forked_to_services.rb: -------------------------------------------------------------------------------- 1 | class AddForkedToServices < ActiveRecord::Migration 2 | def change 3 | add_column :repos, :forked, :boolean 4 | 5 | Repo.all.update_all(:forked => false) 6 | end 7 | end 8 | -------------------------------------------------------------------------------- /db/migrate/20160601190842_add_html_url_to_repos.rb: -------------------------------------------------------------------------------- 1 | class AddHtmlUrlToRepos < ActiveRecord::Migration 2 | def change 3 | Repo.all.each do |repo| 4 | repo.update(:html_url => "https://github.groupondev.com/#{repo.name}") 5 | end 6 | end 7 | end 8 | -------------------------------------------------------------------------------- /db/migrate/20160603165144_add_default_burn_user.rb: -------------------------------------------------------------------------------- 1 | class AddDefaultBurnUser < ActiveRecord::Migration 2 | def change 3 | Burn.all.each do |burn| 4 | burn.update(:user => User.first) unless burn.user 5 | end 6 | end 7 | end 8 | -------------------------------------------------------------------------------- /db/migrate/20160607153518_add_default_branch_to_findings.rb: -------------------------------------------------------------------------------- 1 | class AddDefaultBranchToFindings < ActiveRecord::Migration 2 | def change 3 | Finding.all.each do |finding| 4 | finding.update(:branch => finding.repo.branches.first) unless finding.branch 5 | end 6 | end 7 | end 8 | -------------------------------------------------------------------------------- /db/migrate/20160922204536_encrypt_tokens.rb: -------------------------------------------------------------------------------- 1 | class EncryptTokens < ActiveRecord::Migration 2 | def up 3 | rename_column :users, :access_token, :old_token 4 | add_column :users, :encrypted_access_token, :string 5 | add_column :users, :encrypted_access_token_iv, :string 6 | 7 | User.find_each do |u| 8 | u.access_token = u.old_token 9 | u.save 10 | end 11 | 12 | remove_column :users, :old_token 13 | end 14 | 15 | def down 16 | raise ActiveRecord::IrreversibleMigration 17 | end 18 | end 19 | -------------------------------------------------------------------------------- /db/seeds.rb: -------------------------------------------------------------------------------- 1 | # 2 | #The MIT License (MIT) 3 | # 4 | #Copyright (c) 2016, Groupon, Inc. 5 | # 6 | #Permission is hereby granted, free of charge, to any person obtaining a copy 7 | #of this software and associated documentation files (the "Software"), to deal 8 | #in the Software without restriction, including without limitation the rights 9 | #to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | #copies of the Software, and to permit persons to whom the Software is 11 | #furnished to do so, subject to the following conditions: 12 | # 13 | #The above copyright notice and this permission notice shall be included in 14 | #all copies or substantial portions of the Software. 15 | # 16 | #THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | #IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | #FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | #AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | #LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | #OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | #THE SOFTWARE. 23 | # 24 | # This file should contain all the record creation needed to seed the database with its default values. 25 | # The data can then be loaded with the rake db:seed (or created alongside the db with db:setup). 26 | # 27 | # Examples: 28 | # 29 | # cities = City.create([{ name: 'Chicago' }, { name: 'Copenhagen' }]) 30 | # Mayor.create(name: 'Emanuel', city: cities.first) 31 | -------------------------------------------------------------------------------- /docker-build.sh: -------------------------------------------------------------------------------- 1 | docker-compose build 2 | docker-compose run web bash -c "while ! mysqladmin ping -h db --silent; do echo waiting for mysql; sleep 3; done; mysqladmin -u root -h db create codeburner_production" 3 | docker-compose run web rake db:setup 4 | 5 | if [ $? == 0 ]; then 6 | echo -e "\nDocker containers initialized, run 'docker-compose up' to start Codeburner." 7 | fi 8 | -------------------------------------------------------------------------------- /docker-compose.yml: -------------------------------------------------------------------------------- 1 | db: 2 | image: mysql:5.7 3 | ports: 4 | - "13306:3306" 5 | environment: 6 | MYSQL_ALLOW_EMPTY_PASSWORD: 'true' 7 | redis: 8 | image: redis 9 | ports: 10 | - "6379:6379" 11 | web: &app_base 12 | build: . 13 | environment: 14 | - RAILS_ENV=production 15 | - RAILS_SERVE_STATIC_FILES=true 16 | - SECRET_KEY_BASE=d21e2a84a06dc6b1fe95e30a18df6ec559dd623e0a1cd6439796533693167c3b2086a2e143564b1a11d41089c7d22651a4c993a3b30efd93af1e0143ffb57d4c 17 | volumes: 18 | - .:/codeburner 19 | ports: 20 | - "3000:3000" 21 | links: 22 | - db 23 | - redis 24 | command: bash -c "rm -f /codeburner/tmp/pids/server.pid && rake db:migrate && bundle exec rails server -b 0.0.0.0" 25 | worker: 26 | <<: *app_base 27 | ports: [] 28 | command: bash -c "bundle exec sidekiq" 29 | -------------------------------------------------------------------------------- /docs/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/groupon/codeburner/4686f5316664ba2851803f20cdcf4466da7401ce/docs/favicon.ico -------------------------------------------------------------------------------- /docs/images/fire.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/groupon/codeburner/4686f5316664ba2851803f20cdcf4466da7401ce/docs/images/fire.png -------------------------------------------------------------------------------- /docs/index.md: -------------------------------------------------------------------------------- 1 | ## What is Codeburner? 2 | Codeburner is a tool to help security (and dev!) teams manage the chaos of static code analysis. Sure, you can fire off a bunch of scripts at the end of every CI build... but what do you actually DO with all those results? 3 | 4 | Codeburner uses the OWASP pipeline project to run multiple open source and commercial static analysis tools against your code, and provides a unified (and we think rather attractive) interface to sort and act on the issues it finds. 5 | 6 | ## Key Features 7 | * Asynchronous scanning (via sidekiq) that scales 8 | * Advanced false positive filtering 9 | * Publish issues via GitHub or JIRA 10 | * Track statistics and graph security trends in your applications 11 | * Integrates with a variety of open source and commercial scanning tools 12 | * Full REST API for extension and integration with other tools, CI processes, etc. 13 | 14 | ## Supported Tools 15 | * Brakeman 16 | * Bundler-Audit 17 | * Checkmarx** 18 | * Dawnscanner 19 | * FindSecurityBugs 20 | * NodeSecurityProject 21 | * PMD 22 | * Retire.js 23 | * Snyk 24 | 25 | ** commercial license required 26 | 27 | *** 28 | -------------------------------------------------------------------------------- /docs/setup/installation.md: -------------------------------------------------------------------------------- 1 | ## Download 2 | You can download the latest release of Codeburner here: https://github.com/groupon/codeburner/releases 3 | 4 | The rest of this guide assumes you're inside the directory created by unpacking a release tarball or cloning the repository: 5 | 6 |
git clone https://github.com/groupon/codeburner
7 | 8 | ## Ruby 9 | Codeburner was developed on Ruby 2.2, and is tested with/works fine on 2.3. If you're using [RVM](http://rvm.io) or [rbenv](http://rbenv.org) we've provided a .ruby-version so you should be all set. If you aren't using one of those, just make sure your local ruby version is at least 2.0+ before proceeding. 10 | 11 | *** 12 | 13 | ## Bundler 14 | ### Gem 15 | First you'll need to install the bundler gem if you don't already have it: 16 | 17 |
gem install bundler
18 | 19 | ### Bundle Install 20 | Once you have bundler, you can use it to install the local gems for Codeburner: 21 | 22 |
bundle install
23 | 24 | 25 | *** 26 | -------------------------------------------------------------------------------- /docs/setup/startup.md: -------------------------------------------------------------------------------- 1 | ## Start Codeburner 2 | Codeburner should work fine with most standard rack servers. Internally it's been tested to work quite well with both unicorn and puma. 3 | 4 | For local development, we recommend the standard WEBrick rails server and the spring gem for fast iteration. You can start the main app server like so: 5 | 6 |
bundle exec rails s -p 8080
7 | 8 | That will start Codeburner on port 8080, and at this point you should be able to open Codeburner by pointing a web browser at http://localhost:8080/. 9 | 10 | !!! Developers 11 | If you change the port here, just note that you'll also need to change it in the [client proxy config](/developer/client/#api-proxy) for the web client to pass API calls correctly. 12 | 13 | In a production environment, we recommend serving the root static content (public/) with something like httpd or nginx. 14 | 15 | *** 16 | 17 | ## Start Sidekiq 18 | Codeburner uses Sidekiq for asynchronous work (scanning code, sending notifications, etc.). You'll need to explicitly start sidekiq as a separate process for Codeburner to actually "do" anything useful. The default configuration options should work fine in most environments. 19 | 20 | ### Configuration 21 | If you do need to customize sidekiq, it is configured in config/sidekiq.yml. 22 | 23 | ### Startup 24 | For local development/testing you can start sidekiq with bundle exec: 25 | 26 |
bundle exec sidekiq
27 | 28 | If you've deployed to a remote host (and configured Capistrano correctly) you should be able to start sidekiq using cap: 29 | 30 |
bundle exec cap  sidekiq:start
31 | 32 | 33 | *** 34 | -------------------------------------------------------------------------------- /docs/theme/assets/fonts/icon.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/groupon/codeburner/4686f5316664ba2851803f20cdcf4466da7401ce/docs/theme/assets/fonts/icon.eot -------------------------------------------------------------------------------- /docs/theme/assets/fonts/icon.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/groupon/codeburner/4686f5316664ba2851803f20cdcf4466da7401ce/docs/theme/assets/fonts/icon.ttf -------------------------------------------------------------------------------- /docs/theme/assets/fonts/icon.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/groupon/codeburner/4686f5316664ba2851803f20cdcf4466da7401ce/docs/theme/assets/fonts/icon.woff -------------------------------------------------------------------------------- /docs/theme/assets/images/favicon-e565ddfa3b.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/groupon/codeburner/4686f5316664ba2851803f20cdcf4466da7401ce/docs/theme/assets/images/favicon-e565ddfa3b.ico -------------------------------------------------------------------------------- /docs/theme/assets/images/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/groupon/codeburner/4686f5316664ba2851803f20cdcf4466da7401ce/docs/theme/assets/images/favicon.ico -------------------------------------------------------------------------------- /docs/theme/footer.html: -------------------------------------------------------------------------------- 1 | {% if include_next_prev %} 2 | 42 | {% endif %} -------------------------------------------------------------------------------- /docs/theme/header.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /docs/theme/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "assets/images/favicon.ico": "assets/images/favicon-e565ddfa3b.ico", 3 | "assets/javascripts/application.js": "assets/javascripts/application-dfb6964a49.js", 4 | "assets/javascripts/modernizr.js": "assets/javascripts/modernizr-4a5cc7e01e.js", 5 | "assets/stylesheets/application.css": "assets/stylesheets/application-b0857bc6fe.css", 6 | "assets/stylesheets/palettes.css": "assets/stylesheets/palettes-2d6c5d2926.css" 7 | } -------------------------------------------------------------------------------- /docs/theme/nav.html: -------------------------------------------------------------------------------- 1 | {% if nav_item.children %} 2 |
  • 3 | {{ nav_item.title }} 4 |
      5 | {% for nav_item in nav_item.children %} 6 | {% include "nav.html" %} 7 | {% endfor %} 8 |
    9 |
  • 10 | {% else %} 11 |
  • 12 | 13 | {{ nav_item.title }} 14 | 15 | {% if nav_item == current_page %} 16 | {% if h1 %} 17 | {% set toc = (toc | first).children %} 18 | {% endif %} 19 | {% if toc %} 20 | 29 | {% endif %} 30 | {% endif %} 31 |
  • 32 | {% endif %} -------------------------------------------------------------------------------- /docs/user/burns.md: -------------------------------------------------------------------------------- 1 | The home page for Codeburner is the 'burns' page. It can be accessed via the URL http://localhost:8080/, or by clicking the 'Codeburner' title/logo in the navigation bar. 2 | 3 | To submit a new burn, click on the "Submit Burn" button: 4 | 5 | ![burn_submit](images/burn_submit.png) 6 | 7 | Fill out the form that pops up: 8 | 9 | ![burn_submit_form](images/burn_submit_form.png) 10 | 11 | The only required fields are 'Service Name' and 'Repository URL'. You can optionally specify a specific commit/tag to scan and an e-mail address to notify when the burn is complete. 12 | 13 | The list of 'Recent Burns' will refresh automatically, and the status should change to 'done' when it's complete. 14 | 15 | If you highlight/click on a specific burn from the list, you'll be taken to the findings page and shown the findings for **just that one burn**: 16 | 17 | ![burn_list](images/burn_list.png) 18 | 19 | You can also submit a burn through the REST API (useful for scripting or as part of a CI process): 20 | 21 | ```bash 22 | curl -X POST -d '{"repo_name":"codeburner","repo_url":"https://github.com/groupon/codeburner"}' http://localhost:8080/api/burn 23 | ``` 24 | 25 | 26 | *** 27 | -------------------------------------------------------------------------------- /docs/user/images/burn_list.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/groupon/codeburner/4686f5316664ba2851803f20cdcf4466da7401ce/docs/user/images/burn_list.png -------------------------------------------------------------------------------- /docs/user/images/burn_submit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/groupon/codeburner/4686f5316664ba2851803f20cdcf4466da7401ce/docs/user/images/burn_submit.png -------------------------------------------------------------------------------- /docs/user/images/burn_submit_form.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/groupon/codeburner/4686f5316664ba2851803f20cdcf4466da7401ce/docs/user/images/burn_submit_form.png -------------------------------------------------------------------------------- /docs/user/images/details_pane.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/groupon/codeburner/4686f5316664ba2851803f20cdcf4466da7401ce/docs/user/images/details_pane.png -------------------------------------------------------------------------------- /docs/user/images/filter_click.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/groupon/codeburner/4686f5316664ba2851803f20cdcf4466da7401ce/docs/user/images/filter_click.png -------------------------------------------------------------------------------- /docs/user/images/filter_collapse.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/groupon/codeburner/4686f5316664ba2851803f20cdcf4466da7401ce/docs/user/images/filter_collapse.png -------------------------------------------------------------------------------- /docs/user/images/filter_default.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/groupon/codeburner/4686f5316664ba2851803f20cdcf4466da7401ce/docs/user/images/filter_default.png -------------------------------------------------------------------------------- /docs/user/images/filter_delete.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/groupon/codeburner/4686f5316664ba2851803f20cdcf4466da7401ce/docs/user/images/filter_delete.png -------------------------------------------------------------------------------- /docs/user/images/filter_expand.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/groupon/codeburner/4686f5316664ba2851803f20cdcf4466da7401ce/docs/user/images/filter_expand.png -------------------------------------------------------------------------------- /docs/user/images/filter_finding.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/groupon/codeburner/4686f5316664ba2851803f20cdcf4466da7401ce/docs/user/images/filter_finding.png -------------------------------------------------------------------------------- /docs/user/images/filter_more.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/groupon/codeburner/4686f5316664ba2851803f20cdcf4466da7401ce/docs/user/images/filter_more.png -------------------------------------------------------------------------------- /docs/user/images/findings_list.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/groupon/codeburner/4686f5316664ba2851803f20cdcf4466da7401ce/docs/user/images/findings_list.png -------------------------------------------------------------------------------- /docs/user/images/findings_page.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/groupon/codeburner/4686f5316664ba2851803f20cdcf4466da7401ce/docs/user/images/findings_page.png -------------------------------------------------------------------------------- /docs/user/images/github_commit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/groupon/codeburner/4686f5316664ba2851803f20cdcf4466da7401ce/docs/user/images/github_commit.png -------------------------------------------------------------------------------- /docs/user/images/github_commit_click.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/groupon/codeburner/4686f5316664ba2851803f20cdcf4466da7401ce/docs/user/images/github_commit_click.png -------------------------------------------------------------------------------- /docs/user/images/github_file_click.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/groupon/codeburner/4686f5316664ba2851803f20cdcf4466da7401ce/docs/user/images/github_file_click.png -------------------------------------------------------------------------------- /docs/user/images/github_line.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/groupon/codeburner/4686f5316664ba2851803f20cdcf4466da7401ce/docs/user/images/github_line.png -------------------------------------------------------------------------------- /docs/user/images/hide_finding.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/groupon/codeburner/4686f5316664ba2851803f20cdcf4466da7401ce/docs/user/images/hide_finding.png -------------------------------------------------------------------------------- /docs/user/images/publish_finding.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/groupon/codeburner/4686f5316664ba2851803f20cdcf4466da7401ce/docs/user/images/publish_finding.png -------------------------------------------------------------------------------- /docs/user/images/publish_github.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/groupon/codeburner/4686f5316664ba2851803f20cdcf4466da7401ce/docs/user/images/publish_github.png -------------------------------------------------------------------------------- /docs/user/images/publish_jira.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/groupon/codeburner/4686f5316664ba2851803f20cdcf4466da7401ce/docs/user/images/publish_jira.png -------------------------------------------------------------------------------- /docs/user/images/service_list.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/groupon/codeburner/4686f5316664ba2851803f20cdcf4466da7401ce/docs/user/images/service_list.png -------------------------------------------------------------------------------- /docs/user/images/stats_date.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/groupon/codeburner/4686f5316664ba2851803f20cdcf4466da7401ce/docs/user/images/stats_date.png -------------------------------------------------------------------------------- /docs/user/images/stats_datepicker.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/groupon/codeburner/4686f5316664ba2851803f20cdcf4466da7401ce/docs/user/images/stats_datepicker.png -------------------------------------------------------------------------------- /docs/user/images/stats_page.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/groupon/codeburner/4686f5316664ba2851803f20cdcf4466da7401ce/docs/user/images/stats_page.png -------------------------------------------------------------------------------- /docs/user/images/stats_redraw.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/groupon/codeburner/4686f5316664ba2851803f20cdcf4466da7401ce/docs/user/images/stats_redraw.png -------------------------------------------------------------------------------- /docs/user/images/stats_resolution.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/groupon/codeburner/4686f5316664ba2851803f20cdcf4466da7401ce/docs/user/images/stats_resolution.png -------------------------------------------------------------------------------- /docs/user/images/stats_service_list.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/groupon/codeburner/4686f5316664ba2851803f20cdcf4466da7401ce/docs/user/images/stats_service_list.png -------------------------------------------------------------------------------- /docs/user/stats.md: -------------------------------------------------------------------------------- 1 | ![stats_page](images/stats_page.png) 2 | 3 | ## Google Charts 4 | The statistics page uses the Google Charts API to generate graphs. If you prefer a different look for your reports, see the [API documentation](/developer/api/#apistats) for more details on using the REST API to feed the graphing solution of your choice. 5 | 6 | *** 7 | 8 | ## Select a repo 9 | On the left you can select a specific repo (the default is **All Services**) with substring matching: 10 | 11 | ![stats_repo_list](images/stats_repo_list.png) 12 | 13 | If you select a new repo, the charts will redraw automatically using default values. 14 | 15 | *** 16 | 17 | ## Choose a date range 18 | If you click on either the "Start Date" or "End Date" fields a date picker will appear letting you narrow down the date range of the stats generated: 19 | 20 | ![stats_date](images/stats_date.png) 21 | 22 | ![stats_datepicker](images/stats_datepicker.png) 23 | 24 | *** 25 | 26 | ## Tweak history resolution 27 | Codeburner does a fairly good job of choosing a resolution for your statistics based on the length of time between start date and end date to generate nice trend lines. If you want more control over the graphs produced and want to change the level of detail, you can slide the resolution slider left or right to adjust the resolution: 28 | 29 | ![stats_resolution](images/stats_resolution.png) 30 | 31 | !!! Warning 32 | Be careful with the resolution setting. If you set this too low (say, every 5 minutes on multiple months of history) you can generate a **very** large number of database queries and cause considerable slowdown. 33 | 34 | *** 35 | 36 | ## Redraw 37 | After setting a new combination of start date, end date, and resolution you need to click the newly-revealed "Redraw" button to redraw the charts: 38 | 39 | ![stats_redraw](images/stats_redraw.png) 40 | -------------------------------------------------------------------------------- /lib/assets/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/groupon/codeburner/4686f5316664ba2851803f20cdcf4466da7401ce/lib/assets/.keep -------------------------------------------------------------------------------- /lib/tasks/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/groupon/codeburner/4686f5316664ba2851803f20cdcf4466da7401ce/lib/tasks/.keep -------------------------------------------------------------------------------- /lib/tasks/burn.rake: -------------------------------------------------------------------------------- 1 | require './config/boot' 2 | require './config/environment' 3 | require 'pp' 4 | 5 | namespace :burn do 6 | task :list do 7 | Burn.order('id DESC').page(1).per(10).each do |burn| 8 | pp burn 9 | end 10 | end 11 | 12 | task :delete do 13 | ARGV.each { |a| task a.to_sym do ; end } 14 | 15 | id = ARGV[1] 16 | burn = Burn.find(id) 17 | 18 | puts "This will delete burn ##{id} and all #{Finding.burn_id(id).count} findings associated with it. Are you sure? [y/N]" 19 | input = STDIN.getch 20 | raise RuntimeError unless input.downcase == 'y' 21 | 22 | count = Finding.burn_id(id).count 23 | Finding.burn_id(id).destroy_all 24 | burn.destroy 25 | puts "Successfully deleted burn ##{id} and #{count} findings" 26 | 27 | $redis.del ["burn_list", "burn_stats", "stats", "history", "history_range"] 28 | end 29 | end 30 | -------------------------------------------------------------------------------- /lib/tasks/frontend.rake: -------------------------------------------------------------------------------- 1 | require './config/boot' 2 | require './config/environment' 3 | 4 | namespace :frontend do 5 | task :build do 6 | puts `cd client && grunt build && cp -r dist/* #{Dir.pwd}/public/` 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /mkdocs.yml: -------------------------------------------------------------------------------- 1 | site_name: Codeburner 2 | site_url: http://groupon.github.io/codeburner 3 | site_description: One static analysis tool to rule them all... 4 | site_author: Groupon, Inc. 5 | site_favicon: favicon.ico 6 | repo_url: https://github.com/groupon/codeburner 7 | extra_css: 8 | - css/prism.css 9 | extra_javascript: 10 | - js/prism.js 11 | pages: 12 | - Home: index.md 13 | - Setup Guide: 14 | - Quick Start: setup/quickstart.md 15 | - Installation: setup/installation.md 16 | - Configuration: setup/configuration.md 17 | - Scanning Tools: setup/scanning_tools.md 18 | - Start Burning!: setup/startup.md 19 | - User Guide: 20 | - Submit a Burn: user/burns.md 21 | - Interact with Findings: user/findings.md 22 | - Filtering: user/filters.md 23 | - Statistics/Charts: user/stats.md 24 | - Developer Guide: 25 | - Rails Backend: developer/backend.md 26 | - Web Client: developer/client.md 27 | - Pipeline: developer/pipeline.md 28 | - API Reference: developer/api.md 29 | markdown_extensions: 30 | - toc: 31 | permalink: '#' 32 | - admonition 33 | - codehilite(css_class=code) 34 | theme_dir: ./docs/theme 35 | extra: 36 | logo: images/fire.png 37 | author: 38 | github: groupon 39 | twitter: GrouponEng 40 | -------------------------------------------------------------------------------- /public/404.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | The page you were looking for doesn't exist (404) 5 | 6 | 55 | 56 | 57 | 58 | 59 |
    60 |
    61 |

    The page you were looking for doesn't exist.

    62 |

    You may have mistyped the address or the page may have moved.

    63 |
    64 |

    If you are the application owner check the logs for more information.

    65 |
    66 | 67 | 68 | -------------------------------------------------------------------------------- /public/422.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | The change you wanted was rejected (422) 5 | 6 | 55 | 56 | 57 | 58 | 59 |
    60 |
    61 |

    The change you wanted was rejected.

    62 |

    Maybe you tried to change something you didn't have access to.

    63 |
    64 |

    If you are the application owner check the logs for more information.

    65 |
    66 | 67 | 68 | -------------------------------------------------------------------------------- /public/500.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | We're sorry, but something went wrong (500) 5 | 6 | 55 | 56 | 57 | 58 | 59 |
    60 |
    61 |

    We're sorry, but something went wrong.

    62 |
    63 |

    If you are the application owner check the logs for more information.

    64 |
    65 | 66 | 67 | -------------------------------------------------------------------------------- /public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/groupon/codeburner/4686f5316664ba2851803f20cdcf4466da7401ce/public/favicon.ico -------------------------------------------------------------------------------- /public/images/fire.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/groupon/codeburner/4686f5316664ba2851803f20cdcf4466da7401ce/public/images/fire.png -------------------------------------------------------------------------------- /public/images/github_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/groupon/codeburner/4686f5316664ba2851803f20cdcf4466da7401ce/public/images/github_logo.png -------------------------------------------------------------------------------- /public/images/jira_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/groupon/codeburner/4686f5316664ba2851803f20cdcf4466da7401ce/public/images/jira_logo.png -------------------------------------------------------------------------------- /public/images/loader.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/groupon/codeburner/4686f5316664ba2851803f20cdcf4466da7401ce/public/images/loader.gif -------------------------------------------------------------------------------- /public/robots.txt: -------------------------------------------------------------------------------- 1 | # See http://www.robotstxt.org/robotstxt.html for documentation on how to use the robots.txt file 2 | # 3 | # To ban all spiders from the entire site uncomment the next two lines: 4 | # User-agent: * 5 | # Disallow: / 6 | -------------------------------------------------------------------------------- /public/styles/octicons-local.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/groupon/codeburner/4686f5316664ba2851803f20cdcf4466da7401ce/public/styles/octicons-local.ttf -------------------------------------------------------------------------------- /public/styles/octicons.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/groupon/codeburner/4686f5316664ba2851803f20cdcf4466da7401ce/public/styles/octicons.ttf -------------------------------------------------------------------------------- /public/styles/octicons.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/groupon/codeburner/4686f5316664ba2851803f20cdcf4466da7401ce/public/styles/octicons.woff -------------------------------------------------------------------------------- /test/controllers/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/groupon/codeburner/4686f5316664ba2851803f20cdcf4466da7401ce/test/controllers/.keep -------------------------------------------------------------------------------- /test/fixtures/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/groupon/codeburner/4686f5316664ba2851803f20cdcf4466da7401ce/test/fixtures/.keep -------------------------------------------------------------------------------- /test/fixtures/branches.yml: -------------------------------------------------------------------------------- 1 | # Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html 2 | 3 | one: 4 | repo_id: 5 | ref: MyString 6 | 7 | two: 8 | repo_id: 9 | ref: MyString 10 | -------------------------------------------------------------------------------- /test/fixtures/burn.json: -------------------------------------------------------------------------------- 1 | {"id":271267788,"repo_name":"Test Service","revision":"abcdefg123456789","code_lang":"JavaScript, CSS, Shell","repo_url":"http://fake.server/a/path","status":"created"} 2 | -------------------------------------------------------------------------------- /test/fixtures/burns.yml: -------------------------------------------------------------------------------- 1 | # 2 | #The MIT License (MIT) 3 | # 4 | #Copyright (c) 2016, Groupon, Inc. 5 | # 6 | #Permission is hereby granted, free of charge, to any person obtaining a copy 7 | #of this software and associated documentation files (the "Software"), to deal 8 | #in the Software without restriction, including without limitation the rights 9 | #to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | #copies of the Software, and to permit persons to whom the Software is 11 | #furnished to do so, subject to the following conditions: 12 | # 13 | #The above copyright notice and this permission notice shall be included in 14 | #all copies or substantial portions of the Software. 15 | # 16 | #THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | #IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | #FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | #AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | #LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | #OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | #THE SOFTWARE. 23 | # 24 | # Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html 25 | 26 | one: 27 | repo: one 28 | revision: abcdefg123456789 29 | code_lang: JavaScript, CSS, Shell 30 | repo_url: http://github.com/a/path 31 | num_files: 100 32 | num_lines: 5000 33 | repo_portal: true 34 | status: created 35 | 36 | two: 37 | repo: two 38 | revision: 123456789abcdefg 39 | code_lang: Ruby, JavaScript, CoffeScript 40 | repo_url: http://fake.server/a/path 41 | num_files: 200 42 | num_lines: 10000 43 | repo_portal: false 44 | status: created 45 | 46 | three: 47 | repo: two 48 | revision: 123456789qwerty 49 | code_lang: Ruby, Java, Python 50 | repo_url: http://fake.server/a/path 51 | num_files: 200 52 | num_lines: 10000 53 | repo_portal: true 54 | status: created 55 | 56 | four: 57 | repo: two 58 | revision: 123456789zxcv 59 | code_lang: Invalid_Language 60 | repo_url: http://fake.server/a/path 61 | num_files: 200 62 | num_lines: 10000 63 | repo_portal: false 64 | status: created 65 | -------------------------------------------------------------------------------- /test/fixtures/filters.yml: -------------------------------------------------------------------------------- 1 | # 2 | #The MIT License (MIT) 3 | # 4 | #Copyright (c) 2016, Groupon, Inc. 5 | # 6 | #Permission is hereby granted, free of charge, to any person obtaining a copy 7 | #of this software and associated documentation files (the "Software"), to deal 8 | #in the Software without restriction, including without limitation the rights 9 | #to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | #copies of the Software, and to permit persons to whom the Software is 11 | #furnished to do so, subject to the following conditions: 12 | # 13 | #The above copyright notice and this permission notice shall be included in 14 | #all copies or substantial portions of the Software. 15 | # 16 | #THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | #IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | #FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | #AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | #LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | #OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | #THE SOFTWARE. 23 | # 24 | # Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html 25 | 26 | one: 27 | repo: one 28 | severity: 3 29 | fingerprint: abcdefg123456789 30 | scanner: test_scanner 31 | description: test_description 32 | detail: test_detail 33 | file: app/test.rb 34 | line: '1' 35 | code: some_test_code() 36 | 37 | two: 38 | repo: two 39 | severity: 3 40 | fingerprint: gfedcba0987654321 41 | scanner: test_scanner 42 | description: test_description 43 | detail: test_detail_2 44 | file: app/test2.rb 45 | line: '1' 46 | code: some_test_code2() 47 | -------------------------------------------------------------------------------- /test/fixtures/findings.yml: -------------------------------------------------------------------------------- 1 | # 2 | #The MIT License (MIT) 3 | # 4 | #Copyright (c) 2016, Groupon, Inc. 5 | # 6 | #Permission is hereby granted, free of charge, to any person obtaining a copy 7 | #of this software and associated documentation files (the "Software"), to deal 8 | #in the Software without restriction, including without limitation the rights 9 | #to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | #copies of the Software, and to permit persons to whom the Software is 11 | #furnished to do so, subject to the following conditions: 12 | # 13 | #The above copyright notice and this permission notice shall be included in 14 | #all copies or substantial portions of the Software. 15 | # 16 | #THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | #IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | #FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | #AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | #LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | #OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | #THE SOFTWARE. 23 | # 24 | # Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html 25 | 26 | one: 27 | repo: one 28 | burn: one 29 | filter: one 30 | description: test_description 31 | severity: 3 32 | fingerprint: abcdefg123456789 33 | detail: test_detail 34 | status: 1 35 | scanner: test_scanner 36 | file: app/test.rb 37 | line: 1 38 | code: some_test_code() 39 | 40 | two: 41 | repo: two 42 | burn: two 43 | filter: 44 | description: Finding Two 45 | severity: 2 46 | fingerprint: 123456789abcdefg 47 | detail: Details about finding two 48 | status: 1 49 | scanner: Checkmarx 50 | file: app/test2.rb 51 | line: 50 52 | code: test_code_2(stopped).code 53 | -------------------------------------------------------------------------------- /test/fixtures/notification_mailer/notification_email: -------------------------------------------------------------------------------- 1 | 2 | 3 |

    Codeburner Report

    4 |

    Codeburner has finished burning Test Service - abcdefg123456789. 5 |

    You can view the full results and sort/create jira issues here: 6 |

    http://localhost:8000/#findings?burn_id=980190962 7 |


    8 |

    9 | Description: Finding One
    10 | Severity: 3
    11 | Details: Details about finding one
    12 | Scanner: Brakeman
    13 | File: app/test.rb
    14 | Line: 100
    15 | Code:

    test_code(running).code

    16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /test/fixtures/notifications.yml: -------------------------------------------------------------------------------- 1 | # 2 | #The MIT License (MIT) 3 | # 4 | #Copyright (c) 2016, Groupon, Inc. 5 | # 6 | #Permission is hereby granted, free of charge, to any person obtaining a copy 7 | #of this software and associated documentation files (the "Software"), to deal 8 | #in the Software without restriction, including without limitation the rights 9 | #to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | #copies of the Software, and to permit persons to whom the Software is 11 | #furnished to do so, subject to the following conditions: 12 | # 13 | #The above copyright notice and this permission notice shall be included in 14 | #all copies or substantial portions of the Software. 15 | # 16 | #THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | #IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | #FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | #AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | #LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | #OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | #THE SOFTWARE. 23 | # 24 | # Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html 25 | 26 | one: 27 | burn: all 28 | method: email 29 | destination: test@test.com 30 | -------------------------------------------------------------------------------- /test/fixtures/service_stats.yml: -------------------------------------------------------------------------------- 1 | # 2 | #The MIT License (MIT) 3 | # 4 | #Copyright (c) 2016, Groupon, Inc. 5 | # 6 | #Permission is hereby granted, free of charge, to any person obtaining a copy 7 | #of this software and associated documentation files (the "Software"), to deal 8 | #in the Software without restriction, including without limitation the rights 9 | #to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | #copies of the Software, and to permit persons to whom the Software is 11 | #furnished to do so, subject to the following conditions: 12 | # 13 | #The above copyright notice and this permission notice shall be included in 14 | #all copies or substantial portions of the Software. 15 | # 16 | #THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | #IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | #FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | #AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | #LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | #OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | #THE SOFTWARE. 23 | # 24 | # Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html 25 | 26 | one: 27 | repo: one 28 | burns: 1 29 | total_findings: 1 30 | open_findings: 1 31 | filtered_findings: 1 32 | hidden_findings: 1 33 | published_findings: 1 34 | 35 | two: 36 | repo: two 37 | burns: 1 38 | total_findings: 1 39 | open_findings: 1 40 | filtered_findings: 1 41 | hidden_findings: 1 42 | published_findings: 1 43 | -------------------------------------------------------------------------------- /test/fixtures/services.yml: -------------------------------------------------------------------------------- 1 | # 2 | #The MIT License (MIT) 3 | # 4 | #Copyright (c) 2016, Groupon, Inc. 5 | # 6 | #Permission is hereby granted, free of charge, to any person obtaining a copy 7 | #of this software and associated documentation files (the "Software"), to deal 8 | #in the Software without restriction, including without limitation the rights 9 | #to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | #copies of the Software, and to permit persons to whom the Software is 11 | #furnished to do so, subject to the following conditions: 12 | # 13 | #The above copyright notice and this permission notice shall be included in 14 | #all copies or substantial portions of the Software. 15 | # 16 | #THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | #IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | #FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | #AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | #LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | #OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | #THE SOFTWARE. 23 | # 24 | # Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html 25 | 26 | one: 27 | name: test_repo 28 | full_name: Test Service 29 | repo_portal: true 30 | 31 | two: 32 | name: test_repo_2 33 | full_name: Test Service 2 34 | repo_portal: false 35 | -------------------------------------------------------------------------------- /test/fixtures/system_stats.yml: -------------------------------------------------------------------------------- 1 | # 2 | #The MIT License (MIT) 3 | # 4 | #Copyright (c) 2016, Groupon, Inc. 5 | # 6 | #Permission is hereby granted, free of charge, to any person obtaining a copy 7 | #of this software and associated documentation files (the "Software"), to deal 8 | #in the Software without restriction, including without limitation the rights 9 | #to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | #copies of the Software, and to permit persons to whom the Software is 11 | #furnished to do so, subject to the following conditions: 12 | # 13 | #The above copyright notice and this permission notice shall be included in 14 | #all copies or substantial portions of the Software. 15 | # 16 | #THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | #IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | #FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | #AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | #LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | #OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | #THE SOFTWARE. 23 | # 24 | # Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html 25 | 26 | one: 27 | repos: 1 28 | burns: 1 29 | total_findings: 1 30 | open_findings: 1 31 | hidden_findings: 1 32 | published_findings: 1 33 | filtered_findings: 1 34 | files: 1 35 | lines: 1 36 | 37 | two: 38 | repos: 1 39 | burns: 1 40 | total_findings: 1 41 | open_findings: 1 42 | hidden_findings: 1 43 | published_findings: 1 44 | filtered_findings: 1 45 | files: 1 46 | lines: 1 47 | -------------------------------------------------------------------------------- /test/fixtures/tokens.yml: -------------------------------------------------------------------------------- 1 | # Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html 2 | 3 | one: 4 | user_id: 5 | name: MyString 6 | token: MyString 7 | 8 | two: 9 | user_id: 10 | name: MyString 11 | token: MyString 12 | -------------------------------------------------------------------------------- /test/fixtures/users.yml: -------------------------------------------------------------------------------- 1 | # Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html 2 | 3 | one: 4 | github_uid: 1 5 | name: MyString 6 | profile_url: MyString 7 | avatar_url: MyString 8 | access_token: MyString 9 | 10 | two: 11 | github_uid: 1 12 | name: MyString 13 | profile_url: MyString 14 | avatar_url: MyString 15 | access_token: MyString 16 | -------------------------------------------------------------------------------- /test/helpers/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/groupon/codeburner/4686f5316664ba2851803f20cdcf4466da7401ce/test/helpers/.keep -------------------------------------------------------------------------------- /test/integration/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/groupon/codeburner/4686f5316664ba2851803f20cdcf4466da7401ce/test/integration/.keep -------------------------------------------------------------------------------- /test/mailers/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/groupon/codeburner/4686f5316664ba2851803f20cdcf4466da7401ce/test/mailers/.keep -------------------------------------------------------------------------------- /test/mailers/notification_mailer_test.rb: -------------------------------------------------------------------------------- 1 | # 2 | #The MIT License (MIT) 3 | # 4 | #Copyright (c) 2016, Groupon, Inc. 5 | # 6 | #Permission is hereby granted, free of charge, to any person obtaining a copy 7 | #of this software and associated documentation files (the "Software"), to deal 8 | #in the Software without restriction, including without limitation the rights 9 | #to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | #copies of the Software, and to permit persons to whom the Software is 11 | #furnished to do so, subject to the following conditions: 12 | # 13 | #The above copyright notice and this permission notice shall be included in 14 | #all copies or substantial portions of the Software. 15 | # 16 | #THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | #IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | #FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | #AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | #LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | #OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | #THE SOFTWARE. 23 | # 24 | require 'test_helper' 25 | 26 | class NotificationMailerTest < ActionMailer::TestCase 27 | # previous_stats = { 28 | # :open_findings => 0, 29 | # :filtered_findings => 0, 30 | # :published_findings => 0, 31 | # :hidden_findings => 0, 32 | # :total_findings => 0 33 | # } 34 | 35 | # def burn_ids 36 | # burn_ids = [] 37 | # burns.each { |burn| burn_ids << burn.id } 38 | # return burn_ids 39 | # end 40 | 41 | # test "notification_email" do 42 | # email = NotificationMailer.notification_email(notifications(:one).destination, burns(:one).id, @previous_stats) 43 | 44 | # assert_emails 1 do 45 | # email.deliver_now 46 | # end 47 | 48 | # assert_equal read_fixture('notification_email').join, email.body.to_s 49 | # end 50 | 51 | # test "fails on invalid burn id" do 52 | # assert_raises(ActiveRecord::RecordNotFound) do 53 | # NotificationMailer.notification_email(notifications(:one).destination, ([1...1000] - burn_ids).sample, @previous_stats).deliver_now 54 | # end 55 | # end 56 | end 57 | -------------------------------------------------------------------------------- /test/mailers/previews/notification_mailer_preview.rb: -------------------------------------------------------------------------------- 1 | # 2 | #The MIT License (MIT) 3 | # 4 | #Copyright (c) 2016, Groupon, Inc. 5 | # 6 | #Permission is hereby granted, free of charge, to any person obtaining a copy 7 | #of this software and associated documentation files (the "Software"), to deal 8 | #in the Software without restriction, including without limitation the rights 9 | #to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | #copies of the Software, and to permit persons to whom the Software is 11 | #furnished to do so, subject to the following conditions: 12 | # 13 | #The above copyright notice and this permission notice shall be included in 14 | #all copies or substantial portions of the Software. 15 | # 16 | #THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | #IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | #FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | #AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | #LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | #OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | #THE SOFTWARE. 23 | # 24 | # Preview all emails at http://localhost:3000/rails/mailers/notification_mailer 25 | class NotificationMailerPreview < ActionMailer::Preview 26 | 27 | end 28 | -------------------------------------------------------------------------------- /test/models/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/groupon/codeburner/4686f5316664ba2851803f20cdcf4466da7401ce/test/models/.keep -------------------------------------------------------------------------------- /test/models/branch_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | class BranchTest < ActiveSupport::TestCase 4 | # test "the truth" do 5 | # assert true 6 | # end 7 | end 8 | -------------------------------------------------------------------------------- /test/models/filter_test.rb: -------------------------------------------------------------------------------- 1 | # 2 | #The MIT License (MIT) 3 | # 4 | #Copyright (c) 2016, Groupon, Inc. 5 | # 6 | #Permission is hereby granted, free of charge, to any person obtaining a copy 7 | #of this software and associated documentation files (the "Software"), to deal 8 | #in the Software without restriction, including without limitation the rights 9 | #to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | #copies of the Software, and to permit persons to whom the Software is 11 | #furnished to do so, subject to the following conditions: 12 | # 13 | #The above copyright notice and this permission notice shall be included in 14 | #all copies or substantial portions of the Software. 15 | # 16 | #THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | #IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | #FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | #AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | #LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | #OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | #THE SOFTWARE. 23 | # 24 | require 'test_helper' 25 | 26 | class FilterTest < ActiveSupport::TestCase 27 | # test "the truth" do 28 | # assert true 29 | # end 30 | end 31 | -------------------------------------------------------------------------------- /test/models/notification_test.rb: -------------------------------------------------------------------------------- 1 | # 2 | #The MIT License (MIT) 3 | # 4 | #Copyright (c) 2016, Groupon, Inc. 5 | # 6 | #Permission is hereby granted, free of charge, to any person obtaining a copy 7 | #of this software and associated documentation files (the "Software"), to deal 8 | #in the Software without restriction, including without limitation the rights 9 | #to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | #copies of the Software, and to permit persons to whom the Software is 11 | #furnished to do so, subject to the following conditions: 12 | # 13 | #The above copyright notice and this permission notice shall be included in 14 | #all copies or substantial portions of the Software. 15 | # 16 | #THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | #IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | #FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | #AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | #LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | #OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | #THE SOFTWARE. 23 | # 24 | require 'test_helper' 25 | 26 | class NotificationTest < ActiveSupport::TestCase 27 | test "notifies and destroys itself" do 28 | assert_difference('Notification.count', -1) do 29 | notification_email = mock('notification_email') 30 | notification_email.expects(:deliver_now).returns(true).once 31 | NotificationMailer.expects(:notification_email).returns(notification_email).once 32 | 33 | notifications(:one).burn = burns(:one).id 34 | notifications(:one).notify(burns(:one).id, {}) 35 | end 36 | end 37 | 38 | test "fails and destroys itself" do 39 | assert_difference('Notification.count', -1) do 40 | failure_email = mock('failure_email') 41 | failure_email.expects(:deliver_now).returns(true).once 42 | NotificationMailer.expects(:failure_email).returns(failure_email).once 43 | 44 | notifications(:one).burn = burns(:one).id 45 | notifications(:one).fail(burns(:one).id) 46 | end 47 | end 48 | end 49 | -------------------------------------------------------------------------------- /test/models/service_stat_test.rb: -------------------------------------------------------------------------------- 1 | # 2 | #The MIT License (MIT) 3 | # 4 | #Copyright (c) 2016, Groupon, Inc. 5 | # 6 | #Permission is hereby granted, free of charge, to any person obtaining a copy 7 | #of this software and associated documentation files (the "Software"), to deal 8 | #in the Software without restriction, including without limitation the rights 9 | #to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | #copies of the Software, and to permit persons to whom the Software is 11 | #furnished to do so, subject to the following conditions: 12 | # 13 | #The above copyright notice and this permission notice shall be included in 14 | #all copies or substantial portions of the Software. 15 | # 16 | #THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | #IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | #FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | #AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | #LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | #OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | #THE SOFTWARE. 23 | # 24 | require 'test_helper' 25 | 26 | class ServiceStatTest < ActiveSupport::TestCase 27 | # test "the truth" do 28 | # assert true 29 | # end 30 | end 31 | -------------------------------------------------------------------------------- /test/models/system_stat_test.rb: -------------------------------------------------------------------------------- 1 | # 2 | #The MIT License (MIT) 3 | # 4 | #Copyright (c) 2016, Groupon, Inc. 5 | # 6 | #Permission is hereby granted, free of charge, to any person obtaining a copy 7 | #of this software and associated documentation files (the "Software"), to deal 8 | #in the Software without restriction, including without limitation the rights 9 | #to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | #copies of the Software, and to permit persons to whom the Software is 11 | #furnished to do so, subject to the following conditions: 12 | # 13 | #The above copyright notice and this permission notice shall be included in 14 | #all copies or substantial portions of the Software. 15 | # 16 | #THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | #IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | #FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | #AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | #LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | #OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | #THE SOFTWARE. 23 | # 24 | require 'test_helper' 25 | 26 | class SystemStatTest < ActiveSupport::TestCase 27 | # test "the truth" do 28 | # assert true 29 | # end 30 | end 31 | -------------------------------------------------------------------------------- /test/models/token_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | class TokenTest < ActiveSupport::TestCase 4 | # test "the truth" do 5 | # assert true 6 | # end 7 | end 8 | -------------------------------------------------------------------------------- /test/models/user_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | class UserTest < ActiveSupport::TestCase 4 | # test "the truth" do 5 | # assert true 6 | # end 7 | end 8 | -------------------------------------------------------------------------------- /test/test_helper.rb: -------------------------------------------------------------------------------- 1 | # 2 | #The MIT License (MIT) 3 | # 4 | #Copyright (c) 2016, Groupon, Inc. 5 | # 6 | #Permission is hereby granted, free of charge, to any person obtaining a copy 7 | #of this software and associated documentation files (the "Software"), to deal 8 | #in the Software without restriction, including without limitation the rights 9 | #to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | #copies of the Software, and to permit persons to whom the Software is 11 | #furnished to do so, subject to the following conditions: 12 | # 13 | #The above copyright notice and this permission notice shall be included in 14 | #all copies or substantial portions of the Software. 15 | # 16 | #THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | #IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | #FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | #AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | #LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | #OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | #THE SOFTWARE. 23 | # 24 | require "codeclimate-test-reporter" 25 | CodeClimate::TestReporter.start 26 | 27 | require 'simplecov' 28 | SimpleCov.start 'rails' 29 | 30 | ENV["RAILS_ENV"] ||= "test" 31 | require File.expand_path("../../config/environment", __FILE__) 32 | 33 | require "rails/test_help" 34 | require "mocha/mini_test" 35 | 36 | # Improved Minitest output (color and progress bar) 37 | require "minitest/reporters" 38 | Minitest::Reporters.use!(Minitest::Reporters::ProgressReporter.new,ENV,Minitest.backtrace_filter) 39 | 40 | class ActiveSupport::TestCase 41 | fixtures :all 42 | end 43 | 44 | class ActiveRecord::Base 45 | mattr_accessor :shared_connection 46 | @@shared_connection = nil 47 | 48 | def self.connection 49 | @@shared_connection || ConnectionPool::Wrapper.new(:size => 1) { retrieve_connection } 50 | end 51 | end 52 | ActiveRecord::Base.shared_connection = ActiveRecord::Base.connection 53 | 54 | class Minitest::Test 55 | def setup 56 | Rails.cache.clear 57 | end 58 | end 59 | 60 | Minitest.after_run { Rails.cache.clear } 61 | -------------------------------------------------------------------------------- /test/validators/filter_validator_test.rb: -------------------------------------------------------------------------------- 1 | # 2 | #The MIT License (MIT) 3 | # 4 | #Copyright (c) 2016, Groupon, Inc. 5 | # 6 | #Permission is hereby granted, free of charge, to any person obtaining a copy 7 | #of this software and associated documentation files (the "Software"), to deal 8 | #in the Software without restriction, including without limitation the rights 9 | #to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | #copies of the Software, and to permit persons to whom the Software is 11 | #furnished to do so, subject to the following conditions: 12 | # 13 | #The above copyright notice and this permission notice shall be included in 14 | #all copies or substantial portions of the Software. 15 | # 16 | #THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | #IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | #FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | #AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | #LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | #OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | #THE SOFTWARE. 23 | # 24 | require 'test_helper' 25 | 26 | class FilterValidatorTest < ActiveSupport::TestCase 27 | test "drops duplicate filters" do 28 | filter = Filter.new({ 29 | :repo => filters(:one).repo, 30 | :severity => filters(:one).severity, 31 | :fingerprint => filters(:one).fingerprint, 32 | :scanner => filters(:one).scanner, 33 | :description => filters(:one).description, 34 | :detail => filters(:one).detail, 35 | :file => filters(:one).file, 36 | :line => filters(:one).line, 37 | :code => filters(:one).code 38 | }) 39 | refute filter.valid?, "duplicate filter should be invalid" 40 | end 41 | end 42 | -------------------------------------------------------------------------------- /test/workers/burn_worker_test.rb: -------------------------------------------------------------------------------- 1 | # 2 | #The MIT License (MIT) 3 | # 4 | #Copyright (c) 2016, Groupon, Inc. 5 | # 6 | #Permission is hereby granted, free of charge, to any person obtaining a copy 7 | #of this software and associated documentation files (the "Software"), to deal 8 | #in the Software without restriction, including without limitation the rights 9 | #to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | #copies of the Software, and to permit persons to whom the Software is 11 | #furnished to do so, subject to the following conditions: 12 | # 13 | #The above copyright notice and this permission notice shall be included in 14 | #all copies or substantial portions of the Software. 15 | # 16 | #THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | #IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | #FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | #AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | #LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | #OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | #THE SOFTWARE. 23 | # 24 | require 'test_helper' 25 | 26 | class BurnWorkerTest < ActiveSupport::TestCase 27 | test "kicks off ignition" do 28 | burns(:one).expects(:ignite).returns(true).once 29 | Burn.expects(:find).returns(burns(:one)) 30 | 31 | BurnWorker.new.perform(burns(:one).id) 32 | end 33 | end 34 | -------------------------------------------------------------------------------- /vendor/assets/javascripts/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/groupon/codeburner/4686f5316664ba2851803f20cdcf4466da7401ce/vendor/assets/javascripts/.keep -------------------------------------------------------------------------------- /vendor/assets/stylesheets/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/groupon/codeburner/4686f5316664ba2851803f20cdcf4466da7401ce/vendor/assets/stylesheets/.keep --------------------------------------------------------------------------------