]>
Commit | Line | Data |
---|---|---|
992af0b9 | 1 | #Shaarli configuration |
4fd053d6 A |
2 | # Shaarli configuration |
3 | ||
992af0b9 V |
4 | ## Foreword |
5 | ||
6 | **Do not edit configuration options in index.php! Your changes would be lost.** | |
7 | ||
4fd053d6 A |
8 | Once your Shaarli instance is installed, the file `data/config.json.php` is generated: |
9 | * it contains all settings in JSON format, and can be edited to customize values | |
10 | * it defines which [plugins](Plugin-System) are enabled[(.html)]((.html).html) | |
992af0b9 | 11 | * its values override those defined in `index.php` |
4fd053d6 | 12 | * it is wrap in a PHP comment to prevent anyone accessing it, regardless of server configuration |
992af0b9 V |
13 | |
14 | ## File and directory permissions | |
4fd053d6 | 15 | |
992af0b9 V |
16 | The server process running Shaarli must have: |
17 | - `read` access to the following resources: | |
5409ade2 A |
18 | - PHP scripts: `index.php`, `application/*.php`, `plugins/*.php` |
19 | - 3rd party PHP and Javascript libraries: `inc/*.php`, `inc/*.js` | |
992af0b9 | 20 | - static assets: |
5409ade2 A |
21 | - CSS stylesheets: `inc/*.css` |
22 | - `images/*` | |
23 | - RainTPL templates: `tpl/*.html` | |
992af0b9 V |
24 | - `read`, `write` and `execution` access to the following directories: |
25 | - `cache` - thumbnail cache | |
26 | - `data` - link data store, configuration options | |
27 | - `pagecache` - Atom/RSS feed cache | |
28 | - `tmp` - RainTPL page cache | |
29 | ||
30 | On a Linux distribution: | |
31 | - the web server user will likely be `www` or `http` (for Apache2) | |
32 | - it will be a member of a group of the same name: `www:www`, `http:http` | |
33 | - to give it access to Shaarli, either: | |
34 | - unzip Shaarli in the default web server location (usually `/var/www/`) and set the web server user as the owner | |
35 | - put users in the same group as the web server, and set the appropriate access rights | |
4fd053d6 A |
36 | - if you have a domain / subdomain to serve Shaarli, [configure the server](Server-configuration) accordingly[(.html)]((.html).html) |
37 | ||
38 | ## Configuration | |
39 | ||
40 | In `data/config.json.php`. | |
41 | ||
42 | See also [Plugin System](Plugin-System.html).[](.html) | |
43 | ||
44 | ### Credentials | |
45 | ||
46 | > You shouldn't edit those. | |
47 | ||
48 | **login**: Login username. | |
49 | **hash**: Generated password hash. | |
50 | **salt**: Password salt. | |
51 | ||
52 | ### General | |
53 | ||
54 | **title**: Shaarli's instance title. | |
55 | **header_link**: Link to the homepage. | |
56 | **links_per_page**: Number of shaares displayed per page. | |
57 | **timezone**: See [the list of supported timezones](http://php.net/manual/en/timezones.php). [](.html) | |
58 | **enabled_plugins**: List of enabled plugins. | |
59 | ||
60 | ### Security | |
61 | ||
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 | ||
69 | ### Resources | |
70 | ||
71 | **data_dir**: Data directory. | |
72 | **datastore**: Shaarli's links database file path. | |
73 | **updates**: File path for the ran updates file. | |
74 | **log**: Log file path. | |
75 | **update_check**: Last update check file path. | |
76 | **raintpl_tpl**: Templates directory. | |
77 | **raintpl_tmp**: Template engine cache directory. | |
78 | **thumbnails_cache**: Thumbnails cache directory. | |
79 | **page_cache**: Shaarli's internal cache directory. | |
80 | **ban_file**: Banned IP file path. | |
81 | ||
82 | ### Updates | |
83 | ||
84 | **check_updates**: Enable or disable update check to the git repository. | |
85 | **check_updates_branch**: Git branch used to check updates (e.g. `stable` or `master`). | |
86 | **check_updates_interval**: Look for new version every N seconds (default: every day). | |
87 | ||
88 | ### Privacy | |
89 | ||
90 | **default_private_links**: Check the private checkbox by default for every new link. | |
91 | **hide_public_links**: All links are hidden while logged out. | |
92 | **hide_timestamps**: Timestamps are hidden. | |
93 | ||
94 | ### Feed | |
95 | ||
96 | **rss_permalinks**: Enable this to redirect RSS links to Shaarli's permalinks instead of shaared URL. | |
97 | **show_atom**: Display ATOM feed button. | |
98 | ||
99 | ### Thumbnail | |
100 | ||
101 | **enable_thumbnails**: Enable or disable thumbnail display. | |
102 | **enable_localcache**: Enable or disable local cache. | |
103 | ||
104 | ### Redirector | |
105 | ||
106 | **url**: Redirector URL, such as `anonym.to`. | |
107 | **encode_url**: Enable this if the redirector needs encoded URL to work properly. | |
108 | ||
109 | ## Configuration file example | |
110 | ||
111 | ```json | |
112 | <?php /* | |
113 | { | |
114 | "credentials": { | |
115 | "login": "<login>", | |
116 | "hash": "<password hash>", | |
117 | "salt": "<password salt>" | |
118 | }, | |
119 | "security": { | |
120 | "ban_after": 4, | |
121 | "session_protection_disabled": false, | |
122 | "ban_duration": 1800, | |
123 | "trusted_proxies": [[](.html) | |
124 | "1.2.3.4", | |
125 | "5.6.7.8" | |
126 | ] | |
127 | }, | |
128 | "resources": { | |
129 | "data_dir": "data", | |
130 | "config": "data\/config.php", | |
131 | "datastore": "data\/datastore.php", | |
132 | "ban_file": "data\/ipbans.php", | |
133 | "updates": "data\/updates.txt", | |
134 | "log": "data\/log.txt", | |
135 | "update_check": "data\/lastupdatecheck.txt", | |
136 | "raintpl_tmp": "tmp\/", | |
137 | "raintpl_tpl": "tpl\/", | |
138 | "thumbnails_cache": "cache", | |
139 | "page_cache": "pagecache" | |
140 | }, | |
141 | "general": { | |
142 | "check_updates": true, | |
143 | "rss_permalinks": true, | |
144 | "links_per_page": 20, | |
145 | "default_private_links": true, | |
146 | "enable_thumbnails": true, | |
147 | "enable_localcache": true, | |
148 | "check_updates_branch": "stable", | |
149 | "check_updates_interval": 86400, | |
150 | "enabled_plugins": [[](.html) | |
151 | "markdown", | |
152 | "wallabag", | |
153 | "archiveorg" | |
154 | ], | |
155 | "timezone": "Europe\/Paris", | |
156 | "title": "My Shaarli", | |
157 | "header_link": "?" | |
158 | }, | |
159 | "extras": { | |
160 | "show_atom": false, | |
161 | "hide_public_links": false, | |
162 | "hide_timestamps": false, | |
163 | "open_shaarli": false, | |
164 | "redirector": "http://anonym.to/?", | |
165 | "redirector_encode_url": false | |
166 | }, | |
167 | "general": { | |
168 | "header_link": "?", | |
169 | "links_per_page": 20, | |
170 | "enabled_plugins": [[](.html) | |
171 | "markdown", | |
172 | "wallabag" | |
173 | ], | |
174 | "timezone": "Europe\/Paris", | |
175 | "title": "My Shaarli" | |
176 | }, | |
177 | "updates": { | |
178 | "check_updates": true, | |
179 | "check_updates_branch": "stable", | |
180 | "check_updates_interval": 86400 | |
181 | }, | |
182 | "feed": { | |
183 | "rss_permalinks": true, | |
184 | "show_atom": false | |
185 | }, | |
186 | "privacy": { | |
187 | "default_private_links": true, | |
188 | "hide_public_links": false, | |
189 | "hide_timestamps": false | |
190 | }, | |
191 | "thumbnail": { | |
192 | "enable_thumbnails": true, | |
193 | "enable_localcache": true | |
194 | }, | |
195 | "redirector": { | |
196 | "url": "http://anonym.to/?", | |
197 | "encode_url": false | |
198 | }, | |
199 | "plugins": { | |
200 | "WALLABAG_URL": "http://demo.wallabag.org", | |
201 | "WALLABAG_VERSION": "1" | |
202 | } | |
203 | } ?> | |
992af0b9 | 204 | ``` |
5409ade2 A |
205 | |
206 | ## Additional configuration | |
207 | ||
4fd053d6 A |
208 | The playvideos plugin may require that you adapt your server's |
209 | [Content Security Policy](https://github.com/shaarli/Shaarli/blob/master/plugins/playvideos/README.md#troubleshooting) [](.html) | |
210 | configuration to work properly.[(.html)]((.html).html) | |
211 |