telescope-browser / telescope

browser for the small internet
https://telescope-browser.org
ISC License
43 stars 1 forks source link

How does one get libretls or libtls on Ubuntu #2

Closed stacksmith closed 2 years ago

stacksmith commented 2 years ago

I can't find it, even with Google!

I have openssl-1.1.1 and was concerned about LibreSSL stepping on it.

Any help is appreciated, and I can't wait to give telescope a try.

omar-polo commented 2 years ago

Hi :)

Unfortunately, neither libressl nor libtls are packaged on Debian-derived distributions AFAIK. (I know for sure Fedora, arch, void, alpine, gentoo have it packaged.)

Telescope needs openssl and a library called "libtls", which is provided by either LibreSSL or LibTLS (it's easy to get confused with these similar names.)

If libtls or libretls are not available for you distro, you have tree options I think:

Cheers!

stacksmith commented 2 years ago

Thank you. Installed the binary (which btw crashed when I followed the link to 'project gemini')

Occasionally I come across a missing library, but usually 5 minutes of poking around is enough to figure out the Ubuntu name or find a debian package... This really one stumped me, largely because I know very little about these libraries and have OpenSSL pre-installed by default (is it safe to install LibreSSL side-by-side?) And there are all these different versions for SSL, TLS, etc... Not to mention the 'portable' library...

omar-polo commented 2 years ago

Yeah, it gets confusing, I know. The TL;DR is

From what I can see at repology there's seems to be a "libretls" package on Debian 12, Testing and Unstable. Can you use those packages? both "libretls" and "libretls-dev" are needed.

Otherwise, you can manually install libtls from here using checkinstall, as per Gnuserland post.

omar-polo commented 2 years ago

In particular, I was looking at libtls20 and libtls-dev mentioned here https://packages.debian.org/bookworm/source/libretls

stacksmith commented 2 years ago

OK, I will try to do this.

stacksmith commented 2 years ago

Does libtls require LibreSSL? Or does it work with OpenSSL (which I already have)? Oh, it looks like libretls is libtls of OpenSSL, while libtls is libtls for LibreSSL. Who's on first? Gah.

omar-polo commented 2 years ago

Telescope needs either OpenSSL+libtls or LibreTLS. On linux systems, where you have already OpenSSL installed, I think it's better to simply install libtls. I'll try to update the README to make it more clear! :)

stacksmith commented 2 years ago

Hah. Now I am really confusled: the above link to a debian page titled libretls contains two .deb files: libtls-dev and libtls20...

So do these comprise LibreTLS, or is that somehow yet another library? Or is libretls different from LibreTLS?

Perhaps my brain is totally blown from Covid, but I find this staggeringly confusing and kind of nuts, really.

stacksmith commented 2 years ago

Anyway, I dpkg'ed the two .debs, and (after resolving libevent dependency) compiled telescope.

Thanks for walking me through this, and after poking around BearSSL (After an hour still can't figure out the Error 62 certificate issues) I can see that anything simpler is a good thing...

If you ever put together a guide for Ubuntu users, this way definitely works. You may want to list the required packages (my system only needed libevent, but I've been coding on it for years...)

stacksmith commented 2 years ago

https://blogs.gentoo.org/mgorny/2020/12/29/openssl-libressl-libretls-and-all-the-terminological-irony/

omar-polo commented 2 years ago

Yep, the page you linked is a clear explanation. It's unfortunate that there are all these similar names, and one can get confused really easily. I'm sorry for that, but it's not something I improve ^^"

regarding the 62 errors, unfortunately telescope still doesn't support client certificates. It's something that I plan to add, but it's still a young project and I haven't had enough time to implement everything yet.

(I'm currently working on the cache subsystem, it's taking time thought eheh. see #1)

Regarding the debian package naming: libtls20 is only the library, while libtls-dev has some source files (the C headers specifically) that are needed to compile. It's a mistery to me why debian called the package libtls20 and not libtls, I haven't got a clue about that, sorry.

I'm thinking of adding a wiki page with all these information. If you have some tips or want to give it a shot I'll be grateful! ;)

Thanks!

stacksmith commented 2 years ago

Hey, no need to apologize - it is not your fault!

If you add a wiki I will be happy to write a 'building on Ubuntu' page.

omar-polo commented 2 years ago

I have to confess I'm not too sure how github wikis work, but I've created one. Now it's too late here, but tomorrow I'll invest some time to improve it :)

Edit: oh, I almost forgot, thanks!

stacksmith commented 2 years ago

https://docs.github.com/en/communities/documenting-your-project-with-wikis/adding-or-editing-wiki-pages#adding-wiki-pages

You can add me as a collaborator; I am not sure how it works these days in terms of limiting access to the wiki (and I promise not to mess with your repo if access granularity is coarse - I am a legit long-time user). If you start an organization you have finer control, but the repo URL will have to change when you transfer the repo...

https://docs.github.com/en/account-and-profile/setting-up-and-managing-your-github-user-account/managing-access-to-your-personal-repositories/inviting-collaborators-to-a-personal-repository

omar-polo commented 2 years ago

I've opened up the wiki: everyone with an account can edit and create pages now. Changes are still stored as commits, so it's easy to revert accidental commit, and it's easy to revert the setting if the feature get mis-used (something I don't expect will happen)

Thanks for volunteering to write the page! :)

Cheers!

stacksmith commented 2 years ago

I will give it a whack tomorrow.

omar-polo commented 2 years ago

Sorry for the delay. I've just read the page, thanks! I did a small edit in the first paragraph to mention that libtls is available on Sid so it'll come to ubuntu soon. This way, I hope users will first issue an apt search/install in case it's become available before downloading the packages from debian.

I believe this issue can be closed now, but if you have further problems feel free to re-open.

P.S. I'm hoping everything is going smoothly with your common-lisp gemini project ;)

stacksmith commented 2 years ago

Omar, no problem - I am not territorial - feel free to change as needed! I tried to keep it short... Thanks again.

P.S. Working on a state machine parser/styler for gmi... All good.

OT: where does the sigil icon for each site come from?

omar-polo commented 2 years ago

I don't know what do you mean with "the sigil icon", sorry. If you're talking about lagrange, it chose randomly a icon per site and uses that in the tab bar. I could add something similar for telescope too...

stacksmith commented 2 years ago

Yes, thank you... I thought maybe the server sends some unicode icon that I somehow missed. I suppose it helps visually identify the site you are at... I don't know if it makes sense in a terminal, but maybe yes

omar-polo commented 2 years ago

For a time there was the idea of having a file favicon.txt with a single unicode character followed by a newline for clients to use. I don't think lagrange ever supported that, but other clients (amfora and tinmop comes to mind at least) supported it. There was a heated discussion at some point, but then all the parties acknowledged that it wasn't really a good idea and was removed, or at least disabled by default. If you search in the mailing list archive or in the amfora issue tracker you should find something.

stacksmith commented 2 years ago

I think a faded/incorrect memory of favicon.txt is why I thought there was some way of getting the character. I will go read the list again when I feel too stupid to code (in an hour or so?). I am curious to see why everyone thought it was not a good idea. Overall I feel it is fine to have a strict/minimal specification but implement non-standard non-breaking styling features - and see what sticks. After all, styling/formatting is up to the client, right?

For instance, there is little harm in highlighting text marked with a * or **, especially if the marks close over a word with no spaces... It's iffier with spaces, but probably ok if the marks close before a newline... As long as * is not the first character. Not too hard with a state-machine parser.

omar-polo commented 2 years ago

There was a lot of heat around that discussion at that time. The major downside IIRC was that it somewhat broke the promise of "one-page-one-request" and as a way of extending gemini. Personally, I was never a fan of the idea, but I don't see it as "evil" as other thought. I know for sure tinmop has a knob to enable the favicon (and thanks to that I found a bug in my server some time ago :D).

I agree that it's up to the client to decide the styling, and I love that aspect of gemini. (for example, the proposal/break-page branch has some code to turn lines like "----" into fancy line breaks that I was thinking of polishing and merging). I don't (but again, it's a personal opinion) miss the inline formatting. After some months of posting in the gemini space I grew liking it! These are all personal opinion thought, but just a tip: give it a try for some time before adding features ;)

Cheers!

stacksmith commented 2 years ago

give it a try for some time before adding features ;)

Words to live by!