SproutCMS

This is the code documentation for the SproutCMS project

source of /config/sprout.php

Configuration for Sprout
  1. <?php
  2. /**
  3.  * Configuration for Sprout
  4.  * @package Kohana
  5.  */
  6.  
  7. use Sprout\Helpers\SearchHandler;
  8. use Sprout\Helpers\WidgetArea;
  9.  
  10. // Super users are operators with access to all the developer tools
  11. // Each entry is a username => details mapping, created by the tool at http://servername/dbtools/genPassHash
  12. // An example is provided
  13. $config['super_users'] = [
  14. // 'test' => ['uid' => 1, 'hash' => '$2a$12$J/qUFM9j6KRb7lXvXtFhH.J8RhJYdP/3oeNetR3taDmNhTYMCJfkG', 'salt' => '109Du9gMwI'],
  15. ];
  16.  
  17. // jQuery version(s) to use
  18. $config['jquery_front'] = '2.1.4';
  19. $config['jqueryui_front'] = '1.11.4';
  20. $config['jquery_admin'] = '2.1.4';
  21. $config['jqueryui_admin'] = '1.11.4';
  22.  
  23. /**
  24.  * Rich text field type
  25.  * 'TinyMCE4', 'Textarea'
  26.  */
  27. $config['rich_text_type'] = 'TinyMCE4';
  28.  
  29.  
  30. /**
  31.  * Who to send emails to if any cronjobs fail
  32.  **/
  33. $config['cron_email'] = 'root@localhost';
  34.  
  35. /**
  36.  * Email address for the webmaster/developer
  37.  *
  38.  * This is shown in places like the coming_soon and maintenance pages
  39.  */
  40. $config['info_email'] = 'info@example.com';
  41.  
  42. /**
  43.  * SMTP settings for email sending.
  44.  * If you need more options, edit sprout/libraries/Email.php
  45.  * The email library being used (PHPMailer) also supports other transports
  46.  * but support for these will need to be hacked in manually.
  47.  *
  48.  * smtp_server Server name or IP address
  49.  * smtp_port Server port
  50.  * smtp_secure Boolean to enable TLS
  51.  * smtp_autotls Boolean to automatically enable TLS if server supports it,
  52.  * even if smtp_secure is off. This needs to be switched off
  53.  * if the connection fails testing, e.g. due to a self-signed
  54.  * cert or hostname mismatch.
  55.  * smtp_auth Boolean to enable authentication
  56.  * smtp_username Authentication username
  57.  * smtp_password Authentication password
  58.  */
  59. $config['smtp_server'] = 'localhost';
  60. $config['smtp_port'] = 25;
  61. $config['smtp_secure'] = false;
  62. $config['smtp_autotls'] = true;
  63. $config['smtp_auth'] = false;
  64. $config['smtp_username'] = '';
  65. $config['smtp_password'] = '';
  66.  
  67.  
  68. /**
  69.  * Restrict email sending to a given set of domain names.
  70.  * If set to NULL then there aren't any restrictions
  71.  */
  72. if (IN_PRODUCTION) {
  73. $config['email_allowed_domains'] = null;
  74. } else {
  75. // Only permit email to be sent to addresses at devel.example.com
  76. $config['email_allowed_domains'] = ['devel.example.com'];
  77. }
  78.  
  79.  
  80. /**
  81. * Proxy server to use
  82. **/
  83. $config['httpreq_proxy_host'] = '';
  84. $config['httpreq_proxy_port'] = '';
  85.  
  86. /**
  87. * Proxy auth, formatted as user:password
  88. **/
  89. $config['httpreq_proxy_auth'] = '';
  90.  
  91. /**
  92. * Proxy type, either 'html' or 'socks5'
  93. **/
  94. $config['httpreq_proxy_type'] = 'html';
  95.  
  96.  
  97. // The default widgets are listed in sprout/sprout_load.php
  98. // You can still add widgets in here if you really want though
  99.  
  100. /**
  101.  * Define the widget area: embedded
  102.  */
  103. $config['widget_areas'][1] = $area = new WidgetArea('embedded', 1);
  104.  
  105. $area->setNiceName('Embedded in content');
  106. $area->setOrientation(WidgetArea::ORIENTATION_WIDE);
  107. $area->setEmbed(true);
  108.  
  109.  
  110. /**
  111.  * Define the widget area: sidebar
  112.  */
  113. $config['widget_areas'][2] = $area = new WidgetArea('sidebar', 2);
  114.  
  115. $area->setNiceName('Sidebar');
  116. $area->setOrientation(WidgetArea::ORIENTATION_TALL);
  117. $area->addDefault('RelatedLinks', array());
  118.  
  119.  
  120. /**
  121.  * Define the widget area: email
  122.  */
  123. $config['widget_areas'][4] = $area = new WidgetArea('email', 4);
  124.  
  125. $area->setNiceName('Email');
  126. $area->setOrientation(WidgetArea::ORIENTATION_EMAIL);
  127. $area->setEmbed(true);
  128.  
  129.  
  130. /**
  131.  * List of controllers (shorthand notation) to hide from admin tiles
  132.  *
  133.  * For example add 'recurring_payment' to this list if you're not using
  134.  * the recurring payment feature of the payments module
  135.  *
  136.  * Unlike operator permissions, this *does not* protect against direct-url
  137.  * access to these controllers; it only affects the display of the links.
  138.  */
  139. $config['admin_tile_hidden'] = [];
  140.  
  141.  
  142. /**
  143.  * The URL which the user should be redirected to when logging in
  144.  */
  145. $config['admin_intro'] = 'admin/dashboard';
  146.  
  147.  
  148. /**
  149.  * The domain to require for the admin control panel.
  150.  * If the admin is accessed from a different domain, the user is redirected
  151.  */
  152. //$config['admin_domain'] = 'www.example.net';
  153.  
  154.  
  155. /**
  156.  * Restrict admin access to given IPs or CIDR ranges
  157.  */
  158. //$config['admin_ips'] = array('192.168.10.0/24');
  159.  
  160.  
  161. /**
  162. * How strict the censorship is. 1 = Fairly lax, 3 = Fairly strict.
  163. * This roughly translate into R18, M15, PG.
  164. * Level 0 disables censorship.
  165. **/
  166. $config['censor_level'] = 3;
  167.  
  168.  
  169. /**
  170. * Update notification:
  171. * Updates to pages will send an email to all operators, detailing the change made
  172. **/
  173. $config['update_notify'] = false;
  174.  
  175.  
  176. /**
  177. * Should the admin do record locking
  178. * Turn this off if it's constantly giving trouble
  179. **/
  180. $config['admin_locks'] = true;
  181.  
  182.  
  183. /**
  184. * Allows per-page skin tweaking with custom CSS
  185. **/
  186. $config['tweak_skin'] = false;
  187.  
  188.  
  189. /**
  190. * Should we track stats for page traffic?
  191. * This is normally of for performance, but is
  192. * useful for a "popular pages" feature
  193. **/
  194. $config['page_stats'] = false;
  195.  
  196.  
  197. /**
  198.  * Default class to handle CAPTCHA fields: 'DefaultCaptcha' or 'Recaptcha'
  199.  */
  200. $config['captcha'] = 'Recaptcha';
  201.  
  202.  
  203. /**
  204.  * ReCAPTCHA keys, see https://www.google.com/recaptcha
  205.  */
  206. if (!IN_PRODUCTION) {
  207. // Keys for development usage
  208. $config['recaptcha_public_key'] = 'please_generate_me_devel';
  209. $config['recaptcha_private_key'] = 'please_generate_me_devel';
  210. } else {
  211. // Add live keys here
  212. $config['recaptcha_public_key'] = 'please_generate_me';
  213. $config['recaptcha_private_key'] = 'please_generate_me';
  214. }
  215.  
  216.  
  217. /**
  218.  * Google Maps API keys
  219.  * An empty string will cause no key to be included in the JS call.
  220.  * The string "please_generate_me" will throw an exception
  221.  */
  222. if (!IN_PRODUCTION) {
  223. $config['google_maps_key'] = '';
  224. $config['google_maps_secret'] = '';
  225. } else {
  226. $config['google_maps_key'] = 'please_generate_me';
  227. $config['google_maps_secret'] = 'please_generate_me';
  228. }
  229.  
  230.  
  231. /**
  232.  * Google Places API key
  233.  * Used for autocomplete address fields
  234.  */
  235. if (!IN_PRODUCTION) {
  236. $config['google_places_key'] = '';
  237. } else {
  238. $config['google_places_key'] = 'please_generate_me';
  239. }
  240.  
  241.  
  242. /**
  243.  * Google YouTube API key
  244.  * An empty string will cause no key to be included in the JS call.
  245.  * The string "please_generate_me" will throw an exception
  246.  */
  247. if (!IN_PRODUCTION) {
  248. $config['google_youtube_api'] = '';
  249. } else {
  250. $config['google_youtube_api'] = 'please_generate_me';
  251. }
  252.  
  253.  
  254. /**
  255.  * Default address to send stale page notifications to
  256.  */
  257. if (!IN_PRODUCTION) {
  258. $config['stale_page_email'] = 'stale@example.com';
  259. } else {
  260. $config['stale_page_email'] = 'stale@example.com';
  261. }
  262.  
  263. /**
  264.  * Default max age for new 'standard' page revisions, before they're counted as stale
  265.  */
  266. $config['stale_page_age'] = 0;
  267.  
  268. /**
  269.  * Number of days between resend of stale page info
  270.  */
  271. $config['stale_page_resend_after'] = 7;
  272.  
  273.  
  274. /**
  275. * Site unavailability.
  276. * Makes it so that skin views will not be loaded but the specified message will be loaded instead.
  277. * The admin will still work while the site is unavailable.
  278. **/
  279. $config['unavailable'] = '';
  280. //$config['unavailable'] = 'coming_soon';
  281. //$config['unavailable'] = 'maintenance';
  282.  
  283.  
  284. /**
  285.  * Default quality for JPEGs that travel through the resize handler
  286.  */
  287. $config['jpeg_quality'] = 80;
  288.  
  289. /**
  290.  * Use interlacing on JPEGs (aka progressive JPEGs)
  291.  * This usually makes them smaller and on most browsers leads to the nice blur-in effect.
  292.  */
  293. $config['jpeg_progressive'] = true;
  294.  
  295. /**
  296.  * Per-hour rate limiting for admin authentication
  297.  */
  298. $config['auth_rate_limit']['ip'] = 10;
  299. $config['auth_rate_limit']['username'] = 10;
  300.  
  301. /**
  302.  * Whether the server is behind a load balancer
  303.  *
  304.  * This is necessary to determine whether to trust X-Forwarded headers.
  305.  */
  306. $config['load_balanced'] = false;
  307.  
  308. /**
  309.  * Complexity requirements for password validation using the {@see Validity::password} method
  310.  */
  311. $config['password_length'] = 8;
  312. $config['password_classes'] = 2;
  313. $config['password_bad_list'] = true;
  314.