Use the N.I.N.A. Sync Plugin

The PSF Guard Sync plugin connects a live Target Scheduler catalog to a PSF Guard server. It uploads saved lights and calibration frames, pushes scheduler captures, and exchanges plans and reviewed grades. This removes the need to run manual CLI sync commands between database files.

This plugin is on the beta channel and is fully functional. Current builds pair with a one-time code, upload FITS or XISF images, and transfer Target Scheduler data through the versioned /api/sync/v1 protocol. Servers and clients running version 0.6.1 or later can also use the manual API key setup described below.

Install the plugin in N.I.N.A.

PSF Guard hosts a N.I.N.A. plugin repository. After you add this repository as a source, the PSF Guard Sync plugin installs and updates through the N.I.N.A. interface:

  1. In N.I.N.A., open Options → Plugins.
  2. Add this repository URL:
    https://nina-plugins.psf-guard.com/
  3. Turn on “Include beta versions” because PSF Guard Sync releases are currently distributed on the beta channel.
  4. Locate PSF Guard Sync in the list of available plugins, install it, and restart N.I.N.A.
The plugin requires Windows x64, N.I.N.A. version 3.2.0.9001 or newer, and PSF Guard version 0.6.1 or newer. Target Scheduler schema version 22 or newer is required for catalog synchronization, but is not required for direct FITS uploads. The plugin registry is hosted at nina-plugins.psf-guard.com.

Pair N.I.N.A. with a catalog

  1. Open Settings → Databases and edit the destination catalog.
  2. If you want N.I.N.A. to upload image files, enable Remote image uploads, choose a configured image directory as the receive directory, and save the catalog.
  3. Select Generate pairing code next to Pair a client, and copy the code.
  4. In the plugin interface, enter the PSF Guard server URL, paste the pairing code, and click connect. The server provides the catalog ID and the credentials for this N.I.N.A. installation.
  5. Select Test connection, and then configure your preferred upload and catalog synchronization behavior.

A pairing code is single-use and expires after one hour. Each pairing creates a unique catalog-scoped credential. The PSF Guard server stores only the digest of the credential, and the plugin stores the credential in Windows Credential Manager. Pairing enables scheduler synchronization for the catalog, but does not configure image uploads or the receive directory.

The catalog editor lists all connected installations under Paired clients. You can revoke a single client credential there without affecting other paired clients.

Generating pairing codes and revoking clients are database management tasks. Browser-managed servers require database management to be enabled and require an administrator or editor login. You can read more about the security model in the Server Accounts section.

Use a manual API key fallback

A client that does not support pairing can use the following manual setup:

  1. Enable Remote scheduler sync on the catalog, and separately enable Remote image uploads if you want to upload files.
  2. Select Generate next to Remote API key, copy the key, and save the catalog.
  3. Copy the catalog ID from the database list or from its ?db= URL, then enter the server URL, database ID, and API key into the N.I.N.A. plugin.

Generating a new manual key invalidates the previous manual key. It does not affect paired clients. Similarly, revoking a paired client does not invalidate the manual key or other paired clients.

Understand how the plugin works

The plugin listens for image-saved events in N.I.N.A. and supports two capture paths. Direct image mode places the saved FITS or XISF file into an upload queue. Target Scheduler mode waits for the corresponding acquiredimage row, and then queues a bundle that includes the capture metadata, project, target, and planning fields. All uploads run in the background. If the server is offline, the plugin retains the queued items and retries later.

Review staged catalog changes

Each catalog push generates a preview on the server before modifying the destination database. You can view these under Settings → Sync → Staged previews. This list displays previews created in the current browser and previews uploaded by remote N.I.N.A. installations.

Each row shows the destination catalog, operation type, data source, change counts, and expiration time. You can expand the What would change section to inspect individual field changes, grade transitions, rejection reasons, and any database items scheduled for updates, up to a limit of 400 lines.

No modifications are made until you apply the changes. If automatic application is enabled, the plugin applies the generated preview immediately. Otherwise, the preview remains staged for review until you apply it, discard it, or let it expire.

Configure synchronization and upload settings

Once you have paired the client, navigate to Plugins → Installed → PSF Guard Sync in N.I.N.A. and configure the following options:

  1. Specify the Target Scheduler database file path (the default path is %LOCALAPPDATA%\NINA\SchedulerPlugin\schedulerdb.sqlite).
  2. Select whether the plugin should upload each saved light frame directly.
  3. Select whether to also upload calibration frames, including bias, dark, dark-flat, and flat frames.
  4. Select whether the plugin should push the Target Scheduler database row for each saved light.
  5. Choose whether catalog previews should apply automatically or remain staged in the UI for manual review.

Click Test connection before enabling automated features. This tool verifies the server URL, client credentials, catalog selection, protocol version, and server permissions.

Use advanced sequencer instructions

The plugin adds several instructions under the PSF Guard Sync category in N.I.N.A.'s advanced sequencer:

Reconciliation instructions wait for Target Scheduler to complete its current database transaction and for the server to generate the preview. The sequence pauses until both actions are complete. Automatic per-capture uploads continue in the background and will retry if they encounter errors.

Resolve common issues

ResultCheck
Pairing code is unknown, expired, or already usedGenerate a new code from the destination catalog. A pairing code works once and remains valid for one hour.
401 or “Bearer token required”The plugin does not have a saved credential, or the paired client has been revoked. Pair the client again, or configure the manual key fallback, and run Test connection.
403 invalid key or wrong catalogThe credentials are catalog-scoped. Pair with the intended catalog, or verify both the manual key and catalog ID.
403 scheduler sync disabledEnable the Remote scheduler sync option on that PSF Guard catalog. Image upload permissions alone do not grant catalog synchronization rights.
Image upload is unavailableEnable Remote image uploads and select a receive directory on the destination catalog. Pairing does not automatically enable this permission.
404 under /api/sync/v1Upgrade the PSF Guard server to version 0.6.1 or newer. A 404 error for an older preview can also indicate that its 30-minute lifetime expired or it was already applied.
Large preview times out at a proxyUpgrade the client and server so that the client requests background preview jobs and polls them to completion.
“Bundle digest is missing or invalid”Upgrade both the client and server so that pull operations verify the raw response against the X-Content-SHA256 header instead of re-serializing the JSON bundle.
Queued work does not drainRun Test connection, confirm that N.I.N.A. can reach the server URL, and leave the plugin running. The durable queues resume automatically when connection is restored.
If you work on a single machine or synchronize two SQLite files directly, you can use the CLI psf-guard sync commands to perform the same task between database files without installing the plugin.

More projects from theatr.us