Generate HTML documentation using MkDocs (WIP)
MkDocs is a static site generator geared towards building project documentation. Documentation source files are written in Markdown, and configured with a single YAML file. * http://www.mkdocs.org/ * http://www.mkdocs.org/user-guide/configuration/ Ref. #312 * remove pandoc-generated HTML documentation * move markdown doc to doc/md/, * mkdocs.yml: * generate HTML doc in doc/html * add pages TOC/ordering * use index.md as index page * Makefile: remove execute permissions from generated files * Makefile: rewrite htmlpages GFM to markdown conversion using sed: awk expression aslo matched '][' which causes invalid output on complex links with images or code blocks * Add mkdocs.yml to .gitattributes, exclude this file from release archives * Makefile: rename: htmldoc -> doc_html target * run make doc: pull latest markdown documentation from wiki * run make htmlpages: update html documentation
This commit is contained in:
parent
d5d22a6d07
commit
53ed6d7d1e
162 changed files with 22127 additions and 7136 deletions
1
.gitattributes
vendored
1
.gitattributes
vendored
|
@ -33,5 +33,6 @@ doc/**/*.md export-ignore
|
|||
docker/ export-ignore
|
||||
Doxyfile export-ignore
|
||||
Makefile export-ignore
|
||||
mkdocs.yml export-ignore
|
||||
phpunit.xml export-ignore
|
||||
tests/ export-ignore
|
||||
|
|
50
Makefile
50
Makefile
|
@ -194,42 +194,28 @@ doxygen: clean
|
|||
|
||||
### update the local copy of the documentation
|
||||
doc: clean
|
||||
@rm -rf doc
|
||||
@git clone https://github.com/shaarli/Shaarli.wiki.git doc
|
||||
@rm -rf doc/.git
|
||||
|
||||
### Generate a custom sidebar
|
||||
#
|
||||
# Sidebar content:
|
||||
# - convert GitHub-flavoured relative links to standard Markdown
|
||||
# - trim HTML, only keep the list (<ul>[...]</ul>) part
|
||||
htmlsidebar:
|
||||
@echo '<div id="local-sidebar">' > doc/sidebar.html
|
||||
@awk 'BEGIN { FS = "[\\[\\]]{2}" }'\
|
||||
'm = /\[/ { t=$$2; gsub(/ /, "-", $$2); print $$1"["t"]("$$2".html)"$$3 }'\
|
||||
'!m { print $$0 }' doc/_Sidebar.md > doc/tmp.md
|
||||
@pandoc -f markdown -t html5 -s doc/tmp.md | awk '/(ul>|li>)/' >> doc/sidebar.html
|
||||
@echo '</div>' >> doc/sidebar.html
|
||||
@rm doc/tmp.md
|
||||
@rm -rf doc/md/
|
||||
@git clone https://github.com/shaarli/Shaarli.wiki.git doc/md
|
||||
mv doc/md/Home.md doc/md/index.md
|
||||
@rm -rf doc/md/.git
|
||||
|
||||
### Convert local markdown documentation to HTML
|
||||
#
|
||||
# For all pages:
|
||||
# - infer title from the file name
|
||||
# - convert GitHub-flavoured relative links to standard Markdown
|
||||
# - insert the sidebar menu
|
||||
# - generate html documentation with mkdocs
|
||||
htmlpages:
|
||||
@for file in `find doc/ -maxdepth 1 -name "*.md"`; do \
|
||||
base=`basename $$file .md`; \
|
||||
sed -i "1i #$${base//-/ }" $$file; \
|
||||
awk 'BEGIN { FS = "[\\[\\]]{2}" }'\
|
||||
'm = /\[/ { t=$$2; gsub(/ /, "-", $$2); print $$1"["t"]("$$2".html)"$$3 }'\
|
||||
'!m { print $$0 }' $$file > doc/tmp.md; \
|
||||
mv doc/tmp.md $$file; \
|
||||
pandoc -f markdown_github -t html5 -s \
|
||||
-c "github-markdown.css" \
|
||||
-T Shaarli -M pagetitle:"$${base//-/ }" -B doc/sidebar.html \
|
||||
-o doc/$$base.html $$file; \
|
||||
done;
|
||||
# Rename local [[links]] to regular links.
|
||||
@for file in `find doc/md/ -maxdepth 1 -name "*.md"`; do \
|
||||
sed -e "s/\[\[\(.*\)\]\]/[\1](\1)/g" "$$file" > doc/md/tmp.md; \
|
||||
mv doc/md/tmp.md $$file; \
|
||||
done
|
||||
|
||||
htmldoc: authors doc htmlsidebar htmlpages
|
||||
python3 -m venv venv/
|
||||
bash -c 'source venv/bin/activate; \
|
||||
pip install mkdocs; \
|
||||
mkdocs build'
|
||||
find doc/html/ -type f -exec chmod a-x '{}' \;
|
||||
rm -r venv
|
||||
|
||||
doc_html: authors doc htmlpages
|
||||
|
|
|
@ -1,88 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="generator" content="pandoc">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">
|
||||
<title>Shaarli – 3rd party libraries</title>
|
||||
<style type="text/css">code{white-space: pre;}</style>
|
||||
<link rel="stylesheet" href="github-markdown.css">
|
||||
<!--[if lt IE 9]>
|
||||
<script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv-printshiv.min.js"></script>
|
||||
<![endif]-->
|
||||
</head>
|
||||
<body>
|
||||
<div id="local-sidebar">
|
||||
<ul>
|
||||
<li><a href="Home.html">Home</a></li>
|
||||
<li>Setup
|
||||
<ul>
|
||||
<li><a href="Download-and-Installation.html">Download and Installation</a></li>
|
||||
<li><a href="Upgrade-and-migration.html">Upgrade and migration</a></li>
|
||||
<li><a href="Server-requirements.html">Server requirements</a></li>
|
||||
<li><a href="Server-configuration.html">Server configuration</a></li>
|
||||
<li><a href="Server-security.html">Server security</a></li>
|
||||
<li><a href="Shaarli-configuration.html">Shaarli configuration</a></li>
|
||||
<li><a href="Plugins.html">Plugins</a></li>
|
||||
</ul></li>
|
||||
<li><a href="Docker.html">Docker</a></li>
|
||||
<li><a href="Usage.html">Usage</a>
|
||||
<ul>
|
||||
<li><a href="Sharing-button.html">Sharing button</a> (bookmarklet)</li>
|
||||
<li><a href="Browsing-and-Searching.html">Browsing and Searching</a></li>
|
||||
<li><a href="Firefox-share.html">Firefox share</a></li>
|
||||
<li><a href="RSS-feeds.html">RSS feeds</a></li>
|
||||
<li><a href="REST-API.html">REST API</a></li>
|
||||
</ul></li>
|
||||
<li>How To
|
||||
<ul>
|
||||
<li><a href="Backup,-restore,-import-and-export.html">Backup, restore, import and export</a></li>
|
||||
<li><a href="Copy-an-existing-installation-over-SSH-and-serve-it-locally.html">Copy an existing installation over SSH and serve it locally</a></li>
|
||||
<li><a href="Create-and-serve-multiple-Shaarlis-(farm).html">Create and serve multiple Shaarlis (farm)</a></li>
|
||||
<li><a href="Download-CSS-styles-from-an-OPML-list.html">Download CSS styles from an OPML list</a></li>
|
||||
<li><a href="Datastore-hacks.html">Datastore hacks</a></li>
|
||||
</ul></li>
|
||||
<li><a href="Troubleshooting.html">Troubleshooting</a></li>
|
||||
<li><a href="Development.html">Development</a>
|
||||
<ul>
|
||||
<li><a href="GnuPG-signature.html">GnuPG signature</a></li>
|
||||
<li><a href="Coding-guidelines.html">Coding guidelines</a></li>
|
||||
<li><a href="Directory-structure.html">Directory structure</a></li>
|
||||
<li><a href="3rd-party-libraries.html">3rd party libraries</a></li>
|
||||
<li><a href="Plugin-System.html">Plugin System</a></li>
|
||||
<li><a href="Release-Shaarli.html">Release Shaarli</a></li>
|
||||
<li><a href="Versioning-and-Branches.html">Versioning and Branches</a></li>
|
||||
<li><a href="Security.html">Security</a></li>
|
||||
<li><a href="Static-analysis.html">Static analysis</a></li>
|
||||
<li><a href="Theming.html">Theming</a></li>
|
||||
<li><a href="Unit-tests.html">Unit tests</a></li>
|
||||
</ul></li>
|
||||
<li>About
|
||||
<ul>
|
||||
<li><a href="FAQ.html">FAQ</a></li>
|
||||
<li><a href="Community-&-Related-software.html">Community & Related software</a></li>
|
||||
</ul></li>
|
||||
</ul>
|
||||
</div>
|
||||
<h1 id="rd-party-libraries">3rd party libraries</h1>
|
||||
<h2 id="css">CSS</h2>
|
||||
<ul>
|
||||
<li>Yahoo UI <a href="http://yuilibrary.com/yui/docs/cssreset/">CSS Reset</a><a href=".html"></a>
|
||||
<ul>
|
||||
<li>resets default CSS properties for all HTML elements (overriding browsers' default values)</li>
|
||||
<li>ensures custom CSS stylessheets will provide the same results on all browsers</li>
|
||||
</ul></li>
|
||||
</ul>
|
||||
<h2 id="javascript">Javascript</h2>
|
||||
<ul>
|
||||
<li><a href="https://leaverou.github.io/awesomplete/">Awesomeplete</a> (<a href="https://github.com/LeaVerou/awesomplete">GitHub</a>) - autocompletion in input forms<a href=".html"></a></li>
|
||||
<li><a href="http://dinbror.dk/blazy/">bLazy</a> (<a href="https://github.com/dinbror/blazy">GitHub</a>) - lazy loading for thumbnails<a href=".html"></a></li>
|
||||
<li><a href="http://neocotic.com/qr.js/">qr.js</a> (<a href="https://github.com/neocotic/qr.js">GitHub</a>) - QR code generation<a href=".html"></a></li>
|
||||
</ul>
|
||||
<h2 id="php">PHP</h2>
|
||||
<ul>
|
||||
<li><a href="https://github.com/shaarli/netscape-bookmark-parser">shaarli/netscape-bookmark-parser</a> - Netscape bookmark parser<a href=".html"></a></li>
|
||||
<li><a href="https://github.com/rainphp/raintpl">RainTPL</a> - HTML templating for PHP<a href=".html"></a></li>
|
||||
</ul>
|
||||
</body>
|
||||
</html>
|
|
@ -1,152 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="generator" content="pandoc">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">
|
||||
<title>Shaarli – Backup, restore, import and export</title>
|
||||
<style type="text/css">code{white-space: pre;}</style>
|
||||
<style type="text/css">
|
||||
div.sourceCode { overflow-x: auto; }
|
||||
table.sourceCode, tr.sourceCode, td.lineNumbers, td.sourceCode {
|
||||
margin: 0; padding: 0; vertical-align: baseline; border: none; }
|
||||
table.sourceCode { width: 100%; line-height: 100%; }
|
||||
td.lineNumbers { text-align: right; padding-right: 4px; padding-left: 4px; color: #aaaaaa; border-right: 1px solid #aaaaaa; }
|
||||
td.sourceCode { padding-left: 5px; }
|
||||
code > span.kw { color: #007020; font-weight: bold; } /* Keyword */
|
||||
code > span.dt { color: #902000; } /* DataType */
|
||||
code > span.dv { color: #40a070; } /* DecVal */
|
||||
code > span.bn { color: #40a070; } /* BaseN */
|
||||
code > span.fl { color: #40a070; } /* Float */
|
||||
code > span.ch { color: #4070a0; } /* Char */
|
||||
code > span.st { color: #4070a0; } /* String */
|
||||
code > span.co { color: #60a0b0; font-style: italic; } /* Comment */
|
||||
code > span.ot { color: #007020; } /* Other */
|
||||
code > span.al { color: #ff0000; font-weight: bold; } /* Alert */
|
||||
code > span.fu { color: #06287e; } /* Function */
|
||||
code > span.er { color: #ff0000; font-weight: bold; } /* Error */
|
||||
code > span.wa { color: #60a0b0; font-weight: bold; font-style: italic; } /* Warning */
|
||||
code > span.cn { color: #880000; } /* Constant */
|
||||
code > span.sc { color: #4070a0; } /* SpecialChar */
|
||||
code > span.vs { color: #4070a0; } /* VerbatimString */
|
||||
code > span.ss { color: #bb6688; } /* SpecialString */
|
||||
code > span.im { } /* Import */
|
||||
code > span.va { color: #19177c; } /* Variable */
|
||||
code > span.cf { color: #007020; font-weight: bold; } /* ControlFlow */
|
||||
code > span.op { color: #666666; } /* Operator */
|
||||
code > span.bu { } /* BuiltIn */
|
||||
code > span.ex { } /* Extension */
|
||||
code > span.pp { color: #bc7a00; } /* Preprocessor */
|
||||
code > span.at { color: #7d9029; } /* Attribute */
|
||||
code > span.do { color: #ba2121; font-style: italic; } /* Documentation */
|
||||
code > span.an { color: #60a0b0; font-weight: bold; font-style: italic; } /* Annotation */
|
||||
code > span.cv { color: #60a0b0; font-weight: bold; font-style: italic; } /* CommentVar */
|
||||
code > span.in { color: #60a0b0; font-weight: bold; font-style: italic; } /* Information */
|
||||
</style>
|
||||
<link rel="stylesheet" href="github-markdown.css">
|
||||
<!--[if lt IE 9]>
|
||||
<script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv-printshiv.min.js"></script>
|
||||
<![endif]-->
|
||||
</head>
|
||||
<body>
|
||||
<div id="local-sidebar">
|
||||
<ul>
|
||||
<li><a href="Home.html">Home</a></li>
|
||||
<li>Setup
|
||||
<ul>
|
||||
<li><a href="Download-and-Installation.html">Download and Installation</a></li>
|
||||
<li><a href="Upgrade-and-migration.html">Upgrade and migration</a></li>
|
||||
<li><a href="Server-requirements.html">Server requirements</a></li>
|
||||
<li><a href="Server-configuration.html">Server configuration</a></li>
|
||||
<li><a href="Server-security.html">Server security</a></li>
|
||||
<li><a href="Shaarli-configuration.html">Shaarli configuration</a></li>
|
||||
<li><a href="Plugins.html">Plugins</a></li>
|
||||
</ul></li>
|
||||
<li><a href="Docker.html">Docker</a></li>
|
||||
<li><a href="Usage.html">Usage</a>
|
||||
<ul>
|
||||
<li><a href="Sharing-button.html">Sharing button</a> (bookmarklet)</li>
|
||||
<li><a href="Browsing-and-Searching.html">Browsing and Searching</a></li>
|
||||
<li><a href="Firefox-share.html">Firefox share</a></li>
|
||||
<li><a href="RSS-feeds.html">RSS feeds</a></li>
|
||||
<li><a href="REST-API.html">REST API</a></li>
|
||||
</ul></li>
|
||||
<li>How To
|
||||
<ul>
|
||||
<li><a href="Backup,-restore,-import-and-export.html">Backup, restore, import and export</a></li>
|
||||
<li><a href="Copy-an-existing-installation-over-SSH-and-serve-it-locally.html">Copy an existing installation over SSH and serve it locally</a></li>
|
||||
<li><a href="Create-and-serve-multiple-Shaarlis-(farm).html">Create and serve multiple Shaarlis (farm)</a></li>
|
||||
<li><a href="Download-CSS-styles-from-an-OPML-list.html">Download CSS styles from an OPML list</a></li>
|
||||
<li><a href="Datastore-hacks.html">Datastore hacks</a></li>
|
||||
</ul></li>
|
||||
<li><a href="Troubleshooting.html">Troubleshooting</a></li>
|
||||
<li><a href="Development.html">Development</a>
|
||||
<ul>
|
||||
<li><a href="GnuPG-signature.html">GnuPG signature</a></li>
|
||||
<li><a href="Coding-guidelines.html">Coding guidelines</a></li>
|
||||
<li><a href="Directory-structure.html">Directory structure</a></li>
|
||||
<li><a href="3rd-party-libraries.html">3rd party libraries</a></li>
|
||||
<li><a href="Plugin-System.html">Plugin System</a></li>
|
||||
<li><a href="Release-Shaarli.html">Release Shaarli</a></li>
|
||||
<li><a href="Versioning-and-Branches.html">Versioning and Branches</a></li>
|
||||
<li><a href="Security.html">Security</a></li>
|
||||
<li><a href="Static-analysis.html">Static analysis</a></li>
|
||||
<li><a href="Theming.html">Theming</a></li>
|
||||
<li><a href="Unit-tests.html">Unit tests</a></li>
|
||||
</ul></li>
|
||||
<li>About
|
||||
<ul>
|
||||
<li><a href="FAQ.html">FAQ</a></li>
|
||||
<li><a href="Community-&-Related-software.html">Community & Related software</a></li>
|
||||
</ul></li>
|
||||
</ul>
|
||||
</div>
|
||||
<h1 id="backup-restore-import-and-export">Backup, restore, import and export</h1>
|
||||
<ul>
|
||||
<li><a href="#backup-and-restore-the-datastore-file">Backup and restore the datastore file</a><a href=".html"></a></li>
|
||||
<li><a href="#export-links-as">Export links as...</a><a href=".html"></a></li>
|
||||
<li><a href="#import-links-from">Import links from...</a><a href=".html"></a></li>
|
||||
<li><a href="#import-shaarli-links-to-firefox">Import Shaarli links to Firefox</a><a href=".html"></a></li>
|
||||
</ul>
|
||||
<hr />
|
||||
<h2 id="backup-and-restore-the-datastore-file">Backup and restore the datastore file</h2>
|
||||
<p>Backup the file <code>data/datastore.php</code> (by FTP or SSH). Restore by putting the file back in place.</p>
|
||||
<p>Example command:</p>
|
||||
<div class="sourceCode"><pre class="sourceCode bash"><code class="sourceCode bash"><span class="fu">rsync</span> -avzP my.server.com:/var/www/shaarli/data/datastore.php datastore-<span class="va">$(</span><span class="fu">date</span> +%Y-%m-%d_%H%M<span class="va">)</span>.php</code></pre></div>
|
||||
<h2 id="export-links-as...">Export links as...</h2>
|
||||
<p>To export links as an HTML file, under <em>Tools > Export</em>, choose:</p>
|
||||
<ul>
|
||||
<li><em>Export all</em> to export both public and private links</li>
|
||||
<li><em>Export public</em> to export public links only</li>
|
||||
<li><em>Export private</em> to export private links only</li>
|
||||
</ul>
|
||||
<p>Restore by using the <code>Import</code> feature.</p>
|
||||
<ul>
|
||||
<li>This can be done using the <a href="https://github.com/nodiscc/shaarchiver">shaarchiver</a> tool.<a href=".html"></a></li>
|
||||
</ul>
|
||||
<p>Example command:</p>
|
||||
<div class="sourceCode"><pre class="sourceCode bash"><code class="sourceCode bash"><span class="ex">./export-bookmarks.py</span> --url=https://my.server.com/shaarli --username=myusername --password=mysupersecretpassword --download-dir=./ --type=all</code></pre></div>
|
||||
<h2 id="import-links-from...">Import links from...</h2>
|
||||
<h3 id="diigo">Diigo</h3>
|
||||
<p>If you export your bookmark from Diigo, make sure you use the Delicious export, not the Netscape export. (Their Netscape export is broken, and they don't seem to be interested in fixing it.)</p>
|
||||
<h3 id="mister-wong">Mister Wong</h3>
|
||||
<p>See <a href="https://github.com/sebsauvage/Shaarli/issues/146">this issue</a> for import tweaks.<a href=".html"></a></p>
|
||||
<h3 id="semanticscuttle">SemanticScuttle</h3>
|
||||
<p>To correctly import the tags from a <a href="http://semanticscuttle.sourceforge.net/">SemanticScuttle</a> HTML export, edit the HTML file before importing and replace all occurences of <code>tags=</code> (lowercase) to <code>TAGS=</code> (uppercase).<a href=".html"></a></p>
|
||||
<h3 id="scuttle">Scuttle</h3>
|
||||
<p>Shaarli cannot import data directly from <a href="https://github.com/scronide/scuttle">Scuttle</a>. However, you can use this third party tool: <a href="https://github.com/q2apro/scuttle-to-shaarli" class="uri">https://github.com/q2apro/scuttle-to-shaarli</a> to export the Scuttle database to the Netscape HTML format compatible with the Shaarli importer.<a href=".html"></a></p>
|
||||
<h2 id="import-shaarli-links-to-firefox">Import Shaarli links to Firefox</h2>
|
||||
<ul>
|
||||
<li>Export your Shaarli links as described above.</li>
|
||||
<li>For compatibility reasons, check <code>Prepend note permalinks with this Shaarli instance's URL (useful to import bookmarks in a web browser)</code></li>
|
||||
<li>In Firefox, open the bookmark manager (not the sidebar! <code>Bookmarks menu > Show all bookmarks</code> or <code>Ctrl+Shift+B</code>)</li>
|
||||
<li>Select <code>Import and Backup > Import bookmarks in HTML format</code></li>
|
||||
</ul>
|
||||
<p>Your bookmarks will be imported in Firefox, ready to use, with tags and descriptions retained. "Self" (notes) shaares will still point to the Shaarli instance you exported them from, but the note text can be viewed directly in the bookmark properties inside your browser. Depending on the number of bookmarks, the import can take some time.</p>
|
||||
<p>You may be interested in these Firefox addons to manage links imported from Shaarli</p>
|
||||
<ul>
|
||||
<li><a href="https://addons.mozilla.org/en-US/firefox/addon/bookmark-deduplicator/">Bookmark Deduplicator</a> - provides an easy way to deduplicate your bookmarks<a href=".html"></a></li>
|
||||
<li><a href="https://addons.mozilla.org/en-US/firefox/addon/tagsieve/">TagSieve</a> - browse your bookmarks by their tags<a href=".html"></a></li>
|
||||
</ul>
|
||||
</body>
|
||||
</html>
|
|
@ -1,83 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="generator" content="pandoc">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">
|
||||
<title>Shaarli – Browsing and searching</title>
|
||||
<style type="text/css">code{white-space: pre;}</style>
|
||||
<link rel="stylesheet" href="github-markdown.css">
|
||||
<!--[if lt IE 9]>
|
||||
<script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv-printshiv.min.js"></script>
|
||||
<![endif]-->
|
||||
</head>
|
||||
<body>
|
||||
<div id="local-sidebar">
|
||||
<ul>
|
||||
<li><a href="Home.html">Home</a></li>
|
||||
<li>Setup
|
||||
<ul>
|
||||
<li><a href="Download-and-Installation.html">Download and Installation</a></li>
|
||||
<li><a href="Upgrade-and-migration.html">Upgrade and migration</a></li>
|
||||
<li><a href="Server-requirements.html">Server requirements</a></li>
|
||||
<li><a href="Server-configuration.html">Server configuration</a></li>
|
||||
<li><a href="Server-security.html">Server security</a></li>
|
||||
<li><a href="Shaarli-configuration.html">Shaarli configuration</a></li>
|
||||
<li><a href="Plugins.html">Plugins</a></li>
|
||||
</ul></li>
|
||||
<li><a href="Docker.html">Docker</a></li>
|
||||
<li><a href="Usage.html">Usage</a>
|
||||
<ul>
|
||||
<li><a href="Sharing-button.html">Sharing button</a> (bookmarklet)</li>
|
||||
<li><a href="Browsing-and-Searching.html">Browsing and Searching</a></li>
|
||||
<li><a href="Firefox-share.html">Firefox share</a></li>
|
||||
<li><a href="RSS-feeds.html">RSS feeds</a></li>
|
||||
<li><a href="REST-API.html">REST API</a></li>
|
||||
</ul></li>
|
||||
<li>How To
|
||||
<ul>
|
||||
<li><a href="Backup,-restore,-import-and-export.html">Backup, restore, import and export</a></li>
|
||||
<li><a href="Copy-an-existing-installation-over-SSH-and-serve-it-locally.html">Copy an existing installation over SSH and serve it locally</a></li>
|
||||
<li><a href="Create-and-serve-multiple-Shaarlis-(farm).html">Create and serve multiple Shaarlis (farm)</a></li>
|
||||
<li><a href="Download-CSS-styles-from-an-OPML-list.html">Download CSS styles from an OPML list</a></li>
|
||||
<li><a href="Datastore-hacks.html">Datastore hacks</a></li>
|
||||
</ul></li>
|
||||
<li><a href="Troubleshooting.html">Troubleshooting</a></li>
|
||||
<li><a href="Development.html">Development</a>
|
||||
<ul>
|
||||
<li><a href="GnuPG-signature.html">GnuPG signature</a></li>
|
||||
<li><a href="Coding-guidelines.html">Coding guidelines</a></li>
|
||||
<li><a href="Directory-structure.html">Directory structure</a></li>
|
||||
<li><a href="3rd-party-libraries.html">3rd party libraries</a></li>
|
||||
<li><a href="Plugin-System.html">Plugin System</a></li>
|
||||
<li><a href="Release-Shaarli.html">Release Shaarli</a></li>
|
||||
<li><a href="Versioning-and-Branches.html">Versioning and Branches</a></li>
|
||||
<li><a href="Security.html">Security</a></li>
|
||||
<li><a href="Static-analysis.html">Static analysis</a></li>
|
||||
<li><a href="Theming.html">Theming</a></li>
|
||||
<li><a href="Unit-tests.html">Unit tests</a></li>
|
||||
</ul></li>
|
||||
<li>About
|
||||
<ul>
|
||||
<li><a href="FAQ.html">FAQ</a></li>
|
||||
<li><a href="Community-&-Related-software.html">Community & Related software</a></li>
|
||||
</ul></li>
|
||||
</ul>
|
||||
</div>
|
||||
<h1 id="browsing-and-searching">Browsing and searching</h1>
|
||||
<h1 id="browsing-and-searching-1">Browsing and Searching</h1>
|
||||
<p><embed src="(http://pix.toile-libre.org/upload/original/1455571378.png).html" /></p>
|
||||
<h2 id="plain-text-search">Plain text search</h2>
|
||||
<p>Use the <code>Search text</code> field to search in <em>any</em> of the fields of all links (Title, URL, Description...)</p>
|
||||
<p><strong>Exclude text/tags:</strong> Use the <code>-</code> operator before a word or tag (example <code>-uninteresting</code>) to prevent entries containing (or tagged) <code>uninteresting</code> from showing up in the search results.</p>
|
||||
<p><strong>Exact text search:</strong> Use double-quotes (example <code>"exact search"</code>) to search for the exact expression.</p>
|
||||
<p>Both exclude patterns and exact searches can be combined with normal searches (example <code>"exact search" term otherterm -notthis "very exact" stuff -notagain</code>)</p>
|
||||
<h2 id="tags-search">Tags search</h2>
|
||||
<p>Use the <code>Filter by tags</code> field to restrict displayed links to entries tagged with one or multiple tags (use space to separate tags).</p>
|
||||
<p><strong>Hidden tags:</strong> Tags starting with a dot <code>.</code> (example <code>.secret</code>) are private. They can only be seen and searched when logged in.</p>
|
||||
<p>Alternatively you can use the <code>Tag cloud</code> to discover all tags and click on any of them to display related links.</p>
|
||||
<p>To search for links that are not tagged, enter <code>""</code> in the tag search field.</p>
|
||||
<h2 id="filtering-rss-feedspicture-wall">Filtering RSS feeds/Picture wall</h2>
|
||||
<p>RSS feeds can also be restricted to only return items matching a text/tag search: see <a href="RSS-feeds.html">RSS feeds</a>.</p>
|
||||
</body>
|
||||
</html>
|
|
@ -1,75 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="generator" content="pandoc">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">
|
||||
<title>Shaarli – Coding guidelines</title>
|
||||
<style type="text/css">code{white-space: pre;}</style>
|
||||
<link rel="stylesheet" href="github-markdown.css">
|
||||
<!--[if lt IE 9]>
|
||||
<script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv-printshiv.min.js"></script>
|
||||
<![endif]-->
|
||||
</head>
|
||||
<body>
|
||||
<div id="local-sidebar">
|
||||
<ul>
|
||||
<li><a href="Home.html">Home</a></li>
|
||||
<li>Setup
|
||||
<ul>
|
||||
<li><a href="Download-and-Installation.html">Download and Installation</a></li>
|
||||
<li><a href="Upgrade-and-migration.html">Upgrade and migration</a></li>
|
||||
<li><a href="Server-requirements.html">Server requirements</a></li>
|
||||
<li><a href="Server-configuration.html">Server configuration</a></li>
|
||||
<li><a href="Server-security.html">Server security</a></li>
|
||||
<li><a href="Shaarli-configuration.html">Shaarli configuration</a></li>
|
||||
<li><a href="Plugins.html">Plugins</a></li>
|
||||
</ul></li>
|
||||
<li><a href="Docker.html">Docker</a></li>
|
||||
<li><a href="Usage.html">Usage</a>
|
||||
<ul>
|
||||
<li><a href="Sharing-button.html">Sharing button</a> (bookmarklet)</li>
|
||||
<li><a href="Browsing-and-Searching.html">Browsing and Searching</a></li>
|
||||
<li><a href="Firefox-share.html">Firefox share</a></li>
|
||||
<li><a href="RSS-feeds.html">RSS feeds</a></li>
|
||||
<li><a href="REST-API.html">REST API</a></li>
|
||||
</ul></li>
|
||||
<li>How To
|
||||
<ul>
|
||||
<li><a href="Backup,-restore,-import-and-export.html">Backup, restore, import and export</a></li>
|
||||
<li><a href="Copy-an-existing-installation-over-SSH-and-serve-it-locally.html">Copy an existing installation over SSH and serve it locally</a></li>
|
||||
<li><a href="Create-and-serve-multiple-Shaarlis-(farm).html">Create and serve multiple Shaarlis (farm)</a></li>
|
||||
<li><a href="Download-CSS-styles-from-an-OPML-list.html">Download CSS styles from an OPML list</a></li>
|
||||
<li><a href="Datastore-hacks.html">Datastore hacks</a></li>
|
||||
</ul></li>
|
||||
<li><a href="Troubleshooting.html">Troubleshooting</a></li>
|
||||
<li><a href="Development.html">Development</a>
|
||||
<ul>
|
||||
<li><a href="GnuPG-signature.html">GnuPG signature</a></li>
|
||||
<li><a href="Coding-guidelines.html">Coding guidelines</a></li>
|
||||
<li><a href="Directory-structure.html">Directory structure</a></li>
|
||||
<li><a href="3rd-party-libraries.html">3rd party libraries</a></li>
|
||||
<li><a href="Plugin-System.html">Plugin System</a></li>
|
||||
<li><a href="Release-Shaarli.html">Release Shaarli</a></li>
|
||||
<li><a href="Versioning-and-Branches.html">Versioning and Branches</a></li>
|
||||
<li><a href="Security.html">Security</a></li>
|
||||
<li><a href="Static-analysis.html">Static analysis</a></li>
|
||||
<li><a href="Theming.html">Theming</a></li>
|
||||
<li><a href="Unit-tests.html">Unit tests</a></li>
|
||||
</ul></li>
|
||||
<li>About
|
||||
<ul>
|
||||
<li><a href="FAQ.html">FAQ</a></li>
|
||||
<li><a href="Community-&-Related-software.html">Community & Related software</a></li>
|
||||
</ul></li>
|
||||
</ul>
|
||||
</div>
|
||||
<h1 id="coding-guidelines">Coding guidelines</h1>
|
||||
<h2 id="wip">WIP</h2>
|
||||
<p>This topic is currently being discussed here:</p>
|
||||
<ul>
|
||||
<li><a href="https://github.com/shaarli/Shaarli/issues/95">Fix coding style (static analysis)</a> (#95)<a href=".html"></a></li>
|
||||
<li><a href="https://github.com/shaarli/Shaarli/issues/130">Continuous Integration tools & features</a> (#130)<a href=".html"></a></li>
|
||||
</ul>
|
||||
</body>
|
||||
</html>
|
|
@ -1,131 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="generator" content="pandoc">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">
|
||||
<title>Shaarli – Community & Related software</title>
|
||||
<style type="text/css">code{white-space: pre;}</style>
|
||||
<link rel="stylesheet" href="github-markdown.css">
|
||||
<!--[if lt IE 9]>
|
||||
<script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv-printshiv.min.js"></script>
|
||||
<![endif]-->
|
||||
</head>
|
||||
<body>
|
||||
<div id="local-sidebar">
|
||||
<ul>
|
||||
<li><a href="Home.html">Home</a></li>
|
||||
<li>Setup
|
||||
<ul>
|
||||
<li><a href="Download-and-Installation.html">Download and Installation</a></li>
|
||||
<li><a href="Upgrade-and-migration.html">Upgrade and migration</a></li>
|
||||
<li><a href="Server-requirements.html">Server requirements</a></li>
|
||||
<li><a href="Server-configuration.html">Server configuration</a></li>
|
||||
<li><a href="Server-security.html">Server security</a></li>
|
||||
<li><a href="Shaarli-configuration.html">Shaarli configuration</a></li>
|
||||
<li><a href="Plugins.html">Plugins</a></li>
|
||||
</ul></li>
|
||||
<li><a href="Docker.html">Docker</a></li>
|
||||
<li><a href="Usage.html">Usage</a>
|
||||
<ul>
|
||||
<li><a href="Sharing-button.html">Sharing button</a> (bookmarklet)</li>
|
||||
<li><a href="Browsing-and-Searching.html">Browsing and Searching</a></li>
|
||||
<li><a href="Firefox-share.html">Firefox share</a></li>
|
||||
<li><a href="RSS-feeds.html">RSS feeds</a></li>
|
||||
<li><a href="REST-API.html">REST API</a></li>
|
||||
</ul></li>
|
||||
<li>How To
|
||||
<ul>
|
||||
<li><a href="Backup,-restore,-import-and-export.html">Backup, restore, import and export</a></li>
|
||||
<li><a href="Copy-an-existing-installation-over-SSH-and-serve-it-locally.html">Copy an existing installation over SSH and serve it locally</a></li>
|
||||
<li><a href="Create-and-serve-multiple-Shaarlis-(farm).html">Create and serve multiple Shaarlis (farm)</a></li>
|
||||
<li><a href="Download-CSS-styles-from-an-OPML-list.html">Download CSS styles from an OPML list</a></li>
|
||||
<li><a href="Datastore-hacks.html">Datastore hacks</a></li>
|
||||
</ul></li>
|
||||
<li><a href="Troubleshooting.html">Troubleshooting</a></li>
|
||||
<li><a href="Development.html">Development</a>
|
||||
<ul>
|
||||
<li><a href="GnuPG-signature.html">GnuPG signature</a></li>
|
||||
<li><a href="Coding-guidelines.html">Coding guidelines</a></li>
|
||||
<li><a href="Directory-structure.html">Directory structure</a></li>
|
||||
<li><a href="3rd-party-libraries.html">3rd party libraries</a></li>
|
||||
<li><a href="Plugin-System.html">Plugin System</a></li>
|
||||
<li><a href="Release-Shaarli.html">Release Shaarli</a></li>
|
||||
<li><a href="Versioning-and-Branches.html">Versioning and Branches</a></li>
|
||||
<li><a href="Security.html">Security</a></li>
|
||||
<li><a href="Static-analysis.html">Static analysis</a></li>
|
||||
<li><a href="Theming.html">Theming</a></li>
|
||||
<li><a href="Unit-tests.html">Unit tests</a></li>
|
||||
</ul></li>
|
||||
<li>About
|
||||
<ul>
|
||||
<li><a href="FAQ.html">FAQ</a></li>
|
||||
<li><a href="Community-&-Related-software.html">Community & Related software</a></li>
|
||||
</ul></li>
|
||||
</ul>
|
||||
</div>
|
||||
<h1 id="community-related-software">Community & Related software</h1>
|
||||
<p><em>Unofficial but related work on Shaarli. If you maintain one of these, please get in touch with us to help us find a way to adapt your work to our fork.</em></p>
|
||||
<p><em>TODO: contact repos owners to see if they'd like to standardize their work with the community fork.</em></p>
|
||||
<h2 id="community">Community</h2>
|
||||
<ul>
|
||||
<li><a href="http://sebsauvage.net/links/">Liens en vrac de sebsauvage</a> - the original Shaarli<a href=".html"></a></li>
|
||||
<li><a href="http://porneia.free.fr/pub/links/ou-est-shaarli.html">A large list of Shaarlis</a><a href=".html"></a></li>
|
||||
<li><a href="https://raw.githubusercontent.com/Oros42/find_shaarlis/master/annuaires.json">A list of working Shaarli aggregators</a><a href=".html"></a></li>
|
||||
<li><a href="https://github.com/Oros42/shaarlis_list">A list of some known Shaarlis</a><a href=".html"></a></li>
|
||||
<li><a href="http://sebsauvage.net/rhaa/index.php?2011/09/16/09/29/58-adieu-delicious-diigo-et-stumbleupon-salut-shaarli-">Adieu Delicious, Diigo et StumbleUpon. Salut Shaarli ! - sebsauvage.net</a> (fr) <em>16/09/2011 - the original post about Shaarli</em><a href=".html"></a></li>
|
||||
<li><a href="http://sebsauvage.net/wiki/doku.php?id=php:shaarli:ideas">Original ideas/fixme/TODO page</a><a href=".html"></a></li>
|
||||
<li><a href="http://sebsauvage.net/wiki/doku.php?id=php:shaarli:discussion">Original discussion page</a> (fr)<a href=".html"></a></li>
|
||||
<li><a href="http://sebsauvage.net/wiki/doku.php?id=php:shaarli:history">Original revisions history</a><a href=".html"></a></li>
|
||||
<li><a href="https://www.shaarli.fr/my.php">Shaarli.fr/my</a> - Unofficial, unsupported (old fork) hosted Shaarlis provider, courtesy of <a href="https://github.com/DMeloni">DMeloni</a><a href=".html"></a></li>
|
||||
</ul>
|
||||
<h3 id="articles-and-social-media-discussions">Articles and social media discussions</h3>
|
||||
<ul>
|
||||
<li>2016-09-22 - Hacker News - <a href="https://news.ycombinator.com/item?id=12552176" class="uri">https://news.ycombinator.com/item?id=12552176</a></li>
|
||||
<li>2015-08-15 - Reddit - <a href="https://www.reddit.com/r/selfhosted/comments/3h3zwh/question_about_migrating_from_wordpress_to_shaarli/">Question about migrating from WordPress to Shaarli.</a><a href=".html"></a></li>
|
||||
<li>2015-06-22 - Hacker News - <a href="https://news.ycombinator.com/item?id=9755366" class="uri">https://news.ycombinator.com/item?id=9755366</a></li>
|
||||
<li>2015-05-12 - Reddit - <a href="https://www.reddit.com/r/selfhosted/comments/35pkkc/shaarli_self_hosted_bookmarking_delicious_php/">shaarli - Self hosted Bookmarking / Delicious (PHP, MySQL)</a><a href=".html"></a></li>
|
||||
</ul>
|
||||
<h3 id="third-party-plugins">Third party plugins</h3>
|
||||
<ul>
|
||||
<li><a href="https://github.com/kalvn/shaarli-plugin-autosave">autosave</a> by <a href="https://github.com/kalvn">@kalvn</a>: Automatically saves data when editing a link to avoid any loss in case of crash or unexpected shutdown.<a href=".html"></a></li>
|
||||
<li><a href="https://github.com/ArthurHoaro/code-coloration">Code Coloration</a> by <a href="https://github.com/ArthurHoaro">@ArthurHoaro</a>: client side code syntax highlighter.<a href=".html"></a></li>
|
||||
<li><a href="https://github.com/kalvn/shaarli-plugin-disqus">Disqus</a> by <a href="https://github.com/kalvn">@kalvn</a>: Adds Disqus comment system to your Shaarli.<a href=".html"></a></li>
|
||||
<li><a href="https://github.com/NerosTie/emojione">emojione</a> by <a href="https://github.com/NerosTie">@NerosTie</a>: Add colorful emojis to your Shaarli.<a href=".html"></a></li>
|
||||
<li><a href="https://github.com/ericjuden/Shaarli-Google-Analytics-Plugin">google analytics</a> by <a href="http://github.com/ericjuden">@ericjuden</a>: Adds Google Analytics tracking support<a href=".html"></a></li>
|
||||
<li><a href="https://github.com/ArthurHoaro/launch-plugin">launch</a> - Launch Plugin is a plugin designed to enhance and customize Launch Theme for Shaarli.<a href=".html"></a></li>
|
||||
<li><a href="https://github.com/alexisju/social">social</a> by <a href="https://github.com/alexisju">@alexisju</a>: share links to social networks.<a href=".html"></a></li>
|
||||
<li><a href="https://github.com/ArthurHoaro/shaarli2twitter">shaarli2twitter</a> by <a href="https://github.com/ArthurHoaro">@ArthurHoaro</a> - Automatically tweet your shared links from Shaarli<a href=".html"></a></li>
|
||||
</ul>
|
||||
<h3 id="themes">Themes</h3>
|
||||
<p>See <a href="Theming.html">Theming</a> for the list of community-contributed themes, and an installation guide.</p>
|
||||
<h3 id="server-apps">Server apps</h3>
|
||||
<ul>
|
||||
<li><a href="https://github.com/nodiscc/shaarchiver">shaarchiver</a> - Archive your Shaarli bookmarks and their content<a href=".html"></a></li>
|
||||
<li><a href="https://github.com/mknexen/shaarli-river">shaarli-river</a> - An aggregator for shaarlis with many features <a href=".html"></a></li>
|
||||
<li><a href="https://github.com/DMeloni/shaarlo">Shaarlo</a> - An aggregator for shaarlis with many features (a very popular running instance among french shaarliers: <a href="http://shaarli.fr/">shaarli.fr</a>)<a href=".html"></a></li>
|
||||
<li><a href="https://github.com/BoboTiG/shaarlimages">Shaarlimages</a> - An image-oriented aggregator for Shaarlis<a href=".html"></a></li>
|
||||
<li><a href="https://github.com/mknexen/shaarli-api">mknexen/shaarli-api</a> - A REST API for Shaarli<a href=".html"></a></li>
|
||||
<li><a href="https://github.com/qwertygc/shaarli-dev-code/blob/master/self-dead-link.php">Self dead link</a> - Detect dead links on shaarli. This version use the database of shaarli. <a href="https://github.com/qwertygc/shaarli-dev-code/blob/master/dead-link.php">Another version</a>, can be used for other shaarli instances (but is more resource consuming).<a href=".html"></a></li>
|
||||
</ul>
|
||||
<h3 id="mobile-apps">Mobile Apps</h3>
|
||||
<ul>
|
||||
<li><a href="http://app.mro.name/Shaarli💫">Shaarli💫</a> iOS share extension - see <a href="https://github.com/shaarli/Shaarli/issues/308#issuecomment-184592070">#308</a> for some promo codes,<a href=".html"></a></li>
|
||||
<li><a href="http://sebsauvage.net/links/?ZAyDzg">Shaarli for Android</a> - Android application that adds Shaarli as a sharing provider<a href=".html"></a></li>
|
||||
<li><a href="https://github.com/dimtion/Shaarlier">Shaarlier for Android</a> - Android application to simply add links directly into your Shaarli<a href=".html"></a></li>
|
||||
</ul>
|
||||
<h2 id="integration-with-other-platforms">Integration with other platforms</h2>
|
||||
<ul>
|
||||
<li><a href="https://github.com/jcsaaddupuy/tt-rss-shaarli">tt-rss-shaarli</a> - <a href="http://tt-rss.org/">TinyTiny RSS</a> plugin that adds support for sharing articles with Shaarli<a href=".html"></a></li>
|
||||
<li><a href="https://github.com/ahmet2mir/octopress-shaarli">octopress-shaarli</a> - Octopress plugin to retrieve Shaarli links on the sidebar<a href=".html"></a></li>
|
||||
<li><a href="https://github.com/q2apro/scuttle-to-shaarli">Scuttle to Shaarli</a> - Import bookmarks from Scuttle<a href=".html"></a></li>
|
||||
</ul>
|
||||
<h2 id="alternatives-to-shaarli">Alternatives to Shaarli</h2>
|
||||
<ul>
|
||||
<li><a href="http://alternativeto.net/software/shaarli/">Shaarli alternatives</a> (alternativeto.net)<a href=".html"></a></li>
|
||||
<li><a href="https://github.com/bookieio/bookie">Bookie</a> - Another self-hostable, free bookmark sharing software, written in Python<a href=".html"></a></li>
|
||||
<li><a href="https://github.com/plainmade/unmark">Unmark</a> - An open source todo app for bookmarks (<a href="https://unmark.it/">Homepage</a>)<a href=".html"></a></li>
|
||||
<li><a href="https://wordpress.org/plugins/wp-bookmarks/">Wordpress bookmarks</a><a href=".html"></a></li>
|
||||
</ul>
|
||||
</body>
|
||||
</html>
|
|
@ -1,165 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="generator" content="pandoc">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">
|
||||
<title>Shaarli – Copy an existing installation over SSH and serve it locally</title>
|
||||
<style type="text/css">code{white-space: pre;}</style>
|
||||
<style type="text/css">
|
||||
div.sourceCode { overflow-x: auto; }
|
||||
table.sourceCode, tr.sourceCode, td.lineNumbers, td.sourceCode {
|
||||
margin: 0; padding: 0; vertical-align: baseline; border: none; }
|
||||
table.sourceCode { width: 100%; line-height: 100%; }
|
||||
td.lineNumbers { text-align: right; padding-right: 4px; padding-left: 4px; color: #aaaaaa; border-right: 1px solid #aaaaaa; }
|
||||
td.sourceCode { padding-left: 5px; }
|
||||
code > span.kw { color: #007020; font-weight: bold; } /* Keyword */
|
||||
code > span.dt { color: #902000; } /* DataType */
|
||||
code > span.dv { color: #40a070; } /* DecVal */
|
||||
code > span.bn { color: #40a070; } /* BaseN */
|
||||
code > span.fl { color: #40a070; } /* Float */
|
||||
code > span.ch { color: #4070a0; } /* Char */
|
||||
code > span.st { color: #4070a0; } /* String */
|
||||
code > span.co { color: #60a0b0; font-style: italic; } /* Comment */
|
||||
code > span.ot { color: #007020; } /* Other */
|
||||
code > span.al { color: #ff0000; font-weight: bold; } /* Alert */
|
||||
code > span.fu { color: #06287e; } /* Function */
|
||||
code > span.er { color: #ff0000; font-weight: bold; } /* Error */
|
||||
code > span.wa { color: #60a0b0; font-weight: bold; font-style: italic; } /* Warning */
|
||||
code > span.cn { color: #880000; } /* Constant */
|
||||
code > span.sc { color: #4070a0; } /* SpecialChar */
|
||||
code > span.vs { color: #4070a0; } /* VerbatimString */
|
||||
code > span.ss { color: #bb6688; } /* SpecialString */
|
||||
code > span.im { } /* Import */
|
||||
code > span.va { color: #19177c; } /* Variable */
|
||||
code > span.cf { color: #007020; font-weight: bold; } /* ControlFlow */
|
||||
code > span.op { color: #666666; } /* Operator */
|
||||
code > span.bu { } /* BuiltIn */
|
||||
code > span.ex { } /* Extension */
|
||||
code > span.pp { color: #bc7a00; } /* Preprocessor */
|
||||
code > span.at { color: #7d9029; } /* Attribute */
|
||||
code > span.do { color: #ba2121; font-style: italic; } /* Documentation */
|
||||
code > span.an { color: #60a0b0; font-weight: bold; font-style: italic; } /* Annotation */
|
||||
code > span.cv { color: #60a0b0; font-weight: bold; font-style: italic; } /* CommentVar */
|
||||
code > span.in { color: #60a0b0; font-weight: bold; font-style: italic; } /* Information */
|
||||
</style>
|
||||
<link rel="stylesheet" href="github-markdown.css">
|
||||
<!--[if lt IE 9]>
|
||||
<script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv-printshiv.min.js"></script>
|
||||
<![endif]-->
|
||||
</head>
|
||||
<body>
|
||||
<div id="local-sidebar">
|
||||
<ul>
|
||||
<li><a href="Home.html">Home</a></li>
|
||||
<li>Setup
|
||||
<ul>
|
||||
<li><a href="Download-and-Installation.html">Download and Installation</a></li>
|
||||
<li><a href="Upgrade-and-migration.html">Upgrade and migration</a></li>
|
||||
<li><a href="Server-requirements.html">Server requirements</a></li>
|
||||
<li><a href="Server-configuration.html">Server configuration</a></li>
|
||||
<li><a href="Server-security.html">Server security</a></li>
|
||||
<li><a href="Shaarli-configuration.html">Shaarli configuration</a></li>
|
||||
<li><a href="Plugins.html">Plugins</a></li>
|
||||
</ul></li>
|
||||
<li><a href="Docker.html">Docker</a></li>
|
||||
<li><a href="Usage.html">Usage</a>
|
||||
<ul>
|
||||
<li><a href="Sharing-button.html">Sharing button</a> (bookmarklet)</li>
|
||||
<li><a href="Browsing-and-Searching.html">Browsing and Searching</a></li>
|
||||
<li><a href="Firefox-share.html">Firefox share</a></li>
|
||||
<li><a href="RSS-feeds.html">RSS feeds</a></li>
|
||||
<li><a href="REST-API.html">REST API</a></li>
|
||||
</ul></li>
|
||||
<li>How To
|
||||
<ul>
|
||||
<li><a href="Backup,-restore,-import-and-export.html">Backup, restore, import and export</a></li>
|
||||
<li><a href="Copy-an-existing-installation-over-SSH-and-serve-it-locally.html">Copy an existing installation over SSH and serve it locally</a></li>
|
||||
<li><a href="Create-and-serve-multiple-Shaarlis-(farm).html">Create and serve multiple Shaarlis (farm)</a></li>
|
||||
<li><a href="Download-CSS-styles-from-an-OPML-list.html">Download CSS styles from an OPML list</a></li>
|
||||
<li><a href="Datastore-hacks.html">Datastore hacks</a></li>
|
||||
</ul></li>
|
||||
<li><a href="Troubleshooting.html">Troubleshooting</a></li>
|
||||
<li><a href="Development.html">Development</a>
|
||||
<ul>
|
||||
<li><a href="GnuPG-signature.html">GnuPG signature</a></li>
|
||||
<li><a href="Coding-guidelines.html">Coding guidelines</a></li>
|
||||
<li><a href="Directory-structure.html">Directory structure</a></li>
|
||||
<li><a href="3rd-party-libraries.html">3rd party libraries</a></li>
|
||||
<li><a href="Plugin-System.html">Plugin System</a></li>
|
||||
<li><a href="Release-Shaarli.html">Release Shaarli</a></li>
|
||||
<li><a href="Versioning-and-Branches.html">Versioning and Branches</a></li>
|
||||
<li><a href="Security.html">Security</a></li>
|
||||
<li><a href="Static-analysis.html">Static analysis</a></li>
|
||||
<li><a href="Theming.html">Theming</a></li>
|
||||
<li><a href="Unit-tests.html">Unit tests</a></li>
|
||||
</ul></li>
|
||||
<li>About
|
||||
<ul>
|
||||
<li><a href="FAQ.html">FAQ</a></li>
|
||||
<li><a href="Community-&-Related-software.html">Community & Related software</a></li>
|
||||
</ul></li>
|
||||
</ul>
|
||||
</div>
|
||||
<h1 id="copy-an-existing-installation-over-ssh-and-serve-it-locally">Copy an existing installation over SSH and serve it locally</h1>
|
||||
<p>Example bash script:</p>
|
||||
<div class="sourceCode"><pre class="sourceCode bash"><code class="sourceCode bash"><span class="co">#!/bin/bash</span>
|
||||
<span class="co">#Description: Copy a Shaarli installation over SSH/SCP, serve it locally with php-cli</span>
|
||||
<span class="co">#Will create a local-shaarli/ directory when you run it, backup your Shaarli there, and serve it locally.</span>
|
||||
<span class="co">#Will NOT download linked pages. It's just a directly usable backup/copy/mirror of your Shaarli</span>
|
||||
<span class="co">#Requires: ssh, scp and a working SSH access to the server where your Shaarli is installed</span>
|
||||
<span class="co">#Usage: ./local-shaarli.sh</span>
|
||||
<span class="co">#Author: nodiscc (nodiscc@gmail.com)</span>
|
||||
<span class="co">#License: MIT (http://opensource.org/licenses/MIT)</span>
|
||||
<span class="kw">set</span> <span class="ex">-o</span> errexit
|
||||
<span class="kw">set</span> <span class="ex">-o</span> nounset
|
||||
|
||||
<span class="co">##### CONFIG #################</span>
|
||||
<span class="co">#The port used by php's local server</span>
|
||||
<span class="va">php_local_port=</span>7431
|
||||
|
||||
<span class="co">#Name of the SSH server and path where Shaarli is installed</span>
|
||||
<span class="co">#TODO: pass these as command-line arguments</span>
|
||||
<span class="va">remotehost=</span><span class="st">"my.ssh.server"</span>
|
||||
<span class="va">remote_shaarli_dir=</span><span class="st">"/var/www/shaarli"</span>
|
||||
|
||||
|
||||
<span class="co">###### FUNCTIONS #############</span>
|
||||
<span class="fu">_main()</span> <span class="kw">{</span>
|
||||
<span class="ex">_CBSyncShaarli</span>
|
||||
<span class="ex">_CBServeShaarli</span>
|
||||
<span class="kw">}</span>
|
||||
|
||||
<span class="fu">_CBSyncShaarli()</span> <span class="kw">{</span>
|
||||
<span class="va">remote_temp_dir=$(</span><span class="fu">ssh</span> <span class="va">$remotehost</span> mktemp -d<span class="va">)</span>
|
||||
<span class="va">remote_ssh_user=$(</span><span class="fu">ssh</span> <span class="va">$remotehost</span> whoami<span class="va">)</span>
|
||||
<span class="fu">ssh</span> -t <span class="st">"</span><span class="va">$remotehost</span><span class="st">"</span> sudo cp -r <span class="st">"</span><span class="va">$remote_shaarli_dir</span><span class="st">"</span> <span class="st">"</span><span class="va">$remote_temp_dir</span><span class="st">"</span>
|
||||
<span class="fu">ssh</span> -t <span class="st">"</span><span class="va">$remotehost</span><span class="st">"</span> sudo chown -R <span class="st">"</span><span class="va">$remote_ssh_user</span><span class="st">"</span>:<span class="st">"</span><span class="va">$remote_ssh_user</span><span class="st">"</span> <span class="st">"</span><span class="va">$remote_temp_dir</span><span class="st">"</span>
|
||||
<span class="fu">scp</span> -rq <span class="st">"</span><span class="va">$remotehost</span><span class="st">"</span>:<span class="st">"</span><span class="va">$remote_temp_dir</span><span class="st">"</span> local-shaarli
|
||||
<span class="fu">ssh</span> <span class="st">"</span><span class="va">$remotehost</span><span class="st">"</span> rm -r <span class="st">"</span><span class="va">$remote_temp_dir</span><span class="st">"</span>
|
||||
<span class="kw">}</span>
|
||||
|
||||
<span class="fu">_CBServeShaarli()</span> <span class="kw">{</span>
|
||||
<span class="co">#TODO: allow serving a previously downloaded Shaarli</span>
|
||||
<span class="co">#TODO: ask before overwriting local copy, if it exists</span>
|
||||
<span class="bu">cd</span> local-shaarli/
|
||||
<span class="ex">php</span> -S localhost:<span class="va">${php_local_port}</span>
|
||||
<span class="bu">echo</span> <span class="st">"Please go to http://localhost:</span><span class="va">${php_local_port}</span><span class="st">"</span>
|
||||
<span class="kw">}</span>
|
||||
|
||||
|
||||
<span class="co">##### MAIN #################</span>
|
||||
|
||||
<span class="ex">_main</span></code></pre></div>
|
||||
<p>This outputs:</p>
|
||||
<div class="sourceCode"><pre class="sourceCode bash"><code class="sourceCode bash">$ <span class="ex">./local-shaarli.sh</span>
|
||||
<span class="ex">PHP</span> 5.6.0RC4 Development Server started at Mon Sep 1 21:56:19 2014
|
||||
<span class="ex">Listening</span> on http://localhost:7431
|
||||
<span class="ex">Document</span> root is /home/user/local-shaarli/shaarli
|
||||
<span class="ex">Press</span> Ctrl-C to quit.
|
||||
|
||||
[<span class="ex">Mon</span> Sep 1 21:56:27 2014] ::1:57868 [200]: /[](.html)
|
||||
[<span class="ex">Mon</span> Sep 1 21:56:27 2014] ::1:57869 [200]: /index.html[](.html)
|
||||
[<span class="ex">Mon</span> Sep 1 21:56:37 2014] ::1:57881 [200]: /...[](.html)</code></pre></div>
|
||||
</body>
|
||||
</html>
|
|
@ -1,159 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="generator" content="pandoc">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">
|
||||
<title>Shaarli – Create and serve multiple Shaarlis (farm)</title>
|
||||
<style type="text/css">code{white-space: pre;}</style>
|
||||
<style type="text/css">
|
||||
div.sourceCode { overflow-x: auto; }
|
||||
table.sourceCode, tr.sourceCode, td.lineNumbers, td.sourceCode {
|
||||
margin: 0; padding: 0; vertical-align: baseline; border: none; }
|
||||
table.sourceCode { width: 100%; line-height: 100%; }
|
||||
td.lineNumbers { text-align: right; padding-right: 4px; padding-left: 4px; color: #aaaaaa; border-right: 1px solid #aaaaaa; }
|
||||
td.sourceCode { padding-left: 5px; }
|
||||
code > span.kw { color: #007020; font-weight: bold; } /* Keyword */
|
||||
code > span.dt { color: #902000; } /* DataType */
|
||||
code > span.dv { color: #40a070; } /* DecVal */
|
||||
code > span.bn { color: #40a070; } /* BaseN */
|
||||
code > span.fl { color: #40a070; } /* Float */
|
||||
code > span.ch { color: #4070a0; } /* Char */
|
||||
code > span.st { color: #4070a0; } /* String */
|
||||
code > span.co { color: #60a0b0; font-style: italic; } /* Comment */
|
||||
code > span.ot { color: #007020; } /* Other */
|
||||
code > span.al { color: #ff0000; font-weight: bold; } /* Alert */
|
||||
code > span.fu { color: #06287e; } /* Function */
|
||||
code > span.er { color: #ff0000; font-weight: bold; } /* Error */
|
||||
code > span.wa { color: #60a0b0; font-weight: bold; font-style: italic; } /* Warning */
|
||||
code > span.cn { color: #880000; } /* Constant */
|
||||
code > span.sc { color: #4070a0; } /* SpecialChar */
|
||||
code > span.vs { color: #4070a0; } /* VerbatimString */
|
||||
code > span.ss { color: #bb6688; } /* SpecialString */
|
||||
code > span.im { } /* Import */
|
||||
code > span.va { color: #19177c; } /* Variable */
|
||||
code > span.cf { color: #007020; font-weight: bold; } /* ControlFlow */
|
||||
code > span.op { color: #666666; } /* Operator */
|
||||
code > span.bu { } /* BuiltIn */
|
||||
code > span.ex { } /* Extension */
|
||||
code > span.pp { color: #bc7a00; } /* Preprocessor */
|
||||
code > span.at { color: #7d9029; } /* Attribute */
|
||||
code > span.do { color: #ba2121; font-style: italic; } /* Documentation */
|
||||
code > span.an { color: #60a0b0; font-weight: bold; font-style: italic; } /* Annotation */
|
||||
code > span.cv { color: #60a0b0; font-weight: bold; font-style: italic; } /* CommentVar */
|
||||
code > span.in { color: #60a0b0; font-weight: bold; font-style: italic; } /* Information */
|
||||
</style>
|
||||
<link rel="stylesheet" href="github-markdown.css">
|
||||
<!--[if lt IE 9]>
|
||||
<script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv-printshiv.min.js"></script>
|
||||
<![endif]-->
|
||||
</head>
|
||||
<body>
|
||||
<div id="local-sidebar">
|
||||
<ul>
|
||||
<li><a href="Home.html">Home</a></li>
|
||||
<li>Setup
|
||||
<ul>
|
||||
<li><a href="Download-and-Installation.html">Download and Installation</a></li>
|
||||
<li><a href="Upgrade-and-migration.html">Upgrade and migration</a></li>
|
||||
<li><a href="Server-requirements.html">Server requirements</a></li>
|
||||
<li><a href="Server-configuration.html">Server configuration</a></li>
|
||||
<li><a href="Server-security.html">Server security</a></li>
|
||||
<li><a href="Shaarli-configuration.html">Shaarli configuration</a></li>
|
||||
<li><a href="Plugins.html">Plugins</a></li>
|
||||
</ul></li>
|
||||
<li><a href="Docker.html">Docker</a></li>
|
||||
<li><a href="Usage.html">Usage</a>
|
||||
<ul>
|
||||
<li><a href="Sharing-button.html">Sharing button</a> (bookmarklet)</li>
|
||||
<li><a href="Browsing-and-Searching.html">Browsing and Searching</a></li>
|
||||
<li><a href="Firefox-share.html">Firefox share</a></li>
|
||||
<li><a href="RSS-feeds.html">RSS feeds</a></li>
|
||||
<li><a href="REST-API.html">REST API</a></li>
|
||||
</ul></li>
|
||||
<li>How To
|
||||
<ul>
|
||||
<li><a href="Backup,-restore,-import-and-export.html">Backup, restore, import and export</a></li>
|
||||
<li><a href="Copy-an-existing-installation-over-SSH-and-serve-it-locally.html">Copy an existing installation over SSH and serve it locally</a></li>
|
||||
<li><a href="Create-and-serve-multiple-Shaarlis-(farm).html">Create and serve multiple Shaarlis (farm)</a></li>
|
||||
<li><a href="Download-CSS-styles-from-an-OPML-list.html">Download CSS styles from an OPML list</a></li>
|
||||
<li><a href="Datastore-hacks.html">Datastore hacks</a></li>
|
||||
</ul></li>
|
||||
<li><a href="Troubleshooting.html">Troubleshooting</a></li>
|
||||
<li><a href="Development.html">Development</a>
|
||||
<ul>
|
||||
<li><a href="GnuPG-signature.html">GnuPG signature</a></li>
|
||||
<li><a href="Coding-guidelines.html">Coding guidelines</a></li>
|
||||
<li><a href="Directory-structure.html">Directory structure</a></li>
|
||||
<li><a href="3rd-party-libraries.html">3rd party libraries</a></li>
|
||||
<li><a href="Plugin-System.html">Plugin System</a></li>
|
||||
<li><a href="Release-Shaarli.html">Release Shaarli</a></li>
|
||||
<li><a href="Versioning-and-Branches.html">Versioning and Branches</a></li>
|
||||
<li><a href="Security.html">Security</a></li>
|
||||
<li><a href="Static-analysis.html">Static analysis</a></li>
|
||||
<li><a href="Theming.html">Theming</a></li>
|
||||
<li><a href="Unit-tests.html">Unit tests</a></li>
|
||||
</ul></li>
|
||||
<li>About
|
||||
<ul>
|
||||
<li><a href="FAQ.html">FAQ</a></li>
|
||||
<li><a href="Community-&-Related-software.html">Community & Related software</a></li>
|
||||
</ul></li>
|
||||
</ul>
|
||||
</div>
|
||||
<h1 id="create-and-serve-multiple-shaarlis-farm">Create and serve multiple Shaarlis (farm)</h1>
|
||||
<p>Example bash script (creates multiple shaarli instances and generates an HTML index of them)</p>
|
||||
<div class="sourceCode"><pre class="sourceCode bash"><code class="sourceCode bash"><span class="co">#!/bin/bash</span>
|
||||
<span class="kw">set</span> <span class="ex">-o</span> errexit
|
||||
<span class="kw">set</span> <span class="ex">-o</span> nounset
|
||||
|
||||
<span class="co">#config</span>
|
||||
<span class="va">shaarli_base_dir=</span><span class="st">'/var/www/shaarli'</span>
|
||||
<span class="va">accounts=</span><span class="st">'bob john whatever username'</span>
|
||||
<span class="va">shaarli_repo_url=</span><span class="st">'https://github.com/shaarli/Shaarli'</span>
|
||||
<span class="va">ref=</span><span class="st">"master"</span>
|
||||
|
||||
<span class="co">#clone multiple shaarli instances</span>
|
||||
<span class="kw">if</span><span class="bu"> [</span> <span class="ot">!</span> <span class="ot">-d</span> <span class="st">"</span><span class="va">$shaarli_base_dir</span><span class="st">"</span><span class="bu"> ]</span>; <span class="kw">then</span> <span class="fu">mkdir</span> <span class="st">"</span><span class="va">$shaarli_base_dir</span><span class="st">"</span><span class="kw">;</span> <span class="kw">fi</span>[]<span class="kw">(</span><span class="ex">.html</span><span class="kw">)</span>
|
||||
|
||||
<span class="kw">for</span> <span class="ex">account</span> in <span class="va">$accounts</span><span class="kw">;</span> <span class="kw">do</span>
|
||||
<span class="kw">if</span><span class="bu"> [</span> <span class="ot">-d</span> <span class="st">"</span><span class="va">$shaarli_base_dir</span><span class="st">/</span><span class="va">$account</span><span class="st">"</span><span class="bu"> ]</span>;[]<span class="kw">(</span><span class="ex">.html</span><span class="kw">)</span>
|
||||
<span class="kw">then</span> <span class="bu">echo</span> <span class="st">"[info] account </span><span class="va">$account</span><span class="st"> already exists, skipping"</span><span class="kw">;</span>[]<span class="kw">(</span><span class="ex">.html</span><span class="kw">)</span>
|
||||
<span class="kw">else</span> <span class="bu">echo</span> <span class="st">"[info] creating new account </span><span class="va">$account</span><span class="st"> ..."</span><span class="kw">;</span> <span class="fu">git</span> clone --quiet <span class="st">"</span><span class="va">$shaarli_repo_url</span><span class="st">"</span> -b <span class="st">"</span><span class="va">$ref</span><span class="st">"</span> <span class="st">"</span><span class="va">$shaarli_base_dir</span><span class="st">/</span><span class="va">$account</span><span class="st">"</span><span class="kw">;</span> <span class="kw">fi</span>[]<span class="kw">(</span><span class="ex">.html</span><span class="kw">)</span>
|
||||
<span class="kw">done</span>
|
||||
|
||||
<span class="co">#generate html index of shaarlis</span>
|
||||
<span class="va">htmlhead=</span><span class="st">'<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"></span>
|
||||
<span class="st"><!-- Minimal html template thanks to http://www.sitepoint.com/a-minimal-html-document/ --></span>
|
||||
<span class="st"><html lang="en"></span>
|
||||
<span class="st"> <head></span>
|
||||
<span class="st"> <meta http-equiv="content-type" content="text/html; charset=utf-8"></span>
|
||||
<span class="st"> <title>My Shaarli farm</title></span>
|
||||
<span class="st"> <style>body {font-family: "Open Sans"}</style></span>
|
||||
<span class="st"> </head></span>
|
||||
<span class="st"> <body></span>
|
||||
<span class="st"> <div></span>
|
||||
<span class="st"> <h1>My Shaarli farm</h1></span>
|
||||
<span class="st"> <ul style="list-style-type: none;">'</span>
|
||||
|
||||
<span class="va">accountlinks=</span><span class="st">''</span>
|
||||
|
||||
<span class="va">htmlfooter=</span><span class="st">'</span>
|
||||
<span class="st"> </ul></span>
|
||||
<span class="st"> </div></span>
|
||||
<span class="st"> </body></span>
|
||||
<span class="st"></html>'</span>
|
||||
|
||||
|
||||
|
||||
<span class="kw">for</span> <span class="ex">account</span> in <span class="va">$accounts</span><span class="kw">;</span> <span class="kw">do</span> <span class="va">accountlinks=</span><span class="st">"</span><span class="va">$accountlinks</span><span class="st">\n<li><a href=</span><span class="dt">\"</span><span class="va">$account</span><span class="dt">\"</span><span class="st">></span><span class="va">$account</span><span class="st"></a></li>"</span>; <span class="kw">done</span>
|
||||
<span class="kw">if</span><span class="bu"> [</span> <span class="ot">-d</span> <span class="st">"</span><span class="va">$shaarli_base_dir</span><span class="st">/index.html"</span><span class="bu"> ]</span>; <span class="kw">then</span> <span class="bu">echo</span> <span class="st">"[removing old index.html]"</span><span class="kw">;</span> <span class="fu">rm</span> <span class="st">"</span><span class="va">$shaarli_base_dir</span><span class="st">/index.html"</span> ]<span class="kw">;</span> <span class="kw">fi</span>[]<span class="kw">(</span><span class="ex">.html</span><span class="kw">)</span>
|
||||
<span class="bu">echo</span> <span class="st">"[info] generating new index of shaarlis"</span>[](.html)
|
||||
<span class="bu">echo</span> -e <span class="st">"</span><span class="va">$htmlhead</span><span class="st"> </span><span class="va">$accountlinks</span><span class="st"> </span><span class="va">$htmlfooter</span><span class="st">"</span> <span class="op">></span> <span class="st">"</span><span class="va">$shaarli_base_dir</span><span class="st">/index.html"</span>
|
||||
<span class="bu">echo</span> <span class="st">'[info] done.'</span>[](.html)
|
||||
<span class="bu">echo</span> <span class="st">"[info] list of accounts: </span><span class="va">$accounts</span><span class="st">"</span>[](.html)
|
||||
<span class="bu">echo</span> <span class="st">"[info] contents of </span><span class="va">$shaarli_base_dir</span><span class="st">:"</span>[](.html)
|
||||
<span class="ex">tree</span> -a -L 1 <span class="st">"</span><span class="va">$shaarli_base_dir</span><span class="st">"</span></code></pre></div>
|
||||
<p>This script just serves as an example. More precise or complex (applying custom configuration, etc) automation is possible using configuration management software like <a href="https://www.ansible.com/">Ansible</a><a href=".html"></a></p>
|
||||
</body>
|
||||
</html>
|
|
@ -1,124 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="generator" content="pandoc">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">
|
||||
<title>Shaarli – Datastore hacks</title>
|
||||
<style type="text/css">code{white-space: pre;}</style>
|
||||
<style type="text/css">
|
||||
div.sourceCode { overflow-x: auto; }
|
||||
table.sourceCode, tr.sourceCode, td.lineNumbers, td.sourceCode {
|
||||
margin: 0; padding: 0; vertical-align: baseline; border: none; }
|
||||
table.sourceCode { width: 100%; line-height: 100%; }
|
||||
td.lineNumbers { text-align: right; padding-right: 4px; padding-left: 4px; color: #aaaaaa; border-right: 1px solid #aaaaaa; }
|
||||
td.sourceCode { padding-left: 5px; }
|
||||
code > span.kw { color: #007020; font-weight: bold; } /* Keyword */
|
||||
code > span.dt { color: #902000; } /* DataType */
|
||||
code > span.dv { color: #40a070; } /* DecVal */
|
||||
code > span.bn { color: #40a070; } /* BaseN */
|
||||
code > span.fl { color: #40a070; } /* Float */
|
||||
code > span.ch { color: #4070a0; } /* Char */
|
||||
code > span.st { color: #4070a0; } /* String */
|
||||
code > span.co { color: #60a0b0; font-style: italic; } /* Comment */
|
||||
code > span.ot { color: #007020; } /* Other */
|
||||
code > span.al { color: #ff0000; font-weight: bold; } /* Alert */
|
||||
code > span.fu { color: #06287e; } /* Function */
|
||||
code > span.er { color: #ff0000; font-weight: bold; } /* Error */
|
||||
code > span.wa { color: #60a0b0; font-weight: bold; font-style: italic; } /* Warning */
|
||||
code > span.cn { color: #880000; } /* Constant */
|
||||
code > span.sc { color: #4070a0; } /* SpecialChar */
|
||||
code > span.vs { color: #4070a0; } /* VerbatimString */
|
||||
code > span.ss { color: #bb6688; } /* SpecialString */
|
||||
code > span.im { } /* Import */
|
||||
code > span.va { color: #19177c; } /* Variable */
|
||||
code > span.cf { color: #007020; font-weight: bold; } /* ControlFlow */
|
||||
code > span.op { color: #666666; } /* Operator */
|
||||
code > span.bu { } /* BuiltIn */
|
||||
code > span.ex { } /* Extension */
|
||||
code > span.pp { color: #bc7a00; } /* Preprocessor */
|
||||
code > span.at { color: #7d9029; } /* Attribute */
|
||||
code > span.do { color: #ba2121; font-style: italic; } /* Documentation */
|
||||
code > span.an { color: #60a0b0; font-weight: bold; font-style: italic; } /* Annotation */
|
||||
code > span.cv { color: #60a0b0; font-weight: bold; font-style: italic; } /* CommentVar */
|
||||
code > span.in { color: #60a0b0; font-weight: bold; font-style: italic; } /* Information */
|
||||
</style>
|
||||
<link rel="stylesheet" href="github-markdown.css">
|
||||
<!--[if lt IE 9]>
|
||||
<script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv-printshiv.min.js"></script>
|
||||
<![endif]-->
|
||||
</head>
|
||||
<body>
|
||||
<div id="local-sidebar">
|
||||
<ul>
|
||||
<li><a href="Home.html">Home</a></li>
|
||||
<li>Setup
|
||||
<ul>
|
||||
<li><a href="Download-and-Installation.html">Download and Installation</a></li>
|
||||
<li><a href="Upgrade-and-migration.html">Upgrade and migration</a></li>
|
||||
<li><a href="Server-requirements.html">Server requirements</a></li>
|
||||
<li><a href="Server-configuration.html">Server configuration</a></li>
|
||||
<li><a href="Server-security.html">Server security</a></li>
|
||||
<li><a href="Shaarli-configuration.html">Shaarli configuration</a></li>
|
||||
<li><a href="Plugins.html">Plugins</a></li>
|
||||
</ul></li>
|
||||
<li><a href="Docker.html">Docker</a></li>
|
||||
<li><a href="Usage.html">Usage</a>
|
||||
<ul>
|
||||
<li><a href="Sharing-button.html">Sharing button</a> (bookmarklet)</li>
|
||||
<li><a href="Browsing-and-Searching.html">Browsing and Searching</a></li>
|
||||
<li><a href="Firefox-share.html">Firefox share</a></li>
|
||||
<li><a href="RSS-feeds.html">RSS feeds</a></li>
|
||||
<li><a href="REST-API.html">REST API</a></li>
|
||||
</ul></li>
|
||||
<li>How To
|
||||
<ul>
|
||||
<li><a href="Backup,-restore,-import-and-export.html">Backup, restore, import and export</a></li>
|
||||
<li><a href="Copy-an-existing-installation-over-SSH-and-serve-it-locally.html">Copy an existing installation over SSH and serve it locally</a></li>
|
||||
<li><a href="Create-and-serve-multiple-Shaarlis-(farm).html">Create and serve multiple Shaarlis (farm)</a></li>
|
||||
<li><a href="Download-CSS-styles-from-an-OPML-list.html">Download CSS styles from an OPML list</a></li>
|
||||
<li><a href="Datastore-hacks.html">Datastore hacks</a></li>
|
||||
</ul></li>
|
||||
<li><a href="Troubleshooting.html">Troubleshooting</a></li>
|
||||
<li><a href="Development.html">Development</a>
|
||||
<ul>
|
||||
<li><a href="GnuPG-signature.html">GnuPG signature</a></li>
|
||||
<li><a href="Coding-guidelines.html">Coding guidelines</a></li>
|
||||
<li><a href="Directory-structure.html">Directory structure</a></li>
|
||||
<li><a href="3rd-party-libraries.html">3rd party libraries</a></li>
|
||||
<li><a href="Plugin-System.html">Plugin System</a></li>
|
||||
<li><a href="Release-Shaarli.html">Release Shaarli</a></li>
|
||||
<li><a href="Versioning-and-Branches.html">Versioning and Branches</a></li>
|
||||
<li><a href="Security.html">Security</a></li>
|
||||
<li><a href="Static-analysis.html">Static analysis</a></li>
|
||||
<li><a href="Theming.html">Theming</a></li>
|
||||
<li><a href="Unit-tests.html">Unit tests</a></li>
|
||||
</ul></li>
|
||||
<li>About
|
||||
<ul>
|
||||
<li><a href="FAQ.html">FAQ</a></li>
|
||||
<li><a href="Community-&-Related-software.html">Community & Related software</a></li>
|
||||
</ul></li>
|
||||
</ul>
|
||||
</div>
|
||||
<h1 id="datastore-hacks">Datastore hacks</h1>
|
||||
<h3 id="decode-datastore-content">Decode datastore content</h3>
|
||||
<p>To display the array representing the data saved in <code>data/datastore.php</code>, use the following snippet:</p>
|
||||
<div class="sourceCode"><pre class="sourceCode php"><code class="sourceCode php"><span class="kw">$data</span> = <span class="st">"tZNdb9MwFIb... <Commented content inside datastore.php>"</span><span class="ot">;</span>
|
||||
<span class="kw">$out</span> = <span class="fu">unserialize</span><span class="ot">(</span><span class="fu">gzinflate</span><span class="ot">(</span><span class="fu">base64_decode</span><span class="ot">(</span><span class="kw">$data</span><span class="ot">)));</span>
|
||||
<span class="fu">echo</span> <span class="st">"<pre>"</span><span class="ot">;</span> <span class="co">// Pretty printing is love, pretty printing is life</span>
|
||||
<span class="fu">print_r</span><span class="ot">(</span><span class="kw">$out</span><span class="ot">);</span>
|
||||
<span class="fu">echo</span> <span class="st">"</pre>"</span><span class="ot">;</span>
|
||||
<span class="fu">exit</span><span class="ot">;</span></code></pre></div>
|
||||
<p>This will output the internal representation of the datastore, "unobfuscated" (if this can really be considered obfuscation).</p>
|
||||
<p>Alternatively, you can transform to JSON format (and pretty-print if you have <code>jq</code> installed):</p>
|
||||
<pre><code>php -r 'print(json_encode(unserialize(gzinflate(base64_decode(preg_replace("!.*/\* (.+) \*/.*!", "$1", file_get_contents("data/datastore.php")))))));' | jq .</code></pre>
|
||||
<h3 id="changing-the-timestamp-for-a-link">Changing the timestamp for a link</h3>
|
||||
<ul>
|
||||
<li>Look for <code><input type="hidden" name="lf_linkdate" value="{$link.linkdate}"></code> in <code>tpl/editlink.tpl</code> (line 14)</li>
|
||||
<li>Replace <code>type="hidden"</code> with <code>type="text"</code> from this line</li>
|
||||
<li>A new date/time field becomes available in the edit/new link dialog.</li>
|
||||
<li>You can set the timestamp manually by entering it in the format <code>YYYMMDD_HHMMS</code>.</li>
|
||||
</ul>
|
||||
</body>
|
||||
</html>
|
|
@ -1,112 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="generator" content="pandoc">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">
|
||||
<title>Shaarli – Development</title>
|
||||
<style type="text/css">code{white-space: pre;}</style>
|
||||
<link rel="stylesheet" href="github-markdown.css">
|
||||
<!--[if lt IE 9]>
|
||||
<script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv-printshiv.min.js"></script>
|
||||
<![endif]-->
|
||||
</head>
|
||||
<body>
|
||||
<div id="local-sidebar">
|
||||
<ul>
|
||||
<li><a href="Home.html">Home</a></li>
|
||||
<li>Setup
|
||||
<ul>
|
||||
<li><a href="Download-and-Installation.html">Download and Installation</a></li>
|
||||
<li><a href="Upgrade-and-migration.html">Upgrade and migration</a></li>
|
||||
<li><a href="Server-requirements.html">Server requirements</a></li>
|
||||
<li><a href="Server-configuration.html">Server configuration</a></li>
|
||||
<li><a href="Server-security.html">Server security</a></li>
|
||||
<li><a href="Shaarli-configuration.html">Shaarli configuration</a></li>
|
||||
<li><a href="Plugins.html">Plugins</a></li>
|
||||
</ul></li>
|
||||
<li><a href="Docker.html">Docker</a></li>
|
||||
<li><a href="Usage.html">Usage</a>
|
||||
<ul>
|
||||
<li><a href="Sharing-button.html">Sharing button</a> (bookmarklet)</li>
|
||||
<li><a href="Browsing-and-Searching.html">Browsing and Searching</a></li>
|
||||
<li><a href="Firefox-share.html">Firefox share</a></li>
|
||||
<li><a href="RSS-feeds.html">RSS feeds</a></li>
|
||||
<li><a href="REST-API.html">REST API</a></li>
|
||||
</ul></li>
|
||||
<li>How To
|
||||
<ul>
|
||||
<li><a href="Backup,-restore,-import-and-export.html">Backup, restore, import and export</a></li>
|
||||
<li><a href="Copy-an-existing-installation-over-SSH-and-serve-it-locally.html">Copy an existing installation over SSH and serve it locally</a></li>
|
||||
<li><a href="Create-and-serve-multiple-Shaarlis-(farm).html">Create and serve multiple Shaarlis (farm)</a></li>
|
||||
<li><a href="Download-CSS-styles-from-an-OPML-list.html">Download CSS styles from an OPML list</a></li>
|
||||
<li><a href="Datastore-hacks.html">Datastore hacks</a></li>
|
||||
</ul></li>
|
||||
<li><a href="Troubleshooting.html">Troubleshooting</a></li>
|
||||
<li><a href="Development.html">Development</a>
|
||||
<ul>
|
||||
<li><a href="GnuPG-signature.html">GnuPG signature</a></li>
|
||||
<li><a href="Coding-guidelines.html">Coding guidelines</a></li>
|
||||
<li><a href="Directory-structure.html">Directory structure</a></li>
|
||||
<li><a href="3rd-party-libraries.html">3rd party libraries</a></li>
|
||||
<li><a href="Plugin-System.html">Plugin System</a></li>
|
||||
<li><a href="Release-Shaarli.html">Release Shaarli</a></li>
|
||||
<li><a href="Versioning-and-Branches.html">Versioning and Branches</a></li>
|
||||
<li><a href="Security.html">Security</a></li>
|
||||
<li><a href="Static-analysis.html">Static analysis</a></li>
|
||||
<li><a href="Theming.html">Theming</a></li>
|
||||
<li><a href="Unit-tests.html">Unit tests</a></li>
|
||||
</ul></li>
|
||||
<li>About
|
||||
<ul>
|
||||
<li><a href="FAQ.html">FAQ</a></li>
|
||||
<li><a href="Community-&-Related-software.html">Community & Related software</a></li>
|
||||
</ul></li>
|
||||
</ul>
|
||||
</div>
|
||||
<h1 id="development">Development</h1>
|
||||
<h2 id="guidelines">Guidelines</h2>
|
||||
<p>Please have a look at the following pages:</p>
|
||||
<ul>
|
||||
<li><a href="https://github.com/shaarli/Shaarli/tree/master/CONTRIBUTING.md">Contributing to Shaarli</a><a href=".html"></a></li>
|
||||
<li><a href="Static-analysis.html">Static analysis</a> - patches should try to stick to the <a href="http://www.php-fig.org/psr/">PHP Standard Recommendations</a> (PSR), especially:
|
||||
<ul>
|
||||
<li><a href="http://www.php-fig.org/psr/psr-1/">PSR-1</a> - Basic Coding Standard<a href=".html"></a></li>
|
||||
<li><a href="http://www.php-fig.org/psr/psr-2/">PSR-2</a> - Coding Style Guide<a href=".html"></a></li>
|
||||
</ul></li>
|
||||
<li><a href="Unit-tests.html">Unit tests</a></li>
|
||||
<li><a href="GnuPG-signature.html">GnuPG signature</a> for tags/releases</li>
|
||||
</ul>
|
||||
<h2 id="continuous-integration-tools">Continuous integration tools</h2>
|
||||
<h3 id="local-development">Local development</h3>
|
||||
<p>A <a href="https://github.com/shaarli/Shaarli/blob/master/Makefile"><code>Makefile</code></a> is available to perform project-related operations:<a href=".html"></a></p>
|
||||
<ul>
|
||||
<li>Documentation - generate a local HTML copy of the GitHub wiki</li>
|
||||
<li><a href="Static-analysis.html">Static analysis</a> - check that the code is compliant to PHP conventions</li>
|
||||
<li><a href="Unit-tests.html">Unit tests</a> - ensure there are no regressions introduced by new commits</li>
|
||||
</ul>
|
||||
<h3 id="automatic-builds">Automatic builds</h3>
|
||||
<p><a href="http://docs.travis-ci.com/">Travis CI</a> is a Continuous Integration build server, that runs a build:<a href=".html"></a></p>
|
||||
<ul>
|
||||
<li>each time a commit is merged to the mainline (<code>master</code> branch)</li>
|
||||
<li>each time a Pull Request is submitted or updated</li>
|
||||
</ul>
|
||||
<p>A build is composed of several jobs: one for each supported PHP version (see <a href="Server-requirements.html">Server requirements</a>).</p>
|
||||
<p>Each build job:</p>
|
||||
<ul>
|
||||
<li>updates Composer</li>
|
||||
<li>installs 3rd-party test dependencies with Composer</li>
|
||||
<li>runs <a href="Unit-tests.html">Unit tests</a></li>
|
||||
</ul>
|
||||
<p>After all jobs have finished, Travis returns the results to GitHub:</p>
|
||||
<ul>
|
||||
<li>a status icon represents the result for the <code>master</code> branch: <a href="(https://api.travis-ci.org/shaarli/Shaarli.svg)%5D(https://travis-ci.org/shaarli/Shaarli).html"><img src="https://travis-ci.org/shaarli/Shaarli" alt="(https://api.travis-ci.org/shaarli/Shaarli.svg)" /></a></li>
|
||||
<li>Pull Requests are updated with the Travis result
|
||||
<ul>
|
||||
<li>Green: all tests have passed</li>
|
||||
<li>Red: some tests failed</li>
|
||||
<li>Orange: tests are pending</li>
|
||||
</ul></li>
|
||||
</ul>
|
||||
</body>
|
||||
</html>
|
|
@ -1,35 +0,0 @@
|
|||
#Development
|
||||
## Guidelines
|
||||
Please have a look at the following pages:
|
||||
- [Contributing to Shaarli](https://github.com/shaarli/Shaarli/tree/master/CONTRIBUTING.md)[](.html)
|
||||
- [Static analysis](Static-analysis.html) - patches should try to stick to the [PHP Standard Recommendations](http://www.php-fig.org/psr/) (PSR), especially:
|
||||
- [PSR-1](http://www.php-fig.org/psr/psr-1/) - Basic Coding Standard[](.html)
|
||||
- [PSR-2](http://www.php-fig.org/psr/psr-2/) - Coding Style Guide[](.html)
|
||||
- [Unit tests](Unit-tests.html)
|
||||
- [GnuPG signature](GnuPG-signature.html) for tags/releases
|
||||
|
||||
## Continuous integration tools
|
||||
### Local development
|
||||
A [`Makefile`](https://github.com/shaarli/Shaarli/blob/master/Makefile) is available to perform project-related operations:[](.html)
|
||||
- Documentation - generate a local HTML copy of the GitHub wiki
|
||||
- [Static analysis](Static-analysis.html) - check that the code is compliant to PHP conventions
|
||||
- [Unit tests](Unit-tests.html) - ensure there are no regressions introduced by new commits
|
||||
|
||||
### Automatic builds
|
||||
[Travis CI](http://docs.travis-ci.com/) is a Continuous Integration build server, that runs a build:[](.html)
|
||||
- each time a commit is merged to the mainline (`master` branch)
|
||||
- each time a Pull Request is submitted or updated
|
||||
|
||||
A build is composed of several jobs: one for each supported PHP version (see [Server requirements](Server-requirements.html)).
|
||||
|
||||
Each build job:
|
||||
- updates Composer
|
||||
- installs 3rd-party test dependencies with Composer
|
||||
- runs [Unit tests](Unit-tests.html)
|
||||
|
||||
After all jobs have finished, Travis returns the results to GitHub:
|
||||
- a status icon represents the result for the `master` branch: []((https://api.travis-ci.org/shaarli/Shaarli.svg)](https://travis-ci.org/shaarli/Shaarli).html)
|
||||
- Pull Requests are updated with the Travis result
|
||||
- Green: all tests have passed
|
||||
- Red: some tests failed
|
||||
- Orange: tests are pending
|
|
@ -1,135 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="generator" content="pandoc">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">
|
||||
<title>Shaarli – Directory structure</title>
|
||||
<style type="text/css">code{white-space: pre;}</style>
|
||||
<style type="text/css">
|
||||
div.sourceCode { overflow-x: auto; }
|
||||
table.sourceCode, tr.sourceCode, td.lineNumbers, td.sourceCode {
|
||||
margin: 0; padding: 0; vertical-align: baseline; border: none; }
|
||||
table.sourceCode { width: 100%; line-height: 100%; }
|
||||
td.lineNumbers { text-align: right; padding-right: 4px; padding-left: 4px; color: #aaaaaa; border-right: 1px solid #aaaaaa; }
|
||||
td.sourceCode { padding-left: 5px; }
|
||||
code > span.kw { color: #007020; font-weight: bold; } /* Keyword */
|
||||
code > span.dt { color: #902000; } /* DataType */
|
||||
code > span.dv { color: #40a070; } /* DecVal */
|
||||
code > span.bn { color: #40a070; } /* BaseN */
|
||||
code > span.fl { color: #40a070; } /* Float */
|
||||
code > span.ch { color: #4070a0; } /* Char */
|
||||
code > span.st { color: #4070a0; } /* String */
|
||||
code > span.co { color: #60a0b0; font-style: italic; } /* Comment */
|
||||
code > span.ot { color: #007020; } /* Other */
|
||||
code > span.al { color: #ff0000; font-weight: bold; } /* Alert */
|
||||
code > span.fu { color: #06287e; } /* Function */
|
||||
code > span.er { color: #ff0000; font-weight: bold; } /* Error */
|
||||
code > span.wa { color: #60a0b0; font-weight: bold; font-style: italic; } /* Warning */
|
||||
code > span.cn { color: #880000; } /* Constant */
|
||||
code > span.sc { color: #4070a0; } /* SpecialChar */
|
||||
code > span.vs { color: #4070a0; } /* VerbatimString */
|
||||
code > span.ss { color: #bb6688; } /* SpecialString */
|
||||
code > span.im { } /* Import */
|
||||
code > span.va { color: #19177c; } /* Variable */
|
||||
code > span.cf { color: #007020; font-weight: bold; } /* ControlFlow */
|
||||
code > span.op { color: #666666; } /* Operator */
|
||||
code > span.bu { } /* BuiltIn */
|
||||
code > span.ex { } /* Extension */
|
||||
code > span.pp { color: #bc7a00; } /* Preprocessor */
|
||||
code > span.at { color: #7d9029; } /* Attribute */
|
||||
code > span.do { color: #ba2121; font-style: italic; } /* Documentation */
|
||||
code > span.an { color: #60a0b0; font-weight: bold; font-style: italic; } /* Annotation */
|
||||
code > span.cv { color: #60a0b0; font-weight: bold; font-style: italic; } /* CommentVar */
|
||||
code > span.in { color: #60a0b0; font-weight: bold; font-style: italic; } /* Information */
|
||||
</style>
|
||||
<link rel="stylesheet" href="github-markdown.css">
|
||||
<!--[if lt IE 9]>
|
||||
<script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv-printshiv.min.js"></script>
|
||||
<![endif]-->
|
||||
</head>
|
||||
<body>
|
||||
<div id="local-sidebar">
|
||||
<ul>
|
||||
<li><a href="Home.html">Home</a></li>
|
||||
<li>Setup
|
||||
<ul>
|
||||
<li><a href="Download-and-Installation.html">Download and Installation</a></li>
|
||||
<li><a href="Upgrade-and-migration.html">Upgrade and migration</a></li>
|
||||
<li><a href="Server-requirements.html">Server requirements</a></li>
|
||||
<li><a href="Server-configuration.html">Server configuration</a></li>
|
||||
<li><a href="Server-security.html">Server security</a></li>
|
||||
<li><a href="Shaarli-configuration.html">Shaarli configuration</a></li>
|
||||
<li><a href="Plugins.html">Plugins</a></li>
|
||||
</ul></li>
|
||||
<li><a href="Docker.html">Docker</a></li>
|
||||
<li><a href="Usage.html">Usage</a>
|
||||
<ul>
|
||||
<li><a href="Sharing-button.html">Sharing button</a> (bookmarklet)</li>
|
||||
<li><a href="Browsing-and-Searching.html">Browsing and Searching</a></li>
|
||||
<li><a href="Firefox-share.html">Firefox share</a></li>
|
||||
<li><a href="RSS-feeds.html">RSS feeds</a></li>
|
||||
<li><a href="REST-API.html">REST API</a></li>
|
||||
</ul></li>
|
||||
<li>How To
|
||||
<ul>
|
||||
<li><a href="Backup,-restore,-import-and-export.html">Backup, restore, import and export</a></li>
|
||||
<li><a href="Copy-an-existing-installation-over-SSH-and-serve-it-locally.html">Copy an existing installation over SSH and serve it locally</a></li>
|
||||
<li><a href="Create-and-serve-multiple-Shaarlis-(farm).html">Create and serve multiple Shaarlis (farm)</a></li>
|
||||
<li><a href="Download-CSS-styles-from-an-OPML-list.html">Download CSS styles from an OPML list</a></li>
|
||||
<li><a href="Datastore-hacks.html">Datastore hacks</a></li>
|
||||
</ul></li>
|
||||
<li><a href="Troubleshooting.html">Troubleshooting</a></li>
|
||||
<li><a href="Development.html">Development</a>
|
||||
<ul>
|
||||
<li><a href="GnuPG-signature.html">GnuPG signature</a></li>
|
||||
<li><a href="Coding-guidelines.html">Coding guidelines</a></li>
|
||||
<li><a href="Directory-structure.html">Directory structure</a></li>
|
||||
<li><a href="3rd-party-libraries.html">3rd party libraries</a></li>
|
||||
<li><a href="Plugin-System.html">Plugin System</a></li>
|
||||
<li><a href="Release-Shaarli.html">Release Shaarli</a></li>
|
||||
<li><a href="Versioning-and-Branches.html">Versioning and Branches</a></li>
|
||||
<li><a href="Security.html">Security</a></li>
|
||||
<li><a href="Static-analysis.html">Static analysis</a></li>
|
||||
<li><a href="Theming.html">Theming</a></li>
|
||||
<li><a href="Unit-tests.html">Unit tests</a></li>
|
||||
</ul></li>
|
||||
<li>About
|
||||
<ul>
|
||||
<li><a href="FAQ.html">FAQ</a></li>
|
||||
<li><a href="Community-&-Related-software.html">Community & Related software</a></li>
|
||||
</ul></li>
|
||||
</ul>
|
||||
</div>
|
||||
<h1 id="directory-structure">Directory structure</h1>
|
||||
<p>Here is the directory structure of Shaarli and the purpose of the different files:</p>
|
||||
<div class="sourceCode"><pre class="sourceCode bash"><code class="sourceCode bash"> <span class="ex">index.php</span> # Main program
|
||||
<span class="ex">application/</span> # Shaarli classes
|
||||
├── <span class="ex">LinkDB.php</span>
|
||||
└── <span class="ex">Utils.php</span>
|
||||
<span class="ex">tests/</span> # Shaarli unitary <span class="kw">&</span> <span class="ex">functional</span> tests
|
||||
├── <span class="ex">LinkDBTest.php</span>
|
||||
├── <span class="ex">utils</span> # utilities to ease testing
|
||||
│ └── <span class="ex">ReferenceLinkDB.php</span>
|
||||
└── <span class="ex">UtilsTest.php</span>
|
||||
<span class="ex">COPYING</span> # Shaarli license
|
||||
<span class="ex">inc/</span> # static assets and 3rd party libraries
|
||||
├── <span class="ex">awesomplete.*</span> # tags autocompletion library
|
||||
├── <span class="ex">blazy.*</span> # picture wall lazy image loading library
|
||||
├── <span class="ex">shaarli.css</span>, reset.css <span class="co"># Shaarli stylesheet.</span>
|
||||
├── <span class="ex">qr.*</span> # qr code generation library
|
||||
└──<span class="ex">rain.tpl.class.php</span> # RainTPL templating library
|
||||
<span class="ex">tpl/</span> # RainTPL templates for Shaarli. They are used to build the pages.
|
||||
<span class="ex">images/</span> # Images and icons used in Shaarli
|
||||
<span class="ex">data/</span> # data storage: bookmark database, configuration, logs, banlist…
|
||||
├── <span class="ex">config.php</span> # Shaarli configuration (login, password, timezone, title…)
|
||||
├── <span class="ex">datastore.php</span> # Your link database (compressed)<span class="ex">.</span>
|
||||
├── <span class="ex">ipban.php</span> # IP address ban system data
|
||||
├── <span class="ex">lastupdatecheck.txt</span> # Update check timestamp file
|
||||
└──<span class="ex">log.txt</span> # login/IPban log.
|
||||
<span class="ex">cache/</span> # thumbnails cache
|
||||
<span class="co"># This directory is automatically created. You can erase it anytime you want.</span>
|
||||
<span class="ex">tmp/</span> # Temporary directory for compiled RainTPL templates.
|
||||
<span class="co"># This directory is automatically created. You can erase it anytime you want.</span></code></pre></div>
|
||||
</body>
|
||||
</html>
|
245
doc/Docker.html
245
doc/Docker.html
|
@ -1,245 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="generator" content="pandoc">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">
|
||||
<title>Shaarli – Docker</title>
|
||||
<style type="text/css">code{white-space: pre;}</style>
|
||||
<style type="text/css">
|
||||
div.sourceCode { overflow-x: auto; }
|
||||
table.sourceCode, tr.sourceCode, td.lineNumbers, td.sourceCode {
|
||||
margin: 0; padding: 0; vertical-align: baseline; border: none; }
|
||||
table.sourceCode { width: 100%; line-height: 100%; }
|
||||
td.lineNumbers { text-align: right; padding-right: 4px; padding-left: 4px; color: #aaaaaa; border-right: 1px solid #aaaaaa; }
|
||||
td.sourceCode { padding-left: 5px; }
|
||||
code > span.kw { color: #007020; font-weight: bold; } /* Keyword */
|
||||
code > span.dt { color: #902000; } /* DataType */
|
||||
code > span.dv { color: #40a070; } /* DecVal */
|
||||
code > span.bn { color: #40a070; } /* BaseN */
|
||||
code > span.fl { color: #40a070; } /* Float */
|
||||
code > span.ch { color: #4070a0; } /* Char */
|
||||
code > span.st { color: #4070a0; } /* String */
|
||||
code > span.co { color: #60a0b0; font-style: italic; } /* Comment */
|
||||
code > span.ot { color: #007020; } /* Other */
|
||||
code > span.al { color: #ff0000; font-weight: bold; } /* Alert */
|
||||
code > span.fu { color: #06287e; } /* Function */
|
||||
code > span.er { color: #ff0000; font-weight: bold; } /* Error */
|
||||
code > span.wa { color: #60a0b0; font-weight: bold; font-style: italic; } /* Warning */
|
||||
code > span.cn { color: #880000; } /* Constant */
|
||||
code > span.sc { color: #4070a0; } /* SpecialChar */
|
||||
code > span.vs { color: #4070a0; } /* VerbatimString */
|
||||
code > span.ss { color: #bb6688; } /* SpecialString */
|
||||
code > span.im { } /* Import */
|
||||
code > span.va { color: #19177c; } /* Variable */
|
||||
code > span.cf { color: #007020; font-weight: bold; } /* ControlFlow */
|
||||
code > span.op { color: #666666; } /* Operator */
|
||||
code > span.bu { } /* BuiltIn */
|
||||
code > span.ex { } /* Extension */
|
||||
code > span.pp { color: #bc7a00; } /* Preprocessor */
|
||||
code > span.at { color: #7d9029; } /* Attribute */
|
||||
code > span.do { color: #ba2121; font-style: italic; } /* Documentation */
|
||||
code > span.an { color: #60a0b0; font-weight: bold; font-style: italic; } /* Annotation */
|
||||
code > span.cv { color: #60a0b0; font-weight: bold; font-style: italic; } /* CommentVar */
|
||||
code > span.in { color: #60a0b0; font-weight: bold; font-style: italic; } /* Information */
|
||||
</style>
|
||||
<link rel="stylesheet" href="github-markdown.css">
|
||||
<!--[if lt IE 9]>
|
||||
<script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv-printshiv.min.js"></script>
|
||||
<![endif]-->
|
||||
</head>
|
||||
<body>
|
||||
<div id="local-sidebar">
|
||||
<ul>
|
||||
<li><a href="Home.html">Home</a></li>
|
||||
<li>Setup
|
||||
<ul>
|
||||
<li><a href="Download-and-Installation.html">Download and Installation</a></li>
|
||||
<li><a href="Upgrade-and-migration.html">Upgrade and migration</a></li>
|
||||
<li><a href="Server-requirements.html">Server requirements</a></li>
|
||||
<li><a href="Server-configuration.html">Server configuration</a></li>
|
||||
<li><a href="Server-security.html">Server security</a></li>
|
||||
<li><a href="Shaarli-configuration.html">Shaarli configuration</a></li>
|
||||
<li><a href="Plugins.html">Plugins</a></li>
|
||||
</ul></li>
|
||||
<li><a href="Docker.html">Docker</a></li>
|
||||
<li><a href="Usage.html">Usage</a>
|
||||
<ul>
|
||||
<li><a href="Sharing-button.html">Sharing button</a> (bookmarklet)</li>
|
||||
<li><a href="Browsing-and-Searching.html">Browsing and Searching</a></li>
|
||||
<li><a href="Firefox-share.html">Firefox share</a></li>
|
||||
<li><a href="RSS-feeds.html">RSS feeds</a></li>
|
||||
<li><a href="REST-API.html">REST API</a></li>
|
||||
</ul></li>
|
||||
<li>How To
|
||||
<ul>
|
||||
<li><a href="Backup,-restore,-import-and-export.html">Backup, restore, import and export</a></li>
|
||||
<li><a href="Copy-an-existing-installation-over-SSH-and-serve-it-locally.html">Copy an existing installation over SSH and serve it locally</a></li>
|
||||
<li><a href="Create-and-serve-multiple-Shaarlis-(farm).html">Create and serve multiple Shaarlis (farm)</a></li>
|
||||
<li><a href="Download-CSS-styles-from-an-OPML-list.html">Download CSS styles from an OPML list</a></li>
|
||||
<li><a href="Datastore-hacks.html">Datastore hacks</a></li>
|
||||
</ul></li>
|
||||
<li><a href="Troubleshooting.html">Troubleshooting</a></li>
|
||||
<li><a href="Development.html">Development</a>
|
||||
<ul>
|
||||
<li><a href="GnuPG-signature.html">GnuPG signature</a></li>
|
||||
<li><a href="Coding-guidelines.html">Coding guidelines</a></li>
|
||||
<li><a href="Directory-structure.html">Directory structure</a></li>
|
||||
<li><a href="3rd-party-libraries.html">3rd party libraries</a></li>
|
||||
<li><a href="Plugin-System.html">Plugin System</a></li>
|
||||
<li><a href="Release-Shaarli.html">Release Shaarli</a></li>
|
||||
<li><a href="Versioning-and-Branches.html">Versioning and Branches</a></li>
|
||||
<li><a href="Security.html">Security</a></li>
|
||||
<li><a href="Static-analysis.html">Static analysis</a></li>
|
||||
<li><a href="Theming.html">Theming</a></li>
|
||||
<li><a href="Unit-tests.html">Unit tests</a></li>
|
||||
</ul></li>
|
||||
<li>About
|
||||
<ul>
|
||||
<li><a href="FAQ.html">FAQ</a></li>
|
||||
<li><a href="Community-&-Related-software.html">Community & Related software</a></li>
|
||||
</ul></li>
|
||||
</ul>
|
||||
</div>
|
||||
<h1 id="docker">Docker</h1>
|
||||
<ul>
|
||||
<li><a href="#docker-usage">Docker usage</a><a href=".html"></a></li>
|
||||
<li><a href="#get-and-run-a-shaarli-image">Get and run a Shaarli image</a><a href=".html"></a></li>
|
||||
<li><a href="#resources">Resources</a><a href=".html"></a></li>
|
||||
</ul>
|
||||
<h2 id="docker-usage">Docker usage</h2>
|
||||
<h3 id="basics">Basics</h3>
|
||||
<p>Install <a href="https://www.docker.com/">Docker</a>, by following the instructions relevant<a href=".html"></a><br />
|
||||
to your OS / distribution, and start the service.</p>
|
||||
<h4 id="search-an-image-on-dockerhub">Search an image on <a href="https://hub.docker.com/">DockerHub</a><a href=".html"></a></h4>
|
||||
<div class="sourceCode"><pre class="sourceCode bash"><code class="sourceCode bash">$ <span class="ex">docker</span> search debian
|
||||
|
||||
<span class="ex">NAME</span> DESCRIPTION STARS OFFICIAL AUTOMATED
|
||||
<span class="ex">ubuntu</span> Ubuntu is a Debian-based Linux operating s... 2065 [OK][](.html)
|
||||
<span class="ex">debian</span> Debian is a Linux distribution that<span class="st">'s comp... 603 [OK][](.html)</span>
|
||||
<span class="st">google/debian 47 [OK][](.html)</span></code></pre></div>
|
||||
<h4 id="show-available-tags-for-a-repository">Show available tags for a repository</h4>
|
||||
<div class="sourceCode"><pre class="sourceCode bash"><code class="sourceCode bash">$ <span class="ex">curl</span> https://index.docker.io/v1/repositories/debian/tags <span class="kw">|</span> <span class="ex">python</span> -m json.tool
|
||||
|
||||
<span class="ex">%</span> Total % Received % Xferd Average Speed Time Time Time Current
|
||||
<span class="ex">Dload</span> Upload Total Spent Left Speed
|
||||
<span class="ex">100</span> 1283 0 1283 0 0 433 0 --:--:-- 0:00:02 --:--:-- 433</code></pre></div>
|
||||
<p>Sample output:</p>
|
||||
<div class="sourceCode"><pre class="sourceCode json"><code class="sourceCode json"><span class="ot">[[]</span><span class="er">(.html)</span>
|
||||
<span class="fu">{</span>
|
||||
<span class="dt">"layer"</span><span class="fu">:</span> <span class="st">"85a02782"</span><span class="fu">,</span>
|
||||
<span class="dt">"name"</span><span class="fu">:</span> <span class="st">"stretch"</span>
|
||||
<span class="fu">}</span><span class="ot">,</span>
|
||||
<span class="fu">{</span>
|
||||
<span class="dt">"layer"</span><span class="fu">:</span> <span class="st">"59abecbc"</span><span class="fu">,</span>
|
||||
<span class="dt">"name"</span><span class="fu">:</span> <span class="st">"testing"</span>
|
||||
<span class="fu">}</span><span class="ot">,</span>
|
||||
<span class="fu">{</span>
|
||||
<span class="dt">"layer"</span><span class="fu">:</span> <span class="st">"bf0fd686"</span><span class="fu">,</span>
|
||||
<span class="dt">"name"</span><span class="fu">:</span> <span class="st">"unstable"</span>
|
||||
<span class="fu">}</span><span class="ot">,</span>
|
||||
<span class="fu">{</span>
|
||||
<span class="dt">"layer"</span><span class="fu">:</span> <span class="st">"60c52dbe"</span><span class="fu">,</span>
|
||||
<span class="dt">"name"</span><span class="fu">:</span> <span class="st">"wheezy"</span>
|
||||
<span class="fu">}</span><span class="ot">,</span>
|
||||
<span class="fu">{</span>
|
||||
<span class="dt">"layer"</span><span class="fu">:</span> <span class="st">"c5b806fe"</span><span class="fu">,</span>
|
||||
<span class="dt">"name"</span><span class="fu">:</span> <span class="st">"wheezy-backports"</span>
|
||||
<span class="fu">}</span>
|
||||
<span class="ot">]</span></code></pre></div>
|
||||
<h4 id="pull-an-image-from-dockerhub">Pull an image from DockerHub</h4>
|
||||
<div class="sourceCode"><pre class="sourceCode bash"><code class="sourceCode bash">$ <span class="ex">docker</span> pull repository[:tag][](.html)
|
||||
|
||||
$ <span class="ex">docker</span> pull debian:wheezy
|
||||
<span class="ex">wheezy</span>: Pulling from debian
|
||||
<span class="ex">4c8cbfd2973e</span>: Pull complete
|
||||
<span class="ex">60c52dbe9d91</span>: Pull complete
|
||||
<span class="ex">Digest</span>: sha256:c584131da2ac1948aa3e66468a4424b6aea2f33acba7cec0b631bdb56254c4fe
|
||||
<span class="ex">Status</span>: Downloaded newer image for debian:wheezy</code></pre></div>
|
||||
<h2 id="get-and-run-a-shaarli-image">Get and run a Shaarli image</h2>
|
||||
<h3 id="dockerhub-repository">DockerHub repository</h3>
|
||||
<p>The images can be found in the <a href="https://hub.docker.com/r/shaarli/shaarli/"><code>shaarli/shaarli</code></a><a href=".html"></a><br />
|
||||
repository.</p>
|
||||
<h3 id="available-image-tags">Available image tags</h3>
|
||||
<ul>
|
||||
<li><code>latest</code>: master branch (tarball release)</li>
|
||||
<li><code>stable</code>: stable branch (tarball release)</li>
|
||||
<li><code>dev</code>: master branch (Git clone)</li>
|
||||
</ul>
|
||||
<p>All images rely on:</p>
|
||||
<ul>
|
||||
<li><a href="https://hub.docker.com/_/debian/">Debian 8 Jessie</a><a href=".html"></a></li>
|
||||
<li><a href="http://php-fpm.org/">PHP5-FPM</a><a href=".html"></a></li>
|
||||
<li><a href="http://nginx.org/">Nginx</a><a href=".html"></a></li>
|
||||
</ul>
|
||||
<h3 id="download-from-dockerhub">Download from DockerHub</h3>
|
||||
<div class="sourceCode"><pre class="sourceCode bash"><code class="sourceCode bash">$ <span class="ex">docker</span> pull shaarli/shaarli
|
||||
<span class="ex">latest</span>: Pulling from shaarli/shaarli
|
||||
<span class="ex">32716d9fcddb</span>: Pull complete
|
||||
<span class="ex">84899d045435</span>: Pull complete
|
||||
<span class="ex">4b6ad7444763</span>: Pull complete
|
||||
<span class="ex">e0345ef7a3e0</span>: Pull complete
|
||||
<span class="ex">5c1dd344094f</span>: Pull complete
|
||||
<span class="ex">6422305a200b</span>: Pull complete
|
||||
<span class="ex">7d63f861dbef</span>: Pull complete
|
||||
<span class="ex">3eb97210645c</span>: Pull complete
|
||||
<span class="ex">869319d746ff</span>: Already exists
|
||||
<span class="ex">869319d746ff</span>: Pulling fs layer
|
||||
<span class="ex">902b87aaaec9</span>: Already exists
|
||||
<span class="ex">Digest</span>: sha256:f836b4627b958b3f83f59c332f22f02fcd495ace3056f2be2c4912bd8704cc98
|
||||
<span class="ex">Status</span>: Downloaded newer image for shaarli/shaarli:latest</code></pre></div>
|
||||
<h3 id="create-and-start-a-new-container-from-the-image">Create and start a new container from the image</h3>
|
||||
<div class="sourceCode"><pre class="sourceCode bash"><code class="sourceCode bash"><span class="co"># map the host's :8000 port to the container's :80 port</span>
|
||||
$ <span class="ex">docker</span> create -p 8000:80 shaarli/shaarli
|
||||
<span class="ex">d40b7af693d678958adedfb88f87d6ea0237186c23de5c4102a55a8fcb499101</span>
|
||||
|
||||
<span class="co"># launch the container in the background</span>
|
||||
$ <span class="ex">docker</span> start d40b7af693d678958adedfb88f87d6ea0237186c23de5c4102a55a8fcb499101
|
||||
<span class="ex">d40b7af693d678958adedfb88f87d6ea0237186c23de5c4102a55a8fcb499101</span>
|
||||
|
||||
<span class="co"># list active containers</span>
|
||||
$ <span class="ex">docker</span> ps
|
||||
<span class="ex">CONTAINER</span> ID IMAGE COMMAND CREATED STATUS PORTS NAMES
|
||||
<span class="ex">d40b7af693d6</span> shaarli/shaarli /usr/bin/supervisor 15 seconds ago Up 4 seconds 0.0.0.0:8000-<span class="op">></span>80/tcp backstabbing_galileo</code></pre></div>
|
||||
<h3 id="stop-and-destroy-a-container">Stop and destroy a container</h3>
|
||||
<div class="sourceCode"><pre class="sourceCode bash"><code class="sourceCode bash">$ <span class="ex">docker</span> stop backstabbing_galileo # those docker guys are really rude to physicists!
|
||||
<span class="ex">backstabbing_galileo</span>
|
||||
|
||||
<span class="co"># check the container is stopped</span>
|
||||
$ <span class="ex">docker</span> ps
|
||||
<span class="ex">CONTAINER</span> ID IMAGE COMMAND CREATED STATUS PORTS NAMES
|
||||
|
||||
<span class="co"># list ALL containers</span>
|
||||
$ <span class="ex">docker</span> ps -a
|
||||
<span class="ex">CONTAINER</span> ID IMAGE COMMAND CREATED STATUS PORTS NAMES
|
||||
<span class="ex">d40b7af693d6</span> shaarli/shaarli /usr/bin/supervisor 5 minutes ago Exited (0) <span class="ex">48</span> seconds ago backstabbing_galileo
|
||||
|
||||
<span class="co"># destroy the container</span>
|
||||
$ <span class="ex">docker</span> rm backstabbing_galileo # let<span class="st">'s put an end to these barbarian practices</span>
|
||||
<span class="st">backstabbing_galileo</span>
|
||||
|
||||
<span class="st">$ docker ps -a</span>
|
||||
<span class="st">CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES</span></code></pre></div>
|
||||
<h2 id="resources">Resources</h2>
|
||||
<h3 id="docker-1">Docker</h3>
|
||||
<ul>
|
||||
<li><a href="https://www.katacoda.com/courses/docker/">Interactive Docker training portal</a> on <a href="https://www.katacoda.com/">Katakoda</a><a href=".html"></a></li>
|
||||
<li><a href="http://blog.thoward37.me/articles/where-are-docker-images-stored/">Where are Docker images stored?</a><a href=".html"></a></li>
|
||||
<li><a href="https://docs.docker.com/reference/builder/">Dockerfile reference</a><a href=".html"></a></li>
|
||||
<li><a href="https://docs.docker.com/articles/dockerfile_best-practices/">Dockerfile best practices</a><a href=".html"></a></li>
|
||||
<li><a href="https://docs.docker.com/userguide/dockervolumes/">Volumes</a><a href=".html"></a></li>
|
||||
</ul>
|
||||
<h3 id="dockerhub">DockerHub</h3>
|
||||
<ul>
|
||||
<li><a href="https://docs.docker.com/userguide/dockerrepos/">Repositories</a><a href=".html"></a></li>
|
||||
<li><a href="https://docs.docker.com/docker-hub/orgs/">Teams and organizations</a><a href=".html"></a></li>
|
||||
<li><a href="https://docs.docker.com/docker-hub/github/">GitHub automated build</a><a href=".html"></a></li>
|
||||
</ul>
|
||||
<h3 id="service-management">Service management</h3>
|
||||
<ul>
|
||||
<li><a href="https://docs.docker.com/articles/using_supervisord/">Using supervisord</a><a href=".html"></a></li>
|
||||
<li><a href="http://nginx.org/en/docs/ngx_core_module.html#daemon">Nginx in the foreground</a><a href=".html"></a></li>
|
||||
<li><a href="http://supervisord.org/">supervisord</a><a href=".html"></a></li>
|
||||
</ul>
|
||||
</body>
|
||||
</html>
|
|
@ -1,257 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="generator" content="pandoc">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">
|
||||
<title>Shaarli – Download CSS styles from an OPML list</title>
|
||||
<style type="text/css">code{white-space: pre;}</style>
|
||||
<style type="text/css">
|
||||
div.sourceCode { overflow-x: auto; }
|
||||
table.sourceCode, tr.sourceCode, td.lineNumbers, td.sourceCode {
|
||||
margin: 0; padding: 0; vertical-align: baseline; border: none; }
|
||||
table.sourceCode { width: 100%; line-height: 100%; }
|
||||
td.lineNumbers { text-align: right; padding-right: 4px; padding-left: 4px; color: #aaaaaa; border-right: 1px solid #aaaaaa; }
|
||||
td.sourceCode { padding-left: 5px; }
|
||||
code > span.kw { color: #007020; font-weight: bold; } /* Keyword */
|
||||
code > span.dt { color: #902000; } /* DataType */
|
||||
code > span.dv { color: #40a070; } /* DecVal */
|
||||
code > span.bn { color: #40a070; } /* BaseN */
|
||||
code > span.fl { color: #40a070; } /* Float */
|
||||
code > span.ch { color: #4070a0; } /* Char */
|
||||
code > span.st { color: #4070a0; } /* String */
|
||||
code > span.co { color: #60a0b0; font-style: italic; } /* Comment */
|
||||
code > span.ot { color: #007020; } /* Other */
|
||||
code > span.al { color: #ff0000; font-weight: bold; } /* Alert */
|
||||
code > span.fu { color: #06287e; } /* Function */
|
||||
code > span.er { color: #ff0000; font-weight: bold; } /* Error */
|
||||
code > span.wa { color: #60a0b0; font-weight: bold; font-style: italic; } /* Warning */
|
||||
code > span.cn { color: #880000; } /* Constant */
|
||||
code > span.sc { color: #4070a0; } /* SpecialChar */
|
||||
code > span.vs { color: #4070a0; } /* VerbatimString */
|
||||
code > span.ss { color: #bb6688; } /* SpecialString */
|
||||
code > span.im { } /* Import */
|
||||
code > span.va { color: #19177c; } /* Variable */
|
||||
code > span.cf { color: #007020; font-weight: bold; } /* ControlFlow */
|
||||
code > span.op { color: #666666; } /* Operator */
|
||||
code > span.bu { } /* BuiltIn */
|
||||
code > span.ex { } /* Extension */
|
||||
code > span.pp { color: #bc7a00; } /* Preprocessor */
|
||||
code > span.at { color: #7d9029; } /* Attribute */
|
||||
code > span.do { color: #ba2121; font-style: italic; } /* Documentation */
|
||||
code > span.an { color: #60a0b0; font-weight: bold; font-style: italic; } /* Annotation */
|
||||
code > span.cv { color: #60a0b0; font-weight: bold; font-style: italic; } /* CommentVar */
|
||||
code > span.in { color: #60a0b0; font-weight: bold; font-style: italic; } /* Information */
|
||||
</style>
|
||||
<link rel="stylesheet" href="github-markdown.css">
|
||||
<!--[if lt IE 9]>
|
||||
<script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv-printshiv.min.js"></script>
|
||||
<![endif]-->
|
||||
</head>
|
||||
<body>
|
||||
<div id="local-sidebar">
|
||||
<ul>
|
||||
<li><a href="Home.html">Home</a></li>
|
||||
<li>Setup
|
||||
<ul>
|
||||
<li><a href="Download-and-Installation.html">Download and Installation</a></li>
|
||||
<li><a href="Upgrade-and-migration.html">Upgrade and migration</a></li>
|
||||
<li><a href="Server-requirements.html">Server requirements</a></li>
|
||||
<li><a href="Server-configuration.html">Server configuration</a></li>
|
||||
<li><a href="Server-security.html">Server security</a></li>
|
||||
<li><a href="Shaarli-configuration.html">Shaarli configuration</a></li>
|
||||
<li><a href="Plugins.html">Plugins</a></li>
|
||||
</ul></li>
|
||||
<li><a href="Docker.html">Docker</a></li>
|
||||
<li><a href="Usage.html">Usage</a>
|
||||
<ul>
|
||||
<li><a href="Sharing-button.html">Sharing button</a> (bookmarklet)</li>
|
||||
<li><a href="Browsing-and-Searching.html">Browsing and Searching</a></li>
|
||||
<li><a href="Firefox-share.html">Firefox share</a></li>
|
||||
<li><a href="RSS-feeds.html">RSS feeds</a></li>
|
||||
<li><a href="REST-API.html">REST API</a></li>
|
||||
</ul></li>
|
||||
<li>How To
|
||||
<ul>
|
||||
<li><a href="Backup,-restore,-import-and-export.html">Backup, restore, import and export</a></li>
|
||||
<li><a href="Copy-an-existing-installation-over-SSH-and-serve-it-locally.html">Copy an existing installation over SSH and serve it locally</a></li>
|
||||
<li><a href="Create-and-serve-multiple-Shaarlis-(farm).html">Create and serve multiple Shaarlis (farm)</a></li>
|
||||
<li><a href="Download-CSS-styles-from-an-OPML-list.html">Download CSS styles from an OPML list</a></li>
|
||||
<li><a href="Datastore-hacks.html">Datastore hacks</a></li>
|
||||
</ul></li>
|
||||
<li><a href="Troubleshooting.html">Troubleshooting</a></li>
|
||||
<li><a href="Development.html">Development</a>
|
||||
<ul>
|
||||
<li><a href="GnuPG-signature.html">GnuPG signature</a></li>
|
||||
<li><a href="Coding-guidelines.html">Coding guidelines</a></li>
|
||||
<li><a href="Directory-structure.html">Directory structure</a></li>
|
||||
<li><a href="3rd-party-libraries.html">3rd party libraries</a></li>
|
||||
<li><a href="Plugin-System.html">Plugin System</a></li>
|
||||
<li><a href="Release-Shaarli.html">Release Shaarli</a></li>
|
||||
<li><a href="Versioning-and-Branches.html">Versioning and Branches</a></li>
|
||||
<li><a href="Security.html">Security</a></li>
|
||||
<li><a href="Static-analysis.html">Static analysis</a></li>
|
||||
<li><a href="Theming.html">Theming</a></li>
|
||||
<li><a href="Unit-tests.html">Unit tests</a></li>
|
||||
</ul></li>
|
||||
<li>About
|
||||
<ul>
|
||||
<li><a href="FAQ.html">FAQ</a></li>
|
||||
<li><a href="Community-&-Related-software.html">Community & Related software</a></li>
|
||||
</ul></li>
|
||||
</ul>
|
||||
</div>
|
||||
<h1 id="download-css-styles-from-an-opml-list">Download CSS styles from an OPML list</h1>
|
||||
<h3 id="download-css-styles-for-shaarlis-listed-in-an-opml-file">Download CSS styles for shaarlis listed in an opml file</h3>
|
||||
<p>Example php script:</p>
|
||||
<div class="sourceCode"><pre class="sourceCode php"><code class="sourceCode php"><!---- <span class="ot">?</span>php -->
|
||||
<!---- Copyright <span class="ot">(</span>c<span class="ot">)</span> <span class="dv">2014</span> Nicolas Delsaux <span class="ot">(</span>https<span class="ot">:</span><span class="co">//github.com/Riduidel) --></span>
|
||||
<!---- License: zlib <span class="ot">(</span>http:<span class="co">//www.gzip.org/zlib/zlib_license.html) --></span>
|
||||
|
||||
<span class="co">/**</span>
|
||||
<span class="co"> * Source: https://github.com/Riduidel</span>
|
||||
<span class="co"> * Download css styles for shaarlis listed in an opml file</span>
|
||||
<span class="co"> */</span>
|
||||
<span class="fu">define</span><span class="ot">(</span><span class="st">"SHAARLI_RSS_OPML"</span><span class="ot">,</span> <span class="st">"https://www.ecirtam.net/shaarlirss/custom/people.opml"</span><span class="ot">);</span>
|
||||
|
||||
<span class="fu">define</span><span class="ot">(</span><span class="st">"THEMES_TEMP_FOLDER"</span><span class="ot">,</span> <span class="st">"new_themes"</span><span class="ot">);</span>
|
||||
|
||||
<span class="kw">if</span><span class="ot">(</span>!<span class="fu">file_exists</span><span class="ot">(</span><span class="kw">THEMES_TEMP_FOLDER</span><span class="ot">))</span> {
|
||||
<span class="fu">mkdir</span><span class="ot">(</span><span class="kw">THEMES_TEMP_FOLDER</span><span class="ot">);</span>
|
||||
}
|
||||
|
||||
<span class="kw">function</span> siteUrl<span class="ot">(</span><span class="kw">$pathInSite</span><span class="ot">)</span> {
|
||||
<span class="kw">$indexPos</span> = <span class="fu">strpos</span><span class="ot">(</span><span class="kw">$pathInSite</span><span class="ot">,</span> <span class="st">"index.php"</span><span class="ot">);</span>
|
||||
<span class="kw">if</span><span class="ot">(</span>!<span class="kw">$indexPos</span><span class="ot">)</span> {
|
||||
<span class="kw">return</span> <span class="kw">$pathInSite</span><span class="ot">;</span>
|
||||
} <span class="kw">else</span> {
|
||||
<span class="kw">return</span> <span class="fu">substr</span><span class="ot">(</span><span class="kw">$pathInSite</span><span class="ot">,</span> <span class="dv">0</span><span class="ot">,</span> <span class="kw">$indexPos</span><span class="ot">);</span>
|
||||
}
|
||||
}
|
||||
|
||||
<span class="kw">function</span> createShaarliHashFromOPMLL<span class="ot">(</span><span class="kw">$opmlFile</span><span class="ot">)</span> {
|
||||
<span class="kw">$result</span> = <span class="fu">array</span><span class="ot">();</span>
|
||||
<span class="kw">$opml</span> = <span class="fu">file_get_contents</span><span class="ot">(</span><span class="kw">$opmlFile</span><span class="ot">);</span>
|
||||
<span class="kw">$opmlXml</span> = <span class="fu">simplexml_load_string</span><span class="ot">(</span><span class="kw">$opml</span><span class="ot">);</span>
|
||||
<span class="kw">$outlineElements</span> = <span class="kw">$opmlXml</span>->xpath<span class="ot">(</span><span class="st">"body/outline"</span><span class="ot">);</span>
|
||||
<span class="kw">foreach</span><span class="ot">(</span><span class="kw">$outlineElements</span> <span class="kw">as</span> <span class="kw">$site</span><span class="ot">)</span> {
|
||||
<span class="kw">$siteUrl</span> = siteUrl<span class="ot">(</span><span class="dt">(string)</span> <span class="kw">$site</span><span class="ot">[</span><span class="st">'htmlUrl'</span><span class="ot">]);[](</span>.html<span class="ot">)</span>
|
||||
<span class="kw">$result</span><span class="ot">[</span><span class="kw">$siteUrl</span><span class="ot">]</span>=<span class="ot">(</span><span class="dt">(string)</span> <span class="kw">$site</span><span class="ot">[</span><span class="st">'text'</span><span class="ot">]);[](</span>.html<span class="ot">)</span>
|
||||
}
|
||||
<span class="kw">return</span> <span class="kw">$result</span><span class="ot">;</span>
|
||||
}
|
||||
|
||||
<span class="kw">function</span> getSiteFolder<span class="ot">(</span><span class="kw">$url</span><span class="ot">)</span> {
|
||||
<span class="kw">$domain</span> = <span class="fu">parse_url</span><span class="ot">(</span><span class="kw">$url</span><span class="ot">,</span> <span class="kw">PHP_URL_HOST</span><span class="ot">);</span>
|
||||
<span class="kw">return</span> <span class="kw">THEMES_TEMP_FOLDER</span>.<span class="st">"/"</span>.<span class="fu">str_replace</span><span class="ot">(</span><span class="st">"."</span><span class="ot">,</span> <span class="st">"_"</span><span class="ot">,</span> <span class="kw">$domain</span><span class="ot">);</span>
|
||||
}
|
||||
|
||||
<span class="kw">function</span> get_http_response_code<span class="ot">(</span><span class="kw">$theURL</span><span class="ot">)</span> {
|
||||
<span class="kw">$headers</span> = <span class="fu">get_headers</span><span class="ot">(</span><span class="kw">$theURL</span><span class="ot">);</span>
|
||||
<span class="kw">return</span> <span class="fu">substr</span><span class="ot">(</span><span class="kw">$headers</span><span class="ot">[</span><span class="dv">0</span><span class="ot">],</span> <span class="dv">9</span><span class="ot">,</span> <span class="dv">3</span><span class="ot">);[](</span>.html<span class="ot">)</span>
|
||||
}
|
||||
|
||||
<span class="co">/**</span>
|
||||
<span class="co"> * This makes the code PHP-5 only (particularly the call to "get_headers")</span>
|
||||
<span class="co"> */</span>
|
||||
<span class="kw">function</span> copyUserStyleFrom<span class="ot">(</span><span class="kw">$url</span><span class="ot">,</span> <span class="kw">$name</span><span class="ot">,</span> <span class="kw">$knownStyles</span><span class="ot">)</span> {
|
||||
<span class="kw">$userStyle</span> = <span class="kw">$url</span>.<span class="st">"inc/user.css"</span><span class="ot">;</span>
|
||||
<span class="kw">if</span><span class="ot">(</span><span class="fu">in_array</span><span class="ot">(</span><span class="kw">$url</span><span class="ot">,</span> <span class="kw">$knownStyles</span><span class="ot">))</span> {
|
||||
<span class="co">// </span><span class="al">TODO</span><span class="co"> add log message</span>
|
||||
} <span class="kw">else</span> {
|
||||
<span class="kw">$statusCode</span> = get_http_response_code<span class="ot">(</span><span class="kw">$userStyle</span><span class="ot">);</span>
|
||||
<span class="kw">if</span><span class="ot">(</span><span class="fu">intval</span><span class="ot">(</span><span class="kw">$statusCode</span><span class="ot">)</span><<span class="dv">300</span><span class="ot">)</span> {
|
||||
<span class="kw">$styleSheet</span> = <span class="fu">file_get_contents</span><span class="ot">(</span><span class="kw">$userStyle</span><span class="ot">);</span>
|
||||
<span class="kw">$siteFolder</span> = getSiteFolder<span class="ot">(</span><span class="kw">$url</span><span class="ot">);</span>
|
||||
<span class="kw">if</span><span class="ot">(</span>!<span class="fu">file_exists</span><span class="ot">(</span><span class="kw">$siteFolder</span><span class="ot">))</span> {
|
||||
<span class="fu">mkdir</span><span class="ot">(</span><span class="kw">$siteFolder</span><span class="ot">);</span>
|
||||
}
|
||||
<span class="kw">if</span><span class="ot">(</span>!<span class="fu">file_exists</span><span class="ot">(</span><span class="kw">$siteFolder</span>.<span class="st">'/user.css'</span><span class="ot">))</span> {
|
||||
<span class="co">// Copy stylesheet</span>
|
||||
<span class="fu">file_put_contents</span><span class="ot">(</span><span class="kw">$siteFolder</span>.<span class="st">'/user.css'</span><span class="ot">,</span> <span class="kw">$styleSheet</span><span class="ot">);</span>
|
||||
}
|
||||
<span class="kw">if</span><span class="ot">(</span>!<span class="fu">file_exists</span><span class="ot">(</span><span class="kw">$siteFolder</span>.<span class="st">'/README.md'</span><span class="ot">))</span> {
|
||||
<span class="co">// Then write a readme.md file</span>
|
||||
<span class="fu">file_put_contents</span><span class="ot">(</span><span class="kw">$siteFolder</span>.<span class="st">'/README.md'</span><span class="ot">,</span>
|
||||
<span class="st">"User style from "</span>.<span class="kw">$name</span>.<span class="st">"</span><span class="kw">\n</span><span class="st">"</span>
|
||||
.<span class="st">"============================="</span>
|
||||
.<span class="st">"</span><span class="kw">\n\n</span><span class="st">"</span>
|
||||
.<span class="st">"This stylesheet was downloaded from "</span>.<span class="kw">$userStyle</span>.<span class="st">" on "</span>.<span class="fu">date</span><span class="ot">(</span><span class="kw">DATE_RFC822</span><span class="ot">)</span>
|
||||
<span class="ot">);</span>
|
||||
}
|
||||
<span class="kw">if</span><span class="ot">(</span>!<span class="fu">file_exists</span><span class="ot">(</span><span class="kw">$siteFolder</span>.<span class="st">'/config.ini'</span><span class="ot">))</span> {
|
||||
<span class="co">// Write a config file containing useful informations</span>
|
||||
<span class="fu">file_put_contents</span><span class="ot">(</span><span class="kw">$siteFolder</span>.<span class="st">'/config.ini'</span><span class="ot">,</span>
|
||||
<span class="st">"site_url="</span>.<span class="kw">$url</span>.<span class="st">"</span><span class="kw">\n</span><span class="st">"</span>
|
||||
.<span class="st">"site_name="</span>.<span class="kw">$name</span>.<span class="st">"</span><span class="kw">\n</span><span class="st">"</span>
|
||||
<span class="ot">);</span>
|
||||
}
|
||||
<span class="kw">if</span><span class="ot">(</span>!<span class="fu">file_exists</span><span class="ot">(</span><span class="kw">$siteFolder</span>.<span class="st">'/home.png'</span><span class="ot">))</span> {
|
||||
<span class="co">// And finally copy generated thumbnail</span>
|
||||
<span class="kw">$homeThumb</span> = <span class="kw">$siteFolder</span>.<span class="st">'/home.png'</span><span class="ot">;</span>
|
||||
<span class="fu">file_put_contents</span><span class="ot">(</span><span class="kw">$siteFolder</span>.<span class="st">'/home.png'</span><span class="ot">,</span> <span class="fu">file_get_contents</span><span class="ot">(</span>getThumbnailUrl<span class="ot">(</span><span class="kw">$url</span><span class="ot">)));</span>
|
||||
}
|
||||
<span class="fu">echo</span> <span class="st">'Theme have been downloaded from <a href="'</span>.<span class="kw">$url</span>.<span class="st">'">'</span>.<span class="kw">$url</span>.<span class="st">'</a> into '</span>.<span class="kw">$siteFolder</span>
|
||||
.<span class="st">'. It looks like <img src="'</span>.<span class="kw">$homeThumb</span>.<span class="st">'"><br/>'</span><span class="ot">;</span>
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
<span class="kw">function</span> getThumbnailUrl<span class="ot">(</span><span class="kw">$url</span><span class="ot">)</span> {
|
||||
<span class="kw">return</span> <span class="st">'http://api.webthumbnail.org/?url='</span>.<span class="kw">$url</span><span class="ot">;</span>
|
||||
}
|
||||
|
||||
<span class="kw">function</span> copyUserStylesFrom<span class="ot">(</span><span class="kw">$urlToNames</span><span class="ot">,</span> <span class="kw">$knownStyles</span><span class="ot">)</span> {
|
||||
<span class="kw">foreach</span><span class="ot">(</span><span class="kw">$urlToNames</span> <span class="kw">as</span> <span class="kw">$url</span> => <span class="kw">$name</span><span class="ot">)</span> {
|
||||
copyUserStyleFrom<span class="ot">(</span><span class="kw">$url</span><span class="ot">,</span> <span class="kw">$name</span><span class="ot">,</span> <span class="kw">$knownStyles</span><span class="ot">);</span>
|
||||
}
|
||||
}
|
||||
|
||||
<span class="co">/**</span>
|
||||
<span class="co"> * Reading directory list, courtesy of http://www.laughing-buddha.net/php/dirlist/</span>
|
||||
<span class="co"> * </span><span class="an">@param</span><span class="co"> </span><span class="cv">directory</span><span class="co"> the directory we want to list files of</span>
|
||||
<span class="co"> * </span><span class="an">@return</span><span class="co"> a simple array containing the list of absolute file paths. Notice that current file (".") and parent one("..")</span>
|
||||
<span class="co"> * are not listed here</span>
|
||||
<span class="co"> */</span>
|
||||
<span class="kw">function</span> getDirectoryList <span class="ot">(</span><span class="kw">$directory</span><span class="ot">)</span> {
|
||||
<span class="kw">$realPath</span> = <span class="fu">realpath</span><span class="ot">(</span><span class="kw">$directory</span><span class="ot">);</span>
|
||||
<span class="co">// create an array to hold directory list</span>
|
||||
<span class="kw">$results</span> = <span class="fu">array</span><span class="ot">();</span>
|
||||
<span class="co">// create a handler for the directory</span>
|
||||
<span class="kw">$handler</span> = <span class="fu">opendir</span><span class="ot">(</span><span class="kw">$directory</span><span class="ot">);</span>
|
||||
<span class="co">// open directory and walk through the filenames</span>
|
||||
<span class="kw">while</span> <span class="ot">(</span><span class="kw">$file</span> = <span class="fu">readdir</span><span class="ot">(</span><span class="kw">$handler</span><span class="ot">))</span> {
|
||||
<span class="co">// if file isn't this directory or its parent, add it to the results</span>
|
||||
<span class="kw">if</span> <span class="ot">(</span><span class="kw">$file</span> != <span class="st">"."</span> && <span class="kw">$file</span> != <span class="st">".."</span><span class="ot">)</span> {
|
||||
<span class="kw">$results</span><span class="ot">[</span> = <span class="fu">realpath</span><span class="ot">(</span><span class="kw">$realPath</span> . <span class="st">"/"</span> . <span class="kw">$file</span><span class="ot">);](</span>-=-<span class="fu">realpath</span><span class="ot">(</span><span class="kw">$realPath</span>-.-<span class="st">"/"</span>-.-<span class="kw">$file</span><span class="ot">);</span>.html<span class="ot">)</span>
|
||||
}
|
||||
}
|
||||
<span class="co">// tidy up: close the handler</span>
|
||||
<span class="fu">closedir</span><span class="ot">(</span><span class="kw">$handler</span><span class="ot">);</span>
|
||||
<span class="co">// done!</span>
|
||||
<span class="kw">return</span> <span class="kw">$results</span><span class="ot">;</span>
|
||||
}
|
||||
|
||||
<span class="co">/**</span>
|
||||
<span class="co"> * Start in themes folder and look in all subfolders for config.ini files. </span>
|
||||
<span class="co"> * These config.ini files allow us not to download styles again and again</span>
|
||||
<span class="co"> */</span>
|
||||
<span class="kw">function</span> findKnownStyles<span class="ot">()</span> {
|
||||
<span class="kw">$result</span> = <span class="fu">array</span><span class="ot">();</span>
|
||||
<span class="kw">$subFolders</span> = getDirectoryList<span class="ot">(</span><span class="st">"themes"</span><span class="ot">);</span>
|
||||
<span class="kw">foreach</span><span class="ot">(</span><span class="kw">$subFolders</span> <span class="kw">as</span> <span class="kw">$folder</span><span class="ot">)</span> {
|
||||
<span class="kw">$configFile</span> = <span class="kw">$folder</span>.<span class="st">"/config.ini"</span><span class="ot">;</span>
|
||||
<span class="kw">if</span><span class="ot">(</span><span class="fu">file_exists</span><span class="ot">(</span><span class="kw">$configFile</span><span class="ot">))</span> {
|
||||
<span class="kw">$iniParameters</span> = <span class="fu">parse_ini_file</span><span class="ot">(</span><span class="kw">$configFile</span><span class="ot">);</span>
|
||||
<span class="fu">array_push</span><span class="ot">(</span><span class="kw">$result</span><span class="ot">,</span> <span class="kw">$iniParameters</span><span class="ot">[</span><span class="st">'site_url'</span><span class="ot">]);[](</span>.html<span class="ot">)</span>
|
||||
}
|
||||
}
|
||||
<span class="kw">return</span> <span class="kw">$result</span><span class="ot">;</span>
|
||||
}
|
||||
|
||||
<span class="kw">$knownStyles</span> = findKnownStyles<span class="ot">();</span>
|
||||
copyUserStylesFrom<span class="ot">(</span>createShaarliHashFromOPMLL<span class="ot">(</span><span class="kw">SHAARLI_RSS_OPML</span><span class="ot">),</span> <span class="kw">$knownStyles</span><span class="ot">);</span>
|
||||
|
||||
<!--- <span class="ot">?</span> ----></code></pre></div>
|
||||
</body>
|
||||
</html>
|
|
@ -1,172 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="generator" content="pandoc">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">
|
||||
<title>Shaarli – Download and Installation</title>
|
||||
<style type="text/css">code{white-space: pre;}</style>
|
||||
<style type="text/css">
|
||||
div.sourceCode { overflow-x: auto; }
|
||||
table.sourceCode, tr.sourceCode, td.lineNumbers, td.sourceCode {
|
||||
margin: 0; padding: 0; vertical-align: baseline; border: none; }
|
||||
table.sourceCode { width: 100%; line-height: 100%; }
|
||||
td.lineNumbers { text-align: right; padding-right: 4px; padding-left: 4px; color: #aaaaaa; border-right: 1px solid #aaaaaa; }
|
||||
td.sourceCode { padding-left: 5px; }
|
||||
code > span.kw { color: #007020; font-weight: bold; } /* Keyword */
|
||||
code > span.dt { color: #902000; } /* DataType */
|
||||
code > span.dv { color: #40a070; } /* DecVal */
|
||||
code > span.bn { color: #40a070; } /* BaseN */
|
||||
code > span.fl { color: #40a070; } /* Float */
|
||||
code > span.ch { color: #4070a0; } /* Char */
|
||||
code > span.st { color: #4070a0; } /* String */
|
||||
code > span.co { color: #60a0b0; font-style: italic; } /* Comment */
|
||||
code > span.ot { color: #007020; } /* Other */
|
||||
code > span.al { color: #ff0000; font-weight: bold; } /* Alert */
|
||||
code > span.fu { color: #06287e; } /* Function */
|
||||
code > span.er { color: #ff0000; font-weight: bold; } /* Error */
|
||||
code > span.wa { color: #60a0b0; font-weight: bold; font-style: italic; } /* Warning */
|
||||
code > span.cn { color: #880000; } /* Constant */
|
||||
code > span.sc { color: #4070a0; } /* SpecialChar */
|
||||
code > span.vs { color: #4070a0; } /* VerbatimString */
|
||||
code > span.ss { color: #bb6688; } /* SpecialString */
|
||||
code > span.im { } /* Import */
|
||||
code > span.va { color: #19177c; } /* Variable */
|
||||
code > span.cf { color: #007020; font-weight: bold; } /* ControlFlow */
|
||||
code > span.op { color: #666666; } /* Operator */
|
||||
code > span.bu { } /* BuiltIn */
|
||||
code > span.ex { } /* Extension */
|
||||
code > span.pp { color: #bc7a00; } /* Preprocessor */
|
||||
code > span.at { color: #7d9029; } /* Attribute */
|
||||
code > span.do { color: #ba2121; font-style: italic; } /* Documentation */
|
||||
code > span.an { color: #60a0b0; font-weight: bold; font-style: italic; } /* Annotation */
|
||||
code > span.cv { color: #60a0b0; font-weight: bold; font-style: italic; } /* CommentVar */
|
||||
code > span.in { color: #60a0b0; font-weight: bold; font-style: italic; } /* Information */
|
||||
</style>
|
||||
<link rel="stylesheet" href="github-markdown.css">
|
||||
<!--[if lt IE 9]>
|
||||
<script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv-printshiv.min.js"></script>
|
||||
<![endif]-->
|
||||
</head>
|
||||
<body>
|
||||
<div id="local-sidebar">
|
||||
<ul>
|
||||
<li><a href="Home.html">Home</a></li>
|
||||
<li>Setup
|
||||
<ul>
|
||||
<li><a href="Download-and-Installation.html">Download and Installation</a></li>
|
||||
<li><a href="Upgrade-and-migration.html">Upgrade and migration</a></li>
|
||||
<li><a href="Server-requirements.html">Server requirements</a></li>
|
||||
<li><a href="Server-configuration.html">Server configuration</a></li>
|
||||
<li><a href="Server-security.html">Server security</a></li>
|
||||
<li><a href="Shaarli-configuration.html">Shaarli configuration</a></li>
|
||||
<li><a href="Plugins.html">Plugins</a></li>
|
||||
</ul></li>
|
||||
<li><a href="Docker.html">Docker</a></li>
|
||||
<li><a href="Usage.html">Usage</a>
|
||||
<ul>
|
||||
<li><a href="Sharing-button.html">Sharing button</a> (bookmarklet)</li>
|
||||
<li><a href="Browsing-and-Searching.html">Browsing and Searching</a></li>
|
||||
<li><a href="Firefox-share.html">Firefox share</a></li>
|
||||
<li><a href="RSS-feeds.html">RSS feeds</a></li>
|
||||
<li><a href="REST-API.html">REST API</a></li>
|
||||
</ul></li>
|
||||
<li>How To
|
||||
<ul>
|
||||
<li><a href="Backup,-restore,-import-and-export.html">Backup, restore, import and export</a></li>
|
||||
<li><a href="Copy-an-existing-installation-over-SSH-and-serve-it-locally.html">Copy an existing installation over SSH and serve it locally</a></li>
|
||||
<li><a href="Create-and-serve-multiple-Shaarlis-(farm).html">Create and serve multiple Shaarlis (farm)</a></li>
|
||||
<li><a href="Download-CSS-styles-from-an-OPML-list.html">Download CSS styles from an OPML list</a></li>
|
||||
<li><a href="Datastore-hacks.html">Datastore hacks</a></li>
|
||||
</ul></li>
|
||||
<li><a href="Troubleshooting.html">Troubleshooting</a></li>
|
||||
<li><a href="Development.html">Development</a>
|
||||
<ul>
|
||||
<li><a href="GnuPG-signature.html">GnuPG signature</a></li>
|
||||
<li><a href="Coding-guidelines.html">Coding guidelines</a></li>
|
||||
<li><a href="Directory-structure.html">Directory structure</a></li>
|
||||
<li><a href="3rd-party-libraries.html">3rd party libraries</a></li>
|
||||
<li><a href="Plugin-System.html">Plugin System</a></li>
|
||||
<li><a href="Release-Shaarli.html">Release Shaarli</a></li>
|
||||
<li><a href="Versioning-and-Branches.html">Versioning and Branches</a></li>
|
||||
<li><a href="Security.html">Security</a></li>
|
||||
<li><a href="Static-analysis.html">Static analysis</a></li>
|
||||
<li><a href="Theming.html">Theming</a></li>
|
||||
<li><a href="Unit-tests.html">Unit tests</a></li>
|
||||
</ul></li>
|
||||
<li>About
|
||||
<ul>
|
||||
<li><a href="FAQ.html">FAQ</a></li>
|
||||
<li><a href="Community-&-Related-software.html">Community & Related software</a></li>
|
||||
</ul></li>
|
||||
</ul>
|
||||
</div>
|
||||
<h1 id="download-and-installation">Download and Installation</h1>
|
||||
<h1 id="get-shaarli">Get Shaarli!</h1>
|
||||
<p>To install Shaarli, simply place the files in a directory under your webserver's Document Root (or directly at the document root). Make sure your <a href="Server-requirements">server</a> is properly <a href="Server-configuration">configured</a>.<a href=".html"></a></p>
|
||||
<p>Several releases are available:</p>
|
||||
<hr />
|
||||
<h2 id="latest-release-recommended">Latest release (recommended)</h2>
|
||||
<h3 id="download-as-an-archive">Download as an archive</h3>
|
||||
<p>Get the latest released version from the <a href="https://github.com/shaarli/Shaarli/releases">releases</a> page.<a href=".html"></a></p>
|
||||
<p><strong>Download our <em>shaarli-full</em> archive</strong> to include dependencies.</p>
|
||||
<p>The current latest released version is <code>v0.8.4</code></p>
|
||||
<p>Or in command lines:</p>
|
||||
<div class="sourceCode"><pre class="sourceCode bash"><code class="sourceCode bash">$ <span class="fu">wget</span> https://github.com/shaarli/Shaarli/releases/download/v0.8.4/shaarli-v0.8.4-full.zip
|
||||
$ <span class="fu">unzip</span> shaarli-v0.8.4-full.zip
|
||||
$ <span class="fu">mv</span> Shaarli /path/to/shaarli/</code></pre></div>
|
||||
<table style="width:46%;">
|
||||
<colgroup>
|
||||
<col style="width: 8%" />
|
||||
<col style="width: 37%" />
|
||||
</colgroup>
|
||||
<thead>
|
||||
<tr class="header">
|
||||
<th>!</th>
|
||||
<th>In most cases, download Shaarli from the <a href="https://github.com/shaarli/Shaarli/releases">releases</a> page. Cloning using <code>git</code> or downloading Github branches as zip files requires additional steps (see below).</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
</tbody>
|
||||
</table>
|
||||
<h3 id="using-git">Using git</h3>
|
||||
<pre><code>mkdir -p /path/to/shaarli && cd /path/to/shaarli/
|
||||
git clone -b v0.8 https://github.com/shaarli/Shaarli.git .
|
||||
composer install --no-dev</code></pre>
|
||||
<hr />
|
||||
<h2 id="stable-version">Stable version</h2>
|
||||
<p>The stable version has been experienced by Shaarli users, and will receive security updates.</p>
|
||||
<h3 id="download-as-an-archive-1">Download as an archive</h3>
|
||||
<p>As a .zip archive:</p>
|
||||
<div class="sourceCode"><pre class="sourceCode bash"><code class="sourceCode bash">$ <span class="fu">wget</span> https://github.com/shaarli/Shaarli/archive/stable.zip
|
||||
$ <span class="fu">unzip</span> stable.zip
|
||||
$ <span class="fu">mv</span> Shaarli-stable /path/to/shaarli/</code></pre></div>
|
||||
<p>As a .tar.gz archive :</p>
|
||||
<div class="sourceCode"><pre class="sourceCode bash"><code class="sourceCode bash">$ <span class="fu">wget</span> https://github.com/shaarli/Shaarli/archive/stable.tar.gz
|
||||
$ <span class="fu">tar</span> xvf stable.tar.gz
|
||||
$ <span class="fu">mv</span> Shaarli-stable /path/to/shaarli/</code></pre></div>
|
||||
<h3 id="clone-with-git">Clone with Git</h3>
|
||||
<p><a href="https://getcomposer.org/">Composer</a> is required to build a functional Shaarli installation when pulling from git.<a href=".html"></a></p>
|
||||
<div class="sourceCode"><pre class="sourceCode bash"><code class="sourceCode bash">$ <span class="fu">git</span> clone https://github.com/shaarli/Shaarli.git -b stable /path/to/shaarli/
|
||||
<span class="co"># install/update third-party dependencies</span>
|
||||
$ <span class="bu">cd</span> /path/to/shaarli/
|
||||
$ <span class="ex">composer</span> install --no-dev</code></pre></div>
|
||||
<hr />
|
||||
<h2 id="development-version-mainline">Development version (mainline)</h2>
|
||||
<p><em>Use at your own risk!</em></p>
|
||||
<p>To get the latest changes from the <code>master</code> branch:</p>
|
||||
<div class="sourceCode"><pre class="sourceCode bash"><code class="sourceCode bash"><span class="co"># clone the repository </span>
|
||||
$ <span class="fu">git</span> clone https://github.com/shaarli/Shaarli.git -b master /path/to/shaarli/
|
||||
<span class="co"># install/update third-party dependencies</span>
|
||||
$ <span class="bu">cd</span> /path/to/shaarli
|
||||
$ <span class="ex">composer</span> install --no-dev</code></pre></div>
|
||||
<hr />
|
||||
<h2 id="finish-installation">Finish Installation</h2>
|
||||
<p>Once Shaarli is downloaded and files have been placed at the correct location, open it this location your favorite browser.</p>
|
||||
<p><img src="http://i.imgur.com/wuMpDSN.png" alt="install screenshot" /><a href=".html"></a></p>
|
||||
<p>Setup your Shaarli installation, and it's ready to use!</p>
|
||||
<hr />
|
||||
<h2 id="updating-shaarli">Updating Shaarli</h2>
|
||||
<p>See <a href="Upgrade-and-migration">Upgrade and Migration</a><a href=".html"></a></p>
|
||||
</body>
|
||||
</html>
|
|
@ -1,254 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="generator" content="pandoc">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">
|
||||
<title>Shaarli – Example patch add new via field for links</title>
|
||||
<style type="text/css">code{white-space: pre;}</style>
|
||||
<link rel="stylesheet" href="github-markdown.css">
|
||||
<!--[if lt IE 9]>
|
||||
<script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv-printshiv.min.js"></script>
|
||||
<![endif]-->
|
||||
</head>
|
||||
<body>
|
||||
<div id="local-sidebar">
|
||||
<ul>
|
||||
<li><a href="Home.html">Home</a></li>
|
||||
<li>Setup
|
||||
<ul>
|
||||
<li><a href="Download-and-Installation.html">Download and Installation</a></li>
|
||||
<li><a href="Upgrade-and-migration.html">Upgrade and migration</a></li>
|
||||
<li><a href="Server-requirements.html">Server requirements</a></li>
|
||||
<li><a href="Server-configuration.html">Server configuration</a></li>
|
||||
<li><a href="Server-security.html">Server security</a></li>
|
||||
<li><a href="Shaarli-configuration.html">Shaarli configuration</a></li>
|
||||
<li><a href="Plugins.html">Plugins</a></li>
|
||||
</ul></li>
|
||||
<li><a href="Docker.html">Docker</a></li>
|
||||
<li><a href="Usage.html">Usage</a>
|
||||
<ul>
|
||||
<li><a href="Sharing-button.html">Sharing button</a> (bookmarklet)</li>
|
||||
<li><a href="Browsing-and-Searching.html">Browsing and Searching</a></li>
|
||||
<li><a href="Firefox-share.html">Firefox share</a></li>
|
||||
<li><a href="RSS-feeds.html">RSS feeds</a></li>
|
||||
<li><a href="REST-API.html">REST API</a></li>
|
||||
</ul></li>
|
||||
<li>How To
|
||||
<ul>
|
||||
<li><a href="Backup,-restore,-import-and-export.html">Backup, restore, import and export</a></li>
|
||||
<li><a href="Copy-an-existing-installation-over-SSH-and-serve-it-locally.html">Copy an existing installation over SSH and serve it locally</a></li>
|
||||
<li><a href="Create-and-serve-multiple-Shaarlis-(farm).html">Create and serve multiple Shaarlis (farm)</a></li>
|
||||
<li><a href="Download-CSS-styles-from-an-OPML-list.html">Download CSS styles from an OPML list</a></li>
|
||||
<li><a href="Datastore-hacks.html">Datastore hacks</a></li>
|
||||
</ul></li>
|
||||
<li><a href="Troubleshooting.html">Troubleshooting</a></li>
|
||||
<li><a href="Development.html">Development</a>
|
||||
<ul>
|
||||
<li><a href="GnuPG-signature.html">GnuPG signature</a></li>
|
||||
<li><a href="Coding-guidelines.html">Coding guidelines</a></li>
|
||||
<li><a href="Directory-structure.html">Directory structure</a></li>
|
||||
<li><a href="3rd-party-libraries.html">3rd party libraries</a></li>
|
||||
<li><a href="Plugin-System.html">Plugin System</a></li>
|
||||
<li><a href="Release-Shaarli.html">Release Shaarli</a></li>
|
||||
<li><a href="Versioning-and-Branches.html">Versioning and Branches</a></li>
|
||||
<li><a href="Security.html">Security</a></li>
|
||||
<li><a href="Static-analysis.html">Static analysis</a></li>
|
||||
<li><a href="Theming.html">Theming</a></li>
|
||||
<li><a href="Unit-tests.html">Unit tests</a></li>
|
||||
</ul></li>
|
||||
<li>About
|
||||
<ul>
|
||||
<li><a href="FAQ.html">FAQ</a></li>
|
||||
<li><a href="Community-&-Related-software.html">Community & Related software</a></li>
|
||||
</ul></li>
|
||||
</ul>
|
||||
</div>
|
||||
<h1 id="example-patch-add-new-via-field-for-links">Example patch add new via field for links</h1>
|
||||
<p>Example patch to add a new field ("via") for links, an input field to set the "via" property from the "edit link" dialog, and display the "via" field in the link list display. <strong>Untested, use at your own risk</strong></p>
|
||||
<p>Thanks to @Knah-Tsaeb in <a href="https://github.com/sebsauvage/Shaarli/pull/158" class="uri">https://github.com/sebsauvage/Shaarli/pull/158</a></p>
|
||||
<pre><code>From e0f363c18e8fe67990ed2bb1a08652e24e70bbcb Mon Sep 17 00:00:00 2001
|
||||
From: Knah Tsaeb <knah-tsaeb@knah-tsaeb.org>
|
||||
Date: Fri, 11 Oct 2013 15:18:37 +0200
|
||||
Subject: [PATCH] Add a "via"/origin property for links, add new input in "edit link" dialog[](.html)
|
||||
Thanks to:
|
||||
* https://github.com/Knah-Tsaeb/Shaarli/commit/040eb18ec8cdabd5ea855e108f81f97fbf0478c4
|
||||
* https://github.com/Knah-Tsaeb/Shaarli/commit/4123658eae44d7564d1128ce52ddd5689efee813
|
||||
* https://github.com/Knah-Tsaeb/Shaarli/commit/f1a8ca9cc8fe49b119d51b2d8382cc1a34542f96
|
||||
|
||||
---
|
||||
index.php | 43 ++++++++++++++++++++++++++++++++-----------
|
||||
tpl/editlink.html | 1 +
|
||||
tpl/linklist.html | 1 +
|
||||
3 files changed, 34 insertions(+), 11 deletions(-)
|
||||
|
||||
diff --git a/index.php b/index.php
|
||||
index 6fae2f8..53f798e 100644
|
||||
--- a/index.php
|
||||
+++ b/index.php
|
||||
@@ -436,6 +436,12 @@ if (isset($_POST['login']))[](.html)
|
||||
// ------------------------------------------------------------------------------------------
|
||||
// Misc utility functions:
|
||||
|
||||
+// Try to get just domain for @via
|
||||
+function getJustDomain($url){
|
||||
+ $parts = parse_url($url);
|
||||
+ return trim($parts['host']);[](.html)
|
||||
+ }
|
||||
+
|
||||
// Returns the server URL (including port and http/https), without path.
|
||||
// e.g. "http://myserver.com:8080"
|
||||
// You can append $_SERVER['SCRIPT_NAME'] to get the current script URL.[](.html)
|
||||
@@ -799,7 +805,8 @@ class linkdb implements Iterator, Countable, ArrayAccess
|
||||
$found= (strpos(strtolower($l['title']),$s)!==false)[](.html)
|
||||
|| (strpos(strtolower($l['description']),$s)!==false)[](.html)
|
||||
|| (strpos(strtolower($l['url']),$s)!==false)[](.html)
|
||||
- || (strpos(strtolower($l['tags']),$s)!==false);[](.html)
|
||||
+ || (strpos(strtolower($l['tags']),$s)!==false)[](.html)
|
||||
+ || (!empty($l['via']) && (strpos(strtolower($l['via']),$s)!==false));[](.html)
|
||||
if ($found) $filtered[$l['linkdate'[ = $l;](-=-$l;.html)
|
||||
}
|
||||
krsort($filtered);
|
||||
@@ -814,7 +821,7 @@ class linkdb implements Iterator, Countable, ArrayAccess
|
||||
$t = str_replace(',',' ',($casesensitive?$tags:strtolower($tags)));
|
||||
$searchtags=explode(' ',$t);
|
||||
$filtered=array();
|
||||
- foreach($this->links as $l)
|
||||
+ foreach($this-> links as $l)
|
||||
{
|
||||
$linktags = explode(' ',($casesensitive?$l['tags']:strtolower($l['tags'])));[](.html)
|
||||
if (count(array_intersect($linktags,$searchtags)) == count($searchtags))
|
||||
@@ -905,7 +912,7 @@ function showRSS()
|
||||
else $linksToDisplay = $LINKSDB;
|
||||
$nblinksToDisplay = 50; // Number of links to display.
|
||||
if (!empty($_GET['nb'])) // In URL, you can specificy the number of links. Example: nb=200 or nb=all for all links.[](.html)
|
||||
- {
|
||||
+ {
|
||||
$nblinksToDisplay = $_GET['nb']=='all' ? count($linksToDisplay) : max($_GET['nb']+0,1) ;[](.html)
|
||||
}
|
||||
|
||||
@@ -944,7 +951,12 @@ function showRSS()
|
||||
// If user wants permalinks first, put the final link in description
|
||||
if ($usepermalinks===true) $descriptionlink = '(<a href="'.$absurl.'">Link</a>)';
|
||||
if (strlen($link['description'])>0) $descriptionlink = '<br>'.$descriptionlink;[](.html)
|
||||
- echo '<description><![CDATA['.nl2br(keepMultipleSpaces(text2clickable(htmlspecialchars($link['description'])))).$descriptionlink.'[></description>'."\n</item>\n";](></description>'."\n</item>\n";.html)
|
||||
+ if(!empty($link['via'])){[](.html)
|
||||
+ $via = '<br>Origine => <a href="'.htmlspecialchars($link['via']).'">'.htmlspecialchars(getJustDomain($link['via'])).'</a>';[](.html)
|
||||
+ } else {
|
||||
+ $via = '';
|
||||
+ }
|
||||
+ echo '<description><![CDATA['.nl2br(keepMultipleSpaces(text2clickable(htmlspecialchars($link['description'])))).$via.$descriptionlink.'[></description>'."\n</item>\n";](></description>'."\n</item>\n";.html)
|
||||
$i++;
|
||||
}
|
||||
echo '</channel></rss><!-- Cached version of '.htmlspecialchars(pageUrl()).' -->';
|
||||
@@ -980,7 +992,7 @@ function showATOM()
|
||||
else $linksToDisplay = $LINKSDB;
|
||||
$nblinksToDisplay = 50; // Number of links to display.
|
||||
if (!empty($_GET['nb'])) // In URL, you can specificy the number of links. Example: nb=200 or nb=all for all links.[](.html)
|
||||
- {
|
||||
+ {
|
||||
$nblinksToDisplay = $_GET['nb']=='all' ? count($linksToDisplay) : max($_GET['nb']+0,1) ;[](.html)
|
||||
}
|
||||
|
||||
@@ -1006,11 +1018,16 @@ function showATOM()
|
||||
|
||||
// Add permalink in description
|
||||
$descriptionlink = htmlspecialchars('(<a href="'.$guid.'">Permalink</a>)');
|
||||
+ if(isset($link['via']) && !empty($link['via'])){[](.html)
|
||||
+ $via = htmlspecialchars('</br> Origine => <a href="'.$link['via'].'">'.getJustDomain($link['via']).'</a>');[](.html)
|
||||
+ } else {
|
||||
+ $via = '';
|
||||
+ }
|
||||
// If user wants permalinks first, put the final link in description
|
||||
if ($usepermalinks===true) $descriptionlink = htmlspecialchars('(<a href="'.$absurl.'">Link</a>)');
|
||||
if (strlen($link['description'])>0) $descriptionlink = '&lt;br&gt;'.$descriptionlink;[](.html)
|
||||
|
||||
- $entries.='<content type="html">'.htmlspecialchars(nl2br(keepMultipleSpaces(text2clickable(htmlspecialchars($link['description']))))).$descriptionlink."</content>\n";[](.html)
|
||||
+ $entries.='<content type="html">'.htmlspecialchars(nl2br(keepMultipleSpaces(text2clickable(htmlspecialchars($link['description']))))).$descriptionlink.$via."</content>\n";[](.html)
|
||||
if ($link['tags']!='') // Adding tags to each ATOM entry (as mentioned in ATOM specification)[](.html)
|
||||
{
|
||||
foreach(explode(' ',$link['tags']) as $tag)[](.html)
|
||||
@@ -1478,7 +1495,7 @@ function renderPage()
|
||||
if (!startsWith($url,'http:') && !startsWith($url,'https:') && !startsWith($url,'ftp:') && !startsWith($url,'magnet:') && !startsWith($url,'?'))
|
||||
$url = 'http://'.$url;
|
||||
$link = array('title'=>trim($_POST['lf_title']),'url'=>$url,'description'=>trim($_POST['lf_description']),'private'=>(isset($_POST['lf_private']) ? 1 : 0),[](.html)
|
||||
- 'linkdate'=>$linkdate,'tags'=>str_replace(',',' ',$tags));
|
||||
+ 'linkdate'=>$linkdate,'tags'=>str_replace(',',' ',$tags), 'via'=>trim($_POST['lf_via']));[](.html)
|
||||
if ($link['title']=='') $link['title']=$link['url']; // If title is empty, use the URL as title.[](.html)
|
||||
$LINKSDB[$linkdate] = $link;[](.html)
|
||||
$LINKSDB->savedb(); // Save to disk.
|
||||
@@ -1556,7 +1573,8 @@ function renderPage()
|
||||
$title = (empty($_GET['title']) ? '' : $_GET['title'] ); // Get title if it was provided in URL (by the bookmarklet).[](.html)
|
||||
$description = (empty($_GET['description']) ? '' : $_GET['description']); // Get description if it was provided in URL (by the bookmarklet). [Bronco added that][](.html)
|
||||
$tags = (empty($_GET['tags']) ? '' : $_GET['tags'] ); // Get tags if it was provided in URL[](.html)
|
||||
- $private = (!empty($_GET['private']) && $_GET['private'] === "1" ? 1 : 0); // Get private if it was provided in URL [](.html)
|
||||
+ $via = (empty($_GET['via']) ? '' : $_GET['via'] );[](.html)
|
||||
+ $private = (!empty($_GET['private']) && $_GET['private'] === "1" ? 1 : 0); // Get private if it was provided in URL[](.html)
|
||||
if (($url!='') && parse_url($url,PHP_URL_SCHEME)=='') $url = 'http://'.$url;
|
||||
// If this is an HTTP link, we try go get the page to extract the title (otherwise we will to straight to the edit form.)
|
||||
if (empty($title) && parse_url($url,PHP_URL_SCHEME)=='http')
|
||||
@@ -1567,7 +1585,7 @@ function renderPage()
|
||||
{
|
||||
// Look for charset in html header.
|
||||
preg_match('#<meta .*charset=.*>#Usi', $data, $meta);
|
||||
-
|
||||
+
|
||||
// If found, extract encoding.
|
||||
if (!empty($meta[0]))[](.html)
|
||||
{
|
||||
@@ -1577,7 +1595,7 @@ function renderPage()
|
||||
$html_charset = (!empty($enc[1])) ? strtolower($enc[1]) : 'utf-8';[](.html)
|
||||
}
|
||||
else { $html_charset = 'utf-8'; }
|
||||
-
|
||||
+
|
||||
// Extract title
|
||||
$title = html_extract_title($data);
|
||||
if (!empty($title))
|
||||
@@ -1592,7 +1610,7 @@ function renderPage()
|
||||
$url='?'.smallHash($linkdate);
|
||||
$title='Note: ';
|
||||
}
|
||||
- $link = array('linkdate'=>$linkdate,'title'=>$title,'url'=>$url,'description'=>$description,'tags'=>$tags,'private'=>$private);
|
||||
+ $link = array('linkdate'=>$linkdate,'title'=>$title,'url'=>$url,'description'=>$description,'tags'=>$tags,'via' => $via,'private'=>$private);
|
||||
}
|
||||
|
||||
$PAGE = new pageBuilder;
|
||||
@@ -1842,6 +1860,9 @@ function buildLinkList($PAGE,$LINKSDB)
|
||||
$taglist = explode(' ',$link['tags']);[](.html)
|
||||
uasort($taglist, 'strcasecmp');
|
||||
$link['taglist']=$taglist;[](.html)
|
||||
+ if(!empty($link['via'])){[](.html)
|
||||
+ $link['via']=htmlspecialchars($link['via']);[](.html)
|
||||
+ }
|
||||
$linkDisp[$keys[$i[ = $link;](-=-$link;.html)
|
||||
$i++;
|
||||
}
|
||||
diff --git a/tpl/editlink.html b/tpl/editlink.html
|
||||
index 4a2c30c..14d4f9c 100644
|
||||
--- a/tpl/editlink.html
|
||||
+++ b/tpl/editlink.html
|
||||
@@ -16,6 +16,7 @@
|
||||
<i>Title</i><br><input type="text" name="lf_title" value="{$link.title|htmlspecialchars}" style="width:100%"><br>
|
||||
<i>Description</i><br><textarea name="lf_description" rows="4" cols="25" style="width:100%">{$link.description|htmlspecialchars}</textarea><br>
|
||||
<i>Tags</i><br><input type="text" id="lf_tags" name="lf_tags" value="{$link.tags|htmlspecialchars}" style="width:100%"><br>
|
||||
+ <i>Origine</i><br><input type="text" name="lf_via" value="{$link.via|htmlspecialchars}" style="width:100%"><br>
|
||||
{if condition="($link_is_new && $GLOBALS['privateLinkByDefault']==true) || $link.private == true"}[](.html)
|
||||
<input type="checkbox" checked="checked" name="lf_private" id="lf_private">
|
||||
&nbsp;<label for="lf_private"><i>Private</i></label><br>
|
||||
diff --git a/tpl/linklist.html b/tpl/linklist.html
|
||||
index ddc38cb..0a8475f 100644
|
||||
--- a/tpl/linklist.html
|
||||
+++ b/tpl/linklist.html
|
||||
@@ -43,6 +43,7 @@
|
||||
<span class="linktitle"><a href="{$redirector}{$value.url|htmlspecialchars}">{$value.title|htmlspecialchars}</a></span>
|
||||
<br>
|
||||
{if="$value.description"}<div class="linkdescription"{if condition="$search_type=='permalink'"} style="max-height:none !important;"{/if}>{$value.description}</div>{/if}
|
||||
+ {if condition="isset($value.via) && !empty($value.via)"}<div><a href="{$value.via}">Origine => {$value.via|getJustDomain}</a></div>{/if}
|
||||
{if="!$GLOBALS['config'['HIDE_TIMESTAMPS'] || isLoggedIn()"}]('HIDE_TIMESTAMPS']-||-isLoggedIn()"}.html)
|
||||
<span class="linkdate" title="Permalink"><a href="?{$value.linkdate|smallHash}">{$value.localdate|htmlspecialchars} - permalink</a> - </span>
|
||||
{else}
|
||||
--
|
||||
2.1.1</code></pre>
|
||||
</body>
|
||||
</html>
|
107
doc/FAQ.html
107
doc/FAQ.html
|
@ -1,107 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="generator" content="pandoc">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">
|
||||
<title>Shaarli – FAQ</title>
|
||||
<style type="text/css">code{white-space: pre;}</style>
|
||||
<link rel="stylesheet" href="github-markdown.css">
|
||||
<!--[if lt IE 9]>
|
||||
<script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv-printshiv.min.js"></script>
|
||||
<![endif]-->
|
||||
</head>
|
||||
<body>
|
||||
<div id="local-sidebar">
|
||||
<ul>
|
||||
<li><a href="Home.html">Home</a></li>
|
||||
<li>Setup
|
||||
<ul>
|
||||
<li><a href="Download-and-Installation.html">Download and Installation</a></li>
|
||||
<li><a href="Upgrade-and-migration.html">Upgrade and migration</a></li>
|
||||
<li><a href="Server-requirements.html">Server requirements</a></li>
|
||||
<li><a href="Server-configuration.html">Server configuration</a></li>
|
||||
<li><a href="Server-security.html">Server security</a></li>
|
||||
<li><a href="Shaarli-configuration.html">Shaarli configuration</a></li>
|
||||
<li><a href="Plugins.html">Plugins</a></li>
|
||||
</ul></li>
|
||||
<li><a href="Docker.html">Docker</a></li>
|
||||
<li><a href="Usage.html">Usage</a>
|
||||
<ul>
|
||||
<li><a href="Sharing-button.html">Sharing button</a> (bookmarklet)</li>
|
||||
<li><a href="Browsing-and-Searching.html">Browsing and Searching</a></li>
|
||||
<li><a href="Firefox-share.html">Firefox share</a></li>
|
||||
<li><a href="RSS-feeds.html">RSS feeds</a></li>
|
||||
<li><a href="REST-API.html">REST API</a></li>
|
||||
</ul></li>
|
||||
<li>How To
|
||||
<ul>
|
||||
<li><a href="Backup,-restore,-import-and-export.html">Backup, restore, import and export</a></li>
|
||||
<li><a href="Copy-an-existing-installation-over-SSH-and-serve-it-locally.html">Copy an existing installation over SSH and serve it locally</a></li>
|
||||
<li><a href="Create-and-serve-multiple-Shaarlis-(farm).html">Create and serve multiple Shaarlis (farm)</a></li>
|
||||
<li><a href="Download-CSS-styles-from-an-OPML-list.html">Download CSS styles from an OPML list</a></li>
|
||||
<li><a href="Datastore-hacks.html">Datastore hacks</a></li>
|
||||
</ul></li>
|
||||
<li><a href="Troubleshooting.html">Troubleshooting</a></li>
|
||||
<li><a href="Development.html">Development</a>
|
||||
<ul>
|
||||
<li><a href="GnuPG-signature.html">GnuPG signature</a></li>
|
||||
<li><a href="Coding-guidelines.html">Coding guidelines</a></li>
|
||||
<li><a href="Directory-structure.html">Directory structure</a></li>
|
||||
<li><a href="3rd-party-libraries.html">3rd party libraries</a></li>
|
||||
<li><a href="Plugin-System.html">Plugin System</a></li>
|
||||
<li><a href="Release-Shaarli.html">Release Shaarli</a></li>
|
||||
<li><a href="Versioning-and-Branches.html">Versioning and Branches</a></li>
|
||||
<li><a href="Security.html">Security</a></li>
|
||||
<li><a href="Static-analysis.html">Static analysis</a></li>
|
||||
<li><a href="Theming.html">Theming</a></li>
|
||||
<li><a href="Unit-tests.html">Unit tests</a></li>
|
||||
</ul></li>
|
||||
<li>About
|
||||
<ul>
|
||||
<li><a href="FAQ.html">FAQ</a></li>
|
||||
<li><a href="Community-&-Related-software.html">Community & Related software</a></li>
|
||||
</ul></li>
|
||||
</ul>
|
||||
</div>
|
||||
<h1 id="faq">FAQ</h1>
|
||||
<h3 id="why-did-you-create-shaarli">Why did you create Shaarli ?</h3>
|
||||
<p>I was a StumbleUpon user. Then I got fed up with they big toolbar. I switched to delicious, which was lighter, faster and more beautiful. Until Yahoo bought it. Then the export API broke all the time, delicious became slow and was ditched by Yahoo. I switched to Diigo, which is not bad, but does too much. And Diigo is sslllooooowww and their Firefox extension a bit buggy. And… oh… <strong>their Firefox addon sends to Diigo every single URL you visit</strong> (Don't believe me ? Use <a href="https://addons.mozilla.org/en-US/firefox/addon/tamper-data/">Tamper Data</a> and open any page).<a href=".html"></a></p>
|
||||
<p>Enough is enough. Saving simple links should not be a complicated heavy thing. I ditched them all and wrote my own: Shaarli. It's simple, but it does the job and does it well. And my data is not hosted on a foreign server, but on my server.</p>
|
||||
<h3 id="why-use-shaarli-and-not-deliciousdiigo">Why use Shaarli and not Delicious/Diigo ?</h3>
|
||||
<p>With Shaarli:</p>
|
||||
<ul>
|
||||
<li>The data is yours: It's hosted on your server.</li>
|
||||
<li>Never fear of having your data locked-in.</li>
|
||||
<li>Never fear to have your data sold to third party.</li>
|
||||
<li>Your private links are not hosted on a third party server.</li>
|
||||
<li>You are not tracked by browser addons (like Diigo does)</li>
|
||||
<li>You can change the look and feel of the pages if you want.</li>
|
||||
<li>You can change the behaviour of the program.</li>
|
||||
<li>It's magnitude faster than most bookmarking services.</li>
|
||||
</ul>
|
||||
<h3 id="what-does-shaarli-mean">What does Shaarli mean?</h3>
|
||||
<p>Shaarli is for shaaring your links.</p>
|
||||
<h3 id="my-shaarli-is-broken">My Shaarli is broken!</h3>
|
||||
<p>First of all, ensure that both the <a href="Server-configuration">web server</a> and <a href="Shaarli-configuration">Shaarli</a> are correctly configured, and that your installation is <a href="Server-requirements">supported</a>.<a href=".html"></a></p>
|
||||
<p>If everything looks right but the issue(s) remain(s), please:</p>
|
||||
<ul>
|
||||
<li>take a look at the <a href="Troubleshooting">troubleshooting</a> section<a href=".html"></a></li>
|
||||
<li>come <a href="https://gitter.im/shaarli/Shaarli">chat with us</a> on Gitter, we'll be happy to help ;-)<a href=".html"></a></li>
|
||||
<li>browse active <a href="https://github.com/shaarli/Shaarli/issues">issues</a> and <a href="https://github.com/shaarli/Shaarli/pulls">Pull Requests</a><a href=".html"></a>
|
||||
<ul>
|
||||
<li>if you find one that is related to the issue, feel free to comment and provide additional details (host/Shaarli setup)</li>
|
||||
<li>else, <a href="https://github.com/shaarli/Shaarli/issues/new">open a new issue</a>, and provide information about the problem:<a href=".html"></a>
|
||||
<ul>
|
||||
<li><em>what happens?</em> - display glitches, invalid data, security flaws...</li>
|
||||
<li><em>what is your configuration?</em> - OS, server version, activated extensions, web browser...</li>
|
||||
<li><em>is it reproducible?</em></li>
|
||||
</ul></li>
|
||||
</ul></li>
|
||||
</ul>
|
||||
<h3 id="why-not-use-a-real-database-files-are-slow">Why not use a real database? Files are slow!</h3>
|
||||
<p>Does browsing <a href="http://sebsauvage.net/links/">this page</a> feel slow? Try browsing older pages, too.<a href=".html"></a></p>
|
||||
<p>It's not slow at all, is it? And don't forget the database contains more than 16000 links, and it's on a shared host, with 32000 visitors/day for my website alone. And it's still damn fast. Why?</p>
|
||||
<p>The data file is only 3.7 Mb. It's read 99% of the time, and is probably already in the operation system disk cache. So generating a page involves no I/O at all most of the time.</p>
|
||||
</body>
|
||||
</html>
|
|
@ -1,95 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="generator" content="pandoc">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">
|
||||
<title>Shaarli – Firefox share</title>
|
||||
<style type="text/css">code{white-space: pre;}</style>
|
||||
<link rel="stylesheet" href="github-markdown.css">
|
||||
<!--[if lt IE 9]>
|
||||
<script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv-printshiv.min.js"></script>
|
||||
<![endif]-->
|
||||
</head>
|
||||
<body>
|
||||
<div id="local-sidebar">
|
||||
<ul>
|
||||
<li><a href="Home.html">Home</a></li>
|
||||
<li>Setup
|
||||
<ul>
|
||||
<li><a href="Download-and-Installation.html">Download and Installation</a></li>
|
||||
<li><a href="Upgrade-and-migration.html">Upgrade and migration</a></li>
|
||||
<li><a href="Server-requirements.html">Server requirements</a></li>
|
||||
<li><a href="Server-configuration.html">Server configuration</a></li>
|
||||
<li><a href="Server-security.html">Server security</a></li>
|
||||
<li><a href="Shaarli-configuration.html">Shaarli configuration</a></li>
|
||||
<li><a href="Plugins.html">Plugins</a></li>
|
||||
</ul></li>
|
||||
<li><a href="Docker.html">Docker</a></li>
|
||||
<li><a href="Usage.html">Usage</a>
|
||||
<ul>
|
||||
<li><a href="Sharing-button.html">Sharing button</a> (bookmarklet)</li>
|
||||
<li><a href="Browsing-and-Searching.html">Browsing and Searching</a></li>
|
||||
<li><a href="Firefox-share.html">Firefox share</a></li>
|
||||
<li><a href="RSS-feeds.html">RSS feeds</a></li>
|
||||
<li><a href="REST-API.html">REST API</a></li>
|
||||
</ul></li>
|
||||
<li>How To
|
||||
<ul>
|
||||
<li><a href="Backup,-restore,-import-and-export.html">Backup, restore, import and export</a></li>
|
||||
<li><a href="Copy-an-existing-installation-over-SSH-and-serve-it-locally.html">Copy an existing installation over SSH and serve it locally</a></li>
|
||||
<li><a href="Create-and-serve-multiple-Shaarlis-(farm).html">Create and serve multiple Shaarlis (farm)</a></li>
|
||||
<li><a href="Download-CSS-styles-from-an-OPML-list.html">Download CSS styles from an OPML list</a></li>
|
||||
<li><a href="Datastore-hacks.html">Datastore hacks</a></li>
|
||||
</ul></li>
|
||||
<li><a href="Troubleshooting.html">Troubleshooting</a></li>
|
||||
<li><a href="Development.html">Development</a>
|
||||
<ul>
|
||||
<li><a href="GnuPG-signature.html">GnuPG signature</a></li>
|
||||
<li><a href="Coding-guidelines.html">Coding guidelines</a></li>
|
||||
<li><a href="Directory-structure.html">Directory structure</a></li>
|
||||
<li><a href="3rd-party-libraries.html">3rd party libraries</a></li>
|
||||
<li><a href="Plugin-System.html">Plugin System</a></li>
|
||||
<li><a href="Release-Shaarli.html">Release Shaarli</a></li>
|
||||
<li><a href="Versioning-and-Branches.html">Versioning and Branches</a></li>
|
||||
<li><a href="Security.html">Security</a></li>
|
||||
<li><a href="Static-analysis.html">Static analysis</a></li>
|
||||
<li><a href="Theming.html">Theming</a></li>
|
||||
<li><a href="Unit-tests.html">Unit tests</a></li>
|
||||
</ul></li>
|
||||
<li>About
|
||||
<ul>
|
||||
<li><a href="FAQ.html">FAQ</a></li>
|
||||
<li><a href="Community-&-Related-software.html">Community & Related software</a></li>
|
||||
</ul></li>
|
||||
</ul>
|
||||
</div>
|
||||
<h1 id="firefox-share">Firefox share</h1>
|
||||
<h3 id="add-shaarli-as-a-sharing-service-to-firefox">Add Shaarli as a sharing service to Firefox</h3>
|
||||
<ul>
|
||||
<li>Open your Shaarli and <code>Login</code></li>
|
||||
<li>Click the <code>Tools</code> button in the top bar</li>
|
||||
<li>Click the <code>✚Add to Firefox social</code> button and accept the activation.</li>
|
||||
</ul>
|
||||
<h3 id="sharing-links-using-firefox-share">Sharing links using Firefox share</h3>
|
||||
<ul>
|
||||
<li>Add the sharing service as described above</li>
|
||||
<li>When you are visiting a webpage you would like to share with Shaarli, click the Firefox <em>Share</em> button <a href="images/firefoxshare.png.html">images/firefoxshare.png</a></li>
|
||||
<li>You can edit your link before and after saving, just like the bookmarklet above.</li>
|
||||
</ul>
|
||||
<table style="width:100%;">
|
||||
<colgroup>
|
||||
<col style="width: 8%" />
|
||||
<col style="width: 91%" />
|
||||
</colgroup>
|
||||
<thead>
|
||||
<tr class="header">
|
||||
<th></th>
|
||||
<th>Your Shaarli instance must be hosted on an HTTPS (SSL/TLS secure connection) enabled server for Firefox Share to work. Firefox Share will not work over plain HTTP connections.</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
</tbody>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
|
@ -1,175 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="generator" content="pandoc">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">
|
||||
<title>Shaarli – GnuPG signature</title>
|
||||
<style type="text/css">code{white-space: pre;}</style>
|
||||
<style type="text/css">
|
||||
div.sourceCode { overflow-x: auto; }
|
||||
table.sourceCode, tr.sourceCode, td.lineNumbers, td.sourceCode {
|
||||
margin: 0; padding: 0; vertical-align: baseline; border: none; }
|
||||
table.sourceCode { width: 100%; line-height: 100%; }
|
||||
td.lineNumbers { text-align: right; padding-right: 4px; padding-left: 4px; color: #aaaaaa; border-right: 1px solid #aaaaaa; }
|
||||
td.sourceCode { padding-left: 5px; }
|
||||
code > span.kw { color: #007020; font-weight: bold; } /* Keyword */
|
||||
code > span.dt { color: #902000; } /* DataType */
|
||||
code > span.dv { color: #40a070; } /* DecVal */
|
||||
code > span.bn { color: #40a070; } /* BaseN */
|
||||
code > span.fl { color: #40a070; } /* Float */
|
||||
code > span.ch { color: #4070a0; } /* Char */
|
||||
code > span.st { color: #4070a0; } /* String */
|
||||
code > span.co { color: #60a0b0; font-style: italic; } /* Comment */
|
||||
code > span.ot { color: #007020; } /* Other */
|
||||
code > span.al { color: #ff0000; font-weight: bold; } /* Alert */
|
||||
code > span.fu { color: #06287e; } /* Function */
|
||||
code > span.er { color: #ff0000; font-weight: bold; } /* Error */
|
||||
code > span.wa { color: #60a0b0; font-weight: bold; font-style: italic; } /* Warning */
|
||||
code > span.cn { color: #880000; } /* Constant */
|
||||
code > span.sc { color: #4070a0; } /* SpecialChar */
|
||||
code > span.vs { color: #4070a0; } /* VerbatimString */
|
||||
code > span.ss { color: #bb6688; } /* SpecialString */
|
||||
code > span.im { } /* Import */
|
||||
code > span.va { color: #19177c; } /* Variable */
|
||||
code > span.cf { color: #007020; font-weight: bold; } /* ControlFlow */
|
||||
code > span.op { color: #666666; } /* Operator */
|
||||
code > span.bu { } /* BuiltIn */
|
||||
code > span.ex { } /* Extension */
|
||||
code > span.pp { color: #bc7a00; } /* Preprocessor */
|
||||
code > span.at { color: #7d9029; } /* Attribute */
|
||||
code > span.do { color: #ba2121; font-style: italic; } /* Documentation */
|
||||
code > span.an { color: #60a0b0; font-weight: bold; font-style: italic; } /* Annotation */
|
||||
code > span.cv { color: #60a0b0; font-weight: bold; font-style: italic; } /* CommentVar */
|
||||
code > span.in { color: #60a0b0; font-weight: bold; font-style: italic; } /* Information */
|
||||
</style>
|
||||
<link rel="stylesheet" href="github-markdown.css">
|
||||
<!--[if lt IE 9]>
|
||||
<script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv-printshiv.min.js"></script>
|
||||
<![endif]-->
|
||||
</head>
|
||||
<body>
|
||||
<div id="local-sidebar">
|
||||
<ul>
|
||||
<li><a href="Home.html">Home</a></li>
|
||||
<li>Setup
|
||||
<ul>
|
||||
<li><a href="Download-and-Installation.html">Download and Installation</a></li>
|
||||
<li><a href="Upgrade-and-migration.html">Upgrade and migration</a></li>
|
||||
<li><a href="Server-requirements.html">Server requirements</a></li>
|
||||
<li><a href="Server-configuration.html">Server configuration</a></li>
|
||||
<li><a href="Server-security.html">Server security</a></li>
|
||||
<li><a href="Shaarli-configuration.html">Shaarli configuration</a></li>
|
||||
<li><a href="Plugins.html">Plugins</a></li>
|
||||
</ul></li>
|
||||
<li><a href="Docker.html">Docker</a></li>
|
||||
<li><a href="Usage.html">Usage</a>
|
||||
<ul>
|
||||
<li><a href="Sharing-button.html">Sharing button</a> (bookmarklet)</li>
|
||||
<li><a href="Browsing-and-Searching.html">Browsing and Searching</a></li>
|
||||
<li><a href="Firefox-share.html">Firefox share</a></li>
|
||||
<li><a href="RSS-feeds.html">RSS feeds</a></li>
|
||||
<li><a href="REST-API.html">REST API</a></li>
|
||||
</ul></li>
|
||||
<li>How To
|
||||
<ul>
|
||||
<li><a href="Backup,-restore,-import-and-export.html">Backup, restore, import and export</a></li>
|
||||
<li><a href="Copy-an-existing-installation-over-SSH-and-serve-it-locally.html">Copy an existing installation over SSH and serve it locally</a></li>
|
||||
<li><a href="Create-and-serve-multiple-Shaarlis-(farm).html">Create and serve multiple Shaarlis (farm)</a></li>
|
||||
<li><a href="Download-CSS-styles-from-an-OPML-list.html">Download CSS styles from an OPML list</a></li>
|
||||
<li><a href="Datastore-hacks.html">Datastore hacks</a></li>
|
||||
</ul></li>
|
||||
<li><a href="Troubleshooting.html">Troubleshooting</a></li>
|
||||
<li><a href="Development.html">Development</a>
|
||||
<ul>
|
||||
<li><a href="GnuPG-signature.html">GnuPG signature</a></li>
|
||||
<li><a href="Coding-guidelines.html">Coding guidelines</a></li>
|
||||
<li><a href="Directory-structure.html">Directory structure</a></li>
|
||||
<li><a href="3rd-party-libraries.html">3rd party libraries</a></li>
|
||||
<li><a href="Plugin-System.html">Plugin System</a></li>
|
||||
<li><a href="Release-Shaarli.html">Release Shaarli</a></li>
|
||||
<li><a href="Versioning-and-Branches.html">Versioning and Branches</a></li>
|
||||
<li><a href="Security.html">Security</a></li>
|
||||
<li><a href="Static-analysis.html">Static analysis</a></li>
|
||||
<li><a href="Theming.html">Theming</a></li>
|
||||
<li><a href="Unit-tests.html">Unit tests</a></li>
|
||||
</ul></li>
|
||||
<li>About
|
||||
<ul>
|
||||
<li><a href="FAQ.html">FAQ</a></li>
|
||||
<li><a href="Community-&-Related-software.html">Community & Related software</a></li>
|
||||
</ul></li>
|
||||
</ul>
|
||||
</div>
|
||||
<h1 id="gnupg-signature">GnuPG signature</h1>
|
||||
<h2 id="introduction">Introduction</h2>
|
||||
<h3 id="pgp-and-gpg">PGP and GPG</h3>
|
||||
<p><a href="https://gnupg.org/">Gnu Privacy Guard</a> (GnuPG) is an Open Source implementation of the <a href="https://en.wikipedia.org/wiki/Pretty_Good_Privacy#OpenPGP">Pretty Good [](.html)<br />
|
||||
Privacy</a> (OpenPGP) specification. Its main purposes are digital authentication,<br />
|
||||
signature and encryption.</p>
|
||||
<p>It is often used by the <a href="https://en.wikipedia.org/wiki/Free_and_open-source_software">FLOSS</a> community to verify:<a href=".html"></a></p>
|
||||
<ul>
|
||||
<li>Linux package signatures: Debian <a href="https://wiki.debian.org/SecureApt">SecureApt</a>, ArchLinux <a href="https://www.archlinux.org/master-keys/">Master [](.html)<br />
|
||||
Keys</a></li>
|
||||
<li><a href="https://en.wikipedia.org/wiki/Revision_control">SCM</a> releases & maintainer identity<a href=".html"></a></li>
|
||||
</ul>
|
||||
<h3 id="trust">Trust</h3>
|
||||
<p>To quote Phil Pennock (the author of the <a href="https://bitbucket.org/skskeyserver/sks-keyserver/wiki/Home">SKS</a> key server - <a href="http://sks.spodhuis.org/" class="uri">http://sks.spodhuis.org/</a>):<a href=".html"></a></p>
|
||||
<blockquote>
|
||||
<p>You MUST understand that presence of data in the keyserver (pools) in no way connotes trust. Anyone can generate a key, with any name or email address, and upload it. All security and trust comes from evaluating security at the “object level”, via PGP Web-Of-Trust signatures. This keyserver makes it possible to retrieve keys, looking them up via various indices, but the collection of keys in this public pool is KNOWN to contain malicious and fraudulent keys. It is the common expectation of server operators that users understand this and use software which, like all known common OpenPGP implementations, evaluates trust accordingly. This expectation is so common that it is not normally explicitly stated.</p>
|
||||
</blockquote>
|
||||
<p>Trust can be gained by having your key signed by other people (and signing their key back, too :) ), for instance during <a href="https://en.wikipedia.org/wiki/Key_signing_party">key signing parties</a>, see:<a href=".html"></a></p>
|
||||
<ul>
|
||||
<li><a href="http://www.cryptnet.net/fdp/crypto/keysigning_party/en/keysigning_party.html">The Keysigning party HOWTO</a><a href=".html"></a></li>
|
||||
<li><a href="https://en.wikipedia.org/wiki/Web_of_trust">Web of trust</a><a href=".html"></a></li>
|
||||
</ul>
|
||||
<h2 id="generate-a-gpg-key">Generate a GPG key</h2>
|
||||
<ul>
|
||||
<li><a href="http://stackoverflow.com/a/16725717">Generating a GPG key for Git tagging</a> (StackOverflow)<a href=".html"></a></li>
|
||||
<li><a href="https://help.github.com/articles/generating-a-gpg-key/">Generating a GPG key</a> (GitHub)<a href=".html"></a></li>
|
||||
</ul>
|
||||
<h3 id="gpg---provide-identity-information">gpg - provide identity information</h3>
|
||||
<div class="sourceCode"><pre class="sourceCode bash"><code class="sourceCode bash">$ <span class="ex">gpg</span> --gen-key
|
||||
|
||||
<span class="ex">gpg</span> (GnuPG) <span class="ex">2.1.6</span><span class="kw">;</span> <span class="ex">Copyright</span> (C) <span class="ex">2015</span> Free Software Foundation, Inc.
|
||||
<span class="ex">This</span> is free software: you are free to change and redistribute it.
|
||||
<span class="ex">There</span> is NO WARRANTY, to the extent permitted by law.
|
||||
|
||||
<span class="ex">Note</span>: Use <span class="st">"gpg2 --full-gen-key"</span> for a full featured key generation dialog.
|
||||
|
||||
<span class="ex">GnuPG</span> needs to construct a user ID to identify your key.
|
||||
|
||||
<span class="ex">Real</span> name: Marvin the Paranoid Android
|
||||
<span class="ex">Email</span> address: marvin@h2g2.net
|
||||
<span class="ex">You</span> selected this USER-ID:
|
||||
<span class="st">"Marvin the Paranoid Android <marvin@h2g2.net>"</span>
|
||||
|
||||
<span class="ex">Change</span> (N)<span class="ex">ame</span>, (E)<span class="ex">mail</span>, or (O)<span class="ex">kay</span>/<span class="kw">(</span><span class="ex">Q</span><span class="kw">)</span><span class="ex">uit?</span> o
|
||||
<span class="ex">We</span> need to generate a lot of random bytes. It is a good idea to perform
|
||||
<span class="ex">some</span> other action (type on the keyboard, move the mouse, utilize the
|
||||
<span class="ex">disks</span>) <span class="ex">during</span> the prime generation<span class="kw">;</span> <span class="ex">this</span> gives the random number
|
||||
<span class="ex">generator</span> a better chance to gain enough entropy.</code></pre></div>
|
||||
<h3 id="gpg---entropy-interlude">gpg - entropy interlude</h3>
|
||||
<p>At this point, you will:</p>
|
||||
<ul>
|
||||
<li>be prompted for a secure password to protect your key (the input method will depend on your Desktop Environment and configuration)</li>
|
||||
<li>be asked to use your machine's input devices (mouse, keyboard, etc.) to generate random entropy; this step <em>may take some time</em></li>
|
||||
</ul>
|
||||
<h3 id="gpg---key-creation-confirmation">gpg - key creation confirmation</h3>
|
||||
<div class="sourceCode"><pre class="sourceCode bash"><code class="sourceCode bash"><span class="ex">gpg</span>: key A9D53A3E marked as ultimately trusted
|
||||
<span class="ex">public</span> and secret key created and signed.
|
||||
|
||||
<span class="ex">gpg</span>: checking the trustdb
|
||||
<span class="ex">gpg</span>: 3 marginal(s) <span class="ex">needed</span>, 1 complete(s) <span class="ex">needed</span>, PGP trust model
|
||||
<span class="ex">gpg</span>: depth: 0 valid: 2 signed: 0 trust: 0-, 0q, 0n, 0m, 0f, 2u
|
||||
<span class="ex">pub</span> rsa2048/A9D53A3E 2015-07-31
|
||||
<span class="ex">Key</span> fingerprint = AF2A 5381 E54B 2FD2 14C4 A9A3 0E35 ACA4 A9D5 3A3E
|
||||
<span class="ex">uid</span> [ultimate] Marvin the Paranoid Android <span class="op"><</span>marvin@h2g2.net<span class="op">></span>[](.html)
|
||||
<span class="ex">sub</span> rsa2048/8C0EACF1 2015-07-31</code></pre></div>
|
||||
<h3 id="gpg---submit-your-public-key-to-a-pgp-server-optional">gpg - submit your public key to a PGP server (Optional)</h3>
|
||||
<div class="sourceCode"><pre class="sourceCode bash"><code class="sourceCode bash">$ <span class="ex">gpg</span> --keyserver pgp.mit.edu --send-keys A9D53A3E
|
||||
<span class="ex">gpg</span>: sending key A9D53A3E to hkp server pgp.mit.edu</code></pre></div>
|
||||
<h2 id="create-and-push-a-gpg-signed-tag">Create and push a GPG-signed tag</h2>
|
||||
<p>See <a href="Release-Shaarli.html">Release Shaarli</a>.</p>
|
||||
</body>
|
||||
</html>
|
|
@ -1,76 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="generator" content="pandoc">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">
|
||||
<title>Shaarli – Home</title>
|
||||
<style type="text/css">code{white-space: pre;}</style>
|
||||
<link rel="stylesheet" href="github-markdown.css">
|
||||
<!--[if lt IE 9]>
|
||||
<script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv-printshiv.min.js"></script>
|
||||
<![endif]-->
|
||||
</head>
|
||||
<body>
|
||||
<div id="local-sidebar">
|
||||
<ul>
|
||||
<li><a href="Home.html">Home</a></li>
|
||||
<li>Setup
|
||||
<ul>
|
||||
<li><a href="Download-and-Installation.html">Download and Installation</a></li>
|
||||
<li><a href="Upgrade-and-migration.html">Upgrade and migration</a></li>
|
||||
<li><a href="Server-requirements.html">Server requirements</a></li>
|
||||
<li><a href="Server-configuration.html">Server configuration</a></li>
|
||||
<li><a href="Server-security.html">Server security</a></li>
|
||||
<li><a href="Shaarli-configuration.html">Shaarli configuration</a></li>
|
||||
<li><a href="Plugins.html">Plugins</a></li>
|
||||
</ul></li>
|
||||
<li><a href="Docker.html">Docker</a></li>
|
||||
<li><a href="Usage.html">Usage</a>
|
||||
<ul>
|
||||
<li><a href="Sharing-button.html">Sharing button</a> (bookmarklet)</li>
|
||||
<li><a href="Browsing-and-Searching.html">Browsing and Searching</a></li>
|
||||
<li><a href="Firefox-share.html">Firefox share</a></li>
|
||||
<li><a href="RSS-feeds.html">RSS feeds</a></li>
|
||||
<li><a href="REST-API.html">REST API</a></li>
|
||||
</ul></li>
|
||||
<li>How To
|
||||
<ul>
|
||||
<li><a href="Backup,-restore,-import-and-export.html">Backup, restore, import and export</a></li>
|
||||
<li><a href="Copy-an-existing-installation-over-SSH-and-serve-it-locally.html">Copy an existing installation over SSH and serve it locally</a></li>
|
||||
<li><a href="Create-and-serve-multiple-Shaarlis-(farm).html">Create and serve multiple Shaarlis (farm)</a></li>
|
||||
<li><a href="Download-CSS-styles-from-an-OPML-list.html">Download CSS styles from an OPML list</a></li>
|
||||
<li><a href="Datastore-hacks.html">Datastore hacks</a></li>
|
||||
</ul></li>
|
||||
<li><a href="Troubleshooting.html">Troubleshooting</a></li>
|
||||
<li><a href="Development.html">Development</a>
|
||||
<ul>
|
||||
<li><a href="GnuPG-signature.html">GnuPG signature</a></li>
|
||||
<li><a href="Coding-guidelines.html">Coding guidelines</a></li>
|
||||
<li><a href="Directory-structure.html">Directory structure</a></li>
|
||||
<li><a href="3rd-party-libraries.html">3rd party libraries</a></li>
|
||||
<li><a href="Plugin-System.html">Plugin System</a></li>
|
||||
<li><a href="Release-Shaarli.html">Release Shaarli</a></li>
|
||||
<li><a href="Versioning-and-Branches.html">Versioning and Branches</a></li>
|
||||
<li><a href="Security.html">Security</a></li>
|
||||
<li><a href="Static-analysis.html">Static analysis</a></li>
|
||||
<li><a href="Theming.html">Theming</a></li>
|
||||
<li><a href="Unit-tests.html">Unit tests</a></li>
|
||||
</ul></li>
|
||||
<li>About
|
||||
<ul>
|
||||
<li><a href="FAQ.html">FAQ</a></li>
|
||||
<li><a href="Community-&-Related-software.html">Community & Related software</a></li>
|
||||
</ul></li>
|
||||
</ul>
|
||||
</div>
|
||||
<h1 id="home">Home</h1>
|
||||
<h1 id="shaarli-wiki">Shaarli wiki</h1>
|
||||
<p>Welcome to the <a href="https://github.com/shaarli/Shaarli/">Shaarli</a> wiki<embed src=".html" /></p>
|
||||
<p>Here you can find some info on how to use, configure, tweak and solve problems with your Shaarli.</p>
|
||||
<p>For general info, read the <a href="https://github.com/shaarli/Shaarli/blob/master/README.md">README</a>.<a href=".html"></a></p>
|
||||
<p>If you have any questions or ideas, please join the <a href="https://gitter.im/shaarli/Shaarli">chat</a> (also reachable via <a href="https://irc.gitter.im/">IRC</a>), post them in our <a href="https://github.com/shaarli/Shaarli/issues/308">general discussion</a> (<a href="https://github.com/shaarli/Shaarli/issues/44">archive</a>) or read the current <a href="https://github.com/shaarli/Shaarli/issues">issues</a>. If you've found a bug, please create a <a href="https://github.com/shaarli/Shaarli/issues/new">new issue</a>.<a href=".html"></a></p>
|
||||
<p>If you would like a feature added to Shaarli, check the issues labeled <a href="https://github.com/shaarli/Shaarli/labels/feature"><code>feature</code></a>, <a href="https://github.com/shaarli/Shaarli/labels/enhancement"><code>enhancement</code></a>, and <a href="https://github.com/shaarli/Shaarli/labels/plugin"><code>plugin</code></a>.<a href=".html"></a></p>
|
||||
<p><em>Note: This documentation is available online at <a href="https://github.com/shaarli/Shaarli/wiki" class="uri">https://github.com/shaarli/Shaarli/wiki</a>, and locally in the <code>doc/</code> directory of your Shaarli installation.</em></p>
|
||||
</body>
|
||||
</html>
|
|
@ -1,634 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="generator" content="pandoc">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">
|
||||
<title>Shaarli – Plugin System</title>
|
||||
<style type="text/css">code{white-space: pre;}</style>
|
||||
<style type="text/css">
|
||||
div.sourceCode { overflow-x: auto; }
|
||||
table.sourceCode, tr.sourceCode, td.lineNumbers, td.sourceCode {
|
||||
margin: 0; padding: 0; vertical-align: baseline; border: none; }
|
||||
table.sourceCode { width: 100%; line-height: 100%; }
|
||||
td.lineNumbers { text-align: right; padding-right: 4px; padding-left: 4px; color: #aaaaaa; border-right: 1px solid #aaaaaa; }
|
||||
td.sourceCode { padding-left: 5px; }
|
||||
code > span.kw { color: #007020; font-weight: bold; } /* Keyword */
|
||||
code > span.dt { color: #902000; } /* DataType */
|
||||
code > span.dv { color: #40a070; } /* DecVal */
|
||||
code > span.bn { color: #40a070; } /* BaseN */
|
||||
code > span.fl { color: #40a070; } /* Float */
|
||||
code > span.ch { color: #4070a0; } /* Char */
|
||||
code > span.st { color: #4070a0; } /* String */
|
||||
code > span.co { color: #60a0b0; font-style: italic; } /* Comment */
|
||||
code > span.ot { color: #007020; } /* Other */
|
||||
code > span.al { color: #ff0000; font-weight: bold; } /* Alert */
|
||||
code > span.fu { color: #06287e; } /* Function */
|
||||
code > span.er { color: #ff0000; font-weight: bold; } /* Error */
|
||||
code > span.wa { color: #60a0b0; font-weight: bold; font-style: italic; } /* Warning */
|
||||
code > span.cn { color: #880000; } /* Constant */
|
||||
code > span.sc { color: #4070a0; } /* SpecialChar */
|
||||
code > span.vs { color: #4070a0; } /* VerbatimString */
|
||||
code > span.ss { color: #bb6688; } /* SpecialString */
|
||||
code > span.im { } /* Import */
|
||||
code > span.va { color: #19177c; } /* Variable */
|
||||
code > span.cf { color: #007020; font-weight: bold; } /* ControlFlow */
|
||||
code > span.op { color: #666666; } /* Operator */
|
||||
code > span.bu { } /* BuiltIn */
|
||||
code > span.ex { } /* Extension */
|
||||
code > span.pp { color: #bc7a00; } /* Preprocessor */
|
||||
code > span.at { color: #7d9029; } /* Attribute */
|
||||
code > span.do { color: #ba2121; font-style: italic; } /* Documentation */
|
||||
code > span.an { color: #60a0b0; font-weight: bold; font-style: italic; } /* Annotation */
|
||||
code > span.cv { color: #60a0b0; font-weight: bold; font-style: italic; } /* CommentVar */
|
||||
code > span.in { color: #60a0b0; font-weight: bold; font-style: italic; } /* Information */
|
||||
</style>
|
||||
<link rel="stylesheet" href="github-markdown.css">
|
||||
<!--[if lt IE 9]>
|
||||
<script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv-printshiv.min.js"></script>
|
||||
<![endif]-->
|
||||
</head>
|
||||
<body>
|
||||
<div id="local-sidebar">
|
||||
<ul>
|
||||
<li><a href="Home.html">Home</a></li>
|
||||
<li>Setup
|
||||
<ul>
|
||||
<li><a href="Download-and-Installation.html">Download and Installation</a></li>
|
||||
<li><a href="Upgrade-and-migration.html">Upgrade and migration</a></li>
|
||||
<li><a href="Server-requirements.html">Server requirements</a></li>
|
||||
<li><a href="Server-configuration.html">Server configuration</a></li>
|
||||
<li><a href="Server-security.html">Server security</a></li>
|
||||
<li><a href="Shaarli-configuration.html">Shaarli configuration</a></li>
|
||||
<li><a href="Plugins.html">Plugins</a></li>
|
||||
</ul></li>
|
||||
<li><a href="Docker.html">Docker</a></li>
|
||||
<li><a href="Usage.html">Usage</a>
|
||||
<ul>
|
||||
<li><a href="Sharing-button.html">Sharing button</a> (bookmarklet)</li>
|
||||
<li><a href="Browsing-and-Searching.html">Browsing and Searching</a></li>
|
||||
<li><a href="Firefox-share.html">Firefox share</a></li>
|
||||
<li><a href="RSS-feeds.html">RSS feeds</a></li>
|
||||
<li><a href="REST-API.html">REST API</a></li>
|
||||
</ul></li>
|
||||
<li>How To
|
||||
<ul>
|
||||
<li><a href="Backup,-restore,-import-and-export.html">Backup, restore, import and export</a></li>
|
||||
<li><a href="Copy-an-existing-installation-over-SSH-and-serve-it-locally.html">Copy an existing installation over SSH and serve it locally</a></li>
|
||||
<li><a href="Create-and-serve-multiple-Shaarlis-(farm).html">Create and serve multiple Shaarlis (farm)</a></li>
|
||||
<li><a href="Download-CSS-styles-from-an-OPML-list.html">Download CSS styles from an OPML list</a></li>
|
||||
<li><a href="Datastore-hacks.html">Datastore hacks</a></li>
|
||||
</ul></li>
|
||||
<li><a href="Troubleshooting.html">Troubleshooting</a></li>
|
||||
<li><a href="Development.html">Development</a>
|
||||
<ul>
|
||||
<li><a href="GnuPG-signature.html">GnuPG signature</a></li>
|
||||
<li><a href="Coding-guidelines.html">Coding guidelines</a></li>
|
||||
<li><a href="Directory-structure.html">Directory structure</a></li>
|
||||
<li><a href="3rd-party-libraries.html">3rd party libraries</a></li>
|
||||
<li><a href="Plugin-System.html">Plugin System</a></li>
|
||||
<li><a href="Release-Shaarli.html">Release Shaarli</a></li>
|
||||
<li><a href="Versioning-and-Branches.html">Versioning and Branches</a></li>
|
||||
<li><a href="Security.html">Security</a></li>
|
||||
<li><a href="Static-analysis.html">Static analysis</a></li>
|
||||
<li><a href="Theming.html">Theming</a></li>
|
||||
<li><a href="Unit-tests.html">Unit tests</a></li>
|
||||
</ul></li>
|
||||
<li>About
|
||||
<ul>
|
||||
<li><a href="FAQ.html">FAQ</a></li>
|
||||
<li><a href="Community-&-Related-software.html">Community & Related software</a></li>
|
||||
</ul></li>
|
||||
</ul>
|
||||
</div>
|
||||
<h1 id="plugin-system">Plugin System</h1>
|
||||
<p><a href="#developer-api"><strong>I am a developer.</strong> Developer API.</a><a href=".html"></a></p>
|
||||
<p><a href="#guide-for-template-designer"><strong>I am a template designer.</strong> Guide for template designer.</a><a href=".html"></a></p>
|
||||
<h2 id="developer-api">Developer API</h2>
|
||||
<h3 id="what-can-i-do-with-plugins">What can I do with plugins?</h3>
|
||||
<p>The plugin system let you:</p>
|
||||
<ul>
|
||||
<li>insert content into specific places across templates.</li>
|
||||
<li>alter data before templates rendering.</li>
|
||||
<li>alter data before saving new links.</li>
|
||||
</ul>
|
||||
<h3 id="how-can-i-create-a-plugin-for-shaarli">How can I create a plugin for Shaarli?</h3>
|
||||
<p>First, chose a plugin name, such as <code>demo_plugin</code>.</p>
|
||||
<p>Under <code>plugin</code> folder, create a folder named with your plugin name. Then create a <plugin_name>.php file in that folder.</p>
|
||||
<p>You should have the following tree view:</p>
|
||||
<pre><code>| index.php
|
||||
| plugins/
|
||||
|---| demo_plugin/
|
||||
| |---| demo_plugin.php</code></pre>
|
||||
<h3 id="plugin-initialization">Plugin initialization</h3>
|
||||
<p>At the beginning of Shaarli execution, all enabled plugins are loaded. At this point, the plugin system looks for an <code>init()</code> function to execute and run it if it exists. This function must be named this way, and takes the <code>ConfigManager</code> as parameter.</p>
|
||||
<pre><code><plugin_name>_init($conf)</code></pre>
|
||||
<p>This function can be used to create initial data, load default settings, etc. But also to set <em>plugin errors</em>. If the initialization function returns an array of strings, they will be understand as errors, and displayed in the header to logged in users.</p>
|
||||
<h3 id="understanding-hooks">Understanding hooks</h3>
|
||||
<p>A plugin is a set of functions. Each function will be triggered by the plugin system at certain point in Shaarli execution.</p>
|
||||
<p>These functions need to be named with this pattern:</p>
|
||||
<pre><code>hook_<plugin_name>_<hook_name>($data, $conf)</code></pre>
|
||||
<p>Parameters:</p>
|
||||
<ul>
|
||||
<li>data: see <a href="https://github.com/shaarli/Shaarli/wiki/Plugin-System#plugins-data">$data section</a><a href=".html"></a></li>
|
||||
<li>conf: the <code>ConfigManager</code> instance.</li>
|
||||
</ul>
|
||||
<p>For exemple, if my plugin want to add data to the header, this function is needed:</p>
|
||||
<pre><code>hook_demo_plugin_render_header</code></pre>
|
||||
<p>If this function is declared, and the plugin enabled, it will be called every time Shaarli is rendering the header.</p>
|
||||
<h3 id="plugins-data">Plugin's data</h3>
|
||||
<h4 id="parameters">Parameters</h4>
|
||||
<p>Every hook function has a <code>$data</code> parameter. Its content differs for each hooks.</p>
|
||||
<p><strong>This parameter needs to be returned every time</strong>, otherwise data is lost.</p>
|
||||
<pre><code>return $data;</code></pre>
|
||||
<h4 id="filling-templates-placeholder">Filling templates placeholder</h4>
|
||||
<p>Template placeholders are displayed in template in specific places.</p>
|
||||
<p>RainTPL displays every element contained in the placeholder's array. These element can be added by plugins.</p>
|
||||
<p>For example, let's add a value in the placeholder <code>top_placeholder</code> which is displayed at the top of my page:</p>
|
||||
<div class="sourceCode"><pre class="sourceCode php"><code class="sourceCode php"><span class="kw">$data</span><span class="ot">[</span><span class="st">'top_placeholder'</span><span class="ot">[]</span> = <span class="st">'My content'</span><span class="ot">;](]</span>-=-<span class="st">'My-content'</span><span class="ot">;</span>.html<span class="ot">)</span>
|
||||
<span class="co"># OR</span>
|
||||
<span class="fu">array_push</span><span class="ot">(</span><span class="kw">$data</span><span class="ot">[</span><span class="st">'top_placeholder'</span><span class="ot">],</span> <span class="st">'My'</span><span class="ot">,</span> <span class="st">'content'</span><span class="ot">);[](</span>.html<span class="ot">)</span>
|
||||
|
||||
<span class="kw">return</span> <span class="kw">$data</span><span class="ot">;</span></code></pre></div>
|
||||
<h4 id="data-manipulation">Data manipulation</h4>
|
||||
<p>When a page is displayed, every variable send to the template engine is passed to plugins before that in <code>$data</code>.</p>
|
||||
<p>The data contained by this array can be altered before template rendering.</p>
|
||||
<p>For exemple, in linklist, it is possible to alter every title:</p>
|
||||
<div class="sourceCode"><pre class="sourceCode php"><code class="sourceCode php"><span class="co">// mind the reference if you want $data to be altered</span>
|
||||
<span class="kw">foreach</span> <span class="ot">(</span><span class="kw">$data</span><span class="ot">[</span><span class="st">'links'</span><span class="ot">]</span> <span class="kw">as</span> &<span class="kw">$value</span><span class="ot">)</span> {<span class="ot">[](</span>.html<span class="ot">)</span>
|
||||
<span class="co">// String reverse every title.</span>
|
||||
<span class="kw">$value</span><span class="ot">[</span><span class="st">'title'</span><span class="ot">]</span> = <span class="fu">strrev</span><span class="ot">(</span><span class="kw">$value</span><span class="ot">[</span><span class="st">'title'</span><span class="ot">]);[](</span>.html<span class="ot">)</span>
|
||||
}
|
||||
|
||||
<span class="kw">return</span> <span class="kw">$data</span><span class="ot">;</span></code></pre></div>
|
||||
<h3 id="metadata">Metadata</h3>
|
||||
<p>Every plugin needs a <code><plugin_name>.meta</code> file, which is in fact an <code>.ini</code> file (<code>KEY="VALUE"</code>), to be listed in plugin administration.</p>
|
||||
<p>Each file contain two keys:</p>
|
||||
<ul>
|
||||
<li><code>description</code>: plugin description</li>
|
||||
<li><code>parameters</code>: user parameter names, separated by a <code>;</code>.</li>
|
||||
<li><code>parameter.<PARAMETER_NAME></code>: add a text description the specified parameter.</li>
|
||||
</ul>
|
||||
<blockquote>
|
||||
<p>Note: In PHP, <code>parse_ini_file()</code> seems to want strings to be between by quotes <code>"</code> in the ini file.</p>
|
||||
</blockquote>
|
||||
<h3 id="its-not-working">It's not working!</h3>
|
||||
<p>Use <code>demo_plugin</code> as a functional example. It covers most of the plugin system features.</p>
|
||||
<p>If it's still not working, please <a href="https://github.com/shaarli/Shaarli/issues/new">open an issue</a>.<a href=".html"></a></p>
|
||||
<h3 id="hooks">Hooks</h3>
|
||||
<table style="width:42%;">
|
||||
<colgroup>
|
||||
<col style="width: 19%" />
|
||||
<col style="width: 22%" />
|
||||
</colgroup>
|
||||
<thead>
|
||||
<tr class="header">
|
||||
<th>Hooks</th>
|
||||
<th style="text-align: center;">Description</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr class="odd">
|
||||
<td><a href="#render_header">render_header</a></td>
|
||||
<td style="text-align: center;">Allow plugin to add content in page headers.</td>
|
||||
</tr>
|
||||
<tr class="even">
|
||||
<td><a href="#render_includes">render_includes</a></td>
|
||||
<td style="text-align: center;">Allow plugin to include their own CSS files.</td>
|
||||
</tr>
|
||||
<tr class="odd">
|
||||
<td><a href="#render_footer">render_footer</a></td>
|
||||
<td style="text-align: center;">Allow plugin to add content in page footer and include their own JS files.</td>
|
||||
</tr>
|
||||
<tr class="even">
|
||||
<td><a href="#render_linklist">render_linklist</a></td>
|
||||
<td style="text-align: center;">It allows to add content at the begining and end of the page, after every link displayed and to alter link data.</td>
|
||||
</tr>
|
||||
<tr class="odd">
|
||||
<td><a href="#render_editlink">render_editlink</a></td>
|
||||
<td style="text-align: center;">Allow to add fields in the form, or display elements.</td>
|
||||
</tr>
|
||||
<tr class="even">
|
||||
<td><a href="#render_tools">render_tools</a></td>
|
||||
<td style="text-align: center;">Allow to add content at the end of the page.</td>
|
||||
</tr>
|
||||
<tr class="odd">
|
||||
<td><a href="#render_picwall">render_picwall</a></td>
|
||||
<td style="text-align: center;">Allow to add content at the top and bottom of the page.</td>
|
||||
</tr>
|
||||
<tr class="even">
|
||||
<td><a href="#render_tagcloud">render_tagcloud</a></td>
|
||||
<td style="text-align: center;">Allow to add content at the top and bottom of the page, and after all tags.</td>
|
||||
</tr>
|
||||
<tr class="odd">
|
||||
<td><a href="#render_taglist">render_taglist</a></td>
|
||||
<td style="text-align: center;">Allow to add content at the top and bottom of the page, and after all tags.</td>
|
||||
</tr>
|
||||
<tr class="even">
|
||||
<td><a href="#render_daily">render_daily</a></td>
|
||||
<td style="text-align: center;">Allow to add content at the top and bottom of the page, the bottom of each link and to alter data.</td>
|
||||
</tr>
|
||||
<tr class="odd">
|
||||
<td><a href="#render_feed">render_feed</a></td>
|
||||
<td style="text-align: center;">Allow to do add tags in RSS and ATOM feeds.</td>
|
||||
</tr>
|
||||
<tr class="even">
|
||||
<td><a href="#save_link">save_link</a></td>
|
||||
<td style="text-align: center;">Allow to alter the link being saved in the datastore.</td>
|
||||
</tr>
|
||||
<tr class="odd">
|
||||
<td><a href="#delete_link">delete_link</a></td>
|
||||
<td style="text-align: center;">Allow to do an action before a link is deleted from the datastore.</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<h4 id="render_header">render_header</h4>
|
||||
<p>Triggered on every page.</p>
|
||||
<p>Allow plugin to add content in page headers.</p>
|
||||
<h5 id="data">Data</h5>
|
||||
<p><code>$data</code> is an array containing:</p>
|
||||
<ul>
|
||||
<li><code>_PAGE_</code>: current target page (eg: <code>linklist</code>, <code>picwall</code>, etc.).</li>
|
||||
<li><code>_LOGGEDIN_</code>: true if user is logged in, false otherwise.</li>
|
||||
</ul>
|
||||
<h5 id="template-placeholders">Template placeholders</h5>
|
||||
<p>Items can be displayed in templates by adding an entry in <code>$data['<placeholder>']</code> array.<a href=".html"></a></p>
|
||||
<p>List of placeholders:</p>
|
||||
<ul>
|
||||
<li><code>buttons_toolbar</code>: after the list of buttons in the header.</li>
|
||||
</ul>
|
||||
<p><img src="http://i.imgur.com/ssJUOrt.png" alt="buttons_toolbar_example" /><a href=".html"></a></p>
|
||||
<ul>
|
||||
<li><code>fields_toolbar</code>: after search fields in the header.</li>
|
||||
</ul>
|
||||
<blockquote>
|
||||
<p>Note: This will only be called in linklist.</p>
|
||||
</blockquote>
|
||||
<p><img src="http://i.imgur.com/3GMifI2.png" alt="fields_toolbar_example" /><a href=".html"></a></p>
|
||||
<h4 id="render_includes">render_includes</h4>
|
||||
<p>Triggered on every page.</p>
|
||||
<p>Allow plugin to include their own CSS files.</p>
|
||||
<h5 id="data-1">Data</h5>
|
||||
<p><code>$data</code> is an array containing:</p>
|
||||
<ul>
|
||||
<li><code>_PAGE_</code>: current target page (eg: <code>linklist</code>, <code>picwall</code>, etc.).</li>
|
||||
<li><code>_LOGGEDIN_</code>: true if user is logged in, false otherwise.</li>
|
||||
</ul>
|
||||
<h5 id="template-placeholders-1">Template placeholders</h5>
|
||||
<p>Items can be displayed in templates by adding an entry in <code>$data['<placeholder>']</code> array.<a href=".html"></a></p>
|
||||
<p>List of placeholders:</p>
|
||||
<ul>
|
||||
<li><code>css_files</code>: called after loading default CSS.</li>
|
||||
</ul>
|
||||
<blockquote>
|
||||
<p>Note: only add the path of the CSS file. E.g: <code>plugins/demo_plugin/custom_demo.css</code>.</p>
|
||||
</blockquote>
|
||||
<h4 id="render_footer">render_footer</h4>
|
||||
<p>Triggered on every page.</p>
|
||||
<p>Allow plugin to add content in page footer and include their own JS files.</p>
|
||||
<h5 id="data-2">Data</h5>
|
||||
<p><code>$data</code> is an array containing:</p>
|
||||
<ul>
|
||||
<li><code>_PAGE_</code>: current target page (eg: <code>linklist</code>, <code>picwall</code>, etc.).</li>
|
||||
<li><code>_LOGGEDIN_</code>: true if user is logged in, false otherwise.</li>
|
||||
</ul>
|
||||
<h5 id="template-placeholders-2">Template placeholders</h5>
|
||||
<p>Items can be displayed in templates by adding an entry in <code>$data['<placeholder>']</code> array.<a href=".html"></a></p>
|
||||
<p>List of placeholders:</p>
|
||||
<ul>
|
||||
<li><code>text</code>: called after the end of the footer text.</li>
|
||||
<li><code>endofpage</code>: called at the end of the page.</li>
|
||||
</ul>
|
||||
<p><img src="http://i.imgur.com/L5S2YEH.png" alt="text_example" /><a href=".html"></a></p>
|
||||
<ul>
|
||||
<li><code>js_files</code>: called at the end of the page, to include custom JS scripts.</li>
|
||||
</ul>
|
||||
<blockquote>
|
||||
<p>Note: only add the path of the JS file. E.g: <code>plugins/demo_plugin/custom_demo.js</code>.</p>
|
||||
</blockquote>
|
||||
<h4 id="render_linklist">render_linklist</h4>
|
||||
<p>Triggered when <code>linklist</code> is displayed (list of links, permalink, search, tag filtered, etc.).</p>
|
||||
<p>It allows to add content at the begining and end of the page, after every link displayed and to alter link data.</p>
|
||||
<h5 id="data-3">Data</h5>
|
||||
<p><code>$data</code> is an array containing:</p>
|
||||
<ul>
|
||||
<li><code>_LOGGEDIN_</code>: true if user is logged in, false otherwise.</li>
|
||||
<li>All templates data, including links.</li>
|
||||
</ul>
|
||||
<h5 id="template-placeholders-3">Template placeholders</h5>
|
||||
<p>Items can be displayed in templates by adding an entry in <code>$data['<placeholder>']</code> array.<a href=".html"></a></p>
|
||||
<p>List of placeholders:</p>
|
||||
<ul>
|
||||
<li><code>action_plugin</code>: next to the button "private only" at the top and bottom of the page.</li>
|
||||
</ul>
|
||||
<p><img src="http://i.imgur.com/Q12PWg0.png" alt="action_plugin_example" /><a href=".html"></a></p>
|
||||
<ul>
|
||||
<li><code>link_plugin</code>: for every link, between permalink and link URL.</li>
|
||||
</ul>
|
||||
<p><img src="http://i.imgur.com/3oDPhWx.png" alt="link_plugin_example" /><a href=".html"></a></p>
|
||||
<ul>
|
||||
<li><code>plugin_start_zone</code>: before displaying the template content.</li>
|
||||
</ul>
|
||||
<p><img src="http://i.imgur.com/OVBkGy3.png" alt="plugin_start_zone_example" /><a href=".html"></a></p>
|
||||
<ul>
|
||||
<li><code>plugin_end_zone</code>: after displaying the template content.</li>
|
||||
</ul>
|
||||
<p><img src="http://i.imgur.com/6IoRuop.png" alt="plugin_end_zone_example" /><a href=".html"></a></p>
|
||||
<h4 id="render_editlink">render_editlink</h4>
|
||||
<p>Triggered when the link edition form is displayed.</p>
|
||||
<p>Allow to add fields in the form, or display elements.</p>
|
||||
<h5 id="data-4">Data</h5>
|
||||
<p><code>$data</code> is an array containing:</p>
|
||||
<ul>
|
||||
<li>All templates data.</li>
|
||||
</ul>
|
||||
<h5 id="template-placeholders-4">Template placeholders</h5>
|
||||
<p>Items can be displayed in templates by adding an entry in <code>$data['<placeholder>']</code> array.<a href=".html"></a></p>
|
||||
<p>List of placeholders:</p>
|
||||
<ul>
|
||||
<li><code>edit_link_plugin</code>: after tags field.</li>
|
||||
</ul>
|
||||
<p><img src="http://i.imgur.com/5u17Ens.png" alt="edit_link_plugin_example" /><a href=".html"></a></p>
|
||||
<h4 id="render_tools">render_tools</h4>
|
||||
<p>Triggered when the "tools" page is displayed.</p>
|
||||
<p>Allow to add content at the end of the page.</p>
|
||||
<h5 id="data-5">Data</h5>
|
||||
<p><code>$data</code> is an array containing:</p>
|
||||
<ul>
|
||||
<li>All templates data.</li>
|
||||
</ul>
|
||||
<h5 id="template-placeholders-5">Template placeholders</h5>
|
||||
<p>Items can be displayed in templates by adding an entry in <code>$data['<placeholder>']</code> array.<a href=".html"></a></p>
|
||||
<p>List of placeholders:</p>
|
||||
<ul>
|
||||
<li><code>tools_plugin</code>: at the end of the page.</li>
|
||||
</ul>
|
||||
<p><img src="http://i.imgur.com/Bqhu9oQ.png" alt="tools_plugin_example" /><a href=".html"></a></p>
|
||||
<h4 id="render_picwall">render_picwall</h4>
|
||||
<p>Triggered when picwall is displayed.</p>
|
||||
<p>Allow to add content at the top and bottom of the page.</p>
|
||||
<h5 id="data-6">Data</h5>
|
||||
<p><code>$data</code> is an array containing:</p>
|
||||
<ul>
|
||||
<li><code>_LOGGEDIN_</code>: true if user is logged in, false otherwise.</li>
|
||||
<li>All templates data.</li>
|
||||
</ul>
|
||||
<h5 id="template-placeholders-6">Template placeholders</h5>
|
||||
<p>Items can be displayed in templates by adding an entry in <code>$data['<placeholder>']</code> array.<a href=".html"></a></p>
|
||||
<p>List of placeholders:</p>
|
||||
<ul>
|
||||
<li><p><code>plugin_start_zone</code>: before displaying the template content.</p></li>
|
||||
<li><p><code>plugin_end_zone</code>: after displaying the template content.</p></li>
|
||||
</ul>
|
||||
<p><img src="http://i.imgur.com/tVTQFER.png" alt="plugin_start_end_zone_example" /><a href=".html"></a></p>
|
||||
<h4 id="render_tagcloud">render_tagcloud</h4>
|
||||
<p>Triggered when tagcloud is displayed.</p>
|
||||
<p>Allow to add content at the top and bottom of the page.</p>
|
||||
<h5 id="data-7">Data</h5>
|
||||
<p><code>$data</code> is an array containing:</p>
|
||||
<ul>
|
||||
<li><code>_LOGGEDIN_</code>: true if user is logged in, false otherwise.</li>
|
||||
<li>All templates data.</li>
|
||||
</ul>
|
||||
<h5 id="template-placeholders-7">Template placeholders</h5>
|
||||
<p>Items can be displayed in templates by adding an entry in <code>$data['<placeholder>']</code> array.<a href=".html"></a></p>
|
||||
<p>List of placeholders:</p>
|
||||
<ul>
|
||||
<li><p><code>plugin_start_zone</code>: before displaying the template content.</p></li>
|
||||
<li><p><code>plugin_end_zone</code>: after displaying the template content.</p></li>
|
||||
</ul>
|
||||
<p>For each tag, the following placeholder can be used:</p>
|
||||
<ul>
|
||||
<li><code>tag_plugin</code>: after each tag</li>
|
||||
</ul>
|
||||
<p><img src="http://i.imgur.com/vHmyT3a.png" alt="plugin_start_end_zone_example" /><a href=".html"></a></p>
|
||||
<h4 id="render_taglist">render_taglist</h4>
|
||||
<p>Triggered when taglist is displayed.</p>
|
||||
<p>Allow to add content at the top and bottom of the page.</p>
|
||||
<h5 id="data-8">Data</h5>
|
||||
<p><code>$data</code> is an array containing:</p>
|
||||
<ul>
|
||||
<li><code>_LOGGEDIN_</code>: true if user is logged in, false otherwise.</li>
|
||||
<li>All templates data.</li>
|
||||
</ul>
|
||||
<h5 id="template-placeholders-8">Template placeholders</h5>
|
||||
<p>Items can be displayed in templates by adding an entry in <code>$data['<placeholder>']</code> array.<a href=".html"></a></p>
|
||||
<p>List of placeholders:</p>
|
||||
<ul>
|
||||
<li><p><code>plugin_start_zone</code>: before displaying the template content.</p></li>
|
||||
<li><p><code>plugin_end_zone</code>: after displaying the template content.</p></li>
|
||||
</ul>
|
||||
<p>For each tag, the following placeholder can be used:</p>
|
||||
<ul>
|
||||
<li><code>tag_plugin</code>: after each tag</li>
|
||||
</ul>
|
||||
<h4 id="render_daily">render_daily</h4>
|
||||
<p>Triggered when tagcloud is displayed.</p>
|
||||
<p>Allow to add content at the top and bottom of the page, the bottom of each link and to alter data.</p>
|
||||
<h5 id="data-9">Data</h5>
|
||||
<p><code>$data</code> is an array containing:</p>
|
||||
<ul>
|
||||
<li><code>_LOGGEDIN_</code>: true if user is logged in, false otherwise.</li>
|
||||
<li>All templates data, including links.</li>
|
||||
</ul>
|
||||
<h5 id="template-placeholders-9">Template placeholders</h5>
|
||||
<p>Items can be displayed in templates by adding an entry in <code>$data['<placeholder>']</code> array.<a href=".html"></a></p>
|
||||
<p>List of placeholders:</p>
|
||||
<ul>
|
||||
<li><code>link_plugin</code>: used at bottom of each link.</li>
|
||||
</ul>
|
||||
<p><img src="http://i.imgur.com/hzhMfSZ.png" alt="link_plugin_example" /><a href=".html"></a></p>
|
||||
<ul>
|
||||
<li><p><code>plugin_start_zone</code>: before displaying the template content.</p></li>
|
||||
<li><p><code>plugin_end_zone</code>: after displaying the template content.</p></li>
|
||||
</ul>
|
||||
<h4 id="render_feed">render_feed</h4>
|
||||
<p>Triggered when the ATOM or RSS feed is displayed.</p>
|
||||
<p>Allow to add tags in the feed, either in the header or for each items. Items (links) can also be altered before being rendered.</p>
|
||||
<h5 id="data-10">Data</h5>
|
||||
<p><code>$data</code> is an array containing:</p>
|
||||
<ul>
|
||||
<li><code>_LOGGEDIN_</code>: true if user is logged in, false otherwise.</li>
|
||||
<li><code>_PAGE_</code>: containing either <code>rss</code> or <code>atom</code>.</li>
|
||||
<li>All templates data, including links.</li>
|
||||
</ul>
|
||||
<h5 id="template-placeholders-10">Template placeholders</h5>
|
||||
<p>Tags can be added in feeds by adding an entry in <code>$data['<placeholder>']</code> array.<a href=".html"></a></p>
|
||||
<p>List of placeholders:</p>
|
||||
<ul>
|
||||
<li><code>feed_plugins_header</code>: used as a header tag in the feed.</li>
|
||||
</ul>
|
||||
<p>For each links:</p>
|
||||
<ul>
|
||||
<li><code>feed_plugins</code>: additional tag for every link entry.</li>
|
||||
</ul>
|
||||
<h4 id="save_link">save_link</h4>
|
||||
<p>Triggered when a link is save (new link or edit).</p>
|
||||
<p>Allow to alter the link being saved in the datastore.</p>
|
||||
<h5 id="data-11">Data</h5>
|
||||
<p><code>$data</code> is an array containing the link being saved:</p>
|
||||
<ul>
|
||||
<li>id</li>
|
||||
<li>title</li>
|
||||
<li>url</li>
|
||||
<li>shorturl</li>
|
||||
<li>description</li>
|
||||
<li>private</li>
|
||||
<li>tags</li>
|
||||
<li>created</li>
|
||||
<li>updated</li>
|
||||
</ul>
|
||||
<h4 id="delete_link">delete_link</h4>
|
||||
<p>Triggered when a link is deleted.</p>
|
||||
<p>Allow to execute any action before the link is actually removed from the datastore</p>
|
||||
<h5 id="data-12">Data</h5>
|
||||
<p><code>$data</code> is an array containing the link being saved:</p>
|
||||
<ul>
|
||||
<li>id</li>
|
||||
<li>title</li>
|
||||
<li>url</li>
|
||||
<li>shorturl</li>
|
||||
<li>description</li>
|
||||
<li>private</li>
|
||||
<li>tags</li>
|
||||
<li>created</li>
|
||||
<li>updated</li>
|
||||
</ul>
|
||||
<h2 id="guide-for-template-designer">Guide for template designer</h2>
|
||||
<h3 id="plugin-administration">Plugin administration</h3>
|
||||
<p>Your theme must include a plugin administration page: <code>pluginsadmin.html</code>.</p>
|
||||
<blockquote>
|
||||
<p>Note: repo's template link needs to be added when the PR is merged.</p>
|
||||
</blockquote>
|
||||
<p>Use the default one as an example.</p>
|
||||
<p>Aside from classic RainTPL loops, plugins order is handle by JavaScript. You can just include <code>plugin_admin.js</code>, only if:</p>
|
||||
<ul>
|
||||
<li>you're using a table.</li>
|
||||
<li>you call orderUp() and orderUp() onclick on arrows.</li>
|
||||
<li>you add data-line and data-order to your rows.</li>
|
||||
</ul>
|
||||
<p>Otherwise, you can use your own JS as long as this field is send by the form:</p>
|
||||
<p><input type="hidden" name="order_{$key}" value="{$counter}"></p>
|
||||
<h3 id="placeholder-system">Placeholder system</h3>
|
||||
<p>In order to make plugins work with every custom themes, you need to add variable placeholder in your templates.</p>
|
||||
<p>It's a RainTPL loop like this:</p>
|
||||
<pre><code>{loop="$plugin_variable"}
|
||||
{$value}
|
||||
{/loop}</code></pre>
|
||||
<p>You should enable <code>demo_plugin</code> for testing purpose, since it uses every placeholder available.</p>
|
||||
<h3 id="list-of-placeholders">List of placeholders</h3>
|
||||
<p><strong>page.header.html</strong></p>
|
||||
<p>At the end of the menu:</p>
|
||||
<pre><code>{loop="$plugins_header.buttons_toolbar"}
|
||||
{$value}
|
||||
{/loop}</code></pre>
|
||||
<p>At the end of file, before clearing floating blocks:</p>
|
||||
<pre><code>{if="!empty($plugin_errors) && isLoggedIn()"}
|
||||
<ul class="errors">
|
||||
{loop="plugin_errors"}
|
||||
<li>{$value}</li>
|
||||
{/loop}
|
||||
</ul>
|
||||
{/if}</code></pre>
|
||||
<p><strong>includes.html</strong></p>
|
||||
<p>At the end of the file:</p>
|
||||
<div class="sourceCode"><pre class="sourceCode html"><code class="sourceCode html">{loop="$plugins_includes.css_files"}
|
||||
<span class="kw"><link</span><span class="ot"> type=</span><span class="st">"text/css"</span><span class="ot"> rel=</span><span class="st">"stylesheet"</span><span class="ot"> href=</span><span class="st">"{$value}#"</span><span class="kw">/></span>
|
||||
{/loop}</code></pre></div>
|
||||
<p><strong>page.footer.html</strong></p>
|
||||
<p>At the end of your footer notes:</p>
|
||||
<div class="sourceCode"><pre class="sourceCode html"><code class="sourceCode html">{loop="$plugins_footer.text"}
|
||||
{$value}
|
||||
{/loop}</code></pre></div>
|
||||
<p>At the end of file:</p>
|
||||
<div class="sourceCode"><pre class="sourceCode html"><code class="sourceCode html">{loop="$plugins_footer.js_files"}
|
||||
<span class="kw"><script</span><span class="ot"> src=</span><span class="st">"{$value}#"</span><span class="kw">></script></span>
|
||||
{/loop}</code></pre></div>
|
||||
<p><strong>linklist.html</strong></p>
|
||||
<p>After search fields:</p>
|
||||
<div class="sourceCode"><pre class="sourceCode html"><code class="sourceCode html">{loop="$plugins_header.fields_toolbar"}
|
||||
{$value}
|
||||
{/loop}</code></pre></div>
|
||||
<p>Before displaying the link list (after paging):</p>
|
||||
<div class="sourceCode"><pre class="sourceCode html"><code class="sourceCode html">{loop="$plugin_start_zone"}
|
||||
{$value}
|
||||
{/loop}</code></pre></div>
|
||||
<p>For every links (icons):</p>
|
||||
<div class="sourceCode"><pre class="sourceCode html"><code class="sourceCode html">{loop="$value.link_plugin"}
|
||||
<span class="kw"><span></span>{$value}<span class="kw"></span></span>
|
||||
{/loop}</code></pre></div>
|
||||
<p>Before end paging:</p>
|
||||
<div class="sourceCode"><pre class="sourceCode html"><code class="sourceCode html">{loop="$plugin_end_zone"}
|
||||
{$value}
|
||||
{/loop}</code></pre></div>
|
||||
<p><strong>linklist.paging.html</strong></p>
|
||||
<p>After the "private only" icon:</p>
|
||||
<div class="sourceCode"><pre class="sourceCode html"><code class="sourceCode html">{loop="$action_plugin"}
|
||||
{$value}
|
||||
{/loop}</code></pre></div>
|
||||
<p><strong>editlink.html</strong></p>
|
||||
<p>After tags field:</p>
|
||||
<div class="sourceCode"><pre class="sourceCode html"><code class="sourceCode html">{loop="$edit_link_plugin"}
|
||||
{$value}
|
||||
{/loop}</code></pre></div>
|
||||
<p><strong>tools.html</strong></p>
|
||||
<p>After the last tool:</p>
|
||||
<div class="sourceCode"><pre class="sourceCode html"><code class="sourceCode html">{loop="$tools_plugin"}
|
||||
{$value}
|
||||
{/loop}</code></pre></div>
|
||||
<p><strong>picwall.html</strong></p>
|
||||
<p>Top:</p>
|
||||
<div class="sourceCode"><pre class="sourceCode html"><code class="sourceCode html"><span class="kw"><div</span><span class="ot"> id=</span><span class="st">"plugin_zone_start_picwall"</span><span class="ot"> class=</span><span class="st">"plugin_zone"</span><span class="kw">></span>
|
||||
{loop="$plugin_start_zone"}
|
||||
{$value}
|
||||
{/loop}
|
||||
<span class="kw"></div></span></code></pre></div>
|
||||
<p>Bottom:</p>
|
||||
<div class="sourceCode"><pre class="sourceCode html"><code class="sourceCode html"><span class="kw"><div</span><span class="ot"> id=</span><span class="st">"plugin_zone_end_picwall"</span><span class="ot"> class=</span><span class="st">"plugin_zone"</span><span class="kw">></span>
|
||||
{loop="$plugin_end_zone"}
|
||||
{$value}
|
||||
{/loop}
|
||||
<span class="kw"></div></span></code></pre></div>
|
||||
<p><strong>tagcloud.html</strong></p>
|
||||
<p>Top:</p>
|
||||
<div class="sourceCode"><pre class="sourceCode html"><code class="sourceCode html"> <span class="kw"><div</span><span class="ot"> id=</span><span class="st">"plugin_zone_start_tagcloud"</span><span class="ot"> class=</span><span class="st">"plugin_zone"</span><span class="kw">></span>
|
||||
{loop="$plugin_start_zone"}
|
||||
{$value}
|
||||
{/loop}
|
||||
<span class="kw"></div></span></code></pre></div>
|
||||
<p>Bottom:</p>
|
||||
<div class="sourceCode"><pre class="sourceCode html"><code class="sourceCode html"> <span class="kw"><div</span><span class="ot"> id=</span><span class="st">"plugin_zone_end_tagcloud"</span><span class="ot"> class=</span><span class="st">"plugin_zone"</span><span class="kw">></span>
|
||||
{loop="$plugin_end_zone"}
|
||||
{$value}
|
||||
{/loop}
|
||||
<span class="kw"></div></span></code></pre></div>
|
||||
<p><strong>daily.html</strong></p>
|
||||
<p>Top:</p>
|
||||
<div class="sourceCode"><pre class="sourceCode html"><code class="sourceCode html"><span class="kw"><div</span><span class="ot"> id=</span><span class="st">"plugin_zone_start_picwall"</span><span class="ot"> class=</span><span class="st">"plugin_zone"</span><span class="kw">></span>
|
||||
{loop="$plugin_start_zone"}
|
||||
{$value}
|
||||
{/loop}
|
||||
<span class="kw"></div></span></code></pre></div>
|
||||
<p>After every link:</p>
|
||||
<div class="sourceCode"><pre class="sourceCode html"><code class="sourceCode html"><span class="kw"><div</span><span class="ot"> class=</span><span class="st">"dailyEntryFooter"</span><span class="kw">></span>
|
||||
{loop="$link.link_plugin"}
|
||||
{$value}
|
||||
{/loop}
|
||||
<span class="kw"></div></span></code></pre></div>
|
||||
<p>Bottom:</p>
|
||||
<div class="sourceCode"><pre class="sourceCode html"><code class="sourceCode html"><span class="kw"><div</span><span class="ot"> id=</span><span class="st">"plugin_zone_end_picwall"</span><span class="ot"> class=</span><span class="st">"plugin_zone"</span><span class="kw">></span>
|
||||
{loop="$plugin_end_zone"}
|
||||
{$value}
|
||||
{/loop}
|
||||
<span class="kw"></div></span></code></pre></div>
|
||||
<p><strong>feed.atom.xml</strong> and <strong>feed.rss.xml</strong>:</p>
|
||||
<p>In headers tags section:</p>
|
||||
<div class="sourceCode"><pre class="sourceCode xml"><code class="sourceCode xml">{loop="$feed_plugins_header"}
|
||||
{$value}
|
||||
{/loop}</code></pre></div>
|
||||
<p>After each entry:</p>
|
||||
<div class="sourceCode"><pre class="sourceCode xml"><code class="sourceCode xml">{loop="$value.feed_plugins"}
|
||||
{$value}
|
||||
{/loop}</code></pre></div>
|
||||
</body>
|
||||
</html>
|
155
doc/Plugins.html
155
doc/Plugins.html
|
@ -1,155 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="generator" content="pandoc">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">
|
||||
<title>Shaarli – Plugins</title>
|
||||
<style type="text/css">code{white-space: pre;}</style>
|
||||
<style type="text/css">
|
||||
div.sourceCode { overflow-x: auto; }
|
||||
table.sourceCode, tr.sourceCode, td.lineNumbers, td.sourceCode {
|
||||
margin: 0; padding: 0; vertical-align: baseline; border: none; }
|
||||
table.sourceCode { width: 100%; line-height: 100%; }
|
||||
td.lineNumbers { text-align: right; padding-right: 4px; padding-left: 4px; color: #aaaaaa; border-right: 1px solid #aaaaaa; }
|
||||
td.sourceCode { padding-left: 5px; }
|
||||
code > span.kw { color: #007020; font-weight: bold; } /* Keyword */
|
||||
code > span.dt { color: #902000; } /* DataType */
|
||||
code > span.dv { color: #40a070; } /* DecVal */
|
||||
code > span.bn { color: #40a070; } /* BaseN */
|
||||
code > span.fl { color: #40a070; } /* Float */
|
||||
code > span.ch { color: #4070a0; } /* Char */
|
||||
code > span.st { color: #4070a0; } /* String */
|
||||
code > span.co { color: #60a0b0; font-style: italic; } /* Comment */
|
||||
code > span.ot { color: #007020; } /* Other */
|
||||
code > span.al { color: #ff0000; font-weight: bold; } /* Alert */
|
||||
code > span.fu { color: #06287e; } /* Function */
|
||||
code > span.er { color: #ff0000; font-weight: bold; } /* Error */
|
||||
code > span.wa { color: #60a0b0; font-weight: bold; font-style: italic; } /* Warning */
|
||||
code > span.cn { color: #880000; } /* Constant */
|
||||
code > span.sc { color: #4070a0; } /* SpecialChar */
|
||||
code > span.vs { color: #4070a0; } /* VerbatimString */
|
||||
code > span.ss { color: #bb6688; } /* SpecialString */
|
||||
code > span.im { } /* Import */
|
||||
code > span.va { color: #19177c; } /* Variable */
|
||||
code > span.cf { color: #007020; font-weight: bold; } /* ControlFlow */
|
||||
code > span.op { color: #666666; } /* Operator */
|
||||
code > span.bu { } /* BuiltIn */
|
||||
code > span.ex { } /* Extension */
|
||||
code > span.pp { color: #bc7a00; } /* Preprocessor */
|
||||
code > span.at { color: #7d9029; } /* Attribute */
|
||||
code > span.do { color: #ba2121; font-style: italic; } /* Documentation */
|
||||
code > span.an { color: #60a0b0; font-weight: bold; font-style: italic; } /* Annotation */
|
||||
code > span.cv { color: #60a0b0; font-weight: bold; font-style: italic; } /* CommentVar */
|
||||
code > span.in { color: #60a0b0; font-weight: bold; font-style: italic; } /* Information */
|
||||
</style>
|
||||
<link rel="stylesheet" href="github-markdown.css">
|
||||
<!--[if lt IE 9]>
|
||||
<script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv-printshiv.min.js"></script>
|
||||
<![endif]-->
|
||||
</head>
|
||||
<body>
|
||||
<div id="local-sidebar">
|
||||
<ul>
|
||||
<li><a href="Home.html">Home</a></li>
|
||||
<li>Setup
|
||||
<ul>
|
||||
<li><a href="Download-and-Installation.html">Download and Installation</a></li>
|
||||
<li><a href="Upgrade-and-migration.html">Upgrade and migration</a></li>
|
||||
<li><a href="Server-requirements.html">Server requirements</a></li>
|
||||
<li><a href="Server-configuration.html">Server configuration</a></li>
|
||||
<li><a href="Server-security.html">Server security</a></li>
|
||||
<li><a href="Shaarli-configuration.html">Shaarli configuration</a></li>
|
||||
<li><a href="Plugins.html">Plugins</a></li>
|
||||
</ul></li>
|
||||
<li><a href="Docker.html">Docker</a></li>
|
||||
<li><a href="Usage.html">Usage</a>
|
||||
<ul>
|
||||
<li><a href="Sharing-button.html">Sharing button</a> (bookmarklet)</li>
|
||||
<li><a href="Browsing-and-Searching.html">Browsing and Searching</a></li>
|
||||
<li><a href="Firefox-share.html">Firefox share</a></li>
|
||||
<li><a href="RSS-feeds.html">RSS feeds</a></li>
|
||||
<li><a href="REST-API.html">REST API</a></li>
|
||||
</ul></li>
|
||||
<li>How To
|
||||
<ul>
|
||||
<li><a href="Backup,-restore,-import-and-export.html">Backup, restore, import and export</a></li>
|
||||
<li><a href="Copy-an-existing-installation-over-SSH-and-serve-it-locally.html">Copy an existing installation over SSH and serve it locally</a></li>
|
||||
<li><a href="Create-and-serve-multiple-Shaarlis-(farm).html">Create and serve multiple Shaarlis (farm)</a></li>
|
||||
<li><a href="Download-CSS-styles-from-an-OPML-list.html">Download CSS styles from an OPML list</a></li>
|
||||
<li><a href="Datastore-hacks.html">Datastore hacks</a></li>
|
||||
</ul></li>
|
||||
<li><a href="Troubleshooting.html">Troubleshooting</a></li>
|
||||
<li><a href="Development.html">Development</a>
|
||||
<ul>
|
||||
<li><a href="GnuPG-signature.html">GnuPG signature</a></li>
|
||||
<li><a href="Coding-guidelines.html">Coding guidelines</a></li>
|
||||
<li><a href="Directory-structure.html">Directory structure</a></li>
|
||||
<li><a href="3rd-party-libraries.html">3rd party libraries</a></li>
|
||||
<li><a href="Plugin-System.html">Plugin System</a></li>
|
||||
<li><a href="Release-Shaarli.html">Release Shaarli</a></li>
|
||||
<li><a href="Versioning-and-Branches.html">Versioning and Branches</a></li>
|
||||
<li><a href="Security.html">Security</a></li>
|
||||
<li><a href="Static-analysis.html">Static analysis</a></li>
|
||||
<li><a href="Theming.html">Theming</a></li>
|
||||
<li><a href="Unit-tests.html">Unit tests</a></li>
|
||||
</ul></li>
|
||||
<li>About
|
||||
<ul>
|
||||
<li><a href="FAQ.html">FAQ</a></li>
|
||||
<li><a href="Community-&-Related-software.html">Community & Related software</a></li>
|
||||
</ul></li>
|
||||
</ul>
|
||||
</div>
|
||||
<h1 id="plugins">Plugins</h1>
|
||||
<h2 id="plugin-installation">Plugin installation</h2>
|
||||
<p>There is a bunch of plugins shipped with Shaarli, where there is nothing to do to install them.</p>
|
||||
<p>If you want to install a third party plugin:</p>
|
||||
<ul>
|
||||
<li>Download it.</li>
|
||||
<li>Put it in the <code>plugins</code> directory in Shaarli's installation folder.</li>
|
||||
<li>Make sure you put it correctly:</li>
|
||||
</ul>
|
||||
<pre><code>| index.php
|
||||
| plugins/
|
||||
|---| custom_plugin/
|
||||
| |---| custom_plugin.php
|
||||
| |---| ...
|
||||
</code></pre>
|
||||
<ul>
|
||||
<li>Make sure your webserver can read and write the files in your plugin folder.</li>
|
||||
</ul>
|
||||
<h2 id="plugin-configuration">Plugin configuration</h2>
|
||||
<p>In Shaarli's administration page (<code>Tools</code> link), go to <code>Plugin administration</code>.</p>
|
||||
<p>Here you can enable and disable all plugins available, and configure them.</p>
|
||||
<p><img src="https://camo.githubusercontent.com/5da68e191969007492ca0fbeb25f3b2357b748cc/687474703a2f2f692e696d6775722e636f6d2f766837544643712e706e67" alt="administration screenshot" /><a href=".html"></a></p>
|
||||
<h2 id="plugin-order">Plugin order</h2>
|
||||
<p>In the plugin administration page, you can move enabled plugins to the top or bottom of the list. The first plugins in the list will be processed first.</p>
|
||||
<p>This is important in case plugins are depending on each other. Read plugins README details for more information.</p>
|
||||
<p><strong>Use case</strong>: The (non existent) plugin <code>shaares_footer</code> adds a footer to every shaare in Markdown syntax. It needs to be processed <em>before</em> (higher in the list) the Markdown plugin. Otherwise its syntax won't be translated in HTML.</p>
|
||||
<h2 id="file-mode">File mode</h2>
|
||||
<p>Enabled plugin are stored in your <code>config.php</code> parameters file, under the <code>array</code>:</p>
|
||||
<div class="sourceCode"><pre class="sourceCode php"><code class="sourceCode php"><span class="kw">$GLOBALS</span><span class="ot">[</span><span class="st">'config'</span><span class="ot">[</span><span class="st">'ENABLED_PLUGINS'</span><span class="ot">]](</span><span class="st">'ENABLED_PLUGINS'</span><span class="ot">]</span>.html<span class="ot">)</span></code></pre></div>
|
||||
<p>You can edit them manually here.<br />
|
||||
Example:</p>
|
||||
<div class="sourceCode"><pre class="sourceCode php"><code class="sourceCode php"><span class="kw">$GLOBALS</span><span class="ot">[</span><span class="st">'config'</span><span class="ot">[</span><span class="st">'ENABLED_PLUGINS'</span><span class="ot">]</span> = <span class="fu">array</span><span class="ot">(](</span><span class="st">'ENABLED_PLUGINS'</span><span class="ot">]</span>-=-<span class="fu">array</span><span class="ot">(</span>.html<span class="ot">)</span>
|
||||
<span class="st">'qrcode'</span><span class="ot">,</span>
|
||||
<span class="st">'archiveorg'</span><span class="ot">,</span>
|
||||
<span class="st">'wallabag'</span><span class="ot">,</span>
|
||||
<span class="st">'markdown'</span><span class="ot">,</span>
|
||||
<span class="ot">);</span></code></pre></div>
|
||||
<h3 id="plugin-usage">Plugin usage</h3>
|
||||
<h4 id="official-plugins">Official plugins</h4>
|
||||
<p>Usage of each plugin is documented in it's README file:</p>
|
||||
<ul>
|
||||
<li><code>addlink-toolbar</code>: Adds the addlink input on the linklist page</li>
|
||||
<li><code>archiveorg</code>: For each link, add an Archive.org icon</li>
|
||||
<li><a href="https://github.com/shaarli/Shaarli/blob/master/plugins/markdown/README.md"><code>markdown</code></a>: Render shaare description with Markdown syntax.<a href=".html"></a></li>
|
||||
<li><a href="https://github.com/shaarli/Shaarli/blob/master/plugins/playvideos/README.md"><code>playvideos</code></a>: Add a button in the toolbar allowing to watch all videos.<a href=".html"></a></li>
|
||||
<li><code>qrcode</code>: For each link, add a QRCode icon.</li>
|
||||
<li><a href="https://github.com/shaarli/Shaarli/blob/master/plugins/wallabag/README.md"><code>wallabag</code></a>: For each link, add a Wallabag icon to save it in your instance.<a href=".html"></a></li>
|
||||
</ul>
|
||||
<h4 id="third-party-plugins">Third party plugins</h4>
|
||||
<p>See <a href="https://github.com/shaarli/Shaarli/wiki/Community-%26-Related-software#third-party-plugins">Community & related software</a><a href=".html"></a></p>
|
||||
</body>
|
||||
</html>
|
|
@ -1,169 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="generator" content="pandoc">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">
|
||||
<title>Shaarli – REST API</title>
|
||||
<style type="text/css">code{white-space: pre;}</style>
|
||||
<style type="text/css">
|
||||
div.sourceCode { overflow-x: auto; }
|
||||
table.sourceCode, tr.sourceCode, td.lineNumbers, td.sourceCode {
|
||||
margin: 0; padding: 0; vertical-align: baseline; border: none; }
|
||||
table.sourceCode { width: 100%; line-height: 100%; }
|
||||
td.lineNumbers { text-align: right; padding-right: 4px; padding-left: 4px; color: #aaaaaa; border-right: 1px solid #aaaaaa; }
|
||||
td.sourceCode { padding-left: 5px; }
|
||||
code > span.kw { color: #007020; font-weight: bold; } /* Keyword */
|
||||
code > span.dt { color: #902000; } /* DataType */
|
||||
code > span.dv { color: #40a070; } /* DecVal */
|
||||
code > span.bn { color: #40a070; } /* BaseN */
|
||||
code > span.fl { color: #40a070; } /* Float */
|
||||
code > span.ch { color: #4070a0; } /* Char */
|
||||
code > span.st { color: #4070a0; } /* String */
|
||||
code > span.co { color: #60a0b0; font-style: italic; } /* Comment */
|
||||
code > span.ot { color: #007020; } /* Other */
|
||||
code > span.al { color: #ff0000; font-weight: bold; } /* Alert */
|
||||
code > span.fu { color: #06287e; } /* Function */
|
||||
code > span.er { color: #ff0000; font-weight: bold; } /* Error */
|
||||
code > span.wa { color: #60a0b0; font-weight: bold; font-style: italic; } /* Warning */
|
||||
code > span.cn { color: #880000; } /* Constant */
|
||||
code > span.sc { color: #4070a0; } /* SpecialChar */
|
||||
code > span.vs { color: #4070a0; } /* VerbatimString */
|
||||
code > span.ss { color: #bb6688; } /* SpecialString */
|
||||
code > span.im { } /* Import */
|
||||
code > span.va { color: #19177c; } /* Variable */
|
||||
code > span.cf { color: #007020; font-weight: bold; } /* ControlFlow */
|
||||
code > span.op { color: #666666; } /* Operator */
|
||||
code > span.bu { } /* BuiltIn */
|
||||
code > span.ex { } /* Extension */
|
||||
code > span.pp { color: #bc7a00; } /* Preprocessor */
|
||||
code > span.at { color: #7d9029; } /* Attribute */
|
||||
code > span.do { color: #ba2121; font-style: italic; } /* Documentation */
|
||||
code > span.an { color: #60a0b0; font-weight: bold; font-style: italic; } /* Annotation */
|
||||
code > span.cv { color: #60a0b0; font-weight: bold; font-style: italic; } /* CommentVar */
|
||||
code > span.in { color: #60a0b0; font-weight: bold; font-style: italic; } /* Information */
|
||||
</style>
|
||||
<link rel="stylesheet" href="github-markdown.css">
|
||||
<!--[if lt IE 9]>
|
||||
<script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv-printshiv.min.js"></script>
|
||||
<![endif]-->
|
||||
</head>
|
||||
<body>
|
||||
<div id="local-sidebar">
|
||||
<ul>
|
||||
<li><a href="Home.html">Home</a></li>
|
||||
<li>Setup
|
||||
<ul>
|
||||
<li><a href="Download-and-Installation.html">Download and Installation</a></li>
|
||||
<li><a href="Upgrade-and-migration.html">Upgrade and migration</a></li>
|
||||
<li><a href="Server-requirements.html">Server requirements</a></li>
|
||||
<li><a href="Server-configuration.html">Server configuration</a></li>
|
||||
<li><a href="Server-security.html">Server security</a></li>
|
||||
<li><a href="Shaarli-configuration.html">Shaarli configuration</a></li>
|
||||
<li><a href="Plugins.html">Plugins</a></li>
|
||||
</ul></li>
|
||||
<li><a href="Docker.html">Docker</a></li>
|
||||
<li><a href="Usage.html">Usage</a>
|
||||
<ul>
|
||||
<li><a href="Sharing-button.html">Sharing button</a> (bookmarklet)</li>
|
||||
<li><a href="Browsing-and-Searching.html">Browsing and Searching</a></li>
|
||||
<li><a href="Firefox-share.html">Firefox share</a></li>
|
||||
<li><a href="RSS-feeds.html">RSS feeds</a></li>
|
||||
<li><a href="REST-API.html">REST API</a></li>
|
||||
</ul></li>
|
||||
<li>How To
|
||||
<ul>
|
||||
<li><a href="Backup,-restore,-import-and-export.html">Backup, restore, import and export</a></li>
|
||||
<li><a href="Copy-an-existing-installation-over-SSH-and-serve-it-locally.html">Copy an existing installation over SSH and serve it locally</a></li>
|
||||
<li><a href="Create-and-serve-multiple-Shaarlis-(farm).html">Create and serve multiple Shaarlis (farm)</a></li>
|
||||
<li><a href="Download-CSS-styles-from-an-OPML-list.html">Download CSS styles from an OPML list</a></li>
|
||||
<li><a href="Datastore-hacks.html">Datastore hacks</a></li>
|
||||
</ul></li>
|
||||
<li><a href="Troubleshooting.html">Troubleshooting</a></li>
|
||||
<li><a href="Development.html">Development</a>
|
||||
<ul>
|
||||
<li><a href="GnuPG-signature.html">GnuPG signature</a></li>
|
||||
<li><a href="Coding-guidelines.html">Coding guidelines</a></li>
|
||||
<li><a href="Directory-structure.html">Directory structure</a></li>
|
||||
<li><a href="3rd-party-libraries.html">3rd party libraries</a></li>
|
||||
<li><a href="Plugin-System.html">Plugin System</a></li>
|
||||
<li><a href="Release-Shaarli.html">Release Shaarli</a></li>
|
||||
<li><a href="Versioning-and-Branches.html">Versioning and Branches</a></li>
|
||||
<li><a href="Security.html">Security</a></li>
|
||||
<li><a href="Static-analysis.html">Static analysis</a></li>
|
||||
<li><a href="Theming.html">Theming</a></li>
|
||||
<li><a href="Unit-tests.html">Unit tests</a></li>
|
||||
</ul></li>
|
||||
<li>About
|
||||
<ul>
|
||||
<li><a href="FAQ.html">FAQ</a></li>
|
||||
<li><a href="Community-&-Related-software.html">Community & Related software</a></li>
|
||||
</ul></li>
|
||||
</ul>
|
||||
</div>
|
||||
<h1 id="rest-api">REST API</h1>
|
||||
<h2 id="usage">Usage</h2>
|
||||
<p>See the <a href="http://shaarli.github.io/api-documentation/">REST API documentation</a>.<a href=".html"></a></p>
|
||||
<h2 id="authentication">Authentication</h2>
|
||||
<p>All requests to Shaarli's API must include a JWT token to verify their authenticity.</p>
|
||||
<p>This token has to be included as an HTTP header called <code>Authentication: Bearer <jwt token></code>.</p>
|
||||
<p>JWT resources :</p>
|
||||
<ul>
|
||||
<li><a href="https://jwt.io">jwt.io</a> (including a list of client per language).<a href=".html"></a></li>
|
||||
<li>RFC : <a href="https://tools.ietf.org/html/rfc7519" class="uri">https://tools.ietf.org/html/rfc7519</a></li>
|
||||
<li><a href="https://float-middle.com/json-web-tokens-jwt-vs-sessions/" class="uri">https://float-middle.com/json-web-tokens-jwt-vs-sessions/</a></li>
|
||||
<li>HackerNews thread: <a href="https://news.ycombinator.com/item?id=11929267" class="uri">https://news.ycombinator.com/item?id=11929267</a></li>
|
||||
</ul>
|
||||
<h3 id="shaarli-jwt-token">Shaarli JWT Token</h3>
|
||||
<p>JWT tokens are composed by three parts, separated by a dot <code>.</code> and encoded in base64:</p>
|
||||
<pre><code>[header].[payload].[signature][](.html)</code></pre>
|
||||
<h4 id="header">Header</h4>
|
||||
<p>Shaarli only allow one hash algorithm, so the header will always be the same:</p>
|
||||
<div class="sourceCode"><pre class="sourceCode json"><code class="sourceCode json"><span class="fu">{</span>
|
||||
<span class="dt">"typ"</span><span class="fu">:</span> <span class="st">"JWT"</span><span class="fu">,</span>
|
||||
<span class="dt">"alg"</span><span class="fu">:</span> <span class="st">"HS512"</span>
|
||||
<span class="fu">}</span></code></pre></div>
|
||||
<p>Encoded in base64, it gives:</p>
|
||||
<pre><code>ewogICAgICAgICJ0eXAiOiAiSldUIiwKICAgICAgICAiYWxnIjogIkhTNTEyIgogICAgfQ==</code></pre>
|
||||
<h4 id="payload">Payload</h4>
|
||||
<p><strong>Validity duration</strong></p>
|
||||
<p>To avoid infinite token validity, JWT tokens must include their creation date in UNIX timestamp format (timezone independant - UTC) under the key <code>iat</code> (issued at). This token will be accepted during 9 minutes.</p>
|
||||
<div class="sourceCode"><pre class="sourceCode json"><code class="sourceCode json"><span class="fu">{</span>
|
||||
<span class="dt">"iat"</span><span class="fu">:</span> <span class="dv">1468663519</span>
|
||||
<span class="fu">}</span></code></pre></div>
|
||||
<p>See <a href="https://tools.ietf.org/html/rfc7519#section-4.1.6">RFC reference</a>.<a href=".html"></a></p>
|
||||
<h4 id="signature">Signature</h4>
|
||||
<p>The signature authenticate the token validity. It contains the base64 of the header and the body, separated by a dot <code>.</code>, hashed in SHA512 with the API secret available in Shaarli administration page.</p>
|
||||
<p>Signature example with PHP:</p>
|
||||
<div class="sourceCode"><pre class="sourceCode php"><code class="sourceCode php"><span class="kw">$content</span> = <span class="fu">base64_encode</span><span class="ot">(</span><span class="kw">$header</span><span class="ot">)</span> . <span class="st">'.'</span> . <span class="fu">base64_encode</span><span class="ot">(</span><span class="kw">$payload</span><span class="ot">);</span>
|
||||
<span class="kw">$signature</span> = <span class="fu">hash_hmac</span><span class="ot">(</span><span class="st">'sha512'</span><span class="ot">,</span> <span class="kw">$content</span><span class="ot">,</span> <span class="kw">$secret</span><span class="ot">);</span></code></pre></div>
|
||||
<h3 id="complete-example">Complete example</h3>
|
||||
<h4 id="php">PHP</h4>
|
||||
<div class="sourceCode"><pre class="sourceCode php"><code class="sourceCode php"><span class="kw">function</span> generateToken<span class="ot">(</span><span class="kw">$secret</span><span class="ot">)</span> {
|
||||
<span class="kw">$header</span> = <span class="fu">base64_encode</span><span class="ot">(</span><span class="st">'{</span>
|
||||
<span class="st"> "typ": "JWT",</span>
|
||||
<span class="st"> "alg": "HS512"</span>
|
||||
<span class="st"> }'</span><span class="ot">);</span>
|
||||
<span class="kw">$payload</span> = <span class="fu">base64_encode</span><span class="ot">(</span><span class="st">'{</span>
|
||||
<span class="st"> "iat": '</span>. <span class="fu">time</span><span class="ot">()</span> .<span class="st">'</span>
|
||||
<span class="st"> }'</span><span class="ot">);</span>
|
||||
<span class="kw">$signature</span> = <span class="fu">hash_hmac</span><span class="ot">(</span><span class="st">'sha512'</span><span class="ot">,</span> <span class="kw">$header</span> .<span class="st">'.'</span>. <span class="kw">$payload</span> <span class="ot">,</span> <span class="kw">$secret</span><span class="ot">);</span>
|
||||
<span class="kw">return</span> <span class="kw">$header</span> .<span class="st">'.'</span>. <span class="kw">$payload</span> .<span class="st">'.'</span>. <span class="kw">$signature</span><span class="ot">;</span>
|
||||
}
|
||||
|
||||
<span class="kw">$secret</span> = <span class="st">'mysecret'</span><span class="ot">;</span>
|
||||
<span class="kw">$token</span> = generateToken<span class="ot">(</span><span class="kw">$secret</span><span class="ot">);</span>
|
||||
<span class="fu">echo</span> <span class="kw">$token</span><span class="ot">;</span></code></pre></div>
|
||||
<blockquote>
|
||||
<p><code>ewogICAgICAgICJ0eXAiOiAiSldUIiwKICAgICAgICAiYWxnIjogIkhTNTEyIgogICAgfQ==.ewogICAgICAgICJpYXQiOiAxNDY4NjY3MDQ3CiAgICB9.1d2c54fa947daf594fdbf7591796195652c8bc63bffad7f6a6db2a41c313f495a542cbfb595acade79e83f3810d709b4251d7b940bbc10b531a6e6134af63a68</code></p>
|
||||
</blockquote>
|
||||
<div class="sourceCode"><pre class="sourceCode php"><code class="sourceCode php"><span class="kw">$options</span> = <span class="ot">[[](</span>.html<span class="ot">)</span>
|
||||
<span class="st">'http'</span> => <span class="ot">[[](</span>.html<span class="ot">)</span>
|
||||
<span class="st">'method'</span> => <span class="st">'GET'</span><span class="ot">,</span>
|
||||
<span class="st">'jwt'</span> => <span class="kw">$token</span><span class="ot">,</span>
|
||||
<span class="ot">],</span>
|
||||
<span class="ot">];</span>
|
||||
<span class="kw">$context</span> = <span class="fu">stream_context_create</span><span class="ot">(</span><span class="kw">$options</span><span class="ot">);</span>
|
||||
<span class="fu">file_get_contents</span><span class="ot">(</span><span class="kw">$apiEndpoint</span><span class="ot">,</span> <span class="kw">false</span><span class="ot">,</span> <span class="kw">$context</span><span class="ot">);</span></code></pre></div>
|
||||
</body>
|
||||
</html>
|
|
@ -1,99 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="generator" content="pandoc">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">
|
||||
<title>Shaarli – RSS feeds</title>
|
||||
<style type="text/css">code{white-space: pre;}</style>
|
||||
<link rel="stylesheet" href="github-markdown.css">
|
||||
<!--[if lt IE 9]>
|
||||
<script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv-printshiv.min.js"></script>
|
||||
<![endif]-->
|
||||
</head>
|
||||
<body>
|
||||
<div id="local-sidebar">
|
||||
<ul>
|
||||
<li><a href="Home.html">Home</a></li>
|
||||
<li>Setup
|
||||
<ul>
|
||||
<li><a href="Download-and-Installation.html">Download and Installation</a></li>
|
||||
<li><a href="Upgrade-and-migration.html">Upgrade and migration</a></li>
|
||||
<li><a href="Server-requirements.html">Server requirements</a></li>
|
||||
<li><a href="Server-configuration.html">Server configuration</a></li>
|
||||
<li><a href="Server-security.html">Server security</a></li>
|
||||
<li><a href="Shaarli-configuration.html">Shaarli configuration</a></li>
|
||||
<li><a href="Plugins.html">Plugins</a></li>
|
||||
</ul></li>
|
||||
<li><a href="Docker.html">Docker</a></li>
|
||||
<li><a href="Usage.html">Usage</a>
|
||||
<ul>
|
||||
<li><a href="Sharing-button.html">Sharing button</a> (bookmarklet)</li>
|
||||
<li><a href="Browsing-and-Searching.html">Browsing and Searching</a></li>
|
||||
<li><a href="Firefox-share.html">Firefox share</a></li>
|
||||
<li><a href="RSS-feeds.html">RSS feeds</a></li>
|
||||
<li><a href="REST-API.html">REST API</a></li>
|
||||
</ul></li>
|
||||
<li>How To
|
||||
<ul>
|
||||
<li><a href="Backup,-restore,-import-and-export.html">Backup, restore, import and export</a></li>
|
||||
<li><a href="Copy-an-existing-installation-over-SSH-and-serve-it-locally.html">Copy an existing installation over SSH and serve it locally</a></li>
|
||||
<li><a href="Create-and-serve-multiple-Shaarlis-(farm).html">Create and serve multiple Shaarlis (farm)</a></li>
|
||||
<li><a href="Download-CSS-styles-from-an-OPML-list.html">Download CSS styles from an OPML list</a></li>
|
||||
<li><a href="Datastore-hacks.html">Datastore hacks</a></li>
|
||||
</ul></li>
|
||||
<li><a href="Troubleshooting.html">Troubleshooting</a></li>
|
||||
<li><a href="Development.html">Development</a>
|
||||
<ul>
|
||||
<li><a href="GnuPG-signature.html">GnuPG signature</a></li>
|
||||
<li><a href="Coding-guidelines.html">Coding guidelines</a></li>
|
||||
<li><a href="Directory-structure.html">Directory structure</a></li>
|
||||
<li><a href="3rd-party-libraries.html">3rd party libraries</a></li>
|
||||
<li><a href="Plugin-System.html">Plugin System</a></li>
|
||||
<li><a href="Release-Shaarli.html">Release Shaarli</a></li>
|
||||
<li><a href="Versioning-and-Branches.html">Versioning and Branches</a></li>
|
||||
<li><a href="Security.html">Security</a></li>
|
||||
<li><a href="Static-analysis.html">Static analysis</a></li>
|
||||
<li><a href="Theming.html">Theming</a></li>
|
||||
<li><a href="Unit-tests.html">Unit tests</a></li>
|
||||
</ul></li>
|
||||
<li>About
|
||||
<ul>
|
||||
<li><a href="FAQ.html">FAQ</a></li>
|
||||
<li><a href="Community-&-Related-software.html">Community & Related software</a></li>
|
||||
</ul></li>
|
||||
</ul>
|
||||
</div>
|
||||
<h1 id="rss-feeds">RSS feeds</h1>
|
||||
<h3 id="feeds-options">Feeds options</h3>
|
||||
<p>Feeds are available in ATOM with <code>?do=atom</code> and RSS with <code>do=RSS</code>.</p>
|
||||
<p>Options:</p>
|
||||
<ul>
|
||||
<li>You can use <code>permalinks</code> in the feed URL to get permalink to Shaares instead of direct link to shaared URL.
|
||||
<ul>
|
||||
<li>E.G. <code>https://my.shaarli.domain/?do=atom&permalinks</code>.</li>
|
||||
</ul></li>
|
||||
<li>You can use <code>nb</code> parameter in the feed URL to specify the number of Shaares you want in a feed (default if not specified: <code>50</code>). The keyword <code>all</code> is available if you want everything.
|
||||
<ul>
|
||||
<li><code>https://my.shaarli.domain/?do=atom&permalinks&nb=42</code></li>
|
||||
<li><code>https://my.shaarli.domain/?do=atom&permalinks&nb=all</code></li>
|
||||
</ul></li>
|
||||
</ul>
|
||||
<h3 id="rss-feeds-or-picture-wall-for-a-specific-searchtag">RSS Feeds or Picture Wall for a specific search/tag</h3>
|
||||
<p>It is possible to filter RSS/ATOM feeds and Picture Wall on a Shaarli to <strong>only display results of a specific search, or for a specific tag</strong>.</p>
|
||||
<p>For example, if you want to subscribe only to links tagged <code>photography</code>:</p>
|
||||
<ul>
|
||||
<li>Go to the desired Shaarli instance.</li>
|
||||
<li>Search for the <code>photography</code> tag in the <em>Filter by tag</em> box. Links tagged <code>photography</code> are displayed.</li>
|
||||
<li>Click on the <code>RSS Feed</code> button.</li>
|
||||
<li>You are presented with an RSS feed showing only these links. Subscribe to it to receive only updates with this tag.</li>
|
||||
<li>The same method <strong>also works for a full-text search</strong> (<em>Search</em> box) <strong>and for the Picture Wall</strong> (want to only see pictures about <code>nature</code>?)</li>
|
||||
<li>You can also build the URLs manually:
|
||||
<ul>
|
||||
<li><code>https://my.shaarli.domain/?do=rss&searchtags=nature</code></li>
|
||||
<li><code>https://my.shaarli.domain/links/?do=picwall&searchterm=poney</code></li>
|
||||
</ul></li>
|
||||
</ul>
|
||||
<p><embed src="(images/rss-filter-1.png)-!.html" />(images/rss-filter-2.png)</p>
|
||||
</body>
|
||||
</html>
|
|
@ -1,224 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="generator" content="pandoc">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">
|
||||
<title>Shaarli – Release Shaarli</title>
|
||||
<style type="text/css">code{white-space: pre;}</style>
|
||||
<style type="text/css">
|
||||
div.sourceCode { overflow-x: auto; }
|
||||
table.sourceCode, tr.sourceCode, td.lineNumbers, td.sourceCode {
|
||||
margin: 0; padding: 0; vertical-align: baseline; border: none; }
|
||||
table.sourceCode { width: 100%; line-height: 100%; }
|
||||
td.lineNumbers { text-align: right; padding-right: 4px; padding-left: 4px; color: #aaaaaa; border-right: 1px solid #aaaaaa; }
|
||||
td.sourceCode { padding-left: 5px; }
|
||||
code > span.kw { color: #007020; font-weight: bold; } /* Keyword */
|
||||
code > span.dt { color: #902000; } /* DataType */
|
||||
code > span.dv { color: #40a070; } /* DecVal */
|
||||
code > span.bn { color: #40a070; } /* BaseN */
|
||||
code > span.fl { color: #40a070; } /* Float */
|
||||
code > span.ch { color: #4070a0; } /* Char */
|
||||
code > span.st { color: #4070a0; } /* String */
|
||||
code > span.co { color: #60a0b0; font-style: italic; } /* Comment */
|
||||
code > span.ot { color: #007020; } /* Other */
|
||||
code > span.al { color: #ff0000; font-weight: bold; } /* Alert */
|
||||
code > span.fu { color: #06287e; } /* Function */
|
||||
code > span.er { color: #ff0000; font-weight: bold; } /* Error */
|
||||
code > span.wa { color: #60a0b0; font-weight: bold; font-style: italic; } /* Warning */
|
||||
code > span.cn { color: #880000; } /* Constant */
|
||||
code > span.sc { color: #4070a0; } /* SpecialChar */
|
||||
code > span.vs { color: #4070a0; } /* VerbatimString */
|
||||
code > span.ss { color: #bb6688; } /* SpecialString */
|
||||
code > span.im { } /* Import */
|
||||
code > span.va { color: #19177c; } /* Variable */
|
||||
code > span.cf { color: #007020; font-weight: bold; } /* ControlFlow */
|
||||
code > span.op { color: #666666; } /* Operator */
|
||||
code > span.bu { } /* BuiltIn */
|
||||
code > span.ex { } /* Extension */
|
||||
code > span.pp { color: #bc7a00; } /* Preprocessor */
|
||||
code > span.at { color: #7d9029; } /* Attribute */
|
||||
code > span.do { color: #ba2121; font-style: italic; } /* Documentation */
|
||||
code > span.an { color: #60a0b0; font-weight: bold; font-style: italic; } /* Annotation */
|
||||
code > span.cv { color: #60a0b0; font-weight: bold; font-style: italic; } /* CommentVar */
|
||||
code > span.in { color: #60a0b0; font-weight: bold; font-style: italic; } /* Information */
|
||||
</style>
|
||||
<link rel="stylesheet" href="github-markdown.css">
|
||||
<!--[if lt IE 9]>
|
||||
<script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv-printshiv.min.js"></script>
|
||||
<![endif]-->
|
||||
</head>
|
||||
<body>
|
||||
<div id="local-sidebar">
|
||||
<ul>
|
||||
<li><a href="Home.html">Home</a></li>
|
||||
<li>Setup
|
||||
<ul>
|
||||
<li><a href="Download-and-Installation.html">Download and Installation</a></li>
|
||||
<li><a href="Upgrade-and-migration.html">Upgrade and migration</a></li>
|
||||
<li><a href="Server-requirements.html">Server requirements</a></li>
|
||||
<li><a href="Server-configuration.html">Server configuration</a></li>
|
||||
<li><a href="Server-security.html">Server security</a></li>
|
||||
<li><a href="Shaarli-configuration.html">Shaarli configuration</a></li>
|
||||
<li><a href="Plugins.html">Plugins</a></li>
|
||||
</ul></li>
|
||||
<li><a href="Docker.html">Docker</a></li>
|
||||
<li><a href="Usage.html">Usage</a>
|
||||
<ul>
|
||||
<li><a href="Sharing-button.html">Sharing button</a> (bookmarklet)</li>
|
||||
<li><a href="Browsing-and-Searching.html">Browsing and Searching</a></li>
|
||||
<li><a href="Firefox-share.html">Firefox share</a></li>
|
||||
<li><a href="RSS-feeds.html">RSS feeds</a></li>
|
||||
<li><a href="REST-API.html">REST API</a></li>
|
||||
</ul></li>
|
||||
<li>How To
|
||||
<ul>
|
||||
<li><a href="Backup,-restore,-import-and-export.html">Backup, restore, import and export</a></li>
|
||||
<li><a href="Copy-an-existing-installation-over-SSH-and-serve-it-locally.html">Copy an existing installation over SSH and serve it locally</a></li>
|
||||
<li><a href="Create-and-serve-multiple-Shaarlis-(farm).html">Create and serve multiple Shaarlis (farm)</a></li>
|
||||
<li><a href="Download-CSS-styles-from-an-OPML-list.html">Download CSS styles from an OPML list</a></li>
|
||||
<li><a href="Datastore-hacks.html">Datastore hacks</a></li>
|
||||
</ul></li>
|
||||
<li><a href="Troubleshooting.html">Troubleshooting</a></li>
|
||||
<li><a href="Development.html">Development</a>
|
||||
<ul>
|
||||
<li><a href="GnuPG-signature.html">GnuPG signature</a></li>
|
||||
<li><a href="Coding-guidelines.html">Coding guidelines</a></li>
|
||||
<li><a href="Directory-structure.html">Directory structure</a></li>
|
||||
<li><a href="3rd-party-libraries.html">3rd party libraries</a></li>
|
||||
<li><a href="Plugin-System.html">Plugin System</a></li>
|
||||
<li><a href="Release-Shaarli.html">Release Shaarli</a></li>
|
||||
<li><a href="Versioning-and-Branches.html">Versioning and Branches</a></li>
|
||||
<li><a href="Security.html">Security</a></li>
|
||||
<li><a href="Static-analysis.html">Static analysis</a></li>
|
||||
<li><a href="Theming.html">Theming</a></li>
|
||||
<li><a href="Unit-tests.html">Unit tests</a></li>
|
||||
</ul></li>
|
||||
<li>About
|
||||
<ul>
|
||||
<li><a href="FAQ.html">FAQ</a></li>
|
||||
<li><a href="Community-&-Related-software.html">Community & Related software</a></li>
|
||||
</ul></li>
|
||||
</ul>
|
||||
</div>
|
||||
<h1 id="release-shaarli">Release Shaarli</h1>
|
||||
<p>See <a href="http://git-scm.com/book/en/v2/Distributed-Git-Maintaining-a-Project#Tagging-Your-Releases">Git - Maintaining a project - Tagging your [](.html)<br />
|
||||
releases</a>.</p>
|
||||
<h2 id="prerequisites">Prerequisites</h2>
|
||||
<p>This guide assumes that you have:</p>
|
||||
<ul>
|
||||
<li>a GPG key matching your GitHub authentication credentials
|
||||
<ul>
|
||||
<li>i.e., the email address identified by the GPG key is the same as the one in your <code>~/.gitconfig</code></li>
|
||||
</ul></li>
|
||||
<li>a GitHub fork of Shaarli</li>
|
||||
<li>a local clone of your Shaarli fork, with the following remotes:
|
||||
<ul>
|
||||
<li><code>origin</code> pointing to your GitHub fork</li>
|
||||
<li><code>upstream</code> pointing to the main Shaarli repository</li>
|
||||
</ul></li>
|
||||
<li>maintainer permissions on the main Shaarli repository, to:
|
||||
<ul>
|
||||
<li>push the signed tag</li>
|
||||
<li>create a new release</li>
|
||||
</ul></li>
|
||||
<li><a href="https://getcomposer.org/">Composer</a> and <a href="http://pandoc.org/">Pandoc</a> need to be installed<a href=".html"></a></li>
|
||||
</ul>
|
||||
<h2 id="github-release-draft-and-changelog.md">GitHub release draft and <code>CHANGELOG.md</code></h2>
|
||||
<p>See <a href="http://keepachangelog.com/en/0.3.0/" class="uri">http://keepachangelog.com/en/0.3.0/</a> for changelog formatting.</p>
|
||||
<h3 id="github-release-draft">GitHub release draft</h3>
|
||||
<p>GitHub allows drafting the release note for the upcoming release, from the <a href="https://github.com/shaarli/Shaarli/releases">Releases</a> page. This way, the release note can be drafted while contributions are merged to <code>master</code>.<a href=".html"></a></p>
|
||||
<h3 id="changelog.md"><code>CHANGELOG.md</code></h3>
|
||||
<p>This file should contain the same information as the release note draft for the upcoming version.</p>
|
||||
<p>Update it to:</p>
|
||||
<ul>
|
||||
<li>add new entries (additions, fixes, etc.)</li>
|
||||
<li>mark the current version as released by setting its date and link</li>
|
||||
<li>add a new section for the future unreleased version</li>
|
||||
</ul>
|
||||
<div class="sourceCode"><pre class="sourceCode bash"><code class="sourceCode bash">$ <span class="bu">cd</span> /path/to/shaarli
|
||||
|
||||
$ <span class="fu">nano</span> CHANGELOG.md
|
||||
|
||||
[<span class="ex">...</span>][](.html)
|
||||
<span class="co">## vA.B.C - UNRELEASED</span>
|
||||
<span class="ex">TBA</span>
|
||||
|
||||
<span class="co">## [vX.Y.Z](https://github.com/shaarli/Shaarli/releases/tag/vX.Y.Z) - YYYY-MM-DD[](.html)</span>
|
||||
[<span class="ex">...</span>][](.html)</code></pre></div>
|
||||
<h2 id="increment-the-version-code-create-and-push-a-signed-tag">Increment the version code, create and push a signed tag</h2>
|
||||
<h3 id="bump-shaarlis-version">Bump Shaarli's version</h3>
|
||||
<div class="sourceCode"><pre class="sourceCode bash"><code class="sourceCode bash">$ <span class="bu">cd</span> /path/to/shaarli
|
||||
|
||||
<span class="co"># create a new branch</span>
|
||||
$ <span class="fu">git</span> fetch upstream
|
||||
$ <span class="fu">git</span> checkout upstream/master -b v0.5.0
|
||||
|
||||
<span class="co"># bump the version number</span>
|
||||
$ <span class="ex">vim</span> index.php shaarli_version.php
|
||||
|
||||
<span class="co"># rebuild the documentation from the wiki</span>
|
||||
$ <span class="fu">make</span> htmldoc
|
||||
|
||||
<span class="co"># commit the changes</span>
|
||||
$ <span class="fu">git</span> add index.php shaarli_version.php doc
|
||||
$ <span class="fu">git</span> commit -s -m <span class="st">"Bump version to v0.5.0"</span>
|
||||
|
||||
<span class="co"># push the commit on your GitHub fork</span>
|
||||
$ <span class="fu">git</span> push origin v0.5.0</code></pre></div>
|
||||
<h3 id="create-and-merge-a-pull-request">Create and merge a Pull Request</h3>
|
||||
<p>This one is pretty straightforward ;-)</p>
|
||||
<h3 id="create-and-push-a-signed-tag">Create and push a signed tag</h3>
|
||||
<div class="sourceCode"><pre class="sourceCode bash"><code class="sourceCode bash"><span class="co"># update your local copy</span>
|
||||
$ <span class="fu">git</span> checkout master
|
||||
$ <span class="fu">git</span> fetch upstream
|
||||
$ <span class="fu">git</span> pull upstream master
|
||||
|
||||
<span class="co"># create a signed tag</span>
|
||||
$ <span class="fu">git</span> tag -s -m <span class="st">"Release v0.5.0"</span> v0.5.0
|
||||
|
||||
<span class="co"># push it to "upstream"</span>
|
||||
$ <span class="fu">git</span> push --tags upstream</code></pre></div>
|
||||
<h3 id="verify-a-signed-tag">Verify a signed tag</h3>
|
||||
<p><a href="https://github.com/shaarli/Shaarli/releases/tag/v0.5.0"><code>v0.5.0</code></a> is the first GPG-signed tag pushed on the Community Shaarli.<a href=".html"></a></p>
|
||||
<p>Let's have a look at its signature!</p>
|
||||
<div class="sourceCode"><pre class="sourceCode bash"><code class="sourceCode bash">$ <span class="bu">cd</span> /path/to/shaarli
|
||||
$ <span class="fu">git</span> fetch upstream
|
||||
|
||||
<span class="co"># get the SHA1 reference of the tag</span>
|
||||
$ <span class="fu">git</span> show-ref tags/v0.5.0
|
||||
<span class="ex">f7762cf803f03f5caf4b8078359a63783d0090c1</span> refs/tags/v0.5.0
|
||||
|
||||
<span class="co"># verify the tag signature information</span>
|
||||
$ <span class="fu">git</span> verify-tag f7762cf803f03f5caf4b8078359a63783d0090c1
|
||||
<span class="ex">gpg</span>: Signature made Thu 30 Jul 2015 11:46:34 CEST using RSA key ID 4100DF6F
|
||||
<span class="ex">gpg</span>: Good signature from <span class="st">"VirtualTam <virtualtam@flibidi.net>"</span> [ultimate][](.html)</code></pre></div>
|
||||
<h2 id="publish-the-github-release">Publish the GitHub release</h2>
|
||||
<h3 id="update-release-badges">Update release badges</h3>
|
||||
<p>Update <code>README.md</code> so version badges display and point to the newly released Shaarli version(s).</p>
|
||||
<h3 id="create-a-github-release-from-a-git-tag">Create a GitHub release from a Git tag</h3>
|
||||
<p>From the previously drafted release:</p>
|
||||
<ul>
|
||||
<li>edit the release notes (if needed)</li>
|
||||
<li>specify the appropriate Git tag</li>
|
||||
<li>publish the release</li>
|
||||
<li>profit!</li>
|
||||
</ul>
|
||||
<h3 id="generate-and-upload-all-in-one-release-archives">Generate and upload all-in-one release archives</h3>
|
||||
<p>Users with a shared hosting may have:</p>
|
||||
<ul>
|
||||
<li>no SSH access</li>
|
||||
<li>no possibility to install PHP packages or server extensions</li>
|
||||
<li>no possibility to run scripts</li>
|
||||
</ul>
|
||||
<p>To ease Shaarli installations, it is possible to generate and upload additional release archives,<br />
|
||||
that will contain Shaarli code plus all required third-party libraries:</p>
|
||||
<div class="sourceCode"><pre class="sourceCode bash"><code class="sourceCode bash">$ <span class="fu">make</span> release_archive</code></pre></div>
|
||||
<p>This will create the following archives:</p>
|
||||
<ul>
|
||||
<li><code>shaarli-vX.Y.Z-full.tar</code></li>
|
||||
<li><code>shaarli-vX.Y.Z-full.zip</code></li>
|
||||
</ul>
|
||||
<p>The archives need to be manually uploaded on the previously created GitHub release.</p>
|
||||
</body>
|
||||
</html>
|
|
@ -1,135 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="generator" content="pandoc">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">
|
||||
<title>Shaarli – Security</title>
|
||||
<style type="text/css">code{white-space: pre;}</style>
|
||||
<style type="text/css">
|
||||
div.sourceCode { overflow-x: auto; }
|
||||
table.sourceCode, tr.sourceCode, td.lineNumbers, td.sourceCode {
|
||||
margin: 0; padding: 0; vertical-align: baseline; border: none; }
|
||||
table.sourceCode { width: 100%; line-height: 100%; }
|
||||
td.lineNumbers { text-align: right; padding-right: 4px; padding-left: 4px; color: #aaaaaa; border-right: 1px solid #aaaaaa; }
|
||||
td.sourceCode { padding-left: 5px; }
|
||||
code > span.kw { color: #007020; font-weight: bold; } /* Keyword */
|
||||
code > span.dt { color: #902000; } /* DataType */
|
||||
code > span.dv { color: #40a070; } /* DecVal */
|
||||
code > span.bn { color: #40a070; } /* BaseN */
|
||||
code > span.fl { color: #40a070; } /* Float */
|
||||
code > span.ch { color: #4070a0; } /* Char */
|
||||
code > span.st { color: #4070a0; } /* String */
|
||||
code > span.co { color: #60a0b0; font-style: italic; } /* Comment */
|
||||
code > span.ot { color: #007020; } /* Other */
|
||||
code > span.al { color: #ff0000; font-weight: bold; } /* Alert */
|
||||
code > span.fu { color: #06287e; } /* Function */
|
||||
code > span.er { color: #ff0000; font-weight: bold; } /* Error */
|
||||
code > span.wa { color: #60a0b0; font-weight: bold; font-style: italic; } /* Warning */
|
||||
code > span.cn { color: #880000; } /* Constant */
|
||||
code > span.sc { color: #4070a0; } /* SpecialChar */
|
||||
code > span.vs { color: #4070a0; } /* VerbatimString */
|
||||
code > span.ss { color: #bb6688; } /* SpecialString */
|
||||
code > span.im { } /* Import */
|
||||
code > span.va { color: #19177c; } /* Variable */
|
||||
code > span.cf { color: #007020; font-weight: bold; } /* ControlFlow */
|
||||
code > span.op { color: #666666; } /* Operator */
|
||||
code > span.bu { } /* BuiltIn */
|
||||
code > span.ex { } /* Extension */
|
||||
code > span.pp { color: #bc7a00; } /* Preprocessor */
|
||||
code > span.at { color: #7d9029; } /* Attribute */
|
||||
code > span.do { color: #ba2121; font-style: italic; } /* Documentation */
|
||||
code > span.an { color: #60a0b0; font-weight: bold; font-style: italic; } /* Annotation */
|
||||
code > span.cv { color: #60a0b0; font-weight: bold; font-style: italic; } /* CommentVar */
|
||||
code > span.in { color: #60a0b0; font-weight: bold; font-style: italic; } /* Information */
|
||||
</style>
|
||||
<link rel="stylesheet" href="github-markdown.css">
|
||||
<!--[if lt IE 9]>
|
||||
<script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv-printshiv.min.js"></script>
|
||||
<![endif]-->
|
||||
</head>
|
||||
<body>
|
||||
<div id="local-sidebar">
|
||||
<ul>
|
||||
<li><a href="Home.html">Home</a></li>
|
||||
<li>Setup
|
||||
<ul>
|
||||
<li><a href="Download-and-Installation.html">Download and Installation</a></li>
|
||||
<li><a href="Upgrade-and-migration.html">Upgrade and migration</a></li>
|
||||
<li><a href="Server-requirements.html">Server requirements</a></li>
|
||||
<li><a href="Server-configuration.html">Server configuration</a></li>
|
||||
<li><a href="Server-security.html">Server security</a></li>
|
||||
<li><a href="Shaarli-configuration.html">Shaarli configuration</a></li>
|
||||
<li><a href="Plugins.html">Plugins</a></li>
|
||||
</ul></li>
|
||||
<li><a href="Docker.html">Docker</a></li>
|
||||
<li><a href="Usage.html">Usage</a>
|
||||
<ul>
|
||||
<li><a href="Sharing-button.html">Sharing button</a> (bookmarklet)</li>
|
||||
<li><a href="Browsing-and-Searching.html">Browsing and Searching</a></li>
|
||||
<li><a href="Firefox-share.html">Firefox share</a></li>
|
||||
<li><a href="RSS-feeds.html">RSS feeds</a></li>
|
||||
<li><a href="REST-API.html">REST API</a></li>
|
||||
</ul></li>
|
||||
<li>How To
|
||||
<ul>
|
||||
<li><a href="Backup,-restore,-import-and-export.html">Backup, restore, import and export</a></li>
|
||||
<li><a href="Copy-an-existing-installation-over-SSH-and-serve-it-locally.html">Copy an existing installation over SSH and serve it locally</a></li>
|
||||
<li><a href="Create-and-serve-multiple-Shaarlis-(farm).html">Create and serve multiple Shaarlis (farm)</a></li>
|
||||
<li><a href="Download-CSS-styles-from-an-OPML-list.html">Download CSS styles from an OPML list</a></li>
|
||||
<li><a href="Datastore-hacks.html">Datastore hacks</a></li>
|
||||
</ul></li>
|
||||
<li><a href="Troubleshooting.html">Troubleshooting</a></li>
|
||||
<li><a href="Development.html">Development</a>
|
||||
<ul>
|
||||
<li><a href="GnuPG-signature.html">GnuPG signature</a></li>
|
||||
<li><a href="Coding-guidelines.html">Coding guidelines</a></li>
|
||||
<li><a href="Directory-structure.html">Directory structure</a></li>
|
||||
<li><a href="3rd-party-libraries.html">3rd party libraries</a></li>
|
||||
<li><a href="Plugin-System.html">Plugin System</a></li>
|
||||
<li><a href="Release-Shaarli.html">Release Shaarli</a></li>
|
||||
<li><a href="Versioning-and-Branches.html">Versioning and Branches</a></li>
|
||||
<li><a href="Security.html">Security</a></li>
|
||||
<li><a href="Static-analysis.html">Static analysis</a></li>
|
||||
<li><a href="Theming.html">Theming</a></li>
|
||||
<li><a href="Unit-tests.html">Unit tests</a></li>
|
||||
</ul></li>
|
||||
<li>About
|
||||
<ul>
|
||||
<li><a href="FAQ.html">FAQ</a></li>
|
||||
<li><a href="Community-&-Related-software.html">Community & Related software</a></li>
|
||||
</ul></li>
|
||||
</ul>
|
||||
</div>
|
||||
<h1 id="security">Security</h1>
|
||||
<h2 id="client-browser">Client browser</h2>
|
||||
<ul>
|
||||
<li>Shaarli relies on <code>HTTP_REFERER</code> for some functions (like redirects and clicking on tags). If you have disabled or masqueraded <code>HTTP_REFERER</code> in your browser, some features of Shaarli may not work</li>
|
||||
</ul>
|
||||
<h2 id="php">PHP</h2>
|
||||
<ul>
|
||||
<li><code>magic_quotes</code> is an horrible option of PHP which is often activated on servers. No serious developer should rely on this horror to secure their code against SQL injections. You should disable it (and Shaarli expects this option to be disabled). Nevertheless, I have added code to cope with <code>magic_quotes</code> on, so you should not be bothered even on crappy hosts.</li>
|
||||
</ul>
|
||||
<h2 id="server-and-sessions">Server and sessions</h2>
|
||||
<ul>
|
||||
<li>Directories are protected using <code>.htaccess</code> files</li>
|
||||
<li>Forms are protected against XSRF (Cross-site requests forgery):</li>
|
||||
<li>Forms which act on data (save,delete…) contain a token generated by the server.</li>
|
||||
<li>Any posted form which does not contain a valid token is rejected.</li>
|
||||
<li>Any token can only be used once.</li>
|
||||
<li>Tokens are attached to the session and cannot be reused in another session.</li>
|
||||
<li>Sessions automatically expire after 60 minutes.</li>
|
||||
<li>Sessions are protected against hijacking: the session ID cannot be used from a different IP address.</li>
|
||||
</ul>
|
||||
<h2 id="shaarli-datastore-and-configuration">Shaarli datastore and configuration</h2>
|
||||
<ul>
|
||||
<li>The password is salted, hashed and stored in the data subdirectory, in a PHP file, and protected by htaccess. Even if the webserver does not support htaccess, the hash is not readable by URL. Even if the .php file is stolen, the password cannot deduced from the hash. The salt prevents rainbow-tables attacks.</li>
|
||||
<li>Links are stored as an associative array which is serialized, compressed (with deflate), base64-encoded and saved as a comment in a <code>.php</code> file.</li>
|
||||
<li>Even if the server does not support <code>.htaccess</code> files, the data file will still not be readable by URL.</li>
|
||||
<li><p>The database looks like this:</p>
|
||||
<div class="sourceCode"><pre class="sourceCode php"><code class="sourceCode php"><span class="kw"><?php</span> <span class="co">/* zP1ZjxxJtiYIvvevEPJ2lDOaLrZv7o...</span>
|
||||
<span class="co">...ka7gaco/Z+TFXM2i7BlfMf8qxpaSSYfKlvqv/x8= */</span> <span class="kw">?></span></code></pre></div></li>
|
||||
<li><p>Small hashes are used to make a link to an entry in Shaarli. They are unique. In fact, the date of the items (eg. <code>20110923_150523</code>) is hashed with CRC32, then converted to base64 and some characters are replaced. They are always 6 characters longs and use only <code>A-Z a-z 0-9 - _</code> and <code>@</code>.</p></li>
|
||||
</ul>
|
||||
</body>
|
||||
</html>
|
|
@ -1,459 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="generator" content="pandoc">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">
|
||||
<title>Shaarli – Server configuration</title>
|
||||
<style type="text/css">code{white-space: pre;}</style>
|
||||
<style type="text/css">
|
||||
div.sourceCode { overflow-x: auto; }
|
||||
table.sourceCode, tr.sourceCode, td.lineNumbers, td.sourceCode {
|
||||
margin: 0; padding: 0; vertical-align: baseline; border: none; }
|
||||
table.sourceCode { width: 100%; line-height: 100%; }
|
||||
td.lineNumbers { text-align: right; padding-right: 4px; padding-left: 4px; color: #aaaaaa; border-right: 1px solid #aaaaaa; }
|
||||
td.sourceCode { padding-left: 5px; }
|
||||
code > span.kw { color: #007020; font-weight: bold; } /* Keyword */
|
||||
code > span.dt { color: #902000; } /* DataType */
|
||||
code > span.dv { color: #40a070; } /* DecVal */
|
||||
code > span.bn { color: #40a070; } /* BaseN */
|
||||
code > span.fl { color: #40a070; } /* Float */
|
||||
code > span.ch { color: #4070a0; } /* Char */
|
||||
code > span.st { color: #4070a0; } /* String */
|
||||
code > span.co { color: #60a0b0; font-style: italic; } /* Comment */
|
||||
code > span.ot { color: #007020; } /* Other */
|
||||
code > span.al { color: #ff0000; font-weight: bold; } /* Alert */
|
||||
code > span.fu { color: #06287e; } /* Function */
|
||||
code > span.er { color: #ff0000; font-weight: bold; } /* Error */
|
||||
code > span.wa { color: #60a0b0; font-weight: bold; font-style: italic; } /* Warning */
|
||||
code > span.cn { color: #880000; } /* Constant */
|
||||
code > span.sc { color: #4070a0; } /* SpecialChar */
|
||||
code > span.vs { color: #4070a0; } /* VerbatimString */
|
||||
code > span.ss { color: #bb6688; } /* SpecialString */
|
||||
code > span.im { } /* Import */
|
||||
code > span.va { color: #19177c; } /* Variable */
|
||||
code > span.cf { color: #007020; font-weight: bold; } /* ControlFlow */
|
||||
code > span.op { color: #666666; } /* Operator */
|
||||
code > span.bu { } /* BuiltIn */
|
||||
code > span.ex { } /* Extension */
|
||||
code > span.pp { color: #bc7a00; } /* Preprocessor */
|
||||
code > span.at { color: #7d9029; } /* Attribute */
|
||||
code > span.do { color: #ba2121; font-style: italic; } /* Documentation */
|
||||
code > span.an { color: #60a0b0; font-weight: bold; font-style: italic; } /* Annotation */
|
||||
code > span.cv { color: #60a0b0; font-weight: bold; font-style: italic; } /* CommentVar */
|
||||
code > span.in { color: #60a0b0; font-weight: bold; font-style: italic; } /* Information */
|
||||
</style>
|
||||
<link rel="stylesheet" href="github-markdown.css">
|
||||
<!--[if lt IE 9]>
|
||||
<script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv-printshiv.min.js"></script>
|
||||
<![endif]-->
|
||||
</head>
|
||||
<body>
|
||||
<div id="local-sidebar">
|
||||
<ul>
|
||||
<li><a href="Home.html">Home</a></li>
|
||||
<li>Setup
|
||||
<ul>
|
||||
<li><a href="Download-and-Installation.html">Download and Installation</a></li>
|
||||
<li><a href="Upgrade-and-migration.html">Upgrade and migration</a></li>
|
||||
<li><a href="Server-requirements.html">Server requirements</a></li>
|
||||
<li><a href="Server-configuration.html">Server configuration</a></li>
|
||||
<li><a href="Server-security.html">Server security</a></li>
|
||||
<li><a href="Shaarli-configuration.html">Shaarli configuration</a></li>
|
||||
<li><a href="Plugins.html">Plugins</a></li>
|
||||
</ul></li>
|
||||
<li><a href="Docker.html">Docker</a></li>
|
||||
<li><a href="Usage.html">Usage</a>
|
||||
<ul>
|
||||
<li><a href="Sharing-button.html">Sharing button</a> (bookmarklet)</li>
|
||||
<li><a href="Browsing-and-Searching.html">Browsing and Searching</a></li>
|
||||
<li><a href="Firefox-share.html">Firefox share</a></li>
|
||||
<li><a href="RSS-feeds.html">RSS feeds</a></li>
|
||||
<li><a href="REST-API.html">REST API</a></li>
|
||||
</ul></li>
|
||||
<li>How To
|
||||
<ul>
|
||||
<li><a href="Backup,-restore,-import-and-export.html">Backup, restore, import and export</a></li>
|
||||
<li><a href="Copy-an-existing-installation-over-SSH-and-serve-it-locally.html">Copy an existing installation over SSH and serve it locally</a></li>
|
||||
<li><a href="Create-and-serve-multiple-Shaarlis-(farm).html">Create and serve multiple Shaarlis (farm)</a></li>
|
||||
<li><a href="Download-CSS-styles-from-an-OPML-list.html">Download CSS styles from an OPML list</a></li>
|
||||
<li><a href="Datastore-hacks.html">Datastore hacks</a></li>
|
||||
</ul></li>
|
||||
<li><a href="Troubleshooting.html">Troubleshooting</a></li>
|
||||
<li><a href="Development.html">Development</a>
|
||||
<ul>
|
||||
<li><a href="GnuPG-signature.html">GnuPG signature</a></li>
|
||||
<li><a href="Coding-guidelines.html">Coding guidelines</a></li>
|
||||
<li><a href="Directory-structure.html">Directory structure</a></li>
|
||||
<li><a href="3rd-party-libraries.html">3rd party libraries</a></li>
|
||||
<li><a href="Plugin-System.html">Plugin System</a></li>
|
||||
<li><a href="Release-Shaarli.html">Release Shaarli</a></li>
|
||||
<li><a href="Versioning-and-Branches.html">Versioning and Branches</a></li>
|
||||
<li><a href="Security.html">Security</a></li>
|
||||
<li><a href="Static-analysis.html">Static analysis</a></li>
|
||||
<li><a href="Theming.html">Theming</a></li>
|
||||
<li><a href="Unit-tests.html">Unit tests</a></li>
|
||||
</ul></li>
|
||||
<li>About
|
||||
<ul>
|
||||
<li><a href="FAQ.html">FAQ</a></li>
|
||||
<li><a href="Community-&-Related-software.html">Community & Related software</a></li>
|
||||
</ul></li>
|
||||
</ul>
|
||||
</div>
|
||||
<h1 id="server-configuration">Server configuration</h1>
|
||||
<p><em>Example virtual host configurations for popular web servers</em></p>
|
||||
<ul>
|
||||
<li><a href="#apache">Apache</a><a href=".html"></a></li>
|
||||
<li><a href="#nginx">Nginx</a><a href=".html"></a></li>
|
||||
</ul>
|
||||
<h2 id="prerequisites">Prerequisites</h2>
|
||||
<h3 id="shaarli">Shaarli</h3>
|
||||
<ul>
|
||||
<li>Shaarli is installed in a directory readable/writeable by the user</li>
|
||||
<li>the correct read/write permissions have been granted to the web server <em>user and/or group</em></li>
|
||||
<li>for HTTPS / SSL:</li>
|
||||
<li>a key pair (public, private) and a certificate have been generated</li>
|
||||
<li>the appropriate server SSL extension is installed and active</li>
|
||||
</ul>
|
||||
<h3 id="https-tls-and-self-signed-certificates">HTTPS, TLS and self-signed certificates</h3>
|
||||
<p>Related guides:</p>
|
||||
<ul>
|
||||
<li><a href="http://www.xenocafe.com/tutorials/linux/centos/openssl/self_signed_certificates/index.php">How to Create Self-Signed SSL Certificates with OpenSSL</a><a href=".html"></a></li>
|
||||
<li><a href="https://workaround.org/certificate-authority">How do I create my own Certificate Authority?</a><a href=".html"></a></li>
|
||||
<li>Generate a self-signed certificate (will trigger browser warnings) with apache2: <code>make-ssl-cert generate-default-snakeoil --force-overwrite</code> will create <code>/etc/ssl/certs/ssl-cert-snakeoil.pem</code> and <code>/etc/ssl/private/ssl-cert-snakeoil.key</code></li>
|
||||
</ul>
|
||||
<h3 id="proxies">Proxies</h3>
|
||||
<p>If Shaarli is served behind a proxy (i.e. there is a proxy server between clients and the web server hosting Shaarli), please refer to the proxy server documentation for proper configuration. In particular, you have to ensure that the following server variables are properly set:</p>
|
||||
<ul>
|
||||
<li><code>X-Forwarded-Proto</code>;</li>
|
||||
<li><code>X-Forwarded-Host</code>;</li>
|
||||
<li><code>X-Forwarded-For</code>.</li>
|
||||
</ul>
|
||||
<p>See also <a href="https://github.com/shaarli/Shaarli/issues?utf8=%E2%9C%93&q=label%3Aproxy+">proxy-related</a> issues.<a href=".html"></a></p>
|
||||
<h2 id="apache">Apache</h2>
|
||||
<h3 id="minimal">Minimal</h3>
|
||||
<div class="sourceCode"><pre class="sourceCode apache"><code class="sourceCode apache"><span class="fu"><VirtualHost</span><span class="at"> *:80</span><span class="fu">></span>
|
||||
ServerName<span class="st"> shaarli.my-domain.org</span>
|
||||
DocumentRoot<span class="st"> /absolute/path/to/shaarli/</span>
|
||||
<span class="fu"></VirtualHost></span></code></pre></div>
|
||||
<h3 id="debug---log-all-the-things">Debug - Log all the things!</h3>
|
||||
<p>This configuration will log both Apache and PHP errors, which may prove useful to identify server configuration errors.</p>
|
||||
<p>See:</p>
|
||||
<ul>
|
||||
<li><a href="http://stackoverflow.com/q/176">Apache/PHP - error log per VirtualHost</a> (StackOverflow)<a href=".html"></a></li>
|
||||
<li><a href="https://ma.ttias.be/php-php_value-vs-php_admin_value-and-the-use-of-php_flag-explained/">PHP: php_value vs php_admin_value and the use of php_flag explained</a><a href=".html"></a></li>
|
||||
</ul>
|
||||
<div class="sourceCode"><pre class="sourceCode apache"><code class="sourceCode apache"><span class="fu"><VirtualHost</span><span class="at"> *:80</span><span class="fu">></span>
|
||||
ServerName<span class="st"> shaarli.my-domain.org</span>
|
||||
DocumentRoot<span class="st"> /absolute/path/to/shaarli/</span>
|
||||
|
||||
<span class="ex">LogLevel</span><span class="ch"> </span><span class="kw">warn</span>
|
||||
ErrorLog<span class="st"> /var/log/apache2/shaarli-error.log</span>
|
||||
CustomLog<span class="st"> /var/log/apache2/shaarli-access.log combined</span>
|
||||
|
||||
php_flag log_errors on
|
||||
php_flag display_errors on
|
||||
php_value error_reporting 2147483647
|
||||
php_value error_log /var/log/apache2/shaarli-php-error.log
|
||||
<span class="fu"></VirtualHost></span></code></pre></div>
|
||||
<h3 id="standard---keep-access-and-error-logs">Standard - Keep access and error logs</h3>
|
||||
<div class="sourceCode"><pre class="sourceCode apache"><code class="sourceCode apache"><span class="fu"><VirtualHost</span><span class="at"> *:80</span><span class="fu">></span>
|
||||
ServerName<span class="st"> shaarli.my-domain.org</span>
|
||||
DocumentRoot<span class="st"> /absolute/path/to/shaarli/</span>
|
||||
|
||||
<span class="ex">LogLevel</span><span class="ch"> </span><span class="kw">warn</span>
|
||||
ErrorLog<span class="st"> /var/log/apache2/shaarli-error.log</span>
|
||||
CustomLog<span class="st"> /var/log/apache2/shaarli-access.log combined</span>
|
||||
<span class="fu"></VirtualHost></span></code></pre></div>
|
||||
<h3 id="paranoid---redirect-http-80-to-https-443">Paranoid - Redirect HTTP (:80) to HTTPS (:443)</h3>
|
||||
<p>See <a href="https://wiki.mozilla.org/Security/Server_Side_TLS#Apache">Server-side TLS</a> (Mozilla).<a href=".html"></a></p>
|
||||
<div class="sourceCode"><pre class="sourceCode apache"><code class="sourceCode apache"><span class="fu"><VirtualHost</span><span class="at"> *:443</span><span class="fu">></span>
|
||||
ServerName<span class="st"> shaarli.my-domain.org</span>
|
||||
DocumentRoot<span class="st"> /absolute/path/to/shaarli/</span>
|
||||
|
||||
<span class="ex">SSLEngine</span><span class="ch"> </span><span class="kw">on</span>
|
||||
SSLCertificateFile<span class="st"> /absolute/path/to/the/website/certificate.pem</span>
|
||||
SSLCertificateKeyFile<span class="st"> /absolute/path/to/the/website/key.key</span>
|
||||
|
||||
<span class="fu"><Directory</span><span class="at"> /absolute/path/to/shaarli/</span><span class="fu">></span>
|
||||
<span class="ex">AllowOverride</span><span class="ch"> </span><span class="kw">All</span>
|
||||
<span class="ex">Options</span><span class="ch"> </span><span class="kw">Indexes</span><span class="ch"> </span><span class="kw">FollowSymLinks</span><span class="ch"> </span><span class="kw">MultiViews</span>
|
||||
<span class="ex">Order</span><span class="ch"> </span><span class="kw">allow,deny</span>
|
||||
allow<span class="st"> from all</span>
|
||||
<span class="fu"></Directory></span>
|
||||
|
||||
<span class="ex">LogLevel</span><span class="ch"> </span><span class="kw">warn</span>
|
||||
ErrorLog<span class="st"> /var/log/apache2/shaarli-error.log</span>
|
||||
CustomLog<span class="st"> /var/log/apache2/shaarli-access.log combined</span>
|
||||
<span class="fu"></VirtualHost></span>
|
||||
<span class="fu"><VirtualHost</span><span class="at"> *:80</span><span class="fu">></span>
|
||||
ServerName<span class="st"> shaarli.my-domain.org</span>
|
||||
Redirect<span class="st"> 301 / https://shaarli.my-domain.org</span>
|
||||
|
||||
<span class="ex">LogLevel</span><span class="ch"> </span><span class="kw">warn</span>
|
||||
ErrorLog<span class="st"> /var/log/apache2/shaarli-error.log</span>
|
||||
CustomLog<span class="st"> /var/log/apache2/shaarli-access.log combined</span>
|
||||
<span class="fu"></VirtualHost></span></code></pre></div>
|
||||
<h3 id="htaccess">.htaccess</h3>
|
||||
<p>Shaarli use <code>.htaccess</code> Apache files to deny access to files that shouldn't be directly accessed (datastore, config, etc.). You need the directive <code>AllowOverride All</code> in your virtual host configuration for them to work.</p>
|
||||
<p><strong>Warning</strong>: If you use Apache 2.2 or lower, you need <a href="https://httpd.apache.org/docs/current/mod/mod_version.html">mod_version</a> to be installed and enabled.<a href=".html"></a></p>
|
||||
<p>Apache module <code>mod_rewrite</code> <strong>must</strong> be enabled to use the REST API. URL rewriting rules for the Slim microframework are stated in the root <code>.htaccess</code> file.</p>
|
||||
<h2 id="lighthttpd">LightHttpd</h2>
|
||||
<h2 id="nginx">Nginx</h2>
|
||||
<h3 id="foreword">Foreword</h3>
|
||||
<p>Nginx does not natively interpret PHP scripts; to this effect, we will run a <a href="https://en.wikipedia.org/wiki/FastCGI">FastCGI</a> service, to which Nginx's FastCGI module will proxy all requests to PHP resources.<a href=".html"></a></p>
|
||||
<p>Required packages:</p>
|
||||
<ul>
|
||||
<li><a href="http://nginx.org">nginx</a><a href=".html"></a></li>
|
||||
<li><a href="http://php-fpm.org">php-fpm</a> - PHP FastCGI Process Manager<a href=".html"></a></li>
|
||||
</ul>
|
||||
<p>Official documentation:</p>
|
||||
<ul>
|
||||
<li><a href="http://nginx.org/en/docs/beginners_guide.html">Beginner's guide</a><a href=".html"></a></li>
|
||||
<li><a href="http://nginx.org/en/docs/http/ngx_http_fastcgi_module.html">ngx_http_fastcgi_module</a><a href=".html"></a></li>
|
||||
<li><a href="http://wiki.nginx.org/Pitfalls">Pitfalls</a><a href=".html"></a></li>
|
||||
</ul>
|
||||
<p>Community resources:</p>
|
||||
<ul>
|
||||
<li><a href="https://wiki.mozilla.org/Security/Server_Side_TLS#Nginx">Server-side TLS (Nginx)</a> (Mozilla)<a href=".html"></a></li>
|
||||
<li><a href="http://kbeezie.com/nginx-configuration-examples/">PHP configuration examples</a> (Karl Blessing)<a href=".html"></a></li>
|
||||
</ul>
|
||||
<h3 id="common-setup">Common setup</h3>
|
||||
<p>Once Nginx and PHP-FPM are installed, we need to ensure:</p>
|
||||
<ul>
|
||||
<li>Nginx and PHP-FPM are running using the <em>same user and group</em></li>
|
||||
<li>both these user and group have
|
||||
<ul>
|
||||
<li><code>read</code> permissions for Shaarli resources</li>
|
||||
<li><code>execute</code> permissions for Shaarli directories <em>AND</em> their parent directories</li>
|
||||
</ul></li>
|
||||
</ul>
|
||||
<p>On a production server:</p>
|
||||
<ul>
|
||||
<li><code>user:group</code> will likely be <code>http:http</code>, <code>www:www</code> or <code>www-data:www-data</code></li>
|
||||
<li>files will be located under <code>/var/www</code>, <code>/var/http</code> or <code>/usr/share/nginx</code></li>
|
||||
</ul>
|
||||
<p>On a development server:</p>
|
||||
<ul>
|
||||
<li>files may be located in a user's home directory</li>
|
||||
<li>in this case, make sure both Nginx and PHP-FPM are running as the local user/group!</li>
|
||||
</ul>
|
||||
<p>For all following configuration examples, this user/group pair will be used:</p>
|
||||
<ul>
|
||||
<li><code>user:group = john:users</code>,</li>
|
||||
</ul>
|
||||
<p>which corresponds to the following service configuration:</p>
|
||||
<div class="sourceCode"><pre class="sourceCode ini"><code class="sourceCode ini"><span class="co">; /etc/php/php-fpm.conf</span>
|
||||
<span class="dt">user </span><span class="ot">=</span><span class="st"> john</span>
|
||||
<span class="dt">group </span><span class="ot">=</span><span class="st"> users</span>
|
||||
|
||||
<span class="kw">[...][]</span><span class="dt">(.html)</span>
|
||||
<span class="dt">listen.owner </span><span class="ot">=</span><span class="st"> john</span>
|
||||
<span class="dt">listen.group </span><span class="ot">=</span><span class="st"> users</span></code></pre></div>
|
||||
<pre class="nginx"><code># /etc/nginx/nginx.conf
|
||||
user john users;
|
||||
|
||||
http {
|
||||
[...][](.html)
|
||||
}</code></pre>
|
||||
<h3 id="optional-increase-the-maximum-file-upload-size">(Optional) Increase the maximum file upload size</h3>
|
||||
<p>Some bookmark dumps generated by web browsers can be <em>huge</em> due to the presence of Base64-encoded images and favicons, as well as extra verbosity when nesting links in (sub-)folders.</p>
|
||||
<p>To increase upload size, you will need to modify both nginx and PHP configuration:</p>
|
||||
<pre class="nginx"><code># /etc/nginx/nginx.conf
|
||||
|
||||
http {
|
||||
[...][](.html)
|
||||
|
||||
client_max_body_size 10m;
|
||||
|
||||
[...][](.html)
|
||||
}</code></pre>
|
||||
<div class="sourceCode"><pre class="sourceCode ini"><code class="sourceCode ini"><span class="co"># /etc/php5/fpm/php.ini</span>
|
||||
|
||||
<span class="kw">[...][]</span><span class="dt">(.html)</span>
|
||||
<span class="dt">post_max_size </span><span class="ot">=</span><span class="st"> 10M</span>
|
||||
<span class="kw">[...][]</span><span class="dt">(.html)</span>
|
||||
<span class="dt">upload_max_filesize </span><span class="ot">=</span><span class="st"> 10M</span></code></pre></div>
|
||||
<h3 id="minimal-1">Minimal</h3>
|
||||
<p><em>WARNING: Use for development only!</em></p>
|
||||
<pre class="nginx"><code>user john users;
|
||||
worker_processes 1;
|
||||
events {
|
||||
worker_connections 1024;
|
||||
}
|
||||
|
||||
http {
|
||||
include mime.types;
|
||||
default_type application/octet-stream;
|
||||
keepalive_timeout 20;
|
||||
|
||||
index index.html index.php;
|
||||
|
||||
server {
|
||||
listen 80;
|
||||
server_name localhost;
|
||||
root /home/john/web;
|
||||
|
||||
access_log /var/log/nginx/access.log;
|
||||
error_log /var/log/nginx/error.log;
|
||||
|
||||
location /shaarli/ {
|
||||
try_files $uri /shaarli/index.php$is_args$args;
|
||||
access_log /var/log/nginx/shaarli.access.log;
|
||||
error_log /var/log/nginx/shaarli.error.log;
|
||||
}
|
||||
|
||||
location ~ (index)\.php$ {
|
||||
try_files $uri =404;
|
||||
fastcgi_split_path_info ^(.+\.php)(/.+)$;
|
||||
fastcgi_pass unix:/var/run/php-fpm/php-fpm.sock;
|
||||
fastcgi_index index.php;
|
||||
include fastcgi.conf;
|
||||
}
|
||||
}
|
||||
}</code></pre>
|
||||
<h3 id="modular">Modular</h3>
|
||||
<p>The previous setup is sufficient for development purposes, but has several major caveats:</p>
|
||||
<ul>
|
||||
<li>every content that does not match the PHP rule will be sent to client browsers:
|
||||
<ul>
|
||||
<li>dotfiles - in our case, <code>.htaccess</code></li>
|
||||
<li>temporary files, e.g. Vim or Emacs files: <code>index.php~</code></li>
|
||||
</ul></li>
|
||||
<li>asset / static resource caching is not optimized</li>
|
||||
<li>if serving several PHP sites, there will be a lot of duplication: <code>location /shaarli/</code>, <code>location /mysite/</code>, etc.</li>
|
||||
</ul>
|
||||
<p>To solve this, we will split Nginx configuration in several parts, that will be included when needed:</p>
|
||||
<pre class="nginx"><code># /etc/nginx/deny.conf
|
||||
location ~ /\. {
|
||||
# deny access to dotfiles
|
||||
access_log off;
|
||||
log_not_found off;
|
||||
deny all;
|
||||
}
|
||||
|
||||
location ~ ~$ {
|
||||
# deny access to temp editor files, e.g. "script.php~"
|
||||
access_log off;
|
||||
log_not_found off;
|
||||
deny all;
|
||||
}</code></pre>
|
||||
<pre class="nginx"><code># /etc/nginx/php.conf
|
||||
location ~ (index)\.php$ {
|
||||
# Slim - split URL path into (script_filename, path_info)
|
||||
try_files $uri =404;
|
||||
fastcgi_split_path_info ^(.+\.php)(/.+)$;
|
||||
|
||||
# filter and proxy PHP requests to PHP-FPM
|
||||
fastcgi_pass unix:/var/run/php-fpm/php-fpm.sock;
|
||||
fastcgi_index index.php;
|
||||
include fastcgi.conf;
|
||||
}
|
||||
|
||||
location ~ \.php$ {
|
||||
# deny access to all other PHP scripts
|
||||
deny all;
|
||||
}</code></pre>
|
||||
<pre class="nginx"><code># /etc/nginx/static_assets.conf
|
||||
location ~* \.(?:ico|css|js|gif|jpe?g|png)$ {
|
||||
expires max;
|
||||
add_header Pragma public;
|
||||
add_header Cache-Control "public, must-revalidate, proxy-revalidate";
|
||||
}</code></pre>
|
||||
<pre class="nginx"><code># /etc/nginx/nginx.conf
|
||||
[...][](.html)
|
||||
|
||||
http {
|
||||
[...][](.html)
|
||||
|
||||
root /home/john/web;
|
||||
access_log /var/log/nginx/access.log;
|
||||
error_log /var/log/nginx/error.log;
|
||||
|
||||
server {
|
||||
# virtual host for a first domain
|
||||
listen 80;
|
||||
server_name my.first.domain.org;
|
||||
|
||||
location /shaarli/ {
|
||||
# Slim - rewrite URLs
|
||||
try_files $uri /shaarli/index.php$is_args$args;
|
||||
|
||||
access_log /var/log/nginx/shaarli.access.log;
|
||||
error_log /var/log/nginx/shaarli.error.log;
|
||||
}
|
||||
|
||||
location = /shaarli/favicon.ico {
|
||||
# serve the Shaarli favicon from its custom location
|
||||
alias /var/www/shaarli/images/favicon.ico;
|
||||
}
|
||||
|
||||
include deny.conf;
|
||||
include static_assets.conf;
|
||||
include php.conf;
|
||||
}
|
||||
|
||||
server {
|
||||
# virtual host for a second domain
|
||||
listen 80;
|
||||
server_name second.domain.com;
|
||||
|
||||
location /minigal/ {
|
||||
access_log /var/log/nginx/minigal.access.log;
|
||||
error_log /var/log/nginx/minigal.error.log;
|
||||
}
|
||||
|
||||
include deny.conf;
|
||||
include static_assets.conf;
|
||||
include php.conf;
|
||||
}
|
||||
}</code></pre>
|
||||
<h3 id="redirect-http-to-https">Redirect HTTP to HTTPS</h3>
|
||||
<p>Assuming you have generated a (self-signed) key and certificate, and they are located under <code>/home/john/ssl/localhost.{key,crt}</code>, it is pretty straightforward to set an HTTP (:80) to HTTPS (:443) redirection to force SSL/TLS usage.</p>
|
||||
<pre class="nginx"><code># /etc/nginx/nginx.conf
|
||||
[...][](.html)
|
||||
|
||||
http {
|
||||
[...][](.html)
|
||||
|
||||
index index.html index.php;
|
||||
|
||||
root /home/john/web;
|
||||
access_log /var/log/nginx/access.log;
|
||||
error_log /var/log/nginx/error.log;
|
||||
|
||||
server {
|
||||
listen 80;
|
||||
server_name localhost;
|
||||
|
||||
return 301 https://localhost$request_uri;
|
||||
}
|
||||
|
||||
server {
|
||||
listen 443 ssl;
|
||||
server_name localhost;
|
||||
|
||||
ssl_certificate /home/john/ssl/localhost.crt;
|
||||
ssl_certificate_key /home/john/ssl/localhost.key;
|
||||
|
||||
location /shaarli/ {
|
||||
# Slim - rewrite URLs
|
||||
try_files $uri /index.php$is_args$args;
|
||||
|
||||
access_log /var/log/nginx/shaarli.access.log;
|
||||
error_log /var/log/nginx/shaarli.error.log;
|
||||
}
|
||||
|
||||
location = /shaarli/favicon.ico {
|
||||
# serve the Shaarli favicon from its custom location
|
||||
alias /var/www/shaarli/images/favicon.ico;
|
||||
}
|
||||
|
||||
include deny.conf;
|
||||
include static_assets.conf;
|
||||
include php.conf;
|
||||
}
|
||||
}</code></pre>
|
||||
</body>
|
||||
</html>
|
|
@ -1,195 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="generator" content="pandoc">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">
|
||||
<title>Shaarli – Server requirements</title>
|
||||
<style type="text/css">code{white-space: pre;}</style>
|
||||
<link rel="stylesheet" href="github-markdown.css">
|
||||
<!--[if lt IE 9]>
|
||||
<script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv-printshiv.min.js"></script>
|
||||
<![endif]-->
|
||||
</head>
|
||||
<body>
|
||||
<div id="local-sidebar">
|
||||
<ul>
|
||||
<li><a href="Home.html">Home</a></li>
|
||||
<li>Setup
|
||||
<ul>
|
||||
<li><a href="Download-and-Installation.html">Download and Installation</a></li>
|
||||
<li><a href="Upgrade-and-migration.html">Upgrade and migration</a></li>
|
||||
<li><a href="Server-requirements.html">Server requirements</a></li>
|
||||
<li><a href="Server-configuration.html">Server configuration</a></li>
|
||||
<li><a href="Server-security.html">Server security</a></li>
|
||||
<li><a href="Shaarli-configuration.html">Shaarli configuration</a></li>
|
||||
<li><a href="Plugins.html">Plugins</a></li>
|
||||
</ul></li>
|
||||
<li><a href="Docker.html">Docker</a></li>
|
||||
<li><a href="Usage.html">Usage</a>
|
||||
<ul>
|
||||
<li><a href="Sharing-button.html">Sharing button</a> (bookmarklet)</li>
|
||||
<li><a href="Browsing-and-Searching.html">Browsing and Searching</a></li>
|
||||
<li><a href="Firefox-share.html">Firefox share</a></li>
|
||||
<li><a href="RSS-feeds.html">RSS feeds</a></li>
|
||||
<li><a href="REST-API.html">REST API</a></li>
|
||||
</ul></li>
|
||||
<li>How To
|
||||
<ul>
|
||||
<li><a href="Backup,-restore,-import-and-export.html">Backup, restore, import and export</a></li>
|
||||
<li><a href="Copy-an-existing-installation-over-SSH-and-serve-it-locally.html">Copy an existing installation over SSH and serve it locally</a></li>
|
||||
<li><a href="Create-and-serve-multiple-Shaarlis-(farm).html">Create and serve multiple Shaarlis (farm)</a></li>
|
||||
<li><a href="Download-CSS-styles-from-an-OPML-list.html">Download CSS styles from an OPML list</a></li>
|
||||
<li><a href="Datastore-hacks.html">Datastore hacks</a></li>
|
||||
</ul></li>
|
||||
<li><a href="Troubleshooting.html">Troubleshooting</a></li>
|
||||
<li><a href="Development.html">Development</a>
|
||||
<ul>
|
||||
<li><a href="GnuPG-signature.html">GnuPG signature</a></li>
|
||||
<li><a href="Coding-guidelines.html">Coding guidelines</a></li>
|
||||
<li><a href="Directory-structure.html">Directory structure</a></li>
|
||||
<li><a href="3rd-party-libraries.html">3rd party libraries</a></li>
|
||||
<li><a href="Plugin-System.html">Plugin System</a></li>
|
||||
<li><a href="Release-Shaarli.html">Release Shaarli</a></li>
|
||||
<li><a href="Versioning-and-Branches.html">Versioning and Branches</a></li>
|
||||
<li><a href="Security.html">Security</a></li>
|
||||
<li><a href="Static-analysis.html">Static analysis</a></li>
|
||||
<li><a href="Theming.html">Theming</a></li>
|
||||
<li><a href="Unit-tests.html">Unit tests</a></li>
|
||||
</ul></li>
|
||||
<li>About
|
||||
<ul>
|
||||
<li><a href="FAQ.html">FAQ</a></li>
|
||||
<li><a href="Community-&-Related-software.html">Community & Related software</a></li>
|
||||
</ul></li>
|
||||
</ul>
|
||||
</div>
|
||||
<h1 id="server-requirements">Server requirements</h1>
|
||||
<h2 id="php">PHP</h2>
|
||||
<h3 id="release-information">Release information</h3>
|
||||
<ul>
|
||||
<li><a href="http://php.net/supported-versions.php">PHP: Supported versions</a><a href=".html"></a></li>
|
||||
<li><a href="http://php.net/eol.php">PHP: Unsupported versions</a> <em>(EOL - End Of Life)</em><a href=".html"></a></li>
|
||||
<li><a href="http://php.net/ChangeLog-7.php">PHP 7 Changelog</a><a href=".html"></a></li>
|
||||
<li><a href="http://php.net/ChangeLog-5.php">PHP 5 Changelog</a><a href=".html"></a></li>
|
||||
<li><a href="https://bugs.php.net/">PHP: Bugs</a><a href=".html"></a></li>
|
||||
</ul>
|
||||
<h3 id="supported-versions">Supported versions</h3>
|
||||
<table>
|
||||
<thead>
|
||||
<tr class="header">
|
||||
<th style="text-align: center;">Version</th>
|
||||
<th style="text-align: center;">Status</th>
|
||||
<th style="text-align: center;">Shaarli compatibility</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr class="odd">
|
||||
<td style="text-align: center;">7.1</td>
|
||||
<td style="text-align: center;">Supported (v0.9.x)</td>
|
||||
<td style="text-align: center;">✅</td>
|
||||
</tr>
|
||||
<tr class="even">
|
||||
<td style="text-align: center;">7.0</td>
|
||||
<td style="text-align: center;">Supported</td>
|
||||
<td style="text-align: center;">✅</td>
|
||||
</tr>
|
||||
<tr class="odd">
|
||||
<td style="text-align: center;">5.6</td>
|
||||
<td style="text-align: center;">Supported</td>
|
||||
<td style="text-align: center;">✅</td>
|
||||
</tr>
|
||||
<tr class="even">
|
||||
<td style="text-align: center;">5.5</td>
|
||||
<td style="text-align: center;">EOL: 2016-07-10</td>
|
||||
<td style="text-align: center;">✅</td>
|
||||
</tr>
|
||||
<tr class="odd">
|
||||
<td style="text-align: center;">5.4</td>
|
||||
<td style="text-align: center;">EOL: 2015-09-14</td>
|
||||
<td style="text-align: center;">✅ (up to Shaarli 0.8.x)</td>
|
||||
</tr>
|
||||
<tr class="even">
|
||||
<td style="text-align: center;">5.3</td>
|
||||
<td style="text-align: center;">EOL: 2014-08-14</td>
|
||||
<td style="text-align: center;">✅ (up to Shaarli 0.8.x)</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<p>See also:</p>
|
||||
<ul>
|
||||
<li><a href="https://github.com/shaarli/Shaarli/blob/master/.travis.yml">Travis configuration</a><a href=".html"></a></li>
|
||||
</ul>
|
||||
<h3 id="dependency-management">Dependency management</h3>
|
||||
<p>Starting with Shaarli <code>v0.8.x</code>, <a href="https://getcomposer.org/">Composer</a> is used to resolve,<a href=".html"></a><br />
|
||||
download and install third-party PHP dependencies.</p>
|
||||
<table>
|
||||
<thead>
|
||||
<tr class="header">
|
||||
<th>Library</th>
|
||||
<th style="text-align: center;">Required?</th>
|
||||
<th>Usage</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr class="odd">
|
||||
<td><a href="https://packagist.org/packages/shaarli/netscape-bookmark-parser"><code>shaarli/netscape-bookmark-parser</code></a></td>
|
||||
<td style="text-align: center;">All</td>
|
||||
<td>Import bookmarks from Netscape files<a href=".html"></a></td>
|
||||
</tr>
|
||||
<tr class="even">
|
||||
<td><a href="https://packagist.org/packages/erusev/parsedown"><code>erusev/parsedown</code></a></td>
|
||||
<td style="text-align: center;">All</td>
|
||||
<td>Parse MarkDown syntax for the MarkDown plugin<a href=".html"></a></td>
|
||||
</tr>
|
||||
<tr class="odd">
|
||||
<td><a href="https://packagist.org/packages/slim/slim"><code>slim/slim</code></a></td>
|
||||
<td style="text-align: center;">All</td>
|
||||
<td>Handle routes and middleware for the REST API<a href=".html"></a></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<h3 id="extensions">Extensions</h3>
|
||||
<table style="width:19%;">
|
||||
<colgroup>
|
||||
<col style="width: 5%" />
|
||||
<col style="width: 8%" />
|
||||
<col style="width: 5%" />
|
||||
</colgroup>
|
||||
<thead>
|
||||
<tr class="header">
|
||||
<th>Extension</th>
|
||||
<th style="text-align: center;">Required?</th>
|
||||
<th>Usage</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr class="odd">
|
||||
<td><a href="http://php.net/manual/en/book.openssl.php"><code>openssl</code></a></td>
|
||||
<td style="text-align: center;">All</td>
|
||||
<td>OpenSSL, HTTPS<a href=".html"></a></td>
|
||||
</tr>
|
||||
<tr class="even">
|
||||
<td><a href="http://php.net/manual/en/book.mbstring.php"><code>php-mbstring</code></a></td>
|
||||
<td style="text-align: center;">CentOS, Fedora, RHEL, Windows</td>
|
||||
<td>multibyte (Unicode) string support<a href=".html"></a></td>
|
||||
</tr>
|
||||
<tr class="odd">
|
||||
<td><a href="http://php.net/manual/en/book.image.php"><code>php-gd</code></a></td>
|
||||
<td style="text-align: center;">optional</td>
|
||||
<td>thumbnail resizing<a href=".html"></a></td>
|
||||
</tr>
|
||||
<tr class="even">
|
||||
<td><a href="http://php.net/manual/en/book.intl.php"><code>php-intl</code></a></td>
|
||||
<td style="text-align: center;">optional</td>
|
||||
<td>localized text sorting (e.g. <code>e->è->f</code>)<a href=".html"></a></td>
|
||||
</tr>
|
||||
<tr class="odd">
|
||||
<td><a href="http://php.net/manual/en/book.curl.php"><code>php-curl</code></a></td>
|
||||
<td style="text-align: center;">optional</td>
|
||||
<td>using cURL for fetching webpages and thumbnails in a more robust way<a href=".html"></a></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
|
@ -1,175 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="generator" content="pandoc">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">
|
||||
<title>Shaarli – Server security</title>
|
||||
<style type="text/css">code{white-space: pre;}</style>
|
||||
<style type="text/css">
|
||||
div.sourceCode { overflow-x: auto; }
|
||||
table.sourceCode, tr.sourceCode, td.lineNumbers, td.sourceCode {
|
||||
margin: 0; padding: 0; vertical-align: baseline; border: none; }
|
||||
table.sourceCode { width: 100%; line-height: 100%; }
|
||||
td.lineNumbers { text-align: right; padding-right: 4px; padding-left: 4px; color: #aaaaaa; border-right: 1px solid #aaaaaa; }
|
||||
td.sourceCode { padding-left: 5px; }
|
||||
code > span.kw { color: #007020; font-weight: bold; } /* Keyword */
|
||||
code > span.dt { color: #902000; } /* DataType */
|
||||
code > span.dv { color: #40a070; } /* DecVal */
|
||||
code > span.bn { color: #40a070; } /* BaseN */
|
||||
code > span.fl { color: #40a070; } /* Float */
|
||||
code > span.ch { color: #4070a0; } /* Char */
|
||||
code > span.st { color: #4070a0; } /* String */
|
||||
code > span.co { color: #60a0b0; font-style: italic; } /* Comment */
|
||||
code > span.ot { color: #007020; } /* Other */
|
||||
code > span.al { color: #ff0000; font-weight: bold; } /* Alert */
|
||||
code > span.fu { color: #06287e; } /* Function */
|
||||
code > span.er { color: #ff0000; font-weight: bold; } /* Error */
|
||||
code > span.wa { color: #60a0b0; font-weight: bold; font-style: italic; } /* Warning */
|
||||
code > span.cn { color: #880000; } /* Constant */
|
||||
code > span.sc { color: #4070a0; } /* SpecialChar */
|
||||
code > span.vs { color: #4070a0; } /* VerbatimString */
|
||||
code > span.ss { color: #bb6688; } /* SpecialString */
|
||||
code > span.im { } /* Import */
|
||||
code > span.va { color: #19177c; } /* Variable */
|
||||
code > span.cf { color: #007020; font-weight: bold; } /* ControlFlow */
|
||||
code > span.op { color: #666666; } /* Operator */
|
||||
code > span.bu { } /* BuiltIn */
|
||||
code > span.ex { } /* Extension */
|
||||
code > span.pp { color: #bc7a00; } /* Preprocessor */
|
||||
code > span.at { color: #7d9029; } /* Attribute */
|
||||
code > span.do { color: #ba2121; font-style: italic; } /* Documentation */
|
||||
code > span.an { color: #60a0b0; font-weight: bold; font-style: italic; } /* Annotation */
|
||||
code > span.cv { color: #60a0b0; font-weight: bold; font-style: italic; } /* CommentVar */
|
||||
code > span.in { color: #60a0b0; font-weight: bold; font-style: italic; } /* Information */
|
||||
</style>
|
||||
<link rel="stylesheet" href="github-markdown.css">
|
||||
<!--[if lt IE 9]>
|
||||
<script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv-printshiv.min.js"></script>
|
||||
<![endif]-->
|
||||
</head>
|
||||
<body>
|
||||
<div id="local-sidebar">
|
||||
<ul>
|
||||
<li><a href="Home.html">Home</a></li>
|
||||
<li>Setup
|
||||
<ul>
|
||||
<li><a href="Download-and-Installation.html">Download and Installation</a></li>
|
||||
<li><a href="Upgrade-and-migration.html">Upgrade and migration</a></li>
|
||||
<li><a href="Server-requirements.html">Server requirements</a></li>
|
||||
<li><a href="Server-configuration.html">Server configuration</a></li>
|
||||
<li><a href="Server-security.html">Server security</a></li>
|
||||
<li><a href="Shaarli-configuration.html">Shaarli configuration</a></li>
|
||||
<li><a href="Plugins.html">Plugins</a></li>
|
||||
</ul></li>
|
||||
<li><a href="Docker.html">Docker</a></li>
|
||||
<li><a href="Usage.html">Usage</a>
|
||||
<ul>
|
||||
<li><a href="Sharing-button.html">Sharing button</a> (bookmarklet)</li>
|
||||
<li><a href="Browsing-and-Searching.html">Browsing and Searching</a></li>
|
||||
<li><a href="Firefox-share.html">Firefox share</a></li>
|
||||
<li><a href="RSS-feeds.html">RSS feeds</a></li>
|
||||
<li><a href="REST-API.html">REST API</a></li>
|
||||
</ul></li>
|
||||
<li>How To
|
||||
<ul>
|
||||
<li><a href="Backup,-restore,-import-and-export.html">Backup, restore, import and export</a></li>
|
||||
<li><a href="Copy-an-existing-installation-over-SSH-and-serve-it-locally.html">Copy an existing installation over SSH and serve it locally</a></li>
|
||||
<li><a href="Create-and-serve-multiple-Shaarlis-(farm).html">Create and serve multiple Shaarlis (farm)</a></li>
|
||||
<li><a href="Download-CSS-styles-from-an-OPML-list.html">Download CSS styles from an OPML list</a></li>
|
||||
<li><a href="Datastore-hacks.html">Datastore hacks</a></li>
|
||||
</ul></li>
|
||||
<li><a href="Troubleshooting.html">Troubleshooting</a></li>
|
||||
<li><a href="Development.html">Development</a>
|
||||
<ul>
|
||||
<li><a href="GnuPG-signature.html">GnuPG signature</a></li>
|
||||
<li><a href="Coding-guidelines.html">Coding guidelines</a></li>
|
||||
<li><a href="Directory-structure.html">Directory structure</a></li>
|
||||
<li><a href="3rd-party-libraries.html">3rd party libraries</a></li>
|
||||
<li><a href="Plugin-System.html">Plugin System</a></li>
|
||||
<li><a href="Release-Shaarli.html">Release Shaarli</a></li>
|
||||
<li><a href="Versioning-and-Branches.html">Versioning and Branches</a></li>
|
||||
<li><a href="Security.html">Security</a></li>
|
||||
<li><a href="Static-analysis.html">Static analysis</a></li>
|
||||
<li><a href="Theming.html">Theming</a></li>
|
||||
<li><a href="Unit-tests.html">Unit tests</a></li>
|
||||
</ul></li>
|
||||
<li>About
|
||||
<ul>
|
||||
<li><a href="FAQ.html">FAQ</a></li>
|
||||
<li><a href="Community-&-Related-software.html">Community & Related software</a></li>
|
||||
</ul></li>
|
||||
</ul>
|
||||
</div>
|
||||
<h1 id="server-security">Server security</h1>
|
||||
<h2 id="php.ini">php.ini</h2>
|
||||
<p>PHP settings are defined in:</p>
|
||||
<ul>
|
||||
<li>a main configuration file, usually found under <code>/etc/php5/php.ini</code>; some distributions provide different configuration environments, e.g.
|
||||
<ul>
|
||||
<li><code>/etc/php5/php.ini</code> - used when running console scripts</li>
|
||||
<li><code>/etc/php5/apache2/php.ini</code> - used when a client requests PHP resources from Apache</li>
|
||||
<li><code>/etc/php5/php-fpm.conf</code> - used when PHP requests are proxied to PHP-FPM</li>
|
||||
</ul></li>
|
||||
<li>additional configuration files/entries, depending on the installed/enabled extensions:
|
||||
<ul>
|
||||
<li><code>/etc/php/conf.d/xdebug.ini</code></li>
|
||||
</ul></li>
|
||||
</ul>
|
||||
<h3 id="locate-.ini-files">Locate .ini files</h3>
|
||||
<h4 id="console-environment">Console environment</h4>
|
||||
<div class="sourceCode"><pre class="sourceCode bash"><code class="sourceCode bash">$ <span class="ex">php</span> --ini
|
||||
<span class="ex">Configuration</span> File (php.ini) <span class="ex">Path</span>: /etc/php
|
||||
<span class="ex">Loaded</span> Configuration File: /etc/php/php.ini
|
||||
<span class="ex">Scan</span> for additional .ini files in: /etc/php/conf.d
|
||||
<span class="ex">Additional</span> .ini files parsed: /etc/php/conf.d/xdebug.ini</code></pre></div>
|
||||
<h4 id="server-environment">Server environment</h4>
|
||||
<ul>
|
||||
<li>create a <code>phpinfo.php</code> script located in a path supported by the web server, e.g.
|
||||
<ul>
|
||||
<li>Apache (with user dirs enabled): <code>/home/myself/public_html/phpinfo.php</code></li>
|
||||
<li><code>/var/www/test/phpinfo.php</code></li>
|
||||
</ul></li>
|
||||
<li>make sure the script is readable by the web server user/group (usually, <code>www</code>, <code>www-data</code> or <code>httpd</code>)</li>
|
||||
<li>access the script from a web browser</li>
|
||||
<li><p>look at the <em>Loaded Configuration File</em> and <em>Scan this dir for additional .ini files</em> entries</p>
|
||||
<div class="sourceCode"><pre class="sourceCode php"><code class="sourceCode php"><span class="kw"><?php</span> <span class="fu">phpinfo</span><span class="ot">();</span> <span class="kw">?></span></code></pre></div></li>
|
||||
</ul>
|
||||
<h2 id="fail2ban">fail2ban</h2>
|
||||
<p><code>fail2ban</code> is an intrusion prevention framework that reads server (Apache, SSH, etc.) and uses <code>iptables</code> profiles to block brute-force attempts:</p>
|
||||
<ul>
|
||||
<li><a href="http://www.fail2ban.org/wiki/index.php/Main_Page">Official website</a><a href=".html"></a></li>
|
||||
<li><a href="https://github.com/fail2ban/fail2ban">Source code</a><a href=".html"></a></li>
|
||||
</ul>
|
||||
<h3 id="read-shaarli-logs-to-ban-ips">Read Shaarli logs to ban IPs</h3>
|
||||
<p>Example configuration:</p>
|
||||
<ul>
|
||||
<li>allow 3 login attempts per IP address</li>
|
||||
<li>after 3 failures, permanently ban the corresponding IP adddress</li>
|
||||
</ul>
|
||||
<p><code>/etc/fail2ban/jail.local</code></p>
|
||||
<div class="sourceCode"><pre class="sourceCode ini"><code class="sourceCode ini"><span class="kw">[shaarli-auth][]</span><span class="dt">(.html)</span>
|
||||
<span class="dt">enabled </span><span class="ot">=</span><span class="st"> </span><span class="kw">true</span>
|
||||
<span class="dt">port </span><span class="ot">=</span><span class="st"> https,http</span>
|
||||
<span class="dt">filter </span><span class="ot">=</span><span class="st"> shaarli-auth</span>
|
||||
<span class="dt">logpath </span><span class="ot">=</span><span class="st"> /var/www/path/to/shaarli/data/log.txt</span>
|
||||
<span class="dt">maxretry </span><span class="ot">=</span><span class="st"> </span><span class="dv">3</span>
|
||||
<span class="dt">bantime </span><span class="ot">=</span><span class="st"> -</span><span class="dv">1</span></code></pre></div>
|
||||
<p><code>/etc/fail2ban/filter.d/shaarli-auth.conf</code></p>
|
||||
<div class="sourceCode"><pre class="sourceCode ini"><code class="sourceCode ini"><span class="kw">[INCLUDES][]</span><span class="dt">(.html)</span>
|
||||
<span class="dt">before </span><span class="ot">=</span><span class="st"> common.conf</span>
|
||||
<span class="kw">[Definition][]</span><span class="dt">(.html)</span>
|
||||
<span class="dt">failregex </span><span class="ot">=</span><span class="st"> \s-\s<HOST>\s-\sLogin failed for user.*$</span>
|
||||
<span class="dt">ignoreregex </span><span class="ot">=</span><span class="st"> </span></code></pre></div>
|
||||
<h2 id="robots---restricting-search-engines-and-web-crawler-traffic">Robots - Restricting search engines and web crawler traffic</h2>
|
||||
<p>Creating a <code>robots.txt</code> with the following contents at the root of your Shaarli installation will prevent <em>honest</em> web crawlers from indexing each and every link and Daily page from a Shaarli instance, thus getting rid of a certain amount of unsollicited network traffic.</p>
|
||||
<pre><code>User-agent: *
|
||||
Disallow: /</code></pre>
|
||||
<p>See:</p>
|
||||
<ul>
|
||||
<li><a href="http://www.robotstxt.org/" class="uri">http://www.robotstxt.org/</a></li>
|
||||
<li><a href="http://www.robotstxt.org/robotstxt.html" class="uri">http://www.robotstxt.org/robotstxt.html</a></li>
|
||||
<li><a href="http://www.robotstxt.org/meta.html" class="uri">http://www.robotstxt.org/meta.html</a></li>
|
||||
</ul>
|
||||
</body>
|
||||
</html>
|
|
@ -1,298 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="generator" content="pandoc">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">
|
||||
<title>Shaarli – Shaarli configuration</title>
|
||||
<style type="text/css">code{white-space: pre;}</style>
|
||||
<style type="text/css">
|
||||
div.sourceCode { overflow-x: auto; }
|
||||
table.sourceCode, tr.sourceCode, td.lineNumbers, td.sourceCode {
|
||||
margin: 0; padding: 0; vertical-align: baseline; border: none; }
|
||||
table.sourceCode { width: 100%; line-height: 100%; }
|
||||
td.lineNumbers { text-align: right; padding-right: 4px; padding-left: 4px; color: #aaaaaa; border-right: 1px solid #aaaaaa; }
|
||||
td.sourceCode { padding-left: 5px; }
|
||||
code > span.kw { color: #007020; font-weight: bold; } /* Keyword */
|
||||
code > span.dt { color: #902000; } /* DataType */
|
||||
code > span.dv { color: #40a070; } /* DecVal */
|
||||
code > span.bn { color: #40a070; } /* BaseN */
|
||||
code > span.fl { color: #40a070; } /* Float */
|
||||
code > span.ch { color: #4070a0; } /* Char */
|
||||
code > span.st { color: #4070a0; } /* String */
|
||||
code > span.co { color: #60a0b0; font-style: italic; } /* Comment */
|
||||
code > span.ot { color: #007020; } /* Other */
|
||||
code > span.al { color: #ff0000; font-weight: bold; } /* Alert */
|
||||
code > span.fu { color: #06287e; } /* Function */
|
||||
code > span.er { color: #ff0000; font-weight: bold; } /* Error */
|
||||
code > span.wa { color: #60a0b0; font-weight: bold; font-style: italic; } /* Warning */
|
||||
code > span.cn { color: #880000; } /* Constant */
|
||||
code > span.sc { color: #4070a0; } /* SpecialChar */
|
||||
code > span.vs { color: #4070a0; } /* VerbatimString */
|
||||
code > span.ss { color: #bb6688; } /* SpecialString */
|
||||
code > span.im { } /* Import */
|
||||
code > span.va { color: #19177c; } /* Variable */
|
||||
code > span.cf { color: #007020; font-weight: bold; } /* ControlFlow */
|
||||
code > span.op { color: #666666; } /* Operator */
|
||||
code > span.bu { } /* BuiltIn */
|
||||
code > span.ex { } /* Extension */
|
||||
code > span.pp { color: #bc7a00; } /* Preprocessor */
|
||||
code > span.at { color: #7d9029; } /* Attribute */
|
||||
code > span.do { color: #ba2121; font-style: italic; } /* Documentation */
|
||||
code > span.an { color: #60a0b0; font-weight: bold; font-style: italic; } /* Annotation */
|
||||
code > span.cv { color: #60a0b0; font-weight: bold; font-style: italic; } /* CommentVar */
|
||||
code > span.in { color: #60a0b0; font-weight: bold; font-style: italic; } /* Information */
|
||||
</style>
|
||||
<link rel="stylesheet" href="github-markdown.css">
|
||||
<!--[if lt IE 9]>
|
||||
<script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv-printshiv.min.js"></script>
|
||||
<![endif]-->
|
||||
</head>
|
||||
<body>
|
||||
<div id="local-sidebar">
|
||||
<ul>
|
||||
<li><a href="Home.html">Home</a></li>
|
||||
<li>Setup
|
||||
<ul>
|
||||
<li><a href="Download-and-Installation.html">Download and Installation</a></li>
|
||||
<li><a href="Upgrade-and-migration.html">Upgrade and migration</a></li>
|
||||
<li><a href="Server-requirements.html">Server requirements</a></li>
|
||||
<li><a href="Server-configuration.html">Server configuration</a></li>
|
||||
<li><a href="Server-security.html">Server security</a></li>
|
||||
<li><a href="Shaarli-configuration.html">Shaarli configuration</a></li>
|
||||
<li><a href="Plugins.html">Plugins</a></li>
|
||||
</ul></li>
|
||||
<li><a href="Docker.html">Docker</a></li>
|
||||
<li><a href="Usage.html">Usage</a>
|
||||
<ul>
|
||||
<li><a href="Sharing-button.html">Sharing button</a> (bookmarklet)</li>
|
||||
<li><a href="Browsing-and-Searching.html">Browsing and Searching</a></li>
|
||||
<li><a href="Firefox-share.html">Firefox share</a></li>
|
||||
<li><a href="RSS-feeds.html">RSS feeds</a></li>
|
||||
<li><a href="REST-API.html">REST API</a></li>
|
||||
</ul></li>
|
||||
<li>How To
|
||||
<ul>
|
||||
<li><a href="Backup,-restore,-import-and-export.html">Backup, restore, import and export</a></li>
|
||||
<li><a href="Copy-an-existing-installation-over-SSH-and-serve-it-locally.html">Copy an existing installation over SSH and serve it locally</a></li>
|
||||
<li><a href="Create-and-serve-multiple-Shaarlis-(farm).html">Create and serve multiple Shaarlis (farm)</a></li>
|
||||
<li><a href="Download-CSS-styles-from-an-OPML-list.html">Download CSS styles from an OPML list</a></li>
|
||||
<li><a href="Datastore-hacks.html">Datastore hacks</a></li>
|
||||
</ul></li>
|
||||
<li><a href="Troubleshooting.html">Troubleshooting</a></li>
|
||||
<li><a href="Development.html">Development</a>
|
||||
<ul>
|
||||
<li><a href="GnuPG-signature.html">GnuPG signature</a></li>
|
||||
<li><a href="Coding-guidelines.html">Coding guidelines</a></li>
|
||||
<li><a href="Directory-structure.html">Directory structure</a></li>
|
||||
<li><a href="3rd-party-libraries.html">3rd party libraries</a></li>
|
||||
<li><a href="Plugin-System.html">Plugin System</a></li>
|
||||
<li><a href="Release-Shaarli.html">Release Shaarli</a></li>
|
||||
<li><a href="Versioning-and-Branches.html">Versioning and Branches</a></li>
|
||||
<li><a href="Security.html">Security</a></li>
|
||||
<li><a href="Static-analysis.html">Static analysis</a></li>
|
||||
<li><a href="Theming.html">Theming</a></li>
|
||||
<li><a href="Unit-tests.html">Unit tests</a></li>
|
||||
</ul></li>
|
||||
<li>About
|
||||
<ul>
|
||||
<li><a href="FAQ.html">FAQ</a></li>
|
||||
<li><a href="Community-&-Related-software.html">Community & Related software</a></li>
|
||||
</ul></li>
|
||||
</ul>
|
||||
</div>
|
||||
<h1 id="shaarli-configuration">Shaarli configuration</h1>
|
||||
<h1 id="shaarli-configuration-1">Shaarli configuration</h1>
|
||||
<h2 id="foreword">Foreword</h2>
|
||||
<p><strong>Do not edit configuration options in index.php! Your changes would be lost.</strong></p>
|
||||
<p>Once your Shaarli instance is installed, the file <code>data/config.json.php</code> is generated:</p>
|
||||
<ul>
|
||||
<li>it contains all settings in JSON format, and can be edited to customize values</li>
|
||||
<li>it defines which <a href="Plugin-System">plugins</a> are enabled<a href="(.html).html">(.html)</a></li>
|
||||
<li>its values override those defined in <code>index.php</code></li>
|
||||
<li>it is wrap in a PHP comment to prevent anyone accessing it, regardless of server configuration</li>
|
||||
</ul>
|
||||
<h2 id="file-and-directory-permissions">File and directory permissions</h2>
|
||||
<p>The server process running Shaarli must have:</p>
|
||||
<ul>
|
||||
<li><code>read</code> access to the following resources:
|
||||
<ul>
|
||||
<li>PHP scripts: <code>index.php</code>, <code>application/*.php</code>, <code>plugins/*.php</code></li>
|
||||
<li>3rd party PHP and Javascript libraries: <code>inc/*.php</code>, <code>inc/*.js</code></li>
|
||||
<li>static assets:
|
||||
<ul>
|
||||
<li>CSS stylesheets: <code>inc/*.css</code></li>
|
||||
<li><code>images/*</code></li>
|
||||
</ul></li>
|
||||
<li>RainTPL templates: <code>tpl/*.html</code></li>
|
||||
</ul></li>
|
||||
<li><code>read</code>, <code>write</code> and <code>execution</code> access to the following directories:
|
||||
<ul>
|
||||
<li><code>cache</code> - thumbnail cache</li>
|
||||
<li><code>data</code> - link data store, configuration options</li>
|
||||
<li><code>pagecache</code> - Atom/RSS feed cache</li>
|
||||
<li><code>tmp</code> - RainTPL page cache</li>
|
||||
</ul></li>
|
||||
</ul>
|
||||
<p>On a Linux distribution:</p>
|
||||
<ul>
|
||||
<li>the web server user will likely be <code>www</code> or <code>http</code> (for Apache2)</li>
|
||||
<li>it will be a member of a group of the same name: <code>www:www</code>, <code>http:http</code></li>
|
||||
<li>to give it access to Shaarli, either:
|
||||
<ul>
|
||||
<li>unzip Shaarli in the default web server location (usually <code>/var/www/</code>) and set the web server user as the owner</li>
|
||||
<li>put users in the same group as the web server, and set the appropriate access rights</li>
|
||||
</ul></li>
|
||||
<li>if you have a domain / subdomain to serve Shaarli, <a href="Server-configuration">configure the server</a> accordingly<a href="(.html).html">(.html)</a></li>
|
||||
</ul>
|
||||
<h2 id="configuration">Configuration</h2>
|
||||
<p>In <code>data/config.json.php</code>.</p>
|
||||
<p>See also <a href="Plugin-System.html">Plugin System</a>.<a href=".html"></a></p>
|
||||
<h3 id="credentials">Credentials</h3>
|
||||
<blockquote>
|
||||
<p>You shouldn't edit those.</p>
|
||||
</blockquote>
|
||||
<p><strong>login</strong>: Login username.<br />
|
||||
<strong>hash</strong>: Generated password hash.<br />
|
||||
<strong>salt</strong>: Password salt.</p>
|
||||
<h3 id="general">General</h3>
|
||||
<p><strong>title</strong>: Shaarli's instance title.<br />
|
||||
<strong>header_link</strong>: Link to the homepage.<br />
|
||||
<strong>links_per_page</strong>: Number of shaares displayed per page.<br />
|
||||
<strong>timezone</strong>: See <a href="http://php.net/manual/en/timezones.php">the list of supported timezones</a>. <a href=".html"></a><br />
|
||||
<strong>enabled_plugins</strong>: List of enabled plugins.</p>
|
||||
<h3 id="security">Security</h3>
|
||||
<p><strong>session_protection_disabled</strong>: Disable session cookie hijacking protection (not recommended).<br />
|
||||
It might be useful if your IP adress often changes.<br />
|
||||
<strong>ban_after</strong>: Failed login attempts before being IP banned.<br />
|
||||
<strong>ban_duration</strong>: IP ban duration in seconds.<br />
|
||||
<strong>open_shaarli</strong>: Anyone can add a new link while logged out if enabled.<br />
|
||||
<strong>trusted_proxies</strong>: List of trusted IP which won't be banned after failed login attemps. Useful if Shaarli is behind a reverse proxy.</p>
|
||||
<h3 id="resources">Resources</h3>
|
||||
<p><strong>data_dir</strong>: Data directory.<br />
|
||||
<strong>datastore</strong>: Shaarli's links database file path.<br />
|
||||
<strong>history</strong>: Shaarli's operation history file path.<br />
|
||||
<strong>updates</strong>: File path for the ran updates file.<br />
|
||||
<strong>log</strong>: Log file path.<br />
|
||||
<strong>update_check</strong>: Last update check file path.<br />
|
||||
<strong>raintpl_tpl</strong>: Templates directory.<br />
|
||||
<strong>raintpl_tmp</strong>: Template engine cache directory.<br />
|
||||
<strong>thumbnails_cache</strong>: Thumbnails cache directory.<br />
|
||||
<strong>page_cache</strong>: Shaarli's internal cache directory.<br />
|
||||
<strong>ban_file</strong>: Banned IP file path.</p>
|
||||
<h3 id="updates">Updates</h3>
|
||||
<p><strong>check_updates</strong>: Enable or disable update check to the git repository.<br />
|
||||
<strong>check_updates_branch</strong>: Git branch used to check updates (e.g. <code>stable</code> or <code>master</code>).<br />
|
||||
<strong>check_updates_interval</strong>: Look for new version every N seconds (default: every day).</p>
|
||||
<h3 id="privacy">Privacy</h3>
|
||||
<p><strong>default_private_links</strong>: Check the private checkbox by default for every new link.<br />
|
||||
<strong>hide_public_links</strong>: All links are hidden while logged out.<br />
|
||||
<strong>hide_timestamps</strong>: Timestamps are hidden.</p>
|
||||
<h3 id="feed">Feed</h3>
|
||||
<p><strong>rss_permalinks</strong>: Enable this to redirect RSS links to Shaarli's permalinks instead of shaared URL.<br />
|
||||
<strong>show_atom</strong>: Display ATOM feed button.</p>
|
||||
<h3 id="thumbnail">Thumbnail</h3>
|
||||
<p><strong>enable_thumbnails</strong>: Enable or disable thumbnail display.<br />
|
||||
<strong>enable_localcache</strong>: Enable or disable local cache.</p>
|
||||
<h3 id="redirector">Redirector</h3>
|
||||
<p><strong>url</strong>: Redirector URL, such as <code>anonym.to</code>.<br />
|
||||
<strong>encode_url</strong>: Enable this if the redirector needs encoded URL to work properly.</p>
|
||||
<h2 id="configuration-file-example">Configuration file example</h2>
|
||||
<div class="sourceCode"><pre class="sourceCode json"><code class="sourceCode json"><span class="er"><?php</span> <span class="er">/*</span>
|
||||
<span class="fu">{</span>
|
||||
<span class="dt">"credentials"</span><span class="fu">:</span> <span class="fu">{</span>
|
||||
<span class="dt">"login"</span><span class="fu">:</span> <span class="st">"<login>"</span><span class="fu">,</span>
|
||||
<span class="dt">"hash"</span><span class="fu">:</span> <span class="st">"<password hash>"</span><span class="fu">,</span>
|
||||
<span class="dt">"salt"</span><span class="fu">:</span> <span class="st">"<password salt>"</span>
|
||||
<span class="fu">},</span>
|
||||
<span class="dt">"security"</span><span class="fu">:</span> <span class="fu">{</span>
|
||||
<span class="dt">"ban_after"</span><span class="fu">:</span> <span class="dv">4</span><span class="fu">,</span>
|
||||
<span class="dt">"session_protection_disabled"</span><span class="fu">:</span> <span class="kw">false</span><span class="fu">,</span>
|
||||
<span class="dt">"ban_duration"</span><span class="fu">:</span> <span class="dv">1800</span><span class="fu">,</span>
|
||||
<span class="dt">"trusted_proxies"</span><span class="fu">:</span> <span class="ot">[[]</span><span class="er">(.html)</span>
|
||||
<span class="st">"1.2.3.4"</span><span class="ot">,</span>
|
||||
<span class="st">"5.6.7.8"</span>
|
||||
<span class="ot">]</span>
|
||||
<span class="fu">},</span>
|
||||
<span class="dt">"resources"</span><span class="fu">:</span> <span class="fu">{</span>
|
||||
<span class="dt">"data_dir"</span><span class="fu">:</span> <span class="st">"data"</span><span class="fu">,</span>
|
||||
<span class="dt">"config"</span><span class="fu">:</span> <span class="st">"data</span><span class="ch">\/</span><span class="st">config.php"</span><span class="fu">,</span>
|
||||
<span class="dt">"datastore"</span><span class="fu">:</span> <span class="st">"data</span><span class="ch">\/</span><span class="st">datastore.php"</span><span class="fu">,</span>
|
||||
<span class="dt">"ban_file"</span><span class="fu">:</span> <span class="st">"data</span><span class="ch">\/</span><span class="st">ipbans.php"</span><span class="fu">,</span>
|
||||
<span class="dt">"updates"</span><span class="fu">:</span> <span class="st">"data</span><span class="ch">\/</span><span class="st">updates.txt"</span><span class="fu">,</span>
|
||||
<span class="dt">"log"</span><span class="fu">:</span> <span class="st">"data</span><span class="ch">\/</span><span class="st">log.txt"</span><span class="fu">,</span>
|
||||
<span class="dt">"update_check"</span><span class="fu">:</span> <span class="st">"data</span><span class="ch">\/</span><span class="st">lastupdatecheck.txt"</span><span class="fu">,</span>
|
||||
<span class="dt">"raintpl_tmp"</span><span class="fu">:</span> <span class="st">"tmp</span><span class="ch">\/</span><span class="st">"</span><span class="fu">,</span>
|
||||
<span class="dt">"raintpl_tpl"</span><span class="fu">:</span> <span class="st">"tpl</span><span class="ch">\/</span><span class="st">"</span><span class="fu">,</span>
|
||||
<span class="dt">"thumbnails_cache"</span><span class="fu">:</span> <span class="st">"cache"</span><span class="fu">,</span>
|
||||
<span class="dt">"page_cache"</span><span class="fu">:</span> <span class="st">"pagecache"</span>
|
||||
<span class="fu">},</span>
|
||||
<span class="dt">"general"</span><span class="fu">:</span> <span class="fu">{</span>
|
||||
<span class="dt">"check_updates"</span><span class="fu">:</span> <span class="kw">true</span><span class="fu">,</span>
|
||||
<span class="dt">"rss_permalinks"</span><span class="fu">:</span> <span class="kw">true</span><span class="fu">,</span>
|
||||
<span class="dt">"links_per_page"</span><span class="fu">:</span> <span class="dv">20</span><span class="fu">,</span>
|
||||
<span class="dt">"default_private_links"</span><span class="fu">:</span> <span class="kw">true</span><span class="fu">,</span>
|
||||
<span class="dt">"enable_thumbnails"</span><span class="fu">:</span> <span class="kw">true</span><span class="fu">,</span>
|
||||
<span class="dt">"enable_localcache"</span><span class="fu">:</span> <span class="kw">true</span><span class="fu">,</span>
|
||||
<span class="dt">"check_updates_branch"</span><span class="fu">:</span> <span class="st">"stable"</span><span class="fu">,</span>
|
||||
<span class="dt">"check_updates_interval"</span><span class="fu">:</span> <span class="dv">86400</span><span class="fu">,</span>
|
||||
<span class="dt">"enabled_plugins"</span><span class="fu">:</span> <span class="ot">[[]</span><span class="er">(.html)</span>
|
||||
<span class="st">"markdown"</span><span class="ot">,</span>
|
||||
<span class="st">"wallabag"</span><span class="ot">,</span>
|
||||
<span class="st">"archiveorg"</span>
|
||||
<span class="ot">]</span><span class="fu">,</span>
|
||||
<span class="dt">"timezone"</span><span class="fu">:</span> <span class="st">"Europe</span><span class="ch">\/</span><span class="st">Paris"</span><span class="fu">,</span>
|
||||
<span class="dt">"title"</span><span class="fu">:</span> <span class="st">"My Shaarli"</span><span class="fu">,</span>
|
||||
<span class="dt">"header_link"</span><span class="fu">:</span> <span class="st">"?"</span>
|
||||
<span class="fu">},</span>
|
||||
<span class="dt">"extras"</span><span class="fu">:</span> <span class="fu">{</span>
|
||||
<span class="dt">"show_atom"</span><span class="fu">:</span> <span class="kw">false</span><span class="fu">,</span>
|
||||
<span class="dt">"hide_public_links"</span><span class="fu">:</span> <span class="kw">false</span><span class="fu">,</span>
|
||||
<span class="dt">"hide_timestamps"</span><span class="fu">:</span> <span class="kw">false</span><span class="fu">,</span>
|
||||
<span class="dt">"open_shaarli"</span><span class="fu">:</span> <span class="kw">false</span><span class="fu">,</span>
|
||||
<span class="dt">"redirector"</span><span class="fu">:</span> <span class="st">"http://anonym.to/?"</span><span class="fu">,</span>
|
||||
<span class="dt">"redirector_encode_url"</span><span class="fu">:</span> <span class="kw">false</span>
|
||||
<span class="fu">},</span>
|
||||
<span class="dt">"general"</span><span class="fu">:</span> <span class="fu">{</span>
|
||||
<span class="dt">"header_link"</span><span class="fu">:</span> <span class="st">"?"</span><span class="fu">,</span>
|
||||
<span class="dt">"links_per_page"</span><span class="fu">:</span> <span class="dv">20</span><span class="fu">,</span>
|
||||
<span class="dt">"enabled_plugins"</span><span class="fu">:</span> <span class="ot">[[]</span><span class="er">(.html)</span>
|
||||
<span class="st">"markdown"</span><span class="ot">,</span>
|
||||
<span class="st">"wallabag"</span>
|
||||
<span class="ot">]</span><span class="fu">,</span>
|
||||
<span class="dt">"timezone"</span><span class="fu">:</span> <span class="st">"Europe</span><span class="ch">\/</span><span class="st">Paris"</span><span class="fu">,</span>
|
||||
<span class="dt">"title"</span><span class="fu">:</span> <span class="st">"My Shaarli"</span>
|
||||
<span class="fu">},</span>
|
||||
<span class="dt">"updates"</span><span class="fu">:</span> <span class="fu">{</span>
|
||||
<span class="dt">"check_updates"</span><span class="fu">:</span> <span class="kw">true</span><span class="fu">,</span>
|
||||
<span class="dt">"check_updates_branch"</span><span class="fu">:</span> <span class="st">"stable"</span><span class="fu">,</span>
|
||||
<span class="dt">"check_updates_interval"</span><span class="fu">:</span> <span class="dv">86400</span>
|
||||
<span class="fu">},</span>
|
||||
<span class="dt">"feed"</span><span class="fu">:</span> <span class="fu">{</span>
|
||||
<span class="dt">"rss_permalinks"</span><span class="fu">:</span> <span class="kw">true</span><span class="fu">,</span>
|
||||
<span class="dt">"show_atom"</span><span class="fu">:</span> <span class="kw">false</span>
|
||||
<span class="fu">},</span>
|
||||
<span class="dt">"privacy"</span><span class="fu">:</span> <span class="fu">{</span>
|
||||
<span class="dt">"default_private_links"</span><span class="fu">:</span> <span class="kw">true</span><span class="fu">,</span>
|
||||
<span class="dt">"hide_public_links"</span><span class="fu">:</span> <span class="kw">false</span><span class="fu">,</span>
|
||||
<span class="dt">"hide_timestamps"</span><span class="fu">:</span> <span class="kw">false</span>
|
||||
<span class="fu">},</span>
|
||||
<span class="dt">"thumbnail"</span><span class="fu">:</span> <span class="fu">{</span>
|
||||
<span class="dt">"enable_thumbnails"</span><span class="fu">:</span> <span class="kw">true</span><span class="fu">,</span>
|
||||
<span class="dt">"enable_localcache"</span><span class="fu">:</span> <span class="kw">true</span>
|
||||
<span class="fu">},</span>
|
||||
<span class="dt">"redirector"</span><span class="fu">:</span> <span class="fu">{</span>
|
||||
<span class="dt">"url"</span><span class="fu">:</span> <span class="st">"http://anonym.to/?"</span><span class="fu">,</span>
|
||||
<span class="dt">"encode_url"</span><span class="fu">:</span> <span class="kw">false</span>
|
||||
<span class="fu">},</span>
|
||||
<span class="dt">"plugins"</span><span class="fu">:</span> <span class="fu">{</span>
|
||||
<span class="dt">"WALLABAG_URL"</span><span class="fu">:</span> <span class="st">"http://demo.wallabag.org"</span><span class="fu">,</span>
|
||||
<span class="dt">"WALLABAG_VERSION"</span><span class="fu">:</span> <span class="st">"1"</span>
|
||||
<span class="fu">}</span>
|
||||
<span class="fu">}</span> <span class="er">?></span></code></pre></div>
|
||||
<h2 id="additional-configuration">Additional configuration</h2>
|
||||
<p>The playvideos plugin may require that you adapt your server's<br />
|
||||
<a href="https://github.com/shaarli/Shaarli/blob/master/plugins/playvideos/README.md#troubleshooting">Content Security Policy</a> <a href=".html"></a><br />
|
||||
configuration to work properly.<a href="(.html).html">(.html)</a></p>
|
||||
</body>
|
||||
</html>
|
|
@ -1,94 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="generator" content="pandoc">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">
|
||||
<title>Shaarli – Sharing button</title>
|
||||
<style type="text/css">code{white-space: pre;}</style>
|
||||
<link rel="stylesheet" href="github-markdown.css">
|
||||
<!--[if lt IE 9]>
|
||||
<script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv-printshiv.min.js"></script>
|
||||
<![endif]-->
|
||||
</head>
|
||||
<body>
|
||||
<div id="local-sidebar">
|
||||
<ul>
|
||||
<li><a href="Home.html">Home</a></li>
|
||||
<li>Setup
|
||||
<ul>
|
||||
<li><a href="Download-and-Installation.html">Download and Installation</a></li>
|
||||
<li><a href="Upgrade-and-migration.html">Upgrade and migration</a></li>
|
||||
<li><a href="Server-requirements.html">Server requirements</a></li>
|
||||
<li><a href="Server-configuration.html">Server configuration</a></li>
|
||||
<li><a href="Server-security.html">Server security</a></li>
|
||||
<li><a href="Shaarli-configuration.html">Shaarli configuration</a></li>
|
||||
<li><a href="Plugins.html">Plugins</a></li>
|
||||
</ul></li>
|
||||
<li><a href="Docker.html">Docker</a></li>
|
||||
<li><a href="Usage.html">Usage</a>
|
||||
<ul>
|
||||
<li><a href="Sharing-button.html">Sharing button</a> (bookmarklet)</li>
|
||||
<li><a href="Browsing-and-Searching.html">Browsing and Searching</a></li>
|
||||
<li><a href="Firefox-share.html">Firefox share</a></li>
|
||||
<li><a href="RSS-feeds.html">RSS feeds</a></li>
|
||||
<li><a href="REST-API.html">REST API</a></li>
|
||||
</ul></li>
|
||||
<li>How To
|
||||
<ul>
|
||||
<li><a href="Backup,-restore,-import-and-export.html">Backup, restore, import and export</a></li>
|
||||
<li><a href="Copy-an-existing-installation-over-SSH-and-serve-it-locally.html">Copy an existing installation over SSH and serve it locally</a></li>
|
||||
<li><a href="Create-and-serve-multiple-Shaarlis-(farm).html">Create and serve multiple Shaarlis (farm)</a></li>
|
||||
<li><a href="Download-CSS-styles-from-an-OPML-list.html">Download CSS styles from an OPML list</a></li>
|
||||
<li><a href="Datastore-hacks.html">Datastore hacks</a></li>
|
||||
</ul></li>
|
||||
<li><a href="Troubleshooting.html">Troubleshooting</a></li>
|
||||
<li><a href="Development.html">Development</a>
|
||||
<ul>
|
||||
<li><a href="GnuPG-signature.html">GnuPG signature</a></li>
|
||||
<li><a href="Coding-guidelines.html">Coding guidelines</a></li>
|
||||
<li><a href="Directory-structure.html">Directory structure</a></li>
|
||||
<li><a href="3rd-party-libraries.html">3rd party libraries</a></li>
|
||||
<li><a href="Plugin-System.html">Plugin System</a></li>
|
||||
<li><a href="Release-Shaarli.html">Release Shaarli</a></li>
|
||||
<li><a href="Versioning-and-Branches.html">Versioning and Branches</a></li>
|
||||
<li><a href="Security.html">Security</a></li>
|
||||
<li><a href="Static-analysis.html">Static analysis</a></li>
|
||||
<li><a href="Theming.html">Theming</a></li>
|
||||
<li><a href="Unit-tests.html">Unit tests</a></li>
|
||||
</ul></li>
|
||||
<li>About
|
||||
<ul>
|
||||
<li><a href="FAQ.html">FAQ</a></li>
|
||||
<li><a href="Community-&-Related-software.html">Community & Related software</a></li>
|
||||
</ul></li>
|
||||
</ul>
|
||||
</div>
|
||||
<h1 id="sharing-button">Sharing button</h1>
|
||||
<h3 id="add-the-sharing-button-bookmarklet-to-your-browser">Add the sharing button (<em>bookmarklet</em>) to your browser</h3>
|
||||
<ul>
|
||||
<li>Open your Shaarli and <code>Login</code></li>
|
||||
<li>Click the <code>Tools</code> button in the top bar</li>
|
||||
<li>Drag the <strong><code>✚Shaare link</code> button</strong>, and drop it to your browser's bookmarks bar.</li>
|
||||
</ul>
|
||||
<p><em>This bookmarklet button is compatible with Firefox, Opera, Chrome and Safari. Under Opera, you can't drag'n drop the button: You have to right-click on it and add a bookmark to your personal toolbar.</em></p>
|
||||
<p><embed src="(images/bookmarklet.png).html" /></p>
|
||||
<h3 id="share-links-using-the-bookmarklet">Share links using the <em>bookmarklet</em></h3>
|
||||
<ul>
|
||||
<li>When you are visiting a webpage you would like to share with Shaarli, click the <em>bookmarklet</em> you just added.</li>
|
||||
<li>A window opens.</li>
|
||||
<li>You can freely edit title, description, tags... to find it later using the text search or tag filtering.</li>
|
||||
<li>You will be able to edit this link later using the <embed src="(https://raw.githubusercontent.com/shaarli/Shaarli/master/images/edit_icon.png)-edit-button..html" /></li>
|
||||
<li>You can also check the “Private” box so that the link is saved but only visible to you.</li>
|
||||
<li>Click <code>Save</code>.<strong>Voilà! Your link is now shared.</strong></li>
|
||||
</ul>
|
||||
<h3 id="troubleshooting-the-bookmarklet-doesnt-work-with-a-few-website-e.g.-github.com">Troubleshooting: The bookmarklet doesn't work with a few website (e.g. Github.com)</h3>
|
||||
<p>Websites which enforce Content Security Policy (CSP), such as github.com, disallow usage of bookmarklets. Unfortunatly, there is nothing Shaarli can do about it.</p>
|
||||
<p>See <a href="https://github.com/shaarli/Shaarli#196">#196</a>.<a href=".html"></a></p>
|
||||
<p>There is an open bug for both Firefox and Chromium:</p>
|
||||
<ul>
|
||||
<li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=866522" class="uri">https://bugzilla.mozilla.org/show_bug.cgi?id=866522</a></li>
|
||||
<li><a href="https://code.google.com/p/chromium/issues/detail?id=233903" class="uri">https://code.google.com/p/chromium/issues/detail?id=233903</a></li>
|
||||
</ul>
|
||||
</body>
|
||||
</html>
|
|
@ -1,82 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="generator" content="pandoc">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">
|
||||
<title>Shaarli – Static analysis</title>
|
||||
<style type="text/css">code{white-space: pre;}</style>
|
||||
<link rel="stylesheet" href="github-markdown.css">
|
||||
<!--[if lt IE 9]>
|
||||
<script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv-printshiv.min.js"></script>
|
||||
<![endif]-->
|
||||
</head>
|
||||
<body>
|
||||
<div id="local-sidebar">
|
||||
<ul>
|
||||
<li><a href="Home.html">Home</a></li>
|
||||
<li>Setup
|
||||
<ul>
|
||||
<li><a href="Download-and-Installation.html">Download and Installation</a></li>
|
||||
<li><a href="Upgrade-and-migration.html">Upgrade and migration</a></li>
|
||||
<li><a href="Server-requirements.html">Server requirements</a></li>
|
||||
<li><a href="Server-configuration.html">Server configuration</a></li>
|
||||
<li><a href="Server-security.html">Server security</a></li>
|
||||
<li><a href="Shaarli-configuration.html">Shaarli configuration</a></li>
|
||||
<li><a href="Plugins.html">Plugins</a></li>
|
||||
</ul></li>
|
||||
<li><a href="Docker.html">Docker</a></li>
|
||||
<li><a href="Usage.html">Usage</a>
|
||||
<ul>
|
||||
<li><a href="Sharing-button.html">Sharing button</a> (bookmarklet)</li>
|
||||
<li><a href="Browsing-and-Searching.html">Browsing and Searching</a></li>
|
||||
<li><a href="Firefox-share.html">Firefox share</a></li>
|
||||
<li><a href="RSS-feeds.html">RSS feeds</a></li>
|
||||
<li><a href="REST-API.html">REST API</a></li>
|
||||
</ul></li>
|
||||
<li>How To
|
||||
<ul>
|
||||
<li><a href="Backup,-restore,-import-and-export.html">Backup, restore, import and export</a></li>
|
||||
<li><a href="Copy-an-existing-installation-over-SSH-and-serve-it-locally.html">Copy an existing installation over SSH and serve it locally</a></li>
|
||||
<li><a href="Create-and-serve-multiple-Shaarlis-(farm).html">Create and serve multiple Shaarlis (farm)</a></li>
|
||||
<li><a href="Download-CSS-styles-from-an-OPML-list.html">Download CSS styles from an OPML list</a></li>
|
||||
<li><a href="Datastore-hacks.html">Datastore hacks</a></li>
|
||||
</ul></li>
|
||||
<li><a href="Troubleshooting.html">Troubleshooting</a></li>
|
||||
<li><a href="Development.html">Development</a>
|
||||
<ul>
|
||||
<li><a href="GnuPG-signature.html">GnuPG signature</a></li>
|
||||
<li><a href="Coding-guidelines.html">Coding guidelines</a></li>
|
||||
<li><a href="Directory-structure.html">Directory structure</a></li>
|
||||
<li><a href="3rd-party-libraries.html">3rd party libraries</a></li>
|
||||
<li><a href="Plugin-System.html">Plugin System</a></li>
|
||||
<li><a href="Release-Shaarli.html">Release Shaarli</a></li>
|
||||
<li><a href="Versioning-and-Branches.html">Versioning and Branches</a></li>
|
||||
<li><a href="Security.html">Security</a></li>
|
||||
<li><a href="Static-analysis.html">Static analysis</a></li>
|
||||
<li><a href="Theming.html">Theming</a></li>
|
||||
<li><a href="Unit-tests.html">Unit tests</a></li>
|
||||
</ul></li>
|
||||
<li>About
|
||||
<ul>
|
||||
<li><a href="FAQ.html">FAQ</a></li>
|
||||
<li><a href="Community-&-Related-software.html">Community & Related software</a></li>
|
||||
</ul></li>
|
||||
</ul>
|
||||
</div>
|
||||
<h1 id="static-analysis">Static analysis</h1>
|
||||
<h2 id="wip">WIP</h2>
|
||||
<p>This topic is currently being discussed here:</p>
|
||||
<ul>
|
||||
<li><a href="https://github.com/shaarli/Shaarli/issues/95">Fix coding style (static analysis)</a> (#95)<a href=".html"></a></li>
|
||||
<li><a href="https://github.com/shaarli/Shaarli/issues/130">Continuous Integration tools & features</a> (#130)<a href=".html"></a></li>
|
||||
</ul>
|
||||
<h3 id="usage">Usage</h3>
|
||||
<p>Static analysis tools can be installed with Composer, and used through Shaarli's <a href="https://github.com/shaarli/Shaarli/blob/master/Makefile">Makefile</a>.<a href=".html"></a></p>
|
||||
<p>For an overview of the available features, see:</p>
|
||||
<ul>
|
||||
<li><a href="https://github.com/shaarli/Shaarli/pull/124">Code quality: Makefile to run static code checkers</a> (#124)<a href=".html"></a></li>
|
||||
<li><a href="https://github.com/shaarli/Shaarli/pull/276">Run PHPCS against different coding standards</a> (#276)<a href=".html"></a></li>
|
||||
</ul>
|
||||
</body>
|
||||
</html>
|
182
doc/Theming.html
182
doc/Theming.html
|
@ -1,182 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="generator" content="pandoc">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">
|
||||
<title>Shaarli – Theming</title>
|
||||
<style type="text/css">code{white-space: pre;}</style>
|
||||
<style type="text/css">
|
||||
div.sourceCode { overflow-x: auto; }
|
||||
table.sourceCode, tr.sourceCode, td.lineNumbers, td.sourceCode {
|
||||
margin: 0; padding: 0; vertical-align: baseline; border: none; }
|
||||
table.sourceCode { width: 100%; line-height: 100%; }
|
||||
td.lineNumbers { text-align: right; padding-right: 4px; padding-left: 4px; color: #aaaaaa; border-right: 1px solid #aaaaaa; }
|
||||
td.sourceCode { padding-left: 5px; }
|
||||
code > span.kw { color: #007020; font-weight: bold; } /* Keyword */
|
||||
code > span.dt { color: #902000; } /* DataType */
|
||||
code > span.dv { color: #40a070; } /* DecVal */
|
||||
code > span.bn { color: #40a070; } /* BaseN */
|
||||
code > span.fl { color: #40a070; } /* Float */
|
||||
code > span.ch { color: #4070a0; } /* Char */
|
||||
code > span.st { color: #4070a0; } /* String */
|
||||
code > span.co { color: #60a0b0; font-style: italic; } /* Comment */
|
||||
code > span.ot { color: #007020; } /* Other */
|
||||
code > span.al { color: #ff0000; font-weight: bold; } /* Alert */
|
||||
code > span.fu { color: #06287e; } /* Function */
|
||||
code > span.er { color: #ff0000; font-weight: bold; } /* Error */
|
||||
code > span.wa { color: #60a0b0; font-weight: bold; font-style: italic; } /* Warning */
|
||||
code > span.cn { color: #880000; } /* Constant */
|
||||
code > span.sc { color: #4070a0; } /* SpecialChar */
|
||||
code > span.vs { color: #4070a0; } /* VerbatimString */
|
||||
code > span.ss { color: #bb6688; } /* SpecialString */
|
||||
code > span.im { } /* Import */
|
||||
code > span.va { color: #19177c; } /* Variable */
|
||||
code > span.cf { color: #007020; font-weight: bold; } /* ControlFlow */
|
||||
code > span.op { color: #666666; } /* Operator */
|
||||
code > span.bu { } /* BuiltIn */
|
||||
code > span.ex { } /* Extension */
|
||||
code > span.pp { color: #bc7a00; } /* Preprocessor */
|
||||
code > span.at { color: #7d9029; } /* Attribute */
|
||||
code > span.do { color: #ba2121; font-style: italic; } /* Documentation */
|
||||
code > span.an { color: #60a0b0; font-weight: bold; font-style: italic; } /* Annotation */
|
||||
code > span.cv { color: #60a0b0; font-weight: bold; font-style: italic; } /* CommentVar */
|
||||
code > span.in { color: #60a0b0; font-weight: bold; font-style: italic; } /* Information */
|
||||
</style>
|
||||
<link rel="stylesheet" href="github-markdown.css">
|
||||
<!--[if lt IE 9]>
|
||||
<script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv-printshiv.min.js"></script>
|
||||
<![endif]-->
|
||||
</head>
|
||||
<body>
|
||||
<div id="local-sidebar">
|
||||
<ul>
|
||||
<li><a href="Home.html">Home</a></li>
|
||||
<li>Setup
|
||||
<ul>
|
||||
<li><a href="Download-and-Installation.html">Download and Installation</a></li>
|
||||
<li><a href="Upgrade-and-migration.html">Upgrade and migration</a></li>
|
||||
<li><a href="Server-requirements.html">Server requirements</a></li>
|
||||
<li><a href="Server-configuration.html">Server configuration</a></li>
|
||||
<li><a href="Server-security.html">Server security</a></li>
|
||||
<li><a href="Shaarli-configuration.html">Shaarli configuration</a></li>
|
||||
<li><a href="Plugins.html">Plugins</a></li>
|
||||
</ul></li>
|
||||
<li><a href="Docker.html">Docker</a></li>
|
||||
<li><a href="Usage.html">Usage</a>
|
||||
<ul>
|
||||
<li><a href="Sharing-button.html">Sharing button</a> (bookmarklet)</li>
|
||||
<li><a href="Browsing-and-Searching.html">Browsing and Searching</a></li>
|
||||
<li><a href="Firefox-share.html">Firefox share</a></li>
|
||||
<li><a href="RSS-feeds.html">RSS feeds</a></li>
|
||||
<li><a href="REST-API.html">REST API</a></li>
|
||||
</ul></li>
|
||||
<li>How To
|
||||
<ul>
|
||||
<li><a href="Backup,-restore,-import-and-export.html">Backup, restore, import and export</a></li>
|
||||
<li><a href="Copy-an-existing-installation-over-SSH-and-serve-it-locally.html">Copy an existing installation over SSH and serve it locally</a></li>
|
||||
<li><a href="Create-and-serve-multiple-Shaarlis-(farm).html">Create and serve multiple Shaarlis (farm)</a></li>
|
||||
<li><a href="Download-CSS-styles-from-an-OPML-list.html">Download CSS styles from an OPML list</a></li>
|
||||
<li><a href="Datastore-hacks.html">Datastore hacks</a></li>
|
||||
</ul></li>
|
||||
<li><a href="Troubleshooting.html">Troubleshooting</a></li>
|
||||
<li><a href="Development.html">Development</a>
|
||||
<ul>
|
||||
<li><a href="GnuPG-signature.html">GnuPG signature</a></li>
|
||||
<li><a href="Coding-guidelines.html">Coding guidelines</a></li>
|
||||
<li><a href="Directory-structure.html">Directory structure</a></li>
|
||||
<li><a href="3rd-party-libraries.html">3rd party libraries</a></li>
|
||||
<li><a href="Plugin-System.html">Plugin System</a></li>
|
||||
<li><a href="Release-Shaarli.html">Release Shaarli</a></li>
|
||||
<li><a href="Versioning-and-Branches.html">Versioning and Branches</a></li>
|
||||
<li><a href="Security.html">Security</a></li>
|
||||
<li><a href="Static-analysis.html">Static analysis</a></li>
|
||||
<li><a href="Theming.html">Theming</a></li>
|
||||
<li><a href="Unit-tests.html">Unit tests</a></li>
|
||||
</ul></li>
|
||||
<li>About
|
||||
<ul>
|
||||
<li><a href="FAQ.html">FAQ</a></li>
|
||||
<li><a href="Community-&-Related-software.html">Community & Related software</a></li>
|
||||
</ul></li>
|
||||
</ul>
|
||||
</div>
|
||||
<h1 id="theming">Theming</h1>
|
||||
<h2 id="foreword">Foreword</h2>
|
||||
<p>There are two ways of customizing how Shaarli looks:</p>
|
||||
<ol>
|
||||
<li>by using a custom CSS to override Shaarli's CSS</li>
|
||||
<li>by using a full theme that provides its own RainTPL templates, CSS and Javascript resources</li>
|
||||
</ol>
|
||||
<h2 id="custom-css">Custom CSS</h2>
|
||||
<p>Shaarli's appearance can be modified by adding CSS rules to:</p>
|
||||
<ul>
|
||||
<li>Shaarli < <code>v0.9.0</code>: <code>inc/user.css</code></li>
|
||||
<li>Shaarli >= <code>v0.9.0</code>: <code>data/user.css</code></li>
|
||||
</ul>
|
||||
<p>This file allows overriding rules defined in the template CSS files (only add changed rules), or define a whole new theme.</p>
|
||||
<p><strong>Note</strong>: Do not edit <code>tpl/default/css/shaarli.css</code>! Your changes would be overridden when updating Shaarli.</p>
|
||||
<p>See also <a href="Download-CSS-styles-from-an-OPML-list.html">Download CSS styles from an OPML list</a></p>
|
||||
<h2 id="themes">Themes</h2>
|
||||
<p><em>WARNING - This feature is currently being worked on and will be improved in the next releases. Experimental.</em></p>
|
||||
<p>Installation:</p>
|
||||
<ul>
|
||||
<li>find a theme you'd like to install</li>
|
||||
<li>copy or clone the theme folder under <code>tpl/<a_sweet_theme></code></li>
|
||||
<li>enable the theme:
|
||||
<ul>
|
||||
<li>Shaarli < <code>v0.9.0</code>: edit <code>data/config.json.php</code> and set the value of <code>raintpl_tpl</code> to the new theme name:<br />
|
||||
<code>"raintpl_tpl": "tpl\/my-template\/"</code></li>
|
||||
<li>Shaarli >= <code>v0.9.0</code>: select the theme through the <em>Tools</em> page</li>
|
||||
</ul></li>
|
||||
</ul>
|
||||
<h2 id="community-css-themes">Community CSS & themes</h2>
|
||||
<h3 id="custom-css-1">Custom CSS</h3>
|
||||
<ul>
|
||||
<li><a href="https://github.com/mrjovanovic/serious-theme-shaarli">mrjovanovic/serious-theme-shaarli</a> - A serious theme for Shaarli<a href=".html"></a></li>
|
||||
<li><a href="https://github.com/shaarli/shaarli-themes">shaarli/shaarli-themes</a><a href=".html"></a></li>
|
||||
</ul>
|
||||
<h3 id="themes-1">Themes</h3>
|
||||
<ul>
|
||||
<li><a href="https://github.com/AkibaTech/Shaarli---SuperHero-Theme">AkibaTech/Shaarli Superhero Theme</a> - A template/theme for Shaarli<a href=".html"></a></li>
|
||||
<li><a href="https://github.com/alexisju/albinomouse-template">alexisju/albinomouse-template</a> - A full template for Shaarli<a href=".html"></a></li>
|
||||
<li><a href="https://github.com/ArthurHoaro/shaarli-launch">ArthurHoaro/shaarli-launch</a> - Customizable Shaarli theme<a href=".html"></a></li>
|
||||
<li><a href="https://github.com/dhoko/ShaarliTemplate">dhoko/ShaarliTemplate</a> - A template/theme for Shaarli<a href=".html"></a></li>
|
||||
<li><a href="https://github.com/kalvn/shaarli-blocks">kalvn/shaarli-blocks</a> - A template/theme for Shaarli<a href=".html"></a></li>
|
||||
<li><a href="https://github.com/kalvn/Shaarli-Material">kalvn/Shaarli-Material</a> - A theme (template) based on Google's Material Design for Shaarli, the superfast delicious clone<a href=".html"></a></li>
|
||||
<li><a href="https://github.com/ManufacturaInd/shaarli-2004licious-theme">ManufacturaInd/shaarli-2004licious-theme</a> - A template/theme as a humble homage to the early looks of the del.icio.us site<a href=".html"></a></li>
|
||||
</ul>
|
||||
<h3 id="shaarli-forks">Shaarli forks</h3>
|
||||
<ul>
|
||||
<li><a href="https://github.com/misterair/limonade">misterair/Limonade</a> - A fork of (legacy) Shaarli with a new template<a href=".html"></a></li>
|
||||
<li><a href="https://github.com/vivienhaese/shaarlitheme">vivienhaese/shaarlitheme</a> - A Shaarli fork meant to be run in an openshift instance<a href=".html"></a></li>
|
||||
</ul>
|
||||
<h2 id="example-installation-albinomouse-theme">Example installation: AlbinoMouse theme</h2>
|
||||
<p>With the following configuration:</p>
|
||||
<ul>
|
||||
<li>Apache 2 / PHP 5.6</li>
|
||||
<li>user sites are enabled, e.g. <code>/home/user/public_html/somedir</code> is served as <code>http://localhost/~user/somedir</code></li>
|
||||
<li><code>http</code> is the name of the Apache user</li>
|
||||
</ul>
|
||||
<div class="sourceCode"><pre class="sourceCode bash"><code class="sourceCode bash">$ <span class="bu">cd</span> ~/public_html
|
||||
|
||||
<span class="co"># clone repositories</span>
|
||||
$ <span class="fu">git</span> clone https://github.com/shaarli/Shaarli.git shaarli
|
||||
$ <span class="bu">pushd</span> shaarli/tpl
|
||||
$ <span class="fu">git</span> clone https://github.com/alexisju/albinomouse-template.git
|
||||
$ <span class="bu">popd</span>
|
||||
|
||||
<span class="co"># set access rights for Apache</span>
|
||||
$ <span class="fu">chgrp</span> -R http shaarli
|
||||
$ <span class="fu">chmod</span> g+rwx shaarli shaarli/cache shaarli/data shaarli/pagecache shaarli/tmp</code></pre></div>
|
||||
<p>Get config written:</p>
|
||||
<ul>
|
||||
<li>go to the freshly installed site</li>
|
||||
<li>fill the install form</li>
|
||||
<li>log in to Shaarli</li>
|
||||
</ul>
|
||||
<p>Edit Shaarli's <a href="configuration%7CShaarli-configuration.html">configuration|Shaarli configuration</a>:</p>
|
||||
<div class="sourceCode"><pre class="sourceCode bash"><code class="sourceCode bash"><span class="co"># the file should be owned by Apache, thus not writeable => sudo</span>
|
||||
$ <span class="fu">sudo</span> sed -i s=tpl=tpl/albinomouse-template=g shaarli/data/config.php</code></pre></div>
|
||||
</body>
|
||||
</html>
|
|
@ -1,202 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="generator" content="pandoc">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">
|
||||
<title>Shaarli – Troubleshooting</title>
|
||||
<style type="text/css">code{white-space: pre;}</style>
|
||||
<style type="text/css">
|
||||
div.sourceCode { overflow-x: auto; }
|
||||
table.sourceCode, tr.sourceCode, td.lineNumbers, td.sourceCode {
|
||||
margin: 0; padding: 0; vertical-align: baseline; border: none; }
|
||||
table.sourceCode { width: 100%; line-height: 100%; }
|
||||
td.lineNumbers { text-align: right; padding-right: 4px; padding-left: 4px; color: #aaaaaa; border-right: 1px solid #aaaaaa; }
|
||||
td.sourceCode { padding-left: 5px; }
|
||||
code > span.kw { color: #007020; font-weight: bold; } /* Keyword */
|
||||
code > span.dt { color: #902000; } /* DataType */
|
||||
code > span.dv { color: #40a070; } /* DecVal */
|
||||
code > span.bn { color: #40a070; } /* BaseN */
|
||||
code > span.fl { color: #40a070; } /* Float */
|
||||
code > span.ch { color: #4070a0; } /* Char */
|
||||
code > span.st { color: #4070a0; } /* String */
|
||||
code > span.co { color: #60a0b0; font-style: italic; } /* Comment */
|
||||
code > span.ot { color: #007020; } /* Other */
|
||||
code > span.al { color: #ff0000; font-weight: bold; } /* Alert */
|
||||
code > span.fu { color: #06287e; } /* Function */
|
||||
code > span.er { color: #ff0000; font-weight: bold; } /* Error */
|
||||
code > span.wa { color: #60a0b0; font-weight: bold; font-style: italic; } /* Warning */
|
||||
code > span.cn { color: #880000; } /* Constant */
|
||||
code > span.sc { color: #4070a0; } /* SpecialChar */
|
||||
code > span.vs { color: #4070a0; } /* VerbatimString */
|
||||
code > span.ss { color: #bb6688; } /* SpecialString */
|
||||
code > span.im { } /* Import */
|
||||
code > span.va { color: #19177c; } /* Variable */
|
||||
code > span.cf { color: #007020; font-weight: bold; } /* ControlFlow */
|
||||
code > span.op { color: #666666; } /* Operator */
|
||||
code > span.bu { } /* BuiltIn */
|
||||
code > span.ex { } /* Extension */
|
||||
code > span.pp { color: #bc7a00; } /* Preprocessor */
|
||||
code > span.at { color: #7d9029; } /* Attribute */
|
||||
code > span.do { color: #ba2121; font-style: italic; } /* Documentation */
|
||||
code > span.an { color: #60a0b0; font-weight: bold; font-style: italic; } /* Annotation */
|
||||
code > span.cv { color: #60a0b0; font-weight: bold; font-style: italic; } /* CommentVar */
|
||||
code > span.in { color: #60a0b0; font-weight: bold; font-style: italic; } /* Information */
|
||||
</style>
|
||||
<link rel="stylesheet" href="github-markdown.css">
|
||||
<!--[if lt IE 9]>
|
||||
<script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv-printshiv.min.js"></script>
|
||||
<![endif]-->
|
||||
</head>
|
||||
<body>
|
||||
<div id="local-sidebar">
|
||||
<ul>
|
||||
<li><a href="Home.html">Home</a></li>
|
||||
<li>Setup
|
||||
<ul>
|
||||
<li><a href="Download-and-Installation.html">Download and Installation</a></li>
|
||||
<li><a href="Upgrade-and-migration.html">Upgrade and migration</a></li>
|
||||
<li><a href="Server-requirements.html">Server requirements</a></li>
|
||||
<li><a href="Server-configuration.html">Server configuration</a></li>
|
||||
<li><a href="Server-security.html">Server security</a></li>
|
||||
<li><a href="Shaarli-configuration.html">Shaarli configuration</a></li>
|
||||
<li><a href="Plugins.html">Plugins</a></li>
|
||||
</ul></li>
|
||||
<li><a href="Docker.html">Docker</a></li>
|
||||
<li><a href="Usage.html">Usage</a>
|
||||
<ul>
|
||||
<li><a href="Sharing-button.html">Sharing button</a> (bookmarklet)</li>
|
||||
<li><a href="Browsing-and-Searching.html">Browsing and Searching</a></li>
|
||||
<li><a href="Firefox-share.html">Firefox share</a></li>
|
||||
<li><a href="RSS-feeds.html">RSS feeds</a></li>
|
||||
<li><a href="REST-API.html">REST API</a></li>
|
||||
</ul></li>
|
||||
<li>How To
|
||||
<ul>
|
||||
<li><a href="Backup,-restore,-import-and-export.html">Backup, restore, import and export</a></li>
|
||||
<li><a href="Copy-an-existing-installation-over-SSH-and-serve-it-locally.html">Copy an existing installation over SSH and serve it locally</a></li>
|
||||
<li><a href="Create-and-serve-multiple-Shaarlis-(farm).html">Create and serve multiple Shaarlis (farm)</a></li>
|
||||
<li><a href="Download-CSS-styles-from-an-OPML-list.html">Download CSS styles from an OPML list</a></li>
|
||||
<li><a href="Datastore-hacks.html">Datastore hacks</a></li>
|
||||
</ul></li>
|
||||
<li><a href="Troubleshooting.html">Troubleshooting</a></li>
|
||||
<li><a href="Development.html">Development</a>
|
||||
<ul>
|
||||
<li><a href="GnuPG-signature.html">GnuPG signature</a></li>
|
||||
<li><a href="Coding-guidelines.html">Coding guidelines</a></li>
|
||||
<li><a href="Directory-structure.html">Directory structure</a></li>
|
||||
<li><a href="3rd-party-libraries.html">3rd party libraries</a></li>
|
||||
<li><a href="Plugin-System.html">Plugin System</a></li>
|
||||
<li><a href="Release-Shaarli.html">Release Shaarli</a></li>
|
||||
<li><a href="Versionin |