Sophie

Sophie

distrib > Mageia > 6 > x86_64 > media > core-updates > by-pkgid > a2ac79ac252ef7b89f2f0fc449728720 > files > 366

ikiwiki-3.20190228-1.1.mga6.noarch.rpm

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>attach (third party plugin)</title>
<meta name="viewport" content="width=device-width, initial-scale=1" />

<link rel="stylesheet" href="../../style.css" type="text/css" />

<link rel="stylesheet" href="../../local.css" type="text/css" />










</head>
<body>

<div class="page">

<div class="pageheader">
<div class="header">
<span>
<span class="parentlinks">

<a href="../../index.html">ikiwiki</a>/ 

<a href="../../plugins.html">plugins</a>/ 

<a href="../contrib.html">contrib</a>/ 

</span>
<span class="title">
attach (third party plugin)

</span>
</span>



</div>









</div>





<div id="pagebody">

<div id="content" role="main">
<p><span class="infobox">
Plugin: attach<br />
Author: <span class="createlink">Ben</span><br />
Included in ikiwiki: no<br />
Enabled by default: no<br />
Included in <a href="../goodstuff.html">goodstuff</a>: no<br />
Currently enabled: no<br />
</span></p>

<p><strong>Note: This plugin is currently pending upload. It is also most assuredly beta.</strong></p>

<p>Most of this plugin's functionality is configured in the IkiWiki setup file (<code>ìkiwiki.setup</code>, by default), in an <code>attach</code> block. A minimum configuration looks something like this:</p>

<pre><code>attach =&gt; {
enabled =&gt; 1, #If false, no new attachments are allowed via the web interface
every_page =&gt; 1, #Toggles whether attachments are allowed on every page of the IkiWiki
},
</code></pre>

<p>This configuration allows any user of the IkiWiki to attach any file to any page of the IkiWiki. By default, each file must be no bigger than 1MB. </p>

<h2>Configuration Options</h2>

<p>Each option is specified in the same format as above: the name is a hash key inside of an attach block, and the value is the hash key.</p>

<ul>
<li><strong>ban_ips</strong> - A space separated list of regular expressions corresponding to IP addresses which are prohibited from attaching files. IP address filtering is described in further detail below.</li>
<li><strong>enabled</strong> -Toggles whether attachments are allowed. If false, the attachment form will not appear on any pages, nor will the CGI accept any new uploads. Details of existing attachments will continue to be displayed on the appropriate pages, however. </li>
<li><strong>max_kbs</strong> - The maximum size in kilobytes an attachment can be. If an upload's size exceeds this value, it will be prohibited. By default, this value is <em>1024</em>. If set to <em>0</em>, attachments of any size are permitted. </li>
<li><strong>dir</strong> - The name of the temporary directory, relative to the source directory, in which attachments are stored pending validation. The value is prefixed with a period so that it is hidden on *nix systems. The default value is <em>attachments</em>, and there shouldn't be any need to change this.</li>
<li><strong>mime_strategy</strong> - The method of filtering attachments on their MIME type. Permissible values are <em>allow,deny</em> and <em>deny,allow</em>. MIME filtering is described in further detail below.</li>
<li><strong>mime_allow</strong> - A space-separated list of MIME types, used in conjunction with <em>mime_strategy</em> and <em>mime_deny</em>. MIME filtering is described in further detail below.</li>
<li><strong>mime_deny</strong> - A space-separated list of MIME types, used in conjunction with <em>mime_strategy</em> and <em>mime_allow</em>. MIME filtering is described in further detail below.</li>
</ul>

<h2>MIME Filtering</h2>

<p>Attachments may be filtered on the basis of their MIME type. For instance, an administrator may wish to prohibit video files from being uploaded to his IkiWiki. This is achieved by a "MIME strategy", a list of MIME types to allow, and a list of MIME types to deny.</p>

<p>With an <em>allow,deny</em> strategy: "First, all Allow directives are evaluated; at least one must match, or the [attachment] is rejected. Next, all Deny directives are evaluated. If any matches, the [attachment] is rejected. Last, any requests which do not match an Allow or a Deny directive are denied by default." (Excerpt from <a href="http://httpd.apache.org/docs/2.0/mod/mod_access.html">Apache Module: mod_access</a>  on which this feature is based).</p>

<p>With a <em>deny,allow</em> strategy: "First, all Deny  directives are evaluated; if any match, the request is denied unless it also matches an Allow directive. Any requests which do not match any Allow or Deny directives are permitted." (Excerpt from <a href="http://httpd.apache.org/docs/2.0/mod/mod_access.html">Apache Module: mod_access</a> on which this feature is based).</p>

<h2>IP Address Filtering</h2>

<p>Attachments added via the web can be denied on the basis of their uploader's IP address matching a blacklist.</p>

<p>The blacklist is defined as a space-separated list of regular expressions as a value of the <em>ban_ips</em> setting. For example, a value of '3 127. ^2[45]' blocks all addresses containing the number 3, containing the octet 127, and starting with a 2 followed by a 4 or 5.</p>

<h2>Allowing Attachments Only on Specific Pages</h2>

<p>An administrator may wish to only allow users to attach files to pages which he has chosen. To do so, he must set the <em>every_page</em> option to <em>0</em>, then an <em>attach</em> preprocessor directive ("[[attach ]] to the pages on which attachments should be allowed.</p>

<h2>Attaching Files from the Command Line</h2>

<p>An attachment is simply a non-source file located in the source directory of the IkiWiki. The directory in which the file is located determines which page it is attached to. For example, to attach <em>song.ogg</em> to the <em>music</em> page, an administrator would simply create a <em>music</em> sub-directory of the source directory, if it doesn't already exist, and move <em>song.ogg</em> inside of it.</p>

<p>Files attached in this manner are not subject to any of the validation procedures. They can be of arbitrary size and type.</p>

</div>







</div>

<div id="footer" class="pagefooter" role="contentinfo">

<div id="pageinfo">






<div id="backlinks">
Links:

<a href="../../soc.html">soc</a>


</div>






<div class="pagedate">
Last edited <span class="date">Tue Feb 26 23:01:54 2019</span>
<!-- Created <span class="date">Tue Feb 26 23:01:54 2019</span> -->
</div>

</div>


<!-- from ikiwiki -->
</div>

</div>

</body>
</html>