]> git.immae.eu Git - github/shaarli/Shaarli.git/blame - doc/md/Shaarli-configuration.md
Remove the redirector setting
[github/shaarli/Shaarli.git] / doc / md / Shaarli-configuration.md
CommitLineData
992af0b9
V
1## Foreword
2
3**Do not edit configuration options in index.php! Your changes would be lost.**
4
fdf88d19
A
5Once 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
53ed6d7d 7* it defines which [plugins](Plugin-System) are enabled[](.html)
992af0b9 8* its values override those defined in `index.php`
fdf88d19 9* it is wrap in a PHP comment to prevent anyone accessing it, regardless of server configuration
992af0b9
V
10
11## File and directory permissions
fdf88d19 12
992af0b9 13The server process running Shaarli must have:
6d074b4c 14
992af0b9 15- `read` access to the following resources:
5409ade2
A
16 - PHP scripts: `index.php`, `application/*.php`, `plugins/*.php`
17 - 3rd party PHP and Javascript libraries: `inc/*.php`, `inc/*.js`
992af0b9 18 - static assets:
5409ade2
A
19 - CSS stylesheets: `inc/*.css`
20 - `images/*`
21 - RainTPL templates: `tpl/*.html`
992af0b9
V
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
28On a Linux distribution:
6d074b4c 29
992af0b9
V
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
53ed6d7d 35- if you have a domain / subdomain to serve Shaarli, [configure the server](Server-configuration) accordingly[](.html)
fdf88d19
A
36
37## Configuration
38
39In `data/config.json.php`.
40
53ed6d7d 41See also [Plugin System](Plugin-System.html).
fdf88d19
A
42
43### Credentials
44
43ad7c8e 45_These settings should not be edited_
fdf88d19 46
43ad7c8e
V
47- **login**: Login username.
48- **hash**: Generated password hash.
49- **salt**: Password salt.
fdf88d19
A
50
51### General
52
43ad7c8e
V
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.
722caa20 58- **default_note_title**: Default title of a new note.
fdf88d19
A
59
60### Security
61
43ad7c8e
V
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"]`).
fdf88d19
A
69
70### Resources
71
43ad7c8e
V
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.
fdf88d19 83
1a47014f
A
84### Translation
85
86- **language**: translation language (also see [Translations](Translations))
87 - **auto** (default): The translation language is chosen from the browser locale.
88 It means that the language can be different for 2 different visitors depending on their locale.
89 - **en**: Use the English translation.
90 - **fr**: Use the French translation.
91- **mode**:
92 - **auto** or **php** (default): Use the PHP implementation of gettext (slower)
93 - **gettext**: Use PHP builtin gettext extension
94 (faster, but requires `php-gettext` to be installed and to reload the web server on update)
95- **extension**: Translation extensions for custom themes or plugins.
96Must be an associative array: `translation domain => translation path`.
97
fdf88d19
A
98### Updates
99
43ad7c8e
V
100- **check_updates**: Enable or disable update check to the git repository.
101- **check_updates_branch**: Git branch used to check updates (e.g. `stable` or `master`).
102- **check_updates_interval**: Look for new version every N seconds (default: every day).
fdf88d19
A
103
104### Privacy
105
43ad7c8e
V
106- **default_private_links**: Check the private checkbox by default for every new link.
107- **hide_public_links**: All links are hidden while logged out.
27e21231 108- **force_login**: if **hide_public_links** and this are set to `true`, all anonymous users are redirected to the login page.
43ad7c8e 109- **hide_timestamps**: Timestamps are hidden.
2e07e775
WE
110- **remember_user_default**: Default state of the login page's *remember me* checkbox
111 - `true`: checked by default, `false`: unchecked by default
fdf88d19
A
112
113### Feed
114
43ad7c8e
V
115- **rss_permalinks**: Enable this to redirect RSS links to Shaarli's permalinks instead of shaared URL.
116- **show_atom**: Display ATOM feed button.
fdf88d19
A
117
118### Thumbnail
119
43ad7c8e
V
120- **enable_thumbnails**: Enable or disable thumbnail display.
121- **enable_localcache**: Enable or disable local cache.
fdf88d19 122
fdf88d19
A
123## Configuration file example
124
125```json
126<?php /*
127{
128 "credentials": {
129 "login": "<login>",
130 "hash": "<password hash>",
131 "salt": "<password salt>"
132 },
133 "security": {
134 "ban_after": 4,
135 "session_protection_disabled": false,
136 "ban_duration": 1800,
53ed6d7d 137 "trusted_proxies": [
fdf88d19
A
138 "1.2.3.4",
139 "5.6.7.8"
53ed6d7d 140 ],
141 "allowed_protocols": [
142 "ftp",
143 "ftps",
144 "magnet"
fdf88d19
A
145 ]
146 },
147 "resources": {
148 "data_dir": "data",
149 "config": "data\/config.php",
150 "datastore": "data\/datastore.php",
151 "ban_file": "data\/ipbans.php",
152 "updates": "data\/updates.txt",
153 "log": "data\/log.txt",
154 "update_check": "data\/lastupdatecheck.txt",
155 "raintpl_tmp": "tmp\/",
156 "raintpl_tpl": "tpl\/",
157 "thumbnails_cache": "cache",
158 "page_cache": "pagecache"
159 },
160 "general": {
161 "check_updates": true,
162 "rss_permalinks": true,
163 "links_per_page": 20,
164 "default_private_links": true,
165 "enable_thumbnails": true,
166 "enable_localcache": true,
167 "check_updates_branch": "stable",
168 "check_updates_interval": 86400,
53ed6d7d 169 "enabled_plugins": [
fdf88d19
A
170 "markdown",
171 "wallabag",
172 "archiveorg"
173 ],
174 "timezone": "Europe\/Paris",
175 "title": "My Shaarli",
176 "header_link": "?"
177 },
178 "extras": {
179 "show_atom": false,
180 "hide_public_links": false,
181 "hide_timestamps": false,
182 "open_shaarli": false,
fdf88d19
A
183 },
184 "general": {
185 "header_link": "?",
186 "links_per_page": 20,
53ed6d7d 187 "enabled_plugins": [
fdf88d19
A
188 "markdown",
189 "wallabag"
190 ],
191 "timezone": "Europe\/Paris",
192 "title": "My Shaarli"
193 },
194 "updates": {
195 "check_updates": true,
196 "check_updates_branch": "stable",
197 "check_updates_interval": 86400
198 },
199 "feed": {
200 "rss_permalinks": true,
201 "show_atom": false
202 },
203 "privacy": {
204 "default_private_links": true,
205 "hide_public_links": false,
27e21231 206 "force_login": false,
2e07e775
WE
207 "hide_timestamps": false,
208 "remember_user_default": true
fdf88d19
A
209 },
210 "thumbnail": {
211 "enable_thumbnails": true,
212 "enable_localcache": true
213 },
fdf88d19
A
214 "plugins": {
215 "WALLABAG_URL": "http://demo.wallabag.org",
216 "WALLABAG_VERSION": "1"
1a47014f
A
217 },
218 "translation": {
219 "language": "fr",
220 "mode": "php",
221 "extensions": {
222 "demo": "plugins/demo_plugin/languages/"
223 }
fdf88d19
A
224 }
225} ?>
992af0b9 226```
5409ade2
A
227
228## Additional configuration
229
43ad7c8e 230The `playvideos` plugin may require that you adapt your server's
53ed6d7d 231[Content Security Policy](https://github.com/shaarli/Shaarli/blob/master/plugins/playvideos/README.md#troubleshooting)
43ad7c8e 232configuration to work properly.
fdf88d19 233