---------------------------------------- | |
gopher.black on tor, part 2 | |
April 28th, 2018 | |
---------------------------------------- | |
This gopher site is finally available as a tor hidden service with | |
the production onion address: blackgviz2y4nhrd.onion [0] | |
[0] gopher.black (tor) | |
In my last post [1] I mentioned three problems I had left: | |
[1] gopher.black on tor, part 1 | |
1) Ugly onion addresses | |
2) Internal links kick you out of tor | |
3) Port 71 | |
Here's how that got resolved. | |
I used Eschalot to generate my onion address. I let the app run | |
a full day trying to get something that started with gopherblack, | |
but the pattern was too long to find a match. I figure "black" is | |
good enough for folks to remember. I had about | |
15 different ones starting with black, but this had the best | |
looking pattern. | |
I ended up installing Gophernicus as a second gopher server next | |
to motsognir and configured it to serve up my same content. This | |
install was a tiny bit tricky since I already have a service | |
listenining on port 70. I also wanted Gophernicus to use my tor | |
address, not my actual hostname. Finally, I wanted it to run on | |
port 71, but act like links were still port 70. Doing all this | |
involved changing 3 files in the repo before I ran make install: | |
gophernicus.env | |
Uncomment options and give it the onion host and whatever else | |
is necessary to your liking: | |
OPTIONS="-h blackgviz2y4nhrd.onion -nf -nt" | |
gophernicus.socket | |
Change port to listen on to 71 or 1138 or whatever you'll be | |
using with the tor proxy. | |
[email protected] | |
There's a line in there that looks like this: | |
ExecStart=/usr/sbin/in.gophernicus -h %H $OPTIONS | |
Remove the -h %H bit. We set that in options. | |
Now you can 'sudo make install' and it should "Just Work". | |
Remember to update your torrc to use port 70 and proxy to 71. This | |
will give you your content back on port 70 over tor and all will | |
be good in the world. | |
The last hurdle to fix were the internal links. My sexy burrow | |
helper wants to be a good partner, so it generates gophermaps with | |
full \tHOST\tPORT\r\n line endings. That's overkill for motsognir | |
and gophernicus, and doesn't allow them the flexibility to add | |
those bits itself. | |
On Motsognir I can exclude the full line ending as long as | |
I prefix the line with type "i" and it will work. | |
On Gophernicus I can get rid of any type at the start of the line | |
and it will work. | |
To make both happy I need to include the type "i" at the start of | |
the line and add a single tab character at the end. Not two tabs | |
or three, just exactly one with nothing after it. This makes both | |
servers happy and lets them fill in the gaps. | |
I'll need to add a switch to burrow to generate this style in the | |
future, but in the meantime I can manually clean it up as I add | |
posts. | |
find . -name "gophermap" -exec sed -i 's/\tgopher.black.*//g' {} \; |