Toggle menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

Subdomains and Custom Domains: Difference between revisions

From Nest Guides
Bddylol (talk | contribs)
Edit custom domains section to include steps
Samuel (talk | contribs)
m fix wording of subdomains guide
 
(8 intermediate revisions by 4 users not shown)
Line 1: Line 1:
While a subdomain of https://hackclub.app is automatically configured for you when you sign up for Nest, you'll need to use the [[Nest CLI]] to configure new subdomains under your user subdomain (https://<username>.hackclub.app).
Whilst a subdomain of https://hackclub.app is automatically configured for you when you sign up for Nest, you'll need to use the [[Nest CLI]] to configure new subdomains under your user subdomain (<code>https://<username>.hackclub.app</code>).


== Subdomains ==
== Subdomains ==
To configure any subdomains of your user subdomain of hackclub.app, you can simply run the following command:
To configure any subdomains of your user subdomain of hackclub.app, you can simply run the following command where <code>name</code> is the name of the subdomain you want to add. For example, if your username is <code>orpheus</code>, and you'd like to configure <code>drawing.orpheus.hackclub.app</code>, then you would run <code>nest caddy add drawing.orpheus.hackclub.app</code>.  
nest subdomain add <name>
nest caddy add <name>.<username>.hackclub.app
where <code>name</code> is the name of the subdomain you want to add. If your username is <code>orpheus</code>, and you'd like to configure <code>drawing.orpheus.hackclub.app</code>, then you would run <code>nest subdomain add drawing</code>. The Nest CLI will automatically configure it in the system and add a block to your Caddyfile to get you started. See [[Caddy]] for more information about the Caddyfile.
The Nest CLI will automatically configure the subdomain in the system, but you'll need to add a block to your Caddyfile to get you started. It will give you a connection string that starts with <code>unix/</code>. Take that UNIX socket and add it to your Caddyfile like this:
http://<name>.<username>.hackclub.app {
    bind <socket>|777
    # Add other directives here.
}
See [[Caddy]] for more information about the Caddyfile.


If you'd like to remove a subdomain from the configuration, you can also run
Note: If you have something that is listening on a port, you can specify the --proxy flag to redirect traffic there instead.
  nest subdomain remove <name>
nest caddy add <name>.<username>.hackclub.app --proxy localhost:12345
If you'd like to remove a subdomain from the configuration, you can run the following command which will remove it from your account.
  nest caddy rm <name>.<username>.hackclub.app


== Custom Domains ==
== Custom Domains ==
Custom domains are a feature where you can visually personalize your nest. For example, instead of accessing your nest at <nowiki>https://coolguy24.hackclub.app</nowiki> you can access it at <nowiki>https://coolguy24.net</nowiki>! (only if you own that domain)
As well as having your <code>https://<username>.hackclub.app</code> subdomain, you can link a custom domain to your user account.


Follow the easy steps listed below:
To configure a domain for your user account, add a CNAME record to your domain pointing to <code><username>.hackclub.app</code>. For example, if your username was <code>orpheus</code>, you'd set your CNAME to <code>orpheus.hackclub.app</code>. If you're using Cloudflare or similar providers that reverse-proxies requests, make sure to disable proxying (on Cloudflare, this is the orange cloud).


# Login to your DNS provider, select DNS records
If you're using a root domain and you can't add a CNAME, you can also add an ALIAS record (or manually add the A and AAAA records if you're feeling spicy). Set your ALIAS record to <code>hackclub.app</code>, or set your A record to <code>37.27.51.34</code> and AAAA record to <code>2a01:4f9:3081:399c::4</code>. You'll also need to add a TXT record on that domain with the contents <code>domain-verification=<YOUR_NEST_USERNAME></code> if you're using the ALIAS/A/AAAA record approach.
# Add the DNS record with the CNAME to be <code><username>.hackclub.app</code>. In my case, I'm using Cloudflare so i would put the name to <code>@</code> and the value to <code>bddylol.hackclub.app</code>)
 
# If you are using Cloudflare, make sure to uncheck "Proxy status" (orange cloud) so they don't reverse-proxy it.
Once you've followed either of those and the DNS has propagated, you can link the domain to your user account by running the following command. For example, <code>orpheus</code> may run <code>nest caddy add orpheus.com</code>.
# Head over to your nest terminal, then type the following command:<syntaxhighlight lang="bash">
nest caddy add <domain>
nest domain add <domain>
 
</syntaxhighlight>where  <code>domain</code> is your custom domain. Like subdomains, the Nest CLI will automatically configure it in the system and add a block to your Caddyfile to get you started. See [[Caddy]] for more information about the Caddyfile.
Once you've ran this command and it succeeded, congrats! You've now successfully linked your domain to your user account! The Nest CLI, just like with subdomains, has configured your domain. Like above, you'll need to modify the Caddyfile yourself. See the [[Caddy]] page for more information about the Caddyfile.
If you'd like to remove a domain from the configuration, you can also run
 
  nest domain remove <name>
If you'd ever like to remove a domain from your user account, you can run the following command which will remove it from your account
  nest caddy rm <domain>

Latest revision as of 04:00, 13 November 2024

Whilst a subdomain of https://hackclub.app is automatically configured for you when you sign up for Nest, you'll need to use the Nest CLI to configure new subdomains under your user subdomain (https://<username>.hackclub.app).

Subdomains

To configure any subdomains of your user subdomain of hackclub.app, you can simply run the following command where name is the name of the subdomain you want to add. For example, if your username is orpheus, and you'd like to configure drawing.orpheus.hackclub.app, then you would run nest caddy add drawing.orpheus.hackclub.app.

nest caddy add <name>.<username>.hackclub.app

The Nest CLI will automatically configure the subdomain in the system, but you'll need to add a block to your Caddyfile to get you started. It will give you a connection string that starts with unix/. Take that UNIX socket and add it to your Caddyfile like this:

http://<name>.<username>.hackclub.app {
    bind <socket>|777
    # Add other directives here.
}

See Caddy for more information about the Caddyfile.

Note: If you have something that is listening on a port, you can specify the --proxy flag to redirect traffic there instead.

nest caddy add <name>.<username>.hackclub.app --proxy localhost:12345

If you'd like to remove a subdomain from the configuration, you can run the following command which will remove it from your account.

nest caddy rm <name>.<username>.hackclub.app

Custom Domains

As well as having your https://<username>.hackclub.app subdomain, you can link a custom domain to your user account.

To configure a domain for your user account, add a CNAME record to your domain pointing to <username>.hackclub.app. For example, if your username was orpheus, you'd set your CNAME to orpheus.hackclub.app. If you're using Cloudflare or similar providers that reverse-proxies requests, make sure to disable proxying (on Cloudflare, this is the orange cloud).

If you're using a root domain and you can't add a CNAME, you can also add an ALIAS record (or manually add the A and AAAA records if you're feeling spicy). Set your ALIAS record to hackclub.app, or set your A record to 37.27.51.34 and AAAA record to 2a01:4f9:3081:399c::4. You'll also need to add a TXT record on that domain with the contents domain-verification=<YOUR_NEST_USERNAME> if you're using the ALIAS/A/AAAA record approach.

Once you've followed either of those and the DNS has propagated, you can link the domain to your user account by running the following command. For example, orpheus may run nest caddy add orpheus.com.

nest caddy add <domain>

Once you've ran this command and it succeeded, congrats! You've now successfully linked your domain to your user account! The Nest CLI, just like with subdomains, has configured your domain. Like above, you'll need to modify the Caddyfile yourself. See the Caddy page for more information about the Caddyfile.

If you'd ever like to remove a domain from your user account, you can run the following command which will remove it from your account

nest caddy rm <domain>