Expand description
Syncing from login (technical design):
nibkeep-sync, a program without a window that starts when the person logs in, holds the
sync role of the libraries they chose, as an app holds it while unlocked. Every NibKeep
program reads and writes the list of those libraries alike, in the person’s folder of
settings; the service follows it, and writes beside it what it does for each.
Modules§
- app
- What an app does with syncing from login (technical design):
the switch, which has the copy of
nibkeep-syncthat the app ships beside its program sync a library whenever the person is logged in; and what the app does as it starts. Only on computers.
Structs§
- AtLogin
- The list of libraries to sync from login, and the copy of
nibkeep-syncthat serves them. - AtLogin
Status - What syncing from login does for a library, as a program shows it.
- Login
Entry - The login entry that starts
nibkeep-syncwhen the person logs in: the platform’s own, where the person finds the programs that start with their session. Each computer has one of its own, named as its folder of state is, so that a program that syncs dotfolders, or a roaming profile, never makes one computer’s turning off remove another’s. - Served
- A library that the service syncs from login.
- Service
Options - How the service runs.
- Service
Status - What the service does for each library it serves, which it writes beside the list.
- Turned
Off - What turning syncing from login off did.
- Turned
On - What turning syncing from login on did.
Enums§
- Entry
Outcome - What became of the login entry.
- Entry
State - What the login entry says.
- Service
Ended - Why the service ended.
- Serving
- What the service does for a library.
Constants§
- ENGINE_
VERSION - The engine’s version, which the engines file records of each program, and a copy of
nibkeep-synctells, so that the newest runs. - SERVICE_
PROGRAM - What the service names itself in a replica’s records, and the name of its program.
Functions§
- app_
started - What an app does as it starts, where the list holds libraries and the login entry is on,
or the platform has none: names
own, its copy ofnibkeep-sync, if the listed one is gone or older, pointing the login entry along; and returns the copy to start, if any: its own, just named, which waits for the one that runs to end, or the listed one, where none runs, as after a crash. Where the person turned the entry off, or removed it, it does nothing, so that the copy that runs, as one that turning on started, goes on. - name_
own_ copy - Names
own, this program’s copy ofnibkeep-sync, in the list, where the list names none, or one that is gone, as after its app was removed, or one older thanown, asversion_oftells of each; and points the login entry at it, if there is one, leaving it off if the person turned it off: whether it named it. A copy of the same version stays, so that two programs do not take it from each other, and so does one that does not tell its version in time, as one that a scanner of viruses holds up. - newer
- Whether version
ais newer thanb, comparing their numbers in turn. - serve_
at_ login - Runs the service: takes the lock on
sync-at-login.running, or waits for the copy that holds it while the list names this one; then holds the sync role of each library on the list, each on a thread of its own, following the list as it changes, and writes what it does for each, until stopped, or the list is empty or names another copy.nowis the wall clock, andrngmakes randomness for each thread. - service_
running - Whether a copy of
nibkeep-syncruns for the person: whether one holds the lock onsync-at-login.running, which this takes for a moment to tell. - service_
version - The engine’s version that a copy of
nibkeep-synctells, orNoneif it tells none within a few seconds, as one that is gone. - settings_
folder - This computer’s folder within NibKeep’s folder of state for the person, where the list
and the files beside it are: in
~/.local/state/nibkeepon Linux (or$XDG_STATE_HOME/nibkeep),%LOCALAPPDATA%\NibKeepon Windows, which no roaming profile carries, and~/Library/Application Support/NibKeepon macOS. It is named by a hash of the computer’s ID, so that a program that syncs the home folder between computers makes no two of them write the same file. Or the folder thatNIBKEEP_STATEnames, as tests name one.Nonewhere there is no home folder. - start_
service - Starts a copy of
nibkeep-sync, apart from this program, so that it runs on when this one ends. - status
- What syncing from login does for the library in
directory, or the one whose replica here isreplica, as after its folder was named another way: as far as it can be read, for a program to show; a list that cannot be read counts as one without it. Of a library that is off, nothing more is read. - turn_
off - Turns syncing from login off for the library in
directory, or, if the list has none there, forreplica, as after the library’s folder was moved. The service lets go of its role once it reads the list, and ends if it was the last. Once the list, written, holds no library, the login entry goes too, while the list is locked; so a later turning off removes an entry left by one that failed to. Where there is no list, nothing is written, and the entry is left alone. - turn_on
- Turns syncing from login on for a library: adds it to the list; names
own, this program’s copy ofnibkeep-sync, if it is newer than the one listed, asversion_oftells; and, once the list is written, makes the login entry start the listed copy, leaving it off if the person turned it off. The entry changes while the list is locked, so that turning another library off meanwhile never removes it. A login entry that cannot be made leaves the library on the list, and is told.
Type Aliases§
- Keyring
Locked - Whether the keystore holds its entry of a service and an account locked.
- Version
Of - What tells the engine’s version of a copy of
nibkeep-sync, asservice_versiondoes.