blazer 0.0.1

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of blazer might be problematic. Click here for more details.

Files changed (49) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +14 -0
  3. data/Gemfile +4 -0
  4. data/LICENSE.txt +22 -0
  5. data/README.md +144 -0
  6. data/Rakefile +2 -0
  7. data/app/assets/javascripts/blazer/ace/ace.js +11 -0
  8. data/app/assets/javascripts/blazer/ace/ext-language_tools.js +5 -0
  9. data/app/assets/javascripts/blazer/ace/mode-sql.js +1 -0
  10. data/app/assets/javascripts/blazer/ace/snippets/sql.js +1 -0
  11. data/app/assets/javascripts/blazer/ace/snippets/text.js +1 -0
  12. data/app/assets/javascripts/blazer/ace/theme-twilight.js +1 -0
  13. data/app/assets/javascripts/blazer/application.js +15 -0
  14. data/app/assets/javascripts/blazer/daterangepicker.js +1026 -0
  15. data/app/assets/javascripts/blazer/highlight.pack.js +1 -0
  16. data/app/assets/javascripts/blazer/jquery.js +10308 -0
  17. data/app/assets/javascripts/blazer/jquery.stickytableheaders.js +263 -0
  18. data/app/assets/javascripts/blazer/jquery_ujs.js +469 -0
  19. data/app/assets/javascripts/blazer/list.js +1474 -0
  20. data/app/assets/javascripts/blazer/moment.js +2400 -0
  21. data/app/assets/javascripts/blazer/selectize.js +3477 -0
  22. data/app/assets/javascripts/blazer/stupidtable.js +114 -0
  23. data/app/assets/stylesheets/blazer/application.css +66 -0
  24. data/app/assets/stylesheets/blazer/bootstrap.css +6203 -0
  25. data/app/assets/stylesheets/blazer/bootstrap.css.map +1 -0
  26. data/app/assets/stylesheets/blazer/daterangepicker-bs3.css +267 -0
  27. data/app/assets/stylesheets/blazer/github.css +126 -0
  28. data/app/assets/stylesheets/blazer/selectize.default.css +386 -0
  29. data/app/controllers/blazer/queries_controller.rb +216 -0
  30. data/app/helpers/blazer/queries_helper.rb +21 -0
  31. data/app/models/blazer/audit.rb +5 -0
  32. data/app/models/blazer/connection.rb +5 -0
  33. data/app/models/blazer/query.rb +13 -0
  34. data/app/views/blazer/queries/_form.html.erb +84 -0
  35. data/app/views/blazer/queries/edit.html.erb +1 -0
  36. data/app/views/blazer/queries/index.html.erb +47 -0
  37. data/app/views/blazer/queries/new.html.erb +1 -0
  38. data/app/views/blazer/queries/run.html.erb +50 -0
  39. data/app/views/blazer/queries/show.html.erb +138 -0
  40. data/app/views/layouts/blazer/application.html.erb +17 -0
  41. data/blazer.gemspec +25 -0
  42. data/config/routes.rb +6 -0
  43. data/lib/blazer/engine.rb +11 -0
  44. data/lib/blazer/version.rb +3 -0
  45. data/lib/blazer.rb +16 -0
  46. data/lib/generators/blazer/install_generator.rb +33 -0
  47. data/lib/generators/blazer/templates/config.yml +8 -0
  48. data/lib/generators/blazer/templates/install.rb +17 -0
  49. metadata +134 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: f0cc5c695fe3306251d680f374ea23640dc82edd
4
+ data.tar.gz: cc7b6d8fec02206bef1c8fec25d67d9b875bdca3
5
+ SHA512:
6
+ metadata.gz: e26681fc2ccffbb9559a73e9b966a818e759d1136373daf64d03a60a33532773484a455c99fc609e103659acf69f6ef7b5d6810ec7f48be3846e310526669039
7
+ data.tar.gz: e2ceadfdcbef7e74929d801bd77d0e196e9e4b308bc9d1e83cc4aa2804e9c8b82072d77792ae7306938ddb06aff5f5d0dbf951c35c7c216750bc1e51eadfdc4f
data/.gitignore ADDED
@@ -0,0 +1,14 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /Gemfile.lock
4
+ /_yardoc/
5
+ /coverage/
6
+ /doc/
7
+ /pkg/
8
+ /spec/reports/
9
+ /tmp/
10
+ *.bundle
11
+ *.so
12
+ *.o
13
+ *.a
14
+ mkmf.log
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in blazer.gemspec
4
+ gemspec
data/LICENSE.txt ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2014 Andrew Kane
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,144 @@
1
+ # Blazer
2
+
3
+ Create and share SQL queries instantly
4
+
5
+ [View the demo](https://blazerme.herokuapp.com)
6
+
7
+ Works with PostgreSQL and MySQL
8
+
9
+ :tangerine: Battle-tested at [Instacart](https://www.instacart.com)
10
+
11
+ ## Features
12
+
13
+ - **Secure** - works with your authentication system
14
+ - **Variables** - get the same insights for multiple values
15
+ - **Linked Columns** - link to other pages in your apps or around the web
16
+ - **Smart Columns** - get the data your want without all the joins
17
+ - **Smart Variables** - no need to remember IDs
18
+ - **Charts & Maps** - a picture is worth a thousand words
19
+
20
+ Documentation coming soon.
21
+
22
+ ## Installation
23
+
24
+ Add this line to your application’s Gemfile:
25
+
26
+ ```ruby
27
+ gem 'blazer'
28
+ ```
29
+
30
+ Run:
31
+
32
+ ```sh
33
+ rails g blazer:install
34
+ rake db:migrate
35
+ ```
36
+
37
+ And mount the dashboard in your `config/routes.rb`:
38
+
39
+ ```ruby
40
+ mount Blazer::Engine, at: "blazer"
41
+ ```
42
+
43
+ Then, specify your database:
44
+
45
+ ```ruby
46
+ ENV["BLAZER_DATABASE_URL"]
47
+ ```
48
+
49
+ It is **highly, highly recommended** to use a read only user. Keep reading to see how to create one.
50
+
51
+ ## Permissions
52
+
53
+ ### PostgreSQL
54
+
55
+ Create a user with read only permissions:
56
+
57
+ ```sql
58
+ BEGIN;
59
+ CREATE ROLE blazer LOGIN PASSWORD 'secret123';
60
+ GRANT CONNECT ON DATABASE database_name TO blazer;
61
+ GRANT USAGE ON SCHEMA public TO blazer;
62
+ COMMIT;
63
+ ```
64
+
65
+ It’s highly recommended to protect sensitive information with views. Documentation coming soon.
66
+
67
+ ### MySQL
68
+
69
+ Create a user with read only permissions:
70
+
71
+ ```sql
72
+ GRANT SELECT, SHOW VIEW ON database_name.* TO blazer@’127.0.0.1′ IDENTIFIED BY ‘secret123‘;
73
+ FLUSH PRIVILEGES;
74
+ ```
75
+
76
+ It’s highly recommended to protect sensitive information with views. Documentation coming soon.
77
+
78
+ ## Authentication
79
+
80
+ Don’t forget to protect the dashboard in production.
81
+
82
+ ### Basic Authentication
83
+
84
+ Set the following variables in your environment or an initializer.
85
+
86
+ ```ruby
87
+ ENV["BLAZER_USERNAME"] = "andrew"
88
+ ENV["BLAZER_PASSWORD"] = "secret"
89
+ ```
90
+
91
+ ### Devise
92
+
93
+ ```ruby
94
+ authenticate :user, lambda{|user| user.admin? } do
95
+ mount Blazer::Engine, at: "blazer"
96
+ end
97
+ ```
98
+
99
+ ## Customization
100
+
101
+ Change time zone
102
+
103
+ ```ruby
104
+ Blazer.time_zone = "Pacific Time (US & Canada)"
105
+ ```
106
+
107
+ Turn off audits
108
+
109
+ ```ruby
110
+ Blazer.audit = false
111
+ ```
112
+
113
+ ## TODO
114
+
115
+ - better readme
116
+ - better navigation
117
+ - standalone version
118
+ - update lock
119
+ - warn when database user has write permissions
120
+ - advanced permissions
121
+ - favorites
122
+ - support for multiple data sources
123
+
124
+ ## Thanks
125
+
126
+ Blazer uses a number of awesome, open source projects.
127
+
128
+ - [Rails](https://github.com/rails/rails/)
129
+ - [jQuery](https://github.com/jquery/jquery)
130
+ - [Bootstrap](https://github.com/twbs/bootstrap)
131
+ - [Selectize](https://github.com/brianreavis/selectize.js)
132
+ - [List.js](https://github.com/javve/list.js)
133
+ - [StickyTableHeaders](https://github.com/jmosbech/StickyTableHeaders)
134
+ - [Stupid jQuery Table Sort](https://github.com/joequery/Stupid-Table-Plugin)
135
+ - [Date Range Picker](https://github.com/dangrossman/bootstrap-daterangepicker)
136
+
137
+ ## Contributing
138
+
139
+ Everyone is encouraged to help improve this project. Here are a few ways you can help:
140
+
141
+ - [Report bugs](https://github.com/ankane/blazer/issues)
142
+ - Fix bugs and [submit pull requests](https://github.com/ankane/blazer/pulls)
143
+ - Write, clarify, or fix documentation
144
+ - Suggest or add new features
data/Rakefile ADDED
@@ -0,0 +1,2 @@
1
+ require "bundler/gem_tasks"
2
+