- WebFinger

WebFinger is a protocol that allows you to find a user's profile by their email address. In other things, I'm feeling overwhelmed.

WebFinger

Today I learned about WebFinger and implemented it into my site.

$ curl https://kglitchy.com/.well-known/webfinger\?resource\=acct:katie@kglitchy.com
{
    "subject": "acct:katie@kglitchy.com",
    "aliases": [
    "mailto:katie@kglitchy.com",
    "acct:katie@chaosfem.tw"
    ],
    "links": [
    {
        "rel": "http://webfinger.net/rel/profile-page",
        "type": "text/html",
        "href": "https://bsky.app/profile/kglitchy.com"
    }
    ]
}

The cool thing about WebFinger is that it's the same protocol used by Mastodon (unfortunately not Bluesky). This means that I can use webfinger.net to find my profile.

I'm not sure exactly what I'll link in this or what I'll do with it but I'm weird lol.

Implementing WebFinger in Apache2

In Apache2, I made sure that in my sites-available/kglitchy.com.conf file, I had a AllowOverride All directive so that I could use an .htaccess file to override the configuration. This allowed me to make the .well-known/webfinger redirect work. In the .well-known/.htaccess file, I added the following:

# Re-write rules
RewriteEngine On

# Handle https:// URI resources (encoded or unencoded)
RewriteCond %{REQUEST_URI}  /\.well-known/webfinger$
RewriteCond %{QUERY_STRING} resource=https%3A%2F%2F([^&]+) [NC,OR]
RewriteCond %{QUERY_STRING} resource=https://([^&]+)
RewriteRule ^(.*)$ /wf/%1.json [L]

# Handle other resources (acct:, etc.)
RewriteCond %{REQUEST_URI}  /\.well-known/webfinger$
RewriteCond %{QUERY_STRING} resource=([^&]+)
RewriteRule ^(.*)$ /wf/%1.json [L]

RewriteRule ^/.well-known/webfinger$ - [L,R=400]

This allows me to put a /wf/ directory in the root of my site with the .json files for each resource available.

I also stuck a .htaccess file in the /wf/ directory that allows symlinks to be used so that I can have one .json file for multiple aliases. For example, I can have a https://kglitchy.com alias that points to acct:katie@kglitchy.com.


A Day

Today is quite a day. I am getting a lot done at work but am struggling to be productive at home. I have so much stuff to do but I can't seem to get started. I have ADHD so it's really easy to get distracted and I end up doing things that are not on my list. I have so many projects going on between my old house and my new one (trying to sell the old one). It needs a lot of work unfortunately because of a burst pipe... I'm working on trying to get quotes from different contractors to get the work done but I'm definitely on the struggle bus here with all of this.

I wish I could just hire a project manager or something to help me get everything done but I definitely can't afford that right now lol. Between the two mortgages and all the repairs and other expenses, I'm all out of cash.

Current Projects:

  • Repair the damage from the burst pipe at the old house
  • Fix the pool at the new house (it's buldging from ground water...)
  • Sell the old house
  • Install blinds in the new house
  • Put away all the boxes from the move

Unfortunately, I'm probably going to have to sell my car to cover the costs of the repairs.

I guess for now, I'll just keep focusing on the work stuff and the high priority house stuff and hope for the best. Outside of that, I'll just try to keep my sanity by writing, reading, and trying to relax where I can.