295 lines
21 KiB
HTML
295 lines
21 KiB
HTML
<!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>
|
||
</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="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>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>theme</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">"theme"</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>
|