<metaname="description"content="The oputil CLI ENiGMA½ comes with oputil.js henceforth known as oputil, a command line interface (CLI) tool for sysops to perform general system and user administration. You likely used oputil to do the initial ENiGMA configuration."/>
<metaproperty="og:description"content="The oputil CLI ENiGMA½ comes with oputil.js henceforth known as oputil, a command line interface (CLI) tool for sysops to perform general system and user administration. You likely used oputil to do the initial ENiGMA configuration."/>
{"datePublished":"2023-10-13T02:42:45+00:00","description":"The oputil CLI ENiGMA½ comes with oputil.js henceforth known as oputil, a command line interface (CLI) tool for sysops to perform general system and user administration. You likely used oputil to do the initial ENiGMA configuration.","mainEntityOfPage":{"@type":"WebPage","@id":"/enigma-bbs/admin/oputil.html"},"publisher":{"@type":"Organization","logo":{"@type":"ImageObject","url":"/enigma-bbs/assets/images/enigma-logo.png"}},"url":"/enigma-bbs/admin/oputil.html","@type":"BlogPosting","headline":"oputil","dateModified":"2023-10-13T02:42:45+00:00","@context":"https://schema.org"}</script>
<p>ENiGMA½ comes with <codeclass="language-plaintext highlighter-rouge">oputil.js</code> henceforth known as <codeclass="language-plaintext highlighter-rouge">oputil</code>, a command line interface (CLI) tool for sysops to perform general system and user administration. You likely used oputil to do the initial ENiGMA configuration.</p>
<p>Let’s look the main help output as per this writing:</p>
<td>Message base configuration and management</td>
</tr>
</tbody>
</table>
<p>Global arguments apply to most commands and actions:</p>
<ul>
<li><codeclass="language-plaintext highlighter-rouge">--config</code>: Specify configuration directory if it is not the default of <codeclass="language-plaintext highlighter-rouge">./config/</code>.</li>
<li><codeclass="language-plaintext highlighter-rouge">--no-prompt</code>: Assume defaults and do not prompt when posisible.</li>
</ul>
<p>Type <codeclass="language-plaintext highlighter-rouge">./oputil.js <command> --help</code> for additional help on a particular command. The following sections will describe them.</p>
<h2id="user">User</h2>
<p>The <codeclass="language-plaintext highlighter-rouge">user</code> command covers various user operations.</p>
<divclass="language-plaintext highlighter-rouge"><divclass="highlight"><preclass="highlight"><code>usage: oputil.js user <action> [<arguments>]
Actions:
info USERNAME Display information about a user
pw USERNAME PASSWORD Set a user's password
(passwd|password)
rm USERNAME Permanently removes user from system
(del|delete|remove)
rename USERNAME NEWNAME Rename a user
(mv)
2fa-otp USERNAME SPEC Enable 2FA/OTP for the user
(otp)
The system supports various implementations of Two Factor Authentication (2FA)
<td>Add to group: <codeclass="language-plaintext highlighter-rouge">./oputil.js user group joeuser +derp</code><br/>Remove from group: <codeclass="language-plaintext highlighter-rouge">./oputil.js user group joeuser ~derp</code></td>
<td>N/A</td>
</tr>
</tbody>
</table>
<h4id="manage-2faotp">Manage 2FA/OTP</h4>
<p>While <codeclass="language-plaintext highlighter-rouge">oputil.js</code> can be used to manage a user’s 2FA/OTP, it is highly recommended to require users to opt-in themselves. See <ahref="/enigma-bbs/configuration/security.html">Security</a> for details.</p>
<h2id="configuration">Configuration</h2>
<p>The <codeclass="language-plaintext highlighter-rouge">config</code> command allows sysops to perform various system configuration and maintenance tasks.</p>
info CRITERIA Display information about areas and/or files
mv SRC [SRC...] DST Move matching entry(s)
(move)
Source may be any of the following:
- Filename including '*' wildcards
- SHA-1
- File ID
- Area tag with optional @storageTag suffix
Destination is area tag with optional @storageTag suffix
rm SRC [SRC...] Remove entry(s) from the system
(del|delete|remove)
Source may be any of the following:
- Filename including '*' wildcards
- SHA-1
- File ID
- Area tag with optional @storageTag suffix
desc CRITERIA Updates an file base entry's description
Launches an external editor using $VISUAL, $EDITOR, or vim/notepad.
import-areas FILEGATE.ZXX Import file base areas using FileGate RAID type format
scan arguments:
--tags TAG1,TAG2,... Specify hashtag(s) to assign to discovered entries
--desc-file [PATH] Prefer file descriptions from supplied input file
If a file description can be found in the supplied input file, prefer that description
over other sources such related FILE_ID.DIZ. Path must point to a valid FILES.BBS or
DESCRIPT.ION file.
--update Attempt to update information for existing entries
--full Perform a full scan (default is quick)
info arguments:
--show-desc Display short description, if any
remove arguments:
--phys-file Also remove underlying physical file
import-areas arguments:
--type TYPE Sets import areas type
Valid types are are "zxx" or "na".
--create-dirs Also create backing storage directories
General Information:
Generally an area tag can also include an optional storage tag. For example, the
area of 'bbswarez' stored using 'bbswarez_main': bbswarez@bbswarez_main
When performing an initial import of a large area or storage backing, --full
is the best option. If re-scanning an area for updates a standard / quick scan is
generally good enough.
File ID's are those found in file.sqlite3.
</code></pre></div></div>
<h4id="scan-file-area">Scan File Area</h4>
<p>The <codeclass="language-plaintext highlighter-rouge">scan</code> action can (re)scan a file area for new entries as well as update (<codeclass="language-plaintext highlighter-rouge">--update</code>) existing entry records (description, etc.). When scanning, a valid area tag must be specified. Optionally, storage tag may also be supplied in order to scan a specific filesystem location using the <codeclass="language-plaintext highlighter-rouge">@the_storage_tag</code> syntax. If a <ahref="http://man7.org/linux/man-pages/man7/glob.7.html">GLOB</a> is supplied as the last argument, only file entries with filenames matching will be processed.</p>
<h5id="examples">Examples</h5>
<p>Performing a quick scan of a specific area’s storage location (“retro_warez”, “retro_warez_games) matching only *.zip extensions:</p>
<divclass="language-bash highlighter-rouge"><divclass="highlight"><preclass="highlight"><code><spanclass="c"># note that we must quote the wildcard to prevent shell expansion</span>
<p>Given a FileGate “RAID” style <codeclass="language-plaintext highlighter-rouge">FILEGATE.ZXX</code> file, one can import areas. This format also often comes in FTN-style info packs in the form of a <codeclass="language-plaintext highlighter-rouge">.NA</code> file i.e.: <codeclass="language-plaintext highlighter-rouge">FILEBONE.NA</code>.</p>
<divclass="language-bash highlighter-rouge"><divclass="highlight"><preclass="highlight"><code><spanclass="c"># fsxNet info packs contain a FSX_FILE.NA file</span>
./oputil.js fb import-areas FSX_FILE.NA <spanclass="nt">--create-dirs</span><spanclass="nt">--type</span> NA
</code></pre></div></div>
<p>The above command will process FILEGATE.ZXX creating areas and backing directories. Directories created are relative to the <codeclass="language-plaintext highlighter-rouge">fileBase.areaStoragePrefix</code><codeclass="language-plaintext highlighter-rouge">config.hjson</code> setting.</p>
<h2id="message-base-management">Message Base Management</h2>
<p>The <codeclass="language-plaintext highlighter-rouge">mb</code> command provides various Message Base related tools:</p>
<p>When using the <codeclass="language-plaintext highlighter-rouge">import-areas</code> action, you will be prompted for any missing additional arguments described in “import-areas args”.</p>