Ctrl K
ComunidadGuías…

automatic-backup.html

Rama main · réplica de lectura del repositorio original.

Archivo original ↗Preguntar a KiBot
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="canonical" href="https://newtondarts.com/automatic-backup.html">
    <title>Automatic Backup — NewTon DC Tournament Manager</title>
    <meta name="description" content="Automatic tournament backup and remote replication for NewTon DC Tournament Manager. Save completed tournaments to disk and upload to an Analytics instance — no manual steps required.">
    <link rel="icon" type="image/jpeg" href="images/logo.jpg">
    <link rel="preload" href="fonts/Insignia-Regular.otf" as="font" type="font/otf" crossorigin>
    <link rel="preload" href="fonts/Inter-VariableFont_opsz,wght.ttf" as="font" type="font/ttf" crossorigin>
    <link rel="stylesheet" href="css/landing.css">
</head>
<body>

<a class="docs-back-link" href="/">&#8592; NewTon DC Tournament Manager</a>

<div class="docs-content">

    <h1>Automatic Backup</h1>
    <p class="docs-subtitle">Save completed tournaments automatically &mdash; locally and to a remote instance.</p>

    <nav class="docs-toc">
        <h2>Contents</h2>
        <ol>
            <li><a href="#overview">Overview</a></li>
            <li><a href="#use-case">Use Case</a></li>
            <li><a href="#local-backup">Local Backup</a></li>
            <li><a href="#remote-backup">Remote Backup</a></li>
            <li><a href="#setup">Setup</a></li>
            <li><a href="#analytics-mode">Analytics Mode</a></li>
            <li><a href="#failed-upload">When an Upload Fails</a></li>
            <li><a href="#live-view">Live View</a></li>
            <li><a href="#manual-fallback">Manual Fallback</a></li>
            <li><a href="#requirements">Requirements</a></li>
        </ol>
    </nav>

    <h2 id="overview">Overview</h2>
    <p>NewTon is offline-first &mdash; everything is stored locally in your browser. This works brilliantly for running tournaments without an internet connection, but it means tournament data lives on one machine.</p>
    <p>Automatic Backup bridges the gap:</p>
    <ul>
        <li><strong>Local backup</strong> &mdash; when a tournament is finalized, the complete tournament data is saved to the server as a JSON file. No button to click, no export to remember. It happens silently at the moment of completion.</li>
        <li><strong>Remote backup</strong> &mdash; optionally, the same data is uploaded to a second instance at the same time. Tournaments run locally, but results are available online immediately.</li>
        <li><strong>Immediately available</strong> &mdash; saved tournaments appear in Analytics for all users, on any device. The moment a tournament is finalized, everyone can see the results.</li>
    </ul>

    <hr>

    <h2 id="use-case">Use Case</h2>
    <p>Here is how our club uses it:</p>
    <p>At the venue, we have a dedicated computer for the Tournament Manager. It comes out for each tournament, then goes back in the storage locker. Internet at the venue is spotty, so we rely on the offline functionality &mdash; the Tournament Manager runs without a connection.</p>
    <p>At the end of a tournament, whatever internet connection we have is enough to upload the completed tournament to our online instance. This instance runs in <a href="#analytics-mode">Analytics Mode</a> &mdash; a read-only view of all tournament data.</p>
    <p>Once uploaded, anyone can open the online instance on their phone and access the full stats &mdash; cross-tournament leaderboard, player rankings, match history, achievements &mdash; all from their pocket.</p>

    <hr>

    <h2 id="local-backup">Local Backup</h2>
    <p>When <strong>Automatically backup tournaments on completion</strong> is enabled, finalizing a tournament saves the complete tournament data as a JSON file to the server&rsquo;s persistent storage (as configured in your Docker Compose volume mounts).</p>
    <p>Saved tournaments appear in <strong>Shared Tournaments</strong> for all visitors on that instance. They can be imported to Recent Tournaments manually. Analytics picks them up automatically &mdash; every completed tournament becomes part of the cross-tournament statistics for everyone who visits the site.</p>
    <p>Duplicate protection is built in &mdash; uploading a tournament that already exists on the server will not overwrite the existing copy.</p>

    <hr>

    <h2 id="remote-backup">Remote Backup</h2>
    <p>In addition to the local backup, tournaments can be uploaded to a second instance at the moment of completion. The venue computer saves locally <em>and</em> pushes to the online Analytics instance in one step.</p>
    <p>The upload happens immediately. If there is no internet connection at that moment it does not succeed, but it is not forgotten: see <a href="#failed-upload">when an upload fails</a>.</p>
    <p>The receiving instance needs <code>NEWTON_API_ENABLED=true</code> in its Docker configuration. To keep strangers from uploading to it, set <code>NEWTON_API_KEY</code> there and enter the same key on the venue computer. Members can still open Analytics without a login: only uploads, deletes and corrections need the key.</p>

    <hr>

    <h2 id="setup">Setup</h2>
    <p>In <strong>Global Settings</strong>, scroll to <strong>Server Settings</strong>:</p>

    <img src="Screenshots/backup.png" alt="Server Settings panel showing automatic backup configuration" class="docs-screenshot lightbox-trigger" data-full="Screenshots/backup.png">

    <ol>
        <li>Tick <strong>Automatically backup tournaments on completion</strong>. This enables the local backup.</li>
        <li>For remote backup, fill in the <strong>Remote Backup</strong> fields:
            <ul>
                <li><strong>Remote server URL</strong> &mdash; the full URL of the receiving instance (e.g. <code>https://my.other.instance</code>)</li>
                <li><strong>API key</strong> &mdash; the <code>NEWTON_API_KEY</code> set on the remote instance (leave empty if it has none)</li>
            </ul>
        </li>
        <li>Click <strong>Save Server Settings</strong>.</li>
    </ol>
    <p>That&rsquo;s it. The next time a tournament is finalized, it will be saved locally and uploaded to the remote instance automatically.</p>

    <hr>

    <h2 id="analytics-mode">Analytics Mode</h2>
    <p>The remote instance is typically configured with <code>NEWTON_MODE=analytics</code> in Docker. In Analytics Mode:</p>
    <ul>
        <li>The full Tournament Manager interface is hidden &mdash; visitors see only Analytics.</li>
        <li>Data is <strong>read-only</strong>. No tournaments can be created or modified through the UI. Tournament JSON files can still be imported via Analytics.</li>
        <li>All uploaded tournaments appear automatically in the cross-tournament statistics.</li>
        <li>The leaderboard, player rankings, match history, and achievements are all available.</li>
        <li>Works on mobile &mdash; designed to be checked from your phone.</li>
    </ul>
    <p>See the <a href="docker-quickstart.html">Docker Quick Start</a> for environment variable reference.</p>

    <hr>

    <h2 id="failed-upload">When an Upload Fails</h2>
    <p>A tournament that did not reach the remote server says so. <strong>Setup</strong> shows &ldquo;Not uploaded to &hellip;&rdquo; with the reason and an <strong>Upload now</strong> button, the bracket page shows a <strong>Not uploaded</strong> chip, and the tournament&rsquo;s row in Setup&rsquo;s list carries a <strong>Not uploaded</strong> tag, so anyone can find it later.</p>
    <ul>
        <li><strong>It is tried again by itself</strong> while the page is open: after 30 seconds, a minute, two minutes, then every five minutes, at once when the connection comes back, and when the page is opened with a failed upload waiting.</li>
        <li><strong>A refusal is not retried.</strong> A wrong API key, a host that is not allowed or a file that is too large waits for someone to fix it; the message says which. <strong>Upload now</strong> tries it at once and tells you what happened.</li>
        <li>The tag and the notice go when the upload succeeds. Only the remote server is followed; the local server is this computer&rsquo;s own.</li>
        <li>A tournament that is not loaded is retried when it is loaded again; load the one with the tag and press <strong>Upload now</strong>.</li>
    </ul>

    <hr>

    <h2 id="live-view">Live View</h2>
    <p>Optional, and off by default. With <strong>Global Settings &rarr; Server &rarr; Live copy while it is played</strong> on, the venue computer sends a slim copy of the tournament to its server, and to the remote server, after every change: the players and their statistics, the matches with scores, lanes and what each one recorded. Nothing is sent before the bracket is drawn.</p>
    <ul>
        <li><strong>On the Analytics site</strong>, a &ldquo;Live now&rdquo; line appears at the top of Analytics while a tournament is being played, with <strong>Watch</strong>. It opens a list of what is being played (with the lane), what is up next and the latest results; <strong>Bracket</strong> and <strong>Leaderboard</strong> are one tap away. It is read-only and updates by itself.</li>
        <li><strong>The live copy is not part of Analytics.</strong> It is kept apart, and goes when the finished tournament has been backed up. Analytics takes the finished tournament in as usual. If the backup fails, the live copy stays and shows the finished state until the upload succeeds, or for three days at most.</li>
        <li><strong>Anyone who can open the server can read it</strong>, as with the finished tournament. Writing it needs the API key.</li>
        <li>It needs a server with the API (Docker). Without one, the setting does nothing.</li>
    </ul>

    <hr>

    <h2 id="manual-fallback">Manual Fallback</h2>
    <p>If an upload does not succeed and you cannot wait for the retry (or the refusal needs a fix first), you can also:</p>
    <ol>
        <li>Export the tournament as a JSON file from the Tournament Manager (Recent Tournaments &rarr; Export).</li>
        <li>Upload the JSON file to the Analytics instance manually (Analytics &rarr; Import).</li>
    </ol>
    <p>Manually imported tournaments are also added to Shared Tournaments on the receiving instance, just like automatic uploads. The same duplicate protection applies.</p>
    <p>The local backup still happens regardless of internet connectivity &mdash; only the remote upload is affected.</p>

    <hr>

    <h2 id="requirements">Requirements</h2>
    <ul>
        <li><strong>Docker</strong> &mdash; automatic backup is a server-side feature. It requires the Docker installation.</li>
        <li><strong><code>NEWTON_API_ENABLED=true</code></strong> &mdash; the API must be enabled on both the sending and receiving instances.</li>
        <li><strong>Persistent storage</strong> &mdash; configure volume mounts in Docker Compose so saved tournaments survive container restarts.</li>
        <li><strong><code>NEWTON_API_KEY</code></strong> (optional) &mdash; recommended on the remote instance, so only your venue can upload to it while members read freely.</li>
    </ul>

    <hr>

    <p><em>NewTon DC Tournament Manager &mdash; offline at the oche, online for everyone else.</em></p>

</div>

<div class="landing-footer docs-footer">
    <p>
        NewTon DC Tournament Manager &mdash; BSD-3-Clause License &mdash;
        <a href="https://github.com/skrodahl/NewTon" target="_blank" rel="noopener">GitHub</a> &mdash;
        <a href="/privacy.html">Privacy</a>
    </p>
    <p class="footer-cheeky">No popups? No cookies!</p>
</div>

<div id="lightbox" class="lightbox">
    <div class="lightbox-content">
        <button class="lightbox-close" aria-label="Close">&times;</button>
        <img id="lightboxImg" src="" alt="">
    </div>
</div>

<script src="js/lightbox.js"></script>
</body>
</html>