Welcome to the Shaarli wiki! Here you can find some info on how to use, configure, tweak and solve problems with your Shaarli. For general info, read the README.
If you have any questions or ideas, please join the chat (also reachable via IRC), post them in our general discussion or read the current issues. If you've found a bug, please create a new issue. If you would like a feature added to Shaarli, check the issues labeled feature
, enhancement
, and plugin
.
Note: This documentation is available online at https://github.com/shaarli/Shaarli/wiki, and locally in the doc/
directory of your Shaarli installation.
Sessions do not seem to work correctly on your server
Login
Tools
button in the top bar✚Shaare link
button, and drop it to your browser's bookmarks bar.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.
Login
Tools
button in the top bar✚Add to Firefox social
button and accept the activation.Save
.Voila! Your link is now shared.Shaarli can be used:
readlater
)music
or video
tags)discussion
)Add Link
buttonAdd Link
Private
then click Save
It is possible to filter RSS/ATOM feeds and Picture Wall on a Shaarli to only display results of a specific search, or for a specific tag. For example, if you want to subscribe only to links tagged photography
:
photography
tag in the Filter by tag box. Links tagged photography
are displayed.RSS Feed
button.nature
?)https://my.shaarli.domain/?do=rss&searchtags=nature
, https://my.shaarli.domain/links/?do=picwall&searchterm=poney
To change the configuration, create the file data/options.php
, example:
<?php
$GLOBALS['config']['LINKS_PER_PAGE'] = 30;
$GLOBALS['config']['HIDE_TIMESTAMPS'] = true;
$GLOBALS['config']['ENABLE_THUMBNAILS'] = false;
?>
Do not edit config options in index.php! Your changes would be lost when you upgrade. The following parameters are available (parameters (default value)):
DATADIR ('data')
: This is the name of the subdirectory where Shaarli stores is data file. You can change it for better security.CONFIG_FILE ($GLOBALS['config']['DATADIR'].'/config.php')
: Name of file which is used to store login/password.DATASTORE ($GLOBALS['config']['DATADIR'].'/datastore.php')
: Name of file which contains the link database.LINKS_PER_PAGE (20)
: Default number of links per page displayed.IPBANS_FILENAME ($GLOBALS['config']['DATADIR'].'/ipbans.php')
: Name of file which records login attempts and IP bans.BAN_AFTER (4)
: An IP address will be banned after this many failed login attempts.BAN_DURATION (1800)
: Duration of ban (in seconds). (1800 seconds = 30 minutes)OPEN_SHAARLI (false)
: If you set this option to true, anyone will be able to add/modify/delete/import/exports links without having to login.HIDE_TIMESTAMPS (false)
: If you set this option to true, the date/time of each link will not be displayed (including in RSS Feed).#related-softwareENABLE_THUMBNAILS (true)
: Enable/disable thumbnails.RAINTPL_TMP (tmp/)
: Raintpl cache directory (keep the trailing slash!)RAINTPL_TPL (tpl/)
: Raintpl template directory (keep the trailing slash!). Edit this option if you want to change the rendering template (page structure) used by Shaarli. See Changing templateCACHEDIR ('cache')
: Directory where the thumbnails are stored.ENABLE_LOCALCACHE (true)
: 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)UPDATECHECK_FILENAME ($GLOBALS['config']['DATADIR'].'/lastupdatecheck.txt')
: name of the file used to store available shaarli version.UPDATECHECK_INTERVAL (86400)
: 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.ENABLE_UPDATECHECK
: Determines whether Shaarli check for new releases at https://github.com/shaarli/ShaarliSHOW_ATOM (false)
: Show an ATOM Feed
button next to the Subscribe
(RSS) button. ATOM feeds are available at the address ?do=atom
regardless of this option.ARCHIVE_ORG (false)
: For each link, display a link to an archived version on archive.orgENABLE_RSS_PERMALINKS (true)
: choose whether the RSS item title link points directly to the link, or to the entry on Shaarli (permalink). true
is the original Shaarli bahevior (point directly to the link)HIDE_PUBLIC_LINKS (false)
: setting this to true hides all links, even public ones, for non-logged in users.inc/user.css
. This file allows to override rules defined in the main inc/shaarli.css
(only add changed rules), or define a whole new theme.inc/shaarli.css
! Your changes would be overriden when updating Shaarli.See also:
| WARNING | This feature is currently being worked on and will be improved in the next releases. Experimental. |
|---------|---------|
tpl/
directory, run git clone https://url/of/my-template/
or unpack the zip archive. There should now be a my-template/
directory under the tpl/
dir, containing directly all the template files.data/options.php
to have Shaarli use this template. Eg.$GLOBALS['config']['RAINTPL_TPL'] = 'tpl/my-template/' ;
You can find a list of compatible templates in Related Software
You have two ways of backing up your database:
data/datastore.php
(by FTP or SSH). Restore by putting the file back in place.rsync -avzP my.server.com:/var/www/shaarli/data/datastore.php datastore-$(date +%Y-%m-%d_%H%M).php
Tools
> Export
). Restore by using the Import
feature../export-bookmarks.py --url=https://my.server.com/shaarli --username=myusername --password=mysupersecretpassword --download-dir=./ --type=all
Delete the file data/config.php and display the page again. You will be asked for a new login/password.
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.
To remove the current IP bans, delete the file data/ipbans.php
The file data/log.txt
shows all logins (successful or failed) and bans/lifted bans.
Search for failed
in this file to look for unauthorized login attempts.
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.)
To correctly import the tags from a SemanticScuttle HTML export, edit the HTML file before importing and replace all occurences of tags=
(lowercase) to TAGS=
(uppercase).
See this issue for import tweaks.
sessions
directory at the root of your webspace. Change the file extension to .php5
or create a .htaccess
file in the directory where Shaarli is located containing:php 1
SetEnv PHP_VER 5
Parse error: syntax error, unexpected '=', expecting '(' in /links/index.php on line xxx
, it means that your host is using php4, not php5. Shaarli requires php 5.1. Try changing the file extension to .php5
Warning: file_get_contents() [function.file-get-contents]: URL file-access is disabled in the server configuration in /…/index.php on line xxx
, 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://list($status,$headers,$data) = getHTTP($url,4); // Short timeout to keep the application responsive.
// FIXME: Decode charset according to charset specified in either 1) HTTP response headers or 2) <head> in html
//if (strpos($status,'200 OK')) $title=html_extract_title($data);
<? // tout ce qui est charge ici (generalement des includes et require) est charge en permanence. ?>
. To fix this, remove this message from php-include/prepend.php
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 :-( )
On CentOS/RedHat derivatives, you may need to install the php-mbstring
package.
This can be caused by several things:
session
directory on the root of your website.) You may need to create the session directory of set it up.sessions
subdirectory and add ini_set('session.save_path', $_SERVER['DOCUMENT_ROOT'].'/../sessions');
. Make sure this directory is not browsable !)Sessions do not seem to work correctly on your server
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 no dots in the hostname (e.g. localhost
or http://my-webserver/shaarli/
), some browsers will not store cookies at all (this respects the HTTP cookie specification).
Download publisher.php at the root of your Shaarli installation and set $GLOBALS['config']['PUBSUBHUB_URL']
in your config.php
To display the array representing the data saved in datastore.php, use the following snippet
$data = "tZNdb9MwFIb... <Commented content inside datastore.php>";
$out = unserialize(gzinflate(base64_decode($data)));
echo "<pre>"; // Pretty printing is love, pretty printing is life
print_r($out);
echo "</pre>";
exit;
This will output the internal representation of the datastore, "unobfuscated" (if this can really be considered obfuscation)
<input type="hidden" name="lf_linkdate" value="{$link.linkdate}">
in tpl/editlink.tpl
(line 14)type="hidden"
from this lineYYYMMDD_HHMMS
.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. TODO contact repos owners to see if they'd like to standardize their work for the community fork.
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… their Firefox addon sends to Diigo every single URL you visit (Don't believe me ? Use Tamper Data and open any page).
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.
With Shaarli:
Shaarli is for shaaring your links.
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:
<?php /* zP1ZjxxJtiYIvvevEPJ2lDOaLrZv7o...
...ka7gaco/Z+TFXM2i7BlfMf8qxpaSSYfKlvqv/x8= */ ?>
HTTP_REFERER
for some functions (like redirects and clicking on tags). If you have disabled or masqueraded HTTP_REFERER
in your browser, some features of Shaarli may not workmagic_quotes
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.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 @.
Here is the directory structure of Shaarli and the purpose of the different files:
index.php : Main program.
application/ : Shaarli classes
├── LinkDB.php
└── Utils.php
tests/ : Shaarli unitary & functional tests
├── LinkDBTest.php
├── utils # utilities to ease testing
│ └── ReferenceLinkDB.php
└── UtilsTest.php
COPYING : Shaarli license.
inc/ : Includes (libraries, CSS…)
├── awesomplete.*: tags autocompletion library
├── blazy.*: picture wall lazy image loading library
├── shaarli.css, reset.css : Shaarli stylesheet.
├── qr.* : qr code generation library
└──rain.tpl.class.php : RainTPL templating library.
tpl/ : RainTPL templates for Shaarli. They are used to build the pages.
images/ : Images and icons used in Shaarli.
data/ : Directory where data is stored (bookmark database, configuration, logs, banlist…)
├── config.php : Shaarli configuration (login, password, timezone, title…)
├── datastore.php : Your link database (compressed).
├── ipban.php : IP address ban system data.
├── lastupdatecheck.txt : Update check timestamp file (used to check every 24 hours if a new version of Shaarli is available).
└──log.txt : login/IPban log.
cache/ : Directory containing the thumbnails cache. This directory is automatically created. You can erase it anytime you want.
tmp/ : Temporary directory for compiled RainTPL templates. This directory is automatically created. You can erase it anytime you want.
Does browsing this page feel slow ? Try browsing older pages, too.
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 ?
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.