Skip to main content

4 posts tagged with "monitoring"

View All Tags

· 2 min read

When I was building a robust website for having privacy friendly website analytics, simple uptime monitoring, status pages, user feedback all bundled together, I realized that my app website and marketing website needs to be different.

Why should my Marketing website aka landing page, docs, blog be separate

I wanted a simple no frills approach, setup once, infinitely configurable and static site generator with the capacity for super dynamic website in the future. I had this simple requirement and I set out on searching and finding the best possible way to do it. Along the way I found many alternatives, I didn't mind paying, but I wanted infinite customizable to exactly suit my needs. I stumbled upon

  • Squarespace
  • VuePress
  • GitBook
  • Jekyll
  • Hugo

All these have amazing features and others have acheived greatness with this, but the paid solutions didn't give me confidence in their customizability, I have nothing against those but they aren't for the power users like me.

Next, the static site generators had plugins but nothing had out of the box solutions for documentation, yeah vue press but I'm not much of a vue guy I'm a react guy since my application front end is in Next Js I didnt' want to have a lot of context switch.

Hugo, Jekyll are in languages I am not familiar with and again I didn't want to do a lot of context switching.

GitBook is also an amazing solution for documentation but not so amazing for having a unified solution with landing page and dynamic content the way I wanted.

So finally I stumbled upon Docusaurus and I can't be more delighted with the support, out of the box solutions and best of all its in react. Fully customizable, out of the box markdown support, out of the box documentation support, it can run Jsx to run any dynamic stuff I want to run later, out of the box rss support, reading time and literally all the basic tiny details. And it was a joy to setup. Love the contributors to docusaurus and I would recommend more people to definitely use it. And its documentation is in a github repo so I can locally build and access it while flying without any issue.

· 3 min read

Intro

The tech stack for Easy Startup uses a lot of technologies, I will just briefly explain what I have used leaving the specifics of it to another blog post. My tech stack consists mainly of the following -

  • Backend
    • Java 17 (I love the language, I wanted a statically typed language and I have loads of experience with it building production systems and debugging all the random errors that can creep up)
  • Database / Storage
    • MongoDb (My database of choice, I can change schema on the fly without having to worry about breaking anything)
    • PostgresSQL (For analytical reporting and aggregation since mongo is not built for this)
    • Clickhouse
    • Linode Object Storage (Its fully S3 compatible so I can switch provider later) (Its configured but I currently dont use it for anything, might start using it once I add the export functionality)
  • Frontend
    • NextJs (react) Yeah I know I don't use any server side rendering feature but I like the opinions of nextjs and hence I have stuck to it
    • Tailwind (What would I do without you )
    • Docusaurus (Static site builder for landing page and marketing site, this blog, documentation etc. I tried vue for a while but I am sorry vue fans I'll stick with react)
  • Deployment
    • Kubernetes (I have a simple bash script set up which does the git commit, git push, and triggers git actions helm deploy with just one command ./build_deploy.sh)
    • Git (Best version control system invented)
  • Reverse Proxy / CDN / Certificate
    • Nginx
    • Cloudflare (CDN + Certificate generator) free plan as of now (will switch cdn once I get more users)
  • Text Editors / IDE
    • Intellij Community Edition for Java with the VimPlugin
    • Vim for all server configs and editing anything on the fly (I spent around 2 hours learning vim and I can say that it was one of the best times ever spent, vim makes normal editing so much faster and efficient and I dont have to every worry about editing directly on the server)
    • Vs Studio Code for NextJs
    • Sublime Text for pretty json, mongo updates and for in general pasting any random stuff
  • Laptop
    • M1 Macbook Air 16GB ram 256GB ssd. This is literally the best purchase, I couldn't have been happier with a purchase, ironically it costs less than my iPhone which I use much less than my air. This device runs everything a programmer wants flawlessly and super fast, my i9 16 inch Macbook pro overheats, throttles and starts crying out loud even if I run a simple Intellij Java program, this air flies through anything and it doesn't even have a fan. 🙌 Thanks apple for making this wonderful magic device. I run hundreds of chrome tabs, java, intellij, mulitple node servers for react, visual studio code, postman, sublime text, iterm, spotify, spark (for mail), bitwarden, twitterdeck and many more apps all together and this beast doesn't even skip a beat.

· One min read
  1. We provide custom domain support to bypass ad blockers, whereas Google Analytics gets blocked by most ad blockers and other privacy browsers
  2. We believe in privacy and provide a Privacy First Solution
  3. Our customer support is better than what google can provide
  4. Along with analytics we also provide other solutions all included in the same package
  5. We do not store user data and are fully GDPR compliant
  6. No cookie consent required when using Easy Startup Analytics
  7. Daily/Monthly Reports

· 2 min read

Easy Startup analytics provides users the ability to have

  1. Unlimited Status Page for monitoring on a custom domain.
  2. Website Analytics capturing using custom domain for aggressive ad blockers who unknowingly block our privacy first website analytics.

So to achieve this goal I searched and found a few solutions.

  1. Amazon AWS Certificate Manager (Need to pay for load balancer)
  2. Cloudflare SSL-FOR-SAAS ($2 per website)
  3. OpenResty Lua with Nginx (Not actively maintained open source)
  4. Caddy (Open source and beautiful and easy to use, perfect for my use case)

So the choice was obvious, I went with Caddy which does exactly this out of the box using lets encrypt certificates. It auto renews, generates SSL certificates on the fly, serves static files and acts as reverse proxy.

Steps to implement

Follow the following steps to get a working installation on Ubuntu. We will be using the On Demand TLS feature of Caddy as documented here. Another amazingly simple guide to enable is available on caddy community.

1. Install Caddy on Ubuntu

Caddy's documentation have specified the steps for installation here. I just copied and ran these steps right away on my server.

sudo apt install -y debian-keyring debian-archive-keyring apt-transport-https
curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/gpg.key' | sudo tee /etc/apt/trusted.gpg.d/caddy-stable.asc
curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/debian.deb.txt' | sudo tee /etc/apt/sources.list.d/caddy-stable.list
sudo apt update
sudo apt install caddy
danger

If you are using cloudflare DNS, you need to create * A record and AAAA record which points to your caddy server ip address and make sure to disable PROXY and make it DNS only.

2. Setup caddy config

{
on_demand_tls {
ask http://localhost:8081/api/private/check
interval 2m
burst 20
}
}

https:// {
tls {
on_demand
}
file_server
}
tip

Caddy will hit your ask endpoint with a GET request and domain query param. And you have to return with 200 status code to allow it to create ssl certificate. This is required to prevent abuse else anybody can hit your endpoint and a new certificate will get generated which can get your server blacklisted from lets encrypt for abuse. So please make sure to have all the proper checks before deploying in production.

And voila your caddy config is ready to serve SSL on custom domains for all requests.