3 **Do not edit configuration options in index.php! Your changes would be lost.**
5 Once your Shaarli instance is installed, the file `data/config.json.php` is generated:
6 * it contains all settings in JSON format, and can be edited to customize values
7 * it defines which [plugins](Plugin-System) are enabled[](.html)
8 * its values override those defined in `index.php`
9 * it is wrap in a PHP comment to prevent anyone accessing it, regardless of server configuration
11 ## File and directory permissions
13 The server process running Shaarli must have:
15 - `read` access to the following resources:
16 - PHP scripts: `index.php`, `application/*.php`, `plugins/*.php`
17 - 3rd party PHP and Javascript libraries: `inc/*.php`, `inc/*.js`
19 - CSS stylesheets: `inc/*.css`
21 - RainTPL templates: `tpl/*.html`
22 - `read`, `write` and `execution` access to the following directories:
23 - `cache` - thumbnail cache
24 - `data` - link data store, configuration options
25 - `pagecache` - Atom/RSS feed cache
26 - `tmp` - RainTPL page cache
28 On a Linux distribution:
30 - the web server user will likely be `www` or `http` (for Apache2)
31 - it will be a member of a group of the same name: `www:www`, `http:http`
32 - to give it access to Shaarli, either:
33 - unzip Shaarli in the default web server location (usually `/var/www/`) and set the web server user as the owner
34 - put users in the same group as the web server, and set the appropriate access rights
35 - if you have a domain / subdomain to serve Shaarli, [configure the server](Server-configuration) accordingly[](.html)
39 In `data/config.json.php`.
41 See also [Plugin System](Plugin-System.html).
45 _These settings should not be edited_
47 - **login**: Login username.
48 - **hash**: Generated password hash.
49 - **salt**: Password salt.
53 - **title**: Shaarli's instance title.
54 - **header_link**: Link to the homepage.
55 - **links_per_page**: Number of shaares displayed per page.
56 - **timezone**: See [the list of supported timezones](http://php.net/manual/en/timezones.php).
57 - **enabled_plugins**: List of enabled plugins.
58 - **default_note_title**: Default title of a new note.
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.
68 - **allowed_protocols**: List of allowed protocols in shaare URLs or markdown-rendered descriptions. Useful if you want to store `javascript:` links (bookmarklets) in Shaarli (default: `["ftp", "ftps", "magnet"]`).
72 - **data_dir**: Data directory.
73 - **datastore**: Shaarli's links database file path.
74 - **history**: Shaarli's operation history file path.
75 - **updates**: File path for the ran updates file.
76 - **log**: Log file path.
77 - **update_check**: Last update check file path.
78 - **raintpl_tpl**: Templates directory.
79 - **raintpl_tmp**: Template engine cache directory.
80 - **thumbnails_cache**: Thumbnails cache directory.
81 - **page_cache**: Shaarli's internal cache directory.
82 - **ban_file**: Banned IP file path.
86 - **check_updates**: Enable or disable update check to the git repository.
87 - **check_updates_branch**: Git branch used to check updates (e.g. `stable` or `master`).
88 - **check_updates_interval**: Look for new version every N seconds (default: every day).
92 - **default_private_links**: Check the private checkbox by default for every new link.
93 - **hide_public_links**: All links are hidden while logged out.
94 - **force_login**: if **hide_public_links** and this are set to `true`, all anonymous users are redirected to the login page.
95 - **hide_timestamps**: Timestamps are hidden.
96 - **remember_user_default**: Default state of the login page's *remember me* checkbox
97 - `true`: checked by default, `false`: unchecked by default
101 - **rss_permalinks**: Enable this to redirect RSS links to Shaarli's permalinks instead of shaared URL.
102 - **show_atom**: Display ATOM feed button.
106 - **enable_thumbnails**: Enable or disable thumbnail display.
107 - **enable_localcache**: Enable or disable local cache.
111 - **url**: Redirector URL, such as `anonym.to`.
112 - **encode_url**: Enable this if the redirector needs encoded URL to work properly.
114 ## Configuration file example
121 "hash": "<password hash>",
122 "salt": "<password salt>"
126 "session_protection_disabled": false,
127 "ban_duration": 1800,
132 "allowed_protocols": [
140 "config": "data\/config.php",
141 "datastore": "data\/datastore.php",
142 "ban_file": "data\/ipbans.php",
143 "updates": "data\/updates.txt",
144 "log": "data\/log.txt",
145 "update_check": "data\/lastupdatecheck.txt",
146 "raintpl_tmp": "tmp\/",
147 "raintpl_tpl": "tpl\/",
148 "thumbnails_cache": "cache",
149 "page_cache": "pagecache"
152 "check_updates": true,
153 "rss_permalinks": true,
154 "links_per_page": 20,
155 "default_private_links": true,
156 "enable_thumbnails": true,
157 "enable_localcache": true,
158 "check_updates_branch": "stable",
159 "check_updates_interval": 86400,
165 "timezone": "Europe\/Paris",
166 "title": "My Shaarli",
171 "hide_public_links": false,
172 "hide_timestamps": false,
173 "open_shaarli": false,
174 "redirector": "http://anonym.to/?",
175 "redirector_encode_url": false
179 "links_per_page": 20,
184 "timezone": "Europe\/Paris",
185 "title": "My Shaarli"
188 "check_updates": true,
189 "check_updates_branch": "stable",
190 "check_updates_interval": 86400
193 "rss_permalinks": true,
197 "default_private_links": true,
198 "hide_public_links": false,
199 "force_login": false,
200 "hide_timestamps": false,
201 "remember_user_default": true
204 "enable_thumbnails": true,
205 "enable_localcache": true
208 "url": "http://anonym.to/?",
212 "WALLABAG_URL": "http://demo.wallabag.org",
213 "WALLABAG_VERSION": "1"
218 ## Additional configuration
220 The `playvideos` plugin may require that you adapt your server's
221 [Content Security Policy](https://github.com/shaarli/Shaarli/blob/master/plugins/playvideos/README.md#troubleshooting)
222 configuration to work properly.