.gitattributes export-ignore
.gitignore export-ignore
.travis.yml export-ignore
-composer.json export-ignore
doc/**/*.json export-ignore
doc/**/*.md export-ignore
docker/ export-ignore
Login: `demo`; Password: `demo`
### Installation & upgrade
-- [Download](https://github.com/shaarli/Shaarli/wiki/Download)
+- [Download and installation](https://github.com/shaarli/Shaarli/wiki/Download-and-Installation)
- [Upgrade and migration](https://github.com/shaarli/Shaarli/wiki/Upgrade-and-migration)
- [Server requirements](https://github.com/shaarli/Shaarli/wiki/Server-requirements)
- [Server configuration](https://github.com/shaarli/Shaarli/wiki/Server-configuration)
<?php
/**
* GET an HTTP URL to retrieve its content
+ * Uses the cURL library or a fallback method
*
* @param string $url URL to get (http://...)
* @param int $timeout network timeout (in seconds)
* echo 'There was an error: '.htmlspecialchars($headers[0]);
* }
*
- * @see http://php.net/manual/en/function.file-get-contents.php
- * @see http://php.net/manual/en/function.stream-context-create.php
- * @see http://php.net/manual/en/function.get-headers.php
+ * @see https://secure.php.net/manual/en/ref.curl.php
+ * @see https://secure.php.net/manual/en/functions.anonymous.php
+ * @see https://secure.php.net/manual/en/function.preg-split.php
+ * @see https://secure.php.net/manual/en/function.explode.php
+ * @see http://stackoverflow.com/q/17641073
+ * @see http://stackoverflow.com/q/9183178
+ * @see http://stackoverflow.com/q/1462720
*/
function get_http_response($url, $timeout = 30, $maxBytes = 4194304)
{
$urlObj = new Url($url);
$cleanUrl = $urlObj->idnToAscii();
- if (! filter_var($cleanUrl, FILTER_VALIDATE_URL) || ! $urlObj->isHttp()) {
+ if (!filter_var($cleanUrl, FILTER_VALIDATE_URL) || !$urlObj->isHttp()) {
return array(array(0 => 'Invalid HTTP Url'), false);
}
+ $userAgent =
+ 'Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:45.0)'
+ . ' Gecko/20100101 Firefox/45.0';
+ $acceptLanguage =
+ substr(setlocale(LC_COLLATE, 0), 0, 2) . ',en-US;q=0.7,en;q=0.3';
+ $maxRedirs = 3;
+
+ if (!function_exists('curl_init')) {
+ return get_http_response_fallback(
+ $cleanUrl,
+ $timeout,
+ $maxBytes,
+ $userAgent,
+ $acceptLanguage,
+ $maxRedirs
+ );
+ }
+
+ $ch = curl_init($cleanUrl);
+ if ($ch === false) {
+ return array(array(0 => 'curl_init() error'), false);
+ }
+
+ // General cURL settings
+ curl_setopt($ch, CURLOPT_AUTOREFERER, true);
+ curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
+ curl_setopt($ch, CURLOPT_HEADER, true);
+ curl_setopt(
+ $ch,
+ CURLOPT_HTTPHEADER,
+ array('Accept-Language: ' . $acceptLanguage)
+ );
+ curl_setopt($ch, CURLOPT_MAXREDIRS, $maxRedirs);
+ curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
+ curl_setopt($ch, CURLOPT_TIMEOUT, $timeout);
+ curl_setopt($ch, CURLOPT_USERAGENT, $userAgent);
+
+ // Max download size management
+ curl_setopt($ch, CURLOPT_BUFFERSIZE, 1024);
+ curl_setopt($ch, CURLOPT_NOPROGRESS, false);
+ curl_setopt($ch, CURLOPT_PROGRESSFUNCTION,
+ function($arg0, $arg1, $arg2, $arg3, $arg4 = 0) use ($maxBytes)
+ {
+ if (version_compare(phpversion(), '5.5', '<')) {
+ // PHP version lower than 5.5
+ // Callback has 4 arguments
+ $downloaded = $arg1;
+ } else {
+ // Callback has 5 arguments
+ $downloaded = $arg2;
+ }
+ // Non-zero return stops downloading
+ return ($downloaded > $maxBytes) ? 1 : 0;
+ }
+ );
+
+ $response = curl_exec($ch);
+ $errorNo = curl_errno($ch);
+ $errorStr = curl_error($ch);
+ $headSize = curl_getinfo($ch, CURLINFO_HEADER_SIZE);
+ curl_close($ch);
+
+ if ($response === false) {
+ if ($errorNo == CURLE_COULDNT_RESOLVE_HOST) {
+ /*
+ * Workaround to match fallback method behaviour
+ * Removing this would require updating
+ * GetHttpUrlTest::testGetInvalidRemoteUrl()
+ */
+ return array(false, false);
+ }
+ return array(array(0 => 'curl_exec() error: ' . $errorStr), false);
+ }
+
+ // Formatting output like the fallback method
+ $rawHeaders = substr($response, 0, $headSize);
+
+ // Keep only headers from latest redirection
+ $rawHeadersArrayRedirs = explode("\r\n\r\n", trim($rawHeaders));
+ $rawHeadersLastRedir = end($rawHeadersArrayRedirs);
+
+ $content = substr($response, $headSize);
+ $headers = array();
+ foreach (preg_split('~[\r\n]+~', $rawHeadersLastRedir) as $line) {
+ if (empty($line) or ctype_space($line)) {
+ continue;
+ }
+ $splitLine = explode(': ', $line, 2);
+ if (count($splitLine) > 1) {
+ $key = $splitLine[0];
+ $value = $splitLine[1];
+ if (array_key_exists($key, $headers)) {
+ if (!is_array($headers[$key])) {
+ $headers[$key] = array(0 => $headers[$key]);
+ }
+ $headers[$key][] = $value;
+ } else {
+ $headers[$key] = $value;
+ }
+ } else {
+ $headers[] = $splitLine[0];
+ }
+ }
+
+ return array($headers, $content);
+}
+
+/**
+ * GET an HTTP URL to retrieve its content (fallback method)
+ *
+ * @param string $cleanUrl URL to get (http://... valid and in ASCII form)
+ * @param int $timeout network timeout (in seconds)
+ * @param int $maxBytes maximum downloaded bytes
+ * @param string $userAgent "User-Agent" header
+ * @param string $acceptLanguage "Accept-Language" header
+ * @param int $maxRedr maximum amount of redirections followed
+ *
+ * @return array HTTP response headers, downloaded content
+ *
+ * Output format:
+ * [0] = associative array containing HTTP response headers
+ * [1] = URL content (downloaded data)
+ *
+ * @see http://php.net/manual/en/function.file-get-contents.php
+ * @see http://php.net/manual/en/function.stream-context-create.php
+ * @see http://php.net/manual/en/function.get-headers.php
+ */
+function get_http_response_fallback(
+ $cleanUrl,
+ $timeout,
+ $maxBytes,
+ $userAgent,
+ $acceptLanguage,
+ $maxRedr
+) {
$options = array(
'http' => array(
'method' => 'GET',
'timeout' => $timeout,
- 'user_agent' => 'Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:45.0)'
- .' Gecko/20100101 Firefox/45.0',
- 'accept_language' => substr(setlocale(LC_COLLATE, 0), 0, 2) . ',en-US;q=0.7,en;q=0.3',
+ 'user_agent' => $userAgent,
+ 'header' => "Accept: */*\r\n"
+ . 'Accept-Language: ' . $acceptLanguage
)
);
stream_context_set_default($options);
- list($headers, $finalUrl) = get_redirected_headers($cleanUrl);
+ list($headers, $finalUrl) = get_redirected_headers($cleanUrl, $maxRedr);
if (! $headers || strpos($headers[0], '200 OK') === false) {
$options['http']['request_fulluri'] = true;
stream_context_set_default($options);
- list($headers, $finalUrl) = get_redirected_headers($cleanUrl);
+ list($headers, $finalUrl) = get_redirected_headers($cleanUrl, $maxRedr);
}
- if (! $headers || strpos($headers[0], '200 OK') === false) {
+ if (! $headers) {
return array($headers, false);
}
--- /dev/null
+<?php
+
+/**
+ * Wrapper function for translation which match the API
+ * of gettext()/_() and ngettext().
+ *
+ * Not doing translation for now.
+ *
+ * @param string $text Text to translate.
+ * @param string $nText The plural message ID.
+ * @param int $nb The number of items for plural forms.
+ *
+ * @return String Text translated.
+ */
+function t($text, $nText = '', $nb = 0) {
+ if (empty($nText)) {
+ return $text;
+ }
+ $actualForm = $nb > 1 ? $nText : $text;
+ return sprintf($actualForm, $nb);
+}
return $bookmarkLinks;
}
+
+ /**
+ * Generates an import status summary
+ *
+ * @param string $filename name of the file to import
+ * @param int $filesize size of the file to import
+ * @param int $importCount how many links were imported
+ * @param int $overwriteCount how many links were overwritten
+ * @param int $skipCount how many links were skipped
+ *
+ * @return string Summary of the bookmark import status
+ */
+ private static function importStatus(
+ $filename,
+ $filesize,
+ $importCount=0,
+ $overwriteCount=0,
+ $skipCount=0
+ )
+ {
+ $status = 'File '.$filename.' ('.$filesize.' bytes) ';
+ if ($importCount == 0 && $overwriteCount == 0 && $skipCount == 0) {
+ $status .= 'has an unknown file format. Nothing was imported.';
+ } else {
+ $status .= 'was successfully processed: '.$importCount.' links imported, ';
+ $status .= $overwriteCount.' links overwritten, ';
+ $status .= $skipCount.' links skipped.';
+ }
+ return $status;
+ }
+
+ /**
+ * Imports Web bookmarks from an uploaded Netscape bookmark dump
+ *
+ * @param array $post Server $_POST parameters
+ * @param array $file Server $_FILES parameters
+ * @param LinkDB $linkDb Loaded LinkDB instance
+ * @param string $pagecache Page cache
+ *
+ * @return string Summary of the bookmark import status
+ */
+ public static function import($post, $files, $linkDb, $pagecache)
+ {
+ $filename = $files['filetoupload']['name'];
+ $filesize = $files['filetoupload']['size'];
+ $data = file_get_contents($files['filetoupload']['tmp_name']);
+
+ if (strpos($data, '<!DOCTYPE NETSCAPE-Bookmark-file-1>') === false) {
+ return self::importStatus($filename, $filesize);
+ }
+
+ // Overwrite existing links?
+ $overwrite = ! empty($post['overwrite']);
+
+ // Add tags to all imported links?
+ if (empty($post['default_tags'])) {
+ $defaultTags = array();
+ } else {
+ $defaultTags = preg_split(
+ '/[\s,]+/',
+ escape($post['default_tags'])
+ );
+ }
+
+ // links are imported as public by default
+ $defaultPrivacy = 0;
+
+ $parser = new NetscapeBookmarkParser(
+ true, // nested tag support
+ $defaultTags, // additional user-specified tags
+ strval(1 - $defaultPrivacy) // defaultPub = 1 - defaultPrivacy
+ );
+ $bookmarks = $parser->parseString($data);
+
+ $importCount = 0;
+ $overwriteCount = 0;
+ $skipCount = 0;
+
+ foreach ($bookmarks as $bkm) {
+ $private = $defaultPrivacy;
+ if (empty($post['privacy']) || $post['privacy'] == 'default') {
+ // use value from the imported file
+ $private = $bkm['pub'] == '1' ? 0 : 1;
+ } else if ($post['privacy'] == 'private') {
+ // all imported links are private
+ $private = 1;
+ } else if ($post['privacy'] == 'public') {
+ // all imported links are public
+ $private = 0;
+ }
+
+ $newLink = array(
+ 'title' => $bkm['title'],
+ 'url' => $bkm['uri'],
+ 'description' => $bkm['note'],
+ 'private' => $private,
+ 'linkdate'=> '',
+ 'tags' => $bkm['tags']
+ );
+
+ $existingLink = $linkDb->getLinkFromUrl($bkm['uri']);
+
+ if ($existingLink !== false) {
+ if ($overwrite === false) {
+ // Do not overwrite an existing link
+ $skipCount++;
+ continue;
+ }
+
+ // Overwrite an existing link, keep its date
+ $newLink['linkdate'] = $existingLink['linkdate'];
+ $linkDb[$existingLink['linkdate']] = $newLink;
+ $importCount++;
+ $overwriteCount++;
+ continue;
+ }
+
+ // Add a new link
+ $newLinkDate = new DateTime('@'.strval($bkm['time']));
+ while (!empty($linkDb[$newLinkDate->format(LinkDB::LINK_DATE_FORMAT)])) {
+ // Ensure the date/time is not already used
+ // - this hack is necessary as the date/time acts as a primary key
+ // - apply 1 second increments until an unused index is found
+ // See https://github.com/shaarli/Shaarli/issues/351
+ $newLinkDate->add(new DateInterval('PT1S'));
+ }
+ $linkDbDate = $newLinkDate->format(LinkDB::LINK_DATE_FORMAT);
+ $newLink['linkdate'] = $linkDbDate;
+ $linkDb[$linkDbDate] = $newLink;
+ $importCount++;
+ }
+
+ $linkDb->savedb($pagecache);
+ return self::importStatus(
+ $filename,
+ $filesize,
+ $importCount,
+ $overwriteCount,
+ $skipCount
+ );
+ }
}
if (!empty($GLOBALS['plugin_errors'])) {
$this->tpl->assign('plugin_errors', $GLOBALS['plugin_errors']);
}
+ $this->tpl->assign('token', getToken($this->conf));
// To be removed with a proper theme configuration.
$this->tpl->assign('conf', $this->conf);
}
continue;
}
- $metaData[$plugin]['parameters'][$param] = '';
+ $metaData[$plugin]['parameters'][$param]['value'] = '';
+ // Optional parameter description in parameter.PARAM_NAME=
+ if (isset($metaData[$plugin]['parameter.'. $param])) {
+ $metaData[$plugin]['parameters'][$param]['desc'] = $metaData[$plugin]['parameter.'. $param];
+ }
}
}
{
$this->message = 'Plugin "'. $pluginName .'" files not found.';
}
-}
\ No newline at end of file
+}
return self::$PAGE_LINKLIST;
}
-}
\ No newline at end of file
+}
}
/**
- * Affect plugin parameters values into plugins array.
+ * Affect plugin parameters values from the ConfigManager into plugins array.
*
- * @param mixed $plugins Plugins array ($plugins[<plugin_name>]['parameters']['param_name'] = <value>.
+ * @param mixed $plugins Plugins array:
+ * $plugins[<plugin_name>]['parameters'][<param_name>] = [
+ * 'value' => <value>,
+ * 'desc' => <description>
+ * ]
* @param mixed $conf Plugins configuration.
*
* @return mixed Updated $plugins array.
foreach ($plugin['parameters'] as $key => $param) {
if (!empty($conf[$key])) {
- $out[$name]['parameters'][$key] = $conf[$key];
+ $out[$name]['parameters'][$key]['value'] = $conf[$key];
}
}
}
"wiki": "https://github.com/shaarli/Shaarli/wiki"
},
"keywords": ["bookmark", "link", "share", "web"],
- "repositories": [
- {
- "type": "vcs",
- "url": "https://github.com/shaarli/netscape-bookmark-parser"
- }
- ],
"require": {
"php": ">=5.3.4",
- "kafene/netscape-bookmark-parser": "dev-shaarli-stable"
+ "shaarli/netscape-bookmark-parser": "1.*"
},
"require-dev": {
"phpmd/phpmd" : "@stable",
<div id="local-sidebar">
<ul>
<li><a href="Home.html">Home</a></li>
-<li>Installation
+<li>Setup
<ul>
-<li><a href="Download.html">Download</a></li>
+<li><a href="Download-and-Installation.html">Download and Installation</a></li>
+<li><a href="Upgrade-and-migration.html">Upgrade and migration</a></li>
<li><a href="Server-requirements.html">Server requirements</a></li>
<li><a href="Server-configuration.html">Server configuration</a></li>
<li><a href="Server-security.html">Server security</a></li>
-<li><a href="Shaarli-installation.html">Shaarli installation</a></li>
<li><a href="Shaarli-configuration.html">Shaarli configuration</a></li>
<li><a href="Plugins.html">Plugins</a></li>
</ul></li>
<li>How To
<ul>
<li><a href="Backup,-restore,-import-and-export.html">Backup, restore, import and export</a></li>
-<li><a href="Upgrade-from-original-sebsauvage/Shaarli.html">Upgrade from original sebsauvage/Shaarli</a></li>
<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>
<li><a href="Create-and-serve-multiple-Shaarlis-(farm).html">Create and serve multiple Shaarlis (farm)</a></li>
<li><a href="Download-CSS-styles-from-an-OPML-list.html">Download CSS styles from an OPML list</a></li>
<ul>
<li><a href="FAQ.html">FAQ</a></li>
<li><a href="Community-&-Related-software.html">Community & Related software</a></li>
-<li><a href="TODO.html">TODO</a></li>
</ul></li>
</ul>
</div>
</ul>
<h2 id="php">PHP</h2>
<ul>
+<li><a href="https://github.com/shaarli/netscape-bookmark-parser">shaarli/netscape-bookmark-parser</a> - Netscape bookmark parser<a href=".html"></a></li>
<li><a href="https://github.com/rainphp/raintpl">RainTPL</a> - HTML templating for PHP<a href=".html"></a></li>
</ul>
</body>
- [qr.js](http://neocotic.com/qr.js/) ([GitHub](https://github.com/neocotic/qr.js)) - QR code generation[](.html)
## PHP
+- [shaarli/netscape-bookmark-parser](https://github.com/shaarli/netscape-bookmark-parser) - Netscape bookmark parser[](.html)
- [RainTPL](https://github.com/rainphp/raintpl) - HTML templating for PHP[](.html)
<div id="local-sidebar">
<ul>
<li><a href="Home.html">Home</a></li>
-<li>Installation
+<li>Setup
<ul>
-<li><a href="Download.html">Download</a></li>
+<li><a href="Download-and-Installation.html">Download and Installation</a></li>
+<li><a href="Upgrade-and-migration.html">Upgrade and migration</a></li>
<li><a href="Server-requirements.html">Server requirements</a></li>
<li><a href="Server-configuration.html">Server configuration</a></li>
<li><a href="Server-security.html">Server security</a></li>
-<li><a href="Shaarli-installation.html">Shaarli installation</a></li>
<li><a href="Shaarli-configuration.html">Shaarli configuration</a></li>
<li><a href="Plugins.html">Plugins</a></li>
</ul></li>
<li>How To
<ul>
<li><a href="Backup,-restore,-import-and-export.html">Backup, restore, import and export</a></li>
-<li><a href="Upgrade-from-original-sebsauvage/Shaarli.html">Upgrade from original sebsauvage/Shaarli</a></li>
<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>
<li><a href="Create-and-serve-multiple-Shaarlis-(farm).html">Create and serve multiple Shaarlis (farm)</a></li>
<li><a href="Download-CSS-styles-from-an-OPML-list.html">Download CSS styles from an OPML list</a></li>
<ul>
<li><a href="FAQ.html">FAQ</a></li>
<li><a href="Community-&-Related-software.html">Community & Related software</a></li>
-<li><a href="TODO.html">TODO</a></li>
</ul></li>
</ul>
</div>
<h1 id="backup-restore-import-and-export">Backup, restore, import and export</h1>
+<ul>
+<li><a href="#backup-and-restore-the-datastore-file">Backup and restore the datastore file</a><a href=".html"></a></li>
+<li><a href="#export-links-as">Export links as...</a><a href=".html"></a></li>
+<li><a href="#import-links-from">Import links from...</a><a href=".html"></a></li>
+<li><a href="#import-shaarli-links-to-firefox">Import Shaarli links to Firefox</a><a href=".html"></a></li>
+</ul>
+<hr />
<h2 id="backup-and-restore-the-datastore-file">Backup and restore the datastore file</h2>
<p>Backup the file <code>data/datastore.php</code> (by FTP or SSH). Restore by putting the file back in place.</p>
<p>Example command:</p>
-<div class="sourceCode"><pre class="sourceCode bash"><code class="sourceCode bash"><span class="kw">rsync</span> -avzP my.server.com:/var/www/shaarli/data/datastore.php datastore-<span class="ot">$(</span><span class="kw">date</span> +%Y-%m-%d_%H%M<span class="ot">)</span>.php</code></pre></div>
+<div class="sourceCode"><pre class="sourceCode bash"><code class="sourceCode bash"><span class="fu">rsync</span> -avzP my.server.com:/var/www/shaarli/data/datastore.php datastore-<span class="va">$(</span><span class="fu">date</span> +%Y-%m-%d_%H%M<span class="va">)</span>.php</code></pre></div>
<h2 id="export-links-as...">Export links as...</h2>
<p>To export links as an HTML file, under <em>Tools > Export</em>, choose:</p>
<ul>
<li>This can be done using the <a href="https://github.com/nodiscc/shaarchiver">shaarchiver</a> tool.<a href=".html"></a></li>
</ul>
<p>Example command:</p>
-<div class="sourceCode"><pre class="sourceCode bash"><code class="sourceCode bash"><span class="kw">./export-bookmarks.py</span> --url=https://my.server.com/shaarli --username=myusername --password=mysupersecretpassword --download-dir=./ --type=all</code></pre></div>
+<div class="sourceCode"><pre class="sourceCode bash"><code class="sourceCode bash"><span class="ex">./export-bookmarks.py</span> --url=https://my.server.com/shaarli --username=myusername --password=mysupersecretpassword --download-dir=./ --type=all</code></pre></div>
<h2 id="import-links-from...">Import links from...</h2>
<h3 id="diigo">Diigo</h3>
<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>
<p>See <a href="https://github.com/sebsauvage/Shaarli/issues/146">this issue</a> for import tweaks.<a href=".html"></a></p>
<h3 id="semanticscuttle">SemanticScuttle</h3>
<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).<a href=".html"></a></p>
+<h3 id="scuttle">Scuttle</h3>
+<p>Shaarli cannot import data directly from <a href="https://github.com/scronide/scuttle">Scuttle</a>. However, you can use this third party tool: <a href="https://github.com/q2apro/scuttle-to-shaarli" class="uri">https://github.com/q2apro/scuttle-to-shaarli</a> to export the Scuttle database to the Netscape HTML format compatible with the Shaarli importer.<a href=".html"></a></p>
+<h2 id="import-shaarli-links-to-firefox">Import Shaarli links to Firefox</h2>
+<ul>
+<li>Export your Shaarli links as described above.</li>
+<li>For compatibility reasons, check <code>Prepend note permalinks with this Shaarli instance's URL (useful to import bookmarks in a web browser)</code></li>
+<li>In Firefox, open the bookmark manager (not the sidebar! <code>Bookmarks menu > Show all bookmarks</code> or <code>Ctrl+Shift+B</code>)</li>
+<li>Select <code>Import and Backup > Import bookmarks in HTML format</code></li>
+</ul>
+<p>Your bookmarks will be imported in Firefox, ready to use, with tags and descriptions retained. "Self" (notes) shaares will still point to the Shaarli instance you exported them from, but the note text can be viewed directly in the bookmark properties inside your browser. Depending on the number of bookmarks, the import can take some time.</p>
+<p>You may be interested in these Firefox addons to manage links imported from Shaarli</p>
+<ul>
+<li><a href="https://addons.mozilla.org/en-US/firefox/addon/bookmark-deduplicator/">Bookmark Deduplicator</a> - provides an easy way to deduplicate your bookmarks<a href=".html"></a></li>
+<li><a href="https://addons.mozilla.org/en-US/firefox/addon/tagsieve/">TagSieve</a> - browse your bookmarks by their tags<a href=".html"></a></li>
+</ul>
</body>
</html>
#Backup, restore, import and export
+ * [Backup and restore the datastore file](#backup-and-restore-the-datastore-file)[](.html)
+ * [Export links as...](#export-links-as)[](.html)
+ * [Import links from...](#import-links-from)[](.html)
+ * [Import Shaarli links to Firefox](#import-shaarli-links-to-firefox)[](.html)
+
+
+----------------------
+
## Backup and restore the datastore file
Backup the file `data/datastore.php` (by FTP or SSH). Restore by putting the file back in place.
```
## Export links as...
+
To export links as an HTML file, under _Tools > Export_, choose:
- _Export all_ to export both public and private links
- _Export public_ to export public links only
```
## Import links from...
+
+
### Diigo
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.)
+
### Mister Wong
+
See [this issue](https://github.com/sebsauvage/Shaarli/issues/146) for import tweaks.[](.html)
### SemanticScuttle
To correctly import the tags from a [SemanticScuttle](http://semanticscuttle.sourceforge.net/) HTML export, edit the HTML file before importing and replace all occurences of `tags=` (lowercase) to `TAGS=` (uppercase).[](.html)
+
+### Scuttle
+
+Shaarli cannot import data directly from [Scuttle](https://github.com/scronide/scuttle). However, you can use this third party tool: https://github.com/q2apro/scuttle-to-shaarli to export the Scuttle database to the Netscape HTML format compatible with the Shaarli importer.[](.html)
+
+## Import Shaarli links to Firefox
+
+ * Export your Shaarli links as described above.
+ * For compatibility reasons, check `Prepend note permalinks with this Shaarli instance's URL (useful to import bookmarks in a web browser)`
+ * In Firefox, open the bookmark manager (not the sidebar! `Bookmarks menu > Show all bookmarks` or `Ctrl+Shift+B`)
+ * Select `Import and Backup > Import bookmarks in HTML format`
+
+Your bookmarks will be imported in Firefox, ready to use, with tags and descriptions retained. "Self" (notes) shaares will still point to the Shaarli instance you exported them from, but the note text can be viewed directly in the bookmark properties inside your browser. Depending on the number of bookmarks, the import can take some time.
+
+You may be interested in these Firefox addons to manage links imported from Shaarli
+
+ * [Bookmark Deduplicator](https://addons.mozilla.org/en-US/firefox/addon/bookmark-deduplicator/) - provides an easy way to deduplicate your bookmarks[](.html)
+ * [TagSieve](https://addons.mozilla.org/en-US/firefox/addon/tagsieve/) - browse your bookmarks by their tags[](.html)
<div id="local-sidebar">
<ul>
<li><a href="Home.html">Home</a></li>
-<li>Installation
+<li>Setup
<ul>
-<li><a href="Download.html">Download</a></li>
+<li><a href="Download-and-Installation.html">Download and Installation</a></li>
+<li><a href="Upgrade-and-migration.html">Upgrade and migration</a></li>
<li><a href="Server-requirements.html">Server requirements</a></li>
<li><a href="Server-configuration.html">Server configuration</a></li>
<li><a href="Server-security.html">Server security</a></li>
-<li><a href="Shaarli-installation.html">Shaarli installation</a></li>
<li><a href="Shaarli-configuration.html">Shaarli configuration</a></li>
<li><a href="Plugins.html">Plugins</a></li>
</ul></li>
<li>How To
<ul>
<li><a href="Backup,-restore,-import-and-export.html">Backup, restore, import and export</a></li>
-<li><a href="Upgrade-from-original-sebsauvage/Shaarli.html">Upgrade from original sebsauvage/Shaarli</a></li>
<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>
<li><a href="Create-and-serve-multiple-Shaarlis-(farm).html">Create and serve multiple Shaarlis (farm)</a></li>
<li><a href="Download-CSS-styles-from-an-OPML-list.html">Download CSS styles from an OPML list</a></li>
<ul>
<li><a href="FAQ.html">FAQ</a></li>
<li><a href="Community-&-Related-software.html">Community & Related software</a></li>
-<li><a href="TODO.html">TODO</a></li>
</ul></li>
</ul>
</div>
<div id="local-sidebar">
<ul>
<li><a href="Home.html">Home</a></li>
-<li>Installation
+<li>Setup
<ul>
-<li><a href="Download.html">Download</a></li>
+<li><a href="Download-and-Installation.html">Download and Installation</a></li>
+<li><a href="Upgrade-and-migration.html">Upgrade and migration</a></li>
<li><a href="Server-requirements.html">Server requirements</a></li>
<li><a href="Server-configuration.html">Server configuration</a></li>
<li><a href="Server-security.html">Server security</a></li>
-<li><a href="Shaarli-installation.html">Shaarli installation</a></li>
<li><a href="Shaarli-configuration.html">Shaarli configuration</a></li>
<li><a href="Plugins.html">Plugins</a></li>
</ul></li>
<li>How To
<ul>
<li><a href="Backup,-restore,-import-and-export.html">Backup, restore, import and export</a></li>
-<li><a href="Upgrade-from-original-sebsauvage/Shaarli.html">Upgrade from original sebsauvage/Shaarli</a></li>
<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>
<li><a href="Create-and-serve-multiple-Shaarlis-(farm).html">Create and serve multiple Shaarlis (farm)</a></li>
<li><a href="Download-CSS-styles-from-an-OPML-list.html">Download CSS styles from an OPML list</a></li>
<ul>
<li><a href="FAQ.html">FAQ</a></li>
<li><a href="Community-&-Related-software.html">Community & Related software</a></li>
-<li><a href="TODO.html">TODO</a></li>
</ul></li>
</ul>
</div>
<div id="local-sidebar">
<ul>
<li><a href="Home.html">Home</a></li>
-<li>Installation
+<li>Setup
<ul>
-<li><a href="Download.html">Download</a></li>
+<li><a href="Download-and-Installation.html">Download and Installation</a></li>
+<li><a href="Upgrade-and-migration.html">Upgrade and migration</a></li>
<li><a href="Server-requirements.html">Server requirements</a></li>
<li><a href="Server-configuration.html">Server configuration</a></li>
<li><a href="Server-security.html">Server security</a></li>
-<li><a href="Shaarli-installation.html">Shaarli installation</a></li>
<li><a href="Shaarli-configuration.html">Shaarli configuration</a></li>
<li><a href="Plugins.html">Plugins</a></li>
</ul></li>
<li>How To
<ul>
<li><a href="Backup,-restore,-import-and-export.html">Backup, restore, import and export</a></li>
-<li><a href="Upgrade-from-original-sebsauvage/Shaarli.html">Upgrade from original sebsauvage/Shaarli</a></li>
<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>
<li><a href="Create-and-serve-multiple-Shaarlis-(farm).html">Create and serve multiple Shaarlis (farm)</a></li>
<li><a href="Download-CSS-styles-from-an-OPML-list.html">Download CSS styles from an OPML list</a></li>
<ul>
<li><a href="FAQ.html">FAQ</a></li>
<li><a href="Community-&-Related-software.html">Community & Related software</a></li>
-<li><a href="TODO.html">TODO</a></li>
</ul></li>
</ul>
</div>
<li><a href="https://github.com/kalvn/shaarli-plugin-autosave">autosave</a> by <a href="https://github.com/kalvn">@kalvn</a>: Automatically saves data when editing a link to avoid any loss in case of crash or unexpected shutdown.<a href=".html"></a></li>
<li><a href="https://github.com/ArthurHoaro/code-coloration">Code Coloration</a> by <a href="https://github.com/ArthurHoaro">@ArthurHoaro</a>: client side code syntax highlighter.<a href=".html"></a></li>
<li><a href="https://github.com/alexisju/social">social</a> by <a href="https://github.com/alexisju">@alexisju</a>: share links to social networks.<a href=".html"></a></li>
-<li><a href="https://github.com/NerosTie/emojione">emojione</a> by <a href="https://github.com/NerosTie/emojione">@NerosTie</a>: Add colorful emojis to your Shaarli.<a href=".html"></a></li>
+<li><a href="https://github.com/NerosTie/emojione">emojione</a> by <a href="https://github.com/NerosTie">@NerosTie</a>: Add colorful emojis to your Shaarli.<a href=".html"></a></li>
<li><a href="https://github.com/ArthurHoaro/launch-plugin">launch</a> - Launch Plugin is a plugin designed to enhance and customize Launch Theme for Shaarli.<a href=".html"></a></li>
+<li><a href="https://github.com/kalvn/shaarli-plugin-disqus">Disqus</a> by <a href="https://github.com/kalvn">@kalvn</a>: Adds Disqus comment system to your Shaarli.<a href=".html"></a></li>
</ul>
<h3 id="themes">Themes</h3>
<p>See <a href="Theming.html">Theming</a> for the list of community-contributed themes, and an installation guide.</p>
* [autosave](https://github.com/kalvn/shaarli-plugin-autosave) by [@kalvn](https://github.com/kalvn): Automatically saves data when editing a link to avoid any loss in case of crash or unexpected shutdown.[](.html)
* [Code Coloration](https://github.com/ArthurHoaro/code-coloration) by [@ArthurHoaro](https://github.com/ArthurHoaro): client side code syntax highlighter.[](.html)
* [social](https://github.com/alexisju/social) by [@alexisju](https://github.com/alexisju): share links to social networks.[](.html)
- * [emojione](https://github.com/NerosTie/emojione) by [@NerosTie](https://github.com/NerosTie/emojione): Add colorful emojis to your Shaarli.[](.html)
+ * [emojione](https://github.com/NerosTie/emojione) by [@NerosTie](https://github.com/NerosTie): Add colorful emojis to your Shaarli.[](.html)
* [launch](https://github.com/ArthurHoaro/launch-plugin) - Launch Plugin is a plugin designed to enhance and customize Launch Theme for Shaarli.[](.html)
+ * [Disqus](https://github.com/kalvn/shaarli-plugin-disqus) by [@kalvn](https://github.com/kalvn): Adds Disqus comment system to your Shaarli.[](.html)
### Themes
<div id="local-sidebar">
<ul>
<li><a href="Home.html">Home</a></li>
-<li>Installation
+<li>Setup
<ul>
-<li><a href="Download.html">Download</a></li>
+<li><a href="Download-and-Installation.html">Download and Installation</a></li>
+<li><a href="Upgrade-and-migration.html">Upgrade and migration</a></li>
<li><a href="Server-requirements.html">Server requirements</a></li>
<li><a href="Server-configuration.html">Server configuration</a></li>
<li><a href="Server-security.html">Server security</a></li>
-<li><a href="Shaarli-installation.html">Shaarli installation</a></li>
<li><a href="Shaarli-configuration.html">Shaarli configuration</a></li>
<li><a href="Plugins.html">Plugins</a></li>
</ul></li>
<li>How To
<ul>
<li><a href="Backup,-restore,-import-and-export.html">Backup, restore, import and export</a></li>
-<li><a href="Upgrade-from-original-sebsauvage/Shaarli.html">Upgrade from original sebsauvage/Shaarli</a></li>
<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>
<li><a href="Create-and-serve-multiple-Shaarlis-(farm).html">Create and serve multiple Shaarlis (farm)</a></li>
<li><a href="Download-CSS-styles-from-an-OPML-list.html">Download CSS styles from an OPML list</a></li>
<ul>
<li><a href="FAQ.html">FAQ</a></li>
<li><a href="Community-&-Related-software.html">Community & Related software</a></li>
-<li><a href="TODO.html">TODO</a></li>
</ul></li>
</ul>
</div>
<span class="co">#Usage: ./local-shaarli.sh</span>
<span class="co">#Author: nodiscc (nodiscc@gmail.com)</span>
<span class="co">#License: MIT (http://opensource.org/licenses/MIT)</span>
-<span class="kw">set</span> <span class="kw">-o</span> errexit
-<span class="kw">set</span> <span class="kw">-o</span> nounset
+<span class="kw">set</span> <span class="ex">-o</span> errexit
+<span class="kw">set</span> <span class="ex">-o</span> nounset
<span class="co">##### CONFIG #################</span>
<span class="co">#The port used by php's local server</span>
-<span class="ot">php_local_port=</span>7431
+<span class="va">php_local_port=</span>7431
<span class="co">#Name of the SSH server and path where Shaarli is installed</span>
<span class="co">#TODO: pass these as command-line arguments</span>
-<span class="ot">remotehost=</span><span class="st">"my.ssh.server"</span>
-<span class="ot">remote_shaarli_dir=</span><span class="st">"/var/www/shaarli"</span>
+<span class="va">remotehost=</span><span class="st">"my.ssh.server"</span>
+<span class="va">remote_shaarli_dir=</span><span class="st">"/var/www/shaarli"</span>
<span class="co">###### FUNCTIONS #############</span>
<span class="fu">_main()</span> <span class="kw">{</span>
- <span class="kw">_CBSyncShaarli</span>
- <span class="kw">_CBServeShaarli</span>
+ <span class="ex">_CBSyncShaarli</span>
+ <span class="ex">_CBServeShaarli</span>
<span class="kw">}</span>
<span class="fu">_CBSyncShaarli()</span> <span class="kw">{</span>
- <span class="ot">remote_temp_dir=$(</span><span class="kw">ssh</span> <span class="ot">$remotehost</span> mktemp -d<span class="ot">)</span>
- <span class="ot">remote_ssh_user=$(</span><span class="kw">ssh</span> <span class="ot">$remotehost</span> whoami<span class="ot">)</span>
- <span class="kw">ssh</span> -t <span class="st">"</span><span class="ot">$remotehost</span><span class="st">"</span> sudo cp -r <span class="st">"</span><span class="ot">$remote_shaarli_dir</span><span class="st">"</span> <span class="st">"</span><span class="ot">$remote_temp_dir</span><span class="st">"</span>
- <span class="kw">ssh</span> -t <span class="st">"</span><span class="ot">$remotehost</span><span class="st">"</span> sudo chown -R <span class="st">"</span><span class="ot">$remote_ssh_user</span><span class="st">"</span>:<span class="st">"</span><span class="ot">$remote_ssh_user</span><span class="st">"</span> <span class="st">"</span><span class="ot">$remote_temp_dir</span><span class="st">"</span>
- <span class="kw">scp</span> -rq <span class="st">"</span><span class="ot">$remotehost</span><span class="st">"</span>:<span class="st">"</span><span class="ot">$remote_temp_dir</span><span class="st">"</span> local-shaarli
- <span class="kw">ssh</span> <span class="st">"</span><span class="ot">$remotehost</span><span class="st">"</span> rm -r <span class="st">"</span><span class="ot">$remote_temp_dir</span><span class="st">"</span>
+ <span class="va">remote_temp_dir=$(</span><span class="fu">ssh</span> <span class="va">$remotehost</span> mktemp -d<span class="va">)</span>
+ <span class="va">remote_ssh_user=$(</span><span class="fu">ssh</span> <span class="va">$remotehost</span> whoami<span class="va">)</span>
+ <span class="fu">ssh</span> -t <span class="st">"</span><span class="va">$remotehost</span><span class="st">"</span> sudo cp -r <span class="st">"</span><span class="va">$remote_shaarli_dir</span><span class="st">"</span> <span class="st">"</span><span class="va">$remote_temp_dir</span><span class="st">"</span>
+ <span class="fu">ssh</span> -t <span class="st">"</span><span class="va">$remotehost</span><span class="st">"</span> sudo chown -R <span class="st">"</span><span class="va">$remote_ssh_user</span><span class="st">"</span>:<span class="st">"</span><span class="va">$remote_ssh_user</span><span class="st">"</span> <span class="st">"</span><span class="va">$remote_temp_dir</span><span class="st">"</span>
+ <span class="fu">scp</span> -rq <span class="st">"</span><span class="va">$remotehost</span><span class="st">"</span>:<span class="st">"</span><span class="va">$remote_temp_dir</span><span class="st">"</span> local-shaarli
+ <span class="fu">ssh</span> <span class="st">"</span><span class="va">$remotehost</span><span class="st">"</span> rm -r <span class="st">"</span><span class="va">$remote_temp_dir</span><span class="st">"</span>
<span class="kw">}</span>
<span class="fu">_CBServeShaarli()</span> <span class="kw">{</span>
<span class="co">#TODO: allow serving a previously downloaded Shaarli</span>
<span class="co">#TODO: ask before overwriting local copy, if it exists</span>
- <span class="kw">cd</span> local-shaarli/
- <span class="kw">php</span> -S localhost:<span class="ot">${php_local_port}</span>
- <span class="kw">echo</span> <span class="st">"Please go to http://localhost:</span><span class="ot">${php_local_port}</span><span class="st">"</span>
+ <span class="bu">cd</span> local-shaarli/
+ <span class="ex">php</span> -S localhost:<span class="va">${php_local_port}</span>
+ <span class="bu">echo</span> <span class="st">"Please go to http://localhost:</span><span class="va">${php_local_port}</span><span class="st">"</span>
<span class="kw">}</span>
<span class="co">##### MAIN #################</span>
-<span class="kw">_main</span></code></pre></div>
+<span class="ex">_main</span></code></pre></div>
<p>This outputs:</p>
-<div class="sourceCode"><pre class="sourceCode bash"><code class="sourceCode bash">$ <span class="kw">./local-shaarli.sh</span>
-<span class="kw">PHP</span> 5.6.0RC4 Development Server started at Mon Sep 1 21:56:19 2014
-<span class="kw">Listening</span> on http://localhost:7431
-<span class="kw">Document</span> root is /home/user/local-shaarli/shaarli
-<span class="kw">Press</span> Ctrl-C to quit.
+<div class="sourceCode"><pre class="sourceCode bash"><code class="sourceCode bash">$ <span class="ex">./local-shaarli.sh</span>
+<span class="ex">PHP</span> 5.6.0RC4 Development Server started at Mon Sep 1 21:56:19 2014
+<span class="ex">Listening</span> on http://localhost:7431
+<span class="ex">Document</span> root is /home/user/local-shaarli/shaarli
+<span class="ex">Press</span> Ctrl-C to quit.
-[<span class="kw">Mon</span> Sep 1 21:56:27 2014] ::1:57868 [200]: /[](.html)
-[<span class="kw">Mon</span> Sep 1 21:56:27 2014] ::1:57869 [200]: /index.html[](.html)
-[<span class="kw">Mon</span> Sep 1 21:56:37 2014] ::1:57881 [200]: /...[](.html)</code></pre></div>
+[<span class="ex">Mon</span> Sep 1 21:56:27 2014] ::1:57868 [200]: /[](.html)
+[<span class="ex">Mon</span> Sep 1 21:56:27 2014] ::1:57869 [200]: /index.html[](.html)
+[<span class="ex">Mon</span> Sep 1 21:56:37 2014] ::1:57881 [200]: /...[](.html)</code></pre></div>
</body>
</html>
<div id="local-sidebar">
<ul>
<li><a href="Home.html">Home</a></li>
-<li>Installation
+<li>Setup
<ul>
-<li><a href="Download.html">Download</a></li>
+<li><a href="Download-and-Installation.html">Download and Installation</a></li>
+<li><a href="Upgrade-and-migration.html">Upgrade and migration</a></li>
<li><a href="Server-requirements.html">Server requirements</a></li>
<li><a href="Server-configuration.html">Server configuration</a></li>
<li><a href="Server-security.html">Server security</a></li>
-<li><a href="Shaarli-installation.html">Shaarli installation</a></li>
<li><a href="Shaarli-configuration.html">Shaarli configuration</a></li>
<li><a href="Plugins.html">Plugins</a></li>
</ul></li>
<li>How To
<ul>
<li><a href="Backup,-restore,-import-and-export.html">Backup, restore, import and export</a></li>
-<li><a href="Upgrade-from-original-sebsauvage/Shaarli.html">Upgrade from original sebsauvage/Shaarli</a></li>
<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>
<li><a href="Create-and-serve-multiple-Shaarlis-(farm).html">Create and serve multiple Shaarlis (farm)</a></li>
<li><a href="Download-CSS-styles-from-an-OPML-list.html">Download CSS styles from an OPML list</a></li>
<ul>
<li><a href="FAQ.html">FAQ</a></li>
<li><a href="Community-&-Related-software.html">Community & Related software</a></li>
-<li><a href="TODO.html">TODO</a></li>
</ul></li>
</ul>
</div>
<h1 id="create-and-serve-multiple-shaarlis-farm">Create and serve multiple Shaarlis (farm)</h1>
<p>Example bash script (creates multiple shaarli instances and generates an HTML index of them)</p>
<div class="sourceCode"><pre class="sourceCode bash"><code class="sourceCode bash"><span class="co">#!/bin/bash</span>
-<span class="kw">set</span> <span class="kw">-o</span> errexit
-<span class="kw">set</span> <span class="kw">-o</span> nounset
+<span class="kw">set</span> <span class="ex">-o</span> errexit
+<span class="kw">set</span> <span class="ex">-o</span> nounset
<span class="co">#config</span>
-<span class="ot">shaarli_base_dir=</span><span class="st">'/var/www/shaarli'</span>
-<span class="ot">accounts=</span><span class="st">'bob john whatever username'</span>
-<span class="ot">shaarli_repo_url=</span><span class="st">'https://github.com/shaarli/Shaarli'</span>
-<span class="ot">ref=</span><span class="st">"master"</span>
+<span class="va">shaarli_base_dir=</span><span class="st">'/var/www/shaarli'</span>
+<span class="va">accounts=</span><span class="st">'bob john whatever username'</span>
+<span class="va">shaarli_repo_url=</span><span class="st">'https://github.com/shaarli/Shaarli'</span>
+<span class="va">ref=</span><span class="st">"master"</span>
<span class="co">#clone multiple shaarli instances</span>
-<span class="kw">if [</span> <span class="ot">!</span> <span class="ot">-d</span> <span class="st">"</span><span class="ot">$shaarli_base_dir</span><span class="st">"</span><span class="kw"> ]</span>; <span class="kw">then</span> <span class="kw">mkdir</span> <span class="st">"</span><span class="ot">$shaarli_base_dir</span><span class="st">"</span><span class="kw">;</span> <span class="kw">fi</span>[]<span class="kw">(.html)</span>
+<span class="kw">if</span><span class="bu"> [</span> <span class="ot">!</span> <span class="ot">-d</span> <span class="st">"</span><span class="va">$shaarli_base_dir</span><span class="st">"</span><span class="bu"> ]</span>; <span class="kw">then</span> <span class="fu">mkdir</span> <span class="st">"</span><span class="va">$shaarli_base_dir</span><span class="st">"</span><span class="kw">;</span> <span class="kw">fi</span>[]<span class="kw">(</span><span class="ex">.html</span><span class="kw">)</span>
-<span class="kw">for</span> <span class="kw">account</span> in <span class="ot">$accounts</span><span class="kw">;</span> <span class="kw">do</span>
- <span class="kw">if [</span> <span class="ot">-d</span> <span class="st">"</span><span class="ot">$shaarli_base_dir</span><span class="st">/</span><span class="ot">$account</span><span class="st">"</span><span class="kw"> ]</span>;[]<span class="kw">(.html)</span>
- <span class="kw">then</span> <span class="kw">echo</span> <span class="st">"[info] account </span><span class="ot">$account</span><span class="st"> already exists, skipping"</span><span class="kw">;</span>[]<span class="kw">(.html)</span>
- <span class="kw">else</span> <span class="kw">echo</span> <span class="st">"[info] creating new account </span><span class="ot">$account</span><span class="st"> ..."</span><span class="kw">;</span> <span class="kw">git</span> clone --quiet <span class="st">"</span><span class="ot">$shaarli_repo_url</span><span class="st">"</span> -b <span class="st">"</span><span class="ot">$ref</span><span class="st">"</span> <span class="st">"</span><span class="ot">$shaarli_base_dir</span><span class="st">/</span><span class="ot">$account</span><span class="st">"</span><span class="kw">;</span> <span class="kw">fi</span>[]<span class="kw">(.html)</span>
+<span class="kw">for</span> <span class="ex">account</span> in <span class="va">$accounts</span><span class="kw">;</span> <span class="kw">do</span>
+ <span class="kw">if</span><span class="bu"> [</span> <span class="ot">-d</span> <span class="st">"</span><span class="va">$shaarli_base_dir</span><span class="st">/</span><span class="va">$account</span><span class="st">"</span><span class="bu"> ]</span>;[]<span class="kw">(</span><span class="ex">.html</span><span class="kw">)</span>
+ <span class="kw">then</span> <span class="bu">echo</span> <span class="st">"[info] account </span><span class="va">$account</span><span class="st"> already exists, skipping"</span><span class="kw">;</span>[]<span class="kw">(</span><span class="ex">.html</span><span class="kw">)</span>
+ <span class="kw">else</span> <span class="bu">echo</span> <span class="st">"[info] creating new account </span><span class="va">$account</span><span class="st"> ..."</span><span class="kw">;</span> <span class="fu">git</span> clone --quiet <span class="st">"</span><span class="va">$shaarli_repo_url</span><span class="st">"</span> -b <span class="st">"</span><span class="va">$ref</span><span class="st">"</span> <span class="st">"</span><span class="va">$shaarli_base_dir</span><span class="st">/</span><span class="va">$account</span><span class="st">"</span><span class="kw">;</span> <span class="kw">fi</span>[]<span class="kw">(</span><span class="ex">.html</span><span class="kw">)</span>
<span class="kw">done</span>
<span class="co">#generate html index of shaarlis</span>
-<span class="ot">htmlhead=</span><span class="st">'<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"></span>
+<span class="va">htmlhead=</span><span class="st">'<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"></span>
<span class="st"><!-- Minimal html template thanks to http://www.sitepoint.com/a-minimal-html-document/ --></span>
<span class="st"><html lang="en"></span>
<span class="st"> <head></span>
<span class="st"> <h1>My Shaarli farm</h1></span>
<span class="st"> <ul style="list-style-type: none;">'</span>
-<span class="ot">accountlinks=</span><span class="st">''</span>
+<span class="va">accountlinks=</span><span class="st">''</span>
-<span class="ot">htmlfooter=</span><span class="st">'</span>
+<span class="va">htmlfooter=</span><span class="st">'</span>
<span class="st"> </ul></span>
<span class="st"> </div></span>
<span class="st"> </body></span>
-<span class="kw">for</span> <span class="kw">account</span> in <span class="ot">$accounts</span><span class="kw">;</span> <span class="kw">do</span> <span class="ot">accountlinks=</span><span class="st">"</span><span class="ot">$accountlinks</span><span class="st">\n<li><a href=</span><span class="dt">\"</span><span class="ot">$account</span><span class="dt">\"</span><span class="st">></span><span class="ot">$account</span><span class="st"></a></li>"</span>; <span class="kw">done</span>
-<span class="kw">if [</span> <span class="ot">-d</span> <span class="st">"</span><span class="ot">$shaarli_base_dir</span><span class="st">/index.html"</span><span class="kw"> ]</span>; <span class="kw">then</span> <span class="kw">echo</span> <span class="st">"[removing old index.html]"</span><span class="kw">;</span> <span class="kw">rm</span> <span class="st">"</span><span class="ot">$shaarli_base_dir</span><span class="st">/index.html"</span> ]<span class="kw">;</span> <span class="kw">fi</span>[]<span class="kw">(.html)</span>
-<span class="kw">echo</span> <span class="st">"[info] generating new index of shaarlis"</span>[](.html)
-<span class="kw">echo</span> -e <span class="st">"</span><span class="ot">$htmlhead</span><span class="st"> </span><span class="ot">$accountlinks</span><span class="st"> </span><span class="ot">$htmlfooter</span><span class="st">"</span> <span class="kw">></span> <span class="st">"</span><span class="ot">$shaarli_base_dir</span><span class="st">/index.html"</span>
-<span class="kw">echo</span> <span class="st">'[info] done.'</span>[](.html)
-<span class="kw">echo</span> <span class="st">"[info] list of accounts: </span><span class="ot">$accounts</span><span class="st">"</span>[](.html)
-<span class="kw">echo</span> <span class="st">"[info] contents of </span><span class="ot">$shaarli_base_dir</span><span class="st">:"</span>[](.html)
-<span class="kw">tree</span> -a -L 1 <span class="st">"</span><span class="ot">$shaarli_base_dir</span><span class="st">"</span></code></pre></div>
+<span class="kw">for</span> <span class="ex">account</span> in <span class="va">$accounts</span><span class="kw">;</span> <span class="kw">do</span> <span class="va">accountlinks=</span><span class="st">"</span><span class="va">$accountlinks</span><span class="st">\n<li><a href=</span><span class="dt">\"</span><span class="va">$account</span><span class="dt">\"</span><span class="st">></span><span class="va">$account</span><span class="st"></a></li>"</span>; <span class="kw">done</span>
+<span class="kw">if</span><span class="bu"> [</span> <span class="ot">-d</span> <span class="st">"</span><span class="va">$shaarli_base_dir</span><span class="st">/index.html"</span><span class="bu"> ]</span>; <span class="kw">then</span> <span class="bu">echo</span> <span class="st">"[removing old index.html]"</span><span class="kw">;</span> <span class="fu">rm</span> <span class="st">"</span><span class="va">$shaarli_base_dir</span><span class="st">/index.html"</span> ]<span class="kw">;</span> <span class="kw">fi</span>[]<span class="kw">(</span><span class="ex">.html</span><span class="kw">)</span>
+<span class="bu">echo</span> <span class="st">"[info] generating new index of shaarlis"</span>[](.html)
+<span class="bu">echo</span> -e <span class="st">"</span><span class="va">$htmlhead</span><span class="st"> </span><span class="va">$accountlinks</span><span class="st"> </span><span class="va">$htmlfooter</span><span class="st">"</span> <span class="op">></span> <span class="st">"</span><span class="va">$shaarli_base_dir</span><span class="st">/index.html"</span>
+<span class="bu">echo</span> <span class="st">'[info] done.'</span>[](.html)
+<span class="bu">echo</span> <span class="st">"[info] list of accounts: </span><span class="va">$accounts</span><span class="st">"</span>[](.html)
+<span class="bu">echo</span> <span class="st">"[info] contents of </span><span class="va">$shaarli_base_dir</span><span class="st">:"</span>[](.html)
+<span class="ex">tree</span> -a -L 1 <span class="st">"</span><span class="va">$shaarli_base_dir</span><span class="st">"</span></code></pre></div>
<p>This script just serves as an example. More precise or complex (applying custom configuration, etc) automation is possible using configuration management software like <a href="https://www.ansible.com/">Ansible</a><a href=".html"></a></p>
</body>
</html>
<div id="local-sidebar">
<ul>
<li><a href="Home.html">Home</a></li>
-<li>Installation
+<li>Setup
<ul>
-<li><a href="Download.html">Download</a></li>
+<li><a href="Download-and-Installation.html">Download and Installation</a></li>
+<li><a href="Upgrade-and-migration.html">Upgrade and migration</a></li>
<li><a href="Server-requirements.html">Server requirements</a></li>
<li><a href="Server-configuration.html">Server configuration</a></li>
<li><a href="Server-security.html">Server security</a></li>
-<li><a href="Shaarli-installation.html">Shaarli installation</a></li>
<li><a href="Shaarli-configuration.html">Shaarli configuration</a></li>
<li><a href="Plugins.html">Plugins</a></li>
</ul></li>
<li>How To
<ul>
<li><a href="Backup,-restore,-import-and-export.html">Backup, restore, import and export</a></li>
-<li><a href="Upgrade-from-original-sebsauvage/Shaarli.html">Upgrade from original sebsauvage/Shaarli</a></li>
<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>
<li><a href="Create-and-serve-multiple-Shaarlis-(farm).html">Create and serve multiple Shaarlis (farm)</a></li>
<li><a href="Download-CSS-styles-from-an-OPML-list.html">Download CSS styles from an OPML list</a></li>
<ul>
<li><a href="FAQ.html">FAQ</a></li>
<li><a href="Community-&-Related-software.html">Community & Related software</a></li>
-<li><a href="TODO.html">TODO</a></li>
</ul></li>
</ul>
</div>
<div id="local-sidebar">
<ul>
<li><a href="Home.html">Home</a></li>
-<li>Installation
+<li>Setup
<ul>
-<li><a href="Download.html">Download</a></li>
+<li><a href="Download-and-Installation.html">Download and Installation</a></li>
+<li><a href="Upgrade-and-migration.html">Upgrade and migration</a></li>
<li><a href="Server-requirements.html">Server requirements</a></li>
<li><a href="Server-configuration.html">Server configuration</a></li>
<li><a href="Server-security.html">Server security</a></li>
-<li><a href="Shaarli-installation.html">Shaarli installation</a></li>
<li><a href="Shaarli-configuration.html">Shaarli configuration</a></li>
<li><a href="Plugins.html">Plugins</a></li>
</ul></li>
<li>How To
<ul>
<li><a href="Backup,-restore,-import-and-export.html">Backup, restore, import and export</a></li>
-<li><a href="Upgrade-from-original-sebsauvage/Shaarli.html">Upgrade from original sebsauvage/Shaarli</a></li>
<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>
<li><a href="Create-and-serve-multiple-Shaarlis-(farm).html">Create and serve multiple Shaarlis (farm)</a></li>
<li><a href="Download-CSS-styles-from-an-OPML-list.html">Download CSS styles from an OPML list</a></li>
<ul>
<li><a href="FAQ.html">FAQ</a></li>
<li><a href="Community-&-Related-software.html">Community & Related software</a></li>
-<li><a href="TODO.html">TODO</a></li>
</ul></li>
</ul>
</div>
<div id="local-sidebar">
<ul>
<li><a href="Home.html">Home</a></li>
-<li>Installation
+<li>Setup
<ul>
-<li><a href="Download.html">Download</a></li>
+<li><a href="Download-and-Installation.html">Download and Installation</a></li>
+<li><a href="Upgrade-and-migration.html">Upgrade and migration</a></li>
<li><a href="Server-requirements.html">Server requirements</a></li>
<li><a href="Server-configuration.html">Server configuration</a></li>
<li><a href="Server-security.html">Server security</a></li>
-<li><a href="Shaarli-installation.html">Shaarli installation</a></li>
<li><a href="Shaarli-configuration.html">Shaarli configuration</a></li>
<li><a href="Plugins.html">Plugins</a></li>
</ul></li>
<li>How To
<ul>
<li><a href="Backup,-restore,-import-and-export.html">Backup, restore, import and export</a></li>
-<li><a href="Upgrade-from-original-sebsauvage/Shaarli.html">Upgrade from original sebsauvage/Shaarli</a></li>
<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>
<li><a href="Create-and-serve-multiple-Shaarlis-(farm).html">Create and serve multiple Shaarlis (farm)</a></li>
<li><a href="Download-CSS-styles-from-an-OPML-list.html">Download CSS styles from an OPML list</a></li>
<ul>
<li><a href="FAQ.html">FAQ</a></li>
<li><a href="Community-&-Related-software.html">Community & Related software</a></li>
-<li><a href="TODO.html">TODO</a></li>
</ul></li>
</ul>
</div>
<h1 id="directory-structure">Directory structure</h1>
<p>Here is the directory structure of Shaarli and the purpose of the different files:</p>
-<div class="sourceCode"><pre class="sourceCode bash"><code class="sourceCode bash"> <span class="kw">index.php</span> <span class="co"># Main program</span>
- <span class="kw">application/</span> <span class="co"># Shaarli classes</span>
- ├── <span class="kw">LinkDB.php</span>
- └── <span class="kw">Utils.php</span>
- <span class="kw">tests/</span> <span class="co"># Shaarli unitary & functional tests</span>
- ├── <span class="kw">LinkDBTest.php</span>
- ├── <span class="kw">utils</span> <span class="co"># utilities to ease testing</span>
- │ └── <span class="kw">ReferenceLinkDB.php</span>
- └── <span class="kw">UtilsTest.php</span>
- <span class="kw">COPYING</span> <span class="co"># Shaarli license</span>
- <span class="kw">inc/</span> <span class="co"># static assets and 3rd party libraries</span>
- ├── <span class="kw">awesomplete.*</span> <span class="co"># tags autocompletion library</span>
- ├── <span class="kw">blazy.*</span> <span class="co"># picture wall lazy image loading library</span>
- ├── <span class="kw">shaarli.css</span>, reset.css <span class="co"># Shaarli stylesheet.</span>
- ├── <span class="kw">qr.*</span> <span class="co"># qr code generation library</span>
- └──<span class="kw">rain.tpl.class.php</span> <span class="co"># RainTPL templating library</span>
- <span class="kw">tpl/</span> <span class="co"># RainTPL templates for Shaarli. They are used to build the pages.</span>
- <span class="kw">images/</span> <span class="co"># Images and icons used in Shaarli</span>
- <span class="kw">data/</span> <span class="co"># data storage: bookmark database, configuration, logs, banlist…</span>
- ├── <span class="kw">config.php</span> <span class="co"># Shaarli configuration (login, password, timezone, title…)</span>
- ├── <span class="kw">datastore.php</span> <span class="co"># Your link database (compressed).</span>
- ├── <span class="kw">ipban.php</span> <span class="co"># IP address ban system data</span>
- ├── <span class="kw">lastupdatecheck.txt</span> <span class="co"># Update check timestamp file</span>
- └──<span class="kw">log.txt</span> <span class="co"># login/IPban log.</span>
- <span class="kw">cache/</span> <span class="co"># thumbnails cache</span>
+<div class="sourceCode"><pre class="sourceCode bash"><code class="sourceCode bash"> <span class="ex">index.php</span> <span class="co"># Main program</span>
+ <span class="ex">application/</span> <span class="co"># Shaarli classes</span>
+ ├── <span class="ex">LinkDB.php</span>
+ └── <span class="ex">Utils.php</span>
+ <span class="ex">tests/</span> <span class="co"># Shaarli unitary & functional tests</span>
+ ├── <span class="ex">LinkDBTest.php</span>
+ ├── <span class="ex">utils</span> <span class="co"># utilities to ease testing</span>
+ │ └── <span class="ex">ReferenceLinkDB.php</span>
+ └── <span class="ex">UtilsTest.php</span>
+ <span class="ex">COPYING</span> <span class="co"># Shaarli license</span>
+ <span class="ex">inc/</span> <span class="co"># static assets and 3rd party libraries</span>
+ ├── <span class="ex">awesomplete.*</span> <span class="co"># tags autocompletion library</span>
+ ├── <span class="ex">blazy.*</span> <span class="co"># picture wall lazy image loading library</span>
+ ├── <span class="ex">shaarli.css</span>, reset.css <span class="co"># Shaarli stylesheet.</span>
+ ├── <span class="ex">qr.*</span> <span class="co"># qr code generation library</span>
+ └──<span class="ex">rain.tpl.class.php</span> <span class="co"># RainTPL templating library</span>
+ <span class="ex">tpl/</span> <span class="co"># RainTPL templates for Shaarli. They are used to build the pages.</span>
+ <span class="ex">images/</span> <span class="co"># Images and icons used in Shaarli</span>
+ <span class="ex">data/</span> <span class="co"># data storage: bookmark database, configuration, logs, banlist…</span>
+ ├── <span class="ex">config.php</span> <span class="co"># Shaarli configuration (login, password, timezone, title…)</span>
+ ├── <span class="ex">datastore.php</span> <span class="co"># Your link database (compressed).</span>
+ ├── <span class="ex">ipban.php</span> <span class="co"># IP address ban system data</span>
+ ├── <span class="ex">lastupdatecheck.txt</span> <span class="co"># Update check timestamp file</span>
+ └──<span class="ex">log.txt</span> <span class="co"># login/IPban log.</span>
+ <span class="ex">cache/</span> <span class="co"># thumbnails cache</span>
<span class="co"># This directory is automatically created. You can erase it anytime you want.</span>
- <span class="kw">tmp/</span> <span class="co"># Temporary directory for compiled RainTPL templates.</span>
+ <span class="ex">tmp/</span> <span class="co"># Temporary directory for compiled RainTPL templates.</span>
<span class="co"># This directory is automatically created. You can erase it anytime you want.</span></code></pre></div>
</body>
</html>
<div id="local-sidebar">
<ul>
<li><a href="Home.html">Home</a></li>
-<li>Installation
+<li>Setup
<ul>
-<li><a href="Download.html">Download</a></li>
+<li><a href="Download-and-Installation.html">Download and Installation</a></li>
+<li><a href="Upgrade-and-migration.html">Upgrade and migration</a></li>
<li><a href="Server-requirements.html">Server requirements</a></li>
<li><a href="Server-configuration.html">Server configuration</a></li>
<li><a href="Server-security.html">Server security</a></li>
-<li><a href="Shaarli-installation.html">Shaarli installation</a></li>
<li><a href="Shaarli-configuration.html">Shaarli configuration</a></li>
<li><a href="Plugins.html">Plugins</a></li>
</ul></li>
<li>How To
<ul>
<li><a href="Backup,-restore,-import-and-export.html">Backup, restore, import and export</a></li>
-<li><a href="Upgrade-from-original-sebsauvage/Shaarli.html">Upgrade from original sebsauvage/Shaarli</a></li>
<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>
<li><a href="Create-and-serve-multiple-Shaarlis-(farm).html">Create and serve multiple Shaarlis (farm)</a></li>
<li><a href="Download-CSS-styles-from-an-OPML-list.html">Download CSS styles from an OPML list</a></li>
<ul>
<li><a href="FAQ.html">FAQ</a></li>
<li><a href="Community-&-Related-software.html">Community & Related software</a></li>
-<li><a href="TODO.html">TODO</a></li>
</ul></li>
</ul>
</div>
<p>Install <a href="https://www.docker.com/">Docker</a>, by following the instructions relevant<a href=".html"></a><br />
to your OS / distribution, and start the service.</p>
<h4 id="search-an-image-on-dockerhub">Search an image on <a href="https://hub.docker.com/">DockerHub</a><a href=".html"></a></h4>
-<div class="sourceCode"><pre class="sourceCode bash"><code class="sourceCode bash">$ <span class="kw">docker</span> search debian
+<div class="sourceCode"><pre class="sourceCode bash"><code class="sourceCode bash">$ <span class="ex">docker</span> search debian
-<span class="kw">NAME</span> DESCRIPTION STARS OFFICIAL AUTOMATED
-<span class="kw">ubuntu</span> Ubuntu is a Debian-based Linux operating s... 2065 [OK][](.html)
-<span class="kw">debian</span> Debian is a Linux distribution that<span class="st">'s comp... 603 [OK][](.html)</span>
+<span class="ex">NAME</span> DESCRIPTION STARS OFFICIAL AUTOMATED
+<span class="ex">ubuntu</span> Ubuntu is a Debian-based Linux operating s... 2065 [OK][](.html)
+<span class="ex">debian</span> Debian is a Linux distribution that<span class="st">'s comp... 603 [OK][](.html)</span>
<span class="st">google/debian 47 [OK][](.html)</span></code></pre></div>
<h4 id="show-available-tags-for-a-repository">Show available tags for a repository</h4>
-<div class="sourceCode"><pre class="sourceCode bash"><code class="sourceCode bash">$ <span class="kw">curl</span> https://index.docker.io/v1/repositories/debian/tags <span class="kw">|</span> <span class="kw">python</span> -m json.tool
+<div class="sourceCode"><pre class="sourceCode bash"><code class="sourceCode bash">$ <span class="ex">curl</span> https://index.docker.io/v1/repositories/debian/tags <span class="kw">|</span> <span class="ex">python</span> -m json.tool
-<span class="kw">%</span> Total % Received % Xferd Average Speed Time Time Time Current
-<span class="kw">Dload</span> Upload Total Spent Left Speed
-<span class="kw">100</span> 1283 0 1283 0 0 433 0 --:--:-- 0:00:02 --:--:-- 433</code></pre></div>
+<span class="ex">%</span> Total % Received % Xferd Average Speed Time Time Time Current
+<span class="ex">Dload</span> Upload Total Spent Left Speed
+<span class="ex">100</span> 1283 0 1283 0 0 433 0 --:--:-- 0:00:02 --:--:-- 433</code></pre></div>
<p>Sample output:</p>
<div class="sourceCode"><pre class="sourceCode json"><code class="sourceCode json"><span class="ot">[[]</span><span class="er">(.html)</span>
<span class="fu">{</span>
<span class="fu">}</span>
<span class="ot">]</span></code></pre></div>
<h4 id="pull-an-image-from-dockerhub">Pull an image from DockerHub</h4>
-<div class="sourceCode"><pre class="sourceCode bash"><code class="sourceCode bash">$ <span class="kw">docker</span> pull repository[:tag][](.html)
+<div class="sourceCode"><pre class="sourceCode bash"><code class="sourceCode bash">$ <span class="ex">docker</span> pull repository[:tag][](.html)
-$ <span class="kw">docker</span> pull debian:wheezy
-<span class="kw">wheezy</span>: Pulling from debian
-<span class="kw">4c8cbfd2973e</span>: Pull complete
-<span class="kw">60c52dbe9d91</span>: Pull complete
-<span class="kw">Digest</span>: sha256:c584131da2ac1948aa3e66468a4424b6aea2f33acba7cec0b631bdb56254c4fe
-<span class="kw">Status</span>: Downloaded newer image for debian:wheezy</code></pre></div>
+$ <span class="ex">docker</span> pull debian:wheezy
+<span class="ex">wheezy</span>: Pulling from debian
+<span class="ex">4c8cbfd2973e</span>: Pull complete
+<span class="ex">60c52dbe9d91</span>: Pull complete
+<span class="ex">Digest</span>: sha256:c584131da2ac1948aa3e66468a4424b6aea2f33acba7cec0b631bdb56254c4fe
+<span class="ex">Status</span>: Downloaded newer image for debian:wheezy</code></pre></div>
<h2 id="get-and-run-a-shaarli-image">Get and run a Shaarli image</h2>
<h3 id="dockerhub-repository">DockerHub repository</h3>
<p>The images can be found in the <a href="https://hub.docker.com/r/shaarli/shaarli/"><code>shaarli/shaarli</code></a><a href=".html"></a><br />
<li><a href="http://nginx.org/">Nginx</a><a href=".html"></a></li>
</ul>
<h3 id="download-from-dockerhub">Download from DockerHub</h3>
-<div class="sourceCode"><pre class="sourceCode bash"><code class="sourceCode bash">$ <span class="kw">docker</span> pull shaarli/shaarli
-<span class="kw">latest</span>: Pulling from shaarli/shaarli
-<span class="kw">32716d9fcddb</span>: Pull complete
-<span class="kw">84899d045435</span>: Pull complete
-<span class="kw">4b6ad7444763</span>: Pull complete
-<span class="kw">e0345ef7a3e0</span>: Pull complete
-<span class="kw">5c1dd344094f</span>: Pull complete
-<span class="kw">6422305a200b</span>: Pull complete
-<span class="kw">7d63f861dbef</span>: Pull complete
-<span class="kw">3eb97210645c</span>: Pull complete
-<span class="kw">869319d746ff</span>: Already exists
-<span class="kw">869319d746ff</span>: Pulling fs layer
-<span class="kw">902b87aaaec9</span>: Already exists
-<span class="kw">Digest</span>: sha256:f836b4627b958b3f83f59c332f22f02fcd495ace3056f2be2c4912bd8704cc98
-<span class="kw">Status</span>: Downloaded newer image for shaarli/shaarli:latest</code></pre></div>
+<div class="sourceCode"><pre class="sourceCode bash"><code class="sourceCode bash">$ <span class="ex">docker</span> pull shaarli/shaarli
+<span class="ex">latest</span>: Pulling from shaarli/shaarli
+<span class="ex">32716d9fcddb</span>: Pull complete
+<span class="ex">84899d045435</span>: Pull complete
+<span class="ex">4b6ad7444763</span>: Pull complete
+<span class="ex">e0345ef7a3e0</span>: Pull complete
+<span class="ex">5c1dd344094f</span>: Pull complete
+<span class="ex">6422305a200b</span>: Pull complete
+<span class="ex">7d63f861dbef</span>: Pull complete
+<span class="ex">3eb97210645c</span>: Pull complete
+<span class="ex">869319d746ff</span>: Already exists
+<span class="ex">869319d746ff</span>: Pulling fs layer
+<span class="ex">902b87aaaec9</span>: Already exists
+<span class="ex">Digest</span>: sha256:f836b4627b958b3f83f59c332f22f02fcd495ace3056f2be2c4912bd8704cc98
+<span class="ex">Status</span>: Downloaded newer image for shaarli/shaarli:latest</code></pre></div>
<h3 id="create-and-start-a-new-container-from-the-image">Create and start a new container from the image</h3>
<div class="sourceCode"><pre class="sourceCode bash"><code class="sourceCode bash"><span class="co"># map the host's :8000 port to the container's :80 port</span>
-$ <span class="kw">docker</span> create -p 8000:80 shaarli/shaarli
-<span class="kw">d40b7af693d678958adedfb88f87d6ea0237186c23de5c4102a55a8fcb499101</span>
+$ <span class="ex">docker</span> create -p 8000:80 shaarli/shaarli
+<span class="ex">d40b7af693d678958adedfb88f87d6ea0237186c23de5c4102a55a8fcb499101</span>
<span class="co"># launch the container in the background</span>
-$ <span class="kw">docker</span> start d40b7af693d678958adedfb88f87d6ea0237186c23de5c4102a55a8fcb499101
-<span class="kw">d40b7af693d678958adedfb88f87d6ea0237186c23de5c4102a55a8fcb499101</span>
+$ <span class="ex">docker</span> start d40b7af693d678958adedfb88f87d6ea0237186c23de5c4102a55a8fcb499101
+<span class="ex">d40b7af693d678958adedfb88f87d6ea0237186c23de5c4102a55a8fcb499101</span>
<span class="co"># list active containers</span>
-$ <span class="kw">docker</span> ps
-<span class="kw">CONTAINER</span> ID IMAGE COMMAND CREATED STATUS PORTS NAMES
-<span class="kw">d40b7af693d6</span> shaarli/shaarli /usr/bin/supervisor 15 seconds ago Up 4 seconds 0.0.0.0:8000-<span class="kw">></span>80/tcp backstabbing_galileo</code></pre></div>
+$ <span class="ex">docker</span> ps
+<span class="ex">CONTAINER</span> ID IMAGE COMMAND CREATED STATUS PORTS NAMES
+<span class="ex">d40b7af693d6</span> shaarli/shaarli /usr/bin/supervisor 15 seconds ago Up 4 seconds 0.0.0.0:8000-<span class="op">></span>80/tcp backstabbing_galileo</code></pre></div>
<h3 id="stop-and-destroy-a-container">Stop and destroy a container</h3>
-<div class="sourceCode"><pre class="sourceCode bash"><code class="sourceCode bash">$ <span class="kw">docker</span> stop backstabbing_galileo <span class="co"># those docker guys are really rude to physicists!</span>
-<span class="kw">backstabbing_galileo</span>
+<div class="sourceCode"><pre class="sourceCode bash"><code class="sourceCode bash">$ <span class="ex">docker</span> stop backstabbing_galileo <span class="co"># those docker guys are really rude to physicists!</span>
+<span class="ex">backstabbing_galileo</span>
<span class="co"># check the container is stopped</span>
-$ <span class="kw">docker</span> ps
-<span class="kw">CONTAINER</span> ID IMAGE COMMAND CREATED STATUS PORTS NAMES
+$ <span class="ex">docker</span> ps
+<span class="ex">CONTAINER</span> ID IMAGE COMMAND CREATED STATUS PORTS NAMES
<span class="co"># list ALL containers</span>
-$ <span class="kw">docker</span> ps -a
-<span class="kw">CONTAINER</span> ID IMAGE COMMAND CREATED STATUS PORTS NAMES
-<span class="kw">d40b7af693d6</span> shaarli/shaarli /usr/bin/supervisor 5 minutes ago Exited (0) <span class="kw">48</span> seconds ago backstabbing_galileo
+$ <span class="ex">docker</span> ps -a
+<span class="ex">CONTAINER</span> ID IMAGE COMMAND CREATED STATUS PORTS NAMES
+<span class="ex">d40b7af693d6</span> shaarli/shaarli /usr/bin/supervisor 5 minutes ago Exited (0) <span class="ex">48</span> seconds ago backstabbing_galileo
<span class="co"># destroy the container</span>
-$ <span class="kw">docker</span> rm backstabbing_galileo <span class="co"># let's put an end to these barbarian practices</span>
-<span class="kw">backstabbing_galileo</span>
+$ <span class="ex">docker</span> rm backstabbing_galileo <span class="co"># let's put an end to these barbarian practices</span>
+<span class="ex">backstabbing_galileo</span>
-$ <span class="kw">docker</span> ps -a
-<span class="kw">CONTAINER</span> ID IMAGE COMMAND CREATED STATUS PORTS NAMES</code></pre></div>
+$ <span class="ex">docker</span> ps -a
+<span class="ex">CONTAINER</span> ID IMAGE COMMAND CREATED STATUS PORTS NAMES</code></pre></div>
<h2 id="resources">Resources</h2>
<h3 id="docker-1">Docker</h3>
<ul>
<div id="local-sidebar">
<ul>
<li><a href="Home.html">Home</a></li>
-<li>Installation
+<li>Setup
<ul>
-<li><a href="Download.html">Download</a></li>
+<li><a href="Download-and-Installation.html">Download and Installation</a></li>
+<li><a href="Upgrade-and-migration.html">Upgrade and migration</a></li>
<li><a href="Server-requirements.html">Server requirements</a></li>
<li><a href="Server-configuration.html">Server configuration</a></li>
<li><a href="Server-security.html">Server security</a></li>
-<li><a href="Shaarli-installation.html">Shaarli installation</a></li>
<li><a href="Shaarli-configuration.html">Shaarli configuration</a></li>
<li><a href="Plugins.html">Plugins</a></li>
</ul></li>
<li>How To
<ul>
<li><a href="Backup,-restore,-import-and-export.html">Backup, restore, import and export</a></li>
-<li><a href="Upgrade-from-original-sebsauvage/Shaarli.html">Upgrade from original sebsauvage/Shaarli</a></li>
<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>
<li><a href="Create-and-serve-multiple-Shaarlis-(farm).html">Create and serve multiple Shaarlis (farm)</a></li>
<li><a href="Download-CSS-styles-from-an-OPML-list.html">Download CSS styles from an OPML list</a></li>
<ul>
<li><a href="FAQ.html">FAQ</a></li>
<li><a href="Community-&-Related-software.html">Community & Related software</a></li>
-<li><a href="TODO.html">TODO</a></li>
</ul></li>
</ul>
</div>
<span class="co">/**</span>
<span class="co"> * Reading directory list, courtesy of http://www.laughing-buddha.net/php/dirlist/</span>
-<span class="co"> * </span><span class="kw">@param</span><span class="co"> </span><span class="kw">directory</span><span class="co"> the directory we want to list files of</span>
-<span class="co"> * </span><span class="kw">@return</span><span class="co"> a simple array containing the list of absolute file paths. Notice that current file (".") and parent one("..")</span>
+<span class="co"> * </span><span class="an">@param</span><span class="co"> </span><span class="cv">directory</span><span class="co"> the directory we want to list files of</span>
+<span class="co"> * </span><span class="an">@return</span><span class="co"> a simple array containing the list of absolute file paths. Notice that current file (".") and parent one("..")</span>
<span class="co"> * are not listed here</span>
<span class="co"> */</span>
<span class="kw">function</span> getDirectoryList <span class="ot">(</span><span class="kw">$directory</span><span class="ot">)</span> {
<meta charset="utf-8">
<meta name="generator" content="pandoc">
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">
- <title>Shaarli – Download</title>
+ <title>Shaarli – Download and Installation</title>
<style type="text/css">code{white-space: pre;}</style>
<style type="text/css">
div.sourceCode { overflow-x: auto; }
<div id="local-sidebar">
<ul>
<li><a href="Home.html">Home</a></li>
-<li>Installation
+<li>Setup
<ul>
-<li><a href="Download.html">Download</a></li>
+<li><a href="Download-and-Installation.html">Download and Installation</a></li>
+<li><a href="Upgrade-and-migration.html">Upgrade and migration</a></li>
<li><a href="Server-requirements.html">Server requirements</a></li>
<li><a href="Server-configuration.html">Server configuration</a></li>
<li><a href="Server-security.html">Server security</a></li>
-<li><a href="Shaarli-installation.html">Shaarli installation</a></li>
<li><a href="Shaarli-configuration.html">Shaarli configuration</a></li>
<li><a href="Plugins.html">Plugins</a></li>
</ul></li>
<li>How To
<ul>
<li><a href="Backup,-restore,-import-and-export.html">Backup, restore, import and export</a></li>
-<li><a href="Upgrade-from-original-sebsauvage/Shaarli.html">Upgrade from original sebsauvage/Shaarli</a></li>
<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>
<li><a href="Create-and-serve-multiple-Shaarlis-(farm).html">Create and serve multiple Shaarlis (farm)</a></li>
<li><a href="Download-CSS-styles-from-an-OPML-list.html">Download CSS styles from an OPML list</a></li>
<ul>
<li><a href="FAQ.html">FAQ</a></li>
<li><a href="Community-&-Related-software.html">Community & Related software</a></li>
-<li><a href="TODO.html">TODO</a></li>
</ul></li>
</ul>
</div>
-<h1 id="download">Download</h1>
-<h2 id="get-shaarli">Get Shaarli!</h2>
-<h3 id="latest-stable-revision">Latest stable revision</h3>
-<p>This revision has been <a href="https://github.com/shaarli/Shaarli/releases">released</a> and tested.<a href=".html"></a></p>
-<h4 id="clone-with-git-recommended">Clone with Git (recommended)</h4>
-<div class="sourceCode"><pre class="sourceCode bash"><code class="sourceCode bash">$ <span class="kw">git</span> clone https://github.com/shaarli/Shaarli.git -b stable shaarli</code></pre></div>
-<h4 id="download-as-an-archive">Download as an archive</h4>
-<div class="sourceCode"><pre class="sourceCode bash"><code class="sourceCode bash">$ <span class="kw">wget</span> https://github.com/shaarli/Shaarli/archive/stable.zip
-$ <span class="kw">unzip</span> stable.zip
-$ <span class="kw">mv</span> Shaarli-stable shaarli</code></pre></div>
-<p>Tarballs are also available:</p>
-<div class="sourceCode"><pre class="sourceCode bash"><code class="sourceCode bash">$ <span class="kw">wget</span> https://github.com/shaarli/Shaarli/archive/stable.tar.gz
-$ <span class="kw">tar</span> xvf stable.tar.gz
-$ <span class="kw">mv</span> Shaarli-stable shaarli</code></pre></div>
-<h3 id="development-mainline">Development (mainline)</h3>
+<h1 id="download-and-installation">Download and Installation</h1>
+<h1 id="get-shaarli">Get Shaarli!</h1>
+<p>To install Shaarli, simply place the files in a directory under your webserver's Document Root (or directly at the document root). Make sure your <a href="Server-requirements">server</a> is properly <a href="Server-configuration">configured</a>.<a href=".html"></a></p>
+<p>Several releases are available:</p>
+<hr />
+<h2 id="latest-release-recommended">Latest release (recommended)</h2>
+<p>Get the latest released version from the <a href="https://github.com/shaarli/Shaarli/releases">releases</a> page.<a href=".html"></a></p>
+<p>The current latest released version is <code>v0.7.0</code>.</p>
+<h3 id="download-as-an-archive">Download as an archive</h3>
+<p>As a .zip archive:</p>
+<div class="sourceCode"><pre class="sourceCode bash"><code class="sourceCode bash">$ <span class="fu">wget</span> https://github.com/shaarli/Shaarli/archive/v0.7.0.zip
+$ <span class="fu">unzip</span> Shaarli-v0.7.0.zip
+$ <span class="fu">mv</span> Shaarli-v0.7.0 /path/to/shaarli/</code></pre></div>
+<table style="width:46%;">
+<colgroup>
+<col style="width: 8%" />
+<col style="width: 37%" />
+</colgroup>
+<thead>
+<tr class="header">
+<th>!</th>
+<th>In most cases, download Shaarli from the <a href="https://github.com/shaarli/Shaarli/releases">releases</a> page. Cloning using <code>git</code> or downloading Github branches as zip files requires additional steps (see below).</th>
+</tr>
+</thead>
+<tbody>
+</tbody>
+</table>
+<hr />
+<h2 id="stable-version">Stable version</h2>
+<p>The stable version has been experienced by Shaarli users, and will receive security updates.</p>
+<h3 id="download-as-an-archive-1">Download as an archive</h3>
+<p>As a .zip archive:</p>
+<div class="sourceCode"><pre class="sourceCode bash"><code class="sourceCode bash">$ <span class="fu">wget</span> https://github.com/shaarli/Shaarli/archive/stable.zip
+$ <span class="fu">unzip</span> stable.zip
+$ <span class="fu">mv</span> Shaarli-stable /path/to/shaarli/</code></pre></div>
+<p>As a .tar.gz archive :</p>
+<div class="sourceCode"><pre class="sourceCode bash"><code class="sourceCode bash">$ <span class="fu">wget</span> https://github.com/shaarli/Shaarli/archive/stable.tar.gz
+$ <span class="fu">tar</span> xvf stable.tar.gz
+$ <span class="fu">mv</span> Shaarli-stable /path/to/shaarli/</code></pre></div>
+<h3 id="clone-with-git">Clone with Git</h3>
+<p><a href="https://getcomposer.org/">Composer</a> is required to build a functional Shaarli installation when pulling from git.<a href=".html"></a></p>
+<div class="sourceCode"><pre class="sourceCode bash"><code class="sourceCode bash">$ <span class="fu">git</span> clone https://github.com/shaarli/Shaarli.git -b stable /path/to/shaarli/
+<span class="co"># install/update third-party dependencies</span>
+$ <span class="bu">cd</span> /path/to/shaarli/
+$ <span class="ex">composer</span> update --no-dev</code></pre></div>
+<hr />
+<h2 id="development-version-mainline">Development version (mainline)</h2>
<p><em>Use at your own risk!</em></p>
-<p>To get the latest changes:</p>
-<div class="sourceCode"><pre class="sourceCode bash"><code class="sourceCode bash">$ <span class="kw">git</span> clone https://github.com/shaarli/Shaarli.git shaarli</code></pre></div>
+<p>To get the latest changes from the <code>master</code> branch:</p>
+<div class="sourceCode"><pre class="sourceCode bash"><code class="sourceCode bash"><span class="co"># clone the repository </span>
+$ <span class="fu">git</span> clone https://github.com/shaarli/Shaarli.git master /path/to/shaarli/
+<span class="co"># install/update third-party dependencies</span>
+$ <span class="bu">cd</span> /path/to/shaarli
+$ <span class="ex">composer</span> update --no-dev</code></pre></div>
+<hr />
+<h2 id="finish-installation">Finish Installation</h2>
+<p>Once Shaarli is downloaded and files have been placed at the correct location, open it this location your favorite browser.</p>
+<p><img src="http://i.imgur.com/wuMpDSN.png" alt="install screenshot" /><a href=".html"></a></p>
+<p>Setup your Shaarli installation, and it's ready to use!</p>
+<hr />
+<h2 id="updating-shaarli">Updating Shaarli</h2>
+<p>See <a href="Upgrade-and-migration">Upgrade and Migration</a><a href=".html"></a></p>
</body>
</html>
--- /dev/null
+#Download and Installation
+# Get Shaarli!
+
+To install Shaarli, simply place the files in a directory under your webserver's Document Root (or directly at the document root). Make sure your [server](Server-requirements) is properly [configured](Server-configuration).[](.html)
+
+Several releases are available:
+
+--------------------------------------------------------
+
+## Latest release (recommended)
+
+Get the latest released version from the [releases](https://github.com/shaarli/Shaarli/releases) page.[](.html)
+
+The current latest released version is `v0.7.0`.
+
+### Download as an archive
+
+As a .zip archive:
+
+```bash
+$ wget https://github.com/shaarli/Shaarli/archive/v0.7.0.zip
+$ unzip Shaarli-v0.7.0.zip
+$ mv Shaarli-v0.7.0 /path/to/shaarli/
+```
+
+
+| ! |In most cases, download Shaarli from the [releases](https://github.com/shaarli/Shaarli/releases) page. Cloning using `git` or downloading Github branches as zip files requires additional steps (see below).|[](.html)
+|-----|--------------------------|
+
+
+
+--------------------------------------------------------
+
+## Stable version
+
+The stable version has been experienced by Shaarli users, and will receive security updates.
+
+### Download as an archive
+
+As a .zip archive:
+
+```bash
+$ wget https://github.com/shaarli/Shaarli/archive/stable.zip
+$ unzip stable.zip
+$ mv Shaarli-stable /path/to/shaarli/
+```
+
+As a .tar.gz archive :
+
+```bash
+$ wget https://github.com/shaarli/Shaarli/archive/stable.tar.gz
+$ tar xvf stable.tar.gz
+$ mv Shaarli-stable /path/to/shaarli/
+```
+
+### Clone with Git
+
+[Composer](https://getcomposer.org/) is required to build a functional Shaarli installation when pulling from git.[](.html)
+
+```bash
+$ git clone https://github.com/shaarli/Shaarli.git -b stable /path/to/shaarli/
+# install/update third-party dependencies
+$ cd /path/to/shaarli/
+$ composer update --no-dev
+```
+
+--------------------------------------------------------
+
+## Development version (mainline)
+
+_Use at your own risk!_
+
+To get the latest changes from the `master` branch:
+
+```bash
+# clone the repository
+$ git clone https://github.com/shaarli/Shaarli.git master /path/to/shaarli/
+# install/update third-party dependencies
+$ cd /path/to/shaarli
+$ composer update --no-dev
+```
+
+--------------------------------------------------------
+
+## Finish Installation
+
+Once Shaarli is downloaded and files have been placed at the correct location, open it this location your favorite browser.
+
+![install screenshot](http://i.imgur.com/wuMpDSN.png)[](.html)
+
+Setup your Shaarli installation, and it's ready to use!
+
+--------------------------------------------------------
+
+## Updating Shaarli
+
+See [Upgrade and Migration](Upgrade-and-migration)[](.html)
+++ /dev/null
-#Download
-## Get Shaarli!
-### Latest stable revision
-This revision has been [released](https://github.com/shaarli/Shaarli/releases) and tested.[](.html)
-
-#### Clone with Git (recommended)
-```bash
-$ git clone https://github.com/shaarli/Shaarli.git -b stable shaarli
-```
-
-#### Download as an archive
-```bash
-$ wget https://github.com/shaarli/Shaarli/archive/stable.zip
-$ unzip stable.zip
-$ mv Shaarli-stable shaarli
-```
-
-Tarballs are also available:
-```bash
-$ wget https://github.com/shaarli/Shaarli/archive/stable.tar.gz
-$ tar xvf stable.tar.gz
-$ mv Shaarli-stable shaarli
-```
-
-### Development (mainline)
-_Use at your own risk!_
-
-To get the latest changes:
-```bash
-$ git clone https://github.com/shaarli/Shaarli.git shaarli
-```
<div id="local-sidebar">
<ul>
<li><a href="Home.html">Home</a></li>
-<li>Installation
+<li>Setup
<ul>
-<li><a href="Download.html">Download</a></li>
+<li><a href="Download-and-Installation.html">Download and Installation</a></li>
+<li><a href="Upgrade-and-migration.html">Upgrade and migration</a></li>
<li><a href="Server-requirements.html">Server requirements</a></li>
<li><a href="Server-configuration.html">Server configuration</a></li>
<li><a href="Server-security.html">Server security</a></li>
-<li><a href="Shaarli-installation.html">Shaarli installation</a></li>
<li><a href="Shaarli-configuration.html">Shaarli configuration</a></li>
<li><a href="Plugins.html">Plugins</a></li>
</ul></li>
<li>How To
<ul>
<li><a href="Backup,-restore,-import-and-export.html">Backup, restore, import and export</a></li>
-<li><a href="Upgrade-from-original-sebsauvage/Shaarli.html">Upgrade from original sebsauvage/Shaarli</a></li>
<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>
<li><a href="Create-and-serve-multiple-Shaarlis-(farm).html">Create and serve multiple Shaarlis (farm)</a></li>
<li><a href="Download-CSS-styles-from-an-OPML-list.html">Download CSS styles from an OPML list</a></li>
<ul>
<li><a href="FAQ.html">FAQ</a></li>
<li><a href="Community-&-Related-software.html">Community & Related software</a></li>
-<li><a href="TODO.html">TODO</a></li>
</ul></li>
</ul>
</div>
<div id="local-sidebar">
<ul>
<li><a href="Home.html">Home</a></li>
-<li>Installation
+<li>Setup
<ul>
-<li><a href="Download.html">Download</a></li>
+<li><a href="Download-and-Installation.html">Download and Installation</a></li>
+<li><a href="Upgrade-and-migration.html">Upgrade and migration</a></li>
<li><a href="Server-requirements.html">Server requirements</a></li>
<li><a href="Server-configuration.html">Server configuration</a></li>
<li><a href="Server-security.html">Server security</a></li>
-<li><a href="Shaarli-installation.html">Shaarli installation</a></li>
<li><a href="Shaarli-configuration.html">Shaarli configuration</a></li>
<li><a href="Plugins.html">Plugins</a></li>
</ul></li>
<li>How To
<ul>
<li><a href="Backup,-restore,-import-and-export.html">Backup, restore, import and export</a></li>
-<li><a href="Upgrade-from-original-sebsauvage/Shaarli.html">Upgrade from original sebsauvage/Shaarli</a></li>
<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>
<li><a href="Create-and-serve-multiple-Shaarlis-(farm).html">Create and serve multiple Shaarlis (farm)</a></li>
<li><a href="Download-CSS-styles-from-an-OPML-list.html">Download CSS styles from an OPML list</a></li>
<ul>
<li><a href="FAQ.html">FAQ</a></li>
<li><a href="Community-&-Related-software.html">Community & Related software</a></li>
-<li><a href="TODO.html">TODO</a></li>
</ul></li>
</ul>
</div>
<div id="local-sidebar">
<ul>
<li><a href="Home.html">Home</a></li>
-<li>Installation
+<li>Setup
<ul>
-<li><a href="Download.html">Download</a></li>
+<li><a href="Download-and-Installation.html">Download and Installation</a></li>
+<li><a href="Upgrade-and-migration.html">Upgrade and migration</a></li>
<li><a href="Server-requirements.html">Server requirements</a></li>
<li><a href="Server-configuration.html">Server configuration</a></li>
<li><a href="Server-security.html">Server security</a></li>
-<li><a href="Shaarli-installation.html">Shaarli installation</a></li>
<li><a href="Shaarli-configuration.html">Shaarli configuration</a></li>
<li><a href="Plugins.html">Plugins</a></li>
</ul></li>
<li>How To
<ul>
<li><a href="Backup,-restore,-import-and-export.html">Backup, restore, import and export</a></li>
-<li><a href="Upgrade-from-original-sebsauvage/Shaarli.html">Upgrade from original sebsauvage/Shaarli</a></li>
<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>
<li><a href="Create-and-serve-multiple-Shaarlis-(farm).html">Create and serve multiple Shaarlis (farm)</a></li>
<li><a href="Download-CSS-styles-from-an-OPML-list.html">Download CSS styles from an OPML list</a></li>
<ul>
<li><a href="FAQ.html">FAQ</a></li>
<li><a href="Community-&-Related-software.html">Community & Related software</a></li>
-<li><a href="TODO.html">TODO</a></li>
</ul></li>
</ul>
</div>
<div id="local-sidebar">
<ul>
<li><a href="Home.html">Home</a></li>
-<li>Installation
+<li>Setup
<ul>
-<li><a href="Download.html">Download</a></li>
+<li><a href="Download-and-Installation.html">Download and Installation</a></li>
+<li><a href="Upgrade-and-migration.html">Upgrade and migration</a></li>
<li><a href="Server-requirements.html">Server requirements</a></li>
<li><a href="Server-configuration.html">Server configuration</a></li>
<li><a href="Server-security.html">Server security</a></li>
-<li><a href="Shaarli-installation.html">Shaarli installation</a></li>
<li><a href="Shaarli-configuration.html">Shaarli configuration</a></li>
<li><a href="Plugins.html">Plugins</a></li>
</ul></li>
<li>How To
<ul>
<li><a href="Backup,-restore,-import-and-export.html">Backup, restore, import and export</a></li>
-<li><a href="Upgrade-from-original-sebsauvage/Shaarli.html">Upgrade from original sebsauvage/Shaarli</a></li>
<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>
<li><a href="Create-and-serve-multiple-Shaarlis-(farm).html">Create and serve multiple Shaarlis (farm)</a></li>
<li><a href="Download-CSS-styles-from-an-OPML-list.html">Download CSS styles from an OPML list</a></li>
<ul>
<li><a href="FAQ.html">FAQ</a></li>
<li><a href="Community-&-Related-software.html">Community & Related software</a></li>
-<li><a href="TODO.html">TODO</a></li>
</ul></li>
</ul>
</div>
<li><a href="https://help.github.com/articles/generating-a-gpg-key/">Generating a GPG key</a> (GitHub)<a href=".html"></a></li>
</ul>
<h3 id="gpg---provide-identity-information">gpg - provide identity information</h3>
-<div class="sourceCode"><pre class="sourceCode bash"><code class="sourceCode bash">$ <span class="kw">gpg</span> --gen-key
+<div class="sourceCode"><pre class="sourceCode bash"><code class="sourceCode bash">$ <span class="ex">gpg</span> --gen-key
-<span class="kw">gpg</span> (GnuPG) <span class="kw">2.1.6;</span> <span class="kw">Copyright</span> (C) <span class="kw">2015</span> Free Software Foundation, Inc.
-<span class="kw">This</span> is free software: you are free to change and redistribute it.
-<span class="kw">There</span> is NO WARRANTY, to the extent permitted by law.
+<span class="ex">gpg</span> (GnuPG) <span class="ex">2.1.6</span><span class="kw">;</span> <span class="ex">Copyright</span> (C) <span class="ex">2015</span> Free Software Foundation, Inc.
+<span class="ex">This</span> is free software: you are free to change and redistribute it.
+<span class="ex">There</span> is NO WARRANTY, to the extent permitted by law.
-<span class="kw">Note</span>: Use <span class="st">"gpg2 --full-gen-key"</span> for a full featured key generation dialog.
+<span class="ex">Note</span>: Use <span class="st">"gpg2 --full-gen-key"</span> for a full featured key generation dialog.
-<span class="kw">GnuPG</span> needs to construct a user ID to identify your key.
+<span class="ex">GnuPG</span> needs to construct a user ID to identify your key.
-<span class="kw">Real</span> name: Marvin the Paranoid Android
-<span class="kw">Email</span> address: marvin@h2g2.net
-<span class="kw">You</span> selected this USER-ID:
+<span class="ex">Real</span> name: Marvin the Paranoid Android
+<span class="ex">Email</span> address: marvin@h2g2.net
+<span class="ex">You</span> selected this USER-ID:
<span class="st">"Marvin the Paranoid Android <marvin@h2g2.net>"</span>
-<span class="kw">Change</span> (N)<span class="kw">ame</span>, (E)<span class="kw">mail</span>, or (O)<span class="kw">kay</span>/<span class="kw">(Q)uit?</span> o
-<span class="kw">We</span> need to generate a lot of random bytes. It is a good idea to perform
-<span class="kw">some</span> other action (type on the keyboard, move the mouse, utilize the
-<span class="kw">disks</span>) <span class="kw">during</span> the prime generation<span class="kw">;</span> <span class="kw">this</span> gives the random number
-<span class="kw">generator</span> a better chance to gain enough entropy.</code></pre></div>
+<span class="ex">Change</span> (N)<span class="ex">ame</span>, (E)<span class="ex">mail</span>, or (O)<span class="ex">kay</span>/<span class="kw">(</span><span class="ex">Q</span><span class="kw">)</span><span class="ex">uit?</span> o
+<span class="ex">We</span> need to generate a lot of random bytes. It is a good idea to perform
+<span class="ex">some</span> other action (type on the keyboard, move the mouse, utilize the
+<span class="ex">disks</span>) <span class="ex">during</span> the prime generation<span class="kw">;</span> <span class="ex">this</span> gives the random number
+<span class="ex">generator</span> a better chance to gain enough entropy.</code></pre></div>
<h3 id="gpg---entropy-interlude">gpg - entropy interlude</h3>
<p>At this point, you will:</p>
<ul>
<li>be asked to use your machine's input devices (mouse, keyboard, etc.) to generate random entropy; this step <em>may take some time</em></li>
</ul>
<h3 id="gpg---key-creation-confirmation">gpg - key creation confirmation</h3>
-<div class="sourceCode"><pre class="sourceCode bash"><code class="sourceCode bash"><span class="kw">gpg</span>: key A9D53A3E marked as ultimately trusted
-<span class="kw">public</span> and secret key created and signed.
+<div class="sourceCode"><pre class="sourceCode bash"><code class="sourceCode bash"><span class="ex">gpg</span>: key A9D53A3E marked as ultimately trusted
+<span class="ex">public</span> and secret key created and signed.
-<span class="kw">gpg</span>: checking the trustdb
-<span class="kw">gpg</span>: 3 marginal(s) <span class="kw">needed</span>, 1 complete(s) <span class="kw">needed</span>, PGP trust model
-<span class="kw">gpg</span>: depth: 0 valid: 2 signed: 0 trust: 0-, 0q, 0n, 0m, 0f, 2u
-<span class="kw">pub</span> rsa2048/A9D53A3E 2015-07-31
- <span class="kw">Key</span> fingerprint = AF2A 5381 E54B 2FD2 14C4 A9A3 0E35 ACA4 A9D5 3A3E
-<span class="kw">uid</span> [ultimate] Marvin the Paranoid Android <span class="kw"><</span>marvin@h2g2.net<span class="kw">></span>[](.html)
-<span class="kw">sub</span> rsa2048/8C0EACF1 2015-07-31</code></pre></div>
+<span class="ex">gpg</span>: checking the trustdb
+<span class="ex">gpg</span>: 3 marginal(s) <span class="ex">needed</span>, 1 complete(s) <span class="ex">needed</span>, PGP trust model
+<span class="ex">gpg</span>: depth: 0 valid: 2 signed: 0 trust: 0-, 0q, 0n, 0m, 0f, 2u
+<span class="ex">pub</span> rsa2048/A9D53A3E 2015-07-31
+ <span class="ex">Key</span> fingerprint = AF2A 5381 E54B 2FD2 14C4 A9A3 0E35 ACA4 A9D5 3A3E
+<span class="ex">uid</span> [ultimate] Marvin the Paranoid Android <span class="op"><</span>marvin@h2g2.net<span class="op">></span>[](.html)
+<span class="ex">sub</span> rsa2048/8C0EACF1 2015-07-31</code></pre></div>
<h3 id="gpg---submit-your-public-key-to-a-pgp-server-optional">gpg - submit your public key to a PGP server (Optional)</h3>
-<div class="sourceCode"><pre class="sourceCode bash"><code class="sourceCode bash">$ <span class="kw">gpg</span> --keyserver pgp.mit.edu --send-keys A9D53A3E
-<span class="kw">gpg</span>: sending key A9D53A3E to hkp server pgp.mit.edu</code></pre></div>
+<div class="sourceCode"><pre class="sourceCode bash"><code class="sourceCode bash">$ <span class="ex">gpg</span> --keyserver pgp.mit.edu --send-keys A9D53A3E
+<span class="ex">gpg</span>: sending key A9D53A3E to hkp server pgp.mit.edu</code></pre></div>
<h2 id="create-and-push-a-gpg-signed-tag">Create and push a GPG-signed tag</h2>
<p>See <a href="Release-Shaarli.html">Release Shaarli</a>.</p>
</body>
<div id="local-sidebar">
<ul>
<li><a href="Home.html">Home</a></li>
-<li>Installation
+<li>Setup
<ul>
-<li><a href="Download.html">Download</a></li>
+<li><a href="Download-and-Installation.html">Download and Installation</a></li>
+<li><a href="Upgrade-and-migration.html">Upgrade and migration</a></li>
<li><a href="Server-requirements.html">Server requirements</a></li>
<li><a href="Server-configuration.html">Server configuration</a></li>
<li><a href="Server-security.html">Server security</a></li>
-<li><a href="Shaarli-installation.html">Shaarli installation</a></li>
<li><a href="Shaarli-configuration.html">Shaarli configuration</a></li>
<li><a href="Plugins.html">Plugins</a></li>
</ul></li>
<li>How To
<ul>
<li><a href="Backup,-restore,-import-and-export.html">Backup, restore, import and export</a></li>
-<li><a href="Upgrade-from-original-sebsauvage/Shaarli.html">Upgrade from original sebsauvage/Shaarli</a></li>
<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>
<li><a href="Create-and-serve-multiple-Shaarlis-(farm).html">Create and serve multiple Shaarlis (farm)</a></li>
<li><a href="Download-CSS-styles-from-an-OPML-list.html">Download CSS styles from an OPML list</a></li>
<ul>
<li><a href="FAQ.html">FAQ</a></li>
<li><a href="Community-&-Related-software.html">Community & Related software</a></li>
-<li><a href="TODO.html">TODO</a></li>
</ul></li>
</ul>
</div>
<div id="local-sidebar">
<ul>
<li><a href="Home.html">Home</a></li>
-<li>Installation
+<li>Setup
<ul>
-<li><a href="Download.html">Download</a></li>
+<li><a href="Download-and-Installation.html">Download and Installation</a></li>
+<li><a href="Upgrade-and-migration.html">Upgrade and migration</a></li>
<li><a href="Server-requirements.html">Server requirements</a></li>
<li><a href="Server-configuration.html">Server configuration</a></li>
<li><a href="Server-security.html">Server security</a></li>
-<li><a href="Shaarli-installation.html">Shaarli installation</a></li>
<li><a href="Shaarli-configuration.html">Shaarli configuration</a></li>
<li><a href="Plugins.html">Plugins</a></li>
</ul></li>
<li>How To
<ul>
<li><a href="Backup,-restore,-import-and-export.html">Backup, restore, import and export</a></li>
-<li><a href="Upgrade-from-original-sebsauvage/Shaarli.html">Upgrade from original sebsauvage/Shaarli</a></li>
<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>
<li><a href="Create-and-serve-multiple-Shaarlis-(farm).html">Create and serve multiple Shaarlis (farm)</a></li>
<li><a href="Download-CSS-styles-from-an-OPML-list.html">Download CSS styles from an OPML list</a></li>
<ul>
<li><a href="FAQ.html">FAQ</a></li>
<li><a href="Community-&-Related-software.html">Community & Related software</a></li>
-<li><a href="TODO.html">TODO</a></li>
</ul></li>
</ul>
</div>
<div id="local-sidebar">
<ul>
<li><a href="Home.html">Home</a></li>
-<li>Installation
+<li>Setup
<ul>
-<li><a href="Download.html">Download</a></li>
+<li><a href="Download-and-Installation.html">Download and Installation</a></li>
+<li><a href="Upgrade-and-migration.html">Upgrade and migration</a></li>
<li><a href="Server-requirements.html">Server requirements</a></li>
<li><a href="Server-configuration.html">Server configuration</a></li>
<li><a href="Server-security.html">Server security</a></li>
-<li><a href="Shaarli-installation.html">Shaarli installation</a></li>
<li><a href="Shaarli-configuration.html">Shaarli configuration</a></li>
<li><a href="Plugins.html">Plugins</a></li>
</ul></li>
<li>How To
<ul>
<li><a href="Backup,-restore,-import-and-export.html">Backup, restore, import and export</a></li>
-<li><a href="Upgrade-from-original-sebsauvage/Shaarli.html">Upgrade from original sebsauvage/Shaarli</a></li>
<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>
<li><a href="Create-and-serve-multiple-Shaarlis-(farm).html">Create and serve multiple Shaarlis (farm)</a></li>
<li><a href="Download-CSS-styles-from-an-OPML-list.html">Download CSS styles from an OPML list</a></li>
<ul>
<li><a href="FAQ.html">FAQ</a></li>
<li><a href="Community-&-Related-software.html">Community & Related software</a></li>
-<li><a href="TODO.html">TODO</a></li>
</ul></li>
</ul>
</div>
<div id="local-sidebar">
<ul>
<li><a href="Home.html">Home</a></li>
-<li>Installation
+<li>Setup
<ul>
-<li><a href="Download.html">Download</a></li>
+<li><a href="Download-and-Installation.html">Download and Installation</a></li>
+<li><a href="Upgrade-and-migration.html">Upgrade and migration</a></li>
<li><a href="Server-requirements.html">Server requirements</a></li>
<li><a href="Server-configuration.html">Server configuration</a></li>
<li><a href="Server-security.html">Server security</a></li>
-<li><a href="Shaarli-installation.html">Shaarli installation</a></li>
<li><a href="Shaarli-configuration.html">Shaarli configuration</a></li>
<li><a href="Plugins.html">Plugins</a></li>
</ul></li>
<li>How To
<ul>
<li><a href="Backup,-restore,-import-and-export.html">Backup, restore, import and export</a></li>
-<li><a href="Upgrade-from-original-sebsauvage/Shaarli.html">Upgrade from original sebsauvage/Shaarli</a></li>
<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>
<li><a href="Create-and-serve-multiple-Shaarlis-(farm).html">Create and serve multiple Shaarlis (farm)</a></li>
<li><a href="Download-CSS-styles-from-an-OPML-list.html">Download CSS styles from an OPML list</a></li>
<ul>
<li><a href="FAQ.html">FAQ</a></li>
<li><a href="Community-&-Related-software.html">Community & Related software</a></li>
-<li><a href="TODO.html">TODO</a></li>
</ul></li>
</ul>
</div>
<div id="local-sidebar">
<ul>
<li><a href="Home.html">Home</a></li>
-<li>Installation
+<li>Setup
<ul>
-<li><a href="Download.html">Download</a></li>
+<li><a href="Download-and-Installation.html">Download and Installation</a></li>
+<li><a href="Upgrade-and-migration.html">Upgrade and migration</a></li>
<li><a href="Server-requirements.html">Server requirements</a></li>
<li><a href="Server-configuration.html">Server configuration</a></li>
<li><a href="Server-security.html">Server security</a></li>
-<li><a href="Shaarli-installation.html">Shaarli installation</a></li>
<li><a href="Shaarli-configuration.html">Shaarli configuration</a></li>
<li><a href="Plugins.html">Plugins</a></li>
</ul></li>
<li>How To
<ul>
<li><a href="Backup,-restore,-import-and-export.html">Backup, restore, import and export</a></li>
-<li><a href="Upgrade-from-original-sebsauvage/Shaarli.html">Upgrade from original sebsauvage/Shaarli</a></li>
<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>
<li><a href="Create-and-serve-multiple-Shaarlis-(farm).html">Create and serve multiple Shaarlis (farm)</a></li>
<li><a href="Download-CSS-styles-from-an-OPML-list.html">Download CSS styles from an OPML list</a></li>
<ul>
<li><a href="FAQ.html">FAQ</a></li>
<li><a href="Community-&-Related-software.html">Community & Related software</a></li>
-<li><a href="TODO.html">TODO</a></li>
</ul></li>
</ul>
</div>
<h1 id="release-shaarli">Release Shaarli</h1>
<p>See <a href="http://git-scm.com/book/en/v2/Distributed-Git-Maintaining-a-Project#Tagging-Your-Releases">Git - Maintaining a project - Tagging your [](.html)<br />
releases</a>.</p>
-<h3 id="prerequisites">Prerequisites</h3>
+<h2 id="prerequisites">Prerequisites</h2>
<p>This guide assumes that you have:</p>
<ul>
<li>a GPG key matching your GitHub authentication credentials
<li><code>upstream</code> pointing to the main Shaarli repository</li>
</ul></li>
<li>maintainer permissions on the main Shaarli repository (to push the signed tag)</li>
-<li><a href="http://pandoc.org/">Pandoc</a> needs to be installed.<a href=".html"></a></li>
+<li><a href="https://getcomposer.org/">Composer</a> and <a href="http://pandoc.org/">Pandoc</a> need to be installed<a href=".html"></a></li>
</ul>
+<h2 id="increment-the-version-code-create-and-push-a-signed-tag">Increment the version code, create and push a signed tag</h2>
<h3 id="bump-shaarlis-version">Bump Shaarli's version</h3>
-<div class="sourceCode"><pre class="sourceCode bash"><code class="sourceCode bash">$ <span class="kw">cd</span> /path/to/shaarli
+<div class="sourceCode"><pre class="sourceCode bash"><code class="sourceCode bash">$ <span class="bu">cd</span> /path/to/shaarli
<span class="co"># create a new branch</span>
-$ <span class="kw">git</span> fetch upstream
-$ <span class="kw">git</span> checkout upstream/master -b v0.5.0
+$ <span class="fu">git</span> fetch upstream
+$ <span class="fu">git</span> checkout upstream/master -b v0.5.0
<span class="co"># bump the version number</span>
-$ <span class="kw">vim</span> index.php shaarli_version.php
+$ <span class="ex">vim</span> index.php shaarli_version.php
<span class="co"># rebuild the documentation from the wiki</span>
-$ <span class="kw">make</span> htmldoc
+$ <span class="fu">make</span> htmldoc
<span class="co"># commit the changes</span>
-$ <span class="kw">git</span> add index.php shaarli_version.php doc
-$ <span class="kw">git</span> commit -s -m <span class="st">"Bump version to v0.5.0"</span>
+$ <span class="fu">git</span> add index.php shaarli_version.php doc
+$ <span class="fu">git</span> commit -s -m <span class="st">"Bump version to v0.5.0"</span>
<span class="co"># push the commit on your GitHub fork</span>
-$ <span class="kw">git</span> push origin v0.5.0</code></pre></div>
+$ <span class="fu">git</span> push origin v0.5.0</code></pre></div>
<h3 id="create-and-merge-a-pull-request">Create and merge a Pull Request</h3>
<p>This one is pretty straightforward ;-)</p>
<h3 id="create-and-push-a-signed-tag">Create and push a signed tag</h3>
<div class="sourceCode"><pre class="sourceCode bash"><code class="sourceCode bash"><span class="co"># update your local copy</span>
-$ <span class="kw">git</span> checkout master
-$ <span class="kw">git</span> fetch upstream
-$ <span class="kw">git</span> pull upstream master
+$ <span class="fu">git</span> checkout master
+$ <span class="fu">git</span> fetch upstream
+$ <span class="fu">git</span> pull upstream master
<span class="co"># create a signed tag</span>
-$ <span class="kw">git</span> tag -s -m <span class="st">"Release v0.5.0"</span> v0.5.0
+$ <span class="fu">git</span> tag -s -m <span class="st">"Release v0.5.0"</span> v0.5.0
<span class="co"># push it to "upstream"</span>
-$ <span class="kw">git</span> push --tags upstream</code></pre></div>
+$ <span class="fu">git</span> push --tags upstream</code></pre></div>
<h3 id="verify-a-signed-tag">Verify a signed tag</h3>
<p><a href="https://github.com/shaarli/Shaarli/releases/tag/v0.5.0"><code>v0.5.0</code></a> is the first GPG-signed tag pushed on the Community Shaarli.<a href=".html"></a></p>
<p>Let's have a look at its signature!</p>
-<div class="sourceCode"><pre class="sourceCode bash"><code class="sourceCode bash">$ <span class="kw">cd</span> /path/to/shaarli
-$ <span class="kw">git</span> fetch upstream
+<div class="sourceCode"><pre class="sourceCode bash"><code class="sourceCode bash">$ <span class="bu">cd</span> /path/to/shaarli
+$ <span class="fu">git</span> fetch upstream
<span class="co"># get the SHA1 reference of the tag</span>
-$ <span class="kw">git</span> show-ref tags/v0.5.0
-<span class="kw">f7762cf803f03f5caf4b8078359a63783d0090c1</span> refs/tags/v0.5.0
+$ <span class="fu">git</span> show-ref tags/v0.5.0
+<span class="ex">f7762cf803f03f5caf4b8078359a63783d0090c1</span> refs/tags/v0.5.0
<span class="co"># verify the tag signature information</span>
-$ <span class="kw">git</span> verify-tag f7762cf803f03f5caf4b8078359a63783d0090c1
-<span class="kw">gpg</span>: Signature made Thu 30 Jul 2015 11:46:34 CEST using RSA key ID 4100DF6F
-<span class="kw">gpg</span>: Good signature from <span class="st">"VirtualTam <virtualtam@flibidi.net>"</span> [ultimate][](.html)</code></pre></div>
+$ <span class="fu">git</span> verify-tag f7762cf803f03f5caf4b8078359a63783d0090c1
+<span class="ex">gpg</span>: Signature made Thu 30 Jul 2015 11:46:34 CEST using RSA key ID 4100DF6F
+<span class="ex">gpg</span>: Good signature from <span class="st">"VirtualTam <virtualtam@flibidi.net>"</span> [ultimate][](.html)</code></pre></div>
+<h2 id="generate-and-upload-all-in-one-release-archives">Generate and upload all-in-one release archives</h2>
+<p>Users with a shared hosting may have:</p>
+<ul>
+<li>no SSH access</li>
+<li>no possibility to install PHP packages or server extensions</li>
+<li>no possibility to run scripts</li>
+</ul>
+<p>To ease Shaarli installations, it is possible to generate and upload additional release archives,<br />
+that will contain Shaarli code plus all required third-party libraries:</p>
+<div class="sourceCode"><pre class="sourceCode bash"><code class="sourceCode bash">$ <span class="fu">make</span> release_archive</code></pre></div>
+<p>This will create the following archives:</p>
+<ul>
+<li><code>shaarli-vX.Y.Z-full.tar</code></li>
+<li><code>shaarli-vX.Y.Z-full.zip</code></li>
+</ul>
+<p>The archives need to be manually uploaded on the previously created GitHub release.</p>
</body>
</html>
See [Git - Maintaining a project - Tagging your [](.html)
releases](http://git-scm.com/book/en/v2/Distributed-Git-Maintaining-a-Project#Tagging-Your-Releases).
-### Prerequisites
+## Prerequisites
This guide assumes that you have:
- a GPG key matching your GitHub authentication credentials
- i.e., the email address identified by the GPG key is the same as the one in your `~/.gitconfig`
- `origin` pointing to your GitHub fork
- `upstream` pointing to the main Shaarli repository
- maintainer permissions on the main Shaarli repository (to push the signed tag)
-- [Pandoc](http://pandoc.org/) needs to be installed.[](.html)
+- [Composer](https://getcomposer.org/) and [Pandoc](http://pandoc.org/) need to be installed[](.html)
+## Increment the version code, create and push a signed tag
### Bump Shaarli's version
```bash
$ cd /path/to/shaarli
gpg: Signature made Thu 30 Jul 2015 11:46:34 CEST using RSA key ID 4100DF6F
gpg: Good signature from "VirtualTam <virtualtam@flibidi.net>" [ultimate][](.html)
```
+
+## Generate and upload all-in-one release archives
+Users with a shared hosting may have:
+- no SSH access
+- no possibility to install PHP packages or server extensions
+- no possibility to run scripts
+
+To ease Shaarli installations, it is possible to generate and upload additional release archives,
+that will contain Shaarli code plus all required third-party libraries:
+
+```bash
+$ make release_archive
+```
+
+This will create the following archives:
+- `shaarli-vX.Y.Z-full.tar`
+- `shaarli-vX.Y.Z-full.zip`
+
+The archives need to be manually uploaded on the previously created GitHub release.
<div id="local-sidebar">
<ul>
<li><a href="Home.html">Home</a></li>
-<li>Installation
+<li>Setup
<ul>
-<li><a href="Download.html">Download</a></li>
+<li><a href="Download-and-Installation.html">Download and Installation</a></li>
+<li><a href="Upgrade-and-migration.html">Upgrade and migration</a></li>
<li><a href="Server-requirements.html">Server requirements</a></li>
<li><a href="Server-configuration.html">Server configuration</a></li>
<li><a href="Server-security.html">Server security</a></li>
-<li><a href="Shaarli-installation.html">Shaarli installation</a></li>
<li><a href="Shaarli-configuration.html">Shaarli configuration</a></li>
<li><a href="Plugins.html">Plugins</a></li>
</ul></li>
<li>How To
<ul>
<li><a href="Backup,-restore,-import-and-export.html">Backup, restore, import and export</a></li>
-<li><a href="Upgrade-from-original-sebsauvage/Shaarli.html">Upgrade from original sebsauvage/Shaarli</a></li>
<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>
<li><a href="Create-and-serve-multiple-Shaarlis-(farm).html">Create and serve multiple Shaarlis (farm)</a></li>
<li><a href="Download-CSS-styles-from-an-OPML-list.html">Download CSS styles from an OPML list</a></li>
<ul>
<li><a href="FAQ.html">FAQ</a></li>
<li><a href="Community-&-Related-software.html">Community & Related software</a></li>
-<li><a href="TODO.html">TODO</a></li>
</ul></li>
</ul>
</div>
<div id="local-sidebar">
<ul>
<li><a href="Home.html">Home</a></li>
-<li>Installation
+<li>Setup
<ul>
-<li><a href="Download.html">Download</a></li>
+<li><a href="Download-and-Installation.html">Download and Installation</a></li>
+<li><a href="Upgrade-and-migration.html">Upgrade and migration</a></li>
<li><a href="Server-requirements.html">Server requirements</a></li>
<li><a href="Server-configuration.html">Server configuration</a></li>
<li><a href="Server-security.html">Server security</a></li>
-<li><a href="Shaarli-installation.html">Shaarli installation</a></li>
<li><a href="Shaarli-configuration.html">Shaarli configuration</a></li>
<li><a href="Plugins.html">Plugins</a></li>
</ul></li>
<li>How To
<ul>
<li><a href="Backup,-restore,-import-and-export.html">Backup, restore, import and export</a></li>
-<li><a href="Upgrade-from-original-sebsauvage/Shaarli.html">Upgrade from original sebsauvage/Shaarli</a></li>
<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>
<li><a href="Create-and-serve-multiple-Shaarlis-(farm).html">Create and serve multiple Shaarlis (farm)</a></li>
<li><a href="Download-CSS-styles-from-an-OPML-list.html">Download CSS styles from an OPML list</a></li>
<ul>
<li><a href="FAQ.html">FAQ</a></li>
<li><a href="Community-&-Related-software.html">Community & Related software</a></li>
-<li><a href="TODO.html">TODO</a></li>
</ul></li>
</ul>
</div>
<p>See also <a href="https://github.com/shaarli/Shaarli/issues?utf8=%E2%9C%93&q=label%3Aproxy+">proxy-related</a> issues.<a href=".html"></a></p>
<h2 id="apache">Apache</h2>
<h3 id="minimal">Minimal</h3>
-<div class="sourceCode"><pre class="sourceCode apache"><code class="sourceCode apache"><span class="fu"><VirtualHost</span><span class="ot"> *:80</span><span class="fu">></span>
+<div class="sourceCode"><pre class="sourceCode apache"><code class="sourceCode apache"><span class="fu"><VirtualHost</span><span class="at"> *:80</span><span class="fu">></span>
ServerName<span class="st"> shaarli.my-domain.org</span>
DocumentRoot<span class="st"> /absolute/path/to/shaarli/</span>
<span class="fu"></VirtualHost></span></code></pre></div>
<li><a href="http://stackoverflow.com/q/176">Apache/PHP - error log per VirtualHost</a> (StackOverflow)<a href=".html"></a></li>
<li><a href="https://ma.ttias.be/php-php_value-vs-php_admin_value-and-the-use-of-php_flag-explained/">PHP: php_value vs php_admin_value and the use of php_flag explained</a><a href=".html"></a></li>
</ul>
-<div class="sourceCode"><pre class="sourceCode apache"><code class="sourceCode apache"><span class="fu"><VirtualHost</span><span class="ot"> *:80</span><span class="fu">></span>
+<div class="sourceCode"><pre class="sourceCode apache"><code class="sourceCode apache"><span class="fu"><VirtualHost</span><span class="at"> *:80</span><span class="fu">></span>
ServerName<span class="st"> shaarli.my-domain.org</span>
DocumentRoot<span class="st"> /absolute/path/to/shaarli/</span>
- <span class="ot">LogLevel</span><span class="ch"> </span><span class="kw">warn</span>
+ <span class="ex">LogLevel</span><span class="ch"> </span><span class="kw">warn</span>
ErrorLog<span class="st"> /var/log/apache2/shaarli-error.log</span>
CustomLog<span class="st"> /var/log/apache2/shaarli-access.log combined</span>
php_value error_log /var/log/apache2/shaarli-php-error.log
<span class="fu"></VirtualHost></span></code></pre></div>
<h3 id="standard---keep-access-and-error-logs">Standard - Keep access and error logs</h3>
-<div class="sourceCode"><pre class="sourceCode apache"><code class="sourceCode apache"><span class="fu"><VirtualHost</span><span class="ot"> *:80</span><span class="fu">></span>
+<div class="sourceCode"><pre class="sourceCode apache"><code class="sourceCode apache"><span class="fu"><VirtualHost</span><span class="at"> *:80</span><span class="fu">></span>
ServerName<span class="st"> shaarli.my-domain.org</span>
DocumentRoot<span class="st"> /absolute/path/to/shaarli/</span>
- <span class="ot">LogLevel</span><span class="ch"> </span><span class="kw">warn</span>
+ <span class="ex">LogLevel</span><span class="ch"> </span><span class="kw">warn</span>
ErrorLog<span class="st"> /var/log/apache2/shaarli-error.log</span>
CustomLog<span class="st"> /var/log/apache2/shaarli-access.log combined</span>
<span class="fu"></VirtualHost></span></code></pre></div>
<h3 id="paranoid---redirect-http-80-to-https-443">Paranoid - Redirect HTTP (:80) to HTTPS (:443)</h3>
<p>See <a href="https://wiki.mozilla.org/Security/Server_Side_TLS#Apache">Server-side TLS</a> (Mozilla).<a href=".html"></a></p>
-<div class="sourceCode"><pre class="sourceCode apache"><code class="sourceCode apache"><span class="fu"><VirtualHost</span><span class="ot"> *:443</span><span class="fu">></span>
+<div class="sourceCode"><pre class="sourceCode apache"><code class="sourceCode apache"><span class="fu"><VirtualHost</span><span class="at"> *:443</span><span class="fu">></span>
ServerName<span class="st"> shaarli.my-domain.org</span>
DocumentRoot<span class="st"> /absolute/path/to/shaarli/</span>
- <span class="ot">SSLEngine</span><span class="ch"> </span><span class="kw">on</span>
+ <span class="ex">SSLEngine</span><span class="ch"> </span><span class="kw">on</span>
SSLCertificateFile<span class="st"> /absolute/path/to/the/website/certificate.pem</span>
SSLCertificateKeyFile<span class="st"> /absolute/path/to/the/website/key.key</span>
- <span class="fu"><Directory</span><span class="ot"> /absolute/path/to/shaarli/</span><span class="fu">></span>
- <span class="ot">AllowOverride</span><span class="ch"> </span><span class="kw">All</span>
- <span class="ot">Options</span><span class="ch"> </span><span class="kw">Indexes</span><span class="ch"> </span><span class="kw">FollowSymLinks</span><span class="ch"> </span><span class="kw">MultiViews</span>
- <span class="ot">Order</span><span class="ch"> </span><span class="kw">allow,deny</span>
+ <span class="fu"><Directory</span><span class="at"> /absolute/path/to/shaarli/</span><span class="fu">></span>
+ <span class="ex">AllowOverride</span><span class="ch"> </span><span class="kw">All</span>
+ <span class="ex">Options</span><span class="ch"> </span><span class="kw">Indexes</span><span class="ch"> </span><span class="kw">FollowSymLinks</span><span class="ch"> </span><span class="kw">MultiViews</span>
+ <span class="ex">Order</span><span class="ch"> </span><span class="kw">allow,deny</span>
allow<span class="st"> from all</span>
<span class="fu"></Directory></span>
- <span class="ot">LogLevel</span><span class="ch"> </span><span class="kw">warn</span>
+ <span class="ex">LogLevel</span><span class="ch"> </span><span class="kw">warn</span>
ErrorLog<span class="st"> /var/log/apache2/shaarli-error.log</span>
CustomLog<span class="st"> /var/log/apache2/shaarli-access.log combined</span>
<span class="fu"></VirtualHost></span>
-<span class="fu"><VirtualHost</span><span class="ot"> *:80</span><span class="fu">></span>
+<span class="fu"><VirtualHost</span><span class="at"> *:80</span><span class="fu">></span>
ServerName<span class="st"> shaarli.my-domain.org</span>
Redirect<span class="st"> 301 / https://shaarli.my-domain.org</span>
- <span class="ot">LogLevel</span><span class="ch"> </span><span class="kw">warn</span>
+ <span class="ex">LogLevel</span><span class="ch"> </span><span class="kw">warn</span>
ErrorLog<span class="st"> /var/log/apache2/shaarli-error.log</span>
CustomLog<span class="st"> /var/log/apache2/shaarli-access.log combined</span>
<span class="fu"></VirtualHost></span></code></pre></div>
include php.conf;
}
}</code></pre>
-<h2 id="restricting-search-engines-and-web-crawler-traffic">Restricting search engines and web crawler traffic</h2>
-<p>Creating a <code>robots.txt</code> witht he following contents at the root of your Shaarli installation will prevent "honest" web crawlers from indexing each and every link and Daily page from a Shaarli instance, thus getting rid of a certain amount of unsollicited network traffic.</p>
-<pre><code>User-agent: *
-Disallow: /</code></pre>
-<p>See: <a href="http://www.robotstxt.org/" class="uri">http://www.robotstxt.org/</a>, <a href="http://www.robotstxt.org/robotstxt.html" class="uri">http://www.robotstxt.org/robotstxt.html</a>, <a href="http://www.robotstxt.org/meta.html" class="uri">http://www.robotstxt.org/meta.html</a></p>
</body>
</html>
}
}
```
-
-## Restricting search engines and web crawler traffic
-
-Creating a `robots.txt` witht he following contents at the root of your Shaarli installation will prevent "honest" web crawlers from indexing each and every link and Daily page from a Shaarli instance, thus getting rid of a certain amount of unsollicited network traffic.
-
-```
-User-agent: *
-Disallow: /
-```
-
-See: http://www.robotstxt.org/, http://www.robotstxt.org/robotstxt.html, http://www.robotstxt.org/meta.html
-
<div id="local-sidebar">
<ul>
<li><a href="Home.html">Home</a></li>
-<li>Installation
+<li>Setup
<ul>
-<li><a href="Download.html">Download</a></li>
+<li><a href="Download-and-Installation.html">Download and Installation</a></li>
+<li><a href="Upgrade-and-migration.html">Upgrade and migration</a></li>
<li><a href="Server-requirements.html">Server requirements</a></li>
<li><a href="Server-configuration.html">Server configuration</a></li>
<li><a href="Server-security.html">Server security</a></li>
-<li><a href="Shaarli-installation.html">Shaarli installation</a></li>
<li><a href="Shaarli-configuration.html">Shaarli configuration</a></li>
<li><a href="Plugins.html">Plugins</a></li>
</ul></li>
<li>How To
<ul>
<li><a href="Backup,-restore,-import-and-export.html">Backup, restore, import and export</a></li>
-<li><a href="Upgrade-from-original-sebsauvage/Shaarli.html">Upgrade from original sebsauvage/Shaarli</a></li>
<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>
<li><a href="Create-and-serve-multiple-Shaarlis-(farm).html">Create and serve multiple Shaarlis (farm)</a></li>
<li><a href="Download-CSS-styles-from-an-OPML-list.html">Download CSS styles from an OPML list</a></li>
<ul>
<li><a href="FAQ.html">FAQ</a></li>
<li><a href="Community-&-Related-software.html">Community & Related software</a></li>
-<li><a href="TODO.html">TODO</a></li>
</ul></li>
</ul>
</div>
</tr>
<tr class="odd">
<td style="text-align: center;">5.5</td>
-<td style="text-align: center;">Supported</td>
+<td style="text-align: center;">EOL: 2016-07-10</td>
<td style="text-align: center;">✅</td>
</tr>
<tr class="even">
<td style="text-align: center;">5.4</td>
<td style="text-align: center;">EOL: 2015-09-14</td>
-<td style="text-align: center;">✅</td>
+<td style="text-align: center;">✅ (up to Shaarli 0.8.x)</td>
</tr>
<tr class="odd">
<td style="text-align: center;">5.3</td>
<td style="text-align: center;">EOL: 2014-08-14</td>
-<td style="text-align: center;">✅</td>
+<td style="text-align: center;">✅ (up to Shaarli 0.8.x)</td>
</tr>
</tbody>
</table>
<ul>
<li><a href="https://github.com/shaarli/Shaarli/blob/master/.travis.yml">Travis configuration</a><a href=".html"></a></li>
</ul>
+<h3 id="dependency-management">Dependency management</h3>
+<p>Starting with Shaarli <code>v0.8.x</code>, <a href="https://getcomposer.org/">Composer</a> is used to resolve,<a href=".html"></a><br />
+download and install third-party PHP dependencies.</p>
+<table>
+<thead>
+<tr class="header">
+<th>Library</th>
+<th style="text-align: center;">Required?</th>
+<th>Usage</th>
+</tr>
+</thead>
+<tbody>
+<tr class="odd">
+<td><a href="https://packagist.org/packages/shaarli/netscape-bookmark-parser"><code>shaarli/netscape-bookmark-parser</code></a></td>
+<td style="text-align: center;">All</td>
+<td>Import bookmarks from Netscape files<a href=".html"></a></td>
+</tr>
+</tbody>
+</table>
<h3 id="extensions">Extensions</h3>
<table style="width:19%;">
<colgroup>
</tr>
<tr class="odd">
<td><a href="http://php.net/manual/en/book.image.php"><code>php-gd</code></a></td>
-<td style="text-align: center;">-</td>
+<td style="text-align: center;">optional</td>
<td>thumbnail resizing<a href=".html"></a></td>
</tr>
<tr class="even">
-<td><a href="http://php.net/manual/fr/book.intl.php"><code>php-intl</code></a></td>
-<td style="text-align: center;">Optional</td>
-<td>Tag cloud intelligent sorting (eg. <code>e->è->f</code>)<a href=".html"></a></td>
+<td><a href="http://php.net/manual/en/book.intl.php"><code>php-intl</code></a></td>
+<td style="text-align: center;">optional</td>
+<td>localized text sorting (e.g. <code>e->è->f</code>)<a href=".html"></a></td>
+</tr>
+<tr class="odd">
+<td><a href="http://php.net/manual/en/book.curl.php"><code>php-curl</code></a></td>
+<td style="text-align: center;">optional</td>
+<td>using cURL for fetching webpages and thumbnails in a more robust way<a href=".html"></a></td>
</tr>
</tbody>
</table>
:---:|:---:|:---:
7.0 | Supported | :white_check_mark:
5.6 | Supported | :white_check_mark:
-5.5 | Supported | :white_check_mark:
-5.4 | EOL: 2015-09-14 | :white_check_mark:
-5.3 | EOL: 2014-08-14 | :white_check_mark:
+5.5 | EOL: 2016-07-10 | :white_check_mark:
+5.4 | EOL: 2015-09-14 | :white_check_mark: (up to Shaarli 0.8.x)
+5.3 | EOL: 2014-08-14 | :white_check_mark: (up to Shaarli 0.8.x)
See also:
- [Travis configuration](https://github.com/shaarli/Shaarli/blob/master/.travis.yml)[](.html)
+### Dependency management
+Starting with Shaarli `v0.8.x`, [Composer](https://getcomposer.org/) is used to resolve,[](.html)
+download and install third-party PHP dependencies.
+
+Library | Required? | Usage
+---|:---:|---
+[`shaarli/netscape-bookmark-parser`](https://packagist.org/packages/shaarli/netscape-bookmark-parser) | All | Import bookmarks from Netscape files[](.html)
+
### Extensions
Extension | Required? | Usage
---|:---:|---
[`openssl`](http://php.net/manual/en/book.openssl.php) | All | OpenSSL, HTTPS[](.html)
[`php-mbstring`](http://php.net/manual/en/book.mbstring.php) | CentOS, Fedora, RHEL, Windows | multibyte (Unicode) string support[](.html)
-[`php-gd`](http://php.net/manual/en/book.image.php) | - | thumbnail resizing[](.html)
-[`php-intl`](http://php.net/manual/fr/book.intl.php) | Optional | Tag cloud intelligent sorting (eg. `e->è->f`)[](.html)
+[`php-gd`](http://php.net/manual/en/book.image.php) | optional | thumbnail resizing[](.html)
+[`php-intl`](http://php.net/manual/en/book.intl.php) | optional | localized text sorting (e.g. `e->è->f`)[](.html)
+[`php-curl`](http://php.net/manual/en/book.curl.php) | optional | using cURL for fetching webpages and thumbnails in a more robust way[](.html)
<div id="local-sidebar">
<ul>
<li><a href="Home.html">Home</a></li>
-<li>Installation
+<li>Setup
<ul>
-<li><a href="Download.html">Download</a></li>
+<li><a href="Download-and-Installation.html">Download and Installation</a></li>
+<li><a href="Upgrade-and-migration.html">Upgrade and migration</a></li>
<li><a href="Server-requirements.html">Server requirements</a></li>
<li><a href="Server-configuration.html">Server configuration</a></li>
<li><a href="Server-security.html">Server security</a></li>
-<li><a href="Shaarli-installation.html">Shaarli installation</a></li>
<li><a href="Shaarli-configuration.html">Shaarli configuration</a></li>
<li><a href="Plugins.html">Plugins</a></li>
</ul></li>
<li>How To
<ul>
<li><a href="Backup,-restore,-import-and-export.html">Backup, restore, import and export</a></li>
-<li><a href="Upgrade-from-original-sebsauvage/Shaarli.html">Upgrade from original sebsauvage/Shaarli</a></li>
<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>
<li><a href="Create-and-serve-multiple-Shaarlis-(farm).html">Create and serve multiple Shaarlis (farm)</a></li>
<li><a href="Download-CSS-styles-from-an-OPML-list.html">Download CSS styles from an OPML list</a></li>
<ul>
<li><a href="FAQ.html">FAQ</a></li>
<li><a href="Community-&-Related-software.html">Community & Related software</a></li>
-<li><a href="TODO.html">TODO</a></li>
</ul></li>
</ul>
</div>
</ul>
<h3 id="locate-.ini-files">Locate .ini files</h3>
<h4 id="console-environment">Console environment</h4>
-<div class="sourceCode"><pre class="sourceCode bash"><code class="sourceCode bash">$ <span class="kw">php</span> --ini
-<span class="kw">Configuration</span> File (php.ini) <span class="kw">Path</span>: /etc/php
-<span class="kw">Loaded</span> Configuration File: /etc/php/php.ini
-<span class="kw">Scan</span> for additional .ini files in: /etc/php/conf.d
-<span class="kw">Additional</span> .ini files parsed: /etc/php/conf.d/xdebug.ini</code></pre></div>
+<div class="sourceCode"><pre class="sourceCode bash"><code class="sourceCode bash">$ <span class="ex">php</span> --ini
+<span class="ex">Configuration</span> File (php.ini) <span class="ex">Path</span>: /etc/php
+<span class="ex">Loaded</span> Configuration File: /etc/php/php.ini
+<span class="ex">Scan</span> for additional .ini files in: /etc/php/conf.d
+<span class="ex">Additional</span> .ini files parsed: /etc/php/conf.d/xdebug.ini</code></pre></div>
<h4 id="server-environment">Server environment</h4>
<ul>
<li>create a <code>phpinfo.php</code> script located in a path supported by the web server, e.g.
<span class="kw">[Definition][]</span><span class="dt">(.html)</span>
<span class="dt">failregex </span><span class="ot">=</span><span class="st"> \s-\s<HOST>\s-\sLogin failed for user.*$</span>
<span class="dt">ignoreregex </span><span class="ot">=</span><span class="st"> </span></code></pre></div>
+<h2 id="robots---restricting-search-engines-and-web-crawler-traffic">Robots - Restricting search engines and web crawler traffic</h2>
+<p>Creating a <code>robots.txt</code> with the following contents at the root of your Shaarli installation will prevent <em>honest</em> web crawlers from indexing each and every link and Daily page from a Shaarli instance, thus getting rid of a certain amount of unsollicited network traffic.</p>
+<pre><code>User-agent: *
+Disallow: /</code></pre>
+<p>See:</p>
+<ul>
+<li><a href="http://www.robotstxt.org/" class="uri">http://www.robotstxt.org/</a></li>
+<li><a href="http://www.robotstxt.org/robotstxt.html" class="uri">http://www.robotstxt.org/robotstxt.html</a></li>
+<li><a href="http://www.robotstxt.org/meta.html" class="uri">http://www.robotstxt.org/meta.html</a></li>
+</ul>
</body>
</html>
failregex = \s-\s<HOST>\s-\sLogin failed for user.*$
ignoreregex =
```
+
+## Robots - Restricting search engines and web crawler traffic
+
+Creating a `robots.txt` with the following contents at the root of your Shaarli installation will prevent _honest_ web crawlers from indexing each and every link and Daily page from a Shaarli instance, thus getting rid of a certain amount of unsollicited network traffic.
+
+```
+User-agent: *
+Disallow: /
+```
+
+See:
+- http://www.robotstxt.org/
+- http://www.robotstxt.org/robotstxt.html
+- http://www.robotstxt.org/meta.html
<div id="local-sidebar">
<ul>
<li><a href="Home.html">Home</a></li>
-<li>Installation
+<li>Setup
<ul>
-<li><a href="Download.html">Download</a></li>
+<li><a href="Download-and-Installation.html">Download and Installation</a></li>
+<li><a href="Upgrade-and-migration.html">Upgrade and migration</a></li>
<li><a href="Server-requirements.html">Server requirements</a></li>
<li><a href="Server-configuration.html">Server configuration</a></li>
<li><a href="Server-security.html">Server security</a></li>
-<li><a href="Shaarli-installation.html">Shaarli installation</a></li>
<li><a href="Shaarli-configuration.html">Shaarli configuration</a></li>
<li><a href="Plugins.html">Plugins</a></li>
</ul></li>
<li>How To
<ul>
<li><a href="Backup,-restore,-import-and-export.html">Backup, restore, import and export</a></li>
-<li><a href="Upgrade-from-original-sebsauvage/Shaarli.html">Upgrade from original sebsauvage/Shaarli</a></li>
<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>
<li><a href="Create-and-serve-multiple-Shaarlis-(farm).html">Create and serve multiple Shaarlis (farm)</a></li>
<li><a href="Download-CSS-styles-from-an-OPML-list.html">Download CSS styles from an OPML list</a></li>
<ul>
<li><a href="FAQ.html">FAQ</a></li>
<li><a href="Community-&-Related-software.html">Community & Related software</a></li>
-<li><a href="TODO.html">TODO</a></li>
</ul></li>
</ul>
</div>
<h1 id="shaarli-configuration">Shaarli configuration</h1>
+<h1 id="shaarli-configuration-1">Shaarli configuration</h1>
<h2 id="foreword">Foreword</h2>
<p><strong>Do not edit configuration options in index.php! Your changes would be lost.</strong></p>
-<p>Once your Shaarli instance is installed, the file <code>data/config.php</code> is generated:</p>
+<p>Once your Shaarli instance is installed, the file <code>data/config.json.php</code> is generated:</p>
<ul>
-<li>it contains all settings, and can be edited to customize values</li>
-<li>it defines which <a href="Plugin-System">plugins</a> are enabled<a href=".html"></a></li>
+<li>it contains all settings in JSON format, and can be edited to customize values</li>
+<li>it defines which <a href="Plugin-System">plugins</a> are enabled<a href="(.html).html">(.html)</a></li>
<li>its values override those defined in <code>index.php</code></li>
+<li>it is wrap in a PHP comment to prevent anyone accessing it, regardless of server configuration</li>
</ul>
<h2 id="file-and-directory-permissions">File and directory permissions</h2>
<p>The server process running Shaarli must have:</p>
<li>unzip Shaarli in the default web server location (usually <code>/var/www/</code>) and set the web server user as the owner</li>
<li>put users in the same group as the web server, and set the appropriate access rights</li>
</ul></li>
-<li>if you have a domain / subdomain to serve Shaarli, <a href="Server-configuration">configure the server</a> accordingly<a href=".html"></a></li>
+<li>if you have a domain / subdomain to serve Shaarli, <a href="Server-configuration">configure the server</a> accordingly<a href="(.html).html">(.html)</a></li>
</ul>
-<h2 id="example-dataconfig.php">Example <code>data/config.php</code></h2>
-<p>See also <a href="Plugin-System.html">Plugin System</a>.</p>
-<div class="sourceCode"><pre class="sourceCode php"><code class="sourceCode php"><span class="kw"><?php</span>
-<span class="co">// User login</span>
-<span class="kw">$GLOBALS</span><span class="ot">[</span><span class="st">'login'</span><span class="ot">]</span> = <span class="st">'<login>'</span><span class="ot">;[](</span>.html<span class="ot">)</span>
-
-<span class="co">// User password hash</span>
-<span class="kw">$GLOBALS</span><span class="ot">[</span><span class="st">'hash'</span><span class="ot">]</span> = <span class="st">'200c452da46c2f889e5e48c49ef044bcacdcb095'</span><span class="ot">;[](</span>.html<span class="ot">)</span>
-
-<span class="co">// Password salt</span>
-<span class="kw">$GLOBALS</span><span class="ot">[</span><span class="st">'salt'</span><span class="ot">]</span> = <span class="st">'13b654102321576033d8473b63a275a1bf94c0f0'</span><span class="ot">;</span> <span class="ot">[](</span>.html<span class="ot">)</span>
-
-<span class="co">// Local timezone</span>
-<span class="kw">$GLOBALS</span><span class="ot">[</span><span class="st">'timezone'</span><span class="ot">]</span> = <span class="st">'Africa/Abidjan'</span><span class="ot">;[](</span>.html<span class="ot">)</span>
-<span class="fu">date_default_timezone_set</span><span class="ot">(</span><span class="st">'Africa/Abidjan'</span><span class="ot">);</span>
-
-<span class="co">// Shaarli title</span>
-<span class="kw">$GLOBALS</span><span class="ot">[</span><span class="st">'title'</span><span class="ot">]</span> = <span class="st">'My Little Shaarly'</span><span class="ot">;[](</span>.html<span class="ot">)</span>
-
-<span class="co">// Link the Shaarli title points to</span>
-<span class="kw">$GLOBALS</span><span class="ot">[</span><span class="st">'titleLink'</span><span class="ot">]</span> = <span class="st">'?'</span><span class="ot">;[](</span>.html<span class="ot">)</span>
-
-<span class="co">// HTTP referer redirector</span>
-<span class="kw">$GLOBALS</span><span class="ot">[</span><span class="st">'redirector'</span><span class="ot">]</span> = <span class="st">''</span><span class="ot">;[](</span>.html<span class="ot">)</span>
-
-<span class="co">// Disable session hijacking</span>
-<span class="kw">$GLOBALS</span><span class="ot">[</span><span class="st">'disablesessionprotection'</span><span class="ot">]</span> = <span class="kw">false</span><span class="ot">;</span> <span class="ot">[](</span>.html<span class="ot">)</span>
-
-<span class="co">// Whether new links are private by default</span>
-<span class="kw">$GLOBALS</span><span class="ot">[</span><span class="st">'privateLinkByDefault'</span><span class="ot">]</span> = <span class="kw">false</span><span class="ot">;[](</span>.html<span class="ot">)</span>
-
-<span class="co">// Enabled plugins</span>
-<span class="co">// Note: each plugin may provide further settings through its own "config.php"</span>
-<span class="kw">$GLOBALS</span><span class="ot">[</span><span class="st">'config'</span><span class="ot">[</span><span class="st">'ENABLED_PLUGINS'</span><span class="ot">]</span> = <span class="fu">array</span><span class="ot">(</span><span class="st">'addlink_toolbar'</span><span class="ot">,</span> <span class="st">'qrcode'</span><span class="ot">);](</span><span class="st">'ENABLED_PLUGINS'</span><span class="ot">]</span>-=-<span class="fu">array</span><span class="ot">(</span><span class="st">'addlink_toolbar'</span><span class="ot">,</span>-<span class="st">'qrcode'</span><span class="ot">);</span>.html<span class="ot">)</span>
-
-<span class="co">// Subdirectory where Shaarli stores its data files.</span>
-<span class="co">// You can change it for better security.</span>
-<span class="kw">$GLOBALS</span><span class="ot">[</span><span class="st">'config'</span><span class="ot">[</span><span class="st">'DATADIR'</span><span class="ot">]</span> = <span class="st">'data'</span><span class="ot">;](</span><span class="st">'DATADIR'</span><span class="ot">]</span>-=-<span class="st">'data'</span><span class="ot">;</span>.html<span class="ot">)</span>
-
-<span class="co">// File used to store settings</span>
-<span class="kw">$GLOBALS</span><span class="ot">[</span><span class="st">'config'</span><span class="ot">[</span><span class="st">'CONFIG_FILE'</span><span class="ot">]</span> = <span class="st">'data/config.php'</span><span class="ot">;](</span><span class="st">'CONFIG_FILE'</span><span class="ot">]</span>-=-<span class="st">'data/config.php'</span><span class="ot">;</span>.html<span class="ot">)</span>
-
-<span class="co">// File containing the link database</span>
-<span class="kw">$GLOBALS</span><span class="ot">[</span><span class="st">'config'</span><span class="ot">[</span><span class="st">'DATASTORE'</span><span class="ot">]</span> = <span class="st">'data/datastore.php'</span><span class="ot">;](</span><span class="st">'DATASTORE'</span><span class="ot">]</span>-=-<span class="st">'data/datastore.php'</span><span class="ot">;</span>.html<span class="ot">)</span>
-
-<span class="co">// Number of links displayed per page</span>
-<span class="kw">$GLOBALS</span><span class="ot">[</span><span class="st">'config'</span><span class="ot">[</span><span class="st">'LINKS_PER_PAGE'</span><span class="ot">]</span> = <span class="dv">20</span><span class="ot">;](</span><span class="st">'LINKS_PER_PAGE'</span><span class="ot">]</span>-=-<span class="dv">20</span><span class="ot">;</span>.html<span class="ot">)</span>
-
-<span class="co">// File recording failed login attempts and IP bans</span>
-<span class="kw">$GLOBALS</span><span class="ot">[</span><span class="st">'config'</span><span class="ot">[</span><span class="st">'IPBANS_FILENAME'</span><span class="ot">]</span> = <span class="st">'data/ipbans.php'</span><span class="ot">;](</span><span class="st">'IPBANS_FILENAME'</span><span class="ot">]</span>-=-<span class="st">'data/ipbans.php'</span><span class="ot">;</span>.html<span class="ot">)</span>
-
-<span class="co">// Failed login attempts before being banned</span>
-<span class="kw">$GLOBALS</span><span class="ot">[</span><span class="st">'config'</span><span class="ot">[</span><span class="st">'BAN_AFTER'</span><span class="ot">]</span> = <span class="dv">4</span><span class="ot">;](</span><span class="st">'BAN_AFTER'</span><span class="ot">]</span>-=-<span class="dv">4</span><span class="ot">;</span>.html<span class="ot">)</span>
-
-<span class="co">// Duration of an IP ban, in seconds (30 minutes)</span>
-<span class="kw">$GLOBALS</span><span class="ot">[</span><span class="st">'config'</span><span class="ot">[</span><span class="st">'BAN_DURATION'</span><span class="ot">]</span> = <span class="dv">1800</span><span class="ot">;](</span><span class="st">'BAN_DURATION'</span><span class="ot">]</span>-=-<span class="dv">1800</span><span class="ot">;</span>.html<span class="ot">)</span>
-
-<span class="co">// If set to true, everyone will be able to add, edit and remove links,</span>
-<span class="co">// as well as change configuration</span>
-<span class="kw">$GLOBALS</span><span class="ot">[</span><span class="st">'config'</span><span class="ot">[</span><span class="st">'OPEN_SHAARLI'</span><span class="ot">]</span> = <span class="kw">false</span><span class="ot">;](</span><span class="st">'OPEN_SHAARLI'</span><span class="ot">]</span>-=-<span class="kw">false</span><span class="ot">;</span>.html<span class="ot">)</span>
-
-<span class="co">// Do not show link timestamps</span>
-<span class="kw">$GLOBALS</span><span class="ot">[</span><span class="st">'config'</span><span class="ot">[</span><span class="st">'HIDE_TIMESTAMPS'</span><span class="ot">]</span> = <span class="kw">false</span><span class="ot">;](</span><span class="st">'HIDE_TIMESTAMPS'</span><span class="ot">]</span>-=-<span class="kw">false</span><span class="ot">;</span>.html<span class="ot">)</span>
-
-<span class="co">// Set to false to disable local thumbnail cache, e.g. due to limited disk quotas</span>
-<span class="kw">$GLOBALS</span><span class="ot">[</span><span class="st">'config'</span><span class="ot">[</span><span class="st">'ENABLE_THUMBNAILS'</span><span class="ot">]</span> = <span class="kw">true</span><span class="ot">;](</span><span class="st">'ENABLE_THUMBNAILS'</span><span class="ot">]</span>-=-<span class="kw">true</span><span class="ot">;</span>.html<span class="ot">)</span>
-
-<span class="co">// Thumbnail cache directory</span>
-<span class="kw">$GLOBALS</span><span class="ot">[</span><span class="st">'config'</span><span class="ot">[</span><span class="st">'CACHEDIR'</span><span class="ot">]</span> = <span class="st">'cache'</span><span class="ot">;](</span><span class="st">'CACHEDIR'</span><span class="ot">]</span>-=-<span class="st">'cache'</span><span class="ot">;</span>.html<span class="ot">)</span>
-
-<span class="co">// Enable feed (rss, atom, dailyrss) cache</span>
-<span class="kw">$GLOBALS</span><span class="ot">[</span><span class="st">'config'</span><span class="ot">[</span><span class="st">'ENABLE_LOCALCACHE'</span><span class="ot">]</span> = <span class="kw">true</span><span class="ot">;](</span><span class="st">'ENABLE_LOCALCACHE'</span><span class="ot">]</span>-=-<span class="kw">true</span><span class="ot">;</span>.html<span class="ot">)</span>
-
-<span class="co">// Feed cache directory</span>
-<span class="kw">$GLOBALS</span><span class="ot">[</span><span class="st">'config'</span><span class="ot">[</span><span class="st">'PAGECACHE'</span><span class="ot">]</span> = <span class="st">'pagecache'</span><span class="ot">;](</span><span class="st">'PAGECACHE'</span><span class="ot">]</span>-=-<span class="st">'pagecache'</span><span class="ot">;</span>.html<span class="ot">)</span>
-
-<span class="co">// RainTPL cache directory (keep the trailing slash!)</span>
-<span class="kw">$GLOBALS</span><span class="ot">[</span><span class="st">'config'</span><span class="ot">[</span><span class="st">'RAINTPL_TMP'</span><span class="ot">]</span> = <span class="st">'tmp/'</span><span class="ot">;](</span><span class="st">'RAINTPL_TMP'</span><span class="ot">]</span>-=-<span class="st">'tmp/'</span><span class="ot">;</span>.html<span class="ot">)</span>
-
-<span class="co">// RainTPL template directory (keep the trailing slash!)</span>
-<span class="kw">$GLOBALS</span><span class="ot">[</span><span class="st">'config'</span><span class="ot">[</span><span class="st">'RAINTPL_TPL'</span><span class="ot">]</span> = <span class="st">'tpl/'</span><span class="ot">;](</span><span class="st">'RAINTPL_TPL'</span><span class="ot">]</span>-=-<span class="st">'tpl/'</span><span class="ot">;</span>.html<span class="ot">)</span>
-
-<span class="co">// Whether Shaarli checks for new releases at https://github.com/shaarli/Shaarli</span>
-<span class="kw">$GLOBALS</span><span class="ot">[</span><span class="st">'config'</span><span class="ot">[</span><span class="st">'ENABLE_UPDATECHECK'</span><span class="ot">]</span> = <span class="kw">true</span><span class="ot">;](</span><span class="st">'ENABLE_UPDATECHECK'</span><span class="ot">]</span>-=-<span class="kw">true</span><span class="ot">;</span>.html<span class="ot">)</span>
-
-<span class="co">// File to store the latest Shaarli version</span>
-<span class="kw">$GLOBALS</span><span class="ot">[</span><span class="st">'config'</span><span class="ot">[</span><span class="st">'UPDATECHECK_FILENAME'</span><span class="ot">]</span> = <span class="st">'data/lastupdatecheck.txt'</span><span class="ot">;](</span><span class="st">'UPDATECHECK_FILENAME'</span><span class="ot">]</span>-=-<span class="st">'data/lastupdatecheck.txt'</span><span class="ot">;</span>.html<span class="ot">)</span>
-
-<span class="co">// Delay between version checks (requires to be logged in) (24 hours)</span>
-<span class="kw">$GLOBALS</span><span class="ot">[</span><span class="st">'config'</span><span class="ot">[</span><span class="st">'UPDATECHECK_INTERVAL'</span><span class="ot">]</span> = <span class="dv">86400</span><span class="ot">;](</span><span class="st">'UPDATECHECK_INTERVAL'</span><span class="ot">]</span>-=-<span class="dv">86400</span><span class="ot">;</span>.html<span class="ot">)</span>
-
-<span class="co">// For each link, display a link to an archived version on archive.org</span>
-<span class="kw">$GLOBALS</span><span class="ot">[</span><span class="st">'config'</span><span class="ot">[</span><span class="st">'ARCHIVE_ORG'</span><span class="ot">]</span> = <span class="kw">false</span><span class="ot">;](</span><span class="st">'ARCHIVE_ORG'</span><span class="ot">]</span>-=-<span class="kw">false</span><span class="ot">;</span>.html<span class="ot">)</span>
-
-<span class="co">// The RSS item links point:</span>
-<span class="co">// true => directly to the link</span>
-<span class="co">// false => to the entry on Shaarli (permalink)</span>
-<span class="kw">$GLOBALS</span><span class="ot">[</span><span class="st">'config'</span><span class="ot">[</span><span class="st">'ENABLE_RSS_PERMALINKS'</span><span class="ot">]</span> = <span class="kw">true</span><span class="ot">;](</span><span class="st">'ENABLE_RSS_PERMALINKS'</span><span class="ot">]</span>-=-<span class="kw">true</span><span class="ot">;</span>.html<span class="ot">)</span>
-
-<span class="co">// Hide all links to non-logged users</span>
-<span class="kw">$GLOBALS</span><span class="ot">[</span><span class="st">'config'</span><span class="ot">[</span><span class="st">'HIDE_PUBLIC_LINKS'</span><span class="ot">]</span> = <span class="kw">false</span><span class="ot">;](</span><span class="st">'HIDE_PUBLIC_LINKS'</span><span class="ot">]</span>-=-<span class="kw">false</span><span class="ot">;</span>.html<span class="ot">)</span>
-
-<span class="kw">$GLOBALS</span><span class="ot">[</span><span class="st">'config'</span><span class="ot">[</span><span class="st">'PUBSUBHUB_URL'</span><span class="ot">]</span> = <span class="st">''</span><span class="ot">;](</span><span class="st">'PUBSUBHUB_URL'</span><span class="ot">]</span>-=-<span class="st">''</span><span class="ot">;</span>.html<span class="ot">)</span>
-
-<span class="co">// Show an ATOM Feed button next to the Subscribe (RSS) button.</span>
-<span class="co">// ATOM feeds are available at the address ?do=atom regardless of this option.</span>
-<span class="kw">$GLOBALS</span><span class="ot">[</span><span class="st">'config'</span><span class="ot">[</span><span class="st">'SHOW_ATOM'</span><span class="ot">]</span> = <span class="kw">false</span><span class="ot">;](</span><span class="st">'SHOW_ATOM'</span><span class="ot">]</span>-=-<span class="kw">false</span><span class="ot">;</span>.html<span class="ot">)</span>
-
-<span class="co">// Set this to true if the redirector requires encoded URL, false otherwise.</span>
-<span class="kw">$GLOBALS</span><span class="ot">[</span><span class="st">'config'</span><span class="ot">[</span><span class="st">'REDIRECTOR_URLENCODE'</span><span class="ot">]</span> = <span class="kw">true</span><span class="ot">;](</span><span class="st">'REDIRECTOR_URLENCODE'</span><span class="ot">]</span>-=-<span class="kw">true</span><span class="ot">;</span>.html<span class="ot">)</span>
-<span class="kw">?></span></code></pre></div>
+<h2 id="configuration">Configuration</h2>
+<p>In <code>data/config.json.php</code>.</p>
+<p>See also <a href="Plugin-System.html">Plugin System</a>.<a href=".html"></a></p>
+<h3 id="credentials">Credentials</h3>
+<blockquote>
+<p>You shouldn't edit those.</p>
+</blockquote>
+<p><strong>login</strong>: Login username.<br />
+<strong>hash</strong>: Generated password hash.<br />
+<strong>salt</strong>: Password salt.</p>
+<h3 id="general">General</h3>
+<p><strong>title</strong>: Shaarli's instance title.<br />
+<strong>header_link</strong>: Link to the homepage.<br />
+<strong>links_per_page</strong>: Number of shaares displayed per page.<br />
+<strong>timezone</strong>: See <a href="http://php.net/manual/en/timezones.php">the list of supported timezones</a>. <a href=".html"></a><br />
+<strong>enabled_plugins</strong>: List of enabled plugins.</p>
+<h3 id="security">Security</h3>
+<p><strong>session_protection_disabled</strong>: Disable session cookie hijacking protection (not recommended).<br />
+It might be useful if your IP adress often changes.<br />
+<strong>ban_after</strong>: Failed login attempts before being IP banned.<br />
+<strong>ban_duration</strong>: IP ban duration in seconds.<br />
+<strong>open_shaarli</strong>: Anyone can add a new link while logged out if enabled.<br />
+<strong>trusted_proxies</strong>: List of trusted IP which won't be banned after failed login attemps. Useful if Shaarli is behind a reverse proxy.</p>
+<h3 id="resources">Resources</h3>
+<p><strong>data_dir</strong>: Data directory.<br />
+<strong>datastore</strong>: Shaarli's links database file path.<br />
+<strong>updates</strong>: File path for the ran updates file.<br />
+<strong>log</strong>: Log file path.<br />
+<strong>update_check</strong>: Last update check file path.<br />
+<strong>raintpl_tpl</strong>: Templates directory.<br />
+<strong>raintpl_tmp</strong>: Template engine cache directory.<br />
+<strong>thumbnails_cache</strong>: Thumbnails cache directory.<br />
+<strong>page_cache</strong>: Shaarli's internal cache directory.<br />
+<strong>ban_file</strong>: Banned IP file path.</p>
+<h3 id="updates">Updates</h3>
+<p><strong>check_updates</strong>: Enable or disable update check to the git repository.<br />
+<strong>check_updates_branch</strong>: Git branch used to check updates (e.g. <code>stable</code> or <code>master</code>).<br />
+<strong>check_updates_interval</strong>: Look for new version every N seconds (default: every day).</p>
+<h3 id="privacy">Privacy</h3>
+<p><strong>default_private_links</strong>: Check the private checkbox by default for every new link.<br />
+<strong>hide_public_links</strong>: All links are hidden while logged out.<br />
+<strong>hide_timestamps</strong>: Timestamps are hidden.</p>
+<h3 id="feed">Feed</h3>
+<p><strong>rss_permalinks</strong>: Enable this to redirect RSS links to Shaarli's permalinks instead of shaared URL.<br />
+<strong>show_atom</strong>: Display ATOM feed button.</p>
+<h3 id="thumbnail">Thumbnail</h3>
+<p><strong>enable_thumbnails</strong>: Enable or disable thumbnail display.<br />
+<strong>enable_localcache</strong>: Enable or disable local cache.</p>
+<h3 id="redirector">Redirector</h3>
+<p><strong>url</strong>: Redirector URL, such as <code>anonym.to</code>.<br />
+<strong>encode_url</strong>: Enable this if the redirector needs encoded URL to work properly.</p>
+<h2 id="configuration-file-example">Configuration file example</h2>
+<div class="sourceCode"><pre class="sourceCode json"><code class="sourceCode json"><span class="er"><?php</span> <span class="er">/*</span>
+<span class="fu">{</span>
+ <span class="dt">"credentials"</span><span class="fu">:</span> <span class="fu">{</span>
+ <span class="dt">"login"</span><span class="fu">:</span> <span class="st">"<login>"</span><span class="fu">,</span>
+ <span class="dt">"hash"</span><span class="fu">:</span> <span class="st">"<password hash>"</span><span class="fu">,</span>
+ <span class="dt">"salt"</span><span class="fu">:</span> <span class="st">"<password salt>"</span>
+ <span class="fu">},</span>
+ <span class="dt">"security"</span><span class="fu">:</span> <span class="fu">{</span>
+ <span class="dt">"ban_after"</span><span class="fu">:</span> <span class="dv">4</span><span class="fu">,</span>
+ <span class="dt">"session_protection_disabled"</span><span class="fu">:</span> <span class="kw">false</span><span class="fu">,</span>
+ <span class="dt">"ban_duration"</span><span class="fu">:</span> <span class="dv">1800</span><span class="fu">,</span>
+ <span class="dt">"trusted_proxies"</span><span class="fu">:</span> <span class="ot">[[]</span><span class="er">(.html)</span>
+ <span class="st">"1.2.3.4"</span><span class="ot">,</span>
+ <span class="st">"5.6.7.8"</span>
+ <span class="ot">]</span>
+ <span class="fu">},</span>
+ <span class="dt">"resources"</span><span class="fu">:</span> <span class="fu">{</span>
+ <span class="dt">"data_dir"</span><span class="fu">:</span> <span class="st">"data"</span><span class="fu">,</span>
+ <span class="dt">"config"</span><span class="fu">:</span> <span class="st">"data</span><span class="ch">\/</span><span class="st">config.php"</span><span class="fu">,</span>
+ <span class="dt">"datastore"</span><span class="fu">:</span> <span class="st">"data</span><span class="ch">\/</span><span class="st">datastore.php"</span><span class="fu">,</span>
+ <span class="dt">"ban_file"</span><span class="fu">:</span> <span class="st">"data</span><span class="ch">\/</span><span class="st">ipbans.php"</span><span class="fu">,</span>
+ <span class="dt">"updates"</span><span class="fu">:</span> <span class="st">"data</span><span class="ch">\/</span><span class="st">updates.txt"</span><span class="fu">,</span>
+ <span class="dt">"log"</span><span class="fu">:</span> <span class="st">"data</span><span class="ch">\/</span><span class="st">log.txt"</span><span class="fu">,</span>
+ <span class="dt">"update_check"</span><span class="fu">:</span> <span class="st">"data</span><span class="ch">\/</span><span class="st">lastupdatecheck.txt"</span><span class="fu">,</span>
+ <span class="dt">"raintpl_tmp"</span><span class="fu">:</span> <span class="st">"tmp</span><span class="ch">\/</span><span class="st">"</span><span class="fu">,</span>
+ <span class="dt">"raintpl_tpl"</span><span class="fu">:</span> <span class="st">"tpl</span><span class="ch">\/</span><span class="st">"</span><span class="fu">,</span>
+ <span class="dt">"thumbnails_cache"</span><span class="fu">:</span> <span class="st">"cache"</span><span class="fu">,</span>
+ <span class="dt">"page_cache"</span><span class="fu">:</span> <span class="st">"pagecache"</span>
+ <span class="fu">},</span>
+ <span class="dt">"general"</span><span class="fu">:</span> <span class="fu">{</span>
+ <span class="dt">"check_updates"</span><span class="fu">:</span> <span class="kw">true</span><span class="fu">,</span>
+ <span class="dt">"rss_permalinks"</span><span class="fu">:</span> <span class="kw">true</span><span class="fu">,</span>
+ <span class="dt">"links_per_page"</span><span class="fu">:</span> <span class="dv">20</span><span class="fu">,</span>
+ <span class="dt">"default_private_links"</span><span class="fu">:</span> <span class="kw">true</span><span class="fu">,</span>
+ <span class="dt">"enable_thumbnails"</span><span class="fu">:</span> <span class="kw">true</span><span class="fu">,</span>
+ <span class="dt">"enable_localcache"</span><span class="fu">:</span> <span class="kw">true</span><span class="fu">,</span>
+ <span class="dt">"check_updates_branch"</span><span class="fu">:</span> <span class="st">"stable"</span><span class="fu">,</span>
+ <span class="dt">"check_updates_interval"</span><span class="fu">:</span> <span class="dv">86400</span><span class="fu">,</span>
+ <span class="dt">"enabled_plugins"</span><span class="fu">:</span> <span class="ot">[[]</span><span class="er">(.html)</span>
+ <span class="st">"markdown"</span><span class="ot">,</span>
+ <span class="st">"wallabag"</span><span class="ot">,</span>
+ <span class="st">"archiveorg"</span>
+ <span class="ot">]</span><span class="fu">,</span>
+ <span class="dt">"timezone"</span><span class="fu">:</span> <span class="st">"Europe</span><span class="ch">\/</span><span class="st">Paris"</span><span class="fu">,</span>
+ <span class="dt">"title"</span><span class="fu">:</span> <span class="st">"My Shaarli"</span><span class="fu">,</span>
+ <span class="dt">"header_link"</span><span class="fu">:</span> <span class="st">"?"</span>
+ <span class="fu">},</span>
+ <span class="dt">"extras"</span><span class="fu">:</span> <span class="fu">{</span>
+ <span class="dt">"show_atom"</span><span class="fu">:</span> <span class="kw">false</span><span class="fu">,</span>
+ <span class="dt">"hide_public_links"</span><span class="fu">:</span> <span class="kw">false</span><span class="fu">,</span>
+ <span class="dt">"hide_timestamps"</span><span class="fu">:</span> <span class="kw">false</span><span class="fu">,</span>
+ <span class="dt">"open_shaarli"</span><span class="fu">:</span> <span class="kw">false</span><span class="fu">,</span>
+ <span class="dt">"redirector"</span><span class="fu">:</span> <span class="st">"http://anonym.to/?"</span><span class="fu">,</span>
+ <span class="dt">"redirector_encode_url"</span><span class="fu">:</span> <span class="kw">false</span>
+ <span class="fu">},</span>
+ <span class="dt">"general"</span><span class="fu">:</span> <span class="fu">{</span>
+ <span class="dt">"header_link"</span><span class="fu">:</span> <span class="st">"?"</span><span class="fu">,</span>
+ <span class="dt">"links_per_page"</span><span class="fu">:</span> <span class="dv">20</span><span class="fu">,</span>
+ <span class="dt">"enabled_plugins"</span><span class="fu">:</span> <span class="ot">[[]</span><span class="er">(.html)</span>
+ <span class="st">"markdown"</span><span class="ot">,</span>
+ <span class="st">"wallabag"</span>
+ <span class="ot">]</span><span class="fu">,</span>
+ <span class="dt">"timezone"</span><span class="fu">:</span> <span class="st">"Europe</span><span class="ch">\/</span><span class="st">Paris"</span><span class="fu">,</span>
+ <span class="dt">"title"</span><span class="fu">:</span> <span class="st">"My Shaarli"</span>
+ <span class="fu">},</span>
+ <span class="dt">"updates"</span><span class="fu">:</span> <span class="fu">{</span>
+ <span class="dt">"check_updates"</span><span class="fu">:</span> <span class="kw">true</span><span class="fu">,</span>
+ <span class="dt">"check_updates_branch"</span><span class="fu">:</span> <span class="st">"stable"</span><span class="fu">,</span>
+ <span class="dt">"check_updates_interval"</span><span class="fu">:</span> <span class="dv">86400</span>
+ <span class="fu">},</span>
+ <span class="dt">"feed"</span><span class="fu">:</span> <span class="fu">{</span>
+ <span class="dt">"rss_permalinks"</span><span class="fu">:</span> <span class="kw">true</span><span class="fu">,</span>
+ <span class="dt">"show_atom"</span><span class="fu">:</span> <span class="kw">false</span>
+ <span class="fu">},</span>
+ <span class="dt">"privacy"</span><span class="fu">:</span> <span class="fu">{</span>
+ <span class="dt">"default_private_links"</span><span class="fu">:</span> <span class="kw">true</span><span class="fu">,</span>
+ <span class="dt">"hide_public_links"</span><span class="fu">:</span> <span class="kw">false</span><span class="fu">,</span>
+ <span class="dt">"hide_timestamps"</span><span class="fu">:</span> <span class="kw">false</span>
+ <span class="fu">},</span>
+ <span class="dt">"thumbnail"</span><span class="fu">:</span> <span class="fu">{</span>
+ <span class="dt">"enable_thumbnails"</span><span class="fu">:</span> <span class="kw">true</span><span class="fu">,</span>
+ <span class="dt">"enable_localcache"</span><span class="fu">:</span> <span class="kw">true</span>
+ <span class="fu">},</span>
+ <span class="dt">"redirector"</span><span class="fu">:</span> <span class="fu">{</span>
+ <span class="dt">"url"</span><span class="fu">:</span> <span class="st">"http://anonym.to/?"</span><span class="fu">,</span>
+ <span class="dt">"encode_url"</span><span class="fu">:</span> <span class="kw">false</span>
+ <span class="fu">},</span>
+ <span class="dt">"plugins"</span><span class="fu">:</span> <span class="fu">{</span>
+ <span class="dt">"WALLABAG_URL"</span><span class="fu">:</span> <span class="st">"http://demo.wallabag.org"</span><span class="fu">,</span>
+ <span class="dt">"WALLABAG_VERSION"</span><span class="fu">:</span> <span class="st">"1"</span>
+ <span class="fu">}</span>
+<span class="fu">}</span> <span class="er">?></span></code></pre></div>
<h2 id="additional-configuration">Additional configuration</h2>
-<p>The playvideos plugin may require that you adapt your server's <a href="https://github.com/shaarli/Shaarli/blob/master/plugins/playvideos/README.md#troubleshooting">Content Security Policy</a> configuration to work properly.<a href=".html"></a></p>
+<p>The playvideos plugin may require that you adapt your server's<br />
+<a href="https://github.com/shaarli/Shaarli/blob/master/plugins/playvideos/README.md#troubleshooting">Content Security Policy</a> <a href=".html"></a><br />
+configuration to work properly.<a href="(.html).html">(.html)</a></p>
</body>
</html>
#Shaarli configuration
+# Shaarli configuration
+
## Foreword
**Do not edit configuration options in index.php! Your changes would be lost.**
-Once your Shaarli instance is installed, the file `data/config.php` is generated:
-* it contains all settings, and can be edited to customize values
-* it defines which [plugins](Plugin-System) are enabled[](.html)
+Once your Shaarli instance is installed, the file `data/config.json.php` is generated:
+* it contains all settings in JSON format, and can be edited to customize values
+* it defines which [plugins](Plugin-System) are enabled[(.html)]((.html).html)
* its values override those defined in `index.php`
+* it is wrap in a PHP comment to prevent anyone accessing it, regardless of server configuration
## File and directory permissions
+
The server process running Shaarli must have:
- `read` access to the following resources:
- PHP scripts: `index.php`, `application/*.php`, `plugins/*.php`
- to give it access to Shaarli, either:
- unzip Shaarli in the default web server location (usually `/var/www/`) and set the web server user as the owner
- put users in the same group as the web server, and set the appropriate access rights
-- if you have a domain / subdomain to serve Shaarli, [configure the server](Server-configuration) accordingly[](.html)
-
-## Example `data/config.php`
-See also [Plugin System](Plugin-System.html).
-
-```php
-<?php
-// User login
-$GLOBALS['login'] = '<login>';[](.html)
-
-// User password hash
-$GLOBALS['hash'] = '200c452da46c2f889e5e48c49ef044bcacdcb095';[](.html)
-
-// Password salt
-$GLOBALS['salt'] = '13b654102321576033d8473b63a275a1bf94c0f0'; [](.html)
-
-// Local timezone
-$GLOBALS['timezone'] = 'Africa/Abidjan';[](.html)
-date_default_timezone_set('Africa/Abidjan');
-
-// Shaarli title
-$GLOBALS['title'] = 'My Little Shaarly';[](.html)
-
-// Link the Shaarli title points to
-$GLOBALS['titleLink'] = '?';[](.html)
-
-// HTTP referer redirector
-$GLOBALS['redirector'] = '';[](.html)
-
-// Disable session hijacking
-$GLOBALS['disablesessionprotection'] = false; [](.html)
-
-// Whether new links are private by default
-$GLOBALS['privateLinkByDefault'] = false;[](.html)
-
-// Enabled plugins
-// Note: each plugin may provide further settings through its own "config.php"
-$GLOBALS['config'['ENABLED_PLUGINS'] = array('addlink_toolbar', 'qrcode');]('ENABLED_PLUGINS']-=-array('addlink_toolbar',-'qrcode');.html)
-
-// Subdirectory where Shaarli stores its data files.
-// You can change it for better security.
-$GLOBALS['config'['DATADIR'] = 'data';]('DATADIR']-=-'data';.html)
-
-// File used to store settings
-$GLOBALS['config'['CONFIG_FILE'] = 'data/config.php';]('CONFIG_FILE']-=-'data/config.php';.html)
-
-// File containing the link database
-$GLOBALS['config'['DATASTORE'] = 'data/datastore.php';]('DATASTORE']-=-'data/datastore.php';.html)
-
-// Number of links displayed per page
-$GLOBALS['config'['LINKS_PER_PAGE'] = 20;]('LINKS_PER_PAGE']-=-20;.html)
-
-// File recording failed login attempts and IP bans
-$GLOBALS['config'['IPBANS_FILENAME'] = 'data/ipbans.php';]('IPBANS_FILENAME']-=-'data/ipbans.php';.html)
-
-// Failed login attempts before being banned
-$GLOBALS['config'['BAN_AFTER'] = 4;]('BAN_AFTER']-=-4;.html)
-
-// Duration of an IP ban, in seconds (30 minutes)
-$GLOBALS['config'['BAN_DURATION'] = 1800;]('BAN_DURATION']-=-1800;.html)
-
-// If set to true, everyone will be able to add, edit and remove links,
-// as well as change configuration
-$GLOBALS['config'['OPEN_SHAARLI'] = false;]('OPEN_SHAARLI']-=-false;.html)
-
-// Do not show link timestamps
-$GLOBALS['config'['HIDE_TIMESTAMPS'] = false;]('HIDE_TIMESTAMPS']-=-false;.html)
-
-// Set to false to disable local thumbnail cache, e.g. due to limited disk quotas
-$GLOBALS['config'['ENABLE_THUMBNAILS'] = true;]('ENABLE_THUMBNAILS']-=-true;.html)
-
-// Thumbnail cache directory
-$GLOBALS['config'['CACHEDIR'] = 'cache';]('CACHEDIR']-=-'cache';.html)
-
-// Enable feed (rss, atom, dailyrss) cache
-$GLOBALS['config'['ENABLE_LOCALCACHE'] = true;]('ENABLE_LOCALCACHE']-=-true;.html)
-
-// Feed cache directory
-$GLOBALS['config'['PAGECACHE'] = 'pagecache';]('PAGECACHE']-=-'pagecache';.html)
-
-// RainTPL cache directory (keep the trailing slash!)
-$GLOBALS['config'['RAINTPL_TMP'] = 'tmp/';]('RAINTPL_TMP']-=-'tmp/';.html)
-
-// RainTPL template directory (keep the trailing slash!)
-$GLOBALS['config'['RAINTPL_TPL'] = 'tpl/';]('RAINTPL_TPL']-=-'tpl/';.html)
-
-// Whether Shaarli checks for new releases at https://github.com/shaarli/Shaarli
-$GLOBALS['config'['ENABLE_UPDATECHECK'] = true;]('ENABLE_UPDATECHECK']-=-true;.html)
-
-// File to store the latest Shaarli version
-$GLOBALS['config'['UPDATECHECK_FILENAME'] = 'data/lastupdatecheck.txt';]('UPDATECHECK_FILENAME']-=-'data/lastupdatecheck.txt';.html)
-
-// Delay between version checks (requires to be logged in) (24 hours)
-$GLOBALS['config'['UPDATECHECK_INTERVAL'] = 86400;]('UPDATECHECK_INTERVAL']-=-86400;.html)
-
-// For each link, display a link to an archived version on archive.org
-$GLOBALS['config'['ARCHIVE_ORG'] = false;]('ARCHIVE_ORG']-=-false;.html)
-
-// The RSS item links point:
-// true => directly to the link
-// false => to the entry on Shaarli (permalink)
-$GLOBALS['config'['ENABLE_RSS_PERMALINKS'] = true;]('ENABLE_RSS_PERMALINKS']-=-true;.html)
-
-// Hide all links to non-logged users
-$GLOBALS['config'['HIDE_PUBLIC_LINKS'] = false;]('HIDE_PUBLIC_LINKS']-=-false;.html)
-
-$GLOBALS['config'['PUBSUBHUB_URL'] = '';]('PUBSUBHUB_URL']-=-'';.html)
-
-// Show an ATOM Feed button next to the Subscribe (RSS) button.
-// ATOM feeds are available at the address ?do=atom regardless of this option.
-$GLOBALS['config'['SHOW_ATOM'] = false;]('SHOW_ATOM']-=-false;.html)
-
-// Set this to true if the redirector requires encoded URL, false otherwise.
-$GLOBALS['config'['REDIRECTOR_URLENCODE'] = true;]('REDIRECTOR_URLENCODE']-=-true;.html)
-?>
+- if you have a domain / subdomain to serve Shaarli, [configure the server](Server-configuration) accordingly[(.html)]((.html).html)
+
+## Configuration
+
+In `data/config.json.php`.
+
+See also [Plugin System](Plugin-System.html).[](.html)
+
+### Credentials
+
+> You shouldn't edit those.
+
+**login**: Login username.
+**hash**: Generated password hash.
+**salt**: Password salt.
+
+### General
+
+**title**: Shaarli's instance title.
+**header_link**: Link to the homepage.
+**links_per_page**: Number of shaares displayed per page.
+**timezone**: See [the list of supported timezones](http://php.net/manual/en/timezones.php). [](.html)
+**enabled_plugins**: List of enabled plugins.
+
+### Security
+
+**session_protection_disabled**: Disable session cookie hijacking protection (not recommended).
+It might be useful if your IP adress often changes.
+**ban_after**: Failed login attempts before being IP banned.
+**ban_duration**: IP ban duration in seconds.
+**open_shaarli**: Anyone can add a new link while logged out if enabled.
+**trusted_proxies**: List of trusted IP which won't be banned after failed login attemps. Useful if Shaarli is behind a reverse proxy.
+
+### Resources
+
+**data_dir**: Data directory.
+**datastore**: Shaarli's links database file path.
+**updates**: File path for the ran updates file.
+**log**: Log file path.
+**update_check**: Last update check file path.
+**raintpl_tpl**: Templates directory.
+**raintpl_tmp**: Template engine cache directory.
+**thumbnails_cache**: Thumbnails cache directory.
+**page_cache**: Shaarli's internal cache directory.
+**ban_file**: Banned IP file path.
+
+### Updates
+
+**check_updates**: Enable or disable update check to the git repository.
+**check_updates_branch**: Git branch used to check updates (e.g. `stable` or `master`).
+**check_updates_interval**: Look for new version every N seconds (default: every day).
+
+### Privacy
+
+**default_private_links**: Check the private checkbox by default for every new link.
+**hide_public_links**: All links are hidden while logged out.
+**hide_timestamps**: Timestamps are hidden.
+
+### Feed
+
+**rss_permalinks**: Enable this to redirect RSS links to Shaarli's permalinks instead of shaared URL.
+**show_atom**: Display ATOM feed button.
+
+### Thumbnail
+
+**enable_thumbnails**: Enable or disable thumbnail display.
+**enable_localcache**: Enable or disable local cache.
+
+### Redirector
+
+**url**: Redirector URL, such as `anonym.to`.
+**encode_url**: Enable this if the redirector needs encoded URL to work properly.
+
+## Configuration file example
+
+```json
+<?php /*
+{
+ "credentials": {
+ "login": "<login>",
+ "hash": "<password hash>",
+ "salt": "<password salt>"
+ },
+ "security": {
+ "ban_after": 4,
+ "session_protection_disabled": false,
+ "ban_duration": 1800,
+ "trusted_proxies": [[](.html)
+ "1.2.3.4",
+ "5.6.7.8"
+ ]
+ },
+ "resources": {
+ "data_dir": "data",
+ "config": "data\/config.php",
+ "datastore": "data\/datastore.php",
+ "ban_file": "data\/ipbans.php",
+ "updates": "data\/updates.txt",
+ "log": "data\/log.txt",
+ "update_check": "data\/lastupdatecheck.txt",
+ "raintpl_tmp": "tmp\/",
+ "raintpl_tpl": "tpl\/",
+ "thumbnails_cache": "cache",
+ "page_cache": "pagecache"
+ },
+ "general": {
+ "check_updates": true,
+ "rss_permalinks": true,
+ "links_per_page": 20,
+ "default_private_links": true,
+ "enable_thumbnails": true,
+ "enable_localcache": true,
+ "check_updates_branch": "stable",
+ "check_updates_interval": 86400,
+ "enabled_plugins": [[](.html)
+ "markdown",
+ "wallabag",
+ "archiveorg"
+ ],
+ "timezone": "Europe\/Paris",
+ "title": "My Shaarli",
+ "header_link": "?"
+ },
+ "extras": {
+ "show_atom": false,
+ "hide_public_links": false,
+ "hide_timestamps": false,
+ "open_shaarli": false,
+ "redirector": "http://anonym.to/?",
+ "redirector_encode_url": false
+ },
+ "general": {
+ "header_link": "?",
+ "links_per_page": 20,
+ "enabled_plugins": [[](.html)
+ "markdown",
+ "wallabag"
+ ],
+ "timezone": "Europe\/Paris",
+ "title": "My Shaarli"
+ },
+ "updates": {
+ "check_updates": true,
+ "check_updates_branch": "stable",
+ "check_updates_interval": 86400
+ },
+ "feed": {
+ "rss_permalinks": true,
+ "show_atom": false
+ },
+ "privacy": {
+ "default_private_links": true,
+ "hide_public_links": false,
+ "hide_timestamps": false
+ },
+ "thumbnail": {
+ "enable_thumbnails": true,
+ "enable_localcache": true
+ },
+ "redirector": {
+ "url": "http://anonym.to/?",
+ "encode_url": false
+ },
+ "plugins": {
+ "WALLABAG_URL": "http://demo.wallabag.org",
+ "WALLABAG_VERSION": "1"
+ }
+} ?>
```
## Additional configuration
-The playvideos plugin may require that you adapt your server's [Content Security Policy](https://github.com/shaarli/Shaarli/blob/master/plugins/playvideos/README.md#troubleshooting) configuration to work properly.[](.html)
+The playvideos plugin may require that you adapt your server's
+[Content Security Policy](https://github.com/shaarli/Shaarli/blob/master/plugins/playvideos/README.md#troubleshooting) [](.html)
+configuration to work properly.[(.html)]((.html).html)
+
+++ /dev/null
-<!DOCTYPE html>
-<html>
-<head>
- <meta charset="utf-8">
- <meta name="generator" content="pandoc">
- <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">
- <title>Shaarli – Shaarli installation</title>
- <style type="text/css">code{white-space: pre;}</style>
- <link rel="stylesheet" href="github-markdown.css">
- <!--[if lt IE 9]>
- <script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv-printshiv.min.js"></script>
- <![endif]-->
-</head>
-<body>
-<div id="local-sidebar">
-<ul>
-<li><a href="Home.html">Home</a></li>
-<li>Installation
-<ul>
-<li><a href="Download.html">Download</a></li>
-<li><a href="Server-requirements.html">Server requirements</a></li>
-<li><a href="Server-configuration.html">Server configuration</a></li>
-<li><a href="Server-security.html">Server security</a></li>
-<li><a href="Shaarli-installation.html">Shaarli installation</a></li>
-<li><a href="Shaarli-configuration.html">Shaarli configuration</a></li>
-<li><a href="Plugins.html">Plugins</a></li>
-</ul></li>
-<li><a href="Docker.html">Docker</a></li>
-<li><a href="Usage.html">Usage</a>
-<ul>
-<li><a href="Sharing-button.html">Sharing button</a> (bookmarklet)</li>
-<li><a href="Browsing-and-Searching.html">Browsing and Searching</a></li>
-<li><a href="Firefox-share.html">Firefox share</a></li>
-<li><a href="RSS-feeds.html">RSS feeds</a></li>
-</ul></li>
-<li>How To
-<ul>
-<li><a href="Backup,-restore,-import-and-export.html">Backup, restore, import and export</a></li>
-<li><a href="Upgrade-from-original-sebsauvage/Shaarli.html">Upgrade from original sebsauvage/Shaarli</a></li>
-<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>
-<li><a href="Create-and-serve-multiple-Shaarlis-(farm).html">Create and serve multiple Shaarlis (farm)</a></li>
-<li><a href="Download-CSS-styles-from-an-OPML-list.html">Download CSS styles from an OPML list</a></li>
-<li><a href="Datastore-hacks.html">Datastore hacks</a></li>
-</ul></li>
-<li><a href="Troubleshooting.html">Troubleshooting</a></li>
-<li><a href="Development.html">Development</a>
-<ul>
-<li><a href="GnuPG-signature.html">GnuPG signature</a></li>
-<li><a href="Coding-guidelines.html">Coding guidelines</a></li>
-<li><a href="Directory-structure.html">Directory structure</a></li>
-<li><a href="3rd-party-libraries.html">3rd party libraries</a></li>
-<li><a href="Plugin-System.html">Plugin System</a></li>
-<li><a href="Release-Shaarli.html">Release Shaarli</a></li>
-<li><a href="Security.html">Security</a></li>
-<li><a href="Static-analysis.html">Static analysis</a></li>
-<li><a href="Theming.html">Theming</a></li>
-<li><a href="Unit-tests.html">Unit tests</a></li>
-</ul></li>
-<li>About
-<ul>
-<li><a href="FAQ.html">FAQ</a></li>
-<li><a href="Community-&-Related-software.html">Community & Related software</a></li>
-<li><a href="TODO.html">TODO</a></li>
-</ul></li>
-</ul>
-</div>
-<h1 id="shaarli-installation">Shaarli installation</h1>
-<p>Once Shaarli is downloaded and installed behind a web server, open it in your favorite browser.</p>
-<p><img src="http://i.imgur.com/wuMpDSN.png" alt="install screenshot" /><a href=".html"></a></p>
-<p>Setup your Shaarli installation, and it's ready to use!</p>
-</body>
-</html>
+++ /dev/null
-#Shaarli installation
-Once Shaarli is downloaded and installed behind a web server, open it in your favorite browser.
-
-![install screenshot](http://i.imgur.com/wuMpDSN.png)[](.html)
-
-Setup your Shaarli installation, and it's ready to use!
<div id="local-sidebar">
<ul>
<li><a href="Home.html">Home</a></li>
-<li>Installation
+<li>Setup
<ul>
-<li><a href="Download.html">Download</a></li>
+<li><a href="Download-and-Installation.html">Download and Installation</a></li>
+<li><a href="Upgrade-and-migration.html">Upgrade and migration</a></li>
<li><a href="Server-requirements.html">Server requirements</a></li>
<li><a href="Server-configuration.html">Server configuration</a></li>
<li><a href="Server-security.html">Server security</a></li>
-<li><a href="Shaarli-installation.html">Shaarli installation</a></li>
<li><a href="Shaarli-configuration.html">Shaarli configuration</a></li>
<li><a href="Plugins.html">Plugins</a></li>
</ul></li>
<li>How To
<ul>
<li><a href="Backup,-restore,-import-and-export.html">Backup, restore, import and export</a></li>
-<li><a href="Upgrade-from-original-sebsauvage/Shaarli.html">Upgrade from original sebsauvage/Shaarli</a></li>
<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>
<li><a href="Create-and-serve-multiple-Shaarlis-(farm).html">Create and serve multiple Shaarlis (farm)</a></li>
<li><a href="Download-CSS-styles-from-an-OPML-list.html">Download CSS styles from an OPML list</a></li>
<ul>
<li><a href="FAQ.html">FAQ</a></li>
<li><a href="Community-&-Related-software.html">Community & Related software</a></li>
-<li><a href="TODO.html">TODO</a></li>
</ul></li>
</ul>
</div>
<div id="local-sidebar">
<ul>
<li><a href="Home.html">Home</a></li>
-<li>Installation
+<li>Setup
<ul>
-<li><a href="Download.html">Download</a></li>
+<li><a href="Download-and-Installation.html">Download and Installation</a></li>
+<li><a href="Upgrade-and-migration.html">Upgrade and migration</a></li>
<li><a href="Server-requirements.html">Server requirements</a></li>
<li><a href="Server-configuration.html">Server configuration</a></li>
<li><a href="Server-security.html">Server security</a></li>
-<li><a href="Shaarli-installation.html">Shaarli installation</a></li>
<li><a href="Shaarli-configuration.html">Shaarli configuration</a></li>
<li><a href="Plugins.html">Plugins</a></li>
</ul></li>
<li>How To
<ul>
<li><a href="Backup,-restore,-import-and-export.html">Backup, restore, import and export</a></li>
-<li><a href="Upgrade-from-original-sebsauvage/Shaarli.html">Upgrade from original sebsauvage/Shaarli</a></li>
<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>
<li><a href="Create-and-serve-multiple-Shaarlis-(farm).html">Create and serve multiple Shaarlis (farm)</a></li>
<li><a href="Download-CSS-styles-from-an-OPML-list.html">Download CSS styles from an OPML list</a></li>
<ul>
<li><a href="FAQ.html">FAQ</a></li>
<li><a href="Community-&-Related-software.html">Community & Related software</a></li>
-<li><a href="TODO.html">TODO</a></li>
</ul></li>
</ul>
</div>
+++ /dev/null
-<!DOCTYPE html>
-<html>
-<head>
- <meta charset="utf-8">
- <meta name="generator" content="pandoc">
- <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">
- <title>Shaarli – TODO</title>
- <style type="text/css">code{white-space: pre;}</style>
- <link rel="stylesheet" href="github-markdown.css">
- <!--[if lt IE 9]>
- <script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv-printshiv.min.js"></script>
- <![endif]-->
-</head>
-<body>
-<div id="local-sidebar">
-<ul>
-<li><a href="Home.html">Home</a></li>
-<li>Installation
-<ul>
-<li><a href="Download.html">Download</a></li>
-<li><a href="Server-requirements.html">Server requirements</a></li>
-<li><a href="Server-configuration.html">Server configuration</a></li>
-<li><a href="Server-security.html">Server security</a></li>
-<li><a href="Shaarli-installation.html">Shaarli installation</a></li>
-<li><a href="Shaarli-configuration.html">Shaarli configuration</a></li>
-<li><a href="Plugins.html">Plugins</a></li>
-</ul></li>
-<li><a href="Docker.html">Docker</a></li>
-<li><a href="Usage.html">Usage</a>
-<ul>
-<li><a href="Sharing-button.html">Sharing button</a> (bookmarklet)</li>
-<li><a href="Browsing-and-Searching.html">Browsing and Searching</a></li>
-<li><a href="Firefox-share.html">Firefox share</a></li>
-<li><a href="RSS-feeds.html">RSS feeds</a></li>
-</ul></li>
-<li>How To
-<ul>
-<li><a href="Backup,-restore,-import-and-export.html">Backup, restore, import and export</a></li>
-<li><a href="Upgrade-from-original-sebsauvage/Shaarli.html">Upgrade from original sebsauvage/Shaarli</a></li>
-<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>
-<li><a href="Create-and-serve-multiple-Shaarlis-(farm).html">Create and serve multiple Shaarlis (farm)</a></li>
-<li><a href="Download-CSS-styles-from-an-OPML-list.html">Download CSS styles from an OPML list</a></li>
-<li><a href="Datastore-hacks.html">Datastore hacks</a></li>
-</ul></li>
-<li><a href="Troubleshooting.html">Troubleshooting</a></li>
-<li><a href="Development.html">Development</a>
-<ul>
-<li><a href="GnuPG-signature.html">GnuPG signature</a></li>
-<li><a href="Coding-guidelines.html">Coding guidelines</a></li>
-<li><a href="Directory-structure.html">Directory structure</a></li>
-<li><a href="3rd-party-libraries.html">3rd party libraries</a></li>
-<li><a href="Plugin-System.html">Plugin System</a></li>
-<li><a href="Release-Shaarli.html">Release Shaarli</a></li>
-<li><a href="Security.html">Security</a></li>
-<li><a href="Static-analysis.html">Static analysis</a></li>
-<li><a href="Theming.html">Theming</a></li>
-<li><a href="Unit-tests.html">Unit tests</a></li>
-</ul></li>
-<li>About
-<ul>
-<li><a href="FAQ.html">FAQ</a></li>
-<li><a href="Community-&-Related-software.html">Community & Related software</a></li>
-<li><a href="TODO.html">TODO</a></li>
-</ul></li>
-</ul>
-</div>
-<h1 id="todo">TODO</h1>
-<ul>
-<li>add more screenshots</li>
-<li>improve developer documentation: storage architecture, classes and functions, security handling...</li>
-<li>add server configuration examples: lighthttpd</li>
-</ul>
-</body>
-</html>
+++ /dev/null
-#TODO
-* add more screenshots
-* improve developer documentation: storage architecture, classes and functions, security handling...
-* add server configuration examples: lighthttpd
<div id="local-sidebar">
<ul>
<li><a href="Home.html">Home</a></li>
-<li>Installation
+<li>Setup
<ul>
-<li><a href="Download.html">Download</a></li>
+<li><a href="Download-and-Installation.html">Download and Installation</a></li>
+<li><a href="Upgrade-and-migration.html">Upgrade and migration</a></li>
<li><a href="Server-requirements.html">Server requirements</a></li>
<li><a href="Server-configuration.html">Server configuration</a></li>
<li><a href="Server-security.html">Server security</a></li>
-<li><a href="Shaarli-installation.html">Shaarli installation</a></li>
<li><a href="Shaarli-configuration.html">Shaarli configuration</a></li>
<li><a href="Plugins.html">Plugins</a></li>
</ul></li>
<li>How To
<ul>
<li><a href="Backup,-restore,-import-and-export.html">Backup, restore, import and export</a></li>
-<li><a href="Upgrade-from-original-sebsauvage/Shaarli.html">Upgrade from original sebsauvage/Shaarli</a></li>
<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>
<li><a href="Create-and-serve-multiple-Shaarlis-(farm).html">Create and serve multiple Shaarlis (farm)</a></li>
<li><a href="Download-CSS-styles-from-an-OPML-list.html">Download CSS styles from an OPML list</a></li>
<ul>
<li><a href="FAQ.html">FAQ</a></li>
<li><a href="Community-&-Related-software.html">Community & Related software</a></li>
-<li><a href="TODO.html">TODO</a></li>
</ul></li>
</ul>
</div>
<li><a href="https://github.com/kalvn/shaarli-blocks">kalvn/shaarli-blocks</a> - A template/theme for Shaarli<a href=".html"></a></li>
<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.<a href=".html"></a></li>
<li><a href="https://github.com/misterair/limonade">misterair/Limonade</a> - A fork of (legacy) Shaarli with a new template<a href=".html"></a></li>
+<li><a href="https://github.com/mrjovanovic/serious-theme-shaarli">mrjovanovic/serious-theme-shaarli</a> - A serious theme for SHaarli.<a href=".html"></a></li>
<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)<a href=".html"></a></li>
<li><a href="https://github.com/vivienhaese/shaarlitheme">vivienhaese/shaarlitheme</a> - A Shaarli fork meant to be run in an openshift instance<a href=".html"></a></li>
</ul>
<li>user sites are enabled, e.g. <code>/home/user/public_html/somedir</code> is served as <code>http://localhost/~user/somedir</code></li>
<li><code>http</code> is the name of the Apache user</li>
</ul>
-<div class="sourceCode"><pre class="sourceCode bash"><code class="sourceCode bash">$ <span class="kw">cd</span> ~/public_html
+<div class="sourceCode"><pre class="sourceCode bash"><code class="sourceCode bash">$ <span class="bu">cd</span> ~/public_html
<span class="co"># clone repositories</span>
-$ <span class="kw">git</span> clone https://github.com/shaarli/Shaarli.git shaarli
-$ <span class="kw">pushd</span> shaarli/tpl
-$ <span class="kw">git</span> clone https://github.com/alexisju/albinomouse-template.git
-$ <span class="kw">popd</span>
+$ <span class="fu">git</span> clone https://github.com/shaarli/Shaarli.git shaarli
+$ <span class="bu">pushd</span> shaarli/tpl
+$ <span class="fu">git</span> clone https://github.com/alexisju/albinomouse-template.git
+$ <span class="bu">popd</span>
<span class="co"># set access rights for Apache</span>
-$ <span class="kw">chgrp</span> -R http shaarli
-$ <span class="kw">chmod</span> g+rwx shaarli shaarli/cache shaarli/data shaarli/pagecache shaarli/tmp</code></pre></div>
+$ <span class="fu">chgrp</span> -R http shaarli
+$ <span class="fu">chmod</span> g+rwx shaarli shaarli/cache shaarli/data shaarli/pagecache shaarli/tmp</code></pre></div>
<p>Get config written:</p>
<ul>
<li>go to the freshly installed site</li>
</ul>
<p>Edit Shaarli's <a href="configuration%7CShaarli-configuration.html">configuration|Shaarli configuration</a>:</p>
<div class="sourceCode"><pre class="sourceCode bash"><code class="sourceCode bash"><span class="co"># the file should be owned by Apache, thus not writeable => sudo</span>
-$ <span class="kw">sudo</span> sed -i s=tpl=tpl/albinomouse-template=g shaarli/data/config.php</code></pre></div>
+$ <span class="fu">sudo</span> sed -i s=tpl=tpl/albinomouse-template=g shaarli/data/config.php</code></pre></div>
</body>
</html>
- [kalvn/shaarli-blocks](https://github.com/kalvn/shaarli-blocks) - A template/theme for Shaarli[](.html)
- [kalvn/Shaarli-Material](https://github.com/kalvn/Shaarli-Material) - A theme (template) based on Google's Material Design for Shaarli, the superfast delicious clone.[](.html)
- [misterair/Limonade](https://github.com/misterair/limonade) - A fork of (legacy) Shaarli with a new template[](.html)
+- [mrjovanovic/serious-theme-shaarli](https://github.com/mrjovanovic/serious-theme-shaarli) - A serious theme for SHaarli.[](.html)
- [Vinm/Blue-theme-for Shaarli](https://github.com/Vinm/Blue-theme-for-Shaarli) - A template/theme for Shaarli ([unmaintained](https://github.com/Vinm/Blue-theme-for-Shaarli/issues/2), compatibility unknown)[](.html)
- [vivienhaese/shaarlitheme](https://github.com/vivienhaese/shaarlitheme) - A Shaarli fork meant to be run in an openshift instance[](.html)
<div id="local-sidebar">
<ul>
<li><a href="Home.html">Home</a></li>
-<li>Installation
+<li>Setup
<ul>
-<li><a href="Download.html">Download</a></li>
+<li><a href="Download-and-Installation.html">Download and Installation</a></li>
+<li><a href="Upgrade-and-migration.html">Upgrade and migration</a></li>
<li><a href="Server-requirements.html">Server requirements</a></li>
<li><a href="Server-configuration.html">Server configuration</a></li>
<li><a href="Server-security.html">Server security</a></li>
-<li><a href="Shaarli-installation.html">Shaarli installation</a></li>
<li><a href="Shaarli-configuration.html">Shaarli configuration</a></li>
<li><a href="Plugins.html">Plugins</a></li>
</ul></li>
<li>How To
<ul>
<li><a href="Backup,-restore,-import-and-export.html">Backup, restore, import and export</a></li>
-<li><a href="Upgrade-from-original-sebsauvage/Shaarli.html">Upgrade from original sebsauvage/Shaarli</a></li>
<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>
<li><a href="Create-and-serve-multiple-Shaarlis-(farm).html">Create and serve multiple Shaarlis (farm)</a></li>
<li><a href="Download-CSS-styles-from-an-OPML-list.html">Download CSS styles from an OPML list</a></li>
<ul>
<li><a href="FAQ.html">FAQ</a></li>
<li><a href="Community-&-Related-software.html">Community & Related software</a></li>
-<li><a href="TODO.html">TODO</a></li>
</ul></li>
</ul>
</div>
<ul>
<li>false (default): real referer</li>
<li>true: spoof referer (use target URI as referer)</li>
+<li>known to break some functionality in Shaarli</li>
</ul>
<p><code>network.http.referer.trimmingPolicy</code> - trim the URI not to send a full Referer</p>
<ul>
<li>2: scheme+host+port</li>
</ul>
<h3 id="firefox-localhost-and-redirections">Firefox, localhost and redirections</h3>
-<p><code>localhost</code> is not a proper Fully Qualified Domain Name (FQDN); if Firefox has been set up to spoof referers, or anly accept requests from the same base domain/host, Shaarli redirections will not work properly.</p>
+<p><code>localhost</code> is not a proper Fully Qualified Domain Name (FQDN); if Firefox has been set up to spoof referers, or only accept requests from the same base domain/host, Shaarli redirections will not work properly.</p>
<p>To solve this, assign a local domain to your host, e.g.</p>
<pre><code>127.0.0.1 localhost desktop localhost.lan
::1 localhost desktop localhost.lan</code></pre>
`network.http.referer.spoofSource` - Referer spoofing (~faking)
- false (default): real referer
- true: spoof referer (use target URI as referer)
+ - known to break some functionality in Shaarli
`network.http.referer.trimmingPolicy` - trim the URI not to send a full Referer
- 0 (default): send full URI
- 2: scheme+host+port
### Firefox, localhost and redirections
-`localhost` is not a proper Fully Qualified Domain Name (FQDN); if Firefox has been set up to spoof referers, or anly accept requests from the same base domain/host, Shaarli redirections will not work properly.
+`localhost` is not a proper Fully Qualified Domain Name (FQDN); if Firefox has been set up to spoof referers, or only accept requests from the same base domain/host, Shaarli redirections will not work properly.
To solve this, assign a local domain to your host, e.g.
```
<div id="local-sidebar">
<ul>
<li><a href="Home.html">Home</a></li>
-<li>Installation
+<li>Setup
<ul>
-<li><a href="Download.html">Download</a></li>
+<li><a href="Download-and-Installation.html">Download and Installation</a></li>
+<li><a href="Upgrade-and-migration.html">Upgrade and migration</a></li>
<li><a href="Server-requirements.html">Server requirements</a></li>
<li><a href="Server-configuration.html">Server configuration</a></li>
<li><a href="Server-security.html">Server security</a></li>
-<li><a href="Shaarli-installation.html">Shaarli installation</a></li>
<li><a href="Shaarli-configuration.html">Shaarli configuration</a></li>
<li><a href="Plugins.html">Plugins</a></li>
</ul></li>
<li>How To
<ul>
<li><a href="Backup,-restore,-import-and-export.html">Backup, restore, import and export</a></li>
-<li><a href="Upgrade-from-original-sebsauvage/Shaarli.html">Upgrade from original sebsauvage/Shaarli</a></li>
<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>
<li><a href="Create-and-serve-multiple-Shaarlis-(farm).html">Create and serve multiple Shaarlis (farm)</a></li>
<li><a href="Download-CSS-styles-from-an-OPML-list.html">Download CSS styles from an OPML list</a></li>
<ul>
<li><a href="FAQ.html">FAQ</a></li>
<li><a href="Community-&-Related-software.html">Community & Related software</a></li>
-<li><a href="TODO.html">TODO</a></li>
</ul></li>
</ul>
</div>
</ul>
<h4 id="sample-usage">Sample usage</h4>
<div class="sourceCode"><pre class="sourceCode bash"><code class="sourceCode bash"><span class="co"># system-wide version</span>
-$ <span class="kw">composer</span> install
-$ <span class="kw">composer</span> update
+$ <span class="ex">composer</span> install
+$ <span class="ex">composer</span> update
<span class="co"># local version</span>
-$ <span class="kw">php</span> composer.phar self-update
-$ <span class="kw">php</span> composer.phar install
-$ <span class="kw">php</span> composer.phar update</code></pre></div>
+$ <span class="ex">php</span> composer.phar self-update
+$ <span class="ex">php</span> composer.phar install
+$ <span class="ex">php</span> composer.phar update</code></pre></div>
<h4 id="install-shaarli-dev-dependencies">Install Shaarli dev dependencies</h4>
-<div class="sourceCode"><pre class="sourceCode bash"><code class="sourceCode bash">$ <span class="kw">cd</span> /path/to/shaarli
-$ <span class="kw">composer</span> update</code></pre></div>
+<div class="sourceCode"><pre class="sourceCode bash"><code class="sourceCode bash">$ <span class="bu">cd</span> /path/to/shaarli
+$ <span class="ex">composer</span> update</code></pre></div>
<h4 id="install-and-enable-xdebug-to-generate-phpunit-coverage-reports">Install and enable Xdebug to generate PHPUnit coverage reports</h4>
<p>For Debian-based distros:</p>
-<div class="sourceCode"><pre class="sourceCode bash"><code class="sourceCode bash">$ <span class="kw">aptitude</span> install php5-xdebug</code></pre></div>
+<div class="sourceCode"><pre class="sourceCode bash"><code class="sourceCode bash">$ <span class="ex">aptitude</span> install php5-xdebug</code></pre></div>
<p>For ArchLinux:</p>
-<div class="sourceCode"><pre class="sourceCode bash"><code class="sourceCode bash">$ <span class="kw">pacman</span> -S xdebug</code></pre></div>
+<div class="sourceCode"><pre class="sourceCode bash"><code class="sourceCode bash">$ <span class="ex">pacman</span> -S xdebug</code></pre></div>
<p>Then add the following line to <code>/etc/php/php.ini</code>:</p>
<div class="sourceCode"><pre class="sourceCode ini"><code class="sourceCode ini"><span class="dt">zend_extension</span><span class="ot">=</span><span class="st">xdebug.so</span></code></pre></div>
<h4 id="run-unit-tests">Run unit tests</h4>
<p>Successful test suite:</p>
-<div class="sourceCode"><pre class="sourceCode bash"><code class="sourceCode bash">$ <span class="kw">make</span> test
+<div class="sourceCode"><pre class="sourceCode bash"><code class="sourceCode bash">$ <span class="fu">make</span> test
-<span class="kw">-------</span>
-<span class="kw">PHPUNIT</span>
-<span class="kw">-------</span>
-<span class="kw">PHPUnit</span> 4.6.9 by Sebastian Bergmann and contributors.
+<span class="ex">-------</span>
+<span class="ex">PHPUNIT</span>
+<span class="ex">-------</span>
+<span class="ex">PHPUnit</span> 4.6.9 by Sebastian Bergmann and contributors.
-<span class="kw">Configuration</span> read from /home/virtualtam/public_html/shaarli/phpunit.xml
+<span class="ex">Configuration</span> read from /home/virtualtam/public_html/shaarli/phpunit.xml
-<span class="kw">....................................</span>
+<span class="ex">....................................</span>
-<span class="kw">Time</span>: 759 ms, Memory: 8.25Mb
+<span class="ex">Time</span>: 759 ms, Memory: 8.25Mb
-<span class="kw">OK</span> (36 tests, 65 assertions)</code></pre></div>
+<span class="ex">OK</span> (36 tests, 65 assertions)</code></pre></div>
<p>Test suite with failures and errors:</p>
-<div class="sourceCode"><pre class="sourceCode bash"><code class="sourceCode bash">$ <span class="kw">make</span> test
-<span class="kw">-------</span>
-<span class="kw">PHPUNIT</span>
-<span class="kw">-------</span>
-<span class="kw">PHPUnit</span> 4.6.9 by Sebastian Bergmann and contributors.
+<div class="sourceCode"><pre class="sourceCode bash"><code class="sourceCode bash">$ <span class="fu">make</span> test
+<span class="ex">-------</span>
+<span class="ex">PHPUNIT</span>
+<span class="ex">-------</span>
+<span class="ex">PHPUnit</span> 4.6.9 by Sebastian Bergmann and contributors.
-<span class="kw">Configuration</span> read from /home/virtualtam/public_html/shaarli/phpunit.xml
+<span class="ex">Configuration</span> read from /home/virtualtam/public_html/shaarli/phpunit.xml
-<span class="kw">E..FF...............................</span>
+<span class="ex">E..FF...............................</span>
-<span class="kw">Time</span>: 802 ms, Memory: 8.25Mb
+<span class="ex">Time</span>: 802 ms, Memory: 8.25Mb
-<span class="kw">There</span> was 1 error:
+<span class="ex">There</span> was 1 error:
-<span class="kw">1</span>) <span class="kw">LinkDBTest</span>::testConstructLoggedIn
-<span class="kw">Missing</span> argument 2 for LinkDB::__construct(), <span class="kw">called</span> in /home/virtualtam/public_html/shaarli/tests/Link\
+<span class="ex">1</span>) <span class="ex">LinkDBTest</span>::testConstructLoggedIn
+<span class="ex">Missing</span> argument 2 for LinkDB::__construct(), <span class="ex">called</span> in /home/virtualtam/public_html/shaarli/tests/Link\
DBTest.php on line 79 and defined
-<span class="kw">/home/virtualtam/public_html/shaarli/application</span>/LinkDB.php:<span class="kw">58</span>
-<span class="kw">/home/virtualtam/public_html/shaarli/tests</span>/LinkDBTest.php:<span class="kw">79</span>
+<span class="ex">/home/virtualtam/public_html/shaarli/application</span>/LinkDB.php:<span class="ex">58</span>
+<span class="ex">/home/virtualtam/public_html/shaarli/tests</span>/LinkDBTest.php:<span class="ex">79</span>
-<span class="kw">--</span>
+<span class="ex">--</span>
-<span class="kw">There</span> were 2 failures:
+<span class="ex">There</span> were 2 failures:
-<span class="kw">1</span>) <span class="kw">LinkDBTest</span>::testCheckDBNew
-<span class="kw">Failed</span> asserting that two strings are equal.
-<span class="kw">---</span> Expected
-<span class="kw">+++</span> Actual
-<span class="kw">@@</span> @@
-<span class="kw">-</span><span class="st">'e3edea8ea7bb50be4bcb404df53fbb4546a7156e'</span>
-<span class="kw">+</span><span class="st">'85eab0c610d4f68025f6ed6e6b6b5fabd4b55834'</span>
+<span class="ex">1</span>) <span class="ex">LinkDBTest</span>::testCheckDBNew
+<span class="ex">Failed</span> asserting that two strings are equal.
+<span class="ex">---</span> Expected
+<span class="ex">+++</span> Actual
+<span class="ex">@@</span> @@
+<span class="ex">-</span><span class="st">'e3edea8ea7bb50be4bcb404df53fbb4546a7156e'</span>
+<span class="ex">+</span><span class="st">'85eab0c610d4f68025f6ed6e6b6b5fabd4b55834'</span>
-<span class="kw">/home/virtualtam/public_html/shaarli/tests</span>/LinkDBTest.php:<span class="kw">121</span>
+<span class="ex">/home/virtualtam/public_html/shaarli/tests</span>/LinkDBTest.php:<span class="ex">121</span>
-<span class="kw">2</span>) <span class="kw">LinkDBTest</span>::testCheckDBLoad
-<span class="kw">Failed</span> asserting that two strings are equal.
-<span class="kw">---</span> Expected
-<span class="kw">+++</span> Actual
-<span class="kw">@@</span> @@
-<span class="kw">-</span><span class="st">'e3edea8ea7bb50be4bcb404df53fbb4546a7156e'</span>
-<span class="kw">+</span><span class="st">'85eab0c610d4f68025f6ed6e6b6b5fabd4b55834'</span>
+<span class="ex">2</span>) <span class="ex">LinkDBTest</span>::testCheckDBLoad
+<span class="ex">Failed</span> asserting that two strings are equal.
+<span class="ex">---</span> Expected
+<span class="ex">+++</span> Actual
+<span class="ex">@@</span> @@
+<span class="ex">-</span><span class="st">'e3edea8ea7bb50be4bcb404df53fbb4546a7156e'</span>
+<span class="ex">+</span><span class="st">'85eab0c610d4f68025f6ed6e6b6b5fabd4b55834'</span>
-<span class="kw">/home/virtualtam/public_html/shaarli/tests</span>/LinkDBTest.php:<span class="kw">133</span>
+<span class="ex">/home/virtualtam/public_html/shaarli/tests</span>/LinkDBTest.php:<span class="ex">133</span>
-<span class="kw">FAILURES</span>!
-<span class="kw">Tests</span>: 36, Assertions: 63, Errors: 1, Failures: 2.</code></pre></div>
+<span class="ex">FAILURES</span>!
+<span class="ex">Tests</span>: 36, Assertions: 63, Errors: 1, Failures: 2.</code></pre></div>
<h4 id="test-results-and-coverage">Test results and coverage</h4>
<p>By default, PHPUnit will run all suitable tests found under the <code>tests</code> directory.</p>
<p>Each test has 3 possible outcomes:</p>
--- /dev/null
+<!DOCTYPE html>
+<html>
+<head>
+ <meta charset="utf-8">
+ <meta name="generator" content="pandoc">
+ <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">
+ <title>Shaarli – Upgrade and migration</title>
+ <style type="text/css">code{white-space: pre;}</style>
+ <style type="text/css">
+div.sourceCode { overflow-x: auto; }
+table.sourceCode, tr.sourceCode, td.lineNumbers, td.sourceCode {
+ margin: 0; padding: 0; vertical-align: baseline; border: none; }
+table.sourceCode { width: 100%; line-height: 100%; }
+td.lineNumbers { text-align: right; padding-right: 4px; padding-left: 4px; color: #aaaaaa; border-right: 1px solid #aaaaaa; }
+td.sourceCode { padding-left: 5px; }
+code > span.kw { color: #007020; font-weight: bold; } /* Keyword */
+code > span.dt { color: #902000; } /* DataType */
+code > span.dv { color: #40a070; } /* DecVal */
+code > span.bn { color: #40a070; } /* BaseN */
+code > span.fl { color: #40a070; } /* Float */
+code > span.ch { color: #4070a0; } /* Char */
+code > span.st { color: #4070a0; } /* String */
+code > span.co { color: #60a0b0; font-style: italic; } /* Comment */
+code > span.ot { color: #007020; } /* Other */
+code > span.al { color: #ff0000; font-weight: bold; } /* Alert */
+code > span.fu { color: #06287e; } /* Function */
+code > span.er { color: #ff0000; font-weight: bold; } /* Error */
+code > span.wa { color: #60a0b0; font-weight: bold; font-style: italic; } /* Warning */
+code > span.cn { color: #880000; } /* Constant */
+code > span.sc { color: #4070a0; } /* SpecialChar */
+code > span.vs { color: #4070a0; } /* VerbatimString */
+code > span.ss { color: #bb6688; } /* SpecialString */
+code > span.im { } /* Import */
+code > span.va { color: #19177c; } /* Variable */
+code > span.cf { color: #007020; font-weight: bold; } /* ControlFlow */
+code > span.op { color: #666666; } /* Operator */
+code > span.bu { } /* BuiltIn */
+code > span.ex { } /* Extension */
+code > span.pp { color: #bc7a00; } /* Preprocessor */
+code > span.at { color: #7d9029; } /* Attribute */
+code > span.do { color: #ba2121; font-style: italic; } /* Documentation */
+code > span.an { color: #60a0b0; font-weight: bold; font-style: italic; } /* Annotation */
+code > span.cv { color: #60a0b0; font-weight: bold; font-style: italic; } /* CommentVar */
+code > span.in { color: #60a0b0; font-weight: bold; font-style: italic; } /* Information */
+ </style>
+ <link rel="stylesheet" href="github-markdown.css">
+ <!--[if lt IE 9]>
+ <script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv-printshiv.min.js"></script>
+ <![endif]-->
+</head>
+<body>
+<div id="local-sidebar">
+<ul>
+<li><a href="Home.html">Home</a></li>
+<li>Setup
+<ul>
+<li><a href="Download-and-Installation.html">Download and Installation</a></li>
+<li><a href="Upgrade-and-migration.html">Upgrade and migration</a></li>
+<li><a href="Server-requirements.html">Server requirements</a></li>
+<li><a href="Server-configuration.html">Server configuration</a></li>
+<li><a href="Server-security.html">Server security</a></li>
+<li><a href="Shaarli-configuration.html">Shaarli configuration</a></li>
+<li><a href="Plugins.html">Plugins</a></li>
+</ul></li>
+<li><a href="Docker.html">Docker</a></li>
+<li><a href="Usage.html">Usage</a>
+<ul>
+<li><a href="Sharing-button.html">Sharing button</a> (bookmarklet)</li>
+<li><a href="Browsing-and-Searching.html">Browsing and Searching</a></li>
+<li><a href="Firefox-share.html">Firefox share</a></li>
+<li><a href="RSS-feeds.html">RSS feeds</a></li>
+</ul></li>
+<li>How To
+<ul>
+<li><a href="Backup,-restore,-import-and-export.html">Backup, restore, import and export</a></li>
+<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>
+<li><a href="Create-and-serve-multiple-Shaarlis-(farm).html">Create and serve multiple Shaarlis (farm)</a></li>
+<li><a href="Download-CSS-styles-from-an-OPML-list.html">Download CSS styles from an OPML list</a></li>
+<li><a href="Datastore-hacks.html">Datastore hacks</a></li>
+</ul></li>
+<li><a href="Troubleshooting.html">Troubleshooting</a></li>
+<li><a href="Development.html">Development</a>
+<ul>
+<li><a href="GnuPG-signature.html">GnuPG signature</a></li>
+<li><a href="Coding-guidelines.html">Coding guidelines</a></li>
+<li><a href="Directory-structure.html">Directory structure</a></li>
+<li><a href="3rd-party-libraries.html">3rd party libraries</a></li>
+<li><a href="Plugin-System.html">Plugin System</a></li>
+<li><a href="Release-Shaarli.html">Release Shaarli</a></li>
+<li><a href="Security.html">Security</a></li>
+<li><a href="Static-analysis.html">Static analysis</a></li>
+<li><a href="Theming.html">Theming</a></li>
+<li><a href="Unit-tests.html">Unit tests</a></li>
+</ul></li>
+<li>About
+<ul>
+<li><a href="FAQ.html">FAQ</a></li>
+<li><a href="Community-&-Related-software.html">Community & Related software</a></li>
+</ul></li>
+</ul>
+</div>
+<h1 id="upgrade-and-migration">Upgrade and migration</h1>
+<h2 id="preparation">Preparation</h2>
+<h3 id="backup-your-data">Backup your data</h3>
+<p>Shaarli stores all user data under the <code>data</code> directory:</p>
+<ul>
+<li><code>data/config.php</code> - main configuration file</li>
+<li><code>data/datastore.php</code> - bookmarked links</li>
+<li><code>data/ipbans.php</code> - banned IP addresses</li>
+</ul>
+<p>See <a href="Shaarli-configuration.html">Shaarli configuration</a> for more information about Shaarli resources.</p>
+<p>It is recommended to backup this repository <em>before</em> starting updating/upgrading Shaarli:</p>
+<ul>
+<li>users with SSH access: copy or archive the directory to a temporary location</li>
+<li>users with FTP access: download a local copy of your Shaarli installation using your favourite client</li>
+</ul>
+<h3 id="migrating-data-from-a-previous-installation">Migrating data from a previous installation</h3>
+<p>As all user data is kept under <code>data</code>, this is the only directory you need to worry about when migrating to a new installation, which corresponds to the following steps:</p>
+<ul>
+<li>backup the <code>data</code> directory</li>
+<li>install or update Shaarli:
+<ul>
+<li>fresh installation - see <a href="Download-and-installation.html">Download and installation</a></li>
+<li>update - see the following sections</li>
+</ul></li>
+<li>check or restore the <code>data</code> directory</li>
+</ul>
+<h2 id="upgrading-from-release-archives">Upgrading from release archives</h2>
+<p>All tagged revisions can be downloaded as tarballs or ZIP archives from the <a href="https://github.com/shaarli/Shaarli/releases">releases</a> page.<a href=".html"></a></p>
+<p>We <em>recommend</em> using the releases from the <code>stable</code> branch, which are available as:</p>
+<ul>
+<li>gzipped tarball - <a href="https://github.com/shaarli/Shaarli/archive/stable.tar.gz" class="uri">https://github.com/shaarli/Shaarli/archive/stable.tar.gz</a></li>
+<li>ZIP archive - <a href="https://github.com/shaarli/Shaarli/archive/stable.zip" class="uri">https://github.com/shaarli/Shaarli/archive/stable.zip</a></li>
+</ul>
+<p>Once downloaded, extract the archive locally and update your remote installation (e.g. via FTP) -be sure you keep the contents of the <code>data</code> directory!</p>
+<p>After upgrading, access your fresh Shaarli installation from a web browser; the configuration will then be automatically updated, and new settings added to <code>data/config.php</code> (see <a href="Shaarli-configuration.html">Shaarli configuration</a> for more details).</p>
+<h2 id="upgrading-with-git">Upgrading with Git</h2>
+<h3 id="updating-a-community-shaarli">Updating a community Shaarli</h3>
+<p>If you have installed Shaarli from the <a href="Download#clone-with-git-recommended">community Git repository</a>, simply <a href="https://www.git-scm.com/docs/git-pull">pull new changes</a> from your local clone:<a href=".html"></a></p>
+<div class="sourceCode"><pre class="sourceCode bash"><code class="sourceCode bash">$ <span class="bu">cd</span> /path/to/shaarli
+$ <span class="fu">git</span> pull
+
+<span class="ex">From</span> github.com:shaarli/Shaarli
+ <span class="ex">*</span> branch master -<span class="op">></span> FETCH_HEAD
+<span class="ex">Updating</span> ebd67c6..521f0e6
+<span class="ex">Fast-forward</span>
+ <span class="ex">application/Url.php</span> <span class="kw">|</span> <span class="ex">1</span> +
+ <span class="ex">shaarli_version.php</span> <span class="kw">|</span> <span class="ex">2</span> +-
+ <span class="ex">tests/Url/UrlTest.php</span> <span class="kw">|</span> <span class="ex">1</span> +
+ <span class="ex">3</span> files changed, 3 insertions(+), <span class="ex">1</span> deletion(-)</code></pre></div>
+<p>Shaarli >= <code>v0.8.x</code>: install/update third-party PHP dependencies using <a href="https://getcomposer.org/">Composer</a>:<a href=".html"></a></p>
+<div class="sourceCode"><pre class="sourceCode bash"><code class="sourceCode bash">$ <span class="ex">composer</span> update --no-dev
+
+<span class="ex">Loading</span> composer repositories with package information
+<span class="ex">Updating</span> dependencies
+ <span class="ex">-</span> Installing shaarli/netscape-bookmark-parser (v1.0.1)
+ <span class="ex">Downloading</span>: 100%</code></pre></div>
+<h3 id="migrating-and-upgrading-from-sebsauvages-repository">Migrating and upgrading from Sebsauvage's repository</h3>
+<p>If you have installed Shaarli from <a href="https://github.com/sebsauvage/Shaarli">Sebsauvage's original Git repository</a>, you can use <a href="https://git-scm.com/book/en/v2/Git-Basics-Working-with-Remotes">Git remotes</a> to update your working copy.<a href=".html"></a></p>
+<p>The following guide assumes that:</p>
+<ul>
+<li>you have a basic knowledge of Git <a href="https://git-scm.com/book/en/v2/Git-Branching-Branches-in-a-Nutshell">branching</a> and <a href="https://git-scm.com/book/en/v2/Git-Basics-Working-with-Remotes">remote repositories</a><a href=".html"></a></li>
+<li>the default remote is named <code>origin</code> and points to Sebsauvage's repository</li>
+<li>the current branch is <code>master</code>
+<ul>
+<li>if you have personal branches containing customizations, you will need to <a href="https://git-scm.com/book/en/v2/Git-Branching-Rebasing">rebase them</a> after the upgrade; beware though, a lot of changes have been made since the community fork has been created, so things are very likely to break<embed src=".html" /></li>
+</ul></li>
+<li>the working copy is clean:
+<ul>
+<li>no versioned file has been locally modified</li>
+<li>no untracked files are present</li>
+</ul></li>
+</ul>
+<h4 id="step-0-show-repository-information">Step 0: show repository information</h4>
+<div class="sourceCode"><pre class="sourceCode bash"><code class="sourceCode bash">$ <span class="bu">cd</span> /path/to/shaarli
+
+$ <span class="fu">git</span> remote -v
+<span class="ex">origin</span> https://github.com/sebsauvage/Shaarli (fetch)
+<span class="ex">origin</span> https://github.com/sebsauvage/Shaarli (push)
+
+$ <span class="fu">git</span> branch -vv
+<span class="ex">*</span> master 029f75f [origin/master] Update README.md[](.html)
+
+$ <span class="fu">git</span> status
+<span class="ex">On</span> branch master
+<span class="ex">Your</span> branch is up-to-date with <span class="st">'origin/master'</span>.
+<span class="ex">nothing</span> to commit, working directory clean</code></pre></div>
+<h4 id="step-1-update-git-remotes">Step 1: update Git remotes</h4>
+<pre><code>$ git remote rename origin sebsauvage
+$ git remote -v
+sebsauvage https://github.com/sebsauvage/Shaarli (fetch)
+sebsauvage https://github.com/sebsauvage/Shaarli (push)
+
+$ git remote add origin https://github.com/shaarli/Shaarli
+$ git fetch origin
+
+remote: Counting objects: 3015, done.
+remote: Compressing objects: 100% (19/19), done.
+remote: Total 3015 (delta 446), reused 457 (delta 446), pack-reused 2550
+Receiving objects: 100% (3015/3015), 2.59 MiB | 918.00 KiB/s, done.
+Resolving deltas: 100% (1899/1899), completed with 48 local objects.
+From https://github.com/shaarli/Shaarli
+ * [new branch] master -> origin/master[](.html)
+ * [new branch] stable -> origin/stable[](.html)
+[...][](.html)
+ * [new tag] v0.6.4 -> v0.6.4[](.html)
+ * [new tag] v0.7.0 -> v0.7.0[](.html)</code></pre>
+<h4 id="step-2-use-the-stable-community-branch">Step 2: use the stable community branch</h4>
+<div class="sourceCode"><pre class="sourceCode bash"><code class="sourceCode bash">$ <span class="fu">git</span> checkout origin/stable -b stable
+<span class="ex">Branch</span> stable set up to track remote branch stable from origin.
+<span class="ex">Switched</span> to a new branch <span class="st">'stable'</span>
+
+$ <span class="fu">git</span> branch -vv
+ <span class="ex">master</span> 029f75f [sebsauvage/master] Update README.md[](.html)
+<span class="ex">*</span> stable 890afc3 [origin/stable] Merge pull request <span class="co">#509 from ArthurHoaro/v0.6.5[](.html)</span></code></pre></div>
+<p>Shaarli >= <code>v0.8.x</code>: install/update third-party PHP dependencies using <a href="https://getcomposer.org/">Composer</a>:<a href=".html"></a></p>
+<div class="sourceCode"><pre class="sourceCode bash"><code class="sourceCode bash">$ <span class="ex">composer</span> update --no-dev
+
+<span class="ex">Loading</span> composer repositories with package information
+<span class="ex">Updating</span> dependencies
+ <span class="ex">-</span> Installing shaarli/netscape-bookmark-parser (v1.0.1)
+ <span class="ex">Downloading</span>: 100%</code></pre></div>
+<p>Optionally, you can delete information related to the legacy version:</p>
+<div class="sourceCode"><pre class="sourceCode bash"><code class="sourceCode bash">$ <span class="fu">git</span> branch -D master
+<span class="ex">Deleted</span> branch master (was 029f75f)<span class="ex">.</span>
+
+$ <span class="fu">git</span> remote remove sebsauvage
+
+$ <span class="fu">git</span> remote -v
+<span class="ex">origin</span> https://github.com/shaarli/Shaarli (fetch)
+<span class="ex">origin</span> https://github.com/shaarli/Shaarli (push)
+
+$ <span class="fu">git</span> gc
+<span class="ex">Counting</span> objects: 3317, done.
+<span class="ex">Delta</span> compression using up to 8 threads.
+<span class="ex">Compressing</span> objects: 100% (1237/1237), <span class="kw">done</span><span class="ex">.</span>
+<span class="ex">Writing</span> objects: 100% (3317/3317), <span class="kw">done</span><span class="ex">.</span>
+<span class="ex">Total</span> 3317 (delta 2050), <span class="ex">reused</span> 3301 (delta 2034)<span class="ex">to</span></code></pre></div>
+<h4 id="step-3-configuration">Step 3: configuration</h4>
+<p>After migrating, access your fresh Shaarli installation from a web browser; the configuration will then be automatically updated, and new settings added to <code>data/config.php</code> (see <a href="Shaarli-configuration.html">Shaarli configuration</a> for more details).</p>
+</body>
+</html>
--- /dev/null
+#Upgrade and migration
+## Preparation
+### Backup your data
+
+Shaarli stores all user data under the `data` directory:
+- `data/config.php` - main configuration file
+- `data/datastore.php` - bookmarked links
+- `data/ipbans.php` - banned IP addresses
+
+See [Shaarli configuration](Shaarli-configuration.html) for more information about Shaarli resources.
+
+It is recommended to backup this repository _before_ starting updating/upgrading Shaarli:
+- users with SSH access: copy or archive the directory to a temporary location
+- users with FTP access: download a local copy of your Shaarli installation using your favourite client
+
+### Migrating data from a previous installation
+As all user data is kept under `data`, this is the only directory you need to worry about when migrating to a new installation, which corresponds to the following steps:
+
+- backup the `data` directory
+- install or update Shaarli:
+ - fresh installation - see [Download and installation](Download-and-installation.html)
+ - update - see the following sections
+- check or restore the `data` directory
+
+## Upgrading from release archives
+All tagged revisions can be downloaded as tarballs or ZIP archives from the [releases](https://github.com/shaarli/Shaarli/releases) page.[](.html)
+
+We _recommend_ using the releases from the `stable` branch, which are available as:
+- gzipped tarball - https://github.com/shaarli/Shaarli/archive/stable.tar.gz
+- ZIP archive - https://github.com/shaarli/Shaarli/archive/stable.zip
+
+Once downloaded, extract the archive locally and update your remote installation (e.g. via FTP) -be sure you keep the contents of the `data` directory!
+
+After upgrading, access your fresh Shaarli installation from a web browser; the configuration will then be automatically updated, and new settings added to `data/config.php` (see [Shaarli configuration](Shaarli-configuration.html) for more details).
+
+## Upgrading with Git
+### Updating a community Shaarli
+If you have installed Shaarli from the [community Git repository](Download#clone-with-git-recommended), simply [pull new changes](https://www.git-scm.com/docs/git-pull) from your local clone:[](.html)
+
+```bash
+$ cd /path/to/shaarli
+$ git pull
+
+From github.com:shaarli/Shaarli
+ * branch master -> FETCH_HEAD
+Updating ebd67c6..521f0e6
+Fast-forward
+ application/Url.php | 1 +
+ shaarli_version.php | 2 +-
+ tests/Url/UrlTest.php | 1 +
+ 3 files changed, 3 insertions(+), 1 deletion(-)
+```
+
+Shaarli >= `v0.8.x`: install/update third-party PHP dependencies using [Composer](https://getcomposer.org/):[](.html)
+
+```bash
+$ composer update --no-dev
+
+Loading composer repositories with package information
+Updating dependencies
+ - Installing shaarli/netscape-bookmark-parser (v1.0.1)
+ Downloading: 100%
+```
+
+### Migrating and upgrading from Sebsauvage's repository
+If you have installed Shaarli from [Sebsauvage's original Git repository](https://github.com/sebsauvage/Shaarli), you can use [Git remotes](https://git-scm.com/book/en/v2/Git-Basics-Working-with-Remotes) to update your working copy.[](.html)
+
+The following guide assumes that:
+- you have a basic knowledge of Git [branching](https://git-scm.com/book/en/v2/Git-Branching-Branches-in-a-Nutshell) and [remote repositories](https://git-scm.com/book/en/v2/Git-Basics-Working-with-Remotes)[](.html)
+- the default remote is named `origin` and points to Sebsauvage's repository
+- the current branch is `master`
+ - if you have personal branches containing customizations, you will need to [rebase them](https://git-scm.com/book/en/v2/Git-Branching-Rebasing) after the upgrade; beware though, a lot of changes have been made since the community fork has been created, so things are very likely to break![](.html)
+- the working copy is clean:
+ - no versioned file has been locally modified
+ - no untracked files are present
+
+#### Step 0: show repository information
+```bash
+$ cd /path/to/shaarli
+
+$ git remote -v
+origin https://github.com/sebsauvage/Shaarli (fetch)
+origin https://github.com/sebsauvage/Shaarli (push)
+
+$ git branch -vv
+* master 029f75f [origin/master] Update README.md[](.html)
+
+$ git status
+On branch master
+Your branch is up-to-date with 'origin/master'.
+nothing to commit, working directory clean
+```
+
+#### Step 1: update Git remotes
+```
+$ git remote rename origin sebsauvage
+$ git remote -v
+sebsauvage https://github.com/sebsauvage/Shaarli (fetch)
+sebsauvage https://github.com/sebsauvage/Shaarli (push)
+
+$ git remote add origin https://github.com/shaarli/Shaarli
+$ git fetch origin
+
+remote: Counting objects: 3015, done.
+remote: Compressing objects: 100% (19/19), done.
+remote: Total 3015 (delta 446), reused 457 (delta 446), pack-reused 2550
+Receiving objects: 100% (3015/3015), 2.59 MiB | 918.00 KiB/s, done.
+Resolving deltas: 100% (1899/1899), completed with 48 local objects.
+From https://github.com/shaarli/Shaarli
+ * [new branch] master -> origin/master[](.html)
+ * [new branch] stable -> origin/stable[](.html)
+[...][](.html)
+ * [new tag] v0.6.4 -> v0.6.4[](.html)
+ * [new tag] v0.7.0 -> v0.7.0[](.html)
+```
+
+#### Step 2: use the stable community branch
+
+```bash
+$ git checkout origin/stable -b stable
+Branch stable set up to track remote branch stable from origin.
+Switched to a new branch 'stable'
+
+$ git branch -vv
+ master 029f75f [sebsauvage/master] Update README.md[](.html)
+* stable 890afc3 [origin/stable] Merge pull request #509 from ArthurHoaro/v0.6.5[](.html)
+```
+
+Shaarli >= `v0.8.x`: install/update third-party PHP dependencies using [Composer](https://getcomposer.org/):[](.html)
+
+```bash
+$ composer update --no-dev
+
+Loading composer repositories with package information
+Updating dependencies
+ - Installing shaarli/netscape-bookmark-parser (v1.0.1)
+ Downloading: 100%
+```
+
+Optionally, you can delete information related to the legacy version:
+
+```bash
+$ git branch -D master
+Deleted branch master (was 029f75f).
+
+$ git remote remove sebsauvage
+
+$ git remote -v
+origin https://github.com/shaarli/Shaarli (fetch)
+origin https://github.com/shaarli/Shaarli (push)
+
+$ git gc
+Counting objects: 3317, done.
+Delta compression using up to 8 threads.
+Compressing objects: 100% (1237/1237), done.
+Writing objects: 100% (3317/3317), done.
+Total 3317 (delta 2050), reused 3301 (delta 2034)to
+```
+
+#### Step 3: configuration
+After migrating, access your fresh Shaarli installation from a web browser; the configuration will then be automatically updated, and new settings added to `data/config.php` (see [Shaarli configuration](Shaarli-configuration.html) for more details).
+++ /dev/null
-<!DOCTYPE html>
-<html>
-<head>
- <meta charset="utf-8">
- <meta name="generator" content="pandoc">
- <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">
- <title>Shaarli – Upgrade from original sebsauvage Shaarli</title>
- <style type="text/css">code{white-space: pre;}</style>
- <link rel="stylesheet" href="github-markdown.css">
- <!--[if lt IE 9]>
- <script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv-printshiv.min.js"></script>
- <![endif]-->
-</head>
-<body>
-<div id="local-sidebar">
-<ul>
-<li><a href="Home.html">Home</a></li>
-<li>Installation
-<ul>
-<li><a href="Download.html">Download</a></li>
-<li><a href="Server-requirements.html">Server requirements</a></li>
-<li><a href="Server-configuration.html">Server configuration</a></li>
-<li><a href="Server-security.html">Server security</a></li>
-<li><a href="Shaarli-installation.html">Shaarli installation</a></li>
-<li><a href="Shaarli-configuration.html">Shaarli configuration</a></li>
-<li><a href="Plugins.html">Plugins</a></li>
-</ul></li>
-<li><a href="Docker.html">Docker</a></li>
-<li><a href="Usage.html">Usage</a>
-<ul>
-<li><a href="Sharing-button.html">Sharing button</a> (bookmarklet)</li>
-<li><a href="Browsing-and-Searching.html">Browsing and Searching</a></li>
-<li><a href="Firefox-share.html">Firefox share</a></li>
-<li><a href="RSS-feeds.html">RSS feeds</a></li>
-</ul></li>
-<li>How To
-<ul>
-<li><a href="Backup,-restore,-import-and-export.html">Backup, restore, import and export</a></li>
-<li><a href="Upgrade-from-original-sebsauvage/Shaarli.html">Upgrade from original sebsauvage/Shaarli</a></li>
-<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>
-<li><a href="Create-and-serve-multiple-Shaarlis-(farm).html">Create and serve multiple Shaarlis (farm)</a></li>
-<li><a href="Download-CSS-styles-from-an-OPML-list.html">Download CSS styles from an OPML list</a></li>
-<li><a href="Datastore-hacks.html">Datastore hacks</a></li>
-</ul></li>
-<li><a href="Troubleshooting.html">Troubleshooting</a></li>
-<li><a href="Development.html">Development</a>
-<ul>
-<li><a href="GnuPG-signature.html">GnuPG signature</a></li>
-<li><a href="Coding-guidelines.html">Coding guidelines</a></li>
-<li><a href="Directory-structure.html">Directory structure</a></li>
-<li><a href="3rd-party-libraries.html">3rd party libraries</a></li>
-<li><a href="Plugin-System.html">Plugin System</a></li>
-<li><a href="Release-Shaarli.html">Release Shaarli</a></li>
-<li><a href="Security.html">Security</a></li>
-<li><a href="Static-analysis.html">Static analysis</a></li>
-<li><a href="Theming.html">Theming</a></li>
-<li><a href="Unit-tests.html">Unit tests</a></li>
-</ul></li>
-<li>About
-<ul>
-<li><a href="FAQ.html">FAQ</a></li>
-<li><a href="Community-&-Related-software.html">Community & Related software</a></li>
-<li><a href="TODO.html">TODO</a></li>
-</ul></li>
-</ul>
-</div>
-<h1 id="upgrade-from-original-sebsauvage-shaarli">Upgrade from original sebsauvage Shaarli</h1>
-<ul>
-<li>Backup your original <code>data/</code> directory.</li>
-<li><a href="https://github.com/shaarli/Shaarli#installation--upgrade">Install</a> and setup the Shaarli community fork.<a href=".html"></a></li>
-<li>Copy your original <code>data</code> directory over the new installation.</li>
-</ul>
-</body>
-</html>
+++ /dev/null
-#Upgrade from original sebsauvage Shaarli
- * Backup your original `data/` directory.
- * [Install](https://github.com/shaarli/Shaarli#installation--upgrade) and setup the Shaarli community fork.[](.html)
- * Copy your original `data` directory over the new installation.
<div id="local-sidebar">
<ul>
<li><a href="Home.html">Home</a></li>
-<li>Installation
+<li>Setup
<ul>
-<li><a href="Download.html">Download</a></li>
+<li><a href="Download-and-Installation.html">Download and Installation</a></li>
+<li><a href="Upgrade-and-migration.html">Upgrade and migration</a></li>
<li><a href="Server-requirements.html">Server requirements</a></li>
<li><a href="Server-configuration.html">Server configuration</a></li>
<li><a href="Server-security.html">Server security</a></li>
-<li><a href="Shaarli-installation.html">Shaarli installation</a></li>
<li><a href="Shaarli-configuration.html">Shaarli configuration</a></li>
<li><a href="Plugins.html">Plugins</a></li>
</ul></li>
<li>How To
<ul>
<li><a href="Backup,-restore,-import-and-export.html">Backup, restore, import and export</a></li>
-<li><a href="Upgrade-from-original-sebsauvage/Shaarli.html">Upgrade from original sebsauvage/Shaarli</a></li>
<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>
<li><a href="Create-and-serve-multiple-Shaarlis-(farm).html">Create and serve multiple Shaarlis (farm)</a></li>
<li><a href="Download-CSS-styles-from-an-OPML-list.html">Download CSS styles from an OPML list</a></li>
<ul>
<li><a href="FAQ.html">FAQ</a></li>
<li><a href="Community-&-Related-software.html">Community & Related software</a></li>
-<li><a href="TODO.html">TODO</a></li>
</ul></li>
</ul>
</div>
<div id="local-sidebar">
<ul>
<li><a href="Home.html">Home</a></li>
-<li>Installation
+<li>Setup
<ul>
-<li><a href="Download.html">Download</a></li>
+<li><a href="Download-and-Installation.html">Download and Installation</a></li>
+<li><a href="Upgrade-and-migration.html">Upgrade and migration</a></li>
<li><a href="Server-requirements.html">Server requirements</a></li>
<li><a href="Server-configuration.html">Server configuration</a></li>
<li><a href="Server-security.html">Server security</a></li>
-<li><a href="Shaarli-installation.html">Shaarli installation</a></li>
<li><a href="Shaarli-configuration.html">Shaarli configuration</a></li>
<li><a href="Plugins.html">Plugins</a></li>
</ul></li>
<li>How To
<ul>
<li><a href="Backup,-restore,-import-and-export.html">Backup, restore, import and export</a></li>
-<li><a href="Upgrade-from-original-sebsauvage/Shaarli.html">Upgrade from original sebsauvage/Shaarli</a></li>
<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>
<li><a href="Create-and-serve-multiple-Shaarlis-(farm).html">Create and serve multiple Shaarlis (farm)</a></li>
<li><a href="Download-CSS-styles-from-an-OPML-list.html">Download CSS styles from an OPML list</a></li>
<ul>
<li><a href="FAQ.html">FAQ</a></li>
<li><a href="Community-&-Related-software.html">Community & Related software</a></li>
-<li><a href="TODO.html">TODO</a></li>
</ul></li>
</ul>
</div>
-<h1 id="footer-shaarli-the-personal-minimalist-super-fast-no-database-delicious-clone">_Footer<br />
-<em>Shaarli, the personal, minimalist, super-fast, no-database delicious clone</em></h1>
+<h1 id="footer-shaarli-the-personal-minimalist-super-fast-database-free-bookmarking-service">_Footer<br />
+<em>Shaarli, the personal, minimalist, super-fast, database-free bookmarking service</em></h1>
</body>
</html>
#_Footer
-_Shaarli, the personal, minimalist, super-fast, no-database delicious clone_
+_Shaarli, the personal, minimalist, super-fast, database-free bookmarking service_
<div id="local-sidebar">
<ul>
<li><a href="Home.html">Home</a></li>
-<li>Installation
+<li>Setup
<ul>
-<li><a href="Download.html">Download</a></li>
+<li><a href="Download-and-Installation.html">Download and Installation</a></li>
+<li><a href="Upgrade-and-migration.html">Upgrade and migration</a></li>
<li><a href="Server-requirements.html">Server requirements</a></li>
<li><a href="Server-configuration.html">Server configuration</a></li>
<li><a href="Server-security.html">Server security</a></li>
-<li><a href="Shaarli-installation.html">Shaarli installation</a></li>
<li><a href="Shaarli-configuration.html">Shaarli configuration</a></li>
<li><a href="Plugins.html">Plugins</a></li>
</ul></li>
<li>How To
<ul>
<li><a href="Backup,-restore,-import-and-export.html">Backup, restore, import and export</a></li>
-<li><a href="Upgrade-from-original-sebsauvage/Shaarli.html">Upgrade from original sebsauvage/Shaarli</a></li>
<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>
<li><a href="Create-and-serve-multiple-Shaarlis-(farm).html">Create and serve multiple Shaarlis (farm)</a></li>
<li><a href="Download-CSS-styles-from-an-OPML-list.html">Download CSS styles from an OPML list</a></li>
<ul>
<li><a href="FAQ.html">FAQ</a></li>
<li><a href="Community-&-Related-software.html">Community & Related software</a></li>
-<li><a href="TODO.html">TODO</a></li>
</ul></li>
</ul>
</div>
<h1 id="sidebar">_Sidebar</h1>
<ul>
<li><a href="Home.html">Home</a></li>
-<li>Installation
+<li>Setup
<ul>
-<li><a href="Download.html">Download</a></li>
+<li><a href="Download-and-Installation.html">Download and Installation</a></li>
+<li><a href="Upgrade-and-migration.html">Upgrade and migration</a></li>
<li><a href="Server-requirements.html">Server requirements</a></li>
<li><a href="Server-configuration.html">Server configuration</a></li>
<li><a href="Server-security.html">Server security</a></li>
-<li><a href="Shaarli-installation.html">Shaarli installation</a></li>
<li><a href="Shaarli-configuration.html">Shaarli configuration</a></li>
<li><a href="Plugins.html">Plugins</a></li>
</ul></li>
<li>How To
<ul>
<li><a href="Backup,-restore,-import-and-export.html">Backup, restore, import and export</a></li>
-<li><a href="Upgrade-from-original-sebsauvage/Shaarli.html">Upgrade from original sebsauvage/Shaarli</a></li>
<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>
<li><a href="Create-and-serve-multiple-Shaarlis-(farm).html">Create and serve multiple Shaarlis (farm)</a></li>
<li><a href="Download-CSS-styles-from-an-OPML-list.html">Download CSS styles from an OPML list</a></li>
<ul>
<li><a href="FAQ.html">FAQ</a></li>
<li><a href="Community-&-Related-software.html">Community & Related software</a></li>
-<li><a href="TODO.html">TODO</a></li>
</ul></li>
</ul>
</body>
#_Sidebar
- [Home](Home.html)
-- Installation
- - [Download](Download.html)
+- Setup
+ - [Download and Installation](Download-and-Installation.html)
+ - [Upgrade and migration](Upgrade-and-migration.html)
- [Server requirements](Server-requirements.html)
- [Server configuration](Server-configuration.html)
- [Server security](Server-security.html)
- - [Shaarli installation](Shaarli-installation.html)
- [Shaarli configuration](Shaarli-configuration.html)
- [Plugins](Plugins.html)
- [Docker](Docker.html)
- [RSS feeds](RSS-feeds.html)
- How To
- [Backup, restore, import and export](Backup,-restore,-import-and-export.html)
- - [Upgrade from original sebsauvage/Shaarli](Upgrade-from-original-sebsauvage/Shaarli.html)
- [Copy an existing installation over SSH and serve it locally](Copy-an-existing-installation-over-SSH-and-serve-it-locally.html)
- [Create and serve multiple Shaarlis (farm)](Create-and-serve-multiple-Shaarlis-(farm).html)
- [Download CSS styles from an OPML list](Download-CSS-styles-from-an-OPML-list.html)
- About
- [FAQ](FAQ.html)
- [Community & Related software](Community-&-Related-software.html)
- - [TODO](TODO.html)
<div id="local-sidebar">
<ul>
<li><a href="Home.html">Home</a></li>
-<li>Installation
+<li>Setup
<ul>
-<li><a href="Download.html">Download</a></li>
+<li><a href="Download-and-Installation.html">Download and Installation</a></li>
+<li><a href="Upgrade-and-migration.html">Upgrade and migration</a></li>
<li><a href="Server-requirements.html">Server requirements</a></li>
<li><a href="Server-configuration.html">Server configuration</a></li>
<li><a href="Server-security.html">Server security</a></li>
-<li><a href="Shaarli-installation.html">Shaarli installation</a></li>
<li><a href="Shaarli-configuration.html">Shaarli configuration</a></li>
<li><a href="Plugins.html">Plugins</a></li>
</ul></li>
<li>How To
<ul>
<li><a href="Backup,-restore,-import-and-export.html">Backup, restore, import and export</a></li>
-<li><a href="Upgrade-from-original-sebsauvage/Shaarli.html">Upgrade from original sebsauvage/Shaarli</a></li>
<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>
<li><a href="Create-and-serve-multiple-Shaarlis-(farm).html">Create and serve multiple Shaarlis (farm)</a></li>
<li><a href="Download-CSS-styles-from-an-OPML-list.html">Download CSS styles from an OPML list</a></li>
<ul>
<li><a href="FAQ.html">FAQ</a></li>
<li><a href="Community-&-Related-software.html">Community & Related software</a></li>
-<li><a href="TODO.html">TODO</a></li>
</ul></li>
</ul>
</div>
FROM debian:jessie
MAINTAINER Shaarli Community
+ENV TERM dumb
RUN apt-get update \
- && apt-get install -y \
- nginx-light php5-fpm php5-gd supervisor \
- git nano
-
-ADD https://getcomposer.org/composer.phar /usr/local/bin/composer
-RUN chmod 755 /usr/local/bin/composer
+ && apt-get install --no-install-recommends -y \
+ ca-certificates \
+ nginx-light \
+ php5-curl \
+ php5-fpm \
+ php5-gd \
+ php5-intl \
+ supervisor \
+ git \
+ nano \
+ && apt-get clean
COPY nginx.conf /etc/nginx/nginx.conf
COPY supervised.conf /etc/supervisor/conf.d/supervised.conf
-RUN echo "<?php phpinfo(); ?>" > /var/www/index.php
+
+ADD https://getcomposer.org/composer.phar /usr/local/bin/composer
+RUN chmod 755 /usr/local/bin/composer
WORKDIR /var/www
+RUN git clone https://github.com/shaarli/Shaarli.git shaarli \
+ && cd shaarli \
+ && composer --prefer-dist install
RUN rm -rf html \
- && git clone https://github.com/shaarli/Shaarli.git shaarli \
+ && echo "<?php phpinfo(); ?>" > index.php \
&& chown -R www-data:www-data .
-WORKDIR /var/www/shaarli
-RUN composer install
-
VOLUME /var/www/shaarli/data
EXPOSE 80
FROM debian:jessie
MAINTAINER Shaarli Community
+ENV TERM dumb
RUN apt-get update \
- && apt-get install -y curl nginx-light php5-fpm php5-gd supervisor
+ && apt-get install --no-install-recommends -y \
+ ca-certificates \
+ curl \
+ nginx-light \
+ php5-curl \
+ php5-fpm \
+ php5-gd \
+ php5-intl \
+ supervisor \
+ && apt-get clean
COPY nginx.conf /etc/nginx/nginx.conf
COPY supervised.conf /etc/supervisor/conf.d/supervised.conf
+ADD https://getcomposer.org/composer.phar /usr/local/bin/composer
+RUN chmod 755 /usr/local/bin/composer
+
WORKDIR /var/www
-RUN rm -rf html \
- && curl -L https://github.com/shaarli/Shaarli/archive/master.tar.gz | tar xvzf - \
+RUN curl -L https://github.com/shaarli/Shaarli/archive/master.tar.gz | tar xzf - \
&& mv Shaarli-master shaarli \
- && chown -R www-data:www-data shaarli
+ && cd shaarli \
+ && composer --prefer-dist --no-dev install
+RUN rm -rf html \
+ && chown -R www-data:www-data .
VOLUME /var/www/shaarli/data
FROM debian:jessie
MAINTAINER Shaarli Community
+ENV TERM dumb
RUN apt-get update \
- && apt-get install -y curl nginx-light php5-fpm php5-gd supervisor
+ && apt-get install --no-install-recommends -y \
+ ca-certificates \
+ curl \
+ nginx-light \
+ php5-curl \
+ php5-fpm \
+ php5-gd \
+ php5-intl \
+ supervisor \
+ && apt-get clean
COPY nginx.conf /etc/nginx/nginx.conf
COPY supervised.conf /etc/supervisor/conf.d/supervised.conf
+ADD https://getcomposer.org/composer.phar /usr/local/bin/composer
+RUN chmod 755 /usr/local/bin/composer
+
WORKDIR /var/www
-RUN rm -rf html \
- && curl -L https://github.com/shaarli/Shaarli/archive/stable.tar.gz | tar xvzf - \
+RUN curl -L https://github.com/shaarli/Shaarli/archive/stable.tar.gz | tar xzf - \
&& mv Shaarli-stable shaarli \
- && chown -R www-data:www-data shaarli
+ && cd shaarli \
+ && composer --prefer-dist --no-dev install
+RUN rm -rf html \
+ && chown -R www-data:www-data .
VOLUME /var/www/shaarli/data
}
#pluginsadmin .plugin_parameter {
- padding: 5px 0;
+ padding: 10px 0;
border-width: 1px 0;
border-style: solid;
border-color: #c0c0c0;
#pluginsadmin .float_label {
float: left;
- width: 20%;
+ width: 40%;
}
#pluginsadmin a {
<?php
/**
- * Shaarli v0.7.0 - Shaare your links...
+ * Shaarli v0.8.0 - Shaare your links...
*
* The personal, minimalist, super-fast, database free, bookmarking service.
*
/*
* PHP configuration
*/
-define('shaarli_version', '0.7.0');
+define('shaarli_version', '0.8.0');
// http://server.com/x/shaarli --> /shaarli/
define('WEB_PATH', substr($_SERVER['REQUEST_URI'], 0, 1+strrpos($_SERVER['REQUEST_URI'], '/', 0)));
//error_reporting(-1);
+// 3rd-party libraries
+if (! file_exists(__DIR__ . '/vendor/autoload.php')) {
+ header('Content-Type: text/plain; charset=utf-8');
+ echo "Error: missing Composer configuration\n\n"
+ ."If you installed Shaarli through Git or using the development branch,\n"
+ ."please refer to the installation documentation to install PHP"
+ ." dependencies using Composer:\n"
+ ."- https://github.com/shaarli/Shaarli/wiki/Server-requirements\n"
+ ."- https://github.com/shaarli/Shaarli/wiki/Download-and-Installation";
+ exit;
+}
+require_once 'inc/rain.tpl.class.php';
+require_once __DIR__ . '/vendor/autoload.php';
+
// Shaarli library
require_once 'application/ApplicationUtils.php';
require_once 'application/Cache.php';
require_once 'application/FeedBuilder.php';
require_once 'application/FileUtils.php';
require_once 'application/HttpUtils.php';
+require_once 'application/Languages.php';
require_once 'application/LinkDB.php';
require_once 'application/LinkFilter.php';
require_once 'application/LinkUtils.php';
require_once 'application/PluginManager.php';
require_once 'application/Router.php';
require_once 'application/Updater.php';
-require_once 'inc/rain.tpl.class.php';
// Ensure the PHP version is supported
try {
if ($targetPage == Router::$PAGE_LOGIN)
{
if ($conf->get('security.open_shaarli')) { header('Location: ?'); exit; } // No need to login for open Shaarli
- $token=''; if (ban_canLogin($conf)) $token=getToken($conf); // Do not waste token generation if not useful.
- $PAGE->assign('token',$token);
if (isset($_GET['username'])) {
$PAGE->assign('username', escape($_GET['username']));
}
}
else // show the change password form.
{
- $PAGE->assign('token',getToken($conf));
$PAGE->renderPage('changepassword');
exit;
}
}
else // Show the configuration form.
{
- $PAGE->assign('token',getToken($conf));
$PAGE->assign('title', $conf->get('general.title'));
$PAGE->assign('redirector', $conf->get('redirector.url'));
list($timezone_form, $timezone_js) = generateTimeZoneForm($conf->get('general.timezone'));
if ($targetPage == Router::$PAGE_CHANGETAG)
{
if (empty($_POST['fromtag']) || (empty($_POST['totag']) && isset($_POST['renametag']))) {
- $PAGE->assign('token', getToken($conf));
$PAGE->assign('tags', $LINKSDB->allTags());
$PAGE->renderPage('changetag');
exit;
$data = array(
'link' => $link,
'link_is_new' => false,
- 'token' => getToken($conf),
'http_referer' => (isset($_SERVER['HTTP_REFERER']) ? escape($_SERVER['HTTP_REFERER']) : ''),
'tags' => $LINKSDB->allTags(),
);
$data = array(
'link' => $link,
'link_is_new' => $link_is_new,
- 'token' => getToken($conf), // XSRF protection.
'http_referer' => (isset($_SERVER['HTTP_REFERER']) ? escape($_SERVER['HTTP_REFERER']) : ''),
'source' => (isset($_GET['source']) ? $_GET['source'] : ''),
'tags' => $LINKSDB->allTags(),
- 'default_private_links' => $conf->get('default_private_links', false),
+ 'default_private_links' => $conf->get('privacy.default_private_links', false),
);
$pluginManager->executeHooks('render_editlink', $data);
exit;
}
- // -------- User is uploading a file for import
- if (isset($_SERVER['QUERY_STRING']) && startsWith($_SERVER['QUERY_STRING'], 'do=upload'))
- {
- // If file is too big, some form field may be missing.
- if (!isset($_POST['token']) || (!isset($_FILES)) || (isset($_FILES['filetoupload']['size']) && $_FILES['filetoupload']['size']==0))
- {
- $returnurl = ( empty($_SERVER['HTTP_REFERER']) ? '?' : $_SERVER['HTTP_REFERER'] );
- echo '<script>alert("The file you are trying to upload is probably bigger than what this webserver can accept ('.getMaxFileSize().' bytes). Please upload in smaller chunks.");document.location=\''.escape($returnurl).'\';</script>';
+ if ($targetPage == Router::$PAGE_IMPORT) {
+ // Upload a Netscape bookmark dump to import its contents
+
+ if (! isset($_POST['token']) || ! isset($_FILES['filetoupload'])) {
+ // Show import dialog
+ $PAGE->assign('maxfilesize', getMaxFileSize());
+ $PAGE->renderPage('import');
exit;
}
- if (!tokenOk($_POST['token'])) die('Wrong token.');
- importFile($LINKSDB);
- exit;
- }
- // -------- Show upload/import dialog:
- if ($targetPage == Router::$PAGE_IMPORT)
- {
- $PAGE->assign('token',getToken($conf));
- $PAGE->assign('maxfilesize',getMaxFileSize());
- $PAGE->renderPage('import');
+ // Import bookmarks from an uploaded file
+ if (isset($_FILES['filetoupload']['size']) && $_FILES['filetoupload']['size'] == 0) {
+ // The file is too big or some form field may be missing.
+ echo '<script>alert("The file you are trying to upload is probably'
+ .' bigger than what this webserver can accept ('
+ .getMaxFileSize().' bytes).'
+ .' Please upload in smaller chunks.");document.location=\'?do='
+ .Router::$PAGE_IMPORT .'\';</script>';
+ exit;
+ }
+ if (! tokenOk($_POST['token'])) {
+ die('Wrong token.');
+ }
+ $status = NetscapeBookmarkUtils::import(
+ $_POST,
+ $_FILES,
+ $LINKSDB,
+ $conf->get('resource.page_cache')
+ );
+ echo '<script>alert("'.$status.'");document.location=\'?do='
+ .Router::$PAGE_IMPORT .'\';</script>';
exit;
}
exit;
}
-/**
- * Process the import file form.
- *
- * @param LinkDB $LINKSDB Loaded LinkDB instance.
- * @param ConfigManager $conf Configuration Manager instance.
- */
-function importFile($LINKSDB, $conf)
-{
- if (!isLoggedIn()) { die('Not allowed.'); }
-
- $filename=$_FILES['filetoupload']['name'];
- $filesize=$_FILES['filetoupload']['size'];
- $data=file_get_contents($_FILES['filetoupload']['tmp_name']);
- $private = (empty($_POST['private']) ? 0 : 1); // Should the links be imported as private?
- $overwrite = !empty($_POST['overwrite']) ; // Should the imported links overwrite existing ones?
- $import_count=0;
-
- // Sniff file type:
- $type='unknown';
- if (startsWith($data,'<!DOCTYPE NETSCAPE-Bookmark-file-1>')) $type='netscape'; // Netscape bookmark file (aka Firefox).
-
- // Then import the bookmarks.
- if ($type=='netscape')
- {
- // This is a standard Netscape-style bookmark file.
- // This format is supported by all browsers (except IE, of course), also Delicious, Diigo and others.
- foreach(explode('<DT>',$data) as $html) // explode is very fast
- {
- $link = array('linkdate'=>'','title'=>'','url'=>'','description'=>'','tags'=>'','private'=>0);
- $d = explode('<DD>',$html);
- if (startsWith($d[0], '<A '))
- {
- $link['description'] = (isset($d[1]) ? html_entity_decode(trim($d[1]),ENT_QUOTES,'UTF-8') : ''); // Get description (optional)
- preg_match('!<A .*?>(.*?)</A>!i',$d[0],$matches); $link['title'] = (isset($matches[1]) ? trim($matches[1]) : ''); // Get title
- $link['title'] = html_entity_decode($link['title'],ENT_QUOTES,'UTF-8');
- preg_match_all('! ([A-Z_]+)=\"(.*?)"!i',$html,$matches,PREG_SET_ORDER); // Get all other attributes
- $raw_add_date=0;
- foreach($matches as $m)
- {
- $attr=$m[1]; $value=$m[2];
- if ($attr=='HREF') $link['url']=html_entity_decode($value,ENT_QUOTES,'UTF-8');
- elseif ($attr=='ADD_DATE')
- {
- $raw_add_date=intval($value);
- if ($raw_add_date>30000000000) $raw_add_date/=1000; //If larger than year 2920, then was likely stored in milliseconds instead of seconds
- }
- elseif ($attr=='PRIVATE') $link['private']=($value=='0'?0:1);
- elseif ($attr=='TAGS') $link['tags']=html_entity_decode(str_replace(',',' ',$value),ENT_QUOTES,'UTF-8');
- }
- if ($link['url']!='')
- {
- if ($private==1) $link['private']=1;
- $dblink = $LINKSDB->getLinkFromUrl($link['url']); // See if the link is already in database.
- if ($dblink==false)
- { // Link not in database, let's import it...
- if (empty($raw_add_date)) $raw_add_date=time(); // In case of shitty bookmark file with no ADD_DATE
-
- // Make sure date/time is not already used by another link.
- // (Some bookmark files have several different links with the same ADD_DATE)
- // We increment date by 1 second until we find a date which is not used in DB.
- // (so that links that have the same date/time are more or less kept grouped by date, but do not conflict.)
- while (!empty($LINKSDB[date('Ymd_His',$raw_add_date)])) { $raw_add_date++; }// Yes, I know it's ugly.
- $link['linkdate']=date('Ymd_His',$raw_add_date);
- $LINKSDB[$link['linkdate']] = $link;
- $import_count++;
- }
- else // Link already present in database.
- {
- if ($overwrite)
- { // If overwrite is required, we import link data, except date/time.
- $link['linkdate']=$dblink['linkdate'];
- $LINKSDB[$link['linkdate']] = $link;
- $import_count++;
- }
- }
-
- }
- }
- }
- $LINKSDB->savedb($conf->get('resource.page_cache'));
-
- echo '<script>alert("File '.json_encode($filename).' ('.$filesize.' bytes) was successfully processed: '.$import_count.' links imported.");document.location=\'?\';</script>';
- }
- else
- {
- echo '<script>alert("File '.json_encode($filename).' ('.$filesize.' bytes) has an unknown file format. Nothing was imported.");document.location=\'?\';</script>';
- }
-}
-
/**
* Template for the list of links (<div id="linklist">)
* This function fills all the necessary fields in the $PAGE for the template 'linklist.html'
'search_term' => $searchterm,
'search_tags' => $searchtags,
'redirector' => $conf->get('redirector.url'), // Optional redirector URL.
- 'token' => $token,
'links' => $linkDisp,
'tags' => $LINKSDB->allTags(),
);
}
return $data;
-}
\ No newline at end of file
+}
}
return $data;
-}
\ No newline at end of file
+}
### Installation
-Clone this repository inside your `tpl/plugins/` directory, or download the archive and unpack it there.
+Clone this repository inside your `tpl/plugins/` directory, or download the archive and unpack it there.
The directory structure should look like:
-```
+```bash
└── tpl
└── plugins
- └── wallabag
- ├── README.md
- ├── wallabag.html
- ├── wallabag.meta
- ├── wallabag.php
- ├── wallabag.php
- └── WallabagInstance.php
+ └── wallabag
+ ├── README.md
+ ├── wallabag.html
+ ├── wallabag.meta
+ ├── wallabag.php
+ ├── wallabag.php
+ └── WallabagInstance.php
```
To enable the plugin, you can either:
Go to the plugin administration page, and edit the following settings (with the plugin enabled).
-**WALLABAG_URL**: *Wallabag instance URL*
+**WALLABAG_URL**: *Wallabag instance URL*
Example value: `http://v2.wallabag.org`
-**WALLABAG_VERSION**: *Wallabag version*
+**WALLABAG_VERSION**: *Wallabag version*
Value: either `1` (for 1.x) or `2` (for 2.x)
-> Note: these settings can also be set in `data/config.json.php`, in the plugins section.
\ No newline at end of file
+> Note: these settings can also be set in `data/config.json.php`, in the plugins section.
description="For each link, add a Wallabag icon to save it in your instance."
-parameters="WALLABAG_URL;WALLABAG_VERSION"
\ No newline at end of file
+parameters="WALLABAG_URL;WALLABAG_VERSION"
+parameter.WALLABAG_URL="Wallabag API URL"
+parameter.WALLABAG_VERSION="Wallabag API version (1 or 2)"
\ No newline at end of file
-<?php /* 0.7.0 */ ?>
+<?php /* 0.8.0 */ ?>
--- /dev/null
+<?php
+
+require_once 'application/Languages.php';
+
+/**
+ * Class LanguagesTest.
+ */
+class LanguagesTest extends PHPUnit_Framework_TestCase
+{
+ /**
+ * Test t() with a simple non identified value.
+ */
+ public function testTranslateSingleNotID()
+ {
+ $text = 'abcdé 564 fgK';
+ $this->assertEquals($text, t($text));
+ }
+
+ /**
+ * Test t() with a non identified plural form.
+ */
+ public function testTranslatePluralNotID()
+ {
+ $text = '%s sandwich';
+ $nText = '%s sandwiches';
+ $this->assertEquals('0 sandwich', t($text, $nText));
+ $this->assertEquals('1 sandwich', t($text, $nText, 1));
+ $this->assertEquals('2 sandwiches', t($text, $nText, 2));
+ }
+
+ /**
+ * Test t() with a non identified invalid plural form.
+ */
+ public function testTranslatePluralNotIDInvalid()
+ {
+ $text = 'sandwich';
+ $nText = 'sandwiches';
+ $this->assertEquals('sandwich', t($text, $nText, 1));
+ $this->assertEquals('sandwiches', t($text, $nText, 2));
+ }
+}
require_once 'application/NetscapeBookmarkUtils.php';
/**
- * Netscape bookmark import and export
+ * Netscape bookmark export
*/
-class NetscapeBookmarkUtilsTest extends PHPUnit_Framework_TestCase
+class BookmarkExportTest extends PHPUnit_Framework_TestCase
{
/**
* @var string datastore to test write operations
--- /dev/null
+<?php
+
+require_once 'application/NetscapeBookmarkUtils.php';
+
+
+/**
+ * Utility function to load a file's metadata in a $_FILES-like array
+ *
+ * @param string $filename Basename of the file
+ *
+ * @return array A $_FILES-like array
+ */
+function file2array($filename)
+{
+ return array(
+ 'filetoupload' => array(
+ 'name' => $filename,
+ 'tmp_name' => __DIR__ . '/input/' . $filename,
+ 'size' => filesize(__DIR__ . '/input/' . $filename)
+ )
+ );
+}
+
+
+/**
+ * Netscape bookmark import
+ */
+class BookmarkImportTest extends PHPUnit_Framework_TestCase
+{
+ /**
+ * @var string datastore to test write operations
+ */
+ protected static $testDatastore = 'sandbox/datastore.php';
+
+ /**
+ * @var LinkDB private LinkDB instance
+ */
+ protected $linkDb = null;
+
+ /**
+ * @var string Dummy page cache
+ */
+ protected $pagecache = 'tests';
+
+ /**
+ * Resets test data before each test
+ */
+ protected function setUp()
+ {
+ if (file_exists(self::$testDatastore)) {
+ unlink(self::$testDatastore);
+ }
+ // start with an empty datastore
+ file_put_contents(self::$testDatastore, '<?php /* S7QysKquBQA= */ ?>');
+ $this->linkDb = new LinkDB(self::$testDatastore, true, false);
+ }
+
+ /**
+ * Attempt to import bookmarks from an empty file
+ */
+ public function testImportEmptyData()
+ {
+ $files = file2array('empty.htm');
+ $this->assertEquals(
+ 'File empty.htm (0 bytes) has an unknown file format.'
+ .' Nothing was imported.',
+ NetscapeBookmarkUtils::import(NULL, $files, NULL, NULL)
+ );
+ $this->assertEquals(0, count($this->linkDb));
+ }
+
+ /**
+ * Attempt to import bookmarks from a file with no Doctype
+ */
+ public function testImportNoDoctype()
+ {
+ $files = file2array('no_doctype.htm');
+ $this->assertEquals(
+ 'File no_doctype.htm (350 bytes) has an unknown file format. Nothing was imported.',
+ NetscapeBookmarkUtils::import(NULL, $files, NULL, NULL)
+ );
+ $this->assertEquals(0, count($this->linkDb));
+ }
+
+ /**
+ * Ensure IE dumps are supported
+ */
+ public function testImportInternetExplorerEncoding()
+ {
+ $files = file2array('internet_explorer_encoding.htm');
+ $this->assertEquals(
+ 'File internet_explorer_encoding.htm (356 bytes) was successfully processed:'
+ .' 1 links imported, 0 links overwritten, 0 links skipped.',
+ NetscapeBookmarkUtils::import(array(), $files, $this->linkDb, $this->pagecache)
+ );
+ $this->assertEquals(1, count($this->linkDb));
+ $this->assertEquals(0, count_private($this->linkDb));
+
+ $this->assertEquals(
+ array(
+ 'linkdate' => '20160618_173944',
+ 'title' => 'Hg Init a Mercurial tutorial by Joel Spolsky',
+ 'url' => 'http://hginit.com/',
+ 'description' => '',
+ 'private' => 0,
+ 'tags' => ''
+ ),
+ $this->linkDb->getLinkFromUrl('http://hginit.com/')
+ );
+ }
+
+
+ /**
+ * Import bookmarks nested in a folder hierarchy
+ */
+ public function testImportNested()
+ {
+ $files = file2array('netscape_nested.htm');
+ $this->assertEquals(
+ 'File netscape_nested.htm (1337 bytes) was successfully processed:'
+ .' 8 links imported, 0 links overwritten, 0 links skipped.',
+ NetscapeBookmarkUtils::import(array(), $files, $this->linkDb, $this->pagecache)
+ );
+ $this->assertEquals(8, count($this->linkDb));
+ $this->assertEquals(2, count_private($this->linkDb));
+
+ $this->assertEquals(
+ array(
+ 'linkdate' => '20160225_205541',
+ 'title' => 'Nested 1',
+ 'url' => 'http://nest.ed/1',
+ 'description' => '',
+ 'private' => 0,
+ 'tags' => 'tag1 tag2'
+ ),
+ $this->linkDb->getLinkFromUrl('http://nest.ed/1')
+ );
+ $this->assertEquals(
+ array(
+ 'linkdate' => '20160225_205542',
+ 'title' => 'Nested 1-1',
+ 'url' => 'http://nest.ed/1-1',
+ 'description' => '',
+ 'private' => 0,
+ 'tags' => 'folder1 tag1 tag2'
+ ),
+ $this->linkDb->getLinkFromUrl('http://nest.ed/1-1')
+ );
+ $this->assertEquals(
+ array(
+ 'linkdate' => '20160225_205547',
+ 'title' => 'Nested 1-2',
+ 'url' => 'http://nest.ed/1-2',
+ 'description' => '',
+ 'private' => 0,
+ 'tags' => 'folder1 tag3 tag4'
+ ),
+ $this->linkDb->getLinkFromUrl('http://nest.ed/1-2')
+ );
+ $this->assertEquals(
+ array(
+ 'linkdate' => '20160202_172222',
+ 'title' => 'Nested 2-1',
+ 'url' => 'http://nest.ed/2-1',
+ 'description' => 'First link of the second section',
+ 'private' => 1,
+ 'tags' => 'folder2'
+ ),
+ $this->linkDb->getLinkFromUrl('http://nest.ed/2-1')
+ );
+ $this->assertEquals(
+ array(
+ 'linkdate' => '20160119_200227',
+ 'title' => 'Nested 2-2',
+ 'url' => 'http://nest.ed/2-2',
+ 'description' => 'Second link of the second section',
+ 'private' => 1,
+ 'tags' => 'folder2'
+ ),
+ $this->linkDb->getLinkFromUrl('http://nest.ed/2-2')
+ );
+ $this->assertEquals(
+ array(
+ 'linkdate' => '20160202_172223',
+ 'title' => 'Nested 3-1',
+ 'url' => 'http://nest.ed/3-1',
+ 'description' => '',
+ 'private' => 0,
+ 'tags' => 'folder3 folder3-1 tag3'
+ ),
+ $this->linkDb->getLinkFromUrl('http://nest.ed/3-1')
+ );
+ $this->assertEquals(
+ array(
+ 'linkdate' => '20160119_200228',
+ 'title' => 'Nested 3-2',
+ 'url' => 'http://nest.ed/3-2',
+ 'description' => '',
+ 'private' => 0,
+ 'tags' => 'folder3 folder3-1'
+ ),
+ $this->linkDb->getLinkFromUrl('http://nest.ed/3-2')
+ );
+ $this->assertEquals(
+ array(
+ 'linkdate' => '20160229_081541',
+ 'title' => 'Nested 2',
+ 'url' => 'http://nest.ed/2',
+ 'description' => '',
+ 'private' => 0,
+ 'tags' => 'tag4'
+ ),
+ $this->linkDb->getLinkFromUrl('http://nest.ed/2')
+ );
+ }
+
+ /**
+ * Import bookmarks with the default privacy setting (reuse from file)
+ *
+ * The $_POST array is not set.
+ */
+ public function testImportDefaultPrivacyNoPost()
+ {
+ $files = file2array('netscape_basic.htm');
+ $this->assertEquals(
+ 'File netscape_basic.htm (482 bytes) was successfully processed:'
+ .' 2 links imported, 0 links overwritten, 0 links skipped.',
+ NetscapeBookmarkUtils::import(array(), $files, $this->linkDb, $this->pagecache)
+ );
+ $this->assertEquals(2, count($this->linkDb));
+ $this->assertEquals(1, count_private($this->linkDb));
+
+ $this->assertEquals(
+ array(
+ 'linkdate' => '20001010_105536',
+ 'title' => 'Secret stuff',
+ 'url' => 'https://private.tld',
+ 'description' => "Super-secret stuff you're not supposed to know about",
+ 'private' => 1,
+ 'tags' => 'private secret'
+ ),
+ $this->linkDb->getLinkFromUrl('https://private.tld')
+ );
+ $this->assertEquals(
+ array(
+ 'linkdate' => '20160225_205548',
+ 'title' => 'Public stuff',
+ 'url' => 'http://public.tld',
+ 'description' => '',
+ 'private' => 0,
+ 'tags' => 'public hello world'
+ ),
+ $this->linkDb->getLinkFromUrl('http://public.tld')
+ );
+ }
+
+ /**
+ * Import bookmarks with the default privacy setting (reuse from file)
+ */
+ public function testImportKeepPrivacy()
+ {
+ $post = array('privacy' => 'default');
+ $files = file2array('netscape_basic.htm');
+ $this->assertEquals(
+ 'File netscape_basic.htm (482 bytes) was successfully processed:'
+ .' 2 links imported, 0 links overwritten, 0 links skipped.',
+ NetscapeBookmarkUtils::import($post, $files, $this->linkDb, $this->pagecache)
+ );
+ $this->assertEquals(2, count($this->linkDb));
+ $this->assertEquals(1, count_private($this->linkDb));
+
+ $this->assertEquals(
+ array(
+ 'linkdate' => '20001010_105536',
+ 'title' => 'Secret stuff',
+ 'url' => 'https://private.tld',
+ 'description' => "Super-secret stuff you're not supposed to know about",
+ 'private' => 1,
+ 'tags' => 'private secret'
+ ),
+ $this->linkDb->getLinkFromUrl('https://private.tld')
+ );
+ $this->assertEquals(
+ array(
+ 'linkdate' => '20160225_205548',
+ 'title' => 'Public stuff',
+ 'url' => 'http://public.tld',
+ 'description' => '',
+ 'private' => 0,
+ 'tags' => 'public hello world'
+ ),
+ $this->linkDb->getLinkFromUrl('http://public.tld')
+ );
+ }
+
+ /**
+ * Import links as public
+ */
+ public function testImportAsPublic()
+ {
+ $post = array('privacy' => 'public');
+ $files = file2array('netscape_basic.htm');
+ $this->assertEquals(
+ 'File netscape_basic.htm (482 bytes) was successfully processed:'
+ .' 2 links imported, 0 links overwritten, 0 links skipped.',
+ NetscapeBookmarkUtils::import($post, $files, $this->linkDb, $this->pagecache)
+ );
+ $this->assertEquals(2, count($this->linkDb));
+ $this->assertEquals(0, count_private($this->linkDb));
+ $this->assertEquals(
+ 0,
+ $this->linkDb['20001010_105536']['private']
+ );
+ $this->assertEquals(
+ 0,
+ $this->linkDb['20160225_205548']['private']
+ );
+ }
+
+ /**
+ * Import links as private
+ */
+ public function testImportAsPrivate()
+ {
+ $post = array('privacy' => 'private');
+ $files = file2array('netscape_basic.htm');
+ $this->assertEquals(
+ 'File netscape_basic.htm (482 bytes) was successfully processed:'
+ .' 2 links imported, 0 links overwritten, 0 links skipped.',
+ NetscapeBookmarkUtils::import($post, $files, $this->linkDb, $this->pagecache)
+ );
+ $this->assertEquals(2, count($this->linkDb));
+ $this->assertEquals(2, count_private($this->linkDb));
+ $this->assertEquals(
+ 1,
+ $this->linkDb['20001010_105536']['private']
+ );
+ $this->assertEquals(
+ 1,
+ $this->linkDb['20160225_205548']['private']
+ );
+ }
+
+ /**
+ * Overwrite private links so they become public
+ */
+ public function testOverwriteAsPublic()
+ {
+ $files = file2array('netscape_basic.htm');
+
+ // import links as private
+ $post = array('privacy' => 'private');
+ $this->assertEquals(
+ 'File netscape_basic.htm (482 bytes) was successfully processed:'
+ .' 2 links imported, 0 links overwritten, 0 links skipped.',
+ NetscapeBookmarkUtils::import($post, $files, $this->linkDb, $this->pagecache)
+ );
+ $this->assertEquals(2, count($this->linkDb));
+ $this->assertEquals(2, count_private($this->linkDb));
+ $this->assertEquals(
+ 1,
+ $this->linkDb['20001010_105536']['private']
+ );
+ $this->assertEquals(
+ 1,
+ $this->linkDb['20160225_205548']['private']
+ );
+
+ // re-import as public, enable overwriting
+ $post = array(
+ 'privacy' => 'public',
+ 'overwrite' => 'true'
+ );
+ $this->assertEquals(
+ 'File netscape_basic.htm (482 bytes) was successfully processed:'
+ .' 2 links imported, 2 links overwritten, 0 links skipped.',
+ NetscapeBookmarkUtils::import($post, $files, $this->linkDb, $this->pagecache)
+ );
+ $this->assertEquals(2, count($this->linkDb));
+ $this->assertEquals(0, count_private($this->linkDb));
+ $this->assertEquals(
+ 0,
+ $this->linkDb['20001010_105536']['private']
+ );
+ $this->assertEquals(
+ 0,
+ $this->linkDb['20160225_205548']['private']
+ );
+ }
+
+ /**
+ * Overwrite public links so they become private
+ */
+ public function testOverwriteAsPrivate()
+ {
+ $files = file2array('netscape_basic.htm');
+
+ // import links as public
+ $post = array('privacy' => 'public');
+ $this->assertEquals(
+ 'File netscape_basic.htm (482 bytes) was successfully processed:'
+ .' 2 links imported, 0 links overwritten, 0 links skipped.',
+ NetscapeBookmarkUtils::import($post, $files, $this->linkDb, $this->pagecache)
+ );
+ $this->assertEquals(2, count($this->linkDb));
+ $this->assertEquals(0, count_private($this->linkDb));
+ $this->assertEquals(
+ 0,
+ $this->linkDb['20001010_105536']['private']
+ );
+ $this->assertEquals(
+ 0,
+ $this->linkDb['20160225_205548']['private']
+ );
+
+ // re-import as private, enable overwriting
+ $post = array(
+ 'privacy' => 'private',
+ 'overwrite' => 'true'
+ );
+ $this->assertEquals(
+ 'File netscape_basic.htm (482 bytes) was successfully processed:'
+ .' 2 links imported, 2 links overwritten, 0 links skipped.',
+ NetscapeBookmarkUtils::import($post, $files, $this->linkDb, $this->pagecache)
+ );
+ $this->assertEquals(2, count($this->linkDb));
+ $this->assertEquals(2, count_private($this->linkDb));
+ $this->assertEquals(
+ 1,
+ $this->linkDb['20001010_105536']['private']
+ );
+ $this->assertEquals(
+ 1,
+ $this->linkDb['20160225_205548']['private']
+ );
+ }
+
+ /**
+ * Attept to import the same links twice without enabling overwriting
+ */
+ public function testSkipOverwrite()
+ {
+ $post = array('privacy' => 'public');
+ $files = file2array('netscape_basic.htm');
+ $this->assertEquals(
+ 'File netscape_basic.htm (482 bytes) was successfully processed:'
+ .' 2 links imported, 0 links overwritten, 0 links skipped.',
+ NetscapeBookmarkUtils::import($post, $files, $this->linkDb, $this->pagecache)
+ );
+ $this->assertEquals(2, count($this->linkDb));
+ $this->assertEquals(0, count_private($this->linkDb));
+
+ // re-import as private, DO NOT enable overwriting
+ $post = array('privacy' => 'private');
+ $this->assertEquals(
+ 'File netscape_basic.htm (482 bytes) was successfully processed:'
+ .' 0 links imported, 0 links overwritten, 2 links skipped.',
+ NetscapeBookmarkUtils::import($post, $files, $this->linkDb, $this->pagecache)
+ );
+ $this->assertEquals(2, count($this->linkDb));
+ $this->assertEquals(0, count_private($this->linkDb));
+ }
+
+ /**
+ * Add user-specified tags to all imported bookmarks
+ */
+ public function testSetDefaultTags()
+ {
+ $post = array(
+ 'privacy' => 'public',
+ 'default_tags' => 'tag1,tag2 tag3'
+ );
+ $files = file2array('netscape_basic.htm');
+ $this->assertEquals(
+ 'File netscape_basic.htm (482 bytes) was successfully processed:'
+ .' 2 links imported, 0 links overwritten, 0 links skipped.',
+ NetscapeBookmarkUtils::import($post, $files, $this->linkDb, $this->pagecache)
+ );
+ $this->assertEquals(2, count($this->linkDb));
+ $this->assertEquals(0, count_private($this->linkDb));
+ $this->assertEquals(
+ 'tag1 tag2 tag3 private secret',
+ $this->linkDb['20001010_105536']['tags']
+ );
+ $this->assertEquals(
+ 'tag1 tag2 tag3 public hello world',
+ $this->linkDb['20160225_205548']['tags']
+ );
+ }
+
+ /**
+ * The user-specified tags contain characters to be escaped
+ */
+ public function testSanitizeDefaultTags()
+ {
+ $post = array(
+ 'privacy' => 'public',
+ 'default_tags' => 'tag1&,tag2 "tag3"'
+ );
+ $files = file2array('netscape_basic.htm');
+ $this->assertEquals(
+ 'File netscape_basic.htm (482 bytes) was successfully processed:'
+ .' 2 links imported, 0 links overwritten, 0 links skipped.',
+ NetscapeBookmarkUtils::import($post, $files, $this->linkDb, $this->pagecache)
+ );
+ $this->assertEquals(2, count($this->linkDb));
+ $this->assertEquals(0, count_private($this->linkDb));
+ $this->assertEquals(
+ 'tag1& tag2 "tag3" private secret',
+ $this->linkDb['20001010_105536']['tags']
+ );
+ $this->assertEquals(
+ 'tag1& tag2 "tag3" public hello world',
+ $this->linkDb['20160225_205548']['tags']
+ );
+ }
+
+ /**
+ * Ensure each imported bookmark has a unique linkdate
+ *
+ * See https://github.com/shaarli/Shaarli/issues/351
+ */
+ public function testImportSameDate()
+ {
+ $files = file2array('same_date.htm');
+ $this->assertEquals(
+ 'File same_date.htm (453 bytes) was successfully processed:'
+ .' 3 links imported, 0 links overwritten, 0 links skipped.',
+ NetscapeBookmarkUtils::import(array(), $files, $this->linkDb, $this->pagecache)
+ );
+ $this->assertEquals(3, count($this->linkDb));
+ $this->assertEquals(0, count_private($this->linkDb));
+ $this->assertEquals(
+ '20160225_205548',
+ $this->linkDb['20160225_205548']['linkdate']
+ );
+ $this->assertEquals(
+ '20160225_205549',
+ $this->linkDb['20160225_205549']['linkdate']
+ );
+ $this->assertEquals(
+ '20160225_205550',
+ $this->linkDb['20160225_205550']['linkdate']
+ );
+ }
+}
--- /dev/null
+<!DOCTYPE NETSCAPE-Bookmark-file-1>
+<!-- This is an automatically generated file.
+It will be read and overwritten.
+Do Not Edit! -->
+<TITLE>Bookmarks</TITLE>
+<H1>Bookmarks</H1>
+<DL><p>
+ <DT><A HREF="http://hginit.com/" ADD_DATE="1466271584" LAST_VISIT="1466271584" LAST_MODIFIED="1466271584" >Hg Init a Mercurial tutorial by Joel Spolsky</A>
+</DL><p>
--- /dev/null
+<!DOCTYPE NETSCAPE-Bookmark-file-1>
+<!-- This is an automatically generated file.
+It will be read and overwritten.
+Do Not Edit! -->
+<TITLE>Bookmarks</TITLE>
+<H1>Bookmarks</H1>
+<DL><p>
+<DT><A HREF="https://private.tld" ADD_DATE="10/Oct/2000:13:55:36 +0300" PRIVATE="1" TAGS="private secret">Secret stuff</A>
+<DD>Super-secret stuff you're not supposed to know about
+<DT><A HREF="http://public.tld" ADD_DATE="1456433748" PRIVATE="0" TAGS="public hello world">Public stuff</A>
+</DL><p>
--- /dev/null
+<!DOCTYPE NETSCAPE-Bookmark-file-1>
+<!-- This is an automatically generated file.
+It will be read and overwritten.
+Do Not Edit! -->
+<TITLE>Bookmarks</TITLE>
+<H1>Bookmarks</H1>
+<DL><p>
+ <DT><A HREF="http://nest.ed/1" ADD_DATE="1456433741" PRIVATE="0" TAGS="tag1,tag2">Nested 1</A>
+ <DT><H3 ADD_DATE="1456433722" LAST_MODIFIED="1456433739">Folder1</H3>
+ <DL><p>
+ <DT><A HREF="http://nest.ed/1-1" ADD_DATE="1456433742" PRIVATE="0" TAGS="tag1,tag2">Nested 1-1</A>
+ <DT><A HREF="http://nest.ed/1-2" ADD_DATE="1456433747" PRIVATE="0" TAGS="tag3,tag4">Nested 1-2</A>
+ </DL><p>
+ <DT><H3 ADD_DATE="1456433722">Folder2</H3>
+ <DD>This second folder contains wonderful links!
+ <DL><p>
+ <DT><A HREF="http://nest.ed/2-1" ADD_DATE="1454433742" PRIVATE="1">Nested 2-1</A>
+ <DD>First link of the second section
+ <DT><A HREF="http://nest.ed/2-2" ADD_DATE="1453233747" PRIVATE="1">Nested 2-2</A>
+ <DD>Second link of the second section
+ </DL><p>
+ <DT><H3>Folder3</H3>
+ <DL><p>
+ <DT><H3>Folder3-1</H3>
+ <DL><p>
+ <DT><A HREF="http://nest.ed/3-1" ADD_DATE="1454433742" PRIVATE="0" TAGS="tag3">Nested 3-1</A>
+ <DT><A HREF="http://nest.ed/3-2" ADD_DATE="1453233747" PRIVATE="0">Nested 3-2</A>
+ </DL><p>
+ </DL><p>
+ <DT><A HREF="http://nest.ed/2" ADD_DATE="1456733741" PRIVATE="0" TAGS="tag4">Nested 2</A>
+</DL><p>
--- /dev/null
+<TITLE>Bookmarks</TITLE>
+<H1>Bookmarks</H1>
+<DL><p>
+<DT><A HREF="https://private.tld" ADD_DATE="10/Oct/2000:13:55:36 +0300" PRIVATE="1" TAGS="private secret">Secret stuff</A>
+<DD>Super-secret stuff you're not supposed to know about
+<DT><A HREF="http://public.tld" ADD_DATE="1456433748" PRIVATE="0" TAGS="public hello world">Public stuff</A>
+</DL><p>
--- /dev/null
+<!DOCTYPE NETSCAPE-Bookmark-file-1>
+<!-- This is an automatically generated file.
+It will be read and overwritten.
+Do Not Edit! -->
+<TITLE>Bookmarks</TITLE>
+<H1>Bookmarks</H1>
+<DL><p>
+<DT><A HREF="https://fir.st" ADD_DATE="1456433748" PRIVATE="0">Today's first link</A>
+<DT><A HREF="https://seco.nd" ADD_DATE="1456433748" PRIVATE="0">Today's second link</A>
+<DT><A HREF="https://thi.rd" ADD_DATE="1456433748" PRIVATE="0">Today's third link</A>
+</DL><p>
$this->pluginManager->load(array(self::$pluginName));
$expectedParameters = array(
- 'pop' => '',
- 'hip' => '',
+ 'pop' => array(
+ 'value' => '',
+ 'desc' => 'pop description',
+ ),
+ 'hip' => array(
+ 'value' => '',
+ 'desc' => '',
+ ),
);
$meta = $this->pluginManager->getPluginsMeta();
$this->assertEquals('test plugin', $meta[self::$pluginName]['description']);
$this->assertEquals($expectedParameters, $meta[self::$pluginName]['parameters']);
}
-}
\ No newline at end of file
+}
$plugins = array(
'plugin_name' => array(
'parameters' => array(
- 'param1' => true,
- 'param2' => false,
- 'param3' => '',
+ 'param1' => array('value' => true),
+ 'param2' => array('value' => false),
+ 'param3' => array('value' => ''),
)
)
);
);
$result = load_plugin_parameter_values($plugins, $parameters);
- $this->assertEquals('value1', $result['plugin_name']['parameters']['param1']);
- $this->assertEquals('value2', $result['plugin_name']['parameters']['param2']);
- $this->assertEquals('', $result['plugin_name']['parameters']['param3']);
+ $this->assertEquals('value1', $result['plugin_name']['parameters']['param1']['value']);
+ $this->assertEquals('value2', $result['plugin_name']['parameters']['param2']['value']);
+ $this->assertEquals('', $result['plugin_name']['parameters']['param3']['value']);
}
}
description="test plugin"
-parameters="pop;hip"
\ No newline at end of file
+parameters="pop;hip"
+parameter.pop="pop description"
+parameter.hip=
\ No newline at end of file
{
bad: bad,
}
-*/ ?>
\ No newline at end of file
+*/ ?>
<head>{include="includes"}</head>
<body onload="document.uploadform.filetoupload.focus();">
<div id="pageheader">
- {include="page.header"}
- <div id="uploaddiv">
- Import Netscape HTML bookmarks (as exported from Firefox/Chrome/Opera/Delicious/Diigo...) (Max: {$maxfilesize} bytes).
- <form method="POST" action="?do=upload" enctype="multipart/form-data" name="uploadform" id="uploadform">
- <input type="hidden" name="token" value="{$token}">
- <input type="file" name="filetoupload">
- <input type="hidden" name="MAX_FILE_SIZE" value="{$maxfilesize}">
- <input type="submit" name="import_file" value="Import" class="bigbutton"><br>
- <input type="checkbox" name="private" id="private"><label for="private"> Import all links as private</label><br>
- <input type="checkbox" name="overwrite" id="overwrite"><label for="overwrite"> Overwrite existing links</label>
- </form>
- </div>
+ {include="page.header"}
+ <div id="uploaddiv">
+ Import Netscape HTML bookmarks (as exported from Firefox/Chrome/Opera/Delicious/Diigo...) (Max: {$maxfilesize} bytes).
+ <form method="POST" action="?do=import" enctype="multipart/form-data"
+ name="uploadform" id="uploadform">
+ <input type="hidden" name="token" value="{$token}">
+ <input type="hidden" name="MAX_FILE_SIZE" value="{$maxfilesize}">
+ <input type="file" name="filetoupload">
+ <input type="submit" name="import_file" value="Import" class="bigbutton"><br>
+
+ <label for="privacy"> Visibility:</label><br>
+ <input type="radio" name="privacy" value="default" checked="true">
+ Use values from the imported file, default to public<br>
+ <input type="radio" name="privacy" value="private">
+ Import all bookmarks as private<br>
+ <input type="radio" name="privacy" value="public">
+ Import all bookmarks as public<br>
+
+ <input type="checkbox" name="overwrite" id="overwrite">
+ <label for="overwrite"> Overwrite existing bookmarks</label><br>
+ <label for="default_tags"> Add default tags</label>
+ <input type="text" name="default_tags" id="default_tags">
+ </form>
+ </div>
</div>
{include="page.footer"}
</body>
-</html>
\ No newline at end of file
+</html>
<div class="plugin_parameter">
<div class="float_label">
<label for="{$key}">
- <code>{$key}</code>
+ <code>{$key}</code><br>
+ {$value.desc}
</label>
</div>
<div class="float_input">
- <input name="{$key}" value="{$value}" id="{$key}"/>
+ <input name="{$key}" value="{$value.value}" id="{$key}"/>
</div>
</div>
{/loop}
<br><br>
<a href="?do=pluginadmin"><b>Plugin administration</b><span>: Enable, disable and configure plugins.</span></a>
<br><br>
- {if="$openshaarli"}<a href="?do=changepasswd"><b>Change password</b><span>: Change your password.</span></a>
+ {if="!$openshaarli"}<a href="?do=changepasswd"><b>Change password</b><span>: Change your password.</span></a>
<br><br>{/if}
<a href="?do=changetag"><b>Rename/delete tags</b><span>: Rename or delete a tag in all links</span></a>
<br><br>