View Single Post
Old 03-03-2025, 07:41 PM   #23
elinkser
Addict
elinkser has survived committing the World's Second Greatest Blunder.elinkser has survived committing the World's Second Greatest Blunder.elinkser has survived committing the World's Second Greatest Blunder.elinkser has survived committing the World's Second Greatest Blunder.elinkser has survived committing the World's Second Greatest Blunder.elinkser has survived committing the World's Second Greatest Blunder.elinkser has survived committing the World's Second Greatest Blunder.elinkser has survived committing the World's Second Greatest Blunder.elinkser has survived committing the World's Second Greatest Blunder.elinkser has survived committing the World's Second Greatest Blunder.elinkser has survived committing the World's Second Greatest Blunder.
 
Posts: 242
Karma: 146236
Join Date: Oct 2022
Device: Kobo Clara HD
***
***
***


What is Gemini

Excerpt from geminiprotocol.net:

Gemini is a group of technologies similar to the ones that lie behind your familiar web browser. Using Gemini, you can explore an online collection of written documents which can link to other written documents. The main difference is that Gemini approaches this task with a strong philosophy of "keep it simple" and "less is enough". This allows Gemini to simply sidestep, rather than try and probably fail to solve, many of the problems plaguing the modern web, which just seem to get worse and worse no matter how many browser add-ons or well meaning regulations get thrown at them.
https://github.com/kr1sp1n/awesome-gemini


Browsing Gemini sites on a Kobo
https://letsdecentralize.org/tutoria...-terminal.html



***

Install golang on desktop:

$ source $HOME/.profile

$ go version
go version go1.20.2 linux/amd64


***


BUILD FOR DESKTOP:


***

Gemini client

makew0rld/gemget
https://github.com/makew0rld/gemget

$ git clone https://github.com/makeworld-the-better-one/gemget/

$ cd gemget

$ go build
go: downloading github.com/makeworld-the-better-one/go-gemini v0.13.1
go: downloading github.com/makeworld-the-better-one/go-gemini-socks5 v1.0.0
go: downloading github.com/schollz/progressbar/v3 v3.6.0
go: downloading golang.org/x/net v0.23.0
go: downloading github.com/mattn/go-runewidth v0.0.9
go: downloading github.com/mitchellh/colorstring v0.0.0-20190213212951-d06e56a500db

$ file gemget
gemget: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, Go BuildID=KdfD8QCiOqTahbWYFmCw/nzjEvWPDxYUPmUsyo95D/lEbMAJTm9sFCcy-laW8M/z26aPzLP4AksrtbzntRm, with debug_info, not stripped

$ ./gemget gemini://gemini.circumlunar.space
Info: Started gemini://gemini.circumlunar.space
Info: Redirected to gemini://gemini.circumlunar.space/
Info: Saved gemini.circumlunar.space from URL gemini://gemini.circumlunar.space/

$ mv gemget gemgetX86-64


***

Gemini server

https://github.com/n0x1m/gmifs
n0x1m/gmifs

$ git clone https://github.com/n0x1m/gmifs

$ cd gmifs/

$ go build

$ file gmifs
gmifs: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, Go BuildID=VPWFLLuJ1ZVao5XlHOKq/e3mjj8BcLAYt4m2Nn9Sv/EarHGSxq5pBM0zexZUPa/ZmpThabbfP-5uWaFV0nY, with debug_info, not stripped

$ mkdir public

$ cp ../gemget/gemini.circumlunar.space public/index.gmi

$ ./gmifs -root ./public -autoindex
2025/03/03 15:42:09 generating a self-signed temporary certificate, valid for 1 days


In the gemget build terminal:

$ ./gemgetX86-64 localhost:1965
Info: Started gemini://localhost:1965
Info: Redirected to ./
Info: Saved localhost from URL gemini://localhost:1965/

$ cat localhost
# Circumlunar Gemini Outpost
## Project Gemini has moved!!!
This server, gemini.circumlunar.space, is no longer the official home of Project Gemini! The official protocol specification, FAQ and other documentation now lives at geminiprotocol.net:
=> gemini://geminiprotocol.net New official Project Gemini capsule


$ mv localhost my.gmi


Adding http link to view in gemini client, e.g.amfora:
makew0rld/amfora
https://github.com/makew0rld/amfora

$ nano my.gmi
Code:
# Circumlunar Gemini Outpost
## Project Gemini has moved!!!
This server, gemini.circumlunar.space, is no longer the official home of Project Gemini!  The offic$
=> gemini://geminiprotocol.net  New official Project Gemini capsule

=>  https://www.mobileread.com/forums/forumdisplay.php?f=247 Kobo Developer's Corner 
...

Configure a web to gemini proxy server for amfora gemini browser:

$ nano -l ~/.config/amfora/config.toml
Code:
...
 36 # http = 'default'
...
260 [proxies]
261 http = "stargate.gemi.dev:1994"
262 https = "stargate.gemi.dev:1994"
...
$ ../../amfora_1.9.2_linux_64-bit my.gmi

and select the Mobileread Forums link.


$ mv gmifs gmifsX86-64



***

Build your own gemini proxy server

LukeEmmet/duckling-proxy
https://github.com/LukeEmmet/duckling-proxy
Duckling Proxy Quick Setup Guide For Local Hosting
https://portal.mozz.us/gemini/tilde....ling-guide.gmi

$ git clone https://github.com/LukeEmmet/duckling-proxy

$ cd duckling-proxy/

$ go build
go: downloading github.com/LukeEmmet/html2gemini v0.0.0-20200831220433-65476d2a84ff
go: downloading github.com/makeworld-the-better-one/go-gemini v0.8.5
go: downloading github.com/ssor/bom v0.0.0-20170718123548-6386211fdfcf
go: downloading golang.org/x/net v0.0.0-20200822124328-c89045814202

$ file duckling-proxy
duckling-proxy: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, Go BuildID=js-G_Va3VjGRQjzHxY7_/y2o64ocQTOIVS6Nt81dj/V7dsvBz9qxx1_axNf-CG/NtQcAqX0YM8Df_7oHIUT, with debug_info, not stripped




$ openssl req -x509 -newkey rsa:4096 -keyout my.serv.key -out my.serv.cert.pem -days 3650 -nodes -subj "/CN=my.serv" -addext "subjectAltName=DNS:localhost,IP:127.0.0.1"
Generating a RSA private key
writing new private key to 'my.serv.key'

* Edit your /etc/ssl/openssl.cnf on the logstash host - add subjectAltName = IP:192.168.136.191 in [v3_ca] section.
Recreate the certificate
Copy the cert and key to both hosts
PS Consider adding -days 365 or more to the certificate creation commandline as the default certificate validity is just 30 days and you probably do not want to recreate it every month..


$ ./duckling-proxy -n -p 1966-r -c my.serv.cert.pem -k my.serv.key
Info: Starting Duckling Proxy v0.2.1 on 127.0.0.1 port: 1966


Reconfigure web to gemini proxy server for amfora gemini browser:

$ nano -l ~/.config/amfora/config.toml
Code:
...
 36 # http = 'default'
...
260 [proxies]
261 http = "127.0.0.1:1966"
262 https = "127.0.0.1:1966"
...

$ ../gmifs/gmifsX86-64 -root ./public -autoindex -cert ../gmifs/my.serv.cert.pem -key ../gmifs/my.serv.key &
[1] 28076


$ ./duckling-proxy -n -p 1966 -r -c my.serv.cert.pem -k my.serv.key
Info: Starting Duckling Proxy v0.2.1 on 127.0.0.1 port: 1966


$ ../../amfora_1.9.2_linux_64-bit gemini://gemi.dev/stargate.gmi


and select the [1] Bear's discovery feed link.

$ mv duckling-proxy duckling-proxyX86-64


***

BUILD FOR KOBO:

$ source ~/koxtoolchain/refs/x-compile.sh kobo env bare
( Prepare build as in https://www.mobileread.com/forums/sh...d.php?t=350054 Post #4, or you could try Linaro build as in Post #1.)

$ env GOOS=linux GOARCH=arm CC=arm-kobo-linux-gnueabihf-gcc CXX=arm-kobo-linux-gnueabihf-g++ go build

$ file gemget
gemget: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), statically linked, Go BuildID=0psHJvjMHx6Hl8n2e2L_/uDznriJ6IOpa_DXY6xys/tgJcsUVLB2BfvUfNvn6B/OVbXT7Jwm3CWRE9A7OI0, with debug_info, not stripped


$ cd ../gmifs/

$ env GOOS=linux GOARCH=arm CC=arm-kobo-linux-gnueabihf-gcc CXX=arm-kobo-linux-gnueabihf-g++ go build

$ file gmifs
gmifs: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), statically linked, Go BuildID=kwQnsO6TxtxlxhWrxq6W/3V_D_P_3lICAxYzSc6Bw/E2SpfMDjxoUquuwaztbE/A1hIJ2812LNE85T0cpJb, with debug_info, not stripped


$ cd ../duckling-proxy/

$ env GOOS=linux GOARCH=arm CC=arm-kobo-linux-gnueabihf-gcc CXX=arm-kobo-linux-gnueabihf-g++ go build

$ file duckling-proxy
duckling-proxy: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), statically linked, Go BuildID=UxOmM_a7ZQHnYAm7sGOd/RcyamGD1TQTbc8kNxgbL/8gqBb9dpPQsVx9jvsJtA/2bmKLQ1uqq-W0p4NtECH, with debug_info, not stripped


***

Notes: Open the firewall for gemini server:
(if needed)


$ ifconfig
wlan0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.136.191 netmask 255.255.255.0 broadcast 192.168.136.255


$ sudo ufw allow proto tcp from 192.168.136.191 to any port 1965
Rule added

$ sudo ufw allow proto tcp from 192.168.136.191 to any port 1966
Rule added

$ sudo ufw reload

$ sudo ufw status numbered
Status: active


$ netstat -tulpn | grep 196
tcp 0 0 127.0.0.1:1966 0.0.0.0:* LISTEN 27646/./duckling-pr
tcp6 0 0 :::1965 :::* LISTEN 27585/../gmifs/gmif


$ netstat -ano -p tcp | grep 196
tcp 0 0 127.0.0.1:1966 0.0.0.0:* LISTEN 27646/./duckling-pr off (0.00/0/0)
tcp6 0 0 :::1965 :::* LISTEN 27585/../gmifs/gmif off (0.00/0/0)
unix 3 [ ] STREAM CONNECTED 32196 - @/tmp/.X11-unix/X0
unix 3 [ ] STREAM CONNECTED 20196 -


***
***
***


You can try the http to gemini proxy on the Kobo with the Alpine Linux armv7 version of the amfora gemini client.
(As shown in https://www.mobileread.com/forums/sh...d.php?t=350054 Post #3, migrated to kordir folder as in Post #14.)


amfora
https://pkgs.alpinelinux.org/package...y/armv7/amfora

terminal browser for the Gemini protocol

Depends (1)
so:libc.musl-armv7.so.1 *
*already got it from elinks install.

$ wget https://dl-cdn.alpinelinux.org/alpin...-1.9.2-r13.apk

$ tar zxvf amfora-1.9.2-r13.apk

$ mv usr/bin/amfora bin/

$ mv usr/share/amfora/default-config.toml libs/



Copy bin/amfora from the PC to /mnt/onboard/.adds/kordir/scripts/ folder on the Kobo.


Copy libs/default-config.toml from the PC to /mnt/onboard/.adds/kordir/.config/amfora/config.toml on the Kobo.

Ensure the same proxy as above, e.g.:
$ nano -l ~/.config/amfora/config.toml
Code:
...
 36 # http = 'default'
...
260 [proxies]
261 http = "stargate.gemi.dev:1994"
262 https = "stargate.gemi.dev:1994"
...

From KOReader terminal:

# . /korenv.sh

# amfora gemini://gemi.dev/stargate.gmi


and select the [1] Bear's discovery feed link.


***


Gemini client plugin for koreader
https://repo.or.cz/gemini.koplugin.git

https://github.com/search?q=koplugin&type=repositories

$ git clone https://repo.or.cz/gemini.koplugin.git
Cloning into 'gemini.koplugin'...
remote: Counting objects: 329, done.
remote: Total 329 (delta 0), reused 0 (delta 0)
Receiving objects: 100% (329/329), 153.30 KiB | 570.00 KiB/s, done.
Resolving deltas: 100% (216/216), done.

$ zip -r gemini.koplugin.zip gemini.koplugin/

# Installing / updating

Update KOReader if necessary -- versions 2023.03 and later should be supported.

Extract to the plugins/ directory within your koreader directory (e.g. /.adds/koreader/plugins/), such that plugins/gemini.koplugin/ contains the *.lua files.

Restart KOReader, and select "Browse Gemini" from the search menu to get started.



***
***
***


NEW GEMINI PROTOCOL FORUM FOR DISCUSSING EREADERS

https://portal.mozz.us/gemini/bbs.ge....org/s/ereader






***
***
***


IMPORTANT:
To use the Gemini protocol privately as intended, understand that client certificates must be managed properly, or they can act like an identifying cookie.

https://portal.mozz.us/gemini/bbs.ge...skGemini/30325



***
***
***

Last edited by elinkser; 07-18-2025 at 12:32 PM. Reason: public/ not .public, formatting, gemini ereader forum,NOTICE
elinkser is offline   Reply With Quote