aboutsummaryrefslogtreecommitdiffhomepage
path: root/doc/Copy-a-Shaarli-installation-over-SSH-SCP,-serve-it-locally-with-php-cli.md
diff options
context:
space:
mode:
authorVirtualTam <virtualtam@flibidi.net>2015-07-22 05:02:10 +0200
committerVirtualTam <virtualtam@flibidi.net>2015-08-04 16:02:21 +0200
commit992af0b9d77cb4fbac2c37ef8d5896042d67a2a3 (patch)
tree4726baf18e7057eac3f9b6bdb5991fe6117814fc /doc/Copy-a-Shaarli-installation-over-SSH-SCP,-serve-it-locally-with-php-cli.md
parent96db105e4c0833324f7168edb5673278de8ccd54 (diff)
downloadShaarli-992af0b9d77cb4fbac2c37ef8d5896042d67a2a3.tar.gz
Shaarli-992af0b9d77cb4fbac2c37ef8d5896042d67a2a3.tar.zst
Shaarli-992af0b9d77cb4fbac2c37ef8d5896042d67a2a3.zip
Doc: sync from Wiki, generate HTML
Closes #291 Fixes #227 Modifications - HTML content: match the new Wiki structure - Makefile - generate a custom HTML sidebar - include the sidebar on all pages - infer and prepend page titles - handle relative links - add title metadata, e.g. Shaarli - <Page Name> Signed-off-by: VirtualTam <virtualtam@flibidi.net>
Diffstat (limited to 'doc/Copy-a-Shaarli-installation-over-SSH-SCP,-serve-it-locally-with-php-cli.md')
-rw-r--r--doc/Copy-a-Shaarli-installation-over-SSH-SCP,-serve-it-locally-with-php-cli.md66
1 files changed, 0 insertions, 66 deletions
diff --git a/doc/Copy-a-Shaarli-installation-over-SSH-SCP,-serve-it-locally-with-php-cli.md b/doc/Copy-a-Shaarli-installation-over-SSH-SCP,-serve-it-locally-with-php-cli.md
deleted file mode 100644
index 5b0aec6f..00000000
--- a/doc/Copy-a-Shaarli-installation-over-SSH-SCP,-serve-it-locally-with-php-cli.md
+++ /dev/null
@@ -1,66 +0,0 @@
1Example bash script:
2
3```
4#!/bin/bash
5#Description: Copy a Shaarli installation over SSH/SCP, serve it locally with php-cli
6#Will create a local-shaarli/ directory when you run it, backup your Shaarli there, and serve it locally.
7#Will NOT download linked pages. It's just a directly usable backup/copy/mirror of your Shaarli
8#Requires: ssh, scp and a working SSH access to the server where your Shaarli is installed
9#Usage: ./local-shaarli.sh
10#Author: nodiscc (nodiscc@gmail.com)
11#License: MIT (http://opensource.org/licenses/MIT)
12set -o errexit
13set -o nounset
14
15##### CONFIG #################
16#The port used by php's local server
17php_local_port=7431
18
19#Name of the SSH server and path where Shaarli is installed
20#TODO: pass these as command-line arguments
21remotehost="my.ssh.server"
22remote_shaarli_dir="/var/www/shaarli"
23
24
25###### FUNCTIONS #############
26_main() {
27 _CBSyncShaarli
28 _CBServeShaarli
29}
30
31_CBSyncShaarli() {
32 remote_temp_dir=$(ssh $remotehost mktemp -d)
33 remote_ssh_user=$(ssh $remotehost whoami)
34 ssh -t "$remotehost" sudo cp -r "$remote_shaarli_dir" "$remote_temp_dir"
35 ssh -t "$remotehost" sudo chown -R "$remote_ssh_user":"$remote_ssh_user" "$remote_temp_dir"
36 scp -rq "$remotehost":"$remote_temp_dir" local-shaarli
37 ssh "$remotehost" rm -r "$remote_temp_dir"
38}
39
40_CBServeShaarli() {
41 #TODO: allow serving a previously downloaded Shaarli
42 #TODO: ask before overwriting local copy, if it exists
43 cd local-shaarli/
44 php -S localhost:${php_local_port}
45 echo "Please go to http://localhost:${php_local_port}"
46}
47
48
49##### MAIN #################
50
51_main
52```
53
54This outputs:
55
56```
57$ ./local-shaarli.sh
58PHP 5.6.0RC4 Development Server started at Mon Sep 1 21:56:19 2014
59Listening on http://localhost:7431
60Document root is /home/user/local-shaarli/shaarli
61Press Ctrl-C to quit.
62
63[Mon Sep 1 21:56:27 2014] ::1:57868 [200]: /
64[Mon Sep 1 21:56:27 2014] ::1:57869 [200]: /index.html
65[Mon Sep 1 21:56:37 2014] ::1:57881 [200]: /...
66``` \ No newline at end of file