]> git.immae.eu Git - github/shaarli/Shaarli.git/blame - doc/md/Shaarli-configuration.md
Add manual configuration for root URL
[github/shaarli/Shaarli.git] / doc / md / Shaarli-configuration.md
CommitLineData
91a21c27 1# Shaarli configuration
992af0b9 2
fdf88d19 3Once your Shaarli instance is installed, the file `data/config.json.php` is generated:
fdf88d19 4
91a21c27 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
1a47014f 9
650a5f09 10**Do not edit configuration options in index.php! Your changes would be lost.**
fdf88d19 11
91a21c27 12## Tools menu
fdf88d19 13
91a21c27 14Some settings can be configured directly from a web browser by accesing the `Tools` menu. Values are read/written to/from the configuration file.
fdf88d19 15
91a21c27 16![](https://i.imgur.com/boaaibC.png)
fdf88d19 17
cc2ded54
SN
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
fdf88d19
A
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,
53ed6d7d 37 "trusted_proxies": [
fdf88d19
A
38 "1.2.3.4",
39 "5.6.7.8"
53ed6d7d 40 ],
41 "allowed_protocols": [
42 "ftp",
43 "ftps",
44 "magnet"
fdf88d19
A
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,
53ed6d7d 69 "enabled_plugins": [
fdf88d19
A
70 "markdown",
71 "wallabag",
72 "archiveorg"
73 ],
74 "timezone": "Europe\/Paris",
75 "title": "My Shaarli",
76 "header_link": "?"
77 },
5cacf290 78 "dev": {
79 "debug": false,
80 }
fdf88d19
A
81 "extras": {
82 "show_atom": false,
83 "hide_public_links": false,
84 "hide_timestamps": false,
85 "open_shaarli": false,
fdf88d19
A
86 },
87 "general": {
88 "header_link": "?",
89 "links_per_page": 20,
53ed6d7d 90 "enabled_plugins": [
fdf88d19
A
91 "markdown",
92 "wallabag"
93 ],
94 "timezone": "Europe\/Paris",
95 "title": "My Shaarli"
96 },
97 "updates": {
98 "check_updates": true,
99 "check_updates_branch": "stable",
100 "check_updates_interval": 86400
101 },
102 "feed": {
103 "rss_permalinks": true,
104 "show_atom": false
105 },
106 "privacy": {
107 "default_private_links": true,
108 "hide_public_links": false,
27e21231 109 "force_login": false,
2e07e775
WE
110 "hide_timestamps": false,
111 "remember_user_default": true
fdf88d19
A
112 },
113 "thumbnail": {
114 "enable_thumbnails": true,
115 "enable_localcache": true
116 },
fdf88d19
A
117 "plugins": {
118 "WALLABAG_URL": "http://demo.wallabag.org",
119 "WALLABAG_VERSION": "1"
1a47014f
A
120 },
121 "translation": {
122 "language": "fr",
123 "mode": "php",
124 "extensions": {
125 "demo": "plugins/demo_plugin/languages/"
126 }
cc2ded54
SN
127 },
128 "ldap": {
129 "host": "ldap://localhost",
130 "dn": "uid=%s,ou=people,dc=example,dc=org"
fdf88d19
A
131 }
132} ?>
992af0b9 133```
5409ade2 134
91a21c27 135## Settings
136
137### Credentials
650a5f09 138
91a21c27 139_These settings should not be edited_
140
650a5f09
A
141- **login**: Login username.
142- **hash**: Generated password hash.
91a21c27 143- **salt**: Password salt.
144
145### General
146
650a5f09
A
147- **title**: Shaarli's instance title.
148- **header_link**: Link to the homepage.
149- **links_per_page**: Number of Shaares displayed per page.
150- **timezone**: See [the list of supported timezones](http://php.net/manual/en/timezones.php).
91a21c27 151- **enabled_plugins**: List of enabled plugins.
152- **default_note_title**: Default title of a new note.
153- **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.
650a5f09 154- **root_url**: Overrides automatic discovery of Shaarli instance's URL (e.g.) `https://sub.domain.tld/shaarli-folder/`.
91a21c27 155
156### Security
157
650a5f09
A
158- **session_protection_disabled**: Disable session cookie hijacking protection (not recommended).
159 It might be useful if your IP adress often changes.
160- **ban_after**: Failed login attempts before being IP banned.
161- **ban_duration**: IP ban duration in seconds.
162- **open_shaarli**: Anyone can add a new Shaare while logged out if enabled.
163- **trusted_proxies**: List of trusted IP which won't be banned after failed login attemps. Useful if Shaarli is behind a reverse proxy.
91a21c27 164- **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"]`).
165
166### Resources
167
650a5f09
A
168- **data_dir**: Data directory.
169- **datastore**: Shaarli's Shaares database file path.
91a21c27 170- **history**: Shaarli's operation history file path.
650a5f09
A
171- **updates**: File path for the ran updates file.
172- **log**: Log file path.
173- **update_check**: Last update check file path.
174- **raintpl_tpl**: Templates directory.
175- **raintpl_tmp**: Template engine cache directory.
176- **thumbnails_cache**: Thumbnails cache directory.
177- **page_cache**: Shaarli's internal cache directory.
91a21c27 178- **ban_file**: Banned IP file path.
179
180### Translation
181
182- **language**: translation language (also see [Translations](Translations))
650a5f09
A
183 - **auto** (default): The translation language is chosen from the browser locale.
184 It means that the language can be different for 2 different visitors depending on their locale.
91a21c27 185 - **en**: Use the English translation.
186 - **fr**: Use the French translation.
650a5f09 187- **mode**:
91a21c27 188 - **auto** or **php** (default): Use the PHP implementation of gettext (slower)
650a5f09 189 - **gettext**: Use PHP builtin gettext extension
91a21c27 190 (faster, but requires `php-gettext` to be installed and to reload the web server on update)
650a5f09 191- **extension**: Translation extensions for custom themes or plugins.
91a21c27 192Must be an associative array: `translation domain => translation path`.
193
194### Updates
195
650a5f09
A
196- **check_updates**: Enable or disable update check to the git repository.
197- **check_updates_branch**: Git branch used to check updates (e.g. `stable` or `master`).
91a21c27 198- **check_updates_interval**: Look for new version every N seconds (default: every day).
199
200### Privacy
201
650a5f09
A
202- **default_private_links**: Check the private checkbox by default for every new Shaare.
203- **hide_public_links**: All Shaares are hidden while logged out.
91a21c27 204- **force_login**: if **hide_public_links** and this are set to `true`, all anonymous users are redirected to the login page.
205- **hide_timestamps**: Timestamps are hidden.
206- **remember_user_default**: Default state of the login page's *remember me* checkbox
207 - `true`: checked by default, `false`: unchecked by default
208
209### Feed
210
650a5f09 211- **rss_permalinks**: Enable this to redirect RSS links to Shaarli's permalinks instead of shaared URL.
91a21c27 212- **show_atom**: Display ATOM feed button.
213
214### Thumbnail
215
650a5f09 216- **enable_thumbnails**: Enable or disable thumbnail display.
91a21c27 217- **enable_localcache**: Enable or disable local cache.
5409ade2 218
91a21c27 219## Plugins configuration
fdf88d19 220
650a5f09 221See [Plugins](Plugins.md)