2 # Shaarli configuration
6 **Do not edit configuration options in index.php! Your changes would be lost.**
8 Once your Shaarli instance is installed, the file `data/config.json.php` is generated:
9 * it contains all settings in JSON format, and can be edited to customize values
10 * it defines which [plugins](Plugin-System) are enabled[(.html)]((.html).html)
11 * its values override those defined in `index.php`
12 * it is wrap in a PHP comment to prevent anyone accessing it, regardless of server configuration
14 ## File and directory permissions
16 The server process running Shaarli must have:
17 - `read` access to the following resources:
18 - PHP scripts: `index.php`, `application/*.php`, `plugins/*.php`
19 - 3rd party PHP and Javascript libraries: `inc/*.php`, `inc/*.js`
21 - CSS stylesheets: `inc/*.css`
23 - RainTPL templates: `tpl/*.html`
24 - `read`, `write` and `execution` access to the following directories:
25 - `cache` - thumbnail cache
26 - `data` - link data store, configuration options
27 - `pagecache` - Atom/RSS feed cache
28 - `tmp` - RainTPL page cache
30 On a Linux distribution:
31 - the web server user will likely be `www` or `http` (for Apache2)
32 - it will be a member of a group of the same name: `www:www`, `http:http`
33 - to give it access to Shaarli, either:
34 - unzip Shaarli in the default web server location (usually `/var/www/`) and set the web server user as the owner
35 - put users in the same group as the web server, and set the appropriate access rights
36 - if you have a domain / subdomain to serve Shaarli, [configure the server](Server-configuration) accordingly[(.html)]((.html).html)
40 In `data/config.json.php`.
42 See also [Plugin System](Plugin-System.html).[](.html)
46 > You shouldn't edit those.
48 **login**: Login username.
49 **hash**: Generated password hash.
50 **salt**: Password salt.
54 **title**: Shaarli's instance title.
55 **header_link**: Link to the homepage.
56 **links_per_page**: Number of shaares displayed per page.
57 **timezone**: See [the list of supported timezones](http://php.net/manual/en/timezones.php). [](.html)
58 **enabled_plugins**: List of enabled plugins.
62 **session_protection_disabled**: Disable session cookie hijacking protection (not recommended).
63 It might be useful if your IP adress often changes.
64 **ban_after**: Failed login attempts before being IP banned.
65 **ban_duration**: IP ban duration in seconds.
66 **open_shaarli**: Anyone can add a new link while logged out if enabled.
67 **trusted_proxies**: List of trusted IP which won't be banned after failed login attemps. Useful if Shaarli is behind a reverse proxy.
71 **data_dir**: Data directory.
72 **datastore**: Shaarli's links database file path.
73 **updates**: File path for the ran updates file.
74 **log**: Log file path.
75 **update_check**: Last update check file path.
76 **raintpl_tpl**: Templates directory.
77 **raintpl_tmp**: Template engine cache directory.
78 **thumbnails_cache**: Thumbnails cache directory.
79 **page_cache**: Shaarli's internal cache directory.
80 **ban_file**: Banned IP file path.
84 **check_updates**: Enable or disable update check to the git repository.
85 **check_updates_branch**: Git branch used to check updates (e.g. `stable` or `master`).
86 **check_updates_interval**: Look for new version every N seconds (default: every day).
90 **default_private_links**: Check the private checkbox by default for every new link.
91 **hide_public_links**: All links are hidden while logged out.
92 **hide_timestamps**: Timestamps are hidden.
96 **rss_permalinks**: Enable this to redirect RSS links to Shaarli's permalinks instead of shaared URL.
97 **show_atom**: Display ATOM feed button.
101 **enable_thumbnails**: Enable or disable thumbnail display.
102 **enable_localcache**: Enable or disable local cache.
106 **url**: Redirector URL, such as `anonym.to`.
107 **encode_url**: Enable this if the redirector needs encoded URL to work properly.
109 ## Configuration file example
116 "hash": "<password hash>",
117 "salt": "<password salt>"
121 "session_protection_disabled": false,
122 "ban_duration": 1800,
123 "trusted_proxies": [[](.html)
130 "config": "data\/config.php",
131 "datastore": "data\/datastore.php",
132 "ban_file": "data\/ipbans.php",
133 "updates": "data\/updates.txt",
134 "log": "data\/log.txt",
135 "update_check": "data\/lastupdatecheck.txt",
136 "raintpl_tmp": "tmp\/",
137 "raintpl_tpl": "tpl\/",
138 "thumbnails_cache": "cache",
139 "page_cache": "pagecache"
142 "check_updates": true,
143 "rss_permalinks": true,
144 "links_per_page": 20,
145 "default_private_links": true,
146 "enable_thumbnails": true,
147 "enable_localcache": true,
148 "check_updates_branch": "stable",
149 "check_updates_interval": 86400,
150 "enabled_plugins": [[](.html)
155 "timezone": "Europe\/Paris",
156 "title": "My Shaarli",
161 "hide_public_links": false,
162 "hide_timestamps": false,
163 "open_shaarli": false,
164 "redirector": "http://anonym.to/?",
165 "redirector_encode_url": false
169 "links_per_page": 20,
170 "enabled_plugins": [[](.html)
174 "timezone": "Europe\/Paris",
175 "title": "My Shaarli"
178 "check_updates": true,
179 "check_updates_branch": "stable",
180 "check_updates_interval": 86400
183 "rss_permalinks": true,
187 "default_private_links": true,
188 "hide_public_links": false,
189 "hide_timestamps": false
192 "enable_thumbnails": true,
193 "enable_localcache": true
196 "url": "http://anonym.to/?",
200 "WALLABAG_URL": "http://demo.wallabag.org",
201 "WALLABAG_VERSION": "1"
206 ## Additional configuration
208 The playvideos plugin may require that you adapt your server's
209 [Content Security Policy](https://github.com/shaarli/Shaarli/blob/master/plugins/playvideos/README.md#troubleshooting) [](.html)
210 configuration to work properly.[(.html)]((.html).html)