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

App Submission: Saifa (lnd Invoice manager) #1021

Merged
merged 46 commits into from
May 28, 2024

Conversation

patranakamo
Copy link
Contributor

@patranakamo patranakamo commented Mar 15, 2024

App Submission
...
app name (Saifa)
...

256x256 SVG icon
https://svgur.com/i/1452.svg

description:
Saifa is designed to enhance the interoperability and efficiency of applications interacting with the Lightning Network Daemon (LND).
Our project simplifies the integration process, allowing applications to seamlessly connect to LND through an intuitive webhook system.
With Saifa, users can effortlessly create new invoices using a straightforward REST API, cancel invoices, and receive real-time updates on invoice status.
This system is crafted to streamline operations and facilitate a smoother transaction experience on the Lightning Network,
making it an essential tool for developers looking to optimize their applications for better performance and user satisfaction.

...

Gallery images
1
2
3
4

I have tested my app on:
Umbrel OS on a Raspberry Pi 4

@nmfretz
Copy link
Contributor

nmfretz commented Apr 23, 2024

Thanks for this app submission @patranakamo! We are currently behind on reviewing app PRs while we work on critical umbrelOS updates. I will review this soon.

@patranakamo
Copy link
Contributor Author

Hi nmfretz great to hear that.
Thank you for you comment.

Copy link
Contributor

@nmfretz nmfretz left a comment

Choose a reason for hiding this comment

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

Hi @patranakamo, thanks for bearing with me. And thanks again for this submission!

I've reviewed and left some packaging suggestions below. Once these are addressed I'll test out the app.

Comment on lines +1 to +2
version: "3.7"

Copy link
Contributor

Choose a reason for hiding this comment

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

The app_proxy service needs to be added here. You can take a look at Thunderhub as an example of how to set it up:
https://github.com/getumbrel/umbrel-apps/blob/master/thunderhub/docker-compose.yml

It will be used to proxy port 9989 to your web app. It can also automatically protect your app by requiring the user to enter their Umbrel password when accessing it if they aren't already logged into a session.

If you have in-buiilt authentication in your app then you could choose to remove the authentication layer by using the env varPROXY_AUTH_ADD: "false"


services:
backend:
image: patranakamo/saifa-be:v1.3.3
Copy link
Contributor

Choose a reason for hiding this comment

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

For each image in this compose file, we need to add the multi-arch digest to make sure that we are locking in a specific image that has been tested for this release. With just the tag, a new image can be pushed to docker hub with the same tag and then a new image would be downloaded by the user just by restarting the app (and of course by fresh installs).

Your image is already multi-arch which is fantastic:
image

So all you need to do is get the digest by running:

docker pull patranakamo/saifa-be:v1.3.3

and grabbing the digest from the output. In this case I get:

Digest: sha256:a04bbaba219b35d7bb59426665ae813ad2d219cb1b2e0eceed1c79170ede6228

So in this example you would do:

image: patranakamo/saifa-be:v1.3.3@sha256:a04bbaba219b35d7bb59426665ae813ad2d219cb1b2e0eceed1c79170ede6228

services:
backend:
image: patranakamo/saifa-be:v1.3.3
restart: on-failure
Copy link
Contributor

Choose a reason for hiding this comment

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

Perfect. You'll want to add this same restart: on failure to the frontend and redis services in this compose file as well.

Comment on lines +8 to +9
ports:
- "9988:80"
Copy link
Contributor

Choose a reason for hiding this comment

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

Do you need this port bound to the host? This would be necessary if external applications are trying to send requests directly to this backend container.

Or is it just your frontend container that is connecting to the backend? If so, then there is no need to bind the port to the host, since your frontend container can resolve the ip of the backend container using Docker's inbuilt dns and communicate on container port 80 directly.

ports:
- "9988:80"
volumes:
- ${APP_DATA_DIR}/data/app:/data
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you please add this directory to this repo so that it is created for users when installing the app. If we don't do this then Docker will create the directory when the container is spun up, which has the potential to cause permissions issues.

See the Lightning Node app as an example:
https://github.com/getumbrel/umbrel-apps/tree/master/lightning

You'll want to create a data directory and then a app directory inside of that with a .gitkeep file to make sure the empty directory is committed.

id: saifa
category: finance,development tool
name: Saifa - invoice lightning network manager
version: "1.0.0"
Copy link
Contributor

Choose a reason for hiding this comment

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

You can update this to your current version

@@ -0,0 +1,36 @@
manifestVersion: 1
id: saifa
category: finance,development tool
Copy link
Contributor

Choose a reason for hiding this comment

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

We currently only support one category (may change in the future). I'd suggest bitcoin for now so that it will show up with related apps.

Comment on lines 13 to 17
releaseNotes: >-
- Base Project Launch: The foundational framework of our project has been successfully deployed, establishing the core functionalities and setting the stage for future enhancements.
- Webhook System Integration: We've introduced a robust webhook system designed to facilitate seamless updates on invoice statuses. This feature ensures that applications remain synchronized, providing timely notifications to users and other connected applications.
- User Interface for Invoice Management: A user-friendly interface has been implemented, allowing users to effortlessly monitor the status of their invoices. This intuitive UI simplifies the management process, ensuring a smooth and efficient user experience.
- Enhanced Invoice Operations: Users now have the ability to add and cancel invoices directly from the simple UI. This enhancement streamlines the invoice management process, making it more accessible and convenient for our users.
Copy link
Contributor

Choose a reason for hiding this comment

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

For the initial release we can just leave these blank, since no one will get an app update notification.

You can change to:

releaseNotes: ""

email: [email protected]
dependencies:
- bitcoin
- lnd
Copy link
Contributor

Choose a reason for hiding this comment

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

the id for lnd is actually lightning for this.

Comment on lines 7 to 12
description: >-
Saifa is designed to enhance the interoperability and efficiency of applications interacting with the Lightning Network Daemon (LND).
Our project simplifies the integration process, allowing applications to seamlessly connect to LND through an intuitive webhook system.
With Saifa, users can effortlessly create new invoices using a straightforward REST API, cancel invoices, and receive real-time updates on invoice status.
This system is crafted to streamline operations and facilitate a smoother transaction experience on the Lightning Network,
making it an essential tool for developers looking to optimize their applications for better performance and user satisfaction.
Copy link
Contributor

Choose a reason for hiding this comment

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

Rendering yaml in the UI makes it a bit finicky to create whitespace. here's what you can do to make sure that the app description looks good in the app store:

If you want a paragraph to show up on a separate line without a blank line above it, then add a single blank line to the yaml

e.g.

description: >-
  I am the first block.
  
  I will show up on my own line but directly under the first block.

The above will render like this:

I am the first block.
I will show up on my own line but directly under the first block.

If you want a paragraph to show up on a separate line with a blank line above it, then add two blank lines to the yaml

e.g.

description: >-
  I am the first block.
  

  I will show up on my own line with a blank line above.

The above will render like this:

I am the first block.

I will show up on my own line with a blank line above.

@patranakamo
Copy link
Contributor Author

HI @nmfretz
Thank you so much for your detailed review. I've made the edits based on your comments. However, I’m encountering an issue with adding app_proxy.
Whenever I try to add it, I receive the following error:

ERROR: The Compose file '/home/umbrel/umbrel/scripts/support/docker-compose.app_proxy.yml' is invalid because:
services.app_proxy.ports contains an invalid type, it should be a number, or an object

The system runs normally when I remove and reinstall. (I push it in docker-composer.yml as comment in case you want to see it.)
Could you suggest any solutions for this issue? Your help would be greatly appreciated.

Thanks again.

@nmfretz
Copy link
Contributor

nmfretz commented May 13, 2024

Could you suggest any solutions for this issue? Your help would be greatly appreciated.

No worries at all, I have pushed some commits that resolve a couple issues. The app_proxy is using Docker's DNS to resolve the IP of the frontend container and proxy to port 80 running in the frontend container.

The app now installs fine, but the frontend container has these errors and won't start up:

$ sudo docker logs -f saifa_frontend_1
/docker-entrypoint.sh: /docker-entrypoint.d/ is not empty, will attempt to perform configuration
/docker-entrypoint.sh: Looking for shell scripts in /docker-entrypoint.d/
/docker-entrypoint.sh: Launching /docker-entrypoint.d/10-listen-on-ipv6-by-default.sh
10-listen-on-ipv6-by-default.sh: info: Getting the checksum of /etc/nginx/conf.d/default.conf
10-listen-on-ipv6-by-default.sh: info: /etc/nginx/conf.d/default.conf differs from the packaged version
/docker-entrypoint.sh: Launching /docker-entrypoint.d/20-envsubst-on-templates.sh
/docker-entrypoint.sh: Launching /docker-entrypoint.d/30-tune-worker-processes.sh
/docker-entrypoint.sh: Configuration complete; ready for start up
2024/05/13 12:13:19 [emerg] 1#1: host not found in upstream "backend" in /etc/nginx/conf.d/default.conf:12

@patranakamo
Copy link
Contributor Author

I pushed an update after you helped me fix the frontend port issue. I tested it on my Umbrel-on-Raspberry, and it can be installed normally, with the frontend running smoothly. It should work on your Umbrel too.

I just wanted to let you know that I appreciate your help in pushing some fixes. I didn't expect this level of assistance from anyone.

@nmfretz
Copy link
Contributor

nmfretz commented May 15, 2024

I just wanted to let you know that I appreciate your help in pushing some fixes. I didn't expect this level of assistance from anyone.

You're most welcome, glad to help!

I have tested and made a couple changes to make sure it runs for both arm64 and x86 users and to show users their default app password. We are pretty much ready to go.

Can you please let me know the following:

  1. Do you want your app version to still be listed as 1.0.0 (App Submission: Saifa (lnd Invoice manager) #1021 (comment)), or do you want to change it to 1.3.3 like in your Docker images?

  2. Just to confirm: are you binding the backend port (9988:80) on the host so that you can make requests to the backend from outside the app (e.g., via REST API)? If so, then we leave this as-is. If not and only the frontend should talk to the backend then we can remove this port binding. App Submission: Saifa (lnd Invoice manager) #1021 (comment)

  3. Are you okay with me changing the app name from Saifa - Invoice lightning network manager to just Saifa so that it shows up nicely on the homescreen when someone installs it? I moved Invoice lightning network manager to the tagline.

  4. For your 3 gallery images, what would you like the text to say on each image?

@patranakamo
Copy link
Contributor Author

HI again @nmfretz

Let me answer your questions:

1 ) Let's keep the app version as 1.0.0, even if it's not the same as the Docker images. The Docker images include the front-end as well, so sometimes they need different versions.

2 ) Yes, I still need to keep that port open. It has a feature for an external API that can call this backend directly (with a token) to create or get invoices without opening the front-end UI.

3 ) Sure, that sounds good.

4 ) For the gallery images, please use the following text:
First picture: "Add New Invoice Page."
Second picture: "Invoice List - Users can see all invoices, both active and inactive, on this page."
Third picture: "Webhook Routing Config Page - Shows how users can configure to receive real-time invoice data sent to other apps."
Last picture: "Token Config Page - Shows how users can call the Saifa API without logging in through the UI."

@nmfretz
Copy link
Contributor

nmfretz commented May 16, 2024

Thanks @patranakamo. We'll get the gallery assets ready and then launch on the app store!

@nmfretz
Copy link
Contributor

nmfretz commented May 28, 2024

@patranakamo the gallery assets are ready: https://github.com/getumbrel/umbrel-apps-gallery/tree/master/saifa

Going live to the app store now. Congratulations! And thanks again for all your hard work bringing Saifa to Umbrel.

image

@nmfretz nmfretz merged commit df0419f into getumbrel:master May 28, 2024
@patranakamo
Copy link
Contributor Author

Wow, the app looks great on the App Store!
Thank you for your help and suggestions.
I will try to continue contribute to this community.

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.

None yet

2 participants