diff --git a/app/repositories/lightning.py b/app/repositories/lightning.py index e11a3ea..aec415d 100644 --- a/app/repositories/lightning.py +++ b/app/repositories/lightning.py @@ -177,6 +177,11 @@ async def register_lightning_listener(): """ try: + + if lightning_config.ln_node == "" or lightning_config.ln_node == "none": + logging.info("SKIPPING register_lightning_listener -> no lightning configured") + return + await ln.get_ln_info_impl() loop = asyncio.get_event_loop() diff --git a/app/utils.py b/app/utils.py index 02c23a0..40d8d64 100644 --- a/app/utils.py +++ b/app/utils.py @@ -26,10 +26,11 @@ elif node_type == "cln_grpc": import app.repositories.ln_impl.protos.cln.node_pb2_grpc as clnrpc elif node_type == "cln_unix_socket": from pyln.client import LightningRpc +elif node_type == "" or node_type == "none": + logging.info("Running in bitcoin-only mode") else: raise ValueError(f"Unknown node type: {node_type}") - from app.models.bitcoind import BlockRpcFunc @@ -104,7 +105,7 @@ class LightningConfig: opts = (("grpc.ssl_target_name_override", "cln"),) self._channel = grpc.aio.secure_channel(cln_grpc_url, creds, options=opts) self.cln_stub = clnrpc.NodeStub(self._channel) - elif self.ln_node == "none": + elif self.ln_node == "none" or self.ln_node == "": # its ok to run raspiblitz also without lightning pass else: diff --git a/scripts/sync_to_blitz.sh b/scripts/sync_to_blitz.sh index 9065109..2baf992 100644 --- a/scripts/sync_to_blitz.sh +++ b/scripts/sync_to_blitz.sh @@ -40,7 +40,8 @@ if [ "$?" != "0" ]; then fi local=. -remote=admin@$localIP:/root/blitz_api +remoteRepoPath="/root/blitz_api" +remote="admin@$localIP:${remoteRepoPath}" # clean pycache just in case the code was compiled locally before echo "# local cache delete .." @@ -55,6 +56,17 @@ rm -r ./app/repositories/__pycache__ 2>/dev/null rm -r ./app/routers/__pycache__ 2>/dev/null rm -r ./app/auth/__pycache__ 2>/dev/null +# make sure remote repo files can be overwritten bei user admin +sshpass -p "$passwordA" ssh -p $sshPort admin@$localIP "sudo chown -R admin:admin ${remoteRepoPath}" +result=$? +echo "result(${result})" +if [ "$result" != "0" ]; then + echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!" + echo "FAIL: was not able to ssh in: ssh -p ${sshPort} admin@$localIP" + echo "SSH in once manually. Then try again." + exit 1 +fi + # Needs sshpass installed echo "# syncing local code to: ${remote}" sshpass -p "$passwordA" rsync -rvz --exclude .git/ -e "ssh -p ${sshPort}" $local $remote @@ -62,8 +74,7 @@ result=$? echo "result(${result})" if [ "$result" != "0" ]; then echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!" - echo "FAIL: was not able to ssh in: ssh -p ${sshPort} admin@$localIP" - echo "SSH in once manually. Then try again." + echo "FAIL: was not able to rsync" exit 1 fi