##// END OF EJS Templates
user-sessions: added option to cleanup redis based sessions in user session interface.
ergo -
r3539:78388d8d default
parent child Browse files
Show More
@@ -1,737 +1,741 b''
1
1
2
2
3 ################################################################################
3 ################################################################################
4 ## RHODECODE COMMUNITY EDITION CONFIGURATION ##
4 ## RHODECODE COMMUNITY EDITION CONFIGURATION ##
5 ################################################################################
5 ################################################################################
6
6
7 [DEFAULT]
7 [DEFAULT]
8 ## Debug flag sets all loggers to debug, and enables request tracking
8 ## Debug flag sets all loggers to debug, and enables request tracking
9 debug = true
9 debug = true
10
10
11 ################################################################################
11 ################################################################################
12 ## EMAIL CONFIGURATION ##
12 ## EMAIL CONFIGURATION ##
13 ## Uncomment and replace with the email address which should receive ##
13 ## Uncomment and replace with the email address which should receive ##
14 ## any error reports after an application crash ##
14 ## any error reports after an application crash ##
15 ## Additionally these settings will be used by the RhodeCode mailing system ##
15 ## Additionally these settings will be used by the RhodeCode mailing system ##
16 ################################################################################
16 ################################################################################
17
17
18 ## prefix all emails subjects with given prefix, helps filtering out emails
18 ## prefix all emails subjects with given prefix, helps filtering out emails
19 #email_prefix = [RhodeCode]
19 #email_prefix = [RhodeCode]
20
20
21 ## email FROM address all mails will be sent
21 ## email FROM address all mails will be sent
22 #app_email_from = rhodecode-noreply@localhost
22 #app_email_from = rhodecode-noreply@localhost
23
23
24 #smtp_server = mail.server.com
24 #smtp_server = mail.server.com
25 #smtp_username =
25 #smtp_username =
26 #smtp_password =
26 #smtp_password =
27 #smtp_port =
27 #smtp_port =
28 #smtp_use_tls = false
28 #smtp_use_tls = false
29 #smtp_use_ssl = true
29 #smtp_use_ssl = true
30
30
31 [server:main]
31 [server:main]
32 ## COMMON ##
32 ## COMMON ##
33 host = 127.0.0.1
33 host = 127.0.0.1
34 port = 5000
34 port = 5000
35
35
36 ###########################################################
36 ###########################################################
37 ## WAITRESS WSGI SERVER - Recommended for Development ####
37 ## WAITRESS WSGI SERVER - Recommended for Development ####
38 ###########################################################
38 ###########################################################
39
39
40 use = egg:waitress#main
40 use = egg:waitress#main
41 ## number of worker threads
41 ## number of worker threads
42 threads = 5
42 threads = 5
43 ## MAX BODY SIZE 100GB
43 ## MAX BODY SIZE 100GB
44 max_request_body_size = 107374182400
44 max_request_body_size = 107374182400
45 ## Use poll instead of select, fixes file descriptors limits problems.
45 ## Use poll instead of select, fixes file descriptors limits problems.
46 ## May not work on old windows systems.
46 ## May not work on old windows systems.
47 asyncore_use_poll = true
47 asyncore_use_poll = true
48
48
49
49
50 ##########################
50 ##########################
51 ## GUNICORN WSGI SERVER ##
51 ## GUNICORN WSGI SERVER ##
52 ##########################
52 ##########################
53 ## run with gunicorn --log-config rhodecode.ini --paste rhodecode.ini
53 ## run with gunicorn --log-config rhodecode.ini --paste rhodecode.ini
54
54
55 #use = egg:gunicorn#main
55 #use = egg:gunicorn#main
56 ## Sets the number of process workers. More workers means more concurrent connections
56 ## Sets the number of process workers. More workers means more concurrent connections
57 ## RhodeCode can handle at the same time. Each additional worker also it increases
57 ## RhodeCode can handle at the same time. Each additional worker also it increases
58 ## memory usage as each has it's own set of caches.
58 ## memory usage as each has it's own set of caches.
59 ## Recommended value is (2 * NUMBER_OF_CPUS + 1), eg 2CPU = 5 workers, but no more
59 ## Recommended value is (2 * NUMBER_OF_CPUS + 1), eg 2CPU = 5 workers, but no more
60 ## than 8-10 unless for really big deployments .e.g 700-1000 users.
60 ## than 8-10 unless for really big deployments .e.g 700-1000 users.
61 ## `instance_id = *` must be set in the [app:main] section below (which is the default)
61 ## `instance_id = *` must be set in the [app:main] section below (which is the default)
62 ## when using more than 1 worker.
62 ## when using more than 1 worker.
63 #workers = 2
63 #workers = 2
64 ## process name visible in process list
64 ## process name visible in process list
65 #proc_name = rhodecode
65 #proc_name = rhodecode
66 ## type of worker class, one of sync, gevent
66 ## type of worker class, one of sync, gevent
67 ## recommended for bigger setup is using of of other than sync one
67 ## recommended for bigger setup is using of of other than sync one
68 #worker_class = gevent
68 #worker_class = gevent
69 ## The maximum number of simultaneous clients. Valid only for Gevent
69 ## The maximum number of simultaneous clients. Valid only for Gevent
70 #worker_connections = 10
70 #worker_connections = 10
71 ## max number of requests that worker will handle before being gracefully
71 ## max number of requests that worker will handle before being gracefully
72 ## restarted, could prevent memory leaks
72 ## restarted, could prevent memory leaks
73 #max_requests = 1000
73 #max_requests = 1000
74 #max_requests_jitter = 30
74 #max_requests_jitter = 30
75 ## amount of time a worker can spend with handling a request before it
75 ## amount of time a worker can spend with handling a request before it
76 ## gets killed and restarted. Set to 6hrs
76 ## gets killed and restarted. Set to 6hrs
77 #timeout = 21600
77 #timeout = 21600
78
78
79
79
80 ## prefix middleware for RhodeCode.
80 ## prefix middleware for RhodeCode.
81 ## recommended when using proxy setup.
81 ## recommended when using proxy setup.
82 ## allows to set RhodeCode under a prefix in server.
82 ## allows to set RhodeCode under a prefix in server.
83 ## eg https://server.com/custom_prefix. Enable `filter-with =` option below as well.
83 ## eg https://server.com/custom_prefix. Enable `filter-with =` option below as well.
84 ## And set your prefix like: `prefix = /custom_prefix`
84 ## And set your prefix like: `prefix = /custom_prefix`
85 ## be sure to also set beaker.session.cookie_path = /custom_prefix if you need
85 ## be sure to also set beaker.session.cookie_path = /custom_prefix if you need
86 ## to make your cookies only work on prefix url
86 ## to make your cookies only work on prefix url
87 [filter:proxy-prefix]
87 [filter:proxy-prefix]
88 use = egg:PasteDeploy#prefix
88 use = egg:PasteDeploy#prefix
89 prefix = /
89 prefix = /
90
90
91 [app:main]
91 [app:main]
92 ## The %(here)s variable will be replaced with the absolute path of parent directory
92 ## The %(here)s variable will be replaced with the absolute path of parent directory
93 ## of this file
93 ## of this file
94 ## In addition ENVIRONMENT variables usage is possible, e.g
94 ## In addition ENVIRONMENT variables usage is possible, e.g
95 ## sqlalchemy.db1.url = {ENV_RC_DB_URL}
95 ## sqlalchemy.db1.url = {ENV_RC_DB_URL}
96
96
97 use = egg:rhodecode-enterprise-ce
97 use = egg:rhodecode-enterprise-ce
98
98
99 ## enable proxy prefix middleware, defined above
99 ## enable proxy prefix middleware, defined above
100 #filter-with = proxy-prefix
100 #filter-with = proxy-prefix
101
101
102 # During development the we want to have the debug toolbar enabled
102 # During development the we want to have the debug toolbar enabled
103 pyramid.includes =
103 pyramid.includes =
104 pyramid_debugtoolbar
104 pyramid_debugtoolbar
105 rhodecode.lib.middleware.request_wrapper
105 rhodecode.lib.middleware.request_wrapper
106
106
107 pyramid.reload_templates = true
107 pyramid.reload_templates = true
108
108
109 debugtoolbar.hosts = 0.0.0.0/0
109 debugtoolbar.hosts = 0.0.0.0/0
110 debugtoolbar.exclude_prefixes =
110 debugtoolbar.exclude_prefixes =
111 /css
111 /css
112 /fonts
112 /fonts
113 /images
113 /images
114 /js
114 /js
115
115
116 ## RHODECODE PLUGINS ##
116 ## RHODECODE PLUGINS ##
117 rhodecode.includes =
117 rhodecode.includes =
118 rhodecode.api
118 rhodecode.api
119
119
120
120
121 # api prefix url
121 # api prefix url
122 rhodecode.api.url = /_admin/api
122 rhodecode.api.url = /_admin/api
123
123
124
124
125 ## END RHODECODE PLUGINS ##
125 ## END RHODECODE PLUGINS ##
126
126
127 ## encryption key used to encrypt social plugin tokens,
127 ## encryption key used to encrypt social plugin tokens,
128 ## remote_urls with credentials etc, if not set it defaults to
128 ## remote_urls with credentials etc, if not set it defaults to
129 ## `beaker.session.secret`
129 ## `beaker.session.secret`
130 #rhodecode.encrypted_values.secret =
130 #rhodecode.encrypted_values.secret =
131
131
132 ## decryption strict mode (enabled by default). It controls if decryption raises
132 ## decryption strict mode (enabled by default). It controls if decryption raises
133 ## `SignatureVerificationError` in case of wrong key, or damaged encryption data.
133 ## `SignatureVerificationError` in case of wrong key, or damaged encryption data.
134 #rhodecode.encrypted_values.strict = false
134 #rhodecode.encrypted_values.strict = false
135
135
136 ## Pick algorithm for encryption. Either fernet (more secure) or aes (default)
136 ## Pick algorithm for encryption. Either fernet (more secure) or aes (default)
137 ## fernet is safer, and we strongly recommend switching to it.
137 ## fernet is safer, and we strongly recommend switching to it.
138 ## Due to backward compatibility aes is used as default.
138 ## Due to backward compatibility aes is used as default.
139 #rhodecode.encrypted_values.algorithm = fernet
139 #rhodecode.encrypted_values.algorithm = fernet
140
140
141 ## return gzipped responses from RhodeCode (static files/application)
141 ## return gzipped responses from RhodeCode (static files/application)
142 gzip_responses = false
142 gzip_responses = false
143
143
144 ## auto-generate javascript routes file on startup
144 ## auto-generate javascript routes file on startup
145 generate_js_files = false
145 generate_js_files = false
146
146
147 ## System global default language.
147 ## System global default language.
148 ## All available languages: en(default), be, de, es, fr, it, ja, pl, pt, ru, zh
148 ## All available languages: en(default), be, de, es, fr, it, ja, pl, pt, ru, zh
149 lang = en
149 lang = en
150
150
151 ## Perform a full repository scan and import on each server start.
151 ## Perform a full repository scan and import on each server start.
152 ## Settings this to true could lead to very long startup time.
152 ## Settings this to true could lead to very long startup time.
153 startup.import_repos = false
153 startup.import_repos = false
154
154
155 ## Uncomment and set this path to use archive download cache.
155 ## Uncomment and set this path to use archive download cache.
156 ## Once enabled, generated archives will be cached at this location
156 ## Once enabled, generated archives will be cached at this location
157 ## and served from the cache during subsequent requests for the same archive of
157 ## and served from the cache during subsequent requests for the same archive of
158 ## the repository.
158 ## the repository.
159 #archive_cache_dir = /tmp/tarballcache
159 #archive_cache_dir = /tmp/tarballcache
160
160
161 ## URL at which the application is running. This is used for Bootstrapping
161 ## URL at which the application is running. This is used for Bootstrapping
162 ## requests in context when no web request is available. Used in ishell, or
162 ## requests in context when no web request is available. Used in ishell, or
163 ## SSH calls. Set this for events to receive proper url for SSH calls.
163 ## SSH calls. Set this for events to receive proper url for SSH calls.
164 app.base_url = http://rhodecode.local
164 app.base_url = http://rhodecode.local
165
165
166 ## Unique application ID. Should be a random unique string for security.
166 ## Unique application ID. Should be a random unique string for security.
167 app_instance_uuid = rc-production
167 app_instance_uuid = rc-production
168
168
169 ## Cut off limit for large diffs (size in bytes). If overall diff size on
169 ## Cut off limit for large diffs (size in bytes). If overall diff size on
170 ## commit, or pull request exceeds this limit this diff will be displayed
170 ## commit, or pull request exceeds this limit this diff will be displayed
171 ## partially. E.g 512000 == 512Kb
171 ## partially. E.g 512000 == 512Kb
172 cut_off_limit_diff = 512000
172 cut_off_limit_diff = 512000
173
173
174 ## Cut off limit for large files inside diffs (size in bytes). Each individual
174 ## Cut off limit for large files inside diffs (size in bytes). Each individual
175 ## file inside diff which exceeds this limit will be displayed partially.
175 ## file inside diff which exceeds this limit will be displayed partially.
176 ## E.g 128000 == 128Kb
176 ## E.g 128000 == 128Kb
177 cut_off_limit_file = 128000
177 cut_off_limit_file = 128000
178
178
179 ## use cached version of vcs repositories everywhere. Recommended to be `true`
179 ## use cached version of vcs repositories everywhere. Recommended to be `true`
180 vcs_full_cache = true
180 vcs_full_cache = true
181
181
182 ## Force https in RhodeCode, fixes https redirects, assumes it's always https.
182 ## Force https in RhodeCode, fixes https redirects, assumes it's always https.
183 ## Normally this is controlled by proper http flags sent from http server
183 ## Normally this is controlled by proper http flags sent from http server
184 force_https = false
184 force_https = false
185
185
186 ## use Strict-Transport-Security headers
186 ## use Strict-Transport-Security headers
187 use_htsts = false
187 use_htsts = false
188
188
189 ## git rev filter option, --all is the default filter, if you need to
189 ## git rev filter option, --all is the default filter, if you need to
190 ## hide all refs in changelog switch this to --branches --tags
190 ## hide all refs in changelog switch this to --branches --tags
191 git_rev_filter = --branches --tags
191 git_rev_filter = --branches --tags
192
192
193 # Set to true if your repos are exposed using the dumb protocol
193 # Set to true if your repos are exposed using the dumb protocol
194 git_update_server_info = false
194 git_update_server_info = false
195
195
196 ## RSS/ATOM feed options
196 ## RSS/ATOM feed options
197 rss_cut_off_limit = 256000
197 rss_cut_off_limit = 256000
198 rss_items_per_page = 10
198 rss_items_per_page = 10
199 rss_include_diff = false
199 rss_include_diff = false
200
200
201 ## gist URL alias, used to create nicer urls for gist. This should be an
201 ## gist URL alias, used to create nicer urls for gist. This should be an
202 ## url that does rewrites to _admin/gists/{gistid}.
202 ## url that does rewrites to _admin/gists/{gistid}.
203 ## example: http://gist.rhodecode.org/{gistid}. Empty means use the internal
203 ## example: http://gist.rhodecode.org/{gistid}. Empty means use the internal
204 ## RhodeCode url, ie. http[s]://rhodecode.server/_admin/gists/{gistid}
204 ## RhodeCode url, ie. http[s]://rhodecode.server/_admin/gists/{gistid}
205 gist_alias_url =
205 gist_alias_url =
206
206
207 ## List of views (using glob pattern syntax) that AUTH TOKENS could be
207 ## List of views (using glob pattern syntax) that AUTH TOKENS could be
208 ## used for access.
208 ## used for access.
209 ## Adding ?auth_token=TOKEN_HASH to the url authenticates this request as if it
209 ## Adding ?auth_token=TOKEN_HASH to the url authenticates this request as if it
210 ## came from the the logged in user who own this authentication token.
210 ## came from the the logged in user who own this authentication token.
211 ## Additionally @TOKEN syntax can be used to bound the view to specific
211 ## Additionally @TOKEN syntax can be used to bound the view to specific
212 ## authentication token. Such view would be only accessible when used together
212 ## authentication token. Such view would be only accessible when used together
213 ## with this authentication token
213 ## with this authentication token
214 ##
214 ##
215 ## list of all views can be found under `/_admin/permissions/auth_token_access`
215 ## list of all views can be found under `/_admin/permissions/auth_token_access`
216 ## The list should be "," separated and on a single line.
216 ## The list should be "," separated and on a single line.
217 ##
217 ##
218 ## Most common views to enable:
218 ## Most common views to enable:
219 # RepoCommitsView:repo_commit_download
219 # RepoCommitsView:repo_commit_download
220 # RepoCommitsView:repo_commit_patch
220 # RepoCommitsView:repo_commit_patch
221 # RepoCommitsView:repo_commit_raw
221 # RepoCommitsView:repo_commit_raw
222 # RepoCommitsView:repo_commit_raw@TOKEN
222 # RepoCommitsView:repo_commit_raw@TOKEN
223 # RepoFilesView:repo_files_diff
223 # RepoFilesView:repo_files_diff
224 # RepoFilesView:repo_archivefile
224 # RepoFilesView:repo_archivefile
225 # RepoFilesView:repo_file_raw
225 # RepoFilesView:repo_file_raw
226 # GistView:*
226 # GistView:*
227 api_access_controllers_whitelist =
227 api_access_controllers_whitelist =
228
228
229 ## Default encoding used to convert from and to unicode
229 ## Default encoding used to convert from and to unicode
230 ## can be also a comma separated list of encoding in case of mixed encodings
230 ## can be also a comma separated list of encoding in case of mixed encodings
231 default_encoding = UTF-8
231 default_encoding = UTF-8
232
232
233 ## instance-id prefix
233 ## instance-id prefix
234 ## a prefix key for this instance used for cache invalidation when running
234 ## a prefix key for this instance used for cache invalidation when running
235 ## multiple instances of RhodeCode, make sure it's globally unique for
235 ## multiple instances of RhodeCode, make sure it's globally unique for
236 ## all running RhodeCode instances. Leave empty if you don't use it
236 ## all running RhodeCode instances. Leave empty if you don't use it
237 instance_id =
237 instance_id =
238
238
239 ## Fallback authentication plugin. Set this to a plugin ID to force the usage
239 ## Fallback authentication plugin. Set this to a plugin ID to force the usage
240 ## of an authentication plugin also if it is disabled by it's settings.
240 ## of an authentication plugin also if it is disabled by it's settings.
241 ## This could be useful if you are unable to log in to the system due to broken
241 ## This could be useful if you are unable to log in to the system due to broken
242 ## authentication settings. Then you can enable e.g. the internal RhodeCode auth
242 ## authentication settings. Then you can enable e.g. the internal RhodeCode auth
243 ## module to log in again and fix the settings.
243 ## module to log in again and fix the settings.
244 ##
244 ##
245 ## Available builtin plugin IDs (hash is part of the ID):
245 ## Available builtin plugin IDs (hash is part of the ID):
246 ## egg:rhodecode-enterprise-ce#rhodecode
246 ## egg:rhodecode-enterprise-ce#rhodecode
247 ## egg:rhodecode-enterprise-ce#pam
247 ## egg:rhodecode-enterprise-ce#pam
248 ## egg:rhodecode-enterprise-ce#ldap
248 ## egg:rhodecode-enterprise-ce#ldap
249 ## egg:rhodecode-enterprise-ce#jasig_cas
249 ## egg:rhodecode-enterprise-ce#jasig_cas
250 ## egg:rhodecode-enterprise-ce#headers
250 ## egg:rhodecode-enterprise-ce#headers
251 ## egg:rhodecode-enterprise-ce#crowd
251 ## egg:rhodecode-enterprise-ce#crowd
252 #rhodecode.auth_plugin_fallback = egg:rhodecode-enterprise-ce#rhodecode
252 #rhodecode.auth_plugin_fallback = egg:rhodecode-enterprise-ce#rhodecode
253
253
254 ## alternative return HTTP header for failed authentication. Default HTTP
254 ## alternative return HTTP header for failed authentication. Default HTTP
255 ## response is 401 HTTPUnauthorized. Currently HG clients have troubles with
255 ## response is 401 HTTPUnauthorized. Currently HG clients have troubles with
256 ## handling that causing a series of failed authentication calls.
256 ## handling that causing a series of failed authentication calls.
257 ## Set this variable to 403 to return HTTPForbidden, or any other HTTP code
257 ## Set this variable to 403 to return HTTPForbidden, or any other HTTP code
258 ## This will be served instead of default 401 on bad authentication
258 ## This will be served instead of default 401 on bad authentication
259 auth_ret_code =
259 auth_ret_code =
260
260
261 ## use special detection method when serving auth_ret_code, instead of serving
261 ## use special detection method when serving auth_ret_code, instead of serving
262 ## ret_code directly, use 401 initially (Which triggers credentials prompt)
262 ## ret_code directly, use 401 initially (Which triggers credentials prompt)
263 ## and then serve auth_ret_code to clients
263 ## and then serve auth_ret_code to clients
264 auth_ret_code_detection = false
264 auth_ret_code_detection = false
265
265
266 ## locking return code. When repository is locked return this HTTP code. 2XX
266 ## locking return code. When repository is locked return this HTTP code. 2XX
267 ## codes don't break the transactions while 4XX codes do
267 ## codes don't break the transactions while 4XX codes do
268 lock_ret_code = 423
268 lock_ret_code = 423
269
269
270 ## allows to change the repository location in settings page
270 ## allows to change the repository location in settings page
271 allow_repo_location_change = true
271 allow_repo_location_change = true
272
272
273 ## allows to setup custom hooks in settings page
273 ## allows to setup custom hooks in settings page
274 allow_custom_hooks_settings = true
274 allow_custom_hooks_settings = true
275
275
276 ## Generated license token required for EE edition license.
276 ## Generated license token required for EE edition license.
277 ## New generated token value can be found in Admin > settings > license page.
277 ## New generated token value can be found in Admin > settings > license page.
278 license_token =
278 license_token =
279
279
280 ## supervisor connection uri, for managing supervisor and logs.
280 ## supervisor connection uri, for managing supervisor and logs.
281 supervisor.uri =
281 supervisor.uri =
282 ## supervisord group name/id we only want this RC instance to handle
282 ## supervisord group name/id we only want this RC instance to handle
283 supervisor.group_id = dev
283 supervisor.group_id = dev
284
284
285 ## Display extended labs settings
285 ## Display extended labs settings
286 labs_settings_active = true
286 labs_settings_active = true
287
287
288 ## Custom exception store path, defaults to TMPDIR
288 ## Custom exception store path, defaults to TMPDIR
289 ## This is used to store exception from RhodeCode in shared directory
289 ## This is used to store exception from RhodeCode in shared directory
290 #exception_tracker.store_path =
290 #exception_tracker.store_path =
291
291
292 ## File store configuration. This is used to store and serve uploaded files
292 ## File store configuration. This is used to store and serve uploaded files
293 file_store.enabled = true
293 file_store.enabled = true
294 ## Storage backend, available options are: local
294 ## Storage backend, available options are: local
295 file_store.backend = local
295 file_store.backend = local
296 ## path to store the uploaded binaries
296 ## path to store the uploaded binaries
297 file_store.storage_path = %(here)s/data/file_store
297 file_store.storage_path = %(here)s/data/file_store
298
298
299
299
300 ####################################
300 ####################################
301 ### CELERY CONFIG ####
301 ### CELERY CONFIG ####
302 ####################################
302 ####################################
303 ## run: /path/to/celery worker \
303 ## run: /path/to/celery worker \
304 ## -E --beat --app rhodecode.lib.celerylib.loader \
304 ## -E --beat --app rhodecode.lib.celerylib.loader \
305 ## --scheduler rhodecode.lib.celerylib.scheduler.RcScheduler \
305 ## --scheduler rhodecode.lib.celerylib.scheduler.RcScheduler \
306 ## --loglevel DEBUG --ini /path/to/rhodecode.ini
306 ## --loglevel DEBUG --ini /path/to/rhodecode.ini
307
307
308 use_celery = false
308 use_celery = false
309
309
310 ## connection url to the message broker (default rabbitmq)
310 ## connection url to the message broker (default rabbitmq)
311 celery.broker_url = amqp://rabbitmq:qweqwe@localhost:5672/rabbitmqhost
311 celery.broker_url = amqp://rabbitmq:qweqwe@localhost:5672/rabbitmqhost
312
312
313 ## maximum tasks to execute before worker restart
313 ## maximum tasks to execute before worker restart
314 celery.max_tasks_per_child = 100
314 celery.max_tasks_per_child = 100
315
315
316 ## tasks will never be sent to the queue, but executed locally instead.
316 ## tasks will never be sent to the queue, but executed locally instead.
317 celery.task_always_eager = false
317 celery.task_always_eager = false
318
318
319 #####################################
319 #####################################
320 ### DOGPILE CACHE ####
320 ### DOGPILE CACHE ####
321 #####################################
321 #####################################
322 ## Default cache dir for caches. Putting this into a ramdisk
322 ## Default cache dir for caches. Putting this into a ramdisk
323 ## can boost performance, eg. /tmpfs/data_ramdisk, however this directory might require
323 ## can boost performance, eg. /tmpfs/data_ramdisk, however this directory might require
324 ## large amount of space
324 ## large amount of space
325 cache_dir = %(here)s/data
325 cache_dir = %(here)s/data
326
326
327 ## `cache_perms` cache settings for permission tree, auth TTL.
327 ## `cache_perms` cache settings for permission tree, auth TTL.
328 rc_cache.cache_perms.backend = dogpile.cache.rc.file_namespace
328 rc_cache.cache_perms.backend = dogpile.cache.rc.file_namespace
329 rc_cache.cache_perms.expiration_time = 300
329 rc_cache.cache_perms.expiration_time = 300
330
330
331 ## alternative `cache_perms` redis backend with distributed lock
331 ## alternative `cache_perms` redis backend with distributed lock
332 #rc_cache.cache_perms.backend = dogpile.cache.rc.redis
332 #rc_cache.cache_perms.backend = dogpile.cache.rc.redis
333 #rc_cache.cache_perms.expiration_time = 300
333 #rc_cache.cache_perms.expiration_time = 300
334 ## redis_expiration_time needs to be greater then expiration_time
334 ## redis_expiration_time needs to be greater then expiration_time
335 #rc_cache.cache_perms.arguments.redis_expiration_time = 7200
335 #rc_cache.cache_perms.arguments.redis_expiration_time = 7200
336 #rc_cache.cache_perms.arguments.socket_timeout = 30
336 #rc_cache.cache_perms.arguments.socket_timeout = 30
337 #rc_cache.cache_perms.arguments.host = localhost
337 #rc_cache.cache_perms.arguments.host = localhost
338 #rc_cache.cache_perms.arguments.port = 6379
338 #rc_cache.cache_perms.arguments.port = 6379
339 #rc_cache.cache_perms.arguments.db = 0
339 #rc_cache.cache_perms.arguments.db = 0
340 ## more Redis options: https://dogpilecache.sqlalchemy.org/en/latest/api.html#redis-backends
340 ## more Redis options: https://dogpilecache.sqlalchemy.org/en/latest/api.html#redis-backends
341 #rc_cache.cache_perms.arguments.distributed_lock = true
341 #rc_cache.cache_perms.arguments.distributed_lock = true
342
342
343 ## `cache_repo` cache settings for FileTree, Readme, RSS FEEDS
343 ## `cache_repo` cache settings for FileTree, Readme, RSS FEEDS
344 rc_cache.cache_repo.backend = dogpile.cache.rc.file_namespace
344 rc_cache.cache_repo.backend = dogpile.cache.rc.file_namespace
345 rc_cache.cache_repo.expiration_time = 2592000
345 rc_cache.cache_repo.expiration_time = 2592000
346
346
347 ## alternative `cache_repo` redis backend with distributed lock
347 ## alternative `cache_repo` redis backend with distributed lock
348 #rc_cache.cache_repo.backend = dogpile.cache.rc.redis
348 #rc_cache.cache_repo.backend = dogpile.cache.rc.redis
349 #rc_cache.cache_repo.expiration_time = 2592000
349 #rc_cache.cache_repo.expiration_time = 2592000
350 ## redis_expiration_time needs to be greater then expiration_time
350 ## redis_expiration_time needs to be greater then expiration_time
351 #rc_cache.cache_repo.arguments.redis_expiration_time = 2678400
351 #rc_cache.cache_repo.arguments.redis_expiration_time = 2678400
352 #rc_cache.cache_repo.arguments.socket_timeout = 30
352 #rc_cache.cache_repo.arguments.socket_timeout = 30
353 #rc_cache.cache_repo.arguments.host = localhost
353 #rc_cache.cache_repo.arguments.host = localhost
354 #rc_cache.cache_repo.arguments.port = 6379
354 #rc_cache.cache_repo.arguments.port = 6379
355 #rc_cache.cache_repo.arguments.db = 1
355 #rc_cache.cache_repo.arguments.db = 1
356 ## more Redis options: https://dogpilecache.sqlalchemy.org/en/latest/api.html#redis-backends
356 ## more Redis options: https://dogpilecache.sqlalchemy.org/en/latest/api.html#redis-backends
357 #rc_cache.cache_repo.arguments.distributed_lock = true
357 #rc_cache.cache_repo.arguments.distributed_lock = true
358
358
359 ## cache settings for SQL queries, this needs to use memory type backend
359 ## cache settings for SQL queries, this needs to use memory type backend
360 rc_cache.sql_cache_short.backend = dogpile.cache.rc.memory_lru
360 rc_cache.sql_cache_short.backend = dogpile.cache.rc.memory_lru
361 rc_cache.sql_cache_short.expiration_time = 30
361 rc_cache.sql_cache_short.expiration_time = 30
362
362
363 ## `cache_repo_longterm` cache for repo object instances, this needs to use memory
363 ## `cache_repo_longterm` cache for repo object instances, this needs to use memory
364 ## type backend as the objects kept are not pickle serializable
364 ## type backend as the objects kept are not pickle serializable
365 rc_cache.cache_repo_longterm.backend = dogpile.cache.rc.memory_lru
365 rc_cache.cache_repo_longterm.backend = dogpile.cache.rc.memory_lru
366 ## by default we use 96H, this is using invalidation on push anyway
366 ## by default we use 96H, this is using invalidation on push anyway
367 rc_cache.cache_repo_longterm.expiration_time = 345600
367 rc_cache.cache_repo_longterm.expiration_time = 345600
368 ## max items in LRU cache, reduce this number to save memory, and expire last used
368 ## max items in LRU cache, reduce this number to save memory, and expire last used
369 ## cached objects
369 ## cached objects
370 rc_cache.cache_repo_longterm.max_size = 10000
370 rc_cache.cache_repo_longterm.max_size = 10000
371
371
372
372
373 ####################################
373 ####################################
374 ### BEAKER SESSION ####
374 ### BEAKER SESSION ####
375 ####################################
375 ####################################
376
376
377 ## .session.type is type of storage options for the session, current allowed
377 ## .session.type is type of storage options for the session, current allowed
378 ## types are file, ext:memcached, ext:redis, ext:database, and memory (default).
378 ## types are file, ext:memcached, ext:redis, ext:database, and memory (default).
379 beaker.session.type = file
379 beaker.session.type = file
380 beaker.session.data_dir = %(here)s/data/sessions
380 beaker.session.data_dir = %(here)s/data/sessions
381
381
382 ## redis sessions
383 #beaker.session.type = ext:redis
384 #beaker.session.url = redis://127.0.0.1:6379/2
385
382 ## db based session, fast, and allows easy management over logged in users
386 ## db based session, fast, and allows easy management over logged in users
383 #beaker.session.type = ext:database
387 #beaker.session.type = ext:database
384 #beaker.session.table_name = db_session
388 #beaker.session.table_name = db_session
385 #beaker.session.sa.url = postgresql://postgres:secret@localhost/rhodecode
389 #beaker.session.sa.url = postgresql://postgres:secret@localhost/rhodecode
386 #beaker.session.sa.url = mysql://root:secret@127.0.0.1/rhodecode
390 #beaker.session.sa.url = mysql://root:secret@127.0.0.1/rhodecode
387 #beaker.session.sa.pool_recycle = 3600
391 #beaker.session.sa.pool_recycle = 3600
388 #beaker.session.sa.echo = false
392 #beaker.session.sa.echo = false
389
393
390 beaker.session.key = rhodecode
394 beaker.session.key = rhodecode
391 beaker.session.secret = develop-rc-uytcxaz
395 beaker.session.secret = develop-rc-uytcxaz
392 beaker.session.lock_dir = %(here)s/data/sessions/lock
396 beaker.session.lock_dir = %(here)s/data/sessions/lock
393
397
394 ## Secure encrypted cookie. Requires AES and AES python libraries
398 ## Secure encrypted cookie. Requires AES and AES python libraries
395 ## you must disable beaker.session.secret to use this
399 ## you must disable beaker.session.secret to use this
396 #beaker.session.encrypt_key = key_for_encryption
400 #beaker.session.encrypt_key = key_for_encryption
397 #beaker.session.validate_key = validation_key
401 #beaker.session.validate_key = validation_key
398
402
399 ## sets session as invalid(also logging out user) if it haven not been
403 ## sets session as invalid(also logging out user) if it haven not been
400 ## accessed for given amount of time in seconds
404 ## accessed for given amount of time in seconds
401 beaker.session.timeout = 2592000
405 beaker.session.timeout = 2592000
402 beaker.session.httponly = true
406 beaker.session.httponly = true
403 ## Path to use for the cookie. Set to prefix if you use prefix middleware
407 ## Path to use for the cookie. Set to prefix if you use prefix middleware
404 #beaker.session.cookie_path = /custom_prefix
408 #beaker.session.cookie_path = /custom_prefix
405
409
406 ## uncomment for https secure cookie
410 ## uncomment for https secure cookie
407 beaker.session.secure = false
411 beaker.session.secure = false
408
412
409 ## auto save the session to not to use .save()
413 ## auto save the session to not to use .save()
410 beaker.session.auto = false
414 beaker.session.auto = false
411
415
412 ## default cookie expiration time in seconds, set to `true` to set expire
416 ## default cookie expiration time in seconds, set to `true` to set expire
413 ## at browser close
417 ## at browser close
414 #beaker.session.cookie_expires = 3600
418 #beaker.session.cookie_expires = 3600
415
419
416 ###################################
420 ###################################
417 ## SEARCH INDEXING CONFIGURATION ##
421 ## SEARCH INDEXING CONFIGURATION ##
418 ###################################
422 ###################################
419 ## Full text search indexer is available in rhodecode-tools under
423 ## Full text search indexer is available in rhodecode-tools under
420 ## `rhodecode-tools index` command
424 ## `rhodecode-tools index` command
421
425
422 ## WHOOSH Backend, doesn't require additional services to run
426 ## WHOOSH Backend, doesn't require additional services to run
423 ## it works good with few dozen repos
427 ## it works good with few dozen repos
424 search.module = rhodecode.lib.index.whoosh
428 search.module = rhodecode.lib.index.whoosh
425 search.location = %(here)s/data/index
429 search.location = %(here)s/data/index
426
430
427 ########################################
431 ########################################
428 ### CHANNELSTREAM CONFIG ####
432 ### CHANNELSTREAM CONFIG ####
429 ########################################
433 ########################################
430 ## channelstream enables persistent connections and live notification
434 ## channelstream enables persistent connections and live notification
431 ## in the system. It's also used by the chat system
435 ## in the system. It's also used by the chat system
432
436
433 channelstream.enabled = false
437 channelstream.enabled = false
434
438
435 ## server address for channelstream server on the backend
439 ## server address for channelstream server on the backend
436 channelstream.server = 127.0.0.1:9800
440 channelstream.server = 127.0.0.1:9800
437
441
438 ## location of the channelstream server from outside world
442 ## location of the channelstream server from outside world
439 ## use ws:// for http or wss:// for https. This address needs to be handled
443 ## use ws:// for http or wss:// for https. This address needs to be handled
440 ## by external HTTP server such as Nginx or Apache
444 ## by external HTTP server such as Nginx or Apache
441 ## see Nginx/Apache configuration examples in our docs
445 ## see Nginx/Apache configuration examples in our docs
442 channelstream.ws_url = ws://rhodecode.yourserver.com/_channelstream
446 channelstream.ws_url = ws://rhodecode.yourserver.com/_channelstream
443 channelstream.secret = secret
447 channelstream.secret = secret
444 channelstream.history.location = %(here)s/channelstream_history
448 channelstream.history.location = %(here)s/channelstream_history
445
449
446 ## Internal application path that Javascript uses to connect into.
450 ## Internal application path that Javascript uses to connect into.
447 ## If you use proxy-prefix the prefix should be added before /_channelstream
451 ## If you use proxy-prefix the prefix should be added before /_channelstream
448 channelstream.proxy_path = /_channelstream
452 channelstream.proxy_path = /_channelstream
449
453
450
454
451 ###################################
455 ###################################
452 ## APPENLIGHT CONFIG ##
456 ## APPENLIGHT CONFIG ##
453 ###################################
457 ###################################
454
458
455 ## Appenlight is tailored to work with RhodeCode, see
459 ## Appenlight is tailored to work with RhodeCode, see
456 ## http://appenlight.com for details how to obtain an account
460 ## http://appenlight.com for details how to obtain an account
457
461
458 ## Appenlight integration enabled
462 ## Appenlight integration enabled
459 appenlight = false
463 appenlight = false
460
464
461 appenlight.server_url = https://api.appenlight.com
465 appenlight.server_url = https://api.appenlight.com
462 appenlight.api_key = YOUR_API_KEY
466 appenlight.api_key = YOUR_API_KEY
463 #appenlight.transport_config = https://api.appenlight.com?threaded=1&timeout=5
467 #appenlight.transport_config = https://api.appenlight.com?threaded=1&timeout=5
464
468
465 ## used for JS client
469 ## used for JS client
466 appenlight.api_public_key = YOUR_API_PUBLIC_KEY
470 appenlight.api_public_key = YOUR_API_PUBLIC_KEY
467
471
468 ## TWEAK AMOUNT OF INFO SENT HERE
472 ## TWEAK AMOUNT OF INFO SENT HERE
469
473
470 ## enables 404 error logging (default False)
474 ## enables 404 error logging (default False)
471 appenlight.report_404 = false
475 appenlight.report_404 = false
472
476
473 ## time in seconds after request is considered being slow (default 1)
477 ## time in seconds after request is considered being slow (default 1)
474 appenlight.slow_request_time = 1
478 appenlight.slow_request_time = 1
475
479
476 ## record slow requests in application
480 ## record slow requests in application
477 ## (needs to be enabled for slow datastore recording and time tracking)
481 ## (needs to be enabled for slow datastore recording and time tracking)
478 appenlight.slow_requests = true
482 appenlight.slow_requests = true
479
483
480 ## enable hooking to application loggers
484 ## enable hooking to application loggers
481 appenlight.logging = true
485 appenlight.logging = true
482
486
483 ## minimum log level for log capture
487 ## minimum log level for log capture
484 appenlight.logging.level = WARNING
488 appenlight.logging.level = WARNING
485
489
486 ## send logs only from erroneous/slow requests
490 ## send logs only from erroneous/slow requests
487 ## (saves API quota for intensive logging)
491 ## (saves API quota for intensive logging)
488 appenlight.logging_on_error = false
492 appenlight.logging_on_error = false
489
493
490 ## list of additional keywords that should be grabbed from environ object
494 ## list of additional keywords that should be grabbed from environ object
491 ## can be string with comma separated list of words in lowercase
495 ## can be string with comma separated list of words in lowercase
492 ## (by default client will always send following info:
496 ## (by default client will always send following info:
493 ## 'REMOTE_USER', 'REMOTE_ADDR', 'SERVER_NAME', 'CONTENT_TYPE' + all keys that
497 ## 'REMOTE_USER', 'REMOTE_ADDR', 'SERVER_NAME', 'CONTENT_TYPE' + all keys that
494 ## start with HTTP* this list be extended with additional keywords here
498 ## start with HTTP* this list be extended with additional keywords here
495 appenlight.environ_keys_whitelist =
499 appenlight.environ_keys_whitelist =
496
500
497 ## list of keywords that should be blanked from request object
501 ## list of keywords that should be blanked from request object
498 ## can be string with comma separated list of words in lowercase
502 ## can be string with comma separated list of words in lowercase
499 ## (by default client will always blank keys that contain following words
503 ## (by default client will always blank keys that contain following words
500 ## 'password', 'passwd', 'pwd', 'auth_tkt', 'secret', 'csrf'
504 ## 'password', 'passwd', 'pwd', 'auth_tkt', 'secret', 'csrf'
501 ## this list be extended with additional keywords set here
505 ## this list be extended with additional keywords set here
502 appenlight.request_keys_blacklist =
506 appenlight.request_keys_blacklist =
503
507
504 ## list of namespaces that should be ignores when gathering log entries
508 ## list of namespaces that should be ignores when gathering log entries
505 ## can be string with comma separated list of namespaces
509 ## can be string with comma separated list of namespaces
506 ## (by default the client ignores own entries: appenlight_client.client)
510 ## (by default the client ignores own entries: appenlight_client.client)
507 appenlight.log_namespace_blacklist =
511 appenlight.log_namespace_blacklist =
508
512
509 # enable debug style page
513 # enable debug style page
510 debug_style = true
514 debug_style = true
511
515
512 ###########################################
516 ###########################################
513 ### MAIN RHODECODE DATABASE CONFIG ###
517 ### MAIN RHODECODE DATABASE CONFIG ###
514 ###########################################
518 ###########################################
515 #sqlalchemy.db1.url = sqlite:///%(here)s/rhodecode.db?timeout=30
519 #sqlalchemy.db1.url = sqlite:///%(here)s/rhodecode.db?timeout=30
516 #sqlalchemy.db1.url = postgresql://postgres:qweqwe@localhost/rhodecode
520 #sqlalchemy.db1.url = postgresql://postgres:qweqwe@localhost/rhodecode
517 #sqlalchemy.db1.url = mysql://root:qweqwe@localhost/rhodecode?charset=utf8
521 #sqlalchemy.db1.url = mysql://root:qweqwe@localhost/rhodecode?charset=utf8
518 # pymysql is an alternative driver for MySQL, use in case of problems with default one
522 # pymysql is an alternative driver for MySQL, use in case of problems with default one
519 #sqlalchemy.db1.url = mysql+pymysql://root:qweqwe@localhost/rhodecode
523 #sqlalchemy.db1.url = mysql+pymysql://root:qweqwe@localhost/rhodecode
520
524
521 sqlalchemy.db1.url = sqlite:///%(here)s/rhodecode.db?timeout=30
525 sqlalchemy.db1.url = sqlite:///%(here)s/rhodecode.db?timeout=30
522
526
523 # see sqlalchemy docs for other advanced settings
527 # see sqlalchemy docs for other advanced settings
524
528
525 ## print the sql statements to output
529 ## print the sql statements to output
526 sqlalchemy.db1.echo = false
530 sqlalchemy.db1.echo = false
527 ## recycle the connections after this amount of seconds
531 ## recycle the connections after this amount of seconds
528 sqlalchemy.db1.pool_recycle = 3600
532 sqlalchemy.db1.pool_recycle = 3600
529 sqlalchemy.db1.convert_unicode = true
533 sqlalchemy.db1.convert_unicode = true
530
534
531 ## the number of connections to keep open inside the connection pool.
535 ## the number of connections to keep open inside the connection pool.
532 ## 0 indicates no limit
536 ## 0 indicates no limit
533 #sqlalchemy.db1.pool_size = 5
537 #sqlalchemy.db1.pool_size = 5
534
538
535 ## the number of connections to allow in connection pool "overflow", that is
539 ## the number of connections to allow in connection pool "overflow", that is
536 ## connections that can be opened above and beyond the pool_size setting,
540 ## connections that can be opened above and beyond the pool_size setting,
537 ## which defaults to five.
541 ## which defaults to five.
538 #sqlalchemy.db1.max_overflow = 10
542 #sqlalchemy.db1.max_overflow = 10
539
543
540 ## Connection check ping, used to detect broken database connections
544 ## Connection check ping, used to detect broken database connections
541 ## could be enabled to better handle cases if MySQL has gone away errors
545 ## could be enabled to better handle cases if MySQL has gone away errors
542 #sqlalchemy.db1.ping_connection = true
546 #sqlalchemy.db1.ping_connection = true
543
547
544 ##################
548 ##################
545 ### VCS CONFIG ###
549 ### VCS CONFIG ###
546 ##################
550 ##################
547 vcs.server.enable = true
551 vcs.server.enable = true
548 vcs.server = localhost:9900
552 vcs.server = localhost:9900
549
553
550 ## Web server connectivity protocol, responsible for web based VCS operations
554 ## Web server connectivity protocol, responsible for web based VCS operations
551 ## Available protocols are:
555 ## Available protocols are:
552 ## `http` - use http-rpc backend (default)
556 ## `http` - use http-rpc backend (default)
553 vcs.server.protocol = http
557 vcs.server.protocol = http
554
558
555 ## Push/Pull operations protocol, available options are:
559 ## Push/Pull operations protocol, available options are:
556 ## `http` - use http-rpc backend (default)
560 ## `http` - use http-rpc backend (default)
557 vcs.scm_app_implementation = http
561 vcs.scm_app_implementation = http
558
562
559 ## Push/Pull operations hooks protocol, available options are:
563 ## Push/Pull operations hooks protocol, available options are:
560 ## `http` - use http-rpc backend (default)
564 ## `http` - use http-rpc backend (default)
561 vcs.hooks.protocol = http
565 vcs.hooks.protocol = http
562
566
563 ## Host on which this instance is listening for hooks. If vcsserver is in other location
567 ## Host on which this instance is listening for hooks. If vcsserver is in other location
564 ## this should be adjusted.
568 ## this should be adjusted.
565 vcs.hooks.host = 127.0.0.1
569 vcs.hooks.host = 127.0.0.1
566
570
567 vcs.server.log_level = debug
571 vcs.server.log_level = debug
568 ## Start VCSServer with this instance as a subprocess, useful for development
572 ## Start VCSServer with this instance as a subprocess, useful for development
569 vcs.start_server = false
573 vcs.start_server = false
570
574
571 ## List of enabled VCS backends, available options are:
575 ## List of enabled VCS backends, available options are:
572 ## `hg` - mercurial
576 ## `hg` - mercurial
573 ## `git` - git
577 ## `git` - git
574 ## `svn` - subversion
578 ## `svn` - subversion
575 vcs.backends = hg, git, svn
579 vcs.backends = hg, git, svn
576
580
577 vcs.connection_timeout = 3600
581 vcs.connection_timeout = 3600
578 ## Compatibility version when creating SVN repositories. Defaults to newest version when commented out.
582 ## Compatibility version when creating SVN repositories. Defaults to newest version when commented out.
579 ## Available options are: pre-1.4-compatible, pre-1.5-compatible, pre-1.6-compatible, pre-1.8-compatible, pre-1.9-compatible
583 ## Available options are: pre-1.4-compatible, pre-1.5-compatible, pre-1.6-compatible, pre-1.8-compatible, pre-1.9-compatible
580 #vcs.svn.compatible_version = pre-1.8-compatible
584 #vcs.svn.compatible_version = pre-1.8-compatible
581
585
582
586
583 ############################################################
587 ############################################################
584 ### Subversion proxy support (mod_dav_svn) ###
588 ### Subversion proxy support (mod_dav_svn) ###
585 ### Maps RhodeCode repo groups into SVN paths for Apache ###
589 ### Maps RhodeCode repo groups into SVN paths for Apache ###
586 ############################################################
590 ############################################################
587 ## Enable or disable the config file generation.
591 ## Enable or disable the config file generation.
588 svn.proxy.generate_config = false
592 svn.proxy.generate_config = false
589 ## Generate config file with `SVNListParentPath` set to `On`.
593 ## Generate config file with `SVNListParentPath` set to `On`.
590 svn.proxy.list_parent_path = true
594 svn.proxy.list_parent_path = true
591 ## Set location and file name of generated config file.
595 ## Set location and file name of generated config file.
592 svn.proxy.config_file_path = %(here)s/mod_dav_svn.conf
596 svn.proxy.config_file_path = %(here)s/mod_dav_svn.conf
593 ## alternative mod_dav config template. This needs to be a mako template
597 ## alternative mod_dav config template. This needs to be a mako template
594 #svn.proxy.config_template = ~/.rccontrol/enterprise-1/custom_svn_conf.mako
598 #svn.proxy.config_template = ~/.rccontrol/enterprise-1/custom_svn_conf.mako
595 ## Used as a prefix to the `Location` block in the generated config file.
599 ## Used as a prefix to the `Location` block in the generated config file.
596 ## In most cases it should be set to `/`.
600 ## In most cases it should be set to `/`.
597 svn.proxy.location_root = /
601 svn.proxy.location_root = /
598 ## Command to reload the mod dav svn configuration on change.
602 ## Command to reload the mod dav svn configuration on change.
599 ## Example: `/etc/init.d/apache2 reload` or /home/USER/apache_reload.sh
603 ## Example: `/etc/init.d/apache2 reload` or /home/USER/apache_reload.sh
600 ## Make sure user who runs RhodeCode process is allowed to reload Apache
604 ## Make sure user who runs RhodeCode process is allowed to reload Apache
601 #svn.proxy.reload_cmd = /etc/init.d/apache2 reload
605 #svn.proxy.reload_cmd = /etc/init.d/apache2 reload
602 ## If the timeout expires before the reload command finishes, the command will
606 ## If the timeout expires before the reload command finishes, the command will
603 ## be killed. Setting it to zero means no timeout. Defaults to 10 seconds.
607 ## be killed. Setting it to zero means no timeout. Defaults to 10 seconds.
604 #svn.proxy.reload_timeout = 10
608 #svn.proxy.reload_timeout = 10
605
609
606 ############################################################
610 ############################################################
607 ### SSH Support Settings ###
611 ### SSH Support Settings ###
608 ############################################################
612 ############################################################
609
613
610 ## Defines if a custom authorized_keys file should be created and written on
614 ## Defines if a custom authorized_keys file should be created and written on
611 ## any change user ssh keys. Setting this to false also disables possibility
615 ## any change user ssh keys. Setting this to false also disables possibility
612 ## of adding SSH keys by users from web interface. Super admins can still
616 ## of adding SSH keys by users from web interface. Super admins can still
613 ## manage SSH Keys.
617 ## manage SSH Keys.
614 ssh.generate_authorized_keyfile = false
618 ssh.generate_authorized_keyfile = false
615
619
616 ## Options for ssh, default is `no-pty,no-port-forwarding,no-X11-forwarding,no-agent-forwarding`
620 ## Options for ssh, default is `no-pty,no-port-forwarding,no-X11-forwarding,no-agent-forwarding`
617 # ssh.authorized_keys_ssh_opts =
621 # ssh.authorized_keys_ssh_opts =
618
622
619 ## Path to the authorized_keys file where the generate entries are placed.
623 ## Path to the authorized_keys file where the generate entries are placed.
620 ## It is possible to have multiple key files specified in `sshd_config` e.g.
624 ## It is possible to have multiple key files specified in `sshd_config` e.g.
621 ## AuthorizedKeysFile %h/.ssh/authorized_keys %h/.ssh/authorized_keys_rhodecode
625 ## AuthorizedKeysFile %h/.ssh/authorized_keys %h/.ssh/authorized_keys_rhodecode
622 ssh.authorized_keys_file_path = ~/.ssh/authorized_keys_rhodecode
626 ssh.authorized_keys_file_path = ~/.ssh/authorized_keys_rhodecode
623
627
624 ## Command to execute the SSH wrapper. The binary is available in the
628 ## Command to execute the SSH wrapper. The binary is available in the
625 ## RhodeCode installation directory.
629 ## RhodeCode installation directory.
626 ## e.g ~/.rccontrol/community-1/profile/bin/rc-ssh-wrapper
630 ## e.g ~/.rccontrol/community-1/profile/bin/rc-ssh-wrapper
627 ssh.wrapper_cmd = ~/.rccontrol/community-1/rc-ssh-wrapper
631 ssh.wrapper_cmd = ~/.rccontrol/community-1/rc-ssh-wrapper
628
632
629 ## Allow shell when executing the ssh-wrapper command
633 ## Allow shell when executing the ssh-wrapper command
630 ssh.wrapper_cmd_allow_shell = false
634 ssh.wrapper_cmd_allow_shell = false
631
635
632 ## Enables logging, and detailed output send back to the client during SSH
636 ## Enables logging, and detailed output send back to the client during SSH
633 ## operations. Useful for debugging, shouldn't be used in production.
637 ## operations. Useful for debugging, shouldn't be used in production.
634 ssh.enable_debug_logging = true
638 ssh.enable_debug_logging = true
635
639
636 ## Paths to binary executable, by default they are the names, but we can
640 ## Paths to binary executable, by default they are the names, but we can
637 ## override them if we want to use a custom one
641 ## override them if we want to use a custom one
638 ssh.executable.hg = ~/.rccontrol/vcsserver-1/profile/bin/hg
642 ssh.executable.hg = ~/.rccontrol/vcsserver-1/profile/bin/hg
639 ssh.executable.git = ~/.rccontrol/vcsserver-1/profile/bin/git
643 ssh.executable.git = ~/.rccontrol/vcsserver-1/profile/bin/git
640 ssh.executable.svn = ~/.rccontrol/vcsserver-1/profile/bin/svnserve
644 ssh.executable.svn = ~/.rccontrol/vcsserver-1/profile/bin/svnserve
641
645
642 ## Enables SSH key generator web interface. Disabling this still allows users
646 ## Enables SSH key generator web interface. Disabling this still allows users
643 ## to add their own keys.
647 ## to add their own keys.
644 ssh.enable_ui_key_generator = true
648 ssh.enable_ui_key_generator = true
645
649
646
650
647 ## Dummy marker to add new entries after.
651 ## Dummy marker to add new entries after.
648 ## Add any custom entries below. Please don't remove.
652 ## Add any custom entries below. Please don't remove.
649 custom.conf = 1
653 custom.conf = 1
650
654
651
655
652 ################################
656 ################################
653 ### LOGGING CONFIGURATION ####
657 ### LOGGING CONFIGURATION ####
654 ################################
658 ################################
655 [loggers]
659 [loggers]
656 keys = root, sqlalchemy, beaker, celery, rhodecode, ssh_wrapper
660 keys = root, sqlalchemy, beaker, celery, rhodecode, ssh_wrapper
657
661
658 [handlers]
662 [handlers]
659 keys = console, console_sql
663 keys = console, console_sql
660
664
661 [formatters]
665 [formatters]
662 keys = generic, color_formatter, color_formatter_sql
666 keys = generic, color_formatter, color_formatter_sql
663
667
664 #############
668 #############
665 ## LOGGERS ##
669 ## LOGGERS ##
666 #############
670 #############
667 [logger_root]
671 [logger_root]
668 level = NOTSET
672 level = NOTSET
669 handlers = console
673 handlers = console
670
674
671 [logger_sqlalchemy]
675 [logger_sqlalchemy]
672 level = INFO
676 level = INFO
673 handlers = console_sql
677 handlers = console_sql
674 qualname = sqlalchemy.engine
678 qualname = sqlalchemy.engine
675 propagate = 0
679 propagate = 0
676
680
677 [logger_beaker]
681 [logger_beaker]
678 level = DEBUG
682 level = DEBUG
679 handlers =
683 handlers =
680 qualname = beaker.container
684 qualname = beaker.container
681 propagate = 1
685 propagate = 1
682
686
683 [logger_rhodecode]
687 [logger_rhodecode]
684 level = DEBUG
688 level = DEBUG
685 handlers =
689 handlers =
686 qualname = rhodecode
690 qualname = rhodecode
687 propagate = 1
691 propagate = 1
688
692
689 [logger_ssh_wrapper]
693 [logger_ssh_wrapper]
690 level = DEBUG
694 level = DEBUG
691 handlers =
695 handlers =
692 qualname = ssh_wrapper
696 qualname = ssh_wrapper
693 propagate = 1
697 propagate = 1
694
698
695 [logger_celery]
699 [logger_celery]
696 level = DEBUG
700 level = DEBUG
697 handlers =
701 handlers =
698 qualname = celery
702 qualname = celery
699
703
700
704
701 ##############
705 ##############
702 ## HANDLERS ##
706 ## HANDLERS ##
703 ##############
707 ##############
704
708
705 [handler_console]
709 [handler_console]
706 class = StreamHandler
710 class = StreamHandler
707 args = (sys.stderr, )
711 args = (sys.stderr, )
708 level = DEBUG
712 level = DEBUG
709 formatter = color_formatter
713 formatter = color_formatter
710
714
711 [handler_console_sql]
715 [handler_console_sql]
712 # "level = DEBUG" logs SQL queries and results.
716 # "level = DEBUG" logs SQL queries and results.
713 # "level = INFO" logs SQL queries.
717 # "level = INFO" logs SQL queries.
714 # "level = WARN" logs neither. (Recommended for production systems.)
718 # "level = WARN" logs neither. (Recommended for production systems.)
715 class = StreamHandler
719 class = StreamHandler
716 args = (sys.stderr, )
720 args = (sys.stderr, )
717 level = WARN
721 level = WARN
718 formatter = color_formatter_sql
722 formatter = color_formatter_sql
719
723
720 ################
724 ################
721 ## FORMATTERS ##
725 ## FORMATTERS ##
722 ################
726 ################
723
727
724 [formatter_generic]
728 [formatter_generic]
725 class = rhodecode.lib.logging_formatter.ExceptionAwareFormatter
729 class = rhodecode.lib.logging_formatter.ExceptionAwareFormatter
726 format = %(asctime)s.%(msecs)03d [%(process)d] %(levelname)-5.5s [%(name)s] %(message)s
730 format = %(asctime)s.%(msecs)03d [%(process)d] %(levelname)-5.5s [%(name)s] %(message)s
727 datefmt = %Y-%m-%d %H:%M:%S
731 datefmt = %Y-%m-%d %H:%M:%S
728
732
729 [formatter_color_formatter]
733 [formatter_color_formatter]
730 class = rhodecode.lib.logging_formatter.ColorFormatter
734 class = rhodecode.lib.logging_formatter.ColorFormatter
731 format = %(asctime)s.%(msecs)03d [%(process)d] %(levelname)-5.5s [%(name)s] %(message)s
735 format = %(asctime)s.%(msecs)03d [%(process)d] %(levelname)-5.5s [%(name)s] %(message)s
732 datefmt = %Y-%m-%d %H:%M:%S
736 datefmt = %Y-%m-%d %H:%M:%S
733
737
734 [formatter_color_formatter_sql]
738 [formatter_color_formatter_sql]
735 class = rhodecode.lib.logging_formatter.ColorFormatterSql
739 class = rhodecode.lib.logging_formatter.ColorFormatterSql
736 format = %(asctime)s.%(msecs)03d [%(process)d] %(levelname)-5.5s [%(name)s] %(message)s
740 format = %(asctime)s.%(msecs)03d [%(process)d] %(levelname)-5.5s [%(name)s] %(message)s
737 datefmt = %Y-%m-%d %H:%M:%S
741 datefmt = %Y-%m-%d %H:%M:%S
@@ -1,710 +1,714 b''
1
1
2
2
3 ################################################################################
3 ################################################################################
4 ## RHODECODE COMMUNITY EDITION CONFIGURATION ##
4 ## RHODECODE COMMUNITY EDITION CONFIGURATION ##
5 ################################################################################
5 ################################################################################
6
6
7 [DEFAULT]
7 [DEFAULT]
8 ## Debug flag sets all loggers to debug, and enables request tracking
8 ## Debug flag sets all loggers to debug, and enables request tracking
9 debug = false
9 debug = false
10
10
11 ################################################################################
11 ################################################################################
12 ## EMAIL CONFIGURATION ##
12 ## EMAIL CONFIGURATION ##
13 ## Uncomment and replace with the email address which should receive ##
13 ## Uncomment and replace with the email address which should receive ##
14 ## any error reports after an application crash ##
14 ## any error reports after an application crash ##
15 ## Additionally these settings will be used by the RhodeCode mailing system ##
15 ## Additionally these settings will be used by the RhodeCode mailing system ##
16 ################################################################################
16 ################################################################################
17
17
18 ## prefix all emails subjects with given prefix, helps filtering out emails
18 ## prefix all emails subjects with given prefix, helps filtering out emails
19 #email_prefix = [RhodeCode]
19 #email_prefix = [RhodeCode]
20
20
21 ## email FROM address all mails will be sent
21 ## email FROM address all mails will be sent
22 #app_email_from = rhodecode-noreply@localhost
22 #app_email_from = rhodecode-noreply@localhost
23
23
24 #smtp_server = mail.server.com
24 #smtp_server = mail.server.com
25 #smtp_username =
25 #smtp_username =
26 #smtp_password =
26 #smtp_password =
27 #smtp_port =
27 #smtp_port =
28 #smtp_use_tls = false
28 #smtp_use_tls = false
29 #smtp_use_ssl = true
29 #smtp_use_ssl = true
30
30
31 [server:main]
31 [server:main]
32 ## COMMON ##
32 ## COMMON ##
33 host = 127.0.0.1
33 host = 127.0.0.1
34 port = 5000
34 port = 5000
35
35
36 ###########################################################
36 ###########################################################
37 ## WAITRESS WSGI SERVER - Recommended for Development ####
37 ## WAITRESS WSGI SERVER - Recommended for Development ####
38 ###########################################################
38 ###########################################################
39
39
40 #use = egg:waitress#main
40 #use = egg:waitress#main
41 ## number of worker threads
41 ## number of worker threads
42 #threads = 5
42 #threads = 5
43 ## MAX BODY SIZE 100GB
43 ## MAX BODY SIZE 100GB
44 #max_request_body_size = 107374182400
44 #max_request_body_size = 107374182400
45 ## Use poll instead of select, fixes file descriptors limits problems.
45 ## Use poll instead of select, fixes file descriptors limits problems.
46 ## May not work on old windows systems.
46 ## May not work on old windows systems.
47 #asyncore_use_poll = true
47 #asyncore_use_poll = true
48
48
49
49
50 ##########################
50 ##########################
51 ## GUNICORN WSGI SERVER ##
51 ## GUNICORN WSGI SERVER ##
52 ##########################
52 ##########################
53 ## run with gunicorn --log-config rhodecode.ini --paste rhodecode.ini
53 ## run with gunicorn --log-config rhodecode.ini --paste rhodecode.ini
54
54
55 use = egg:gunicorn#main
55 use = egg:gunicorn#main
56 ## Sets the number of process workers. More workers means more concurrent connections
56 ## Sets the number of process workers. More workers means more concurrent connections
57 ## RhodeCode can handle at the same time. Each additional worker also it increases
57 ## RhodeCode can handle at the same time. Each additional worker also it increases
58 ## memory usage as each has it's own set of caches.
58 ## memory usage as each has it's own set of caches.
59 ## Recommended value is (2 * NUMBER_OF_CPUS + 1), eg 2CPU = 5 workers, but no more
59 ## Recommended value is (2 * NUMBER_OF_CPUS + 1), eg 2CPU = 5 workers, but no more
60 ## than 8-10 unless for really big deployments .e.g 700-1000 users.
60 ## than 8-10 unless for really big deployments .e.g 700-1000 users.
61 ## `instance_id = *` must be set in the [app:main] section below (which is the default)
61 ## `instance_id = *` must be set in the [app:main] section below (which is the default)
62 ## when using more than 1 worker.
62 ## when using more than 1 worker.
63 workers = 2
63 workers = 2
64 ## process name visible in process list
64 ## process name visible in process list
65 proc_name = rhodecode
65 proc_name = rhodecode
66 ## type of worker class, one of sync, gevent
66 ## type of worker class, one of sync, gevent
67 ## recommended for bigger setup is using of of other than sync one
67 ## recommended for bigger setup is using of of other than sync one
68 worker_class = gevent
68 worker_class = gevent
69 ## The maximum number of simultaneous clients. Valid only for Gevent
69 ## The maximum number of simultaneous clients. Valid only for Gevent
70 worker_connections = 10
70 worker_connections = 10
71 ## max number of requests that worker will handle before being gracefully
71 ## max number of requests that worker will handle before being gracefully
72 ## restarted, could prevent memory leaks
72 ## restarted, could prevent memory leaks
73 max_requests = 1000
73 max_requests = 1000
74 max_requests_jitter = 30
74 max_requests_jitter = 30
75 ## amount of time a worker can spend with handling a request before it
75 ## amount of time a worker can spend with handling a request before it
76 ## gets killed and restarted. Set to 6hrs
76 ## gets killed and restarted. Set to 6hrs
77 timeout = 21600
77 timeout = 21600
78
78
79
79
80 ## prefix middleware for RhodeCode.
80 ## prefix middleware for RhodeCode.
81 ## recommended when using proxy setup.
81 ## recommended when using proxy setup.
82 ## allows to set RhodeCode under a prefix in server.
82 ## allows to set RhodeCode under a prefix in server.
83 ## eg https://server.com/custom_prefix. Enable `filter-with =` option below as well.
83 ## eg https://server.com/custom_prefix. Enable `filter-with =` option below as well.
84 ## And set your prefix like: `prefix = /custom_prefix`
84 ## And set your prefix like: `prefix = /custom_prefix`
85 ## be sure to also set beaker.session.cookie_path = /custom_prefix if you need
85 ## be sure to also set beaker.session.cookie_path = /custom_prefix if you need
86 ## to make your cookies only work on prefix url
86 ## to make your cookies only work on prefix url
87 [filter:proxy-prefix]
87 [filter:proxy-prefix]
88 use = egg:PasteDeploy#prefix
88 use = egg:PasteDeploy#prefix
89 prefix = /
89 prefix = /
90
90
91 [app:main]
91 [app:main]
92 ## The %(here)s variable will be replaced with the absolute path of parent directory
92 ## The %(here)s variable will be replaced with the absolute path of parent directory
93 ## of this file
93 ## of this file
94 ## In addition ENVIRONMENT variables usage is possible, e.g
94 ## In addition ENVIRONMENT variables usage is possible, e.g
95 ## sqlalchemy.db1.url = {ENV_RC_DB_URL}
95 ## sqlalchemy.db1.url = {ENV_RC_DB_URL}
96
96
97 use = egg:rhodecode-enterprise-ce
97 use = egg:rhodecode-enterprise-ce
98
98
99 ## enable proxy prefix middleware, defined above
99 ## enable proxy prefix middleware, defined above
100 #filter-with = proxy-prefix
100 #filter-with = proxy-prefix
101
101
102 ## encryption key used to encrypt social plugin tokens,
102 ## encryption key used to encrypt social plugin tokens,
103 ## remote_urls with credentials etc, if not set it defaults to
103 ## remote_urls with credentials etc, if not set it defaults to
104 ## `beaker.session.secret`
104 ## `beaker.session.secret`
105 #rhodecode.encrypted_values.secret =
105 #rhodecode.encrypted_values.secret =
106
106
107 ## decryption strict mode (enabled by default). It controls if decryption raises
107 ## decryption strict mode (enabled by default). It controls if decryption raises
108 ## `SignatureVerificationError` in case of wrong key, or damaged encryption data.
108 ## `SignatureVerificationError` in case of wrong key, or damaged encryption data.
109 #rhodecode.encrypted_values.strict = false
109 #rhodecode.encrypted_values.strict = false
110
110
111 ## Pick algorithm for encryption. Either fernet (more secure) or aes (default)
111 ## Pick algorithm for encryption. Either fernet (more secure) or aes (default)
112 ## fernet is safer, and we strongly recommend switching to it.
112 ## fernet is safer, and we strongly recommend switching to it.
113 ## Due to backward compatibility aes is used as default.
113 ## Due to backward compatibility aes is used as default.
114 #rhodecode.encrypted_values.algorithm = fernet
114 #rhodecode.encrypted_values.algorithm = fernet
115
115
116 ## return gzipped responses from RhodeCode (static files/application)
116 ## return gzipped responses from RhodeCode (static files/application)
117 gzip_responses = false
117 gzip_responses = false
118
118
119 ## auto-generate javascript routes file on startup
119 ## auto-generate javascript routes file on startup
120 generate_js_files = false
120 generate_js_files = false
121
121
122 ## System global default language.
122 ## System global default language.
123 ## All available languages: en(default), be, de, es, fr, it, ja, pl, pt, ru, zh
123 ## All available languages: en(default), be, de, es, fr, it, ja, pl, pt, ru, zh
124 lang = en
124 lang = en
125
125
126 ## Perform a full repository scan and import on each server start.
126 ## Perform a full repository scan and import on each server start.
127 ## Settings this to true could lead to very long startup time.
127 ## Settings this to true could lead to very long startup time.
128 startup.import_repos = false
128 startup.import_repos = false
129
129
130 ## Uncomment and set this path to use archive download cache.
130 ## Uncomment and set this path to use archive download cache.
131 ## Once enabled, generated archives will be cached at this location
131 ## Once enabled, generated archives will be cached at this location
132 ## and served from the cache during subsequent requests for the same archive of
132 ## and served from the cache during subsequent requests for the same archive of
133 ## the repository.
133 ## the repository.
134 #archive_cache_dir = /tmp/tarballcache
134 #archive_cache_dir = /tmp/tarballcache
135
135
136 ## URL at which the application is running. This is used for Bootstrapping
136 ## URL at which the application is running. This is used for Bootstrapping
137 ## requests in context when no web request is available. Used in ishell, or
137 ## requests in context when no web request is available. Used in ishell, or
138 ## SSH calls. Set this for events to receive proper url for SSH calls.
138 ## SSH calls. Set this for events to receive proper url for SSH calls.
139 app.base_url = http://rhodecode.local
139 app.base_url = http://rhodecode.local
140
140
141 ## Unique application ID. Should be a random unique string for security.
141 ## Unique application ID. Should be a random unique string for security.
142 app_instance_uuid = rc-production
142 app_instance_uuid = rc-production
143
143
144 ## Cut off limit for large diffs (size in bytes). If overall diff size on
144 ## Cut off limit for large diffs (size in bytes). If overall diff size on
145 ## commit, or pull request exceeds this limit this diff will be displayed
145 ## commit, or pull request exceeds this limit this diff will be displayed
146 ## partially. E.g 512000 == 512Kb
146 ## partially. E.g 512000 == 512Kb
147 cut_off_limit_diff = 512000
147 cut_off_limit_diff = 512000
148
148
149 ## Cut off limit for large files inside diffs (size in bytes). Each individual
149 ## Cut off limit for large files inside diffs (size in bytes). Each individual
150 ## file inside diff which exceeds this limit will be displayed partially.
150 ## file inside diff which exceeds this limit will be displayed partially.
151 ## E.g 128000 == 128Kb
151 ## E.g 128000 == 128Kb
152 cut_off_limit_file = 128000
152 cut_off_limit_file = 128000
153
153
154 ## use cached version of vcs repositories everywhere. Recommended to be `true`
154 ## use cached version of vcs repositories everywhere. Recommended to be `true`
155 vcs_full_cache = true
155 vcs_full_cache = true
156
156
157 ## Force https in RhodeCode, fixes https redirects, assumes it's always https.
157 ## Force https in RhodeCode, fixes https redirects, assumes it's always https.
158 ## Normally this is controlled by proper http flags sent from http server
158 ## Normally this is controlled by proper http flags sent from http server
159 force_https = false
159 force_https = false
160
160
161 ## use Strict-Transport-Security headers
161 ## use Strict-Transport-Security headers
162 use_htsts = false
162 use_htsts = false
163
163
164 ## git rev filter option, --all is the default filter, if you need to
164 ## git rev filter option, --all is the default filter, if you need to
165 ## hide all refs in changelog switch this to --branches --tags
165 ## hide all refs in changelog switch this to --branches --tags
166 git_rev_filter = --branches --tags
166 git_rev_filter = --branches --tags
167
167
168 # Set to true if your repos are exposed using the dumb protocol
168 # Set to true if your repos are exposed using the dumb protocol
169 git_update_server_info = false
169 git_update_server_info = false
170
170
171 ## RSS/ATOM feed options
171 ## RSS/ATOM feed options
172 rss_cut_off_limit = 256000
172 rss_cut_off_limit = 256000
173 rss_items_per_page = 10
173 rss_items_per_page = 10
174 rss_include_diff = false
174 rss_include_diff = false
175
175
176 ## gist URL alias, used to create nicer urls for gist. This should be an
176 ## gist URL alias, used to create nicer urls for gist. This should be an
177 ## url that does rewrites to _admin/gists/{gistid}.
177 ## url that does rewrites to _admin/gists/{gistid}.
178 ## example: http://gist.rhodecode.org/{gistid}. Empty means use the internal
178 ## example: http://gist.rhodecode.org/{gistid}. Empty means use the internal
179 ## RhodeCode url, ie. http[s]://rhodecode.server/_admin/gists/{gistid}
179 ## RhodeCode url, ie. http[s]://rhodecode.server/_admin/gists/{gistid}
180 gist_alias_url =
180 gist_alias_url =
181
181
182 ## List of views (using glob pattern syntax) that AUTH TOKENS could be
182 ## List of views (using glob pattern syntax) that AUTH TOKENS could be
183 ## used for access.
183 ## used for access.
184 ## Adding ?auth_token=TOKEN_HASH to the url authenticates this request as if it
184 ## Adding ?auth_token=TOKEN_HASH to the url authenticates this request as if it
185 ## came from the the logged in user who own this authentication token.
185 ## came from the the logged in user who own this authentication token.
186 ## Additionally @TOKEN syntax can be used to bound the view to specific
186 ## Additionally @TOKEN syntax can be used to bound the view to specific
187 ## authentication token. Such view would be only accessible when used together
187 ## authentication token. Such view would be only accessible when used together
188 ## with this authentication token
188 ## with this authentication token
189 ##
189 ##
190 ## list of all views can be found under `/_admin/permissions/auth_token_access`
190 ## list of all views can be found under `/_admin/permissions/auth_token_access`
191 ## The list should be "," separated and on a single line.
191 ## The list should be "," separated and on a single line.
192 ##
192 ##
193 ## Most common views to enable:
193 ## Most common views to enable:
194 # RepoCommitsView:repo_commit_download
194 # RepoCommitsView:repo_commit_download
195 # RepoCommitsView:repo_commit_patch
195 # RepoCommitsView:repo_commit_patch
196 # RepoCommitsView:repo_commit_raw
196 # RepoCommitsView:repo_commit_raw
197 # RepoCommitsView:repo_commit_raw@TOKEN
197 # RepoCommitsView:repo_commit_raw@TOKEN
198 # RepoFilesView:repo_files_diff
198 # RepoFilesView:repo_files_diff
199 # RepoFilesView:repo_archivefile
199 # RepoFilesView:repo_archivefile
200 # RepoFilesView:repo_file_raw
200 # RepoFilesView:repo_file_raw
201 # GistView:*
201 # GistView:*
202 api_access_controllers_whitelist =
202 api_access_controllers_whitelist =
203
203
204 ## Default encoding used to convert from and to unicode
204 ## Default encoding used to convert from and to unicode
205 ## can be also a comma separated list of encoding in case of mixed encodings
205 ## can be also a comma separated list of encoding in case of mixed encodings
206 default_encoding = UTF-8
206 default_encoding = UTF-8
207
207
208 ## instance-id prefix
208 ## instance-id prefix
209 ## a prefix key for this instance used for cache invalidation when running
209 ## a prefix key for this instance used for cache invalidation when running
210 ## multiple instances of RhodeCode, make sure it's globally unique for
210 ## multiple instances of RhodeCode, make sure it's globally unique for
211 ## all running RhodeCode instances. Leave empty if you don't use it
211 ## all running RhodeCode instances. Leave empty if you don't use it
212 instance_id =
212 instance_id =
213
213
214 ## Fallback authentication plugin. Set this to a plugin ID to force the usage
214 ## Fallback authentication plugin. Set this to a plugin ID to force the usage
215 ## of an authentication plugin also if it is disabled by it's settings.
215 ## of an authentication plugin also if it is disabled by it's settings.
216 ## This could be useful if you are unable to log in to the system due to broken
216 ## This could be useful if you are unable to log in to the system due to broken
217 ## authentication settings. Then you can enable e.g. the internal RhodeCode auth
217 ## authentication settings. Then you can enable e.g. the internal RhodeCode auth
218 ## module to log in again and fix the settings.
218 ## module to log in again and fix the settings.
219 ##
219 ##
220 ## Available builtin plugin IDs (hash is part of the ID):
220 ## Available builtin plugin IDs (hash is part of the ID):
221 ## egg:rhodecode-enterprise-ce#rhodecode
221 ## egg:rhodecode-enterprise-ce#rhodecode
222 ## egg:rhodecode-enterprise-ce#pam
222 ## egg:rhodecode-enterprise-ce#pam
223 ## egg:rhodecode-enterprise-ce#ldap
223 ## egg:rhodecode-enterprise-ce#ldap
224 ## egg:rhodecode-enterprise-ce#jasig_cas
224 ## egg:rhodecode-enterprise-ce#jasig_cas
225 ## egg:rhodecode-enterprise-ce#headers
225 ## egg:rhodecode-enterprise-ce#headers
226 ## egg:rhodecode-enterprise-ce#crowd
226 ## egg:rhodecode-enterprise-ce#crowd
227 #rhodecode.auth_plugin_fallback = egg:rhodecode-enterprise-ce#rhodecode
227 #rhodecode.auth_plugin_fallback = egg:rhodecode-enterprise-ce#rhodecode
228
228
229 ## alternative return HTTP header for failed authentication. Default HTTP
229 ## alternative return HTTP header for failed authentication. Default HTTP
230 ## response is 401 HTTPUnauthorized. Currently HG clients have troubles with
230 ## response is 401 HTTPUnauthorized. Currently HG clients have troubles with
231 ## handling that causing a series of failed authentication calls.
231 ## handling that causing a series of failed authentication calls.
232 ## Set this variable to 403 to return HTTPForbidden, or any other HTTP code
232 ## Set this variable to 403 to return HTTPForbidden, or any other HTTP code
233 ## This will be served instead of default 401 on bad authentication
233 ## This will be served instead of default 401 on bad authentication
234 auth_ret_code =
234 auth_ret_code =
235
235
236 ## use special detection method when serving auth_ret_code, instead of serving
236 ## use special detection method when serving auth_ret_code, instead of serving
237 ## ret_code directly, use 401 initially (Which triggers credentials prompt)
237 ## ret_code directly, use 401 initially (Which triggers credentials prompt)
238 ## and then serve auth_ret_code to clients
238 ## and then serve auth_ret_code to clients
239 auth_ret_code_detection = false
239 auth_ret_code_detection = false
240
240
241 ## locking return code. When repository is locked return this HTTP code. 2XX
241 ## locking return code. When repository is locked return this HTTP code. 2XX
242 ## codes don't break the transactions while 4XX codes do
242 ## codes don't break the transactions while 4XX codes do
243 lock_ret_code = 423
243 lock_ret_code = 423
244
244
245 ## allows to change the repository location in settings page
245 ## allows to change the repository location in settings page
246 allow_repo_location_change = true
246 allow_repo_location_change = true
247
247
248 ## allows to setup custom hooks in settings page
248 ## allows to setup custom hooks in settings page
249 allow_custom_hooks_settings = true
249 allow_custom_hooks_settings = true
250
250
251 ## Generated license token required for EE edition license.
251 ## Generated license token required for EE edition license.
252 ## New generated token value can be found in Admin > settings > license page.
252 ## New generated token value can be found in Admin > settings > license page.
253 license_token =
253 license_token =
254
254
255 ## supervisor connection uri, for managing supervisor and logs.
255 ## supervisor connection uri, for managing supervisor and logs.
256 supervisor.uri =
256 supervisor.uri =
257 ## supervisord group name/id we only want this RC instance to handle
257 ## supervisord group name/id we only want this RC instance to handle
258 supervisor.group_id = prod
258 supervisor.group_id = prod
259
259
260 ## Display extended labs settings
260 ## Display extended labs settings
261 labs_settings_active = true
261 labs_settings_active = true
262
262
263 ## Custom exception store path, defaults to TMPDIR
263 ## Custom exception store path, defaults to TMPDIR
264 ## This is used to store exception from RhodeCode in shared directory
264 ## This is used to store exception from RhodeCode in shared directory
265 #exception_tracker.store_path =
265 #exception_tracker.store_path =
266
266
267 ## File store configuration. This is used to store and serve uploaded files
267 ## File store configuration. This is used to store and serve uploaded files
268 file_store.enabled = true
268 file_store.enabled = true
269 ## Storage backend, available options are: local
269 ## Storage backend, available options are: local
270 file_store.backend = local
270 file_store.backend = local
271 ## path to store the uploaded binaries
271 ## path to store the uploaded binaries
272 file_store.storage_path = %(here)s/data/file_store
272 file_store.storage_path = %(here)s/data/file_store
273
273
274
274
275 ####################################
275 ####################################
276 ### CELERY CONFIG ####
276 ### CELERY CONFIG ####
277 ####################################
277 ####################################
278 ## run: /path/to/celery worker \
278 ## run: /path/to/celery worker \
279 ## -E --beat --app rhodecode.lib.celerylib.loader \
279 ## -E --beat --app rhodecode.lib.celerylib.loader \
280 ## --scheduler rhodecode.lib.celerylib.scheduler.RcScheduler \
280 ## --scheduler rhodecode.lib.celerylib.scheduler.RcScheduler \
281 ## --loglevel DEBUG --ini /path/to/rhodecode.ini
281 ## --loglevel DEBUG --ini /path/to/rhodecode.ini
282
282
283 use_celery = false
283 use_celery = false
284
284
285 ## connection url to the message broker (default rabbitmq)
285 ## connection url to the message broker (default rabbitmq)
286 celery.broker_url = amqp://rabbitmq:qweqwe@localhost:5672/rabbitmqhost
286 celery.broker_url = amqp://rabbitmq:qweqwe@localhost:5672/rabbitmqhost
287
287
288 ## maximum tasks to execute before worker restart
288 ## maximum tasks to execute before worker restart
289 celery.max_tasks_per_child = 100
289 celery.max_tasks_per_child = 100
290
290
291 ## tasks will never be sent to the queue, but executed locally instead.
291 ## tasks will never be sent to the queue, but executed locally instead.
292 celery.task_always_eager = false
292 celery.task_always_eager = false
293
293
294 #####################################
294 #####################################
295 ### DOGPILE CACHE ####
295 ### DOGPILE CACHE ####
296 #####################################
296 #####################################
297 ## Default cache dir for caches. Putting this into a ramdisk
297 ## Default cache dir for caches. Putting this into a ramdisk
298 ## can boost performance, eg. /tmpfs/data_ramdisk, however this directory might require
298 ## can boost performance, eg. /tmpfs/data_ramdisk, however this directory might require
299 ## large amount of space
299 ## large amount of space
300 cache_dir = %(here)s/data
300 cache_dir = %(here)s/data
301
301
302 ## `cache_perms` cache settings for permission tree, auth TTL.
302 ## `cache_perms` cache settings for permission tree, auth TTL.
303 rc_cache.cache_perms.backend = dogpile.cache.rc.file_namespace
303 rc_cache.cache_perms.backend = dogpile.cache.rc.file_namespace
304 rc_cache.cache_perms.expiration_time = 300
304 rc_cache.cache_perms.expiration_time = 300
305
305
306 ## alternative `cache_perms` redis backend with distributed lock
306 ## alternative `cache_perms` redis backend with distributed lock
307 #rc_cache.cache_perms.backend = dogpile.cache.rc.redis
307 #rc_cache.cache_perms.backend = dogpile.cache.rc.redis
308 #rc_cache.cache_perms.expiration_time = 300
308 #rc_cache.cache_perms.expiration_time = 300
309 ## redis_expiration_time needs to be greater then expiration_time
309 ## redis_expiration_time needs to be greater then expiration_time
310 #rc_cache.cache_perms.arguments.redis_expiration_time = 7200
310 #rc_cache.cache_perms.arguments.redis_expiration_time = 7200
311 #rc_cache.cache_perms.arguments.socket_timeout = 30
311 #rc_cache.cache_perms.arguments.socket_timeout = 30
312 #rc_cache.cache_perms.arguments.host = localhost
312 #rc_cache.cache_perms.arguments.host = localhost
313 #rc_cache.cache_perms.arguments.port = 6379
313 #rc_cache.cache_perms.arguments.port = 6379
314 #rc_cache.cache_perms.arguments.db = 0
314 #rc_cache.cache_perms.arguments.db = 0
315 ## more Redis options: https://dogpilecache.sqlalchemy.org/en/latest/api.html#redis-backends
315 ## more Redis options: https://dogpilecache.sqlalchemy.org/en/latest/api.html#redis-backends
316 #rc_cache.cache_perms.arguments.distributed_lock = true
316 #rc_cache.cache_perms.arguments.distributed_lock = true
317
317
318 ## `cache_repo` cache settings for FileTree, Readme, RSS FEEDS
318 ## `cache_repo` cache settings for FileTree, Readme, RSS FEEDS
319 rc_cache.cache_repo.backend = dogpile.cache.rc.file_namespace
319 rc_cache.cache_repo.backend = dogpile.cache.rc.file_namespace
320 rc_cache.cache_repo.expiration_time = 2592000
320 rc_cache.cache_repo.expiration_time = 2592000
321
321
322 ## alternative `cache_repo` redis backend with distributed lock
322 ## alternative `cache_repo` redis backend with distributed lock
323 #rc_cache.cache_repo.backend = dogpile.cache.rc.redis
323 #rc_cache.cache_repo.backend = dogpile.cache.rc.redis
324 #rc_cache.cache_repo.expiration_time = 2592000
324 #rc_cache.cache_repo.expiration_time = 2592000
325 ## redis_expiration_time needs to be greater then expiration_time
325 ## redis_expiration_time needs to be greater then expiration_time
326 #rc_cache.cache_repo.arguments.redis_expiration_time = 2678400
326 #rc_cache.cache_repo.arguments.redis_expiration_time = 2678400
327 #rc_cache.cache_repo.arguments.socket_timeout = 30
327 #rc_cache.cache_repo.arguments.socket_timeout = 30
328 #rc_cache.cache_repo.arguments.host = localhost
328 #rc_cache.cache_repo.arguments.host = localhost
329 #rc_cache.cache_repo.arguments.port = 6379
329 #rc_cache.cache_repo.arguments.port = 6379
330 #rc_cache.cache_repo.arguments.db = 1
330 #rc_cache.cache_repo.arguments.db = 1
331 ## more Redis options: https://dogpilecache.sqlalchemy.org/en/latest/api.html#redis-backends
331 ## more Redis options: https://dogpilecache.sqlalchemy.org/en/latest/api.html#redis-backends
332 #rc_cache.cache_repo.arguments.distributed_lock = true
332 #rc_cache.cache_repo.arguments.distributed_lock = true
333
333
334 ## cache settings for SQL queries, this needs to use memory type backend
334 ## cache settings for SQL queries, this needs to use memory type backend
335 rc_cache.sql_cache_short.backend = dogpile.cache.rc.memory_lru
335 rc_cache.sql_cache_short.backend = dogpile.cache.rc.memory_lru
336 rc_cache.sql_cache_short.expiration_time = 30
336 rc_cache.sql_cache_short.expiration_time = 30
337
337
338 ## `cache_repo_longterm` cache for repo object instances, this needs to use memory
338 ## `cache_repo_longterm` cache for repo object instances, this needs to use memory
339 ## type backend as the objects kept are not pickle serializable
339 ## type backend as the objects kept are not pickle serializable
340 rc_cache.cache_repo_longterm.backend = dogpile.cache.rc.memory_lru
340 rc_cache.cache_repo_longterm.backend = dogpile.cache.rc.memory_lru
341 ## by default we use 96H, this is using invalidation on push anyway
341 ## by default we use 96H, this is using invalidation on push anyway
342 rc_cache.cache_repo_longterm.expiration_time = 345600
342 rc_cache.cache_repo_longterm.expiration_time = 345600
343 ## max items in LRU cache, reduce this number to save memory, and expire last used
343 ## max items in LRU cache, reduce this number to save memory, and expire last used
344 ## cached objects
344 ## cached objects
345 rc_cache.cache_repo_longterm.max_size = 10000
345 rc_cache.cache_repo_longterm.max_size = 10000
346
346
347
347
348 ####################################
348 ####################################
349 ### BEAKER SESSION ####
349 ### BEAKER SESSION ####
350 ####################################
350 ####################################
351
351
352 ## .session.type is type of storage options for the session, current allowed
352 ## .session.type is type of storage options for the session, current allowed
353 ## types are file, ext:memcached, ext:redis, ext:database, and memory (default).
353 ## types are file, ext:memcached, ext:redis, ext:database, and memory (default).
354 beaker.session.type = file
354 beaker.session.type = file
355 beaker.session.data_dir = %(here)s/data/sessions
355 beaker.session.data_dir = %(here)s/data/sessions
356
356
357 ## redis sessions
358 #beaker.session.type = ext:redis
359 #beaker.session.url = redis://127.0.0.1:6379/2
360
357 ## db based session, fast, and allows easy management over logged in users
361 ## db based session, fast, and allows easy management over logged in users
358 #beaker.session.type = ext:database
362 #beaker.session.type = ext:database
359 #beaker.session.table_name = db_session
363 #beaker.session.table_name = db_session
360 #beaker.session.sa.url = postgresql://postgres:secret@localhost/rhodecode
364 #beaker.session.sa.url = postgresql://postgres:secret@localhost/rhodecode
361 #beaker.session.sa.url = mysql://root:secret@127.0.0.1/rhodecode
365 #beaker.session.sa.url = mysql://root:secret@127.0.0.1/rhodecode
362 #beaker.session.sa.pool_recycle = 3600
366 #beaker.session.sa.pool_recycle = 3600
363 #beaker.session.sa.echo = false
367 #beaker.session.sa.echo = false
364
368
365 beaker.session.key = rhodecode
369 beaker.session.key = rhodecode
366 beaker.session.secret = production-rc-uytcxaz
370 beaker.session.secret = production-rc-uytcxaz
367 beaker.session.lock_dir = %(here)s/data/sessions/lock
371 beaker.session.lock_dir = %(here)s/data/sessions/lock
368
372
369 ## Secure encrypted cookie. Requires AES and AES python libraries
373 ## Secure encrypted cookie. Requires AES and AES python libraries
370 ## you must disable beaker.session.secret to use this
374 ## you must disable beaker.session.secret to use this
371 #beaker.session.encrypt_key = key_for_encryption
375 #beaker.session.encrypt_key = key_for_encryption
372 #beaker.session.validate_key = validation_key
376 #beaker.session.validate_key = validation_key
373
377
374 ## sets session as invalid(also logging out user) if it haven not been
378 ## sets session as invalid(also logging out user) if it haven not been
375 ## accessed for given amount of time in seconds
379 ## accessed for given amount of time in seconds
376 beaker.session.timeout = 2592000
380 beaker.session.timeout = 2592000
377 beaker.session.httponly = true
381 beaker.session.httponly = true
378 ## Path to use for the cookie. Set to prefix if you use prefix middleware
382 ## Path to use for the cookie. Set to prefix if you use prefix middleware
379 #beaker.session.cookie_path = /custom_prefix
383 #beaker.session.cookie_path = /custom_prefix
380
384
381 ## uncomment for https secure cookie
385 ## uncomment for https secure cookie
382 beaker.session.secure = false
386 beaker.session.secure = false
383
387
384 ## auto save the session to not to use .save()
388 ## auto save the session to not to use .save()
385 beaker.session.auto = false
389 beaker.session.auto = false
386
390
387 ## default cookie expiration time in seconds, set to `true` to set expire
391 ## default cookie expiration time in seconds, set to `true` to set expire
388 ## at browser close
392 ## at browser close
389 #beaker.session.cookie_expires = 3600
393 #beaker.session.cookie_expires = 3600
390
394
391 ###################################
395 ###################################
392 ## SEARCH INDEXING CONFIGURATION ##
396 ## SEARCH INDEXING CONFIGURATION ##
393 ###################################
397 ###################################
394 ## Full text search indexer is available in rhodecode-tools under
398 ## Full text search indexer is available in rhodecode-tools under
395 ## `rhodecode-tools index` command
399 ## `rhodecode-tools index` command
396
400
397 ## WHOOSH Backend, doesn't require additional services to run
401 ## WHOOSH Backend, doesn't require additional services to run
398 ## it works good with few dozen repos
402 ## it works good with few dozen repos
399 search.module = rhodecode.lib.index.whoosh
403 search.module = rhodecode.lib.index.whoosh
400 search.location = %(here)s/data/index
404 search.location = %(here)s/data/index
401
405
402 ########################################
406 ########################################
403 ### CHANNELSTREAM CONFIG ####
407 ### CHANNELSTREAM CONFIG ####
404 ########################################
408 ########################################
405 ## channelstream enables persistent connections and live notification
409 ## channelstream enables persistent connections and live notification
406 ## in the system. It's also used by the chat system
410 ## in the system. It's also used by the chat system
407
411
408 channelstream.enabled = false
412 channelstream.enabled = false
409
413
410 ## server address for channelstream server on the backend
414 ## server address for channelstream server on the backend
411 channelstream.server = 127.0.0.1:9800
415 channelstream.server = 127.0.0.1:9800
412
416
413 ## location of the channelstream server from outside world
417 ## location of the channelstream server from outside world
414 ## use ws:// for http or wss:// for https. This address needs to be handled
418 ## use ws:// for http or wss:// for https. This address needs to be handled
415 ## by external HTTP server such as Nginx or Apache
419 ## by external HTTP server such as Nginx or Apache
416 ## see Nginx/Apache configuration examples in our docs
420 ## see Nginx/Apache configuration examples in our docs
417 channelstream.ws_url = ws://rhodecode.yourserver.com/_channelstream
421 channelstream.ws_url = ws://rhodecode.yourserver.com/_channelstream
418 channelstream.secret = secret
422 channelstream.secret = secret
419 channelstream.history.location = %(here)s/channelstream_history
423 channelstream.history.location = %(here)s/channelstream_history
420
424
421 ## Internal application path that Javascript uses to connect into.
425 ## Internal application path that Javascript uses to connect into.
422 ## If you use proxy-prefix the prefix should be added before /_channelstream
426 ## If you use proxy-prefix the prefix should be added before /_channelstream
423 channelstream.proxy_path = /_channelstream
427 channelstream.proxy_path = /_channelstream
424
428
425
429
426 ###################################
430 ###################################
427 ## APPENLIGHT CONFIG ##
431 ## APPENLIGHT CONFIG ##
428 ###################################
432 ###################################
429
433
430 ## Appenlight is tailored to work with RhodeCode, see
434 ## Appenlight is tailored to work with RhodeCode, see
431 ## http://appenlight.com for details how to obtain an account
435 ## http://appenlight.com for details how to obtain an account
432
436
433 ## Appenlight integration enabled
437 ## Appenlight integration enabled
434 appenlight = false
438 appenlight = false
435
439
436 appenlight.server_url = https://api.appenlight.com
440 appenlight.server_url = https://api.appenlight.com
437 appenlight.api_key = YOUR_API_KEY
441 appenlight.api_key = YOUR_API_KEY
438 #appenlight.transport_config = https://api.appenlight.com?threaded=1&timeout=5
442 #appenlight.transport_config = https://api.appenlight.com?threaded=1&timeout=5
439
443
440 ## used for JS client
444 ## used for JS client
441 appenlight.api_public_key = YOUR_API_PUBLIC_KEY
445 appenlight.api_public_key = YOUR_API_PUBLIC_KEY
442
446
443 ## TWEAK AMOUNT OF INFO SENT HERE
447 ## TWEAK AMOUNT OF INFO SENT HERE
444
448
445 ## enables 404 error logging (default False)
449 ## enables 404 error logging (default False)
446 appenlight.report_404 = false
450 appenlight.report_404 = false
447
451
448 ## time in seconds after request is considered being slow (default 1)
452 ## time in seconds after request is considered being slow (default 1)
449 appenlight.slow_request_time = 1
453 appenlight.slow_request_time = 1
450
454
451 ## record slow requests in application
455 ## record slow requests in application
452 ## (needs to be enabled for slow datastore recording and time tracking)
456 ## (needs to be enabled for slow datastore recording and time tracking)
453 appenlight.slow_requests = true
457 appenlight.slow_requests = true
454
458
455 ## enable hooking to application loggers
459 ## enable hooking to application loggers
456 appenlight.logging = true
460 appenlight.logging = true
457
461
458 ## minimum log level for log capture
462 ## minimum log level for log capture
459 appenlight.logging.level = WARNING
463 appenlight.logging.level = WARNING
460
464
461 ## send logs only from erroneous/slow requests
465 ## send logs only from erroneous/slow requests
462 ## (saves API quota for intensive logging)
466 ## (saves API quota for intensive logging)
463 appenlight.logging_on_error = false
467 appenlight.logging_on_error = false
464
468
465 ## list of additional keywords that should be grabbed from environ object
469 ## list of additional keywords that should be grabbed from environ object
466 ## can be string with comma separated list of words in lowercase
470 ## can be string with comma separated list of words in lowercase
467 ## (by default client will always send following info:
471 ## (by default client will always send following info:
468 ## 'REMOTE_USER', 'REMOTE_ADDR', 'SERVER_NAME', 'CONTENT_TYPE' + all keys that
472 ## 'REMOTE_USER', 'REMOTE_ADDR', 'SERVER_NAME', 'CONTENT_TYPE' + all keys that
469 ## start with HTTP* this list be extended with additional keywords here
473 ## start with HTTP* this list be extended with additional keywords here
470 appenlight.environ_keys_whitelist =
474 appenlight.environ_keys_whitelist =
471
475
472 ## list of keywords that should be blanked from request object
476 ## list of keywords that should be blanked from request object
473 ## can be string with comma separated list of words in lowercase
477 ## can be string with comma separated list of words in lowercase
474 ## (by default client will always blank keys that contain following words
478 ## (by default client will always blank keys that contain following words
475 ## 'password', 'passwd', 'pwd', 'auth_tkt', 'secret', 'csrf'
479 ## 'password', 'passwd', 'pwd', 'auth_tkt', 'secret', 'csrf'
476 ## this list be extended with additional keywords set here
480 ## this list be extended with additional keywords set here
477 appenlight.request_keys_blacklist =
481 appenlight.request_keys_blacklist =
478
482
479 ## list of namespaces that should be ignores when gathering log entries
483 ## list of namespaces that should be ignores when gathering log entries
480 ## can be string with comma separated list of namespaces
484 ## can be string with comma separated list of namespaces
481 ## (by default the client ignores own entries: appenlight_client.client)
485 ## (by default the client ignores own entries: appenlight_client.client)
482 appenlight.log_namespace_blacklist =
486 appenlight.log_namespace_blacklist =
483
487
484
488
485 ###########################################
489 ###########################################
486 ### MAIN RHODECODE DATABASE CONFIG ###
490 ### MAIN RHODECODE DATABASE CONFIG ###
487 ###########################################
491 ###########################################
488 #sqlalchemy.db1.url = sqlite:///%(here)s/rhodecode.db?timeout=30
492 #sqlalchemy.db1.url = sqlite:///%(here)s/rhodecode.db?timeout=30
489 #sqlalchemy.db1.url = postgresql://postgres:qweqwe@localhost/rhodecode
493 #sqlalchemy.db1.url = postgresql://postgres:qweqwe@localhost/rhodecode
490 #sqlalchemy.db1.url = mysql://root:qweqwe@localhost/rhodecode?charset=utf8
494 #sqlalchemy.db1.url = mysql://root:qweqwe@localhost/rhodecode?charset=utf8
491 # pymysql is an alternative driver for MySQL, use in case of problems with default one
495 # pymysql is an alternative driver for MySQL, use in case of problems with default one
492 #sqlalchemy.db1.url = mysql+pymysql://root:qweqwe@localhost/rhodecode
496 #sqlalchemy.db1.url = mysql+pymysql://root:qweqwe@localhost/rhodecode
493
497
494 sqlalchemy.db1.url = postgresql://postgres:qweqwe@localhost/rhodecode
498 sqlalchemy.db1.url = postgresql://postgres:qweqwe@localhost/rhodecode
495
499
496 # see sqlalchemy docs for other advanced settings
500 # see sqlalchemy docs for other advanced settings
497
501
498 ## print the sql statements to output
502 ## print the sql statements to output
499 sqlalchemy.db1.echo = false
503 sqlalchemy.db1.echo = false
500 ## recycle the connections after this amount of seconds
504 ## recycle the connections after this amount of seconds
501 sqlalchemy.db1.pool_recycle = 3600
505 sqlalchemy.db1.pool_recycle = 3600
502 sqlalchemy.db1.convert_unicode = true
506 sqlalchemy.db1.convert_unicode = true
503
507
504 ## the number of connections to keep open inside the connection pool.
508 ## the number of connections to keep open inside the connection pool.
505 ## 0 indicates no limit
509 ## 0 indicates no limit
506 #sqlalchemy.db1.pool_size = 5
510 #sqlalchemy.db1.pool_size = 5
507
511
508 ## the number of connections to allow in connection pool "overflow", that is
512 ## the number of connections to allow in connection pool "overflow", that is
509 ## connections that can be opened above and beyond the pool_size setting,
513 ## connections that can be opened above and beyond the pool_size setting,
510 ## which defaults to five.
514 ## which defaults to five.
511 #sqlalchemy.db1.max_overflow = 10
515 #sqlalchemy.db1.max_overflow = 10
512
516
513 ## Connection check ping, used to detect broken database connections
517 ## Connection check ping, used to detect broken database connections
514 ## could be enabled to better handle cases if MySQL has gone away errors
518 ## could be enabled to better handle cases if MySQL has gone away errors
515 #sqlalchemy.db1.ping_connection = true
519 #sqlalchemy.db1.ping_connection = true
516
520
517 ##################
521 ##################
518 ### VCS CONFIG ###
522 ### VCS CONFIG ###
519 ##################
523 ##################
520 vcs.server.enable = true
524 vcs.server.enable = true
521 vcs.server = localhost:9900
525 vcs.server = localhost:9900
522
526
523 ## Web server connectivity protocol, responsible for web based VCS operations
527 ## Web server connectivity protocol, responsible for web based VCS operations
524 ## Available protocols are:
528 ## Available protocols are:
525 ## `http` - use http-rpc backend (default)
529 ## `http` - use http-rpc backend (default)
526 vcs.server.protocol = http
530 vcs.server.protocol = http
527
531
528 ## Push/Pull operations protocol, available options are:
532 ## Push/Pull operations protocol, available options are:
529 ## `http` - use http-rpc backend (default)
533 ## `http` - use http-rpc backend (default)
530 vcs.scm_app_implementation = http
534 vcs.scm_app_implementation = http
531
535
532 ## Push/Pull operations hooks protocol, available options are:
536 ## Push/Pull operations hooks protocol, available options are:
533 ## `http` - use http-rpc backend (default)
537 ## `http` - use http-rpc backend (default)
534 vcs.hooks.protocol = http
538 vcs.hooks.protocol = http
535
539
536 ## Host on which this instance is listening for hooks. If vcsserver is in other location
540 ## Host on which this instance is listening for hooks. If vcsserver is in other location
537 ## this should be adjusted.
541 ## this should be adjusted.
538 vcs.hooks.host = 127.0.0.1
542 vcs.hooks.host = 127.0.0.1
539
543
540 vcs.server.log_level = info
544 vcs.server.log_level = info
541 ## Start VCSServer with this instance as a subprocess, useful for development
545 ## Start VCSServer with this instance as a subprocess, useful for development
542 vcs.start_server = false
546 vcs.start_server = false
543
547
544 ## List of enabled VCS backends, available options are:
548 ## List of enabled VCS backends, available options are:
545 ## `hg` - mercurial
549 ## `hg` - mercurial
546 ## `git` - git
550 ## `git` - git
547 ## `svn` - subversion
551 ## `svn` - subversion
548 vcs.backends = hg, git, svn
552 vcs.backends = hg, git, svn
549
553
550 vcs.connection_timeout = 3600
554 vcs.connection_timeout = 3600
551 ## Compatibility version when creating SVN repositories. Defaults to newest version when commented out.
555 ## Compatibility version when creating SVN repositories. Defaults to newest version when commented out.
552 ## Available options are: pre-1.4-compatible, pre-1.5-compatible, pre-1.6-compatible, pre-1.8-compatible, pre-1.9-compatible
556 ## Available options are: pre-1.4-compatible, pre-1.5-compatible, pre-1.6-compatible, pre-1.8-compatible, pre-1.9-compatible
553 #vcs.svn.compatible_version = pre-1.8-compatible
557 #vcs.svn.compatible_version = pre-1.8-compatible
554
558
555
559
556 ############################################################
560 ############################################################
557 ### Subversion proxy support (mod_dav_svn) ###
561 ### Subversion proxy support (mod_dav_svn) ###
558 ### Maps RhodeCode repo groups into SVN paths for Apache ###
562 ### Maps RhodeCode repo groups into SVN paths for Apache ###
559 ############################################################
563 ############################################################
560 ## Enable or disable the config file generation.
564 ## Enable or disable the config file generation.
561 svn.proxy.generate_config = false
565 svn.proxy.generate_config = false
562 ## Generate config file with `SVNListParentPath` set to `On`.
566 ## Generate config file with `SVNListParentPath` set to `On`.
563 svn.proxy.list_parent_path = true
567 svn.proxy.list_parent_path = true
564 ## Set location and file name of generated config file.
568 ## Set location and file name of generated config file.
565 svn.proxy.config_file_path = %(here)s/mod_dav_svn.conf
569 svn.proxy.config_file_path = %(here)s/mod_dav_svn.conf
566 ## alternative mod_dav config template. This needs to be a mako template
570 ## alternative mod_dav config template. This needs to be a mako template
567 #svn.proxy.config_template = ~/.rccontrol/enterprise-1/custom_svn_conf.mako
571 #svn.proxy.config_template = ~/.rccontrol/enterprise-1/custom_svn_conf.mako
568 ## Used as a prefix to the `Location` block in the generated config file.
572 ## Used as a prefix to the `Location` block in the generated config file.
569 ## In most cases it should be set to `/`.
573 ## In most cases it should be set to `/`.
570 svn.proxy.location_root = /
574 svn.proxy.location_root = /
571 ## Command to reload the mod dav svn configuration on change.
575 ## Command to reload the mod dav svn configuration on change.
572 ## Example: `/etc/init.d/apache2 reload` or /home/USER/apache_reload.sh
576 ## Example: `/etc/init.d/apache2 reload` or /home/USER/apache_reload.sh
573 ## Make sure user who runs RhodeCode process is allowed to reload Apache
577 ## Make sure user who runs RhodeCode process is allowed to reload Apache
574 #svn.proxy.reload_cmd = /etc/init.d/apache2 reload
578 #svn.proxy.reload_cmd = /etc/init.d/apache2 reload
575 ## If the timeout expires before the reload command finishes, the command will
579 ## If the timeout expires before the reload command finishes, the command will
576 ## be killed. Setting it to zero means no timeout. Defaults to 10 seconds.
580 ## be killed. Setting it to zero means no timeout. Defaults to 10 seconds.
577 #svn.proxy.reload_timeout = 10
581 #svn.proxy.reload_timeout = 10
578
582
579 ############################################################
583 ############################################################
580 ### SSH Support Settings ###
584 ### SSH Support Settings ###
581 ############################################################
585 ############################################################
582
586
583 ## Defines if a custom authorized_keys file should be created and written on
587 ## Defines if a custom authorized_keys file should be created and written on
584 ## any change user ssh keys. Setting this to false also disables possibility
588 ## any change user ssh keys. Setting this to false also disables possibility
585 ## of adding SSH keys by users from web interface. Super admins can still
589 ## of adding SSH keys by users from web interface. Super admins can still
586 ## manage SSH Keys.
590 ## manage SSH Keys.
587 ssh.generate_authorized_keyfile = false
591 ssh.generate_authorized_keyfile = false
588
592
589 ## Options for ssh, default is `no-pty,no-port-forwarding,no-X11-forwarding,no-agent-forwarding`
593 ## Options for ssh, default is `no-pty,no-port-forwarding,no-X11-forwarding,no-agent-forwarding`
590 # ssh.authorized_keys_ssh_opts =
594 # ssh.authorized_keys_ssh_opts =
591
595
592 ## Path to the authorized_keys file where the generate entries are placed.
596 ## Path to the authorized_keys file where the generate entries are placed.
593 ## It is possible to have multiple key files specified in `sshd_config` e.g.
597 ## It is possible to have multiple key files specified in `sshd_config` e.g.
594 ## AuthorizedKeysFile %h/.ssh/authorized_keys %h/.ssh/authorized_keys_rhodecode
598 ## AuthorizedKeysFile %h/.ssh/authorized_keys %h/.ssh/authorized_keys_rhodecode
595 ssh.authorized_keys_file_path = ~/.ssh/authorized_keys_rhodecode
599 ssh.authorized_keys_file_path = ~/.ssh/authorized_keys_rhodecode
596
600
597 ## Command to execute the SSH wrapper. The binary is available in the
601 ## Command to execute the SSH wrapper. The binary is available in the
598 ## RhodeCode installation directory.
602 ## RhodeCode installation directory.
599 ## e.g ~/.rccontrol/community-1/profile/bin/rc-ssh-wrapper
603 ## e.g ~/.rccontrol/community-1/profile/bin/rc-ssh-wrapper
600 ssh.wrapper_cmd = ~/.rccontrol/community-1/rc-ssh-wrapper
604 ssh.wrapper_cmd = ~/.rccontrol/community-1/rc-ssh-wrapper
601
605
602 ## Allow shell when executing the ssh-wrapper command
606 ## Allow shell when executing the ssh-wrapper command
603 ssh.wrapper_cmd_allow_shell = false
607 ssh.wrapper_cmd_allow_shell = false
604
608
605 ## Enables logging, and detailed output send back to the client during SSH
609 ## Enables logging, and detailed output send back to the client during SSH
606 ## operations. Useful for debugging, shouldn't be used in production.
610 ## operations. Useful for debugging, shouldn't be used in production.
607 ssh.enable_debug_logging = false
611 ssh.enable_debug_logging = false
608
612
609 ## Paths to binary executable, by default they are the names, but we can
613 ## Paths to binary executable, by default they are the names, but we can
610 ## override them if we want to use a custom one
614 ## override them if we want to use a custom one
611 ssh.executable.hg = ~/.rccontrol/vcsserver-1/profile/bin/hg
615 ssh.executable.hg = ~/.rccontrol/vcsserver-1/profile/bin/hg
612 ssh.executable.git = ~/.rccontrol/vcsserver-1/profile/bin/git
616 ssh.executable.git = ~/.rccontrol/vcsserver-1/profile/bin/git
613 ssh.executable.svn = ~/.rccontrol/vcsserver-1/profile/bin/svnserve
617 ssh.executable.svn = ~/.rccontrol/vcsserver-1/profile/bin/svnserve
614
618
615 ## Enables SSH key generator web interface. Disabling this still allows users
619 ## Enables SSH key generator web interface. Disabling this still allows users
616 ## to add their own keys.
620 ## to add their own keys.
617 ssh.enable_ui_key_generator = true
621 ssh.enable_ui_key_generator = true
618
622
619
623
620 ## Dummy marker to add new entries after.
624 ## Dummy marker to add new entries after.
621 ## Add any custom entries below. Please don't remove.
625 ## Add any custom entries below. Please don't remove.
622 custom.conf = 1
626 custom.conf = 1
623
627
624
628
625 ################################
629 ################################
626 ### LOGGING CONFIGURATION ####
630 ### LOGGING CONFIGURATION ####
627 ################################
631 ################################
628 [loggers]
632 [loggers]
629 keys = root, sqlalchemy, beaker, celery, rhodecode, ssh_wrapper
633 keys = root, sqlalchemy, beaker, celery, rhodecode, ssh_wrapper
630
634
631 [handlers]
635 [handlers]
632 keys = console, console_sql
636 keys = console, console_sql
633
637
634 [formatters]
638 [formatters]
635 keys = generic, color_formatter, color_formatter_sql
639 keys = generic, color_formatter, color_formatter_sql
636
640
637 #############
641 #############
638 ## LOGGERS ##
642 ## LOGGERS ##
639 #############
643 #############
640 [logger_root]
644 [logger_root]
641 level = NOTSET
645 level = NOTSET
642 handlers = console
646 handlers = console
643
647
644 [logger_sqlalchemy]
648 [logger_sqlalchemy]
645 level = INFO
649 level = INFO
646 handlers = console_sql
650 handlers = console_sql
647 qualname = sqlalchemy.engine
651 qualname = sqlalchemy.engine
648 propagate = 0
652 propagate = 0
649
653
650 [logger_beaker]
654 [logger_beaker]
651 level = DEBUG
655 level = DEBUG
652 handlers =
656 handlers =
653 qualname = beaker.container
657 qualname = beaker.container
654 propagate = 1
658 propagate = 1
655
659
656 [logger_rhodecode]
660 [logger_rhodecode]
657 level = DEBUG
661 level = DEBUG
658 handlers =
662 handlers =
659 qualname = rhodecode
663 qualname = rhodecode
660 propagate = 1
664 propagate = 1
661
665
662 [logger_ssh_wrapper]
666 [logger_ssh_wrapper]
663 level = DEBUG
667 level = DEBUG
664 handlers =
668 handlers =
665 qualname = ssh_wrapper
669 qualname = ssh_wrapper
666 propagate = 1
670 propagate = 1
667
671
668 [logger_celery]
672 [logger_celery]
669 level = DEBUG
673 level = DEBUG
670 handlers =
674 handlers =
671 qualname = celery
675 qualname = celery
672
676
673
677
674 ##############
678 ##############
675 ## HANDLERS ##
679 ## HANDLERS ##
676 ##############
680 ##############
677
681
678 [handler_console]
682 [handler_console]
679 class = StreamHandler
683 class = StreamHandler
680 args = (sys.stderr, )
684 args = (sys.stderr, )
681 level = INFO
685 level = INFO
682 formatter = generic
686 formatter = generic
683
687
684 [handler_console_sql]
688 [handler_console_sql]
685 # "level = DEBUG" logs SQL queries and results.
689 # "level = DEBUG" logs SQL queries and results.
686 # "level = INFO" logs SQL queries.
690 # "level = INFO" logs SQL queries.
687 # "level = WARN" logs neither. (Recommended for production systems.)
691 # "level = WARN" logs neither. (Recommended for production systems.)
688 class = StreamHandler
692 class = StreamHandler
689 args = (sys.stderr, )
693 args = (sys.stderr, )
690 level = WARN
694 level = WARN
691 formatter = generic
695 formatter = generic
692
696
693 ################
697 ################
694 ## FORMATTERS ##
698 ## FORMATTERS ##
695 ################
699 ################
696
700
697 [formatter_generic]
701 [formatter_generic]
698 class = rhodecode.lib.logging_formatter.ExceptionAwareFormatter
702 class = rhodecode.lib.logging_formatter.ExceptionAwareFormatter
699 format = %(asctime)s.%(msecs)03d [%(process)d] %(levelname)-5.5s [%(name)s] %(message)s
703 format = %(asctime)s.%(msecs)03d [%(process)d] %(levelname)-5.5s [%(name)s] %(message)s
700 datefmt = %Y-%m-%d %H:%M:%S
704 datefmt = %Y-%m-%d %H:%M:%S
701
705
702 [formatter_color_formatter]
706 [formatter_color_formatter]
703 class = rhodecode.lib.logging_formatter.ColorFormatter
707 class = rhodecode.lib.logging_formatter.ColorFormatter
704 format = %(asctime)s.%(msecs)03d [%(process)d] %(levelname)-5.5s [%(name)s] %(message)s
708 format = %(asctime)s.%(msecs)03d [%(process)d] %(levelname)-5.5s [%(name)s] %(message)s
705 datefmt = %Y-%m-%d %H:%M:%S
709 datefmt = %Y-%m-%d %H:%M:%S
706
710
707 [formatter_color_formatter_sql]
711 [formatter_color_formatter_sql]
708 class = rhodecode.lib.logging_formatter.ColorFormatterSql
712 class = rhodecode.lib.logging_formatter.ColorFormatterSql
709 format = %(asctime)s.%(msecs)03d [%(process)d] %(levelname)-5.5s [%(name)s] %(message)s
713 format = %(asctime)s.%(msecs)03d [%(process)d] %(levelname)-5.5s [%(name)s] %(message)s
710 datefmt = %Y-%m-%d %H:%M:%S
714 datefmt = %Y-%m-%d %H:%M:%S
@@ -1,223 +1,261 b''
1 # -*- coding: utf-8 -*-
1 # -*- coding: utf-8 -*-
2
2
3 # Copyright (C) 2017-2019 RhodeCode GmbH
3 # Copyright (C) 2017-2019 RhodeCode GmbH
4 #
4 #
5 # This program is free software: you can redistribute it and/or modify
5 # This program is free software: you can redistribute it and/or modify
6 # it under the terms of the GNU Affero General Public License, version 3
6 # it under the terms of the GNU Affero General Public License, version 3
7 # (only), as published by the Free Software Foundation.
7 # (only), as published by the Free Software Foundation.
8 #
8 #
9 # This program is distributed in the hope that it will be useful,
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
12 # GNU General Public License for more details.
13 #
13 #
14 # You should have received a copy of the GNU Affero General Public License
14 # You should have received a copy of the GNU Affero General Public License
15 # along with this program. If not, see <http://www.gnu.org/licenses/>.
15 # along with this program. If not, see <http://www.gnu.org/licenses/>.
16 #
16 #
17 # This program is dual-licensed. If you wish to learn more about the
17 # This program is dual-licensed. If you wish to learn more about the
18 # RhodeCode Enterprise Edition, including its added features, Support services,
18 # RhodeCode Enterprise Edition, including its added features, Support services,
19 # and proprietary license terms, please see https://rhodecode.com/licenses/
19 # and proprietary license terms, please see https://rhodecode.com/licenses/
20
20
21 import os
21 import os
22 import re
22 import re
23 import time
23 import time
24 import datetime
24 import datetime
25 import dateutil
25 import dateutil
26 import pickle
26
27
27 from rhodecode.model.db import DbSession, Session
28 from rhodecode.model.db import DbSession, Session
28
29
29
30
30 class CleanupCommand(Exception):
31 class CleanupCommand(Exception):
31 pass
32 pass
32
33
33
34
34 class BaseAuthSessions(object):
35 class BaseAuthSessions(object):
35 SESSION_TYPE = None
36 SESSION_TYPE = None
36 NOT_AVAILABLE = 'NOT AVAILABLE'
37 NOT_AVAILABLE = 'NOT AVAILABLE'
37
38
38 def __init__(self, config):
39 def __init__(self, config):
39 session_conf = {}
40 session_conf = {}
40 for k, v in config.items():
41 for k, v in config.items():
41 if k.startswith('beaker.session'):
42 if k.startswith('beaker.session'):
42 session_conf[k] = v
43 session_conf[k] = v
43 self.config = session_conf
44 self.config = session_conf
44
45
45 def get_count(self):
46 def get_count(self):
46 raise NotImplementedError
47 raise NotImplementedError
47
48
48 def get_expired_count(self, older_than_seconds=None):
49 def get_expired_count(self, older_than_seconds=None):
49 raise NotImplementedError
50 raise NotImplementedError
50
51
51 def clean_sessions(self, older_than_seconds=None):
52 def clean_sessions(self, older_than_seconds=None):
52 raise NotImplementedError
53 raise NotImplementedError
53
54
54 def _seconds_to_date(self, seconds):
55 def _seconds_to_date(self, seconds):
55 return datetime.datetime.utcnow() - dateutil.relativedelta.relativedelta(
56 return datetime.datetime.utcnow() - dateutil.relativedelta.relativedelta(
56 seconds=seconds)
57 seconds=seconds)
57
58
58
59
59 class DbAuthSessions(BaseAuthSessions):
60 class DbAuthSessions(BaseAuthSessions):
60 SESSION_TYPE = 'ext:database'
61 SESSION_TYPE = 'ext:database'
61
62
62 def get_count(self):
63 def get_count(self):
63 return DbSession.query().count()
64 return DbSession.query().count()
64
65
65 def get_expired_count(self, older_than_seconds=None):
66 def get_expired_count(self, older_than_seconds=None):
66 expiry_date = self._seconds_to_date(older_than_seconds)
67 expiry_date = self._seconds_to_date(older_than_seconds)
67 return DbSession.query().filter(DbSession.accessed < expiry_date).count()
68 return DbSession.query().filter(DbSession.accessed < expiry_date).count()
68
69
69 def clean_sessions(self, older_than_seconds=None):
70 def clean_sessions(self, older_than_seconds=None):
70 expiry_date = self._seconds_to_date(older_than_seconds)
71 expiry_date = self._seconds_to_date(older_than_seconds)
71 to_remove = DbSession.query().filter(DbSession.accessed < expiry_date).count()
72 to_remove = DbSession.query().filter(DbSession.accessed < expiry_date).count()
72 DbSession.query().filter(DbSession.accessed < expiry_date).delete()
73 DbSession.query().filter(DbSession.accessed < expiry_date).delete()
73 Session().commit()
74 Session().commit()
74 return to_remove
75 return to_remove
75
76
76
77
77 class FileAuthSessions(BaseAuthSessions):
78 class FileAuthSessions(BaseAuthSessions):
78 SESSION_TYPE = 'file sessions'
79 SESSION_TYPE = 'file sessions'
79
80
80 def _get_sessions_dir(self):
81 def _get_sessions_dir(self):
81 data_dir = self.config.get('beaker.session.data_dir')
82 data_dir = self.config.get('beaker.session.data_dir')
82 return data_dir
83 return data_dir
83
84
84 def _count_on_filesystem(self, path, older_than=0, callback=None):
85 def _count_on_filesystem(self, path, older_than=0, callback=None):
85 value = dict(percent=0, used=0, total=0, items=0, callbacks=0,
86 value = dict(percent=0, used=0, total=0, items=0, callbacks=0,
86 path=path, text='')
87 path=path, text='')
87 items_count = 0
88 items_count = 0
88 used = 0
89 used = 0
89 callbacks = 0
90 callbacks = 0
90 cur_time = time.time()
91 cur_time = time.time()
91 for root, dirs, files in os.walk(path):
92 for root, dirs, files in os.walk(path):
92 for f in files:
93 for f in files:
93 final_path = os.path.join(root, f)
94 final_path = os.path.join(root, f)
94 try:
95 try:
95 mtime = os.stat(final_path).st_mtime
96 mtime = os.stat(final_path).st_mtime
96 if (cur_time - mtime) > older_than:
97 if (cur_time - mtime) > older_than:
97 items_count += 1
98 items_count += 1
98 if callback:
99 if callback:
99 callback_res = callback(final_path)
100 callback_res = callback(final_path)
100 callbacks += 1
101 callbacks += 1
101 else:
102 else:
102 used += os.path.getsize(final_path)
103 used += os.path.getsize(final_path)
103 except OSError:
104 except OSError:
104 pass
105 pass
105 value.update({
106 value.update({
106 'percent': 100,
107 'percent': 100,
107 'used': used,
108 'used': used,
108 'total': used,
109 'total': used,
109 'items': items_count,
110 'items': items_count,
110 'callbacks': callbacks
111 'callbacks': callbacks
111 })
112 })
112 return value
113 return value
113
114
114 def get_count(self):
115 def get_count(self):
115 try:
116 try:
116 sessions_dir = self._get_sessions_dir()
117 sessions_dir = self._get_sessions_dir()
117 items_count = self._count_on_filesystem(sessions_dir)['items']
118 items_count = self._count_on_filesystem(sessions_dir)['items']
118 except Exception:
119 except Exception:
119 items_count = self.NOT_AVAILABLE
120 items_count = self.NOT_AVAILABLE
120 return items_count
121 return items_count
121
122
122 def get_expired_count(self, older_than_seconds=0):
123 def get_expired_count(self, older_than_seconds=0):
123 try:
124 try:
124 sessions_dir = self._get_sessions_dir()
125 sessions_dir = self._get_sessions_dir()
125 items_count = self._count_on_filesystem(
126 items_count = self._count_on_filesystem(
126 sessions_dir, older_than=older_than_seconds)['items']
127 sessions_dir, older_than=older_than_seconds)['items']
127 except Exception:
128 except Exception:
128 items_count = self.NOT_AVAILABLE
129 items_count = self.NOT_AVAILABLE
129 return items_count
130 return items_count
130
131
131 def clean_sessions(self, older_than_seconds=0):
132 def clean_sessions(self, older_than_seconds=0):
132 # find . -mtime +60 -exec rm {} \;
133 # find . -mtime +60 -exec rm {} \;
133
134
134 sessions_dir = self._get_sessions_dir()
135 sessions_dir = self._get_sessions_dir()
135
136
136 def remove_item(path):
137 def remove_item(path):
137 os.remove(path)
138 os.remove(path)
138
139
139 stats = self._count_on_filesystem(
140 stats = self._count_on_filesystem(
140 sessions_dir, older_than=older_than_seconds,
141 sessions_dir, older_than=older_than_seconds,
141 callback=remove_item)
142 callback=remove_item)
142 return stats['callbacks']
143 return stats['callbacks']
143
144
144
145
145
146 class MemcachedAuthSessions(BaseAuthSessions):
146 class MemcachedAuthSessions(BaseAuthSessions):
147 SESSION_TYPE = 'ext:memcached'
147 SESSION_TYPE = 'ext:memcached'
148 _key_regex = re.compile(r'ITEM (.*_session) \[(.*); (.*)\]')
148 _key_regex = re.compile(r'ITEM (.*_session) \[(.*); (.*)\]')
149
149
150 def _get_client(self):
150 def _get_client(self):
151 import memcache
151 import memcache
152 client = memcache.Client([self.config.get('beaker.session.url')])
152 client = memcache.Client([self.config.get('beaker.session.url')])
153 return client
153 return client
154
154
155 def _get_telnet_client(self, host, port):
155 def _get_telnet_client(self, host, port):
156 import telnetlib
156 import telnetlib
157 client = telnetlib.Telnet(host, port, None)
157 client = telnetlib.Telnet(host, port, None)
158 return client
158 return client
159
159
160 def _run_telnet_cmd(self, client, cmd):
160 def _run_telnet_cmd(self, client, cmd):
161 client.write("%s\n" % cmd)
161 client.write("%s\n" % cmd)
162 return client.read_until('END')
162 return client.read_until('END')
163
163
164 def key_details(self, client, slab_ids, limit=100):
164 def key_details(self, client, slab_ids, limit=100):
165 """ Return a list of tuples containing keys and details """
165 """ Return a list of tuples containing keys and details """
166 cmd = 'stats cachedump %s %s'
166 cmd = 'stats cachedump %s %s'
167 for slab_id in slab_ids:
167 for slab_id in slab_ids:
168 for key in self._key_regex.finditer(
168 for key in self._key_regex.finditer(
169 self._run_telnet_cmd(client, cmd % (slab_id, limit))):
169 self._run_telnet_cmd(client, cmd % (slab_id, limit))):
170 yield key
170 yield key
171
171
172 def get_count(self):
172 def get_count(self):
173 client = self._get_client()
173 client = self._get_client()
174 count = self.NOT_AVAILABLE
174 count = self.NOT_AVAILABLE
175 try:
175 try:
176 slabs = []
176 slabs = []
177 for server, slabs_data in client.get_slabs():
177 for server, slabs_data in client.get_slabs():
178 slabs.extend(slabs_data.keys())
178 slabs.extend(slabs_data.keys())
179
179
180 host, port = client.servers[0].address
180 host, port = client.servers[0].address
181 telnet_client = self._get_telnet_client(host, port)
181 telnet_client = self._get_telnet_client(host, port)
182 keys = self.key_details(telnet_client, slabs)
182 keys = self.key_details(telnet_client, slabs)
183 count = 0
183 count = 0
184 for _k in keys:
184 for _k in keys:
185 count += 1
185 count += 1
186 except Exception:
186 except Exception:
187 return count
187 return count
188
188
189 return count
189 return count
190
190
191 def get_expired_count(self, older_than_seconds=None):
191 def get_expired_count(self, older_than_seconds=None):
192 return self.NOT_AVAILABLE
192 return self.NOT_AVAILABLE
193
193
194 def clean_sessions(self, older_than_seconds=None):
194 def clean_sessions(self, older_than_seconds=None):
195 raise CleanupCommand('Cleanup for this session type not yet available')
195 raise CleanupCommand('Cleanup for this session type not yet available')
196
196
197
197
198 class RedisAuthSessions(BaseAuthSessions):
199 SESSION_TYPE = 'ext:redis'
200
201 def _get_client(self):
202 import redis
203 args = {
204 'socket_timeout': 60,
205 'url': self.config.get('beaker.session.url')
206 }
207
208 client = redis.StrictRedis.from_url(**args)
209 return client
210
211 def get_count(self):
212 client = self._get_client()
213 return len(client.keys('beaker_cache:*'))
214
215 def get_expired_count(self, older_than_seconds=None):
216 expiry_date = self._seconds_to_date(older_than_seconds)
217 return self.NOT_AVAILABLE
218
219 def clean_sessions(self, older_than_seconds=None):
220 client = self._get_client()
221 expiry_time = time.time() - older_than_seconds
222 deleted_keys = 0
223 for key in client.keys('beaker_cache:*'):
224 data = client.get(key)
225 if data:
226 json_data = pickle.loads(data)
227 accessed_time = json_data['_accessed_time']
228 if accessed_time < expiry_time:
229 client.delete(key)
230 deleted_keys += 1
231
232 return deleted_keys
233
234
198 class MemoryAuthSessions(BaseAuthSessions):
235 class MemoryAuthSessions(BaseAuthSessions):
199 SESSION_TYPE = 'memory'
236 SESSION_TYPE = 'memory'
200
237
201 def get_count(self):
238 def get_count(self):
202 return self.NOT_AVAILABLE
239 return self.NOT_AVAILABLE
203
240
204 def get_expired_count(self, older_than_seconds=None):
241 def get_expired_count(self, older_than_seconds=None):
205 return self.NOT_AVAILABLE
242 return self.NOT_AVAILABLE
206
243
207 def clean_sessions(self, older_than_seconds=None):
244 def clean_sessions(self, older_than_seconds=None):
208 raise CleanupCommand('Cleanup for this session type not yet available')
245 raise CleanupCommand('Cleanup for this session type not yet available')
209
246
210
247
211 def get_session_handler(session_type):
248 def get_session_handler(session_type):
212 types = {
249 types = {
213 'file': FileAuthSessions,
250 'file': FileAuthSessions,
214 'ext:memcached': MemcachedAuthSessions,
251 'ext:memcached': MemcachedAuthSessions,
252 'ext:redis': RedisAuthSessions,
215 'ext:database': DbAuthSessions,
253 'ext:database': DbAuthSessions,
216 'memory': MemoryAuthSessions
254 'memory': MemoryAuthSessions
217 }
255 }
218
256
219 try:
257 try:
220 return types[session_type]
258 return types[session_type]
221 except KeyError:
259 except KeyError:
222 raise ValueError(
260 raise ValueError(
223 'This type {} is not supported'.format(session_type))
261 'This type {} is not supported'.format(session_type))
General Comments 0
You need to be logged in to leave comments. Login now