The return of the tilde
As some of you may have noticed my web page is now under /~mc instead
of just /mc. This is a return to olden times.
The Apache web server, and probably many other web servers, had a
simple way of adding personal web pages for local users. This meant
that an URL ending with ~mc led directly to a subdirectory of user
mc's home directory. Whatever they put in that directory was
immediately available on the Intertubes! Neat, huh?
We need to bring this back to the modern net! Many tilde pubnixes has already done so, of course, and hack.org might sort of qualify as a member tilde, although I am, I guess, the BDFL.
See for instance:
In some places, like my alma mater, the Lysator computer club at Linköping University, tilde web pages lead to complicated setups with NFS automounting because, of course, the computer running the web server is not necessarily the computer which knows anything about the user's home directory.
In my case this is, instead, done with rsync. We have SSH access to
a shellbox. On the shellbox we can create a public_www directory in
our home directory, then make it readable by a special user/group and,
voila!, a web page turns up at:
The special sync user rsyncs the contents of public_www to the web
server automatically every 15 minutes. This has been roughly the same
for many years, but now it's more isolated on the web server, and with
that change came the re-introduction of the "~".
Similarly, if we create public_gem in our home directories, a Gemini
capsule on:
gemini://gem.hack.org/who/mc/
appears.
I recently moved the web server from a jail under FreeBSD to a seperate VPS. I also changed the server software from nginx to Caddy. The magic for doing tilde web pages in Caddy looks like this:
@user_home path_regexp user ^/~([^/]+)(/.*)?$
handle @user_home {
redir /~{re.user.1} /~{re.user.1}/ permanent
root * /home/www/hackusers/{re.user.1}
rewrite * {re.user.2}
file_server {
hide .[A-Za-z]*
}
}
I also added redirection for some users who had a lot of stuff already published, for instance, as you can guess, my own:
redir /mc https://hack.org/~mc/ permanent redir /mc/ https://hack.org/~mc/ permanent
I'm aware this made for an extra surprise for my blog readers, since all the previous blog posts also suddenly changed their URL. Some blog readers interpreted this as that all the posts were new posts. Sorry about that!
As an extra bonus, Caddy automagically took care of Let's Encrypt certs for all the domains, including https://spunk.org/ which for the first time ever is now reachable with HTTPS. Thanks, Caddy! Now go visit the Spunk Library over TLS for all your encrypted Anarchist needs!
Written by MC on Boomtime, the 44 day of Discord in the YOLD 3191 ().