Skip to content

Commit

Permalink
Upstream (#14)
Browse files Browse the repository at this point in the history
Upstream
  • Loading branch information
coreyja committed Jun 4, 2019
2 parents 30e59b0 + 6dc561a commit df5e701
Show file tree
Hide file tree
Showing 81 changed files with 599 additions and 1,081 deletions.
2 changes: 2 additions & 0 deletions .github/FUNDING.yml
@@ -0,0 +1,2 @@
github: @andrew, @benjam
open_collective: octobox
66 changes: 3 additions & 63 deletions .rubocop.yml
Expand Up @@ -250,66 +250,6 @@ Metrics/PerceivedComplexity:
human reader.
Enabled: false

##################### Performance #############################

Performance/Count:
Description: >-
Use `count` instead of `select...size`, `reject...size`,
`select...count`, `reject...count`, `select...length`,
and `reject...length`.
Enabled: true

Performance/Detect:
Description: >-
Use `detect` instead of `select.first`, `find_all.first`,
`select.last`, and `find_all.last`.
Reference: 'https://github.com/JuanitoFatas/fast-ruby#enumerabledetect-vs-enumerableselectfirst-code'
Enabled: true

Performance/FlatMap:
Description: >-
Use `Enumerable#flat_map`
instead of `Enumerable#map...Array#flatten(1)`
or `Enumberable#collect..Array#flatten(1)`
Reference: 'https://github.com/JuanitoFatas/fast-ruby#enumerablemaparrayflatten-vs-enumerableflat_map-code'
Enabled: true
EnabledForFlattenWithoutParams: false
# If enabled, this cop will warn about usages of
# `flatten` being called without any parameters.
# This can be dangerous since `flat_map` will only flatten 1 level, and
# `flatten` without any parameters can flatten multiple levels.

Performance/ReverseEach:
Description: 'Use `reverse_each` instead of `reverse.each`.'
Reference: 'https://github.com/JuanitoFatas/fast-ruby#enumerablereverseeach-vs-enumerablereverse_each-code'
Enabled: true

Performance/Sample:
Description: >-
Use `sample` instead of `shuffle.first`,
`shuffle.last`, and `shuffle[Fixnum]`.
Reference: 'https://github.com/JuanitoFatas/fast-ruby#arrayshufflefirst-vs-arraysample-code'
Enabled: true

Performance/Size:
Description: >-
Use `size` instead of `count` for counting
the number of elements in `Array` and `Hash`.
Reference: 'https://github.com/JuanitoFatas/fast-ruby#arraycount-vs-arraysize-code'
Enabled: true

Performance/StringReplacement:
Description: >-
Use `tr` instead of `gsub` when you are replacing the same
number of characters. Use `delete` instead of `gsub` when
you are deleting characters.
Reference: 'https://github.com/JuanitoFatas/fast-ruby#stringgsub-vs-stringtr-code'
Enabled: true

Performance:
enabled: true


##################### Rails ##################################

Rails/ActionFilter:
Expand Down Expand Up @@ -619,7 +559,7 @@ Layout/InitialIndentation:
Checks the indentation of the first non-blank non-comment line in a file.
Enabled: false

Layout/FirstParameterIndentation:
Layout/IndentFirstArgument:
Description: 'Checks the indentation of the first parameter in a method call.'
Enabled: false

Expand Down Expand Up @@ -677,13 +617,13 @@ Layout/IndentationWidth:
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#spaces-indentation'
Enabled: false

Layout/IndentArray:
Layout/IndentFirstArrayElement:
Description: >-
Checks the indentation of the first element in an array
literal.
Enabled: false

Layout/IndentHash:
Layout/IndentFirstHashElement:
Description: 'Checks the indentation of the first key in a hash literal.'
Enabled: false

Expand Down
4 changes: 3 additions & 1 deletion .rubocop_todo.yml
Expand Up @@ -6,6 +6,8 @@
# Note that changes in the inspected code, or installation of new
# versions of RuboCop, may require this file to be generated again.

require: rubocop-performance

# Offense count: 1
# Configuration parameters: AllowSafeAssignment.
Lint/AssignmentInCondition:
Expand Down Expand Up @@ -38,7 +40,7 @@ Metrics/ClassLength:

# Offense count: 9
Metrics/CyclomaticComplexity:
Max: 27
Max: 28

# Offense count: 2
# Configuration parameters: CountComments, ExcludedMethods.
Expand Down
2 changes: 1 addition & 1 deletion .ruby-version
@@ -1 +1 @@
2.6.2
2.6.3
2 changes: 1 addition & 1 deletion .travis.yml
@@ -1,6 +1,6 @@
language: ruby
rvm:
- 2.6.2
- 2.6.3

before_install:
- gem update --system
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
@@ -1,4 +1,4 @@
FROM ruby:2.6.2-alpine
FROM ruby:2.6.3-alpine

ENV APP_ROOT /usr/src/app
WORKDIR $APP_ROOT
Expand Down
16 changes: 8 additions & 8 deletions Gemfile
@@ -1,11 +1,11 @@
source 'https://rubygems.org'
ruby '2.6.2'
ruby '2.6.3'

gem 'rails', '~> 5.2'
gem 'bootstrap'
gem 'attr_encrypted'
gem 'jquery-rails'
gem 'kaminari'
gem 'pagy'
gem 'local_time'
gem 'octicons_helper'
gem 'octokit'
Expand All @@ -18,21 +18,20 @@ gem 'faraday_middleware'
gem 'uglifier'
gem 'pg_search'
gem 'jbuilder'
gem 'rake'
gem 'rake', require: false
gem 'git'
gem 'rgb'
gem 'sidekiq'
gem 'sidekiq-unique-jobs'
gem 'sidekiq-scheduler'
gem 'sidekiq-scheduler', require: false
gem 'rack-canonical-host'
gem 'sidekiq-status'
gem 'gemoji', require: false
gem 'bootsnap', require: false
gem 'bugsnag'
gem 'jwt'
gem 'oj'
gem 'yard'
gem 'simple_form'
gem 'yard', require: false
gem 'commonmarker'

# Supported databases
Expand All @@ -50,6 +49,7 @@ group :development, :test do
gem 'sql_queries_count'
gem 'active_record_query_trace'
gem 'rubocop', require: false
gem 'rubocop-performance'
end

group :test do
Expand All @@ -60,8 +60,8 @@ group :test do
gem 'minitest'
gem 'selenium-webdriver'
gem 'capybara'
gem 'percy-capybara'
gem 'action-cable-testing'
gem 'timecop'
end

group :development do
Expand All @@ -76,7 +76,7 @@ group :development do
end

group :production do
gem 'skylight', '4.0.0.beta2'
gem 'skylight', '4.0.2'
gem 'lograge'
gem 'puma_worker_killer'
gem 'hirefire-resource'
Expand Down
43 changes: 12 additions & 31 deletions Gemfile.lock
Expand Up @@ -109,7 +109,6 @@ GEM
tzinfo
ethon (0.12.0)
ffi (>= 1.3.0)
excon (0.62.0)
execjs (2.7.0)
factory_bot (5.0.2)
activesupport (>= 4.2.0)
Expand Down Expand Up @@ -155,18 +154,6 @@ GEM
thor (>= 0.14, < 2.0)
json (2.2.0)
jwt (2.1.0)
kaminari (1.1.1)
activesupport (>= 4.1.0)
kaminari-actionview (= 1.1.1)
kaminari-activerecord (= 1.1.1)
kaminari-core (= 1.1.1)
kaminari-actionview (1.1.1)
actionview
kaminari-core (= 1.1.1)
kaminari-activerecord (1.1.1)
activerecord
kaminari-core (= 1.1.1)
kaminari-core (1.1.1)
listen (3.1.5)
rb-fsevent (~> 0.9, >= 0.9.4)
rb-inotify (~> 0.9, >= 0.9.7)
Expand Down Expand Up @@ -230,16 +217,10 @@ GEM
oauth2 (~> 1.1)
omniauth (~> 1.9)
opentracing (0.5.0)
pagy (3.2.1)
parallel (1.16.2)
parser (2.6.2.0)
ast (~> 2.4.0)
percy-capybara (3.2.0)
addressable (~> 2)
percy-client (~> 2.0)
percy-client (2.0.3)
addressable
excon
faraday (>= 0.9)
pg (1.1.4)
pg_search (2.1.4)
activerecord (>= 4.2)
Expand Down Expand Up @@ -309,6 +290,8 @@ GEM
rainbow (>= 2.2.2, < 4.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 1.4.0, < 1.6)
rubocop-performance (1.0.0)
rubocop (>= 0.58.0)
ruby-enum (0.7.2)
i18n
ruby-progressbar (1.10.0)
Expand Down Expand Up @@ -350,17 +333,14 @@ GEM
concurrent-ruby (~> 1.0, >= 1.0.5)
sidekiq (>= 4.0, < 7.0)
thor (~> 0)
simple_form (4.1.0)
actionpack (>= 5.0)
activemodel (>= 5.0)
simplecov (0.16.1)
docile (~> 1.1)
json (>= 1.8, < 3)
simplecov-html (~> 0.10.0)
simplecov-html (0.10.2)
skylight (4.0.0.beta2)
skylight-core (= 4.0.0.beta2)
skylight-core (4.0.0.beta2)
skylight (4.0.2)
skylight-core (= 4.0.2)
skylight-core (4.0.2)
activesupport (>= 4.2.0)
spring (2.0.2)
activesupport (>= 4.2)
Expand All @@ -379,6 +359,7 @@ GEM
thor (0.20.3)
thread_safe (0.3.6)
tilt (2.0.9)
timecop (0.9.1)
turbolinks (5.2.0)
turbolinks-source (~> 5.2)
turbolinks-source (5.2.0)
Expand Down Expand Up @@ -435,7 +416,6 @@ DEPENDENCIES
jbuilder
jquery-rails
jwt
kaminari
listen
local_time
lograge
Expand All @@ -446,7 +426,7 @@ DEPENDENCIES
octokit
oj
omniauth-github
percy-capybara
pagy
pg (= 1.1.4)
pg_search
puma
Expand All @@ -457,18 +437,19 @@ DEPENDENCIES
rake
rgb
rubocop
rubocop-performance
sassc-rails
selenium-webdriver
sidekiq
sidekiq-scheduler
sidekiq-status
sidekiq-unique-jobs
simple_form
simplecov
skylight (= 4.0.0.beta2)
skylight (= 4.0.2)
spring
spring-watcher-listen
sql_queries_count
timecop
turbolinks
typhoeus
uglifier
Expand All @@ -477,7 +458,7 @@ DEPENDENCIES
yard

RUBY VERSION
ruby 2.6.2p47
ruby 2.6.3p62

BUNDLED WITH
2.0.1
2 changes: 1 addition & 1 deletion Rakefile
Expand Up @@ -9,7 +9,7 @@ Rake::Task['assets:precompile'].enhance ['api_docs:generate']

task 'test:skip_visuals' => 'test:prepare' do
['channels', 'controllers', 'integration', 'helpers', 'lib', 'models',
'validators', 'workers'].each do |name|
'services', 'validators', 'workers'].each do |name|
$: << 'test'
Rails::TestUnit::Runner.rake_run(["test/#{name}"])
end
Expand Down
57 changes: 57 additions & 0 deletions SECURITY.md
@@ -0,0 +1,57 @@
### Vulnerability disclosure policy

We take our responsibility to protect your data from unwarranted disclosure seriously. Equally we want security researchers to feel comfortable reporting vulnerabilities they've discovered, as set out in this policy, so that we can fix them and keep your information safe.

This policy describes **what systems and types of research** are covered under this policy, **how to send us** vulnerability reports, and **how long** we ask security researchers to wait before publicly disclosing vulnerabilities.

### Guidelines

We require that you:

* Make every effort to avoid privacy violations, degradation of user experience, disruption to production systems, and destruction or manipulation of data.

* Only use exploits to the extent necessary to confirm a vulnerability. Do not use an exploit to compromise or exfiltrate data, establish command line access and/or persistence, or use the exploit to "pivot" to other systems. Once you've established that a vulnerability exists, or encountered any of the sensitive data outlined below, you must stop your test and notify us immediately.

* Keep confidential any information about discovered vulnerabilities for up to 90 calendar days after you have notified us. For details, please review **[Coordinated Disclosure](#coordinated-disclosure)**.

### Scope

This policy applies to the publicly available instance of Octobox hosted at [https://octobox.io](https://octobox.io) only.

**The following test types are not authorized:**

* User interface bugs or typos.
* Network denial of service (DoS or DDoS) tests.
* Physical testing (e.g. office access, open doors, tailgating), social engineering (e.g. phishing, vishing), or any other non-technical vulnerability testing.

If you encounter any of the below on our systems while testing within the scope of this policy, **[stop your test and notify us](#reporting-a-vulnerability) immediately**:

* Personally identifiable information
* Financial information (e.g. credit card or bank account numbers)
* Proprietary information or trade secrets of companies of any party

### Authorization

If you make a good faith effort to comply with this policy during your security research, we will consider your research to be authorized, will work with you to understand and resolve the issue quickly, and we will not initiate or recommend legal action related to your research.

### Reporting a vulnerability

Octobox does not currently have a bug bounty programme but we hope to support one in the future. In the meantime we accept and discuss vulnerability reports via email at [`security@octobox.io`](mailto:security@octobox.io).

Reports should include:

* Description of the potential impact of the vulnerability.
* A detailed description of the steps required to reproduce the vulnerability. Proof of concept (POC) scripts, screenshots, and screen captures are all helpful. Please use extreme care to properly label and protect any exploit code.
* Any technical information and related materials we would need to reproduce the issue.

Please keep your vulnerability reports current by sending us any new information as it becomes available.

We may share your vulnerability reports with members of our community, as well as any affected vendors or open source projects.

### Coordinated Disclosure

We hope to patch vulnerabilities within 90 days or less, disclosing the details of those vulnerabilities when patches are published. We believe that public disclosure of vulnerabilities is an essential part of the vulnerability disclosure process, and that one of the best ways to make software better is to enable everyone to learn from each other's mistakes.

At the same time, we believe that disclosure in absence of a readily available patch tends to increase risk rather than reduce it, and so we ask that you refrain from sharing your report with others while we work on our patch. If you believe there are others that should be informed of your report before the patch is available, please let us know so we can make arrangements.

We may want to coordinate an advisory with you to be published simultaneously with the patch, but you are also welcome to self-disclose if you prefer. By default, we prefer to disclose everything, but we will never publish information about you or our communications with you without your permission. In some cases, we may also have some sensitive information that should be redacted, and so please check with us before self-disclosing.

0 comments on commit df5e701

Please sign in to comment.