Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Heroku shutting down their free tier #451

Open
DawnPaladin opened this issue Sep 8, 2022 · 40 comments
Open

Heroku shutting down their free tier #451

DawnPaladin opened this issue Sep 8, 2022 · 40 comments

Comments

@DawnPaladin
Copy link

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.

@matheusamazonas
Copy link

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

@ka2in
Copy link

ka2in commented Sep 16, 2022

@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?

@turian
Copy link

turian commented Sep 16, 2022

@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

@ka2in
Copy link

ka2in commented Sep 16, 2022

@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.

@matheusamazonas
Copy link

matheusamazonas commented Sep 17, 2022

@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
Copy link

@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.

@Rubonnek
Copy link

Rubonnek commented Sep 17, 2022

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.

@ianrenton
Copy link

@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 😆

@RyanTG
Copy link

RyanTG commented Oct 4, 2022

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.

@VincentTam
Copy link
Contributor

@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.

@ka2in
Copy link

ka2in commented Oct 22, 2022

@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.

@RyanTG
Copy link

RyanTG commented Oct 22, 2022

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.

@jamesmortensen
Copy link

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.

@erikw
Copy link

erikw commented Oct 25, 2022

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

@ka2in
Copy link

ka2in commented Oct 25, 2022

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

@jamesmortensen
Copy link

@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.

@VincentTam
Copy link
Contributor

@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.

@ka2in
Copy link

ka2in commented Nov 19, 2022

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
Copy link

ka2in commented Nov 19, 2022

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.

@jamesmortensen
Copy link

@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.

@ka2in
Copy link

ka2in commented Nov 20, 2022

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

@prateekdwv
Copy link

@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?

@ka2in
Copy link

ka2in commented Nov 26, 2022

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

@ka2in
Copy link

ka2in commented Nov 26, 2022

@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.

@anaxonda
Copy link

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"

freininghaus added a commit to freininghaus/freininghaus.github.io that referenced this issue Jan 4, 2023
@andsplat
Copy link

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?

@VincentTam
Copy link
Contributor

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

@andsplat
Copy link

@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
Copy link

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?

@hispanic
Copy link

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).

@andsplat
Copy link

Thanks, @hispanic! I updated both my config.js and fly.toml to match on the port and that seems to work. I am able to now get the "Hello from Staticman version 3.0.0!" message when I go to the URL.

I updated my api url in my website config file and changed my GitHub Application webhook address, but it failed when doing a test post to the new fly.io instance. Some of the messages that I received:

[@octokit/app] Deprecated. Use @octokit/app-auth instead. See https://github.com/octokit/app.js/#deprecated

(node:536) UnhandledPromiseRejectionWarning: Error: error:0906D06C:PEM routines:PEM_read_bio:no start line

(node:536) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 4)

(node:536) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

[error] could not send HTTP request to instance: connection error: timed out

Did you have any issues when attempting a first test comment?

@hispanic
Copy link

Nope. No issues after that, I believe. Make sure you set your secrets (env vars), including your private key:
% flyctl secrets set -a [your-app-name] RSA_PRIVATE_KEY="$(cat key.pem)"

Full disclosure, I'm using a custom fork, not the official Staticman. (I'm not encouraging usage of my fork, at least not by anyone expecting support.)

@andsplat
Copy link

Thanks, @hispanic. Are you not seeing the depreciation warning around @octokit/app being deprecated and needing to use @octokit/app-auth instead?

@hispanic
Copy link

Nope, no warning for me.

@andsplat
Copy link

@hispanic Yeah, I'm very confused. I am able to use the Fly.io webhook in my Github app, but when I change from my Heroku api call in my comment form HTML post URL to the Fly.io api URL, I get the following error:

iad [error] could not send HTTP request to instance: connection error: timed out

It seems that I am able to authenticate to the Fly.io instance since I can use the webhook URL in my GitHub app, but I don't know why my post URL is not working.

@hispanic
Copy link

I'm not sure what to say. Standard debugging procedures apply. Try to figure out the differences between the calls by recreating both the success and error conditions using something such as Insomnia, Postman, etc. Good luck.

@andsplat
Copy link

Thanks @hispanic. I'll try and figure that out (I'm primarily a designer, so I still have a lot to learn about debugging issues).

@hispanic
Copy link

Roger that. A time out error implies, to me, some sort of configuration error beyond Staticman.

That said, personally, I don't believe that Staticman is maintained, packaged, supported, or coded cleanly enough to be reliably stood-up by those who are not willing and able to dig into the code a bit. This is not a criticism of anyone, including Eduardo. I'm very thankful the codebase is available for use, regardless of any weaknesses I see it as having.

@samusz
Copy link

samusz commented May 4, 2024

Please change the text and link saying Heroku has a free plan on your website. It's somewhat confusing when one lands on the Heroku website and can't find it (any more)!
Best, Take care

@RyanTG
Copy link

RyanTG commented May 6, 2024

@samusz If you’re referring to something in the docs, you can make the edit yourself and submit a PR https://github.com/eduardoboucas/staticman.net

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests