|
| 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 &settings, 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 | signingKeyUnavailable (const AppSettings &s, QString *note) -> bool |
| | Whether the profile has a signing key whose secret key gpg does not hold, so no list may be written: writing one takes the next generation, and an unsigned list then leaves this device's record ahead of the store's own.
|
| static auto | entriesOnThisList (const QString &dir, bool viaPass) -> QStringList |
| | The encrypted entries under dir that the new root list covers: visible regular .gpg files, sub-folders included, except those under a sub-folder whose own .gpg-id decides for them (as pass reads it with viaPass, as the native backend does without).
|
| 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.
|
| static auto | runGit (QProcess &git, const AppSettings &s, const QString &dir, const QStringList &args, QString *note) -> bool |
| | Run one set-up git command on git and wait for it: init and add, which read what lies in the folder, for at most two minutes, as the window waits too; a commit, which git may sign and so wait for the passphrase, without a limit.
|
| static auto | refusedForGit (const QString &dir, const QStringList &files, QString *note) -> bool |
| | Whether staging files in dir is refused because git could wait on something there for good: a .gitattributes or .gitignore on the way that is not a regular file, or a repository in a sub-folder.
|
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 31 of file profileinit.h.
| auto ProfileInit::initialise |
( |
const QString & | dir, |
|
|
const QList< UserInfo > & | users, |
|
|
const AppSettings & | settings, |
|
|
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. |
| settings | Settings for the gpg/git executables and the signing key; with no signing key set, one exported for pass counts (GpgIdSigner::settingOrExported()). |
| 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 166 of file profileinit.cpp.
| auto ProfileInit::runGit |
( |
QProcess & | git, |
|
|
const AppSettings & | s, |
|
|
const QString & | dir, |
|
|
const QStringList & | args, |
|
|
QString * | note ) -> bool |
|
staticprivate |
Run one set-up git command on git and wait for it: init and add, which read what lies in the folder, for at most two minutes, as the window waits too; a commit, which git may sign and so wait for the passphrase, without a limit.
- Parameters
-
| git | The process, set up for the store. |
| s | Settings for the git executable. |
| dir | The store, named in the note. |
| args | The git arguments; the first names the command. |
| note | Receives a translated error naming the command, or that it ran out of time. |
- Returns
- Whether the command succeeded.
Definition at line 395 of file profileinit.cpp.