Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Mempool LN functionality #2042

Merged
merged 2 commits into from
Jan 10, 2025
Merged

Fix Mempool LN functionality #2042

merged 2 commits into from
Jan 10, 2025

Conversation

nmfretz
Copy link
Contributor

@nmfretz nmfretz commented Jan 10, 2025

This PR fixes an issue where in umbrelOS 1.3, optional Lightning Node app environment variables were not sourced for the mempool app.

Closes #2041

Copy link

🎉   Linting finished with no errors or warnings   🎉

Thank you for your submission! This is an automated linter that checks for common issues in pull requests to the Umbrel App Store.

Please review the linting results below and make any necessary changes to your submission.

Linting Results

Severity File Description
ℹ️ mempool/docker-compose.yml Potentially using unsafe user in service "widget-server":
The default container user "root" can lead to security vulnerabilities. If you are using the root user, please try to specify a different user (e.g. "1000:1000") in the compose file or try to set the UID/PUID and GID/PGID environment variables to 1000.

Legend

Symbol Description
Error: This must be resolved before this PR can be merged.
⚠️ Warning: This is highly encouraged to be resolved, but is not strictly mandatory.
ℹ️ Info: This is just for your information.

@nmfretz
Copy link
Contributor Author

nmfretz commented Jan 10, 2025

Tested and ready to be merged.

@knorrium thanks very much for bringing this to our attention 🙏. Are you good with this hotfix going live or is there an imminent https://github.com/mempool/mempool update you'd like to wait for?

@knorrium
Copy link
Contributor

@nmfretz thanks for the quick turnaround. Please merge it so we can continue testing our upcoming release.

I caught this while upgrading our instances and didn't see anything obvious in the release notes, but thankfully my RPi was still on the previous version where it worked :)

@nmfretz
Copy link
Contributor Author

nmfretz commented Jan 10, 2025

Thanks @knorrium. Going live.

@nmfretz nmfretz merged commit 61def51 into master Jan 10, 2025
1 check passed
# Check if Lightning Node app is installed and export required variables if so
# The Lightning Node app is optional and not listed in the `required` field of the umbrel-app.yml file, so we need to do this for compatibility with umbrelOS >=1.3 where only exports of required apps are sourced.
installed_apps=$("${UMBREL_ROOT}/scripts/app" ls-installed)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nmfretz I just pulled the merged changes and I still don't see the exported variables.

Trying to debug, when I run umbrel/scripts/app ls-installed I get This script requires "docker-compose" to be installed, so it looks like the check below is failing.

Were you able to test this locally?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey, yes I tested this in production on both arm64 and x86.

You will not be able to successfully run umbrel/scripts/app ls-installed manually in umbrelOS 1.0+. This is a legacy umbrelOS 0.5 script; however, umbreld in umbrelOS 1.0+ will properly handle this when sourcing the exports.sh file and it will translate it to the proper function call.

I just pulled the merged changes and I still don't see the exported variables.

I can help troubleshoot. How did you end up updating the mempool app to this current version (3.0.1-hotfix)?

Copy link
Contributor

@knorrium knorrium Jan 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nmfretz I usually do the following:

  1. Clone umbrel-apps to the home dir (often from our fork, let's call it mempool-umbrel-apps, where we make the changes to the app)
  2. Remove the local app definitionrm -rf umbrel/app-stores/getumbrel-umbrel-apps-github-53f74447/mempool/
  3. Copy the app from the cloned repo cp -R ~/mempool-umbrel-apps/mempool ~/umbrel/app-stores/getumbrel-umbrel-apps-github-53f74447/mempool
  4. Update the app umbreld client apps.update.mutate --appId mempool

Then I checked the running container:

  1. sudo su
  2. docker ps | grep backend
  3. docker exec -it <container_id> /bin/bash
  4. export
  5. cat mempool-config.json

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While writing this I realized that I accidentally ran apps.restart.mutate instead of apps.update.mutate 🤦

Now that I updated the app, I can see that the lightning tab is working again and I see the correct exports.

Copy link
Contributor Author

@nmfretz nmfretz Jan 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @knorrium, that all looks good. And so if you check the env of the api container right now does it show the correct LND variables or are they missing there too?

sudo docker exec mempool_api_1 env

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here is mempool running on my Pi 5 right now:

$ sudo docker exec mempool_api_1 env | grep LND
LND_REST_API_URL=https://10.21.21.9:8080
LND_TIMEOUT=120000
LND_TLS_CERT_PATH=/lnd/tls.cert
LND_MACAROON_PATH=/lnd/data/chain/bitcoin/mainnet/readonly.macaroon

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nmfretz just checked the env like that and I can confirm it's correct 🎉

Thanks again!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While writing this I realized that I accidentally ran apps.restart.mutate instead of apps.update.mutate 🤦

Now that I updated the app, I can see that the lightning tab is working again and I see the correct exports.

Whoops, sorry I missed this when responding. Haha, no worries at all. Glad it's sorted. Excited for the next release!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug?] APP_LIGHTNING_NODE_IP and APP_LIGHTNING_NODE_REST_PORT no longer available
2 participants