config.metadata.php 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253
  1. <?php
  2. /**
  3. * Metadata for configuration manager plugin
  4. *
  5. * Note: This file is loaded in Loader::loadMeta().
  6. *
  7. * Format:
  8. * $meta[<setting name>] = array(<handler class id>,<param name> => <param value>);
  9. *
  10. * <handler class id> is the handler class name without the "setting_" prefix
  11. *
  12. * Defined classes (see core/Setting/*):
  13. * Generic
  14. * -------------------------------------------
  15. * '' - default class ('setting'), textarea, minimal input validation, setting output in quotes
  16. * 'string' - single line text input, minimal input validation, setting output in quotes
  17. * 'numeric' - text input, accepts numbers and arithmetic operators, setting output without quotes
  18. * if given the '_min' and '_max' parameters are used for validation
  19. * 'numericopt' - like above, but accepts empty values
  20. * 'onoff' - checkbox input, setting output 0|1
  21. * 'multichoice' - select input (single choice), setting output with quotes, required _choices parameter
  22. * 'email' - text input, input must conform to email address format, supports optional '_multiple'
  23. * parameter for multiple comma separated email addresses
  24. * 'password' - password input, minimal input validation, setting output text in quotes, maybe encoded
  25. * according to the _code parameter
  26. * 'dirchoice' - as multichoice, selection choices based on folders found at location specified in _dir
  27. * parameter (required). A pattern can be used to restrict the folders to only those which
  28. * match the pattern.
  29. * 'multicheckbox'- a checkbox for each choice plus an "other" string input, config file setting is a comma
  30. * separated list of checked choices
  31. * 'fieldset' - used to group configuration settings, but is not itself a setting. To make this clear in
  32. * the language files the keys for this type should start with '_'.
  33. * 'array' - a simple (one dimensional) array of string values, shown as comma separated list in the
  34. * config manager but saved as PHP array(). Values may not contain commas themselves.
  35. * _pattern matching on the array values supported.
  36. * 'regex' - regular expression string, normally without delimiters; as for string, in addition tested
  37. * to see if will compile & run as a regex. in addition to _pattern, also accepts _delimiter
  38. * (default '/') and _pregflags (default 'ui')
  39. *
  40. * Single Setting
  41. * -------------------------------------------------
  42. * 'savedir' - as 'setting', input tested against initpath() (inc/init.php)
  43. * 'sepchar' - as multichoice, selection constructed from string of valid values
  44. * 'authtype' - as 'setting', input validated against a valid php file at expected location for auth files
  45. * 'im_convert' - as 'setting', input must exist and be an im_convert module
  46. * 'disableactions' - as 'setting'
  47. * 'compression' - no additional parameters. checks php installation supports possible compression alternatives
  48. * 'licence' - as multichoice, selection constructed from licence strings in language files
  49. * 'renderer' - as multichoice, selection constructed from enabled renderer plugins which canRender()
  50. * 'authtype' - as multichoice, selection constructed from the enabled auth plugins
  51. *
  52. * Any setting commented or missing will use 'setting' class - text input, minimal validation, quoted output
  53. *
  54. * Defined parameters:
  55. * '_caution' - no value (default) or 'warning', 'danger', 'security'. display an alert along with the setting
  56. * '_pattern' - string, a preg pattern. input is tested against this pattern before being accepted
  57. * optional all classes, except onoff & multichoice which ignore it
  58. * '_choices' - array of choices. used to populate a selection box. choice will be replaced by a localised
  59. * language string, indexed by <setting name>_o_<choice>, if one exists
  60. * required by 'multichoice' & 'multicheckbox' classes, ignored by others
  61. * '_dir' - location of directory to be used to populate choice list
  62. * required by 'dirchoice' class, ignored by other classes
  63. * '_combine' - complimentary output setting values which can be combined into a single display checkbox
  64. * optional for 'multicheckbox', ignored by other classes
  65. * '_code' - encoding method to use, accepted values: 'base64','uuencode','plain'. defaults to plain.
  66. * '_min' - minimum numeric value, optional for 'numeric' and 'numericopt', ignored by others
  67. * '_max' - maximum numeric value, optional for 'numeric' and 'numericopt', ignored by others
  68. * '_delimiter' - string, default '/', a single character used as a delimiter for testing regex input values
  69. * '_pregflags' - string, default 'ui', valid preg pattern modifiers used when testing regex input values, for more
  70. * information see http://php.net/manual/en/reference.pcre.pattern.modifiers.php
  71. * '_multiple' - bool, allow multiple comma separated email values; optional for 'email', ignored by others
  72. * '_other' - how to handle other values (not listed in _choices). accepted values: 'always','exists','never'
  73. * default value 'always'. 'exists' only shows 'other' input field when the setting contains value(s)
  74. * not listed in choices (e.g. due to manual editing or update changing _choices). This is safer than
  75. * 'never' as it will not discard unknown/other values.
  76. * optional for 'multicheckbox', ignored by others
  77. *
  78. * The order of the settings influences the order in which they apppear in the config manager
  79. *
  80. * @author Chris Smith <chris@jalakai.co.uk>
  81. */
  82. $meta['_basic'] = array('fieldset');
  83. $meta['title'] = array('string');
  84. $meta['start'] = array('string','_caution' => 'warning','_pattern' => '!^[^:;/]+$!'); // don't accept namespaces
  85. $meta['lang'] = array('dirchoice','_dir' => DOKU_INC.'inc/lang/');
  86. $meta['template'] = array('dirchoice','_dir' => DOKU_INC.'lib/tpl/','_pattern' => '/^[\w-]+$/');
  87. $meta['tagline'] = array('string');
  88. $meta['sidebar'] = array('string');
  89. $meta['license'] = array('license');
  90. $meta['savedir'] = array('savedir','_caution' => 'danger');
  91. $meta['basedir'] = array('string','_caution' => 'danger');
  92. $meta['baseurl'] = array('string','_caution' => 'danger');
  93. $meta['cookiedir'] = array('string','_caution' => 'danger');
  94. $meta['dmode'] = array('numeric','_pattern' => '/0[0-7]{3,4}/'); // only accept octal representation
  95. $meta['fmode'] = array('numeric','_pattern' => '/0[0-7]{3,4}/'); // only accept octal representation
  96. $meta['allowdebug'] = array('onoff','_caution' => 'security');
  97. $meta['_display'] = array('fieldset');
  98. $meta['recent'] = array('numeric');
  99. $meta['recent_days'] = array('numeric');
  100. $meta['breadcrumbs'] = array('numeric','_min' => 0);
  101. $meta['youarehere'] = array('onoff');
  102. $meta['fullpath'] = array('onoff','_caution' => 'security');
  103. $meta['typography'] = array('multichoice','_choices' => array(0,1,2));
  104. $meta['dformat'] = array('string');
  105. $meta['signature'] = array('string');
  106. $meta['showuseras'] = array(
  107. 'multichoice',
  108. '_choices' => array('loginname', 'username', 'username_link', 'email', 'email_link')
  109. );
  110. $meta['toptoclevel'] = array('multichoice','_choices' => array(1,2,3,4,5)); // 5 toc levels
  111. $meta['tocminheads'] = array('multichoice','_choices' => array(0,1,2,3,4,5,10,15,20));
  112. $meta['maxtoclevel'] = array('multichoice','_choices' => array(0,1,2,3,4,5));
  113. $meta['maxseclevel'] = array('multichoice','_choices' => array(0,1,2,3,4,5)); // 0 for no sec edit buttons
  114. $meta['camelcase'] = array('onoff','_caution' => 'warning');
  115. $meta['deaccent'] = array('multichoice','_choices' => array(0,1,2),'_caution' => 'warning');
  116. $meta['useheading'] = array('multichoice','_choices' => array(0,'navigation','content',1));
  117. $meta['sneaky_index'] = array('onoff');
  118. $meta['hidepages'] = array('regex');
  119. $meta['_authentication'] = array('fieldset');
  120. $meta['useacl'] = array('onoff','_caution' => 'danger');
  121. $meta['autopasswd'] = array('onoff');
  122. $meta['authtype'] = array('authtype','_caution' => 'danger');
  123. $meta['passcrypt'] = array('multichoice','_choices' => array(
  124. 'smd5','md5','apr1','sha1','ssha','lsmd5','crypt','mysql','my411','kmd5','pmd5','hmd5',
  125. 'mediawiki','bcrypt','djangomd5','djangosha1','djangopbkdf2_sha1','djangopbkdf2_sha256',
  126. 'sha512','argon2i','argon2id'
  127. ));
  128. $meta['defaultgroup']= array('string');
  129. $meta['superuser'] = array('string','_caution' => 'danger');
  130. $meta['manager'] = array('string');
  131. $meta['profileconfirm'] = array('onoff');
  132. $meta['rememberme'] = array('onoff');
  133. $meta['disableactions'] = array(
  134. 'disableactions',
  135. '_choices' => array(
  136. 'backlink',
  137. 'index',
  138. 'recent',
  139. 'revisions',
  140. 'search',
  141. 'subscription',
  142. 'register',
  143. 'resendpwd',
  144. 'profile',
  145. 'profile_delete',
  146. 'edit',
  147. 'wikicode',
  148. 'check',
  149. 'rss'
  150. ),
  151. '_combine' => array(
  152. 'subscription' => array('subscribe', 'unsubscribe'),
  153. 'wikicode' => array('source', 'export_raw')
  154. )
  155. );
  156. $meta['auth_security_timeout'] = array('numeric');
  157. $meta['securecookie'] = array('onoff');
  158. $meta['remote'] = array('onoff','_caution' => 'security');
  159. $meta['remoteuser'] = array('string');
  160. $meta['remotecors'] = array('string', '_caution' => 'security');
  161. $meta['_anti_spam'] = array('fieldset');
  162. $meta['usewordblock']= array('onoff');
  163. $meta['relnofollow'] = array('onoff');
  164. $meta['indexdelay'] = array('numeric');
  165. $meta['mailguard'] = array('multichoice','_choices' => array('visible','hex','none'));
  166. $meta['iexssprotect']= array('onoff','_caution' => 'security');
  167. $meta['_editing'] = array('fieldset');
  168. $meta['usedraft'] = array('onoff');
  169. $meta['locktime'] = array('numeric');
  170. $meta['cachetime'] = array('numeric');
  171. $meta['_links'] = array('fieldset');
  172. $meta['target____wiki'] = array('string');
  173. $meta['target____interwiki'] = array('string');
  174. $meta['target____extern'] = array('string');
  175. $meta['target____media'] = array('string');
  176. $meta['target____windows'] = array('string');
  177. $meta['_media'] = array('fieldset');
  178. $meta['mediarevisions'] = array('onoff');
  179. $meta['gdlib'] = array('multichoice','_choices' => array(0,1,2));
  180. $meta['im_convert'] = array('im_convert');
  181. $meta['jpg_quality'] = array('numeric','_pattern' => '/^100$|^[1-9]?[0-9]$/'); //(0-100)
  182. $meta['fetchsize'] = array('numeric');
  183. $meta['refcheck'] = array('onoff');
  184. $meta['_notifications'] = array('fieldset');
  185. $meta['subscribers'] = array('onoff');
  186. $meta['subscribe_time'] = array('numeric');
  187. $meta['notify'] = array('email', '_multiple' => true);
  188. $meta['registernotify'] = array('email', '_multiple' => true);
  189. $meta['mailfrom'] = array('email', '_placeholders' => true);
  190. $meta['mailreturnpath'] = array('email', '_placeholders' => true);
  191. $meta['mailprefix'] = array('string');
  192. $meta['htmlmail'] = array('onoff');
  193. $meta['dontlog'] = array(
  194. 'disableactions',
  195. '_choices' => array(
  196. 'error',
  197. 'debug',
  198. 'deprecated',
  199. ),
  200. );
  201. $meta['_syndication'] = array('fieldset');
  202. $meta['sitemap'] = array('numeric');
  203. $meta['rss_type'] = array('multichoice','_choices' => array('rss','rss1','rss2','atom','atom1'));
  204. $meta['rss_linkto'] = array('multichoice','_choices' => array('diff','page','rev','current'));
  205. $meta['rss_content'] = array('multichoice','_choices' => array('abstract','diff','htmldiff','html'));
  206. $meta['rss_media'] = array('multichoice','_choices' => array('both','pages','media'));
  207. $meta['rss_update'] = array('numeric');
  208. $meta['rss_show_summary'] = array('onoff');
  209. $meta['rss_show_deleted'] = array('onoff');
  210. $meta['_advanced'] = array('fieldset');
  211. $meta['updatecheck'] = array('onoff');
  212. $meta['userewrite'] = array('multichoice','_choices' => array(0,1,2),'_caution' => 'danger');
  213. $meta['useslash'] = array('onoff');
  214. $meta['sepchar'] = array('sepchar','_caution' => 'warning');
  215. $meta['canonical'] = array('onoff');
  216. $meta['fnencode'] = array('multichoice','_choices' => array('url','safe','utf-8'),'_caution' => 'warning');
  217. $meta['autoplural'] = array('onoff');
  218. $meta['compress'] = array('onoff');
  219. $meta['cssdatauri'] = array('numeric','_pattern' => '/^\d+$/');
  220. $meta['gzip_output'] = array('onoff');
  221. $meta['send404'] = array('onoff');
  222. $meta['compression'] = array('compression','_caution' => 'warning');
  223. $meta['broken_iua'] = array('onoff');
  224. $meta['xsendfile'] = array('multichoice','_choices' => array(0,1,2,3),'_caution' => 'warning');
  225. $meta['renderer_xhtml'] = array('renderer','_format' => 'xhtml','_choices' => array('xhtml'),'_caution' => 'warning');
  226. $meta['readdircache'] = array('numeric');
  227. $meta['search_nslimit'] = array('numeric', '_min' => 0);
  228. $meta['search_fragment'] = array('multichoice','_choices' => array('exact', 'starts_with', 'ends_with', 'contains'),);
  229. $meta['trustedproxy'] = array('regex');
  230. $meta['_feature_flags'] = ['fieldset'];
  231. $meta['defer_js'] = ['onoff'];
  232. $meta['hidewarnings'] = ['onoff'];
  233. $meta['_network'] = array('fieldset');
  234. $meta['dnslookups'] = array('onoff');
  235. $meta['jquerycdn'] = array('multichoice', '_choices' => array(0,'jquery', 'cdnjs'));
  236. $meta['proxy____host'] = array('string','_pattern' => '#^(|[a-z0-9\-\.+]+)$#i');
  237. $meta['proxy____port'] = array('numericopt');
  238. $meta['proxy____user'] = array('string');
  239. $meta['proxy____pass'] = array('password','_code' => 'base64');
  240. $meta['proxy____ssl'] = array('onoff');
  241. $meta['proxy____except'] = array('string');