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

Add astral to the Umbrel App Store #86

Open
nevets963 opened this issue Jan 4, 2023 · 21 comments
Open

Add astral to the Umbrel App Store #86

nevets963 opened this issue Jan 4, 2023 · 21 comments

Comments

@nevets963
Copy link

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
Copy link
Owner

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
Copy link
Author

nevets963 commented Jan 6, 2023

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
Copy link
Owner

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
Copy link

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
Copy link
Owner

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

@SuperPhatArrow
Copy link

Excellent point

@Asone
Copy link

Asone commented Jan 9, 2023

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
Copy link
Owner

monlovesmango commented Jan 9, 2023

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
Copy link

Asone commented Jan 9, 2023

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
Copy link
Owner

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
Copy link

Asone commented Jan 9, 2023

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

@monlovesmango
Copy link
Owner

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

@monlovesmango
Copy link
Owner

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
Copy link

Asone commented Jan 9, 2023

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
Copy link
Owner

take your time

@Asone
Copy link

Asone commented Jan 10, 2023

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
Copy link
Owner

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

@Asone
Copy link

Asone commented Jan 16, 2023

@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
Copy link
Owner

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

@nevets963
Copy link
Author

nevets963 commented Jan 20, 2023

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
Copy link
Owner

yes, absolutely

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

No branches or pull requests

4 participants