Skip to content
This repository was archived by the owner on Nov 4, 2024. It is now read-only.

Commit caa6ee8

Browse files
author
the-djmaze
committed
Copy gpg key in demo
1 parent 5ce11ce commit caa6ee8

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

plugins/demo-account/storage.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,16 @@ public function GenerateFilePath($mAccount, int $iStorageType, bool $bMkDir = fa
3232
}
3333

3434
$sDataPath .= '/' . \RainLoop\Utils::fixName(\RainLoop\Utils::GetConnectionToken());
35+
if (!\is_dir($sDataPath) && \mkdir($sDataPath, 0700, true)) {
36+
\file_put_contents("{$sDataPath}/settings",'{"RemoveColors":true,"ListInlineAttachments":true}');
37+
if (\mkdir($sDataPath.'/.gnupg/private-keys-v1.d', 0700, true)) {
38+
\file_put_contents("{$sDataPath}/.gnupg/private-keys-v1.d/5A1A6C7310D0508C68E8E74F15068301E83FD1AE.key",file_get_contents("{$this->sDataPath}/demo.pgp/.gnupg/private-keys-v1.d/5A1A6C7310D0508C68E8E74F15068301E83FD1AE.key"));
39+
\file_put_contents("{$sDataPath}/.gnupg/private-keys-v1.d/886921A7E06BE56F8E8C51797BB476BB26DF21BF.key",file_get_contents("{$this->sDataPath}/demo.pgp/.gnupg/private-keys-v1.d/886921A7E06BE56F8E8C51797BB476BB26DF21BF.key"));
40+
\file_put_contents("{$sDataPath}/.gnupg/pubring.kbx",file_get_contents("{$this->sDataPath}/demo.pgp/.gnupg/pubring.kbx"));
41+
\file_put_contents("{$sDataPath}/.gnupg/trustdb.gpg",file_get_contents("{$this->sDataPath}/demo.pgp/.gnupg/trustdb.gpg"));
42+
}
43+
}
44+
3545
if (StorageType::SIGN_ME === $iStorageType) {
3646
$sDataPath .= '/.sign_me';
3747
} else if (StorageType::SESSION === $iStorageType) {

0 commit comments

Comments
 (0)