diff --git a/_posts/2022-02-21-netlify-deployments-from-github-without-giving-write-access.md b/_posts/2022-02-21-netlify-deployments-from-github-without-giving-write-access.md index 9671a975..ed6435ab 100644 --- a/_posts/2022-02-21-netlify-deployments-from-github-without-giving-write-access.md +++ b/_posts/2022-02-21-netlify-deployments-from-github-without-giving-write-access.md @@ -7,7 +7,7 @@ dev_to: https://dev.to/conorsheehan1/netlify-deployments-from-github-without-giv [Netlify](https://www.netlify.com/) is a great hosting service, but there's one thing that bothers me about it. The default deployment path involves giving the service **read *and* write access** to all of your **public *and* private repositories** on GitHub :scream: -https://docs.netlify.com/site-deploys/create-deploys/#deploy-with-git +[https://docs.netlify.com/site-deploys/create-deploys/#deploy-with-git](https://docs.netlify.com/site-deploys/create-deploys/#deploy-with-git) They skip over the authorization step in the video on their docs, but here's what it looks like. @@ -17,13 +17,13 @@ They skip over the authorization step in the video on their docs, but here's wha I found [some](https://answers.netlify.com/t/why-do-you-need-write-permissions-to-my-repository/7897) [questions](https://answers.netlify.com/t/new-github-permissions/37939) on their forums asking about this. There's even an open [issue](https://github.com/netlify/netlify-cms/issues/4329) on their GitHub about it. Despite all the links I visited, I didn't find a clear way to automate deploys to Netlify without giving them full access to my GitHub, so here's how I managed to do it. ## Initial drag and drop deploy -Before we can automate our deploys, we need a site ID. Netlify provides a drag and drop feature, so we can drag the output of a build, or even a folder with an empty `index.html` to create a new site. https://app.netlify.com/drop +Before we can automate our deploys, we need a site ID. Netlify provides a drag and drop feature, so we can drag the output of a build, or even a folder with an empty `index.html` to create a new site. [https://app.netlify.com/drop](https://app.netlify.com/drop) ## GitHub action -Now that we have a Netlify site created, we can automate deploys to it. I used https://github.com/jsmrcaga/action-netlify-deploy, which requires an auth token and a site ID. +Now that we have a Netlify site created, we can automate deploys to it. I used [https://github.com/jsmrcaga/action-netlify-deploy](https://github.com/jsmrcaga/action-netlify-deploy), which requires an auth token and a site ID. ### Generate auth token -We can generate a Netlify auth token by going to https://app.netlify.com/user/applications#personal-access-tokens. Click `New Access Token`, then give it a description and click `generate`. Copy the value, it won't be displayed again. +We can generate a Netlify auth token by going to [https://app.netlify.com/user/applications#personal-access-tokens](https://app.netlify.com/user/applications#personal-access-tokens). Click `New Access Token`, then give it a description and click `generate`. Copy the value, it won't be displayed again. To make the value accessible to the GitHub action, go to your GitHub repository and click `settings` -> `secrets` -> `new repository secret`. I named mine `NETLIFY_AUTH_TOKEN` and pasted in the value I copied from Netlify. diff --git a/_posts/2022-08-04-buying-and-configuring-my-first-domain.md b/_posts/2022-08-04-buying-and-configuring-my-first-domain.md index 00a0077f..2391b644 100644 --- a/_posts/2022-08-04-buying-and-configuring-my-first-domain.md +++ b/_posts/2022-08-04-buying-and-configuring-my-first-domain.md @@ -1,7 +1,7 @@ --- layout: blog categories: blog -tags: devto +tags: devto hosting imagedir: /assets/images/beach_litriochta --- diff --git a/_posts/2022-09-08-jekyll-plugins-on-github-pages.md b/_posts/2022-09-08-jekyll-plugins-on-github-pages.md index b3aef39c..e65428ec 100644 --- a/_posts/2022-09-08-jekyll-plugins-on-github-pages.md +++ b/_posts/2022-09-08-jekyll-plugins-on-github-pages.md @@ -1,7 +1,7 @@ --- layout: post categories: personal -tags: jekyll ruby github-pages +tags: jekyll ruby github-pages hosting --- I finally got tags and categories pages working for this website! diff --git a/_posts/2024-03-07-leaving-netlify-free-tier.md b/_posts/2024-03-07-leaving-netlify-free-tier.md new file mode 100644 index 00000000..fce315e0 --- /dev/null +++ b/_posts/2024-03-07-leaving-netlify-free-tier.md @@ -0,0 +1,78 @@ +--- +layout: blog +categories: blog +tags: devto hosting javascript +imagedir: /assets/images/leaving_netlify +--- + +## Background + +I've had 3 sites on netlify since 2022. + +| URL | Date created | +|--------------------------------------|--------------| +| https://spelling-b.netlify.app | 2022-08-15 | +| https://beach-litriochta.netlify.app | 2022-07-12 | +| https://conorscocktails.netlify.app | 2022-01-06 | + + +I liked the service, although I wasn't thrilled with their default flow for deployments. I wrote a [blogpost]({{site.url}}/blog/2022/02/21/netlify-deployments-from-github-without-giving-write-access.html) about how to deploy without giving netlify **read *and* write access** to all of your **public *and* private repositories**. + +## Leaving Netlify + +Then I read in the news last week that a random developer using the same supposedly free tier on netlify got hit with a >$100k bill due to a DDOS attack. [https://news.ycombinator.com/item?id=39520776](https://news.ycombinator.com/item?id=39520776) + +This is because the netlify free tier is not free. +[https://www.netlify.com/pricing](https://www.netlify.com/pricing) + +Their landing page says `start for free` but if you scroll down you'll see there's a `100GB bandwidth` limit, and a fee for any traffic over the limit. + +![netlify-terms]({{ '/netlify-terms.png' | prepend: page.imagedir | absolute_url }}) + +Normally this would be fine, but when you hit their limit they don't stop service. They might not even inform you that you've exceeded the free limit until you get a bill at the end of the month. + +They also do not protect against DDOS. They just continue service with their high rate of `$55 per 100GB`. For comparison AWS is around `$9 per 100GB`, and that's still high IMO. [https://www.hostdime.com/blog/data-egress-fees-cloud](https://www.hostdime.com/blog/data-egress-fees-cloud) + +I've been stretched thin lately and not working on personal projects, but the thought of a potentially infinite bill definitely kicked me into gear. +Last week I copied all my netlify sites to cloudflare pages. + +1. [https://conors-cocktails.pages.dev](https://conors-cocktails.pages.dev) +2. [https://beach-litriochta.pages.dev](https://beach-litriochta.pages.dev) +3. [https://spelling-bee-free.pages.dev](https://spelling-bee-free.pages.dev) + +Today I deleted all my netlify sites and my netlify account. +I managed to run those 3 sites on netlify for the last 2 years with ~20Gb bandwidth usage, but I'm not willing to stay given the risk. + +## Moving to cloudflare pages + +I found the dev experience really good moving to [cloudflare pages](https://pages.cloudflare.com/). +They give you preview sites based on pr builds for free. +The github access is very easily controlled. They only ask for read access and you can choose the repositories they get access to. +They do ask for write access to metadata so they can put status messages on PRs, but I like that. + +I only had 2 tiny issues: +1. I needed to set an environment variable `YARN_VERSION` to get the build to work +2. I had to delete and recreate a site to change the pages.dev url + [https://developers.cloudflare.com/pages/platform/known-issues/#build-configuration](https://developers.cloudflare.com/pages/platform/known-issues/#build-configuration]) + > If you need to change your *.pages.dev subdomain, delete your project and create a new one. + +Other than that it was seamless. Definitely easier than the github action setup I needed for netlify. + +Most importantly, on the free plan if you exceed their limits, they shutdown the service instead of continuing and charging you! [https://developers.cloudflare.com/pages/functions/pricing/#free-plan](https://developers.cloudflare.com/pages/functions/pricing/#free-plan) + +The icing on the cake is +> On both free and paid plans, requests to static assets are free and unlimited + +![cloudflare-terms]({{ '/cloudflare-terms.png' | prepend: page.imagedir | absolute_url }}) + +This reminds me of the good old days on heroku, where you had a free limit on compute each month, and if you exceeded it the service just stopped. + +## Conclusion + +Although the [Netlify CEO said they'd waive this bill](https://news.ycombinator.com/item?id=39521986), I wouldn't recommend you host any site on netlify, unless you're absolutely sure 100Gb of requests will make you more than netlify charge. For me I don't run ads or make money per request, so I'll be leaving entirely. + +It seems like this tactic of keeping service up no matter what and charging high fees later isn't limited to netlify. Vercel do something similar. [https://serverlesshorrors.com/all/vercel-23k](https://serverlesshorrors.com/all/vercel-23k) +Generally I think this pattern is very dangerous. As a [commenter on hackernews pointed out](https://news.ycombinator.com/item?id=39520981) +> It's unbounded liability. Not to mention the strong conflict of interest for netlify, who stands to gain from their customers being attacked. + +If you're looking for an alternative, I'd recommend [cloudflare pages](https://pages.cloudflare.com/). I found it great so far. \ No newline at end of file diff --git a/assets/images/leaving_netlify/cloudflare-terms.png b/assets/images/leaving_netlify/cloudflare-terms.png new file mode 100644 index 00000000..3243b11e Binary files /dev/null and b/assets/images/leaving_netlify/cloudflare-terms.png differ diff --git a/assets/images/leaving_netlify/netlify-terms.png b/assets/images/leaving_netlify/netlify-terms.png new file mode 100644 index 00000000..3656694c Binary files /dev/null and b/assets/images/leaving_netlify/netlify-terms.png differ