diff --git a/Makefile b/Makefile index d69fac46..05578525 100644 --- a/Makefile +++ b/Makefile @@ -126,8 +126,38 @@ doc: clean @git clone https://github.com/shaarli/Shaarli.wiki.git doc @rm -rf doc/.git +### Generate a custom sidebar +# +# Sidebar content: +# - convert GitHub-flavoured relative links to standard Markdown +# - trim HTML, only keep the list (
Backup the file data/datastore.php
(by FTP or SSH). Restore by putting the file back in place.
Example command:
+rsync -avzP my.server.com:/var/www/shaarli/data/datastore.php datastore-$(date +%Y-%m-%d_%H%M).php
+To export links as an HTML file, under Tools > Export, choose:
+Restore by using the Import
feature.
Example command:
+./export-bookmarks.py --url=https://my.server.com/shaarli --username=myusername --password=mysupersecretpassword --download-dir=./ --type=all
+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.)
+See this issue for import tweaks.
+To correctly import the tags from a SemanticScuttle HTML export, edit the HTML file before importing and replace all occurences of tags=
(lowercase) to TAGS=
(uppercase).
This topic is currently being discussed here:
+ + + diff --git a/doc/Coding-guidelines.md b/doc/Coding-guidelines.md new file mode 100644 index 00000000..1fb28a5b --- /dev/null +++ b/doc/Coding-guidelines.md @@ -0,0 +1,5 @@ +#Coding guidelines +## WIP +This topic is currently being discussed here: +- [Fix coding style (static analysis)](https://github.com/shaarli/Shaarli/issues/95) (#95)[](.html) +- [Continuous Integration tools & features](https://github.com/shaarli/Shaarli/issues/130) (#130)[](.html) diff --git a/doc/Community-&-Related-software.html b/doc/Community-&-Related-software.html new file mode 100644 index 00000000..5468379c --- /dev/null +++ b/doc/Community-&-Related-software.html @@ -0,0 +1,101 @@ + + + + + + +Unofficial but related work on Shaarli. If you maintain one of these, please get in touch with us to help us find a way to adapt your work to our fork.
+TODO: contact repos owners to see if they'd like to standardize their work with the community fork.
+See Theming for the list of community-contributed themes, and an installation guide.
+Example bash script:
-#!/bin/bash
-#Description: Copy a Shaarli installation over SSH/SCP, serve it locally with php-cli
-#Will create a local-shaarli/ directory when you run it, backup your Shaarli there, and serve it locally.
-#Will NOT download linked pages. It's just a directly usable backup/copy/mirror of your Shaarli
-#Requires: ssh, scp and a working SSH access to the server where your Shaarli is installed
-#Usage: ./local-shaarli.sh
-#Author: nodiscc (nodiscc@gmail.com)
-#License: MIT (http://opensource.org/licenses/MIT)
-set -o errexit
-set -o nounset
-
-##### CONFIG #################
-#The port used by php's local server
-php_local_port=7431
-
-#Name of the SSH server and path where Shaarli is installed
-#TODO: pass these as command-line arguments
-remotehost="my.ssh.server"
-remote_shaarli_dir="/var/www/shaarli"
-
-
-###### FUNCTIONS #############
-_main() {
- _CBSyncShaarli
- _CBServeShaarli
-}
-
-_CBSyncShaarli() {
- remote_temp_dir=$(ssh $remotehost mktemp -d)
- remote_ssh_user=$(ssh $remotehost whoami)
- ssh -t "$remotehost" sudo cp -r "$remote_shaarli_dir" "$remote_temp_dir"
- ssh -t "$remotehost" sudo chown -R "$remote_ssh_user":"$remote_ssh_user" "$remote_temp_dir"
- scp -rq "$remotehost":"$remote_temp_dir" local-shaarli
- ssh "$remotehost" rm -r "$remote_temp_dir"
-}
-
-_CBServeShaarli() {
- #TODO: allow serving a previously downloaded Shaarli
- #TODO: ask before overwriting local copy, if it exists
- cd local-shaarli/
- php -S localhost:${php_local_port}
- echo "Please go to http://localhost:${php_local_port}"
-}
-
-
-##### MAIN #################
-
-_main
-This outputs:
-$ ./local-shaarli.sh
-PHP 5.6.0RC4 Development Server started at Mon Sep 1 21:56:19 2014
-Listening on http://localhost:7431
-Document root is /home/user/local-shaarli/shaarli
-Press Ctrl-C to quit.
-
-[Mon Sep 1 21:56:27 2014] ::1:57868 [200]: /
-[Mon Sep 1 21:56:27 2014] ::1:57869 [200]: /index.html
-[Mon Sep 1 21:56:37 2014] ::1:57881 [200]: /...
-
-
diff --git a/doc/Copy-an-existing-installation-over-SSH-and-serve-it-locally.html b/doc/Copy-an-existing-installation-over-SSH-and-serve-it-locally.html
new file mode 100644
index 00000000..9e930e52
--- /dev/null
+++ b/doc/Copy-an-existing-installation-over-SSH-and-serve-it-locally.html
@@ -0,0 +1,137 @@
+
+
+
+
+
+
+ Example bash script:
+#!/bin/bash
+#Description: Copy a Shaarli installation over SSH/SCP, serve it locally with php-cli
+#Will create a local-shaarli/ directory when you run it, backup your Shaarli there, and serve it locally.
+#Will NOT download linked pages. It's just a directly usable backup/copy/mirror of your Shaarli
+#Requires: ssh, scp and a working SSH access to the server where your Shaarli is installed
+#Usage: ./local-shaarli.sh
+#Author: nodiscc (nodiscc@gmail.com)
+#License: MIT (http://opensource.org/licenses/MIT)
+set -o errexit
+set -o nounset
+
+##### CONFIG #################
+#The port used by php's local server
+php_local_port=7431
+
+#Name of the SSH server and path where Shaarli is installed
+#TODO: pass these as command-line arguments
+remotehost="my.ssh.server"
+remote_shaarli_dir="/var/www/shaarli"
+
+
+###### FUNCTIONS #############
+_main() {
+ _CBSyncShaarli
+ _CBServeShaarli
+}
+
+_CBSyncShaarli() {
+ remote_temp_dir=$(ssh $remotehost mktemp -d)
+ remote_ssh_user=$(ssh $remotehost whoami)
+ ssh -t "$remotehost" sudo cp -r "$remote_shaarli_dir" "$remote_temp_dir"
+ ssh -t "$remotehost" sudo chown -R "$remote_ssh_user":"$remote_ssh_user" "$remote_temp_dir"
+ scp -rq "$remotehost":"$remote_temp_dir" local-shaarli
+ ssh "$remotehost" rm -r "$remote_temp_dir"
+}
+
+_CBServeShaarli() {
+ #TODO: allow serving a previously downloaded Shaarli
+ #TODO: ask before overwriting local copy, if it exists
+ cd local-shaarli/
+ php -S localhost:${php_local_port}
+ echo "Please go to http://localhost:${php_local_port}"
+}
+
+
+##### MAIN #################
+
+_main
+This outputs:
+$ ./local-shaarli.sh
+PHP 5.6.0RC4 Development Server started at Mon Sep 1 21:56:19 2014
+Listening on http://localhost:7431
+Document root is /home/user/local-shaarli/shaarli
+Press Ctrl-C to quit.
+
+[Mon Sep 1 21:56:27 2014] ::1:57868 [200]: /[](.html)
+[Mon Sep 1 21:56:27 2014] ::1:57869 [200]: /index.html[](.html)
+[Mon Sep 1 21:56:37 2014] ::1:57881 [200]: /...[](.html)
+
+
diff --git a/doc/Copy-a-Shaarli-installation-over-SSH-SCP,-serve-it-locally-with-php-cli.md b/doc/Copy-an-existing-installation-over-SSH-and-serve-it-locally.md
similarity index 87%
rename from doc/Copy-a-Shaarli-installation-over-SSH-SCP,-serve-it-locally-with-php-cli.md
rename to doc/Copy-an-existing-installation-over-SSH-and-serve-it-locally.md
index 5b0aec6f..88d191da 100644
--- a/doc/Copy-a-Shaarli-installation-over-SSH-SCP,-serve-it-locally-with-php-cli.md
+++ b/doc/Copy-an-existing-installation-over-SSH-and-serve-it-locally.md
@@ -1,6 +1,7 @@
+#Copy an existing installation over SSH and serve it locally
Example bash script:
-```
+```bash
#!/bin/bash
#Description: Copy a Shaarli installation over SSH/SCP, serve it locally with php-cli
#Will create a local-shaarli/ directory when you run it, backup your Shaarli there, and serve it locally.
@@ -53,14 +54,14 @@ _main
This outputs:
-```
+```bash
$ ./local-shaarli.sh
PHP 5.6.0RC4 Development Server started at Mon Sep 1 21:56:19 2014
Listening on http://localhost:7431
Document root is /home/user/local-shaarli/shaarli
Press Ctrl-C to quit.
-[Mon Sep 1 21:56:27 2014] ::1:57868 [200]: /
-[Mon Sep 1 21:56:27 2014] ::1:57869 [200]: /index.html
-[Mon Sep 1 21:56:37 2014] ::1:57881 [200]: /...
-```
\ No newline at end of file
+[Mon Sep 1 21:56:27 2014] ::1:57868 [200]: /[](.html)
+[Mon Sep 1 21:56:27 2014] ::1:57869 [200]: /index.html[](.html)
+[Mon Sep 1 21:56:37 2014] ::1:57881 [200]: /...[](.html)
+```
diff --git a/doc/Datastore-hacks.html b/doc/Datastore-hacks.html
new file mode 100644
index 00000000..4677ae91
--- /dev/null
+++ b/doc/Datastore-hacks.html
@@ -0,0 +1,94 @@
+
+
+
+
+
+
+ To display the array representing the data saved in data/datastore.php
, use the following snippet:
$data = "tZNdb9MwFIb... <Commented content inside datastore.php>";
+$out = unserialize(gzinflate(base64_decode($data)));
+echo "<pre>"; // Pretty printing is love, pretty printing is life
+print_r($out);
+echo "</pre>";
+exit;
+This will output the internal representation of the datastore, "unobfuscated" (if this can really be considered obfuscation).
+<input type="hidden" name="lf_linkdate" value="{$link.linkdate}">
in tpl/editlink.tpl
(line 14)type="hidden"
from this lineYYYMMDD_HHMMS
."; // Pretty printing is love, pretty printing is life +print_r($out); +echo ""; +exit; +``` +This will output the internal representation of the datastore, "unobfuscated" (if this can really be considered obfuscation). + +### Changing the timestamp for a link +* Look for `` in `tpl/editlink.tpl` (line 14) +* Remove `type="hidden"` from this line +* A new date/time field becomes available in the edit/new link dialog. +* You can set the timestamp manually by entering it in the format `YYYMMDD_HHMMS`. diff --git a/doc/Development.html b/doc/Development.html new file mode 100644 index 00000000..1e33eff4 --- /dev/null +++ b/doc/Development.html @@ -0,0 +1,102 @@ + + + + + + +
Please have a look at the following pages:
+A Makefile
is available to perform project-related operations:
Travis CI is a Continuous Integration build server, that runs a build:
+master
branch)A build is composed of several jobs: one for each supported PHP version (see Server requirements).
+Each build job:
+After all jobs have finished, Travis returns the results to GitHub:
+master
branch: Here is the directory structure of Shaarli and the purpose of the different files:
+ index.php # Main program
+ application/ # Shaarli classes
+ ├── LinkDB.php
+ └── Utils.php
+ tests/ # Shaarli unitary & functional tests
+ ├── LinkDBTest.php
+ ├── utils # utilities to ease testing
+ │ └── ReferenceLinkDB.php
+ └── UtilsTest.php
+ COPYING # Shaarli license
+ inc/ # static assets and 3rd party libraries
+ ├── awesomplete.* # tags autocompletion library
+ ├── blazy.* # picture wall lazy image loading library
+ ├── shaarli.css, reset.css # Shaarli stylesheet.
+ ├── qr.* # qr code generation library
+ └──rain.tpl.class.php # RainTPL templating library
+ tpl/ # RainTPL templates for Shaarli. They are used to build the pages.
+ images/ # Images and icons used in Shaarli
+ data/ # data storage: bookmark database, configuration, logs, banlist…
+ ├── config.php # Shaarli configuration (login, password, timezone, title…)
+ ├── datastore.php # Your link database (compressed).
+ ├── ipban.php # IP address ban system data
+ ├── lastupdatecheck.txt # Update check timestamp file
+ └──log.txt # login/IPban log.
+ cache/ # thumbnails cache
+ # This directory is automatically created. You can erase it anytime you want.
+ tmp/ # Temporary directory for compiled RainTPL templates.
+ # This directory is automatically created. You can erase it anytime you want.
+
+
diff --git a/doc/Directory-structure.md b/doc/Directory-structure.md
new file mode 100644
index 00000000..3a1c4309
--- /dev/null
+++ b/doc/Directory-structure.md
@@ -0,0 +1,33 @@
+#Directory structure
+Here is the directory structure of Shaarli and the purpose of the different files:
+
+```bash
+ index.php # Main program
+ application/ # Shaarli classes
+ ├── LinkDB.php
+ └── Utils.php
+ tests/ # Shaarli unitary & functional tests
+ ├── LinkDBTest.php
+ ├── utils # utilities to ease testing
+ │ └── ReferenceLinkDB.php
+ └── UtilsTest.php
+ COPYING # Shaarli license
+ inc/ # static assets and 3rd party libraries
+ ├── awesomplete.* # tags autocompletion library
+ ├── blazy.* # picture wall lazy image loading library
+ ├── shaarli.css, reset.css # Shaarli stylesheet.
+ ├── qr.* # qr code generation library
+ └──rain.tpl.class.php # RainTPL templating library
+ tpl/ # RainTPL templates for Shaarli. They are used to build the pages.
+ images/ # Images and icons used in Shaarli
+ data/ # data storage: bookmark database, configuration, logs, banlist…
+ ├── config.php # Shaarli configuration (login, password, timezone, title…)
+ ├── datastore.php # Your link database (compressed).
+ ├── ipban.php # IP address ban system data
+ ├── lastupdatecheck.txt # Update check timestamp file
+ └──log.txt # login/IPban log.
+ cache/ # thumbnails cache
+ # This directory is automatically created. You can erase it anytime you want.
+ tmp/ # Temporary directory for compiled RainTPL templates.
+ # This directory is automatically created. You can erase it anytime you want.
+```
diff --git a/doc/Download-CSS-styles-for-shaarlis-listed-in-an-opml-file.html b/doc/Download-CSS-styles-for-shaarlis-listed-in-an-opml-file.html
deleted file mode 100644
index 0f32fb84..00000000
--- a/doc/Download-CSS-styles-for-shaarlis-listed-in-an-opml-file.html
+++ /dev/null
@@ -1,167 +0,0 @@
-
-
-
-
-
-
- Example php script:
-<!---- ?php -->
-<!---- Copyright (c) 2014 Nicolas Delsaux (https://github.com/Riduidel) -->
-<!---- License: zlib (http://www.gzip.org/zlib/zlib_license.html) -->
-
-/**
- * Source: https://github.com/Riduidel
- * Download css styles for shaarlis listed in an opml file
- */
-define("SHAARLI_RSS_OPML", "https://www.ecirtam.net/shaarlirss/custom/people.opml");
-
-define("THEMES_TEMP_FOLDER", "new_themes");
-
-if(!file_exists(THEMES_TEMP_FOLDER)) {
- mkdir(THEMES_TEMP_FOLDER);
-}
-
-function siteUrl($pathInSite) {
- $indexPos = strpos($pathInSite, "index.php");
- if(!$indexPos) {
- return $pathInSite;
- } else {
- return substr($pathInSite, 0, $indexPos);
- }
-}
-
-function createShaarliHashFromOPMLL($opmlFile) {
- $result = array();
- $opml = file_get_contents($opmlFile);
- $opmlXml = simplexml_load_string($opml);
- $outlineElements = $opmlXml->xpath("body/outline");
- foreach($outlineElements as $site) {
- $siteUrl = siteUrl((string) $site['htmlUrl']);
- $result[$siteUrl]=((string) $site['text']);
- }
- return $result;
-}
-
-function getSiteFolder($url) {
- $domain = parse_url($url, PHP_URL_HOST);
- return THEMES_TEMP_FOLDER."/".str_replace(".", "_", $domain);
-}
-
-function get_http_response_code($theURL) {
- $headers = get_headers($theURL);
- return substr($headers[0], 9, 3);
-}
-
-/**
- * This makes the code PHP-5 only (particularly the call to "get_headers")
- */
-function copyUserStyleFrom($url, $name, $knownStyles) {
- $userStyle = $url."inc/user.css";
- if(in_array($url, $knownStyles)) {
- // TODO add log message
- } else {
- $statusCode = get_http_response_code($userStyle);
- if(intval($statusCode)<300) {
- $styleSheet = file_get_contents($userStyle);
- $siteFolder = getSiteFolder($url);
- if(!file_exists($siteFolder)) {
- mkdir($siteFolder);
- }
- if(!file_exists($siteFolder.'/user.css')) {
- // Copy stylesheet
- file_put_contents($siteFolder.'/user.css', $styleSheet);
- }
- if(!file_exists($siteFolder.'/README.md')) {
- // Then write a readme.md file
- file_put_contents($siteFolder.'/README.md',
- "User style from ".$name."\n"
- ."============================="
- ."\n\n"
- ."This stylesheet was downloaded from ".$userStyle." on ".date(DATE_RFC822)
- );
- }
- if(!file_exists($siteFolder.'/config.ini')) {
- // Write a config file containing useful informations
- file_put_contents($siteFolder.'/config.ini',
- "site_url=".$url."\n"
- ."site_name=".$name."\n"
- );
- }
- if(!file_exists($siteFolder.'/home.png')) {
- // And finally copy generated thumbnail
- $homeThumb = $siteFolder.'/home.png';
- file_put_contents($siteFolder.'/home.png', file_get_contents(getThumbnailUrl($url)));
- }
- echo 'Theme have been downloaded from <a href="'.$url.'">'.$url.'</a> into '.$siteFolder
- .'. It looks like <img src="'.$homeThumb.'"><br/>';
- }
- }
-}
-
-function getThumbnailUrl($url) {
- return 'http://api.webthumbnail.org/?url='.$url;
-}
-
-function copyUserStylesFrom($urlToNames, $knownStyles) {
- foreach($urlToNames as $url => $name) {
- copyUserStyleFrom($url, $name, $knownStyles);
- }
-}
-
-/**
- * Reading directory list, courtesy of http://www.laughing-buddha.net/php/dirlist/
- * @param directory the directory we want to list files of
- * @return a simple array containing the list of absolute file paths. Notice that current file (".") and parent one("..")
- * are not listed here
- */
-function getDirectoryList ($directory) {
- $realPath = realpath($directory);
- // create an array to hold directory list
- $results = array();
- // create a handler for the directory
- $handler = opendir($directory);
- // open directory and walk through the filenames
- while ($file = readdir($handler)) {
- // if file isn't this directory or its parent, add it to the results
- if ($file != "." && $file != "..") {
- $results[] = realpath($realPath . "/" . $file);
- }
- }
- // tidy up: close the handler
- closedir($handler);
- // done!
- return $results;
-}
-
-/**
- * Start in themes folder and look in all subfolders for config.ini files.
- * These config.ini files allow us not to download styles again and again
- */
-function findKnownStyles() {
- $result = array();
- $subFolders = getDirectoryList("themes");
- foreach($subFolders as $folder) {
- $configFile = $folder."/config.ini";
- if(file_exists($configFile)) {
- $iniParameters = parse_ini_file($configFile);
- array_push($result, $iniParameters['site_url']);
- }
- }
- return $result;
-}
-
-$knownStyles = findKnownStyles();
-copyUserStylesFrom(createShaarliHashFromOPMLL(SHAARLI_RSS_OPML), $knownStyles);
-
-<!--- ? ---->
-
-
diff --git a/doc/Download-CSS-styles-from-an-OPML-list.html b/doc/Download-CSS-styles-from-an-OPML-list.html
new file mode 100644
index 00000000..b21a54bd
--- /dev/null
+++ b/doc/Download-CSS-styles-from-an-OPML-list.html
@@ -0,0 +1,229 @@
+
+
+
+
+
+
+ Example php script:
+<!---- ?php -->
+<!---- Copyright (c) 2014 Nicolas Delsaux (https://github.com/Riduidel) -->
+<!---- License: zlib (http://www.gzip.org/zlib/zlib_license.html) -->
+
+/**
+ * Source: https://github.com/Riduidel
+ * Download css styles for shaarlis listed in an opml file
+ */
+define("SHAARLI_RSS_OPML", "https://www.ecirtam.net/shaarlirss/custom/people.opml");
+
+define("THEMES_TEMP_FOLDER", "new_themes");
+
+if(!file_exists(THEMES_TEMP_FOLDER)) {
+ mkdir(THEMES_TEMP_FOLDER);
+}
+
+function siteUrl($pathInSite) {
+ $indexPos = strpos($pathInSite, "index.php");
+ if(!$indexPos) {
+ return $pathInSite;
+ } else {
+ return substr($pathInSite, 0, $indexPos);
+ }
+}
+
+function createShaarliHashFromOPMLL($opmlFile) {
+ $result = array();
+ $opml = file_get_contents($opmlFile);
+ $opmlXml = simplexml_load_string($opml);
+ $outlineElements = $opmlXml->xpath("body/outline");
+ foreach($outlineElements as $site) {
+ $siteUrl = siteUrl((string) $site['htmlUrl']);[](.html)
+ $result[$siteUrl]=((string) $site['text']);[](.html)
+ }
+ return $result;
+}
+
+function getSiteFolder($url) {
+ $domain = parse_url($url, PHP_URL_HOST);
+ return THEMES_TEMP_FOLDER."/".str_replace(".", "_", $domain);
+}
+
+function get_http_response_code($theURL) {
+ $headers = get_headers($theURL);
+ return substr($headers[0], 9, 3);[](.html)
+}
+
+/**
+ * This makes the code PHP-5 only (particularly the call to "get_headers")
+ */
+function copyUserStyleFrom($url, $name, $knownStyles) {
+ $userStyle = $url."inc/user.css";
+ if(in_array($url, $knownStyles)) {
+ // TODO add log message
+ } else {
+ $statusCode = get_http_response_code($userStyle);
+ if(intval($statusCode)<300) {
+ $styleSheet = file_get_contents($userStyle);
+ $siteFolder = getSiteFolder($url);
+ if(!file_exists($siteFolder)) {
+ mkdir($siteFolder);
+ }
+ if(!file_exists($siteFolder.'/user.css')) {
+ // Copy stylesheet
+ file_put_contents($siteFolder.'/user.css', $styleSheet);
+ }
+ if(!file_exists($siteFolder.'/README.md')) {
+ // Then write a readme.md file
+ file_put_contents($siteFolder.'/README.md',
+ "User style from ".$name."\n"
+ ."============================="
+ ."\n\n"
+ ."This stylesheet was downloaded from ".$userStyle." on ".date(DATE_RFC822)
+ );
+ }
+ if(!file_exists($siteFolder.'/config.ini')) {
+ // Write a config file containing useful informations
+ file_put_contents($siteFolder.'/config.ini',
+ "site_url=".$url."\n"
+ ."site_name=".$name."\n"
+ );
+ }
+ if(!file_exists($siteFolder.'/home.png')) {
+ // And finally copy generated thumbnail
+ $homeThumb = $siteFolder.'/home.png';
+ file_put_contents($siteFolder.'/home.png', file_get_contents(getThumbnailUrl($url)));
+ }
+ echo 'Theme have been downloaded from <a href="'.$url.'">'.$url.'</a> into '.$siteFolder
+ .'. It looks like <img src="'.$homeThumb.'"><br/>';
+ }
+ }
+}
+
+function getThumbnailUrl($url) {
+ return 'http://api.webthumbnail.org/?url='.$url;
+}
+
+function copyUserStylesFrom($urlToNames, $knownStyles) {
+ foreach($urlToNames as $url => $name) {
+ copyUserStyleFrom($url, $name, $knownStyles);
+ }
+}
+
+/**
+ * Reading directory list, courtesy of http://www.laughing-buddha.net/php/dirlist/
+ * @param directory the directory we want to list files of
+ * @return a simple array containing the list of absolute file paths. Notice that current file (".") and parent one("..")
+ * are not listed here
+ */
+function getDirectoryList ($directory) {
+ $realPath = realpath($directory);
+ // create an array to hold directory list
+ $results = array();
+ // create a handler for the directory
+ $handler = opendir($directory);
+ // open directory and walk through the filenames
+ while ($file = readdir($handler)) {
+ // if file isn't this directory or its parent, add it to the results
+ if ($file != "." && $file != "..") {
+ $results[ = realpath($realPath . "/" . $file);](-=-realpath($realPath-.-"/"-.-$file);.html)
+ }
+ }
+ // tidy up: close the handler
+ closedir($handler);
+ // done!
+ return $results;
+}
+
+/**
+ * Start in themes folder and look in all subfolders for config.ini files.
+ * These config.ini files allow us not to download styles again and again
+ */
+function findKnownStyles() {
+ $result = array();
+ $subFolders = getDirectoryList("themes");
+ foreach($subFolders as $folder) {
+ $configFile = $folder."/config.ini";
+ if(file_exists($configFile)) {
+ $iniParameters = parse_ini_file($configFile);
+ array_push($result, $iniParameters['site_url']);[](.html)
+ }
+ }
+ return $result;
+}
+
+$knownStyles = findKnownStyles();
+copyUserStylesFrom(createShaarliHashFromOPMLL(SHAARLI_RSS_OPML), $knownStyles);
+
+<!--- ? ---->
+
+
diff --git a/doc/Download-CSS-styles-for-shaarlis-listed-in-an-opml-file.md b/doc/Download-CSS-styles-from-an-OPML-list.md
similarity index 92%
rename from doc/Download-CSS-styles-for-shaarlis-listed-in-an-opml-file.md
rename to doc/Download-CSS-styles-from-an-OPML-list.md
index 8645b10d..eb66f955 100644
--- a/doc/Download-CSS-styles-for-shaarlis-listed-in-an-opml-file.md
+++ b/doc/Download-CSS-styles-from-an-OPML-list.md
@@ -1,7 +1,8 @@
+#Download CSS styles from an OPML list
###Download CSS styles for shaarlis listed in an opml file
Example php script:
-```
+```php
@@ -33,8 +34,8 @@ function createShaarliHashFromOPMLL($opmlFile) {
$opmlXml = simplexml_load_string($opml);
$outlineElements = $opmlXml->xpath("body/outline");
foreach($outlineElements as $site) {
- $siteUrl = siteUrl((string) $site['htmlUrl']);
- $result[$siteUrl]=((string) $site['text']);
+ $siteUrl = siteUrl((string) $site['htmlUrl']);[](.html)
+ $result[$siteUrl]=((string) $site['text']);[](.html)
}
return $result;
}
@@ -46,7 +47,7 @@ function getSiteFolder($url) {
function get_http_response_code($theURL) {
$headers = get_headers($theURL);
- return substr($headers[0], 9, 3);
+ return substr($headers[0], 9, 3);[](.html)
}
/**
@@ -121,7 +122,7 @@ function getDirectoryList ($directory) {
while ($file = readdir($handler)) {
// if file isn't this directory or its parent, add it to the results
if ($file != "." && $file != "..") {
- $results[] = realpath($realPath . "/" . $file);
+ $results[ = realpath($realPath . "/" . $file);](-=-realpath($realPath-.-"/"-.-$file);.html)
}
}
// tidy up: close the handler
@@ -141,7 +142,7 @@ function findKnownStyles() {
$configFile = $folder."/config.ini";
if(file_exists($configFile)) {
$iniParameters = parse_ini_file($configFile);
- array_push($result, $iniParameters['site_url']);
+ array_push($result, $iniParameters['site_url']);[](.html)
}
}
return $result;
diff --git a/doc/Example-patch---add-new-via-field-for-links.html b/doc/Example-patch---add-new-via-field-for-links.html
index 7df9d253..44352d3e 100644
--- a/doc/Example-patch---add-new-via-field-for-links.html
+++ b/doc/Example-patch---add-new-via-field-for-links.html
@@ -4,7 +4,7 @@
- I was a StumbleUpon user. Then I got fed up with they big toolbar. I switched to delicious, which was lighter, faster and more beautiful. Until Yahoo bought it. Then the export API broke all the time, delicious became slow and was ditched by Yahoo. I switched to Diigo, which is not bad, but does too much. And Diigo is sslllooooowww and their Firefox extension a bit buggy. And… oh… their Firefox addon sends to Diigo every single URL you visit (Don't believe me ? Use Tamper Data and open any page).
+Enough is enough. Saving simple links should not be a complicated heavy thing. I ditched them all and wrote my own: Shaarli. It's simple, but it does the job and does it well. And my data is not hosted on a foreign server, but on my server.
+With Shaarli:
+Shaarli is for shaaring your links.
+First of all, ensure that both the web server and Shaarli are correctly configured, and that your installation is supported.
+If everything looks right but the issue(s) remain(s), please:
+Does browsing this page feel slow? Try browsing older pages, too.
+It's not slow at all, is it? And don't forget the database contains more than 16000 links, and it's on a shared host, with 32000 visitors/day for my website alone. And it's still damn fast. Why?
+The data file is only 3.7 Mb. It's read 99% of the time, and is probably already in the operation system disk cache. So generating a page involves no I/O at all most of the time.
+ + diff --git a/doc/FAQ.md b/doc/FAQ.md new file mode 100644 index 00000000..4c69763f --- /dev/null +++ b/doc/FAQ.md @@ -0,0 +1,44 @@ +#FAQ +### Why did you create Shaarli ? + +I was a StumbleUpon user. Then I got fed up with they big toolbar. I switched to delicious, which was lighter, faster and more beautiful. Until Yahoo bought it. Then the export API broke all the time, delicious became slow and was ditched by Yahoo. I switched to Diigo, which is not bad, but does too much. And Diigo is sslllooooowww and their Firefox extension a bit buggy. And… oh… **their Firefox addon sends to Diigo every single URL you visit** (Don't believe me ? Use [Tamper Data](https://addons.mozilla.org/en-US/firefox/addon/tamper-data/) and open any page).[](.html) + +Enough is enough. Saving simple links should not be a complicated heavy thing. I ditched them all and wrote my own: Shaarli. It's simple, but it does the job and does it well. And my data is not hosted on a foreign server, but on my server. + +### Why use Shaarli and not Delicious/Diigo ? + +With Shaarli: + +* The data is yours: It's hosted on your server. +* Never fear of having your data locked-in. +* Never fear to have your data sold to third party. +* Your private links are not hosted on a third party server. +* You are not tracked by browser addons (like Diigo does) +* You can change the look and feel of the pages if you want. +* You can change the behaviour of the program. +* It's magnitude faster than most bookmarking services. + +### What does Shaarli mean? + +Shaarli is for shaaring your links. + +### My Shaarli is broken! +First of all, ensure that both the [web server](Server-configuration) and [Shaarli](Shaarli-configuration) are correctly configured, and that your installation is [supported](Server-requirements).[](.html) + +If everything looks right but the issue(s) remain(s), please: +- take a look at the [troubleshooting](Troubleshooting) section[](.html) +- come [chat with us](https://gitter.im/shaarli/Shaarli) on Gitter, we'll be happy to help ;-)[](.html) +- browse active [issues](https://github.com/shaarli/Shaarli/issues) and [Pull Requests](https://github.com/shaarli/Shaarli/pulls)[](.html) + - if you find one that is related to the issue, feel free to comment and provide additional details (host/Shaarli setup) + - else, [open a new issue](https://github.com/shaarli/Shaarli/issues/new), and provide information about the problem:[](.html) + - _what happens?_ - display glitches, invalid data, security flaws... + - _what is your configuration?_ - OS, server version, activated extensions, web browser... + - _is it reproducible?_ + +### Why not use a real database? Files are slow! + +Does browsing [this page](http://sebsauvage.net/links/) feel slow? Try browsing older pages, too.[](.html) + +It's not slow at all, is it? And don't forget the database contains more than 16000 links, and it's on a shared host, with 32000 visitors/day for my website alone. And it's still damn fast. Why? + +The data file is only 3.7 Mb. It's read 99% of the time, and is probably already in the operation system disk cache. So generating a page involves no I/O at all most of the time. diff --git a/doc/Firefox-share.html b/doc/Firefox-share.html new file mode 100644 index 00000000..198afe23 --- /dev/null +++ b/doc/Firefox-share.html @@ -0,0 +1,72 @@ + + + + + + +Login
Tools
button in the top bar✚Add to Firefox social
button and accept the activation.| | Your Shaarli instance must be hosted on an HTTPS (SSL/TLS secure connection) enabled server for Firefox Share to work. Firefox Share will not work over plain HTTP connections. |
|------|-------------------------------------------------------------------------------|
Gnu Privacy Guard (GnuPG) is an Open Source implementation of the Pretty Good [](.html)
Privacy (OpenPGP) specification. Its main purposes are digital authentication,
signature and encryption.
It is often used by the FLOSS community to verify:
+To quote Phil Pennock (the author of the SKS key server - http://sks.spodhuis.org/):
+++You MUST understand that presence of data in the keyserver (pools) in no way connotes trust. Anyone can generate a key, with any name or email address, and upload it. All security and trust comes from evaluating security at the “object level”, via PGP Web-Of-Trust signatures. This keyserver makes it possible to retrieve keys, looking them up via various indices, but the collection of keys in this public pool is KNOWN to contain malicious and fraudulent keys. It is the common expectation of server operators that users understand this and use software which, like all known common OpenPGP implementations, evaluates trust accordingly. This expectation is so common that it is not normally explicitly stated.
+
Trust can be gained by having your key signed by other people (and signing their key back, too :) ), for instance during key signing parties, see:
+ +See Generating a GPG key for Git tagging.
+$ gpg --gen-key
+
+gpg (GnuPG) 2.1.6; Copyright (C) 2015 Free Software Foundation, Inc.
+This is free software: you are free to change and redistribute it.
+There is NO WARRANTY, to the extent permitted by law.
+
+Note: Use "gpg2 --full-gen-key" for a full featured key generation dialog.
+
+GnuPG needs to construct a user ID to identify your key.
+
+Real name: Marvin the Paranoid Android
+Email address: marvin@h2g2.net
+You selected this USER-ID:
+ "Marvin the Paranoid Android <marvin@h2g2.net>"
+
+Change (N)ame, (E)mail, or (O)kay/(Q)uit? o
+We need to generate a lot of random bytes. It is a good idea to perform
+some other action (type on the keyboard, move the mouse, utilize the
+disks) during the prime generation; this gives the random number
+generator a better chance to gain enough entropy.
+At this point, you will:
+gpg: key A9D53A3E marked as ultimately trusted
+public and secret key created and signed.
+
+gpg: checking the trustdb
+gpg: 3 marginal(s) needed, 1 complete(s) needed, PGP trust model
+gpg: depth: 0 valid: 2 signed: 0 trust: 0-, 0q, 0n, 0m, 0f, 2u
+pub rsa2048/A9D53A3E 2015-07-31
+ Key fingerprint = AF2A 5381 E54B 2FD2 14C4 A9A3 0E35 ACA4 A9D5 3A3E
+uid [ultimate] Marvin the Paranoid Android <marvin@h2g2.net>[](.html)
+sub rsa2048/8C0EACF1 2015-07-31
+$ gpg --keyserver pgp.mit.edu --send-keys A9D53A3E
+gpg: sending key A9D53A3E to hkp server pgp.mit.edu
+See Git - Maintaining a project - Tagging your [](.html)
releases.
This guide assumes that you have:
+~/.gitconfig
origin
pointing to your GitHub forkupstream
pointing to the main Shaarli repository$ cd /path/to/shaarli
+
+# create a new branch
+$ git fetch upstream
+$ git checkout upstream/master -b v0.5.0
+
+# bump the version number
+$ vim index.php shaarli_version.php
+
+# commit the changes
+$ git add index.php shaarli_version.php
+$ git commit -s -m "Bump version to v0.5.0"
+
+# push the commit on your GitHub fork
+$ git push origin v0.5.0
+This one is pretty straightforward ;-)
+# update your local copy
+$ git checkout master
+$ git fetch upstream
+$ git pull upstream master
+
+# create a signed tag
+$ git tag -s -m "Release v0.5.0" v0.5.0
+
+# push it to "upstream"
+$ git push --tags upstream
+v0.5.0
is the first GPG-signed tag pushed on the Community Shaarli.
Let's have a look at its signature!
+$ cd /path/to/shaarli
+$ git fetch upstream
+
+# get the SHA1 reference of the tag
+$ git show-ref tags/v0.5.0
+f7762cf803f03f5caf4b8078359a63783d0090c1 refs/tags/v0.5.0
+
+# verify the tag signature information
+$ git verify-tag f7762cf803f03f5caf4b8078359a63783d0090c1
+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)
+
+
diff --git a/doc/GnuPG-signature.md b/doc/GnuPG-signature.md
new file mode 100644
index 00000000..e8dbdb11
--- /dev/null
+++ b/doc/GnuPG-signature.md
@@ -0,0 +1,141 @@
+#GnuPG signature
+## Introduction
+### PGP and GPG
+[Gnu Privacy Guard](https://gnupg.org/) (GnuPG) is an Open Source implementation of the [Pretty Good [](.html)
+Privacy](https://en.wikipedia.org/wiki/Pretty_Good_Privacy#OpenPGP) (OpenPGP) specification. Its main purposes are digital authentication,
+signature and encryption.
+
+It is often used by the [FLOSS](https://en.wikipedia.org/wiki/Free_and_open-source_software) community to verify:[](.html)
+- Linux package signatures: Debian [SecureApt](https://wiki.debian.org/SecureApt), ArchLinux [Master [](.html)
+Keys](https://www.archlinux.org/master-keys/)
+- [SCM](https://en.wikipedia.org/wiki/Revision_control) releases & maintainer identity[](.html)
+
+### Trust
+To quote Phil Pennock (the author of the [SKS](https://bitbucket.org/skskeyserver/sks-keyserver/wiki/Home) key server - http://sks.spodhuis.org/):[](.html)
+
+> You MUST understand that presence of data in the keyserver (pools) in no way connotes trust. Anyone can generate a key, with any name or email address, and upload it. All security and trust comes from evaluating security at the “object level”, via PGP Web-Of-Trust signatures. This keyserver makes it possible to retrieve keys, looking them up via various indices, but the collection of keys in this public pool is KNOWN to contain malicious and fraudulent keys. It is the common expectation of server operators that users understand this and use software which, like all known common OpenPGP implementations, evaluates trust accordingly. This expectation is so common that it is not normally explicitly stated.
+
+Trust can be gained by having your key signed by other people (and signing their key back, too :) ), for instance during [key signing parties](https://en.wikipedia.org/wiki/Key_signing_party), see:[](.html)
+- [The Keysigning party HOWTO](http://www.cryptnet.net/fdp/crypto/keysigning_party/en/keysigning_party.html)[](.html)
+- [Web of trust](https://en.wikipedia.org/wiki/Web_of_trust)[](.html)
+
+## Generate a GPG key
+See [Generating a GPG key for Git tagging](http://stackoverflow.com/a/16725717).[](.html)
+
+### gpg - provide identity information
+```bash
+$ gpg --gen-key
+
+gpg (GnuPG) 2.1.6; Copyright (C) 2015 Free Software Foundation, Inc.
+This is free software: you are free to change and redistribute it.
+There is NO WARRANTY, to the extent permitted by law.
+
+Note: Use "gpg2 --full-gen-key" for a full featured key generation dialog.
+
+GnuPG needs to construct a user ID to identify your key.
+
+Real name: Marvin the Paranoid Android
+Email address: marvin@h2g2.net
+You selected this USER-ID:
+ "Marvin the Paranoid Android Sessions do not seem to work correctly on your server
Login
Tools
button in the top bar✚Shaare link
button, and drop it to your browser's bookmarks bar.This bookmarklet button in compatible with Firefox, Opera, Chrome and Safari. Under Opera, you can't drag'n drop the button: You have to right-click on it and add a bookmark to your personal toolbar.
- -Login
Tools
button in the top bar✚Add to Firefox social
button and accept the activation.Save
.Voila! Your link is now shared.Shaarli can be used:
-readlater
)music
or video
tags)discussion
)Add Link
buttonAdd Link
Private
then click Save
It is possible to filter RSS/ATOM feeds and Picture Wall on a Shaarli to only display results of a specific search, or for a specific tag. For example, if you want to subscribe only to links tagged photography
:
photography
tag in the Filter by tag box. Links tagged photography
are displayed.RSS Feed
button.nature
?)https://my.shaarli.domain/?do=rss&searchtags=nature
, https://my.shaarli.domain/links/?do=picwall&searchterm=poney
-
To change the configuration, create the file data/options.php
, example:
<?php
- $GLOBALS['config']['LINKS_PER_PAGE'] = 30;
- $GLOBALS['config']['HIDE_TIMESTAMPS'] = true;
- $GLOBALS['config']['ENABLE_THUMBNAILS'] = false;
- ?>
-Do not edit config options in index.php! Your changes would be lost when you upgrade. The following parameters are available (parameters (default value)):
-DATADIR ('data')
: This is the name of the subdirectory where Shaarli stores is data file. You can change it for better security.CONFIG_FILE ($GLOBALS['config']['DATADIR'].'/config.php')
: Name of file which is used to store login/password.DATASTORE ($GLOBALS['config']['DATADIR'].'/datastore.php')
: Name of file which contains the link database.LINKS_PER_PAGE (20)
: Default number of links per page displayed.IPBANS_FILENAME ($GLOBALS['config']['DATADIR'].'/ipbans.php')
: Name of file which records login attempts and IP bans.BAN_AFTER (4)
: An IP address will be banned after this many failed login attempts.BAN_DURATION (1800)
: Duration of ban (in seconds). (1800 seconds = 30 minutes)OPEN_SHAARLI (false)
: If you set this option to true, anyone will be able to add/modify/delete/import/exports links without having to login.HIDE_TIMESTAMPS (false)
: If you set this option to true, the date/time of each link will not be displayed (including in RSS Feed).#related-softwareENABLE_THUMBNAILS (true)
: Enable/disable thumbnails.RAINTPL_TMP (tmp/)
: Raintpl cache directory (keep the trailing slash!)RAINTPL_TPL (tpl/)
: Raintpl template directory (keep the trailing slash!). Edit this option if you want to change the rendering template (page structure) used by Shaarli. See Changing templateCACHEDIR ('cache')
: Directory where the thumbnails are stored.ENABLE_LOCALCACHE (true)
: If you have a limited quota on your webspace, you can set this option to false: Shaarli will not generate thumbnails which need to be cached locally (vimeo, flickr, etc.). Thumbnails will still be visible for the services which do not use the local cache (youtube.com, imgur.com, dailymotion.com, imageshack.us)UPDATECHECK_FILENAME ($GLOBALS['config']['DATADIR'].'/lastupdatecheck.txt')
: name of the file used to store available shaarli version.UPDATECHECK_INTERVAL (86400)
: Delay between new Shaarli version check. 86400 seconds = 24 hours. Note that if you do not login for a week, Shaarli will not check for new version for a week.ENABLE_UPDATECHECK
: Determines whether Shaarli check for new releases at https://github.com/shaarli/ShaarliSHOW_ATOM (false)
: Show an ATOM Feed
button next to the Subscribe
(RSS) button. ATOM feeds are available at the address ?do=atom
regardless of this option.ARCHIVE_ORG (false)
: For each link, display a link to an archived version on archive.orgENABLE_RSS_PERMALINKS (true)
: choose whether the RSS item title link points directly to the link, or to the entry on Shaarli (permalink). true
is the original Shaarli bahevior (point directly to the link)HIDE_PUBLIC_LINKS (false)
: setting this to true hides all links, even public ones, for non-logged in users.inc/user.css
. This file allows to override rules defined in the main inc/shaarli.css
(only add changed rules), or define a whole new theme.inc/shaarli.css
! Your changes would be overriden when updating Shaarli.See also:
- -| WARNING | This feature is currently being worked on and will be improved in the next releases. Experimental. |
|---------|---------|
tpl/
directory, run git clone https://url/of/my-template/
or unpack the zip archive. There should now be a my-template/
directory under the tpl/
dir, containing directly all the template files.data/options.php
to have Shaarli use this template. Eg.$GLOBALS['config']['RAINTPL_TPL'] = 'tpl/my-template/' ;
You can find a list of compatible templates in Related Software
-You have two ways of backing up your database:
-data/datastore.php
(by FTP or SSH). Restore by putting the file back in place.rsync -avzP my.server.com:/var/www/shaarli/data/datastore.php datastore-$(date +%Y-%m-%d_%H%M).php
Tools
> Export
). Restore by using the Import
feature../export-bookmarks.py --url=https://my.server.com/shaarli --username=myusername --password=mysupersecretpassword --download-dir=./ --type=all
Delete the file data/config.php and display the page again. You will be asked for a new login/password.
-Login form is protected against brute force attacks: 4 failed logins will ban the IP address from login for 30 minutes. Banned IPs can still browse links.
-To remove the current IP bans, delete the file data/ipbans.php
The file data/log.txt
shows all logins (successful or failed) and bans/lifted bans.
Search for failed
in this file to look for unauthorized login attempts.
If you export your bookmark from Diigo, make sure you use the Delicious export, not the Netscape export. (Their Netscape export is broken, and they don't seem to be interested in fixing it.)
-To correctly import the tags from a SemanticScuttle HTML export, edit the HTML file before importing and replace all occurences of tags=
(lowercase) to TAGS=
(uppercase).
See this issue for import tweaks.
-sessions
directory at the root of your webspace. Change the file extension to .php5
or create a .htaccess
file in the directory where Shaarli is located containing:php 1
-SetEnv PHP_VER 5
-Parse error: syntax error, unexpected '=', expecting '(' in /links/index.php on line xxx
, it means that your host is using php4, not php5. Shaarli requires php 5.1. Try changing the file extension to .php5
Warning: file_get_contents() [function.file-get-contents]: URL file-access is disabled in the server configuration in /…/index.php on line xxx
, it means that your host has disabled the ability to fetch a file by HTTP in the php config (Typically in 1and1 hosting). Bad host. Change host. Or comment the following lines://list($status,$headers,$data) = getHTTP($url,4); // Short timeout to keep the application responsive.
-// FIXME: Decode charset according to charset specified in either 1) HTTP response headers or 2) <head> in html
-//if (strpos($status,'200 OK')) $title=html_extract_title($data);
-<? // tout ce qui est charge ici (generalement des includes et require) est charge en permanence. ?>
. To fix this, remove this message from php-include/prepend.php
Shaarli tries to sniff the language of the browser (using HTTP_ACCEPT_LANGUAGE headers) and choose a date format accordingly. But Shaarli can only use the date formats (and more generaly speaking, the locales) provided by the webserver. So even if you have a browser in French, you may end up with dates in US format (it's the case on sebsauvage.net :-( )
-On CentOS/RedHat derivatives, you may need to install the php-mbstring
package.
This can be caused by several things:
-session
directory on the root of your website.) You may need to create the session directory of set it up.sessions
subdirectory and add ini_set('session.save_path', $_SERVER['DOCUMENT_ROOT'].'/../sessions');
. Make sure this directory is not browsable !)Sessions do not seem to work correctly on your server
Follow the instructions in the error message. Make sure you are accessing shaarli via a direct IP address or a proper hostname. If you have no dots in the hostname (e.g. localhost
or http://my-webserver/shaarli/
), some browsers will not store cookies at all (this respects the HTTP cookie specification).
Download publisher.php at the root of your Shaarli installation and set $GLOBALS['config']['PUBSUBHUB_URL']
in your config.php
To display the array representing the data saved in datastore.php, use the following snippet
-$data = "tZNdb9MwFIb... <Commented content inside datastore.php>";
-$out = unserialize(gzinflate(base64_decode($data)));
-echo "<pre>"; // Pretty printing is love, pretty printing is life
-print_r($out);
-echo "</pre>";
-exit;
-This will output the internal representation of the datastore, "unobfuscated" (if this can really be considered obfuscation)
<input type="hidden" name="lf_linkdate" value="{$link.linkdate}">
in tpl/editlink.tpl
(line 14)type="hidden"
from this lineYYYMMDD_HHMMS
.Unofficial but relatedd work on Shaarli. If you maintain one of these, please get in touch with us to help us find a way to adapt your work to our fork. TODO contact repos owners to see if they'd like to standardize their work for the community fork.
-I was a StumbleUpon user. Then I got fed up with they big toolbar. I switched to delicious, which was lighter, faster and more beautiful. Until Yahoo bought it. Then the export API broke all the time, delicious became slow and was ditched by Yahoo. I switched to Diigo, which is not bad, but does too much. And Diigo is sslllooooowww and their Firefox extension a bit buggy. And… oh… their Firefox addon sends to Diigo every single URL you visit (Don't believe me ? Use Tamper Data and open any page).
-Enough is enough. Saving simple links should not be a complicated heavy thing. I ditched them all and wrote my own: Shaarli. It's simple, but it does the job and does it well. And my data is not hosted on a foreign server, but on my server.
-With Shaarli:
-Shaarli is for shaaring your links.
-Link database is an associative array which is serialized, compressed (with deflate), base64-encoded and saved as a comment in a .php file. Thus even if the server does not support htaccess files, the data file will still not be readable by URL. The database looks like this:
-<?php /* zP1ZjxxJtiYIvvevEPJ2lDOaLrZv7o...
-...ka7gaco/Z+TFXM2i7BlfMf8qxpaSSYfKlvqv/x8= */ ?>
HTTP_REFERER
for some functions (like redirects and clicking on tags). If you have disabled or masqueraded HTTP_REFERER
in your browser, some features of Shaarli may not workmagic_quotes
is a horrible option of php which is often activated on servers. No serious developer should rely on this horror to secure their code against SQL injections. You should disable it (and Shaarli expects this option to be disabled). Nevertheless, I have added code to cope with magic_quotes on, so you should not be bothered even on crappy hosts.Small hashes are used to make a link to an entry in Shaarli. They are unique. In fact, the date of the items (eg.20110923_150523) is hashed with CRC32, then converted to base64 and some characters are replaced. They are always 6 characters longs and use only A-Z a-z 0-9 - _ and @.
Here is the directory structure of Shaarli and the purpose of the different files:
- index.php : Main program.
- application/ : Shaarli classes
- ├── LinkDB.php
- └── Utils.php
- tests/ : Shaarli unitary & functional tests
- ├── LinkDBTest.php
- ├── utils # utilities to ease testing
- │ └── ReferenceLinkDB.php
- └── UtilsTest.php
- COPYING : Shaarli license.
- inc/ : Includes (libraries, CSS…)
- ├── awesomplete.*: tags autocompletion library
- ├── blazy.*: picture wall lazy image loading library
- ├── shaarli.css, reset.css : Shaarli stylesheet.
- ├── qr.* : qr code generation library
- └──rain.tpl.class.php : RainTPL templating library.
- tpl/ : RainTPL templates for Shaarli. They are used to build the pages.
- images/ : Images and icons used in Shaarli.
- data/ : Directory where data is stored (bookmark database, configuration, logs, banlist…)
- ├── config.php : Shaarli configuration (login, password, timezone, title…)
- ├── datastore.php : Your link database (compressed).
- ├── ipban.php : IP address ban system data.
- ├── lastupdatecheck.txt : Update check timestamp file (used to check every 24 hours if a new version of Shaarli is available).
- └──log.txt : login/IPban log.
- cache/ : Directory containing the thumbnails cache. This directory is automatically created. You can erase it anytime you want.
- tmp/ : Temporary directory for compiled RainTPL templates. This directory is automatically created. You can erase it anytime you want.
-Does browsing this page feel slow ? Try browsing older pages, too.
-It's not slow at all, is it ? And don't forget the database contains more than 16000 links, and it's on a shared host, with 32000 visitors/day for my website alone. And it's still damn fast. Why ?
-The data file is only 3.7 Mb. It's read 99% of the time, and is probably already in the operation system disk cache. So generating a page involves no I/O at all most of the time.
-Welcome to the Shaarli wiki
+Here you can find some info on how to use, configure, tweak and solve problems with your Shaarli.
+For general info, read the README.
+If you have any questions or ideas, please join the chat (also reachable via IRC), post them in our general discussion or read the current issues. If you've found a bug, please create a new issue.
+If you would like a feature added to Shaarli, check the issues labeled feature
, enhancement
, and plugin
.
Note: This documentation is available online at https://github.com/shaarli/Shaarli/wiki, and locally in the doc/
directory of your Shaarli installation.