Tor: update from Torpoject repo and readd keys

#3179
This commit is contained in:
openoms 2022-06-22 10:23:52 +01:00
parent 8f756e2d47
commit f4d9d6e4df
No known key found for this signature in database
GPG Key ID: 5BFB77609B081B65
2 changed files with 21 additions and 15 deletions

View File

@ -501,7 +501,7 @@ if [ "${mempoolExplorer}" == "on" ]; then
fi
if [ "${runBehindTor}" == "on" ]; then
OPTIONS+=(TOR "Update Tor from the source code")
OPTIONS+=(TOR "Update Tor from the Torproject repo")
fi
if [ "${itchysats}" == "on" ]; then

View File

@ -42,6 +42,21 @@ architecture=$(dpkg --print-architecture)
#### FUNCTIONS ####
add_tor_sources(){
echo -e "\n*** Adding deb.torproject.org keyring ***"
if ! curl -s -x socks5h://127.0.0.1:9050 --connect-timeout 10 "${tor_deb_repo_clean}/torproject.org/${tor_deb_repo_pgp_fingerprint}.asc" | gpg --dearmor | sudo tee /etc/apt/trusted.gpg.d/torproject.gpg >/dev/null; then
echo "!!! FAIL: Was not able to import deb.torproject.org key";
exit 1
fi
echo "- OK key added"
echo -e "\n*** Adding Tor Sources ***"
echo "
deb [arch=${architecture}] ${tor_deb_repo}/torproject.org ${distribution} main
deb-src [arch=${architecture}] ${tor_deb_repo}/torproject.org ${distribution} main
" | sudo tee /etc/apt/sources.list.d/tor.list
echo "- OK sources added"
}
configure_default_torrc(){
echo -e "\n*** updating Tor config ${torrc} ***"
@ -140,19 +155,7 @@ if [ "${action}" = "install" ]; then
# shellcheck disable=SC2086
sudo apt install -y ${tor_pkgs}
echo -e "\n*** Adding deb.torproject.org keyring ***"
if ! curl -s -x socks5h://127.0.0.1:9050 --connect-timeout 10 "${tor_deb_repo_clean}/torproject.org/${tor_deb_repo_pgp_fingerprint}.asc" | gpg --dearmor | sudo tee /etc/apt/trusted.gpg.d/torproject.gpg >/dev/null; then
echo "!!! FAIL: Was not able to import deb.torproject.org key";
exit 1
fi
echo "- OK key added"
echo -e "\n*** Adding Tor Sources ***"
echo "
deb [arch=${architecture}] ${tor_deb_repo}/torproject.org ${distribution} main
deb-src [arch=${architecture}] ${tor_deb_repo}/torproject.org ${distribution} main
" | sudo tee /etc/apt/sources.list.d/tor.list
echo "- OK sources added"
add_tor_sources
echo -e "\n*** Reinstall ***"
sudo apt update -y
@ -286,7 +289,10 @@ if [ "${action}" = "update" ]; then
sudo systemctl start tor
echo "# Installed $(tor --version)"
;;
*) sudo apt update && sudo apt install tor && sudo systemctl restart tor;;
*)
add_tor_sources
sudo apt update && sudo apt install tor && sudo systemctl restart tor
;;
esac
echo
exit