]> git.immae.eu Git - github/shaarli/Shaarli.git/blob - doc/md/Shaarli-configuration.md
Feature: support any tag separator
[github/shaarli/Shaarli.git] / doc / md / Shaarli-configuration.md
1 # Shaarli configuration
2
3 Once your Shaarli instance is installed, the file `data/config.json.php` is generated:
4
5 - it contains all settings in JSON format, and can be edited to customize values
6 - it defines which [plugins](Plugins.md) are enabled
7 - its values override those defined in `index.php`
8 - it is wrapped in a PHP comment so that its contents are never served by the web server, regardless of configuration
9
10 **Do not edit configuration options in index.php! Your changes would be lost.**
11
12 ## Tools menu
13
14 Some settings can be configured directly from a web browser by accesing the `Tools` menu. Values are read/written to/from the configuration file.
15
16 ![](https://i.imgur.com/boaaibC.png)
17
18 ### LDAP
19
20 - **host**: LDAP host used for user authentication
21 - **dn**: user DN template (`sprintf` format, `%s` being replaced by user login)
22
23 ## Configuration file example
24
25 ```json
26 <?php /*
27 {
28 "credentials": {
29 "login": "<login>",
30 "hash": "<password hash>",
31 "salt": "<password salt>"
32 },
33 "security": {
34 "ban_after": 4,
35 "session_protection_disabled": false,
36 "ban_duration": 1800,
37 "trusted_proxies": [
38 "1.2.3.4",
39 "5.6.7.8"
40 ],
41 "allowed_protocols": [
42 "ftp",
43 "ftps",
44 "magnet"
45 ]
46 },
47 "resources": {
48 "data_dir": "data",
49 "config": "data\/config.php",
50 "datastore": "data\/datastore.php",
51 "ban_file": "data\/ipbans.php",
52 "updates": "data\/updates.txt",
53 "log": "data\/log.txt",
54 "update_check": "data\/lastupdatecheck.txt",
55 "raintpl_tmp": "tmp\/",
56 "raintpl_tpl": "tpl\/",
57 "thumbnails_cache": "cache",
58 "page_cache": "pagecache"
59 },
60 "general": {
61 "check_updates": true,
62 "rss_permalinks": true,
63 "links_per_page": 20,
64 "default_private_links": true,
65 "enable_thumbnails": true,
66 "enable_localcache": true,
67 "check_updates_branch": "stable",
68 "check_updates_interval": 86400,
69 "enabled_plugins": [
70 "markdown",
71 "wallabag",
72 "archiveorg"
73 ],
74 "timezone": "Europe\/Paris",
75 "title": "My Shaarli",
76 "header_link": "?"
77 "tags_separator": " "
78 },
79 "dev": {
80 "debug": false,
81 }
82 "extras": {
83 "show_atom": false,
84 "hide_public_links": false,
85 "hide_timestamps": false,
86 "open_shaarli": false,
87 },
88 "general": {
89 "header_link": "?",
90 "links_per_page": 20,
91 "enabled_plugins": [
92 "markdown",
93 "wallabag"
94 ],
95 "timezone": "Europe\/Paris",
96 "title": "My Shaarli"
97 },
98 "updates": {
99 "check_updates": true,
100 "check_updates_branch": "stable",
101 "check_updates_interval": 86400
102 },
103 "feed": {
104 "rss_permalinks": true,
105 "show_atom": false
106 },
107 "privacy": {
108 "default_private_links": true,
109 "hide_public_links": false,
110 "force_login": false,
111 "hide_timestamps": false,
112 "remember_user_default": true
113 },
114 "thumbnail": {
115 "enable_thumbnails": true,
116 "enable_localcache": true
117 },
118 "plugins": {
119 "WALLABAG_URL": "http://demo.wallabag.org",
120 "WALLABAG_VERSION": "1"
121 },
122 "translation": {
123 "language": "fr",
124 "mode": "php",
125 "extensions": {
126 "demo": "plugins/demo_plugin/languages/"
127 }
128 },
129 "ldap": {
130 "host": "ldap://localhost",
131 "dn": "uid=%s,ou=people,dc=example,dc=org"
132 }
133 } ?>
134 ```
135
136 ## Settings
137
138 ### Credentials
139
140 _These settings should not be edited_
141
142 - **login**: Login username.
143 - **hash**: Generated password hash.
144 - **salt**: Password salt.
145
146 ### General
147
148 - **title**: Shaarli's instance title.
149 - **header_link**: Link to the homepage.
150 - **links_per_page**: Number of Shaares displayed per page.
151 - **timezone**: See [the list of supported timezones](http://php.net/manual/en/timezones.php).
152 - **enabled_plugins**: List of enabled plugins.
153 - **default_note_title**: Default title of a new note.
154 - **enable_async_metadata** (boolean): Retrieve external bookmark metadata asynchronously to prevent bookmark creation slowdown.
155 - **retrieve_description** (boolean): If set to true, for every new Shaare Shaarli will try to retrieve the description and keywords from the HTML meta tags.
156 - **root_url**: Overrides automatic discovery of Shaarli instance's URL (e.g.) `https://sub.domain.tld/shaarli-folder/`.
157 - **tags_separator**: Defines your tags separator (default: whitespace).
158
159 ### Security
160
161 - **session_protection_disabled**: Disable session cookie hijacking protection (not recommended).
162 It might be useful if your IP adress often changes.
163 - **ban_after**: Failed login attempts before being IP banned.
164 - **ban_duration**: IP ban duration in seconds.
165 - **open_shaarli**: Anyone can add a new Shaare while logged out if enabled.
166 - **trusted_proxies**: List of trusted IP which won't be banned after failed login attemps. Useful if Shaarli is behind a reverse proxy.
167 - **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"]`).
168
169 ### Formatter
170
171 Single string value. Default available:
172
173 - `default`: supports line breaks, URL and hashtag auto-links.
174 - `markdown`: supports [Markdown](https://daringfireball.net/projects/markdown/syntax).
175 - `markdownExtra`: adds [extra](https://michelf.ca/projects/php-markdown/extra/) flavor to Markdown.
176
177 ### Formatter Settings
178
179 Additional settings applied to formatters.
180
181 #### default
182
183 - **autolink**: boolean to enable or disable automatic linkification of URL and hashtags.
184
185 ### Resources
186
187 - **data_dir**: Data directory.
188 - **datastore**: Shaarli's Shaares database file path.
189 - **history**: Shaarli's operation history file path.
190 - **updates**: File path for the ran updates file.
191 - **log**: Log file path.
192 - **update_check**: Last update check file path.
193 - **raintpl_tpl**: Templates directory.
194 - **raintpl_tmp**: Template engine cache directory.
195 - **thumbnails_cache**: Thumbnails cache directory.
196 - **page_cache**: Shaarli's internal cache directory.
197 - **ban_file**: Banned IP file path.
198
199 ### Translation
200
201 - **language**: translation language (also see [Translations](Translations))
202 - **auto** (default): The translation language is chosen from the browser locale.
203 It means that the language can be different for 2 different visitors depending on their locale.
204 - **en**: Use the English translation.
205 - **fr**: Use the French translation.
206 - **mode**:
207 - **auto** or **php** (default): Use the PHP implementation of gettext (slower)
208 - **gettext**: Use PHP builtin gettext extension
209 (faster, but requires `php-gettext` to be installed and to reload the web server on update)
210 - **extension**: Translation extensions for custom themes or plugins.
211 Must be an associative array: `translation domain => translation path`.
212
213 ### Updates
214
215 - **check_updates**: Enable or disable update check to the git repository.
216 - **check_updates_branch**: Git branch used to check updates (e.g. `stable` or `master`).
217 - **check_updates_interval**: Look for new version every N seconds (default: every day).
218
219 ### Privacy
220
221 - **default_private_links**: Check the private checkbox by default for every new Shaare.
222 - **hide_public_links**: All Shaares are hidden while logged out.
223 - **force_login**: if **hide_public_links** and this are set to `true`, all anonymous users are redirected to the login page.
224 - **hide_timestamps**: Timestamps are hidden.
225 - **remember_user_default**: Default state of the login page's *remember me* checkbox
226 - `true`: checked by default, `false`: unchecked by default
227
228 ### Feed
229
230 - **rss_permalinks**: Enable this to redirect RSS links to Shaarli's permalinks instead of shaared URL.
231 - **show_atom**: Display ATOM feed button.
232
233 ### Thumbnail
234
235 - **enable_thumbnails**: Enable or disable thumbnail display.
236 - **enable_localcache**: Enable or disable local cache.
237
238 ## Plugins configuration
239
240 See [Plugins](Plugins.md)