livesync

package
v1.0.13 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 7, 2026 License: AGPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateSetupURI

func GenerateSetupURI(cfg Config, uriPassphrase string) (string, error)

GenerateSetupURI creates a complete LiveSync Setup URI from a config and URI passphrase.

uriPassphrase encrypts the URI itself (not the vault data). Use a different passphrase from the E2EE passphrase in the config.

Returns the URI and any error.

Types

type Config

type Config struct {
	CouchDBURI      string `json:"couchDB_URI"`
	CouchDBUser     string `json:"couchDB_USER"`
	CouchDBPassword string `json:"couchDB_PASSWORD"`
	CouchDBDBName   string `json:"couchDB_DBNAME"`

	// Sync behaviour — defaults mirror the official Deno script
	SyncOnStart                        bool   `json:"syncOnStart"`
	GCDelay                            int    `json:"gcDelay"`
	PeriodicReplication                bool   `json:"periodicReplication"`
	SyncOnFileOpen                     bool   `json:"syncOnFileOpen"`
	Encrypt                            bool   `json:"encrypt"`
	Passphrase                         string `json:"passphrase"` // E2EE passphrase (can differ from URI passphrase)
	UsePathObfuscation                 bool   `json:"usePathObfuscation"`
	BatchSave                          bool   `json:"batchSave"`
	BatchSize                          int    `json:"batch_size"`
	BatchesLimit                       int    `json:"batches_limit"`
	UseHistory                         bool   `json:"useHistory"`
	DisableRequestURI                  bool   `json:"disableRequestURI"`
	CustomChunkSize                    int    `json:"customChunkSize"`
	SyncAfterMerge                     bool   `json:"syncAfterMerge"`
	ConcurrencyOfReadChunksOnline      int    `json:"concurrencyOfReadChunksOnline"`
	MinimumIntervalOfReadChunksOnline  int    `json:"minimumIntervalOfReadChunksOnline"`
	HandleFilenameCaseSensitive        bool   `json:"handleFilenameCaseSensitive"`
	DoNotUseFixedRevisionForChunks     bool   `json:"doNotUseFixedRevisionForChunks"`
	SettingVersion                     int    `json:"settingVersion"`
	NotifyThresholdOfRemoteStorageSize int    `json:"notifyThresholdOfRemoteStorageSize"`
}

Config is the configuration object embedded in the Setup URI. Fields match exactly what the TypeScript generate_setupuri.ts produces.

func DefaultConfig

func DefaultConfig(couchURI, user, password, dbName, e2eePassphrase string) Config

DefaultConfig returns a Config pre-filled with the same defaults as the official generate_setupuri.ts script.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL