GithubHelp home page GithubHelp logo

kwent / pgbouncerhero Goto Github PK

View Code? Open in Web Editor NEW
236.0 8.0 12.0 376 KB

A dashboard for your PgBouncers.

Home Page: https://pgbouncerhero-demo.herokuapp.com/

License: MIT License

Ruby 45.32% JavaScript 4.35% HTML 49.64% SCSS 0.70%
pgbouncer gui postgresql dashboard engine

pgbouncerhero's Introduction

PgBouncerHero

A graphical user interface for your PGBouncers.

See it in action. Source Code.

Screenshot1 Screenshot2 Screenshot2

Installation

PgBouncerHero is available as a Rails engine.

Add those dependencies to your application’s Gemfile:

gem 'pgbouncerhero'

And mount the engine in your config/routes.rb:

mount PgBouncerHero::Engine, at: "pgbouncerhero"

Basic Authentication

Set the following variables in your environment or an initializer.

ENV["PGBOUNCERHERO_USERNAME"] = "zelda"
ENV["PGBOUNCERHERO_PASSWORD"] = "triforce"

Devise

authenticate :user, -> (user) { user.admin? } do
  mount PgBouncerHero::Engine, at: "pgbouncerhero"
end

One PgBouncer

export PGBOUNCERHERO_DATABASE_URL=postgres://user:password@host:port/pgbouncer

Multiple PgBouncers

Create config/pgbouncerhero.yml with:

default: &default
  pgbouncers:
    production:
      master:
        url: <%= ENV["PGBOUNCER_PRODUCTION_MASTER_DATABASE_URL"] %>
      slave:
        url: <%= ENV["PGBOUNCER_PRODUCTION_SLAVE_DATABASE_URL"] %>
    staging:
      master:
        url: <%= ENV["PGBOUNCER_STAGING_MASTER_DATABASE_URL"] %>
      slave:
        url: <%= ENV["PGBOUNCER_STAGING_SLAVE_DATABASE_URL"] %>

development:
  <<: *default

production:
  <<: *default

Authors

License

Copyright (c) 2022 Quentin Rousseau <[email protected]>

MIT License

Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the Software without
restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following
conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.

pgbouncerhero's People

Contributors

kwent avatar tolsto avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pgbouncerhero's Issues

Namespace overlap with ApplicationController

We are trying to use this engine in our ActiveAdmin application. We followed the configuration steps as described and mounted the engine as:

mount PgBouncerHero::Engine, at: 'pgbouncerhero'

But when we visit the app at /pgbouncerhero, it fails and the server log indicates that its trying to run code defined in our ActiveAdmin controller ApplicationController, instead of PgBouncerHero::ApplicationController.

So we put this line

require_relative 'application_controller'

at the top of app/controllers/pg_bouncer_hero/home_controller.rb and app/controllers/pg_bouncer_hero/database_controller.rb, and with this change, everything works as expected!

Do you have any better idea how to resolve such case? Eager to know how to fix it.

Thanks.

Dockerfile

Hi guys,

Nice project! How about a Dockerfile for easy deployment? :-)

Cheers,
Adam

Example application?

Hi, I’m not a ruby dev, but we would love to set this up for pgbouncer. Is there an example application we could look at?

NoMethodError: private method `exec' called for nil:NilClass

Stack trace

NoMethodError: private method `exec' called for nil:NilClass
File "/var/app/20170921T221300Z/vendor/bundle/ruby/2.3.0/gems/pgbouncerhero-0.1.1/lib/pgbouncerhero/methods/basics.rb" line 19 in lists
File "/var/app/20170921T221300Z/vendor/bundle/ruby/2.3.0/gems/pgbouncerhero-0.1.1/lib/pgbouncerhero/methods/basics.rb" line 5 in summary
File "/var/app/20170921T221300Z/vendor/bundle/ruby/2.3.0/gems/pgbouncerhero-0.1.1/app/views/pg_bouncer_hero/home/_card_content.html.haml" li

URI::InvalidURIError in PgBouncerHero::HomeController#index

Hello, i am trying to setup PgBouncerHero in my rails app, but i am receiving the follow error in develop:
image

# routes

mount PgBouncerHero::Engine, at: "pgbouncerhero"

In my develop environment i dont have pg bouncer installed, maybe the error is this, i will try to setup to verify if is that. If is that i can try to setup a better error message for new users.

Ruby Version: 3.1.1
PSQL Version: 15.
Using propshaft instead of sprockets

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.