enabling lnd breaks settings.php
- nodl model: nodl two
- nodl version: v0.1.3h (Abyssinian)
- lnd version: v0.16.4-beta
when enabling the lnd service, settings.php is broken for the components tor and lnd. this is visible on both sides clearly because the footer isn't visible...
for example rendering of the settings.php page seems to stop at this line for lnd: https://gitlab.lightning-solutions.eu/nodl-private/nodl-admin-private/-/blob/nodl-one/www/pages/settings.php?ref_type=heads#L1084
echo('<p>Open Zap (Mobile and Desktop) and auto-connect: <a href=\'lndconnect://'.$_SERVER['HTTP_X_ORIGINAL_TO'].':10009?cert='.base64url_encode(base64_decode(str_replace(array('-----BEGIN CERTIFICATE-----','-----END CERTIFICATE-----'),array('',''),implode('',file('/opt/bitcoin/.lnd/tls.cert'))))).'&macaroon='.base64url_encode(file_get_contents('/etc/nodl/lnd-admin.macaroon')).'\'>click here</a></p>');
I can see the bold "Zap quick connect:" after that everything else is missing...
the same applies for the settings.php page for the tor component.
in this case rendering seems to stop at this line: https://gitlab.lightning-solutions.eu/nodl-private/nodl-admin-private/-/blob/nodl-one/www/pages/settings.php?ref_type=heads#L836
case 'lnd_rest':
if(isset($status['lnd_status']) && "2"==unserialize($status['lnd_status'])) {
echo('<p>*** Open Zap (Mobile only) and auto-connect through tor: <a href=\'lndconnect://'.unserialize($status['tor_'.$service_name.'_url']).'?cert='.base64url_encode(base64_decode(str_replace(array('-----BEGIN CERTIFICATE-----','-----END CERTIFICATE-----'),array('',''),implode('',file('/opt/bitcoin/.lnd/tls.cert'))))).'&macaroon='.base64url_encode(file_get_contents('/etc/nodl/lnd-admin.macaroon')).'\'>click here</a></p>');
ob_start();
QRCode::png('lndconnect://'.unserialize($status['tor_'.$service_name.'_url']).'?cert='.base64url_encode(base64_decode(str_replace(array('-----BEGIN CERTIFICATE-----','-----END CERTIFICATE-----'),array('',''),implode('',file('/opt/bitcoin/.lnd/tls.cert'))))).'&macaroon='.base64url_encode(file_get_contents('/etc/nodl/lnd-admin.macaroon')));
$qr = ob_get_clean();
echo('<p>*** gRPC (Zap) QR-Code (hidden for your safety, don\'t show if anyone\'s watching)</p>');
echo('<p><a class="btn btn-primary" data-toggle="collapse" href="#QRCode" role="button" aria-expanded="false" aria-controls="QRCode">Show / Hide</a></p>');
echo('<p class="collapse" id="QRCode"><img src="data:image/png;base64,'.base64_encode($qr).'" /></p>');
}
break;
I can see everything including LND REST onion address but everything after that is not visible..
I have tried to:
- restart services -> doesn't fix it, but as soon as lnd is disabled the settings.php works again..
- re-install lnd -> no changes in behavior
- checked that the files /etc/nodl/lnd-admin.macaroon and /opt/bitcoin/.lnd/tls.cert are existent and have correct permissions..
- checked logs but didn't see hints...
i think it has something to do with getting the state of lnd/tor...
for example in case of opening settings for tor it looks like this condition fails:
if(isset($status['lnd_status']) && "2"==unserialize($status['lnd_status'])) {
in the other case im not sure though...
It could also be an issue with lnd, but re-install didn't fix it... -> and i have to mention here: ride the lightning seems to work correctly, so i think the issue is rather an UI issue then lnd itself...
However, my knowledge of the system is not enough to dig deeper and i need help here.. Happy to assist if I can perform a test or similar...