Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit febad48
Showing
47 changed files
with
27,519 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,14 @@ | |||
/.bundle/ | |||
/.yardoc | |||
/Gemfile.lock | |||
/_yardoc/ | |||
/coverage/ | |||
/doc/ | |||
/pkg/ | |||
/spec/reports/ | |||
/tmp/ | |||
*.bundle | |||
*.so | |||
*.o | |||
*.a | |||
mkmf.log |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,4 @@ | |||
source 'https://rubygems.org' | |||
|
|||
# Specify your gem's dependencies in blazer.gemspec | |||
gemspec |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,22 @@ | |||
Copyright (c) 2014 Andrew Kane | |||
|
|||
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,144 @@ | |||
# Blazer | |||
|
|||
Create and share SQL queries instantly | |||
|
|||
[View the demo](https://blazerme.herokuapp.com) | |||
|
|||
Works with PostgreSQL and MySQL | |||
|
|||
:tangerine: Battle-tested at [Instacart](https://www.instacart.com) | |||
|
|||
## Features | |||
|
|||
- **Secure** - works with your authentication system | |||
- **Variables** - get the same insights for multiple values | |||
- **Linked Columns** - link to other pages in your apps or around the web | |||
- **Smart Columns** - get the data your want without all the joins | |||
- **Smart Variables** - no need to remember IDs | |||
- **Charts & Maps** - a picture is worth a thousand words | |||
|
|||
Documentation coming soon. | |||
|
|||
## Installation | |||
|
|||
Add this line to your application’s Gemfile: | |||
|
|||
```ruby | |||
gem 'blazer' | |||
``` | |||
|
|||
Run: | |||
|
|||
```sh | |||
rails g blazer:install | |||
rake db:migrate | |||
``` | |||
|
|||
And mount the dashboard in your `config/routes.rb`: | |||
|
|||
```ruby | |||
mount Blazer::Engine, at: "blazer" | |||
``` | |||
|
|||
Then, specify your database: | |||
|
|||
```ruby | |||
ENV["BLAZER_DATABASE_URL"] | |||
``` | |||
|
|||
It is **highly, highly recommended** to use a read only user. Keep reading to see how to create one. | |||
|
|||
## Permissions | |||
|
|||
### PostgreSQL | |||
|
|||
Create a user with read only permissions: | |||
|
|||
```sql | |||
BEGIN; | |||
CREATE ROLE blazer LOGIN PASSWORD 'secret123'; | |||
GRANT CONNECT ON DATABASE database_name TO blazer; | |||
GRANT USAGE ON SCHEMA public TO blazer; | |||
COMMIT; | |||
``` | |||
|
|||
It’s highly recommended to protect sensitive information with views. Documentation coming soon. | |||
|
|||
### MySQL | |||
|
|||
Create a user with read only permissions: | |||
|
|||
```sql | |||
GRANT SELECT, SHOW VIEW ON database_name.* TO blazer@’127.0.0.1′ IDENTIFIED BY ‘secret123‘; | |||
FLUSH PRIVILEGES; | |||
``` | |||
|
|||
It’s highly recommended to protect sensitive information with views. Documentation coming soon. | |||
|
|||
## Authentication | |||
|
|||
Don’t forget to protect the dashboard in production. | |||
|
|||
### Basic Authentication | |||
|
|||
Set the following variables in your environment or an initializer. | |||
|
|||
```ruby | |||
ENV["BLAZER_USERNAME"] = "andrew" | |||
ENV["BLAZER_PASSWORD"] = "secret" | |||
``` | |||
|
|||
### Devise | |||
|
|||
```ruby | |||
authenticate :user, lambda{|user| user.admin? } do | |||
mount Blazer::Engine, at: "blazer" | |||
end | |||
``` | |||
|
|||
## Customization | |||
|
|||
Change time zone | |||
|
|||
```ruby | |||
Blazer.time_zone = "Pacific Time (US & Canada)" | |||
``` | |||
|
|||
Turn off audits | |||
|
|||
```ruby | |||
Blazer.audit = false | |||
``` | |||
|
|||
## TODO | |||
|
|||
- better readme | |||
- better navigation | |||
- standalone version | |||
- update lock | |||
- warn when database user has write permissions | |||
- advanced permissions | |||
- favorites | |||
- support for multiple data sources | |||
|
|||
## Thanks | |||
|
|||
Blazer uses a number of awesome, open source projects. | |||
|
|||
- [Rails](https://github.com/rails/rails/) | |||
- [jQuery](https://github.com/jquery/jquery) | |||
- [Bootstrap](https://github.com/twbs/bootstrap) | |||
- [Selectize](https://github.com/brianreavis/selectize.js) | |||
- [List.js](https://github.com/javve/list.js) | |||
- [StickyTableHeaders](https://github.com/jmosbech/StickyTableHeaders) | |||
- [Stupid jQuery Table Sort](https://github.com/joequery/Stupid-Table-Plugin) | |||
- [Date Range Picker](https://github.com/dangrossman/bootstrap-daterangepicker) | |||
|
|||
## Contributing | |||
|
|||
Everyone is encouraged to help improve this project. Here are a few ways you can help: | |||
|
|||
- [Report bugs](https://github.com/ankane/blazer/issues) | |||
- Fix bugs and [submit pull requests](https://github.com/ankane/blazer/pulls) | |||
- Write, clarify, or fix documentation | |||
- Suggest or add new features |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,2 @@ | |||
require "bundler/gem_tasks" | |||
|
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,15 @@ | |||
//= require ./jquery | |||
//= require ./jquery_ujs | |||
//= require ./list | |||
//= require ./stupidtable | |||
//= require ./jquery.stickytableheaders | |||
//= require ./selectize | |||
//= require ./highlight.pack | |||
//= require ./moment | |||
//= require ./daterangepicker | |||
//= require ./ace/ace | |||
//= require ./ace/ext-language_tools | |||
//= require ./ace/theme-twilight | |||
//= require ./ace/mode-sql | |||
//= require ./ace/snippets/text | |||
//= require ./ace/snippets/sql |
Oops, something went wrong.