]> git.immae.eu Git - github/shaarli/Shaarli.git/blame - doc/md/Shaarli-configuration.md
documentation: fix rendering and internal references
[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.
fdf88d19
A
58
59### Security
60
43ad7c8e
V
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"]`).
fdf88d19
A
68
69### Resources
70
43ad7c8e
V
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.
fdf88d19
A
82
83### Updates
84
43ad7c8e
V
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).
fdf88d19
A
88
89### Privacy
90
43ad7c8e
V
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.
fdf88d19
A
94
95### Feed
96
43ad7c8e
V
97- **rss_permalinks**: Enable this to redirect RSS links to Shaarli's permalinks instead of shaared URL.
98- **show_atom**: Display ATOM feed button.
fdf88d19
A
99
100### Thumbnail
101
43ad7c8e
V
102- **enable_thumbnails**: Enable or disable thumbnail display.
103- **enable_localcache**: Enable or disable local cache.
fdf88d19
A
104
105### Redirector
106
43ad7c8e
V
107- **url**: Redirector URL, such as `anonym.to`.
108- **encode_url**: Enable this if the redirector needs encoded URL to work properly.
fdf88d19
A
109
110## Configuration file example
111
112```json
113<?php /*
114{
115 "credentials": {
116 "login": "<login>",
117 "hash": "<password hash>",
118 "salt": "<password salt>"
119 },
120 "security": {
121 "ban_after": 4,
122 "session_protection_disabled": false,
123 "ban_duration": 1800,
53ed6d7d 124 "trusted_proxies": [
fdf88d19
A
125 "1.2.3.4",
126 "5.6.7.8"
53ed6d7d 127 ],
128 "allowed_protocols": [
129 "ftp",
130 "ftps",
131 "magnet"
fdf88d19
A
132 ]
133 },
134 "resources": {
135 "data_dir": "data",
136 "config": "data\/config.php",
137 "datastore": "data\/datastore.php",
138 "ban_file": "data\/ipbans.php",
139 "updates": "data\/updates.txt",
140 "log": "data\/log.txt",
141 "update_check": "data\/lastupdatecheck.txt",
142 "raintpl_tmp": "tmp\/",
143 "raintpl_tpl": "tpl\/",
144 "thumbnails_cache": "cache",
145 "page_cache": "pagecache"
146 },
147 "general": {
148 "check_updates": true,
149 "rss_permalinks": true,
150 "links_per_page": 20,
151 "default_private_links": true,
152 "enable_thumbnails": true,
153 "enable_localcache": true,
154 "check_updates_branch": "stable",
155 "check_updates_interval": 86400,
53ed6d7d 156 "enabled_plugins": [
fdf88d19
A
157 "markdown",
158 "wallabag",
159 "archiveorg"
160 ],
161 "timezone": "Europe\/Paris",
162 "title": "My Shaarli",
163 "header_link": "?"
164 },
165 "extras": {
166 "show_atom": false,
167 "hide_public_links": false,
168 "hide_timestamps": false,
169 "open_shaarli": false,
170 "redirector": "http://anonym.to/?",
171 "redirector_encode_url": false
172 },
173 "general": {
174 "header_link": "?",
175 "links_per_page": 20,
53ed6d7d 176 "enabled_plugins": [
fdf88d19
A
177 "markdown",
178 "wallabag"
179 ],
180 "timezone": "Europe\/Paris",
181 "title": "My Shaarli"
182 },
183 "updates": {
184 "check_updates": true,
185 "check_updates_branch": "stable",
186 "check_updates_interval": 86400
187 },
188 "feed": {
189 "rss_permalinks": true,
190 "show_atom": false
191 },
192 "privacy": {
193 "default_private_links": true,
194 "hide_public_links": false,
195 "hide_timestamps": false
196 },
197 "thumbnail": {
198 "enable_thumbnails": true,
199 "enable_localcache": true
200 },
201 "redirector": {
202 "url": "http://anonym.to/?",
203 "encode_url": false
204 },
205 "plugins": {
206 "WALLABAG_URL": "http://demo.wallabag.org",
207 "WALLABAG_VERSION": "1"
208 }
209} ?>
992af0b9 210```
5409ade2
A
211
212## Additional configuration
213
43ad7c8e 214The `playvideos` plugin may require that you adapt your server's
53ed6d7d 215[Content Security Policy](https://github.com/shaarli/Shaarli/blob/master/plugins/playvideos/README.md#troubleshooting)
43ad7c8e 216configuration to work properly.
fdf88d19 217