monlovesmango / astral

Nostr client made with Quasar
https://astral.ninja
MIT License
100 stars 38 forks source link

Add astral to the Umbrel App Store #86

Open nevets963 opened 1 year ago

nevets963 commented 1 year ago

Would there be appetite to add astral to the Umbrel App Store (https://github.com/getumbrel/umbrel-apps)?

It looks like there is already a Dockerfile to build an image, but we would need a multi-arch build pushed to Docker hub (or another container registry). And then to have releases/tags for astral to generate new Docker images for bugfixes/new features.

I can help here with a GitHub workflow to automate this, but releases/tags would need to done and also updates pushed to the app store.

monlovesmango commented 1 year ago

I actually have thought about it and really like this idea. however I think I want to wait until astral is a bit more finalized before maintaining images.

I had a question around doing this that I haven't had time to look into. from my personal experience umbrel feels really slow and I believe this is bc everything runs over tor. do you know if there would be a way for astral to run over clearnet? I am not sure the performance would be great if astral had to run over tor. but maybe with performance improvements it will be more plausible.

nevets963 commented 1 year ago

That's totally understood.

The vast majority of people access their Umbrel server via the local network where their access speed is super quick. Tailscale on Umbrel has become quite popular for people to remotely access their Umbrel which is bound by the user's Internet rather than some of the limitations around Tor.

monlovesmango commented 1 year ago

interesting that sounds very promising then. I would love to do this. apparently mynode just added astral to their latest release too.

I think I will look into do this once I implement pow and it is stable. thanks for opening the issue!

SuperPhatArrow commented 1 year ago

Loading the website over tor might be tricky because the relays are not also on tor (AFAIK). However, loading the site from local network or tailscale would then allow the site to easily communicate with other relays.

Personally, I don't really see any benefit to this as it provides no additional security or privacy to self host the web app.

monlovesmango commented 1 year ago

maybe no security or privacy benefit. but it has censorship resistance benefit if astral.ninja gets taken down or censored. right?

SuperPhatArrow commented 1 year ago

Excellent point

Asone commented 1 year ago

Hey there, while deciding to give a try onto having a nostr relay on umbrel, a discussion lead me to see what it would be to have astral also as a client.

The app seems to work basically however i can't change the relays as i get an error :

could not publish updated list of followed keys and relays: TypeError: Cannot read properties of undefined (reading 'digest')

The console also complains about many CORS errors. Not much of a big deal as it was only to give a try about it, nothing really serious.

Feel free to re-use the code if needed, you'll find it here.

Sidenote: i had to publish an export of the docker image compatible for arm64. I hope you won't mind me for doing so.

Just in case you need it, below the image building command once in project root dir :

docker buildx build --platform linux/arm64 -t monlovesmango/astral:arm64 --no-cache --progress=plain .

Cheers

monlovesmango commented 1 year ago

wow awesome thank you!

for the cors errors, were these for fetching the nip05 ids? or for images?

also when you tried publishing, was private key entered or were you trying to use browser extension? if you are using nos2x browser extension umbrel.local:port pattern may need to be added to nos2x manifest.json

Asone commented 1 year ago

Regarding the publishing i could not publish anything, i got a similar error popping :

could not publish post: TypeError: Cannot read properties of undefined (reading 'digest')

I just used the default keys provided when launching the application for the first time. I provided no bio info nor nip-05 information.

Note that it happens even if i keep the whole original config.

Also note that as this is loaded in umbrel the access goes through an HTTP connection as umbrel does not provide SSL for clearnet access.

EDIT: The CORS error seems to be related to the calls made to

https://nostr.id/.well-known/nostr.json?name=rossbates

I'll check if i find more domains providing those errors

monlovesmango commented 1 year ago

his server isn't serving with cors headers. cors thing was put in the nip05 spec so not much more we can do.

the http thing might be the culprit: https://stackoverflow.com/questions/71475682/cannot-read-properties-of-undefined-reading-digest-angular-ipfs-build-on-h https://community.auth0.com/t/resolved-typeerror-digest-of-undefined-in-some-environments/28327

does mynode not run over http?

Asone commented 1 year ago

I couldn't say for mynode as i just have an umbrel node :/

monlovesmango commented 1 year ago

seems to need secure context (like localhost, ip, https) https://developer.mozilla.org/en-US/docs/Web/Security/Secure_Contexts

monlovesmango commented 1 year ago

you could try using nos2x to sign instead of the browser window. you would have to update the manifest.json to include the umbrel.local pattern and then package it yourself, but its really pretty straightforward if you follow readme. https://github.com/fiatjaf/nos2x

am curious to know if this works or not

Asone commented 1 year ago

you could try using nos2x to sign instead of the browser window. you would have to update the manifest.json to include the umbrel.local pattern and then package it yourself, but its really pretty straightforward if you follow readme. https://github.com/fiatjaf/nos2x

am curious to know if this works or not

I'll give it a try once i get a bit of free time. Matter of days

i'll keep you updated to feedback the result

monlovesmango commented 1 year ago

take your time

Asone commented 1 year ago

So, after building and loading the no2x extension adding http://umbrel.local:*/* in the matches sub-field of the web_accessible_resources from the manifest.json file, i removed all local astral data and reloaded the application.

I selected to use the extension and provide authorization to the key. I then get the below message :

Failed to get a public key from a Nostr extension: Error: nos2x: undefined

I couldn't find any information of the problem source in the console, unfortunately, not even a warning popping.

monlovesmango commented 1 year ago

thank you so much for checking! I will have to look into this further.

Asone commented 1 year ago

@monlovesmango : Would there be any option to keep the sourcemaps into the docker version of the app ? This could provide help to check where the errors come from by using chrome devtools to stop the debugger on exceptions.

monlovesmango commented 1 year ago

yes, just updated the dockerfile to allow sourcemaps. I only had disabled it when I was trying to resolve a docker build issue.

nevets963 commented 1 year ago

If I submitted a PR to add a GitHub workflow to automatically build both arm64 and amd64 Docker images - would this be accepted? We can trigger builds when a release/tag is created. Once those versioned Docker images exist, it's then easier to deploy Astral more widely, and also add to the Umbrel App Store 🚀

monlovesmango commented 1 year ago

yes, absolutely