</li>
<li class="">
- <a class="" href="../Copy-an-existing-installation-over-SSH-and-serve-it-locally/">Copy an existing installation over SSH and serve it locally</a>
- </li>
- <li class="">
-
- <a class="" href="../Create-and-serve-multiple-Shaarlis-(farm)/">Create and serve multiple Shaarlis (farm)</a>
- </li>
- <li class="">
-
- <a class="" href="../Download-CSS-styles-from-an-OPML-list/">Download CSS styles from an OPML list</a>
- </li>
- <li class="">
-
- <a class="" href="../Datastore-hacks/">Datastore hacks</a>
+ <a class="" href="../Various-hacks/">Various hacks</a>
</li>
</ul>
</li>
</li>
<li class="">
- <a class="" href="../Copy-an-existing-installation-over-SSH-and-serve-it-locally/">Copy an existing installation over SSH and serve it locally</a>
- </li>
- <li class="">
-
- <a class="" href="../Create-and-serve-multiple-Shaarlis-(farm)/">Create and serve multiple Shaarlis (farm)</a>
- </li>
- <li class="">
-
- <a class="" href="../Download-CSS-styles-from-an-OPML-list/">Download CSS styles from an OPML list</a>
- </li>
- <li class="">
-
- <a class="" href="../Datastore-hacks/">Datastore hacks</a>
+ <a class="" href="../Various-hacks/">Various hacks</a>
</li>
</ul>
</li>
<div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
- <a href="../Copy-an-existing-installation-over-SSH-and-serve-it-locally/" class="btn btn-neutral float-right" title="Copy an existing installation over SSH and serve it locally">Next <span class="icon icon-circle-arrow-right"></span></a>
+ <a href="../Various-hacks/" class="btn btn-neutral float-right" title="Various hacks">Next <span class="icon icon-circle-arrow-right"></span></a>
<a href="../REST-API/" class="btn btn-neutral" title="REST API"><span class="icon icon-circle-arrow-left"></span> Previous</a>
<span><a href="../REST-API/" style="color: #fcfcfc;">« Previous</a></span>
- <span style="margin-left: 15px"><a href="../Copy-an-existing-installation-over-SSH-and-serve-it-locally/" style="color: #fcfcfc">Next »</a></span>
+ <span style="margin-left: 15px"><a href="../Various-hacks/" style="color: #fcfcfc">Next »</a></span>
</span>
</div>
</li>
<li class="">
- <a class="" href="../Copy-an-existing-installation-over-SSH-and-serve-it-locally/">Copy an existing installation over SSH and serve it locally</a>
- </li>
- <li class="">
-
- <a class="" href="../Create-and-serve-multiple-Shaarlis-(farm)/">Create and serve multiple Shaarlis (farm)</a>
- </li>
- <li class="">
-
- <a class="" href="../Download-CSS-styles-from-an-OPML-list/">Download CSS styles from an OPML list</a>
- </li>
- <li class="">
-
- <a class="" href="../Datastore-hacks/">Datastore hacks</a>
+ <a class="" href="../Various-hacks/">Various hacks</a>
</li>
</ul>
</li>
</li>
<li class="">
- <a class="" href="../Copy-an-existing-installation-over-SSH-and-serve-it-locally/">Copy an existing installation over SSH and serve it locally</a>
- </li>
- <li class="">
-
- <a class="" href="../Create-and-serve-multiple-Shaarlis-(farm)/">Create and serve multiple Shaarlis (farm)</a>
- </li>
- <li class="">
-
- <a class="" href="../Download-CSS-styles-from-an-OPML-list/">Download CSS styles from an OPML list</a>
- </li>
- <li class="">
-
- <a class="" href="../Datastore-hacks/">Datastore hacks</a>
+ <a class="" href="../Various-hacks/">Various hacks</a>
</li>
</ul>
</li>
</li>
<li class="">
- <a class="" href="../Copy-an-existing-installation-over-SSH-and-serve-it-locally/">Copy an existing installation over SSH and serve it locally</a>
- </li>
- <li class="">
-
- <a class="" href="../Create-and-serve-multiple-Shaarlis-(farm)/">Create and serve multiple Shaarlis (farm)</a>
- </li>
- <li class="">
-
- <a class="" href="../Download-CSS-styles-from-an-OPML-list/">Download CSS styles from an OPML list</a>
- </li>
- <li class="">
-
- <a class="" href="../Datastore-hacks/">Datastore hacks</a>
+ <a class="" href="../Various-hacks/">Various hacks</a>
</li>
</ul>
</li>
</li>
<li class="">
- <a class="" href="../Copy-an-existing-installation-over-SSH-and-serve-it-locally/">Copy an existing installation over SSH and serve it locally</a>
- </li>
- <li class="">
-
- <a class="" href="../Create-and-serve-multiple-Shaarlis-(farm)/">Create and serve multiple Shaarlis (farm)</a>
- </li>
- <li class="">
-
- <a class="" href="../Download-CSS-styles-from-an-OPML-list/">Download CSS styles from an OPML list</a>
- </li>
- <li class="">
-
- <a class="" href="../Datastore-hacks/">Datastore hacks</a>
+ <a class="" href="../Various-hacks/">Various hacks</a>
</li>
</ul>
</li>
</li>
<li class="">
- <a class="" href="../Copy-an-existing-installation-over-SSH-and-serve-it-locally/">Copy an existing installation over SSH and serve it locally</a>
- </li>
- <li class="">
-
- <a class="" href="../Create-and-serve-multiple-Shaarlis-(farm)/">Create and serve multiple Shaarlis (farm)</a>
- </li>
- <li class="">
-
- <a class="" href="../Download-CSS-styles-from-an-OPML-list/">Download CSS styles from an OPML list</a>
- </li>
- <li class="">
-
- <a class="" href="../Datastore-hacks/">Datastore hacks</a>
+ <a class="" href="../Various-hacks/">Various hacks</a>
</li>
</ul>
</li>
+++ /dev/null
-<!DOCTYPE html>
-<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]-->
-<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]-->
-<head>
- <meta charset="utf-8">
- <meta http-equiv="X-UA-Compatible" content="IE=edge">
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
-
-
- <link rel="shortcut icon" href="../img/favicon.ico">
- <title>Copy an existing installation over SSH and serve it locally - Shaarli Documentation</title>
- <link href='https://fonts.googleapis.com/css?family=Lato:400,700|Roboto+Slab:400,700|Inconsolata:400,700' rel='stylesheet' type='text/css'>
-
- <link rel="stylesheet" href="../css/theme.css" type="text/css" />
- <link rel="stylesheet" href="../css/theme_extra.css" type="text/css" />
- <link rel="stylesheet" href="../css/highlight.css">
- <link href="../github-markdown.css" rel="stylesheet">
-
- <script>
- // Current page data
- var mkdocs_page_name = "Copy an existing installation over SSH and serve it locally";
- var mkdocs_page_input_path = "Copy-an-existing-installation-over-SSH-and-serve-it-locally.md";
- var mkdocs_page_url = "/Copy-an-existing-installation-over-SSH-and-serve-it-locally/";
- </script>
-
- <script src="../js/jquery-2.1.1.min.js"></script>
- <script src="../js/modernizr-2.8.3.min.js"></script>
- <script type="text/javascript" src="../js/highlight.pack.js"></script>
-
-</head>
-
-<body class="wy-body-for-nav" role="document">
-
- <div class="wy-grid-for-nav">
-
-
- <nav data-toggle="wy-nav-shift" class="wy-nav-side stickynav">
- <div class="wy-side-nav-search">
- <a href=".." class="icon icon-home"> Shaarli Documentation</a>
- <div role="search">
- <form id ="rtd-search-form" class="wy-form" action="../search.html" method="get">
- <input type="text" name="q" placeholder="Search docs" />
- </form>
-</div>
- </div>
-
- <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
- <ul class="current">
-
-
- <li class="toctree-l1">
-
- <a class="" href="..">Home</a>
- </li>
-
- <li class="toctree-l1">
-
- <span class="caption-text">Setup</span>
- <ul class="subnav">
- <li class="">
-
- <a class="" href="../Download-and-Installation/">Download and Installation</a>
- </li>
- <li class="">
-
- <a class="" href="../Upgrade-and-migration/">Upgrade and migration</a>
- </li>
- <li class="">
-
- <a class="" href="../Server-requirements/">Server requirements</a>
- </li>
- <li class="">
-
- <a class="" href="../Server-configuration/">Server configuration</a>
- </li>
- <li class="">
-
- <a class="" href="../Server-security/">Server security</a>
- </li>
- <li class="">
-
- <a class="" href="../Shaarli-configuration/">Shaarli configuration</a>
- </li>
- <li class="">
-
- <a class="" href="../Plugins/">Plugins</a>
- </li>
- </ul>
- </li>
-
- <li class="toctree-l1">
-
- <span class="caption-text">Docker</span>
- <ul class="subnav">
- <li class="">
-
- <a class="" href="../Docker-101/">Docker 101</a>
- </li>
- <li class="">
-
- <a class="" href="../Shaarli-images/">Shaarli images</a>
- </li>
- <li class="">
-
- <a class="" href="../Reverse-proxy-configuration/">Reverse proxy configuration</a>
- </li>
- <li class="">
-
- <a class="" href="../Docker-resources/">Docker resources</a>
- </li>
- </ul>
- </li>
-
- <li class="toctree-l1">
-
- <span class="caption-text">Usage</span>
- <ul class="subnav">
- <li class="">
-
- <a class="" href="../Features/">Features</a>
- </li>
- <li class="">
-
- <a class="" href="../Bookmarklet/">Bookmarklet</a>
- </li>
- <li class="">
-
- <a class="" href="../Browsing-and-searching/">Browsing and searching</a>
- </li>
- <li class="">
-
- <a class="" href="../Firefox-share/">Firefox share</a>
- </li>
- <li class="">
-
- <a class="" href="../RSS-feeds/">RSS feeds</a>
- </li>
- <li class="">
-
- <a class="" href="../REST-API/">REST API</a>
- </li>
- </ul>
- </li>
-
- <li class="toctree-l1">
-
- <span class="caption-text">How To</span>
- <ul class="subnav">
- <li class="">
-
- <a class="" href="../Backup,-restore,-import-and-export/">Backup, restore, import and export</a>
- </li>
- <li class=" current">
-
- <a class="current" href="./">Copy an existing installation over SSH and serve it locally</a>
- <ul class="subnav">
-
- </ul>
- </li>
- <li class="">
-
- <a class="" href="../Create-and-serve-multiple-Shaarlis-(farm)/">Create and serve multiple Shaarlis (farm)</a>
- </li>
- <li class="">
-
- <a class="" href="../Download-CSS-styles-from-an-OPML-list/">Download CSS styles from an OPML list</a>
- </li>
- <li class="">
-
- <a class="" href="../Datastore-hacks/">Datastore hacks</a>
- </li>
- </ul>
- </li>
-
- <li class="toctree-l1">
-
- <a class="" href="../Troubleshooting/">Troubleshooting</a>
- </li>
-
- <li class="toctree-l1">
-
- <span class="caption-text">Development</span>
- <ul class="subnav">
- <li class="">
-
- <a class="" href="../Development-guidelines/">Development guidelines</a>
- </li>
- <li class="">
-
- <a class="" href="../Continuous-integration-tools/">Continuous integration tools</a>
- </li>
- <li class="">
-
- <a class="" href="../GnuPG-signature/">GnuPG signature</a>
- </li>
- <li class="">
-
- <a class="" href="../Coding-guidelines/">Coding guidelines</a>
- </li>
- <li class="">
-
- <a class="" href="../Directory-structure/">Directory structure</a>
- </li>
- <li class="">
-
- <a class="" href="../3rd-party-libraries/">3rd party libraries</a>
- </li>
- <li class="">
-
- <a class="" href="../Plugin-System/">Plugin System</a>
- </li>
- <li class="">
-
- <a class="" href="../Release-Shaarli/">Release Shaarli</a>
- </li>
- <li class="">
-
- <a class="" href="../Versioning-and-Branches/">Versioning and Branches</a>
- </li>
- <li class="">
-
- <a class="" href="../Security/">Security</a>
- </li>
- <li class="">
-
- <a class="" href="../Static-analysis/">Static analysis</a>
- </li>
- <li class="">
-
- <a class="" href="../Theming/">Theming</a>
- </li>
- <li class="">
-
- <a class="" href="../Unit-tests/">Unit tests</a>
- </li>
- </ul>
- </li>
-
- <li class="toctree-l1">
-
- <span class="caption-text">About</span>
- <ul class="subnav">
- <li class="">
-
- <a class="" href="../FAQ/">FAQ</a>
- </li>
- <li class="">
-
- <a class="" href="../Community-&-Related-software/">Community & Related software</a>
- </li>
- </ul>
- </li>
-
- </ul>
- </div>
-
- </nav>
-
- <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
-
-
- <nav class="wy-nav-top" role="navigation" aria-label="top navigation">
- <i data-toggle="wy-nav-top" class="fa fa-bars"></i>
- <a href="..">Shaarli Documentation</a>
- </nav>
-
-
- <div class="wy-nav-content">
- <div class="rst-content">
- <div role="navigation" aria-label="breadcrumbs navigation">
- <ul class="wy-breadcrumbs">
- <li><a href="..">Docs</a> »</li>
-
-
-
- <li>How To »</li>
-
-
-
- <li>Copy an existing installation over SSH and serve it locally</li>
- <li class="wy-breadcrumbs-aside">
-
- <a href="https://github.com/shaarli/Shaarli/edit/master/docs/Copy-an-existing-installation-over-SSH-and-serve-it-locally.md"
- class="icon icon-github"> Edit on GitHub</a>
-
- </li>
- </ul>
- <hr/>
-</div>
- <div role="main">
- <div class="section">
-
- <p>Example bash script:</p>
-<pre><code class="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.
-#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
-</code></pre>
-
-<p>This outputs:</p>
-<pre><code class="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]: /...
-</code></pre>
-
- </div>
- </div>
- <footer>
-
- <div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
-
- <a href="../Create-and-serve-multiple-Shaarlis-(farm)/" class="btn btn-neutral float-right" title="Create and serve multiple Shaarlis (farm)">Next <span class="icon icon-circle-arrow-right"></span></a>
-
-
- <a href="../Backup,-restore,-import-and-export/" class="btn btn-neutral" title="Backup, restore, import and export"><span class="icon icon-circle-arrow-left"></span> Previous</a>
-
- </div>
-
-
- <hr/>
-
- <div role="contentinfo">
- <!-- Copyright etc -->
-
- </div>
-
- Built with <a href="http://www.mkdocs.org">MkDocs</a> using a <a href="https://github.com/snide/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>.
-</footer>
-
- </div>
- </div>
-
- </section>
-
- </div>
-
- <div class="rst-versions" role="note" style="cursor: pointer">
- <span class="rst-current-version" data-toggle="rst-current-version">
-
- <a href="https://github.com/shaarli/Shaarli" class="fa fa-github" style="float: left; color: #fcfcfc"> GitHub</a>
-
-
- <span><a href="../Backup,-restore,-import-and-export/" style="color: #fcfcfc;">« Previous</a></span>
-
-
- <span style="margin-left: 15px"><a href="../Create-and-serve-multiple-Shaarlis-(farm)/" style="color: #fcfcfc">Next »</a></span>
-
- </span>
-</div>
- <script src="../js/theme.js"></script>
-
-</body>
-</html>
+++ /dev/null
-<!DOCTYPE html>
-<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]-->
-<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]-->
-<head>
- <meta charset="utf-8">
- <meta http-equiv="X-UA-Compatible" content="IE=edge">
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
-
-
- <link rel="shortcut icon" href="../img/favicon.ico">
- <title>Create and serve multiple Shaarlis (farm) - Shaarli Documentation</title>
- <link href='https://fonts.googleapis.com/css?family=Lato:400,700|Roboto+Slab:400,700|Inconsolata:400,700' rel='stylesheet' type='text/css'>
-
- <link rel="stylesheet" href="../css/theme.css" type="text/css" />
- <link rel="stylesheet" href="../css/theme_extra.css" type="text/css" />
- <link rel="stylesheet" href="../css/highlight.css">
- <link href="../github-markdown.css" rel="stylesheet">
-
- <script>
- // Current page data
- var mkdocs_page_name = "Create and serve multiple Shaarlis (farm)";
- var mkdocs_page_input_path = "Create-and-serve-multiple-Shaarlis-(farm).md";
- var mkdocs_page_url = "/Create-and-serve-multiple-Shaarlis-(farm)/";
- </script>
-
- <script src="../js/jquery-2.1.1.min.js"></script>
- <script src="../js/modernizr-2.8.3.min.js"></script>
- <script type="text/javascript" src="../js/highlight.pack.js"></script>
-
-</head>
-
-<body class="wy-body-for-nav" role="document">
-
- <div class="wy-grid-for-nav">
-
-
- <nav data-toggle="wy-nav-shift" class="wy-nav-side stickynav">
- <div class="wy-side-nav-search">
- <a href=".." class="icon icon-home"> Shaarli Documentation</a>
- <div role="search">
- <form id ="rtd-search-form" class="wy-form" action="../search.html" method="get">
- <input type="text" name="q" placeholder="Search docs" />
- </form>
-</div>
- </div>
-
- <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
- <ul class="current">
-
-
- <li class="toctree-l1">
-
- <a class="" href="..">Home</a>
- </li>
-
- <li class="toctree-l1">
-
- <span class="caption-text">Setup</span>
- <ul class="subnav">
- <li class="">
-
- <a class="" href="../Download-and-Installation/">Download and Installation</a>
- </li>
- <li class="">
-
- <a class="" href="../Upgrade-and-migration/">Upgrade and migration</a>
- </li>
- <li class="">
-
- <a class="" href="../Server-requirements/">Server requirements</a>
- </li>
- <li class="">
-
- <a class="" href="../Server-configuration/">Server configuration</a>
- </li>
- <li class="">
-
- <a class="" href="../Server-security/">Server security</a>
- </li>
- <li class="">
-
- <a class="" href="../Shaarli-configuration/">Shaarli configuration</a>
- </li>
- <li class="">
-
- <a class="" href="../Plugins/">Plugins</a>
- </li>
- </ul>
- </li>
-
- <li class="toctree-l1">
-
- <span class="caption-text">Docker</span>
- <ul class="subnav">
- <li class="">
-
- <a class="" href="../Docker-101/">Docker 101</a>
- </li>
- <li class="">
-
- <a class="" href="../Shaarli-images/">Shaarli images</a>
- </li>
- <li class="">
-
- <a class="" href="../Reverse-proxy-configuration/">Reverse proxy configuration</a>
- </li>
- <li class="">
-
- <a class="" href="../Docker-resources/">Docker resources</a>
- </li>
- </ul>
- </li>
-
- <li class="toctree-l1">
-
- <span class="caption-text">Usage</span>
- <ul class="subnav">
- <li class="">
-
- <a class="" href="../Features/">Features</a>
- </li>
- <li class="">
-
- <a class="" href="../Bookmarklet/">Bookmarklet</a>
- </li>
- <li class="">
-
- <a class="" href="../Browsing-and-searching/">Browsing and searching</a>
- </li>
- <li class="">
-
- <a class="" href="../Firefox-share/">Firefox share</a>
- </li>
- <li class="">
-
- <a class="" href="../RSS-feeds/">RSS feeds</a>
- </li>
- <li class="">
-
- <a class="" href="../REST-API/">REST API</a>
- </li>
- </ul>
- </li>
-
- <li class="toctree-l1">
-
- <span class="caption-text">How To</span>
- <ul class="subnav">
- <li class="">
-
- <a class="" href="../Backup,-restore,-import-and-export/">Backup, restore, import and export</a>
- </li>
- <li class="">
-
- <a class="" href="../Copy-an-existing-installation-over-SSH-and-serve-it-locally/">Copy an existing installation over SSH and serve it locally</a>
- </li>
- <li class=" current">
-
- <a class="current" href="./">Create and serve multiple Shaarlis (farm)</a>
- <ul class="subnav">
-
- </ul>
- </li>
- <li class="">
-
- <a class="" href="../Download-CSS-styles-from-an-OPML-list/">Download CSS styles from an OPML list</a>
- </li>
- <li class="">
-
- <a class="" href="../Datastore-hacks/">Datastore hacks</a>
- </li>
- </ul>
- </li>
-
- <li class="toctree-l1">
-
- <a class="" href="../Troubleshooting/">Troubleshooting</a>
- </li>
-
- <li class="toctree-l1">
-
- <span class="caption-text">Development</span>
- <ul class="subnav">
- <li class="">
-
- <a class="" href="../Development-guidelines/">Development guidelines</a>
- </li>
- <li class="">
-
- <a class="" href="../Continuous-integration-tools/">Continuous integration tools</a>
- </li>
- <li class="">
-
- <a class="" href="../GnuPG-signature/">GnuPG signature</a>
- </li>
- <li class="">
-
- <a class="" href="../Coding-guidelines/">Coding guidelines</a>
- </li>
- <li class="">
-
- <a class="" href="../Directory-structure/">Directory structure</a>
- </li>
- <li class="">
-
- <a class="" href="../3rd-party-libraries/">3rd party libraries</a>
- </li>
- <li class="">
-
- <a class="" href="../Plugin-System/">Plugin System</a>
- </li>
- <li class="">
-
- <a class="" href="../Release-Shaarli/">Release Shaarli</a>
- </li>
- <li class="">
-
- <a class="" href="../Versioning-and-Branches/">Versioning and Branches</a>
- </li>
- <li class="">
-
- <a class="" href="../Security/">Security</a>
- </li>
- <li class="">
-
- <a class="" href="../Static-analysis/">Static analysis</a>
- </li>
- <li class="">
-
- <a class="" href="../Theming/">Theming</a>
- </li>
- <li class="">
-
- <a class="" href="../Unit-tests/">Unit tests</a>
- </li>
- </ul>
- </li>
-
- <li class="toctree-l1">
-
- <span class="caption-text">About</span>
- <ul class="subnav">
- <li class="">
-
- <a class="" href="../FAQ/">FAQ</a>
- </li>
- <li class="">
-
- <a class="" href="../Community-&-Related-software/">Community & Related software</a>
- </li>
- </ul>
- </li>
-
- </ul>
- </div>
-
- </nav>
-
- <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
-
-
- <nav class="wy-nav-top" role="navigation" aria-label="top navigation">
- <i data-toggle="wy-nav-top" class="fa fa-bars"></i>
- <a href="..">Shaarli Documentation</a>
- </nav>
-
-
- <div class="wy-nav-content">
- <div class="rst-content">
- <div role="navigation" aria-label="breadcrumbs navigation">
- <ul class="wy-breadcrumbs">
- <li><a href="..">Docs</a> »</li>
-
-
-
- <li>How To »</li>
-
-
-
- <li>Create and serve multiple Shaarlis (farm)</li>
- <li class="wy-breadcrumbs-aside">
-
- <a href="https://github.com/shaarli/Shaarli/edit/master/docs/Create-and-serve-multiple-Shaarlis-(farm).md"
- class="icon icon-github"> Edit on GitHub</a>
-
- </li>
- </ul>
- <hr/>
-</div>
- <div role="main">
- <div class="section">
-
- <p>Example bash script (creates multiple shaarli instances and generates an HTML index of them)</p>
-<pre><code class="bash">#!/bin/bash
-set -o errexit
-set -o nounset
-
-#config
-shaarli_base_dir='/var/www/shaarli'
-accounts='bob john whatever username'
-shaarli_repo_url='https://github.com/shaarli/Shaarli'
-ref="master"
-
-#clone multiple shaarli instances
-if [ ! -d "$shaarli_base_dir" ]; then mkdir "$shaarli_base_dir"; fi
-
-for account in $accounts; do
- if [ -d "$shaarli_base_dir/$account" ];
- then echo "[info] account $account already exists, skipping";
- else echo "[info] creating new account $account ..."; git clone --quiet "$shaarli_repo_url" -b "$ref" "$shaarli_base_dir/$account"; fi
-done
-
-#generate html index of shaarlis
-htmlhead='<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
-<!-- Minimal html template thanks to http://www.sitepoint.com/a-minimal-html-document/ -->
-<html lang="en">
- <head>
- <meta http-equiv="content-type" content="text/html; charset=utf-8">
- <title>My Shaarli farm</title>
- <style>body {font-family: "Open Sans"}</style>
- </head>
- <body>
- <div>
- <h1>My Shaarli farm</h1>
- <ul style="list-style-type: none;">'
-
-accountlinks=''
-
-htmlfooter='
- </ul>
- </div>
- </body>
-</html>'
-
-
-
-for account in $accounts; do accountlinks="$accountlinks\n<li><a href=\"$account\">$account</a></li>"; done
-if [ -d "$shaarli_base_dir/index.html" ]; then echo "[removing old index.html]"; rm "$shaarli_base_dir/index.html" ]; fi
-echo "[info] generating new index of shaarlis"
-echo -e "$htmlhead $accountlinks $htmlfooter" > "$shaarli_base_dir/index.html"
-echo '[info] done.'
-echo "[info] list of accounts: $accounts"
-echo "[info] contents of $shaarli_base_dir:"
-tree -a -L 1 "$shaarli_base_dir"
-</code></pre>
-
-<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></p>
-
- </div>
- </div>
- <footer>
-
- <div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
-
- <a href="../Download-CSS-styles-from-an-OPML-list/" class="btn btn-neutral float-right" title="Download CSS styles from an OPML list">Next <span class="icon icon-circle-arrow-right"></span></a>
-
-
- <a href="../Copy-an-existing-installation-over-SSH-and-serve-it-locally/" class="btn btn-neutral" title="Copy an existing installation over SSH and serve it locally"><span class="icon icon-circle-arrow-left"></span> Previous</a>
-
- </div>
-
-
- <hr/>
-
- <div role="contentinfo">
- <!-- Copyright etc -->
-
- </div>
-
- Built with <a href="http://www.mkdocs.org">MkDocs</a> using a <a href="https://github.com/snide/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>.
-</footer>
-
- </div>
- </div>
-
- </section>
-
- </div>
-
- <div class="rst-versions" role="note" style="cursor: pointer">
- <span class="rst-current-version" data-toggle="rst-current-version">
-
- <a href="https://github.com/shaarli/Shaarli" class="fa fa-github" style="float: left; color: #fcfcfc"> GitHub</a>
-
-
- <span><a href="../Copy-an-existing-installation-over-SSH-and-serve-it-locally/" style="color: #fcfcfc;">« Previous</a></span>
-
-
- <span style="margin-left: 15px"><a href="../Download-CSS-styles-from-an-OPML-list/" style="color: #fcfcfc">Next »</a></span>
-
- </span>
-</div>
- <script src="../js/theme.js"></script>
-
-</body>
-</html>
</li>
<li class="">
- <a class="" href="../Copy-an-existing-installation-over-SSH-and-serve-it-locally/">Copy an existing installation over SSH and serve it locally</a>
- </li>
- <li class="">
-
- <a class="" href="../Create-and-serve-multiple-Shaarlis-(farm)/">Create and serve multiple Shaarlis (farm)</a>
- </li>
- <li class="">
-
- <a class="" href="../Download-CSS-styles-from-an-OPML-list/">Download CSS styles from an OPML list</a>
- </li>
- <li class="">
-
- <a class="" href="../Datastore-hacks/">Datastore hacks</a>
+ <a class="" href="../Various-hacks/">Various hacks</a>
</li>
</ul>
</li>
</li>
<li class="">
- <a class="" href="../Copy-an-existing-installation-over-SSH-and-serve-it-locally/">Copy an existing installation over SSH and serve it locally</a>
- </li>
- <li class="">
-
- <a class="" href="../Create-and-serve-multiple-Shaarlis-(farm)/">Create and serve multiple Shaarlis (farm)</a>
- </li>
- <li class="">
-
- <a class="" href="../Download-CSS-styles-from-an-OPML-list/">Download CSS styles from an OPML list</a>
- </li>
- <li class="">
-
- <a class="" href="../Datastore-hacks/">Datastore hacks</a>
+ <a class="" href="../Various-hacks/">Various hacks</a>
</li>
</ul>
</li>
</li>
<li class="">
- <a class="" href="../Copy-an-existing-installation-over-SSH-and-serve-it-locally/">Copy an existing installation over SSH and serve it locally</a>
- </li>
- <li class="">
-
- <a class="" href="../Create-and-serve-multiple-Shaarlis-(farm)/">Create and serve multiple Shaarlis (farm)</a>
- </li>
- <li class="">
-
- <a class="" href="../Download-CSS-styles-from-an-OPML-list/">Download CSS styles from an OPML list</a>
- </li>
- <li class="">
-
- <a class="" href="../Datastore-hacks/">Datastore hacks</a>
+ <a class="" href="../Various-hacks/">Various hacks</a>
</li>
</ul>
</li>
</li>
<li class="">
- <a class="" href="../Copy-an-existing-installation-over-SSH-and-serve-it-locally/">Copy an existing installation over SSH and serve it locally</a>
- </li>
- <li class="">
-
- <a class="" href="../Create-and-serve-multiple-Shaarlis-(farm)/">Create and serve multiple Shaarlis (farm)</a>
- </li>
- <li class="">
-
- <a class="" href="../Download-CSS-styles-from-an-OPML-list/">Download CSS styles from an OPML list</a>
- </li>
- <li class="">
-
- <a class="" href="../Datastore-hacks/">Datastore hacks</a>
+ <a class="" href="../Various-hacks/">Various hacks</a>
</li>
</ul>
</li>
+++ /dev/null
-<!DOCTYPE html>
-<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]-->
-<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]-->
-<head>
- <meta charset="utf-8">
- <meta http-equiv="X-UA-Compatible" content="IE=edge">
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
-
-
- <link rel="shortcut icon" href="../img/favicon.ico">
- <title>Download CSS styles from an OPML list - Shaarli Documentation</title>
- <link href='https://fonts.googleapis.com/css?family=Lato:400,700|Roboto+Slab:400,700|Inconsolata:400,700' rel='stylesheet' type='text/css'>
-
- <link rel="stylesheet" href="../css/theme.css" type="text/css" />
- <link rel="stylesheet" href="../css/theme_extra.css" type="text/css" />
- <link rel="stylesheet" href="../css/highlight.css">
- <link href="../github-markdown.css" rel="stylesheet">
-
- <script>
- // Current page data
- var mkdocs_page_name = "Download CSS styles from an OPML list";
- var mkdocs_page_input_path = "Download-CSS-styles-from-an-OPML-list.md";
- var mkdocs_page_url = "/Download-CSS-styles-from-an-OPML-list/";
- </script>
-
- <script src="../js/jquery-2.1.1.min.js"></script>
- <script src="../js/modernizr-2.8.3.min.js"></script>
- <script type="text/javascript" src="../js/highlight.pack.js"></script>
-
-</head>
-
-<body class="wy-body-for-nav" role="document">
-
- <div class="wy-grid-for-nav">
-
-
- <nav data-toggle="wy-nav-shift" class="wy-nav-side stickynav">
- <div class="wy-side-nav-search">
- <a href=".." class="icon icon-home"> Shaarli Documentation</a>
- <div role="search">
- <form id ="rtd-search-form" class="wy-form" action="../search.html" method="get">
- <input type="text" name="q" placeholder="Search docs" />
- </form>
-</div>
- </div>
-
- <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
- <ul class="current">
-
-
- <li class="toctree-l1">
-
- <a class="" href="..">Home</a>
- </li>
-
- <li class="toctree-l1">
-
- <span class="caption-text">Setup</span>
- <ul class="subnav">
- <li class="">
-
- <a class="" href="../Download-and-Installation/">Download and Installation</a>
- </li>
- <li class="">
-
- <a class="" href="../Upgrade-and-migration/">Upgrade and migration</a>
- </li>
- <li class="">
-
- <a class="" href="../Server-requirements/">Server requirements</a>
- </li>
- <li class="">
-
- <a class="" href="../Server-configuration/">Server configuration</a>
- </li>
- <li class="">
-
- <a class="" href="../Server-security/">Server security</a>
- </li>
- <li class="">
-
- <a class="" href="../Shaarli-configuration/">Shaarli configuration</a>
- </li>
- <li class="">
-
- <a class="" href="../Plugins/">Plugins</a>
- </li>
- </ul>
- </li>
-
- <li class="toctree-l1">
-
- <span class="caption-text">Docker</span>
- <ul class="subnav">
- <li class="">
-
- <a class="" href="../Docker-101/">Docker 101</a>
- </li>
- <li class="">
-
- <a class="" href="../Shaarli-images/">Shaarli images</a>
- </li>
- <li class="">
-
- <a class="" href="../Reverse-proxy-configuration/">Reverse proxy configuration</a>
- </li>
- <li class="">
-
- <a class="" href="../Docker-resources/">Docker resources</a>
- </li>
- </ul>
- </li>
-
- <li class="toctree-l1">
-
- <span class="caption-text">Usage</span>
- <ul class="subnav">
- <li class="">
-
- <a class="" href="../Features/">Features</a>
- </li>
- <li class="">
-
- <a class="" href="../Bookmarklet/">Bookmarklet</a>
- </li>
- <li class="">
-
- <a class="" href="../Browsing-and-searching/">Browsing and searching</a>
- </li>
- <li class="">
-
- <a class="" href="../Firefox-share/">Firefox share</a>
- </li>
- <li class="">
-
- <a class="" href="../RSS-feeds/">RSS feeds</a>
- </li>
- <li class="">
-
- <a class="" href="../REST-API/">REST API</a>
- </li>
- </ul>
- </li>
-
- <li class="toctree-l1">
-
- <span class="caption-text">How To</span>
- <ul class="subnav">
- <li class="">
-
- <a class="" href="../Backup,-restore,-import-and-export/">Backup, restore, import and export</a>
- </li>
- <li class="">
-
- <a class="" href="../Copy-an-existing-installation-over-SSH-and-serve-it-locally/">Copy an existing installation over SSH and serve it locally</a>
- </li>
- <li class="">
-
- <a class="" href="../Create-and-serve-multiple-Shaarlis-(farm)/">Create and serve multiple Shaarlis (farm)</a>
- </li>
- <li class=" current">
-
- <a class="current" href="./">Download CSS styles from an OPML list</a>
- <ul class="subnav">
-
- <li class="toctree-l3"><a href="#download-css-styles-for-shaarlis-listed-in-an-opml-file">Download CSS styles for shaarlis listed in an opml file</a></li>
-
-
- </ul>
- </li>
- <li class="">
-
- <a class="" href="../Datastore-hacks/">Datastore hacks</a>
- </li>
- </ul>
- </li>
-
- <li class="toctree-l1">
-
- <a class="" href="../Troubleshooting/">Troubleshooting</a>
- </li>
-
- <li class="toctree-l1">
-
- <span class="caption-text">Development</span>
- <ul class="subnav">
- <li class="">
-
- <a class="" href="../Development-guidelines/">Development guidelines</a>
- </li>
- <li class="">
-
- <a class="" href="../Continuous-integration-tools/">Continuous integration tools</a>
- </li>
- <li class="">
-
- <a class="" href="../GnuPG-signature/">GnuPG signature</a>
- </li>
- <li class="">
-
- <a class="" href="../Coding-guidelines/">Coding guidelines</a>
- </li>
- <li class="">
-
- <a class="" href="../Directory-structure/">Directory structure</a>
- </li>
- <li class="">
-
- <a class="" href="../3rd-party-libraries/">3rd party libraries</a>
- </li>
- <li class="">
-
- <a class="" href="../Plugin-System/">Plugin System</a>
- </li>
- <li class="">
-
- <a class="" href="../Release-Shaarli/">Release Shaarli</a>
- </li>
- <li class="">
-
- <a class="" href="../Versioning-and-Branches/">Versioning and Branches</a>
- </li>
- <li class="">
-
- <a class="" href="../Security/">Security</a>
- </li>
- <li class="">
-
- <a class="" href="../Static-analysis/">Static analysis</a>
- </li>
- <li class="">
-
- <a class="" href="../Theming/">Theming</a>
- </li>
- <li class="">
-
- <a class="" href="../Unit-tests/">Unit tests</a>
- </li>
- </ul>
- </li>
-
- <li class="toctree-l1">
-
- <span class="caption-text">About</span>
- <ul class="subnav">
- <li class="">
-
- <a class="" href="../FAQ/">FAQ</a>
- </li>
- <li class="">
-
- <a class="" href="../Community-&-Related-software/">Community & Related software</a>
- </li>
- </ul>
- </li>
-
- </ul>
- </div>
-
- </nav>
-
- <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
-
-
- <nav class="wy-nav-top" role="navigation" aria-label="top navigation">
- <i data-toggle="wy-nav-top" class="fa fa-bars"></i>
- <a href="..">Shaarli Documentation</a>
- </nav>
-
-
- <div class="wy-nav-content">
- <div class="rst-content">
- <div role="navigation" aria-label="breadcrumbs navigation">
- <ul class="wy-breadcrumbs">
- <li><a href="..">Docs</a> »</li>
-
-
-
- <li>How To »</li>
-
-
-
- <li>Download CSS styles from an OPML list</li>
- <li class="wy-breadcrumbs-aside">
-
- <a href="https://github.com/shaarli/Shaarli/edit/master/docs/Download-CSS-styles-from-an-OPML-list.md"
- class="icon icon-github"> Edit on GitHub</a>
-
- </li>
- </ul>
- <hr/>
-</div>
- <div role="main">
- <div class="section">
-
- <h3 id="download-css-styles-for-shaarlis-listed-in-an-opml-file">Download CSS styles for shaarlis listed in an opml file</h3>
-<p>Example php script:</p>
-<pre><code class="php"><!---- ?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);
-
-<!--- ? ---->
-</code></pre>
-
- </div>
- </div>
- <footer>
-
- <div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
-
- <a href="../Datastore-hacks/" class="btn btn-neutral float-right" title="Datastore hacks">Next <span class="icon icon-circle-arrow-right"></span></a>
-
-
- <a href="../Create-and-serve-multiple-Shaarlis-(farm)/" class="btn btn-neutral" title="Create and serve multiple Shaarlis (farm)"><span class="icon icon-circle-arrow-left"></span> Previous</a>
-
- </div>
-
-
- <hr/>
-
- <div role="contentinfo">
- <!-- Copyright etc -->
-
- </div>
-
- Built with <a href="http://www.mkdocs.org">MkDocs</a> using a <a href="https://github.com/snide/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>.
-</footer>
-
- </div>
- </div>
-
- </section>
-
- </div>
-
- <div class="rst-versions" role="note" style="cursor: pointer">
- <span class="rst-current-version" data-toggle="rst-current-version">
-
- <a href="https://github.com/shaarli/Shaarli" class="fa fa-github" style="float: left; color: #fcfcfc"> GitHub</a>
-
-
- <span><a href="../Create-and-serve-multiple-Shaarlis-(farm)/" style="color: #fcfcfc;">« Previous</a></span>
-
-
- <span style="margin-left: 15px"><a href="../Datastore-hacks/" style="color: #fcfcfc">Next »</a></span>
-
- </span>
-</div>
- <script src="../js/theme.js"></script>
-
-</body>
-</html>
</li>
<li class="">
- <a class="" href="../Copy-an-existing-installation-over-SSH-and-serve-it-locally/">Copy an existing installation over SSH and serve it locally</a>
- </li>
- <li class="">
-
- <a class="" href="../Create-and-serve-multiple-Shaarlis-(farm)/">Create and serve multiple Shaarlis (farm)</a>
- </li>
- <li class="">
-
- <a class="" href="../Download-CSS-styles-from-an-OPML-list/">Download CSS styles from an OPML list</a>
- </li>
- <li class="">
-
- <a class="" href="../Datastore-hacks/">Datastore hacks</a>
+ <a class="" href="../Various-hacks/">Various hacks</a>
</li>
</ul>
</li>
</li>
<li class="">
- <a class="" href="../Copy-an-existing-installation-over-SSH-and-serve-it-locally/">Copy an existing installation over SSH and serve it locally</a>
- </li>
- <li class="">
-
- <a class="" href="../Create-and-serve-multiple-Shaarlis-(farm)/">Create and serve multiple Shaarlis (farm)</a>
- </li>
- <li class="">
-
- <a class="" href="../Download-CSS-styles-from-an-OPML-list/">Download CSS styles from an OPML list</a>
- </li>
- <li class="">
-
- <a class="" href="../Datastore-hacks/">Datastore hacks</a>
+ <a class="" href="../Various-hacks/">Various hacks</a>
</li>
</ul>
</li>
</li>
<li class="">
- <a class="" href="../Copy-an-existing-installation-over-SSH-and-serve-it-locally/">Copy an existing installation over SSH and serve it locally</a>
- </li>
- <li class="">
-
- <a class="" href="../Create-and-serve-multiple-Shaarlis-(farm)/">Create and serve multiple Shaarlis (farm)</a>
- </li>
- <li class="">
-
- <a class="" href="../Download-CSS-styles-from-an-OPML-list/">Download CSS styles from an OPML list</a>
- </li>
- <li class="">
-
- <a class="" href="../Datastore-hacks/">Datastore hacks</a>
+ <a class="" href="../Various-hacks/">Various hacks</a>
</li>
</ul>
</li>
</li>
<li class="">
- <a class="" href="../Copy-an-existing-installation-over-SSH-and-serve-it-locally/">Copy an existing installation over SSH and serve it locally</a>
- </li>
- <li class="">
-
- <a class="" href="../Create-and-serve-multiple-Shaarlis-(farm)/">Create and serve multiple Shaarlis (farm)</a>
- </li>
- <li class="">
-
- <a class="" href="../Download-CSS-styles-from-an-OPML-list/">Download CSS styles from an OPML list</a>
- </li>
- <li class="">
-
- <a class="" href="../Datastore-hacks/">Datastore hacks</a>
+ <a class="" href="../Various-hacks/">Various hacks</a>
</li>
</ul>
</li>
</li>
<li class="">
- <a class="" href="../Copy-an-existing-installation-over-SSH-and-serve-it-locally/">Copy an existing installation over SSH and serve it locally</a>
- </li>
- <li class="">
-
- <a class="" href="../Create-and-serve-multiple-Shaarlis-(farm)/">Create and serve multiple Shaarlis (farm)</a>
- </li>
- <li class="">
-
- <a class="" href="../Download-CSS-styles-from-an-OPML-list/">Download CSS styles from an OPML list</a>
- </li>
- <li class="">
-
- <a class="" href="../Datastore-hacks/">Datastore hacks</a>
+ <a class="" href="../Various-hacks/">Various hacks</a>
</li>
</ul>
</li>
</li>
<li class="">
- <a class="" href="../Copy-an-existing-installation-over-SSH-and-serve-it-locally/">Copy an existing installation over SSH and serve it locally</a>
- </li>
- <li class="">
-
- <a class="" href="../Create-and-serve-multiple-Shaarlis-(farm)/">Create and serve multiple Shaarlis (farm)</a>
- </li>
- <li class="">
-
- <a class="" href="../Download-CSS-styles-from-an-OPML-list/">Download CSS styles from an OPML list</a>
- </li>
- <li class="">
-
- <a class="" href="../Datastore-hacks/">Datastore hacks</a>
+ <a class="" href="../Various-hacks/">Various hacks</a>
</li>
</ul>
</li>
</li>
<li class="">
- <a class="" href="../Copy-an-existing-installation-over-SSH-and-serve-it-locally/">Copy an existing installation over SSH and serve it locally</a>
- </li>
- <li class="">
-
- <a class="" href="../Create-and-serve-multiple-Shaarlis-(farm)/">Create and serve multiple Shaarlis (farm)</a>
- </li>
- <li class="">
-
- <a class="" href="../Download-CSS-styles-from-an-OPML-list/">Download CSS styles from an OPML list</a>
- </li>
- <li class="">
-
- <a class="" href="../Datastore-hacks/">Datastore hacks</a>
+ <a class="" href="../Various-hacks/">Various hacks</a>
</li>
</ul>
</li>
</li>
<li class="">
- <a class="" href="../Copy-an-existing-installation-over-SSH-and-serve-it-locally/">Copy an existing installation over SSH and serve it locally</a>
- </li>
- <li class="">
-
- <a class="" href="../Create-and-serve-multiple-Shaarlis-(farm)/">Create and serve multiple Shaarlis (farm)</a>
- </li>
- <li class="">
-
- <a class="" href="../Download-CSS-styles-from-an-OPML-list/">Download CSS styles from an OPML list</a>
- </li>
- <li class="">
-
- <a class="" href="../Datastore-hacks/">Datastore hacks</a>
+ <a class="" href="../Various-hacks/">Various hacks</a>
</li>
</ul>
</li>
</li>
<li class="">
- <a class="" href="../Copy-an-existing-installation-over-SSH-and-serve-it-locally/">Copy an existing installation over SSH and serve it locally</a>
- </li>
- <li class="">
-
- <a class="" href="../Create-and-serve-multiple-Shaarlis-(farm)/">Create and serve multiple Shaarlis (farm)</a>
- </li>
- <li class="">
-
- <a class="" href="../Download-CSS-styles-from-an-OPML-list/">Download CSS styles from an OPML list</a>
- </li>
- <li class="">
-
- <a class="" href="../Datastore-hacks/">Datastore hacks</a>
+ <a class="" href="../Various-hacks/">Various hacks</a>
</li>
</ul>
</li>
</li>
<li class="">
- <a class="" href="../Copy-an-existing-installation-over-SSH-and-serve-it-locally/">Copy an existing installation over SSH and serve it locally</a>
- </li>
- <li class="">
-
- <a class="" href="../Create-and-serve-multiple-Shaarlis-(farm)/">Create and serve multiple Shaarlis (farm)</a>
- </li>
- <li class="">
-
- <a class="" href="../Download-CSS-styles-from-an-OPML-list/">Download CSS styles from an OPML list</a>
- </li>
- <li class="">
-
- <a class="" href="../Datastore-hacks/">Datastore hacks</a>
+ <a class="" href="../Various-hacks/">Various hacks</a>
</li>
</ul>
</li>
</li>
<li class="">
- <a class="" href="../Copy-an-existing-installation-over-SSH-and-serve-it-locally/">Copy an existing installation over SSH and serve it locally</a>
- </li>
- <li class="">
-
- <a class="" href="../Create-and-serve-multiple-Shaarlis-(farm)/">Create and serve multiple Shaarlis (farm)</a>
- </li>
- <li class="">
-
- <a class="" href="../Download-CSS-styles-from-an-OPML-list/">Download CSS styles from an OPML list</a>
- </li>
- <li class="">
-
- <a class="" href="../Datastore-hacks/">Datastore hacks</a>
+ <a class="" href="../Various-hacks/">Various hacks</a>
</li>
</ul>
</li>
</li>
<li class="">
- <a class="" href="../Copy-an-existing-installation-over-SSH-and-serve-it-locally/">Copy an existing installation over SSH and serve it locally</a>
- </li>
- <li class="">
-
- <a class="" href="../Create-and-serve-multiple-Shaarlis-(farm)/">Create and serve multiple Shaarlis (farm)</a>
- </li>
- <li class="">
-
- <a class="" href="../Download-CSS-styles-from-an-OPML-list/">Download CSS styles from an OPML list</a>
- </li>
- <li class="">
-
- <a class="" href="../Datastore-hacks/">Datastore hacks</a>
+ <a class="" href="../Various-hacks/">Various hacks</a>
</li>
</ul>
</li>
</li>
<li class="">
- <a class="" href="../Copy-an-existing-installation-over-SSH-and-serve-it-locally/">Copy an existing installation over SSH and serve it locally</a>
- </li>
- <li class="">
-
- <a class="" href="../Create-and-serve-multiple-Shaarlis-(farm)/">Create and serve multiple Shaarlis (farm)</a>
- </li>
- <li class="">
-
- <a class="" href="../Download-CSS-styles-from-an-OPML-list/">Download CSS styles from an OPML list</a>
- </li>
- <li class="">
-
- <a class="" href="../Datastore-hacks/">Datastore hacks</a>
+ <a class="" href="../Various-hacks/">Various hacks</a>
</li>
</ul>
</li>
</li>
<li class="">
- <a class="" href="../Copy-an-existing-installation-over-SSH-and-serve-it-locally/">Copy an existing installation over SSH and serve it locally</a>
- </li>
- <li class="">
-
- <a class="" href="../Create-and-serve-multiple-Shaarlis-(farm)/">Create and serve multiple Shaarlis (farm)</a>
- </li>
- <li class="">
-
- <a class="" href="../Download-CSS-styles-from-an-OPML-list/">Download CSS styles from an OPML list</a>
- </li>
- <li class="">
-
- <a class="" href="../Datastore-hacks/">Datastore hacks</a>
+ <a class="" href="../Various-hacks/">Various hacks</a>
</li>
</ul>
</li>
</li>
<li class="">
- <a class="" href="../Copy-an-existing-installation-over-SSH-and-serve-it-locally/">Copy an existing installation over SSH and serve it locally</a>
- </li>
- <li class="">
-
- <a class="" href="../Create-and-serve-multiple-Shaarlis-(farm)/">Create and serve multiple Shaarlis (farm)</a>
- </li>
- <li class="">
-
- <a class="" href="../Download-CSS-styles-from-an-OPML-list/">Download CSS styles from an OPML list</a>
- </li>
- <li class="">
-
- <a class="" href="../Datastore-hacks/">Datastore hacks</a>
+ <a class="" href="../Various-hacks/">Various hacks</a>
</li>
</ul>
</li>
</li>
<li class="">
- <a class="" href="../Copy-an-existing-installation-over-SSH-and-serve-it-locally/">Copy an existing installation over SSH and serve it locally</a>
- </li>
- <li class="">
-
- <a class="" href="../Create-and-serve-multiple-Shaarlis-(farm)/">Create and serve multiple Shaarlis (farm)</a>
- </li>
- <li class="">
-
- <a class="" href="../Download-CSS-styles-from-an-OPML-list/">Download CSS styles from an OPML list</a>
- </li>
- <li class="">
-
- <a class="" href="../Datastore-hacks/">Datastore hacks</a>
+ <a class="" href="../Various-hacks/">Various hacks</a>
</li>
</ul>
</li>
</li>
<li class="">
- <a class="" href="../Copy-an-existing-installation-over-SSH-and-serve-it-locally/">Copy an existing installation over SSH and serve it locally</a>
- </li>
- <li class="">
-
- <a class="" href="../Create-and-serve-multiple-Shaarlis-(farm)/">Create and serve multiple Shaarlis (farm)</a>
- </li>
- <li class="">
-
- <a class="" href="../Download-CSS-styles-from-an-OPML-list/">Download CSS styles from an OPML list</a>
- </li>
- <li class="">
-
- <a class="" href="../Datastore-hacks/">Datastore hacks</a>
+ <a class="" href="../Various-hacks/">Various hacks</a>
</li>
</ul>
</li>
</li>
<li class="">
- <a class="" href="../Copy-an-existing-installation-over-SSH-and-serve-it-locally/">Copy an existing installation over SSH and serve it locally</a>
- </li>
- <li class="">
-
- <a class="" href="../Create-and-serve-multiple-Shaarlis-(farm)/">Create and serve multiple Shaarlis (farm)</a>
- </li>
- <li class="">
-
- <a class="" href="../Download-CSS-styles-from-an-OPML-list/">Download CSS styles from an OPML list</a>
- </li>
- <li class="">
-
- <a class="" href="../Datastore-hacks/">Datastore hacks</a>
+ <a class="" href="../Various-hacks/">Various hacks</a>
</li>
</ul>
</li>
</li>
<li class="">
- <a class="" href="../Copy-an-existing-installation-over-SSH-and-serve-it-locally/">Copy an existing installation over SSH and serve it locally</a>
- </li>
- <li class="">
-
- <a class="" href="../Create-and-serve-multiple-Shaarlis-(farm)/">Create and serve multiple Shaarlis (farm)</a>
- </li>
- <li class="">
-
- <a class="" href="../Download-CSS-styles-from-an-OPML-list/">Download CSS styles from an OPML list</a>
- </li>
- <li class="">
-
- <a class="" href="../Datastore-hacks/">Datastore hacks</a>
+ <a class="" href="../Various-hacks/">Various hacks</a>
</li>
</ul>
</li>
</li>
<li class="">
- <a class="" href="../Copy-an-existing-installation-over-SSH-and-serve-it-locally/">Copy an existing installation over SSH and serve it locally</a>
- </li>
- <li class="">
-
- <a class="" href="../Create-and-serve-multiple-Shaarlis-(farm)/">Create and serve multiple Shaarlis (farm)</a>
- </li>
- <li class="">
-
- <a class="" href="../Download-CSS-styles-from-an-OPML-list/">Download CSS styles from an OPML list</a>
- </li>
- <li class="">
-
- <a class="" href="../Datastore-hacks/">Datastore hacks</a>
+ <a class="" href="../Various-hacks/">Various hacks</a>
</li>
</ul>
</li>
<a href="../Development-guidelines/" class="btn btn-neutral float-right" title="Development guidelines">Next <span class="icon icon-circle-arrow-right"></span></a>
- <a href="../Datastore-hacks/" class="btn btn-neutral" title="Datastore hacks"><span class="icon icon-circle-arrow-left"></span> Previous</a>
+ <a href="../Various-hacks/" class="btn btn-neutral" title="Various hacks"><span class="icon icon-circle-arrow-left"></span> Previous</a>
</div>
<a href="https://github.com/shaarli/Shaarli" class="fa fa-github" style="float: left; color: #fcfcfc"> GitHub</a>
- <span><a href="../Datastore-hacks/" style="color: #fcfcfc;">« Previous</a></span>
+ <span><a href="../Various-hacks/" style="color: #fcfcfc;">« Previous</a></span>
<span style="margin-left: 15px"><a href="../Development-guidelines/" style="color: #fcfcfc">Next »</a></span>
</li>
<li class="">
- <a class="" href="../Copy-an-existing-installation-over-SSH-and-serve-it-locally/">Copy an existing installation over SSH and serve it locally</a>
- </li>
- <li class="">
-
- <a class="" href="../Create-and-serve-multiple-Shaarlis-(farm)/">Create and serve multiple Shaarlis (farm)</a>
- </li>
- <li class="">
-
- <a class="" href="../Download-CSS-styles-from-an-OPML-list/">Download CSS styles from an OPML list</a>
- </li>
- <li class="">
-
- <a class="" href="../Datastore-hacks/">Datastore hacks</a>
+ <a class="" href="../Various-hacks/">Various hacks</a>
</li>
</ul>
</li>
</li>
<li class="">
- <a class="" href="../Copy-an-existing-installation-over-SSH-and-serve-it-locally/">Copy an existing installation over SSH and serve it locally</a>
- </li>
- <li class="">
-
- <a class="" href="../Create-and-serve-multiple-Shaarlis-(farm)/">Create and serve multiple Shaarlis (farm)</a>
- </li>
- <li class="">
-
- <a class="" href="../Download-CSS-styles-from-an-OPML-list/">Download CSS styles from an OPML list</a>
- </li>
- <li class="">
-
- <a class="" href="../Datastore-hacks/">Datastore hacks</a>
+ <a class="" href="../Various-hacks/">Various hacks</a>
</li>
</ul>
</li>
<link rel="shortcut icon" href="../img/favicon.ico">
- <title>Datastore hacks - Shaarli Documentation</title>
+ <title>Various hacks - Shaarli Documentation</title>
<link href='https://fonts.googleapis.com/css?family=Lato:400,700|Roboto+Slab:400,700|Inconsolata:400,700' rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="../css/theme.css" type="text/css" />
<script>
// Current page data
- var mkdocs_page_name = "Datastore hacks";
- var mkdocs_page_input_path = "Datastore-hacks.md";
- var mkdocs_page_url = "/Datastore-hacks/";
+ var mkdocs_page_name = "Various hacks";
+ var mkdocs_page_input_path = "Various-hacks.md";
+ var mkdocs_page_url = "/Various-hacks/";
</script>
<script src="../js/jquery-2.1.1.min.js"></script>
<li class="">
<a class="" href="../Backup,-restore,-import-and-export/">Backup, restore, import and export</a>
- </li>
- <li class="">
-
- <a class="" href="../Copy-an-existing-installation-over-SSH-and-serve-it-locally/">Copy an existing installation over SSH and serve it locally</a>
- </li>
- <li class="">
-
- <a class="" href="../Create-and-serve-multiple-Shaarlis-(farm)/">Create and serve multiple Shaarlis (farm)</a>
- </li>
- <li class="">
-
- <a class="" href="../Download-CSS-styles-from-an-OPML-list/">Download CSS styles from an OPML list</a>
</li>
<li class=" current">
- <a class="current" href="./">Datastore hacks</a>
+ <a class="current" href="./">Various hacks</a>
<ul class="subnav">
<li class="toctree-l3"><a href="#decode-datastore-content">Decode datastore content</a></li>
- <li class="toctree-l3"><a href="#changing-the-timestamp-for-a-link">Changing the timestamp for a link</a></li>
+ <li class="toctree-l3"><a href="#changing-the-timestamp-for-a-shaare">Changing the timestamp for a shaare</a></li>
+
+
+ <li class="toctree-l3"><a href="#see-also">See also</a></li>
</ul>
- <li>Datastore hacks</li>
+ <li>Various hacks</li>
<li class="wy-breadcrumbs-aside">
- <a href="https://github.com/shaarli/Shaarli/edit/master/docs/Datastore-hacks.md"
+ <a href="https://github.com/shaarli/Shaarli/edit/master/docs/Various-hacks.md"
class="icon icon-github"> Edit on GitHub</a>
</li>
<pre><code>php -r 'print(json_encode(unserialize(gzinflate(base64_decode(preg_replace("!.*/\* (.+) \*/.*!", "$1", file_get_contents("data/datastore.php")))))));' | jq .
</code></pre>
-<h3 id="changing-the-timestamp-for-a-link">Changing the timestamp for a link</h3>
+<h3 id="changing-the-timestamp-for-a-shaare">Changing the timestamp for a shaare</h3>
<ul>
<li>Look for <code><input type="hidden" name="lf_linkdate" value="{$link.linkdate}"></code> in <code>tpl/editlink.tpl</code> (line 14)</li>
<li>Replace <code>type="hidden"</code> with <code>type="text"</code> from this line</li>
<li>A new date/time field becomes available in the edit/new link dialog.</li>
<li>You can set the timestamp manually by entering it in the format <code>YYYMMDD_HHMMS</code>.</li>
+</ul>
+<h3 id="see-also">See also</h3>
+<ul>
+<li><a href="https://gist.github.com/nodiscc/8b0194921f059d7b9ad89a581ecd482c">Add a new custom field to shaares (example patch)</a></li>
+<li><a href="https://gist.github.com/nodiscc/dede231c92cab22c3ad2cc24d5035012">Download CSS styles for shaarlis listed in an opml file</a></li>
+<li><a href="https://gist.github.com/nodiscc/ed161c66e5b028b5299b0a3733d01c77">Copy an existing Shaarli installation over SSH, and serve it locally</a></li>
+<li><a href="https://gist.github.com/nodiscc/52e711cda3bc47717c16065231cf6b20">Create multiple Shaarli instances, generate an HTML index of them</a></li>
</ul>
</div>
<a href="../Troubleshooting/" class="btn btn-neutral float-right" title="Troubleshooting">Next <span class="icon icon-circle-arrow-right"></span></a>
- <a href="../Download-CSS-styles-from-an-OPML-list/" class="btn btn-neutral" title="Download CSS styles from an OPML list"><span class="icon icon-circle-arrow-left"></span> Previous</a>
+ <a href="../Backup,-restore,-import-and-export/" class="btn btn-neutral" title="Backup, restore, import and export"><span class="icon icon-circle-arrow-left"></span> Previous</a>
</div>
<a href="https://github.com/shaarli/Shaarli" class="fa fa-github" style="float: left; color: #fcfcfc"> GitHub</a>
- <span><a href="../Download-CSS-styles-from-an-OPML-list/" style="color: #fcfcfc;">« Previous</a></span>
+ <span><a href="../Backup,-restore,-import-and-export/" style="color: #fcfcfc;">« Previous</a></span>
<span style="margin-left: 15px"><a href="../Troubleshooting/" style="color: #fcfcfc">Next »</a></span>
</li>
<li class="">
- <a class="" href="../Copy-an-existing-installation-over-SSH-and-serve-it-locally/">Copy an existing installation over SSH and serve it locally</a>
- </li>
- <li class="">
-
- <a class="" href="../Create-and-serve-multiple-Shaarlis-(farm)/">Create and serve multiple Shaarlis (farm)</a>
- </li>
- <li class="">
-
- <a class="" href="../Download-CSS-styles-from-an-OPML-list/">Download CSS styles from an OPML list</a>
- </li>
- <li class="">
-
- <a class="" href="../Datastore-hacks/">Datastore hacks</a>
+ <a class="" href="../Various-hacks/">Various hacks</a>
</li>
</ul>
</li>
</li>
<li class="">
- <a class="" href="Copy-an-existing-installation-over-SSH-and-serve-it-locally/">Copy an existing installation over SSH and serve it locally</a>
- </li>
- <li class="">
-
- <a class="" href="Create-and-serve-multiple-Shaarlis-(farm)/">Create and serve multiple Shaarlis (farm)</a>
- </li>
- <li class="">
-
- <a class="" href="Download-CSS-styles-from-an-OPML-list/">Download CSS styles from an OPML list</a>
- </li>
- <li class="">
-
- <a class="" href="Datastore-hacks/">Datastore hacks</a>
+ <a class="" href="Various-hacks/">Various hacks</a>
</li>
</ul>
</li>
<!--
MkDocs version : 0.16.3
-Build Date UTC : 2017-06-17 22:04:25
+Build Date UTC : 2017-06-18 04:31:25
-->
"title": "Import Shaarli links to Firefox"
},
{
- "location": "/Copy-an-existing-installation-over-SSH-and-serve-it-locally/",
- "text": "Example bash script:\n\n\n#!/bin/bash\n#Description: Copy a Shaarli installation over SSH/SCP, serve it locally with php-cli\n#Will create a local-shaarli/ directory when you run it, backup your Shaarli there, and serve it locally.\n#Will NOT download linked pages. It's just a directly usable backup/copy/mirror of your Shaarli\n#Requires: ssh, scp and a working SSH access to the server where your Shaarli is installed\n#Usage: ./local-shaarli.sh\n#Author: nodiscc (nodiscc@gmail.com)\n#License: MIT (http://opensource.org/licenses/MIT)\nset -o errexit\nset -o nounset\n\n##### CONFIG #################\n#The port used by php's local server\nphp_local_port=7431\n\n#Name of the SSH server and path where Shaarli is installed\n#TODO: pass these as command-line arguments\nremotehost=\"my.ssh.server\"\nremote_shaarli_dir=\"/var/www/shaarli\"\n\n\n###### FUNCTIONS #############\n_main() {\n _CBSyncShaarli\n _CBServeShaarli\n}\n\n_CBSyncShaarli() {\n remote_temp_dir=$(ssh $remotehost mktemp -d)\n remote_ssh_user=$(ssh $remotehost whoami)\n ssh -t \"$remotehost\" sudo cp -r \"$remote_shaarli_dir\" \"$remote_temp_dir\"\n ssh -t \"$remotehost\" sudo chown -R \"$remote_ssh_user\":\"$remote_ssh_user\" \"$remote_temp_dir\"\n scp -rq \"$remotehost\":\"$remote_temp_dir\" local-shaarli\n ssh \"$remotehost\" rm -r \"$remote_temp_dir\"\n}\n\n_CBServeShaarli() {\n #TODO: allow serving a previously downloaded Shaarli\n #TODO: ask before overwriting local copy, if it exists\n cd local-shaarli/\n php -S localhost:${php_local_port}\n echo \"Please go to http://localhost:${php_local_port}\"\n}\n\n\n##### MAIN #################\n\n_main\n\n\n\n\nThis outputs:\n\n\n$ ./local-shaarli.sh\nPHP 5.6.0RC4 Development Server started at Mon Sep 1 21:56:19 2014\nListening on http://localhost:7431\nDocument root is /home/user/local-shaarli/shaarli\nPress Ctrl-C to quit.\n\n[Mon Sep 1 21:56:27 2014] ::1:57868 [200]: /\n[Mon Sep 1 21:56:27 2014] ::1:57869 [200]: /index.html\n[Mon Sep 1 21:56:37 2014] ::1:57881 [200]: /...",
- "title": "Copy an existing installation over SSH and serve it locally"
+ "location": "/Various-hacks/",
+ "text": "Decode datastore content\n\n\nTo display the array representing the data saved in \ndata/datastore.php\n, use the following snippet:\n\n\n$data = \"tZNdb9MwFIb... <Commented content inside datastore.php>\";\n$out = unserialize(gzinflate(base64_decode($data)));\necho \"<pre>\"; // Pretty printing is love, pretty printing is life\nprint_r($out);\necho \"</pre>\";\nexit;\n\n\n\n\nThis will output the internal representation of the datastore, \"unobfuscated\" (if this can really be considered obfuscation).\n\n\nAlternatively, you can transform to JSON format (and pretty-print if you have \njq\n installed):\n\n\nphp -r 'print(json_encode(unserialize(gzinflate(base64_decode(preg_replace(\"!.*/\\* (.+) \\*/.*!\", \"$1\", file_get_contents(\"data/datastore.php\")))))));' | jq .\n\n\n\n\nChanging the timestamp for a shaare\n\n\n\n\nLook for \n<input type=\"hidden\" name=\"lf_linkdate\" value=\"{$link.linkdate}\">\n in \ntpl/editlink.tpl\n (line 14)\n\n\nReplace \ntype=\"hidden\"\n with \ntype=\"text\"\n from this line\n\n\nA new date/time field becomes available in the edit/new link dialog.\n\n\nYou can set the timestamp manually by entering it in the format \nYYYMMDD_HHMMS\n.\n\n\n\n\nSee also\n\n\n\n\nAdd a new custom field to shaares (example patch)\n\n\nDownload CSS styles for shaarlis listed in an opml file\n\n\nCopy an existing Shaarli installation over SSH, and serve it locally\n\n\nCreate multiple Shaarli instances, generate an HTML index of them",
+ "title": "Various hacks"
},
{
- "location": "/Create-and-serve-multiple-Shaarlis-(farm)/",
- "text": "Example bash script (creates multiple shaarli instances and generates an HTML index of them)\n\n\n#!/bin/bash\nset -o errexit\nset -o nounset\n\n#config\nshaarli_base_dir='/var/www/shaarli'\naccounts='bob john whatever username'\nshaarli_repo_url='https://github.com/shaarli/Shaarli'\nref=\"master\"\n\n#clone multiple shaarli instances\nif [ ! -d \"$shaarli_base_dir\" ]; then mkdir \"$shaarli_base_dir\"; fi\n\nfor account in $accounts; do\n if [ -d \"$shaarli_base_dir/$account\" ];\n then echo \"[info] account $account already exists, skipping\";\n else echo \"[info] creating new account $account ...\"; git clone --quiet \"$shaarli_repo_url\" -b \"$ref\" \"$shaarli_base_dir/$account\"; fi\ndone\n\n#generate html index of shaarlis\nhtmlhead='<!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 4.01//EN\" \"http://www.w3.org/TR/html4/strict.dtd\">\n<!-- Minimal html template thanks to http://www.sitepoint.com/a-minimal-html-document/ -->\n<html lang=\"en\">\n <head>\n <meta http-equiv=\"content-type\" content=\"text/html; charset=utf-8\">\n <title>My Shaarli farm</title>\n <style>body {font-family: \"Open Sans\"}</style>\n </head>\n <body>\n <div>\n <h1>My Shaarli farm</h1>\n <ul style=\"list-style-type: none;\">'\n\naccountlinks=''\n\nhtmlfooter='\n </ul>\n </div>\n </body>\n</html>' \n\n\n\nfor account in $accounts; do accountlinks=\"$accountlinks\\n<li><a href=\\\"$account\\\">$account</a></li>\"; done\nif [ -d \"$shaarli_base_dir/index.html\" ]; then echo \"[removing old index.html]\"; rm \"$shaarli_base_dir/index.html\" ]; fi\necho \"[info] generating new index of shaarlis\"\necho -e \"$htmlhead $accountlinks $htmlfooter\" > \"$shaarli_base_dir/index.html\"\necho '[info] done.'\necho \"[info] list of accounts: $accounts\"\necho \"[info] contents of $shaarli_base_dir:\"\ntree -a -L 1 \"$shaarli_base_dir\"\n\n\n\n\nThis script just serves as an example. More precise or complex (applying custom configuration, etc) automation is possible using configuration management software like \nAnsible",
- "title": "Create and serve multiple Shaarlis (farm)"
- },
- {
- "location": "/Download-CSS-styles-from-an-OPML-list/",
- "text": "Download CSS styles for shaarlis listed in an opml file\n\n\nExample php script:\n\n\n<!---- ?php -->\n<!---- Copyright (c) 2014 Nicolas Delsaux (https://github.com/Riduidel) -->\n<!---- License: zlib (http://www.gzip.org/zlib/zlib_license.html) -->\n\n/**\n * Source: https://github.com/Riduidel\n * Download css styles for shaarlis listed in an opml file\n */\ndefine(\"SHAARLI_RSS_OPML\", \"https://www.ecirtam.net/shaarlirss/custom/people.opml\");\n\ndefine(\"THEMES_TEMP_FOLDER\", \"new_themes\");\n\nif(!file_exists(THEMES_TEMP_FOLDER)) {\n mkdir(THEMES_TEMP_FOLDER);\n}\n\nfunction siteUrl($pathInSite) {\n $indexPos = strpos($pathInSite, \"index.php\");\n if(!$indexPos) {\n return $pathInSite;\n } else {\n return substr($pathInSite, 0, $indexPos);\n }\n}\n\nfunction createShaarliHashFromOPMLL($opmlFile) {\n $result = array();\n $opml = file_get_contents($opmlFile);\n $opmlXml = simplexml_load_string($opml);\n $outlineElements = $opmlXml->xpath(\"body/outline\");\n foreach($outlineElements as $site) {\n $siteUrl = siteUrl((string) $site['htmlUrl']);\n $result[$siteUrl]=((string) $site['text']);\n }\n return $result;\n}\n\nfunction getSiteFolder($url) {\n $domain = parse_url($url, PHP_URL_HOST);\n return THEMES_TEMP_FOLDER.\"/\".str_replace(\".\", \"_\", $domain);\n}\n\nfunction get_http_response_code($theURL) {\n $headers = get_headers($theURL);\n return substr($headers[0], 9, 3);\n}\n\n/**\n * This makes the code PHP-5 only (particularly the call to \"get_headers\")\n */\nfunction copyUserStyleFrom($url, $name, $knownStyles) {\n $userStyle = $url.\"inc/user.css\";\n if(in_array($url, $knownStyles)) {\n // TODO add log message\n } else {\n $statusCode = get_http_response_code($userStyle);\n if(intval($statusCode)<300) {\n $styleSheet = file_get_contents($userStyle);\n $siteFolder = getSiteFolder($url);\n if(!file_exists($siteFolder)) {\n mkdir($siteFolder);\n }\n if(!file_exists($siteFolder.'/user.css')) {\n // Copy stylesheet\n file_put_contents($siteFolder.'/user.css', $styleSheet);\n }\n if(!file_exists($siteFolder.'/README.md')) {\n // Then write a readme.md file\n file_put_contents($siteFolder.'/README.md', \n \"User style from \".$name.\"\\n\"\n .\"=============================\"\n .\"\\n\\n\"\n .\"This stylesheet was downloaded from \".$userStyle.\" on \".date(DATE_RFC822)\n );\n }\n if(!file_exists($siteFolder.'/config.ini')) {\n // Write a config file containing useful informations\n file_put_contents($siteFolder.'/config.ini', \n \"site_url=\".$url.\"\\n\"\n .\"site_name=\".$name.\"\\n\"\n );\n }\n if(!file_exists($siteFolder.'/home.png')) {\n // And finally copy generated thumbnail\n $homeThumb = $siteFolder.'/home.png';\n file_put_contents($siteFolder.'/home.png', file_get_contents(getThumbnailUrl($url)));\n }\n echo 'Theme have been downloaded from <a href=\"'.$url.'\">'.$url.'</a> into '.$siteFolder\n .'. It looks like <img src=\"'.$homeThumb.'\"><br/>';\n }\n }\n}\n\nfunction getThumbnailUrl($url) {\n return 'http://api.webthumbnail.org/?url='.$url;\n}\n\nfunction copyUserStylesFrom($urlToNames, $knownStyles) {\n foreach($urlToNames as $url => $name) {\n copyUserStyleFrom($url, $name, $knownStyles);\n }\n}\n\n/**\n * Reading directory list, courtesy of http://www.laughing-buddha.net/php/dirlist/\n * @param directory the directory we want to list files of\n * @return a simple array containing the list of absolute file paths. Notice that current file (\".\") and parent one(\"..\")\n * are not listed here\n */\nfunction getDirectoryList ($directory) {\n $realPath = realpath($directory);\n // create an array to hold directory list\n $results = array();\n // create a handler for the directory\n $handler = opendir($directory);\n // open directory and walk through the filenames\n while ($file = readdir($handler)) {\n // if file isn't this directory or its parent, add it to the results\n if ($file != \".\" && $file != \"..\") {\n $results[] = realpath($realPath . \"/\" . $file);\n }\n }\n // tidy up: close the handler\n closedir($handler);\n // done!\n return $results;\n}\n\n/**\n * Start in themes folder and look in all subfolders for config.ini files. \n * These config.ini files allow us not to download styles again and again\n */\nfunction findKnownStyles() {\n $result = array();\n $subFolders = getDirectoryList(\"themes\");\n foreach($subFolders as $folder) {\n $configFile = $folder.\"/config.ini\";\n if(file_exists($configFile)) {\n $iniParameters = parse_ini_file($configFile);\n array_push($result, $iniParameters['site_url']);\n }\n }\n return $result;\n}\n\n$knownStyles = findKnownStyles();\ncopyUserStylesFrom(createShaarliHashFromOPMLL(SHAARLI_RSS_OPML), $knownStyles);\n\n<!--- ? ---->",
- "title": "Download CSS styles from an OPML list"
- },
- {
- "location": "/Download-CSS-styles-from-an-OPML-list/#download-css-styles-for-shaarlis-listed-in-an-opml-file",
- "text": "Example php script: <!---- ?php -->\n<!---- Copyright (c) 2014 Nicolas Delsaux (https://github.com/Riduidel) -->\n<!---- License: zlib (http://www.gzip.org/zlib/zlib_license.html) -->\n\n/**\n * Source: https://github.com/Riduidel\n * Download css styles for shaarlis listed in an opml file\n */\ndefine(\"SHAARLI_RSS_OPML\", \"https://www.ecirtam.net/shaarlirss/custom/people.opml\");\n\ndefine(\"THEMES_TEMP_FOLDER\", \"new_themes\");\n\nif(!file_exists(THEMES_TEMP_FOLDER)) {\n mkdir(THEMES_TEMP_FOLDER);\n}\n\nfunction siteUrl($pathInSite) {\n $indexPos = strpos($pathInSite, \"index.php\");\n if(!$indexPos) {\n return $pathInSite;\n } else {\n return substr($pathInSite, 0, $indexPos);\n }\n}\n\nfunction createShaarliHashFromOPMLL($opmlFile) {\n $result = array();\n $opml = file_get_contents($opmlFile);\n $opmlXml = simplexml_load_string($opml);\n $outlineElements = $opmlXml->xpath(\"body/outline\");\n foreach($outlineElements as $site) {\n $siteUrl = siteUrl((string) $site['htmlUrl']);\n $result[$siteUrl]=((string) $site['text']);\n }\n return $result;\n}\n\nfunction getSiteFolder($url) {\n $domain = parse_url($url, PHP_URL_HOST);\n return THEMES_TEMP_FOLDER.\"/\".str_replace(\".\", \"_\", $domain);\n}\n\nfunction get_http_response_code($theURL) {\n $headers = get_headers($theURL);\n return substr($headers[0], 9, 3);\n}\n\n/**\n * This makes the code PHP-5 only (particularly the call to \"get_headers\")\n */\nfunction copyUserStyleFrom($url, $name, $knownStyles) {\n $userStyle = $url.\"inc/user.css\";\n if(in_array($url, $knownStyles)) {\n // TODO add log message\n } else {\n $statusCode = get_http_response_code($userStyle);\n if(intval($statusCode)<300) {\n $styleSheet = file_get_contents($userStyle);\n $siteFolder = getSiteFolder($url);\n if(!file_exists($siteFolder)) {\n mkdir($siteFolder);\n }\n if(!file_exists($siteFolder.'/user.css')) {\n // Copy stylesheet\n file_put_contents($siteFolder.'/user.css', $styleSheet);\n }\n if(!file_exists($siteFolder.'/README.md')) {\n // Then write a readme.md file\n file_put_contents($siteFolder.'/README.md', \n \"User style from \".$name.\"\\n\"\n .\"=============================\"\n .\"\\n\\n\"\n .\"This stylesheet was downloaded from \".$userStyle.\" on \".date(DATE_RFC822)\n );\n }\n if(!file_exists($siteFolder.'/config.ini')) {\n // Write a config file containing useful informations\n file_put_contents($siteFolder.'/config.ini', \n \"site_url=\".$url.\"\\n\"\n .\"site_name=\".$name.\"\\n\"\n );\n }\n if(!file_exists($siteFolder.'/home.png')) {\n // And finally copy generated thumbnail\n $homeThumb = $siteFolder.'/home.png';\n file_put_contents($siteFolder.'/home.png', file_get_contents(getThumbnailUrl($url)));\n }\n echo 'Theme have been downloaded from <a href=\"'.$url.'\">'.$url.'</a> into '.$siteFolder\n .'. It looks like <img src=\"'.$homeThumb.'\"><br/>';\n }\n }\n}\n\nfunction getThumbnailUrl($url) {\n return 'http://api.webthumbnail.org/?url='.$url;\n}\n\nfunction copyUserStylesFrom($urlToNames, $knownStyles) {\n foreach($urlToNames as $url => $name) {\n copyUserStyleFrom($url, $name, $knownStyles);\n }\n}\n\n/**\n * Reading directory list, courtesy of http://www.laughing-buddha.net/php/dirlist/\n * @param directory the directory we want to list files of\n * @return a simple array containing the list of absolute file paths. Notice that current file (\".\") and parent one(\"..\")\n * are not listed here\n */\nfunction getDirectoryList ($directory) {\n $realPath = realpath($directory);\n // create an array to hold directory list\n $results = array();\n // create a handler for the directory\n $handler = opendir($directory);\n // open directory and walk through the filenames\n while ($file = readdir($handler)) {\n // if file isn't this directory or its parent, add it to the results\n if ($file != \".\" && $file != \"..\") {\n $results[] = realpath($realPath . \"/\" . $file);\n }\n }\n // tidy up: close the handler\n closedir($handler);\n // done!\n return $results;\n}\n\n/**\n * Start in themes folder and look in all subfolders for config.ini files. \n * These config.ini files allow us not to download styles again and again\n */\nfunction findKnownStyles() {\n $result = array();\n $subFolders = getDirectoryList(\"themes\");\n foreach($subFolders as $folder) {\n $configFile = $folder.\"/config.ini\";\n if(file_exists($configFile)) {\n $iniParameters = parse_ini_file($configFile);\n array_push($result, $iniParameters['site_url']);\n }\n }\n return $result;\n}\n\n$knownStyles = findKnownStyles();\ncopyUserStylesFrom(createShaarliHashFromOPMLL(SHAARLI_RSS_OPML), $knownStyles);\n\n<!--- ? ---->",
- "title": "Download CSS styles for shaarlis listed in an opml file"
- },
- {
- "location": "/Datastore-hacks/",
- "text": "Decode datastore content\n\n\nTo display the array representing the data saved in \ndata/datastore.php\n, use the following snippet:\n\n\n$data = \"tZNdb9MwFIb... <Commented content inside datastore.php>\";\n$out = unserialize(gzinflate(base64_decode($data)));\necho \"<pre>\"; // Pretty printing is love, pretty printing is life\nprint_r($out);\necho \"</pre>\";\nexit;\n\n\n\n\nThis will output the internal representation of the datastore, \"unobfuscated\" (if this can really be considered obfuscation).\n\n\nAlternatively, you can transform to JSON format (and pretty-print if you have \njq\n installed):\n\n\nphp -r 'print(json_encode(unserialize(gzinflate(base64_decode(preg_replace(\"!.*/\\* (.+) \\*/.*!\", \"$1\", file_get_contents(\"data/datastore.php\")))))));' | jq .\n\n\n\n\nChanging the timestamp for a link\n\n\n\n\nLook for \n<input type=\"hidden\" name=\"lf_linkdate\" value=\"{$link.linkdate}\">\n in \ntpl/editlink.tpl\n (line 14)\n\n\nReplace \ntype=\"hidden\"\n with \ntype=\"text\"\n from this line\n\n\nA new date/time field becomes available in the edit/new link dialog.\n\n\nYou can set the timestamp manually by entering it in the format \nYYYMMDD_HHMMS\n.",
- "title": "Datastore hacks"
- },
- {
- "location": "/Datastore-hacks/#decode-datastore-content",
+ "location": "/Various-hacks/#decode-datastore-content",
"text": "To display the array representing the data saved in data/datastore.php , use the following snippet: $data = \"tZNdb9MwFIb... <Commented content inside datastore.php>\";\n$out = unserialize(gzinflate(base64_decode($data)));\necho \"<pre>\"; // Pretty printing is love, pretty printing is life\nprint_r($out);\necho \"</pre>\";\nexit; This will output the internal representation of the datastore, \"unobfuscated\" (if this can really be considered obfuscation). Alternatively, you can transform to JSON format (and pretty-print if you have jq installed): php -r 'print(json_encode(unserialize(gzinflate(base64_decode(preg_replace(\"!.*/\\* (.+) \\*/.*!\", \"$1\", file_get_contents(\"data/datastore.php\")))))));' | jq .",
"title": "Decode datastore content"
},
{
- "location": "/Datastore-hacks/#changing-the-timestamp-for-a-link",
+ "location": "/Various-hacks/#changing-the-timestamp-for-a-shaare",
"text": "Look for <input type=\"hidden\" name=\"lf_linkdate\" value=\"{$link.linkdate}\"> in tpl/editlink.tpl (line 14) Replace type=\"hidden\" with type=\"text\" 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 .",
- "title": "Changing the timestamp for a link"
+ "title": "Changing the timestamp for a shaare"
+ },
+ {
+ "location": "/Various-hacks/#see-also",
+ "text": "Add a new custom field to shaares (example patch) Download CSS styles for shaarlis listed in an opml file Copy an existing Shaarli installation over SSH, and serve it locally Create multiple Shaarli instances, generate an HTML index of them",
+ "title": "See also"
},
{
"location": "/Troubleshooting/",
</li>
<li class="">
- <a class="" href="Copy-an-existing-installation-over-SSH-and-serve-it-locally/">Copy an existing installation over SSH and serve it locally</a>
- </li>
- <li class="">
-
- <a class="" href="Create-and-serve-multiple-Shaarlis-(farm)/">Create and serve multiple Shaarlis (farm)</a>
- </li>
- <li class="">
-
- <a class="" href="Download-CSS-styles-from-an-OPML-list/">Download CSS styles from an OPML list</a>
- </li>
- <li class="">
-
- <a class="" href="Datastore-hacks/">Datastore hacks</a>
+ <a class="" href="Various-hacks/">Various hacks</a>
</li>
</ul>
</li>
</url>
<url>
- <loc>/Copy-an-existing-installation-over-SSH-and-serve-it-locally/</loc>
- <lastmod>2017-06-18</lastmod>
- <changefreq>daily</changefreq>
- </url>
-
- <url>
- <loc>/Create-and-serve-multiple-Shaarlis-(farm)/</loc>
- <lastmod>2017-06-18</lastmod>
- <changefreq>daily</changefreq>
- </url>
-
- <url>
- <loc>/Download-CSS-styles-from-an-OPML-list/</loc>
- <lastmod>2017-06-18</lastmod>
- <changefreq>daily</changefreq>
- </url>
-
- <url>
- <loc>/Datastore-hacks/</loc>
+ <loc>/Various-hacks/</loc>
<lastmod>2017-06-18</lastmod>
<changefreq>daily</changefreq>
</url>
## Filtering RSS feeds/Picture wall
-RSS feeds can also be restricted to only return items matching a text/tag search: see [[RSS feeds]].
+RSS feeds can also be restricted to only return items matching a text/tag search: see [RSS feeds](RSS feeds).
### Themes
-See [[Theming]] for the list of community-contributed themes, and an installation guide.
+See [Theming](Theming) for the list of community-contributed themes, and an installation guide.
### Server apps
- [shaarchiver](https://github.com/nodiscc/shaarchiver) - Archive your Shaarli bookmarks and their content
## Local development
A [`Makefile`](https://github.com/shaarli/Shaarli/blob/master/Makefile) is available to perform project-related operations:
- Documentation - generate a local HTML copy of the GitHub wiki
-- [[Static analysis]] - check that the code is compliant to PHP conventions
-- [[Unit tests]] - ensure there are no regressions introduced by new commits
+- [Static analysis](Static analysis) - check that the code is compliant to PHP conventions
+- [Unit tests](Unit tests) - ensure there are no regressions introduced by new commits
## Automatic builds
[Travis CI](http://docs.travis-ci.com/) is a Continuous Integration build server, that runs a build:
- each time a commit is merged to the mainline (`master` branch)
- each time a Pull Request is submitted or updated
-A build is composed of several jobs: one for each supported PHP version (see [[Server requirements]]).
+A build is composed of several jobs: one for each supported PHP version (see [Server requirements](Server requirements)).
Each build job:
- updates Composer
- installs 3rd-party test dependencies with Composer
-- runs [[Unit tests]]
+- runs [Unit tests](Unit tests)
After all jobs have finished, Travis returns the results to GitHub:
- a status icon represents the result for the `master` branch: [![](https://api.travis-ci.org/shaarli/Shaarli.svg)](https://travis-ci.org/shaarli/Shaarli)
Please have a look at the following pages:
- [Contributing to Shaarli](https://github.com/shaarli/Shaarli/tree/master/CONTRIBUTING.md)
-- [[Static analysis]] - patches should try to stick to the [PHP Standard Recommendations](http://www.php-fig.org/psr/) (PSR), especially:
+- [Static analysis](Static analysis) - patches should try to stick to the [PHP Standard Recommendations](http://www.php-fig.org/psr/) (PSR), especially:
- [PSR-1](http://www.php-fig.org/psr/psr-1/) - Basic Coding Standard
- [PSR-2](http://www.php-fig.org/psr/psr-2/) - Coding Style Guide
-- [[Unit tests]]
-- [[GnuPG signature]] for tags/releases
+- [Unit tests](Unit tests)
+- [GnuPG signature](GnuPG signature) for tags/releases
### Sharing links using Firefox share
* Add the sharing service as described above
- * When you are visiting a webpage you would like to share with Shaarli, click the Firefox _Share_ button [[images/firefoxshare.png]]
+ * When you are visiting a webpage you would like to share with Shaarli, click the Firefox _Share_ button [images/firefoxshare.png](images/firefoxshare.png)
* You can edit your link before and after saving, just like the bookmarklet above.
| | 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. |
## Create and push a GPG-signed tag
-See [[Release Shaarli]].
+See [Release Shaarli](Release Shaarli).
**Note**: Do not edit `tpl/default/css/shaarli.css`! Your changes would be overridden when updating Shaarli.
-See also [[Download CSS styles from an OPML list]]
+See also [Download CSS styles from an OPML list](Download CSS styles from an OPML list)
## Themes
- fill the install form
- log in to Shaarli
-Edit Shaarli's [[configuration|Shaarli configuration]]:
+Edit Shaarli's [configuration|Shaarli configuration](configuration|Shaarli configuration):
```bash
# the file should be owned by Apache, thus not writeable => sudo
$ sudo sed -i s=tpl=tpl/albinomouse-template=g shaarli/data/config.php
- `data/ipbans.php` - banned IP addresses
- `data/updates.txt` - contains all automatic update to the configuration and datastore files already run
-See [[Shaarli configuration]] for more information about Shaarli resources.
+See [Shaarli configuration](Shaarli configuration) 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
- backup the `data` directory
- install or update Shaarli:
- - fresh installation - see [[Download and installation]]
+ - fresh installation - see [Download and installation](Download and installation)
- update - see the following sections
- check or restore the `data` directory
All tagged revisions can be downloaded as tarballs or ZIP archives from the [releases](https://github.com/shaarli/Shaarli/releases) page.
-We recommend that you use the latest release tarball with the `-full` suffix. It contains the dependencies, please read [[Download and installation]] for `git` complete instructions.
+We recommend that you use the latest release tarball with the `-full` suffix. It contains the dependencies, please read [Download and installation](Download and installation) for `git` complete instructions.
Once downloaded, extract the archive locally and update your remote installation (e.g. via FTP) -be sure you keep the content of the `data` directory!
-After upgrading, access your fresh Shaarli installation from a web browser; the configuration and data store will then be automatically updated, and new settings added to `data/config.json.php` (see [[Shaarli configuration]] for more details).
+After upgrading, access your fresh Shaarli installation from a web browser; the configuration and data store will then be automatically updated, and new settings added to `data/config.json.php` (see [Shaarli configuration](Shaarli configuration) for more details).
## Upgrading with Git
#### 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]] for more details).
+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) for more details).
## Troubleshooting