##// END OF EJS Templates
fix(configs): removed waitress as a default runner for web service on development....
super-admin -
r1236:23af3321 default
parent child Browse files
Show More
@@ -1,143 +1,138 b''
1 # required for pushd to work..
1 # required for pushd to work..
2 SHELL = /bin/bash
2 SHELL = /bin/bash
3
3
4
4
5 # set by: PATH_TO_OUTDATED_PACKAGES=/some/path/outdated_packages.py
5 # set by: PATH_TO_OUTDATED_PACKAGES=/some/path/outdated_packages.py
6 OUTDATED_PACKAGES = ${PATH_TO_OUTDATED_PACKAGES}
6 OUTDATED_PACKAGES = ${PATH_TO_OUTDATED_PACKAGES}
7
7
8 .PHONY: clean
8 .PHONY: clean
9 ## Cleanup compiled and cache py files
9 ## Cleanup compiled and cache py files
10 clean:
10 clean:
11 make test-clean
11 make test-clean
12 find . -type f \( -iname '*.c' -o -iname '*.pyc' -o -iname '*.so' -o -iname '*.orig' \) -exec rm '{}' ';'
12 find . -type f \( -iname '*.c' -o -iname '*.pyc' -o -iname '*.so' -o -iname '*.orig' \) -exec rm '{}' ';'
13 find . -type d -name "build" -prune -exec rm -rf '{}' ';'
13 find . -type d -name "build" -prune -exec rm -rf '{}' ';'
14
14
15
15
16 .PHONY: test
16 .PHONY: test
17 ## run test-clean and tests
17 ## run test-clean and tests
18 test:
18 test:
19 make test-clean
19 make test-clean
20 make test-only
20 make test-only
21
21
22
22
23 .PHONY: test-clean
23 .PHONY: test-clean
24 ## run test-clean and tests
24 ## run test-clean and tests
25 test-clean:
25 test-clean:
26 rm -rf coverage.xml htmlcov junit.xml pylint.log result
26 rm -rf coverage.xml htmlcov junit.xml pylint.log result
27 find . -type d -name "__pycache__" -prune -exec rm -rf '{}' ';'
27 find . -type d -name "__pycache__" -prune -exec rm -rf '{}' ';'
28 find . -type f \( -iname '.coverage.*' \) -exec rm '{}' ';'
28 find . -type f \( -iname '.coverage.*' \) -exec rm '{}' ';'
29
29
30
30
31 .PHONY: test-only
31 .PHONY: test-only
32 ## Run tests only without cleanup
32 ## Run tests only without cleanup
33 test-only:
33 test-only:
34 PYTHONHASHSEED=random \
34 PYTHONHASHSEED=random \
35 py.test -x -vv -r xw -p no:sugar \
35 py.test -x -vv -r xw -p no:sugar \
36 --cov-report=term-missing --cov-report=html \
36 --cov-report=term-missing --cov-report=html \
37 --cov=vcsserver vcsserver
37 --cov=vcsserver vcsserver
38
38
39
39
40 .PHONY: ruff-check
40 .PHONY: ruff-check
41 ## run a ruff analysis
41 ## run a ruff analysis
42 ruff-check:
42 ruff-check:
43 ruff check --ignore F401 --ignore I001 --ignore E402 --ignore E501 --ignore F841 --exclude rhodecode/lib/dbmigrate --exclude .eggs --exclude .dev .
43 ruff check --ignore F401 --ignore I001 --ignore E402 --ignore E501 --ignore F841 --exclude rhodecode/lib/dbmigrate --exclude .eggs --exclude .dev .
44
44
45
45
46 .PHONY: pip-packages
46 .PHONY: pip-packages
47 ## Show outdated packages
47 ## Show outdated packages
48 pip-packages:
48 pip-packages:
49 python ${OUTDATED_PACKAGES}
49 python ${OUTDATED_PACKAGES}
50
50
51
51
52 .PHONY: build
52 .PHONY: build
53 ## Build sdist/egg
53 ## Build sdist/egg
54 build:
54 build:
55 python -m build
55 python -m build
56
56
57
57
58 .PHONY: dev-sh
58 .PHONY: dev-sh
59 ## make dev-sh
59 ## make dev-sh
60 dev-sh:
60 dev-sh:
61 sudo echo "deb [trusted=yes] https://apt.fury.io/rsteube/ /" | sudo tee -a "/etc/apt/sources.list.d/fury.list"
61 sudo echo "deb [trusted=yes] https://apt.fury.io/rsteube/ /" | sudo tee -a "/etc/apt/sources.list.d/fury.list"
62 sudo apt-get update
62 sudo apt-get update
63 sudo apt-get install -y zsh carapace-bin
63 sudo apt-get install -y zsh carapace-bin
64 rm -rf /home/rhodecode/.oh-my-zsh
64 rm -rf /home/rhodecode/.oh-my-zsh
65 curl https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh | sh
65 curl https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh | sh
66 @echo "source <(carapace _carapace)" > /home/rhodecode/.zsrc
66 @echo "source <(carapace _carapace)" > /home/rhodecode/.zsrc
67 @echo "${RC_DEV_CMD_HELP}"
67 @echo "${RC_DEV_CMD_HELP}"
68 @PROMPT='%(?.%F{green}√.%F{red}?%?)%f %B%F{240}%1~%f%b %# ' zsh
68 @PROMPT='%(?.%F{green}√.%F{red}?%?)%f %B%F{240}%1~%f%b %# ' zsh
69
69
70
70
71 .PHONY: dev-env
71 .PHONY: dev-env
72 ## make dev-env based on the requirements files and install develop of packages
72 ## make dev-env based on the requirements files and install develop of packages
73 ## Cleanup: pip freeze | grep -v "^-e" | grep -v "@" | xargs pip uninstall -y
73 ## Cleanup: pip freeze | grep -v "^-e" | grep -v "@" | xargs pip uninstall -y
74 dev-env:
74 dev-env:
75 sudo -u root chown rhodecode:rhodecode /home/rhodecode/.cache/pip/
75 sudo -u root chown rhodecode:rhodecode /home/rhodecode/.cache/pip/
76 pip install build virtualenv
76 pip install build virtualenv
77 pip wheel --wheel-dir=/home/rhodecode/.cache/pip/wheels -r requirements.txt -r requirements_test.txt -r requirements_debug.txt
77 pip wheel --wheel-dir=/home/rhodecode/.cache/pip/wheels -r requirements.txt -r requirements_test.txt -r requirements_debug.txt
78 pip install --no-index --find-links=/home/rhodecode/.cache/pip/wheels -r requirements.txt -r requirements_test.txt -r requirements_debug.txt
78 pip install --no-index --find-links=/home/rhodecode/.cache/pip/wheels -r requirements.txt -r requirements_test.txt -r requirements_debug.txt
79 pip install -e .
79 pip install -e .
80
80
81
81
82 .PHONY: sh
82 .PHONY: sh
83 ## shortcut for make dev-sh dev-env
83 ## shortcut for make dev-sh dev-env
84 sh:
84 sh:
85 make dev-env
85 make dev-env
86 make dev-sh
86 make dev-sh
87
87
88
88
89 .PHONY: dev-srv
90 ## run develop server instance, docker exec -it $(docker ps -q --filter 'name=dev-enterprise-ce') /bin/bash
91 dev-srv:
92 pserve --reload .dev/dev.ini
93
94 ## Allows changes of workers e.g make dev-srv-g workers=2
89 ## Allows changes of workers e.g make dev-srv-g workers=2
95 workers?=1
90 workers?=1
96
91
97 .PHONY: dev-srv-g
92 .PHONY: dev-srv
98 ## run gunicorn multi process workers
93 ## run gunicorn multi process workers
99 dev-srv-g:
94 dev-srv-g:
100 gunicorn --paste=.dev/dev.ini --bind=0.0.0.0:10010 --config=.dev/gunicorn_config.py --reload --workers=$(workers)
95 gunicorn --paste=.dev/dev.ini --bind=0.0.0.0:10010 --config=.dev/gunicorn_config.py --reload --workers=$(workers)
101
96
102
97
103 # Default command on calling make
98 # Default command on calling make
104 .DEFAULT_GOAL := show-help
99 .DEFAULT_GOAL := show-help
105
100
106 .PHONY: show-help
101 .PHONY: show-help
107 show-help:
102 show-help:
108 @echo "$$(tput bold)Available rules:$$(tput sgr0)"
103 @echo "$$(tput bold)Available rules:$$(tput sgr0)"
109 @echo
104 @echo
110 @sed -n -e "/^## / { \
105 @sed -n -e "/^## / { \
111 h; \
106 h; \
112 s/.*//; \
107 s/.*//; \
113 :doc" \
108 :doc" \
114 -e "H; \
109 -e "H; \
115 n; \
110 n; \
116 s/^## //; \
111 s/^## //; \
117 t doc" \
112 t doc" \
118 -e "s/:.*//; \
113 -e "s/:.*//; \
119 G; \
114 G; \
120 s/\\n## /---/; \
115 s/\\n## /---/; \
121 s/\\n/ /g; \
116 s/\\n/ /g; \
122 p; \
117 p; \
123 }" ${MAKEFILE_LIST} \
118 }" ${MAKEFILE_LIST} \
124 | LC_ALL='C' sort --ignore-case \
119 | LC_ALL='C' sort --ignore-case \
125 | awk -F '---' \
120 | awk -F '---' \
126 -v ncol=$$(tput cols) \
121 -v ncol=$$(tput cols) \
127 -v indent=19 \
122 -v indent=19 \
128 -v col_on="$$(tput setaf 6)" \
123 -v col_on="$$(tput setaf 6)" \
129 -v col_off="$$(tput sgr0)" \
124 -v col_off="$$(tput sgr0)" \
130 '{ \
125 '{ \
131 printf "%s%*s%s ", col_on, -indent, $$1, col_off; \
126 printf "%s%*s%s ", col_on, -indent, $$1, col_off; \
132 n = split($$2, words, " "); \
127 n = split($$2, words, " "); \
133 line_length = ncol - indent; \
128 line_length = ncol - indent; \
134 for (i = 1; i <= n; i++) { \
129 for (i = 1; i <= n; i++) { \
135 line_length -= length(words[i]) + 1; \
130 line_length -= length(words[i]) + 1; \
136 if (line_length <= 0) { \
131 if (line_length <= 0) { \
137 line_length = ncol - indent - length(words[i]) - 1; \
132 line_length = ncol - indent - length(words[i]) - 1; \
138 printf "\n%*s ", -indent, " "; \
133 printf "\n%*s ", -indent, " "; \
139 } \
134 } \
140 printf "%s ", words[i]; \
135 printf "%s ", words[i]; \
141 } \
136 } \
142 printf "\n"; \
137 printf "\n"; \
143 }'
138 }'
@@ -1,204 +1,187 b''
1 #
1 #
2
2
3 ; #################################
3 ; #################################
4 ; RHODECODE VCSSERVER CONFIGURATION
4 ; RHODECODE VCSSERVER CONFIGURATION
5 ; #################################
5 ; #################################
6
6
7 [server:main]
7 [server:main]
8 ; COMMON HOST/IP CONFIG
8 ; COMMON HOST/IP CONFIG
9 host = 0.0.0.0
9 host = 0.0.0.0
10 port = 10010
10 port = 10010
11
11
12 ; ##################################################
13 ; WAITRESS WSGI SERVER - Recommended for Development
14 ; ##################################################
15
16 ; use server type
17 use = egg:waitress#main
18
19 ; number of worker threads
20 threads = 5
21
22 ; MAX BODY SIZE 100GB
23 max_request_body_size = 107374182400
24
25 ; Use poll instead of select, fixes file descriptors limits problems.
26 ; May not work on old windows systems.
27 asyncore_use_poll = true
28
29
12
30 ; ###########################
13 ; ###########################
31 ; GUNICORN APPLICATION SERVER
14 ; GUNICORN APPLICATION SERVER
32 ; ###########################
15 ; ###########################
33
16
34 ; run with gunicorn --paste rhodecode.ini
17 ; run with gunicorn --paste rhodecode.ini
35
18
36 ; Module to use, this setting shouldn't be changed
19 ; Module to use, this setting shouldn't be changed
37 #use = egg:gunicorn#main
20 use = egg:gunicorn#main
38
21
39 [app:main]
22 [app:main]
40 ; The %(here)s variable will be replaced with the absolute path of parent directory
23 ; The %(here)s variable will be replaced with the absolute path of parent directory
41 ; of this file
24 ; of this file
42 ; Each option in the app:main can be override by an environmental variable
25 ; Each option in the app:main can be override by an environmental variable
43 ;
26 ;
44 ;To override an option:
27 ;To override an option:
45 ;
28 ;
46 ;RC_<KeyName>
29 ;RC_<KeyName>
47 ;Everything should be uppercase, . and - should be replaced by _.
30 ;Everything should be uppercase, . and - should be replaced by _.
48 ;For example, if you have these configuration settings:
31 ;For example, if you have these configuration settings:
49 ;rc_cache.repo_object.backend = foo
32 ;rc_cache.repo_object.backend = foo
50 ;can be overridden by
33 ;can be overridden by
51 ;export RC_CACHE_REPO_OBJECT_BACKEND=foo
34 ;export RC_CACHE_REPO_OBJECT_BACKEND=foo
52
35
53 use = egg:rhodecode-vcsserver
36 use = egg:rhodecode-vcsserver
54
37
55
38
56 ; #############
39 ; #############
57 ; DEBUG OPTIONS
40 ; DEBUG OPTIONS
58 ; #############
41 ; #############
59
42
60 # During development the we want to have the debug toolbar enabled
43 # During development the we want to have the debug toolbar enabled
61 pyramid.includes =
44 pyramid.includes =
62 pyramid_debugtoolbar
45 pyramid_debugtoolbar
63
46
64 debugtoolbar.hosts = 0.0.0.0/0
47 debugtoolbar.hosts = 0.0.0.0/0
65 debugtoolbar.exclude_prefixes =
48 debugtoolbar.exclude_prefixes =
66 /css
49 /css
67 /fonts
50 /fonts
68 /images
51 /images
69 /js
52 /js
70
53
71 ; #################
54 ; #################
72 ; END DEBUG OPTIONS
55 ; END DEBUG OPTIONS
73 ; #################
56 ; #################
74
57
75 ; Pyramid default locales, we need this to be set
58 ; Pyramid default locales, we need this to be set
76 #pyramid.default_locale_name = en
59 #pyramid.default_locale_name = en
77
60
78 ; default locale used by VCS systems
61 ; default locale used by VCS systems
79 #locale = en_US.UTF-8
62 #locale = en_US.UTF-8
80
63
81 ; path to binaries (hg,git,svn) for vcsserver, it should be set by the installer
64 ; path to binaries (hg,git,svn) for vcsserver, it should be set by the installer
82 ; at installation time, e.g /home/user/.rccontrol/vcsserver-1/profile/bin
65 ; at installation time, e.g /home/user/.rccontrol/vcsserver-1/profile/bin
83 ; or /usr/local/bin/rhodecode_bin/vcs_bin
66 ; or /usr/local/bin/rhodecode_bin/vcs_bin
84 core.binary_dir =
67 core.binary_dir =
85
68
86 ; Custom exception store path, defaults to TMPDIR
69 ; Custom exception store path, defaults to TMPDIR
87 ; This is used to store exception from RhodeCode in shared directory
70 ; This is used to store exception from RhodeCode in shared directory
88 #exception_tracker.store_path =
71 #exception_tracker.store_path =
89
72
90 ; #############
73 ; #############
91 ; DOGPILE CACHE
74 ; DOGPILE CACHE
92 ; #############
75 ; #############
93
76
94 ; Default cache dir for caches. Putting this into a ramdisk can boost performance.
77 ; Default cache dir for caches. Putting this into a ramdisk can boost performance.
95 ; eg. /tmpfs/data_ramdisk, however this directory might require large amount of space
78 ; eg. /tmpfs/data_ramdisk, however this directory might require large amount of space
96 #cache_dir = %(here)s/data
79 #cache_dir = %(here)s/data
97
80
98 ; ***************************************
81 ; ***************************************
99 ; `repo_object` cache, default file based
82 ; `repo_object` cache, default file based
100 ; ***************************************
83 ; ***************************************
101
84
102 ; `repo_object` cache settings for vcs methods for repositories
85 ; `repo_object` cache settings for vcs methods for repositories
103 #rc_cache.repo_object.backend = dogpile.cache.rc.file_namespace
86 #rc_cache.repo_object.backend = dogpile.cache.rc.file_namespace
104
87
105 ; cache auto-expires after N seconds
88 ; cache auto-expires after N seconds
106 ; Examples: 86400 (1Day), 604800 (7Days), 1209600 (14Days), 2592000 (30days), 7776000 (90Days)
89 ; Examples: 86400 (1Day), 604800 (7Days), 1209600 (14Days), 2592000 (30days), 7776000 (90Days)
107 #rc_cache.repo_object.expiration_time = 2592000
90 #rc_cache.repo_object.expiration_time = 2592000
108
91
109 ; file cache store path. Defaults to `cache_dir =` value or tempdir if both values are not set
92 ; file cache store path. Defaults to `cache_dir =` value or tempdir if both values are not set
110 #rc_cache.repo_object.arguments.filename = /tmp/vcsserver_cache_repo_object.db
93 #rc_cache.repo_object.arguments.filename = /tmp/vcsserver_cache_repo_object.db
111
94
112 ; ***********************************************************
95 ; ***********************************************************
113 ; `repo_object` cache with redis backend
96 ; `repo_object` cache with redis backend
114 ; recommended for larger instance, and for better performance
97 ; recommended for larger instance, and for better performance
115 ; ***********************************************************
98 ; ***********************************************************
116
99
117 ; `repo_object` cache settings for vcs methods for repositories
100 ; `repo_object` cache settings for vcs methods for repositories
118 #rc_cache.repo_object.backend = dogpile.cache.rc.redis_msgpack
101 #rc_cache.repo_object.backend = dogpile.cache.rc.redis_msgpack
119
102
120 ; cache auto-expires after N seconds
103 ; cache auto-expires after N seconds
121 ; Examples: 86400 (1Day), 604800 (7Days), 1209600 (14Days), 2592000 (30days), 7776000 (90Days)
104 ; Examples: 86400 (1Day), 604800 (7Days), 1209600 (14Days), 2592000 (30days), 7776000 (90Days)
122 #rc_cache.repo_object.expiration_time = 2592000
105 #rc_cache.repo_object.expiration_time = 2592000
123
106
124 ; redis_expiration_time needs to be greater then expiration_time
107 ; redis_expiration_time needs to be greater then expiration_time
125 #rc_cache.repo_object.arguments.redis_expiration_time = 3592000
108 #rc_cache.repo_object.arguments.redis_expiration_time = 3592000
126
109
127 #rc_cache.repo_object.arguments.host = localhost
110 #rc_cache.repo_object.arguments.host = localhost
128 #rc_cache.repo_object.arguments.port = 6379
111 #rc_cache.repo_object.arguments.port = 6379
129 #rc_cache.repo_object.arguments.db = 5
112 #rc_cache.repo_object.arguments.db = 5
130 #rc_cache.repo_object.arguments.socket_timeout = 30
113 #rc_cache.repo_object.arguments.socket_timeout = 30
131 ; more Redis options: https://dogpilecache.sqlalchemy.org/en/latest/api.html#redis-backends
114 ; more Redis options: https://dogpilecache.sqlalchemy.org/en/latest/api.html#redis-backends
132 #rc_cache.repo_object.arguments.distributed_lock = true
115 #rc_cache.repo_object.arguments.distributed_lock = true
133
116
134 ; auto-renew lock to prevent stale locks, slower but safer. Use only if problems happen
117 ; auto-renew lock to prevent stale locks, slower but safer. Use only if problems happen
135 #rc_cache.repo_object.arguments.lock_auto_renewal = true
118 #rc_cache.repo_object.arguments.lock_auto_renewal = true
136
119
137 ; Statsd client config, this is used to send metrics to statsd
120 ; Statsd client config, this is used to send metrics to statsd
138 ; We recommend setting statsd_exported and scrape them using Promethues
121 ; We recommend setting statsd_exported and scrape them using Promethues
139 #statsd.enabled = false
122 #statsd.enabled = false
140 #statsd.statsd_host = 0.0.0.0
123 #statsd.statsd_host = 0.0.0.0
141 #statsd.statsd_port = 8125
124 #statsd.statsd_port = 8125
142 #statsd.statsd_prefix =
125 #statsd.statsd_prefix =
143 #statsd.statsd_ipv6 = false
126 #statsd.statsd_ipv6 = false
144
127
145 ; configure logging automatically at server startup set to false
128 ; configure logging automatically at server startup set to false
146 ; to use the below custom logging config.
129 ; to use the below custom logging config.
147 ; RC_LOGGING_FORMATTER
130 ; RC_LOGGING_FORMATTER
148 ; RC_LOGGING_LEVEL
131 ; RC_LOGGING_LEVEL
149 ; env variables can control the settings for logging in case of autoconfigure
132 ; env variables can control the settings for logging in case of autoconfigure
150
133
151 #logging.autoconfigure = true
134 #logging.autoconfigure = true
152
135
153 ; specify your own custom logging config file to configure logging
136 ; specify your own custom logging config file to configure logging
154 #logging.logging_conf_file = /path/to/custom_logging.ini
137 #logging.logging_conf_file = /path/to/custom_logging.ini
155
138
156 ; #####################
139 ; #####################
157 ; LOGGING CONFIGURATION
140 ; LOGGING CONFIGURATION
158 ; #####################
141 ; #####################
159
142
160 [loggers]
143 [loggers]
161 keys = root, vcsserver
144 keys = root, vcsserver
162
145
163 [handlers]
146 [handlers]
164 keys = console
147 keys = console
165
148
166 [formatters]
149 [formatters]
167 keys = generic, json
150 keys = generic, json
168
151
169 ; #######
152 ; #######
170 ; LOGGERS
153 ; LOGGERS
171 ; #######
154 ; #######
172 [logger_root]
155 [logger_root]
173 level = NOTSET
156 level = NOTSET
174 handlers = console
157 handlers = console
175
158
176 [logger_vcsserver]
159 [logger_vcsserver]
177 level = DEBUG
160 level = DEBUG
178 handlers =
161 handlers =
179 qualname = vcsserver
162 qualname = vcsserver
180 propagate = 1
163 propagate = 1
181
164
182 ; ########
165 ; ########
183 ; HANDLERS
166 ; HANDLERS
184 ; ########
167 ; ########
185
168
186 [handler_console]
169 [handler_console]
187 class = StreamHandler
170 class = StreamHandler
188 args = (sys.stderr, )
171 args = (sys.stderr, )
189 level = DEBUG
172 level = DEBUG
190 ; To enable JSON formatted logs replace 'generic' with 'json'
173 ; To enable JSON formatted logs replace 'generic' with 'json'
191 ; This allows sending properly formatted logs to grafana loki or elasticsearch
174 ; This allows sending properly formatted logs to grafana loki or elasticsearch
192 formatter = generic
175 formatter = generic
193
176
194 ; ##########
177 ; ##########
195 ; FORMATTERS
178 ; FORMATTERS
196 ; ##########
179 ; ##########
197
180
198 [formatter_generic]
181 [formatter_generic]
199 format = %(asctime)s.%(msecs)03d [%(process)d] %(levelname)-5.5s [%(name)s] %(message)s
182 format = %(asctime)s.%(msecs)03d [%(process)d] %(levelname)-5.5s [%(name)s] %(message)s
200 datefmt = %Y-%m-%d %H:%M:%S
183 datefmt = %Y-%m-%d %H:%M:%S
201
184
202 [formatter_json]
185 [formatter_json]
203 format = %(timestamp)s %(levelname)s %(name)s %(message)s %(req_id)s
186 format = %(timestamp)s %(levelname)s %(name)s %(message)s %(req_id)s
204 class = vcsserver.lib._vendor.jsonlogger.JsonFormatter
187 class = vcsserver.lib._vendor.jsonlogger.JsonFormatter
@@ -1,167 +1,167 b''
1 #
1 #
2
2
3 ; #################################
3 ; #################################
4 ; RHODECODE VCSSERVER CONFIGURATION
4 ; RHODECODE VCSSERVER CONFIGURATION
5 ; #################################
5 ; #################################
6
6
7 [server:main]
7 [server:main]
8 ; COMMON HOST/IP CONFIG
8 ; COMMON HOST/IP CONFIG
9 host = 127.0.0.1
9 host = 0.0.0.0
10 port = 10010
10 port = 10010
11
11
12
12
13 ; ###########################
13 ; ###########################
14 ; GUNICORN APPLICATION SERVER
14 ; GUNICORN APPLICATION SERVER
15 ; ###########################
15 ; ###########################
16
16
17 ; run with gunicorn --paste rhodecode.ini
17 ; run with gunicorn --paste rhodecode.ini
18
18
19 ; Module to use, this setting shouldn't be changed
19 ; Module to use, this setting shouldn't be changed
20 use = egg:gunicorn#main
20 use = egg:gunicorn#main
21
21
22 [app:main]
22 [app:main]
23 ; The %(here)s variable will be replaced with the absolute path of parent directory
23 ; The %(here)s variable will be replaced with the absolute path of parent directory
24 ; of this file
24 ; of this file
25 ; Each option in the app:main can be override by an environmental variable
25 ; Each option in the app:main can be override by an environmental variable
26 ;
26 ;
27 ;To override an option:
27 ;To override an option:
28 ;
28 ;
29 ;RC_<KeyName>
29 ;RC_<KeyName>
30 ;Everything should be uppercase, . and - should be replaced by _.
30 ;Everything should be uppercase, . and - should be replaced by _.
31 ;For example, if you have these configuration settings:
31 ;For example, if you have these configuration settings:
32 ;rc_cache.repo_object.backend = foo
32 ;rc_cache.repo_object.backend = foo
33 ;can be overridden by
33 ;can be overridden by
34 ;export RC_CACHE_REPO_OBJECT_BACKEND=foo
34 ;export RC_CACHE_REPO_OBJECT_BACKEND=foo
35
35
36 use = egg:rhodecode-vcsserver
36 use = egg:rhodecode-vcsserver
37
37
38 ; Pyramid default locales, we need this to be set
38 ; Pyramid default locales, we need this to be set
39 #pyramid.default_locale_name = en
39 #pyramid.default_locale_name = en
40
40
41 ; default locale used by VCS systems
41 ; default locale used by VCS systems
42 #locale = en_US.UTF-8
42 #locale = en_US.UTF-8
43
43
44 ; path to binaries (hg,git,svn) for vcsserver, it should be set by the installer
44 ; path to binaries (hg,git,svn) for vcsserver, it should be set by the installer
45 ; at installation time, e.g /home/user/.rccontrol/vcsserver-1/profile/bin
45 ; at installation time, e.g /home/user/.rccontrol/vcsserver-1/profile/bin
46 ; or /usr/local/bin/rhodecode_bin/vcs_bin
46 ; or /usr/local/bin/rhodecode_bin/vcs_bin
47 core.binary_dir =
47 core.binary_dir =
48
48
49 ; Custom exception store path, defaults to TMPDIR
49 ; Custom exception store path, defaults to TMPDIR
50 ; This is used to store exception from RhodeCode in shared directory
50 ; This is used to store exception from RhodeCode in shared directory
51 #exception_tracker.store_path =
51 #exception_tracker.store_path =
52
52
53 ; #############
53 ; #############
54 ; DOGPILE CACHE
54 ; DOGPILE CACHE
55 ; #############
55 ; #############
56
56
57 ; Default cache dir for caches. Putting this into a ramdisk can boost performance.
57 ; Default cache dir for caches. Putting this into a ramdisk can boost performance.
58 ; eg. /tmpfs/data_ramdisk, however this directory might require large amount of space
58 ; eg. /tmpfs/data_ramdisk, however this directory might require large amount of space
59 #cache_dir = %(here)s/data
59 #cache_dir = %(here)s/data
60
60
61 ; ***************************************
61 ; ***************************************
62 ; `repo_object` cache, default file based
62 ; `repo_object` cache, default file based
63 ; ***************************************
63 ; ***************************************
64
64
65 ; `repo_object` cache settings for vcs methods for repositories
65 ; `repo_object` cache settings for vcs methods for repositories
66 #rc_cache.repo_object.backend = dogpile.cache.rc.file_namespace
66 #rc_cache.repo_object.backend = dogpile.cache.rc.file_namespace
67
67
68 ; cache auto-expires after N seconds
68 ; cache auto-expires after N seconds
69 ; Examples: 86400 (1Day), 604800 (7Days), 1209600 (14Days), 2592000 (30days), 7776000 (90Days)
69 ; Examples: 86400 (1Day), 604800 (7Days), 1209600 (14Days), 2592000 (30days), 7776000 (90Days)
70 #rc_cache.repo_object.expiration_time = 2592000
70 #rc_cache.repo_object.expiration_time = 2592000
71
71
72 ; file cache store path. Defaults to `cache_dir =` value or tempdir if both values are not set
72 ; file cache store path. Defaults to `cache_dir =` value or tempdir if both values are not set
73 #rc_cache.repo_object.arguments.filename = /tmp/vcsserver_cache_repo_object.db
73 #rc_cache.repo_object.arguments.filename = /tmp/vcsserver_cache_repo_object.db
74
74
75 ; ***********************************************************
75 ; ***********************************************************
76 ; `repo_object` cache with redis backend
76 ; `repo_object` cache with redis backend
77 ; recommended for larger instance, and for better performance
77 ; recommended for larger instance, and for better performance
78 ; ***********************************************************
78 ; ***********************************************************
79
79
80 ; `repo_object` cache settings for vcs methods for repositories
80 ; `repo_object` cache settings for vcs methods for repositories
81 #rc_cache.repo_object.backend = dogpile.cache.rc.redis_msgpack
81 #rc_cache.repo_object.backend = dogpile.cache.rc.redis_msgpack
82
82
83 ; cache auto-expires after N seconds
83 ; cache auto-expires after N seconds
84 ; Examples: 86400 (1Day), 604800 (7Days), 1209600 (14Days), 2592000 (30days), 7776000 (90Days)
84 ; Examples: 86400 (1Day), 604800 (7Days), 1209600 (14Days), 2592000 (30days), 7776000 (90Days)
85 #rc_cache.repo_object.expiration_time = 2592000
85 #rc_cache.repo_object.expiration_time = 2592000
86
86
87 ; redis_expiration_time needs to be greater then expiration_time
87 ; redis_expiration_time needs to be greater then expiration_time
88 #rc_cache.repo_object.arguments.redis_expiration_time = 3592000
88 #rc_cache.repo_object.arguments.redis_expiration_time = 3592000
89
89
90 #rc_cache.repo_object.arguments.host = localhost
90 #rc_cache.repo_object.arguments.host = localhost
91 #rc_cache.repo_object.arguments.port = 6379
91 #rc_cache.repo_object.arguments.port = 6379
92 #rc_cache.repo_object.arguments.db = 5
92 #rc_cache.repo_object.arguments.db = 5
93 #rc_cache.repo_object.arguments.socket_timeout = 30
93 #rc_cache.repo_object.arguments.socket_timeout = 30
94 ; more Redis options: https://dogpilecache.sqlalchemy.org/en/latest/api.html#redis-backends
94 ; more Redis options: https://dogpilecache.sqlalchemy.org/en/latest/api.html#redis-backends
95 #rc_cache.repo_object.arguments.distributed_lock = true
95 #rc_cache.repo_object.arguments.distributed_lock = true
96
96
97 ; auto-renew lock to prevent stale locks, slower but safer. Use only if problems happen
97 ; auto-renew lock to prevent stale locks, slower but safer. Use only if problems happen
98 #rc_cache.repo_object.arguments.lock_auto_renewal = true
98 #rc_cache.repo_object.arguments.lock_auto_renewal = true
99
99
100 ; Statsd client config, this is used to send metrics to statsd
100 ; Statsd client config, this is used to send metrics to statsd
101 ; We recommend setting statsd_exported and scrape them using Promethues
101 ; We recommend setting statsd_exported and scrape them using Promethues
102 #statsd.enabled = false
102 #statsd.enabled = false
103 #statsd.statsd_host = 0.0.0.0
103 #statsd.statsd_host = 0.0.0.0
104 #statsd.statsd_port = 8125
104 #statsd.statsd_port = 8125
105 #statsd.statsd_prefix =
105 #statsd.statsd_prefix =
106 #statsd.statsd_ipv6 = false
106 #statsd.statsd_ipv6 = false
107
107
108 ; configure logging automatically at server startup set to false
108 ; configure logging automatically at server startup set to false
109 ; to use the below custom logging config.
109 ; to use the below custom logging config.
110 ; RC_LOGGING_FORMATTER
110 ; RC_LOGGING_FORMATTER
111 ; RC_LOGGING_LEVEL
111 ; RC_LOGGING_LEVEL
112 ; env variables can control the settings for logging in case of autoconfigure
112 ; env variables can control the settings for logging in case of autoconfigure
113
113
114 #logging.autoconfigure = true
114 #logging.autoconfigure = true
115
115
116 ; specify your own custom logging config file to configure logging
116 ; specify your own custom logging config file to configure logging
117 #logging.logging_conf_file = /path/to/custom_logging.ini
117 #logging.logging_conf_file = /path/to/custom_logging.ini
118
118
119 ; #####################
119 ; #####################
120 ; LOGGING CONFIGURATION
120 ; LOGGING CONFIGURATION
121 ; #####################
121 ; #####################
122
122
123 [loggers]
123 [loggers]
124 keys = root, vcsserver
124 keys = root, vcsserver
125
125
126 [handlers]
126 [handlers]
127 keys = console
127 keys = console
128
128
129 [formatters]
129 [formatters]
130 keys = generic, json
130 keys = generic, json
131
131
132 ; #######
132 ; #######
133 ; LOGGERS
133 ; LOGGERS
134 ; #######
134 ; #######
135 [logger_root]
135 [logger_root]
136 level = NOTSET
136 level = NOTSET
137 handlers = console
137 handlers = console
138
138
139 [logger_vcsserver]
139 [logger_vcsserver]
140 level = INFO
140 level = INFO
141 handlers =
141 handlers =
142 qualname = vcsserver
142 qualname = vcsserver
143 propagate = 1
143 propagate = 1
144
144
145 ; ########
145 ; ########
146 ; HANDLERS
146 ; HANDLERS
147 ; ########
147 ; ########
148
148
149 [handler_console]
149 [handler_console]
150 class = StreamHandler
150 class = StreamHandler
151 args = (sys.stderr, )
151 args = (sys.stderr, )
152 level = INFO
152 level = INFO
153 ; To enable JSON formatted logs replace 'generic' with 'json'
153 ; To enable JSON formatted logs replace 'generic' with 'json'
154 ; This allows sending properly formatted logs to grafana loki or elasticsearch
154 ; This allows sending properly formatted logs to grafana loki or elasticsearch
155 formatter = generic
155 formatter = generic
156
156
157 ; ##########
157 ; ##########
158 ; FORMATTERS
158 ; FORMATTERS
159 ; ##########
159 ; ##########
160
160
161 [formatter_generic]
161 [formatter_generic]
162 format = %(asctime)s.%(msecs)03d [%(process)d] %(levelname)-5.5s [%(name)s] %(message)s
162 format = %(asctime)s.%(msecs)03d [%(process)d] %(levelname)-5.5s [%(name)s] %(message)s
163 datefmt = %Y-%m-%d %H:%M:%S
163 datefmt = %Y-%m-%d %H:%M:%S
164
164
165 [formatter_json]
165 [formatter_json]
166 format = %(timestamp)s %(levelname)s %(name)s %(message)s %(req_id)s
166 format = %(timestamp)s %(levelname)s %(name)s %(message)s %(req_id)s
167 class = vcsserver.lib._vendor.jsonlogger.JsonFormatter
167 class = vcsserver.lib._vendor.jsonlogger.JsonFormatter
General Comments 0
You need to be logged in to leave comments. Login now