Giter VIP home page Giter VIP logo

penthouse's People

Contributors

0x0badc0de avatar dmcnally avatar hubertpompecki avatar joshuatatterton avatar ryantownsend avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

penthouse's Issues

Upgrade Penthouse to be Compatible with Active Record 5.2

Some of the alias methods inside the Migrator have been changed in Activerecord >= 5.2.

These changes were dealt with by Apartment, so we can take some inspiration here: https://github.com/influitive/apartment/pull/523/files

Acceptance Criteria

  • We can install Penthouse in a new Rails 6 application
  • We can install Penthouse in a new Rails 5.2 application
  • Two releases are prepared for the gem with semantic versioning used and release notes written.

[2] Upgrade rubocop to version 0.49.0 or later

Rubocop vulnerability present in penthouse.gemspec. We need to upgrade to 0.49.0 or later.

This needs to be complete by April 2019.

Vulnerability details:

RuboCop 0.48.1 and earlier does not use /tmp in safe way, allowing local users to exploit this to tamper with cache files belonging to other users.

Upgrade yard to version 0.9.11 or later

yard vulnerability has been present in penthouse.gemspec since Dec 2017. We need to upgrade to 0.9.11 or later.

This needs to be complete by April 2019.

Due to time passed, I would suggest updating to the very latest version, if greater than 0.9.11, unless an issue is identified with doing so.

Vulnerability details:

lib/yard/core_ext/file.rb in the server in YARD before 0.9.11 does not block relative paths with an initial ../ sequence, which allows attackers to conduct directory traversal attacks and read arbitrary files.

Integrate shared tables

Currently to handle shared tables, we're having to perform a lot of cruft in individual applications, this could be more neatly abstracted by Penthouse.

default_database_configuration = {
  pool: 20,
  connect_timeout: 5, # seconds
  checkout_timeout: 5, # seconds
  variables: { statement_timeout: 5_000 } # milliseconds
}.with_indifferent_access

ActionDispatch::Reloader.to_prepare do
  # load our global database configuration
  database_config = ActiveRecord::Base.configurations[Rails.env] ||
    Rails.application.config.database_configuration[Rails.env]
  # set some default values
  database_config = default_database_configuration.deep_merge(database_config)
  # set the global tables to use the global database
  [Account, AccountSetting].each do |model|
    # enforce the master connection
    model.octopus_establish_connection(database_config)
    # only allow use of master DB
    model.allow_shard(Octopus.master_shard)
    # ensure it has the public schema prefix
    model.table_name = "public.#{model.table_name.split(".", 2).last}"
  end
end

Recommend Projects

  • React photo React

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

  • Vue.js photo Vue.js

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

  • Typescript photo Typescript

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

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

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

  • web

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

  • server

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

  • Machine learning

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

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

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

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.