3sky's notes

Minimal blog about IT

Move to my own domain with OVH and Netlify

2020-11-15 5 min read 3sky

Welcome

Long time no see. Due to the last 2 months, I had some changes in my personal life. I’ve become a Solution Architect in a nice polish company. If you or your friends need some RedHat implementation here is the link. What will change here? I hope nothing. Still a lot of CI/CD topics, more Kubernetes(with OpenShift), maybe some serverless with Knative and quarkus. Ahh and some new tools. Linode as a cloud service and Pulumi as Terafrom’s replacement. Unfortunately, today I will be focusing on setting up my own domain on different hosting without Github Action.

Tools/services used in this episode

  • ovh.pl
  • netlify.com
  • gitlab.com
  • dig/curl/openssl

Buy own domain

Domains are cheap. Not all of them, but mine was - 14$. I’m based in Poland, so I decided to use OVH. Renewal prices are reasonable, a lot of people are happy with them, so it’s only 14$. The step-by-step guide looks like that:

  1. Go to their site

  2. Find a dream domain name

  3. Just click ’next’ a few times, but read the text on the screen

  4. Make sure that the provided data are correct

  5. And just buy a domain

  6. It’s an easy process, I was surprised how easy I can buy my first private domain

Netlify as free hosting

Netlify has four different pricing plans, but for small webpages, blogs or a pet project free plan is more than enough. It’s easy to run, the web console is clean and readable. Blablabla, nothing special. The biggest pros of Netlify is almost out-of-the-box integration with Hugo. I’d like to describe it:

  1. Add just one small file into repo(copied from doc)

    [build]
    publish = "public"
    command = "hugo --gc --minify"
    
    [context.production.environment]
    HUGO_VERSION = "0.78.2"
    HUGO_ENV = "production"
    HUGO_ENABLEGITINFO = "true"
    
    [context.split1]
    command = "hugo --gc --minify --enableGitInfo"
    
    [context.split1.environment]
    HUGO_VERSION = "0.78.2"
    HUGO_ENV = "production"
    
    [context.deploy-preview]
    command = "hugo --gc --minify --buildFuture -b $DEPLOY_PRIME_URL"
    
    [context.deploy-preview.environment]
    HUGO_VERSION = "0.78.2"
    
    [context.branch-deploy]
    command = "hugo --gc --minify -b $DEPLOY_PRIME_URL"
    
    [context.branch-deploy.environment]
    HUGO_VERSION = "0.78.2"
    
    [context.next.environment]
    HUGO_ENABLEGITINFO = "true"
    
  2. Login into service

  3. Click New site from Git

  4. Connect with repo - I’m testing it with GitLab and it’s working

  5. Then click Deploy site and that is it - deployment started

Connect app to domain

Netlify

  1. Open Netlify Web Console
  2. Go to Domains and Add or register domain
  3. Add your domain name in my case 3sky.dev (without www or http/https)
  4. Click next until you will see four DNS servers names.
  5. Save it.

OVH

  1. Go to OVH web console
  2. Go to Domain and DNS zone, then Add an entry
  3. Choose A record type
  4. As a target put Netlify LB IP - now it’s 104.198.14.52
  5. Save the changes
  6. Now we need to wait for DNS propagation, it can take from 20minuts to 24h

Summa…SSL

Ahh the SSL, we need it. Especially because it’s *.dev domain, so we need https. Luckily Netlify takes care of that almost automatically. Just enable it in HTTPS tab, under Domain managment section. That’s all. It’s a free Let’s Encrypt certificate.

Simple test

  1. Dig it

    $ dig 3sky.dev +short
    104.198.14.52
    
    $ curl -i https://3sky.dev
    HTTP/2 200 
    cache-control: public, max-age=0, must-revalidate
    content-type: text/html; charset=UTF-8
    date: Mon, 15 Nov 2020 21:17:37 GMT
    etag: "6d2c65136f31d13166ffb3c6a5da2c77-ssl"
    strict-transport-security: max-age=31536000
    age: 0
    server: Netlify
    x-nf-request-id: d640bb4f-fdde-477b-88d5-3d142895ba23-24195284
    
    openssl s_client -connect 3sky.dev:443
    CONNECTED(00000003)
    depth=1 C = US, O = Let's Encrypt, CN = Let's Encrypt Authority X3
    verify return:1
    depth=0 CN = *.3sky.dev
    verify return:1
    ---
    Certificate chain
    0 s:CN = *.3sky.dev
    i:C = US, O = Let's Encrypt, CN = Let's Encrypt Authority X3
    1 s:C = US, O = Let's Encrypt, CN = Let's Encrypt Authority X3
    i:O = Digital Signature Trust Co., CN = DST Root CA X3
    

So sweet, page is reachable, status code is correct and SSL looks valid.

SEO

It will be nice to be more visable. I’d like to invest some of time in SEO stuff. That’s really new thing for me, so I started from Google Search Console. Maybe that’s wrong way, but I’m fresh here. How to configure it? It’s easy.

Google Search Console

  1. Go to Web Console
  2. Fill Prefix of URL in my case https://3sky.dev
  3. Then get verifivation code started with google-site-verification= - copy it

OVH Console

  1. Go to OVH consol
  2. Navigate to your domain and DNS zone tab
  3. Click Add a Entry
  4. Choose TXT record type
  5. Click Next
  6. Leave subdomain filed (in my case) empty
  7. TTL set as default value
  8. Value - here past whole verifivation code from Google Site
  9. Save it

Testing

We need to wait for the change. We can check it manually with dig

$ dig +nocmd +noall +answer 3sky.dev TXT @dns113.ovh.net
# 3sky.dev - my domain name
# TXT - record type, we can use A or MX as well
# dns113.ovh.net - DNS server for me it's dns113
3sky.dev.		600	IN	TXT	"1|www.3sky.dev"
3sky.dev.		600	IN	TXT	"v=spf1 include:mx.ovh.com ~all"
3sky.dev.		600	IN	TXT	"google-site-verification=rsddddddddddddddddddddddddddd"

When you see similar output you can go back to Google Search Console and verify you webpage. After that, you need to wait again… and try to learn about SEO in meantime - GOOD LUCK. Maybe I will post about that.

Summary

My own domain. It’s like home on the internet, my home. This feeling is definitely worth 14$. Also, I’m very surprised by Netlify. I have read about it in past, but I linked it with JavaScript ecosystem and npm install on the workstation. Now it’s almost no-code solution. My workflow is growing. I started with manual git push to GH Pages repo, then I add custom scripts for deployment. Next, I tried some CI/CD tools, I fall in love with GitHub Action, but I had some issues with publishing and building, especially after a long break. Now I have a stable and easy maintenance solution, which allows me to focus on writing. In general, it’s an important lesson. Only war never changes, the rest parts of the world do. The Tech industry changes even faster, so good choices are critical in a long term project. Good design and planning are the keys. I know - it is very hard, also nobody has a glass ball. On another hand that’s the reason why I’m here on this blog. I’m trying to learn and be a better specialist every day, maybe that is the key? I will see where I will be in 2025? or 2030?