aboutsummaryrefslogtreecommitdiffhomepage
path: root/doc/Home.html
diff options
context:
space:
mode:
authorVirtualTam <virtualtam@flibidi.net>2015-08-04 16:07:13 +0200
committerVirtualTam <virtualtam@flibidi.net>2015-08-04 16:07:13 +0200
commit27cf2e671d1f35bd8c9383d008cd3733fc1c6e0d (patch)
tree4726baf18e7057eac3f9b6bdb5991fe6117814fc /doc/Home.html
parent96db105e4c0833324f7168edb5673278de8ccd54 (diff)
parent992af0b9d77cb4fbac2c37ef8d5896042d67a2a3 (diff)
downloadShaarli-27cf2e671d1f35bd8c9383d008cd3733fc1c6e0d.tar.gz
Shaarli-27cf2e671d1f35bd8c9383d008cd3733fc1c6e0d.tar.zst
Shaarli-27cf2e671d1f35bd8c9383d008cd3733fc1c6e0d.zip
Merge pull request #294 from virtualtam/doc/update
Doc: sync from Wiki, generate HTML
Diffstat (limited to 'doc/Home.html')
-rw-r--r--doc/Home.html429
1 files changed, 40 insertions, 389 deletions
diff --git a/doc/Home.html b/doc/Home.html
index 2cb54c86..37d62e8b 100644
--- a/doc/Home.html
+++ b/doc/Home.html
@@ -4,7 +4,7 @@
4 <meta charset="utf-8"> 4 <meta charset="utf-8">
5 <meta name="generator" content="pandoc"> 5 <meta name="generator" content="pandoc">
6 <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes"> 6 <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">
7 <title></title> 7 <title>Shaarli - Home</title>
8 <style type="text/css">code{white-space: pre;}</style> 8 <style type="text/css">code{white-space: pre;}</style>
9 <!--[if lt IE 9]> 9 <!--[if lt IE 9]>
10 <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script> 10 <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
@@ -12,404 +12,55 @@
12 <link rel="stylesheet" href="github-markdown.css"> 12 <link rel="stylesheet" href="github-markdown.css">
13</head> 13</head>
14<body> 14<body>
15<h1 id="shaarli-wiki">Shaarli wiki</h1> 15<div id="local-sidebar">
16<p>Welcome to the <a href="https://github.com/shaarli/Shaarli/">Shaarli</a> wiki! Here you can find some info on how to use, configure, tweak and solve problems with your Shaarli. For general info, read the <a href="https://github.com/shaarli/Shaarli/blob/master/README.md">README</a>.</p>
17<p>If you have any questions or ideas, please join the <a href="https://gitter.im/shaarli/Shaarli">chat</a> (also reachable via <a href="https://irc.gitter.im/">IRC</a>), post them in our <a href="https://github.com/shaarli/Shaarli/issues/44">general discussion</a> or read the current <a href="https://github.com/shaarli/Shaarli/issues">issues</a>. If you've found a bug, please create a <a href="https://github.com/shaarli/Shaarli/issues/new">new issue</a>. If you would like a feature added to Shaarli, check the issues labeled <a href="https://github.com/shaarli/Shaarli/labels/feature"><code>feature</code></a>, <a href="https://github.com/shaarli/Shaarli/labels/enhancement"><code>enhancement</code></a>, and <a href="https://github.com/shaarli/Shaarli/labels/plugin"><code>plugin</code></a>.</p>
18<p><em>Note: This documentation is available online at <a href="https://github.com/shaarli/Shaarli/wiki">https://github.com/shaarli/Shaarli/wiki</a>, and locally in the <code>doc/</code> directory of your Shaarli installation.</em></p>
19<hr />
20<!-- MarkdownTOC depth=3 -->
21
22
23<ul> 16<ul>
24<li><p><a href="#basic-usage">Basic Usage</a></p> 17<li><a href="Home.html">Home</a></li>
18<li>Installation
25<ul> 19<ul>
26<li><a href="#add-the-sharing-button-_bookmarklet_-to-your-browser">Add the sharing button (<em>bookmarklet</em>) to your browser</a><br /></li> 20<li><a href="Server-requirements.html">Server requirements</a></li>
27<li><a href="#add-shaarli-as-a-sharing-service-to-firefox">Add Shaarli as a sharing service to Firefox</a><br /></li> 21<li><a href="Server-configuration.html">Server configuration</a></li>
28<li><a href="#share-links-using-the-_bookmarklet_">Share links using the <em>bookmarklet</em></a><br /></li> 22<li><a href="Shaarli-configuration.html">Shaarli configuration</a></li>
29<li><a href="#sharing-links-using-firefox-share">Sharing links using Firefox share</a><br /></li>
30</ul></li> 23</ul></li>
31<li><p><a href="#other-usage-examples">Other usage examples</a></p> 24<li><a href="Usage.html">Usage</a>
32<ul> 25<ul>
33<li><a href="#using-shaarli-as-a-blog-notepad-pastebin">Using Shaarli as a blog, notepad, pastebin...</a><br /></li> 26<li><a href="Sharing-button.html">Sharing button</a> (bookmarklet)</li>
34<li><a href="#rss-feeds-or-picture-wall-for-a-specific-searchtag">RSS Feeds or Picture Wall for a specific search/tag</a><br /></li> 27<li><a href="Firefox-share.html">Firefox share</a></li>
28<li><a href="RSS-feeds.html">RSS feeds</a></li>
35</ul></li> 29</ul></li>
36<li><p><a href="#configuration">Configuration</a></p> 30<li>How To
37<ul> 31<ul>
38<li><a href="#main-dataoptionsphp-file">Main data/options.php file</a><br /></li> 32<li><a href="Backup,-restore,-import-and-export.html">Backup, restore, import and export</a></li>
39<li><a href="#changing-theme">Changing theme</a><br /></li> 33<li><a href="Copy-an-existing-installation-over-SSH-and-serve-it-locally.html">Copy an existing installation over SSH and serve it locally</a></li>
40<li><a href="#changing-template">Changing template</a><br /></li> 34<li><a href="Download-CSS-styles-from-an-OPML-list.html">Download CSS styles from an OPML list</a></li>
41</ul></li> 35</ul></li>
42<li><a href="#backup">Backup</a><br /></li> 36<li><a href="Troubleshooting.html">Troubleshooting</a></li>
43<li><p><a href="#troubleshooting">Troubleshooting</a></p> 37<li><a href="Development.html">Development</a>
44<ul> 38<ul>
45<li><a href="#i-forgot-my-password-">I forgot my password !</a><br /></li> 39<li><a href="GnuPG-signature.html">GnuPG signature</a></li>
46<li><a href="#im-locked-out---login-bruteforce-protection">I'm locked out - Login bruteforce protection</a><br /></li> 40<li><a href="Coding-guidelines.html">Coding guidelines</a></li>
47<li><a href="#list-of-all-login-attempts">List of all login attempts</a><br /></li> 41<li><a href="Directory-structure.html">Directory structure</a></li>
48<li><a href="#exporting-from-diigo">Exporting from Diigo</a><br /></li> 42<li><a href="3rd-party-libraries.html">3rd party libraries</a></li>
49<li><a href="#importing-from-semanticscuttle">Importing from SemanticScuttle</a><br /></li> 43<li><a href="Plugin-System.html">Plugin System</a></li>
50<li><a href="#importing-from-mister-wong">Importing from Mister Wong</a><br /></li> 44<li><a href="Security.html">Security</a></li>
51<li><a href="#hosting-problems">Hosting problems</a><br /></li> 45<li><a href="Static-analysis.html">Static analysis</a></li>
52<li><a href="#dates-are-not-properly-formatted">Dates are not properly formatted</a><br /></li> 46<li><a href="Theming.html">Theming</a></li>
53<li><a href="#problems-on-centos-servers">Problems on CentOS servers</a><br /></li> 47<li><a href="Unit-tests.html">Unit tests</a></li>
54<li><a href="#my-session-expires--i-cant-stay-logged-in">My session expires ! I can't stay logged in</a><br /></li>
55<li><a href="#sessions-do-not-seem-to-work-correctly-on-your-server"><code>Sessions do not seem to work correctly on your server</code></a><br /></li>
56<li><a href="#pubsubhubbub-support">pubsubhubbub support</a><br /></li>
57</ul></li> 48</ul></li>
58<li><p><a href="#notes">Notes</a></p> 49<li>About
59<ul> 50<ul>
60<li><a href="#various-hacks">Various hacks</a><br /></li> 51<li><a href="FAQ.html">FAQ</a></li>
61<li><a href="#changing-timestamp-for-a-link">Changing timestamp for a link</a><br /></li> 52<li><a href="Community-&amp;-Related-software.html">Community &amp; Related software</a></li>
53<li><a href="TODO.html">TODO</a></li>
62</ul></li> 54</ul></li>
63<li><p><a href="#related-software">Related software</a></p>
64<ul>
65<li><a href="#server-apps">Server apps</a><br /></li>
66<li><a href="#android-apps">Android apps</a><br /></li>
67<li><a href="#themes--templates">Themes &amp; templates</a><br /></li>
68<li><a href="#integrate-shaarli-with-other-platforms">Integrate Shaarli with other platforms</a><br /></li>
69<li><a href="#alternative-to-shaarli">Alternative to Shaarli</a><br /></li>
70</ul></li>
71<li><a href="#other-links">Other links</a><br /></li>
72<li><p><a href="#faq">FAQ</a></p>
73<ul>
74<li><a href="#why-did-you-create-shaarli-">Why did you create Shaarli ?</a><br /></li>
75<li><a href="#why-use-shaarli-and-not-deliciousdiigo-">Why use Shaarli and not Delicious/Diigo ?</a><br /></li>
76<li><a href="#what-does-shaarli-mean-">What does Shaarli mean ?</a><br /></li>
77</ul></li>
78<li><p><a href="#technical-details">Technical details</a></p>
79<ul>
80<li><a href="#directory-structure">Directory structure</a><br /></li>
81<li><a href="#development">Development</a><br /></li>
82<li><a href="#why-not-use-a-real-database--files-are-slow-">Why not use a real database ? Files are slow !</a><br /></li>
83</ul></li>
84<li><p><a href="#wiki---todo">Wiki - TODO</a></p></li>
85</ul>
86<!-- /MarkdownTOC -->
87
88
89
90
91<hr />
92<h1 id="basic-usage">Basic Usage</h1>
93<h3 id="add-the-sharing-button-bookmarklet-to-your-browser">Add the sharing button (<em>bookmarklet</em>) to your browser</h3>
94<ul>
95<li>Open your Shaarli and <code>Login</code><br /></li>
96<li>Click the <code>Tools</code> button in the top bar<br /></li>
97<li>Drag the <strong><code>✚Shaare link</code> button</strong>, and drop it to your browser's bookmarks bar.</li>
98</ul>
99<p><em>This bookmarklet button in compatible with Firefox, Opera, Chrome and Safari. Under Opera, you can't drag'n drop the button: You have to right-click on it and add a bookmark to your personal toolbar.</em></p>
100<p><img src="images/bookmarklet.png" /></p>
101<h3 id="add-shaarli-as-a-sharing-service-to-firefox">Add Shaarli as a sharing service to Firefox</h3>
102<ul>
103<li>Open your Shaarli and <code>Login</code><br /></li>
104<li>Click the <code>Tools</code> button in the top bar<br /></li>
105<li>Click the <code>✚Add to Firefox social</code> button and accept the activation.</li>
106</ul>
107<h3 id="share-links-using-the-bookmarklet">Share links using the <em>bookmarklet</em></h3>
108<ul>
109<li>When you are visiting a webpage you would like to share with Shaarli, click the <em>bookmarklet</em> you just added.<br /></li>
110<li>A window opens.<br /></li>
111<li>You can freely edit title, description, tags... to find it later using the text search or tag filtering.<br /></li>
112<li>You will be able to edit this link later using the <img src="https://raw.githubusercontent.com/shaarli/Shaarli/master/images/edit_icon.png" /> edit button.<br /></li>
113<li>You can also check the “Private” box so that the link is saved but only visible to you.<br /></li>
114<li>Click <code>Save</code>.<strong>Voila! Your link is now shared.</strong></li>
115</ul>
116<h3 id="sharing-links-using-firefox-share">Sharing links using Firefox share</h3>
117<ul>
118<li>Add the sharing service as described above<br /></li>
119<li>When you are visiting a webpage you would like to share with Shaarli, click the Firefox <em>Share</em> button [[images/firefoxshare.png]]<br /></li>
120<li>You can edit your link before and after saving, just like the bookmarklet above.</li>
121</ul>
122<h1 id="other-usage-examples">Other usage examples</h1>
123<p>Shaarli can be used:</p>
124<ul>
125<li>to share, comment and save interesting links and news<br /></li>
126<li>to bookmark useful/frequent personal links (as private links) and share them between computers<br /></li>
127<li>as a minimal blog/microblog/writing platform (no character limit)<br /></li>
128<li>as a read-it-later list (for example items tagged <code>readlater</code>)<br /></li>
129<li>to draft and save articles/ideas<br /></li>
130<li>to keep code snippets<br /></li>
131<li>to keep notes and documentation<br /></li>
132<li>as a shared clipboard between machines<br /></li>
133<li>as a todo list<br /></li>
134<li>to store playlists (e.g. with the <code>music</code> or <code>video</code> tags)<br /></li>
135<li>to keep extracts/comments from webpages that may disappear<br /></li>
136<li>to keep track of ongoing discussions (for example items tagged <code>discussion</code>)<br /></li>
137<li><a href="http://shaarli.chassegnouf.net/?9Efeiw">to feed RSS aggregators</a> (planets) with specific tags<br /></li>
138<li>to feed other social networks, blogs... using RSS feeds and external services (dlvr.it, ifttt.com ...)</li>
139</ul>
140<h3 id="using-shaarli-as-a-blog-notepad-pastebin...">Using Shaarli as a blog, notepad, pastebin...</h3>
141<ul>
142<li>Go to your Shaarli setup and log in<br /></li>
143<li>Click the <code>Add Link</code> button<br /></li>
144<li>To share text only, do not enter any URL in the corresponding input field and click <code>Add Link</code><br /></li>
145<li>Pick a title and enter your article, or note, in the description field; add a few tags; optionally check <code>Private</code> then click <code>Save</code><br /></li>
146<li>Voilà! Your article is now published (privately if you selected that option) and accessible using its permalink.</li>
147</ul>
148<h3 id="rss-feeds-or-picture-wall-for-a-specific-searchtag">RSS Feeds or Picture Wall for a specific search/tag</h3>
149<p>It is possible to filter RSS/ATOM feeds and Picture Wall on a Shaarli to <strong>only display results of a specific search, or for a specific tag</strong>. For example, if you want to subscribe only to links tagged <code>photography</code>:</p>
150<ul>
151<li>Go to the desired Shaarli instance.<br /></li>
152<li>Search for the <code>photography</code> tag in the <em>Filter by tag</em> box. Links tagged <code>photography</code> are displayed.<br /></li>
153<li>Click on the <code>RSS Feed</code> button.<br /></li>
154<li>You are presented with an RSS feed showing only these links. Subscribe to it to receive only updates with this tag.<br /></li>
155<li>The same method <strong>also works for a full-text search</strong> (<em>Search</em> box) <strong>and for the Picture Wall</strong> (want to only see pictures about <code>nature</code>?)<br /></li>
156<li>You can also build the URL manually: <code>https://my.shaarli.domain/?do=rss&amp;searchtags=nature</code>, <code>https://my.shaarli.domain/links/?do=picwall&amp;searchterm=poney</code></li>
157</ul>
158<p><img src="images/rss-filter-1.png" /> <img src="images/rss-filter-2.png" /></p>
159<h1 id="configuration">Configuration</h1>
160<h3 id="main-dataoptions.php-file">Main data/options.php file</h3>
161<p>To change the configuration, create the file <code>data/options.php</code>, example:</p>
162<pre><code> &lt;?php
163 $GLOBALS[&#39;config&#39;][&#39;LINKS_PER_PAGE&#39;] = 30;
164 $GLOBALS[&#39;config&#39;][&#39;HIDE_TIMESTAMPS&#39;] = true;
165 $GLOBALS[&#39;config&#39;][&#39;ENABLE_THUMBNAILS&#39;] = false;
166 ?&gt;</code></pre>
167<p><strong>Do not edit config options in index.php! Your changes would be lost when you upgrade.</strong> The following parameters are available (parameters (default value)):</p>
168<ul>
169<li><code>DATADIR ('data')</code> : This is the name of the subdirectory where Shaarli stores is data file. You can change it for better security.<br /></li>
170<li><code>CONFIG_FILE ($GLOBALS['config']['DATADIR'].'/config.php')</code> : Name of file which is used to store login/password.<br /></li>
171<li><code>DATASTORE ($GLOBALS['config']['DATADIR'].'/datastore.php')</code> : Name of file which contains the link database.<br /></li>
172<li><code>LINKS_PER_PAGE (20)</code> : Default number of links per page displayed.<br /></li>
173<li><code>IPBANS_FILENAME ($GLOBALS['config']['DATADIR'].'/ipbans.php')</code> : Name of file which records login attempts and IP bans.<br /></li>
174<li><code>BAN_AFTER (4)</code> : An IP address will be banned after this many failed login attempts.<br /></li>
175<li><code>BAN_DURATION (1800)</code> : Duration of ban (in seconds). (1800 seconds = 30 minutes)<br /></li>
176<li><code>OPEN_SHAARLI (false)</code> : If you set this option to true, anyone will be able to add/modify/delete/import/exports links without having to login.<br /></li>
177<li><code>HIDE_TIMESTAMPS (false)</code> : If you set this option to true, the date/time of each link will not be displayed (including in RSS Feed).#related-software<br /></li>
178<li><code>ENABLE_THUMBNAILS (true)</code> : Enable/disable thumbnails.<br /></li>
179<li><code>RAINTPL_TMP (tmp/)</code> : Raintpl cache directory (keep the trailing slash!)<br /></li>
180<li><code>RAINTPL_TPL (tpl/)</code> : Raintpl template directory (keep the trailing slash!). Edit this option if you want to change the rendering template (page structure) used by Shaarli. See <a href="#changing-template">Changing template</a><br /></li>
181<li><code>CACHEDIR ('cache')</code> : Directory where the thumbnails are stored.<br /></li>
182<li><code>ENABLE_LOCALCACHE (true)</code> : If you have a limited quota on your webspace, you can set this option to false: Shaarli will not generate thumbnails which need to be cached locally (vimeo, flickr, etc.). Thumbnails will still be visible for the services which do not use the local cache (youtube.com, imgur.com, dailymotion.com, imageshack.us)<br /></li>
183<li><code>UPDATECHECK_FILENAME ($GLOBALS['config']['DATADIR'].'/lastupdatecheck.txt')</code> : name of the file used to store available shaarli version.<br /></li>
184<li><code>UPDATECHECK_INTERVAL (86400)</code> : Delay between new Shaarli version check. 86400 seconds = 24 hours. Note that if you do not login for a week, Shaarli will not check for new version for a week.<br /></li>
185<li><code>ENABLE_UPDATECHECK</code>: Determines whether Shaarli check for new releases at <a href="https://github.com/shaarli/Shaarli">https://github.com/shaarli/Shaarli</a><br /></li>
186<li><code>SHOW_ATOM (false)</code> : Show an <code>ATOM Feed</code> button next to the <code>Subscribe</code> (RSS) button. ATOM feeds are available at the address <code>?do=atom</code> regardless of this option.<br /></li>
187<li><code>ARCHIVE_ORG (false)</code> : For each link, display a link to an archived version on archive.org<br /></li>
188<li><code>ENABLE_RSS_PERMALINKS (true)</code>: choose whether the RSS item title link points directly to the link, or to the entry on Shaarli (permalink). <code>true</code> is the original Shaarli bahevior (point directly to the link)<br /></li>
189<li><code>HIDE_PUBLIC_LINKS (false)</code>: setting this to true hides all links, even public ones, for non-logged in users.</li>
190</ul>
191<h3 id="changing-theme">Changing theme</h3>
192<ul>
193<li>Shaarli's apparence can be modified by editing CSS rules in <code>inc/user.css</code>. This file allows to override rules defined in the main <code>inc/shaarli.css</code> (only add changed rules), or define a whole new theme.<br /></li>
194<li>Do not edit <code>inc/shaarli.css</code>! Your changes would be overriden when updating Shaarli.<br /></li>
195<li>Some themes are available at <a href="https://github.com/shaarli/shaarli-themes">https://github.com/shaarli/shaarli-themes</a>.</li>
196</ul>
197<p>See also:</p>
198<ul>
199<li><a href="https://github.com/shaarli/Shaarli/wiki/Download-CSS-styles-for-shaarlis-listed-in-an-opml-file">Download CSS styles for shaarlis listed in an opml file</a></li>
200</ul>
201<h3 id="changing-template">Changing template</h3>
202<p>| WARNING | This feature is currently being worked on and will be improved in the next releases. Experimental. |<br />|---------|---------|</p>
203<ul>
204<li>Find the template you'd like to install. See the list of available templates (TODO). Find it's git clone URL or download the zip archive for the template.<br /></li>
205<li>In your Shaarli <code>tpl/</code> directory, run <code>git clone https://url/of/my-template/</code> or unpack the zip archive. There should now be a <code>my-template/</code> directory under the <code>tpl/</code> dir, containing directly all the template files.<br /></li>
206<li>Edit <code>data/options.php</code> to have Shaarli use this template. Eg.</li>
207</ul>
208<p><code>$GLOBALS['config']['RAINTPL_TPL'] = 'tpl/my-template/' ;</code></p>
209<p>You can find a list of compatible templates in <a href="#related-software">Related Software</a></p>
210<h1 id="backup">Backup</h1>
211<p>You have two ways of backing up your database:</p>
212<ul>
213<li><strong>Backup the file <code>data/datastore.php</code></strong> (by FTP or SSH). Restore by putting the file back in place.<br /></li>
214<li>Example command: <code>rsync -avzP my.server.com:/var/www/shaarli/data/datastore.php datastore-$(date +%Y-%m-%d_%H%M).php</code><br /></li>
215<li><strong>Export your links as HTML</strong> (Menu <code>Tools</code> &gt; <code>Export</code>). Restore by using the <code>Import</code> feature.<br /></li>
216<li>This can be done using the <a href="https://github.com/nodiscc/shaarchiver">shaarchiver</a> tool. Example command: <code>./export-bookmarks.py --url=https://my.server.com/shaarli --username=myusername --password=mysupersecretpassword --download-dir=./ --type=all</code></li>
217</ul>
218<h1 id="troubleshooting">Troubleshooting</h1>
219<h3 id="i-forgot-my-password">I forgot my password !</h3>
220<p>Delete the file data/config.php and display the page again. You will be asked for a new login/password.</p>
221<h3 id="im-locked-out---login-bruteforce-protection">I'm locked out - Login bruteforce protection</h3>
222<p>Login form is protected against brute force attacks: 4 failed logins will ban the IP address from login for 30 minutes. Banned IPs can still browse links.</p>
223<p>To remove the current IP bans, delete the file <code>data/ipbans.php</code></p>
224<h3 id="list-of-all-login-attempts">List of all login attempts</h3>
225<p>The file <code>data/log.txt</code> shows all logins (successful or failed) and bans/lifted bans.<br />Search for <code>failed</code> in this file to look for unauthorized login attempts.</p>
226<h3 id="exporting-from-diigo">Exporting from Diigo</h3>
227<p>If you export your bookmark from Diigo, make sure you use the Delicious export, not the Netscape export. (Their Netscape export is broken, and they don't seem to be interested in fixing it.)</p>
228<h3 id="importing-from-semanticscuttle">Importing from SemanticScuttle</h3>
229<p>To correctly import the tags from a <a href="http://semanticscuttle.sourceforge.net/">SemanticScuttle</a> HTML export, edit the HTML file before importing and replace all occurences of <code>tags=</code> (lowercase) to <code>TAGS=</code> (uppercase).</p>
230<h3 id="importing-from-mister-wong">Importing from Mister Wong</h3>
231<p>See <a href="https://github.com/sebsauvage/Shaarli/issues/146">this issue</a> for import tweaks.</p>
232<h3 id="hosting-problems">Hosting problems</h3>
233<ul>
234<li>On <strong>free.fr</strong> : Please note that free uses php 5.1 and thus you will not have autocomplete in tag editing. Don't forget to create a <code>sessions</code> directory at the root of your webspace. Change the file extension to <code>.php5</code> or create a <code>.htaccess</code> file in the directory where Shaarli is located containing:</li>
235</ul>
236<pre><code>php 1
237SetEnv PHP_VER 5</code></pre>
238<ul>
239<li>If you have an error such as: <code>Parse error: syntax error, unexpected '=', expecting '(' in /links/index.php on line xxx</code>, it means that your host is using php4, not php5. Shaarli requires php 5.1. Try changing the file extension to <code>.php5</code><br /></li>
240<li>On <strong>1and1</strong> : If you add the link from the page (and not from the bookmarklet), Shaarli will no be able to get the title of the page. You will have to enter it manually. (Because they have disabled the ability to download a file through HTTP).<br /></li>
241<li>If you have the error <code>Warning: file_get_contents() [function.file-get-contents]: URL file-access is disabled in the server configuration in /…/index.php on line xxx</code>, it means that your host has disabled the ability to fetch a file by HTTP in the php config (Typically in 1and1 hosting). Bad host. Change host. Or comment the following lines:</li>
242</ul>
243<pre><code>//list($status,$headers,$data) = getHTTP($url,4); // Short timeout to keep the application responsive.
244// FIXME: Decode charset according to charset specified in either 1) HTTP response headers or 2) &lt;head&gt; in html
245//if (strpos($status,&#39;200 OK&#39;)) $title=html_extract_title($data);</code></pre>
246<ul>
247<li>On hosts which forbid outgoing HTTP requests (such as free.fr), some thumbnails will not work.<br /></li>
248<li>On <strong>lost-oasis</strong>, RSS doesn't work correctly, because of this message at the begining of the RSS/ATOM feed : <code>&lt;? // tout ce qui est charge ici (generalement des includes et require) est charge en permanence. ?&gt;</code>. To fix this, remove this message from <code>php-include/prepend.php</code></li>
249</ul>
250<h3 id="dates-are-not-properly-formatted">Dates are not properly formatted</h3>
251<p>Shaarli tries to sniff the language of the browser (using HTTP_ACCEPT_LANGUAGE headers) and choose a date format accordingly. But Shaarli can only use the date formats (and more generaly speaking, the locales) provided by the webserver. So even if you have a browser in French, you may end up with dates in US format (it's the case on sebsauvage.net :-( )</p>
252<h3 id="problems-on-centos-servers">Problems on CentOS servers</h3>
253<p>On <strong>CentOS</strong>/RedHat derivatives, you may need to install the <code>php-mbstring</code> package.</p>
254<h3 id="my-session-expires-i-cant-stay-logged-in">My session expires ! I can't stay logged in</h3>
255<p>This can be caused by several things:</p>
256<ul>
257<li>Your php installation may not have a proper directory setup for session files. (eg. on Free.fr you need to create a <code>session</code> directory on the root of your website.) You may need to create the session directory of set it up.<br /></li>
258<li>Most hosts regularly clean the temporary and session directories. Your host may be cleaning those directories too aggressively (eg.OVH hosts), forcing an expire of the session. You may want to set the session directory in your web root. (eg. Create the <code>sessions</code> subdirectory and add <code>ini_set('session.save_path', $_SERVER['DOCUMENT_ROOT'].'/../sessions');</code>. Make sure this directory is not browsable !)<br /></li>
259<li>If your IP address changes during surfing, Shaarli will force expire your session for security reasons (to prevent session cookie hijacking). This can happen when surfing from WiFi or 3G (you may have switched WiFi/3G access point), or in some corporate/university proxies which use load balancing (and may have proxies with several external IP addresses).<br /></li>
260<li>Some browser addons may interfer with HTTP headers (ipfuck/ipflood/GreaseMonkey…). Try disabling those.<br /></li>
261<li>You may be using OperaTurbo or OperaMini, which use their own proxies which may change from time to time.<br /></li>
262<li>If you have another application on the same webserver where Shaarli is installed, these application may forcefully expire php sessions.</li>
263</ul>
264<h3 id="sessions-do-not-seem-to-work-correctly-on-your-server"><code>Sessions do not seem to work correctly on your server</code></h3>
265<p>Follow the instructions in the error message. Make sure you are accessing shaarli via a direct IP address or a proper hostname. If you have <strong>no dots</strong> in the hostname (e.g. <code>localhost</code> or <code>http://my-webserver/shaarli/</code>), some browsers will not store cookies at all (this respects the <a href="http://curl.haxx.se/rfc/cookie_spec.html">HTTP cookie specification</a>).</p>
266<h3 id="pubsubhubbub-support">pubsubhubbub support</h3>
267<p>Download <a href="https://pubsubhubbub.googlecode.com/git/publisher_clients/php/library/publisher.php">publisher.php</a> at the root of your Shaarli installation and set <code>$GLOBALS['config']['PUBSUBHUB_URL']</code> in your <code>config.php</code></p>
268<h1 id="notes">Notes</h1>
269<h3 id="various-hacks">Various hacks</h3>
270<ul>
271<li><a href="Example-patch---add-new-via-field-for-links">Example patch: add a new &quot;via&quot; field for links</a><br /></li>
272<li><a href="Copy-a-Shaarli-installation-over-SSH-SCP,-serve-it-locally-with-php-cli">Copy a Shaarli installation over SSH SCP, serve it locally with php cli</a><br /></li>
273<li><p>To display the array representing the data saved in datastore.php, use the following snippet</p>
274<pre><code>$data = &quot;tZNdb9MwFIb... &lt;Commented content inside datastore.php&gt;&quot;;
275$out = unserialize(gzinflate(base64_decode($data)));
276echo &quot;&lt;pre&gt;&quot;; // Pretty printing is love, pretty printing is life
277print_r($out);
278echo &quot;&lt;/pre&gt;&quot;;
279exit;</code></pre>
280<p>This will output the internal representation of the datastore, &quot;unobfuscated&quot; (if this can really be considered obfuscation)</p></li>
281</ul>
282<h3 id="changing-timestamp-for-a-link">Changing timestamp for a link</h3>
283<ul>
284<li>Look for <code>&lt;input type=&quot;hidden&quot; name=&quot;lf_linkdate&quot; value=&quot;{$link.linkdate}&quot;&gt;</code> in <code>tpl/editlink.tpl</code> (line 14)<br /></li>
285<li>Remove <code>type=&quot;hidden&quot;</code> from this line<br /></li>
286<li>A new date/time field becomes available in the edit/new link dialog. You can set the timestamp manually by entering it in the format <code>YYYMMDD_HHMMS</code>.</li>
287</ul>
288<h1 id="related-software">Related software</h1>
289<p>Unofficial but relatedd work on Shaarli. If you maintain one of these, please get in touch with us to help us find a way to adapt your work to our fork. <strong>TODO</strong> contact repos owners to see if they'd like to standardize their work for the community fork.</p>
290<h3 id="server-apps">Server apps</h3>
291<ul>
292<li><a href="https://github.com/nodiscc/shaarchiver">shaarchiver</a> - Archive your Shaarli bookmarks and their content<br /></li>
293<li><a href="https://github.com/mknexen/shaarli-river">shaarli-river</a> - An aggregator for shaarlis with many features<br /></li>
294<li><a href="https://github.com/DMeloni/shaarlo">Shaarlo</a> - An aggregator for shaarlis with many features (a very popular running instance among french shaarliers: <a href="http://shaarli.fr/">shaarli.fr</a>)<br /></li>
295<li><a href="https://github.com/BoboTiG/shaarlimages">Shaarlimages</a> - An image-oriented aggregator for Shaarlis<br /></li>
296<li><a href="https://github.com/mknexen/shaarli-api">mknexen/shaarli-api</a> - A REST API for Shaarli</li>
297</ul>
298<h3 id="android-apps">Android apps</h3>
299<ul>
300<li><a href="http://sebsauvage.net/links/?ZAyDzg">Shaarli for Android</a> - Android application that adds Shaarli as a sharing provider<br /></li>
301<li><a href="https://github.com/dimtion/Shaarlier">Shaarlier for Android</a> - Android application to simply add links directly into your Shaarli</li>
302</ul>
303<h3 id="themes-templates">Themes &amp; templates</h3>
304<ul>
305<li><a href="https://github.com/AkibaTech/Shaarli---SuperHero-Theme">AkibaTech/Shaarli Superhero Theme</a> - A template/theme for Shaarli<br /></li>
306<li><a href="https://github.com/alexisju/albinomouse-template">alexisju/albinomouse-template</a> - A full template for Shaarli<br /></li>
307<li><a href="https://github.com/dhoko/ShaarliTemplate">dhoko/ShaarliTemplate</a> - A template/theme for Shaarli<br /></li>
308<li><a href="https://github.com/kalvn/shaarli-blocks">kalvn/shaarli-blocks</a> - A template/theme for Shaarli<br /></li>
309<li><a href="https://github.com/kalvn/Shaarli-Material">kalvn/Shaarli-Material</a> - A theme (template) based on Google's Material Design for Shaarli, the superfast delicious clone.<br /></li>
310<li><a href="https://github.com/misterair/limonade">misterair/Limonade</a> - A fork of (legacy) Shaarli with a new template<br /></li>
311<li><a href="https://github.com/Vinm/Blue-theme-for-Shaarli">Vinm/Blue-theme-for Shaarli</a> - A template/theme for Shaarli (<a href="https://github.com/Vinm/Blue-theme-for-Shaarli/issues/2">unmaintained</a>, compatibility unknown)<br /></li>
312<li><a href="https://github.com/vivienhaese/shaarlitheme">vivienhaese/shaarlitheme</a> - A Shaarli fork meant to be run in an openshift instance</li>
313</ul>
314<h3 id="integrate-shaarli-with-other-platforms">Integrate Shaarli with other platforms</h3>
315<ul>
316<li><a href="https://github.com/jcsaaddupuy/tt-rss-shaarli">tt-rss-shaarli</a> - <a href="http://tt-rss.org/">TinyTiny RSS</a> plugin that adds support for sharing articles with Shaarli<br /></li>
317<li><a href="https://github.com/ahmet2mir/octopress-shaarli">octopress-shaarli</a> - octoprress plugin to retrieve SHaarli links on the sidebara</li>
318</ul>
319<h3 id="alternative-to-shaarli">Alternative to Shaarli</h3>
320<ul>
321<li><a href="https://github.com/bookieio/bookie">Bookie</a> - Another self-hostable, Free bookmark sharing software, written in Python<br /></li>
322<li><a href="https://github.com/plainmade/unmark">Unmark</a> - An open source to do app for bookmarks (<a href="https://unmark.it/">Homepage</a>)</li>
323</ul>
324<h1 id="other-links">Other links</h1>
325<ul>
326<li><a href="http://sebsauvage.net/links/">Liens en vrac de sebsauvage</a> - the original Shaarli<br /></li>
327<li><a href="http://porneia.free.fr/pub/links/ou-est-shaarli.html">A large list of Shaarlis</a><br /></li>
328<li><a href="https://raw.githubusercontent.com/Oros42/find_shaarlis/master/annuaires.json">A list of working Shaarli aggregators</a><br /></li>
329<li><a href="https://github.com/Oros42/shaarlis_list">A list of some known Shaarlis</a><br /></li>
330<li><a href="http://sebsauvage.net/rhaa/index.php?2011/09/16/09/29/58-adieu-delicious-diigo-et-stumbleupon-salut-shaarli-">Adieu Delicious, Diigo et StumbleUpon. Salut Shaarli ! - sebsauvage.net</a> (fr) <em>16/09/2011 - the original post about Shaarli</em><br /></li>
331<li><a href="http://sebsauvage.net/wiki/doku.php?id=php:shaarli:ideas">Original ideas/fixme/TODO page</a><br /></li>
332<li><a href="http://sebsauvage.net/wiki/doku.php?id=php:shaarli:discussion">Original discussion page</a> (fr)<br /></li>
333<li><a href="http://sebsauvage.net/wiki/doku.php?id=php:shaarli:history">Original revisions history</a><br /></li>
334<li><a href="https://www.shaarli.fr/my.php">Shaarli.fr/my</a> - Unofficial, unsupported (old fork) hosted Shaarlis provider, courtesy of <a href="https://github.com/DMeloni">DMeloni</a><br /></li>
335<li><a href="http://shaarferme.etudiant-libre.fr.nf/index.php">Shaarli Communauty</a> - Another unofficial Shaarli hoster (unsupported, old fork), hoster unknown</li>
336</ul>
337<h1 id="faq">FAQ</h1>
338<h3 id="why-did-you-create-shaarli">Why did you create Shaarli ?</h3>
339<p>I was a StumbleUpon user. Then I got fed up with they big toolbar. I switched to delicious, which was lighter, faster and more beautiful. Until Yahoo bought it. Then the export API broke all the time, delicious became slow and was ditched by Yahoo. I switched to Diigo, which is not bad, but does too much. And Diigo is sslllooooowww and their Firefox extension a bit buggy. And… oh… <strong>their Firefox addon sends to Diigo every single URL you visit</strong> (Don't believe me ? Use <a href="https://addons.mozilla.org/en-US/firefox/addon/tamper-data/">Tamper Data</a> and open any page).</p>
340<p>Enough is enough. Saving simple links should not be a complicated heavy thing. I ditched them all and wrote my own: Shaarli. It's simple, but it does the job and does it well. And my data is not hosted on a foreign server, but on my server.</p>
341<h3 id="why-use-shaarli-and-not-deliciousdiigo">Why use Shaarli and not Delicious/Diigo ?</h3>
342<p>With Shaarli:</p>
343<ul>
344<li>The data is yours: It's hosted on your server.<br /></li>
345<li>Never fear of having your data locked-in.<br /></li>
346<li>Never fear to have your data sold to third party.<br /></li>
347<li>Your private links are not hosted on a third party server.<br /></li>
348<li>You are not tracked by browser addons (like Diigo does)<br /></li>
349<li>You can change the look and feel of the pages if you want.<br /></li>
350<li>You can change the behaviour of the program.<br /></li>
351<li>It's magnitude faster than most bookmarking services.</li>
352</ul>
353<h3 id="what-does-shaarli-mean">What does Shaarli mean ?</h3>
354<p>Shaarli is for shaaring your links.</p>
355<h1 id="technical-details">Technical details</h1>
356<ul>
357<li>Application is protected against XSRF (Cross-site requests forgery): Forms which act on data (save,delete…) contain a token generated by the server. Any posted form which does not contain a valid token is rejected. Any token can only be used once. Token are attached to the session and cannot be reused in another session.<br /></li>
358<li>Sessions automatically expires after 60 minutes. Sessions are protected against highjacking: The sessionID cannot be used from a different IP address.<br /></li>
359<li>An .htaccess file protects the data file.<br /></li>
360<li><p>Link database is an associative array which is serialized, compressed (with deflate), base64-encoded and saved as a comment in a .php file. Thus even if the server does not support htaccess files, the data file will still not be readable by URL. The database looks like this:</p>
361<pre><code>&lt;?php /* zP1ZjxxJtiYIvvevEPJ2lDOaLrZv7o...
362...ka7gaco/Z+TFXM2i7BlfMf8qxpaSSYfKlvqv/x8= */ ?&gt;</code></pre></li>
363<li>The password is salted, hashed and stored in the data subdirectory, in a php file, and protected by htaccess. Even if the webserver does not support htaccess, the hash is not readable by URL. Even if the .php file is stolen, the password cannot deduced from the hash. The salt prevents rainbow-tables attacks.<br /></li>
364<li>Shaarli relies on <code>HTTP_REFERER</code> for some functions (like redirects and clicking on tags). If you have disabled or masqueraded <code>HTTP_REFERER</code> in your browser, some features of Shaarli may not work<br /></li>
365<li><code>magic_quotes</code> is a horrible option of php which is often activated on servers. No serious developer should rely on this horror to secure their code against SQL injections. You should disable it (and Shaarli expects this option to be disabled). Nevertheless, I have added code to cope with magic_quotes on, so you should not be bothered even on crappy hosts.<br /></li>
366<li><p>Small hashes are used to make a link to an entry in Shaarli. They are unique. In fact, the date of the items (eg.20110923_150523) is hashed with CRC32, then converted to base64 and some characters are replaced. They are always 6 characters longs and use only A-Z a-z 0-9 - _ and @.</p></li>
367</ul>
368<h3 id="directory-structure">Directory structure</h3>
369<p>Here is the directory structure of Shaarli and the purpose of the different files:</p>
370<pre><code> index.php : Main program.
371 application/ : Shaarli classes
372 ├── LinkDB.php
373 └── Utils.php
374 tests/ : Shaarli unitary &amp; functional tests
375 ├── LinkDBTest.php
376 ├── utils # utilities to ease testing
377 │ └── ReferenceLinkDB.php
378 └── UtilsTest.php
379 COPYING : Shaarli license.
380 inc/ : Includes (libraries, CSS…)
381 ├── awesomplete.*: tags autocompletion library
382 ├── blazy.*: picture wall lazy image loading library
383 ├── shaarli.css, reset.css : Shaarli stylesheet.
384 ├── qr.* : qr code generation library
385 └──rain.tpl.class.php : RainTPL templating library.
386 tpl/ : RainTPL templates for Shaarli. They are used to build the pages.
387 images/ : Images and icons used in Shaarli.
388 data/ : Directory where data is stored (bookmark database, configuration, logs, banlist…)
389 ├── config.php : Shaarli configuration (login, password, timezone, title…)
390 ├── datastore.php : Your link database (compressed).
391 ├── ipban.php : IP address ban system data.
392 ├── lastupdatecheck.txt : Update check timestamp file (used to check every 24 hours if a new version of Shaarli is available).
393 └──log.txt : login/IPban log.
394 cache/ : Directory containing the thumbnails cache. This directory is automatically created. You can erase it anytime you want.
395 tmp/ : Temporary directory for compiled RainTPL templates. This directory is automatically created. You can erase it anytime you want.</code></pre>
396<h3 id="development">Development</h3>
397<ul>
398<li><a href="https://github.com/shaarli/Shaarli/tree/master/CONTRIBUTING.md">Contributing to Shaarli</a><br /></li>
399<li><a href="Running-unit-tests">Running unit tests</a><br /></li>
400<li>Patches should try to stick to the <a href="http://www.php-fig.org/psr/">PHP Standard Recommendations</a> (PSR), especially:<br /></li>
401<li><a href="http://www.php-fig.org/psr/psr-1/">PSR-1</a> - Basic Coding Standard<br /></li>
402<li><a href="http://www.php-fig.org/psr/psr-2/">PSR-2</a> - Coding Style Guide</li>
403</ul>
404<h3 id="why-not-use-a-real-database-files-are-slow">Why not use a real database ? Files are slow !</h3>
405<p>Does browsing <a href="http://sebsauvage.net/links/">this page</a> feel slow ? Try browsing older pages, too.</p>
406<p>It's not slow at all, is it ? And don't forget the database contains more than 16000 links, and it's on a shared host, with 32000 visitors/day for my website alone. And it's still damn fast. Why ?</p>
407<p>The data file is only 3.7 Mb. It's read 99% of the time, and is probably already in the operation system disk cache. So generating a page involves no I/O at all most of the time.</p>
408<h1 id="wiki---todo">Wiki - TODO</h1>
409<ul>
410<li>translate (new page can be called Home.fr, Home.es ... and linked from Home)<br /></li>
411<li>add more screenshots<br /></li>
412<li>add developer documentation (storage architecture, classes and functions, security handling, ...)</li>
413</ul> 55</ul>
56</div>
57<h1 id="home">Home</h1>
58<h1 id="shaarli-wiki">Shaarli wiki</h1>
59<p>Welcome to the <a href="https://github.com/shaarli/Shaarli/">Shaarli</a> wiki<embed src=".html" /></p>
60<p>Here you can find some info on how to use, configure, tweak and solve problems with your Shaarli.</p>
61<p>For general info, read the <a href="https://github.com/shaarli/Shaarli/blob/master/README.md">README</a>.<a href=".html"></a></p>
62<p>If you have any questions or ideas, please join the <a href="https://gitter.im/shaarli/Shaarli">chat</a> (also reachable via <a href="https://irc.gitter.im/">IRC</a>), post them in our <a href="https://github.com/shaarli/Shaarli/issues/44">general discussion</a> or read the current <a href="https://github.com/shaarli/Shaarli/issues">issues</a>. If you've found a bug, please create a <a href="https://github.com/shaarli/Shaarli/issues/new">new issue</a>.<a href=".html"></a></p>
63<p>If you would like a feature added to Shaarli, check the issues labeled <a href="https://github.com/shaarli/Shaarli/labels/feature"><code>feature</code></a>, <a href="https://github.com/shaarli/Shaarli/labels/enhancement"><code>enhancement</code></a>, and <a href="https://github.com/shaarli/Shaarli/labels/plugin"><code>plugin</code></a>.<a href=".html"></a></p>
64<p><em>Note: This documentation is available online at <a href="https://github.com/shaarli/Shaarli/wiki" class="uri">https://github.com/shaarli/Shaarli/wiki</a>, and locally in the <code>doc/</code> directory of your Shaarli installation.</em></p>
414</body> 65</body>
415</html> 66</html>