astral icon indicating copy to clipboard operation
astral copied to clipboard

Add astral to the Umbrel App Store

Open nevets963 opened this issue 2 years ago • 21 comments

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.

nevets963 avatar Jan 04 '23 23:01 nevets963

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.

monlovesmango avatar Jan 06 '23 17:01 monlovesmango

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.

nevets963 avatar Jan 06 '23 17:01 nevets963

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!

monlovesmango avatar Jan 06 '23 17:01 monlovesmango

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.

SuperPhatArrow avatar Jan 06 '23 18:01 SuperPhatArrow

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

monlovesmango avatar Jan 06 '23 18:01 monlovesmango

Excellent point

SuperPhatArrow avatar Jan 06 '23 18:01 SuperPhatArrow

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

Asone avatar Jan 09 '23 20:01 Asone

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

monlovesmango avatar Jan 09 '23 21:01 monlovesmango

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

Asone avatar Jan 09 '23 21:01 Asone

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?

monlovesmango avatar Jan 09 '23 21:01 monlovesmango

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

Asone avatar Jan 09 '23 21:01 Asone

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

monlovesmango avatar Jan 09 '23 21:01 monlovesmango

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

monlovesmango avatar Jan 09 '23 21:01 monlovesmango

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

Asone avatar Jan 09 '23 22:01 Asone

take your time

monlovesmango avatar Jan 09 '23 22:01 monlovesmango

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.

Asone avatar Jan 10 '23 10:01 Asone

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

monlovesmango avatar Jan 10 '23 17:01 monlovesmango

@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.

Asone avatar Jan 16 '23 21:01 Asone

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

monlovesmango avatar Jan 20 '23 18:01 monlovesmango

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 🚀

nevets963 avatar Jan 20 '23 19:01 nevets963

yes, absolutely

monlovesmango avatar Jan 21 '23 03:01 monlovesmango