safeguard-devise 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (185) hide show
  1. checksums.yaml +15 -0
  2. data/.vagrant/machines/default/virtualbox/action_provision +1 -0
  3. data/.vagrant/machines/default/virtualbox/action_set_name +1 -0
  4. data/.vagrant/machines/default/virtualbox/id +1 -0
  5. data/Gemfile +25 -0
  6. data/Gemfile.lock +186 -0
  7. data/Rakefile +51 -0
  8. data/VERSION +1 -0
  9. data/Vagrantfile +128 -0
  10. data/app/controllers/devise/devise_safeguard_controller.rb +56 -0
  11. data/app/views/devise/verify_safeguard.html.erb +9 -0
  12. data/app/views/devise/verify_safeguard.html.haml +7 -0
  13. data/config/locales/pt-BR.yml +5 -0
  14. data/lib/devise-safeguard/controllers/helpers.rb +54 -0
  15. data/lib/devise-safeguard/hooks/safeguard_authenticatable.rb +7 -0
  16. data/lib/devise-safeguard/models/safeguard_authenticatable.rb +18 -0
  17. data/lib/devise-safeguard/rails.rb +7 -0
  18. data/lib/devise-safeguard/routes.rb +17 -0
  19. data/lib/generators/active_record/devise_safeguard_generator.rb +13 -0
  20. data/lib/generators/active_record/templates/migration.rb +15 -0
  21. data/lib/generators/devise_safeguard/devise_safeguard_generator.rb +30 -0
  22. data/lib/generators/devise_safeguard/install_generator.rb +44 -0
  23. data/lib/safeguard-devise.rb +24 -0
  24. data/puppet/manifests/default.pp +66 -0
  25. data/puppet/modules/elasticsearch/CHANGELOG +62 -0
  26. data/puppet/modules/elasticsearch/CONTRIBUTORS +20 -0
  27. data/puppet/modules/elasticsearch/LICENSE +13 -0
  28. data/puppet/modules/elasticsearch/Modulefile +9 -0
  29. data/puppet/modules/elasticsearch/README.md +147 -0
  30. data/puppet/modules/elasticsearch/Rakefile +5 -0
  31. data/puppet/modules/elasticsearch/manifests/config.pp +64 -0
  32. data/puppet/modules/elasticsearch/manifests/init.pp +208 -0
  33. data/puppet/modules/elasticsearch/manifests/java.pp +50 -0
  34. data/puppet/modules/elasticsearch/manifests/package.pp +84 -0
  35. data/puppet/modules/elasticsearch/manifests/params.pp +103 -0
  36. data/puppet/modules/elasticsearch/manifests/plugin.pp +97 -0
  37. data/puppet/modules/elasticsearch/manifests/python.pp +34 -0
  38. data/puppet/modules/elasticsearch/manifests/service.pp +114 -0
  39. data/puppet/modules/elasticsearch/manifests/template.pp +118 -0
  40. data/puppet/modules/elasticsearch/metadata.json +41 -0
  41. data/puppet/modules/elasticsearch/spec/classes/elasticsearch_init_spec.rb +596 -0
  42. data/puppet/modules/elasticsearch/spec/defines/template_spec.rb +66 -0
  43. data/puppet/modules/elasticsearch/spec/spec_helper.rb +2 -0
  44. data/puppet/modules/elasticsearch/templates/etc/default/elasticsearch.erb +5 -0
  45. data/puppet/modules/elasticsearch/templates/etc/elasticsearch/elasticsearch.yml.erb +93 -0
  46. data/puppet/modules/memcached/.gitignore +2 -0
  47. data/puppet/modules/memcached/Modulefile +8 -0
  48. data/puppet/modules/memcached/README.md +29 -0
  49. data/puppet/modules/memcached/manifests/init.pp +33 -0
  50. data/puppet/modules/memcached/manifests/params.pp +21 -0
  51. data/puppet/modules/memcached/templates/memcached.conf.erb +46 -0
  52. data/puppet/modules/memcached/templates/memcached_sysconfig.erb +5 -0
  53. data/puppet/modules/mysql/.fixtures.yml +3 -0
  54. data/puppet/modules/mysql/.gemfile +5 -0
  55. data/puppet/modules/mysql/LICENSE +201 -0
  56. data/puppet/modules/mysql/Modulefile +8 -0
  57. data/puppet/modules/mysql/README.md +124 -0
  58. data/puppet/modules/mysql/files/mysqltuner.pl +966 -0
  59. data/puppet/modules/mysql/lib/puppet/parser/functions/mysql_password.rb +15 -0
  60. data/puppet/modules/mysql/lib/puppet/provider/database/mysql.rb +42 -0
  61. data/puppet/modules/mysql/lib/puppet/provider/database_grant/mysql.rb +177 -0
  62. data/puppet/modules/mysql/lib/puppet/provider/database_user/mysql.rb +42 -0
  63. data/puppet/modules/mysql/lib/puppet/type/database.rb +17 -0
  64. data/puppet/modules/mysql/lib/puppet/type/database_grant.rb +75 -0
  65. data/puppet/modules/mysql/lib/puppet/type/database_user.rb +25 -0
  66. data/puppet/modules/mysql/manifests/backup.pp +68 -0
  67. data/puppet/modules/mysql/manifests/config.pp +122 -0
  68. data/puppet/modules/mysql/manifests/db.pp +77 -0
  69. data/puppet/modules/mysql/manifests/init.pp +24 -0
  70. data/puppet/modules/mysql/manifests/java.pp +24 -0
  71. data/puppet/modules/mysql/manifests/params.pp +91 -0
  72. data/puppet/modules/mysql/manifests/python.pp +26 -0
  73. data/puppet/modules/mysql/manifests/ruby.pp +28 -0
  74. data/puppet/modules/mysql/manifests/server/account_security.pp +13 -0
  75. data/puppet/modules/mysql/manifests/server/monitor.pp +19 -0
  76. data/puppet/modules/mysql/manifests/server/mysqltuner.pp +22 -0
  77. data/puppet/modules/mysql/manifests/server.pp +52 -0
  78. data/puppet/modules/mysql/templates/my.cnf.erb +42 -0
  79. data/puppet/modules/mysql/templates/my.cnf.pass.erb +6 -0
  80. data/puppet/modules/mysql/templates/mysqlbackup.sh.erb +23 -0
  81. data/puppet/modules/postgresql/GPL-3 +674 -0
  82. data/puppet/modules/postgresql/Modulefile +13 -0
  83. data/puppet/modules/postgresql/README.md +156 -0
  84. data/puppet/modules/postgresql/lib/puppet/provider/pg_database/debian_postgresql.rb +30 -0
  85. data/puppet/modules/postgresql/lib/puppet/provider/pg_database/default.rb +17 -0
  86. data/puppet/modules/postgresql/lib/puppet/provider/pg_user/debian_postgresql.rb +63 -0
  87. data/puppet/modules/postgresql/lib/puppet/provider/pg_user/default.rb +17 -0
  88. data/puppet/modules/postgresql/lib/puppet/type/pg_database.rb +29 -0
  89. data/puppet/modules/postgresql/lib/puppet/type/pg_user.rb +45 -0
  90. data/puppet/modules/postgresql/manifests/db.pp +20 -0
  91. data/puppet/modules/postgresql/manifests/init.pp +12 -0
  92. data/puppet/modules/postgresql/manifests/params.pp +15 -0
  93. data/puppet/modules/postgresql/manifests/server.pp +47 -0
  94. data/puppet/modules/postgresql/templates/pg_hba.conf.erb +105 -0
  95. data/puppet/modules/postgresql/templates/postgresql.conf.erb +559 -0
  96. data/puppet/modules/redis/CHANGELOG +41 -0
  97. data/puppet/modules/redis/Gemfile +7 -0
  98. data/puppet/modules/redis/Gemfile.lock +18 -0
  99. data/puppet/modules/redis/Modulefile +10 -0
  100. data/puppet/modules/redis/README.md +34 -0
  101. data/puppet/modules/redis/Rakefile +6 -0
  102. data/puppet/modules/redis/manifests/init.pp +153 -0
  103. data/puppet/modules/redis/manifests/params.pp +39 -0
  104. data/puppet/modules/redis/metadata.json +31 -0
  105. data/puppet/modules/redis/spec/spec_helper.rb +17 -0
  106. data/puppet/modules/redis/templates/redis.debian.conf.erb +217 -0
  107. data/puppet/modules/redis/templates/redis.logrotate.erb +9 -0
  108. data/puppet/modules/redis/templates/redis.rhel.conf.erb +547 -0
  109. data/puppet/modules/redis/tests/init.pp +8 -0
  110. data/puppet/upgrade-puppet.sh +16 -0
  111. data/safeguard-devise.gemspec +249 -0
  112. data/spec/controllers/safeguard_devise_controller_spec.rb +67 -0
  113. data/spec/devise/safeguard_authenticatable_spec.rb +71 -0
  114. data/spec/orm/active_record.rb +4 -0
  115. data/spec/routing/routes_spec.rb +13 -0
  116. data/spec/safeguard-devise-test-app/.gitignore +16 -0
  117. data/spec/safeguard-devise-test-app/Gemfile +14 -0
  118. data/spec/safeguard-devise-test-app/Gemfile.lock +119 -0
  119. data/spec/safeguard-devise-test-app/README.rdoc +28 -0
  120. data/spec/safeguard-devise-test-app/Rakefile +6 -0
  121. data/spec/safeguard-devise-test-app/app/assets/images/.keep +0 -0
  122. data/spec/safeguard-devise-test-app/app/assets/javascripts/application.js +13 -0
  123. data/spec/safeguard-devise-test-app/app/assets/stylesheets/application.css +13 -0
  124. data/spec/safeguard-devise-test-app/app/controllers/application_controller.rb +5 -0
  125. data/spec/safeguard-devise-test-app/app/controllers/concerns/.keep +0 -0
  126. data/spec/safeguard-devise-test-app/app/controllers/home_controller.rb +6 -0
  127. data/spec/safeguard-devise-test-app/app/helpers/application_helper.rb +2 -0
  128. data/spec/safeguard-devise-test-app/app/mailers/.keep +0 -0
  129. data/spec/safeguard-devise-test-app/app/models/.keep +0 -0
  130. data/spec/safeguard-devise-test-app/app/models/concerns/.keep +0 -0
  131. data/spec/safeguard-devise-test-app/app/models/user.rb +6 -0
  132. data/spec/safeguard-devise-test-app/app/views/devise/devise_safeguard/verify_safeguard.html.erb +9 -0
  133. data/spec/safeguard-devise-test-app/app/views/devise/devise_safeguard/verify_safeguard.html.haml +6 -0
  134. data/spec/safeguard-devise-test-app/app/views/home/index.html.erb +1 -0
  135. data/spec/safeguard-devise-test-app/app/views/layouts/application.html.erb +14 -0
  136. data/spec/safeguard-devise-test-app/bin/bundle +3 -0
  137. data/spec/safeguard-devise-test-app/bin/rails +4 -0
  138. data/spec/safeguard-devise-test-app/bin/rake +4 -0
  139. data/spec/safeguard-devise-test-app/config/application.rb +31 -0
  140. data/spec/safeguard-devise-test-app/config/boot.rb +4 -0
  141. data/spec/safeguard-devise-test-app/config/database.yml +25 -0
  142. data/spec/safeguard-devise-test-app/config/environment.rb +5 -0
  143. data/spec/safeguard-devise-test-app/config/environments/development.rb +29 -0
  144. data/spec/safeguard-devise-test-app/config/environments/production.rb +80 -0
  145. data/spec/safeguard-devise-test-app/config/environments/test.rb +36 -0
  146. data/spec/safeguard-devise-test-app/config/initializers/backtrace_silencers.rb +7 -0
  147. data/spec/safeguard-devise-test-app/config/initializers/devise.rb +259 -0
  148. data/spec/safeguard-devise-test-app/config/initializers/filter_parameter_logging.rb +4 -0
  149. data/spec/safeguard-devise-test-app/config/initializers/inflections.rb +16 -0
  150. data/spec/safeguard-devise-test-app/config/initializers/mime_types.rb +5 -0
  151. data/spec/safeguard-devise-test-app/config/initializers/secret_token.rb +12 -0
  152. data/spec/safeguard-devise-test-app/config/initializers/session_store.rb +3 -0
  153. data/spec/safeguard-devise-test-app/config/initializers/wrap_parameters.rb +14 -0
  154. data/spec/safeguard-devise-test-app/config/locales/devise.en.yml +59 -0
  155. data/spec/safeguard-devise-test-app/config/locales/devise.safeguard.pt-BR.yml +5 -0
  156. data/spec/safeguard-devise-test-app/config/locales/en.yml +23 -0
  157. data/spec/safeguard-devise-test-app/config/routes.rb +59 -0
  158. data/spec/safeguard-devise-test-app/config.ru +4 -0
  159. data/spec/safeguard-devise-test-app/db/migrate/20140220191103_create_users.rb +9 -0
  160. data/spec/safeguard-devise-test-app/db/migrate/20140220191247_add_devise_to_users.rb +49 -0
  161. data/spec/safeguard-devise-test-app/db/migrate/20140220191522_devise_safeguard_add_to_users.rb +15 -0
  162. data/spec/safeguard-devise-test-app/db/schema.rb +37 -0
  163. data/spec/safeguard-devise-test-app/db/seeds.rb +7 -0
  164. data/spec/safeguard-devise-test-app/lib/assets/.keep +0 -0
  165. data/spec/safeguard-devise-test-app/lib/tasks/.keep +0 -0
  166. data/spec/safeguard-devise-test-app/log/.keep +0 -0
  167. data/spec/safeguard-devise-test-app/public/404.html +58 -0
  168. data/spec/safeguard-devise-test-app/public/422.html +58 -0
  169. data/spec/safeguard-devise-test-app/public/500.html +57 -0
  170. data/spec/safeguard-devise-test-app/public/favicon.ico +0 -0
  171. data/spec/safeguard-devise-test-app/public/robots.txt +5 -0
  172. data/spec/safeguard-devise-test-app/test/controllers/.keep +0 -0
  173. data/spec/safeguard-devise-test-app/test/fixtures/.keep +0 -0
  174. data/spec/safeguard-devise-test-app/test/fixtures/users.yml +9 -0
  175. data/spec/safeguard-devise-test-app/test/helpers/.keep +0 -0
  176. data/spec/safeguard-devise-test-app/test/integration/.keep +0 -0
  177. data/spec/safeguard-devise-test-app/test/mailers/.keep +0 -0
  178. data/spec/safeguard-devise-test-app/test/models/.keep +0 -0
  179. data/spec/safeguard-devise-test-app/test/models/user_test.rb +7 -0
  180. data/spec/safeguard-devise-test-app/test/test_helper.rb +15 -0
  181. data/spec/safeguard-devise-test-app/vendor/assets/javascripts/.keep +0 -0
  182. data/spec/safeguard-devise-test-app/vendor/assets/stylesheets/.keep +0 -0
  183. data/spec/spec_helper.rb +31 -0
  184. data/spec/tests_helper/helpers.rb +34 -0
  185. metadata +381 -0
@@ -0,0 +1,153 @@
1
+ # == Class: redis
2
+ #
3
+ # Install and configure a Redis server
4
+ #
5
+ # === Parameters
6
+ #
7
+ # All the redis.conf parameters can be passed to the class.
8
+ # Check the README.md file
9
+ #
10
+ # === Variables
11
+ #
12
+ # Here you should define a list of variables that this module would require.
13
+ #
14
+ # === Examples
15
+ #
16
+ # class { redis:
17
+ # $conf_port => '6380',
18
+ # $conf_bind => '0.0.0.0',
19
+ # }
20
+ #
21
+ # === Authors
22
+ #
23
+ # Felipe Salum <fsalum@gmail.com>
24
+ #
25
+ # === Copyright
26
+ #
27
+ # Copyright 2013 Felipe Salum, unless otherwise noted.
28
+ #
29
+ class redis (
30
+ $package_ensure = 'present',
31
+ $service_ensure = 'running',
32
+ $service_enable = true,
33
+ $conf_daemonize = 'yes',
34
+ $conf_pidfile = UNSET,
35
+ $conf_port = '6379',
36
+ $conf_bind = '127.0.0.1',
37
+ $conf_timeout = '0',
38
+ $conf_loglevel = 'notice',
39
+ $conf_logfile = UNSET,
40
+ $conf_syslog_enabled = UNSET,
41
+ $conf_syslog_ident = UNSET,
42
+ $conf_syslog_facility = UNSET,
43
+ $conf_databases = '16',
44
+ $conf_save = UNSET,
45
+ $conf_nosave = UNSET,
46
+ $conf_rdbcompression = 'yes',
47
+ $conf_dbfilename = 'dump.rdb',
48
+ $conf_dir = '/var/lib/redis/',
49
+ $conf_slaveof = UNSET,
50
+ $conf_masterauth = UNSET,
51
+ $conf_slave_server_stale_data = 'yes',
52
+ $conf_repl_ping_slave_period = '10',
53
+ $conf_repl_timeout = '60',
54
+ $conf_requirepass = UNSET,
55
+ $conf_maxclients = UNSET,
56
+ $conf_maxmemory = UNSET,
57
+ $conf_maxmemory_policy = UNSET,
58
+ $conf_maxmemory_samples = UNSET,
59
+ $conf_appendonly = 'no',
60
+ $conf_appendfilename = UNSET,
61
+ $conf_appendfsync = 'everysec',
62
+ $conf_no_appendfsync_on_rewrite = 'no',
63
+ $conf_auto_aof_rewrite_percentage = '100',
64
+ $conf_auto_aof_rewrite_min_size = '64mb',
65
+ $conf_slowlog_log_slower_than = '10000',
66
+ $conf_slowlog_max_len = '1024',
67
+ $conf_vm_enabled = 'no',
68
+ $conf_vm_swap_file = '/tmp/redis.swap',
69
+ $conf_vm_max_memory = '0',
70
+ $conf_vm_page_size = '32',
71
+ $conf_vm_pages = '134217728',
72
+ $conf_vm_max_threads = '4',
73
+ $conf_hash_max_zipmap_entries = '512',
74
+ $conf_hash_max_zipmap_value = '64',
75
+ $conf_list_max_ziplist_entries = '512',
76
+ $conf_list_max_ziplist_value = '64',
77
+ $conf_set_max_intset_entries = '512',
78
+ $conf_zset_max_ziplist_entries = '128',
79
+ $conf_zset_max_ziplist_value = '64',
80
+ $conf_activerehashing = 'yes',
81
+ $conf_include = UNSET,
82
+ ) {
83
+
84
+ include redis::params
85
+
86
+ $conf_template = $redis::params::conf_template
87
+ $conf_redis = $redis::params::conf
88
+ $conf_logrotate = $redis::params::conf_logrotate
89
+ $package = $redis::params::package
90
+ $service = $redis::params::service
91
+
92
+ $conf_pidfile_real = $conf_pidfile ? {
93
+ 'UNSET' => $::redis::params::pidfile,
94
+ default => $conf_pidfile,
95
+ }
96
+
97
+ $conf_logfile_real = $conf_logfile ? {
98
+ 'UNSET' => $::redis::params::logfile,
99
+ default => $conf_logfile,
100
+ }
101
+
102
+ package { 'redis':
103
+ ensure => $package_ensure,
104
+ name => $package,
105
+ }
106
+
107
+ service { 'redis':
108
+ ensure => $service_ensure,
109
+ name => $service,
110
+ enable => $service_enable,
111
+ hasrestart => true,
112
+ hasstatus => true,
113
+ require => Package['redis'],
114
+ }
115
+
116
+ file { $conf_redis:
117
+ path => $conf_redis,
118
+ content => template("redis/${conf_template}"),
119
+ owner => root,
120
+ group => root,
121
+ mode => '0644',
122
+ require => Package['redis'],
123
+ notify => Service['redis'],
124
+ }
125
+
126
+ file { $conf_logrotate:
127
+ path => $conf_logrotate,
128
+ content => template('redis/redis.logrotate.erb'),
129
+ owner => root,
130
+ group => root,
131
+ mode => '0644',
132
+ }
133
+
134
+ exec { $conf_dir:
135
+ path => '/bin:/usr/bin:/sbin:/usr/sbin',
136
+ command => "mkdir -p ${conf_dir}",
137
+ user => root,
138
+ group => root,
139
+ creates => $conf_dir,
140
+ before => Service['redis'],
141
+ require => Package['redis'],
142
+ notify => Service['redis'],
143
+ }
144
+
145
+ file { $conf_dir:
146
+ ensure => directory,
147
+ owner => redis,
148
+ group => redis,
149
+ before => Service['redis'],
150
+ require => Exec[$conf_dir],
151
+ }
152
+
153
+ }
@@ -0,0 +1,39 @@
1
+ # Class: redis::params
2
+ #
3
+ # This class configures parameters for the puppet-redis module.
4
+ #
5
+ # Parameters:
6
+ #
7
+ # Actions:
8
+ #
9
+ # Requires:
10
+ #
11
+ # Sample Usage:
12
+ #
13
+ class redis::params {
14
+
15
+ case $::operatingsystem {
16
+ 'centos', 'redhat', 'fedora': {
17
+ $package = 'redis'
18
+ $service = 'redis'
19
+ $conf = '/etc/redis.conf'
20
+ $conf_template = 'redis.rhel.conf.erb'
21
+ $conf_logrotate = '/etc/logrotate.d/redis'
22
+ $pidfile = '/var/run/redis/redis.pid'
23
+ $logfile = '/var/log/redis/redis.log'
24
+ }
25
+ 'ubuntu', 'debian': {
26
+ $package = 'redis-server'
27
+ $service = 'redis-server'
28
+ $conf = '/etc/redis/redis.conf'
29
+ $conf_template = 'redis.debian.conf.erb'
30
+ $conf_logrotate = '/etc/logrotate.d/redis-server'
31
+ $pidfile = '/var/run/redis/redis-server.pid'
32
+ $logfile = '/var/log/redis/redis-server.log'
33
+ }
34
+ default: {
35
+ fail("Unsupported osfamily: ${::osfamily} operatingsystem: ${::operatingsystem}, module ${module_name} only support osfamily RedHat and Debian")
36
+ }
37
+ }
38
+
39
+ }
@@ -0,0 +1,31 @@
1
+ {
2
+ "name": "fsalum-redis",
3
+ "version": "0.0.6",
4
+ "source": "git://github.com/fsalum/puppet-redis.git",
5
+ "author": "Felipe Salum",
6
+ "license": "Apache License, Version 2.0",
7
+ "summary": "Puppet module for Redis Server",
8
+ "description": "Module to install and configure a Redis server",
9
+ "project_page": "https://github.com/fsalum/puppet-redis",
10
+ "dependencies": [
11
+
12
+ ],
13
+ "types": [
14
+
15
+ ],
16
+ "checksums": {
17
+ "CHANGELOG": "32b928a1e47198dc2083680b01d123da",
18
+ "Gemfile": "7c7684e8c8d675f1061e40a3e1d9236d",
19
+ "Gemfile.lock": "183961a8885783a5f617da58b8d3b8d1",
20
+ "Modulefile": "27a715c1b6653599c64895e7841fce60",
21
+ "README.md": "8834c60017afceea8138775f4e991133",
22
+ "Rakefile": "25325f7a133aff637f3bea5e272bce74",
23
+ "manifests/init.pp": "5d1cca21dfc1aac28ac563d6b9053be9",
24
+ "manifests/params.pp": "6adbdff17035fd34e7ac59b1d1569afb",
25
+ "spec/spec_helper.rb": "a55d1e6483344f8ec6963fcb2c220372",
26
+ "templates/redis.debian.conf.erb": "17ecff45fa42a2397ac061532b764092",
27
+ "templates/redis.logrotate.erb": "c1d0b11eeb8252e6be3f3e0cfe269414",
28
+ "templates/redis.rhel.conf.erb": "b5088bee6393dd7b1073de6755d6d02c",
29
+ "tests/init.pp": "2193e95ff8e32896eeb020edb87671d4"
30
+ }
31
+ }
@@ -0,0 +1,17 @@
1
+ dir = File.expand_path(File.dirname(__FILE__))
2
+ $LOAD_PATH.unshift File.join(dir, 'lib')
3
+
4
+ require 'mocha'
5
+ require 'puppet'
6
+ require 'rspec'
7
+ require 'spec/autorun'
8
+
9
+ Spec::Runner.configure do |config|
10
+ config.mock_with :mocha
11
+ end
12
+
13
+ # We need this because the RAL uses 'should' as a method. This
14
+ # allows us the same behaviour but with a different method name.
15
+ class Object
16
+ alias :must :should
17
+ end
@@ -0,0 +1,217 @@
1
+ # Redis configuration file example
2
+
3
+ # By default Redis does not run as a daemon. Use 'yes' if you need it.
4
+ # Note that Redis will write a pid file in /var/run/redis.pid when daemonized.
5
+ daemonize <%= @conf_daemonize %>
6
+
7
+ # When run as a daemon, Redis write a pid file in /var/run/redis.pid by default.
8
+ # You can specify a custom pid file location here.
9
+ pidfile <%= @conf_pidfile_real %>
10
+
11
+ # Accept connections on the specified port, default is 6379
12
+ port <%= @conf_port %>
13
+
14
+ # If you want you can bind a single interface, if the bind option is not
15
+ # specified all the interfaces will listen for connections.
16
+ #
17
+ bind <%= @conf_bind %>
18
+
19
+ # Close the connection after a client is idle for N seconds (0 to disable)
20
+ timeout <%= @conf_timeout %>
21
+
22
+ # Set server verbosity to 'debug'
23
+ # it can be one of:
24
+ # debug (a lot of information, useful for development/testing)
25
+ # notice (moderately verbose, what you want in production probably)
26
+ # warning (only very important / critical messages are logged)
27
+ loglevel <%= @conf_loglevel %>
28
+
29
+ # Specify the log file name. Also 'stdout' can be used to force
30
+ # the demon to log on the standard output. Note that if you use standard
31
+ # output for logging but daemonize, logs will be sent to /dev/null
32
+ logfile <%= @conf_logfile_real %>
33
+
34
+ # Set the number of databases. The default database is DB 0, you can select
35
+ # a different one on a per-connection basis using SELECT <dbid> where
36
+ # dbid is a number between 0 and 'databases'-1
37
+ databases <%= @conf_databases %>
38
+
39
+ ################################ SNAPSHOTTING #################################
40
+ #
41
+ # Save the DB on disk:
42
+ #
43
+ # save <seconds> <changes>
44
+ #
45
+ # Will save the DB if both the given number of seconds and the given
46
+ # number of write operations against the DB occurred.
47
+ #
48
+ # In the example below the behaviour will be to save:
49
+ # after 900 sec (15 min) if at least 1 key changed
50
+ # after 300 sec (5 min) if at least 10 keys changed
51
+ # after 60 sec if at least 10000 keys changed
52
+ <% if @conf_nosave != 'UNSET' %>
53
+ #do not persist to disk:
54
+ #save 900 1
55
+ #save 300 10
56
+ #save 60 10000
57
+ <% else %>
58
+ <% if @conf_save != 'UNSET' %>
59
+ save <%= @conf_save %>
60
+ <% else %>
61
+ save 900 1
62
+ save 300 10
63
+ save 60 10000
64
+ <% end %>
65
+ <% end %>
66
+
67
+ # Compress string objects using LZF when dump .rdb databases?
68
+ # For default that's set to 'yes' as it's almost always a win.
69
+ # If you want to save some CPU in the saving child set it to 'no' but
70
+ # the dataset will likely be bigger if you have compressible values or keys.
71
+ rdbcompression <%= @conf_rdbcompression %>
72
+
73
+ # The filename where to dump the DB
74
+ dbfilename <%= @conf_dbfilename %>
75
+
76
+ # For default save/load DB in/from the working directory
77
+ # Note that you must specify a directory not a file name.
78
+ dir <%= @conf_dir %>
79
+
80
+ ################################# REPLICATION #################################
81
+
82
+ # Master-Slave replication. Use slaveof to make a Redis instance a copy of
83
+ # another Redis server. Note that the configuration is local to the slave
84
+ # so for example it is possible to configure the slave to save the DB with a
85
+ # different interval, or to listen to another port, and so on.
86
+ #
87
+ # slaveof <masterip> <masterport>
88
+ <% if @conf_slaveof != 'UNSET' %>
89
+ slaveof <%= @conf_slaveof %>
90
+ <% end %>
91
+
92
+ # If the master is password protected (using the "requirepass" configuration
93
+ # directive below) it is possible to tell the slave to authenticate before
94
+ # starting the replication synchronization process, otherwise the master will
95
+ # refuse the slave request.
96
+ #
97
+ # masterauth <master-password>
98
+ <% if @conf_masterauth != 'UNSET' %>
99
+ masterauth <%= @conf_masterauth %>
100
+ <% end %>
101
+
102
+
103
+ ################################## SECURITY ###################################
104
+
105
+ # Require clients to issue AUTH <PASSWORD> before processing any other
106
+ # commands. This might be useful in environments in which you do not trust
107
+ # others with access to the host running redis-server.
108
+ #
109
+ # This should stay commented out for backward compatibility and because most
110
+ # people do not need auth (e.g. they run their own servers).
111
+ #
112
+ # requirepass foobared
113
+ <% if @conf_requirepass != 'UNSET' %>
114
+ requirepass <%= @conf_requirepass %>
115
+ <% end %>
116
+
117
+
118
+ ################################### LIMITS ####################################
119
+
120
+ # Set the max number of connected clients at the same time. By default there
121
+ # is no limit, and it's up to the number of file descriptors the Redis process
122
+ # is able to open. The special value '0' means no limts.
123
+ # Once the limit is reached Redis will close all the new connections sending
124
+ # an error 'max number of clients reached'.
125
+ #
126
+ # maxclients 128
127
+ <% if @conf_maxclients != 'UNSET' %>
128
+ maxclients <%= @conf_maxclients %>
129
+ <% end %>
130
+
131
+ # Don't use more memory than the specified amount of bytes.
132
+ # When the memory limit is reached Redis will try to remove keys with an
133
+ # EXPIRE set. It will try to start freeing keys that are going to expire
134
+ # in little time and preserve keys with a longer time to live.
135
+ # Redis will also try to remove objects from free lists if possible.
136
+ #
137
+ # If all this fails, Redis will start to reply with errors to commands
138
+ # that will use more memory, like SET, LPUSH, and so on, and will continue
139
+ # to reply to most read-only commands like GET.
140
+ #
141
+ # WARNING: maxmemory can be a good idea mainly if you want to use Redis as a
142
+ # 'state' server or cache, not as a real DB. When Redis is used as a real
143
+ # database the memory usage will grow over the weeks, it will be obvious if
144
+ # it is going to use too much memory in the long run, and you'll have the time
145
+ # to upgrade. With maxmemory after the limit is reached you'll start to get
146
+ # errors for write operations, and this may even lead to DB inconsistency.
147
+ #
148
+ # maxmemory <bytes>
149
+ <% if @conf_maxmemory != 'UNSET' %>
150
+ maxmemory <%= @conf_maxmemory %>
151
+ <% end %>
152
+
153
+ ############################## APPEND ONLY MODE ###############################
154
+
155
+ # By default Redis asynchronously dumps the dataset on disk. If you can live
156
+ # with the idea that the latest records will be lost if something like a crash
157
+ # happens this is the preferred way to run Redis. If instead you care a lot
158
+ # about your data and don't want to that a single record can get lost you should
159
+ # enable the append only mode: when this mode is enabled Redis will append
160
+ # every write operation received in the file appendonly.log. This file will
161
+ # be read on startup in order to rebuild the full dataset in memory.
162
+ #
163
+ # Note that you can have both the async dumps and the append only file if you
164
+ # like (you have to comment the "save" statements above to disable the dumps).
165
+ # Still if append only mode is enabled Redis will load the data from the
166
+ # log file at startup ignoring the dump.rdb file.
167
+ #
168
+ # The name of the append only file is "appendonly.log"
169
+ #
170
+ # IMPORTANT: Check the BGREWRITEAOF to check how to rewrite the append
171
+ # log file in background when it gets too big.
172
+
173
+ appendonly <%= @conf_appendonly %>
174
+
175
+ # The fsync() call tells the Operating System to actually write data on disk
176
+ # instead to wait for more data in the output buffer. Some OS will really flush
177
+ # data on disk, some other OS will just try to do it ASAP.
178
+ #
179
+ # Redis supports three different modes:
180
+ #
181
+ # no: don't fsync, just let the OS flush the data when it wants. Faster.
182
+ # always: fsync after every write to the append only log . Slow, Safest.
183
+ # everysec: fsync only if one second passed since the last fsync. Compromise.
184
+ #
185
+ # The default is "always" that's the safer of the options. It's up to you to
186
+ # understand if you can relax this to "everysec" that will fsync every second
187
+ # or to "no" that will let the operating system flush the output buffer when
188
+ # it want, for better performances (but if you can live with the idea of
189
+ # some data loss consider the default persistence mode that's snapshotting).
190
+
191
+ appendfsync <%= @conf_appendfsync %>
192
+ # appendfsync everysec
193
+ # appendfsync no
194
+
195
+ ############################### ADVANCED CONFIG ###############################
196
+
197
+ # Glue small output buffers together in order to send small replies in a
198
+ # single TCP packet. Uses a bit more CPU but most of the times it is a win
199
+ # in terms of number of queries per second. Use 'yes' if unsure.
200
+ glueoutputbuf yes
201
+
202
+ # Use object sharing. Can save a lot of memory if you have many common
203
+ # string in your dataset, but performs lookups against the shared objects
204
+ # pool so it uses more CPU and can be a bit slower. Usually it's a good
205
+ # idea.
206
+ #
207
+ # When object sharing is enabled (shareobjects yes) you can use
208
+ # shareobjectspoolsize to control the size of the pool used in order to try
209
+ # object sharing. A bigger pool size will lead to better sharing capabilities.
210
+ # In general you want this value to be at least the double of the number of
211
+ # very common strings you have in your dataset.
212
+ #
213
+ # WARNING: object sharing is experimental, don't enable this feature
214
+ # in production before of Redis 1.0-stable. Still please try this feature in
215
+ # your development environment so that we can test it better.
216
+ # shareobjects no
217
+ # shareobjectspoolsize 1024
@@ -0,0 +1,9 @@
1
+ <%= @conf_logfile_real %> {
2
+ weekly
3
+ rotate 10
4
+ copytruncate
5
+ delaycompress
6
+ compress
7
+ notifempty
8
+ missingok
9
+ }