Pipedash
Configuration

Setup wizard

The setup wizard's steps and inputs, the setup API, and how a storage migration plans, backs up and rolls back.

The setup wizard creates the first config.toml and later moves Pipedash to another storage backend or data directory. It opens on first start when no config exists, and from Settings, then Storage, then Configure storage.

When the wizard appears

On start the UI asks for the setup status. The web server answers GET /api/v1/setup/status. The answer decides which screen opens.

FieldMeaning
config_existsconfig.toml exists in the data directory
config_validThe file parses and passes validation
validation_errorsError text. The UI shows a Configuration Error screen when the file exists but is invalid.
needs_setupNo config.toml and no legacy file. The UI opens the wizard.
needs_migrationA legacy storage_config.json exists without a config.toml

The desktop app writes a starter config.toml before the first status request, so desktop normally reports needs_setup as false and the wizard opens from Settings. The web server starts in setup mode when no config exists. In setup mode it listens on 127.0.0.1:8080 unless PIPEDASH_BIND_ADDR says otherwise. The Configuration page covers the defaults.

Steps

The first-run wizard has the title "Welcome to Pipedash". With an existing config it has the title "Storage settings" and adds a Transfer step.

StepShownPurpose
StorageAlwaysBackend, location and vault password
TransferOnly with an existing configTransfer data or Start fresh choice
ConfirmAlways on desktop and webSummary and save
SuccessDesktop, web and mobile reconfigurationResult and next action

The native iPhone and Android first-run wizard has no Confirm or Success screen. Its Storage screen shows the on-device database and token store. "Get started" applies the setup and opens the app.

For native mobile reconfiguration, the Transfer step appears only when the change needs a transfer.

Storage inputs

InputShownRule
Database backendAlways on desktop and webSQLite or PostgreSQL. When reconfiguring existing storage, a note under the control starts with "Current backend:" and the backend name.
PostgreSQL connection URLPostgreSQLRequired. It must parse as a postgres:// or postgresql:// URL with a nonempty host. The placeholder is postgresql://user:password@localhost:5432/pipedash. An invalid value shows Enter a valid PostgreSQL connection URL.
Data directorySQLitePrefilled with the default data directory
Password and Confirm passwordUnless PIPEDASH_VAULT_PASSWORD has a valueAt least 8 characters, and both fields must match

When PIPEDASH_VAULT_PASSWORD has a value, the step shows "Vault password configured via PIPEDASH_VAULT_PASSWORD" in place of the two password fields.

Continue stays disabled until the PostgreSQL URL is valid and the password rule passes. Passwords of 12 or more characters also get orange hints, such as "Consider using 16+ characters", for length, digits, special characters or mixed case. The hints never block the step.

A desktop move from SQLite with the keyring to encrypted storage shows the notice "Credential migration". It says that the credentials leave the keyring, get encrypted in the database, and need a vault password.

Storage step with SQLite selected. Desktop and mobile.
The Storage step with SQLite.
Storage step with PostgreSQL selected and a connection URL. Desktop and mobile.
Choosing PostgreSQL asks for the connection URL.

iPhone storage

The iPhone wizard shows "On-device storage" and no inputs. The rows read "Database: SQLite" and "Provider tokens: Device Keychain". The step asks for no vault password. The Mobile page covers the app.

On Android the wizard looks the same, and the "Provider tokens" row reads "Android Keystore".

Transfer, confirm and success

The Transfer step offers "Transfer data", marked Recommended, and "Start fresh". It matters when the backend or data directory changes, or when tokens move from the keyring to encrypted storage.

  • Transfer data: providers, tokens and history move to the new location.
  • Start fresh: no providers or credentials move from the current storage. Existing data in the target stays there. Choose an unused location for an empty database. Provider blocks in config.toml stay and apply to the target.

On desktop and web, Start fresh shows the warning "Switching without transferring data" and changes the main button to "Switch without transferring". On iPhone, the main button of the Transfer step opens a "Skip data transfer?" confirmation with the buttons "Skip data transfer" and "Go back".

Transfer step offering Transfer data, marked Recommended, or Start fresh. Desktop and mobile.
The Transfer step appears when a configuration already exists.

The Confirm step lists the database, the data directory, the credentials, the vault password status and the data migration choice. When a password was entered and the environment does not supply one, it also prints a shell-escaped export PIPEDASH_VAULT_PASSWORD='...' command with a copy button. The save button reads "Save and transfer" when it will migrate, "Switch without transferring" for Start fresh with a change, and "Save" otherwise.

Confirm step with the configuration summary and the Save and transfer button. Desktop and mobile.
The Confirm step before the save.

The Success step is titled "Setup complete". After a migration it lists the Migration summary with the counts of Providers, Tokens, Cache entries and Metrics. A typed password adds a card with the export command that the next run needs. After a migration in the app it shows "Restart now", and on iPhone "Reload now". Otherwise it shows "Get started".

What Save does

A first setup writes config.toml, then loads it, warms up the token store and starts the background tasks. A typed password makes Pipedash set PIPEDASH_VAULT_PASSWORD for the session. With SQLite on desktop it uses the keyring token store.

For an existing setup, Save applies the current draft:

  1. Pipedash validates the backend, PostgreSQL URL and required password.
  2. With Start fresh and a storage change, it tests the target before saving.
  3. A required password entered in the wizard becomes PIPEDASH_VAULT_PASSWORD for the session.
  4. With Transfer data and a change that needs migration, it runs the transfer with migrate_tokens = true and migrate_cache = true.
  5. It saves the config. The web server reloads storage. The desktop app attempts to reopen the core with the saved config.

A failed transfer stops the save and reports its errors. The backup and rollback rules below apply to failed migration steps.

Start fresh skips the database transfer and leaves existing target data in place. It also keeps provider blocks from config.toml, which Pipedash applies when it opens the target.

A web storage reload happens after the config save. If that reload fails, the request returns an error without restoring the previous config file.

Web setup API

The first-run routes are public. The storage routes use the authentication of the configured instance.

RouteAuthBehavior
GET /api/v1/setup/statusNoneReturns the status fields above
POST /api/v1/setup/draftNoneValidates a first-run draft
POST /api/v1/setup/applyNoneApplies a first-run draft and starts services
POST /api/v1/storage/draftRequired when the server requires authenticationValidates a storage change on a configured instance
POST /api/v1/storage/applyRequired when the server requires authenticationApplies a storage change and reloads services

Draft and apply requests take these fields:

KeyTypeRequiredDefaultDescription
backendstringYesNonesqlite or postgres. The draft parser also accepts postgresql.
data_dirstringYesNoneTarget data directory. The wizard fills in the default directory.
postgres_urlstringYesNonePostgreSQL connection URL. Use an empty string for SQLite.
vault_passwordstringYesNonePassword entered in the wizard. Use an empty string when no new password is needed.
vault_password_confirmstringYesNoneConfirmation of the entered password
transfer_databooleanYesNoneTransfers existing data when the change needs migration

A draft response contains config, errors, password_warnings and needs_migration. Errors are keyed by field name.

An apply response contains saved, migration_stats and restart_required. migration_stats is null when no transfer runs. The web server returns restart_required = false after reloading storage.

The first-run draft and apply routes return 409 with Setup already completed. Cannot re-initialize an already-configured instance. after setup completes. Configured instances use the storage routes instead.

On desktop and web, a draft needs a matching password of at least 8 characters when PIPEDASH_VAULT_PASSWORD is unset. A missing password fails draft validation rather than completing setup in locked mode. The Token storage page covers the vault.

Migration plan

The config editor receives an optional migration plan from POST /api/v1/storage/config/analyze, with body { "new_content": "<toml>" }. The plan contains the source config, the target config, the steps and flags.

Plan fieldMeaning
stepsOrdered list of steps
migrate_configstrue when the backend changes, the data directory changes, or tokens move from keyring to encrypted storage
migrate_tokensmigrate_configs and the migrate_tokens option
migrate_cachemigrate_configs and the migrate_cache option
backend_changed, data_dir_changedWhich setting differs

The steps run in this order: test the target, migrate configs, migrate tokens, migrate cache, test the migration and update the config. The two test steps and the update step always appear. The other three appear when the plan needs them.

The configs step copies providers and their metrics settings. Across databases, it also copies views, paired devices, notification preferences, push registrations and alerts.

The cache step copies cache entries, retained run history, completed downloaded logs, cached log trees, metric rows and pipeline metric processing state. Retained history includes archived FluxCD reconciliations. Pipedash remaps provider and pipeline ids.

Incomplete log downloads and unpublished temporary files do not transfer. When both configs use the same database, run history and metric rows stay in place. Local log files can still move to a new data directory.

Options

OptionDefaultEffect
migrate_tokensfalseAdds the token step
migrate_cachefalseAdds the cache step
token_passwordNonePassword for the token blob. PIPEDASH_VAULT_PASSWORD wins when both exist.
dry_runfalseReturns success at once and changes nothing
allow_non_empty_targetfalseNo effect in the current version
clean_targetfalseDeletes target providers and tokens that are not in the source, and replaces the target's alerts with the source's, then compares exact counts
keep_backupsfalseKeeps the backups after a successful run
max_retries3No effect in the current version

Backup and rollback

Every real migration creates backups before it changes the target. Backup failure aborts the run with no changes.

fails

a step fails

all steps pass

Create backups

Abort with no changes

Run steps in order

Restore config, source database and SQLite target

Delete backups unless keep_backups

BackupFile name
Source SQLite databasepipedash.db.backup-<YYYYMMDD_HHMMSS> next to the database
Config fileconfig.toml.backup-<YYYYMMDD_HHMMSS> next to the config
Non-empty target SQLite databasepipedash_target.db.backup-<YYYYMMDD_HHMMSS> next to the target database
PostgreSQL sourcepostgres_backup_<YYYYMMDD_HHMMSS>.json in the data directory

Pipedash copies each SQLite database with VACUUM INTO, so a backup includes committed data that still sits in the write-ahead log. A PostgreSQL target has no backup.

On a failed step, Pipedash copies the config backup back over the config file. It restores the source SQLite database and the SQLite target from their backups. Each database restore runs in one transaction. A provider that the failed run had already copied into an existing SQLite target disappears again.

A PostgreSQL source is a JSON export that Pipedash does not restore by itself. That file is the input for manual recovery. The result carries recovery text with the backup paths in errors. After a success, cleanup deletes the backups and also deletes *.backup-* and *_backup_*.json files older than 7 days from the data directory.

Token migration matches providers by name. When a provider gets a different id in the target, Pipedash stores its token under the new id. In that case a token whose provider has no match fails the step with a data consistency error.

Result

The migration result lists success, steps_completed, errors, duration_ms, provider_id_mapping, backups and stats. The stats count providers, tokens, cache entries, metrics and permissions migrated, and providers and tokens cleaned.