unitaryfund/unitary.fund

discord encrypted redirect

Opened this issue · 0 comments

Description

Currently we direct people to our discord via http://discord.unitary.fund. Technically, this is set up on NameCheap via a redirect (http://discord.unitary.fund to $DISCORD_INVITE_LINK). This works great, but does not work on the encrypted version of this URL https://discord.unitary.fund.

Motivation

This is one of the main ways in which people interact with Unitary Fund, and encryption is a modern web standard. Further, some people may have automatic http -> https forwarding turned on which will render our redirect broken.

Current set up

The following redirects are currently set up through NameCheap (all of which lack HTTPS support).
Screenshot 2023-03-07 at 12 11 30 PM

Solution

As discussed with @WrathfulSpatula on Discord, we think the simplest course of action is to create a tiny Node app to handle the redirect. This should be achieved in just a few lines of non-boilerplate code. We discussed this redirect being hosted on the metriq server, which seems to be the simplest course of action. This has the potential downside of breaking the redirect during metriq maintenance periods, but these are rather limited. Alternatively we could spin up another box to host the redirect.

Why is this so complicated?

In order to handle https redirects, a server needs to be authorized to serve content from your domain. This is handled by using an SSL certificate, which NameCheap does not issue on our behalf since our website is not being hosted on NameCheap (we are using GitHub pages, and hence GitHub is issuing our SSL cert). One might think to use GitHub pages to do the redirect (by hosting a basic website at discord.unitary.fund), but GitHub pages is purely intended to serve static pages, with no server side activity. Hence setting up an HTTP 301 is not possible.


@WrathfulSpatula do you agree with my understanding of this issue? Please correct me if anything is wrong here!