staticman icon indicating copy to clipboard operation
staticman copied to clipboard

Heroku shutting down their free tier

Open DawnPaladin opened this issue 1 year ago • 40 comments

Heads up: Heroku is eliminating their free services, starting November 28. Staticman has long recommended Heroku for their free services, and the documentation walks users through setting up hosting on Heroku; that documentation will need to be changed.

There are a number of competitors seeking to replace Heroku in this market niche. I've looked at a number of them and my current favorite is fly.io. They have a dedicated Heroku importer which has worked pretty well for me.

DawnPaladin avatar Sep 08 '22 04:09 DawnPaladin

Thank you for the tip. I just migrated my Heroku Staticman app to fly.io and it works like a charm.

matheusamazonas avatar Sep 11 '22 09:09 matheusamazonas

@DawnPaladin: Thank you very much for the hint. Please share your feedback about any issues that you might have faced during the migration process. @matheusamazonas: Thank you for sharing your thoughts with us. I am currently hosting Staticman on Heroku, and I intend to migrate my app, too. Are there any settings that need to be changed during the migration?

ka2in avatar Sep 16 '22 19:09 ka2in

@DawnPaladin @matheusamazonas I spent an hour trying to get Heroku working unsuccessfuly :(

I might try netlify as suggested here: https://github.com/eduardoboucas/eleventy-blog-staticman

turian avatar Sep 16 '22 20:09 turian

@turian:

Did you try using a different version (v1 or v2) for the API post request?

<form method="POST" action="https://api.staticman.net/v3/entry/github/eduardoboucas/staticman/gh-pages/comments">

Check the logs on Heroku. That might help finding out what's causing your issue.

ka2in avatar Sep 16 '22 20:09 ka2in

@ka2in The migration was as simple as it could be, to be honest. I only had to choose the Fly.io app name, which Heroku app should it migrate, and that was it. I was kind of impressed about how easy it was.

matheusamazonas avatar Sep 17 '22 09:09 matheusamazonas

@turian It's hard to pinpoint what your problem could be without extra information. I did struggle a bit while trying to set it up on Heroku, but everything was easily fixable.

matheusamazonas avatar Sep 17 '22 10:09 matheusamazonas

I was looking into this recently, and I figured that Staticman can run as a Google Cloud Function with an ugly POST redirection patch. Here is my fork that implements that.

As a Google Cloud Function, Staticman will be able to handle 2 million POST requests per month for free.

Essentially free for small blogs.

Rubonnek avatar Sep 17 '22 14:09 Rubonnek

@Rubonnek I just wanted to say thanks for your effort here! I preferred GCF over Fly.io or Netlify for no real reason other than not having to create an account with yet another company - and it works great thanks to your patch.

A couple of notes for anyone doing the same:

  • The entry point is called "main"
  • You need to set up the environment variables including RSA_PRIVATE_KEY before running the function, otherwise it will fail to run
  • If you get an HTTP 403 error accessing the URL in a browser after it's run up, you need to give "allUsers" the "Cloud Run Invoker" permission so that unauthenticated users can invoke the function via an HTTP request

I hope that helps! I get about 2 comments a month so I'm hoping 2 million POST requests will be enough 😆

ianrenton avatar Sep 25 '22 14:09 ianrenton

Fly.io's heroker importer worked well for me. The importer actually appeared to get stuck, but when I went to the dashboard the app was running. After that, just had to change the github app webhook url and change the API link in the site config.yml.

RyanTG avatar Oct 04 '22 21:10 RyanTG

@turian:

Did you try using a different version (v1 or v2) for the API post request?

<form method="POST" action="https://api.staticman.net/v3/entry/github/eduardoboucas/staticman/gh-pages/comments">

Check the logs on Heroku. That might help finding out what's causing your issue.

i suggest using v3 for two-folded reasons:

  • native GitLab support for GitLab Pages, AND
  • native GitHub App support for GitHub Pages

ℹ️ It's possible that one (personal) API server serve both GitLab and GitHub sites.

VincentTam avatar Oct 14 '22 11:10 VincentTam

@DawnPaladin @matheusamazonas I wanted to give your suggestion a try, but then I was asked for my credit card details in the middle of the process. No way to import an app from Heroku before selecting a payment method.

ka2in avatar Oct 22 '22 18:10 ka2in

We’re living in a post-heroku world. They disabled the free tier in part because of people signing up and using resources, and the competitors have learned from this and most require cards.

RyanTG avatar Oct 22 '22 19:10 RyanTG

I just migrated my Heroku instance to Cyclic. They have free accounts and don't require credit cards. To get setup, I had to fork this repo, since eduardo's repos wouldn't show up in the list. I also had to deploy from master, not dev.

After moving over my GITHUB_TOKEN and RSA_PRIVATE_KEY, and changing the URL in staticman.yml to point to the new instance, everything seems to be working.

jamesmortensen avatar Oct 25 '22 12:10 jamesmortensen

More Heroku alternatives are listed at https://github.com/Engagespot/heroku-free-alternatives

erikw avatar Oct 25 '22 14:10 erikw

@erikw @jamesmortensen: Thank you very much for introducing more alternatives to Heroku.

ka2in avatar Oct 25 '22 19:10 ka2in

@Rubonnek the gcloud integration looks cool. With a little bit more effort, I think you could write a wrapper around it that would allow users of Staticman to choose between the default standalone mode and cloud function mode.

However, the upstream project isn't active, so I'm not sure if it's a good time investment if there is no one to evaluate and merge the pull request.

@VincentTam does v3 still support PAT tokens? I think I am still on v2 because I didn't create a GitHub app.

jamesmortensen avatar Oct 28 '22 16:10 jamesmortensen

@VincentTam does v3 still support PAT tokens? I think I am still on v2 because I didn't create a GitHub app.

@jamesmortensen

Git provider ✔️ / ❌
GitHub ✔️
GitLab

I encourage you to move to GitHub App for issues addressed by PR 243.

VincentTam avatar Oct 28 '22 21:10 VincentTam

I finally migrated my app to Render without any big issues.

  1. Deploy as a Web Service.
  2. Node environment.
  3. Enter the environment variables you were using on Heroku
  4. Adjust your webhook URL and change the URL you're pointing to for the POST requests.

You can also set a different name for your Web Service on Render under Settings. That's it.

ka2in avatar Nov 19 '22 18:11 ka2in

Would be nice if people update their tutorials on the net to explain the migration process for new users. The Getting Started on the Staticman official website is not a detailed resource for newcomers.

ka2in avatar Nov 19 '22 18:11 ka2in

@ka2in would you be able to write one for Render? I should be able to have time soon to do one for cyclic.sh.

Since there is no one to approve and merge pull requests, I think we could just post links to those tutorials in this issue.

jamesmortensen avatar Nov 20 '22 10:11 jamesmortensen

@jamesmortensen yes, sure. I'll prepare a tutorial for Render.

ka2in avatar Nov 20 '22 11:11 ka2in

@ka2in When deploying the app on Render, it prompts

Staticman API running on port 10000

But the build never finishes. It remains stuck on "in progress". It builds fine locally but there seems to be some trouble in deployment which I'm struggling to figure out. Is there by any chance you faced the same issue or know a workaround to fix it?

prateekdwv avatar Nov 26 '22 19:11 prateekdwv

Here's my tutorial: https://github.com/ka2in/heroku-render-migration/wiki/Migrating-your-Staticman-instance-from-Heroku-to-Render

ka2in avatar Nov 26 '22 22:11 ka2in

@prateekdwv What did you choose under Environment (runtime environment for your web service) in Render? I'm getting comments without any issues through my instance on Render.

ka2in avatar Nov 26 '22 22:11 ka2in

I just migrated staticman to fly.io using the linked Heroku importer. Very simple.

  • Made fly.io account. Input credit card to be able to use free tier.
  • run heroku importer tool.
  • change every instance in website of "herokuapp.com" to "fly.dev"

anaxonda avatar Nov 27 '22 23:11 anaxonda

The fly.io migration tool kept failing for me. It said the app was not found. I then manually cloned a copy of staticman to fly.io and copied my secrets from Heroku. That "mostly" seemed to work, but when the app runs, I'm getting an error about the RSA key not being found. Thoughts on what to try next?

andsplat avatar Feb 23 '23 02:02 andsplat

i've given up trying the RSA key cuz RSA won't be safe in post-quantum era.

VincentTam avatar Feb 23 '23 11:02 VincentTam

@VincentTam I'm not able to get the app to run without the RSA though as it kills my app on fly.io. Not sure why I'm having these issues as people above seem to have had no issues using the Heroku to fly.io migration tool. It's just not working for me and my manual clone of staticman and migration of my secrets are not working. I'm a bit confused on how to fix this.

andsplat avatar Feb 23 '23 12:02 andsplat

What port are you all using on fly.io in the config.js staticman file? I think that is where my app is failing. Fly.io is looking for 8080, but staticman is trying to use the default 0. Does that make sense?

andsplat avatar Feb 23 '23 15:02 andsplat

When I first migrated to Fly.io, I kept receiving failure reports:

% flyctl launch

Release v1 created
==> Monitoring deployment

 1 desired, 1 placed, 0 healthy, 1 unhealthy [health checks: 1 total, 1 critical]
Failed Instances

Failure #1

Instance
ID      	PROCESS	VERSION	REGION	DESIRED	STATUS 	HEALTH CHECKS      	RESTARTS	CREATED   
e92b862b	app    	1      	ewr   	run    	running	1 total, 1 critical	0       	5m22s ago	

Recent Events
TIMESTAMP           	TYPE      	MESSAGE                 
2022-11-28T02:55:10Z	Received  	Task received by client	
2022-11-28T02:55:36Z	Task Setup	Building Task Directory	
2022-11-28T02:55:37Z	Started   	Task started by client 	

2022-11-28T02:55:39Z   [info]Staticman API running on port 8098
--> v1 failed - Failed due to unhealthy allocations - no stable job version to auto revert to and deploying as v2 

--> Troubleshooting guide at https://fly.io/docs/getting-started/troubleshooting/
Error abort

I eventually fixed this by setting/changing internal_port = 8098 in the fly.toml file (to match my staticman config).

hispanic avatar Feb 23 '23 21:02 hispanic