<title>Configuring a File Base | ENiGMA½ BBS Software</title>
<metaname="generator"content="Jekyll v4.2.1"/>
<metaproperty="og:title"content="Configuring a File Base"/>
<metaproperty="og:locale"content="en_US"/>
<metaname="description"content="Configuring a File Base ENiGMA½ offers a powerful and flexible file base. Configuration of file the file base and areas is handled via the fileBase section of config.hjson."/>
<metaproperty="og:description"content="Configuring a File Base ENiGMA½ offers a powerful and flexible file base. Configuration of file the file base and areas is handled via the fileBase section of config.hjson."/>
{"description":"Configuring a File Base ENiGMA½ offers a powerful and flexible file base. Configuration of file the file base and areas is handled via the fileBase section of config.hjson.","url":"/enigma-bbs/filebase/first-file-area.html","publisher":{"@type":"Organization","logo":{"@type":"ImageObject","url":"/enigma-bbs/assets/images/enigma-logo.png"}},"@type":"BlogPosting","headline":"Configuring a File Base","dateModified":"2022-08-13T01:22:10+00:00","datePublished":"2022-08-13T01:22:10+00:00","mainEntityOfPage":{"@type":"WebPage","@id":"/enigma-bbs/filebase/first-file-area.html"},"@context":"https://schema.org"}</script>
<h1class="page-title">Configuring a File Base</h1>
<h2id="configuring-a-file-base">Configuring a File Base</h2>
<p>ENiGMA½ offers a powerful and flexible file base. Configuration of file the file base and areas is handled via the <codeclass="language-plaintext highlighter-rouge">fileBase</code> section of <codeclass="language-plaintext highlighter-rouge">config.hjson</code>.</p>
<h2id="enigma-file-base-key-concepts">ENiGMA½ File Base Key Concepts</h2>
<p>First, there are some core concepts you should understand:</p>
<ul>
<li>Storage Tags</li>
<li>Area Tags</li>
</ul>
<h3id="storage-tags">Storage Tags</h3>
<p><em>Storage Tags</em> define paths to physical (filesystem) storage locations that are referenced in a file <em>Area</em> entry. Each entry may be either a fully qualified path or a relative path. Relative paths are relative to the value set by the <codeclass="language-plaintext highlighter-rouge">fileBase.areaStoragePrefix</code> key (defaults to <codeclass="language-plaintext highlighter-rouge">/path/to/enigma-bbs/file_base</code>).</p>
<p>Below is an example defining some storage tags using the relative and fully qualified forms:</p>
<p><imgclass="emoji"title=":memo:"alt=":memo:"src="https://github.githubassets.com/images/icons/emoji/unicode/1f4dd.png"height="20"width="20"> On their own, storage tags don’t do anything — they are simply pointers to storage locations on your system.</p>
<p><imgclass="emoji"title=":warning:"alt=":warning:"src="https://github.githubassets.com/images/icons/emoji/unicode/26a0.png"height="20"width="20"> Remember that paths are case sensitive on most non-Windows systems!</p>
<h3id="areas">Areas</h3>
<p>File base <em>Areas</em> are configured using the <codeclass="language-plaintext highlighter-rouge">fileBase.areas</code> configuration block in <codeclass="language-plaintext highlighter-rouge">config.hjson</code>. Each entry’s block starts with an <em>area tag</em>. Valid members for an area are as follows:</p>
<td>An array of storage tags for physical storage backing of the files in this area. If uploads are enabled for this area, <strong>first</strong> storage tag location is utilized!</td>
<td>Set to an array of strings or comma separated list to provide <em>default</em> hash tags for this area.</td>
</tr>
</tbody>
</table>
<p>Example areas section:</p>
<pre><codeclass="language-hjson">areas: {
retro_pc: { // an area tag!
name: Retro PC
desc: Oldschool PC/DOS
storageTags: [ "retro_pc_dos", "retro_pc_bbs" ]
hashTags: ["retro", "pc", "dos" ]
}
}
</code></pre>
<p>The above example defines an area called “Retro PC” which is referenced via the <em>area tag</em> of <codeclass="language-plaintext highlighter-rouge">retro_pc</code>. Two storage tags are used: <codeclass="language-plaintext highlighter-rouge">retro_pc_dos</code>, and <codeclass="language-plaintext highlighter-rouge">retro_pc_bbs</code>. These storage tags can be seen in the Storage Tags example above.</p>
<p>This combines the two concepts described above. When viewing the file areas from ENiGMA½ a user will only see the “Retro PC” area, but the files in the area are stored in the two locations defined in the <codeclass="language-plaintext highlighter-rouge">storageTags</code> section. We also show a uploads area. Uploads are allowed due to the <ahref="/enigma-bbs/filebase/acs.html">ACS</a> block. See <ahref="/enigma-bbs/filebase/uploads.html">Uploads</a> for more information.</p>
<pre><codeclass="language-hjson">fileBase: {
// override the default relative location
areaStoragePrefix: /enigma-bbs/file_base
storageTags: {
retro_pc_dos: "dos"
retro_pc_bbs: "pc/bbs"
}
areas: {
retro_pc: {
name: Retro PC
desc: Oldschool PC/DOS
storageTags: [ "retro_pc_dos", "retro_pc_bbs" ]
}
uploads: {
name: Uploads
desc: User uploads
acs: {
// allow any user to upload here
write: GM[users]
}
storageTags: [ "user_uploads" ]
}
}
}
</code></pre>
<h2id="importing-areas">Importing Areas</h2>
<p>Areas can also be imported using <ahref="/enigma-bbs/admin/oputil.html">oputil</a> using proper FileGate “RAID” aka <codeclass="language-plaintext highlighter-rouge">FILEBONE.NA</code> style files. After importing areas, you may wish to tweak configuration such as better <codeclass="language-plaintext highlighter-rouge">desc</code> fields, ACS, or sorting.</p>
<h2id="importing-files-scan-for-new-files">Importing Files (Scan For New Files)</h2>
<p>A common task is to <em>import</em> existing files to area(s). Consider a collection of retro BBS files in the area “Retro PC” (tag: <codeclass="language-plaintext highlighter-rouge">retro_pc</code> above) under the storage tag of <codeclass="language-plaintext highlighter-rouge">retro_pc_bbs</code>. You might choose to scan for new files in this area (and thus import new entries) as follows with <ahref="/enigma-bbs/admin/oputil.html">oputil</a>’s <codeclass="language-plaintext highlighter-rouge">fb scan</code>:</p>
<p>Here we have asked <ahref="/enigma-bbs/admin/oputil.html">oputil</a> to scan the file base area by it’s tag <codeclass="language-plaintext highlighter-rouge">retro_pc</code> and only include the storage tag of <codeclass="language-plaintext highlighter-rouge">retro_pc_bbs</code>. Note that the storage tag could be omitted, and if so, all of <codeclass="language-plaintext highlighter-rouge">retro_pc</code> would be scanned. We have also indicated to #hashtag new entries with the tags “retro”, “bbs”, and “pc”.</p>
<p>Please see <ahref="/enigma-bbs/admin/oputil.html">oputil</a> for more information.</p>
</div>
<divclass="PageNavigation">
<aclass="btn"style="float:left;margin-right: 20px;"href="/enigma-bbs/filebase/index.html">« About File Areas</a>