Mercurial > p > roundup > code
comparison roundup/configuration.py @ 7371:a210f4437b49
Incomplete work to generate config doc from config.ini
This is an incomplete attempt to allow generation of the config.ini
documentation in reference.txt. It reformats the output of
'roundup_admin.py genconfig'. So it now includes all of the
settings. Using a Makefile rule like:
tracker_config.txt: ../roundup/configuration.py
python3 ../roundup/scripts/roundup_admin.py \
genconfig _temp_config.txt
sed -e '1,8d' \
-e 's/^\[\([a-z]*\)\]/\n.. index:: config.ini; sections \1\n\n.. code:: ini\n\n [\1]/' \
-e 's/^\([^[]\)/ \1/' \
_temp_config.txt > tracker_config.txt
rm -f _temp_config.txt
results in the config.ini split by section and index links being put
in place. However some sections have a comment before the [section]
marker. This comment is orphaned at the end of the prior section
rather than starting the new section. A simple sed won't allow the
lookahead needed to target the [section] marker and include the prior
comment block. Also there are still have some long lines generated (>
65 characters). Maybe a python script can import configuration.py and
output proper restructured text output?
reference.txt:
add a commented out include:: tracker_config.txt directive
roundup/admin.py:
don't require a tracker home for genconfig. So user can generate a
clean config.ini on demand. Tracker home is still required for
updateconfig.
roundup/configuration.py:
wrap lines better. A number of them are generating comments > 65
characters which is the targeted line length. This cleans up
config.ini too, so is a good thing.
website/www/conf.py:
ignore doc/tracker_config.ini when processing.
| author | John Rouillard <rouilj@ieee.org> |
|---|---|
| date | Wed, 17 May 2023 13:34:36 -0400 |
| parents | ab0ea9f03866 |
| children | bed28b64c581 |
comparison
equal
deleted
inserted
replaced
| 7370:f37c1df6de34 | 7371:a210f4437b49 |
|---|---|
| 563 class OriginHeadersListOption(Option): | 563 class OriginHeadersListOption(Option): |
| 564 | 564 |
| 565 """List of space seperated origin header values. | 565 """List of space seperated origin header values. |
| 566 """ | 566 """ |
| 567 | 567 |
| 568 class_description = "A list of space separated case sensitive origin headers 'scheme://host'." | 568 class_description = "A list of space separated case sensitive\norigin headers 'scheme://host'." |
| 569 | 569 |
| 570 def set(self, _val): | 570 def set(self, _val): |
| 571 pathlist = self._value = [] | 571 pathlist = self._value = [] |
| 572 for elem in _val.split(): | 572 for elem in _val.split(): |
| 573 pathlist.append(elem) | 573 pathlist.append(elem) |
| 1019 "If the sending user is \"Foo Bar\", the From: line\n" | 1019 "If the sending user is \"Foo Bar\", the From: line\n" |
| 1020 "is usually: \"Foo Bar\" <issue_tracker@tracker.example>\n" | 1020 "is usually: \"Foo Bar\" <issue_tracker@tracker.example>\n" |
| 1021 "the EMAIL_FROM_TAG goes inside the \"Foo Bar\" quotes like so:\n" | 1021 "the EMAIL_FROM_TAG goes inside the \"Foo Bar\" quotes like so:\n" |
| 1022 "\"Foo Bar EMAIL_FROM_TAG\" <issue_tracker@tracker.example>"), | 1022 "\"Foo Bar EMAIL_FROM_TAG\" <issue_tracker@tracker.example>"), |
| 1023 (Option, "new_web_user_roles", "User", | 1023 (Option, "new_web_user_roles", "User", |
| 1024 "Roles that a user gets when they register" | 1024 "Roles that a user gets when they register\n" |
| 1025 " with Web User Interface.\n" | 1025 "with Web User Interface.\n" |
| 1026 "This is a comma-separated string of role names" | 1026 "This is a comma-separated string of role names\n" |
| 1027 " (e.g. 'Admin,User')."), | 1027 " (e.g. 'Admin,User')."), |
| 1028 (Option, "new_email_user_roles", "User", | 1028 (Option, "new_email_user_roles", "User", |
| 1029 "Roles that a user gets when they register" | 1029 "Roles that a user gets when they register\n" |
| 1030 " with Email Gateway.\n" | 1030 "with Email Gateway.\n" |
| 1031 "This is a comma-separated string of role names" | 1031 "This is a comma-separated string of role names\n" |
| 1032 " (e.g. 'Admin,User')."), | 1032 " (e.g. 'Admin,User')."), |
| 1033 (Option, "obsolete_history_roles", "Admin", | 1033 (Option, "obsolete_history_roles", "Admin", |
| 1034 "On schema changes, properties or classes in the history may\n" | 1034 "On schema changes, properties or classes in the history may\n" |
| 1035 "become obsolete. Since normal access permissions do not apply\n" | 1035 "become obsolete. Since normal access permissions do not apply\n" |
| 1036 "(we don't know if a user should see such a property or class)\n" | 1036 "(we don't know if a user should see such a property or class)\n" |
| 1037 "a list of roles is specified here that are allowed to see\n" | 1037 "a list of roles is specified here that are allowed to see\n" |
| 1038 "these obsolete properties in the history. By default only the\n" | 1038 "these obsolete properties in the history. By default only the\n" |
| 1039 "admin role may see these history entries, you can make them\n" | 1039 "admin role may see these history entries, you can make them\n" |
| 1040 "visible to all users by adding, e.g., the 'User' role here."), | 1040 "visible to all users by adding, e.g., the 'User' role here."), |
| 1041 (Option, "error_messages_to", "user", | 1041 (Option, "error_messages_to", "user", |
| 1042 'Send error message emails to the "dispatcher", "user", ' | 1042 'Send error message emails to the "dispatcher", "user", \n' |
| 1043 'or "both" (these are the three allowed values).\n' | 1043 'or "both" (these are the three allowed values).\n' |
| 1044 'The dispatcher is configured using the DISPATCHER_EMAIL' | 1044 'The dispatcher is configured using the DISPATCHER_EMAIL\n' |
| 1045 ' setting.'), | 1045 ' setting.'), |
| 1046 (Option, "html_version", "html4", | 1046 (Option, "html_version", "html4", |
| 1047 "HTML version to generate. The templates are html4 by default.\n" | 1047 "HTML version to generate. The templates are html4 by default.\n" |
| 1048 "If you wish to make them xhtml, then you'll need to change this\n" | 1048 "If you wish to make them xhtml, then you'll need to change\n" |
| 1049 "var to 'xhtml' too so all auto-generated HTML is compliant.\n" | 1049 "this setting to 'xhtml' too so all auto-generated HTML\n" |
| 1050 "is compliant.\n" | |
| 1050 "Allowed values: html4, xhtml"), | 1051 "Allowed values: html4, xhtml"), |
| 1051 (TimezoneOption, "timezone", TimezoneOption.defaulttz, | 1052 (TimezoneOption, "timezone", TimezoneOption.defaulttz, |
| 1052 "Default timezone offset," | 1053 "Default timezone offset,\n" |
| 1053 " applied when user's timezone is not set.", | 1054 "applied when user's timezone is not set.", |
| 1054 ["DEFAULT_TIMEZONE"]), | 1055 ["DEFAULT_TIMEZONE"]), |
| 1055 (BooleanOption, "instant_registration", "no", | 1056 (BooleanOption, "instant_registration", "no", |
| 1056 "Register new users instantly, or require confirmation via\n" | 1057 "Register new users instantly, or require confirmation via\n" |
| 1057 "email?"), | 1058 "email?"), |
| 1058 (BooleanOption, "email_registration_confirmation", "yes", | 1059 (BooleanOption, "email_registration_confirmation", "yes", |
| 1059 "Offer registration confirmation by email or only through the web?"), | 1060 "Offer registration confirmation by email or only\n" |
| 1061 "through the web?"), | |
| 1060 (IndexerOption, "indexer", "", | 1062 (IndexerOption, "indexer", "", |
| 1061 "Force Roundup to use a particular text indexer.\n" | 1063 "Force Roundup to use a particular text indexer.\n" |
| 1062 "If no indexer is supplied, the first available indexer\n" | 1064 "If no indexer is supplied, the first available indexer\n" |
| 1063 "will be used in the following order:\n" | 1065 "will be used in the following order:\n" |
| 1064 "Possible values: xapian, whoosh, native (internal), " | 1066 "Possible values: xapian, whoosh, native (internal), " |
| 1106 ("tracker", ( | 1108 ("tracker", ( |
| 1107 (Option, "name", "Roundup issue tracker", | 1109 (Option, "name", "Roundup issue tracker", |
| 1108 "A descriptive name for your roundup instance."), | 1110 "A descriptive name for your roundup instance."), |
| 1109 (WebUrlOption, "web", NODEFAULT, | 1111 (WebUrlOption, "web", NODEFAULT, |
| 1110 "The web address that the tracker is viewable at.\n" | 1112 "The web address that the tracker is viewable at.\n" |
| 1111 "This will be included in information" | 1113 "This will be included in information\n" |
| 1112 " sent to users of the tracker.\n" | 1114 "sent to users of the tracker.\n" |
| 1113 "The URL MUST include the cgi-bin part or anything else\n" | 1115 "The URL MUST include the cgi-bin part or anything else\n" |
| 1114 "that is required to get to the home page of the tracker.\n" | 1116 "that is required to get to the home page of the tracker.\n" |
| 1115 "URL MUST start with http/https scheme and end with '/'"), | 1117 "URL MUST start with http/https scheme and end with '/'"), |
| 1116 (MailAddressOption, "email", "issue_tracker", | 1118 (MailAddressOption, "email", "issue_tracker", |
| 1117 "Email address that mail to roundup should go to.\n" | 1119 "Email address that mail to roundup should go to.\n" |
| 1214 are logged into roundup and open a roundup link | 1216 are logged into roundup and open a roundup link |
| 1215 from a source other than roundup (e.g. link in | 1217 from a source other than roundup (e.g. link in |
| 1216 email)."""), | 1218 email)."""), |
| 1217 (BooleanOption, 'enable_xmlrpc', "yes", | 1219 (BooleanOption, 'enable_xmlrpc', "yes", |
| 1218 """Whether to enable the XMLRPC API in the roundup web | 1220 """Whether to enable the XMLRPC API in the roundup web |
| 1219 interface. By default the XMLRPC endpoint is the string 'xmlrpc' | 1221 interface. By default the XMLRPC endpoint is the string |
| 1220 after the roundup web url configured in the 'tracker' section. | 1222 'xmlrpc' after the roundup web url configured in the |
| 1221 If this variable is set to 'no', the xmlrpc path has no special meaning | 1223 'tracker' section. If this variable is set to 'no', the |
| 1222 and will yield an error message."""), | 1224 xmlrpc path has no special meaning and will yield an |
| 1225 error message."""), | |
| 1223 (BooleanOption, 'translate_xmlrpc', 'no', | 1226 (BooleanOption, 'translate_xmlrpc', 'no', |
| 1224 """Whether to enable i18n for the xmlrpc endpoint. Enable it if | 1227 """Whether to enable i18n for the xmlrpc endpoint. Enable it if |
| 1225 you want to enable translation based on browsers lang (if enabled), trackers | 1228 you want to enable translation based on browsers lang |
| 1226 lang (if set) or environment."""), | 1229 (if enabled), trackers lang (if set) or environment."""), |
| 1227 (BooleanOption, 'enable_rest', "yes", | 1230 (BooleanOption, 'enable_rest', "yes", |
| 1228 """Whether to enable the REST API in the roundup web | 1231 """Whether to enable the REST API in the roundup web |
| 1229 interface. By default the REST endpoint is the string 'rest' plus any | 1232 interface. By default the REST endpoint is the string |
| 1230 additional REST-API parameters after the roundup web url configured in | 1233 'rest' plus any additional REST-API parameters after the |
| 1231 the tracker section. If this variable is set to 'no', the rest path has | 1234 roundup web url configured in the tracker section. If this |
| 1232 no special meaning and will yield an error message."""), | 1235 variable is set to 'no', the rest path has no special meaning |
| 1236 and will yield an error message."""), | |
| 1233 (BooleanOption, 'translate_rest', 'no', | 1237 (BooleanOption, 'translate_rest', 'no', |
| 1234 """Whether to enable i18n for the rest endpoint. Enable it if | 1238 """Whether to enable i18n for the rest endpoint. Enable it if |
| 1235 you want to enable translation based on browsers lang (if enabled), trackers | 1239 you want to enable translation based on browsers lang |
| 1236 lang (if set) or environment."""), | 1240 (if enabled), trackers lang (if set) or environment."""), |
| 1237 (IntegerNumberGeqZeroOption, 'api_calls_per_interval', "0", | 1241 (IntegerNumberGeqZeroOption, 'api_calls_per_interval', "0", |
| 1238 "Limit API calls per api_interval_in_sec seconds to\n" | 1242 "Limit API calls per api_interval_in_sec seconds to\n" |
| 1239 "this number.\n" | 1243 "this number.\n" |
| 1240 "Determines the burst rate and the rate that new api\n" | 1244 "Determines the burst rate and the rate that new api\n" |
| 1241 "calls will be made available. If set to 360 and\n" | 1245 "calls will be made available. If set to 360 and\n" |
| 1368 (BooleanOption, "debug", "no", | 1372 (BooleanOption, "debug", "no", |
| 1369 "Setting this option makes Roundup display error tracebacks\n" | 1373 "Setting this option makes Roundup display error tracebacks\n" |
| 1370 "in the user's browser rather than emailing them to the\n" | 1374 "in the user's browser rather than emailing them to the\n" |
| 1371 "tracker admin."), | 1375 "tracker admin."), |
| 1372 (BooleanOption, "login_empty_passwords", "no", | 1376 (BooleanOption, "login_empty_passwords", "no", |
| 1373 "Setting this option to yes/true allows users with an empty/blank\n" | 1377 "Setting this option to yes/true allows users with\n" |
| 1374 "password to login to the web/http interfaces."), | 1378 "an empty/blank password to login to the\n" |
| 1379 "web/http interfaces."), | |
| 1375 (BooleanOption, "migrate_passwords", "yes", | 1380 (BooleanOption, "migrate_passwords", "yes", |
| 1376 "Setting this option makes Roundup migrate passwords with\n" | 1381 "Setting this option makes Roundup migrate passwords with\n" |
| 1377 "an insecure password-scheme to a more secure scheme\n" | 1382 "an insecure password-scheme to a more secure scheme\n" |
| 1378 "when the user logs in via the web-interface."), | 1383 "when the user logs in via the web-interface."), |
| 1379 (SecretMandatoryOption, "secret_key", create_token(), | 1384 (SecretMandatoryOption, "secret_key", create_token(), |
| 1434 "Default: use a 30 second timeout (extraordinarily generous)\n" | 1439 "Default: use a 30 second timeout (extraordinarily generous)\n" |
| 1435 "Only used in SQLite connections."), | 1440 "Only used in SQLite connections."), |
| 1436 (IntegerNumberGeqZeroOption, 'cache_size', '100', | 1441 (IntegerNumberGeqZeroOption, 'cache_size', '100', |
| 1437 "Size of the node cache (in elements)"), | 1442 "Size of the node cache (in elements)"), |
| 1438 (BooleanOption, "allow_create", "yes", | 1443 (BooleanOption, "allow_create", "yes", |
| 1439 "Setting this option to 'no' protects the database against table creations."), | 1444 "Setting this option to 'no' protects the database against\n" |
| 1445 "table creations."), | |
| 1440 (BooleanOption, "allow_alter", "yes", | 1446 (BooleanOption, "allow_alter", "yes", |
| 1441 "Setting this option to 'no' protects the database against table alterations."), | 1447 "Setting this option to 'no' protects the database against\n" |
| 1448 "table alterations."), | |
| 1442 (BooleanOption, "allow_drop", "yes", | 1449 (BooleanOption, "allow_drop", "yes", |
| 1443 "Setting this option to 'no' protects the database against table drops."), | 1450 "Setting this option to 'no' protects the database against\n" |
| 1451 "table drops."), | |
| 1444 (NullableOption, 'template', '', | 1452 (NullableOption, 'template', '', |
| 1445 "Name of the PostgreSQL template for database creation.\n" | 1453 "Name of the PostgreSQL template for database creation.\n" |
| 1446 "For database creation the template used has to match\n" | 1454 "For database creation the template used has to match\n" |
| 1447 "the character encoding used (UTF8), there are different\n" | 1455 "the character encoding used (UTF8), there are different\n" |
| 1448 "PostgreSQL installations using different templates with\n" | 1456 "PostgreSQL installations using different templates with\n" |
| 1459 "http://www.postgresql.org/docs/9.1/static/transaction-iso.html"), | 1467 "http://www.postgresql.org/docs/9.1/static/transaction-iso.html"), |
| 1460 (BooleanOption, "serverside_cursor", "yes", | 1468 (BooleanOption, "serverside_cursor", "yes", |
| 1461 "Set the database cursor for filter queries to serverside\n" | 1469 "Set the database cursor for filter queries to serverside\n" |
| 1462 "cursor, this avoids caching large amounts of data in the\n" | 1470 "cursor, this avoids caching large amounts of data in the\n" |
| 1463 "client. This option only applies for the postgresql backend."), | 1471 "client. This option only applies for the postgresql backend."), |
| 1464 ), "Settings in this section (except for backend) are used" | 1472 ), "Settings in this section (except for backend) are used\n" |
| 1465 " by RDBMS backends only." | 1473 " by RDBMS backends only." |
| 1466 ), | 1474 ), |
| 1467 ("sessiondb", ( | 1475 ("sessiondb", ( |
| 1468 (SessiondbBackendOption, "backend", "", | 1476 (SessiondbBackendOption, "backend", "", |
| 1469 "Set backend for storing one time key (otk) and session data.\n" | 1477 "Set backend for storing one time key (otk) and session data.\n" |
| 1536 "(eg. iso-8859-1).", | 1544 "(eg. iso-8859-1).", |
| 1537 ["EMAIL_CHARSET"]), | 1545 ["EMAIL_CHARSET"]), |
| 1538 (FilePathOption, "debug", "", | 1546 (FilePathOption, "debug", "", |
| 1539 "Setting this option makes Roundup write all outgoing email\n" | 1547 "Setting this option makes Roundup write all outgoing email\n" |
| 1540 "messages to this file *instead* of sending them.\n" | 1548 "messages to this file *instead* of sending them.\n" |
| 1541 "This option has the same effect as environment variable" | 1549 "This option has the same effect as the environment variable\n" |
| 1542 " SENDMAILDEBUG.\nEnvironment variable takes precedence."), | 1550 "SENDMAILDEBUG.\nEnvironment variable takes precedence."), |
| 1543 (BooleanOption, "add_authorinfo", "yes", | 1551 (BooleanOption, "add_authorinfo", "yes", |
| 1544 "Add a line with author information at top of all messages\n" | 1552 "Add a line with author information at top of all messages\n" |
| 1545 "sent by roundup"), | 1553 "sent by roundup"), |
| 1546 (BooleanOption, "add_authoremail", "yes", | 1554 (BooleanOption, "add_authoremail", "yes", |
| 1547 "Add the mail address of the author to the author information at\n" | 1555 "Add the mail address of the author to the author information\n" |
| 1548 "the top of all messages.\n" | 1556 "at the top of all messages.\n" |
| 1549 "If this is false but add_authorinfo is true, only the name\n" | 1557 "If this is false but add_authorinfo is true, only the name\n" |
| 1550 "of the actor is added which protects the mail address of the\n" | 1558 "of the actor is added which protects the mail address of the\n" |
| 1551 "actor from being exposed at mail archives, etc."), | 1559 "actor from being exposed at mail archives, etc."), |
| 1552 ), "Outgoing email options.\n" | 1560 ), "Outgoing email options.\n" |
| 1553 "Used for nosy messages and approval requests"), | 1561 "Used for nosy messages and approval requests"), |
