Show More
@@ -1,922 +1,923 b'' | |||||
1 | ## -*- coding: utf-8 -*- |
|
1 | ## -*- coding: utf-8 -*- | |
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 | ; These settings will be used by the RhodeCode mailing system |
|
13 | ; These settings will be used by the RhodeCode mailing system | |
14 | ; ######################################################################## |
|
14 | ; ######################################################################## | |
15 |
|
15 | |||
16 | ; prefix all emails subjects with given prefix, helps filtering out emails |
|
16 | ; prefix all emails subjects with given prefix, helps filtering out emails | |
17 | #email_prefix = [RhodeCode] |
|
17 | #email_prefix = [RhodeCode] | |
18 |
|
18 | |||
19 | ; email FROM address all mails will be sent |
|
19 | ; email FROM address all mails will be sent | |
20 | #app_email_from = rhodecode-noreply@localhost |
|
20 | #app_email_from = rhodecode-noreply@localhost | |
21 |
|
21 | |||
22 | #smtp_server = mail.server.com |
|
22 | #smtp_server = mail.server.com | |
23 | #smtp_username = |
|
23 | #smtp_username = | |
24 | #smtp_password = |
|
24 | #smtp_password = | |
25 | #smtp_port = |
|
25 | #smtp_port = | |
26 | #smtp_use_tls = false |
|
26 | #smtp_use_tls = false | |
27 | #smtp_use_ssl = true |
|
27 | #smtp_use_ssl = true | |
28 |
|
28 | |||
29 | [server:main] |
|
29 | [server:main] | |
30 | ; COMMON HOST/IP CONFIG |
|
30 | ; COMMON HOST/IP CONFIG | |
31 | host = 127.0.0.1 |
|
31 | host = 127.0.0.1 | |
32 | port = 5000 |
|
32 | port = 5000 | |
33 |
|
33 | |||
34 | ; ################################################## |
|
34 | ; ################################################## | |
35 | ; WAITRESS WSGI SERVER - Recommended for Development |
|
35 | ; WAITRESS WSGI SERVER - Recommended for Development | |
36 | ; ################################################## |
|
36 | ; ################################################## | |
37 |
|
37 | |||
38 | ; use server type |
|
38 | ; use server type | |
39 | use = egg:waitress#main |
|
39 | use = egg:waitress#main | |
40 |
|
40 | |||
41 | ; number of worker threads |
|
41 | ; number of worker threads | |
42 | threads = 5 |
|
42 | threads = 5 | |
43 |
|
43 | |||
44 | ; MAX BODY SIZE 100GB |
|
44 | ; MAX BODY SIZE 100GB | |
45 | max_request_body_size = 107374182400 |
|
45 | max_request_body_size = 107374182400 | |
46 |
|
46 | |||
47 | ; Use poll instead of select, fixes file descriptors limits problems. |
|
47 | ; Use poll instead of select, fixes file descriptors limits problems. | |
48 | ; May not work on old windows systems. |
|
48 | ; May not work on old windows systems. | |
49 | asyncore_use_poll = true |
|
49 | asyncore_use_poll = true | |
50 |
|
50 | |||
51 |
|
51 | |||
52 | ; ########################### |
|
52 | ; ########################### | |
53 | ; GUNICORN APPLICATION SERVER |
|
53 | ; GUNICORN APPLICATION SERVER | |
54 | ; ########################### |
|
54 | ; ########################### | |
55 |
|
55 | |||
56 | ; run with gunicorn --log-config rhodecode.ini --paste rhodecode.ini |
|
56 | ; run with gunicorn --log-config rhodecode.ini --paste rhodecode.ini | |
57 |
|
57 | |||
58 | ; Module to use, this setting shouldn't be changed |
|
58 | ; Module to use, this setting shouldn't be changed | |
59 | #use = egg:gunicorn#main |
|
59 | #use = egg:gunicorn#main | |
60 |
|
60 | |||
61 | ; Sets the number of process workers. More workers means more concurrent connections |
|
61 | ; Sets the number of process workers. More workers means more concurrent connections | |
62 | ; RhodeCode can handle at the same time. Each additional worker also it increases |
|
62 | ; RhodeCode can handle at the same time. Each additional worker also it increases | |
63 | ; memory usage as each has it's own set of caches. |
|
63 | ; memory usage as each has it's own set of caches. | |
64 | ; Recommended value is (2 * NUMBER_OF_CPUS + 1), eg 2CPU = 5 workers, but no more |
|
64 | ; Recommended value is (2 * NUMBER_OF_CPUS + 1), eg 2CPU = 5 workers, but no more | |
65 | ; than 8-10 unless for really big deployments .e.g 700-1000 users. |
|
65 | ; than 8-10 unless for really big deployments .e.g 700-1000 users. | |
66 | ; `instance_id = *` must be set in the [app:main] section below (which is the default) |
|
66 | ; `instance_id = *` must be set in the [app:main] section below (which is the default) | |
67 | ; when using more than 1 worker. |
|
67 | ; when using more than 1 worker. | |
68 | #workers = 2 |
|
68 | #workers = 2 | |
69 |
|
69 | |||
70 | ; Gunicorn access log level |
|
70 | ; Gunicorn access log level | |
71 | #loglevel = info |
|
71 | #loglevel = info | |
72 |
|
72 | |||
73 | ; Process name visible in process list |
|
73 | ; Process name visible in process list | |
74 | #proc_name = rhodecode |
|
74 | #proc_name = rhodecode | |
75 |
|
75 | |||
76 | ; Type of worker class, one of `sync`, `gevent` |
|
76 | ; Type of worker class, one of `sync`, `gevent` | |
77 | ; Recommended type is `gevent` |
|
77 | ; Recommended type is `gevent` | |
78 | #worker_class = gevent |
|
78 | #worker_class = gevent | |
79 |
|
79 | |||
80 | ; The maximum number of simultaneous clients. Valid only for gevent |
|
80 | ; The maximum number of simultaneous clients. Valid only for gevent | |
81 | #worker_connections = 10 |
|
81 | #worker_connections = 10 | |
82 |
|
82 | |||
83 | ; Max number of requests that worker will handle before being gracefully restarted. |
|
83 | ; Max number of requests that worker will handle before being gracefully restarted. | |
84 | ; Prevents memory leaks, jitter adds variability so not all workers are restarted at once. |
|
84 | ; Prevents memory leaks, jitter adds variability so not all workers are restarted at once. | |
85 | #max_requests = 1000 |
|
85 | #max_requests = 1000 | |
86 | #max_requests_jitter = 30 |
|
86 | #max_requests_jitter = 30 | |
87 |
|
87 | |||
88 | ; Amount of time a worker can spend with handling a request before it |
|
88 | ; Amount of time a worker can spend with handling a request before it | |
89 | ; gets killed and restarted. By default set to 21600 (6hrs) |
|
89 | ; gets killed and restarted. By default set to 21600 (6hrs) | |
90 | ; Examples: 1800 (30min), 3600 (1hr), 7200 (2hr), 43200 (12h) |
|
90 | ; Examples: 1800 (30min), 3600 (1hr), 7200 (2hr), 43200 (12h) | |
91 | #timeout = 21600 |
|
91 | #timeout = 21600 | |
92 |
|
92 | |||
93 | ; The maximum size of HTTP request line in bytes. |
|
93 | ; The maximum size of HTTP request line in bytes. | |
94 | ; 0 for unlimited |
|
94 | ; 0 for unlimited | |
95 | #limit_request_line = 0 |
|
95 | #limit_request_line = 0 | |
96 |
|
96 | |||
97 | ; Limit the number of HTTP headers fields in a request. |
|
97 | ; Limit the number of HTTP headers fields in a request. | |
98 | ; By default this value is 100 and can't be larger than 32768. |
|
98 | ; By default this value is 100 and can't be larger than 32768. | |
99 | #limit_request_fields = 32768 |
|
99 | #limit_request_fields = 32768 | |
100 |
|
100 | |||
101 | ; Limit the allowed size of an HTTP request header field. |
|
101 | ; Limit the allowed size of an HTTP request header field. | |
102 | ; Value is a positive number or 0. |
|
102 | ; Value is a positive number or 0. | |
103 | ; Setting it to 0 will allow unlimited header field sizes. |
|
103 | ; Setting it to 0 will allow unlimited header field sizes. | |
104 | #limit_request_field_size = 0 |
|
104 | #limit_request_field_size = 0 | |
105 |
|
105 | |||
106 | ; Timeout for graceful workers restart. |
|
106 | ; Timeout for graceful workers restart. | |
107 | ; After receiving a restart signal, workers have this much time to finish |
|
107 | ; After receiving a restart signal, workers have this much time to finish | |
108 | ; serving requests. Workers still alive after the timeout (starting from the |
|
108 | ; serving requests. Workers still alive after the timeout (starting from the | |
109 | ; receipt of the restart signal) are force killed. |
|
109 | ; receipt of the restart signal) are force killed. | |
110 | ; Examples: 1800 (30min), 3600 (1hr), 7200 (2hr), 43200 (12h) |
|
110 | ; Examples: 1800 (30min), 3600 (1hr), 7200 (2hr), 43200 (12h) | |
111 | #graceful_timeout = 3600 |
|
111 | #graceful_timeout = 3600 | |
112 |
|
112 | |||
113 | # The number of seconds to wait for requests on a Keep-Alive connection. |
|
113 | # The number of seconds to wait for requests on a Keep-Alive connection. | |
114 | # Generally set in the 1-5 seconds range. |
|
114 | # Generally set in the 1-5 seconds range. | |
115 | #keepalive = 2 |
|
115 | #keepalive = 2 | |
116 |
|
116 | |||
117 | ; Maximum memory usage that each worker can use before it will receive a |
|
117 | ; Maximum memory usage that each worker can use before it will receive a | |
118 | ; graceful restart signal 0 = memory monitoring is disabled |
|
118 | ; graceful restart signal 0 = memory monitoring is disabled | |
119 | ; Examples: 268435456 (256MB), 536870912 (512MB) |
|
119 | ; Examples: 268435456 (256MB), 536870912 (512MB) | |
120 | ; 1073741824 (1GB), 2147483648 (2GB), 4294967296 (4GB) |
|
120 | ; 1073741824 (1GB), 2147483648 (2GB), 4294967296 (4GB) | |
121 | #memory_max_usage = 0 |
|
121 | #memory_max_usage = 0 | |
122 |
|
122 | |||
123 | ; How often in seconds to check for memory usage for each gunicorn worker |
|
123 | ; How often in seconds to check for memory usage for each gunicorn worker | |
124 | #memory_usage_check_interval = 60 |
|
124 | #memory_usage_check_interval = 60 | |
125 |
|
125 | |||
126 | ; Threshold value for which we don't recycle worker if GarbageCollection |
|
126 | ; Threshold value for which we don't recycle worker if GarbageCollection | |
127 | ; frees up enough resources. Before each restart we try to run GC on worker |
|
127 | ; frees up enough resources. Before each restart we try to run GC on worker | |
128 | ; in case we get enough free memory after that, restart will not happen. |
|
128 | ; in case we get enough free memory after that, restart will not happen. | |
129 | #memory_usage_recovery_threshold = 0.8 |
|
129 | #memory_usage_recovery_threshold = 0.8 | |
130 |
|
130 | |||
131 |
|
131 | |||
132 | ; Prefix middleware for RhodeCode. |
|
132 | ; Prefix middleware for RhodeCode. | |
133 | ; recommended when using proxy setup. |
|
133 | ; recommended when using proxy setup. | |
134 | ; allows to set RhodeCode under a prefix in server. |
|
134 | ; allows to set RhodeCode under a prefix in server. | |
135 | ; eg https://server.com/custom_prefix. Enable `filter-with =` option below as well. |
|
135 | ; eg https://server.com/custom_prefix. Enable `filter-with =` option below as well. | |
136 | ; And set your prefix like: `prefix = /custom_prefix` |
|
136 | ; And set your prefix like: `prefix = /custom_prefix` | |
137 | ; be sure to also set beaker.session.cookie_path = /custom_prefix if you need |
|
137 | ; be sure to also set beaker.session.cookie_path = /custom_prefix if you need | |
138 | ; to make your cookies only work on prefix url |
|
138 | ; to make your cookies only work on prefix url | |
139 | [filter:proxy-prefix] |
|
139 | [filter:proxy-prefix] | |
140 | use = egg:PasteDeploy#prefix |
|
140 | use = egg:PasteDeploy#prefix | |
141 | prefix = / |
|
141 | prefix = / | |
142 |
|
142 | |||
143 | [app:main] |
|
143 | [app:main] | |
144 | ; The %(here)s variable will be replaced with the absolute path of parent directory |
|
144 | ; The %(here)s variable will be replaced with the absolute path of parent directory | |
145 | ; of this file |
|
145 | ; of this file | |
146 | ; Each option in the app:main can be override by an environmental variable |
|
146 | ; Each option in the app:main can be override by an environmental variable | |
147 | ; |
|
147 | ; | |
148 | ;To override an option: |
|
148 | ;To override an option: | |
149 | ; |
|
149 | ; | |
150 | ;RC_<KeyName> |
|
150 | ;RC_<KeyName> | |
151 | ;Everything should be uppercase, . and - should be replaced by _. |
|
151 | ;Everything should be uppercase, . and - should be replaced by _. | |
152 | ;For example, if you have these configuration settings: |
|
152 | ;For example, if you have these configuration settings: | |
153 | ;rc_cache.repo_object.backend = foo |
|
153 | ;rc_cache.repo_object.backend = foo | |
154 | ;can be overridden by |
|
154 | ;can be overridden by | |
155 | ;export RC_CACHE_REPO_OBJECT_BACKEND=foo |
|
155 | ;export RC_CACHE_REPO_OBJECT_BACKEND=foo | |
156 |
|
156 | |||
157 | use = egg:rhodecode-enterprise-ce |
|
157 | use = egg:rhodecode-enterprise-ce | |
158 |
|
158 | |||
159 | ; enable proxy prefix middleware, defined above |
|
159 | ; enable proxy prefix middleware, defined above | |
160 | #filter-with = proxy-prefix |
|
160 | #filter-with = proxy-prefix | |
161 |
|
161 | |||
162 | ; ############# |
|
162 | ; ############# | |
163 | ; DEBUG OPTIONS |
|
163 | ; DEBUG OPTIONS | |
164 | ; ############# |
|
164 | ; ############# | |
165 |
|
165 | |||
166 | pyramid.reload_templates = true |
|
166 | pyramid.reload_templates = true | |
167 |
|
167 | |||
168 | # During development the we want to have the debug toolbar enabled |
|
168 | # During development the we want to have the debug toolbar enabled | |
169 | pyramid.includes = |
|
169 | pyramid.includes = | |
170 | pyramid_debugtoolbar |
|
170 | pyramid_debugtoolbar | |
171 |
|
171 | |||
172 | debugtoolbar.hosts = 0.0.0.0/0 |
|
172 | debugtoolbar.hosts = 0.0.0.0/0 | |
173 | debugtoolbar.exclude_prefixes = |
|
173 | debugtoolbar.exclude_prefixes = | |
174 | /css |
|
174 | /css | |
175 | /fonts |
|
175 | /fonts | |
176 | /images |
|
176 | /images | |
177 | /js |
|
177 | /js | |
178 |
|
178 | |||
179 | ## RHODECODE PLUGINS ## |
|
179 | ## RHODECODE PLUGINS ## | |
180 | rhodecode.includes = |
|
180 | rhodecode.includes = | |
181 | rhodecode.api |
|
181 | rhodecode.api | |
182 |
|
182 | |||
183 |
|
183 | |||
184 | # api prefix url |
|
184 | # api prefix url | |
185 | rhodecode.api.url = /_admin/api |
|
185 | rhodecode.api.url = /_admin/api | |
186 |
|
186 | |||
187 | ; enable debug style page |
|
187 | ; enable debug style page | |
188 | debug_style = true |
|
188 | debug_style = true | |
189 |
|
189 | |||
190 | ; ################# |
|
190 | ; ################# | |
191 | ; END DEBUG OPTIONS |
|
191 | ; END DEBUG OPTIONS | |
192 | ; ################# |
|
192 | ; ################# | |
193 |
|
193 | |||
194 | ; encryption key used to encrypt social plugin tokens, |
|
194 | ; encryption key used to encrypt social plugin tokens, | |
195 | ; remote_urls with credentials etc, if not set it defaults to |
|
195 | ; remote_urls with credentials etc, if not set it defaults to | |
196 | ; `beaker.session.secret` |
|
196 | ; `beaker.session.secret` | |
197 | #rhodecode.encrypted_values.secret = |
|
197 | #rhodecode.encrypted_values.secret = | |
198 |
|
198 | |||
199 | ; decryption strict mode (enabled by default). It controls if decryption raises |
|
199 | ; decryption strict mode (enabled by default). It controls if decryption raises | |
200 | ; `SignatureVerificationError` in case of wrong key, or damaged encryption data. |
|
200 | ; `SignatureVerificationError` in case of wrong key, or damaged encryption data. | |
201 | #rhodecode.encrypted_values.strict = false |
|
201 | #rhodecode.encrypted_values.strict = false | |
202 |
|
202 | |||
203 | ; Pick algorithm for encryption. Either fernet (more secure) or aes (default) |
|
203 | ; Pick algorithm for encryption. Either fernet (more secure) or aes (default) | |
204 | ; fernet is safer, and we strongly recommend switching to it. |
|
204 | ; fernet is safer, and we strongly recommend switching to it. | |
205 | ; Due to backward compatibility aes is used as default. |
|
205 | ; Due to backward compatibility aes is used as default. | |
206 | #rhodecode.encrypted_values.algorithm = fernet |
|
206 | #rhodecode.encrypted_values.algorithm = fernet | |
207 |
|
207 | |||
208 | ; Return gzipped responses from RhodeCode (static files/application) |
|
208 | ; Return gzipped responses from RhodeCode (static files/application) | |
209 | gzip_responses = false |
|
209 | gzip_responses = false | |
210 |
|
210 | |||
211 | ; Auto-generate javascript routes file on startup |
|
211 | ; Auto-generate javascript routes file on startup | |
212 | generate_js_files = false |
|
212 | generate_js_files = false | |
213 |
|
213 | |||
214 | ; System global default language. |
|
214 | ; System global default language. | |
215 | ; All available languages: en (default), be, de, es, fr, it, ja, pl, pt, ru, zh |
|
215 | ; All available languages: en (default), be, de, es, fr, it, ja, pl, pt, ru, zh | |
216 | lang = en |
|
216 | lang = en | |
217 |
|
217 | |||
218 | ; Perform a full repository scan and import on each server start. |
|
218 | ; Perform a full repository scan and import on each server start. | |
219 | ; Settings this to true could lead to very long startup time. |
|
219 | ; Settings this to true could lead to very long startup time. | |
220 | startup.import_repos = false |
|
220 | startup.import_repos = false | |
221 |
|
221 | |||
222 | ; Uncomment and set this path to use archive download cache. |
|
222 | ; Uncomment and set this path to use archive download cache. | |
223 | ; Once enabled, generated archives will be cached at this location |
|
223 | ; Once enabled, generated archives will be cached at this location | |
224 | ; and served from the cache during subsequent requests for the same archive of |
|
224 | ; and served from the cache during subsequent requests for the same archive of | |
225 | ; the repository. |
|
225 | ; the repository. | |
226 | #archive_cache_dir = /tmp/tarballcache |
|
226 | #archive_cache_dir = /tmp/tarballcache | |
227 |
|
227 | |||
228 | ; URL at which the application is running. This is used for Bootstrapping |
|
228 | ; URL at which the application is running. This is used for Bootstrapping | |
229 | ; requests in context when no web request is available. Used in ishell, or |
|
229 | ; requests in context when no web request is available. Used in ishell, or | |
230 | ; SSH calls. Set this for events to receive proper url for SSH calls. |
|
230 | ; SSH calls. Set this for events to receive proper url for SSH calls. | |
231 | app.base_url = http://rhodecode.local |
|
231 | app.base_url = http://rhodecode.local | |
232 |
|
232 | |||
233 | ; Unique application ID. Should be a random unique string for security. |
|
233 | ; Unique application ID. Should be a random unique string for security. | |
234 | app_instance_uuid = rc-production |
|
234 | app_instance_uuid = rc-production | |
235 |
|
235 | |||
236 | ; Cut off limit for large diffs (size in bytes). If overall diff size on |
|
236 | ; Cut off limit for large diffs (size in bytes). If overall diff size on | |
237 | ; commit, or pull request exceeds this limit this diff will be displayed |
|
237 | ; commit, or pull request exceeds this limit this diff will be displayed | |
238 | ; partially. E.g 512000 == 512Kb |
|
238 | ; partially. E.g 512000 == 512Kb | |
239 | cut_off_limit_diff = 512000 |
|
239 | cut_off_limit_diff = 512000 | |
240 |
|
240 | |||
241 | ; Cut off limit for large files inside diffs (size in bytes). Each individual |
|
241 | ; Cut off limit for large files inside diffs (size in bytes). Each individual | |
242 | ; file inside diff which exceeds this limit will be displayed partially. |
|
242 | ; file inside diff which exceeds this limit will be displayed partially. | |
243 | ; E.g 128000 == 128Kb |
|
243 | ; E.g 128000 == 128Kb | |
244 | cut_off_limit_file = 128000 |
|
244 | cut_off_limit_file = 128000 | |
245 |
|
245 | |||
246 | ; Use cached version of vcs repositories everywhere. Recommended to be `true` |
|
246 | ; Use cached version of vcs repositories everywhere. Recommended to be `true` | |
247 | vcs_full_cache = true |
|
247 | vcs_full_cache = true | |
248 |
|
248 | |||
249 | ; Force https in RhodeCode, fixes https redirects, assumes it's always https. |
|
249 | ; Force https in RhodeCode, fixes https redirects, assumes it's always https. | |
250 | ; Normally this is controlled by proper flags sent from http server such as Nginx or Apache |
|
250 | ; Normally this is controlled by proper flags sent from http server such as Nginx or Apache | |
251 | force_https = false |
|
251 | force_https = false | |
252 |
|
252 | |||
253 | ; use Strict-Transport-Security headers |
|
253 | ; use Strict-Transport-Security headers | |
254 | use_htsts = false |
|
254 | use_htsts = false | |
255 |
|
255 | |||
256 | ; Set to true if your repos are exposed using the dumb protocol |
|
256 | ; Set to true if your repos are exposed using the dumb protocol | |
257 | git_update_server_info = false |
|
257 | git_update_server_info = false | |
258 |
|
258 | |||
259 | ; RSS/ATOM feed options |
|
259 | ; RSS/ATOM feed options | |
260 | rss_cut_off_limit = 256000 |
|
260 | rss_cut_off_limit = 256000 | |
261 | rss_items_per_page = 10 |
|
261 | rss_items_per_page = 10 | |
262 | rss_include_diff = false |
|
262 | rss_include_diff = false | |
263 |
|
263 | |||
264 | ; gist URL alias, used to create nicer urls for gist. This should be an |
|
264 | ; gist URL alias, used to create nicer urls for gist. This should be an | |
265 | ; url that does rewrites to _admin/gists/{gistid}. |
|
265 | ; url that does rewrites to _admin/gists/{gistid}. | |
266 | ; example: http://gist.rhodecode.org/{gistid}. Empty means use the internal |
|
266 | ; example: http://gist.rhodecode.org/{gistid}. Empty means use the internal | |
267 | ; RhodeCode url, ie. http[s]://rhodecode.server/_admin/gists/{gistid} |
|
267 | ; RhodeCode url, ie. http[s]://rhodecode.server/_admin/gists/{gistid} | |
268 | gist_alias_url = |
|
268 | gist_alias_url = | |
269 |
|
269 | |||
270 | ; List of views (using glob pattern syntax) that AUTH TOKENS could be |
|
270 | ; List of views (using glob pattern syntax) that AUTH TOKENS could be | |
271 | ; used for access. |
|
271 | ; used for access. | |
272 | ; Adding ?auth_token=TOKEN_HASH to the url authenticates this request as if it |
|
272 | ; Adding ?auth_token=TOKEN_HASH to the url authenticates this request as if it | |
273 | ; came from the the logged in user who own this authentication token. |
|
273 | ; came from the the logged in user who own this authentication token. | |
274 | ; Additionally @TOKEN syntax can be used to bound the view to specific |
|
274 | ; Additionally @TOKEN syntax can be used to bound the view to specific | |
275 | ; authentication token. Such view would be only accessible when used together |
|
275 | ; authentication token. Such view would be only accessible when used together | |
276 | ; with this authentication token |
|
276 | ; with this authentication token | |
277 | ; list of all views can be found under `/_admin/permissions/auth_token_access` |
|
277 | ; list of all views can be found under `/_admin/permissions/auth_token_access` | |
278 | ; The list should be "," separated and on a single line. |
|
278 | ; The list should be "," separated and on a single line. | |
279 | ; Most common views to enable: |
|
279 | ; Most common views to enable: | |
280 |
|
280 | |||
281 | # RepoCommitsView:repo_commit_download |
|
281 | # RepoCommitsView:repo_commit_download | |
282 | # RepoCommitsView:repo_commit_patch |
|
282 | # RepoCommitsView:repo_commit_patch | |
283 | # RepoCommitsView:repo_commit_raw |
|
283 | # RepoCommitsView:repo_commit_raw | |
284 | # RepoCommitsView:repo_commit_raw@TOKEN |
|
284 | # RepoCommitsView:repo_commit_raw@TOKEN | |
285 | # RepoFilesView:repo_files_diff |
|
285 | # RepoFilesView:repo_files_diff | |
286 | # RepoFilesView:repo_archivefile |
|
286 | # RepoFilesView:repo_archivefile | |
287 | # RepoFilesView:repo_file_raw |
|
287 | # RepoFilesView:repo_file_raw | |
288 | # GistView:* |
|
288 | # GistView:* | |
289 | api_access_controllers_whitelist = |
|
289 | api_access_controllers_whitelist = | |
290 |
|
290 | |||
291 | ; Default encoding used to convert from and to unicode |
|
291 | ; Default encoding used to convert from and to unicode | |
292 | ; can be also a comma separated list of encoding in case of mixed encodings |
|
292 | ; can be also a comma separated list of encoding in case of mixed encodings | |
293 | default_encoding = UTF-8 |
|
293 | default_encoding = UTF-8 | |
294 |
|
294 | |||
295 | ; instance-id prefix |
|
295 | ; instance-id prefix | |
296 | ; a prefix key for this instance used for cache invalidation when running |
|
296 | ; a prefix key for this instance used for cache invalidation when running | |
297 | ; multiple instances of RhodeCode, make sure it's globally unique for |
|
297 | ; multiple instances of RhodeCode, make sure it's globally unique for | |
298 | ; all running RhodeCode instances. Leave empty if you don't use it |
|
298 | ; all running RhodeCode instances. Leave empty if you don't use it | |
299 | instance_id = |
|
299 | instance_id = | |
300 |
|
300 | |||
301 | ; Fallback authentication plugin. Set this to a plugin ID to force the usage |
|
301 | ; Fallback authentication plugin. Set this to a plugin ID to force the usage | |
302 | ; of an authentication plugin also if it is disabled by it's settings. |
|
302 | ; of an authentication plugin also if it is disabled by it's settings. | |
303 | ; This could be useful if you are unable to log in to the system due to broken |
|
303 | ; This could be useful if you are unable to log in to the system due to broken | |
304 | ; authentication settings. Then you can enable e.g. the internal RhodeCode auth |
|
304 | ; authentication settings. Then you can enable e.g. the internal RhodeCode auth | |
305 | ; module to log in again and fix the settings. |
|
305 | ; module to log in again and fix the settings. | |
306 | ; Available builtin plugin IDs (hash is part of the ID): |
|
306 | ; Available builtin plugin IDs (hash is part of the ID): | |
307 | ; egg:rhodecode-enterprise-ce#rhodecode |
|
307 | ; egg:rhodecode-enterprise-ce#rhodecode | |
308 | ; egg:rhodecode-enterprise-ce#pam |
|
308 | ; egg:rhodecode-enterprise-ce#pam | |
309 | ; egg:rhodecode-enterprise-ce#ldap |
|
309 | ; egg:rhodecode-enterprise-ce#ldap | |
310 | ; egg:rhodecode-enterprise-ce#jasig_cas |
|
310 | ; egg:rhodecode-enterprise-ce#jasig_cas | |
311 | ; egg:rhodecode-enterprise-ce#headers |
|
311 | ; egg:rhodecode-enterprise-ce#headers | |
312 | ; egg:rhodecode-enterprise-ce#crowd |
|
312 | ; egg:rhodecode-enterprise-ce#crowd | |
313 |
|
313 | |||
314 | #rhodecode.auth_plugin_fallback = egg:rhodecode-enterprise-ce#rhodecode |
|
314 | #rhodecode.auth_plugin_fallback = egg:rhodecode-enterprise-ce#rhodecode | |
315 |
|
315 | |||
316 | ; Flag to control loading of legacy plugins in py:/path format |
|
316 | ; Flag to control loading of legacy plugins in py:/path format | |
317 | auth_plugin.import_legacy_plugins = true |
|
317 | auth_plugin.import_legacy_plugins = true | |
318 |
|
318 | |||
319 | ; alternative return HTTP header for failed authentication. Default HTTP |
|
319 | ; alternative return HTTP header for failed authentication. Default HTTP | |
320 | ; response is 401 HTTPUnauthorized. Currently HG clients have troubles with |
|
320 | ; response is 401 HTTPUnauthorized. Currently HG clients have troubles with | |
321 | ; handling that causing a series of failed authentication calls. |
|
321 | ; handling that causing a series of failed authentication calls. | |
322 | ; Set this variable to 403 to return HTTPForbidden, or any other HTTP code |
|
322 | ; Set this variable to 403 to return HTTPForbidden, or any other HTTP code | |
323 | ; This will be served instead of default 401 on bad authentication |
|
323 | ; This will be served instead of default 401 on bad authentication | |
324 | auth_ret_code = |
|
324 | auth_ret_code = | |
325 |
|
325 | |||
326 | ; use special detection method when serving auth_ret_code, instead of serving |
|
326 | ; use special detection method when serving auth_ret_code, instead of serving | |
327 | ; ret_code directly, use 401 initially (Which triggers credentials prompt) |
|
327 | ; ret_code directly, use 401 initially (Which triggers credentials prompt) | |
328 | ; and then serve auth_ret_code to clients |
|
328 | ; and then serve auth_ret_code to clients | |
329 | auth_ret_code_detection = false |
|
329 | auth_ret_code_detection = false | |
330 |
|
330 | |||
331 | ; locking return code. When repository is locked return this HTTP code. 2XX |
|
331 | ; locking return code. When repository is locked return this HTTP code. 2XX | |
332 | ; codes don't break the transactions while 4XX codes do |
|
332 | ; codes don't break the transactions while 4XX codes do | |
333 | lock_ret_code = 423 |
|
333 | lock_ret_code = 423 | |
334 |
|
334 | |||
335 | ; allows to change the repository location in settings page |
|
335 | ; allows to change the repository location in settings page | |
336 | allow_repo_location_change = true |
|
336 | allow_repo_location_change = true | |
337 |
|
337 | |||
338 | ; allows to setup custom hooks in settings page |
|
338 | ; allows to setup custom hooks in settings page | |
339 | allow_custom_hooks_settings = true |
|
339 | allow_custom_hooks_settings = true | |
340 |
|
340 | |||
341 | ; Generated license token required for EE edition license. |
|
341 | ; Generated license token required for EE edition license. | |
342 | ; New generated token value can be found in Admin > settings > license page. |
|
342 | ; New generated token value can be found in Admin > settings > license page. | |
343 | license_token = |
|
343 | license_token = | |
344 |
|
344 | |||
345 | ; This flag hides sensitive information on the license page such as token, and license data |
|
345 | ; This flag hides sensitive information on the license page such as token, and license data | |
346 | license.hide_license_info = false |
|
346 | license.hide_license_info = false | |
347 |
|
347 | |||
348 | ; supervisor connection uri, for managing supervisor and logs. |
|
348 | ; supervisor connection uri, for managing supervisor and logs. | |
349 | supervisor.uri = |
|
349 | supervisor.uri = | |
350 |
|
350 | |||
351 | ; supervisord group name/id we only want this RC instance to handle |
|
351 | ; supervisord group name/id we only want this RC instance to handle | |
352 | supervisor.group_id = dev |
|
352 | supervisor.group_id = dev | |
353 |
|
353 | |||
354 | ; Display extended labs settings |
|
354 | ; Display extended labs settings | |
355 | labs_settings_active = true |
|
355 | labs_settings_active = true | |
356 |
|
356 | |||
357 | ; Custom exception store path, defaults to TMPDIR |
|
357 | ; Custom exception store path, defaults to TMPDIR | |
358 | ; This is used to store exception from RhodeCode in shared directory |
|
358 | ; This is used to store exception from RhodeCode in shared directory | |
359 | #exception_tracker.store_path = |
|
359 | #exception_tracker.store_path = | |
360 |
|
360 | |||
361 | ; Send email with exception details when it happens |
|
361 | ; Send email with exception details when it happens | |
362 | #exception_tracker.send_email = false |
|
362 | #exception_tracker.send_email = false | |
363 |
|
363 | |||
364 | ; Comma separated list of recipients for exception emails, |
|
364 | ; Comma separated list of recipients for exception emails, | |
365 | ; e.g admin@rhodecode.com,devops@rhodecode.com |
|
365 | ; e.g admin@rhodecode.com,devops@rhodecode.com | |
366 | ; Can be left empty, then emails will be sent to ALL super-admins |
|
366 | ; Can be left empty, then emails will be sent to ALL super-admins | |
367 | #exception_tracker.send_email_recipients = |
|
367 | #exception_tracker.send_email_recipients = | |
368 |
|
368 | |||
369 | ; optional prefix to Add to email Subject |
|
369 | ; optional prefix to Add to email Subject | |
370 | #exception_tracker.email_prefix = [RHODECODE ERROR] |
|
370 | #exception_tracker.email_prefix = [RHODECODE ERROR] | |
371 |
|
371 | |||
372 | ; File store configuration. This is used to store and serve uploaded files |
|
372 | ; File store configuration. This is used to store and serve uploaded files | |
373 | file_store.enabled = true |
|
373 | file_store.enabled = true | |
374 |
|
374 | |||
375 | ; Storage backend, available options are: local |
|
375 | ; Storage backend, available options are: local | |
376 | file_store.backend = local |
|
376 | file_store.backend = local | |
377 |
|
377 | |||
378 | ; path to store the uploaded binaries |
|
378 | ; path to store the uploaded binaries | |
379 | file_store.storage_path = %(here)s/data/file_store |
|
379 | file_store.storage_path = %(here)s/data/file_store | |
380 |
|
380 | |||
381 |
|
381 | |||
382 | ; ############# |
|
382 | ; ############# | |
383 | ; CELERY CONFIG |
|
383 | ; CELERY CONFIG | |
384 | ; ############# |
|
384 | ; ############# | |
385 |
|
385 | |||
386 | ; manually run celery: /path/to/celery worker -E --beat --app rhodecode.lib.celerylib.loader --scheduler rhodecode.lib.celerylib.scheduler.RcScheduler --loglevel DEBUG --ini /path/to/rhodecode.ini |
|
386 | ; manually run celery: /path/to/celery worker -E --beat --app rhodecode.lib.celerylib.loader --scheduler rhodecode.lib.celerylib.scheduler.RcScheduler --loglevel DEBUG --ini /path/to/rhodecode.ini | |
387 |
|
387 | |||
388 | use_celery = false |
|
388 | use_celery = false | |
389 |
|
389 | |||
390 | ; path to store schedule database |
|
390 | ; path to store schedule database | |
391 | #celerybeat-schedule.path = |
|
391 | #celerybeat-schedule.path = | |
392 |
|
392 | |||
393 | ; connection url to the message broker (default redis) |
|
393 | ; connection url to the message broker (default redis) | |
394 | celery.broker_url = redis://localhost:6379/8 |
|
394 | celery.broker_url = redis://localhost:6379/8 | |
395 |
|
395 | |||
396 | ; rabbitmq example |
|
396 | ; rabbitmq example | |
397 | #celery.broker_url = amqp://rabbitmq:qweqwe@localhost:5672/rabbitmqhost |
|
397 | #celery.broker_url = amqp://rabbitmq:qweqwe@localhost:5672/rabbitmqhost | |
398 |
|
398 | |||
399 | ; maximum tasks to execute before worker restart |
|
399 | ; maximum tasks to execute before worker restart | |
400 | celery.max_tasks_per_child = 100 |
|
400 | celery.max_tasks_per_child = 100 | |
401 |
|
401 | |||
402 | ; tasks will never be sent to the queue, but executed locally instead. |
|
402 | ; tasks will never be sent to the queue, but executed locally instead. | |
403 | celery.task_always_eager = false |
|
403 | celery.task_always_eager = false | |
404 |
|
404 | |||
405 | ; ############# |
|
405 | ; ############# | |
406 | ; DOGPILE CACHE |
|
406 | ; DOGPILE CACHE | |
407 | ; ############# |
|
407 | ; ############# | |
408 |
|
408 | |||
409 | ; Default cache dir for caches. Putting this into a ramdisk can boost performance. |
|
409 | ; Default cache dir for caches. Putting this into a ramdisk can boost performance. | |
410 | ; eg. /tmpfs/data_ramdisk, however this directory might require large amount of space |
|
410 | ; eg. /tmpfs/data_ramdisk, however this directory might require large amount of space | |
411 | cache_dir = %(here)s/data |
|
411 | cache_dir = %(here)s/data | |
412 |
|
412 | |||
413 | ; ********************************************* |
|
413 | ; ********************************************* | |
414 | ; `sql_cache_short` cache for heavy SQL queries |
|
414 | ; `sql_cache_short` cache for heavy SQL queries | |
415 | ; Only supported backend is `memory_lru` |
|
415 | ; Only supported backend is `memory_lru` | |
416 | ; ********************************************* |
|
416 | ; ********************************************* | |
417 | rc_cache.sql_cache_short.backend = dogpile.cache.rc.memory_lru |
|
417 | rc_cache.sql_cache_short.backend = dogpile.cache.rc.memory_lru | |
418 | rc_cache.sql_cache_short.expiration_time = 30 |
|
418 | rc_cache.sql_cache_short.expiration_time = 30 | |
419 |
|
419 | |||
420 |
|
420 | |||
421 | ; ***************************************************** |
|
421 | ; ***************************************************** | |
422 | ; `cache_repo_longterm` cache for repo object instances |
|
422 | ; `cache_repo_longterm` cache for repo object instances | |
423 | ; Only supported backend is `memory_lru` |
|
423 | ; Only supported backend is `memory_lru` | |
424 | ; ***************************************************** |
|
424 | ; ***************************************************** | |
425 | rc_cache.cache_repo_longterm.backend = dogpile.cache.rc.memory_lru |
|
425 | rc_cache.cache_repo_longterm.backend = dogpile.cache.rc.memory_lru | |
426 | ; by default we use 30 Days, cache is still invalidated on push |
|
426 | ; by default we use 30 Days, cache is still invalidated on push | |
427 | rc_cache.cache_repo_longterm.expiration_time = 2592000 |
|
427 | rc_cache.cache_repo_longterm.expiration_time = 2592000 | |
428 | ; max items in LRU cache, set to smaller number to save memory, and expire last used caches |
|
428 | ; max items in LRU cache, set to smaller number to save memory, and expire last used caches | |
429 | rc_cache.cache_repo_longterm.max_size = 10000 |
|
429 | rc_cache.cache_repo_longterm.max_size = 10000 | |
430 |
|
430 | |||
431 |
|
431 | |||
432 | ; ********************************************* |
|
432 | ; ********************************************* | |
433 | ; `cache_general` cache for general purpose use |
|
433 | ; `cache_general` cache for general purpose use | |
434 | ; for simplicity use rc.file_namespace backend, |
|
434 | ; for simplicity use rc.file_namespace backend, | |
435 | ; for performance and scale use rc.redis |
|
435 | ; for performance and scale use rc.redis | |
436 | ; ********************************************* |
|
436 | ; ********************************************* | |
437 | rc_cache.cache_general.backend = dogpile.cache.rc.file_namespace |
|
437 | rc_cache.cache_general.backend = dogpile.cache.rc.file_namespace | |
438 | rc_cache.cache_general.expiration_time = 43200 |
|
438 | rc_cache.cache_general.expiration_time = 43200 | |
439 | ; file cache store path. Defaults to `cache_dir =` value or tempdir if both values are not set |
|
439 | ; file cache store path. Defaults to `cache_dir =` value or tempdir if both values are not set | |
440 | #rc_cache.cache_general.arguments.filename = /tmp/cache_general.db |
|
440 | #rc_cache.cache_general.arguments.filename = /tmp/cache_general.db | |
441 |
|
441 | |||
442 | ; alternative `cache_general` redis backend with distributed lock |
|
442 | ; alternative `cache_general` redis backend with distributed lock | |
443 | #rc_cache.cache_general.backend = dogpile.cache.rc.redis |
|
443 | #rc_cache.cache_general.backend = dogpile.cache.rc.redis | |
444 | #rc_cache.cache_general.expiration_time = 300 |
|
444 | #rc_cache.cache_general.expiration_time = 300 | |
445 |
|
445 | |||
446 | ; redis_expiration_time needs to be greater then expiration_time |
|
446 | ; redis_expiration_time needs to be greater then expiration_time | |
447 | #rc_cache.cache_general.arguments.redis_expiration_time = 7200 |
|
447 | #rc_cache.cache_general.arguments.redis_expiration_time = 7200 | |
448 |
|
448 | |||
449 | #rc_cache.cache_general.arguments.host = localhost |
|
449 | #rc_cache.cache_general.arguments.host = localhost | |
450 | #rc_cache.cache_general.arguments.port = 6379 |
|
450 | #rc_cache.cache_general.arguments.port = 6379 | |
451 | #rc_cache.cache_general.arguments.db = 0 |
|
451 | #rc_cache.cache_general.arguments.db = 0 | |
452 | #rc_cache.cache_general.arguments.socket_timeout = 30 |
|
452 | #rc_cache.cache_general.arguments.socket_timeout = 30 | |
453 | ; more Redis options: https://dogpilecache.sqlalchemy.org/en/latest/api.html#redis-backends |
|
453 | ; more Redis options: https://dogpilecache.sqlalchemy.org/en/latest/api.html#redis-backends | |
454 | #rc_cache.cache_general.arguments.distributed_lock = true |
|
454 | #rc_cache.cache_general.arguments.distributed_lock = true | |
455 |
|
455 | |||
456 | ; auto-renew lock to prevent stale locks, slower but safer. Use only if problems happen |
|
456 | ; auto-renew lock to prevent stale locks, slower but safer. Use only if problems happen | |
457 | #rc_cache.cache_general.arguments.lock_auto_renewal = true |
|
457 | #rc_cache.cache_general.arguments.lock_auto_renewal = true | |
458 |
|
458 | |||
459 | ; ************************************************* |
|
459 | ; ************************************************* | |
460 | ; `cache_perms` cache for permission tree, auth TTL |
|
460 | ; `cache_perms` cache for permission tree, auth TTL | |
461 | ; for simplicity use rc.file_namespace backend, |
|
461 | ; for simplicity use rc.file_namespace backend, | |
462 | ; for performance and scale use rc.redis |
|
462 | ; for performance and scale use rc.redis | |
463 | ; ************************************************* |
|
463 | ; ************************************************* | |
464 | rc_cache.cache_perms.backend = dogpile.cache.rc.file_namespace |
|
464 | rc_cache.cache_perms.backend = dogpile.cache.rc.file_namespace | |
465 | rc_cache.cache_perms.expiration_time = 3600 |
|
465 | rc_cache.cache_perms.expiration_time = 3600 | |
466 | ; file cache store path. Defaults to `cache_dir =` value or tempdir if both values are not set |
|
466 | ; file cache store path. Defaults to `cache_dir =` value or tempdir if both values are not set | |
467 | #rc_cache.cache_perms.arguments.filename = /tmp/cache_perms.db |
|
467 | #rc_cache.cache_perms.arguments.filename = /tmp/cache_perms.db | |
468 |
|
468 | |||
469 | ; alternative `cache_perms` redis backend with distributed lock |
|
469 | ; alternative `cache_perms` redis backend with distributed lock | |
470 | #rc_cache.cache_perms.backend = dogpile.cache.rc.redis |
|
470 | #rc_cache.cache_perms.backend = dogpile.cache.rc.redis | |
471 | #rc_cache.cache_perms.expiration_time = 300 |
|
471 | #rc_cache.cache_perms.expiration_time = 300 | |
472 |
|
472 | |||
473 | ; redis_expiration_time needs to be greater then expiration_time |
|
473 | ; redis_expiration_time needs to be greater then expiration_time | |
474 | #rc_cache.cache_perms.arguments.redis_expiration_time = 7200 |
|
474 | #rc_cache.cache_perms.arguments.redis_expiration_time = 7200 | |
475 |
|
475 | |||
476 | #rc_cache.cache_perms.arguments.host = localhost |
|
476 | #rc_cache.cache_perms.arguments.host = localhost | |
477 | #rc_cache.cache_perms.arguments.port = 6379 |
|
477 | #rc_cache.cache_perms.arguments.port = 6379 | |
478 | #rc_cache.cache_perms.arguments.db = 0 |
|
478 | #rc_cache.cache_perms.arguments.db = 0 | |
479 | #rc_cache.cache_perms.arguments.socket_timeout = 30 |
|
479 | #rc_cache.cache_perms.arguments.socket_timeout = 30 | |
480 | ; more Redis options: https://dogpilecache.sqlalchemy.org/en/latest/api.html#redis-backends |
|
480 | ; more Redis options: https://dogpilecache.sqlalchemy.org/en/latest/api.html#redis-backends | |
481 | #rc_cache.cache_perms.arguments.distributed_lock = true |
|
481 | #rc_cache.cache_perms.arguments.distributed_lock = true | |
482 |
|
482 | |||
483 | ; auto-renew lock to prevent stale locks, slower but safer. Use only if problems happen |
|
483 | ; auto-renew lock to prevent stale locks, slower but safer. Use only if problems happen | |
484 | #rc_cache.cache_perms.arguments.lock_auto_renewal = true |
|
484 | #rc_cache.cache_perms.arguments.lock_auto_renewal = true | |
485 |
|
485 | |||
486 | ; *************************************************** |
|
486 | ; *************************************************** | |
487 | ; `cache_repo` cache for file tree, Readme, RSS FEEDS |
|
487 | ; `cache_repo` cache for file tree, Readme, RSS FEEDS | |
488 | ; for simplicity use rc.file_namespace backend, |
|
488 | ; for simplicity use rc.file_namespace backend, | |
489 | ; for performance and scale use rc.redis |
|
489 | ; for performance and scale use rc.redis | |
490 | ; *************************************************** |
|
490 | ; *************************************************** | |
491 | rc_cache.cache_repo.backend = dogpile.cache.rc.file_namespace |
|
491 | rc_cache.cache_repo.backend = dogpile.cache.rc.file_namespace | |
492 | rc_cache.cache_repo.expiration_time = 2592000 |
|
492 | rc_cache.cache_repo.expiration_time = 2592000 | |
493 | ; file cache store path. Defaults to `cache_dir =` value or tempdir if both values are not set |
|
493 | ; file cache store path. Defaults to `cache_dir =` value or tempdir if both values are not set | |
494 | #rc_cache.cache_repo.arguments.filename = /tmp/cache_repo.db |
|
494 | #rc_cache.cache_repo.arguments.filename = /tmp/cache_repo.db | |
495 |
|
495 | |||
496 | ; alternative `cache_repo` redis backend with distributed lock |
|
496 | ; alternative `cache_repo` redis backend with distributed lock | |
497 | #rc_cache.cache_repo.backend = dogpile.cache.rc.redis |
|
497 | #rc_cache.cache_repo.backend = dogpile.cache.rc.redis | |
498 | #rc_cache.cache_repo.expiration_time = 2592000 |
|
498 | #rc_cache.cache_repo.expiration_time = 2592000 | |
499 |
|
499 | |||
500 | ; redis_expiration_time needs to be greater then expiration_time |
|
500 | ; redis_expiration_time needs to be greater then expiration_time | |
501 | #rc_cache.cache_repo.arguments.redis_expiration_time = 2678400 |
|
501 | #rc_cache.cache_repo.arguments.redis_expiration_time = 2678400 | |
502 |
|
502 | |||
503 | #rc_cache.cache_repo.arguments.host = localhost |
|
503 | #rc_cache.cache_repo.arguments.host = localhost | |
504 | #rc_cache.cache_repo.arguments.port = 6379 |
|
504 | #rc_cache.cache_repo.arguments.port = 6379 | |
505 | #rc_cache.cache_repo.arguments.db = 1 |
|
505 | #rc_cache.cache_repo.arguments.db = 1 | |
506 | #rc_cache.cache_repo.arguments.socket_timeout = 30 |
|
506 | #rc_cache.cache_repo.arguments.socket_timeout = 30 | |
507 | ; more Redis options: https://dogpilecache.sqlalchemy.org/en/latest/api.html#redis-backends |
|
507 | ; more Redis options: https://dogpilecache.sqlalchemy.org/en/latest/api.html#redis-backends | |
508 | #rc_cache.cache_repo.arguments.distributed_lock = true |
|
508 | #rc_cache.cache_repo.arguments.distributed_lock = true | |
509 |
|
509 | |||
510 | ; auto-renew lock to prevent stale locks, slower but safer. Use only if problems happen |
|
510 | ; auto-renew lock to prevent stale locks, slower but safer. Use only if problems happen | |
511 | #rc_cache.cache_repo.arguments.lock_auto_renewal = true |
|
511 | #rc_cache.cache_repo.arguments.lock_auto_renewal = true | |
512 |
|
512 | |||
513 | ; ############## |
|
513 | ; ############## | |
514 | ; BEAKER SESSION |
|
514 | ; BEAKER SESSION | |
515 | ; ############## |
|
515 | ; ############## | |
516 |
|
516 | |||
517 | ; beaker.session.type is type of storage options for the logged users sessions. Current allowed |
|
517 | ; beaker.session.type is type of storage options for the logged users sessions. Current allowed | |
518 | ; types are file, ext:redis, ext:database, ext:memcached, and memory (default if not specified). |
|
518 | ; types are file, ext:redis, ext:database, ext:memcached, and memory (default if not specified). | |
519 | ; Fastest ones are Redis and ext:database |
|
519 | ; Fastest ones are Redis and ext:database | |
520 | beaker.session.type = file |
|
520 | beaker.session.type = file | |
521 | beaker.session.data_dir = %(here)s/data/sessions |
|
521 | beaker.session.data_dir = %(here)s/data/sessions | |
522 |
|
522 | |||
523 | ; Redis based sessions |
|
523 | ; Redis based sessions | |
524 | #beaker.session.type = ext:redis |
|
524 | #beaker.session.type = ext:redis | |
525 | #beaker.session.url = redis://127.0.0.1:6379/2 |
|
525 | #beaker.session.url = redis://127.0.0.1:6379/2 | |
526 |
|
526 | |||
527 | ; DB based session, fast, and allows easy management over logged in users |
|
527 | ; DB based session, fast, and allows easy management over logged in users | |
528 | #beaker.session.type = ext:database |
|
528 | #beaker.session.type = ext:database | |
529 | #beaker.session.table_name = db_session |
|
529 | #beaker.session.table_name = db_session | |
530 | #beaker.session.sa.url = postgresql://postgres:secret@localhost/rhodecode |
|
530 | #beaker.session.sa.url = postgresql://postgres:secret@localhost/rhodecode | |
531 | #beaker.session.sa.url = mysql://root:secret@127.0.0.1/rhodecode |
|
531 | #beaker.session.sa.url = mysql://root:secret@127.0.0.1/rhodecode | |
532 | #beaker.session.sa.pool_recycle = 3600 |
|
532 | #beaker.session.sa.pool_recycle = 3600 | |
533 | #beaker.session.sa.echo = false |
|
533 | #beaker.session.sa.echo = false | |
534 |
|
534 | |||
535 | beaker.session.key = rhodecode |
|
535 | beaker.session.key = rhodecode | |
536 | beaker.session.secret = develop-rc-uytcxaz |
|
536 | beaker.session.secret = develop-rc-uytcxaz | |
537 | beaker.session.lock_dir = %(here)s/data/sessions/lock |
|
537 | beaker.session.lock_dir = %(here)s/data/sessions/lock | |
538 |
|
538 | |||
539 | ; Secure encrypted cookie. Requires AES and AES python libraries |
|
539 | ; Secure encrypted cookie. Requires AES and AES python libraries | |
540 | ; you must disable beaker.session.secret to use this |
|
540 | ; you must disable beaker.session.secret to use this | |
541 | #beaker.session.encrypt_key = key_for_encryption |
|
541 | #beaker.session.encrypt_key = key_for_encryption | |
542 | #beaker.session.validate_key = validation_key |
|
542 | #beaker.session.validate_key = validation_key | |
543 |
|
543 | |||
544 | ; Sets session as invalid (also logging out user) if it haven not been |
|
544 | ; Sets session as invalid (also logging out user) if it haven not been | |
545 | ; accessed for given amount of time in seconds |
|
545 | ; accessed for given amount of time in seconds | |
546 | beaker.session.timeout = 2592000 |
|
546 | beaker.session.timeout = 2592000 | |
547 | beaker.session.httponly = true |
|
547 | beaker.session.httponly = true | |
548 |
|
548 | |||
549 | ; Path to use for the cookie. Set to prefix if you use prefix middleware |
|
549 | ; Path to use for the cookie. Set to prefix if you use prefix middleware | |
550 | #beaker.session.cookie_path = /custom_prefix |
|
550 | #beaker.session.cookie_path = /custom_prefix | |
551 |
|
551 | |||
552 | ; Set https secure cookie |
|
552 | ; Set https secure cookie | |
553 | beaker.session.secure = false |
|
553 | beaker.session.secure = false | |
554 |
|
554 | |||
555 | ; default cookie expiration time in seconds, set to `true` to set expire |
|
555 | ; default cookie expiration time in seconds, set to `true` to set expire | |
556 | ; at browser close |
|
556 | ; at browser close | |
557 | #beaker.session.cookie_expires = 3600 |
|
557 | #beaker.session.cookie_expires = 3600 | |
558 |
|
558 | |||
559 | ; ############################# |
|
559 | ; ############################# | |
560 | ; SEARCH INDEXING CONFIGURATION |
|
560 | ; SEARCH INDEXING CONFIGURATION | |
561 | ; ############################# |
|
561 | ; ############################# | |
562 |
|
562 | |||
563 | ; Full text search indexer is available in rhodecode-tools under |
|
563 | ; Full text search indexer is available in rhodecode-tools under | |
564 | ; `rhodecode-tools index` command |
|
564 | ; `rhodecode-tools index` command | |
565 |
|
565 | |||
566 | ; WHOOSH Backend, doesn't require additional services to run |
|
566 | ; WHOOSH Backend, doesn't require additional services to run | |
567 | ; it works good with few dozen repos |
|
567 | ; it works good with few dozen repos | |
568 | search.module = rhodecode.lib.index.whoosh |
|
568 | search.module = rhodecode.lib.index.whoosh | |
569 | search.location = %(here)s/data/index |
|
569 | search.location = %(here)s/data/index | |
570 |
|
570 | |||
571 | ; #################### |
|
571 | ; #################### | |
572 | ; CHANNELSTREAM CONFIG |
|
572 | ; CHANNELSTREAM CONFIG | |
573 | ; #################### |
|
573 | ; #################### | |
574 |
|
574 | |||
575 | ; channelstream enables persistent connections and live notification |
|
575 | ; channelstream enables persistent connections and live notification | |
576 | ; in the system. It's also used by the chat system |
|
576 | ; in the system. It's also used by the chat system | |
577 |
|
577 | |||
578 | channelstream.enabled = false |
|
578 | channelstream.enabled = false | |
579 |
|
579 | |||
580 | ; server address for channelstream server on the backend |
|
580 | ; server address for channelstream server on the backend | |
581 | channelstream.server = 127.0.0.1:9800 |
|
581 | channelstream.server = 127.0.0.1:9800 | |
582 |
|
582 | |||
583 | ; location of the channelstream server from outside world |
|
583 | ; location of the channelstream server from outside world | |
584 | ; use ws:// for http or wss:// for https. This address needs to be handled |
|
584 | ; use ws:// for http or wss:// for https. This address needs to be handled | |
585 | ; by external HTTP server such as Nginx or Apache |
|
585 | ; by external HTTP server such as Nginx or Apache | |
586 | ; see Nginx/Apache configuration examples in our docs |
|
586 | ; see Nginx/Apache configuration examples in our docs | |
587 | channelstream.ws_url = ws://rhodecode.yourserver.com/_channelstream |
|
587 | channelstream.ws_url = ws://rhodecode.yourserver.com/_channelstream | |
588 | channelstream.secret = secret |
|
588 | channelstream.secret = secret | |
589 | channelstream.history.location = %(here)s/channelstream_history |
|
589 | channelstream.history.location = %(here)s/channelstream_history | |
590 |
|
590 | |||
591 | ; Internal application path that Javascript uses to connect into. |
|
591 | ; Internal application path that Javascript uses to connect into. | |
592 | ; If you use proxy-prefix the prefix should be added before /_channelstream |
|
592 | ; If you use proxy-prefix the prefix should be added before /_channelstream | |
593 | channelstream.proxy_path = /_channelstream |
|
593 | channelstream.proxy_path = /_channelstream | |
594 |
|
594 | |||
595 |
|
595 | |||
596 | ; ############################## |
|
596 | ; ############################## | |
597 | ; MAIN RHODECODE DATABASE CONFIG |
|
597 | ; MAIN RHODECODE DATABASE CONFIG | |
598 | ; ############################## |
|
598 | ; ############################## | |
599 |
|
599 | |||
600 | #sqlalchemy.db1.url = sqlite:///%(here)s/rhodecode.db?timeout=30 |
|
600 | #sqlalchemy.db1.url = sqlite:///%(here)s/rhodecode.db?timeout=30 | |
601 | #sqlalchemy.db1.url = postgresql://postgres:qweqwe@localhost/rhodecode |
|
601 | #sqlalchemy.db1.url = postgresql://postgres:qweqwe@localhost/rhodecode | |
602 | #sqlalchemy.db1.url = mysql://root:qweqwe@localhost/rhodecode?charset=utf8 |
|
602 | #sqlalchemy.db1.url = mysql://root:qweqwe@localhost/rhodecode?charset=utf8 | |
603 | ; pymysql is an alternative driver for MySQL, use in case of problems with default one |
|
603 | ; pymysql is an alternative driver for MySQL, use in case of problems with default one | |
604 | #sqlalchemy.db1.url = mysql+pymysql://root:qweqwe@localhost/rhodecode |
|
604 | #sqlalchemy.db1.url = mysql+pymysql://root:qweqwe@localhost/rhodecode | |
605 |
|
605 | |||
606 | sqlalchemy.db1.url = sqlite:///%(here)s/rhodecode.db?timeout=30 |
|
606 | sqlalchemy.db1.url = sqlite:///%(here)s/rhodecode.db?timeout=30 | |
607 |
|
607 | |||
608 | ; see sqlalchemy docs for other advanced settings |
|
608 | ; see sqlalchemy docs for other advanced settings | |
609 | ; print the sql statements to output |
|
609 | ; print the sql statements to output | |
610 | sqlalchemy.db1.echo = false |
|
610 | sqlalchemy.db1.echo = false | |
611 |
|
611 | |||
612 | ; recycle the connections after this amount of seconds |
|
612 | ; recycle the connections after this amount of seconds | |
613 | sqlalchemy.db1.pool_recycle = 3600 |
|
613 | sqlalchemy.db1.pool_recycle = 3600 | |
614 | sqlalchemy.db1.convert_unicode = true |
|
614 | sqlalchemy.db1.convert_unicode = true | |
615 |
|
615 | |||
616 | ; the number of connections to keep open inside the connection pool. |
|
616 | ; the number of connections to keep open inside the connection pool. | |
617 | ; 0 indicates no limit |
|
617 | ; 0 indicates no limit | |
618 | #sqlalchemy.db1.pool_size = 5 |
|
618 | #sqlalchemy.db1.pool_size = 5 | |
619 |
|
619 | |||
620 | ; The number of connections to allow in connection pool "overflow", that is |
|
620 | ; The number of connections to allow in connection pool "overflow", that is | |
621 | ; connections that can be opened above and beyond the pool_size setting, |
|
621 | ; connections that can be opened above and beyond the pool_size setting, | |
622 | ; which defaults to five. |
|
622 | ; which defaults to five. | |
623 | #sqlalchemy.db1.max_overflow = 10 |
|
623 | #sqlalchemy.db1.max_overflow = 10 | |
624 |
|
624 | |||
625 | ; Connection check ping, used to detect broken database connections |
|
625 | ; Connection check ping, used to detect broken database connections | |
626 | ; could be enabled to better handle cases if MySQL has gone away errors |
|
626 | ; could be enabled to better handle cases if MySQL has gone away errors | |
627 | #sqlalchemy.db1.ping_connection = true |
|
627 | #sqlalchemy.db1.ping_connection = true | |
628 |
|
628 | |||
629 | ; ########## |
|
629 | ; ########## | |
630 | ; VCS CONFIG |
|
630 | ; VCS CONFIG | |
631 | ; ########## |
|
631 | ; ########## | |
632 | vcs.server.enable = true |
|
632 | vcs.server.enable = true | |
633 | vcs.server = localhost:9900 |
|
633 | vcs.server = localhost:9900 | |
634 |
|
634 | |||
635 | ; Web server connectivity protocol, responsible for web based VCS operations |
|
635 | ; Web server connectivity protocol, responsible for web based VCS operations | |
636 | ; Available protocols are: |
|
636 | ; Available protocols are: | |
637 | ; `http` - use http-rpc backend (default) |
|
637 | ; `http` - use http-rpc backend (default) | |
638 | vcs.server.protocol = http |
|
638 | vcs.server.protocol = http | |
639 |
|
639 | |||
640 | ; Push/Pull operations protocol, available options are: |
|
640 | ; Push/Pull operations protocol, available options are: | |
641 | ; `http` - use http-rpc backend (default) |
|
641 | ; `http` - use http-rpc backend (default) | |
642 | vcs.scm_app_implementation = http |
|
642 | vcs.scm_app_implementation = http | |
643 |
|
643 | |||
644 | ; Push/Pull operations hooks protocol, available options are: |
|
644 | ; Push/Pull operations hooks protocol, available options are: | |
645 | ; `http` - use http-rpc backend (default) |
|
645 | ; `http` - use http-rpc backend (default) | |
646 | vcs.hooks.protocol = http |
|
646 | vcs.hooks.protocol = http | |
647 |
|
647 | |||
648 |
; Host on which this instance is listening for hooks. |
|
648 | ; Host on which this instance is listening for hooks. vcsserver will call this host to pull/push hooks so it should be | |
649 | ; this should be adjusted. |
|
649 | ; accessible via network. | |
650 | vcs.hooks.host = 127.0.0.1 |
|
650 | ; Use vcs.hooks.host = "*" to bind to current hostname (for Docker) | |
|
651 | vcs.hooks.host = * | |||
651 |
|
652 | |||
652 | ; Start VCSServer with this instance as a subprocess, useful for development |
|
653 | ; Start VCSServer with this instance as a subprocess, useful for development | |
653 | vcs.start_server = false |
|
654 | vcs.start_server = false | |
654 |
|
655 | |||
655 | ; List of enabled VCS backends, available options are: |
|
656 | ; List of enabled VCS backends, available options are: | |
656 | ; `hg` - mercurial |
|
657 | ; `hg` - mercurial | |
657 | ; `git` - git |
|
658 | ; `git` - git | |
658 | ; `svn` - subversion |
|
659 | ; `svn` - subversion | |
659 | vcs.backends = hg, git, svn |
|
660 | vcs.backends = hg, git, svn | |
660 |
|
661 | |||
661 | ; Wait this number of seconds before killing connection to the vcsserver |
|
662 | ; Wait this number of seconds before killing connection to the vcsserver | |
662 | vcs.connection_timeout = 3600 |
|
663 | vcs.connection_timeout = 3600 | |
663 |
|
664 | |||
664 | ; Compatibility version when creating SVN repositories. Defaults to newest version when commented out. |
|
665 | ; Compatibility version when creating SVN repositories. Defaults to newest version when commented out. | |
665 | ; Set a numeric version for your current SVN e.g 1.8, or 1.12 |
|
666 | ; Set a numeric version for your current SVN e.g 1.8, or 1.12 | |
666 | ; Legacy available options are: pre-1.4-compatible, pre-1.5-compatible, pre-1.6-compatible, pre-1.8-compatible, pre-1.9-compatible |
|
667 | ; Legacy available options are: pre-1.4-compatible, pre-1.5-compatible, pre-1.6-compatible, pre-1.8-compatible, pre-1.9-compatible | |
667 | #vcs.svn.compatible_version = 1.8 |
|
668 | #vcs.svn.compatible_version = 1.8 | |
668 |
|
669 | |||
669 | ; Cache flag to cache vcsserver remote calls locally |
|
670 | ; Cache flag to cache vcsserver remote calls locally | |
670 | ; It uses cache_region `cache_repo` |
|
671 | ; It uses cache_region `cache_repo` | |
671 | vcs.methods.cache = true |
|
672 | vcs.methods.cache = true | |
672 |
|
673 | |||
673 | ; #################################################### |
|
674 | ; #################################################### | |
674 | ; Subversion proxy support (mod_dav_svn) |
|
675 | ; Subversion proxy support (mod_dav_svn) | |
675 | ; Maps RhodeCode repo groups into SVN paths for Apache |
|
676 | ; Maps RhodeCode repo groups into SVN paths for Apache | |
676 | ; #################################################### |
|
677 | ; #################################################### | |
677 |
|
678 | |||
678 | ; Enable or disable the config file generation. |
|
679 | ; Enable or disable the config file generation. | |
679 | svn.proxy.generate_config = false |
|
680 | svn.proxy.generate_config = false | |
680 |
|
681 | |||
681 | ; Generate config file with `SVNListParentPath` set to `On`. |
|
682 | ; Generate config file with `SVNListParentPath` set to `On`. | |
682 | svn.proxy.list_parent_path = true |
|
683 | svn.proxy.list_parent_path = true | |
683 |
|
684 | |||
684 | ; Set location and file name of generated config file. |
|
685 | ; Set location and file name of generated config file. | |
685 | svn.proxy.config_file_path = %(here)s/mod_dav_svn.conf |
|
686 | svn.proxy.config_file_path = %(here)s/mod_dav_svn.conf | |
686 |
|
687 | |||
687 | ; alternative mod_dav config template. This needs to be a valid mako template |
|
688 | ; alternative mod_dav config template. This needs to be a valid mako template | |
688 | ; Example template can be found in the source code: |
|
689 | ; Example template can be found in the source code: | |
689 | ; rhodecode/apps/svn_support/templates/mod-dav-svn.conf.mako |
|
690 | ; rhodecode/apps/svn_support/templates/mod-dav-svn.conf.mako | |
690 | #svn.proxy.config_template = ~/.rccontrol/enterprise-1/custom_svn_conf.mako |
|
691 | #svn.proxy.config_template = ~/.rccontrol/enterprise-1/custom_svn_conf.mako | |
691 |
|
692 | |||
692 | ; Used as a prefix to the `Location` block in the generated config file. |
|
693 | ; Used as a prefix to the `Location` block in the generated config file. | |
693 | ; In most cases it should be set to `/`. |
|
694 | ; In most cases it should be set to `/`. | |
694 | svn.proxy.location_root = / |
|
695 | svn.proxy.location_root = / | |
695 |
|
696 | |||
696 | ; Command to reload the mod dav svn configuration on change. |
|
697 | ; Command to reload the mod dav svn configuration on change. | |
697 | ; Example: `/etc/init.d/apache2 reload` or /home/USER/apache_reload.sh |
|
698 | ; Example: `/etc/init.d/apache2 reload` or /home/USER/apache_reload.sh | |
698 | ; Make sure user who runs RhodeCode process is allowed to reload Apache |
|
699 | ; Make sure user who runs RhodeCode process is allowed to reload Apache | |
699 | #svn.proxy.reload_cmd = /etc/init.d/apache2 reload |
|
700 | #svn.proxy.reload_cmd = /etc/init.d/apache2 reload | |
700 |
|
701 | |||
701 | ; If the timeout expires before the reload command finishes, the command will |
|
702 | ; If the timeout expires before the reload command finishes, the command will | |
702 | ; be killed. Setting it to zero means no timeout. Defaults to 10 seconds. |
|
703 | ; be killed. Setting it to zero means no timeout. Defaults to 10 seconds. | |
703 | #svn.proxy.reload_timeout = 10 |
|
704 | #svn.proxy.reload_timeout = 10 | |
704 |
|
705 | |||
705 | ; #################### |
|
706 | ; #################### | |
706 | ; SSH Support Settings |
|
707 | ; SSH Support Settings | |
707 | ; #################### |
|
708 | ; #################### | |
708 |
|
709 | |||
709 | ; Defines if a custom authorized_keys file should be created and written on |
|
710 | ; Defines if a custom authorized_keys file should be created and written on | |
710 | ; any change user ssh keys. Setting this to false also disables possibility |
|
711 | ; any change user ssh keys. Setting this to false also disables possibility | |
711 | ; of adding SSH keys by users from web interface. Super admins can still |
|
712 | ; of adding SSH keys by users from web interface. Super admins can still | |
712 | ; manage SSH Keys. |
|
713 | ; manage SSH Keys. | |
713 | ssh.generate_authorized_keyfile = false |
|
714 | ssh.generate_authorized_keyfile = false | |
714 |
|
715 | |||
715 | ; Options for ssh, default is `no-pty,no-port-forwarding,no-X11-forwarding,no-agent-forwarding` |
|
716 | ; Options for ssh, default is `no-pty,no-port-forwarding,no-X11-forwarding,no-agent-forwarding` | |
716 | # ssh.authorized_keys_ssh_opts = |
|
717 | # ssh.authorized_keys_ssh_opts = | |
717 |
|
718 | |||
718 | ; Path to the authorized_keys file where the generate entries are placed. |
|
719 | ; Path to the authorized_keys file where the generate entries are placed. | |
719 | ; It is possible to have multiple key files specified in `sshd_config` e.g. |
|
720 | ; It is possible to have multiple key files specified in `sshd_config` e.g. | |
720 | ; AuthorizedKeysFile %h/.ssh/authorized_keys %h/.ssh/authorized_keys_rhodecode |
|
721 | ; AuthorizedKeysFile %h/.ssh/authorized_keys %h/.ssh/authorized_keys_rhodecode | |
721 | ssh.authorized_keys_file_path = ~/.ssh/authorized_keys_rhodecode |
|
722 | ssh.authorized_keys_file_path = ~/.ssh/authorized_keys_rhodecode | |
722 |
|
723 | |||
723 | ; Command to execute the SSH wrapper. The binary is available in the |
|
724 | ; Command to execute the SSH wrapper. The binary is available in the | |
724 | ; RhodeCode installation directory. |
|
725 | ; RhodeCode installation directory. | |
725 | ; e.g ~/.rccontrol/community-1/profile/bin/rc-ssh-wrapper |
|
726 | ; e.g ~/.rccontrol/community-1/profile/bin/rc-ssh-wrapper | |
726 | ssh.wrapper_cmd = ~/.rccontrol/community-1/rc-ssh-wrapper |
|
727 | ssh.wrapper_cmd = ~/.rccontrol/community-1/rc-ssh-wrapper | |
727 |
|
728 | |||
728 | ; Allow shell when executing the ssh-wrapper command |
|
729 | ; Allow shell when executing the ssh-wrapper command | |
729 | ssh.wrapper_cmd_allow_shell = false |
|
730 | ssh.wrapper_cmd_allow_shell = false | |
730 |
|
731 | |||
731 | ; Enables logging, and detailed output send back to the client during SSH |
|
732 | ; Enables logging, and detailed output send back to the client during SSH | |
732 | ; operations. Useful for debugging, shouldn't be used in production. |
|
733 | ; operations. Useful for debugging, shouldn't be used in production. | |
733 | ssh.enable_debug_logging = true |
|
734 | ssh.enable_debug_logging = true | |
734 |
|
735 | |||
735 | ; Paths to binary executable, by default they are the names, but we can |
|
736 | ; Paths to binary executable, by default they are the names, but we can | |
736 | ; override them if we want to use a custom one |
|
737 | ; override them if we want to use a custom one | |
737 | ssh.executable.hg = ~/.rccontrol/vcsserver-1/profile/bin/hg |
|
738 | ssh.executable.hg = ~/.rccontrol/vcsserver-1/profile/bin/hg | |
738 | ssh.executable.git = ~/.rccontrol/vcsserver-1/profile/bin/git |
|
739 | ssh.executable.git = ~/.rccontrol/vcsserver-1/profile/bin/git | |
739 | ssh.executable.svn = ~/.rccontrol/vcsserver-1/profile/bin/svnserve |
|
740 | ssh.executable.svn = ~/.rccontrol/vcsserver-1/profile/bin/svnserve | |
740 |
|
741 | |||
741 | ; Enables SSH key generator web interface. Disabling this still allows users |
|
742 | ; Enables SSH key generator web interface. Disabling this still allows users | |
742 | ; to add their own keys. |
|
743 | ; to add their own keys. | |
743 | ssh.enable_ui_key_generator = true |
|
744 | ssh.enable_ui_key_generator = true | |
744 |
|
745 | |||
745 |
|
746 | |||
746 | ; ################# |
|
747 | ; ################# | |
747 | ; APPENLIGHT CONFIG |
|
748 | ; APPENLIGHT CONFIG | |
748 | ; ################# |
|
749 | ; ################# | |
749 |
|
750 | |||
750 | ; Appenlight is tailored to work with RhodeCode, see |
|
751 | ; Appenlight is tailored to work with RhodeCode, see | |
751 | ; http://appenlight.rhodecode.com for details how to obtain an account |
|
752 | ; http://appenlight.rhodecode.com for details how to obtain an account | |
752 |
|
753 | |||
753 | ; Appenlight integration enabled |
|
754 | ; Appenlight integration enabled | |
754 | #appenlight = false |
|
755 | #appenlight = false | |
755 |
|
756 | |||
756 | #appenlight.server_url = https://api.appenlight.com |
|
757 | #appenlight.server_url = https://api.appenlight.com | |
757 | #appenlight.api_key = YOUR_API_KEY |
|
758 | #appenlight.api_key = YOUR_API_KEY | |
758 | #appenlight.transport_config = https://api.appenlight.com?threaded=1&timeout=5 |
|
759 | #appenlight.transport_config = https://api.appenlight.com?threaded=1&timeout=5 | |
759 |
|
760 | |||
760 | ; used for JS client |
|
761 | ; used for JS client | |
761 | #appenlight.api_public_key = YOUR_API_PUBLIC_KEY |
|
762 | #appenlight.api_public_key = YOUR_API_PUBLIC_KEY | |
762 |
|
763 | |||
763 | ; TWEAK AMOUNT OF INFO SENT HERE |
|
764 | ; TWEAK AMOUNT OF INFO SENT HERE | |
764 |
|
765 | |||
765 | ; enables 404 error logging (default False) |
|
766 | ; enables 404 error logging (default False) | |
766 | #appenlight.report_404 = false |
|
767 | #appenlight.report_404 = false | |
767 |
|
768 | |||
768 | ; time in seconds after request is considered being slow (default 1) |
|
769 | ; time in seconds after request is considered being slow (default 1) | |
769 | #appenlight.slow_request_time = 1 |
|
770 | #appenlight.slow_request_time = 1 | |
770 |
|
771 | |||
771 | ; record slow requests in application |
|
772 | ; record slow requests in application | |
772 | ; (needs to be enabled for slow datastore recording and time tracking) |
|
773 | ; (needs to be enabled for slow datastore recording and time tracking) | |
773 | #appenlight.slow_requests = true |
|
774 | #appenlight.slow_requests = true | |
774 |
|
775 | |||
775 | ; enable hooking to application loggers |
|
776 | ; enable hooking to application loggers | |
776 | #appenlight.logging = true |
|
777 | #appenlight.logging = true | |
777 |
|
778 | |||
778 | ; minimum log level for log capture |
|
779 | ; minimum log level for log capture | |
779 | #ppenlight.logging.level = WARNING |
|
780 | #ppenlight.logging.level = WARNING | |
780 |
|
781 | |||
781 | ; send logs only from erroneous/slow requests |
|
782 | ; send logs only from erroneous/slow requests | |
782 | ; (saves API quota for intensive logging) |
|
783 | ; (saves API quota for intensive logging) | |
783 | #appenlight.logging_on_error = false |
|
784 | #appenlight.logging_on_error = false | |
784 |
|
785 | |||
785 | ; list of additional keywords that should be grabbed from environ object |
|
786 | ; list of additional keywords that should be grabbed from environ object | |
786 | ; can be string with comma separated list of words in lowercase |
|
787 | ; can be string with comma separated list of words in lowercase | |
787 | ; (by default client will always send following info: |
|
788 | ; (by default client will always send following info: | |
788 | ; 'REMOTE_USER', 'REMOTE_ADDR', 'SERVER_NAME', 'CONTENT_TYPE' + all keys that |
|
789 | ; 'REMOTE_USER', 'REMOTE_ADDR', 'SERVER_NAME', 'CONTENT_TYPE' + all keys that | |
789 | ; start with HTTP* this list be extended with additional keywords here |
|
790 | ; start with HTTP* this list be extended with additional keywords here | |
790 | #appenlight.environ_keys_whitelist = |
|
791 | #appenlight.environ_keys_whitelist = | |
791 |
|
792 | |||
792 | ; list of keywords that should be blanked from request object |
|
793 | ; list of keywords that should be blanked from request object | |
793 | ; can be string with comma separated list of words in lowercase |
|
794 | ; can be string with comma separated list of words in lowercase | |
794 | ; (by default client will always blank keys that contain following words |
|
795 | ; (by default client will always blank keys that contain following words | |
795 | ; 'password', 'passwd', 'pwd', 'auth_tkt', 'secret', 'csrf' |
|
796 | ; 'password', 'passwd', 'pwd', 'auth_tkt', 'secret', 'csrf' | |
796 | ; this list be extended with additional keywords set here |
|
797 | ; this list be extended with additional keywords set here | |
797 | #appenlight.request_keys_blacklist = |
|
798 | #appenlight.request_keys_blacklist = | |
798 |
|
799 | |||
799 | ; list of namespaces that should be ignores when gathering log entries |
|
800 | ; list of namespaces that should be ignores when gathering log entries | |
800 | ; can be string with comma separated list of namespaces |
|
801 | ; can be string with comma separated list of namespaces | |
801 | ; (by default the client ignores own entries: appenlight_client.client) |
|
802 | ; (by default the client ignores own entries: appenlight_client.client) | |
802 | #appenlight.log_namespace_blacklist = |
|
803 | #appenlight.log_namespace_blacklist = | |
803 |
|
804 | |||
804 | ; Statsd client config, this is used to send metrics to statsd |
|
805 | ; Statsd client config, this is used to send metrics to statsd | |
805 | ; We recommend setting statsd_exported and scrape them using Promethues |
|
806 | ; We recommend setting statsd_exported and scrape them using Promethues | |
806 | #statsd.enabled = false |
|
807 | #statsd.enabled = false | |
807 | #statsd.statsd_host = 0.0.0.0 |
|
808 | #statsd.statsd_host = 0.0.0.0 | |
808 | #statsd.statsd_port = 8125 |
|
809 | #statsd.statsd_port = 8125 | |
809 | #statsd.statsd_prefix = |
|
810 | #statsd.statsd_prefix = | |
810 | #statsd.statsd_ipv6 = false |
|
811 | #statsd.statsd_ipv6 = false | |
811 |
|
812 | |||
812 | ; configure logging automatically at server startup set to false |
|
813 | ; configure logging automatically at server startup set to false | |
813 | ; to use the below custom logging config. |
|
814 | ; to use the below custom logging config. | |
814 | ; RC_LOGGING_FORMATTER |
|
815 | ; RC_LOGGING_FORMATTER | |
815 | ; RC_LOGGING_LEVEL |
|
816 | ; RC_LOGGING_LEVEL | |
816 | ; env variables can control the settings for logging in case of autoconfigure |
|
817 | ; env variables can control the settings for logging in case of autoconfigure | |
817 |
|
818 | |||
818 | #logging.autoconfigure = true |
|
819 | #logging.autoconfigure = true | |
819 |
|
820 | |||
820 | ; specify your own custom logging config file to configure logging |
|
821 | ; specify your own custom logging config file to configure logging | |
821 | #logging.logging_conf_file = /path/to/custom_logging.ini |
|
822 | #logging.logging_conf_file = /path/to/custom_logging.ini | |
822 |
|
823 | |||
823 | ; Dummy marker to add new entries after. |
|
824 | ; Dummy marker to add new entries after. | |
824 | ; Add any custom entries below. Please don't remove this marker. |
|
825 | ; Add any custom entries below. Please don't remove this marker. | |
825 | custom.conf = 1 |
|
826 | custom.conf = 1 | |
826 |
|
827 | |||
827 |
|
828 | |||
828 | ; ##################### |
|
829 | ; ##################### | |
829 | ; LOGGING CONFIGURATION |
|
830 | ; LOGGING CONFIGURATION | |
830 | ; ##################### |
|
831 | ; ##################### | |
831 |
|
832 | |||
832 | [loggers] |
|
833 | [loggers] | |
833 | keys = root, sqlalchemy, beaker, celery, rhodecode, ssh_wrapper |
|
834 | keys = root, sqlalchemy, beaker, celery, rhodecode, ssh_wrapper | |
834 |
|
835 | |||
835 | [handlers] |
|
836 | [handlers] | |
836 | keys = console, console_sql |
|
837 | keys = console, console_sql | |
837 |
|
838 | |||
838 | [formatters] |
|
839 | [formatters] | |
839 | keys = generic, json, color_formatter, color_formatter_sql |
|
840 | keys = generic, json, color_formatter, color_formatter_sql | |
840 |
|
841 | |||
841 | ; ####### |
|
842 | ; ####### | |
842 | ; LOGGERS |
|
843 | ; LOGGERS | |
843 | ; ####### |
|
844 | ; ####### | |
844 | [logger_root] |
|
845 | [logger_root] | |
845 | level = NOTSET |
|
846 | level = NOTSET | |
846 | handlers = console |
|
847 | handlers = console | |
847 |
|
848 | |||
848 | [logger_sqlalchemy] |
|
849 | [logger_sqlalchemy] | |
849 | level = INFO |
|
850 | level = INFO | |
850 | handlers = console_sql |
|
851 | handlers = console_sql | |
851 | qualname = sqlalchemy.engine |
|
852 | qualname = sqlalchemy.engine | |
852 | propagate = 0 |
|
853 | propagate = 0 | |
853 |
|
854 | |||
854 | [logger_beaker] |
|
855 | [logger_beaker] | |
855 | level = DEBUG |
|
856 | level = DEBUG | |
856 | handlers = |
|
857 | handlers = | |
857 | qualname = beaker.container |
|
858 | qualname = beaker.container | |
858 | propagate = 1 |
|
859 | propagate = 1 | |
859 |
|
860 | |||
860 | [logger_rhodecode] |
|
861 | [logger_rhodecode] | |
861 | level = DEBUG |
|
862 | level = DEBUG | |
862 | handlers = |
|
863 | handlers = | |
863 | qualname = rhodecode |
|
864 | qualname = rhodecode | |
864 | propagate = 1 |
|
865 | propagate = 1 | |
865 |
|
866 | |||
866 | [logger_ssh_wrapper] |
|
867 | [logger_ssh_wrapper] | |
867 | level = DEBUG |
|
868 | level = DEBUG | |
868 | handlers = |
|
869 | handlers = | |
869 | qualname = ssh_wrapper |
|
870 | qualname = ssh_wrapper | |
870 | propagate = 1 |
|
871 | propagate = 1 | |
871 |
|
872 | |||
872 | [logger_celery] |
|
873 | [logger_celery] | |
873 | level = DEBUG |
|
874 | level = DEBUG | |
874 | handlers = |
|
875 | handlers = | |
875 | qualname = celery |
|
876 | qualname = celery | |
876 |
|
877 | |||
877 |
|
878 | |||
878 | ; ######## |
|
879 | ; ######## | |
879 | ; HANDLERS |
|
880 | ; HANDLERS | |
880 | ; ######## |
|
881 | ; ######## | |
881 |
|
882 | |||
882 | [handler_console] |
|
883 | [handler_console] | |
883 | class = StreamHandler |
|
884 | class = StreamHandler | |
884 | args = (sys.stderr, ) |
|
885 | args = (sys.stderr, ) | |
885 | level = DEBUG |
|
886 | level = DEBUG | |
886 | ; To enable JSON formatted logs replace 'generic/color_formatter' with 'json' |
|
887 | ; To enable JSON formatted logs replace 'generic/color_formatter' with 'json' | |
887 | ; This allows sending properly formatted logs to grafana loki or elasticsearch |
|
888 | ; This allows sending properly formatted logs to grafana loki or elasticsearch | |
888 | formatter = color_formatter |
|
889 | formatter = color_formatter | |
889 |
|
890 | |||
890 | [handler_console_sql] |
|
891 | [handler_console_sql] | |
891 | ; "level = DEBUG" logs SQL queries and results. |
|
892 | ; "level = DEBUG" logs SQL queries and results. | |
892 | ; "level = INFO" logs SQL queries. |
|
893 | ; "level = INFO" logs SQL queries. | |
893 | ; "level = WARN" logs neither. (Recommended for production systems.) |
|
894 | ; "level = WARN" logs neither. (Recommended for production systems.) | |
894 | class = StreamHandler |
|
895 | class = StreamHandler | |
895 | args = (sys.stderr, ) |
|
896 | args = (sys.stderr, ) | |
896 | level = WARN |
|
897 | level = WARN | |
897 | ; To enable JSON formatted logs replace 'generic/color_formatter_sql' with 'json' |
|
898 | ; To enable JSON formatted logs replace 'generic/color_formatter_sql' with 'json' | |
898 | ; This allows sending properly formatted logs to grafana loki or elasticsearch |
|
899 | ; This allows sending properly formatted logs to grafana loki or elasticsearch | |
899 | formatter = color_formatter_sql |
|
900 | formatter = color_formatter_sql | |
900 |
|
901 | |||
901 | ; ########## |
|
902 | ; ########## | |
902 | ; FORMATTERS |
|
903 | ; FORMATTERS | |
903 | ; ########## |
|
904 | ; ########## | |
904 |
|
905 | |||
905 | [formatter_generic] |
|
906 | [formatter_generic] | |
906 | class = rhodecode.lib.logging_formatter.ExceptionAwareFormatter |
|
907 | class = rhodecode.lib.logging_formatter.ExceptionAwareFormatter | |
907 | format = %(asctime)s.%(msecs)03d [%(process)d] %(levelname)-5.5s [%(name)s] %(message)s |
|
908 | format = %(asctime)s.%(msecs)03d [%(process)d] %(levelname)-5.5s [%(name)s] %(message)s | |
908 | datefmt = %Y-%m-%d %H:%M:%S |
|
909 | datefmt = %Y-%m-%d %H:%M:%S | |
909 |
|
910 | |||
910 | [formatter_color_formatter] |
|
911 | [formatter_color_formatter] | |
911 | class = rhodecode.lib.logging_formatter.ColorFormatter |
|
912 | class = rhodecode.lib.logging_formatter.ColorFormatter | |
912 | format = %(asctime)s.%(msecs)03d [%(process)d] %(levelname)-5.5s [%(name)s] %(message)s |
|
913 | format = %(asctime)s.%(msecs)03d [%(process)d] %(levelname)-5.5s [%(name)s] %(message)s | |
913 | datefmt = %Y-%m-%d %H:%M:%S |
|
914 | datefmt = %Y-%m-%d %H:%M:%S | |
914 |
|
915 | |||
915 | [formatter_color_formatter_sql] |
|
916 | [formatter_color_formatter_sql] | |
916 | class = rhodecode.lib.logging_formatter.ColorFormatterSql |
|
917 | class = rhodecode.lib.logging_formatter.ColorFormatterSql | |
917 | format = %(asctime)s.%(msecs)03d [%(process)d] %(levelname)-5.5s [%(name)s] %(message)s |
|
918 | format = %(asctime)s.%(msecs)03d [%(process)d] %(levelname)-5.5s [%(name)s] %(message)s | |
918 | datefmt = %Y-%m-%d %H:%M:%S |
|
919 | datefmt = %Y-%m-%d %H:%M:%S | |
919 |
|
920 | |||
920 | [formatter_json] |
|
921 | [formatter_json] | |
921 | format = %(timestamp)s %(levelname)s %(name)s %(message)s %(req_id)s |
|
922 | format = %(timestamp)s %(levelname)s %(name)s %(message)s %(req_id)s | |
922 | class = rhodecode.lib._vendor.jsonlogger.JsonFormatter |
|
923 | class = rhodecode.lib._vendor.jsonlogger.JsonFormatter |
@@ -1,873 +1,874 b'' | |||||
1 | ## -*- coding: utf-8 -*- |
|
1 | ## -*- coding: utf-8 -*- | |
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 | ; These settings will be used by the RhodeCode mailing system |
|
13 | ; These settings will be used by the RhodeCode mailing system | |
14 | ; ######################################################################## |
|
14 | ; ######################################################################## | |
15 |
|
15 | |||
16 | ; prefix all emails subjects with given prefix, helps filtering out emails |
|
16 | ; prefix all emails subjects with given prefix, helps filtering out emails | |
17 | #email_prefix = [RhodeCode] |
|
17 | #email_prefix = [RhodeCode] | |
18 |
|
18 | |||
19 | ; email FROM address all mails will be sent |
|
19 | ; email FROM address all mails will be sent | |
20 | #app_email_from = rhodecode-noreply@localhost |
|
20 | #app_email_from = rhodecode-noreply@localhost | |
21 |
|
21 | |||
22 | #smtp_server = mail.server.com |
|
22 | #smtp_server = mail.server.com | |
23 | #smtp_username = |
|
23 | #smtp_username = | |
24 | #smtp_password = |
|
24 | #smtp_password = | |
25 | #smtp_port = |
|
25 | #smtp_port = | |
26 | #smtp_use_tls = false |
|
26 | #smtp_use_tls = false | |
27 | #smtp_use_ssl = true |
|
27 | #smtp_use_ssl = true | |
28 |
|
28 | |||
29 | [server:main] |
|
29 | [server:main] | |
30 | ; COMMON HOST/IP CONFIG |
|
30 | ; COMMON HOST/IP CONFIG | |
31 | host = 127.0.0.1 |
|
31 | host = 127.0.0.1 | |
32 | port = 5000 |
|
32 | port = 5000 | |
33 |
|
33 | |||
34 |
|
34 | |||
35 | ; ########################### |
|
35 | ; ########################### | |
36 | ; GUNICORN APPLICATION SERVER |
|
36 | ; GUNICORN APPLICATION SERVER | |
37 | ; ########################### |
|
37 | ; ########################### | |
38 |
|
38 | |||
39 | ; run with gunicorn --paste rhodecode.ini |
|
39 | ; run with gunicorn --paste rhodecode.ini | |
40 |
|
40 | |||
41 | ; Module to use, this setting shouldn't be changed |
|
41 | ; Module to use, this setting shouldn't be changed | |
42 | use = egg:gunicorn#main |
|
42 | use = egg:gunicorn#main | |
43 |
|
43 | |||
44 | ; Sets the number of process workers. More workers means more concurrent connections |
|
44 | ; Sets the number of process workers. More workers means more concurrent connections | |
45 | ; RhodeCode can handle at the same time. Each additional worker also it increases |
|
45 | ; RhodeCode can handle at the same time. Each additional worker also it increases | |
46 | ; memory usage as each has it's own set of caches. |
|
46 | ; memory usage as each has it's own set of caches. | |
47 | ; Recommended value is (2 * NUMBER_OF_CPUS + 1), eg 2CPU = 5 workers, but no more |
|
47 | ; Recommended value is (2 * NUMBER_OF_CPUS + 1), eg 2CPU = 5 workers, but no more | |
48 | ; than 8-10 unless for really big deployments .e.g 700-1000 users. |
|
48 | ; than 8-10 unless for really big deployments .e.g 700-1000 users. | |
49 | ; `instance_id = *` must be set in the [app:main] section below (which is the default) |
|
49 | ; `instance_id = *` must be set in the [app:main] section below (which is the default) | |
50 | ; when using more than 1 worker. |
|
50 | ; when using more than 1 worker. | |
51 | workers = 2 |
|
51 | workers = 2 | |
52 |
|
52 | |||
53 | ; Gunicorn access log level |
|
53 | ; Gunicorn access log level | |
54 | loglevel = info |
|
54 | loglevel = info | |
55 |
|
55 | |||
56 | ; Process name visible in process list |
|
56 | ; Process name visible in process list | |
57 | proc_name = rhodecode |
|
57 | proc_name = rhodecode | |
58 |
|
58 | |||
59 | ; Type of worker class, one of `sync`, `gevent` |
|
59 | ; Type of worker class, one of `sync`, `gevent` | |
60 | ; Recommended type is `gevent` |
|
60 | ; Recommended type is `gevent` | |
61 | worker_class = gevent |
|
61 | worker_class = gevent | |
62 |
|
62 | |||
63 | ; The maximum number of simultaneous clients per worker. Valid only for gevent |
|
63 | ; The maximum number of simultaneous clients per worker. Valid only for gevent | |
64 | worker_connections = 10 |
|
64 | worker_connections = 10 | |
65 |
|
65 | |||
66 | ; Max number of requests that worker will handle before being gracefully restarted. |
|
66 | ; Max number of requests that worker will handle before being gracefully restarted. | |
67 | ; Prevents memory leaks, jitter adds variability so not all workers are restarted at once. |
|
67 | ; Prevents memory leaks, jitter adds variability so not all workers are restarted at once. | |
68 | max_requests = 1000 |
|
68 | max_requests = 1000 | |
69 | max_requests_jitter = 30 |
|
69 | max_requests_jitter = 30 | |
70 |
|
70 | |||
71 | ; Amount of time a worker can spend with handling a request before it |
|
71 | ; Amount of time a worker can spend with handling a request before it | |
72 | ; gets killed and restarted. By default set to 21600 (6hrs) |
|
72 | ; gets killed and restarted. By default set to 21600 (6hrs) | |
73 | ; Examples: 1800 (30min), 3600 (1hr), 7200 (2hr), 43200 (12h) |
|
73 | ; Examples: 1800 (30min), 3600 (1hr), 7200 (2hr), 43200 (12h) | |
74 | timeout = 21600 |
|
74 | timeout = 21600 | |
75 |
|
75 | |||
76 | ; The maximum size of HTTP request line in bytes. |
|
76 | ; The maximum size of HTTP request line in bytes. | |
77 | ; 0 for unlimited |
|
77 | ; 0 for unlimited | |
78 | limit_request_line = 0 |
|
78 | limit_request_line = 0 | |
79 |
|
79 | |||
80 | ; Limit the number of HTTP headers fields in a request. |
|
80 | ; Limit the number of HTTP headers fields in a request. | |
81 | ; By default this value is 100 and can't be larger than 32768. |
|
81 | ; By default this value is 100 and can't be larger than 32768. | |
82 | limit_request_fields = 32768 |
|
82 | limit_request_fields = 32768 | |
83 |
|
83 | |||
84 | ; Limit the allowed size of an HTTP request header field. |
|
84 | ; Limit the allowed size of an HTTP request header field. | |
85 | ; Value is a positive number or 0. |
|
85 | ; Value is a positive number or 0. | |
86 | ; Setting it to 0 will allow unlimited header field sizes. |
|
86 | ; Setting it to 0 will allow unlimited header field sizes. | |
87 | limit_request_field_size = 0 |
|
87 | limit_request_field_size = 0 | |
88 |
|
88 | |||
89 | ; Timeout for graceful workers restart. |
|
89 | ; Timeout for graceful workers restart. | |
90 | ; After receiving a restart signal, workers have this much time to finish |
|
90 | ; After receiving a restart signal, workers have this much time to finish | |
91 | ; serving requests. Workers still alive after the timeout (starting from the |
|
91 | ; serving requests. Workers still alive after the timeout (starting from the | |
92 | ; receipt of the restart signal) are force killed. |
|
92 | ; receipt of the restart signal) are force killed. | |
93 | ; Examples: 1800 (30min), 3600 (1hr), 7200 (2hr), 43200 (12h) |
|
93 | ; Examples: 1800 (30min), 3600 (1hr), 7200 (2hr), 43200 (12h) | |
94 | graceful_timeout = 3600 |
|
94 | graceful_timeout = 3600 | |
95 |
|
95 | |||
96 | # The number of seconds to wait for requests on a Keep-Alive connection. |
|
96 | # The number of seconds to wait for requests on a Keep-Alive connection. | |
97 | # Generally set in the 1-5 seconds range. |
|
97 | # Generally set in the 1-5 seconds range. | |
98 | keepalive = 2 |
|
98 | keepalive = 2 | |
99 |
|
99 | |||
100 | ; Maximum memory usage that each worker can use before it will receive a |
|
100 | ; Maximum memory usage that each worker can use before it will receive a | |
101 | ; graceful restart signal 0 = memory monitoring is disabled |
|
101 | ; graceful restart signal 0 = memory monitoring is disabled | |
102 | ; Examples: 268435456 (256MB), 536870912 (512MB) |
|
102 | ; Examples: 268435456 (256MB), 536870912 (512MB) | |
103 | ; 1073741824 (1GB), 2147483648 (2GB), 4294967296 (4GB) |
|
103 | ; 1073741824 (1GB), 2147483648 (2GB), 4294967296 (4GB) | |
104 | memory_max_usage = 0 |
|
104 | memory_max_usage = 0 | |
105 |
|
105 | |||
106 | ; How often in seconds to check for memory usage for each gunicorn worker |
|
106 | ; How often in seconds to check for memory usage for each gunicorn worker | |
107 | memory_usage_check_interval = 60 |
|
107 | memory_usage_check_interval = 60 | |
108 |
|
108 | |||
109 | ; Threshold value for which we don't recycle worker if GarbageCollection |
|
109 | ; Threshold value for which we don't recycle worker if GarbageCollection | |
110 | ; frees up enough resources. Before each restart we try to run GC on worker |
|
110 | ; frees up enough resources. Before each restart we try to run GC on worker | |
111 | ; in case we get enough free memory after that, restart will not happen. |
|
111 | ; in case we get enough free memory after that, restart will not happen. | |
112 | memory_usage_recovery_threshold = 0.8 |
|
112 | memory_usage_recovery_threshold = 0.8 | |
113 |
|
113 | |||
114 |
|
114 | |||
115 | ; Prefix middleware for RhodeCode. |
|
115 | ; Prefix middleware for RhodeCode. | |
116 | ; recommended when using proxy setup. |
|
116 | ; recommended when using proxy setup. | |
117 | ; allows to set RhodeCode under a prefix in server. |
|
117 | ; allows to set RhodeCode under a prefix in server. | |
118 | ; eg https://server.com/custom_prefix. Enable `filter-with =` option below as well. |
|
118 | ; eg https://server.com/custom_prefix. Enable `filter-with =` option below as well. | |
119 | ; And set your prefix like: `prefix = /custom_prefix` |
|
119 | ; And set your prefix like: `prefix = /custom_prefix` | |
120 | ; be sure to also set beaker.session.cookie_path = /custom_prefix if you need |
|
120 | ; be sure to also set beaker.session.cookie_path = /custom_prefix if you need | |
121 | ; to make your cookies only work on prefix url |
|
121 | ; to make your cookies only work on prefix url | |
122 | [filter:proxy-prefix] |
|
122 | [filter:proxy-prefix] | |
123 | use = egg:PasteDeploy#prefix |
|
123 | use = egg:PasteDeploy#prefix | |
124 | prefix = / |
|
124 | prefix = / | |
125 |
|
125 | |||
126 | [app:main] |
|
126 | [app:main] | |
127 | ; The %(here)s variable will be replaced with the absolute path of parent directory |
|
127 | ; The %(here)s variable will be replaced with the absolute path of parent directory | |
128 | ; of this file |
|
128 | ; of this file | |
129 | ; Each option in the app:main can be override by an environmental variable |
|
129 | ; Each option in the app:main can be override by an environmental variable | |
130 | ; |
|
130 | ; | |
131 | ;To override an option: |
|
131 | ;To override an option: | |
132 | ; |
|
132 | ; | |
133 | ;RC_<KeyName> |
|
133 | ;RC_<KeyName> | |
134 | ;Everything should be uppercase, . and - should be replaced by _. |
|
134 | ;Everything should be uppercase, . and - should be replaced by _. | |
135 | ;For example, if you have these configuration settings: |
|
135 | ;For example, if you have these configuration settings: | |
136 | ;rc_cache.repo_object.backend = foo |
|
136 | ;rc_cache.repo_object.backend = foo | |
137 | ;can be overridden by |
|
137 | ;can be overridden by | |
138 | ;export RC_CACHE_REPO_OBJECT_BACKEND=foo |
|
138 | ;export RC_CACHE_REPO_OBJECT_BACKEND=foo | |
139 |
|
139 | |||
140 | use = egg:rhodecode-enterprise-ce |
|
140 | use = egg:rhodecode-enterprise-ce | |
141 |
|
141 | |||
142 | ; enable proxy prefix middleware, defined above |
|
142 | ; enable proxy prefix middleware, defined above | |
143 | #filter-with = proxy-prefix |
|
143 | #filter-with = proxy-prefix | |
144 |
|
144 | |||
145 | ; encryption key used to encrypt social plugin tokens, |
|
145 | ; encryption key used to encrypt social plugin tokens, | |
146 | ; remote_urls with credentials etc, if not set it defaults to |
|
146 | ; remote_urls with credentials etc, if not set it defaults to | |
147 | ; `beaker.session.secret` |
|
147 | ; `beaker.session.secret` | |
148 | #rhodecode.encrypted_values.secret = |
|
148 | #rhodecode.encrypted_values.secret = | |
149 |
|
149 | |||
150 | ; decryption strict mode (enabled by default). It controls if decryption raises |
|
150 | ; decryption strict mode (enabled by default). It controls if decryption raises | |
151 | ; `SignatureVerificationError` in case of wrong key, or damaged encryption data. |
|
151 | ; `SignatureVerificationError` in case of wrong key, or damaged encryption data. | |
152 | #rhodecode.encrypted_values.strict = false |
|
152 | #rhodecode.encrypted_values.strict = false | |
153 |
|
153 | |||
154 | ; Pick algorithm for encryption. Either fernet (more secure) or aes (default) |
|
154 | ; Pick algorithm for encryption. Either fernet (more secure) or aes (default) | |
155 | ; fernet is safer, and we strongly recommend switching to it. |
|
155 | ; fernet is safer, and we strongly recommend switching to it. | |
156 | ; Due to backward compatibility aes is used as default. |
|
156 | ; Due to backward compatibility aes is used as default. | |
157 | #rhodecode.encrypted_values.algorithm = fernet |
|
157 | #rhodecode.encrypted_values.algorithm = fernet | |
158 |
|
158 | |||
159 | ; Return gzipped responses from RhodeCode (static files/application) |
|
159 | ; Return gzipped responses from RhodeCode (static files/application) | |
160 | gzip_responses = false |
|
160 | gzip_responses = false | |
161 |
|
161 | |||
162 | ; Auto-generate javascript routes file on startup |
|
162 | ; Auto-generate javascript routes file on startup | |
163 | generate_js_files = false |
|
163 | generate_js_files = false | |
164 |
|
164 | |||
165 | ; System global default language. |
|
165 | ; System global default language. | |
166 | ; All available languages: en (default), be, de, es, fr, it, ja, pl, pt, ru, zh |
|
166 | ; All available languages: en (default), be, de, es, fr, it, ja, pl, pt, ru, zh | |
167 | lang = en |
|
167 | lang = en | |
168 |
|
168 | |||
169 | ; Perform a full repository scan and import on each server start. |
|
169 | ; Perform a full repository scan and import on each server start. | |
170 | ; Settings this to true could lead to very long startup time. |
|
170 | ; Settings this to true could lead to very long startup time. | |
171 | startup.import_repos = false |
|
171 | startup.import_repos = false | |
172 |
|
172 | |||
173 | ; Uncomment and set this path to use archive download cache. |
|
173 | ; Uncomment and set this path to use archive download cache. | |
174 | ; Once enabled, generated archives will be cached at this location |
|
174 | ; Once enabled, generated archives will be cached at this location | |
175 | ; and served from the cache during subsequent requests for the same archive of |
|
175 | ; and served from the cache during subsequent requests for the same archive of | |
176 | ; the repository. |
|
176 | ; the repository. | |
177 | #archive_cache_dir = /tmp/tarballcache |
|
177 | #archive_cache_dir = /tmp/tarballcache | |
178 |
|
178 | |||
179 | ; URL at which the application is running. This is used for Bootstrapping |
|
179 | ; URL at which the application is running. This is used for Bootstrapping | |
180 | ; requests in context when no web request is available. Used in ishell, or |
|
180 | ; requests in context when no web request is available. Used in ishell, or | |
181 | ; SSH calls. Set this for events to receive proper url for SSH calls. |
|
181 | ; SSH calls. Set this for events to receive proper url for SSH calls. | |
182 | app.base_url = http://rhodecode.local |
|
182 | app.base_url = http://rhodecode.local | |
183 |
|
183 | |||
184 | ; Unique application ID. Should be a random unique string for security. |
|
184 | ; Unique application ID. Should be a random unique string for security. | |
185 | app_instance_uuid = rc-production |
|
185 | app_instance_uuid = rc-production | |
186 |
|
186 | |||
187 | ; Cut off limit for large diffs (size in bytes). If overall diff size on |
|
187 | ; Cut off limit for large diffs (size in bytes). If overall diff size on | |
188 | ; commit, or pull request exceeds this limit this diff will be displayed |
|
188 | ; commit, or pull request exceeds this limit this diff will be displayed | |
189 | ; partially. E.g 512000 == 512Kb |
|
189 | ; partially. E.g 512000 == 512Kb | |
190 | cut_off_limit_diff = 512000 |
|
190 | cut_off_limit_diff = 512000 | |
191 |
|
191 | |||
192 | ; Cut off limit for large files inside diffs (size in bytes). Each individual |
|
192 | ; Cut off limit for large files inside diffs (size in bytes). Each individual | |
193 | ; file inside diff which exceeds this limit will be displayed partially. |
|
193 | ; file inside diff which exceeds this limit will be displayed partially. | |
194 | ; E.g 128000 == 128Kb |
|
194 | ; E.g 128000 == 128Kb | |
195 | cut_off_limit_file = 128000 |
|
195 | cut_off_limit_file = 128000 | |
196 |
|
196 | |||
197 | ; Use cached version of vcs repositories everywhere. Recommended to be `true` |
|
197 | ; Use cached version of vcs repositories everywhere. Recommended to be `true` | |
198 | vcs_full_cache = true |
|
198 | vcs_full_cache = true | |
199 |
|
199 | |||
200 | ; Force https in RhodeCode, fixes https redirects, assumes it's always https. |
|
200 | ; Force https in RhodeCode, fixes https redirects, assumes it's always https. | |
201 | ; Normally this is controlled by proper flags sent from http server such as Nginx or Apache |
|
201 | ; Normally this is controlled by proper flags sent from http server such as Nginx or Apache | |
202 | force_https = false |
|
202 | force_https = false | |
203 |
|
203 | |||
204 | ; use Strict-Transport-Security headers |
|
204 | ; use Strict-Transport-Security headers | |
205 | use_htsts = false |
|
205 | use_htsts = false | |
206 |
|
206 | |||
207 | ; Set to true if your repos are exposed using the dumb protocol |
|
207 | ; Set to true if your repos are exposed using the dumb protocol | |
208 | git_update_server_info = false |
|
208 | git_update_server_info = false | |
209 |
|
209 | |||
210 | ; RSS/ATOM feed options |
|
210 | ; RSS/ATOM feed options | |
211 | rss_cut_off_limit = 256000 |
|
211 | rss_cut_off_limit = 256000 | |
212 | rss_items_per_page = 10 |
|
212 | rss_items_per_page = 10 | |
213 | rss_include_diff = false |
|
213 | rss_include_diff = false | |
214 |
|
214 | |||
215 | ; gist URL alias, used to create nicer urls for gist. This should be an |
|
215 | ; gist URL alias, used to create nicer urls for gist. This should be an | |
216 | ; url that does rewrites to _admin/gists/{gistid}. |
|
216 | ; url that does rewrites to _admin/gists/{gistid}. | |
217 | ; example: http://gist.rhodecode.org/{gistid}. Empty means use the internal |
|
217 | ; example: http://gist.rhodecode.org/{gistid}. Empty means use the internal | |
218 | ; RhodeCode url, ie. http[s]://rhodecode.server/_admin/gists/{gistid} |
|
218 | ; RhodeCode url, ie. http[s]://rhodecode.server/_admin/gists/{gistid} | |
219 | gist_alias_url = |
|
219 | gist_alias_url = | |
220 |
|
220 | |||
221 | ; List of views (using glob pattern syntax) that AUTH TOKENS could be |
|
221 | ; List of views (using glob pattern syntax) that AUTH TOKENS could be | |
222 | ; used for access. |
|
222 | ; used for access. | |
223 | ; Adding ?auth_token=TOKEN_HASH to the url authenticates this request as if it |
|
223 | ; Adding ?auth_token=TOKEN_HASH to the url authenticates this request as if it | |
224 | ; came from the the logged in user who own this authentication token. |
|
224 | ; came from the the logged in user who own this authentication token. | |
225 | ; Additionally @TOKEN syntax can be used to bound the view to specific |
|
225 | ; Additionally @TOKEN syntax can be used to bound the view to specific | |
226 | ; authentication token. Such view would be only accessible when used together |
|
226 | ; authentication token. Such view would be only accessible when used together | |
227 | ; with this authentication token |
|
227 | ; with this authentication token | |
228 | ; list of all views can be found under `/_admin/permissions/auth_token_access` |
|
228 | ; list of all views can be found under `/_admin/permissions/auth_token_access` | |
229 | ; The list should be "," separated and on a single line. |
|
229 | ; The list should be "," separated and on a single line. | |
230 | ; Most common views to enable: |
|
230 | ; Most common views to enable: | |
231 |
|
231 | |||
232 | # RepoCommitsView:repo_commit_download |
|
232 | # RepoCommitsView:repo_commit_download | |
233 | # RepoCommitsView:repo_commit_patch |
|
233 | # RepoCommitsView:repo_commit_patch | |
234 | # RepoCommitsView:repo_commit_raw |
|
234 | # RepoCommitsView:repo_commit_raw | |
235 | # RepoCommitsView:repo_commit_raw@TOKEN |
|
235 | # RepoCommitsView:repo_commit_raw@TOKEN | |
236 | # RepoFilesView:repo_files_diff |
|
236 | # RepoFilesView:repo_files_diff | |
237 | # RepoFilesView:repo_archivefile |
|
237 | # RepoFilesView:repo_archivefile | |
238 | # RepoFilesView:repo_file_raw |
|
238 | # RepoFilesView:repo_file_raw | |
239 | # GistView:* |
|
239 | # GistView:* | |
240 | api_access_controllers_whitelist = |
|
240 | api_access_controllers_whitelist = | |
241 |
|
241 | |||
242 | ; Default encoding used to convert from and to unicode |
|
242 | ; Default encoding used to convert from and to unicode | |
243 | ; can be also a comma separated list of encoding in case of mixed encodings |
|
243 | ; can be also a comma separated list of encoding in case of mixed encodings | |
244 | default_encoding = UTF-8 |
|
244 | default_encoding = UTF-8 | |
245 |
|
245 | |||
246 | ; instance-id prefix |
|
246 | ; instance-id prefix | |
247 | ; a prefix key for this instance used for cache invalidation when running |
|
247 | ; a prefix key for this instance used for cache invalidation when running | |
248 | ; multiple instances of RhodeCode, make sure it's globally unique for |
|
248 | ; multiple instances of RhodeCode, make sure it's globally unique for | |
249 | ; all running RhodeCode instances. Leave empty if you don't use it |
|
249 | ; all running RhodeCode instances. Leave empty if you don't use it | |
250 | instance_id = |
|
250 | instance_id = | |
251 |
|
251 | |||
252 | ; Fallback authentication plugin. Set this to a plugin ID to force the usage |
|
252 | ; Fallback authentication plugin. Set this to a plugin ID to force the usage | |
253 | ; of an authentication plugin also if it is disabled by it's settings. |
|
253 | ; of an authentication plugin also if it is disabled by it's settings. | |
254 | ; This could be useful if you are unable to log in to the system due to broken |
|
254 | ; This could be useful if you are unable to log in to the system due to broken | |
255 | ; authentication settings. Then you can enable e.g. the internal RhodeCode auth |
|
255 | ; authentication settings. Then you can enable e.g. the internal RhodeCode auth | |
256 | ; module to log in again and fix the settings. |
|
256 | ; module to log in again and fix the settings. | |
257 | ; Available builtin plugin IDs (hash is part of the ID): |
|
257 | ; Available builtin plugin IDs (hash is part of the ID): | |
258 | ; egg:rhodecode-enterprise-ce#rhodecode |
|
258 | ; egg:rhodecode-enterprise-ce#rhodecode | |
259 | ; egg:rhodecode-enterprise-ce#pam |
|
259 | ; egg:rhodecode-enterprise-ce#pam | |
260 | ; egg:rhodecode-enterprise-ce#ldap |
|
260 | ; egg:rhodecode-enterprise-ce#ldap | |
261 | ; egg:rhodecode-enterprise-ce#jasig_cas |
|
261 | ; egg:rhodecode-enterprise-ce#jasig_cas | |
262 | ; egg:rhodecode-enterprise-ce#headers |
|
262 | ; egg:rhodecode-enterprise-ce#headers | |
263 | ; egg:rhodecode-enterprise-ce#crowd |
|
263 | ; egg:rhodecode-enterprise-ce#crowd | |
264 |
|
264 | |||
265 | #rhodecode.auth_plugin_fallback = egg:rhodecode-enterprise-ce#rhodecode |
|
265 | #rhodecode.auth_plugin_fallback = egg:rhodecode-enterprise-ce#rhodecode | |
266 |
|
266 | |||
267 | ; Flag to control loading of legacy plugins in py:/path format |
|
267 | ; Flag to control loading of legacy plugins in py:/path format | |
268 | auth_plugin.import_legacy_plugins = true |
|
268 | auth_plugin.import_legacy_plugins = true | |
269 |
|
269 | |||
270 | ; alternative return HTTP header for failed authentication. Default HTTP |
|
270 | ; alternative return HTTP header for failed authentication. Default HTTP | |
271 | ; response is 401 HTTPUnauthorized. Currently HG clients have troubles with |
|
271 | ; response is 401 HTTPUnauthorized. Currently HG clients have troubles with | |
272 | ; handling that causing a series of failed authentication calls. |
|
272 | ; handling that causing a series of failed authentication calls. | |
273 | ; Set this variable to 403 to return HTTPForbidden, or any other HTTP code |
|
273 | ; Set this variable to 403 to return HTTPForbidden, or any other HTTP code | |
274 | ; This will be served instead of default 401 on bad authentication |
|
274 | ; This will be served instead of default 401 on bad authentication | |
275 | auth_ret_code = |
|
275 | auth_ret_code = | |
276 |
|
276 | |||
277 | ; use special detection method when serving auth_ret_code, instead of serving |
|
277 | ; use special detection method when serving auth_ret_code, instead of serving | |
278 | ; ret_code directly, use 401 initially (Which triggers credentials prompt) |
|
278 | ; ret_code directly, use 401 initially (Which triggers credentials prompt) | |
279 | ; and then serve auth_ret_code to clients |
|
279 | ; and then serve auth_ret_code to clients | |
280 | auth_ret_code_detection = false |
|
280 | auth_ret_code_detection = false | |
281 |
|
281 | |||
282 | ; locking return code. When repository is locked return this HTTP code. 2XX |
|
282 | ; locking return code. When repository is locked return this HTTP code. 2XX | |
283 | ; codes don't break the transactions while 4XX codes do |
|
283 | ; codes don't break the transactions while 4XX codes do | |
284 | lock_ret_code = 423 |
|
284 | lock_ret_code = 423 | |
285 |
|
285 | |||
286 | ; allows to change the repository location in settings page |
|
286 | ; allows to change the repository location in settings page | |
287 | allow_repo_location_change = true |
|
287 | allow_repo_location_change = true | |
288 |
|
288 | |||
289 | ; allows to setup custom hooks in settings page |
|
289 | ; allows to setup custom hooks in settings page | |
290 | allow_custom_hooks_settings = true |
|
290 | allow_custom_hooks_settings = true | |
291 |
|
291 | |||
292 | ; Generated license token required for EE edition license. |
|
292 | ; Generated license token required for EE edition license. | |
293 | ; New generated token value can be found in Admin > settings > license page. |
|
293 | ; New generated token value can be found in Admin > settings > license page. | |
294 | license_token = |
|
294 | license_token = | |
295 |
|
295 | |||
296 | ; This flag hides sensitive information on the license page such as token, and license data |
|
296 | ; This flag hides sensitive information on the license page such as token, and license data | |
297 | license.hide_license_info = false |
|
297 | license.hide_license_info = false | |
298 |
|
298 | |||
299 | ; supervisor connection uri, for managing supervisor and logs. |
|
299 | ; supervisor connection uri, for managing supervisor and logs. | |
300 | supervisor.uri = |
|
300 | supervisor.uri = | |
301 |
|
301 | |||
302 | ; supervisord group name/id we only want this RC instance to handle |
|
302 | ; supervisord group name/id we only want this RC instance to handle | |
303 | supervisor.group_id = prod |
|
303 | supervisor.group_id = prod | |
304 |
|
304 | |||
305 | ; Display extended labs settings |
|
305 | ; Display extended labs settings | |
306 | labs_settings_active = true |
|
306 | labs_settings_active = true | |
307 |
|
307 | |||
308 | ; Custom exception store path, defaults to TMPDIR |
|
308 | ; Custom exception store path, defaults to TMPDIR | |
309 | ; This is used to store exception from RhodeCode in shared directory |
|
309 | ; This is used to store exception from RhodeCode in shared directory | |
310 | #exception_tracker.store_path = |
|
310 | #exception_tracker.store_path = | |
311 |
|
311 | |||
312 | ; Send email with exception details when it happens |
|
312 | ; Send email with exception details when it happens | |
313 | #exception_tracker.send_email = false |
|
313 | #exception_tracker.send_email = false | |
314 |
|
314 | |||
315 | ; Comma separated list of recipients for exception emails, |
|
315 | ; Comma separated list of recipients for exception emails, | |
316 | ; e.g admin@rhodecode.com,devops@rhodecode.com |
|
316 | ; e.g admin@rhodecode.com,devops@rhodecode.com | |
317 | ; Can be left empty, then emails will be sent to ALL super-admins |
|
317 | ; Can be left empty, then emails will be sent to ALL super-admins | |
318 | #exception_tracker.send_email_recipients = |
|
318 | #exception_tracker.send_email_recipients = | |
319 |
|
319 | |||
320 | ; optional prefix to Add to email Subject |
|
320 | ; optional prefix to Add to email Subject | |
321 | #exception_tracker.email_prefix = [RHODECODE ERROR] |
|
321 | #exception_tracker.email_prefix = [RHODECODE ERROR] | |
322 |
|
322 | |||
323 | ; File store configuration. This is used to store and serve uploaded files |
|
323 | ; File store configuration. This is used to store and serve uploaded files | |
324 | file_store.enabled = true |
|
324 | file_store.enabled = true | |
325 |
|
325 | |||
326 | ; Storage backend, available options are: local |
|
326 | ; Storage backend, available options are: local | |
327 | file_store.backend = local |
|
327 | file_store.backend = local | |
328 |
|
328 | |||
329 | ; path to store the uploaded binaries |
|
329 | ; path to store the uploaded binaries | |
330 | file_store.storage_path = %(here)s/data/file_store |
|
330 | file_store.storage_path = %(here)s/data/file_store | |
331 |
|
331 | |||
332 |
|
332 | |||
333 | ; ############# |
|
333 | ; ############# | |
334 | ; CELERY CONFIG |
|
334 | ; CELERY CONFIG | |
335 | ; ############# |
|
335 | ; ############# | |
336 |
|
336 | |||
337 | ; manually run celery: /path/to/celery worker -E --beat --app rhodecode.lib.celerylib.loader --scheduler rhodecode.lib.celerylib.scheduler.RcScheduler --loglevel DEBUG --ini /path/to/rhodecode.ini |
|
337 | ; manually run celery: /path/to/celery worker -E --beat --app rhodecode.lib.celerylib.loader --scheduler rhodecode.lib.celerylib.scheduler.RcScheduler --loglevel DEBUG --ini /path/to/rhodecode.ini | |
338 |
|
338 | |||
339 | use_celery = false |
|
339 | use_celery = false | |
340 |
|
340 | |||
341 | ; path to store schedule database |
|
341 | ; path to store schedule database | |
342 | #celerybeat-schedule.path = |
|
342 | #celerybeat-schedule.path = | |
343 |
|
343 | |||
344 | ; connection url to the message broker (default redis) |
|
344 | ; connection url to the message broker (default redis) | |
345 | celery.broker_url = redis://localhost:6379/8 |
|
345 | celery.broker_url = redis://localhost:6379/8 | |
346 |
|
346 | |||
347 | ; rabbitmq example |
|
347 | ; rabbitmq example | |
348 | #celery.broker_url = amqp://rabbitmq:qweqwe@localhost:5672/rabbitmqhost |
|
348 | #celery.broker_url = amqp://rabbitmq:qweqwe@localhost:5672/rabbitmqhost | |
349 |
|
349 | |||
350 | ; maximum tasks to execute before worker restart |
|
350 | ; maximum tasks to execute before worker restart | |
351 | celery.max_tasks_per_child = 100 |
|
351 | celery.max_tasks_per_child = 100 | |
352 |
|
352 | |||
353 | ; tasks will never be sent to the queue, but executed locally instead. |
|
353 | ; tasks will never be sent to the queue, but executed locally instead. | |
354 | celery.task_always_eager = false |
|
354 | celery.task_always_eager = false | |
355 |
|
355 | |||
356 | ; ############# |
|
356 | ; ############# | |
357 | ; DOGPILE CACHE |
|
357 | ; DOGPILE CACHE | |
358 | ; ############# |
|
358 | ; ############# | |
359 |
|
359 | |||
360 | ; Default cache dir for caches. Putting this into a ramdisk can boost performance. |
|
360 | ; Default cache dir for caches. Putting this into a ramdisk can boost performance. | |
361 | ; eg. /tmpfs/data_ramdisk, however this directory might require large amount of space |
|
361 | ; eg. /tmpfs/data_ramdisk, however this directory might require large amount of space | |
362 | cache_dir = %(here)s/data |
|
362 | cache_dir = %(here)s/data | |
363 |
|
363 | |||
364 | ; ********************************************* |
|
364 | ; ********************************************* | |
365 | ; `sql_cache_short` cache for heavy SQL queries |
|
365 | ; `sql_cache_short` cache for heavy SQL queries | |
366 | ; Only supported backend is `memory_lru` |
|
366 | ; Only supported backend is `memory_lru` | |
367 | ; ********************************************* |
|
367 | ; ********************************************* | |
368 | rc_cache.sql_cache_short.backend = dogpile.cache.rc.memory_lru |
|
368 | rc_cache.sql_cache_short.backend = dogpile.cache.rc.memory_lru | |
369 | rc_cache.sql_cache_short.expiration_time = 30 |
|
369 | rc_cache.sql_cache_short.expiration_time = 30 | |
370 |
|
370 | |||
371 |
|
371 | |||
372 | ; ***************************************************** |
|
372 | ; ***************************************************** | |
373 | ; `cache_repo_longterm` cache for repo object instances |
|
373 | ; `cache_repo_longterm` cache for repo object instances | |
374 | ; Only supported backend is `memory_lru` |
|
374 | ; Only supported backend is `memory_lru` | |
375 | ; ***************************************************** |
|
375 | ; ***************************************************** | |
376 | rc_cache.cache_repo_longterm.backend = dogpile.cache.rc.memory_lru |
|
376 | rc_cache.cache_repo_longterm.backend = dogpile.cache.rc.memory_lru | |
377 | ; by default we use 30 Days, cache is still invalidated on push |
|
377 | ; by default we use 30 Days, cache is still invalidated on push | |
378 | rc_cache.cache_repo_longterm.expiration_time = 2592000 |
|
378 | rc_cache.cache_repo_longterm.expiration_time = 2592000 | |
379 | ; max items in LRU cache, set to smaller number to save memory, and expire last used caches |
|
379 | ; max items in LRU cache, set to smaller number to save memory, and expire last used caches | |
380 | rc_cache.cache_repo_longterm.max_size = 10000 |
|
380 | rc_cache.cache_repo_longterm.max_size = 10000 | |
381 |
|
381 | |||
382 |
|
382 | |||
383 | ; ********************************************* |
|
383 | ; ********************************************* | |
384 | ; `cache_general` cache for general purpose use |
|
384 | ; `cache_general` cache for general purpose use | |
385 | ; for simplicity use rc.file_namespace backend, |
|
385 | ; for simplicity use rc.file_namespace backend, | |
386 | ; for performance and scale use rc.redis |
|
386 | ; for performance and scale use rc.redis | |
387 | ; ********************************************* |
|
387 | ; ********************************************* | |
388 | rc_cache.cache_general.backend = dogpile.cache.rc.file_namespace |
|
388 | rc_cache.cache_general.backend = dogpile.cache.rc.file_namespace | |
389 | rc_cache.cache_general.expiration_time = 43200 |
|
389 | rc_cache.cache_general.expiration_time = 43200 | |
390 | ; file cache store path. Defaults to `cache_dir =` value or tempdir if both values are not set |
|
390 | ; file cache store path. Defaults to `cache_dir =` value or tempdir if both values are not set | |
391 | #rc_cache.cache_general.arguments.filename = /tmp/cache_general.db |
|
391 | #rc_cache.cache_general.arguments.filename = /tmp/cache_general.db | |
392 |
|
392 | |||
393 | ; alternative `cache_general` redis backend with distributed lock |
|
393 | ; alternative `cache_general` redis backend with distributed lock | |
394 | #rc_cache.cache_general.backend = dogpile.cache.rc.redis |
|
394 | #rc_cache.cache_general.backend = dogpile.cache.rc.redis | |
395 | #rc_cache.cache_general.expiration_time = 300 |
|
395 | #rc_cache.cache_general.expiration_time = 300 | |
396 |
|
396 | |||
397 | ; redis_expiration_time needs to be greater then expiration_time |
|
397 | ; redis_expiration_time needs to be greater then expiration_time | |
398 | #rc_cache.cache_general.arguments.redis_expiration_time = 7200 |
|
398 | #rc_cache.cache_general.arguments.redis_expiration_time = 7200 | |
399 |
|
399 | |||
400 | #rc_cache.cache_general.arguments.host = localhost |
|
400 | #rc_cache.cache_general.arguments.host = localhost | |
401 | #rc_cache.cache_general.arguments.port = 6379 |
|
401 | #rc_cache.cache_general.arguments.port = 6379 | |
402 | #rc_cache.cache_general.arguments.db = 0 |
|
402 | #rc_cache.cache_general.arguments.db = 0 | |
403 | #rc_cache.cache_general.arguments.socket_timeout = 30 |
|
403 | #rc_cache.cache_general.arguments.socket_timeout = 30 | |
404 | ; more Redis options: https://dogpilecache.sqlalchemy.org/en/latest/api.html#redis-backends |
|
404 | ; more Redis options: https://dogpilecache.sqlalchemy.org/en/latest/api.html#redis-backends | |
405 | #rc_cache.cache_general.arguments.distributed_lock = true |
|
405 | #rc_cache.cache_general.arguments.distributed_lock = true | |
406 |
|
406 | |||
407 | ; auto-renew lock to prevent stale locks, slower but safer. Use only if problems happen |
|
407 | ; auto-renew lock to prevent stale locks, slower but safer. Use only if problems happen | |
408 | #rc_cache.cache_general.arguments.lock_auto_renewal = true |
|
408 | #rc_cache.cache_general.arguments.lock_auto_renewal = true | |
409 |
|
409 | |||
410 | ; ************************************************* |
|
410 | ; ************************************************* | |
411 | ; `cache_perms` cache for permission tree, auth TTL |
|
411 | ; `cache_perms` cache for permission tree, auth TTL | |
412 | ; for simplicity use rc.file_namespace backend, |
|
412 | ; for simplicity use rc.file_namespace backend, | |
413 | ; for performance and scale use rc.redis |
|
413 | ; for performance and scale use rc.redis | |
414 | ; ************************************************* |
|
414 | ; ************************************************* | |
415 | rc_cache.cache_perms.backend = dogpile.cache.rc.file_namespace |
|
415 | rc_cache.cache_perms.backend = dogpile.cache.rc.file_namespace | |
416 | rc_cache.cache_perms.expiration_time = 3600 |
|
416 | rc_cache.cache_perms.expiration_time = 3600 | |
417 | ; file cache store path. Defaults to `cache_dir =` value or tempdir if both values are not set |
|
417 | ; file cache store path. Defaults to `cache_dir =` value or tempdir if both values are not set | |
418 | #rc_cache.cache_perms.arguments.filename = /tmp/cache_perms.db |
|
418 | #rc_cache.cache_perms.arguments.filename = /tmp/cache_perms.db | |
419 |
|
419 | |||
420 | ; alternative `cache_perms` redis backend with distributed lock |
|
420 | ; alternative `cache_perms` redis backend with distributed lock | |
421 | #rc_cache.cache_perms.backend = dogpile.cache.rc.redis |
|
421 | #rc_cache.cache_perms.backend = dogpile.cache.rc.redis | |
422 | #rc_cache.cache_perms.expiration_time = 300 |
|
422 | #rc_cache.cache_perms.expiration_time = 300 | |
423 |
|
423 | |||
424 | ; redis_expiration_time needs to be greater then expiration_time |
|
424 | ; redis_expiration_time needs to be greater then expiration_time | |
425 | #rc_cache.cache_perms.arguments.redis_expiration_time = 7200 |
|
425 | #rc_cache.cache_perms.arguments.redis_expiration_time = 7200 | |
426 |
|
426 | |||
427 | #rc_cache.cache_perms.arguments.host = localhost |
|
427 | #rc_cache.cache_perms.arguments.host = localhost | |
428 | #rc_cache.cache_perms.arguments.port = 6379 |
|
428 | #rc_cache.cache_perms.arguments.port = 6379 | |
429 | #rc_cache.cache_perms.arguments.db = 0 |
|
429 | #rc_cache.cache_perms.arguments.db = 0 | |
430 | #rc_cache.cache_perms.arguments.socket_timeout = 30 |
|
430 | #rc_cache.cache_perms.arguments.socket_timeout = 30 | |
431 | ; more Redis options: https://dogpilecache.sqlalchemy.org/en/latest/api.html#redis-backends |
|
431 | ; more Redis options: https://dogpilecache.sqlalchemy.org/en/latest/api.html#redis-backends | |
432 | #rc_cache.cache_perms.arguments.distributed_lock = true |
|
432 | #rc_cache.cache_perms.arguments.distributed_lock = true | |
433 |
|
433 | |||
434 | ; auto-renew lock to prevent stale locks, slower but safer. Use only if problems happen |
|
434 | ; auto-renew lock to prevent stale locks, slower but safer. Use only if problems happen | |
435 | #rc_cache.cache_perms.arguments.lock_auto_renewal = true |
|
435 | #rc_cache.cache_perms.arguments.lock_auto_renewal = true | |
436 |
|
436 | |||
437 | ; *************************************************** |
|
437 | ; *************************************************** | |
438 | ; `cache_repo` cache for file tree, Readme, RSS FEEDS |
|
438 | ; `cache_repo` cache for file tree, Readme, RSS FEEDS | |
439 | ; for simplicity use rc.file_namespace backend, |
|
439 | ; for simplicity use rc.file_namespace backend, | |
440 | ; for performance and scale use rc.redis |
|
440 | ; for performance and scale use rc.redis | |
441 | ; *************************************************** |
|
441 | ; *************************************************** | |
442 | rc_cache.cache_repo.backend = dogpile.cache.rc.file_namespace |
|
442 | rc_cache.cache_repo.backend = dogpile.cache.rc.file_namespace | |
443 | rc_cache.cache_repo.expiration_time = 2592000 |
|
443 | rc_cache.cache_repo.expiration_time = 2592000 | |
444 | ; file cache store path. Defaults to `cache_dir =` value or tempdir if both values are not set |
|
444 | ; file cache store path. Defaults to `cache_dir =` value or tempdir if both values are not set | |
445 | #rc_cache.cache_repo.arguments.filename = /tmp/cache_repo.db |
|
445 | #rc_cache.cache_repo.arguments.filename = /tmp/cache_repo.db | |
446 |
|
446 | |||
447 | ; alternative `cache_repo` redis backend with distributed lock |
|
447 | ; alternative `cache_repo` redis backend with distributed lock | |
448 | #rc_cache.cache_repo.backend = dogpile.cache.rc.redis |
|
448 | #rc_cache.cache_repo.backend = dogpile.cache.rc.redis | |
449 | #rc_cache.cache_repo.expiration_time = 2592000 |
|
449 | #rc_cache.cache_repo.expiration_time = 2592000 | |
450 |
|
450 | |||
451 | ; redis_expiration_time needs to be greater then expiration_time |
|
451 | ; redis_expiration_time needs to be greater then expiration_time | |
452 | #rc_cache.cache_repo.arguments.redis_expiration_time = 2678400 |
|
452 | #rc_cache.cache_repo.arguments.redis_expiration_time = 2678400 | |
453 |
|
453 | |||
454 | #rc_cache.cache_repo.arguments.host = localhost |
|
454 | #rc_cache.cache_repo.arguments.host = localhost | |
455 | #rc_cache.cache_repo.arguments.port = 6379 |
|
455 | #rc_cache.cache_repo.arguments.port = 6379 | |
456 | #rc_cache.cache_repo.arguments.db = 1 |
|
456 | #rc_cache.cache_repo.arguments.db = 1 | |
457 | #rc_cache.cache_repo.arguments.socket_timeout = 30 |
|
457 | #rc_cache.cache_repo.arguments.socket_timeout = 30 | |
458 | ; more Redis options: https://dogpilecache.sqlalchemy.org/en/latest/api.html#redis-backends |
|
458 | ; more Redis options: https://dogpilecache.sqlalchemy.org/en/latest/api.html#redis-backends | |
459 | #rc_cache.cache_repo.arguments.distributed_lock = true |
|
459 | #rc_cache.cache_repo.arguments.distributed_lock = true | |
460 |
|
460 | |||
461 | ; auto-renew lock to prevent stale locks, slower but safer. Use only if problems happen |
|
461 | ; auto-renew lock to prevent stale locks, slower but safer. Use only if problems happen | |
462 | #rc_cache.cache_repo.arguments.lock_auto_renewal = true |
|
462 | #rc_cache.cache_repo.arguments.lock_auto_renewal = true | |
463 |
|
463 | |||
464 | ; ############## |
|
464 | ; ############## | |
465 | ; BEAKER SESSION |
|
465 | ; BEAKER SESSION | |
466 | ; ############## |
|
466 | ; ############## | |
467 |
|
467 | |||
468 | ; beaker.session.type is type of storage options for the logged users sessions. Current allowed |
|
468 | ; beaker.session.type is type of storage options for the logged users sessions. Current allowed | |
469 | ; types are file, ext:redis, ext:database, ext:memcached, and memory (default if not specified). |
|
469 | ; types are file, ext:redis, ext:database, ext:memcached, and memory (default if not specified). | |
470 | ; Fastest ones are Redis and ext:database |
|
470 | ; Fastest ones are Redis and ext:database | |
471 | beaker.session.type = file |
|
471 | beaker.session.type = file | |
472 | beaker.session.data_dir = %(here)s/data/sessions |
|
472 | beaker.session.data_dir = %(here)s/data/sessions | |
473 |
|
473 | |||
474 | ; Redis based sessions |
|
474 | ; Redis based sessions | |
475 | #beaker.session.type = ext:redis |
|
475 | #beaker.session.type = ext:redis | |
476 | #beaker.session.url = redis://127.0.0.1:6379/2 |
|
476 | #beaker.session.url = redis://127.0.0.1:6379/2 | |
477 |
|
477 | |||
478 | ; DB based session, fast, and allows easy management over logged in users |
|
478 | ; DB based session, fast, and allows easy management over logged in users | |
479 | #beaker.session.type = ext:database |
|
479 | #beaker.session.type = ext:database | |
480 | #beaker.session.table_name = db_session |
|
480 | #beaker.session.table_name = db_session | |
481 | #beaker.session.sa.url = postgresql://postgres:secret@localhost/rhodecode |
|
481 | #beaker.session.sa.url = postgresql://postgres:secret@localhost/rhodecode | |
482 | #beaker.session.sa.url = mysql://root:secret@127.0.0.1/rhodecode |
|
482 | #beaker.session.sa.url = mysql://root:secret@127.0.0.1/rhodecode | |
483 | #beaker.session.sa.pool_recycle = 3600 |
|
483 | #beaker.session.sa.pool_recycle = 3600 | |
484 | #beaker.session.sa.echo = false |
|
484 | #beaker.session.sa.echo = false | |
485 |
|
485 | |||
486 | beaker.session.key = rhodecode |
|
486 | beaker.session.key = rhodecode | |
487 | beaker.session.secret = production-rc-uytcxaz |
|
487 | beaker.session.secret = production-rc-uytcxaz | |
488 | beaker.session.lock_dir = %(here)s/data/sessions/lock |
|
488 | beaker.session.lock_dir = %(here)s/data/sessions/lock | |
489 |
|
489 | |||
490 | ; Secure encrypted cookie. Requires AES and AES python libraries |
|
490 | ; Secure encrypted cookie. Requires AES and AES python libraries | |
491 | ; you must disable beaker.session.secret to use this |
|
491 | ; you must disable beaker.session.secret to use this | |
492 | #beaker.session.encrypt_key = key_for_encryption |
|
492 | #beaker.session.encrypt_key = key_for_encryption | |
493 | #beaker.session.validate_key = validation_key |
|
493 | #beaker.session.validate_key = validation_key | |
494 |
|
494 | |||
495 | ; Sets session as invalid (also logging out user) if it haven not been |
|
495 | ; Sets session as invalid (also logging out user) if it haven not been | |
496 | ; accessed for given amount of time in seconds |
|
496 | ; accessed for given amount of time in seconds | |
497 | beaker.session.timeout = 2592000 |
|
497 | beaker.session.timeout = 2592000 | |
498 | beaker.session.httponly = true |
|
498 | beaker.session.httponly = true | |
499 |
|
499 | |||
500 | ; Path to use for the cookie. Set to prefix if you use prefix middleware |
|
500 | ; Path to use for the cookie. Set to prefix if you use prefix middleware | |
501 | #beaker.session.cookie_path = /custom_prefix |
|
501 | #beaker.session.cookie_path = /custom_prefix | |
502 |
|
502 | |||
503 | ; Set https secure cookie |
|
503 | ; Set https secure cookie | |
504 | beaker.session.secure = false |
|
504 | beaker.session.secure = false | |
505 |
|
505 | |||
506 | ; default cookie expiration time in seconds, set to `true` to set expire |
|
506 | ; default cookie expiration time in seconds, set to `true` to set expire | |
507 | ; at browser close |
|
507 | ; at browser close | |
508 | #beaker.session.cookie_expires = 3600 |
|
508 | #beaker.session.cookie_expires = 3600 | |
509 |
|
509 | |||
510 | ; ############################# |
|
510 | ; ############################# | |
511 | ; SEARCH INDEXING CONFIGURATION |
|
511 | ; SEARCH INDEXING CONFIGURATION | |
512 | ; ############################# |
|
512 | ; ############################# | |
513 |
|
513 | |||
514 | ; Full text search indexer is available in rhodecode-tools under |
|
514 | ; Full text search indexer is available in rhodecode-tools under | |
515 | ; `rhodecode-tools index` command |
|
515 | ; `rhodecode-tools index` command | |
516 |
|
516 | |||
517 | ; WHOOSH Backend, doesn't require additional services to run |
|
517 | ; WHOOSH Backend, doesn't require additional services to run | |
518 | ; it works good with few dozen repos |
|
518 | ; it works good with few dozen repos | |
519 | search.module = rhodecode.lib.index.whoosh |
|
519 | search.module = rhodecode.lib.index.whoosh | |
520 | search.location = %(here)s/data/index |
|
520 | search.location = %(here)s/data/index | |
521 |
|
521 | |||
522 | ; #################### |
|
522 | ; #################### | |
523 | ; CHANNELSTREAM CONFIG |
|
523 | ; CHANNELSTREAM CONFIG | |
524 | ; #################### |
|
524 | ; #################### | |
525 |
|
525 | |||
526 | ; channelstream enables persistent connections and live notification |
|
526 | ; channelstream enables persistent connections and live notification | |
527 | ; in the system. It's also used by the chat system |
|
527 | ; in the system. It's also used by the chat system | |
528 |
|
528 | |||
529 | channelstream.enabled = false |
|
529 | channelstream.enabled = false | |
530 |
|
530 | |||
531 | ; server address for channelstream server on the backend |
|
531 | ; server address for channelstream server on the backend | |
532 | channelstream.server = 127.0.0.1:9800 |
|
532 | channelstream.server = 127.0.0.1:9800 | |
533 |
|
533 | |||
534 | ; location of the channelstream server from outside world |
|
534 | ; location of the channelstream server from outside world | |
535 | ; use ws:// for http or wss:// for https. This address needs to be handled |
|
535 | ; use ws:// for http or wss:// for https. This address needs to be handled | |
536 | ; by external HTTP server such as Nginx or Apache |
|
536 | ; by external HTTP server such as Nginx or Apache | |
537 | ; see Nginx/Apache configuration examples in our docs |
|
537 | ; see Nginx/Apache configuration examples in our docs | |
538 | channelstream.ws_url = ws://rhodecode.yourserver.com/_channelstream |
|
538 | channelstream.ws_url = ws://rhodecode.yourserver.com/_channelstream | |
539 | channelstream.secret = secret |
|
539 | channelstream.secret = secret | |
540 | channelstream.history.location = %(here)s/channelstream_history |
|
540 | channelstream.history.location = %(here)s/channelstream_history | |
541 |
|
541 | |||
542 | ; Internal application path that Javascript uses to connect into. |
|
542 | ; Internal application path that Javascript uses to connect into. | |
543 | ; If you use proxy-prefix the prefix should be added before /_channelstream |
|
543 | ; If you use proxy-prefix the prefix should be added before /_channelstream | |
544 | channelstream.proxy_path = /_channelstream |
|
544 | channelstream.proxy_path = /_channelstream | |
545 |
|
545 | |||
546 |
|
546 | |||
547 | ; ############################## |
|
547 | ; ############################## | |
548 | ; MAIN RHODECODE DATABASE CONFIG |
|
548 | ; MAIN RHODECODE DATABASE CONFIG | |
549 | ; ############################## |
|
549 | ; ############################## | |
550 |
|
550 | |||
551 | #sqlalchemy.db1.url = sqlite:///%(here)s/rhodecode.db?timeout=30 |
|
551 | #sqlalchemy.db1.url = sqlite:///%(here)s/rhodecode.db?timeout=30 | |
552 | #sqlalchemy.db1.url = postgresql://postgres:qweqwe@localhost/rhodecode |
|
552 | #sqlalchemy.db1.url = postgresql://postgres:qweqwe@localhost/rhodecode | |
553 | #sqlalchemy.db1.url = mysql://root:qweqwe@localhost/rhodecode?charset=utf8 |
|
553 | #sqlalchemy.db1.url = mysql://root:qweqwe@localhost/rhodecode?charset=utf8 | |
554 | ; pymysql is an alternative driver for MySQL, use in case of problems with default one |
|
554 | ; pymysql is an alternative driver for MySQL, use in case of problems with default one | |
555 | #sqlalchemy.db1.url = mysql+pymysql://root:qweqwe@localhost/rhodecode |
|
555 | #sqlalchemy.db1.url = mysql+pymysql://root:qweqwe@localhost/rhodecode | |
556 |
|
556 | |||
557 | sqlalchemy.db1.url = postgresql://postgres:qweqwe@localhost/rhodecode |
|
557 | sqlalchemy.db1.url = postgresql://postgres:qweqwe@localhost/rhodecode | |
558 |
|
558 | |||
559 | ; see sqlalchemy docs for other advanced settings |
|
559 | ; see sqlalchemy docs for other advanced settings | |
560 | ; print the sql statements to output |
|
560 | ; print the sql statements to output | |
561 | sqlalchemy.db1.echo = false |
|
561 | sqlalchemy.db1.echo = false | |
562 |
|
562 | |||
563 | ; recycle the connections after this amount of seconds |
|
563 | ; recycle the connections after this amount of seconds | |
564 | sqlalchemy.db1.pool_recycle = 3600 |
|
564 | sqlalchemy.db1.pool_recycle = 3600 | |
565 | sqlalchemy.db1.convert_unicode = true |
|
565 | sqlalchemy.db1.convert_unicode = true | |
566 |
|
566 | |||
567 | ; the number of connections to keep open inside the connection pool. |
|
567 | ; the number of connections to keep open inside the connection pool. | |
568 | ; 0 indicates no limit |
|
568 | ; 0 indicates no limit | |
569 | #sqlalchemy.db1.pool_size = 5 |
|
569 | #sqlalchemy.db1.pool_size = 5 | |
570 |
|
570 | |||
571 | ; The number of connections to allow in connection pool "overflow", that is |
|
571 | ; The number of connections to allow in connection pool "overflow", that is | |
572 | ; connections that can be opened above and beyond the pool_size setting, |
|
572 | ; connections that can be opened above and beyond the pool_size setting, | |
573 | ; which defaults to five. |
|
573 | ; which defaults to five. | |
574 | #sqlalchemy.db1.max_overflow = 10 |
|
574 | #sqlalchemy.db1.max_overflow = 10 | |
575 |
|
575 | |||
576 | ; Connection check ping, used to detect broken database connections |
|
576 | ; Connection check ping, used to detect broken database connections | |
577 | ; could be enabled to better handle cases if MySQL has gone away errors |
|
577 | ; could be enabled to better handle cases if MySQL has gone away errors | |
578 | #sqlalchemy.db1.ping_connection = true |
|
578 | #sqlalchemy.db1.ping_connection = true | |
579 |
|
579 | |||
580 | ; ########## |
|
580 | ; ########## | |
581 | ; VCS CONFIG |
|
581 | ; VCS CONFIG | |
582 | ; ########## |
|
582 | ; ########## | |
583 | vcs.server.enable = true |
|
583 | vcs.server.enable = true | |
584 | vcs.server = localhost:9900 |
|
584 | vcs.server = localhost:9900 | |
585 |
|
585 | |||
586 | ; Web server connectivity protocol, responsible for web based VCS operations |
|
586 | ; Web server connectivity protocol, responsible for web based VCS operations | |
587 | ; Available protocols are: |
|
587 | ; Available protocols are: | |
588 | ; `http` - use http-rpc backend (default) |
|
588 | ; `http` - use http-rpc backend (default) | |
589 | vcs.server.protocol = http |
|
589 | vcs.server.protocol = http | |
590 |
|
590 | |||
591 | ; Push/Pull operations protocol, available options are: |
|
591 | ; Push/Pull operations protocol, available options are: | |
592 | ; `http` - use http-rpc backend (default) |
|
592 | ; `http` - use http-rpc backend (default) | |
593 | vcs.scm_app_implementation = http |
|
593 | vcs.scm_app_implementation = http | |
594 |
|
594 | |||
595 | ; Push/Pull operations hooks protocol, available options are: |
|
595 | ; Push/Pull operations hooks protocol, available options are: | |
596 | ; `http` - use http-rpc backend (default) |
|
596 | ; `http` - use http-rpc backend (default) | |
597 | vcs.hooks.protocol = http |
|
597 | vcs.hooks.protocol = http | |
598 |
|
598 | |||
599 |
; Host on which this instance is listening for hooks. |
|
599 | ; Host on which this instance is listening for hooks. vcsserver will call this host to pull/push hooks so it should be | |
600 | ; this should be adjusted. |
|
600 | ; accessible via network. | |
601 | vcs.hooks.host = 127.0.0.1 |
|
601 | ; Use vcs.hooks.host = "*" to bind to current hostname (for Docker) | |
|
602 | vcs.hooks.host = * | |||
602 |
|
603 | |||
603 | ; Start VCSServer with this instance as a subprocess, useful for development |
|
604 | ; Start VCSServer with this instance as a subprocess, useful for development | |
604 | vcs.start_server = false |
|
605 | vcs.start_server = false | |
605 |
|
606 | |||
606 | ; List of enabled VCS backends, available options are: |
|
607 | ; List of enabled VCS backends, available options are: | |
607 | ; `hg` - mercurial |
|
608 | ; `hg` - mercurial | |
608 | ; `git` - git |
|
609 | ; `git` - git | |
609 | ; `svn` - subversion |
|
610 | ; `svn` - subversion | |
610 | vcs.backends = hg, git, svn |
|
611 | vcs.backends = hg, git, svn | |
611 |
|
612 | |||
612 | ; Wait this number of seconds before killing connection to the vcsserver |
|
613 | ; Wait this number of seconds before killing connection to the vcsserver | |
613 | vcs.connection_timeout = 3600 |
|
614 | vcs.connection_timeout = 3600 | |
614 |
|
615 | |||
615 | ; Compatibility version when creating SVN repositories. Defaults to newest version when commented out. |
|
616 | ; Compatibility version when creating SVN repositories. Defaults to newest version when commented out. | |
616 | ; Set a numeric version for your current SVN e.g 1.8, or 1.12 |
|
617 | ; Set a numeric version for your current SVN e.g 1.8, or 1.12 | |
617 | ; Legacy available options are: pre-1.4-compatible, pre-1.5-compatible, pre-1.6-compatible, pre-1.8-compatible, pre-1.9-compatible |
|
618 | ; Legacy available options are: pre-1.4-compatible, pre-1.5-compatible, pre-1.6-compatible, pre-1.8-compatible, pre-1.9-compatible | |
618 | #vcs.svn.compatible_version = 1.8 |
|
619 | #vcs.svn.compatible_version = 1.8 | |
619 |
|
620 | |||
620 | ; Cache flag to cache vcsserver remote calls locally |
|
621 | ; Cache flag to cache vcsserver remote calls locally | |
621 | ; It uses cache_region `cache_repo` |
|
622 | ; It uses cache_region `cache_repo` | |
622 | vcs.methods.cache = true |
|
623 | vcs.methods.cache = true | |
623 |
|
624 | |||
624 | ; #################################################### |
|
625 | ; #################################################### | |
625 | ; Subversion proxy support (mod_dav_svn) |
|
626 | ; Subversion proxy support (mod_dav_svn) | |
626 | ; Maps RhodeCode repo groups into SVN paths for Apache |
|
627 | ; Maps RhodeCode repo groups into SVN paths for Apache | |
627 | ; #################################################### |
|
628 | ; #################################################### | |
628 |
|
629 | |||
629 | ; Enable or disable the config file generation. |
|
630 | ; Enable or disable the config file generation. | |
630 | svn.proxy.generate_config = false |
|
631 | svn.proxy.generate_config = false | |
631 |
|
632 | |||
632 | ; Generate config file with `SVNListParentPath` set to `On`. |
|
633 | ; Generate config file with `SVNListParentPath` set to `On`. | |
633 | svn.proxy.list_parent_path = true |
|
634 | svn.proxy.list_parent_path = true | |
634 |
|
635 | |||
635 | ; Set location and file name of generated config file. |
|
636 | ; Set location and file name of generated config file. | |
636 | svn.proxy.config_file_path = %(here)s/mod_dav_svn.conf |
|
637 | svn.proxy.config_file_path = %(here)s/mod_dav_svn.conf | |
637 |
|
638 | |||
638 | ; alternative mod_dav config template. This needs to be a valid mako template |
|
639 | ; alternative mod_dav config template. This needs to be a valid mako template | |
639 | ; Example template can be found in the source code: |
|
640 | ; Example template can be found in the source code: | |
640 | ; rhodecode/apps/svn_support/templates/mod-dav-svn.conf.mako |
|
641 | ; rhodecode/apps/svn_support/templates/mod-dav-svn.conf.mako | |
641 | #svn.proxy.config_template = ~/.rccontrol/enterprise-1/custom_svn_conf.mako |
|
642 | #svn.proxy.config_template = ~/.rccontrol/enterprise-1/custom_svn_conf.mako | |
642 |
|
643 | |||
643 | ; Used as a prefix to the `Location` block in the generated config file. |
|
644 | ; Used as a prefix to the `Location` block in the generated config file. | |
644 | ; In most cases it should be set to `/`. |
|
645 | ; In most cases it should be set to `/`. | |
645 | svn.proxy.location_root = / |
|
646 | svn.proxy.location_root = / | |
646 |
|
647 | |||
647 | ; Command to reload the mod dav svn configuration on change. |
|
648 | ; Command to reload the mod dav svn configuration on change. | |
648 | ; Example: `/etc/init.d/apache2 reload` or /home/USER/apache_reload.sh |
|
649 | ; Example: `/etc/init.d/apache2 reload` or /home/USER/apache_reload.sh | |
649 | ; Make sure user who runs RhodeCode process is allowed to reload Apache |
|
650 | ; Make sure user who runs RhodeCode process is allowed to reload Apache | |
650 | #svn.proxy.reload_cmd = /etc/init.d/apache2 reload |
|
651 | #svn.proxy.reload_cmd = /etc/init.d/apache2 reload | |
651 |
|
652 | |||
652 | ; If the timeout expires before the reload command finishes, the command will |
|
653 | ; If the timeout expires before the reload command finishes, the command will | |
653 | ; be killed. Setting it to zero means no timeout. Defaults to 10 seconds. |
|
654 | ; be killed. Setting it to zero means no timeout. Defaults to 10 seconds. | |
654 | #svn.proxy.reload_timeout = 10 |
|
655 | #svn.proxy.reload_timeout = 10 | |
655 |
|
656 | |||
656 | ; #################### |
|
657 | ; #################### | |
657 | ; SSH Support Settings |
|
658 | ; SSH Support Settings | |
658 | ; #################### |
|
659 | ; #################### | |
659 |
|
660 | |||
660 | ; Defines if a custom authorized_keys file should be created and written on |
|
661 | ; Defines if a custom authorized_keys file should be created and written on | |
661 | ; any change user ssh keys. Setting this to false also disables possibility |
|
662 | ; any change user ssh keys. Setting this to false also disables possibility | |
662 | ; of adding SSH keys by users from web interface. Super admins can still |
|
663 | ; of adding SSH keys by users from web interface. Super admins can still | |
663 | ; manage SSH Keys. |
|
664 | ; manage SSH Keys. | |
664 | ssh.generate_authorized_keyfile = false |
|
665 | ssh.generate_authorized_keyfile = false | |
665 |
|
666 | |||
666 | ; Options for ssh, default is `no-pty,no-port-forwarding,no-X11-forwarding,no-agent-forwarding` |
|
667 | ; Options for ssh, default is `no-pty,no-port-forwarding,no-X11-forwarding,no-agent-forwarding` | |
667 | # ssh.authorized_keys_ssh_opts = |
|
668 | # ssh.authorized_keys_ssh_opts = | |
668 |
|
669 | |||
669 | ; Path to the authorized_keys file where the generate entries are placed. |
|
670 | ; Path to the authorized_keys file where the generate entries are placed. | |
670 | ; It is possible to have multiple key files specified in `sshd_config` e.g. |
|
671 | ; It is possible to have multiple key files specified in `sshd_config` e.g. | |
671 | ; AuthorizedKeysFile %h/.ssh/authorized_keys %h/.ssh/authorized_keys_rhodecode |
|
672 | ; AuthorizedKeysFile %h/.ssh/authorized_keys %h/.ssh/authorized_keys_rhodecode | |
672 | ssh.authorized_keys_file_path = ~/.ssh/authorized_keys_rhodecode |
|
673 | ssh.authorized_keys_file_path = ~/.ssh/authorized_keys_rhodecode | |
673 |
|
674 | |||
674 | ; Command to execute the SSH wrapper. The binary is available in the |
|
675 | ; Command to execute the SSH wrapper. The binary is available in the | |
675 | ; RhodeCode installation directory. |
|
676 | ; RhodeCode installation directory. | |
676 | ; e.g ~/.rccontrol/community-1/profile/bin/rc-ssh-wrapper |
|
677 | ; e.g ~/.rccontrol/community-1/profile/bin/rc-ssh-wrapper | |
677 | ssh.wrapper_cmd = ~/.rccontrol/community-1/rc-ssh-wrapper |
|
678 | ssh.wrapper_cmd = ~/.rccontrol/community-1/rc-ssh-wrapper | |
678 |
|
679 | |||
679 | ; Allow shell when executing the ssh-wrapper command |
|
680 | ; Allow shell when executing the ssh-wrapper command | |
680 | ssh.wrapper_cmd_allow_shell = false |
|
681 | ssh.wrapper_cmd_allow_shell = false | |
681 |
|
682 | |||
682 | ; Enables logging, and detailed output send back to the client during SSH |
|
683 | ; Enables logging, and detailed output send back to the client during SSH | |
683 | ; operations. Useful for debugging, shouldn't be used in production. |
|
684 | ; operations. Useful for debugging, shouldn't be used in production. | |
684 | ssh.enable_debug_logging = false |
|
685 | ssh.enable_debug_logging = false | |
685 |
|
686 | |||
686 | ; Paths to binary executable, by default they are the names, but we can |
|
687 | ; Paths to binary executable, by default they are the names, but we can | |
687 | ; override them if we want to use a custom one |
|
688 | ; override them if we want to use a custom one | |
688 | ssh.executable.hg = ~/.rccontrol/vcsserver-1/profile/bin/hg |
|
689 | ssh.executable.hg = ~/.rccontrol/vcsserver-1/profile/bin/hg | |
689 | ssh.executable.git = ~/.rccontrol/vcsserver-1/profile/bin/git |
|
690 | ssh.executable.git = ~/.rccontrol/vcsserver-1/profile/bin/git | |
690 | ssh.executable.svn = ~/.rccontrol/vcsserver-1/profile/bin/svnserve |
|
691 | ssh.executable.svn = ~/.rccontrol/vcsserver-1/profile/bin/svnserve | |
691 |
|
692 | |||
692 | ; Enables SSH key generator web interface. Disabling this still allows users |
|
693 | ; Enables SSH key generator web interface. Disabling this still allows users | |
693 | ; to add their own keys. |
|
694 | ; to add their own keys. | |
694 | ssh.enable_ui_key_generator = true |
|
695 | ssh.enable_ui_key_generator = true | |
695 |
|
696 | |||
696 |
|
697 | |||
697 | ; ################# |
|
698 | ; ################# | |
698 | ; APPENLIGHT CONFIG |
|
699 | ; APPENLIGHT CONFIG | |
699 | ; ################# |
|
700 | ; ################# | |
700 |
|
701 | |||
701 | ; Appenlight is tailored to work with RhodeCode, see |
|
702 | ; Appenlight is tailored to work with RhodeCode, see | |
702 | ; http://appenlight.rhodecode.com for details how to obtain an account |
|
703 | ; http://appenlight.rhodecode.com for details how to obtain an account | |
703 |
|
704 | |||
704 | ; Appenlight integration enabled |
|
705 | ; Appenlight integration enabled | |
705 | #appenlight = false |
|
706 | #appenlight = false | |
706 |
|
707 | |||
707 | #appenlight.server_url = https://api.appenlight.com |
|
708 | #appenlight.server_url = https://api.appenlight.com | |
708 | #appenlight.api_key = YOUR_API_KEY |
|
709 | #appenlight.api_key = YOUR_API_KEY | |
709 | #appenlight.transport_config = https://api.appenlight.com?threaded=1&timeout=5 |
|
710 | #appenlight.transport_config = https://api.appenlight.com?threaded=1&timeout=5 | |
710 |
|
711 | |||
711 | ; used for JS client |
|
712 | ; used for JS client | |
712 | #appenlight.api_public_key = YOUR_API_PUBLIC_KEY |
|
713 | #appenlight.api_public_key = YOUR_API_PUBLIC_KEY | |
713 |
|
714 | |||
714 | ; TWEAK AMOUNT OF INFO SENT HERE |
|
715 | ; TWEAK AMOUNT OF INFO SENT HERE | |
715 |
|
716 | |||
716 | ; enables 404 error logging (default False) |
|
717 | ; enables 404 error logging (default False) | |
717 | #appenlight.report_404 = false |
|
718 | #appenlight.report_404 = false | |
718 |
|
719 | |||
719 | ; time in seconds after request is considered being slow (default 1) |
|
720 | ; time in seconds after request is considered being slow (default 1) | |
720 | #appenlight.slow_request_time = 1 |
|
721 | #appenlight.slow_request_time = 1 | |
721 |
|
722 | |||
722 | ; record slow requests in application |
|
723 | ; record slow requests in application | |
723 | ; (needs to be enabled for slow datastore recording and time tracking) |
|
724 | ; (needs to be enabled for slow datastore recording and time tracking) | |
724 | #appenlight.slow_requests = true |
|
725 | #appenlight.slow_requests = true | |
725 |
|
726 | |||
726 | ; enable hooking to application loggers |
|
727 | ; enable hooking to application loggers | |
727 | #appenlight.logging = true |
|
728 | #appenlight.logging = true | |
728 |
|
729 | |||
729 | ; minimum log level for log capture |
|
730 | ; minimum log level for log capture | |
730 | #ppenlight.logging.level = WARNING |
|
731 | #ppenlight.logging.level = WARNING | |
731 |
|
732 | |||
732 | ; send logs only from erroneous/slow requests |
|
733 | ; send logs only from erroneous/slow requests | |
733 | ; (saves API quota for intensive logging) |
|
734 | ; (saves API quota for intensive logging) | |
734 | #appenlight.logging_on_error = false |
|
735 | #appenlight.logging_on_error = false | |
735 |
|
736 | |||
736 | ; list of additional keywords that should be grabbed from environ object |
|
737 | ; list of additional keywords that should be grabbed from environ object | |
737 | ; can be string with comma separated list of words in lowercase |
|
738 | ; can be string with comma separated list of words in lowercase | |
738 | ; (by default client will always send following info: |
|
739 | ; (by default client will always send following info: | |
739 | ; 'REMOTE_USER', 'REMOTE_ADDR', 'SERVER_NAME', 'CONTENT_TYPE' + all keys that |
|
740 | ; 'REMOTE_USER', 'REMOTE_ADDR', 'SERVER_NAME', 'CONTENT_TYPE' + all keys that | |
740 | ; start with HTTP* this list be extended with additional keywords here |
|
741 | ; start with HTTP* this list be extended with additional keywords here | |
741 | #appenlight.environ_keys_whitelist = |
|
742 | #appenlight.environ_keys_whitelist = | |
742 |
|
743 | |||
743 | ; list of keywords that should be blanked from request object |
|
744 | ; list of keywords that should be blanked from request object | |
744 | ; can be string with comma separated list of words in lowercase |
|
745 | ; can be string with comma separated list of words in lowercase | |
745 | ; (by default client will always blank keys that contain following words |
|
746 | ; (by default client will always blank keys that contain following words | |
746 | ; 'password', 'passwd', 'pwd', 'auth_tkt', 'secret', 'csrf' |
|
747 | ; 'password', 'passwd', 'pwd', 'auth_tkt', 'secret', 'csrf' | |
747 | ; this list be extended with additional keywords set here |
|
748 | ; this list be extended with additional keywords set here | |
748 | #appenlight.request_keys_blacklist = |
|
749 | #appenlight.request_keys_blacklist = | |
749 |
|
750 | |||
750 | ; list of namespaces that should be ignores when gathering log entries |
|
751 | ; list of namespaces that should be ignores when gathering log entries | |
751 | ; can be string with comma separated list of namespaces |
|
752 | ; can be string with comma separated list of namespaces | |
752 | ; (by default the client ignores own entries: appenlight_client.client) |
|
753 | ; (by default the client ignores own entries: appenlight_client.client) | |
753 | #appenlight.log_namespace_blacklist = |
|
754 | #appenlight.log_namespace_blacklist = | |
754 |
|
755 | |||
755 | ; Statsd client config, this is used to send metrics to statsd |
|
756 | ; Statsd client config, this is used to send metrics to statsd | |
756 | ; We recommend setting statsd_exported and scrape them using Promethues |
|
757 | ; We recommend setting statsd_exported and scrape them using Promethues | |
757 | #statsd.enabled = false |
|
758 | #statsd.enabled = false | |
758 | #statsd.statsd_host = 0.0.0.0 |
|
759 | #statsd.statsd_host = 0.0.0.0 | |
759 | #statsd.statsd_port = 8125 |
|
760 | #statsd.statsd_port = 8125 | |
760 | #statsd.statsd_prefix = |
|
761 | #statsd.statsd_prefix = | |
761 | #statsd.statsd_ipv6 = false |
|
762 | #statsd.statsd_ipv6 = false | |
762 |
|
763 | |||
763 | ; configure logging automatically at server startup set to false |
|
764 | ; configure logging automatically at server startup set to false | |
764 | ; to use the below custom logging config. |
|
765 | ; to use the below custom logging config. | |
765 | ; RC_LOGGING_FORMATTER |
|
766 | ; RC_LOGGING_FORMATTER | |
766 | ; RC_LOGGING_LEVEL |
|
767 | ; RC_LOGGING_LEVEL | |
767 | ; env variables can control the settings for logging in case of autoconfigure |
|
768 | ; env variables can control the settings for logging in case of autoconfigure | |
768 |
|
769 | |||
769 | #logging.autoconfigure = true |
|
770 | #logging.autoconfigure = true | |
770 |
|
771 | |||
771 | ; specify your own custom logging config file to configure logging |
|
772 | ; specify your own custom logging config file to configure logging | |
772 | #logging.logging_conf_file = /path/to/custom_logging.ini |
|
773 | #logging.logging_conf_file = /path/to/custom_logging.ini | |
773 |
|
774 | |||
774 | ; Dummy marker to add new entries after. |
|
775 | ; Dummy marker to add new entries after. | |
775 | ; Add any custom entries below. Please don't remove this marker. |
|
776 | ; Add any custom entries below. Please don't remove this marker. | |
776 | custom.conf = 1 |
|
777 | custom.conf = 1 | |
777 |
|
778 | |||
778 |
|
779 | |||
779 | ; ##################### |
|
780 | ; ##################### | |
780 | ; LOGGING CONFIGURATION |
|
781 | ; LOGGING CONFIGURATION | |
781 | ; ##################### |
|
782 | ; ##################### | |
782 |
|
783 | |||
783 | [loggers] |
|
784 | [loggers] | |
784 | keys = root, sqlalchemy, beaker, celery, rhodecode, ssh_wrapper |
|
785 | keys = root, sqlalchemy, beaker, celery, rhodecode, ssh_wrapper | |
785 |
|
786 | |||
786 | [handlers] |
|
787 | [handlers] | |
787 | keys = console, console_sql |
|
788 | keys = console, console_sql | |
788 |
|
789 | |||
789 | [formatters] |
|
790 | [formatters] | |
790 | keys = generic, json, color_formatter, color_formatter_sql |
|
791 | keys = generic, json, color_formatter, color_formatter_sql | |
791 |
|
792 | |||
792 | ; ####### |
|
793 | ; ####### | |
793 | ; LOGGERS |
|
794 | ; LOGGERS | |
794 | ; ####### |
|
795 | ; ####### | |
795 | [logger_root] |
|
796 | [logger_root] | |
796 | level = NOTSET |
|
797 | level = NOTSET | |
797 | handlers = console |
|
798 | handlers = console | |
798 |
|
799 | |||
799 | [logger_sqlalchemy] |
|
800 | [logger_sqlalchemy] | |
800 | level = INFO |
|
801 | level = INFO | |
801 | handlers = console_sql |
|
802 | handlers = console_sql | |
802 | qualname = sqlalchemy.engine |
|
803 | qualname = sqlalchemy.engine | |
803 | propagate = 0 |
|
804 | propagate = 0 | |
804 |
|
805 | |||
805 | [logger_beaker] |
|
806 | [logger_beaker] | |
806 | level = DEBUG |
|
807 | level = DEBUG | |
807 | handlers = |
|
808 | handlers = | |
808 | qualname = beaker.container |
|
809 | qualname = beaker.container | |
809 | propagate = 1 |
|
810 | propagate = 1 | |
810 |
|
811 | |||
811 | [logger_rhodecode] |
|
812 | [logger_rhodecode] | |
812 | level = DEBUG |
|
813 | level = DEBUG | |
813 | handlers = |
|
814 | handlers = | |
814 | qualname = rhodecode |
|
815 | qualname = rhodecode | |
815 | propagate = 1 |
|
816 | propagate = 1 | |
816 |
|
817 | |||
817 | [logger_ssh_wrapper] |
|
818 | [logger_ssh_wrapper] | |
818 | level = DEBUG |
|
819 | level = DEBUG | |
819 | handlers = |
|
820 | handlers = | |
820 | qualname = ssh_wrapper |
|
821 | qualname = ssh_wrapper | |
821 | propagate = 1 |
|
822 | propagate = 1 | |
822 |
|
823 | |||
823 | [logger_celery] |
|
824 | [logger_celery] | |
824 | level = DEBUG |
|
825 | level = DEBUG | |
825 | handlers = |
|
826 | handlers = | |
826 | qualname = celery |
|
827 | qualname = celery | |
827 |
|
828 | |||
828 |
|
829 | |||
829 | ; ######## |
|
830 | ; ######## | |
830 | ; HANDLERS |
|
831 | ; HANDLERS | |
831 | ; ######## |
|
832 | ; ######## | |
832 |
|
833 | |||
833 | [handler_console] |
|
834 | [handler_console] | |
834 | class = StreamHandler |
|
835 | class = StreamHandler | |
835 | args = (sys.stderr, ) |
|
836 | args = (sys.stderr, ) | |
836 | level = INFO |
|
837 | level = INFO | |
837 | ; To enable JSON formatted logs replace 'generic/color_formatter' with 'json' |
|
838 | ; To enable JSON formatted logs replace 'generic/color_formatter' with 'json' | |
838 | ; This allows sending properly formatted logs to grafana loki or elasticsearch |
|
839 | ; This allows sending properly formatted logs to grafana loki or elasticsearch | |
839 | formatter = generic |
|
840 | formatter = generic | |
840 |
|
841 | |||
841 | [handler_console_sql] |
|
842 | [handler_console_sql] | |
842 | ; "level = DEBUG" logs SQL queries and results. |
|
843 | ; "level = DEBUG" logs SQL queries and results. | |
843 | ; "level = INFO" logs SQL queries. |
|
844 | ; "level = INFO" logs SQL queries. | |
844 | ; "level = WARN" logs neither. (Recommended for production systems.) |
|
845 | ; "level = WARN" logs neither. (Recommended for production systems.) | |
845 | class = StreamHandler |
|
846 | class = StreamHandler | |
846 | args = (sys.stderr, ) |
|
847 | args = (sys.stderr, ) | |
847 | level = WARN |
|
848 | level = WARN | |
848 | ; To enable JSON formatted logs replace 'generic/color_formatter_sql' with 'json' |
|
849 | ; To enable JSON formatted logs replace 'generic/color_formatter_sql' with 'json' | |
849 | ; This allows sending properly formatted logs to grafana loki or elasticsearch |
|
850 | ; This allows sending properly formatted logs to grafana loki or elasticsearch | |
850 | formatter = generic |
|
851 | formatter = generic | |
851 |
|
852 | |||
852 | ; ########## |
|
853 | ; ########## | |
853 | ; FORMATTERS |
|
854 | ; FORMATTERS | |
854 | ; ########## |
|
855 | ; ########## | |
855 |
|
856 | |||
856 | [formatter_generic] |
|
857 | [formatter_generic] | |
857 | class = rhodecode.lib.logging_formatter.ExceptionAwareFormatter |
|
858 | class = rhodecode.lib.logging_formatter.ExceptionAwareFormatter | |
858 | format = %(asctime)s.%(msecs)03d [%(process)d] %(levelname)-5.5s [%(name)s] %(message)s |
|
859 | format = %(asctime)s.%(msecs)03d [%(process)d] %(levelname)-5.5s [%(name)s] %(message)s | |
859 | datefmt = %Y-%m-%d %H:%M:%S |
|
860 | datefmt = %Y-%m-%d %H:%M:%S | |
860 |
|
861 | |||
861 | [formatter_color_formatter] |
|
862 | [formatter_color_formatter] | |
862 | class = rhodecode.lib.logging_formatter.ColorFormatter |
|
863 | class = rhodecode.lib.logging_formatter.ColorFormatter | |
863 | format = %(asctime)s.%(msecs)03d [%(process)d] %(levelname)-5.5s [%(name)s] %(message)s |
|
864 | format = %(asctime)s.%(msecs)03d [%(process)d] %(levelname)-5.5s [%(name)s] %(message)s | |
864 | datefmt = %Y-%m-%d %H:%M:%S |
|
865 | datefmt = %Y-%m-%d %H:%M:%S | |
865 |
|
866 | |||
866 | [formatter_color_formatter_sql] |
|
867 | [formatter_color_formatter_sql] | |
867 | class = rhodecode.lib.logging_formatter.ColorFormatterSql |
|
868 | class = rhodecode.lib.logging_formatter.ColorFormatterSql | |
868 | format = %(asctime)s.%(msecs)03d [%(process)d] %(levelname)-5.5s [%(name)s] %(message)s |
|
869 | format = %(asctime)s.%(msecs)03d [%(process)d] %(levelname)-5.5s [%(name)s] %(message)s | |
869 | datefmt = %Y-%m-%d %H:%M:%S |
|
870 | datefmt = %Y-%m-%d %H:%M:%S | |
870 |
|
871 | |||
871 | [formatter_json] |
|
872 | [formatter_json] | |
872 | format = %(timestamp)s %(levelname)s %(name)s %(message)s %(req_id)s |
|
873 | format = %(timestamp)s %(levelname)s %(name)s %(message)s %(req_id)s | |
873 | class = rhodecode.lib._vendor.jsonlogger.JsonFormatter |
|
874 | class = rhodecode.lib._vendor.jsonlogger.JsonFormatter |
@@ -1,345 +1,350 b'' | |||||
1 | # -*- coding: utf-8 -*- |
|
1 | # -*- coding: utf-8 -*- | |
2 |
|
2 | |||
3 | # Copyright (C) 2010-2020 RhodeCode GmbH |
|
3 | # Copyright (C) 2010-2020 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 time |
|
22 | import time | |
23 | import logging |
|
23 | import logging | |
24 | import tempfile |
|
24 | import tempfile | |
25 | import traceback |
|
25 | import traceback | |
26 | import threading |
|
26 | import threading | |
27 | import socket |
|
27 | import socket | |
28 |
|
28 | |||
29 | from BaseHTTPServer import BaseHTTPRequestHandler |
|
29 | from BaseHTTPServer import BaseHTTPRequestHandler | |
30 | from SocketServer import TCPServer |
|
30 | from SocketServer import TCPServer | |
31 |
|
31 | |||
32 | import rhodecode |
|
32 | import rhodecode | |
33 | from rhodecode.lib.exceptions import HTTPLockedRC, HTTPBranchProtected |
|
33 | from rhodecode.lib.exceptions import HTTPLockedRC, HTTPBranchProtected | |
34 | from rhodecode.model import meta |
|
34 | from rhodecode.model import meta | |
35 | from rhodecode.lib.base import bootstrap_request, bootstrap_config |
|
35 | from rhodecode.lib.base import bootstrap_request, bootstrap_config | |
36 | from rhodecode.lib import hooks_base |
|
36 | from rhodecode.lib import hooks_base | |
37 | from rhodecode.lib.utils2 import AttributeDict |
|
37 | from rhodecode.lib.utils2 import AttributeDict | |
38 | from rhodecode.lib.ext_json import json |
|
38 | from rhodecode.lib.ext_json import json | |
39 | from rhodecode.lib import rc_cache |
|
39 | from rhodecode.lib import rc_cache | |
40 |
|
40 | |||
41 | log = logging.getLogger(__name__) |
|
41 | log = logging.getLogger(__name__) | |
42 |
|
42 | |||
43 |
|
43 | |||
44 | class HooksHttpHandler(BaseHTTPRequestHandler): |
|
44 | class HooksHttpHandler(BaseHTTPRequestHandler): | |
45 |
|
45 | |||
46 | def do_POST(self): |
|
46 | def do_POST(self): | |
47 | method, extras = self._read_request() |
|
47 | method, extras = self._read_request() | |
48 | txn_id = getattr(self.server, 'txn_id', None) |
|
48 | txn_id = getattr(self.server, 'txn_id', None) | |
49 | if txn_id: |
|
49 | if txn_id: | |
50 | log.debug('Computing TXN_ID based on `%s`:`%s`', |
|
50 | log.debug('Computing TXN_ID based on `%s`:`%s`', | |
51 | extras['repository'], extras['txn_id']) |
|
51 | extras['repository'], extras['txn_id']) | |
52 | computed_txn_id = rc_cache.utils.compute_key_from_params( |
|
52 | computed_txn_id = rc_cache.utils.compute_key_from_params( | |
53 | extras['repository'], extras['txn_id']) |
|
53 | extras['repository'], extras['txn_id']) | |
54 | if txn_id != computed_txn_id: |
|
54 | if txn_id != computed_txn_id: | |
55 | raise Exception( |
|
55 | raise Exception( | |
56 | 'TXN ID fail: expected {} got {} instead'.format( |
|
56 | 'TXN ID fail: expected {} got {} instead'.format( | |
57 | txn_id, computed_txn_id)) |
|
57 | txn_id, computed_txn_id)) | |
58 |
|
58 | |||
59 | try: |
|
59 | try: | |
60 | result = self._call_hook(method, extras) |
|
60 | result = self._call_hook(method, extras) | |
61 | except Exception as e: |
|
61 | except Exception as e: | |
62 | exc_tb = traceback.format_exc() |
|
62 | exc_tb = traceback.format_exc() | |
63 | result = { |
|
63 | result = { | |
64 | 'exception': e.__class__.__name__, |
|
64 | 'exception': e.__class__.__name__, | |
65 | 'exception_traceback': exc_tb, |
|
65 | 'exception_traceback': exc_tb, | |
66 | 'exception_args': e.args |
|
66 | 'exception_args': e.args | |
67 | } |
|
67 | } | |
68 | self._write_response(result) |
|
68 | self._write_response(result) | |
69 |
|
69 | |||
70 | def _read_request(self): |
|
70 | def _read_request(self): | |
71 | length = int(self.headers['Content-Length']) |
|
71 | length = int(self.headers['Content-Length']) | |
72 | body = self.rfile.read(length).decode('utf-8') |
|
72 | body = self.rfile.read(length).decode('utf-8') | |
73 | data = json.loads(body) |
|
73 | data = json.loads(body) | |
74 | return data['method'], data['extras'] |
|
74 | return data['method'], data['extras'] | |
75 |
|
75 | |||
76 | def _write_response(self, result): |
|
76 | def _write_response(self, result): | |
77 | self.send_response(200) |
|
77 | self.send_response(200) | |
78 | self.send_header("Content-type", "text/json") |
|
78 | self.send_header("Content-type", "text/json") | |
79 | self.end_headers() |
|
79 | self.end_headers() | |
80 | self.wfile.write(json.dumps(result)) |
|
80 | self.wfile.write(json.dumps(result)) | |
81 |
|
81 | |||
82 | def _call_hook(self, method, extras): |
|
82 | def _call_hook(self, method, extras): | |
83 | hooks = Hooks() |
|
83 | hooks = Hooks() | |
84 | try: |
|
84 | try: | |
85 | result = getattr(hooks, method)(extras) |
|
85 | result = getattr(hooks, method)(extras) | |
86 | finally: |
|
86 | finally: | |
87 | meta.Session.remove() |
|
87 | meta.Session.remove() | |
88 | return result |
|
88 | return result | |
89 |
|
89 | |||
90 | def log_message(self, format, *args): |
|
90 | def log_message(self, format, *args): | |
91 | """ |
|
91 | """ | |
92 | This is an overridden method of BaseHTTPRequestHandler which logs using |
|
92 | This is an overridden method of BaseHTTPRequestHandler which logs using | |
93 | logging library instead of writing directly to stderr. |
|
93 | logging library instead of writing directly to stderr. | |
94 | """ |
|
94 | """ | |
95 |
|
95 | |||
96 | message = format % args |
|
96 | message = format % args | |
97 |
|
97 | |||
98 | log.debug( |
|
98 | log.debug( | |
99 | "%s - - [%s] %s", self.client_address[0], |
|
99 | "%s - - [%s] %s", self.client_address[0], | |
100 | self.log_date_time_string(), message) |
|
100 | self.log_date_time_string(), message) | |
101 |
|
101 | |||
102 |
|
102 | |||
103 | class DummyHooksCallbackDaemon(object): |
|
103 | class DummyHooksCallbackDaemon(object): | |
104 | hooks_uri = '' |
|
104 | hooks_uri = '' | |
105 |
|
105 | |||
106 | def __init__(self): |
|
106 | def __init__(self): | |
107 | self.hooks_module = Hooks.__module__ |
|
107 | self.hooks_module = Hooks.__module__ | |
108 |
|
108 | |||
109 | def __enter__(self): |
|
109 | def __enter__(self): | |
110 | log.debug('Running `%s` callback daemon', self.__class__.__name__) |
|
110 | log.debug('Running `%s` callback daemon', self.__class__.__name__) | |
111 | return self |
|
111 | return self | |
112 |
|
112 | |||
113 | def __exit__(self, exc_type, exc_val, exc_tb): |
|
113 | def __exit__(self, exc_type, exc_val, exc_tb): | |
114 | log.debug('Exiting `%s` callback daemon', self.__class__.__name__) |
|
114 | log.debug('Exiting `%s` callback daemon', self.__class__.__name__) | |
115 |
|
115 | |||
116 |
|
116 | |||
117 | class ThreadedHookCallbackDaemon(object): |
|
117 | class ThreadedHookCallbackDaemon(object): | |
118 |
|
118 | |||
119 | _callback_thread = None |
|
119 | _callback_thread = None | |
120 | _daemon = None |
|
120 | _daemon = None | |
121 | _done = False |
|
121 | _done = False | |
122 |
|
122 | |||
123 | def __init__(self, txn_id=None, host=None, port=None): |
|
123 | def __init__(self, txn_id=None, host=None, port=None): | |
124 | self._prepare(txn_id=txn_id, host=host, port=port) |
|
124 | self._prepare(txn_id=txn_id, host=host, port=port) | |
125 |
|
125 | |||
126 | def __enter__(self): |
|
126 | def __enter__(self): | |
127 | log.debug('Running `%s` callback daemon', self.__class__.__name__) |
|
127 | log.debug('Running `%s` callback daemon', self.__class__.__name__) | |
128 | self._run() |
|
128 | self._run() | |
129 | return self |
|
129 | return self | |
130 |
|
130 | |||
131 | def __exit__(self, exc_type, exc_val, exc_tb): |
|
131 | def __exit__(self, exc_type, exc_val, exc_tb): | |
132 | log.debug('Exiting `%s` callback daemon', self.__class__.__name__) |
|
132 | log.debug('Exiting `%s` callback daemon', self.__class__.__name__) | |
133 | self._stop() |
|
133 | self._stop() | |
134 |
|
134 | |||
135 | def _prepare(self, txn_id=None, host=None, port=None): |
|
135 | def _prepare(self, txn_id=None, host=None, port=None): | |
136 | raise NotImplementedError() |
|
136 | raise NotImplementedError() | |
137 |
|
137 | |||
138 | def _run(self): |
|
138 | def _run(self): | |
139 | raise NotImplementedError() |
|
139 | raise NotImplementedError() | |
140 |
|
140 | |||
141 | def _stop(self): |
|
141 | def _stop(self): | |
142 | raise NotImplementedError() |
|
142 | raise NotImplementedError() | |
143 |
|
143 | |||
144 |
|
144 | |||
145 | class HttpHooksCallbackDaemon(ThreadedHookCallbackDaemon): |
|
145 | class HttpHooksCallbackDaemon(ThreadedHookCallbackDaemon): | |
146 | """ |
|
146 | """ | |
147 | Context manager which will run a callback daemon in a background thread. |
|
147 | Context manager which will run a callback daemon in a background thread. | |
148 | """ |
|
148 | """ | |
149 |
|
149 | |||
150 | hooks_uri = None |
|
150 | hooks_uri = None | |
151 |
|
151 | |||
152 | # From Python docs: Polling reduces our responsiveness to a shutdown |
|
152 | # From Python docs: Polling reduces our responsiveness to a shutdown | |
153 | # request and wastes cpu at all other times. |
|
153 | # request and wastes cpu at all other times. | |
154 | POLL_INTERVAL = 0.01 |
|
154 | POLL_INTERVAL = 0.01 | |
155 |
|
155 | |||
|
156 | def get_hostname(self): | |||
|
157 | return socket.gethostname() or '127.0.0.1' | |||
|
158 | ||||
156 | def get_available_port(self): |
|
159 | def get_available_port(self): | |
157 | mysocket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) |
|
160 | mysocket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) | |
158 |
mysocket.bind(( |
|
161 | mysocket.bind((self.get_hostname(), 0)) | |
159 | port = mysocket.getsockname()[1] |
|
162 | port = mysocket.getsockname()[1] | |
160 | mysocket.close() |
|
163 | mysocket.close() | |
161 | del mysocket |
|
164 | del mysocket | |
162 | return port |
|
165 | return port | |
163 |
|
166 | |||
164 | def _prepare(self, txn_id=None, host=None, port=None): |
|
167 | def _prepare(self, txn_id=None, host=None, port=None): | |
|
168 | if not host or host == "*": | |||
|
169 | host = self.get_hostname() | |||
|
170 | if not port: | |||
|
171 | port = self.get_available_port() | |||
165 |
|
172 | |||
166 | host = host or '127.0.0.1' |
|
|||
167 | port = port or self.get_available_port() |
|
|||
168 | server_address = (host, port) |
|
173 | server_address = (host, port) | |
169 | self.hooks_uri = '{}:{}'.format(host, port) |
|
174 | self.hooks_uri = '{}:{}'.format(host, port) | |
170 | self.txn_id = txn_id |
|
175 | self.txn_id = txn_id | |
171 | self._done = False |
|
176 | self._done = False | |
172 |
|
177 | |||
173 | log.debug( |
|
178 | log.debug( | |
174 | "Preparing HTTP callback daemon at `%s` and registering hook object: %s", |
|
179 | "Preparing HTTP callback daemon at `%s` and registering hook object: %s", | |
175 | self.hooks_uri, HooksHttpHandler) |
|
180 | self.hooks_uri, HooksHttpHandler) | |
176 |
|
181 | |||
177 | self._daemon = TCPServer(server_address, HooksHttpHandler) |
|
182 | self._daemon = TCPServer(server_address, HooksHttpHandler) | |
178 | # inject transaction_id for later verification |
|
183 | # inject transaction_id for later verification | |
179 | self._daemon.txn_id = self.txn_id |
|
184 | self._daemon.txn_id = self.txn_id | |
180 |
|
185 | |||
181 | def _run(self): |
|
186 | def _run(self): | |
182 | log.debug("Running event loop of callback daemon in background thread") |
|
187 | log.debug("Running event loop of callback daemon in background thread") | |
183 | callback_thread = threading.Thread( |
|
188 | callback_thread = threading.Thread( | |
184 | target=self._daemon.serve_forever, |
|
189 | target=self._daemon.serve_forever, | |
185 | kwargs={'poll_interval': self.POLL_INTERVAL}) |
|
190 | kwargs={'poll_interval': self.POLL_INTERVAL}) | |
186 | callback_thread.daemon = True |
|
191 | callback_thread.daemon = True | |
187 | callback_thread.start() |
|
192 | callback_thread.start() | |
188 | self._callback_thread = callback_thread |
|
193 | self._callback_thread = callback_thread | |
189 |
|
194 | |||
190 | def _stop(self): |
|
195 | def _stop(self): | |
191 | log.debug("Waiting for background thread to finish.") |
|
196 | log.debug("Waiting for background thread to finish.") | |
192 | self._daemon.shutdown() |
|
197 | self._daemon.shutdown() | |
193 | self._callback_thread.join() |
|
198 | self._callback_thread.join() | |
194 | self._daemon = None |
|
199 | self._daemon = None | |
195 | self._callback_thread = None |
|
200 | self._callback_thread = None | |
196 | if self.txn_id: |
|
201 | if self.txn_id: | |
197 | txn_id_file = get_txn_id_data_path(self.txn_id) |
|
202 | txn_id_file = get_txn_id_data_path(self.txn_id) | |
198 | log.debug('Cleaning up TXN ID %s', txn_id_file) |
|
203 | log.debug('Cleaning up TXN ID %s', txn_id_file) | |
199 | if os.path.isfile(txn_id_file): |
|
204 | if os.path.isfile(txn_id_file): | |
200 | os.remove(txn_id_file) |
|
205 | os.remove(txn_id_file) | |
201 |
|
206 | |||
202 | log.debug("Background thread done.") |
|
207 | log.debug("Background thread done.") | |
203 |
|
208 | |||
204 |
|
209 | |||
205 | def get_txn_id_data_path(txn_id): |
|
210 | def get_txn_id_data_path(txn_id): | |
206 | import rhodecode |
|
211 | import rhodecode | |
207 |
|
212 | |||
208 | root = rhodecode.CONFIG.get('cache_dir') or tempfile.gettempdir() |
|
213 | root = rhodecode.CONFIG.get('cache_dir') or tempfile.gettempdir() | |
209 | final_dir = os.path.join(root, 'svn_txn_id') |
|
214 | final_dir = os.path.join(root, 'svn_txn_id') | |
210 |
|
215 | |||
211 | if not os.path.isdir(final_dir): |
|
216 | if not os.path.isdir(final_dir): | |
212 | os.makedirs(final_dir) |
|
217 | os.makedirs(final_dir) | |
213 | return os.path.join(final_dir, 'rc_txn_id_{}'.format(txn_id)) |
|
218 | return os.path.join(final_dir, 'rc_txn_id_{}'.format(txn_id)) | |
214 |
|
219 | |||
215 |
|
220 | |||
216 | def store_txn_id_data(txn_id, data_dict): |
|
221 | def store_txn_id_data(txn_id, data_dict): | |
217 | if not txn_id: |
|
222 | if not txn_id: | |
218 | log.warning('Cannot store txn_id because it is empty') |
|
223 | log.warning('Cannot store txn_id because it is empty') | |
219 | return |
|
224 | return | |
220 |
|
225 | |||
221 | path = get_txn_id_data_path(txn_id) |
|
226 | path = get_txn_id_data_path(txn_id) | |
222 | try: |
|
227 | try: | |
223 | with open(path, 'wb') as f: |
|
228 | with open(path, 'wb') as f: | |
224 | f.write(json.dumps(data_dict)) |
|
229 | f.write(json.dumps(data_dict)) | |
225 | except Exception: |
|
230 | except Exception: | |
226 | log.exception('Failed to write txn_id metadata') |
|
231 | log.exception('Failed to write txn_id metadata') | |
227 |
|
232 | |||
228 |
|
233 | |||
229 | def get_txn_id_from_store(txn_id): |
|
234 | def get_txn_id_from_store(txn_id): | |
230 | """ |
|
235 | """ | |
231 | Reads txn_id from store and if present returns the data for callback manager |
|
236 | Reads txn_id from store and if present returns the data for callback manager | |
232 | """ |
|
237 | """ | |
233 | path = get_txn_id_data_path(txn_id) |
|
238 | path = get_txn_id_data_path(txn_id) | |
234 | try: |
|
239 | try: | |
235 | with open(path, 'rb') as f: |
|
240 | with open(path, 'rb') as f: | |
236 | return json.loads(f.read()) |
|
241 | return json.loads(f.read()) | |
237 | except Exception: |
|
242 | except Exception: | |
238 | return {} |
|
243 | return {} | |
239 |
|
244 | |||
240 |
|
245 | |||
241 | def prepare_callback_daemon(extras, protocol, host, use_direct_calls, txn_id=None): |
|
246 | def prepare_callback_daemon(extras, protocol, host, use_direct_calls, txn_id=None): | |
242 | txn_details = get_txn_id_from_store(txn_id) |
|
247 | txn_details = get_txn_id_from_store(txn_id) | |
243 | port = txn_details.get('port', 0) |
|
248 | port = txn_details.get('port', 0) | |
244 | if use_direct_calls: |
|
249 | if use_direct_calls: | |
245 | callback_daemon = DummyHooksCallbackDaemon() |
|
250 | callback_daemon = DummyHooksCallbackDaemon() | |
246 | extras['hooks_module'] = callback_daemon.hooks_module |
|
251 | extras['hooks_module'] = callback_daemon.hooks_module | |
247 | else: |
|
252 | else: | |
248 | if protocol == 'http': |
|
253 | if protocol == 'http': | |
249 | callback_daemon = HttpHooksCallbackDaemon( |
|
254 | callback_daemon = HttpHooksCallbackDaemon( | |
250 | txn_id=txn_id, host=host, port=port) |
|
255 | txn_id=txn_id, host=host, port=port) | |
251 | else: |
|
256 | else: | |
252 | log.error('Unsupported callback daemon protocol "%s"', protocol) |
|
257 | log.error('Unsupported callback daemon protocol "%s"', protocol) | |
253 | raise Exception('Unsupported callback daemon protocol.') |
|
258 | raise Exception('Unsupported callback daemon protocol.') | |
254 |
|
259 | |||
255 | extras['hooks_uri'] = callback_daemon.hooks_uri |
|
260 | extras['hooks_uri'] = callback_daemon.hooks_uri | |
256 | extras['hooks_protocol'] = protocol |
|
261 | extras['hooks_protocol'] = protocol | |
257 | extras['time'] = time.time() |
|
262 | extras['time'] = time.time() | |
258 |
|
263 | |||
259 | # register txn_id |
|
264 | # register txn_id | |
260 | extras['txn_id'] = txn_id |
|
265 | extras['txn_id'] = txn_id | |
261 | log.debug('Prepared a callback daemon: %s at url `%s`', |
|
266 | log.debug('Prepared a callback daemon: %s at url `%s`', | |
262 | callback_daemon.__class__.__name__, callback_daemon.hooks_uri) |
|
267 | callback_daemon.__class__.__name__, callback_daemon.hooks_uri) | |
263 | return callback_daemon, extras |
|
268 | return callback_daemon, extras | |
264 |
|
269 | |||
265 |
|
270 | |||
266 | class Hooks(object): |
|
271 | class Hooks(object): | |
267 | """ |
|
272 | """ | |
268 | Exposes the hooks for remote call backs |
|
273 | Exposes the hooks for remote call backs | |
269 | """ |
|
274 | """ | |
270 |
|
275 | |||
271 | def repo_size(self, extras): |
|
276 | def repo_size(self, extras): | |
272 | log.debug("Called repo_size of %s object", self) |
|
277 | log.debug("Called repo_size of %s object", self) | |
273 | return self._call_hook(hooks_base.repo_size, extras) |
|
278 | return self._call_hook(hooks_base.repo_size, extras) | |
274 |
|
279 | |||
275 | def pre_pull(self, extras): |
|
280 | def pre_pull(self, extras): | |
276 | log.debug("Called pre_pull of %s object", self) |
|
281 | log.debug("Called pre_pull of %s object", self) | |
277 | return self._call_hook(hooks_base.pre_pull, extras) |
|
282 | return self._call_hook(hooks_base.pre_pull, extras) | |
278 |
|
283 | |||
279 | def post_pull(self, extras): |
|
284 | def post_pull(self, extras): | |
280 | log.debug("Called post_pull of %s object", self) |
|
285 | log.debug("Called post_pull of %s object", self) | |
281 | return self._call_hook(hooks_base.post_pull, extras) |
|
286 | return self._call_hook(hooks_base.post_pull, extras) | |
282 |
|
287 | |||
283 | def pre_push(self, extras): |
|
288 | def pre_push(self, extras): | |
284 | log.debug("Called pre_push of %s object", self) |
|
289 | log.debug("Called pre_push of %s object", self) | |
285 | return self._call_hook(hooks_base.pre_push, extras) |
|
290 | return self._call_hook(hooks_base.pre_push, extras) | |
286 |
|
291 | |||
287 | def post_push(self, extras): |
|
292 | def post_push(self, extras): | |
288 | log.debug("Called post_push of %s object", self) |
|
293 | log.debug("Called post_push of %s object", self) | |
289 | return self._call_hook(hooks_base.post_push, extras) |
|
294 | return self._call_hook(hooks_base.post_push, extras) | |
290 |
|
295 | |||
291 | def _call_hook(self, hook, extras): |
|
296 | def _call_hook(self, hook, extras): | |
292 | extras = AttributeDict(extras) |
|
297 | extras = AttributeDict(extras) | |
293 | server_url = extras['server_url'] |
|
298 | server_url = extras['server_url'] | |
294 | request = bootstrap_request(application_url=server_url) |
|
299 | request = bootstrap_request(application_url=server_url) | |
295 |
|
300 | |||
296 | bootstrap_config(request) # inject routes and other interfaces |
|
301 | bootstrap_config(request) # inject routes and other interfaces | |
297 |
|
302 | |||
298 | # inject the user for usage in hooks |
|
303 | # inject the user for usage in hooks | |
299 | request.user = AttributeDict({'username': extras.username, |
|
304 | request.user = AttributeDict({'username': extras.username, | |
300 | 'ip_addr': extras.ip, |
|
305 | 'ip_addr': extras.ip, | |
301 | 'user_id': extras.user_id}) |
|
306 | 'user_id': extras.user_id}) | |
302 |
|
307 | |||
303 | extras.request = request |
|
308 | extras.request = request | |
304 |
|
309 | |||
305 | try: |
|
310 | try: | |
306 | result = hook(extras) |
|
311 | result = hook(extras) | |
307 | if result is None: |
|
312 | if result is None: | |
308 | raise Exception( |
|
313 | raise Exception( | |
309 | 'Failed to obtain hook result from func: {}'.format(hook)) |
|
314 | 'Failed to obtain hook result from func: {}'.format(hook)) | |
310 | except HTTPBranchProtected as handled_error: |
|
315 | except HTTPBranchProtected as handled_error: | |
311 | # Those special cases doesn't need error reporting. It's a case of |
|
316 | # Those special cases doesn't need error reporting. It's a case of | |
312 | # locked repo or protected branch |
|
317 | # locked repo or protected branch | |
313 | result = AttributeDict({ |
|
318 | result = AttributeDict({ | |
314 | 'status': handled_error.code, |
|
319 | 'status': handled_error.code, | |
315 | 'output': handled_error.explanation |
|
320 | 'output': handled_error.explanation | |
316 | }) |
|
321 | }) | |
317 | except (HTTPLockedRC, Exception) as error: |
|
322 | except (HTTPLockedRC, Exception) as error: | |
318 | # locked needs different handling since we need to also |
|
323 | # locked needs different handling since we need to also | |
319 | # handle PULL operations |
|
324 | # handle PULL operations | |
320 | exc_tb = '' |
|
325 | exc_tb = '' | |
321 | if not isinstance(error, HTTPLockedRC): |
|
326 | if not isinstance(error, HTTPLockedRC): | |
322 | exc_tb = traceback.format_exc() |
|
327 | exc_tb = traceback.format_exc() | |
323 | log.exception('Exception when handling hook %s', hook) |
|
328 | log.exception('Exception when handling hook %s', hook) | |
324 | error_args = error.args |
|
329 | error_args = error.args | |
325 | return { |
|
330 | return { | |
326 | 'status': 128, |
|
331 | 'status': 128, | |
327 | 'output': '', |
|
332 | 'output': '', | |
328 | 'exception': type(error).__name__, |
|
333 | 'exception': type(error).__name__, | |
329 | 'exception_traceback': exc_tb, |
|
334 | 'exception_traceback': exc_tb, | |
330 | 'exception_args': error_args, |
|
335 | 'exception_args': error_args, | |
331 | } |
|
336 | } | |
332 | finally: |
|
337 | finally: | |
333 | meta.Session.remove() |
|
338 | meta.Session.remove() | |
334 |
|
339 | |||
335 | log.debug('Got hook call response %s', result) |
|
340 | log.debug('Got hook call response %s', result) | |
336 | return { |
|
341 | return { | |
337 | 'status': result.status, |
|
342 | 'status': result.status, | |
338 | 'output': result.output, |
|
343 | 'output': result.output, | |
339 | } |
|
344 | } | |
340 |
|
345 | |||
341 | def __enter__(self): |
|
346 | def __enter__(self): | |
342 | return self |
|
347 | return self | |
343 |
|
348 | |||
344 | def __exit__(self, exc_type, exc_val, exc_tb): |
|
349 | def __exit__(self, exc_type, exc_val, exc_tb): | |
345 | pass |
|
350 | pass |
@@ -1,332 +1,342 b'' | |||||
1 | # -*- coding: utf-8 -*- |
|
1 | # -*- coding: utf-8 -*- | |
2 |
|
2 | |||
3 | # Copyright (C) 2010-2020 RhodeCode GmbH |
|
3 | # Copyright (C) 2010-2020 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 json |
|
21 | import json | |
22 | import logging |
|
22 | import logging | |
23 | from StringIO import StringIO |
|
23 | from StringIO import StringIO | |
24 |
|
24 | |||
25 | import mock |
|
25 | import mock | |
26 | import pytest |
|
26 | import pytest | |
27 |
|
27 | |||
28 | from rhodecode.lib import hooks_daemon |
|
28 | from rhodecode.lib import hooks_daemon | |
29 | from rhodecode.tests.utils import assert_message_in_log |
|
29 | from rhodecode.tests.utils import assert_message_in_log | |
30 |
|
30 | |||
31 |
|
31 | |||
32 | class TestDummyHooksCallbackDaemon(object): |
|
32 | class TestDummyHooksCallbackDaemon(object): | |
33 | def test_hooks_module_path_set_properly(self): |
|
33 | def test_hooks_module_path_set_properly(self): | |
34 | daemon = hooks_daemon.DummyHooksCallbackDaemon() |
|
34 | daemon = hooks_daemon.DummyHooksCallbackDaemon() | |
35 | assert daemon.hooks_module == 'rhodecode.lib.hooks_daemon' |
|
35 | assert daemon.hooks_module == 'rhodecode.lib.hooks_daemon' | |
36 |
|
36 | |||
37 | def test_logs_entering_the_hook(self): |
|
37 | def test_logs_entering_the_hook(self): | |
38 | daemon = hooks_daemon.DummyHooksCallbackDaemon() |
|
38 | daemon = hooks_daemon.DummyHooksCallbackDaemon() | |
39 | with mock.patch.object(hooks_daemon.log, 'debug') as log_mock: |
|
39 | with mock.patch.object(hooks_daemon.log, 'debug') as log_mock: | |
40 | with daemon as return_value: |
|
40 | with daemon as return_value: | |
41 | log_mock.assert_called_once_with( |
|
41 | log_mock.assert_called_once_with( | |
42 | 'Running `%s` callback daemon', 'DummyHooksCallbackDaemon') |
|
42 | 'Running `%s` callback daemon', 'DummyHooksCallbackDaemon') | |
43 | assert return_value == daemon |
|
43 | assert return_value == daemon | |
44 |
|
44 | |||
45 | def test_logs_exiting_the_hook(self): |
|
45 | def test_logs_exiting_the_hook(self): | |
46 | daemon = hooks_daemon.DummyHooksCallbackDaemon() |
|
46 | daemon = hooks_daemon.DummyHooksCallbackDaemon() | |
47 | with mock.patch.object(hooks_daemon.log, 'debug') as log_mock: |
|
47 | with mock.patch.object(hooks_daemon.log, 'debug') as log_mock: | |
48 | with daemon: |
|
48 | with daemon: | |
49 | pass |
|
49 | pass | |
50 | log_mock.assert_called_with( |
|
50 | log_mock.assert_called_with( | |
51 | 'Exiting `%s` callback daemon', 'DummyHooksCallbackDaemon') |
|
51 | 'Exiting `%s` callback daemon', 'DummyHooksCallbackDaemon') | |
52 |
|
52 | |||
53 |
|
53 | |||
54 | class TestHooks(object): |
|
54 | class TestHooks(object): | |
55 | def test_hooks_can_be_used_as_a_context_processor(self): |
|
55 | def test_hooks_can_be_used_as_a_context_processor(self): | |
56 | hooks = hooks_daemon.Hooks() |
|
56 | hooks = hooks_daemon.Hooks() | |
57 | with hooks as return_value: |
|
57 | with hooks as return_value: | |
58 | pass |
|
58 | pass | |
59 | assert hooks == return_value |
|
59 | assert hooks == return_value | |
60 |
|
60 | |||
61 |
|
61 | |||
62 | class TestHooksHttpHandler(object): |
|
62 | class TestHooksHttpHandler(object): | |
63 | def test_read_request_parses_method_name_and_arguments(self): |
|
63 | def test_read_request_parses_method_name_and_arguments(self): | |
64 | data = { |
|
64 | data = { | |
65 | 'method': 'test', |
|
65 | 'method': 'test', | |
66 | 'extras': { |
|
66 | 'extras': { | |
67 | 'param1': 1, |
|
67 | 'param1': 1, | |
68 | 'param2': 'a' |
|
68 | 'param2': 'a' | |
69 | } |
|
69 | } | |
70 | } |
|
70 | } | |
71 | request = self._generate_post_request(data) |
|
71 | request = self._generate_post_request(data) | |
72 | hooks_patcher = mock.patch.object( |
|
72 | hooks_patcher = mock.patch.object( | |
73 | hooks_daemon.Hooks, data['method'], create=True, return_value=1) |
|
73 | hooks_daemon.Hooks, data['method'], create=True, return_value=1) | |
74 |
|
74 | |||
75 | with hooks_patcher as hooks_mock: |
|
75 | with hooks_patcher as hooks_mock: | |
76 | MockServer(hooks_daemon.HooksHttpHandler, request) |
|
76 | MockServer(hooks_daemon.HooksHttpHandler, request) | |
77 |
|
77 | |||
78 | hooks_mock.assert_called_once_with(data['extras']) |
|
78 | hooks_mock.assert_called_once_with(data['extras']) | |
79 |
|
79 | |||
80 | def test_hooks_serialized_result_is_returned(self): |
|
80 | def test_hooks_serialized_result_is_returned(self): | |
81 | request = self._generate_post_request({}) |
|
81 | request = self._generate_post_request({}) | |
82 | rpc_method = 'test' |
|
82 | rpc_method = 'test' | |
83 | hook_result = { |
|
83 | hook_result = { | |
84 | 'first': 'one', |
|
84 | 'first': 'one', | |
85 | 'second': 2 |
|
85 | 'second': 2 | |
86 | } |
|
86 | } | |
87 | read_patcher = mock.patch.object( |
|
87 | read_patcher = mock.patch.object( | |
88 | hooks_daemon.HooksHttpHandler, '_read_request', |
|
88 | hooks_daemon.HooksHttpHandler, '_read_request', | |
89 | return_value=(rpc_method, {})) |
|
89 | return_value=(rpc_method, {})) | |
90 | hooks_patcher = mock.patch.object( |
|
90 | hooks_patcher = mock.patch.object( | |
91 | hooks_daemon.Hooks, rpc_method, create=True, |
|
91 | hooks_daemon.Hooks, rpc_method, create=True, | |
92 | return_value=hook_result) |
|
92 | return_value=hook_result) | |
93 |
|
93 | |||
94 | with read_patcher, hooks_patcher: |
|
94 | with read_patcher, hooks_patcher: | |
95 | server = MockServer(hooks_daemon.HooksHttpHandler, request) |
|
95 | server = MockServer(hooks_daemon.HooksHttpHandler, request) | |
96 |
|
96 | |||
97 | expected_result = json.dumps(hook_result) |
|
97 | expected_result = json.dumps(hook_result) | |
98 | assert server.request.output_stream.buflist[-1] == expected_result |
|
98 | assert server.request.output_stream.buflist[-1] == expected_result | |
99 |
|
99 | |||
100 | def test_exception_is_returned_in_response(self): |
|
100 | def test_exception_is_returned_in_response(self): | |
101 | request = self._generate_post_request({}) |
|
101 | request = self._generate_post_request({}) | |
102 | rpc_method = 'test' |
|
102 | rpc_method = 'test' | |
103 | read_patcher = mock.patch.object( |
|
103 | read_patcher = mock.patch.object( | |
104 | hooks_daemon.HooksHttpHandler, '_read_request', |
|
104 | hooks_daemon.HooksHttpHandler, '_read_request', | |
105 | return_value=(rpc_method, {})) |
|
105 | return_value=(rpc_method, {})) | |
106 | hooks_patcher = mock.patch.object( |
|
106 | hooks_patcher = mock.patch.object( | |
107 | hooks_daemon.Hooks, rpc_method, create=True, |
|
107 | hooks_daemon.Hooks, rpc_method, create=True, | |
108 | side_effect=Exception('Test exception')) |
|
108 | side_effect=Exception('Test exception')) | |
109 |
|
109 | |||
110 | with read_patcher, hooks_patcher: |
|
110 | with read_patcher, hooks_patcher: | |
111 | server = MockServer(hooks_daemon.HooksHttpHandler, request) |
|
111 | server = MockServer(hooks_daemon.HooksHttpHandler, request) | |
112 |
|
112 | |||
113 | org_exc = json.loads(server.request.output_stream.buflist[-1]) |
|
113 | org_exc = json.loads(server.request.output_stream.buflist[-1]) | |
114 | expected_result = { |
|
114 | expected_result = { | |
115 | 'exception': 'Exception', |
|
115 | 'exception': 'Exception', | |
116 | 'exception_traceback': org_exc['exception_traceback'], |
|
116 | 'exception_traceback': org_exc['exception_traceback'], | |
117 | 'exception_args': ['Test exception'] |
|
117 | 'exception_args': ['Test exception'] | |
118 | } |
|
118 | } | |
119 | assert org_exc == expected_result |
|
119 | assert org_exc == expected_result | |
120 |
|
120 | |||
121 | def test_log_message_writes_to_debug_log(self, caplog): |
|
121 | def test_log_message_writes_to_debug_log(self, caplog): | |
122 | ip_port = ('0.0.0.0', 8888) |
|
122 | ip_port = ('0.0.0.0', 8888) | |
123 | handler = hooks_daemon.HooksHttpHandler( |
|
123 | handler = hooks_daemon.HooksHttpHandler( | |
124 | MockRequest('POST /'), ip_port, mock.Mock()) |
|
124 | MockRequest('POST /'), ip_port, mock.Mock()) | |
125 | fake_date = '1/Nov/2015 00:00:00' |
|
125 | fake_date = '1/Nov/2015 00:00:00' | |
126 | date_patcher = mock.patch.object( |
|
126 | date_patcher = mock.patch.object( | |
127 | handler, 'log_date_time_string', return_value=fake_date) |
|
127 | handler, 'log_date_time_string', return_value=fake_date) | |
128 | with date_patcher, caplog.at_level(logging.DEBUG): |
|
128 | with date_patcher, caplog.at_level(logging.DEBUG): | |
129 | handler.log_message('Some message %d, %s', 123, 'string') |
|
129 | handler.log_message('Some message %d, %s', 123, 'string') | |
130 |
|
130 | |||
131 | expected_message = '{} - - [{}] Some message 123, string'.format( |
|
131 | expected_message = '{} - - [{}] Some message 123, string'.format( | |
132 | ip_port[0], fake_date) |
|
132 | ip_port[0], fake_date) | |
133 | assert_message_in_log( |
|
133 | assert_message_in_log( | |
134 | caplog.records, expected_message, |
|
134 | caplog.records, expected_message, | |
135 | levelno=logging.DEBUG, module='hooks_daemon') |
|
135 | levelno=logging.DEBUG, module='hooks_daemon') | |
136 |
|
136 | |||
137 | def _generate_post_request(self, data): |
|
137 | def _generate_post_request(self, data): | |
138 | payload = json.dumps(data) |
|
138 | payload = json.dumps(data) | |
139 | return 'POST / HTTP/1.0\nContent-Length: {}\n\n{}'.format( |
|
139 | return 'POST / HTTP/1.0\nContent-Length: {}\n\n{}'.format( | |
140 | len(payload), payload) |
|
140 | len(payload), payload) | |
141 |
|
141 | |||
142 |
|
142 | |||
143 | class ThreadedHookCallbackDaemon(object): |
|
143 | class ThreadedHookCallbackDaemon(object): | |
144 | def test_constructor_calls_prepare(self): |
|
144 | def test_constructor_calls_prepare(self): | |
145 | prepare_daemon_patcher = mock.patch.object( |
|
145 | prepare_daemon_patcher = mock.patch.object( | |
146 | hooks_daemon.ThreadedHookCallbackDaemon, '_prepare') |
|
146 | hooks_daemon.ThreadedHookCallbackDaemon, '_prepare') | |
147 | with prepare_daemon_patcher as prepare_daemon_mock: |
|
147 | with prepare_daemon_patcher as prepare_daemon_mock: | |
148 | hooks_daemon.ThreadedHookCallbackDaemon() |
|
148 | hooks_daemon.ThreadedHookCallbackDaemon() | |
149 | prepare_daemon_mock.assert_called_once_with() |
|
149 | prepare_daemon_mock.assert_called_once_with() | |
150 |
|
150 | |||
151 | def test_run_is_called_on_context_start(self): |
|
151 | def test_run_is_called_on_context_start(self): | |
152 | patchers = mock.patch.multiple( |
|
152 | patchers = mock.patch.multiple( | |
153 | hooks_daemon.ThreadedHookCallbackDaemon, |
|
153 | hooks_daemon.ThreadedHookCallbackDaemon, | |
154 | _run=mock.DEFAULT, _prepare=mock.DEFAULT, __exit__=mock.DEFAULT) |
|
154 | _run=mock.DEFAULT, _prepare=mock.DEFAULT, __exit__=mock.DEFAULT) | |
155 |
|
155 | |||
156 | with patchers as mocks: |
|
156 | with patchers as mocks: | |
157 | daemon = hooks_daemon.ThreadedHookCallbackDaemon() |
|
157 | daemon = hooks_daemon.ThreadedHookCallbackDaemon() | |
158 | with daemon as daemon_context: |
|
158 | with daemon as daemon_context: | |
159 | pass |
|
159 | pass | |
160 | mocks['_run'].assert_called_once_with() |
|
160 | mocks['_run'].assert_called_once_with() | |
161 | assert daemon_context == daemon |
|
161 | assert daemon_context == daemon | |
162 |
|
162 | |||
163 | def test_stop_is_called_on_context_exit(self): |
|
163 | def test_stop_is_called_on_context_exit(self): | |
164 | patchers = mock.patch.multiple( |
|
164 | patchers = mock.patch.multiple( | |
165 | hooks_daemon.ThreadedHookCallbackDaemon, |
|
165 | hooks_daemon.ThreadedHookCallbackDaemon, | |
166 | _run=mock.DEFAULT, _prepare=mock.DEFAULT, _stop=mock.DEFAULT) |
|
166 | _run=mock.DEFAULT, _prepare=mock.DEFAULT, _stop=mock.DEFAULT) | |
167 |
|
167 | |||
168 | with patchers as mocks: |
|
168 | with patchers as mocks: | |
169 | daemon = hooks_daemon.ThreadedHookCallbackDaemon() |
|
169 | daemon = hooks_daemon.ThreadedHookCallbackDaemon() | |
170 | with daemon as daemon_context: |
|
170 | with daemon as daemon_context: | |
171 | assert mocks['_stop'].call_count == 0 |
|
171 | assert mocks['_stop'].call_count == 0 | |
172 |
|
172 | |||
173 | mocks['_stop'].assert_called_once_with() |
|
173 | mocks['_stop'].assert_called_once_with() | |
174 | assert daemon_context == daemon |
|
174 | assert daemon_context == daemon | |
175 |
|
175 | |||
176 |
|
176 | |||
177 | class TestHttpHooksCallbackDaemon(object): |
|
177 | class TestHttpHooksCallbackDaemon(object): | |
|
178 | def test_hooks_callback_generates_new_port(self, caplog): | |||
|
179 | with caplog.at_level(logging.DEBUG): | |||
|
180 | daemon = hooks_daemon.HttpHooksCallbackDaemon(host='127.0.0.1', port=8881) | |||
|
181 | assert daemon._daemon.server_address == ('127.0.0.1', 8881) | |||
|
182 | ||||
|
183 | with caplog.at_level(logging.DEBUG): | |||
|
184 | daemon = hooks_daemon.HttpHooksCallbackDaemon(host=None, port=None) | |||
|
185 | assert daemon._daemon.server_address[1] in range(0, 66000) | |||
|
186 | assert daemon._daemon.server_address[0] != '127.0.0.1' | |||
|
187 | ||||
178 | def test_prepare_inits_daemon_variable(self, tcp_server, caplog): |
|
188 | def test_prepare_inits_daemon_variable(self, tcp_server, caplog): | |
179 | with self._tcp_patcher(tcp_server), caplog.at_level(logging.DEBUG): |
|
189 | with self._tcp_patcher(tcp_server), caplog.at_level(logging.DEBUG): | |
180 | daemon = hooks_daemon.HttpHooksCallbackDaemon() |
|
190 | daemon = hooks_daemon.HttpHooksCallbackDaemon(host='127.0.0.1', port=8881) | |
181 | assert daemon._daemon == tcp_server |
|
191 | assert daemon._daemon == tcp_server | |
182 |
|
192 | |||
183 | _, port = tcp_server.server_address |
|
193 | _, port = tcp_server.server_address | |
184 | expected_uri = '{}:{}'.format('127.0.0.1', port) |
|
194 | expected_uri = '{}:{}'.format('127.0.0.1', port) | |
185 | msg = 'Preparing HTTP callback daemon at `{}` and ' \ |
|
195 | msg = 'Preparing HTTP callback daemon at `{}` and ' \ | |
186 | 'registering hook object'.format(expected_uri) |
|
196 | 'registering hook object: rhodecode.lib.hooks_daemon.HooksHttpHandler'.format(expected_uri) | |
187 | assert_message_in_log( |
|
197 | assert_message_in_log( | |
188 | caplog.records, msg, levelno=logging.DEBUG, module='hooks_daemon') |
|
198 | caplog.records, msg, levelno=logging.DEBUG, module='hooks_daemon') | |
189 |
|
199 | |||
190 | def test_prepare_inits_hooks_uri_and_logs_it( |
|
200 | def test_prepare_inits_hooks_uri_and_logs_it( | |
191 | self, tcp_server, caplog): |
|
201 | self, tcp_server, caplog): | |
192 | with self._tcp_patcher(tcp_server), caplog.at_level(logging.DEBUG): |
|
202 | with self._tcp_patcher(tcp_server), caplog.at_level(logging.DEBUG): | |
193 | daemon = hooks_daemon.HttpHooksCallbackDaemon() |
|
203 | daemon = hooks_daemon.HttpHooksCallbackDaemon(host='127.0.0.1', port=8881) | |
194 |
|
204 | |||
195 | _, port = tcp_server.server_address |
|
205 | _, port = tcp_server.server_address | |
196 | expected_uri = '{}:{}'.format('127.0.0.1', port) |
|
206 | expected_uri = '{}:{}'.format('127.0.0.1', port) | |
197 | assert daemon.hooks_uri == expected_uri |
|
207 | assert daemon.hooks_uri == expected_uri | |
198 |
|
208 | |||
199 | msg = 'Preparing HTTP callback daemon at `{}` and ' \ |
|
209 | msg = 'Preparing HTTP callback daemon at `{}` and ' \ | |
200 | 'registering hook object'.format(expected_uri) |
|
210 | 'registering hook object: rhodecode.lib.hooks_daemon.HooksHttpHandler'.format(expected_uri) | |
201 | assert_message_in_log( |
|
211 | assert_message_in_log( | |
202 | caplog.records, msg, |
|
212 | caplog.records, msg, | |
203 | levelno=logging.DEBUG, module='hooks_daemon') |
|
213 | levelno=logging.DEBUG, module='hooks_daemon') | |
204 |
|
214 | |||
205 | def test_run_creates_a_thread(self, tcp_server): |
|
215 | def test_run_creates_a_thread(self, tcp_server): | |
206 | thread = mock.Mock() |
|
216 | thread = mock.Mock() | |
207 |
|
217 | |||
208 | with self._tcp_patcher(tcp_server): |
|
218 | with self._tcp_patcher(tcp_server): | |
209 | daemon = hooks_daemon.HttpHooksCallbackDaemon() |
|
219 | daemon = hooks_daemon.HttpHooksCallbackDaemon() | |
210 |
|
220 | |||
211 | with self._thread_patcher(thread) as thread_mock: |
|
221 | with self._thread_patcher(thread) as thread_mock: | |
212 | daemon._run() |
|
222 | daemon._run() | |
213 |
|
223 | |||
214 | thread_mock.assert_called_once_with( |
|
224 | thread_mock.assert_called_once_with( | |
215 | target=tcp_server.serve_forever, |
|
225 | target=tcp_server.serve_forever, | |
216 | kwargs={'poll_interval': daemon.POLL_INTERVAL}) |
|
226 | kwargs={'poll_interval': daemon.POLL_INTERVAL}) | |
217 | assert thread.daemon is True |
|
227 | assert thread.daemon is True | |
218 | thread.start.assert_called_once_with() |
|
228 | thread.start.assert_called_once_with() | |
219 |
|
229 | |||
220 | def test_run_logs(self, tcp_server, caplog): |
|
230 | def test_run_logs(self, tcp_server, caplog): | |
221 |
|
231 | |||
222 | with self._tcp_patcher(tcp_server): |
|
232 | with self._tcp_patcher(tcp_server): | |
223 | daemon = hooks_daemon.HttpHooksCallbackDaemon() |
|
233 | daemon = hooks_daemon.HttpHooksCallbackDaemon() | |
224 |
|
234 | |||
225 | with self._thread_patcher(mock.Mock()), caplog.at_level(logging.DEBUG): |
|
235 | with self._thread_patcher(mock.Mock()), caplog.at_level(logging.DEBUG): | |
226 | daemon._run() |
|
236 | daemon._run() | |
227 |
|
237 | |||
228 | assert_message_in_log( |
|
238 | assert_message_in_log( | |
229 | caplog.records, |
|
239 | caplog.records, | |
230 | 'Running event loop of callback daemon in background thread', |
|
240 | 'Running event loop of callback daemon in background thread', | |
231 | levelno=logging.DEBUG, module='hooks_daemon') |
|
241 | levelno=logging.DEBUG, module='hooks_daemon') | |
232 |
|
242 | |||
233 | def test_stop_cleans_up_the_connection(self, tcp_server, caplog): |
|
243 | def test_stop_cleans_up_the_connection(self, tcp_server, caplog): | |
234 | thread = mock.Mock() |
|
244 | thread = mock.Mock() | |
235 |
|
245 | |||
236 | with self._tcp_patcher(tcp_server): |
|
246 | with self._tcp_patcher(tcp_server): | |
237 | daemon = hooks_daemon.HttpHooksCallbackDaemon() |
|
247 | daemon = hooks_daemon.HttpHooksCallbackDaemon() | |
238 |
|
248 | |||
239 | with self._thread_patcher(thread), caplog.at_level(logging.DEBUG): |
|
249 | with self._thread_patcher(thread), caplog.at_level(logging.DEBUG): | |
240 | with daemon: |
|
250 | with daemon: | |
241 | assert daemon._daemon == tcp_server |
|
251 | assert daemon._daemon == tcp_server | |
242 | assert daemon._callback_thread == thread |
|
252 | assert daemon._callback_thread == thread | |
243 |
|
253 | |||
244 | assert daemon._daemon is None |
|
254 | assert daemon._daemon is None | |
245 | assert daemon._callback_thread is None |
|
255 | assert daemon._callback_thread is None | |
246 | tcp_server.shutdown.assert_called_with() |
|
256 | tcp_server.shutdown.assert_called_with() | |
247 | thread.join.assert_called_once_with() |
|
257 | thread.join.assert_called_once_with() | |
248 |
|
258 | |||
249 | assert_message_in_log( |
|
259 | assert_message_in_log( | |
250 | caplog.records, 'Waiting for background thread to finish.', |
|
260 | caplog.records, 'Waiting for background thread to finish.', | |
251 | levelno=logging.DEBUG, module='hooks_daemon') |
|
261 | levelno=logging.DEBUG, module='hooks_daemon') | |
252 |
|
262 | |||
253 | def _tcp_patcher(self, tcp_server): |
|
263 | def _tcp_patcher(self, tcp_server): | |
254 | return mock.patch.object( |
|
264 | return mock.patch.object( | |
255 | hooks_daemon, 'TCPServer', return_value=tcp_server) |
|
265 | hooks_daemon, 'TCPServer', return_value=tcp_server) | |
256 |
|
266 | |||
257 | def _thread_patcher(self, thread): |
|
267 | def _thread_patcher(self, thread): | |
258 | return mock.patch.object( |
|
268 | return mock.patch.object( | |
259 | hooks_daemon.threading, 'Thread', return_value=thread) |
|
269 | hooks_daemon.threading, 'Thread', return_value=thread) | |
260 |
|
270 | |||
261 |
|
271 | |||
262 | class TestPrepareHooksDaemon(object): |
|
272 | class TestPrepareHooksDaemon(object): | |
263 | @pytest.mark.parametrize('protocol', ('http',)) |
|
273 | @pytest.mark.parametrize('protocol', ('http',)) | |
264 | def test_returns_dummy_hooks_callback_daemon_when_using_direct_calls( |
|
274 | def test_returns_dummy_hooks_callback_daemon_when_using_direct_calls( | |
265 | self, protocol): |
|
275 | self, protocol): | |
266 | expected_extras = {'extra1': 'value1'} |
|
276 | expected_extras = {'extra1': 'value1'} | |
267 | callback, extras = hooks_daemon.prepare_callback_daemon( |
|
277 | callback, extras = hooks_daemon.prepare_callback_daemon( | |
268 | expected_extras.copy(), protocol=protocol, |
|
278 | expected_extras.copy(), protocol=protocol, | |
269 | host='127.0.0.1', use_direct_calls=True) |
|
279 | host='127.0.0.1', use_direct_calls=True) | |
270 | assert isinstance(callback, hooks_daemon.DummyHooksCallbackDaemon) |
|
280 | assert isinstance(callback, hooks_daemon.DummyHooksCallbackDaemon) | |
271 | expected_extras['hooks_module'] = 'rhodecode.lib.hooks_daemon' |
|
281 | expected_extras['hooks_module'] = 'rhodecode.lib.hooks_daemon' | |
272 | expected_extras['time'] = extras['time'] |
|
282 | expected_extras['time'] = extras['time'] | |
273 | assert 'extra1' in extras |
|
283 | assert 'extra1' in extras | |
274 |
|
284 | |||
275 | @pytest.mark.parametrize('protocol, expected_class', ( |
|
285 | @pytest.mark.parametrize('protocol, expected_class', ( | |
276 | ('http', hooks_daemon.HttpHooksCallbackDaemon), |
|
286 | ('http', hooks_daemon.HttpHooksCallbackDaemon), | |
277 | )) |
|
287 | )) | |
278 | def test_returns_real_hooks_callback_daemon_when_protocol_is_specified( |
|
288 | def test_returns_real_hooks_callback_daemon_when_protocol_is_specified( | |
279 | self, protocol, expected_class): |
|
289 | self, protocol, expected_class): | |
280 | expected_extras = { |
|
290 | expected_extras = { | |
281 | 'extra1': 'value1', |
|
291 | 'extra1': 'value1', | |
282 | 'txn_id': 'txnid2', |
|
292 | 'txn_id': 'txnid2', | |
283 | 'hooks_protocol': protocol.lower() |
|
293 | 'hooks_protocol': protocol.lower() | |
284 | } |
|
294 | } | |
285 | callback, extras = hooks_daemon.prepare_callback_daemon( |
|
295 | callback, extras = hooks_daemon.prepare_callback_daemon( | |
286 | expected_extras.copy(), protocol=protocol, host='127.0.0.1', |
|
296 | expected_extras.copy(), protocol=protocol, host='127.0.0.1', | |
287 | use_direct_calls=False, |
|
297 | use_direct_calls=False, | |
288 | txn_id='txnid2') |
|
298 | txn_id='txnid2') | |
289 | assert isinstance(callback, expected_class) |
|
299 | assert isinstance(callback, expected_class) | |
290 | extras.pop('hooks_uri') |
|
300 | extras.pop('hooks_uri') | |
291 | expected_extras['time'] = extras['time'] |
|
301 | expected_extras['time'] = extras['time'] | |
292 | assert extras == expected_extras |
|
302 | assert extras == expected_extras | |
293 |
|
303 | |||
294 | @pytest.mark.parametrize('protocol', ( |
|
304 | @pytest.mark.parametrize('protocol', ( | |
295 | 'invalid', |
|
305 | 'invalid', | |
296 | 'Http', |
|
306 | 'Http', | |
297 | 'HTTP', |
|
307 | 'HTTP', | |
298 | )) |
|
308 | )) | |
299 | def test_raises_on_invalid_protocol(self, protocol): |
|
309 | def test_raises_on_invalid_protocol(self, protocol): | |
300 | expected_extras = { |
|
310 | expected_extras = { | |
301 | 'extra1': 'value1', |
|
311 | 'extra1': 'value1', | |
302 | 'hooks_protocol': protocol.lower() |
|
312 | 'hooks_protocol': protocol.lower() | |
303 | } |
|
313 | } | |
304 | with pytest.raises(Exception): |
|
314 | with pytest.raises(Exception): | |
305 | callback, extras = hooks_daemon.prepare_callback_daemon( |
|
315 | callback, extras = hooks_daemon.prepare_callback_daemon( | |
306 | expected_extras.copy(), |
|
316 | expected_extras.copy(), | |
307 | protocol=protocol, host='127.0.0.1', |
|
317 | protocol=protocol, host='127.0.0.1', | |
308 | use_direct_calls=False) |
|
318 | use_direct_calls=False) | |
309 |
|
319 | |||
310 |
|
320 | |||
311 | class MockRequest(object): |
|
321 | class MockRequest(object): | |
312 | def __init__(self, request): |
|
322 | def __init__(self, request): | |
313 | self.request = request |
|
323 | self.request = request | |
314 | self.input_stream = StringIO(b'{}'.format(self.request)) |
|
324 | self.input_stream = StringIO(b'{}'.format(self.request)) | |
315 | self.output_stream = StringIO() |
|
325 | self.output_stream = StringIO() | |
316 |
|
326 | |||
317 | def makefile(self, mode, *args, **kwargs): |
|
327 | def makefile(self, mode, *args, **kwargs): | |
318 | return self.output_stream if mode == 'wb' else self.input_stream |
|
328 | return self.output_stream if mode == 'wb' else self.input_stream | |
319 |
|
329 | |||
320 |
|
330 | |||
321 | class MockServer(object): |
|
331 | class MockServer(object): | |
322 | def __init__(self, Handler, request): |
|
332 | def __init__(self, Handler, request): | |
323 | ip_port = ('0.0.0.0', 8888) |
|
333 | ip_port = ('0.0.0.0', 8888) | |
324 | self.request = MockRequest(request) |
|
334 | self.request = MockRequest(request) | |
325 | self.handler = Handler(self.request, ip_port, self) |
|
335 | self.handler = Handler(self.request, ip_port, self) | |
326 |
|
336 | |||
327 |
|
337 | |||
328 | @pytest.fixture() |
|
338 | @pytest.fixture() | |
329 | def tcp_server(): |
|
339 | def tcp_server(): | |
330 | server = mock.Mock() |
|
340 | server = mock.Mock() | |
331 | server.server_address = ('127.0.0.1', 8881) |
|
341 | server.server_address = ('127.0.0.1', 8881) | |
332 | return server |
|
342 | return server |
@@ -1,717 +1,717 b'' | |||||
1 |
|
1 | |||
2 | ; ######################################### |
|
2 | ; ######################################### | |
3 | ; RHODECODE COMMUNITY EDITION CONFIGURATION |
|
3 | ; RHODECODE COMMUNITY EDITION CONFIGURATION | |
4 | ; ######################################### |
|
4 | ; ######################################### | |
5 |
|
5 | |||
6 | [DEFAULT] |
|
6 | [DEFAULT] | |
7 | ; Debug flag sets all loggers to debug, and enables request tracking |
|
7 | ; Debug flag sets all loggers to debug, and enables request tracking | |
8 | debug = true |
|
8 | debug = true | |
9 |
|
9 | |||
10 | ; ######################################################################## |
|
10 | ; ######################################################################## | |
11 | ; EMAIL CONFIGURATION |
|
11 | ; EMAIL CONFIGURATION | |
12 | ; These settings will be used by the RhodeCode mailing system |
|
12 | ; These settings will be used by the RhodeCode mailing system | |
13 | ; ######################################################################## |
|
13 | ; ######################################################################## | |
14 |
|
14 | |||
15 | ; prefix all emails subjects with given prefix, helps filtering out emails |
|
15 | ; prefix all emails subjects with given prefix, helps filtering out emails | |
16 | #email_prefix = [RhodeCode] |
|
16 | #email_prefix = [RhodeCode] | |
17 |
|
17 | |||
18 | ; email FROM address all mails will be sent |
|
18 | ; email FROM address all mails will be sent | |
19 | #app_email_from = rhodecode-noreply@localhost |
|
19 | #app_email_from = rhodecode-noreply@localhost | |
20 |
|
20 | |||
21 | #smtp_server = mail.server.com |
|
21 | #smtp_server = mail.server.com | |
22 | #smtp_username = |
|
22 | #smtp_username = | |
23 | #smtp_password = |
|
23 | #smtp_password = | |
24 | #smtp_port = |
|
24 | #smtp_port = | |
25 | #smtp_use_tls = false |
|
25 | #smtp_use_tls = false | |
26 | #smtp_use_ssl = true |
|
26 | #smtp_use_ssl = true | |
27 |
|
27 | |||
28 | [server:main] |
|
28 | [server:main] | |
29 | ; COMMON HOST/IP CONFIG |
|
29 | ; COMMON HOST/IP CONFIG | |
30 | host = 0.0.0.0 |
|
30 | host = 0.0.0.0 | |
31 | port = 5000 |
|
31 | port = 5000 | |
32 |
|
32 | |||
33 |
|
33 | |||
34 | ; ########################### |
|
34 | ; ########################### | |
35 | ; GUNICORN APPLICATION SERVER |
|
35 | ; GUNICORN APPLICATION SERVER | |
36 | ; ########################### |
|
36 | ; ########################### | |
37 |
|
37 | |||
38 | ; run with gunicorn --log-config rhodecode.ini --paste rhodecode.ini |
|
38 | ; run with gunicorn --log-config rhodecode.ini --paste rhodecode.ini | |
39 |
|
39 | |||
40 | ; Module to use, this setting shouldn't be changed |
|
40 | ; Module to use, this setting shouldn't be changed | |
41 | use = egg:gunicorn#main |
|
41 | use = egg:gunicorn#main | |
42 |
|
42 | |||
43 | ; Sets the number of process workers. More workers means more concurrent connections |
|
43 | ; Sets the number of process workers. More workers means more concurrent connections | |
44 | ; RhodeCode can handle at the same time. Each additional worker also it increases |
|
44 | ; RhodeCode can handle at the same time. Each additional worker also it increases | |
45 | ; memory usage as each has it's own set of caches. |
|
45 | ; memory usage as each has it's own set of caches. | |
46 | ; Recommended value is (2 * NUMBER_OF_CPUS + 1), eg 2CPU = 5 workers, but no more |
|
46 | ; Recommended value is (2 * NUMBER_OF_CPUS + 1), eg 2CPU = 5 workers, but no more | |
47 | ; than 8-10 unless for really big deployments .e.g 700-1000 users. |
|
47 | ; than 8-10 unless for really big deployments .e.g 700-1000 users. | |
48 | ; `instance_id = *` must be set in the [app:main] section below (which is the default) |
|
48 | ; `instance_id = *` must be set in the [app:main] section below (which is the default) | |
49 | ; when using more than 1 worker. |
|
49 | ; when using more than 1 worker. | |
50 | #workers = 2 |
|
50 | #workers = 2 | |
51 |
|
51 | |||
52 | ; Gunicorn access log level |
|
52 | ; Gunicorn access log level | |
53 | #loglevel = info |
|
53 | #loglevel = info | |
54 |
|
54 | |||
55 | ; Process name visible in process list |
|
55 | ; Process name visible in process list | |
56 | #proc_name = rhodecode |
|
56 | #proc_name = rhodecode | |
57 |
|
57 | |||
58 | ; Type of worker class, one of `sync`, `gevent` |
|
58 | ; Type of worker class, one of `sync`, `gevent` | |
59 | ; Recommended type is `gevent` |
|
59 | ; Recommended type is `gevent` | |
60 | #worker_class = gevent |
|
60 | #worker_class = gevent | |
61 |
|
61 | |||
62 | ; The maximum number of simultaneous clients per worker. Valid only for gevent |
|
62 | ; The maximum number of simultaneous clients per worker. Valid only for gevent | |
63 | #worker_connections = 10 |
|
63 | #worker_connections = 10 | |
64 |
|
64 | |||
65 | ; Max number of requests that worker will handle before being gracefully restarted. |
|
65 | ; Max number of requests that worker will handle before being gracefully restarted. | |
66 | ; Prevents memory leaks, jitter adds variability so not all workers are restarted at once. |
|
66 | ; Prevents memory leaks, jitter adds variability so not all workers are restarted at once. | |
67 | #max_requests = 1000 |
|
67 | #max_requests = 1000 | |
68 | #max_requests_jitter = 30 |
|
68 | #max_requests_jitter = 30 | |
69 |
|
69 | |||
70 | ; Amount of time a worker can spend with handling a request before it |
|
70 | ; Amount of time a worker can spend with handling a request before it | |
71 | ; gets killed and restarted. By default set to 21600 (6hrs) |
|
71 | ; gets killed and restarted. By default set to 21600 (6hrs) | |
72 | ; Examples: 1800 (30min), 3600 (1hr), 7200 (2hr), 43200 (12h) |
|
72 | ; Examples: 1800 (30min), 3600 (1hr), 7200 (2hr), 43200 (12h) | |
73 | #timeout = 21600 |
|
73 | #timeout = 21600 | |
74 |
|
74 | |||
75 | ; The maximum size of HTTP request line in bytes. |
|
75 | ; The maximum size of HTTP request line in bytes. | |
76 | ; 0 for unlimited |
|
76 | ; 0 for unlimited | |
77 | #limit_request_line = 0 |
|
77 | #limit_request_line = 0 | |
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 | ; Each option in the app:main can be override by an environmental variable |
|
94 | ; Each option in the app:main can be override by an environmental variable | |
95 | ; |
|
95 | ; | |
96 | ;To override an option: |
|
96 | ;To override an option: | |
97 | ; |
|
97 | ; | |
98 | ;RC_<KeyName> |
|
98 | ;RC_<KeyName> | |
99 | ;Everything should be uppercase, . and - should be replaced by _. |
|
99 | ;Everything should be uppercase, . and - should be replaced by _. | |
100 | ;For example, if you have these configuration settings: |
|
100 | ;For example, if you have these configuration settings: | |
101 | ;rc_cache.repo_object.backend = foo |
|
101 | ;rc_cache.repo_object.backend = foo | |
102 | ;can be overridden by |
|
102 | ;can be overridden by | |
103 | ;export RC_CACHE_REPO_OBJECT_BACKEND=foo |
|
103 | ;export RC_CACHE_REPO_OBJECT_BACKEND=foo | |
104 |
|
104 | |||
105 | is_test = True |
|
105 | is_test = True | |
106 | use = egg:rhodecode-enterprise-ce |
|
106 | use = egg:rhodecode-enterprise-ce | |
107 |
|
107 | |||
108 | ; enable proxy prefix middleware, defined above |
|
108 | ; enable proxy prefix middleware, defined above | |
109 | #filter-with = proxy-prefix |
|
109 | #filter-with = proxy-prefix | |
110 |
|
110 | |||
111 |
|
111 | |||
112 | ## RHODECODE PLUGINS ## |
|
112 | ## RHODECODE PLUGINS ## | |
113 | rhodecode.includes = rhodecode.api |
|
113 | rhodecode.includes = rhodecode.api | |
114 |
|
114 | |||
115 | # api prefix url |
|
115 | # api prefix url | |
116 | rhodecode.api.url = /_admin/api |
|
116 | rhodecode.api.url = /_admin/api | |
117 |
|
117 | |||
118 |
|
118 | |||
119 | ## END RHODECODE PLUGINS ## |
|
119 | ## END RHODECODE PLUGINS ## | |
120 |
|
120 | |||
121 | ## encryption key used to encrypt social plugin tokens, |
|
121 | ## encryption key used to encrypt social plugin tokens, | |
122 | ## remote_urls with credentials etc, if not set it defaults to |
|
122 | ## remote_urls with credentials etc, if not set it defaults to | |
123 | ## `beaker.session.secret` |
|
123 | ## `beaker.session.secret` | |
124 | #rhodecode.encrypted_values.secret = |
|
124 | #rhodecode.encrypted_values.secret = | |
125 |
|
125 | |||
126 | ; decryption strict mode (enabled by default). It controls if decryption raises |
|
126 | ; decryption strict mode (enabled by default). It controls if decryption raises | |
127 | ; `SignatureVerificationError` in case of wrong key, or damaged encryption data. |
|
127 | ; `SignatureVerificationError` in case of wrong key, or damaged encryption data. | |
128 | #rhodecode.encrypted_values.strict = false |
|
128 | #rhodecode.encrypted_values.strict = false | |
129 |
|
129 | |||
130 | ; Pick algorithm for encryption. Either fernet (more secure) or aes (default) |
|
130 | ; Pick algorithm for encryption. Either fernet (more secure) or aes (default) | |
131 | ; fernet is safer, and we strongly recommend switching to it. |
|
131 | ; fernet is safer, and we strongly recommend switching to it. | |
132 | ; Due to backward compatibility aes is used as default. |
|
132 | ; Due to backward compatibility aes is used as default. | |
133 | #rhodecode.encrypted_values.algorithm = fernet |
|
133 | #rhodecode.encrypted_values.algorithm = fernet | |
134 |
|
134 | |||
135 | ; Return gzipped responses from RhodeCode (static files/application) |
|
135 | ; Return gzipped responses from RhodeCode (static files/application) | |
136 | gzip_responses = false |
|
136 | gzip_responses = false | |
137 |
|
137 | |||
138 | ; Auto-generate javascript routes file on startup |
|
138 | ; Auto-generate javascript routes file on startup | |
139 | generate_js_files = false |
|
139 | generate_js_files = false | |
140 |
|
140 | |||
141 | ; System global default language. |
|
141 | ; System global default language. | |
142 | ; All available languages: en (default), be, de, es, fr, it, ja, pl, pt, ru, zh |
|
142 | ; All available languages: en (default), be, de, es, fr, it, ja, pl, pt, ru, zh | |
143 | lang = en |
|
143 | lang = en | |
144 |
|
144 | |||
145 | ; Perform a full repository scan and import on each server start. |
|
145 | ; Perform a full repository scan and import on each server start. | |
146 | ; Settings this to true could lead to very long startup time. |
|
146 | ; Settings this to true could lead to very long startup time. | |
147 | startup.import_repos = true |
|
147 | startup.import_repos = true | |
148 |
|
148 | |||
149 | ; Uncomment and set this path to use archive download cache. |
|
149 | ; Uncomment and set this path to use archive download cache. | |
150 | ; Once enabled, generated archives will be cached at this location |
|
150 | ; Once enabled, generated archives will be cached at this location | |
151 | ; and served from the cache during subsequent requests for the same archive of |
|
151 | ; and served from the cache during subsequent requests for the same archive of | |
152 | ; the repository. |
|
152 | ; the repository. | |
153 | #archive_cache_dir = /tmp/tarballcache |
|
153 | #archive_cache_dir = /tmp/tarballcache | |
154 |
|
154 | |||
155 | ; URL at which the application is running. This is used for Bootstrapping |
|
155 | ; URL at which the application is running. This is used for Bootstrapping | |
156 | ; requests in context when no web request is available. Used in ishell, or |
|
156 | ; requests in context when no web request is available. Used in ishell, or | |
157 | ; SSH calls. Set this for events to receive proper url for SSH calls. |
|
157 | ; SSH calls. Set this for events to receive proper url for SSH calls. | |
158 | app.base_url = http://rhodecode.local |
|
158 | app.base_url = http://rhodecode.local | |
159 |
|
159 | |||
160 | ; Unique application ID. Should be a random unique string for security. |
|
160 | ; Unique application ID. Should be a random unique string for security. | |
161 | app_instance_uuid = rc-production |
|
161 | app_instance_uuid = rc-production | |
162 |
|
162 | |||
163 | ## cut off limit for large diffs (size in bytes) |
|
163 | ## cut off limit for large diffs (size in bytes) | |
164 | cut_off_limit_diff = 1024000 |
|
164 | cut_off_limit_diff = 1024000 | |
165 | cut_off_limit_file = 256000 |
|
165 | cut_off_limit_file = 256000 | |
166 |
|
166 | |||
167 | ; Use cached version of vcs repositories everywhere. Recommended to be `true` |
|
167 | ; Use cached version of vcs repositories everywhere. Recommended to be `true` | |
168 | vcs_full_cache = false |
|
168 | vcs_full_cache = false | |
169 |
|
169 | |||
170 | ; Force https in RhodeCode, fixes https redirects, assumes it's always https. |
|
170 | ; Force https in RhodeCode, fixes https redirects, assumes it's always https. | |
171 | ; Normally this is controlled by proper flags sent from http server such as Nginx or Apache |
|
171 | ; Normally this is controlled by proper flags sent from http server such as Nginx or Apache | |
172 | force_https = false |
|
172 | force_https = false | |
173 |
|
173 | |||
174 | ; use Strict-Transport-Security headers |
|
174 | ; use Strict-Transport-Security headers | |
175 | use_htsts = false |
|
175 | use_htsts = false | |
176 |
|
176 | |||
177 | ; Set to true if your repos are exposed using the dumb protocol |
|
177 | ; Set to true if your repos are exposed using the dumb protocol | |
178 | git_update_server_info = false |
|
178 | git_update_server_info = false | |
179 |
|
179 | |||
180 | ; RSS/ATOM feed options |
|
180 | ; RSS/ATOM feed options | |
181 | rss_cut_off_limit = 256000 |
|
181 | rss_cut_off_limit = 256000 | |
182 | rss_items_per_page = 10 |
|
182 | rss_items_per_page = 10 | |
183 | rss_include_diff = false |
|
183 | rss_include_diff = false | |
184 |
|
184 | |||
185 | ; gist URL alias, used to create nicer urls for gist. This should be an |
|
185 | ; gist URL alias, used to create nicer urls for gist. This should be an | |
186 | ; url that does rewrites to _admin/gists/{gistid}. |
|
186 | ; url that does rewrites to _admin/gists/{gistid}. | |
187 | ; example: http://gist.rhodecode.org/{gistid}. Empty means use the internal |
|
187 | ; example: http://gist.rhodecode.org/{gistid}. Empty means use the internal | |
188 | ; RhodeCode url, ie. http[s]://rhodecode.server/_admin/gists/{gistid} |
|
188 | ; RhodeCode url, ie. http[s]://rhodecode.server/_admin/gists/{gistid} | |
189 | gist_alias_url = |
|
189 | gist_alias_url = | |
190 |
|
190 | |||
191 | ; List of views (using glob pattern syntax) that AUTH TOKENS could be |
|
191 | ; List of views (using glob pattern syntax) that AUTH TOKENS could be | |
192 | ; used for access. |
|
192 | ; used for access. | |
193 | ; Adding ?auth_token=TOKEN_HASH to the url authenticates this request as if it |
|
193 | ; Adding ?auth_token=TOKEN_HASH to the url authenticates this request as if it | |
194 | ; came from the the logged in user who own this authentication token. |
|
194 | ; came from the the logged in user who own this authentication token. | |
195 | ; Additionally @TOKEN syntax can be used to bound the view to specific |
|
195 | ; Additionally @TOKEN syntax can be used to bound the view to specific | |
196 | ; authentication token. Such view would be only accessible when used together |
|
196 | ; authentication token. Such view would be only accessible when used together | |
197 | ; with this authentication token |
|
197 | ; with this authentication token | |
198 | ; list of all views can be found under `/_admin/permissions/auth_token_access` |
|
198 | ; list of all views can be found under `/_admin/permissions/auth_token_access` | |
199 | ; The list should be "," separated and on a single line. |
|
199 | ; The list should be "," separated and on a single line. | |
200 | ; Most common views to enable: |
|
200 | ; Most common views to enable: | |
201 |
|
201 | |||
202 | # RepoCommitsView:repo_commit_download |
|
202 | # RepoCommitsView:repo_commit_download | |
203 | # RepoCommitsView:repo_commit_patch |
|
203 | # RepoCommitsView:repo_commit_patch | |
204 | # RepoCommitsView:repo_commit_raw |
|
204 | # RepoCommitsView:repo_commit_raw | |
205 | # RepoCommitsView:repo_commit_raw@TOKEN |
|
205 | # RepoCommitsView:repo_commit_raw@TOKEN | |
206 | # RepoFilesView:repo_files_diff |
|
206 | # RepoFilesView:repo_files_diff | |
207 | # RepoFilesView:repo_archivefile |
|
207 | # RepoFilesView:repo_archivefile | |
208 | # RepoFilesView:repo_file_raw |
|
208 | # RepoFilesView:repo_file_raw | |
209 | # GistView:* |
|
209 | # GistView:* | |
210 | api_access_controllers_whitelist = |
|
210 | api_access_controllers_whitelist = | |
211 |
|
211 | |||
212 | ; Default encoding used to convert from and to unicode |
|
212 | ; Default encoding used to convert from and to unicode | |
213 | ; can be also a comma separated list of encoding in case of mixed encodings |
|
213 | ; can be also a comma separated list of encoding in case of mixed encodings | |
214 | default_encoding = UTF-8 |
|
214 | default_encoding = UTF-8 | |
215 |
|
215 | |||
216 | ; instance-id prefix |
|
216 | ; instance-id prefix | |
217 | ; a prefix key for this instance used for cache invalidation when running |
|
217 | ; a prefix key for this instance used for cache invalidation when running | |
218 | ; multiple instances of RhodeCode, make sure it's globally unique for |
|
218 | ; multiple instances of RhodeCode, make sure it's globally unique for | |
219 | ; all running RhodeCode instances. Leave empty if you don't use it |
|
219 | ; all running RhodeCode instances. Leave empty if you don't use it | |
220 | instance_id = |
|
220 | instance_id = | |
221 |
|
221 | |||
222 | ; Fallback authentication plugin. Set this to a plugin ID to force the usage |
|
222 | ; Fallback authentication plugin. Set this to a plugin ID to force the usage | |
223 | ; of an authentication plugin also if it is disabled by it's settings. |
|
223 | ; of an authentication plugin also if it is disabled by it's settings. | |
224 | ; This could be useful if you are unable to log in to the system due to broken |
|
224 | ; This could be useful if you are unable to log in to the system due to broken | |
225 | ; authentication settings. Then you can enable e.g. the internal RhodeCode auth |
|
225 | ; authentication settings. Then you can enable e.g. the internal RhodeCode auth | |
226 | ; module to log in again and fix the settings. |
|
226 | ; module to log in again and fix the settings. | |
227 | ; Available builtin plugin IDs (hash is part of the ID): |
|
227 | ; Available builtin plugin IDs (hash is part of the ID): | |
228 | ; egg:rhodecode-enterprise-ce#rhodecode |
|
228 | ; egg:rhodecode-enterprise-ce#rhodecode | |
229 | ; egg:rhodecode-enterprise-ce#pam |
|
229 | ; egg:rhodecode-enterprise-ce#pam | |
230 | ; egg:rhodecode-enterprise-ce#ldap |
|
230 | ; egg:rhodecode-enterprise-ce#ldap | |
231 | ; egg:rhodecode-enterprise-ce#jasig_cas |
|
231 | ; egg:rhodecode-enterprise-ce#jasig_cas | |
232 | ; egg:rhodecode-enterprise-ce#headers |
|
232 | ; egg:rhodecode-enterprise-ce#headers | |
233 | ; egg:rhodecode-enterprise-ce#crowd |
|
233 | ; egg:rhodecode-enterprise-ce#crowd | |
234 |
|
234 | |||
235 | #rhodecode.auth_plugin_fallback = egg:rhodecode-enterprise-ce#rhodecode |
|
235 | #rhodecode.auth_plugin_fallback = egg:rhodecode-enterprise-ce#rhodecode | |
236 |
|
236 | |||
237 | ; Flag to control loading of legacy plugins in py:/path format |
|
237 | ; Flag to control loading of legacy plugins in py:/path format | |
238 | auth_plugin.import_legacy_plugins = true |
|
238 | auth_plugin.import_legacy_plugins = true | |
239 |
|
239 | |||
240 | ; alternative return HTTP header for failed authentication. Default HTTP |
|
240 | ; alternative return HTTP header for failed authentication. Default HTTP | |
241 | ; response is 401 HTTPUnauthorized. Currently HG clients have troubles with |
|
241 | ; response is 401 HTTPUnauthorized. Currently HG clients have troubles with | |
242 | ; handling that causing a series of failed authentication calls. |
|
242 | ; handling that causing a series of failed authentication calls. | |
243 | ; Set this variable to 403 to return HTTPForbidden, or any other HTTP code |
|
243 | ; Set this variable to 403 to return HTTPForbidden, or any other HTTP code | |
244 | ; This will be served instead of default 401 on bad authentication |
|
244 | ; This will be served instead of default 401 on bad authentication | |
245 | auth_ret_code = |
|
245 | auth_ret_code = | |
246 |
|
246 | |||
247 | ; use special detection method when serving auth_ret_code, instead of serving |
|
247 | ; use special detection method when serving auth_ret_code, instead of serving | |
248 | ; ret_code directly, use 401 initially (Which triggers credentials prompt) |
|
248 | ; ret_code directly, use 401 initially (Which triggers credentials prompt) | |
249 | ; and then serve auth_ret_code to clients |
|
249 | ; and then serve auth_ret_code to clients | |
250 | auth_ret_code_detection = false |
|
250 | auth_ret_code_detection = false | |
251 |
|
251 | |||
252 | ; locking return code. When repository is locked return this HTTP code. 2XX |
|
252 | ; locking return code. When repository is locked return this HTTP code. 2XX | |
253 | ; codes don't break the transactions while 4XX codes do |
|
253 | ; codes don't break the transactions while 4XX codes do | |
254 | lock_ret_code = 423 |
|
254 | lock_ret_code = 423 | |
255 |
|
255 | |||
256 | ; allows to change the repository location in settings page |
|
256 | ; allows to change the repository location in settings page | |
257 | allow_repo_location_change = true |
|
257 | allow_repo_location_change = true | |
258 |
|
258 | |||
259 | ; allows to setup custom hooks in settings page |
|
259 | ; allows to setup custom hooks in settings page | |
260 | allow_custom_hooks_settings = true |
|
260 | allow_custom_hooks_settings = true | |
261 |
|
261 | |||
262 | ## generated license token, goto license page in RhodeCode settings to obtain |
|
262 | ## generated license token, goto license page in RhodeCode settings to obtain | |
263 | ## new token |
|
263 | ## new token | |
264 | license_token = abra-cada-bra1-rce3 |
|
264 | license_token = abra-cada-bra1-rce3 | |
265 |
|
265 | |||
266 | ## supervisor connection uri, for managing supervisor and logs. |
|
266 | ## supervisor connection uri, for managing supervisor and logs. | |
267 | supervisor.uri = |
|
267 | supervisor.uri = | |
268 | ## supervisord group name/id we only want this RC instance to handle |
|
268 | ## supervisord group name/id we only want this RC instance to handle | |
269 | supervisor.group_id = dev |
|
269 | supervisor.group_id = dev | |
270 |
|
270 | |||
271 | ## Display extended labs settings |
|
271 | ## Display extended labs settings | |
272 | labs_settings_active = true |
|
272 | labs_settings_active = true | |
273 |
|
273 | |||
274 | ; Custom exception store path, defaults to TMPDIR |
|
274 | ; Custom exception store path, defaults to TMPDIR | |
275 | ; This is used to store exception from RhodeCode in shared directory |
|
275 | ; This is used to store exception from RhodeCode in shared directory | |
276 | #exception_tracker.store_path = |
|
276 | #exception_tracker.store_path = | |
277 |
|
277 | |||
278 | ; Send email with exception details when it happens |
|
278 | ; Send email with exception details when it happens | |
279 | #exception_tracker.send_email = false |
|
279 | #exception_tracker.send_email = false | |
280 |
|
280 | |||
281 | ; Comma separated list of recipients for exception emails, |
|
281 | ; Comma separated list of recipients for exception emails, | |
282 | ; e.g admin@rhodecode.com,devops@rhodecode.com |
|
282 | ; e.g admin@rhodecode.com,devops@rhodecode.com | |
283 | ; Can be left empty, then emails will be sent to ALL super-admins |
|
283 | ; Can be left empty, then emails will be sent to ALL super-admins | |
284 | #exception_tracker.send_email_recipients = |
|
284 | #exception_tracker.send_email_recipients = | |
285 |
|
285 | |||
286 | ; optional prefix to Add to email Subject |
|
286 | ; optional prefix to Add to email Subject | |
287 | #exception_tracker.email_prefix = [RHODECODE ERROR] |
|
287 | #exception_tracker.email_prefix = [RHODECODE ERROR] | |
288 |
|
288 | |||
289 | ; File store configuration. This is used to store and serve uploaded files |
|
289 | ; File store configuration. This is used to store and serve uploaded files | |
290 | file_store.enabled = true |
|
290 | file_store.enabled = true | |
291 |
|
291 | |||
292 | ; Storage backend, available options are: local |
|
292 | ; Storage backend, available options are: local | |
293 | file_store.backend = local |
|
293 | file_store.backend = local | |
294 |
|
294 | |||
295 | ; path to store the uploaded binaries |
|
295 | ; path to store the uploaded binaries | |
296 | file_store.storage_path = %(here)s/data/file_store |
|
296 | file_store.storage_path = %(here)s/data/file_store | |
297 |
|
297 | |||
298 |
|
298 | |||
299 | ; ############# |
|
299 | ; ############# | |
300 | ; CELERY CONFIG |
|
300 | ; CELERY CONFIG | |
301 | ; ############# |
|
301 | ; ############# | |
302 |
|
302 | |||
303 | ; manually run celery: /path/to/celery worker -E --beat --app rhodecode.lib.celerylib.loader --scheduler rhodecode.lib.celerylib.scheduler.RcScheduler --loglevel DEBUG --ini /path/to/rhodecode.ini |
|
303 | ; manually run celery: /path/to/celery worker -E --beat --app rhodecode.lib.celerylib.loader --scheduler rhodecode.lib.celerylib.scheduler.RcScheduler --loglevel DEBUG --ini /path/to/rhodecode.ini | |
304 |
|
304 | |||
305 | use_celery = false |
|
305 | use_celery = false | |
306 |
|
306 | |||
307 | ; path to store schedule database |
|
307 | ; path to store schedule database | |
308 | #celerybeat-schedule.path = |
|
308 | #celerybeat-schedule.path = | |
309 |
|
309 | |||
310 | ; connection url to the message broker (default redis) |
|
310 | ; connection url to the message broker (default redis) | |
311 | celery.broker_url = redis://localhost:6379/8 |
|
311 | celery.broker_url = redis://localhost:6379/8 | |
312 |
|
312 | |||
313 | ; rabbitmq example |
|
313 | ; rabbitmq example | |
314 | #celery.broker_url = amqp://rabbitmq:qweqwe@localhost:5672/rabbitmqhost |
|
314 | #celery.broker_url = amqp://rabbitmq:qweqwe@localhost:5672/rabbitmqhost | |
315 |
|
315 | |||
316 | ; maximum tasks to execute before worker restart |
|
316 | ; maximum tasks to execute before worker restart | |
317 | celery.max_tasks_per_child = 100 |
|
317 | celery.max_tasks_per_child = 100 | |
318 |
|
318 | |||
319 | ; tasks will never be sent to the queue, but executed locally instead. |
|
319 | ; tasks will never be sent to the queue, but executed locally instead. | |
320 | celery.task_always_eager = false |
|
320 | celery.task_always_eager = false | |
321 |
|
321 | |||
322 | ; ############# |
|
322 | ; ############# | |
323 | ; DOGPILE CACHE |
|
323 | ; DOGPILE CACHE | |
324 | ; ############# |
|
324 | ; ############# | |
325 |
|
325 | |||
326 | ; Default cache dir for caches. Putting this into a ramdisk can boost performance. |
|
326 | ; Default cache dir for caches. Putting this into a ramdisk can boost performance. | |
327 | ; eg. /tmpfs/data_ramdisk, however this directory might require large amount of space |
|
327 | ; eg. /tmpfs/data_ramdisk, however this directory might require large amount of space | |
328 | cache_dir = %(here)s/data |
|
328 | cache_dir = %(here)s/data | |
329 |
|
329 | |||
330 | ## locking and default file storage for Beaker. Putting this into a ramdisk |
|
330 | ## locking and default file storage for Beaker. Putting this into a ramdisk | |
331 | ## can boost performance, eg. %(here)s/data_ramdisk/cache/beaker_data |
|
331 | ## can boost performance, eg. %(here)s/data_ramdisk/cache/beaker_data | |
332 | beaker.cache.data_dir = %(here)s/rc/data/cache/beaker_data |
|
332 | beaker.cache.data_dir = %(here)s/rc/data/cache/beaker_data | |
333 | beaker.cache.lock_dir = %(here)s/rc/data/cache/beaker_lock |
|
333 | beaker.cache.lock_dir = %(here)s/rc/data/cache/beaker_lock | |
334 |
|
334 | |||
335 | beaker.cache.regions = long_term |
|
335 | beaker.cache.regions = long_term | |
336 |
|
336 | |||
337 | beaker.cache.long_term.type = memory |
|
337 | beaker.cache.long_term.type = memory | |
338 | beaker.cache.long_term.expire = 36000 |
|
338 | beaker.cache.long_term.expire = 36000 | |
339 | beaker.cache.long_term.key_length = 256 |
|
339 | beaker.cache.long_term.key_length = 256 | |
340 |
|
340 | |||
341 |
|
341 | |||
342 | ##################################### |
|
342 | ##################################### | |
343 | ### DOGPILE CACHE #### |
|
343 | ### DOGPILE CACHE #### | |
344 | ##################################### |
|
344 | ##################################### | |
345 |
|
345 | |||
346 | ## permission tree cache settings |
|
346 | ## permission tree cache settings | |
347 | rc_cache.cache_perms.backend = dogpile.cache.rc.file_namespace |
|
347 | rc_cache.cache_perms.backend = dogpile.cache.rc.file_namespace | |
348 | rc_cache.cache_perms.expiration_time = 0 |
|
348 | rc_cache.cache_perms.expiration_time = 0 | |
349 | rc_cache.cache_perms.arguments.filename = /tmp/rc_cache_1 |
|
349 | rc_cache.cache_perms.arguments.filename = /tmp/rc_cache_1 | |
350 |
|
350 | |||
351 |
|
351 | |||
352 | ## cache settings for SQL queries |
|
352 | ## cache settings for SQL queries | |
353 | rc_cache.sql_cache_short.backend = dogpile.cache.rc.memory_lru |
|
353 | rc_cache.sql_cache_short.backend = dogpile.cache.rc.memory_lru | |
354 | rc_cache.sql_cache_short.expiration_time = 0 |
|
354 | rc_cache.sql_cache_short.expiration_time = 0 | |
355 |
|
355 | |||
356 |
|
356 | |||
357 | ; ############## |
|
357 | ; ############## | |
358 | ; BEAKER SESSION |
|
358 | ; BEAKER SESSION | |
359 | ; ############## |
|
359 | ; ############## | |
360 |
|
360 | |||
361 | ; beaker.session.type is type of storage options for the logged users sessions. Current allowed |
|
361 | ; beaker.session.type is type of storage options for the logged users sessions. Current allowed | |
362 | ; types are file, ext:redis, ext:database, ext:memcached, and memory (default if not specified). |
|
362 | ; types are file, ext:redis, ext:database, ext:memcached, and memory (default if not specified). | |
363 | ; Fastest ones are Redis and ext:database |
|
363 | ; Fastest ones are Redis and ext:database | |
364 | beaker.session.type = file |
|
364 | beaker.session.type = file | |
365 | beaker.session.data_dir = %(here)s/rc/data/sessions/data |
|
365 | beaker.session.data_dir = %(here)s/rc/data/sessions/data | |
366 |
|
366 | |||
367 | ; Redis based sessions |
|
367 | ; Redis based sessions | |
368 | #beaker.session.type = ext:redis |
|
368 | #beaker.session.type = ext:redis | |
369 | #beaker.session.url = redis://127.0.0.1:6379/2 |
|
369 | #beaker.session.url = redis://127.0.0.1:6379/2 | |
370 |
|
370 | |||
371 | ; DB based session, fast, and allows easy management over logged in users |
|
371 | ; DB based session, fast, and allows easy management over logged in users | |
372 | #beaker.session.type = ext:database |
|
372 | #beaker.session.type = ext:database | |
373 | #beaker.session.table_name = db_session |
|
373 | #beaker.session.table_name = db_session | |
374 | #beaker.session.sa.url = postgresql://postgres:secret@localhost/rhodecode |
|
374 | #beaker.session.sa.url = postgresql://postgres:secret@localhost/rhodecode | |
375 | #beaker.session.sa.url = mysql://root:secret@127.0.0.1/rhodecode |
|
375 | #beaker.session.sa.url = mysql://root:secret@127.0.0.1/rhodecode | |
376 | #beaker.session.sa.pool_recycle = 3600 |
|
376 | #beaker.session.sa.pool_recycle = 3600 | |
377 | #beaker.session.sa.echo = false |
|
377 | #beaker.session.sa.echo = false | |
378 |
|
378 | |||
379 | beaker.session.key = rhodecode |
|
379 | beaker.session.key = rhodecode | |
380 | beaker.session.secret = test-rc-uytcxaz |
|
380 | beaker.session.secret = test-rc-uytcxaz | |
381 | beaker.session.lock_dir = %(here)s/rc/data/sessions/lock |
|
381 | beaker.session.lock_dir = %(here)s/rc/data/sessions/lock | |
382 |
|
382 | |||
383 | ; Secure encrypted cookie. Requires AES and AES python libraries |
|
383 | ; Secure encrypted cookie. Requires AES and AES python libraries | |
384 | ; you must disable beaker.session.secret to use this |
|
384 | ; you must disable beaker.session.secret to use this | |
385 | #beaker.session.encrypt_key = key_for_encryption |
|
385 | #beaker.session.encrypt_key = key_for_encryption | |
386 | #beaker.session.validate_key = validation_key |
|
386 | #beaker.session.validate_key = validation_key | |
387 |
|
387 | |||
388 | ; Sets session as invalid (also logging out user) if it haven not been |
|
388 | ; Sets session as invalid (also logging out user) if it haven not been | |
389 | ; accessed for given amount of time in seconds |
|
389 | ; accessed for given amount of time in seconds | |
390 | beaker.session.timeout = 2592000 |
|
390 | beaker.session.timeout = 2592000 | |
391 | beaker.session.httponly = true |
|
391 | beaker.session.httponly = true | |
392 |
|
392 | |||
393 | ; Path to use for the cookie. Set to prefix if you use prefix middleware |
|
393 | ; Path to use for the cookie. Set to prefix if you use prefix middleware | |
394 | #beaker.session.cookie_path = /custom_prefix |
|
394 | #beaker.session.cookie_path = /custom_prefix | |
395 |
|
395 | |||
396 | ; Set https secure cookie |
|
396 | ; Set https secure cookie | |
397 | beaker.session.secure = false |
|
397 | beaker.session.secure = false | |
398 |
|
398 | |||
399 | ## auto save the session to not to use .save() |
|
399 | ## auto save the session to not to use .save() | |
400 | beaker.session.auto = false |
|
400 | beaker.session.auto = false | |
401 |
|
401 | |||
402 | ; default cookie expiration time in seconds, set to `true` to set expire |
|
402 | ; default cookie expiration time in seconds, set to `true` to set expire | |
403 | ; at browser close |
|
403 | ; at browser close | |
404 | #beaker.session.cookie_expires = 3600 |
|
404 | #beaker.session.cookie_expires = 3600 | |
405 |
|
405 | |||
406 | ; ############################# |
|
406 | ; ############################# | |
407 | ; SEARCH INDEXING CONFIGURATION |
|
407 | ; SEARCH INDEXING CONFIGURATION | |
408 | ; ############################# |
|
408 | ; ############################# | |
409 |
|
409 | |||
410 | ; Full text search indexer is available in rhodecode-tools under |
|
410 | ; Full text search indexer is available in rhodecode-tools under | |
411 | ; `rhodecode-tools index` command |
|
411 | ; `rhodecode-tools index` command | |
412 |
|
412 | |||
413 | ; WHOOSH Backend, doesn't require additional services to run |
|
413 | ; WHOOSH Backend, doesn't require additional services to run | |
414 | ; it works good with few dozen repos |
|
414 | ; it works good with few dozen repos | |
415 | search.module = rhodecode.lib.index.whoosh |
|
415 | search.module = rhodecode.lib.index.whoosh | |
416 | search.location = %(here)s/data/index |
|
416 | search.location = %(here)s/data/index | |
417 |
|
417 | |||
418 | ; #################### |
|
418 | ; #################### | |
419 | ; CHANNELSTREAM CONFIG |
|
419 | ; CHANNELSTREAM CONFIG | |
420 | ; #################### |
|
420 | ; #################### | |
421 |
|
421 | |||
422 | ; channelstream enables persistent connections and live notification |
|
422 | ; channelstream enables persistent connections and live notification | |
423 | ; in the system. It's also used by the chat system |
|
423 | ; in the system. It's also used by the chat system | |
424 |
|
424 | |||
425 | channelstream.enabled = false |
|
425 | channelstream.enabled = false | |
426 |
|
426 | |||
427 | ; server address for channelstream server on the backend |
|
427 | ; server address for channelstream server on the backend | |
428 | channelstream.server = 127.0.0.1:9800 |
|
428 | channelstream.server = 127.0.0.1:9800 | |
429 |
|
429 | |||
430 | ; location of the channelstream server from outside world |
|
430 | ; location of the channelstream server from outside world | |
431 | ; use ws:// for http or wss:// for https. This address needs to be handled |
|
431 | ; use ws:// for http or wss:// for https. This address needs to be handled | |
432 | ; by external HTTP server such as Nginx or Apache |
|
432 | ; by external HTTP server such as Nginx or Apache | |
433 | ; see Nginx/Apache configuration examples in our docs |
|
433 | ; see Nginx/Apache configuration examples in our docs | |
434 | channelstream.ws_url = ws://rhodecode.yourserver.com/_channelstream |
|
434 | channelstream.ws_url = ws://rhodecode.yourserver.com/_channelstream | |
435 | channelstream.secret = secret |
|
435 | channelstream.secret = secret | |
436 | channelstream.history.location = %(here)s/channelstream_history |
|
436 | channelstream.history.location = %(here)s/channelstream_history | |
437 |
|
437 | |||
438 | ; Internal application path that Javascript uses to connect into. |
|
438 | ; Internal application path that Javascript uses to connect into. | |
439 | ; If you use proxy-prefix the prefix should be added before /_channelstream |
|
439 | ; If you use proxy-prefix the prefix should be added before /_channelstream | |
440 | channelstream.proxy_path = /_channelstream |
|
440 | channelstream.proxy_path = /_channelstream | |
441 |
|
441 | |||
442 |
|
442 | |||
443 | ; ############################## |
|
443 | ; ############################## | |
444 | ; MAIN RHODECODE DATABASE CONFIG |
|
444 | ; MAIN RHODECODE DATABASE CONFIG | |
445 | ; ############################## |
|
445 | ; ############################## | |
446 |
|
446 | |||
447 | #sqlalchemy.db1.url = sqlite:///%(here)s/rhodecode.db?timeout=30 |
|
447 | #sqlalchemy.db1.url = sqlite:///%(here)s/rhodecode.db?timeout=30 | |
448 | #sqlalchemy.db1.url = postgresql://postgres:qweqwe@localhost/rhodecode |
|
448 | #sqlalchemy.db1.url = postgresql://postgres:qweqwe@localhost/rhodecode | |
449 | #sqlalchemy.db1.url = mysql://root:qweqwe@localhost/rhodecode?charset=utf8 |
|
449 | #sqlalchemy.db1.url = mysql://root:qweqwe@localhost/rhodecode?charset=utf8 | |
450 | ; pymysql is an alternative driver for MySQL, use in case of problems with default one |
|
450 | ; pymysql is an alternative driver for MySQL, use in case of problems with default one | |
451 | #sqlalchemy.db1.url = mysql+pymysql://root:qweqwe@localhost/rhodecode |
|
451 | #sqlalchemy.db1.url = mysql+pymysql://root:qweqwe@localhost/rhodecode | |
452 |
|
452 | |||
453 | sqlalchemy.db1.url = sqlite:///%(here)s/rhodecode_test.db?timeout=30 |
|
453 | sqlalchemy.db1.url = sqlite:///%(here)s/rhodecode_test.db?timeout=30 | |
454 |
|
454 | |||
455 | ; see sqlalchemy docs for other advanced settings |
|
455 | ; see sqlalchemy docs for other advanced settings | |
456 | ; print the sql statements to output |
|
456 | ; print the sql statements to output | |
457 | sqlalchemy.db1.echo = false |
|
457 | sqlalchemy.db1.echo = false | |
458 |
|
458 | |||
459 | ; recycle the connections after this amount of seconds |
|
459 | ; recycle the connections after this amount of seconds | |
460 | sqlalchemy.db1.pool_recycle = 3600 |
|
460 | sqlalchemy.db1.pool_recycle = 3600 | |
461 | sqlalchemy.db1.convert_unicode = true |
|
461 | sqlalchemy.db1.convert_unicode = true | |
462 |
|
462 | |||
463 | ; the number of connections to keep open inside the connection pool. |
|
463 | ; the number of connections to keep open inside the connection pool. | |
464 | ; 0 indicates no limit |
|
464 | ; 0 indicates no limit | |
465 | #sqlalchemy.db1.pool_size = 5 |
|
465 | #sqlalchemy.db1.pool_size = 5 | |
466 |
|
466 | |||
467 | ; The number of connections to allow in connection pool "overflow", that is |
|
467 | ; The number of connections to allow in connection pool "overflow", that is | |
468 | ; connections that can be opened above and beyond the pool_size setting, |
|
468 | ; connections that can be opened above and beyond the pool_size setting, | |
469 | ; which defaults to five. |
|
469 | ; which defaults to five. | |
470 | #sqlalchemy.db1.max_overflow = 10 |
|
470 | #sqlalchemy.db1.max_overflow = 10 | |
471 |
|
471 | |||
472 | ; Connection check ping, used to detect broken database connections |
|
472 | ; Connection check ping, used to detect broken database connections | |
473 | ; could be enabled to better handle cases if MySQL has gone away errors |
|
473 | ; could be enabled to better handle cases if MySQL has gone away errors | |
474 | #sqlalchemy.db1.ping_connection = true |
|
474 | #sqlalchemy.db1.ping_connection = true | |
475 |
|
475 | |||
476 | ; ########## |
|
476 | ; ########## | |
477 | ; VCS CONFIG |
|
477 | ; VCS CONFIG | |
478 | ; ########## |
|
478 | ; ########## | |
479 | vcs.server.enable = true |
|
479 | vcs.server.enable = true | |
480 | vcs.server = localhost:9901 |
|
480 | vcs.server = localhost:9901 | |
481 |
|
481 | |||
482 | ; Web server connectivity protocol, responsible for web based VCS operations |
|
482 | ; Web server connectivity protocol, responsible for web based VCS operations | |
483 | ; Available protocols are: |
|
483 | ; Available protocols are: | |
484 | ; `http` - use http-rpc backend (default) |
|
484 | ; `http` - use http-rpc backend (default) | |
485 | vcs.server.protocol = http |
|
485 | vcs.server.protocol = http | |
486 |
|
486 | |||
487 | ; Push/Pull operations protocol, available options are: |
|
487 | ; Push/Pull operations protocol, available options are: | |
488 | ; `http` - use http-rpc backend (default) |
|
488 | ; `http` - use http-rpc backend (default) | |
489 | vcs.scm_app_implementation = http |
|
489 | vcs.scm_app_implementation = http | |
490 |
|
490 | |||
491 | ; Push/Pull operations hooks protocol, available options are: |
|
491 | ; Push/Pull operations hooks protocol, available options are: | |
492 | ; `http` - use http-rpc backend (default) |
|
492 | ; `http` - use http-rpc backend (default) | |
493 | vcs.hooks.protocol = http |
|
493 | vcs.hooks.protocol = http | |
494 |
|
494 | |||
495 | ; Host on which this instance is listening for hooks. If vcsserver is in other location |
|
495 | ; Host on which this instance is listening for hooks. If vcsserver is in other location | |
496 | ; this should be adjusted. |
|
496 | ; this should be adjusted. | |
497 |
vcs.hooks.host = |
|
497 | vcs.hooks.host = * | |
498 |
|
498 | |||
499 | ; Start VCSServer with this instance as a subprocess, useful for development |
|
499 | ; Start VCSServer with this instance as a subprocess, useful for development | |
500 | vcs.start_server = false |
|
500 | vcs.start_server = false | |
501 |
|
501 | |||
502 | ; List of enabled VCS backends, available options are: |
|
502 | ; List of enabled VCS backends, available options are: | |
503 | ; `hg` - mercurial |
|
503 | ; `hg` - mercurial | |
504 | ; `git` - git |
|
504 | ; `git` - git | |
505 | ; `svn` - subversion |
|
505 | ; `svn` - subversion | |
506 | vcs.backends = hg, git, svn |
|
506 | vcs.backends = hg, git, svn | |
507 |
|
507 | |||
508 | ; Wait this number of seconds before killing connection to the vcsserver |
|
508 | ; Wait this number of seconds before killing connection to the vcsserver | |
509 | vcs.connection_timeout = 3600 |
|
509 | vcs.connection_timeout = 3600 | |
510 |
|
510 | |||
511 | ; Compatibility version when creating SVN repositories. Defaults to newest version when commented out. |
|
511 | ; Compatibility version when creating SVN repositories. Defaults to newest version when commented out. | |
512 | ; Set a numeric version for your current SVN e.g 1.8, or 1.12 |
|
512 | ; Set a numeric version for your current SVN e.g 1.8, or 1.12 | |
513 | ; Legacy available options are: pre-1.4-compatible, pre-1.5-compatible, pre-1.6-compatible, pre-1.8-compatible, pre-1.9-compatible |
|
513 | ; Legacy available options are: pre-1.4-compatible, pre-1.5-compatible, pre-1.6-compatible, pre-1.8-compatible, pre-1.9-compatible | |
514 | #vcs.svn.compatible_version = 1.8 |
|
514 | #vcs.svn.compatible_version = 1.8 | |
515 |
|
515 | |||
516 | ; Cache flag to cache vcsserver remote calls locally |
|
516 | ; Cache flag to cache vcsserver remote calls locally | |
517 | ; It uses cache_region `cache_repo` |
|
517 | ; It uses cache_region `cache_repo` | |
518 | vcs.methods.cache = false |
|
518 | vcs.methods.cache = false | |
519 |
|
519 | |||
520 | ; #################################################### |
|
520 | ; #################################################### | |
521 | ; Subversion proxy support (mod_dav_svn) |
|
521 | ; Subversion proxy support (mod_dav_svn) | |
522 | ; Maps RhodeCode repo groups into SVN paths for Apache |
|
522 | ; Maps RhodeCode repo groups into SVN paths for Apache | |
523 | ; #################################################### |
|
523 | ; #################################################### | |
524 |
|
524 | |||
525 | ; Enable or disable the config file generation. |
|
525 | ; Enable or disable the config file generation. | |
526 | svn.proxy.generate_config = false |
|
526 | svn.proxy.generate_config = false | |
527 |
|
527 | |||
528 | ; Generate config file with `SVNListParentPath` set to `On`. |
|
528 | ; Generate config file with `SVNListParentPath` set to `On`. | |
529 | svn.proxy.list_parent_path = true |
|
529 | svn.proxy.list_parent_path = true | |
530 |
|
530 | |||
531 | ; Set location and file name of generated config file. |
|
531 | ; Set location and file name of generated config file. | |
532 | svn.proxy.config_file_path = %(here)s/mod_dav_svn.conf |
|
532 | svn.proxy.config_file_path = %(here)s/mod_dav_svn.conf | |
533 |
|
533 | |||
534 | ; alternative mod_dav config template. This needs to be a valid mako template |
|
534 | ; alternative mod_dav config template. This needs to be a valid mako template | |
535 | ; Example template can be found in the source code: |
|
535 | ; Example template can be found in the source code: | |
536 | ; rhodecode/apps/svn_support/templates/mod-dav-svn.conf.mako |
|
536 | ; rhodecode/apps/svn_support/templates/mod-dav-svn.conf.mako | |
537 | #svn.proxy.config_template = ~/.rccontrol/enterprise-1/custom_svn_conf.mako |
|
537 | #svn.proxy.config_template = ~/.rccontrol/enterprise-1/custom_svn_conf.mako | |
538 |
|
538 | |||
539 | ; Used as a prefix to the `Location` block in the generated config file. |
|
539 | ; Used as a prefix to the `Location` block in the generated config file. | |
540 | ; In most cases it should be set to `/`. |
|
540 | ; In most cases it should be set to `/`. | |
541 | svn.proxy.location_root = / |
|
541 | svn.proxy.location_root = / | |
542 |
|
542 | |||
543 | ; Command to reload the mod dav svn configuration on change. |
|
543 | ; Command to reload the mod dav svn configuration on change. | |
544 | ; Example: `/etc/init.d/apache2 reload` or /home/USER/apache_reload.sh |
|
544 | ; Example: `/etc/init.d/apache2 reload` or /home/USER/apache_reload.sh | |
545 | ; Make sure user who runs RhodeCode process is allowed to reload Apache |
|
545 | ; Make sure user who runs RhodeCode process is allowed to reload Apache | |
546 | #svn.proxy.reload_cmd = /etc/init.d/apache2 reload |
|
546 | #svn.proxy.reload_cmd = /etc/init.d/apache2 reload | |
547 |
|
547 | |||
548 | ; If the timeout expires before the reload command finishes, the command will |
|
548 | ; If the timeout expires before the reload command finishes, the command will | |
549 | ; be killed. Setting it to zero means no timeout. Defaults to 10 seconds. |
|
549 | ; be killed. Setting it to zero means no timeout. Defaults to 10 seconds. | |
550 | #svn.proxy.reload_timeout = 10 |
|
550 | #svn.proxy.reload_timeout = 10 | |
551 |
|
551 | |||
552 | ; #################### |
|
552 | ; #################### | |
553 | ; SSH Support Settings |
|
553 | ; SSH Support Settings | |
554 | ; #################### |
|
554 | ; #################### | |
555 |
|
555 | |||
556 | ; Defines if a custom authorized_keys file should be created and written on |
|
556 | ; Defines if a custom authorized_keys file should be created and written on | |
557 | ; any change user ssh keys. Setting this to false also disables possibility |
|
557 | ; any change user ssh keys. Setting this to false also disables possibility | |
558 | ; of adding SSH keys by users from web interface. Super admins can still |
|
558 | ; of adding SSH keys by users from web interface. Super admins can still | |
559 | ; manage SSH Keys. |
|
559 | ; manage SSH Keys. | |
560 | ssh.generate_authorized_keyfile = true |
|
560 | ssh.generate_authorized_keyfile = true | |
561 |
|
561 | |||
562 | ; Options for ssh, default is `no-pty,no-port-forwarding,no-X11-forwarding,no-agent-forwarding` |
|
562 | ; Options for ssh, default is `no-pty,no-port-forwarding,no-X11-forwarding,no-agent-forwarding` | |
563 | # ssh.authorized_keys_ssh_opts = |
|
563 | # ssh.authorized_keys_ssh_opts = | |
564 |
|
564 | |||
565 | ; Path to the authorized_keys file where the generate entries are placed. |
|
565 | ; Path to the authorized_keys file where the generate entries are placed. | |
566 | ; It is possible to have multiple key files specified in `sshd_config` e.g. |
|
566 | ; It is possible to have multiple key files specified in `sshd_config` e.g. | |
567 | ; AuthorizedKeysFile %h/.ssh/authorized_keys %h/.ssh/authorized_keys_rhodecode |
|
567 | ; AuthorizedKeysFile %h/.ssh/authorized_keys %h/.ssh/authorized_keys_rhodecode | |
568 | ssh.authorized_keys_file_path = %(here)s/rc/authorized_keys_rhodecode |
|
568 | ssh.authorized_keys_file_path = %(here)s/rc/authorized_keys_rhodecode | |
569 |
|
569 | |||
570 | ; Command to execute the SSH wrapper. The binary is available in the |
|
570 | ; Command to execute the SSH wrapper. The binary is available in the | |
571 | ; RhodeCode installation directory. |
|
571 | ; RhodeCode installation directory. | |
572 | ; e.g ~/.rccontrol/community-1/profile/bin/rc-ssh-wrapper |
|
572 | ; e.g ~/.rccontrol/community-1/profile/bin/rc-ssh-wrapper | |
573 | ssh.wrapper_cmd = ~/.rccontrol/community-1/rc-ssh-wrapper |
|
573 | ssh.wrapper_cmd = ~/.rccontrol/community-1/rc-ssh-wrapper | |
574 |
|
574 | |||
575 | ; Allow shell when executing the ssh-wrapper command |
|
575 | ; Allow shell when executing the ssh-wrapper command | |
576 | ssh.wrapper_cmd_allow_shell = false |
|
576 | ssh.wrapper_cmd_allow_shell = false | |
577 |
|
577 | |||
578 | ; Enables logging, and detailed output send back to the client during SSH |
|
578 | ; Enables logging, and detailed output send back to the client during SSH | |
579 | ; operations. Useful for debugging, shouldn't be used in production. |
|
579 | ; operations. Useful for debugging, shouldn't be used in production. | |
580 | ssh.enable_debug_logging = false |
|
580 | ssh.enable_debug_logging = false | |
581 |
|
581 | |||
582 | ; Paths to binary executable, by default they are the names, but we can |
|
582 | ; Paths to binary executable, by default they are the names, but we can | |
583 | ; override them if we want to use a custom one |
|
583 | ; override them if we want to use a custom one | |
584 | ssh.executable.hg = ~/.rccontrol/vcsserver-1/profile/bin/hg |
|
584 | ssh.executable.hg = ~/.rccontrol/vcsserver-1/profile/bin/hg | |
585 | ssh.executable.git = ~/.rccontrol/vcsserver-1/profile/bin/git |
|
585 | ssh.executable.git = ~/.rccontrol/vcsserver-1/profile/bin/git | |
586 | ssh.executable.svn = ~/.rccontrol/vcsserver-1/profile/bin/svnserve |
|
586 | ssh.executable.svn = ~/.rccontrol/vcsserver-1/profile/bin/svnserve | |
587 |
|
587 | |||
588 | ; Enables SSH key generator web interface. Disabling this still allows users |
|
588 | ; Enables SSH key generator web interface. Disabling this still allows users | |
589 | ; to add their own keys. |
|
589 | ; to add their own keys. | |
590 | ssh.enable_ui_key_generator = true |
|
590 | ssh.enable_ui_key_generator = true | |
591 |
|
591 | |||
592 | ; Statsd client config, this is used to send metrics to statsd |
|
592 | ; Statsd client config, this is used to send metrics to statsd | |
593 | ; We recommend setting statsd_exported and scrape them using Promethues |
|
593 | ; We recommend setting statsd_exported and scrape them using Promethues | |
594 | #statsd.enabled = false |
|
594 | #statsd.enabled = false | |
595 | #statsd.statsd_host = 0.0.0.0 |
|
595 | #statsd.statsd_host = 0.0.0.0 | |
596 | #statsd.statsd_port = 8125 |
|
596 | #statsd.statsd_port = 8125 | |
597 | #statsd.statsd_prefix = |
|
597 | #statsd.statsd_prefix = | |
598 | #statsd.statsd_ipv6 = false |
|
598 | #statsd.statsd_ipv6 = false | |
599 |
|
599 | |||
600 | ; configure logging automatically at server startup set to false |
|
600 | ; configure logging automatically at server startup set to false | |
601 | ; to use the below custom logging config. |
|
601 | ; to use the below custom logging config. | |
602 | ; RC_LOGGING_FORMATTER |
|
602 | ; RC_LOGGING_FORMATTER | |
603 | ; RC_LOGGING_LEVEL |
|
603 | ; RC_LOGGING_LEVEL | |
604 | ; env variables can control the settings for logging in case of autoconfigure |
|
604 | ; env variables can control the settings for logging in case of autoconfigure | |
605 |
|
605 | |||
606 | logging.autoconfigure = false |
|
606 | logging.autoconfigure = false | |
607 |
|
607 | |||
608 | ; specify your own custom logging config file to configure logging |
|
608 | ; specify your own custom logging config file to configure logging | |
609 | #logging.logging_conf_file = /path/to/custom_logging.ini |
|
609 | #logging.logging_conf_file = /path/to/custom_logging.ini | |
610 |
|
610 | |||
611 | ; Dummy marker to add new entries after. |
|
611 | ; Dummy marker to add new entries after. | |
612 | ; Add any custom entries below. Please don't remove this marker. |
|
612 | ; Add any custom entries below. Please don't remove this marker. | |
613 | custom.conf = 1 |
|
613 | custom.conf = 1 | |
614 |
|
614 | |||
615 |
|
615 | |||
616 | ; ##################### |
|
616 | ; ##################### | |
617 | ; LOGGING CONFIGURATION |
|
617 | ; LOGGING CONFIGURATION | |
618 | ; ##################### |
|
618 | ; ##################### | |
619 |
|
619 | |||
620 | [loggers] |
|
620 | [loggers] | |
621 | keys = root, sqlalchemy, beaker, celery, rhodecode, ssh_wrapper |
|
621 | keys = root, sqlalchemy, beaker, celery, rhodecode, ssh_wrapper | |
622 |
|
622 | |||
623 | [handlers] |
|
623 | [handlers] | |
624 | keys = console, console_sql |
|
624 | keys = console, console_sql | |
625 |
|
625 | |||
626 | [formatters] |
|
626 | [formatters] | |
627 | keys = generic, json, color_formatter, color_formatter_sql |
|
627 | keys = generic, json, color_formatter, color_formatter_sql | |
628 |
|
628 | |||
629 | ; ####### |
|
629 | ; ####### | |
630 | ; LOGGERS |
|
630 | ; LOGGERS | |
631 | ; ####### |
|
631 | ; ####### | |
632 | [logger_root] |
|
632 | [logger_root] | |
633 | level = NOTSET |
|
633 | level = NOTSET | |
634 | handlers = console |
|
634 | handlers = console | |
635 |
|
635 | |||
636 | [logger_routes] |
|
636 | [logger_routes] | |
637 | level = DEBUG |
|
637 | level = DEBUG | |
638 | handlers = |
|
638 | handlers = | |
639 | qualname = routes.middleware |
|
639 | qualname = routes.middleware | |
640 | ## "level = DEBUG" logs the route matched and routing variables. |
|
640 | ## "level = DEBUG" logs the route matched and routing variables. | |
641 | propagate = 1 |
|
641 | propagate = 1 | |
642 |
|
642 | |||
643 | [logger_sqlalchemy] |
|
643 | [logger_sqlalchemy] | |
644 | level = INFO |
|
644 | level = INFO | |
645 | handlers = console_sql |
|
645 | handlers = console_sql | |
646 | qualname = sqlalchemy.engine |
|
646 | qualname = sqlalchemy.engine | |
647 | propagate = 0 |
|
647 | propagate = 0 | |
648 |
|
648 | |||
649 | [logger_beaker] |
|
649 | [logger_beaker] | |
650 | level = DEBUG |
|
650 | level = DEBUG | |
651 | handlers = |
|
651 | handlers = | |
652 | qualname = beaker.container |
|
652 | qualname = beaker.container | |
653 | propagate = 1 |
|
653 | propagate = 1 | |
654 |
|
654 | |||
655 | [logger_rhodecode] |
|
655 | [logger_rhodecode] | |
656 | level = DEBUG |
|
656 | level = DEBUG | |
657 | handlers = |
|
657 | handlers = | |
658 | qualname = rhodecode |
|
658 | qualname = rhodecode | |
659 | propagate = 1 |
|
659 | propagate = 1 | |
660 |
|
660 | |||
661 | [logger_ssh_wrapper] |
|
661 | [logger_ssh_wrapper] | |
662 | level = DEBUG |
|
662 | level = DEBUG | |
663 | handlers = |
|
663 | handlers = | |
664 | qualname = ssh_wrapper |
|
664 | qualname = ssh_wrapper | |
665 | propagate = 1 |
|
665 | propagate = 1 | |
666 |
|
666 | |||
667 | [logger_celery] |
|
667 | [logger_celery] | |
668 | level = DEBUG |
|
668 | level = DEBUG | |
669 | handlers = |
|
669 | handlers = | |
670 | qualname = celery |
|
670 | qualname = celery | |
671 |
|
671 | |||
672 |
|
672 | |||
673 | ; ######## |
|
673 | ; ######## | |
674 | ; HANDLERS |
|
674 | ; HANDLERS | |
675 | ; ######## |
|
675 | ; ######## | |
676 |
|
676 | |||
677 | [handler_console] |
|
677 | [handler_console] | |
678 | class = StreamHandler |
|
678 | class = StreamHandler | |
679 | args = (sys.stderr, ) |
|
679 | args = (sys.stderr, ) | |
680 | level = DEBUG |
|
680 | level = DEBUG | |
681 | ; To enable JSON formatted logs replace 'generic/color_formatter' with 'json' |
|
681 | ; To enable JSON formatted logs replace 'generic/color_formatter' with 'json' | |
682 | ; This allows sending properly formatted logs to grafana loki or elasticsearch |
|
682 | ; This allows sending properly formatted logs to grafana loki or elasticsearch | |
683 | formatter = generic |
|
683 | formatter = generic | |
684 |
|
684 | |||
685 | [handler_console_sql] |
|
685 | [handler_console_sql] | |
686 | ; "level = DEBUG" logs SQL queries and results. |
|
686 | ; "level = DEBUG" logs SQL queries and results. | |
687 | ; "level = INFO" logs SQL queries. |
|
687 | ; "level = INFO" logs SQL queries. | |
688 | ; "level = WARN" logs neither. (Recommended for production systems.) |
|
688 | ; "level = WARN" logs neither. (Recommended for production systems.) | |
689 | class = StreamHandler |
|
689 | class = StreamHandler | |
690 | args = (sys.stderr, ) |
|
690 | args = (sys.stderr, ) | |
691 | level = WARN |
|
691 | level = WARN | |
692 | ; To enable JSON formatted logs replace 'generic/color_formatter_sql' with 'json' |
|
692 | ; To enable JSON formatted logs replace 'generic/color_formatter_sql' with 'json' | |
693 | ; This allows sending properly formatted logs to grafana loki or elasticsearch |
|
693 | ; This allows sending properly formatted logs to grafana loki or elasticsearch | |
694 | formatter = generic |
|
694 | formatter = generic | |
695 |
|
695 | |||
696 | ; ########## |
|
696 | ; ########## | |
697 | ; FORMATTERS |
|
697 | ; FORMATTERS | |
698 | ; ########## |
|
698 | ; ########## | |
699 |
|
699 | |||
700 | [formatter_generic] |
|
700 | [formatter_generic] | |
701 | class = rhodecode.lib.logging_formatter.ExceptionAwareFormatter |
|
701 | class = rhodecode.lib.logging_formatter.ExceptionAwareFormatter | |
702 | format = %(asctime)s.%(msecs)03d [%(process)d] %(levelname)-5.5s [%(name)s] %(message)s |
|
702 | format = %(asctime)s.%(msecs)03d [%(process)d] %(levelname)-5.5s [%(name)s] %(message)s | |
703 | datefmt = %Y-%m-%d %H:%M:%S |
|
703 | datefmt = %Y-%m-%d %H:%M:%S | |
704 |
|
704 | |||
705 | [formatter_color_formatter] |
|
705 | [formatter_color_formatter] | |
706 | class = rhodecode.lib.logging_formatter.ColorFormatter |
|
706 | class = rhodecode.lib.logging_formatter.ColorFormatter | |
707 | format = %(asctime)s.%(msecs)03d [%(process)d] %(levelname)-5.5s [%(name)s] %(message)s |
|
707 | format = %(asctime)s.%(msecs)03d [%(process)d] %(levelname)-5.5s [%(name)s] %(message)s | |
708 | datefmt = %Y-%m-%d %H:%M:%S |
|
708 | datefmt = %Y-%m-%d %H:%M:%S | |
709 |
|
709 | |||
710 | [formatter_color_formatter_sql] |
|
710 | [formatter_color_formatter_sql] | |
711 | class = rhodecode.lib.logging_formatter.ColorFormatterSql |
|
711 | class = rhodecode.lib.logging_formatter.ColorFormatterSql | |
712 | format = %(asctime)s.%(msecs)03d [%(process)d] %(levelname)-5.5s [%(name)s] %(message)s |
|
712 | format = %(asctime)s.%(msecs)03d [%(process)d] %(levelname)-5.5s [%(name)s] %(message)s | |
713 | datefmt = %Y-%m-%d %H:%M:%S |
|
713 | datefmt = %Y-%m-%d %H:%M:%S | |
714 |
|
714 | |||
715 | [formatter_json] |
|
715 | [formatter_json] | |
716 | format = %(timestamp)s %(levelname)s %(name)s %(message)s %(req_id)s |
|
716 | format = %(timestamp)s %(levelname)s %(name)s %(message)s %(req_id)s | |
717 | class = rhodecode.lib._vendor.jsonlogger.JsonFormatter |
|
717 | class = rhodecode.lib._vendor.jsonlogger.JsonFormatter |
General Comments 0
You need to be logged in to leave comments.
Login now