Skip to content
This repository has been archived by the owner on Apr 25, 2023. It is now read-only.

Commit

Permalink
auto-GPG key import
Browse files Browse the repository at this point in the history
  • Loading branch information
hinto-janai committed Apr 12, 2022
1 parent 689efea commit 524926a
Show file tree
Hide file tree
Showing 8 changed files with 55 additions and 19 deletions.
7 changes: 6 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,14 @@
- `monero-bash edit <process>` to edit systemd service files

* **Wallet**
- `monero-bash` command now allows `view-only` wallet creation
- `monero-bash` command can create `view-only` wallets
- This requires the ***Main Address*** and ***Private Viewkey*** which can be get with the: `address` and `viewkey` commands while inside monero-wallet-cli

* **GPG**
- if `monero-bash gpg` is on, keys will automatically be imported on installation/upgrade of package
- `monero-bash gpg <author/all>` to select which keys to import


# v1.0.0
## Official Release
* See the [main repo](https://github.com/hinto-janaiyo/monero-bash) for all information on monero-bash
Expand Down
11 changes: 10 additions & 1 deletion monero-bash
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,16 @@ if [[ $options = "true" ]]; then
gpg)
case $2 in
"") gpg_Toggle ;;
import) gpg_import_All ;;
import)
case $3 in
all|All|ALL) gpg_import_All ;;
binaryfate|Binaryfate|monero|Monero|MONERO) gpg_import_Monero ;;
hinto|hinto-janaiyo|Hinto|monero-bash|Monero-Bash) gpg_import_MoneroBash ;;
xmrig|XMRig|XMRIG|Xmrig) gpg_import_XMRig ;;
SChernykh|schernykh|SCHERNYKH|p2pool|p2p|P2P|P2Pool|P2POOL) gpg_import_P2Pool ;;
*) error_Unknown ;;
esac
;;
*) error_Unknown ;;
esac
;;
Expand Down
4 changes: 4 additions & 0 deletions src/func/define
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ define_Monero()
SIG="$SHA"
GPG_OWNER="binaryfate"
GPG_PUB_KEY="https://raw.githubusercontent.com/monero-project/monero/master/utils/gpg_keys/binaryfate.asc"
KEY_ID="81AC591FE9C4B65C5806AFC3F0AF4D462A0BDF92"
}

define_MoneroBash()
Expand All @@ -39,6 +40,7 @@ define_MoneroBash()
SIG="$SHA"
GPG_OWNER="hinto-janaiyo"
GPG_PUB_KEY="https://raw.githubusercontent.com/hinto-janaiyo/monero-bash/master/gpg/hinto-janaiyo.asc"
KEY_ID="21958EE945980282FCB849C8D7483F6CA27D1B1D"
}

define_XMRig()
Expand All @@ -60,6 +62,7 @@ define_XMRig()
SIG="${SHA}.sig"
GPG_OWNER="xmrig"
GPG_PUB_KEY="https://raw.githubusercontent.com/xmrig/xmrig/master/doc/gpg_keys/xmrig.asc"
KEY_ID="9AC4CEA8E66E35A5C7CDDC1B446A53638BE94409"
}

define_P2Pool()
Expand All @@ -81,4 +84,5 @@ define_P2Pool()
SIG="$SHA"
GPG_OWNER="SChernykh"
GPG_PUB_KEY="https://p2pool.io/SChernykh.asc"
KEY_ID="1FCAAB4D3DC3310D16CBD508C47F82B54DA87ADF"
}
28 changes: 19 additions & 9 deletions src/func/gpg
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ gpg_Toggle()

gpg_import_Template()
{
local LOCAL="$(cat "$installDirectory/gpg/${GPG_OWNER}.asc")"
local ONLINE="$(wget -qO- "$GPG_PUB_KEY")"
if [[ "$LOCAL" = "$ONLINE" ]]; then
$bwhite; echo -n "$GPG_OWNER: "
$bgreen; echo "OK" ;$off
Expand All @@ -40,28 +42,36 @@ gpg_import_Template()
fi
}

gpg_import_All()
gpg_import_Monero()
{
define_Monero
local LOCAL="$(cat "$installDirectory/gpg/${GPG_OWNER}.asc")"
local ONLINE="$(wget -qO- "$GPG_PUB_KEY")"
gpg_import_Template
}

gpg_import_MoneroBash()
{
define_MoneroBash
local LOCAL="$(cat "$installDirectory/gpg/${GPG_OWNER}.asc")"
local ONLINE="$(wget -qO- "$GPG_PUB_KEY")"
gpg_import_Template
}

gpg_import_XMRig()
{
define_XMRig
local LOCAL="$(cat "$installDirectory/gpg/${GPG_OWNER}.asc")"
local ONLINE="$(wget -qO- "$GPG_PUB_KEY")"
gpg_import_Template
}

gpg_import_P2Pool()
{
define_P2Pool
local LOCAL="$(cat "$installDirectory/gpg/${GPG_OWNER}.asc")"
local ONLINE="$(wget -qO- "$GPG_PUB_KEY")"
gpg_import_Template
}
gpg_import_All()
{
gpg_import_Monero
gpg_import_MoneroBash
gpg_import_XMRig
gpg_import_P2Pool
}

gpg_Diff()
{
Expand Down
2 changes: 2 additions & 0 deletions src/func/upgrade
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ upgrade_Template()
# DOWNLOAD
print_GreenHash "Downloading [$NAME_PRETTY]"
download_Template

# VERIFY
print_WhiteHash "Verifying"
verify_Template

Expand Down
8 changes: 7 additions & 1 deletion src/func/verify
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,13 @@ verify_Template()
sigFile="$hashFile"
hashSTDOUT="$(cat "$tmpHash/$hashFile")"

# xmrig author pls include the sig in the hash file
# check if gpg key is imported
if ! gpg --list-keys "$KEY_ID" &>/dev/null ;then
$white; echo "Importing GPG key..."
gpg_import_Template
fi

# xmrig author pls include the sig in the hash file
if [[ $downloadXMRig = "true" ]]; then
if [[ $HTML = "true" ]]; then
sigLink="$(echo "$DUMP" \
Expand Down
12 changes: 6 additions & 6 deletions src/txt/hashlist
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
4eebf5932291834386e01210cc217e902771a611f1ed02a5f15eecdb561b1ad2 monero-bash
34e858170a44209916e08f23757acececfa4707a26f046ab6006ccbf1b9ac92a monero-bash
963c01218a8086475c760430dfa539d923619fac07513e74caa657c6dad10439 src/debug
56da6eaf9ccf77a9ffef22f1c969d95ee16e354f3710c9bcc8062adfd3303e0b src/source
78537dcbabd068da59044d2b346ec87c1ecf79b84cf39bee915c76b8f6c5261c src/var
Expand All @@ -7,10 +7,10 @@ d40b3a296f2f69d28230c6eb489e1c6a233d587db87069eff535f3f2af0a0c65 src/func/build
080dfee834a98cccaae0b862fdba38888040dc4428029709a2e8730ab3ca541a src/func/check
f67e6c1e18b44e4d42c2942ff58a9096897dc1b7201bcebd4d13f3b1f00ab551 src/func/code
af858f0830aac7103a4a5fc1b370aaceb8ae30f5cc18c93ece66b44dc9293f74 src/func/compromised
c87165488725abecadb45d5c49089485be610a1381a31cfe53e477ac1c106596 src/func/define
ab17e49c5b76ba60f26c315fef10389e1360c448b56faba05fc4666903d6558d src/func/define
bc1ed3fdb5781986e60148e5043f7730ee7f79429883af70b1d9d951b2eb8d50 src/func/download
6c52d29903456bee78e163cc97e2c37321a44bdfa70e60f1ce0eb50d7afc0d8d src/func/error
ddbfb043e0045fb12bcffb3418061abd4ce26cedf2b1f93667de13e088e7d54d src/func/gpg
bec1330023f7651e9a9adad3c5583f13747bee904f3cacdf0ad7c5b5a8cd3e8e src/func/gpg
9d01560f1fc2fa38445551ed0691292877b59de85039ec8388bdd5d99154f5be src/func/install
87765d83ca56963448462ef4e7a9f82c70c42622713a1019d5f557ebd6d7bd0e src/func/mine
84c69bb7b606611b689fe2669f6c9db4c1feccad27e26277b445d494d2c5d919 src/func/missing
Expand All @@ -27,14 +27,14 @@ f6ff287562bc20876a14b47e1244e3ac45a465441f64aebdbfdb6e6092b4c051 src/func/syste
40c8de4509548e6cb9d0f056bd82135fe472b3c277d7fddc565b01a894d09cf2 src/func/tmp
0973b91157557e6e544096168b2bcf17336bce839261acc0f37fb08ce56d999f src/func/trap
dc94a6f9d32b36aa75d56e9dc58c53bfd82a3243fb528278201fa3237d523cd5 src/func/update
5a1136da36605101d5673015b7286c6d0b876aafcd6d4ab7ee2a99e4fef0289a src/func/upgrade
e72846a81c1cb5e4dce57993292d0b2ae7c1628b9ab343b23713c75b367d0003 src/func/upgrade
ad61f19892bc4f9d733253763c5626a0ef4b89397744728f2b4da16216d38b73 src/func/verbose
abd986b1b1b7c040144321cc8513ac960a1f80411c7177a07c33dcff10ead3a8 src/func/verify
70424f707fc1c5c49f026672da6a0cb622334eb4ca1bf296ff97b9e8712d83ee src/func/verify
73e4c1a93e00335a020391c41fa1f155a256892f8ecfbb91e6705f0502db2c1e src/func/version
4f19bd9215b35aaad933a576180176352a02fbb14d277fded5e016a9dc55acb5 src/func/wallet
bf8c6590145c57476768fca4da06d6e128590a4c8b777900c5d850a767dac256 src/func/watch
0847fe15f8c17dc3ed4a0e221a46c04afbb731ad98412fda05d8f3bbc5d6ee43 src/txt/state
1f1ad6a5924840d257aff6c0e2baf3717fc608f07b78b43260d1ef8f96965340 src/txt/usage
9ce8c1d825b69095b00e602a719f8a86133e098953ed326421123b83fb3b7732 src/txt/usage
fabcc002797166b1344376faa980d0cd56e8626323d57f58d3cbe9b667ddc6ed config/monero-bash.conf
1206ad1c60952930a93a2244b13f268a57def70934ba399462b04295372db1aa config/monerod.conf
e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 config/monero-wallet-cli.conf
Expand Down
2 changes: 1 addition & 1 deletion src/txt/usage
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ watch <daemon/xmrig/p2pool> watch live output of process
edit <daemon/xmrig/p2pool> edit systemd service file

gpg toggle GPG verification of binaries
gpg import import GPG keys of package authors
gpg import <author/all> import GPG keys of package authors
backup encrypt and backup your /wallets/
decrypt decrypt backup.tar.gpg

Expand Down

0 comments on commit 524926a

Please sign in to comment.