aboutsummaryrefslogtreecommitdiffhomepage
path: root/doc/html
diff options
context:
space:
mode:
Diffstat (limited to 'doc/html')
-rw-r--r--doc/html/3rd-party-libraries/index.html14
-rw-r--r--doc/html/Backup,-restore,-import-and-export/index.html18
-rw-r--r--doc/html/Bookmarklet/index.html14
-rw-r--r--doc/html/Browsing-and-searching/index.html14
-rw-r--r--doc/html/Coding-guidelines/index.html14
-rw-r--r--doc/html/Community-&-Related-software/index.html14
-rw-r--r--doc/html/Continuous-integration-tools/index.html14
-rw-r--r--doc/html/Copy-an-existing-installation-over-SSH-and-serve-it-locally/index.html403
-rw-r--r--doc/html/Create-and-serve-multiple-Shaarlis-(farm)/index.html396
-rw-r--r--doc/html/Development-guidelines/index.html14
-rw-r--r--doc/html/Directory-structure/index.html14
-rw-r--r--doc/html/Docker-101/index.html14
-rw-r--r--doc/html/Docker-resources/index.html14
-rw-r--r--doc/html/Download-CSS-styles-from-an-OPML-list/index.html496
-rw-r--r--doc/html/Download-and-Installation/index.html14
-rw-r--r--doc/html/FAQ/index.html14
-rw-r--r--doc/html/Features/index.html14
-rw-r--r--doc/html/Firefox-share/index.html14
-rw-r--r--doc/html/GnuPG-signature/index.html14
-rw-r--r--doc/html/Plugin-System/index.html14
-rw-r--r--doc/html/Plugins/index.html14
-rw-r--r--doc/html/REST-API/index.html14
-rw-r--r--doc/html/RSS-feeds/index.html14
-rw-r--r--doc/html/Release-Shaarli/index.html14
-rw-r--r--doc/html/Reverse-proxy-configuration/index.html14
-rw-r--r--doc/html/Security/index.html14
-rw-r--r--doc/html/Server-configuration/index.html14
-rw-r--r--doc/html/Server-requirements/index.html14
-rw-r--r--doc/html/Server-security/index.html14
-rw-r--r--doc/html/Shaarli-configuration/index.html14
-rw-r--r--doc/html/Shaarli-images/index.html14
-rw-r--r--doc/html/Static-analysis/index.html14
-rw-r--r--doc/html/Theming/index.html14
-rw-r--r--doc/html/Troubleshooting/index.html18
-rw-r--r--doc/html/Unit-tests/index.html14
-rw-r--r--doc/html/Upgrade-and-migration/index.html14
-rw-r--r--doc/html/Various-hacks/index.html (renamed from doc/html/Datastore-hacks/index.html)44
-rw-r--r--doc/html/Versioning-and-Branches/index.html14
-rw-r--r--doc/html/index.html16
-rw-r--r--doc/html/mkdocs/search_index.json37
-rw-r--r--doc/html/search.html14
-rw-r--r--doc/html/sitemap.xml20
42 files changed, 74 insertions, 1836 deletions
diff --git a/doc/html/3rd-party-libraries/index.html b/doc/html/3rd-party-libraries/index.html
index c54c45f5..0d62007d 100644
--- a/doc/html/3rd-party-libraries/index.html
+++ b/doc/html/3rd-party-libraries/index.html
@@ -152,19 +152,7 @@
152 </li> 152 </li>
153 <li class=""> 153 <li class="">
154 154
155 <a class="" href="../Copy-an-existing-installation-over-SSH-and-serve-it-locally/">Copy an existing installation over SSH and serve it locally</a> 155 <a class="" href="../Various-hacks/">Various hacks</a>
156 </li>
157 <li class="">
158
159 <a class="" href="../Create-and-serve-multiple-Shaarlis-(farm)/">Create and serve multiple Shaarlis (farm)</a>
160 </li>
161 <li class="">
162
163 <a class="" href="../Download-CSS-styles-from-an-OPML-list/">Download CSS styles from an OPML list</a>
164 </li>
165 <li class="">
166
167 <a class="" href="../Datastore-hacks/">Datastore hacks</a>
168 </li> 156 </li>
169 </ul> 157 </ul>
170 </li> 158 </li>
diff --git a/doc/html/Backup,-restore,-import-and-export/index.html b/doc/html/Backup,-restore,-import-and-export/index.html
index ceb80170..33ec9124 100644
--- a/doc/html/Backup,-restore,-import-and-export/index.html
+++ b/doc/html/Backup,-restore,-import-and-export/index.html
@@ -179,19 +179,7 @@
179 </li> 179 </li>
180 <li class=""> 180 <li class="">
181 181
182 <a class="" href="../Copy-an-existing-installation-over-SSH-and-serve-it-locally/">Copy an existing installation over SSH and serve it locally</a> 182 <a class="" href="../Various-hacks/">Various hacks</a>
183 </li>
184 <li class="">
185
186 <a class="" href="../Create-and-serve-multiple-Shaarlis-(farm)/">Create and serve multiple Shaarlis (farm)</a>
187 </li>
188 <li class="">
189
190 <a class="" href="../Download-CSS-styles-from-an-OPML-list/">Download CSS styles from an OPML list</a>
191 </li>
192 <li class="">
193
194 <a class="" href="../Datastore-hacks/">Datastore hacks</a>
195 </li> 183 </li>
196 </ul> 184 </ul>
197 </li> 185 </li>
@@ -367,7 +355,7 @@
367 355
368 <div class="rst-footer-buttons" role="navigation" aria-label="footer navigation"> 356 <div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
369 357
370 <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> 358 <a href="../Various-hacks/" class="btn btn-neutral float-right" title="Various hacks">Next <span class="icon icon-circle-arrow-right"></span></a>
371 359
372 360
373 <a href="../REST-API/" class="btn btn-neutral" title="REST API"><span class="icon icon-circle-arrow-left"></span> Previous</a> 361 <a href="../REST-API/" class="btn btn-neutral" title="REST API"><span class="icon icon-circle-arrow-left"></span> Previous</a>
@@ -401,7 +389,7 @@
401 <span><a href="../REST-API/" style="color: #fcfcfc;">&laquo; Previous</a></span> 389 <span><a href="../REST-API/" style="color: #fcfcfc;">&laquo; Previous</a></span>
402 390
403 391
404 <span style="margin-left: 15px"><a href="../Copy-an-existing-installation-over-SSH-and-serve-it-locally/" style="color: #fcfcfc">Next &raquo;</a></span> 392 <span style="margin-left: 15px"><a href="../Various-hacks/" style="color: #fcfcfc">Next &raquo;</a></span>
405 393
406 </span> 394 </span>
407</div> 395</div>
diff --git a/doc/html/Bookmarklet/index.html b/doc/html/Bookmarklet/index.html
index e7a370b6..325d305a 100644
--- a/doc/html/Bookmarklet/index.html
+++ b/doc/html/Bookmarklet/index.html
@@ -164,19 +164,7 @@
164 </li> 164 </li>
165 <li class=""> 165 <li class="">
166 166
167 <a class="" href="../Copy-an-existing-installation-over-SSH-and-serve-it-locally/">Copy an existing installation over SSH and serve it locally</a> 167 <a class="" href="../Various-hacks/">Various hacks</a>
168 </li>
169 <li class="">
170
171 <a class="" href="../Create-and-serve-multiple-Shaarlis-(farm)/">Create and serve multiple Shaarlis (farm)</a>
172 </li>
173 <li class="">
174
175 <a class="" href="../Download-CSS-styles-from-an-OPML-list/">Download CSS styles from an OPML list</a>
176 </li>
177 <li class="">
178
179 <a class="" href="../Datastore-hacks/">Datastore hacks</a>
180 </li> 168 </li>
181 </ul> 169 </ul>
182 </li> 170 </li>
diff --git a/doc/html/Browsing-and-searching/index.html b/doc/html/Browsing-and-searching/index.html
index 459f07c7..c8b7386e 100644
--- a/doc/html/Browsing-and-searching/index.html
+++ b/doc/html/Browsing-and-searching/index.html
@@ -164,19 +164,7 @@
164 </li> 164 </li>
165 <li class=""> 165 <li class="">
166 166
167 <a class="" href="../Copy-an-existing-installation-over-SSH-and-serve-it-locally/">Copy an existing installation over SSH and serve it locally</a> 167 <a class="" href="../Various-hacks/">Various hacks</a>
168 </li>
169 <li class="">
170
171 <a class="" href="../Create-and-serve-multiple-Shaarlis-(farm)/">Create and serve multiple Shaarlis (farm)</a>
172 </li>
173 <li class="">
174
175 <a class="" href="../Download-CSS-styles-from-an-OPML-list/">Download CSS styles from an OPML list</a>
176 </li>
177 <li class="">
178
179 <a class="" href="../Datastore-hacks/">Datastore hacks</a>
180 </li> 168 </li>
181 </ul> 169 </ul>
182 </li> 170 </li>
diff --git a/doc/html/Coding-guidelines/index.html b/doc/html/Coding-guidelines/index.html
index be2bf7e8..dfcdd45c 100644
--- a/doc/html/Coding-guidelines/index.html
+++ b/doc/html/Coding-guidelines/index.html
@@ -152,19 +152,7 @@
152 </li> 152 </li>
153 <li class=""> 153 <li class="">
154 154
155 <a class="" href="../Copy-an-existing-installation-over-SSH-and-serve-it-locally/">Copy an existing installation over SSH and serve it locally</a> 155 <a class="" href="../Various-hacks/">Various hacks</a>
156 </li>
157 <li class="">
158
159 <a class="" href="../Create-and-serve-multiple-Shaarlis-(farm)/">Create and serve multiple Shaarlis (farm)</a>
160 </li>
161 <li class="">
162
163 <a class="" href="../Download-CSS-styles-from-an-OPML-list/">Download CSS styles from an OPML list</a>
164 </li>
165 <li class="">
166
167 <a class="" href="../Datastore-hacks/">Datastore hacks</a>
168 </li> 156 </li>
169 </ul> 157 </ul>
170 </li> 158 </li>
diff --git a/doc/html/Community-&-Related-software/index.html b/doc/html/Community-&-Related-software/index.html
index 1de704a3..2497433c 100644
--- a/doc/html/Community-&-Related-software/index.html
+++ b/doc/html/Community-&-Related-software/index.html
@@ -152,19 +152,7 @@
152 </li> 152 </li>
153 <li class=""> 153 <li class="">
154 154
155 <a class="" href="../Copy-an-existing-installation-over-SSH-and-serve-it-locally/">Copy an existing installation over SSH and serve it locally</a> 155 <a class="" href="../Various-hacks/">Various hacks</a>
156 </li>
157 <li class="">
158
159 <a class="" href="../Create-and-serve-multiple-Shaarlis-(farm)/">Create and serve multiple Shaarlis (farm)</a>
160 </li>
161 <li class="">
162
163 <a class="" href="../Download-CSS-styles-from-an-OPML-list/">Download CSS styles from an OPML list</a>
164 </li>
165 <li class="">
166
167 <a class="" href="../Datastore-hacks/">Datastore hacks</a>
168 </li> 156 </li>
169 </ul> 157 </ul>
170 </li> 158 </li>
diff --git a/doc/html/Continuous-integration-tools/index.html b/doc/html/Continuous-integration-tools/index.html
index c889a963..339f37ac 100644
--- a/doc/html/Continuous-integration-tools/index.html
+++ b/doc/html/Continuous-integration-tools/index.html
@@ -152,19 +152,7 @@
152 </li> 152 </li>
153 <li class=""> 153 <li class="">
154 154
155 <a class="" href="../Copy-an-existing-installation-over-SSH-and-serve-it-locally/">Copy an existing installation over SSH and serve it locally</a> 155 <a class="" href="../Various-hacks/">Various hacks</a>
156 </li>
157 <li class="">
158
159 <a class="" href="../Create-and-serve-multiple-Shaarlis-(farm)/">Create and serve multiple Shaarlis (farm)</a>
160 </li>
161 <li class="">
162
163 <a class="" href="../Download-CSS-styles-from-an-OPML-list/">Download CSS styles from an OPML list</a>
164 </li>
165 <li class="">
166
167 <a class="" href="../Datastore-hacks/">Datastore hacks</a>
168 </li> 156 </li>
169 </ul> 157 </ul>
170 </li> 158 </li>
diff --git a/doc/html/Copy-an-existing-installation-over-SSH-and-serve-it-locally/index.html b/doc/html/Copy-an-existing-installation-over-SSH-and-serve-it-locally/index.html
deleted file mode 100644
index 4aea480d..00000000
--- a/doc/html/Copy-an-existing-installation-over-SSH-and-serve-it-locally/index.html
+++ /dev/null
@@ -1,403 +0,0 @@
1<!DOCTYPE html>
2<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]-->
3<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]-->
4<head>
5 <meta charset="utf-8">
6 <meta http-equiv="X-UA-Compatible" content="IE=edge">
7 <meta name="viewport" content="width=device-width, initial-scale=1.0">
8
9
10 <link rel="shortcut icon" href="../img/favicon.ico">
11 <title>Copy an existing installation over SSH and serve it locally - Shaarli Documentation</title>
12 <link href='https://fonts.googleapis.com/css?family=Lato:400,700|Roboto+Slab:400,700|Inconsolata:400,700' rel='stylesheet' type='text/css'>
13
14 <link rel="stylesheet" href="../css/theme.css" type="text/css" />
15 <link rel="stylesheet" href="../css/theme_extra.css" type="text/css" />
16 <link rel="stylesheet" href="../css/highlight.css">
17 <link href="../github-markdown.css" rel="stylesheet">
18
19 <script>
20 // Current page data
21 var mkdocs_page_name = "Copy an existing installation over SSH and serve it locally";
22 var mkdocs_page_input_path = "Copy-an-existing-installation-over-SSH-and-serve-it-locally.md";
23 var mkdocs_page_url = "/Copy-an-existing-installation-over-SSH-and-serve-it-locally/";
24 </script>
25
26 <script src="../js/jquery-2.1.1.min.js"></script>
27 <script src="../js/modernizr-2.8.3.min.js"></script>
28 <script type="text/javascript" src="../js/highlight.pack.js"></script>
29
30</head>
31
32<body class="wy-body-for-nav" role="document">
33
34 <div class="wy-grid-for-nav">
35
36
37 <nav data-toggle="wy-nav-shift" class="wy-nav-side stickynav">
38 <div class="wy-side-nav-search">
39 <a href=".." class="icon icon-home"> Shaarli Documentation</a>
40 <div role="search">
41 <form id ="rtd-search-form" class="wy-form" action="../search.html" method="get">
42 <input type="text" name="q" placeholder="Search docs" />
43 </form>
44</div>
45 </div>
46
47 <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
48 <ul class="current">
49
50
51 <li class="toctree-l1">
52
53 <a class="" href="..">Home</a>
54 </li>
55
56 <li class="toctree-l1">
57
58 <span class="caption-text">Setup</span>
59 <ul class="subnav">
60 <li class="">
61
62 <a class="" href="../Download-and-Installation/">Download and Installation</a>
63 </li>
64 <li class="">
65
66 <a class="" href="../Upgrade-and-migration/">Upgrade and migration</a>
67 </li>
68 <li class="">
69
70 <a class="" href="../Server-requirements/">Server requirements</a>
71 </li>
72 <li class="">
73
74 <a class="" href="../Server-configuration/">Server configuration</a>
75 </li>
76 <li class="">
77
78 <a class="" href="../Server-security/">Server security</a>
79 </li>
80 <li class="">
81
82 <a class="" href="../Shaarli-configuration/">Shaarli configuration</a>
83 </li>
84 <li class="">
85
86 <a class="" href="../Plugins/">Plugins</a>
87 </li>
88 </ul>
89 </li>
90
91 <li class="toctree-l1">
92
93 <span class="caption-text">Docker</span>
94 <ul class="subnav">
95 <li class="">
96
97 <a class="" href="../Docker-101/">Docker 101</a>
98 </li>
99 <li class="">
100
101 <a class="" href="../Shaarli-images/">Shaarli images</a>
102 </li>
103 <li class="">
104
105 <a class="" href="../Reverse-proxy-configuration/">Reverse proxy configuration</a>
106 </li>
107 <li class="">
108
109 <a class="" href="../Docker-resources/">Docker resources</a>
110 </li>
111 </ul>
112 </li>
113
114 <li class="toctree-l1">
115
116 <span class="caption-text">Usage</span>
117 <ul class="subnav">
118 <li class="">
119
120 <a class="" href="../Features/">Features</a>
121 </li>
122 <li class="">
123
124 <a class="" href="../Bookmarklet/">Bookmarklet</a>
125 </li>
126 <li class="">
127
128 <a class="" href="../Browsing-and-searching/">Browsing and searching</a>
129 </li>
130 <li class="">
131
132 <a class="" href="../Firefox-share/">Firefox share</a>
133 </li>
134 <li class="">
135
136 <a class="" href="../RSS-feeds/">RSS feeds</a>
137 </li>
138 <li class="">
139
140 <a class="" href="../REST-API/">REST API</a>
141 </li>
142 </ul>
143 </li>
144
145 <li class="toctree-l1">
146
147 <span class="caption-text">How To</span>
148 <ul class="subnav">
149 <li class="">
150
151 <a class="" href="../Backup,-restore,-import-and-export/">Backup, restore, import and export</a>
152 </li>
153 <li class=" current">
154
155 <a class="current" href="./">Copy an existing installation over SSH and serve it locally</a>
156 <ul class="subnav">
157
158 </ul>
159 </li>
160 <li class="">
161
162 <a class="" href="../Create-and-serve-multiple-Shaarlis-(farm)/">Create and serve multiple Shaarlis (farm)</a>
163 </li>
164 <li class="">
165
166 <a class="" href="../Download-CSS-styles-from-an-OPML-list/">Download CSS styles from an OPML list</a>
167 </li>
168 <li class="">
169
170 <a class="" href="../Datastore-hacks/">Datastore hacks</a>
171 </li>
172 </ul>
173 </li>
174
175 <li class="toctree-l1">
176
177 <a class="" href="../Troubleshooting/">Troubleshooting</a>
178 </li>
179
180 <li class="toctree-l1">
181
182 <span class="caption-text">Development</span>
183 <ul class="subnav">
184 <li class="">
185
186 <a class="" href="../Development-guidelines/">Development guidelines</a>
187 </li>
188 <li class="">
189
190 <a class="" href="../Continuous-integration-tools/">Continuous integration tools</a>
191 </li>
192 <li class="">
193
194 <a class="" href="../GnuPG-signature/">GnuPG signature</a>
195 </li>
196 <li class="">
197
198 <a class="" href="../Coding-guidelines/">Coding guidelines</a>
199 </li>
200 <li class="">
201
202 <a class="" href="../Directory-structure/">Directory structure</a>
203 </li>
204 <li class="">
205
206 <a class="" href="../3rd-party-libraries/">3rd party libraries</a>
207 </li>
208 <li class="">
209
210 <a class="" href="../Plugin-System/">Plugin System</a>
211 </li>
212 <li class="">
213
214 <a class="" href="../Release-Shaarli/">Release Shaarli</a>
215 </li>
216 <li class="">
217
218 <a class="" href="../Versioning-and-Branches/">Versioning and Branches</a>
219 </li>
220 <li class="">
221
222 <a class="" href="../Security/">Security</a>
223 </li>
224 <li class="">
225
226 <a class="" href="../Static-analysis/">Static analysis</a>
227 </li>
228 <li class="">
229
230 <a class="" href="../Theming/">Theming</a>
231 </li>
232 <li class="">
233
234 <a class="" href="../Unit-tests/">Unit tests</a>
235 </li>
236 </ul>
237 </li>
238
239 <li class="toctree-l1">
240
241 <span class="caption-text">About</span>
242 <ul class="subnav">
243 <li class="">
244
245 <a class="" href="../FAQ/">FAQ</a>
246 </li>
247 <li class="">
248
249 <a class="" href="../Community-&-Related-software/">Community & Related software</a>
250 </li>
251 </ul>
252 </li>
253
254 </ul>
255 </div>
256 &nbsp;
257 </nav>
258
259 <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
260
261
262 <nav class="wy-nav-top" role="navigation" aria-label="top navigation">
263 <i data-toggle="wy-nav-top" class="fa fa-bars"></i>
264 <a href="..">Shaarli Documentation</a>
265 </nav>
266
267
268 <div class="wy-nav-content">
269 <div class="rst-content">
270 <div role="navigation" aria-label="breadcrumbs navigation">
271 <ul class="wy-breadcrumbs">
272 <li><a href="..">Docs</a> &raquo;</li>
273
274
275
276 <li>How To &raquo;</li>
277
278
279
280 <li>Copy an existing installation over SSH and serve it locally</li>
281 <li class="wy-breadcrumbs-aside">
282
283 <a href="https://github.com/shaarli/Shaarli/edit/master/docs/Copy-an-existing-installation-over-SSH-and-serve-it-locally.md"
284 class="icon icon-github"> Edit on GitHub</a>
285
286 </li>
287 </ul>
288 <hr/>
289</div>
290 <div role="main">
291 <div class="section">
292
293 <p>Example bash script:</p>
294<pre><code class="bash">#!/bin/bash
295#Description: Copy a Shaarli installation over SSH/SCP, serve it locally with php-cli
296#Will create a local-shaarli/ directory when you run it, backup your Shaarli there, and serve it locally.
297#Will NOT download linked pages. It's just a directly usable backup/copy/mirror of your Shaarli
298#Requires: ssh, scp and a working SSH access to the server where your Shaarli is installed
299#Usage: ./local-shaarli.sh
300#Author: nodiscc (nodiscc@gmail.com)
301#License: MIT (http://opensource.org/licenses/MIT)
302set -o errexit
303set -o nounset
304
305##### CONFIG #################
306#The port used by php's local server
307php_local_port=7431
308
309#Name of the SSH server and path where Shaarli is installed
310#TODO: pass these as command-line arguments
311remotehost=&quot;my.ssh.server&quot;
312remote_shaarli_dir=&quot;/var/www/shaarli&quot;
313
314
315###### FUNCTIONS #############
316_main() {
317 _CBSyncShaarli
318 _CBServeShaarli
319}
320
321_CBSyncShaarli() {
322 remote_temp_dir=$(ssh $remotehost mktemp -d)
323 remote_ssh_user=$(ssh $remotehost whoami)
324 ssh -t &quot;$remotehost&quot; sudo cp -r &quot;$remote_shaarli_dir&quot; &quot;$remote_temp_dir&quot;
325 ssh -t &quot;$remotehost&quot; sudo chown -R &quot;$remote_ssh_user&quot;:&quot;$remote_ssh_user&quot; &quot;$remote_temp_dir&quot;
326 scp -rq &quot;$remotehost&quot;:&quot;$remote_temp_dir&quot; local-shaarli
327 ssh &quot;$remotehost&quot; rm -r &quot;$remote_temp_dir&quot;
328}
329
330_CBServeShaarli() {
331 #TODO: allow serving a previously downloaded Shaarli
332 #TODO: ask before overwriting local copy, if it exists
333 cd local-shaarli/
334 php -S localhost:${php_local_port}
335 echo &quot;Please go to http://localhost:${php_local_port}&quot;
336}
337
338
339##### MAIN #################
340
341_main
342</code></pre>
343
344<p>This outputs:</p>
345<pre><code class="bash">$ ./local-shaarli.sh
346PHP 5.6.0RC4 Development Server started at Mon Sep 1 21:56:19 2014
347Listening on http://localhost:7431
348Document root is /home/user/local-shaarli/shaarli
349Press Ctrl-C to quit.
350
351[Mon Sep 1 21:56:27 2014] ::1:57868 [200]: /
352[Mon Sep 1 21:56:27 2014] ::1:57869 [200]: /index.html
353[Mon Sep 1 21:56:37 2014] ::1:57881 [200]: /...
354</code></pre>
355
356 </div>
357 </div>
358 <footer>
359
360 <div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
361
362 <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>
363
364
365 <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>
366
367 </div>
368
369
370 <hr/>
371
372 <div role="contentinfo">
373 <!-- Copyright etc -->
374
375 </div>
376
377 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>.
378</footer>
379
380 </div>
381 </div>
382
383 </section>
384
385 </div>
386
387 <div class="rst-versions" role="note" style="cursor: pointer">
388 <span class="rst-current-version" data-toggle="rst-current-version">
389
390 <a href="https://github.com/shaarli/Shaarli" class="fa fa-github" style="float: left; color: #fcfcfc"> GitHub</a>
391
392
393 <span><a href="../Backup,-restore,-import-and-export/" style="color: #fcfcfc;">&laquo; Previous</a></span>
394
395
396 <span style="margin-left: 15px"><a href="../Create-and-serve-multiple-Shaarlis-(farm)/" style="color: #fcfcfc">Next &raquo;</a></span>
397
398 </span>
399</div>
400 <script src="../js/theme.js"></script>
401
402</body>
403</html>
diff --git a/doc/html/Create-and-serve-multiple-Shaarlis-(farm)/index.html b/doc/html/Create-and-serve-multiple-Shaarlis-(farm)/index.html
deleted file mode 100644
index 98d8992e..00000000
--- a/doc/html/Create-and-serve-multiple-Shaarlis-(farm)/index.html
+++ /dev/null
@@ -1,396 +0,0 @@
1<!DOCTYPE html>
2<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]-->
3<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]-->
4<head>
5 <meta charset="utf-8">
6 <meta http-equiv="X-UA-Compatible" content="IE=edge">
7 <meta name="viewport" content="width=device-width, initial-scale=1.0">
8
9
10 <link rel="shortcut icon" href="../img/favicon.ico">
11 <title>Create and serve multiple Shaarlis (farm) - Shaarli Documentation</title>
12 <link href='https://fonts.googleapis.com/css?family=Lato:400,700|Roboto+Slab:400,700|Inconsolata:400,700' rel='stylesheet' type='text/css'>
13
14 <link rel="stylesheet" href="../css/theme.css" type="text/css" />
15 <link rel="stylesheet" href="../css/theme_extra.css" type="text/css" />
16 <link rel="stylesheet" href="../css/highlight.css">
17 <link href="../github-markdown.css" rel="stylesheet">
18
19 <script>
20 // Current page data
21 var mkdocs_page_name = "Create and serve multiple Shaarlis (farm)";
22 var mkdocs_page_input_path = "Create-and-serve-multiple-Shaarlis-(farm).md";
23 var mkdocs_page_url = "/Create-and-serve-multiple-Shaarlis-(farm)/";
24 </script>
25
26 <script src="../js/jquery-2.1.1.min.js"></script>
27 <script src="../js/modernizr-2.8.3.min.js"></script>
28 <script type="text/javascript" src="../js/highlight.pack.js"></script>
29
30</head>
31
32<body class="wy-body-for-nav" role="document">
33
34 <div class="wy-grid-for-nav">
35
36
37 <nav data-toggle="wy-nav-shift" class="wy-nav-side stickynav">
38 <div class="wy-side-nav-search">
39 <a href=".." class="icon icon-home"> Shaarli Documentation</a>
40 <div role="search">
41 <form id ="rtd-search-form" class="wy-form" action="../search.html" method="get">
42 <input type="text" name="q" placeholder="Search docs" />
43 </form>
44</div>
45 </div>
46
47 <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
48 <ul class="current">
49
50
51 <li class="toctree-l1">
52
53 <a class="" href="..">Home</a>
54 </li>
55
56 <li class="toctree-l1">
57
58 <span class="caption-text">Setup</span>
59 <ul class="subnav">
60 <li class="">
61
62 <a class="" href="../Download-and-Installation/">Download and Installation</a>
63 </li>
64 <li class="">
65
66 <a class="" href="../Upgrade-and-migration/">Upgrade and migration</a>
67 </li>
68 <li class="">
69
70 <a class="" href="../Server-requirements/">Server requirements</a>
71 </li>
72 <li class="">
73
74 <a class="" href="../Server-configuration/">Server configuration</a>
75 </li>
76 <li class="">
77
78 <a class="" href="../Server-security/">Server security</a>
79 </li>
80 <li class="">
81
82 <a class="" href="../Shaarli-configuration/">Shaarli configuration</a>
83 </li>
84 <li class="">
85
86 <a class="" href="../Plugins/">Plugins</a>
87 </li>
88 </ul>
89 </li>
90
91 <li class="toctree-l1">
92
93 <span class="caption-text">Docker</span>
94 <ul class="subnav">
95 <li class="">
96
97 <a class="" href="../Docker-101/">Docker 101</a>
98 </li>
99 <li class="">
100
101 <a class="" href="../Shaarli-images/">Shaarli images</a>
102 </li>
103 <li class="">
104
105 <a class="" href="../Reverse-proxy-configuration/">Reverse proxy configuration</a>
106 </li>
107 <li class="">
108
109 <a class="" href="../Docker-resources/">Docker resources</a>
110 </li>
111 </ul>
112 </li>
113
114 <li class="toctree-l1">
115
116 <span class="caption-text">Usage</span>
117 <ul class="subnav">
118 <li class="">
119
120 <a class="" href="../Features/">Features</a>
121 </li>
122 <li class="">
123
124 <a class="" href="../Bookmarklet/">Bookmarklet</a>
125 </li>
126 <li class="">
127
128 <a class="" href="../Browsing-and-searching/">Browsing and searching</a>
129 </li>
130 <li class="">
131
132 <a class="" href="../Firefox-share/">Firefox share</a>
133 </li>
134 <li class="">
135
136 <a class="" href="../RSS-feeds/">RSS feeds</a>
137 </li>
138 <li class="">
139
140 <a class="" href="../REST-API/">REST API</a>
141 </li>
142 </ul>
143 </li>
144
145 <li class="toctree-l1">
146
147 <span class="caption-text">How To</span>
148 <ul class="subnav">
149 <li class="">
150
151 <a class="" href="../Backup,-restore,-import-and-export/">Backup, restore, import and export</a>
152 </li>
153 <li class="">
154
155 <a class="" href="../Copy-an-existing-installation-over-SSH-and-serve-it-locally/">Copy an existing installation over SSH and serve it locally</a>
156 </li>
157 <li class=" current">
158
159 <a class="current" href="./">Create and serve multiple Shaarlis (farm)</a>
160 <ul class="subnav">
161
162 </ul>
163 </li>
164 <li class="">
165
166 <a class="" href="../Download-CSS-styles-from-an-OPML-list/">Download CSS styles from an OPML list</a>
167 </li>
168 <li class="">
169
170 <a class="" href="../Datastore-hacks/">Datastore hacks</a>
171 </li>
172 </ul>
173 </li>
174
175 <li class="toctree-l1">
176
177 <a class="" href="../Troubleshooting/">Troubleshooting</a>
178 </li>
179
180 <li class="toctree-l1">
181
182 <span class="caption-text">Development</span>
183 <ul class="subnav">
184 <li class="">
185
186 <a class="" href="../Development-guidelines/">Development guidelines</a>
187 </li>
188 <li class="">
189
190 <a class="" href="../Continuous-integration-tools/">Continuous integration tools</a>
191 </li>
192 <li class="">
193
194 <a class="" href="../GnuPG-signature/">GnuPG signature</a>
195 </li>
196 <li class="">
197
198 <a class="" href="../Coding-guidelines/">Coding guidelines</a>
199 </li>
200 <li class="">
201
202 <a class="" href="../Directory-structure/">Directory structure</a>
203 </li>
204 <li class="">
205
206 <a class="" href="../3rd-party-libraries/">3rd party libraries</a>
207 </li>
208 <li class="">
209
210 <a class="" href="../Plugin-System/">Plugin System</a>
211 </li>
212 <li class="">
213
214 <a class="" href="../Release-Shaarli/">Release Shaarli</a>
215 </li>
216 <li class="">
217
218 <a class="" href="../Versioning-and-Branches/">Versioning and Branches</a>
219 </li>
220 <li class="">
221
222 <a class="" href="../Security/">Security</a>
223 </li>
224 <li class="">
225
226 <a class="" href="../Static-analysis/">Static analysis</a>
227 </li>
228 <li class="">
229
230 <a class="" href="../Theming/">Theming</a>
231 </li>
232 <li class="">
233
234 <a class="" href="../Unit-tests/">Unit tests</a>
235 </li>
236 </ul>
237 </li>
238
239 <li class="toctree-l1">
240
241 <span class="caption-text">About</span>
242 <ul class="subnav">
243 <li class="">
244
245 <a class="" href="../FAQ/">FAQ</a>
246 </li>
247 <li class="">
248
249 <a class="" href="../Community-&-Related-software/">Community & Related software</a>
250 </li>
251 </ul>
252 </li>
253
254 </ul>
255 </div>
256 &nbsp;
257 </nav>
258
259 <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
260
261
262 <nav class="wy-nav-top" role="navigation" aria-label="top navigation">
263 <i data-toggle="wy-nav-top" class="fa fa-bars"></i>
264 <a href="..">Shaarli Documentation</a>
265 </nav>
266
267
268 <div class="wy-nav-content">
269 <div class="rst-content">
270 <div role="navigation" aria-label="breadcrumbs navigation">
271 <ul class="wy-breadcrumbs">
272 <li><a href="..">Docs</a> &raquo;</li>
273
274
275
276 <li>How To &raquo;</li>
277
278
279
280 <li>Create and serve multiple Shaarlis (farm)</li>
281 <li class="wy-breadcrumbs-aside">
282
283 <a href="https://github.com/shaarli/Shaarli/edit/master/docs/Create-and-serve-multiple-Shaarlis-(farm).md"
284 class="icon icon-github"> Edit on GitHub</a>
285
286 </li>
287 </ul>
288 <hr/>
289</div>
290 <div role="main">
291 <div class="section">
292
293 <p>Example bash script (creates multiple shaarli instances and generates an HTML index of them)</p>
294<pre><code class="bash">#!/bin/bash
295set -o errexit
296set -o nounset
297
298#config
299shaarli_base_dir='/var/www/shaarli'
300accounts='bob john whatever username'
301shaarli_repo_url='https://github.com/shaarli/Shaarli'
302ref=&quot;master&quot;
303
304#clone multiple shaarli instances
305if [ ! -d &quot;$shaarli_base_dir&quot; ]; then mkdir &quot;$shaarli_base_dir&quot;; fi
306
307for account in $accounts; do
308 if [ -d &quot;$shaarli_base_dir/$account&quot; ];
309 then echo &quot;[info] account $account already exists, skipping&quot;;
310 else echo &quot;[info] creating new account $account ...&quot;; git clone --quiet &quot;$shaarli_repo_url&quot; -b &quot;$ref&quot; &quot;$shaarli_base_dir/$account&quot;; fi
311done
312
313#generate html index of shaarlis
314htmlhead='&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD HTML 4.01//EN&quot; &quot;http://www.w3.org/TR/html4/strict.dtd&quot;&gt;
315&lt;!-- Minimal html template thanks to http://www.sitepoint.com/a-minimal-html-document/ --&gt;
316&lt;html lang=&quot;en&quot;&gt;
317 &lt;head&gt;
318 &lt;meta http-equiv=&quot;content-type&quot; content=&quot;text/html; charset=utf-8&quot;&gt;
319 &lt;title&gt;My Shaarli farm&lt;/title&gt;
320 &lt;style&gt;body {font-family: &quot;Open Sans&quot;}&lt;/style&gt;
321 &lt;/head&gt;
322 &lt;body&gt;
323 &lt;div&gt;
324 &lt;h1&gt;My Shaarli farm&lt;/h1&gt;
325 &lt;ul style=&quot;list-style-type: none;&quot;&gt;'
326
327accountlinks=''
328
329htmlfooter='
330 &lt;/ul&gt;
331 &lt;/div&gt;
332 &lt;/body&gt;
333&lt;/html&gt;'
334
335
336
337for account in $accounts; do accountlinks=&quot;$accountlinks\n&lt;li&gt;&lt;a href=\&quot;$account\&quot;&gt;$account&lt;/a&gt;&lt;/li&gt;&quot;; done
338if [ -d &quot;$shaarli_base_dir/index.html&quot; ]; then echo &quot;[removing old index.html]&quot;; rm &quot;$shaarli_base_dir/index.html&quot; ]; fi
339echo &quot;[info] generating new index of shaarlis&quot;
340echo -e &quot;$htmlhead $accountlinks $htmlfooter&quot; &gt; &quot;$shaarli_base_dir/index.html&quot;
341echo '[info] done.'
342echo &quot;[info] list of accounts: $accounts&quot;
343echo &quot;[info] contents of $shaarli_base_dir:&quot;
344tree -a -L 1 &quot;$shaarli_base_dir&quot;
345</code></pre>
346
347<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>
348
349 </div>
350 </div>
351 <footer>
352
353 <div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
354
355 <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>
356
357
358 <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>
359
360 </div>
361
362
363 <hr/>
364
365 <div role="contentinfo">
366 <!-- Copyright etc -->
367
368 </div>
369
370 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>.
371</footer>
372
373 </div>
374 </div>
375
376 </section>
377
378 </div>
379
380 <div class="rst-versions" role="note" style="cursor: pointer">
381 <span class="rst-current-version" data-toggle="rst-current-version">
382
383 <a href="https://github.com/shaarli/Shaarli" class="fa fa-github" style="float: left; color: #fcfcfc"> GitHub</a>
384
385
386 <span><a href="../Copy-an-existing-installation-over-SSH-and-serve-it-locally/" style="color: #fcfcfc;">&laquo; Previous</a></span>
387
388
389 <span style="margin-left: 15px"><a href="../Download-CSS-styles-from-an-OPML-list/" style="color: #fcfcfc">Next &raquo;</a></span>
390
391 </span>
392</div>
393 <script src="../js/theme.js"></script>
394
395</body>
396</html>
diff --git a/doc/html/Development-guidelines/index.html b/doc/html/Development-guidelines/index.html
index 747d53a8..e75c911b 100644
--- a/doc/html/Development-guidelines/index.html
+++ b/doc/html/Development-guidelines/index.html
@@ -152,19 +152,7 @@
152 </li> 152 </li>
153 <li class=""> 153 <li class="">
154 154
155 <a class="" href="../Copy-an-existing-installation-over-SSH-and-serve-it-locally/">Copy an existing installation over SSH and serve it locally</a> 155 <a class="" href="../Various-hacks/">Various hacks</a>
156 </li>
157 <li class="">
158
159 <a class="" href="../Create-and-serve-multiple-Shaarlis-(farm)/">Create and serve multiple Shaarlis (farm)</a>
160 </li>
161 <li class="">
162
163 <a class="" href="../Download-CSS-styles-from-an-OPML-list/">Download CSS styles from an OPML list</a>
164 </li>
165 <li class="">
166
167 <a class="" href="../Datastore-hacks/">Datastore hacks</a>
168 </li> 156 </li>
169 </ul> 157 </ul>
170 </li> 158 </li>
diff --git a/doc/html/Directory-structure/index.html b/doc/html/Directory-structure/index.html
index 82979774..ff075ec5 100644
--- a/doc/html/Directory-structure/index.html
+++ b/doc/html/Directory-structure/index.html
@@ -152,19 +152,7 @@
152 </li> 152 </li>
153 <li class=""> 153 <li class="">
154 154
155 <a class="" href="../Copy-an-existing-installation-over-SSH-and-serve-it-locally/">Copy an existing installation over SSH and serve it locally</a> 155 <a class="" href="../Various-hacks/">Various hacks</a>
156 </li>
157 <li class="">
158
159 <a class="" href="../Create-and-serve-multiple-Shaarlis-(farm)/">Create and serve multiple Shaarlis (farm)</a>
160 </li>
161 <li class="">
162
163 <a class="" href="../Download-CSS-styles-from-an-OPML-list/">Download CSS styles from an OPML list</a>
164 </li>
165 <li class="">
166
167 <a class="" href="../Datastore-hacks/">Datastore hacks</a>
168 </li> 156 </li>
169 </ul> 157 </ul>
170 </li> 158 </li>
diff --git a/doc/html/Docker-101/index.html b/doc/html/Docker-101/index.html
index 5b4f645c..31e57b59 100644
--- a/doc/html/Docker-101/index.html
+++ b/doc/html/Docker-101/index.html
@@ -168,19 +168,7 @@
168 </li> 168 </li>
169 <li class=""> 169 <li class="">
170 170
171 <a class="" href="../Copy-an-existing-installation-over-SSH-and-serve-it-locally/">Copy an existing installation over SSH and serve it locally</a> 171 <a class="" href="../Various-hacks/">Various hacks</a>
172 </li>
173 <li class="">
174
175 <a class="" href="../Create-and-serve-multiple-Shaarlis-(farm)/">Create and serve multiple Shaarlis (farm)</a>
176 </li>
177 <li class="">
178
179 <a class="" href="../Download-CSS-styles-from-an-OPML-list/">Download CSS styles from an OPML list</a>
180 </li>
181 <li class="">
182
183 <a class="" href="../Datastore-hacks/">Datastore hacks</a>
184 </li> 172 </li>
185 </ul> 173 </ul>
186 </li> 174 </li>
diff --git a/doc/html/Docker-resources/index.html b/doc/html/Docker-resources/index.html
index 7bd7067d..169a0297 100644
--- a/doc/html/Docker-resources/index.html
+++ b/doc/html/Docker-resources/index.html
@@ -164,19 +164,7 @@
164 </li> 164 </li>
165 <li class=""> 165 <li class="">
166 166
167 <a class="" href="../Copy-an-existing-installation-over-SSH-and-serve-it-locally/">Copy an existing installation over SSH and serve it locally</a> 167 <a class="" href="../Various-hacks/">Various hacks</a>
168 </li>
169 <li class="">
170
171 <a class="" href="../Create-and-serve-multiple-Shaarlis-(farm)/">Create and serve multiple Shaarlis (farm)</a>
172 </li>
173 <li class="">
174
175 <a class="" href="../Download-CSS-styles-from-an-OPML-list/">Download CSS styles from an OPML list</a>
176 </li>
177 <li class="">
178
179 <a class="" href="../Datastore-hacks/">Datastore hacks</a>
180 </li> 168 </li>
181 </ul> 169 </ul>
182 </li> 170 </li>
diff --git a/doc/html/Download-CSS-styles-from-an-OPML-list/index.html b/doc/html/Download-CSS-styles-from-an-OPML-list/index.html
deleted file mode 100644
index e697b39d..00000000
--- a/doc/html/Download-CSS-styles-from-an-OPML-list/index.html
+++ /dev/null
@@ -1,496 +0,0 @@
1<!DOCTYPE html>
2<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]-->
3<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]-->
4<head>
5 <meta charset="utf-8">
6 <meta http-equiv="X-UA-Compatible" content="IE=edge">
7 <meta name="viewport" content="width=device-width, initial-scale=1.0">
8
9
10 <link rel="shortcut icon" href="../img/favicon.ico">
11 <title>Download CSS styles from an OPML list - Shaarli Documentation</title>
12 <link href='https://fonts.googleapis.com/css?family=Lato:400,700|Roboto+Slab:400,700|Inconsolata:400,700' rel='stylesheet' type='text/css'>
13
14 <link rel="stylesheet" href="../css/theme.css" type="text/css" />
15 <link rel="stylesheet" href="../css/theme_extra.css" type="text/css" />
16 <link rel="stylesheet" href="../css/highlight.css">
17 <link href="../github-markdown.css" rel="stylesheet">
18
19 <script>
20 // Current page data
21 var mkdocs_page_name = "Download CSS styles from an OPML list";
22 var mkdocs_page_input_path = "Download-CSS-styles-from-an-OPML-list.md";
23 var mkdocs_page_url = "/Download-CSS-styles-from-an-OPML-list/";
24 </script>
25
26 <script src="../js/jquery-2.1.1.min.js"></script>
27 <script src="../js/modernizr-2.8.3.min.js"></script>
28 <script type="text/javascript" src="../js/highlight.pack.js"></script>
29
30</head>
31
32<body class="wy-body-for-nav" role="document">
33
34 <div class="wy-grid-for-nav">
35
36
37 <nav data-toggle="wy-nav-shift" class="wy-nav-side stickynav">
38 <div class="wy-side-nav-search">
39 <a href=".." class="icon icon-home"> Shaarli Documentation</a>
40 <div role="search">
41 <form id ="rtd-search-form" class="wy-form" action="../search.html" method="get">
42 <input type="text" name="q" placeholder="Search docs" />
43 </form>
44</div>
45 </div>
46
47 <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
48 <ul class="current">
49
50
51 <li class="toctree-l1">
52
53 <a class="" href="..">Home</a>
54 </li>
55
56 <li class="toctree-l1">
57
58 <span class="caption-text">Setup</span>
59 <ul class="subnav">
60 <li class="">
61
62 <a class="" href="../Download-and-Installation/">Download and Installation</a>
63 </li>
64 <li class="">
65
66 <a class="" href="../Upgrade-and-migration/">Upgrade and migration</a>
67 </li>
68 <li class="">
69
70 <a class="" href="../Server-requirements/">Server requirements</a>
71 </li>
72 <li class="">
73
74 <a class="" href="../Server-configuration/">Server configuration</a>
75 </li>
76 <li class="">
77
78 <a class="" href="../Server-security/">Server security</a>
79 </li>
80 <li class="">
81
82 <a class="" href="../Shaarli-configuration/">Shaarli configuration</a>
83 </li>
84 <li class="">
85
86 <a class="" href="../Plugins/">Plugins</a>
87 </li>
88 </ul>
89 </li>
90
91 <li class="toctree-l1">
92
93 <span class="caption-text">Docker</span>
94 <ul class="subnav">
95 <li class="">
96
97 <a class="" href="../Docker-101/">Docker 101</a>
98 </li>
99 <li class="">
100
101 <a class="" href="../Shaarli-images/">Shaarli images</a>
102 </li>
103 <li class="">
104
105 <a class="" href="../Reverse-proxy-configuration/">Reverse proxy configuration</a>
106 </li>
107 <li class="">
108
109 <a class="" href="../Docker-resources/">Docker resources</a>
110 </li>
111 </ul>
112 </li>
113
114 <li class="toctree-l1">
115
116 <span class="caption-text">Usage</span>
117 <ul class="subnav">
118 <li class="">
119
120 <a class="" href="../Features/">Features</a>
121 </li>
122 <li class="">
123
124 <a class="" href="../Bookmarklet/">Bookmarklet</a>
125 </li>
126 <li class="">
127
128 <a class="" href="../Browsing-and-searching/">Browsing and searching</a>
129 </li>
130 <li class="">
131
132 <a class="" href="../Firefox-share/">Firefox share</a>
133 </li>
134 <li class="">
135
136 <a class="" href="../RSS-feeds/">RSS feeds</a>
137 </li>
138 <li class="">
139
140 <a class="" href="../REST-API/">REST API</a>
141 </li>
142 </ul>
143 </li>
144
145 <li class="toctree-l1">
146
147 <span class="caption-text">How To</span>
148 <ul class="subnav">
149 <li class="">
150
151 <a class="" href="../Backup,-restore,-import-and-export/">Backup, restore, import and export</a>
152 </li>
153 <li class="">
154
155 <a class="" href="../Copy-an-existing-installation-over-SSH-and-serve-it-locally/">Copy an existing installation over SSH and serve it locally</a>
156 </li>
157 <li class="">
158
159 <a class="" href="../Create-and-serve-multiple-Shaarlis-(farm)/">Create and serve multiple Shaarlis (farm)</a>
160 </li>
161 <li class=" current">
162
163 <a class="current" href="./">Download CSS styles from an OPML list</a>
164 <ul class="subnav">
165
166 <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>
167
168
169 </ul>
170 </li>
171 <li class="">
172
173 <a class="" href="../Datastore-hacks/">Datastore hacks</a>
174 </li>
175 </ul>
176 </li>
177
178 <li class="toctree-l1">
179
180 <a class="" href="../Troubleshooting/">Troubleshooting</a>
181 </li>
182
183 <li class="toctree-l1">
184
185 <span class="caption-text">Development</span>
186 <ul class="subnav">
187 <li class="">
188
189 <a class="" href="../Development-guidelines/">Development guidelines</a>
190 </li>
191 <li class="">
192
193 <a class="" href="../Continuous-integration-tools/">Continuous integration tools</a>
194 </li>
195 <li class="">
196
197 <a class="" href="../GnuPG-signature/">GnuPG signature</a>
198 </li>
199 <li class="">
200
201 <a class="" href="../Coding-guidelines/">Coding guidelines</a>
202 </li>
203 <li class="">
204
205 <a class="" href="../Directory-structure/">Directory structure</a>
206 </li>
207 <li class="">
208
209 <a class="" href="../3rd-party-libraries/">3rd party libraries</a>
210 </li>
211 <li class="">
212
213 <a class="" href="../Plugin-System/">Plugin System</a>
214 </li>
215 <li class="">
216
217 <a class="" href="../Release-Shaarli/">Release Shaarli</a>
218 </li>
219 <li class="">
220
221 <a class="" href="../Versioning-and-Branches/">Versioning and Branches</a>
222 </li>
223 <li class="">
224
225 <a class="" href="../Security/">Security</a>
226 </li>
227 <li class="">
228
229 <a class="" href="../Static-analysis/">Static analysis</a>
230 </li>
231 <li class="">
232
233 <a class="" href="../Theming/">Theming</a>
234 </li>
235 <li class="">
236
237 <a class="" href="../Unit-tests/">Unit tests</a>
238 </li>
239 </ul>
240 </li>
241
242 <li class="toctree-l1">
243
244 <span class="caption-text">About</span>
245 <ul class="subnav">
246 <li class="">
247
248 <a class="" href="../FAQ/">FAQ</a>
249 </li>
250 <li class="">
251
252 <a class="" href="../Community-&-Related-software/">Community & Related software</a>
253 </li>
254 </ul>
255 </li>
256
257 </ul>
258 </div>
259 &nbsp;
260 </nav>
261
262 <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
263
264
265 <nav class="wy-nav-top" role="navigation" aria-label="top navigation">
266 <i data-toggle="wy-nav-top" class="fa fa-bars"></i>
267 <a href="..">Shaarli Documentation</a>
268 </nav>
269
270
271 <div class="wy-nav-content">
272 <div class="rst-content">
273 <div role="navigation" aria-label="breadcrumbs navigation">
274 <ul class="wy-breadcrumbs">
275 <li><a href="..">Docs</a> &raquo;</li>
276
277
278
279 <li>How To &raquo;</li>
280
281
282
283 <li>Download CSS styles from an OPML list</li>
284 <li class="wy-breadcrumbs-aside">
285
286 <a href="https://github.com/shaarli/Shaarli/edit/master/docs/Download-CSS-styles-from-an-OPML-list.md"
287 class="icon icon-github"> Edit on GitHub</a>
288
289 </li>
290 </ul>
291 <hr/>
292</div>
293 <div role="main">
294 <div class="section">
295
296 <h3 id="download-css-styles-for-shaarlis-listed-in-an-opml-file">Download CSS styles for shaarlis listed in an opml file</h3>
297<p>Example php script:</p>
298<pre><code class="php">&lt;!---- ?php --&gt;
299&lt;!---- Copyright (c) 2014 Nicolas Delsaux (https://github.com/Riduidel) --&gt;
300&lt;!---- License: zlib (http://www.gzip.org/zlib/zlib_license.html) --&gt;
301
302/**
303 * Source: https://github.com/Riduidel
304 * Download css styles for shaarlis listed in an opml file
305 */
306define(&quot;SHAARLI_RSS_OPML&quot;, &quot;https://www.ecirtam.net/shaarlirss/custom/people.opml&quot;);
307
308define(&quot;THEMES_TEMP_FOLDER&quot;, &quot;new_themes&quot;);
309
310if(!file_exists(THEMES_TEMP_FOLDER)) {
311 mkdir(THEMES_TEMP_FOLDER);
312}
313
314function siteUrl($pathInSite) {
315 $indexPos = strpos($pathInSite, &quot;index.php&quot;);
316 if(!$indexPos) {
317 return $pathInSite;
318 } else {
319 return substr($pathInSite, 0, $indexPos);
320 }
321}
322
323function createShaarliHashFromOPMLL($opmlFile) {
324 $result = array();
325 $opml = file_get_contents($opmlFile);
326 $opmlXml = simplexml_load_string($opml);
327 $outlineElements = $opmlXml-&gt;xpath(&quot;body/outline&quot;);
328 foreach($outlineElements as $site) {
329 $siteUrl = siteUrl((string) $site['htmlUrl']);
330 $result[$siteUrl]=((string) $site['text']);
331 }
332 return $result;
333}
334
335function getSiteFolder($url) {
336 $domain = parse_url($url, PHP_URL_HOST);
337 return THEMES_TEMP_FOLDER.&quot;/&quot;.str_replace(&quot;.&quot;, &quot;_&quot;, $domain);
338}
339
340function get_http_response_code($theURL) {
341 $headers = get_headers($theURL);
342 return substr($headers[0], 9, 3);
343}
344
345/**
346 * This makes the code PHP-5 only (particularly the call to &quot;get_headers&quot;)
347 */
348function copyUserStyleFrom($url, $name, $knownStyles) {
349 $userStyle = $url.&quot;inc/user.css&quot;;
350 if(in_array($url, $knownStyles)) {
351 // TODO add log message
352 } else {
353 $statusCode = get_http_response_code($userStyle);
354 if(intval($statusCode)&lt;300) {
355 $styleSheet = file_get_contents($userStyle);
356 $siteFolder = getSiteFolder($url);
357 if(!file_exists($siteFolder)) {
358 mkdir($siteFolder);
359 }
360 if(!file_exists($siteFolder.'/user.css')) {
361 // Copy stylesheet
362 file_put_contents($siteFolder.'/user.css', $styleSheet);
363 }
364 if(!file_exists($siteFolder.'/README.md')) {
365 // Then write a readme.md file
366 file_put_contents($siteFolder.'/README.md',
367 &quot;User style from &quot;.$name.&quot;\n&quot;
368 .&quot;=============================&quot;
369 .&quot;\n\n&quot;
370 .&quot;This stylesheet was downloaded from &quot;.$userStyle.&quot; on &quot;.date(DATE_RFC822)
371 );
372 }
373 if(!file_exists($siteFolder.'/config.ini')) {
374 // Write a config file containing useful informations
375 file_put_contents($siteFolder.'/config.ini',
376 &quot;site_url=&quot;.$url.&quot;\n&quot;
377 .&quot;site_name=&quot;.$name.&quot;\n&quot;
378 );
379 }
380 if(!file_exists($siteFolder.'/home.png')) {
381 // And finally copy generated thumbnail
382 $homeThumb = $siteFolder.'/home.png';
383 file_put_contents($siteFolder.'/home.png', file_get_contents(getThumbnailUrl($url)));
384 }
385 echo 'Theme have been downloaded from &lt;a href=&quot;'.$url.'&quot;&gt;'.$url.'&lt;/a&gt; into '.$siteFolder
386 .'. It looks like &lt;img src=&quot;'.$homeThumb.'&quot;&gt;&lt;br/&gt;';
387 }
388 }
389}
390
391function getThumbnailUrl($url) {
392 return 'http://api.webthumbnail.org/?url='.$url;
393}
394
395function copyUserStylesFrom($urlToNames, $knownStyles) {
396 foreach($urlToNames as $url =&gt; $name) {
397 copyUserStyleFrom($url, $name, $knownStyles);
398 }
399}
400
401/**
402 * Reading directory list, courtesy of http://www.laughing-buddha.net/php/dirlist/
403 * @param directory the directory we want to list files of
404 * @return a simple array containing the list of absolute file paths. Notice that current file (&quot;.&quot;) and parent one(&quot;..&quot;)
405 * are not listed here
406 */
407function getDirectoryList ($directory) {
408 $realPath = realpath($directory);
409 // create an array to hold directory list
410 $results = array();
411 // create a handler for the directory
412 $handler = opendir($directory);
413 // open directory and walk through the filenames
414 while ($file = readdir($handler)) {
415 // if file isn't this directory or its parent, add it to the results
416 if ($file != &quot;.&quot; &amp;&amp; $file != &quot;..&quot;) {
417 $results[] = realpath($realPath . &quot;/&quot; . $file);
418 }
419 }
420 // tidy up: close the handler
421 closedir($handler);
422 // done!
423 return $results;
424}
425
426/**
427 * Start in themes folder and look in all subfolders for config.ini files.
428 * These config.ini files allow us not to download styles again and again
429 */
430function findKnownStyles() {
431 $result = array();
432 $subFolders = getDirectoryList(&quot;themes&quot;);
433 foreach($subFolders as $folder) {
434 $configFile = $folder.&quot;/config.ini&quot;;
435 if(file_exists($configFile)) {
436 $iniParameters = parse_ini_file($configFile);
437 array_push($result, $iniParameters['site_url']);
438 }
439 }
440 return $result;
441}
442
443$knownStyles = findKnownStyles();
444copyUserStylesFrom(createShaarliHashFromOPMLL(SHAARLI_RSS_OPML), $knownStyles);
445
446&lt;!--- ? ----&gt;
447</code></pre>
448
449 </div>
450 </div>
451 <footer>
452
453 <div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
454
455 <a href="../Datastore-hacks/" class="btn btn-neutral float-right" title="Datastore hacks">Next <span class="icon icon-circle-arrow-right"></span></a>
456
457
458 <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>
459
460 </div>
461
462
463 <hr/>
464
465 <div role="contentinfo">
466 <!-- Copyright etc -->
467
468 </div>
469
470 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>.
471</footer>
472
473 </div>
474 </div>
475
476 </section>
477
478 </div>
479
480 <div class="rst-versions" role="note" style="cursor: pointer">
481 <span class="rst-current-version" data-toggle="rst-current-version">
482
483 <a href="https://github.com/shaarli/Shaarli" class="fa fa-github" style="float: left; color: #fcfcfc"> GitHub</a>
484
485
486 <span><a href="../Create-and-serve-multiple-Shaarlis-(farm)/" style="color: #fcfcfc;">&laquo; Previous</a></span>
487
488
489 <span style="margin-left: 15px"><a href="../Datastore-hacks/" style="color: #fcfcfc">Next &raquo;</a></span>
490
491 </span>
492</div>
493 <script src="../js/theme.js"></script>
494
495</body>
496</html>
diff --git a/doc/html/Download-and-Installation/index.html b/doc/html/Download-and-Installation/index.html
index 1ede1d68..92342681 100644
--- a/doc/html/Download-and-Installation/index.html
+++ b/doc/html/Download-and-Installation/index.html
@@ -186,19 +186,7 @@
186 </li> 186 </li>
187 <li class=""> 187 <li class="">
188 188
189 <a class="" href="../Copy-an-existing-installation-over-SSH-and-serve-it-locally/">Copy an existing installation over SSH and serve it locally</a> 189 <a class="" href="../Various-hacks/">Various hacks</a>
190 </li>
191 <li class="">
192
193 <a class="" href="../Create-and-serve-multiple-Shaarlis-(farm)/">Create and serve multiple Shaarlis (farm)</a>
194 </li>
195 <li class="">
196
197 <a class="" href="../Download-CSS-styles-from-an-OPML-list/">Download CSS styles from an OPML list</a>
198 </li>
199 <li class="">
200
201 <a class="" href="../Datastore-hacks/">Datastore hacks</a>
202 </li> 190 </li>
203 </ul> 191 </ul>
204 </li> 192 </li>
diff --git a/doc/html/FAQ/index.html b/doc/html/FAQ/index.html
index c48e11f8..f8ced260 100644
--- a/doc/html/FAQ/index.html
+++ b/doc/html/FAQ/index.html
@@ -152,19 +152,7 @@
152 </li> 152 </li>
153 <li class=""> 153 <li class="">
154 154
155 <a class="" href="../Copy-an-existing-installation-over-SSH-and-serve-it-locally/">Copy an existing installation over SSH and serve it locally</a> 155 <a class="" href="../Various-hacks/">Various hacks</a>
156 </li>
157 <li class="">
158
159 <a class="" href="../Create-and-serve-multiple-Shaarlis-(farm)/">Create and serve multiple Shaarlis (farm)</a>
160 </li>
161 <li class="">
162
163 <a class="" href="../Download-CSS-styles-from-an-OPML-list/">Download CSS styles from an OPML list</a>
164 </li>
165 <li class="">
166
167 <a class="" href="../Datastore-hacks/">Datastore hacks</a>
168 </li> 156 </li>
169 </ul> 157 </ul>
170 </li> 158 </li>
diff --git a/doc/html/Features/index.html b/doc/html/Features/index.html
index 453f189a..e847c546 100644
--- a/doc/html/Features/index.html
+++ b/doc/html/Features/index.html
@@ -161,19 +161,7 @@
161 </li> 161 </li>
162 <li class=""> 162 <li class="">
163 163
164 <a class="" href="../Copy-an-existing-installation-over-SSH-and-serve-it-locally/">Copy an existing installation over SSH and serve it locally</a> 164 <a class="" href="../Various-hacks/">Various hacks</a>
165 </li>
166 <li class="">
167
168 <a class="" href="../Create-and-serve-multiple-Shaarlis-(farm)/">Create and serve multiple Shaarlis (farm)</a>
169 </li>
170 <li class="">
171
172 <a class="" href="../Download-CSS-styles-from-an-OPML-list/">Download CSS styles from an OPML list</a>
173 </li>
174 <li class="">
175
176 <a class="" href="../Datastore-hacks/">Datastore hacks</a>
177 </li> 165 </li>
178 </ul> 166 </ul>
179 </li> 167 </li>
diff --git a/doc/html/Firefox-share/index.html b/doc/html/Firefox-share/index.html
index c0aaf4bd..9c028ffc 100644
--- a/doc/html/Firefox-share/index.html
+++ b/doc/html/Firefox-share/index.html
@@ -161,19 +161,7 @@
161 </li> 161 </li>
162 <li class=""> 162 <li class="">
163 163
164 <a class="" href="../Copy-an-existing-installation-over-SSH-and-serve-it-locally/">Copy an existing installation over SSH and serve it locally</a> 164 <a class="" href="../Various-hacks/">Various hacks</a>
165 </li>
166 <li class="">
167
168 <a class="" href="../Create-and-serve-multiple-Shaarlis-(farm)/">Create and serve multiple Shaarlis (farm)</a>
169 </li>
170 <li class="">
171
172 <a class="" href="../Download-CSS-styles-from-an-OPML-list/">Download CSS styles from an OPML list</a>
173 </li>
174 <li class="">
175
176 <a class="" href="../Datastore-hacks/">Datastore hacks</a>
177 </li> 165 </li>
178 </ul> 166 </ul>
179 </li> 167 </li>
diff --git a/doc/html/GnuPG-signature/index.html b/doc/html/GnuPG-signature/index.html
index 781ccd2d..0b2d842a 100644
--- a/doc/html/GnuPG-signature/index.html
+++ b/doc/html/GnuPG-signature/index.html
@@ -152,19 +152,7 @@
152 </li> 152 </li>
153 <li class=""> 153 <li class="">
154 154
155 <a class="" href="../Copy-an-existing-installation-over-SSH-and-serve-it-locally/">Copy an existing installation over SSH and serve it locally</a> 155 <a class="" href="../Various-hacks/">Various hacks</a>
156 </li>
157 <li class="">
158
159 <a class="" href="../Create-and-serve-multiple-Shaarlis-(farm)/">Create and serve multiple Shaarlis (farm)</a>
160 </li>
161 <li class="">
162
163 <a class="" href="../Download-CSS-styles-from-an-OPML-list/">Download CSS styles from an OPML list</a>
164 </li>
165 <li class="">
166
167 <a class="" href="../Datastore-hacks/">Datastore hacks</a>
168 </li> 156 </li>
169 </ul> 157 </ul>
170 </li> 158 </li>
diff --git a/doc/html/Plugin-System/index.html b/doc/html/Plugin-System/index.html
index 5ee0f6c1..dbed5908 100644
--- a/doc/html/Plugin-System/index.html
+++ b/doc/html/Plugin-System/index.html
@@ -152,19 +152,7 @@
152 </li> 152 </li>
153 <li class=""> 153 <li class="">
154 154
155 <a class="" href="../Copy-an-existing-installation-over-SSH-and-serve-it-locally/">Copy an existing installation over SSH and serve it locally</a> 155 <a class="" href="../Various-hacks/">Various hacks</a>
156 </li>
157 <li class="">
158
159 <a class="" href="../Create-and-serve-multiple-Shaarlis-(farm)/">Create and serve multiple Shaarlis (farm)</a>
160 </li>
161 <li class="">
162
163 <a class="" href="../Download-CSS-styles-from-an-OPML-list/">Download CSS styles from an OPML list</a>
164 </li>
165 <li class="">
166
167 <a class="" href="../Datastore-hacks/">Datastore hacks</a>
168 </li> 156 </li>
169 </ul> 157 </ul>
170 </li> 158 </li>
diff --git a/doc/html/Plugins/index.html b/doc/html/Plugins/index.html
index 3a30e93c..4b63681e 100644
--- a/doc/html/Plugins/index.html
+++ b/doc/html/Plugins/index.html
@@ -173,19 +173,7 @@
173 </li> 173 </li>
174 <li class=""> 174 <li class="">
175 175
176 <a class="" href="../Copy-an-existing-installation-over-SSH-and-serve-it-locally/">Copy an existing installation over SSH and serve it locally</a> 176 <a class="" href="../Various-hacks/">Various hacks</a>
177 </li>
178 <li class="">
179
180 <a class="" href="../Create-and-serve-multiple-Shaarlis-(farm)/">Create and serve multiple Shaarlis (farm)</a>
181 </li>
182 <li class="">
183
184 <a class="" href="../Download-CSS-styles-from-an-OPML-list/">Download CSS styles from an OPML list</a>
185 </li>
186 <li class="">
187
188 <a class="" href="../Datastore-hacks/">Datastore hacks</a>
189 </li> 177 </li>
190 </ul> 178 </ul>
191 </li> 179 </li>
diff --git a/doc/html/REST-API/index.html b/doc/html/REST-API/index.html
index 2c244bca..6e2c9518 100644
--- a/doc/html/REST-API/index.html
+++ b/doc/html/REST-API/index.html
@@ -169,19 +169,7 @@
169 </li> 169 </li>
170 <li class=""> 170 <li class="">
171 171
172 <a class="" href="../Copy-an-existing-installation-over-SSH-and-serve-it-locally/">Copy an existing installation over SSH and serve it locally</a> 172 <a class="" href="../Various-hacks/">Various hacks</a>
173 </li>
174 <li class="">
175
176 <a class="" href="../Create-and-serve-multiple-Shaarlis-(farm)/">Create and serve multiple Shaarlis (farm)</a>
177 </li>
178 <li class="">
179
180 <a class="" href="../Download-CSS-styles-from-an-OPML-list/">Download CSS styles from an OPML list</a>
181 </li>
182 <li class="">
183
184 <a class="" href="../Datastore-hacks/">Datastore hacks</a>
185 </li> 173 </li>
186 </ul> 174 </ul>
187 </li> 175 </li>
diff --git a/doc/html/RSS-feeds/index.html b/doc/html/RSS-feeds/index.html
index bb6e412c..a4b7339f 100644
--- a/doc/html/RSS-feeds/index.html
+++ b/doc/html/RSS-feeds/index.html
@@ -161,19 +161,7 @@
161 </li> 161 </li>
162 <li class=""> 162 <li class="">
163 163
164 <a class="" href="../Copy-an-existing-installation-over-SSH-and-serve-it-locally/">Copy an existing installation over SSH and serve it locally</a> 164 <a class="" href="../Various-hacks/">Various hacks</a>
165 </li>
166 <li class="">
167
168 <a class="" href="../Create-and-serve-multiple-Shaarlis-(farm)/">Create and serve multiple Shaarlis (farm)</a>
169 </li>
170 <li class="">
171
172 <a class="" href="../Download-CSS-styles-from-an-OPML-list/">Download CSS styles from an OPML list</a>
173 </li>
174 <li class="">
175
176 <a class="" href="../Datastore-hacks/">Datastore hacks</a>
177 </li> 165 </li>
178 </ul> 166 </ul>
179 </li> 167 </li>
diff --git a/doc/html/Release-Shaarli/index.html b/doc/html/Release-Shaarli/index.html
index cf5fcee8..92433203 100644
--- a/doc/html/Release-Shaarli/index.html
+++ b/doc/html/Release-Shaarli/index.html
@@ -152,19 +152,7 @@
152 </li> 152 </li>
153 <li class=""> 153 <li class="">
154 154
155 <a class="" href="../Copy-an-existing-installation-over-SSH-and-serve-it-locally/">Copy an existing installation over SSH and serve it locally</a> 155 <a class="" href="../Various-hacks/">Various hacks</a>
156 </li>
157 <li class="">
158
159 <a class="" href="../Create-and-serve-multiple-Shaarlis-(farm)/">Create and serve multiple Shaarlis (farm)</a>
160 </li>
161 <li class="">
162
163 <a class="" href="../Download-CSS-styles-from-an-OPML-list/">Download CSS styles from an OPML list</a>
164 </li>
165 <li class="">
166
167 <a class="" href="../Datastore-hacks/">Datastore hacks</a>
168 </li> 156 </li>
169 </ul> 157 </ul>
170 </li> 158 </li>
diff --git a/doc/html/Reverse-proxy-configuration/index.html b/doc/html/Reverse-proxy-configuration/index.html
index bebd663f..f573c5cd 100644
--- a/doc/html/Reverse-proxy-configuration/index.html
+++ b/doc/html/Reverse-proxy-configuration/index.html
@@ -161,19 +161,7 @@
161 </li> 161 </li>
162 <li class=""> 162 <li class="">
163 163
164 <a class="" href="../Copy-an-existing-installation-over-SSH-and-serve-it-locally/">Copy an existing installation over SSH and serve it locally</a> 164 <a class="" href="../Various-hacks/">Various hacks</a>
165 </li>
166 <li class="">
167
168 <a class="" href="../Create-and-serve-multiple-Shaarlis-(farm)/">Create and serve multiple Shaarlis (farm)</a>
169 </li>
170 <li class="">
171
172 <a class="" href="../Download-CSS-styles-from-an-OPML-list/">Download CSS styles from an OPML list</a>
173 </li>
174 <li class="">
175
176 <a class="" href="../Datastore-hacks/">Datastore hacks</a>
177 </li> 165 </li>
178 </ul> 166 </ul>
179 </li> 167 </li>
diff --git a/doc/html/Security/index.html b/doc/html/Security/index.html
index 19b569e6..c7aec584 100644
--- a/doc/html/Security/index.html
+++ b/doc/html/Security/index.html
@@ -152,19 +152,7 @@
152 </li> 152 </li>
153 <li class=""> 153 <li class="">
154 154
155 <a class="" href="../Copy-an-existing-installation-over-SSH-and-serve-it-locally/">Copy an existing installation over SSH and serve it locally</a> 155 <a class="" href="../Various-hacks/">Various hacks</a>
156 </li>
157 <li class="">
158
159 <a class="" href="../Create-and-serve-multiple-Shaarlis-(farm)/">Create and serve multiple Shaarlis (farm)</a>
160 </li>
161 <li class="">
162
163 <a class="" href="../Download-CSS-styles-from-an-OPML-list/">Download CSS styles from an OPML list</a>
164 </li>
165 <li class="">
166
167 <a class="" href="../Datastore-hacks/">Datastore hacks</a>
168 </li> 156 </li>
169 </ul> 157 </ul>
170 </li> 158 </li>
diff --git a/doc/html/Server-configuration/index.html b/doc/html/Server-configuration/index.html
index beb8cd08..6e798b4b 100644
--- a/doc/html/Server-configuration/index.html
+++ b/doc/html/Server-configuration/index.html
@@ -207,19 +207,7 @@
207 </li> 207 </li>
208 <li class=""> 208 <li class="">
209 209
210 <a class="" href="../Copy-an-existing-installation-over-SSH-and-serve-it-locally/">Copy an existing installation over SSH and serve it locally</a> 210 <a class="" href="../Various-hacks/">Various hacks</a>
211 </li>
212 <li class="">
213
214 <a class="" href="../Create-and-serve-multiple-Shaarlis-(farm)/">Create and serve multiple Shaarlis (farm)</a>
215 </li>
216 <li class="">
217
218 <a class="" href="../Download-CSS-styles-from-an-OPML-list/">Download CSS styles from an OPML list</a>
219 </li>
220 <li class="">
221
222 <a class="" href="../Datastore-hacks/">Datastore hacks</a>
223 </li> 211 </li>
224 </ul> 212 </ul>
225 </li> 213 </li>
diff --git a/doc/html/Server-requirements/index.html b/doc/html/Server-requirements/index.html
index ab1b0d35..f3bfa185 100644
--- a/doc/html/Server-requirements/index.html
+++ b/doc/html/Server-requirements/index.html
@@ -170,19 +170,7 @@
170 </li> 170 </li>
171 <li class=""> 171 <li class="">
172 172
173 <a class="" href="../Copy-an-existing-installation-over-SSH-and-serve-it-locally/">Copy an existing installation over SSH and serve it locally</a> 173 <a class="" href="../Various-hacks/">Various hacks</a>
174 </li>
175 <li class="">
176
177 <a class="" href="../Create-and-serve-multiple-Shaarlis-(farm)/">Create and serve multiple Shaarlis (farm)</a>
178 </li>
179 <li class="">
180
181 <a class="" href="../Download-CSS-styles-from-an-OPML-list/">Download CSS styles from an OPML list</a>
182 </li>
183 <li class="">
184
185 <a class="" href="../Datastore-hacks/">Datastore hacks</a>
186 </li> 174 </li>
187 </ul> 175 </ul>
188 </li> 176 </li>
diff --git a/doc/html/Server-security/index.html b/doc/html/Server-security/index.html
index dbe99515..6d9f25c0 100644
--- a/doc/html/Server-security/index.html
+++ b/doc/html/Server-security/index.html
@@ -176,19 +176,7 @@
176 </li> 176 </li>
177 <li class=""> 177 <li class="">
178 178
179 <a class="" href="../Copy-an-existing-installation-over-SSH-and-serve-it-locally/">Copy an existing installation over SSH and serve it locally</a> 179 <a class="" href="../Various-hacks/">Various hacks</a>
180 </li>
181 <li class="">
182
183 <a class="" href="../Create-and-serve-multiple-Shaarlis-(farm)/">Create and serve multiple Shaarlis (farm)</a>
184 </li>
185 <li class="">
186
187 <a class="" href="../Download-CSS-styles-from-an-OPML-list/">Download CSS styles from an OPML list</a>
188 </li>
189 <li class="">
190
191 <a class="" href="../Datastore-hacks/">Datastore hacks</a>
192 </li> 180 </li>
193 </ul> 181 </ul>
194 </li> 182 </li>
diff --git a/doc/html/Shaarli-configuration/index.html b/doc/html/Shaarli-configuration/index.html
index 95a487d0..4e556061 100644
--- a/doc/html/Shaarli-configuration/index.html
+++ b/doc/html/Shaarli-configuration/index.html
@@ -192,19 +192,7 @@
192 </li> 192 </li>
193 <li class=""> 193 <li class="">
194 194
195 <a class="" href="../Copy-an-existing-installation-over-SSH-and-serve-it-locally/">Copy an existing installation over SSH and serve it locally</a> 195 <a class="" href="../Various-hacks/">Various hacks</a>
196 </li>
197 <li class="">
198
199 <a class="" href="../Create-and-serve-multiple-Shaarlis-(farm)/">Create and serve multiple Shaarlis (farm)</a>
200 </li>
201 <li class="">
202
203 <a class="" href="../Download-CSS-styles-from-an-OPML-list/">Download CSS styles from an OPML list</a>
204 </li>
205 <li class="">
206
207 <a class="" href="../Datastore-hacks/">Datastore hacks</a>
208 </li> 196 </li>
209 </ul> 197 </ul>
210 </li> 198 </li>
diff --git a/doc/html/Shaarli-images/index.html b/doc/html/Shaarli-images/index.html
index 0fa93ca3..4a1cf66b 100644
--- a/doc/html/Shaarli-images/index.html
+++ b/doc/html/Shaarli-images/index.html
@@ -172,19 +172,7 @@
172 </li> 172 </li>
173 <li class=""> 173 <li class="">
174 174
175 <a class="" href="../Copy-an-existing-installation-over-SSH-and-serve-it-locally/">Copy an existing installation over SSH and serve it locally</a> 175 <a class="" href="../Various-hacks/">Various hacks</a>
176 </li>
177 <li class="">
178
179 <a class="" href="../Create-and-serve-multiple-Shaarlis-(farm)/">Create and serve multiple Shaarlis (farm)</a>
180 </li>
181 <li class="">
182
183 <a class="" href="../Download-CSS-styles-from-an-OPML-list/">Download CSS styles from an OPML list</a>
184 </li>
185 <li class="">
186
187 <a class="" href="../Datastore-hacks/">Datastore hacks</a>
188 </li> 176 </li>
189 </ul> 177 </ul>
190 </li> 178 </li>
diff --git a/doc/html/Static-analysis/index.html b/doc/html/Static-analysis/index.html
index 0dfb5519..ddd81f86 100644
--- a/doc/html/Static-analysis/index.html
+++ b/doc/html/Static-analysis/index.html
@@ -152,19 +152,7 @@
152 </li> 152 </li>
153 <li class=""> 153 <li class="">
154 154
155 <a class="" href="../Copy-an-existing-installation-over-SSH-and-serve-it-locally/">Copy an existing installation over SSH and serve it locally</a> 155 <a class="" href="../Various-hacks/">Various hacks</a>
156 </li>
157 <li class="">
158
159 <a class="" href="../Create-and-serve-multiple-Shaarlis-(farm)/">Create and serve multiple Shaarlis (farm)</a>
160 </li>
161 <li class="">
162
163 <a class="" href="../Download-CSS-styles-from-an-OPML-list/">Download CSS styles from an OPML list</a>
164 </li>
165 <li class="">
166
167 <a class="" href="../Datastore-hacks/">Datastore hacks</a>
168 </li> 156 </li>
169 </ul> 157 </ul>
170 </li> 158 </li>
diff --git a/doc/html/Theming/index.html b/doc/html/Theming/index.html
index 70a36dd4..670dbb80 100644
--- a/doc/html/Theming/index.html
+++ b/doc/html/Theming/index.html
@@ -152,19 +152,7 @@
152 </li> 152 </li>
153 <li class=""> 153 <li class="">
154 154
155 <a class="" href="../Copy-an-existing-installation-over-SSH-and-serve-it-locally/">Copy an existing installation over SSH and serve it locally</a> 155 <a class="" href="../Various-hacks/">Various hacks</a>
156 </li>
157 <li class="">
158
159 <a class="" href="../Create-and-serve-multiple-Shaarlis-(farm)/">Create and serve multiple Shaarlis (farm)</a>
160 </li>
161 <li class="">
162
163 <a class="" href="../Download-CSS-styles-from-an-OPML-list/">Download CSS styles from an OPML list</a>
164 </li>
165 <li class="">
166
167 <a class="" href="../Datastore-hacks/">Datastore hacks</a>
168 </li> 156 </li>
169 </ul> 157 </ul>
170 </li> 158 </li>
diff --git a/doc/html/Troubleshooting/index.html b/doc/html/Troubleshooting/index.html
index ed1c433d..f1564362 100644
--- a/doc/html/Troubleshooting/index.html
+++ b/doc/html/Troubleshooting/index.html
@@ -152,19 +152,7 @@
152 </li> 152 </li>
153 <li class=""> 153 <li class="">
154 154
155 <a class="" href="../Copy-an-existing-installation-over-SSH-and-serve-it-locally/">Copy an existing installation over SSH and serve it locally</a> 155 <a class="" href="../Various-hacks/">Various hacks</a>
156 </li>
157 <li class="">
158
159 <a class="" href="../Create-and-serve-multiple-Shaarlis-(farm)/">Create and serve multiple Shaarlis (farm)</a>
160 </li>
161 <li class="">
162
163 <a class="" href="../Download-CSS-styles-from-an-OPML-list/">Download CSS styles from an OPML list</a>
164 </li>
165 <li class="">
166
167 <a class="" href="../Datastore-hacks/">Datastore hacks</a>
168 </li> 156 </li>
169 </ul> 157 </ul>
170 </li> 158 </li>
@@ -400,7 +388,7 @@ php56 1
400 <a href="../Development-guidelines/" class="btn btn-neutral float-right" title="Development guidelines">Next <span class="icon icon-circle-arrow-right"></span></a> 388 <a href="../Development-guidelines/" class="btn btn-neutral float-right" title="Development guidelines">Next <span class="icon icon-circle-arrow-right"></span></a>
401 389
402 390
403 <a href="../Datastore-hacks/" class="btn btn-neutral" title="Datastore hacks"><span class="icon icon-circle-arrow-left"></span> Previous</a> 391 <a href="../Various-hacks/" class="btn btn-neutral" title="Various hacks"><span class="icon icon-circle-arrow-left"></span> Previous</a>
404 392
405 </div> 393 </div>
406 394
@@ -428,7 +416,7 @@ php56 1
428 <a href="https://github.com/shaarli/Shaarli" class="fa fa-github" style="float: left; color: #fcfcfc"> GitHub</a> 416 <a href="https://github.com/shaarli/Shaarli" class="fa fa-github" style="float: left; color: #fcfcfc"> GitHub</a>
429 417
430 418
431 <span><a href="../Datastore-hacks/" style="color: #fcfcfc;">&laquo; Previous</a></span> 419 <span><a href="../Various-hacks/" style="color: #fcfcfc;">&laquo; Previous</a></span>
432 420
433 421
434 <span style="margin-left: 15px"><a href="../Development-guidelines/" style="color: #fcfcfc">Next &raquo;</a></span> 422 <span style="margin-left: 15px"><a href="../Development-guidelines/" style="color: #fcfcfc">Next &raquo;</a></span>
diff --git a/doc/html/Unit-tests/index.html b/doc/html/Unit-tests/index.html
index 84580db4..ce90ed10 100644
--- a/doc/html/Unit-tests/index.html
+++ b/doc/html/Unit-tests/index.html
@@ -152,19 +152,7 @@
152 </li> 152 </li>
153 <li class=""> 153 <li class="">
154 154
155 <a class="" href="../Copy-an-existing-installation-over-SSH-and-serve-it-locally/">Copy an existing installation over SSH and serve it locally</a> 155 <a class="" href="../Various-hacks/">Various hacks</a>
156 </li>
157 <li class="">
158
159 <a class="" href="../Create-and-serve-multiple-Shaarlis-(farm)/">Create and serve multiple Shaarlis (farm)</a>
160 </li>
161 <li class="">
162
163 <a class="" href="../Download-CSS-styles-from-an-OPML-list/">Download CSS styles from an OPML list</a>
164 </li>
165 <li class="">
166
167 <a class="" href="../Datastore-hacks/">Datastore hacks</a>
168 </li> 156 </li>
169 </ul> 157 </ul>
170 </li> 158 </li>
diff --git a/doc/html/Upgrade-and-migration/index.html b/doc/html/Upgrade-and-migration/index.html
index 642942bf..3319fa72 100644
--- a/doc/html/Upgrade-and-migration/index.html
+++ b/doc/html/Upgrade-and-migration/index.html
@@ -191,19 +191,7 @@
191 </li> 191 </li>
192 <li class=""> 192 <li class="">
193 193
194 <a class="" href="../Copy-an-existing-installation-over-SSH-and-serve-it-locally/">Copy an existing installation over SSH and serve it locally</a> 194 <a class="" href="../Various-hacks/">Various hacks</a>
195 </li>
196 <li class="">
197
198 <a class="" href="../Create-and-serve-multiple-Shaarlis-(farm)/">Create and serve multiple Shaarlis (farm)</a>
199 </li>
200 <li class="">
201
202 <a class="" href="../Download-CSS-styles-from-an-OPML-list/">Download CSS styles from an OPML list</a>
203 </li>
204 <li class="">
205
206 <a class="" href="../Datastore-hacks/">Datastore hacks</a>
207 </li> 195 </li>
208 </ul> 196 </ul>
209 </li> 197 </li>
diff --git a/doc/html/Datastore-hacks/index.html b/doc/html/Various-hacks/index.html
index b3d8d97e..b06207ae 100644
--- a/doc/html/Datastore-hacks/index.html
+++ b/doc/html/Various-hacks/index.html
@@ -8,7 +8,7 @@
8 8
9 9
10 <link rel="shortcut icon" href="../img/favicon.ico"> 10 <link rel="shortcut icon" href="../img/favicon.ico">
11 <title>Datastore hacks - Shaarli Documentation</title> 11 <title>Various hacks - Shaarli Documentation</title>
12 <link href='https://fonts.googleapis.com/css?family=Lato:400,700|Roboto+Slab:400,700|Inconsolata:400,700' rel='stylesheet' type='text/css'> 12 <link href='https://fonts.googleapis.com/css?family=Lato:400,700|Roboto+Slab:400,700|Inconsolata:400,700' rel='stylesheet' type='text/css'>
13 13
14 <link rel="stylesheet" href="../css/theme.css" type="text/css" /> 14 <link rel="stylesheet" href="../css/theme.css" type="text/css" />
@@ -18,9 +18,9 @@
18 18
19 <script> 19 <script>
20 // Current page data 20 // Current page data
21 var mkdocs_page_name = "Datastore hacks"; 21 var mkdocs_page_name = "Various hacks";
22 var mkdocs_page_input_path = "Datastore-hacks.md"; 22 var mkdocs_page_input_path = "Various-hacks.md";
23 var mkdocs_page_url = "/Datastore-hacks/"; 23 var mkdocs_page_url = "/Various-hacks/";
24 </script> 24 </script>
25 25
26 <script src="../js/jquery-2.1.1.min.js"></script> 26 <script src="../js/jquery-2.1.1.min.js"></script>
@@ -150,27 +150,18 @@
150 150
151 <a class="" href="../Backup,-restore,-import-and-export/">Backup, restore, import and export</a> 151 <a class="" href="../Backup,-restore,-import-and-export/">Backup, restore, import and export</a>
152 </li> 152 </li>
153 <li class="">
154
155 <a class="" href="../Copy-an-existing-installation-over-SSH-and-serve-it-locally/">Copy an existing installation over SSH and serve it locally</a>
156 </li>
157 <li class="">
158
159 <a class="" href="../Create-and-serve-multiple-Shaarlis-(farm)/">Create and serve multiple Shaarlis (farm)</a>
160 </li>
161 <li class="">
162
163 <a class="" href="../Download-CSS-styles-from-an-OPML-list/">Download CSS styles from an OPML list</a>
164 </li>
165 <li class=" current"> 153 <li class=" current">
166 154
167 <a class="current" href="./">Datastore hacks</a> 155 <a class="current" href="./">Various hacks</a>
168 <ul class="subnav"> 156 <ul class="subnav">
169 157
170 <li class="toctree-l3"><a href="#decode-datastore-content">Decode datastore content</a></li> 158 <li class="toctree-l3"><a href="#decode-datastore-content">Decode datastore content</a></li>
171 159
172 160
173 <li class="toctree-l3"><a href="#changing-the-timestamp-for-a-link">Changing the timestamp for a link</a></li> 161 <li class="toctree-l3"><a href="#changing-the-timestamp-for-a-shaare">Changing the timestamp for a shaare</a></li>
162
163
164 <li class="toctree-l3"><a href="#see-also">See also</a></li>
174 165
175 166
176 </ul> 167 </ul>
@@ -283,10 +274,10 @@
283 274
284 275
285 276
286 <li>Datastore hacks</li> 277 <li>Various hacks</li>
287 <li class="wy-breadcrumbs-aside"> 278 <li class="wy-breadcrumbs-aside">
288 279
289 <a href="https://github.com/shaarli/Shaarli/edit/master/docs/Datastore-hacks.md" 280 <a href="https://github.com/shaarli/Shaarli/edit/master/docs/Various-hacks.md"
290 class="icon icon-github"> Edit on GitHub</a> 281 class="icon icon-github"> Edit on GitHub</a>
291 282
292 </li> 283 </li>
@@ -311,13 +302,20 @@ exit;
311<pre><code>php -r 'print(json_encode(unserialize(gzinflate(base64_decode(preg_replace(&quot;!.*/\* (.+) \*/.*!&quot;, &quot;$1&quot;, file_get_contents(&quot;data/datastore.php&quot;)))))));' | jq . 302<pre><code>php -r 'print(json_encode(unserialize(gzinflate(base64_decode(preg_replace(&quot;!.*/\* (.+) \*/.*!&quot;, &quot;$1&quot;, file_get_contents(&quot;data/datastore.php&quot;)))))));' | jq .
312</code></pre> 303</code></pre>
313 304
314<h3 id="changing-the-timestamp-for-a-link">Changing the timestamp for a link</h3> 305<h3 id="changing-the-timestamp-for-a-shaare">Changing the timestamp for a shaare</h3>
315<ul> 306<ul>
316<li>Look for <code>&lt;input type="hidden" name="lf_linkdate" value="{$link.linkdate}"&gt;</code> in <code>tpl/editlink.tpl</code> (line 14)</li> 307<li>Look for <code>&lt;input type="hidden" name="lf_linkdate" value="{$link.linkdate}"&gt;</code> in <code>tpl/editlink.tpl</code> (line 14)</li>
317<li>Replace <code>type="hidden"</code> with <code>type="text"</code> from this line</li> 308<li>Replace <code>type="hidden"</code> with <code>type="text"</code> from this line</li>
318<li>A new date/time field becomes available in the edit/new link dialog.</li> 309<li>A new date/time field becomes available in the edit/new link dialog.</li>
319<li>You can set the timestamp manually by entering it in the format <code>YYYMMDD_HHMMS</code>.</li> 310<li>You can set the timestamp manually by entering it in the format <code>YYYMMDD_HHMMS</code>.</li>
320</ul> 311</ul>
312<h3 id="see-also">See also</h3>
313<ul>
314<li><a href="https://gist.github.com/nodiscc/8b0194921f059d7b9ad89a581ecd482c">Add a new custom field to shaares (example patch)</a></li>
315<li><a href="https://gist.github.com/nodiscc/dede231c92cab22c3ad2cc24d5035012">Download CSS styles for shaarlis listed in an opml file</a></li>
316<li><a href="https://gist.github.com/nodiscc/ed161c66e5b028b5299b0a3733d01c77">Copy an existing Shaarli installation over SSH, and serve it locally</a></li>
317<li><a href="https://gist.github.com/nodiscc/52e711cda3bc47717c16065231cf6b20">Create multiple Shaarli instances, generate an HTML index of them</a></li>
318</ul>
321 319
322 </div> 320 </div>
323 </div> 321 </div>
@@ -328,7 +326,7 @@ exit;
328 <a href="../Troubleshooting/" class="btn btn-neutral float-right" title="Troubleshooting">Next <span class="icon icon-circle-arrow-right"></span></a> 326 <a href="../Troubleshooting/" class="btn btn-neutral float-right" title="Troubleshooting">Next <span class="icon icon-circle-arrow-right"></span></a>
329 327
330 328
331 <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> 329 <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>
332 330
333 </div> 331 </div>
334 332
@@ -356,7 +354,7 @@ exit;
356 <a href="https://github.com/shaarli/Shaarli" class="fa fa-github" style="float: left; color: #fcfcfc"> GitHub</a> 354 <a href="https://github.com/shaarli/Shaarli" class="fa fa-github" style="float: left; color: #fcfcfc"> GitHub</a>
357 355
358 356
359 <span><a href="../Download-CSS-styles-from-an-OPML-list/" style="color: #fcfcfc;">&laquo; Previous</a></span> 357 <span><a href="../Backup,-restore,-import-and-export/" style="color: #fcfcfc;">&laquo; Previous</a></span>
360 358
361 359
362 <span style="margin-left: 15px"><a href="../Troubleshooting/" style="color: #fcfcfc">Next &raquo;</a></span> 360 <span style="margin-left: 15px"><a href="../Troubleshooting/" style="color: #fcfcfc">Next &raquo;</a></span>
diff --git a/doc/html/Versioning-and-Branches/index.html b/doc/html/Versioning-and-Branches/index.html
index 406ad7f9..97bdb47e 100644
--- a/doc/html/Versioning-and-Branches/index.html
+++ b/doc/html/Versioning-and-Branches/index.html
@@ -152,19 +152,7 @@
152 </li> 152 </li>
153 <li class=""> 153 <li class="">
154 154
155 <a class="" href="../Copy-an-existing-installation-over-SSH-and-serve-it-locally/">Copy an existing installation over SSH and serve it locally</a> 155 <a class="" href="../Various-hacks/">Various hacks</a>
156 </li>
157 <li class="">
158
159 <a class="" href="../Create-and-serve-multiple-Shaarlis-(farm)/">Create and serve multiple Shaarlis (farm)</a>
160 </li>
161 <li class="">
162
163 <a class="" href="../Download-CSS-styles-from-an-OPML-list/">Download CSS styles from an OPML list</a>
164 </li>
165 <li class="">
166
167 <a class="" href="../Datastore-hacks/">Datastore hacks</a>
168 </li> 156 </li>
169 </ul> 157 </ul>
170 </li> 158 </li>
diff --git a/doc/html/index.html b/doc/html/index.html
index a9b0c7b9..e6d4ef78 100644
--- a/doc/html/index.html
+++ b/doc/html/index.html
@@ -155,19 +155,7 @@
155 </li> 155 </li>
156 <li class=""> 156 <li class="">
157 157
158 <a class="" href="Copy-an-existing-installation-over-SSH-and-serve-it-locally/">Copy an existing installation over SSH and serve it locally</a> 158 <a class="" href="Various-hacks/">Various hacks</a>
159 </li>
160 <li class="">
161
162 <a class="" href="Create-and-serve-multiple-Shaarlis-(farm)/">Create and serve multiple Shaarlis (farm)</a>
163 </li>
164 <li class="">
165
166 <a class="" href="Download-CSS-styles-from-an-OPML-list/">Download CSS styles from an OPML list</a>
167 </li>
168 <li class="">
169
170 <a class="" href="Datastore-hacks/">Datastore hacks</a>
171 </li> 159 </li>
172 </ul> 160 </ul>
173 </li> 161 </li>
@@ -340,5 +328,5 @@
340 328
341<!-- 329<!--
342MkDocs version : 0.16.3 330MkDocs version : 0.16.3
343Build Date UTC : 2017-06-17 22:04:25 331Build Date UTC : 2017-06-18 04:31:25
344--> 332-->
diff --git a/doc/html/mkdocs/search_index.json b/doc/html/mkdocs/search_index.json
index 2222a95b..7ef1837c 100644
--- a/doc/html/mkdocs/search_index.json
+++ b/doc/html/mkdocs/search_index.json
@@ -691,39 +691,24 @@
691 "title": "Import Shaarli links to Firefox" 691 "title": "Import Shaarli links to Firefox"
692 }, 692 },
693 { 693 {
694 "location": "/Copy-an-existing-installation-over-SSH-and-serve-it-locally/", 694 "location": "/Various-hacks/",
695 "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]: /...", 695 "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",
696 "title": "Copy an existing installation over SSH and serve it locally" 696 "title": "Various hacks"
697 }, 697 },
698 { 698 {
699 "location": "/Create-and-serve-multiple-Shaarlis-(farm)/", 699 "location": "/Various-hacks/#decode-datastore-content",
700 "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",
701 "title": "Create and serve multiple Shaarlis (farm)"
702 },
703 {
704 "location": "/Download-CSS-styles-from-an-OPML-list/",
705 "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<!--- ? ---->",
706 "title": "Download CSS styles from an OPML list"
707 },
708 {
709 "location": "/Download-CSS-styles-from-an-OPML-list/#download-css-styles-for-shaarlis-listed-in-an-opml-file",
710 "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<!--- ? ---->",
711 "title": "Download CSS styles for shaarlis listed in an opml file"
712 },
713 {
714 "location": "/Datastore-hacks/",
715 "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.",
716 "title": "Datastore hacks"
717 },
718 {
719 "location": "/Datastore-hacks/#decode-datastore-content",
720 "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 .", 700 "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 .",
721 "title": "Decode datastore content" 701 "title": "Decode datastore content"
722 }, 702 },
723 { 703 {
724 "location": "/Datastore-hacks/#changing-the-timestamp-for-a-link", 704 "location": "/Various-hacks/#changing-the-timestamp-for-a-shaare",
725 "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 .", 705 "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 .",
726 "title": "Changing the timestamp for a link" 706 "title": "Changing the timestamp for a shaare"
707 },
708 {
709 "location": "/Various-hacks/#see-also",
710 "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",
711 "title": "See also"
727 }, 712 },
728 { 713 {
729 "location": "/Troubleshooting/", 714 "location": "/Troubleshooting/",
diff --git a/doc/html/search.html b/doc/html/search.html
index b492b8bd..49541cda 100644
--- a/doc/html/search.html
+++ b/doc/html/search.html
@@ -148,19 +148,7 @@
148 </li> 148 </li>
149 <li class=""> 149 <li class="">
150 150
151 <a class="" href="Copy-an-existing-installation-over-SSH-and-serve-it-locally/">Copy an existing installation over SSH and serve it locally</a> 151 <a class="" href="Various-hacks/">Various hacks</a>
152 </li>
153 <li class="">
154
155 <a class="" href="Create-and-serve-multiple-Shaarlis-(farm)/">Create and serve multiple Shaarlis (farm)</a>
156 </li>
157 <li class="">
158
159 <a class="" href="Download-CSS-styles-from-an-OPML-list/">Download CSS styles from an OPML list</a>
160 </li>
161 <li class="">
162
163 <a class="" href="Datastore-hacks/">Datastore hacks</a>
164 </li> 152 </li>
165 </ul> 153 </ul>
166 </li> 154 </li>
diff --git a/doc/html/sitemap.xml b/doc/html/sitemap.xml
index 534f02b5..2a1b009e 100644
--- a/doc/html/sitemap.xml
+++ b/doc/html/sitemap.xml
@@ -132,25 +132,7 @@
132 </url> 132 </url>
133 133
134 <url> 134 <url>
135 <loc>/Copy-an-existing-installation-over-SSH-and-serve-it-locally/</loc> 135 <loc>/Various-hacks/</loc>
136 <lastmod>2017-06-18</lastmod>
137 <changefreq>daily</changefreq>
138 </url>
139
140 <url>
141 <loc>/Create-and-serve-multiple-Shaarlis-(farm)/</loc>
142 <lastmod>2017-06-18</lastmod>
143 <changefreq>daily</changefreq>
144 </url>
145
146 <url>
147 <loc>/Download-CSS-styles-from-an-OPML-list/</loc>
148 <lastmod>2017-06-18</lastmod>
149 <changefreq>daily</changefreq>
150 </url>
151
152 <url>
153 <loc>/Datastore-hacks/</loc>
154 <lastmod>2017-06-18</lastmod> 136 <lastmod>2017-06-18</lastmod>
155 <changefreq>daily</changefreq> 137 <changefreq>daily</changefreq>
156 </url> 138 </url>