Auto update

This commit is contained in:
Andrea Mazzoleni 2026-03-17 00:12:13 +01:00
parent 4ca3860f6d
commit 63a35fe621
15 changed files with 662 additions and 279 deletions

View file

@ -210,23 +210,29 @@ Getting Started
<p>The daemon acts as a management layer for the SnapRAID CLI. Therefore,
SnapRAID CLI must be installed and fully configured before starting the
service.
</p><p>All <b>data</b>, <b>parity</b>, and <b>extra</b> disks defined in the SnapRAID CLI
configuration file are considered part of the array and are managed
by the daemon. All interactions with the underlying array are handled
through the standard SnapRAID CLI binary.
</p><p>Because the daemon performs direct hardware-level telemetry probes
(such as reading SMART attributes and managing disk power states), it
requires elevated privileges to function correctly. On Linux systems,
the daemon must be run as the root user. On Windows, it must be
executed as a service with equivalent system access rights.
</p><p>It is important to note that the daemon never directly reads the
SnapRAID CLI configuration file <b>snapraid.conf</b>. Instead, it relies
entirely on the output and logs generated by the SnapRAID binary.
</p><p>By processing these logs, the daemon identifies the <b>data</b>, <b>parity</b>,
and <b>extra</b> disks and establishes the current state of the array.
</p><p>During the installation process of the daemon, a default configuration
file is provisioned to enable the REST API and the Web UI. For users
installing via binary packages, this file is typically placed at
<b>/etc/snapraidd.conf</b>. If you are installing from source, it is
recommended to run <b>./configure --sysconfdir=/etc</b> during the build
process to ensure theconfiguration is placed in the standard <b>/etc</b>
process to ensure the configuration is placed in the standard <b>/etc</b>
directory.
</p><p>Using this default configuration file, the UI is accessible locally
via a web browser at the following address:
</p><p><a href="http://localhost:7627">http://localhost:7627</a>
<br>
</p><p>The default port, 7627, was chosen as a mnemonic, representing the
word "SNAP" as typed on a standard telephone keypad.
word <b>SNAP</b> as typed on a standard telephone keypad.
</p><p>At startup, the daemon parses historical logs from <b>/var/log/snapraid</b>
to reconstruct the current state of the array. These logs are
generated and saved by the daemon itself during the execution
@ -359,7 +365,7 @@ path chosen at build time (typically via the <b>--prefix</b> argument to
the configure script).
</p><p>This file governs the behavior of the automation engine, network
accessibility, safety interlocks, and hardware monitoring parameters.
</p><p>The configuration system is designed with a "triple-tier" management
</p><p>The configuration system is designed with a <b>triple-tier</b> management
philosophy to balance operational convenience with rigorous system
security:
</p><p>Tier 1 Core Network (Immutable) - This tier includes critical security
@ -422,7 +428,7 @@ explicitly disable the saving of command output to persistent files.
</p><p>IMPORTANT: While it is possible to leave this empty to avoid saving files,
these logs are used by the daemon to reconstruct the past state of the
array (e.g., tracking the last successful sync or scrub). If no log
directory is provided, the daemon will lose its "memory" of previous
directory is provided, the daemon will lose its <b>memory</b> of previous
task results every time it is restarted.
</p></div>
<div class="manual-section-level-3">
@ -505,7 +511,7 @@ subnets using a comma-separated Access Control List (ACL).
(e.g., /24). The rules are processed sequentially, and the last
matching rule determines the outcome.
If unset, it defaults to accept everything. If any rules are defined,
the daemon adopts a "deny by default" stance.
the daemon adopts a <b>deny by default</b> stance.
</p><p>To allow access via Tailscale or similar services, ensure you add the
relevant network prefix (e.g., +100.0.0.0/8).
</p><p>Examples:
@ -728,8 +734,8 @@ sync_prevent_truncations
</h3>
<p>If set to 1, the sync is halted to prevent overwriting
parity with empty file data. This provides a safety
barrier against truncated data, which may occurs
during system crashes or filesystem errors.
barrier against truncated data, which may occur during system
crashes or filesystem errors.
If this is missing or set to 0, the sync is allowed
to proceed even if files have shrunk to zero size.
</p></div>
@ -850,10 +856,10 @@ hook_run_as_user
<p>Specifies the user account used to execute the hook_script.
If this is missing or blank, the script is executed with the
same privileges as the daemon process.
</p><p>On Linux, "nobody" is the standard choice for maximum isolation.
On Windows, "LocalService" is the preferred choice as it provides
</p><p>On Linux, <b>nobody</b> is the standard choice for maximum isolation.
On Windows, <b>LocalService</b> is the preferred choice as it provides
minimal local access while maintaining network capabilities.
Alternatively, "NetworkService" can be used if the script specifically
Alternatively, <b>NetworkService</b> can be used if the script specifically
requires the computer's network identity to access remote resources.
</p></div>
</div>
@ -886,7 +892,7 @@ notify_heartbeat
</h3>
<p>Defines a command to run ONLY if the maintenance task was successful
(it is not triggered by other tasks, such as heal or undelete).
This is ideal for external monitoring services like "Dead Man's Snitch"
This is ideal for external monitoring services like <b>Dead Man's Snitch</b>
or Healthchecks.io. If this ping stops, it indicates the server is down
or the task is failing.
</p></div>
@ -900,8 +906,8 @@ executed if the task's result matches the <b>notify_result_level</b>.
The daemon pipes a structured, plain-text task report directly into
the command's stdin.
</p><p>The daemon automatically chooses a wide (80-col) or narrow (32-col)
report based on the command and arguments used (e.g., presence of "mail"
or "smtps" strings). Users can manually override this by adding --wide or
report based on the command and arguments used (e.g., presence of <b>mail</b>
or <b>smtps</b> strings). Users can manually override this by adding --wide or
--narrow to the command string. These tags are stripped before execution.
</p><p>Before execution, the daemon scans the command string and replaces the
following tokens with dynamic values corresponding to the current
@ -970,10 +976,10 @@ notify_run_as_user
<p>The user account used for notify_heartbeat, notify_result and mail
notifications. If missing or left blank, the task runs with the
daemon's current privileges.
</p><p>On Linux, "nobody" is the standard choice for maximum isolation.
On Windows, "LocalService" is the preferred choice as it provides
</p><p>On Linux, <b>nobody</b> is the standard choice for maximum isolation.
On Windows, <b>LocalService</b> is the preferred choice as it provides
minimal local access while maintaining network capabilities.
Alternatively, "NetworkService" can be used if the script specifically
Alternatively, <b>NetworkService</b> can be used if the script specifically
requires the computer's network identity to access remote resources.
</p></div>
<div class="manual-section-level-3">
@ -1129,7 +1135,7 @@ curl -X POST <a href="http://localhost:7627/snapraid/v1/suspend_idle">http://loc
</p></div>
<div class="manual-section-level-3">
<h3 id="sec7-1-5" class="manual-title-level-3">
/snapraid/v1/refresh:
/snapraid/v1/refresh
</h3>
<p>Forces the daemon to re-synchronize its internal state with the
content file. This is intended for use after manual interventions
@ -1182,7 +1188,7 @@ curl -s <a href="http://localhost:7627/snapraid/v1/disks">http://localhost:7627/
</div>
<div class="manual-section-level-2">
<h2 id="sec7-3" class="manual-title-level-2">
Configuration
Runtime Configuration
</h2>
<p>Provides a programmatic interface to retrieve and modify the
operational parameters of the daemon in real-time.
@ -1448,8 +1454,13 @@ Files
</h1>
<p>The following list specifies the default filesystem paths used by the
daemon for configuration, data persistence, and inter-process communication.
</p><div class="manual-section-level-2">
<h2 id="sec9-1" class="manual-title-level-2">
Linux
</h2>
<p>On Linux and Unix-like systems:
</p><div class="manual-section-level-3">
<h3 class="manual-title-level-3">
<h3 id="sec9-1-1" class="manual-title-level-3">
$PREFIX/etc/snapraidd.conf
</h3>
<p>The primary configuration file location. The $PREFIX variable
@ -1459,7 +1470,7 @@ values include <b>/usr/local</b> or <b>/usr</b>. If this file does not
exist, the daemon falls back to <b>/etc/snapraidd.conf</b>.
</p></div>
<div class="manual-section-level-3">
<h3 class="manual-title-level-3">
<h3 id="sec9-1-2" class="manual-title-level-3">
$PREFIX/share/snapraidd
</h3>
<p>The primary system data directory. This is the first location
@ -1467,33 +1478,65 @@ searched for the web dashboard ZIP file (e.g., commander.zip).
If not found here, the daemon falls back to <b>/usr/share/snapraidd</b>.
</p></div>
<div class="manual-section-level-3">
<h3 class="manual-title-level-3">
<h3 id="sec9-1-3" class="manual-title-level-3">
/etc/snapraidd.conf
</h3>
<p>The secondary/system-wide configuration file location, used if
the prefix-specific file is missing.
</p></div>
<div class="manual-section-level-3">
<h3 class="manual-title-level-3">
<h3 id="sec9-1-4" class="manual-title-level-3">
/usr/share/snapraidd
</h3>
<p>The secondary/system-wide data directory, used as a fallback for
web assets.
</p></div>
<div class="manual-section-level-3">
<h3 class="manual-title-level-3">
<h3 id="sec9-1-5" class="manual-title-level-3">
/run/snapraidd.pid
</h3>
<p>Default PID file location.
</p></div>
<div class="manual-section-level-3">
<h3 class="manual-title-level-3">
<h3 id="sec9-1-6" class="manual-title-level-3">
/var/log/snapraid
</h3>
<p>Default directory for SnapRAID command execution logs. This
directory contains the output of the SnapRAID binary itself,
rather than the daemon's service logs.
If this directory does not exist, the daemon will attempt to create it
upon the first execution of a SnapRAID command.
</p></div>
</div>
<div class="manual-section-level-2">
<h2 id="sec9-2" class="manual-title-level-2">
Windows
</h2>
<p>On Windows systems:
</p><div class="manual-section-level-3">
<h3 id="sec9-2-1" class="manual-title-level-3">
snapraidd.conf
</h3>
<p>The configuration file is expected to be in the same directory
where the <b>snapraidd.exe</b> binary is located.
</p></div>
<div class="manual-section-level-3">
<h3 id="sec9-2-2" class="manual-title-level-3">
log\
</h3>
<p>A subdirectory named <b>log</b> within the installation directory is
used to store the SnapRAID command execution logs. If this
directory does not exist, the service will attempt to create it
upon the first execution of a SnapRAID command.
</p></div>
<div class="manual-section-level-3">
<h3 id="sec9-2-3" class="manual-title-level-3">
commander.zip
</h3>
<p>The web dashboard assets are searched for in the same directory
as the executable.
</p></div>
</div>
</div>