]>
Commit | Line | Data |
---|---|---|
992af0b9 V |
1 | #Shaarli configuration |
2 | ## Foreword | |
3 | ||
4 | **Do not edit configuration options in index.php! Your changes would be lost.** | |
5 | ||
6 | Once your Shaarli instance is installed, the file `data/config.php` is generated: | |
7 | * it contains all settings, and can be edited to customize values | |
8 | * its values override those defined in `index.php` | |
9 | ||
10 | ## File and directory permissions | |
11 | The server process running Shaarli must have: | |
12 | - `read` access to the following resources: | |
13 | - PHP scripts: `index.php`, `application/*.php` | |
14 | - 3rd party PHP and Javascript libraries: `inc/*.php`, `inc\*.js` | |
15 | - static assets: | |
16 | - CSS stylesheets: `inc\*.css` | |
17 | - `images\*` | |
18 | - RainTPL templates: `tpl\*.html` | |
19 | - `read`, `write` and `execution` access to the following directories: | |
20 | - `cache` - thumbnail cache | |
21 | - `data` - link data store, configuration options | |
22 | - `pagecache` - Atom/RSS feed cache | |
23 | - `tmp` - RainTPL page cache | |
24 | ||
25 | On a Linux distribution: | |
26 | - the web server user will likely be `www` or `http` (for Apache2) | |
27 | - it will be a member of a group of the same name: `www:www`, `http:http` | |
28 | - to give it access to Shaarli, either: | |
29 | - unzip Shaarli in the default web server location (usually `/var/www/`) and set the web server user as the owner | |
30 | - put users in the same group as the web server, and set the appropriate access rights | |
31 | - if you have a domain / subdomain to serve Shaarli, [configure the server](Server-configuration) accordingly[](.html) | |
32 | ||
33 | ## Example `data/config.php` | |
34 | ```php | |
35 | <?php | |
36 | // User login | |
37 | $GLOBALS['login'] = '<login>';[](.html) | |
38 | ||
39 | // User password hash | |
40 | $GLOBALS['hash'] = '200c452da46c2f889e5e48c49ef044bcacdcb095';[](.html) | |
41 | ||
42 | // Password salt | |
43 | $GLOBALS['salt'] = '13b654102321576033d8473b63a275a1bf94c0f0'; [](.html) | |
44 | ||
45 | // Local timezone | |
46 | $GLOBALS['timezone'] = 'Africa/Abidjan';[](.html) | |
47 | date_default_timezone_set('Africa/Abidjan'); | |
48 | ||
49 | // Shaarli title | |
50 | $GLOBALS['title'] = 'My Little Shaarly';[](.html) | |
51 | ||
52 | // Link the Shaarli title points to | |
53 | $GLOBALS['titleLink'] = '?';[](.html) | |
54 | ||
55 | // HTTP referer redirector | |
56 | $GLOBALS['redirector'] = '';[](.html) | |
57 | ||
58 | // Disable session hijacking | |
59 | $GLOBALS['disablesessionprotection'] = false; [](.html) | |
60 | ||
61 | // Whether new links are private by default | |
62 | $GLOBALS['privateLinkByDefault'] = false;[](.html) | |
63 | ||
64 | // Subdirectory where Shaarli stores its data files. | |
65 | // You can change it for better security. | |
66 | $GLOBALS['config'['DATADIR'] = 'data';]('DATADIR']-=-'data';.html) | |
67 | ||
68 | // File used to store settings | |
69 | $GLOBALS['config'['CONFIG_FILE'] = 'data/config.php';]('CONFIG_FILE']-=-'data/config.php';.html) | |
70 | ||
71 | // File containing the link database | |
72 | $GLOBALS['config'['DATASTORE'] = 'data/datastore.php';]('DATASTORE']-=-'data/datastore.php';.html) | |
73 | ||
74 | // Number of links displayed per page | |
75 | $GLOBALS['config'['LINKS_PER_PAGE'] = 20;]('LINKS_PER_PAGE']-=-20;.html) | |
76 | ||
77 | // File recording failed login attempts and IP bans | |
78 | $GLOBALS['config'['IPBANS_FILENAME'] = 'data/ipbans.php';]('IPBANS_FILENAME']-=-'data/ipbans.php';.html) | |
79 | ||
80 | // Failed login attempts before being banned | |
81 | $GLOBALS['config'['BAN_AFTER'] = 4;]('BAN_AFTER']-=-4;.html) | |
82 | ||
83 | // Duration of an IP ban, in seconds (30 minutes) | |
84 | $GLOBALS['config'['BAN_DURATION'] = 1800;]('BAN_DURATION']-=-1800;.html) | |
85 | ||
86 | // If set to true, everyone will be able to add, edit and remove links, | |
87 | // as well as change configuration | |
88 | $GLOBALS['config'['OPEN_SHAARLI'] = false;]('OPEN_SHAARLI']-=-false;.html) | |
89 | ||
90 | // Do not show link timestamps | |
91 | $GLOBALS['config'['HIDE_TIMESTAMPS'] = false;]('HIDE_TIMESTAMPS']-=-false;.html) | |
92 | ||
93 | // Set to false to disable local thumbnail cache, e.g. due to limited disk quotas | |
94 | $GLOBALS['config'['ENABLE_THUMBNAILS'] = true;]('ENABLE_THUMBNAILS']-=-true;.html) | |
95 | ||
96 | // Thumbnail cache directory | |
97 | $GLOBALS['config'['CACHEDIR'] = 'cache';]('CACHEDIR']-=-'cache';.html) | |
98 | ||
99 | // Enable feed (rss, atom, dailyrss) cache | |
100 | $GLOBALS['config'['ENABLE_LOCALCACHE'] = true;]('ENABLE_LOCALCACHE']-=-true;.html) | |
101 | ||
102 | // Feed cache directory | |
103 | $GLOBALS['config'['PAGECACHE'] = 'pagecache';]('PAGECACHE']-=-'pagecache';.html) | |
104 | ||
105 | // RainTPL cache directory (keep the trailing slash!) | |
106 | $GLOBALS['config'['RAINTPL_TMP'] = 'tmp/';]('RAINTPL_TMP']-=-'tmp/';.html) | |
107 | ||
108 | // RainTPL template directory (keep the trailing slash!) | |
109 | $GLOBALS['config'['RAINTPL_TPL'] = 'tpl/';]('RAINTPL_TPL']-=-'tpl/';.html) | |
110 | ||
111 | // Whether Shaarli checks for new releases at https://github.com/shaarli/Shaarli | |
112 | $GLOBALS['config'['ENABLE_UPDATECHECK'] = true;]('ENABLE_UPDATECHECK']-=-true;.html) | |
113 | ||
114 | // File to store the latest Shaarli version | |
115 | $GLOBALS['config'['UPDATECHECK_FILENAME'] = 'data/lastupdatecheck.txt';]('UPDATECHECK_FILENAME']-=-'data/lastupdatecheck.txt';.html) | |
116 | ||
117 | // Delay between version checks (requires to be logged in) (24 hours) | |
118 | $GLOBALS['config'['UPDATECHECK_INTERVAL'] = 86400;]('UPDATECHECK_INTERVAL']-=-86400;.html) | |
119 | ||
120 | // For each link, display a link to an archived version on archive.org | |
121 | $GLOBALS['config'['ARCHIVE_ORG'] = false;]('ARCHIVE_ORG']-=-false;.html) | |
122 | ||
123 | // The RSS item links point: | |
124 | // true => directly to the link | |
125 | // false => to the entry on Shaarli (permalink) | |
126 | $GLOBALS['config'['ENABLE_RSS_PERMALINKS'] = true;]('ENABLE_RSS_PERMALINKS']-=-true;.html) | |
127 | ||
128 | // Hide all links to non-logged users | |
129 | $GLOBALS['config'['HIDE_PUBLIC_LINKS'] = false;]('HIDE_PUBLIC_LINKS']-=-false;.html) | |
130 | ||
131 | $GLOBALS['config'['PUBSUBHUB_URL'] = '';]('PUBSUBHUB_URL']-=-'';.html) | |
132 | ||
133 | // Show an ATOM Feed button next to the Subscribe (RSS) button. | |
134 | // ATOM feeds are available at the address ?do=atom regardless of this option. | |
135 | $GLOBALS['config'['SHOW_ATOM'] = false;]('SHOW_ATOM']-=-false;.html) | |
136 | ?> | |
137 | ``` |