improve API config (#3532)

* remove secret preset (not needed)

* add ip2d debug install info
This commit is contained in:
/rootzoll 2022-12-16 14:07:04 +01:00 committed by GitHub
parent 0ce4cca4ec
commit fe6737439a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 9 additions and 18 deletions

View file

@ -14,7 +14,6 @@ if [ $# -eq 0 ] || [ "$1" = "-h" ] || [ "$1" = "-help" ]; then
exit 1
fi
function confAdd {
# get parameters
keystr="$1"
@ -165,16 +164,16 @@ if [ "$1" = "1" ] || [ "$1" = "on" ]; then
exit 0
fi
echo "# sudo systemctl enable i2pd"
sudo systemctl enable i2pd
echo "# i2pd config"
/home/admin/config.scripts/blitz.conf.sh set debug tor /mnt/hdd/bitcoin/bitcoin.conf noquotes
confAdd debug i2p /mnt/hdd/bitcoin/bitcoin.conf
/home/admin/config.scripts/blitz.conf.sh set i2psam 127.0.0.1:7656 /mnt/hdd/bitcoin/bitcoin.conf noquotes
/home/admin/config.scripts/blitz.conf.sh set i2pacceptincoming 1 /mnt/hdd/bitcoin/bitcoin.conf noquotes
/home/admin/config.scripts/blitz.conf.sh set onlynet tor /mnt/hdd/bitcoin/bitcoin.conf noquotes
confAdd onlynet i2p /mnt/hdd/bitcoin/bitcoin.conf
# config
PASSWORD_B=$(sudo cat /mnt/hdd/bitcoin/bitcoin.conf | grep rpcpassword | cut -c 13-)
cat << EOF | sudo tee /etc/i2pd/i2pd.conf
# i2pd settings for the RaspiBlitz

View file

@ -33,6 +33,7 @@ echo "deleting local DNS confs ..."
sudo rm /etc/resolv.conf
echo "OK"
# make sure that every install runs API with own secret=
echo
echo "deleting old API conf ..."
sudo rm /home/blitzapi/blitz_api/.env 2>/dev/null

View file

@ -41,7 +41,6 @@ if [ "$1" = "update-config" ]; then
sed -i "s/^platform=.*/platform=raspiblitz/g" ./.env
# configure access token secret
secretNeedsInit=$(cat ./.env 2>/dev/null| grep -c "=please_please_update_me_please")
if [ "${secret}" == "" ] || [ "${secret}" == "please_please_update_me_please" ]; then
echo "# init secret ..."
secret=$(dd if=/dev/urandom bs=256 count=1 2> /dev/null | shasum -a256 | cut -d " " -f1)
@ -68,7 +67,6 @@ if [ "$1" = "update-config" ]; then
sed -i "s/^bitcoind_user=.*/bitcoind_user=${RPCUSER}/g" ./.env
sed -i "s/^bitcoind_pw=.*/bitcoind_pw=${RPCPASS}/g" ./.env
# configure LND
if [ "${lightning}" == "lnd" ]; then
@ -248,11 +246,6 @@ if [ "$1" = "1" ] || [ "$1" = "on" ]; then
exit 1
fi
# build the config and set unique secret (its OK to be a new secret every install/update)
/home/admin/config.scripts/blitz.web.api.sh update-config
secret=$(head /dev/urandom | tr -dc A-Za-z0-9 | head -c 64 ; echo '')
sed -i "s/^secret=.*/secret=${secret}/g" ./.env
# prepare systemd service
echo "
[Unit]

View file

@ -35,16 +35,14 @@ function buildGRPCplugin() {
echo "# - install Core Lightning ..."
/home/admin/config.scripts/cl.install.sh install || exit 1
fi
# rust for cln-grpc, includes rustfmt
sudo -u bitcoin curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | \
sudo -u bitcoin sh -s -- -y
echo "# rust for cln-grpc, includes rustfmt"
sudo -u bitcoin curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sudo -u bitcoin sh -s -- -y
cd /home/bitcoin/lightning/plugins/grpc-plugin || exit 1
# build
sudo -u bitcoin /home/bitcoin/.cargo/bin/cargo build \
--target-dir /home/bitcoin/cln-grpc-build
# delete old dir or binary
echo "# build"
sudo -u bitcoin /home/bitcoin/.cargo/bin/cargo build --target-dir /home/bitcoin/cln-grpc-build
echo "# delete old dir or binary"
sudo rm -rf /home/bitcoin/cl-plugins-available/cln-grpc
# move to /home/bitcoin/cl-plugins-available/
echo "# move to /home/bitcoin/cl-plugins-available/"
sudo -u bitcoin mv /home/bitcoin/cln-grpc-build/debug/cln-grpc /home/bitcoin/cl-plugins-available/
else
echo "# - cln-grpc plugin was already built/installed"