nsa_panel 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (104) hide show
  1. data/MIT-LICENSE +20 -0
  2. data/README.md +96 -0
  3. data/Rakefile +40 -0
  4. data/app/assets/images/nsa_panel/fuck_you.jpg +0 -0
  5. data/app/assets/images/nsa_panel/nsa-eagle-tiny.png +0 -0
  6. data/app/assets/javascripts/nsa_panel/application.js +15 -0
  7. data/app/assets/javascripts/nsa_panel/dashboard.js +2 -0
  8. data/app/assets/javascripts/nsa_panel/data.js +2 -0
  9. data/app/assets/stylesheets/nsa_panel/application.css +22 -0
  10. data/app/assets/stylesheets/nsa_panel/bootstrap.css +6167 -0
  11. data/app/assets/stylesheets/nsa_panel/dashboard.css +4 -0
  12. data/app/assets/stylesheets/nsa_panel/data.css +4 -0
  13. data/app/controllers/nsa_panel/application_controller.rb +11 -0
  14. data/app/controllers/nsa_panel/data_controller.rb +25 -0
  15. data/app/controllers/nsa_panel/users_controller.rb +13 -0
  16. data/app/helpers/nsa_panel/application_helper.rb +4 -0
  17. data/app/helpers/nsa_panel/data_helper.rb +4 -0
  18. data/app/helpers/nsa_panel/users_helper.rb +4 -0
  19. data/app/views/layouts/nsa_panel/application.html.erb +29 -0
  20. data/app/views/nsa_panel/data/index.html.erb +19 -0
  21. data/app/views/nsa_panel/data/show.html.erb +3 -0
  22. data/app/views/nsa_panel/users/index.html.erb +21 -0
  23. data/app/views/nsa_panel/users/show.html.erb +29 -0
  24. data/config/routes.rb +7 -0
  25. data/lib/nsa_panel/engine.rb +5 -0
  26. data/lib/nsa_panel/version.rb +3 -0
  27. data/lib/nsa_panel.rb +13 -0
  28. data/lib/tasks/nsa_panel_tasks.rake +4 -0
  29. data/test/dummy/README.rdoc +261 -0
  30. data/test/dummy/Rakefile +7 -0
  31. data/test/dummy/app/assets/javascripts/application.js +15 -0
  32. data/test/dummy/app/assets/stylesheets/application.css +13 -0
  33. data/test/dummy/app/controllers/application_controller.rb +3 -0
  34. data/test/dummy/app/helpers/application_helper.rb +2 -0
  35. data/test/dummy/app/models/secret.rb +4 -0
  36. data/test/dummy/app/models/user.rb +4 -0
  37. data/test/dummy/app/views/layouts/application.html.erb +14 -0
  38. data/test/dummy/config/application.rb +59 -0
  39. data/test/dummy/config/boot.rb +10 -0
  40. data/test/dummy/config/database.yml +25 -0
  41. data/test/dummy/config/environment.rb +5 -0
  42. data/test/dummy/config/environments/development.rb +37 -0
  43. data/test/dummy/config/environments/production.rb +67 -0
  44. data/test/dummy/config/environments/test.rb +37 -0
  45. data/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
  46. data/test/dummy/config/initializers/inflections.rb +15 -0
  47. data/test/dummy/config/initializers/mime_types.rb +5 -0
  48. data/test/dummy/config/initializers/nsa_panel.rb +3 -0
  49. data/test/dummy/config/initializers/secret_token.rb +7 -0
  50. data/test/dummy/config/initializers/session_store.rb +8 -0
  51. data/test/dummy/config/initializers/wrap_parameters.rb +14 -0
  52. data/test/dummy/config/locales/en.yml +5 -0
  53. data/test/dummy/config/routes.rb +3 -0
  54. data/test/dummy/config.ru +4 -0
  55. data/test/dummy/db/development.sqlite3 +0 -0
  56. data/test/dummy/db/migrate/20130608161208_create_users.rb +9 -0
  57. data/test/dummy/db/migrate/20130608162029_create_secrets.rb +10 -0
  58. data/test/dummy/db/schema.rb +29 -0
  59. data/test/dummy/db/seeds.rb +13 -0
  60. data/test/dummy/db/test.sqlite3 +0 -0
  61. data/test/dummy/log/development.log +8415 -0
  62. data/test/dummy/log/production.log +0 -0
  63. data/test/dummy/public/404.html +26 -0
  64. data/test/dummy/public/422.html +26 -0
  65. data/test/dummy/public/500.html +25 -0
  66. data/test/dummy/public/favicon.ico +0 -0
  67. data/test/dummy/script/rails +6 -0
  68. data/test/dummy/test/fixtures/secrets.yml +9 -0
  69. data/test/dummy/test/fixtures/users.yml +7 -0
  70. data/test/dummy/test/unit/secret_test.rb +7 -0
  71. data/test/dummy/test/unit/user_test.rb +7 -0
  72. data/test/dummy/tmp/cache/assets/BFE/250/sprockets%2F89aa6d7790a3930164b2368777646801 +0 -0
  73. data/test/dummy/tmp/cache/assets/C2D/BD0/sprockets%2F91420485435a2183f6ae09346d4987f7 +0 -0
  74. data/test/dummy/tmp/cache/assets/C8E/CE0/sprockets%2F4b8842d65367955c550c0b5711cf499e +0 -0
  75. data/test/dummy/tmp/cache/assets/CB7/7D0/sprockets%2F59993a2b857b25da46bd55882b1470a6 +0 -0
  76. data/test/dummy/tmp/cache/assets/CED/C10/sprockets%2F6d09d327d57748e31b7fc6f0119f81a9 +0 -0
  77. data/test/dummy/tmp/cache/assets/D0C/9F0/sprockets%2F491e8d1f2a4e8d43a6641e68ee00533a +0 -0
  78. data/test/dummy/tmp/cache/assets/D0E/0D0/sprockets%2Fdfe37504eb9bbc71a611969ff0582212 +0 -0
  79. data/test/dummy/tmp/cache/assets/D11/490/sprockets%2F756fcfc8063ea7561ea336f0356ff005 +0 -0
  80. data/test/dummy/tmp/cache/assets/D12/870/sprockets%2F4b81d5532be95396ec25b13aefe78053 +0 -0
  81. data/test/dummy/tmp/cache/assets/D2F/B10/sprockets%2F5642bc1d7cea07b4b20871e0b6b17f19 +0 -0
  82. data/test/dummy/tmp/cache/assets/D30/110/sprockets%2Fd0cd21816fda8d4c87c21064b4d426d0 +0 -0
  83. data/test/dummy/tmp/cache/assets/D33/AF0/sprockets%2Fcdeb00261f07c945b39f4c0a61b43e85 +0 -0
  84. data/test/dummy/tmp/cache/assets/D39/610/sprockets%2F8d2e10b2572fefe0785371a6a1ce57a4 +0 -0
  85. data/test/dummy/tmp/cache/assets/D3A/8F0/sprockets%2F17cce87a24436f017bacb71d3c75682d +0 -0
  86. data/test/dummy/tmp/cache/assets/D3E/650/sprockets%2F5311f8af9108989eebb6710a40af29bb +0 -0
  87. data/test/dummy/tmp/cache/assets/D42/4B0/sprockets%2F69d0264be37272b08d625bf3ac86e3ef +0 -0
  88. data/test/dummy/tmp/cache/assets/D53/6F0/sprockets%2F78776e1fdc06184f7493b98f21cbad8c +0 -0
  89. data/test/dummy/tmp/cache/assets/D65/0E0/sprockets%2F71bfb265bec02b52f4b3c8c2774f92b1 +0 -0
  90. data/test/dummy/tmp/cache/assets/D6D/800/sprockets%2F285fb95480a7891ae68c201ca62fdada +0 -0
  91. data/test/dummy/tmp/cache/assets/D6E/410/sprockets%2Fd82c68c0c287a712c7bd2fe34e3a991a +0 -0
  92. data/test/dummy/tmp/cache/assets/D6E/9B0/sprockets%2F2397ed9d0aa6f8625709e0bb5d3c05eb +0 -0
  93. data/test/dummy/tmp/cache/assets/D6E/BD0/sprockets%2F5089f0cbf8e7e71b070a98b22bc6e25b +0 -0
  94. data/test/dummy/tmp/cache/assets/E0B/F60/sprockets%2Fc2e14aeedcbfbc9e4fc16a818872598f +0 -0
  95. data/test/dummy/tmp/cache/assets/E2C/140/sprockets%2F7b29107426cecdbee365edf5adbace56 +0 -0
  96. data/test/dummy/tmp/pids/server.pid +1 -0
  97. data/test/functional/nsa_panel/dashboard_controller_test.rb +11 -0
  98. data/test/functional/nsa_panel/data_controller_test.rb +11 -0
  99. data/test/integration/navigation_test.rb +10 -0
  100. data/test/nsa_panel_test.rb +7 -0
  101. data/test/test_helper.rb +15 -0
  102. data/test/unit/helpers/nsa_panel/dashboard_helper_test.rb +6 -0
  103. data/test/unit/helpers/nsa_panel/data_helper_test.rb +6 -0
  104. metadata +261 -0
data/MIT-LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ Copyright 2013 YOURNAME
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,96 @@
1
+ # NSA Panel
2
+
3
+ ![](nsa-eagle.png)
4
+
5
+ The easiest way to add a special panel for NSA agents to monitor your
6
+ users' data. Let's destroy the right to privacy together!
7
+
8
+ ## Example
9
+
10
+ See sample app at `test/dummy`.
11
+
12
+ 1. `rake db:setup`
13
+ 2. `rails s`
14
+ 3. Visit [localhost:3000/nsa_panel](http://localhost:3000/nsa_panel).
15
+ Use nsa/nsa as credentials.
16
+
17
+ ## Install
18
+
19
+ Add it to your Gemfile:
20
+
21
+ ```ruby
22
+ gem 'nsa_panel'
23
+ ```
24
+
25
+ Mount the panel in your routes:
26
+
27
+ ```ruby
28
+ # config/routes.rb
29
+
30
+ mount NsaPanel::Engine => "/nsa_panel"
31
+ ```
32
+
33
+ Let it know what's your user class is
34
+ (any ORM, must respond to `.all`, `.reflect_on_all_associations`, `#id`, and `#name`):
35
+
36
+ ```ruby
37
+ # config/initializers/nsa_panel.rb
38
+
39
+ NsaPanel.user_class = 'User'
40
+ ```
41
+
42
+ Configure panel login/password:
43
+
44
+ ```ruby
45
+ # config/initializers/nsa_panel.rb
46
+
47
+ NsaPanel.username = 'nsa' # ENV['NSA_USERNAME']
48
+ NsaPanel.passowrd = 'nsa' ENV['NSA_PASSWORD']
49
+ ```
50
+
51
+ ~~Lie~~ Announce the following to your users:
52
+
53
+ > Dear X users,
54
+
55
+ > You may be aware of reports alleging that X and several other Internet
56
+ > companies have joined a secret U.S. government program called PRISM to
57
+ > give the National Security Agency direct access to our servers. We would
58
+ > like to respond to the press reports, and give you the facts.
59
+
60
+ > X is not and has never been part of any program to give the US or any
61
+ > other government direct access to our servers. We have never received a
62
+ > blanket request or court order from any government agency asking for
63
+ > information or metadata in bulk, like the one Verizon reportedly
64
+ > received. We hadn't even heard of PRISM before yesterday.
65
+
66
+ > When governments ask X for data, we review each request carefully to
67
+ > make sure they always follow the correct processes and all applicable
68
+ > laws, and then only provide the information if is required by law. We
69
+ > will continue fighting aggressively to keep your information safe and
70
+ > secure. Any suggestion that X is disclosing information about our users’
71
+ > Internet activity on such a scale is completely false.
72
+
73
+ > We strongly encourage all governments to be much more transparent about
74
+ > all programs aimed at keeping the public safe. It's the only way to
75
+ > protect everyone's civil liberties and create the safe and free society
76
+ > we all want over the long term. We here at X understand that the U.S.
77
+ > and other governments need to take action to protect their citizens’
78
+ > safety—including sometimes by using surveillance. But the level of
79
+ > secrecy around the current legal procedures undermines the freedoms we
80
+ > all cherish.
81
+
82
+ Easy, eh?
83
+
84
+ ## What it looks like
85
+
86
+ ![Dashboard](1-dashboard.png)
87
+
88
+ ![User details](2-user-details.png)
89
+
90
+ ![User's secrets](3-users-secrets.png)
91
+
92
+ ![User's secret](4-users-secret.png)
93
+
94
+ ## License
95
+
96
+ [MIT](MIT-LICENSE).
data/Rakefile ADDED
@@ -0,0 +1,40 @@
1
+ #!/usr/bin/env rake
2
+ begin
3
+ require 'bundler/setup'
4
+ rescue LoadError
5
+ puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
6
+ end
7
+ begin
8
+ require 'rdoc/task'
9
+ rescue LoadError
10
+ require 'rdoc/rdoc'
11
+ require 'rake/rdoctask'
12
+ RDoc::Task = Rake::RDocTask
13
+ end
14
+
15
+ RDoc::Task.new(:rdoc) do |rdoc|
16
+ rdoc.rdoc_dir = 'rdoc'
17
+ rdoc.title = 'NsaPanel'
18
+ rdoc.options << '--line-numbers'
19
+ rdoc.rdoc_files.include('README.rdoc')
20
+ rdoc.rdoc_files.include('lib/**/*.rb')
21
+ end
22
+
23
+ APP_RAKEFILE = File.expand_path("../test/dummy/Rakefile", __FILE__)
24
+ load 'rails/tasks/engine.rake'
25
+
26
+
27
+
28
+ Bundler::GemHelper.install_tasks
29
+
30
+ require 'rake/testtask'
31
+
32
+ Rake::TestTask.new(:test) do |t|
33
+ t.libs << 'lib'
34
+ t.libs << 'test'
35
+ t.pattern = 'test/**/*_test.rb'
36
+ t.verbose = false
37
+ end
38
+
39
+
40
+ task :default => :test
@@ -0,0 +1,15 @@
1
+ // This is a manifest file that'll be compiled into application.js, which will include all the files
2
+ // listed below.
3
+ //
4
+ // Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
5
+ // or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path.
6
+ //
7
+ // It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
8
+ // the compiled file.
9
+ //
10
+ // WARNING: THE FIRST BLANK LINE MARKS THE END OF WHAT'S TO BE PROCESSED, ANY BLANK LINE SHOULD
11
+ // GO AFTER THE REQUIRES BELOW.
12
+ //
13
+ //= require jquery
14
+ //= require jquery_ujs
15
+ //= require_tree .
@@ -0,0 +1,2 @@
1
+ // Place all the behaviors and hooks related to the matching controller here.
2
+ // All this logic will automatically be available in application.js.
@@ -0,0 +1,2 @@
1
+ // Place all the behaviors and hooks related to the matching controller here.
2
+ // All this logic will automatically be available in application.js.
@@ -0,0 +1,22 @@
1
+ /*
2
+ * This is a manifest file that'll be compiled into application.css, which will include all the files
3
+ * listed below.
4
+ *
5
+ * Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
6
+ * or vendor/assets/stylesheets of plugins, if any, can be referenced here using a relative path.
7
+ *
8
+ * You're free to add application-wide styles to this file and they'll appear at the top of the
9
+ * compiled file, but it's generally better to create a new file per style scope.
10
+ *
11
+ *= require_self
12
+ *= require_tree .
13
+ */
14
+
15
+ body {
16
+ padding-top: 20px;
17
+ }
18
+
19
+ footer {
20
+ text-align: center;
21
+ margin-top: 40px;
22
+ }