]> git.immae.eu Git - github/shaarli/Shaarli.git/blob - doc/md/Shaarli-configuration.md
Merge pull request #944 from thewilli/configure-rememberme
[github/shaarli/Shaarli.git] / doc / md / Shaarli-configuration.md
1 ## Foreword
2
3 **Do not edit configuration options in index.php! Your changes would be lost.**
4
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
10
11 ## File and directory permissions
12
13 The server process running Shaarli must have:
14
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`
18 - static assets:
19 - CSS stylesheets: `inc/*.css`
20 - `images/*`
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
27
28 On a Linux distribution:
29
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)
36
37 ## Configuration
38
39 In `data/config.json.php`.
40
41 See also [Plugin System](Plugin-System.html).
42
43 ### Credentials
44
45 _These settings should not be edited_
46
47 - **login**: Login username.
48 - **hash**: Generated password hash.
49 - **salt**: Password salt.
50
51 ### General
52
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
59 ### Security
60
61 - **session_protection_disabled**: Disable session cookie hijacking protection (not recommended).
62 It might be useful if your IP adress often changes.
63 - **ban_after**: Failed login attempts before being IP banned.
64 - **ban_duration**: IP ban duration in seconds.
65 - **open_shaarli**: Anyone can add a new link while logged out if enabled.
66 - **trusted_proxies**: List of trusted IP which won't be banned after failed login attemps. Useful if Shaarli is behind a reverse proxy.
67 - **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"]`).
68
69 ### Resources
70
71 - **data_dir**: Data directory.
72 - **datastore**: Shaarli's links database file path.
73 - **history**: Shaarli's operation history file path.
74 - **updates**: File path for the ran updates file.
75 - **log**: Log file path.
76 - **update_check**: Last update check file path.
77 - **raintpl_tpl**: Templates directory.
78 - **raintpl_tmp**: Template engine cache directory.
79 - **thumbnails_cache**: Thumbnails cache directory.
80 - **page_cache**: Shaarli's internal cache directory.
81 - **ban_file**: Banned IP file path.
82
83 ### Updates
84
85 - **check_updates**: Enable or disable update check to the git repository.
86 - **check_updates_branch**: Git branch used to check updates (e.g. `stable` or `master`).
87 - **check_updates_interval**: Look for new version every N seconds (default: every day).
88
89 ### Privacy
90
91 - **default_private_links**: Check the private checkbox by default for every new link.
92 - **hide_public_links**: All links are hidden while logged out.
93 - **hide_timestamps**: Timestamps are hidden.
94 - **remember_user_default**: Default state of the login page's *remember me* checkbox
95 - `true`: checked by default, `false`: unchecked by default
96
97 ### Feed
98
99 - **rss_permalinks**: Enable this to redirect RSS links to Shaarli's permalinks instead of shaared URL.
100 - **show_atom**: Display ATOM feed button.
101
102 ### Thumbnail
103
104 - **enable_thumbnails**: Enable or disable thumbnail display.
105 - **enable_localcache**: Enable or disable local cache.
106
107 ### Redirector
108
109 - **url**: Redirector URL, such as `anonym.to`.
110 - **encode_url**: Enable this if the redirector needs encoded URL to work properly.
111
112 ## Configuration file example
113
114 ```json
115 <?php /*
116 {
117 "credentials": {
118 "login": "<login>",
119 "hash": "<password hash>",
120 "salt": "<password salt>"
121 },
122 "security": {
123 "ban_after": 4,
124 "session_protection_disabled": false,
125 "ban_duration": 1800,
126 "trusted_proxies": [
127 "1.2.3.4",
128 "5.6.7.8"
129 ],
130 "allowed_protocols": [
131 "ftp",
132 "ftps",
133 "magnet"
134 ]
135 },
136 "resources": {
137 "data_dir": "data",
138 "config": "data\/config.php",
139 "datastore": "data\/datastore.php",
140 "ban_file": "data\/ipbans.php",
141 "updates": "data\/updates.txt",
142 "log": "data\/log.txt",
143 "update_check": "data\/lastupdatecheck.txt",
144 "raintpl_tmp": "tmp\/",
145 "raintpl_tpl": "tpl\/",
146 "thumbnails_cache": "cache",
147 "page_cache": "pagecache"
148 },
149 "general": {
150 "check_updates": true,
151 "rss_permalinks": true,
152 "links_per_page": 20,
153 "default_private_links": true,
154 "enable_thumbnails": true,
155 "enable_localcache": true,
156 "check_updates_branch": "stable",
157 "check_updates_interval": 86400,
158 "enabled_plugins": [
159 "markdown",
160 "wallabag",
161 "archiveorg"
162 ],
163 "timezone": "Europe\/Paris",
164 "title": "My Shaarli",
165 "header_link": "?"
166 },
167 "extras": {
168 "show_atom": false,
169 "hide_public_links": false,
170 "hide_timestamps": false,
171 "open_shaarli": false,
172 "redirector": "http://anonym.to/?",
173 "redirector_encode_url": false
174 },
175 "general": {
176 "header_link": "?",
177 "links_per_page": 20,
178 "enabled_plugins": [
179 "markdown",
180 "wallabag"
181 ],
182 "timezone": "Europe\/Paris",
183 "title": "My Shaarli"
184 },
185 "updates": {
186 "check_updates": true,
187 "check_updates_branch": "stable",
188 "check_updates_interval": 86400
189 },
190 "feed": {
191 "rss_permalinks": true,
192 "show_atom": false
193 },
194 "privacy": {
195 "default_private_links": true,
196 "hide_public_links": false,
197 "hide_timestamps": false,
198 "remember_user_default": true
199 },
200 "thumbnail": {
201 "enable_thumbnails": true,
202 "enable_localcache": true
203 },
204 "redirector": {
205 "url": "http://anonym.to/?",
206 "encode_url": false
207 },
208 "plugins": {
209 "WALLABAG_URL": "http://demo.wallabag.org",
210 "WALLABAG_VERSION": "1"
211 }
212 } ?>
213 ```
214
215 ## Additional configuration
216
217 The `playvideos` plugin may require that you adapt your server's
218 [Content Security Policy](https://github.com/shaarli/Shaarli/blob/master/plugins/playvideos/README.md#troubleshooting)
219 configuration to work properly.
220