|
| static auto | gpgEnvironment (const AppSettings &s) -> QProcessEnvironment |
| | The environment QtPass runs gpg in outside the active store's backend: the system's, with GNUPGHOME set to the configured GPG home when there is one, so lookups and signatures use the keyring that signs.
|
| static auto | needsInit (const QString &path) -> bool |
| | Check if a profile path needs initialization.
|
| static auto | initialise (const QString &dir, const QList< UserInfo > &users, const AppSettings &s, bool useGit, QString *note) -> bool |
| | Write the recipients and, if wanted, put the folder under git.
|
| static auto | initGit (const QString &dir, const AppSettings &s, QString *note) -> bool |
| | Put an existing store under Git: git init, stage the .gpg entries and the .gpg-id files (nothing else that may lie around in the folder) and make a first commit, with blocking processes of their own in dir.
|
| static auto | gitIdentityConfigured (const QString &dir, const AppSettings &s) -> bool |
| | Whether git has a name and e-mail to commit with, i.e. user.name and user.email resolve (globally or in dir).
|
|
| static auto | writeGpgId (const QString &gpgIdFile, const QList< UserInfo > &users, bool signed_, QString *note, QByteArray *written=nullptr) -> bool |
| | Write the enabled recipients to gpgIdFile, whole or not at all; with signed_ the list carries the generation and folder header a signed store's lists are checked against (GpgIdGeneration).
|
| static auto | signGpgId (const QString &gpgIdFile, const QByteArray &contents, const AppSettings &s, QString *note) -> bool |
| | Sign the list just written as gpgIdFile, over the bytes contents that were written.
|
| static auto | commitGpgId (const QString &dir, const QString &gpgIdFile, const QString &sigFile, const AppSettings &s, QString *note) -> bool |
| | git init in dir, stage the .gpg-id and its signature, and commit them (signed when pass.signcommits is set), with a QProcess of its own in the store's Git environment.
|
Turn a directory into a password store without going through the Pass backend of the currently active store.
The backend is a shared singleton bound to the active store (settings snapshot, PASSWORD_STORE_DIR, one FIFO of asynchronous processes), so a new profile cannot be initialised through it without racing the active store (#1774). Everything here is synchronous and touches only dir.
Definition at line 30 of file profileinit.h.
| auto ProfileInit::initialise |
( |
const QString & | dir, |
|
|
const QList< UserInfo > & | users, |
|
|
const AppSettings & | s, |
|
|
bool | useGit, |
|
|
QString * | note ) -> bool |
|
static |
Write the recipients and, if wanted, put the folder under git.
Writes <dir>/.gpg-id with the enabled key ids, signs it when s.passSigningKey is set, and when useGit runs git init, git add and git commit inside dir with blocking processes. Existing *.gpg files are left alone: re-encrypting them needs the backend, i.e. the profile has to be the active store; note says so.
- Parameters
-
| dir | Directory to initialise; created if missing. |
| users | Key list; only entries with enabled == true are written. |
| s | Settings for the gpg/git executables and the signing key. |
| useGit | Whether to create a repository and commit the file. |
| note | Receives a translated message for the user (empty on a quiet success): the error, or the warning about existing entries. |
- Returns
- true when the .gpg-id (and signature/commit if requested) is in place.
Definition at line 92 of file profileinit.cpp.