Local ghost install + JAMstack Gatsby + Ntlify + GitHub + custom domain


#1

OK, so giving this JAMstack thing a go - only problem is that it’s tough to follow all the instructions (which seems to be a bit scattered at the moment in the documentation) for a newbie.

  1. I’ve got a clean install Ghost running on a local server (it’s Openmediavault, and ghost is running in a docker container). That works fine.
  2. Next, I have forked the gatsyby-starter-ghost repo from TryGhost, in my Github. Cool.
  3. Next I setup the Netlify app and a webhook (this part of the instructions is easy to follow. I also setup DNS redirection to my custom domain. So far, so good - my domain show the ghost starter site. And I can see updating a post triggers the webhook/rebuild. Sick.
  4. Next, I edited the .ghost.json file in the git fork, to put the Netlify webhook ‘contentapi’ in place of the default one that comes with the fork.

Here’s where things stop working.

This is probably because I’m not clear on what I’m really doing… but the rebuild fails everytime.
Here are logs if helpful!

I think this is because of the apiURL in the .ghost.json file?
I’m not really sure what this is meant to be (considering I am running a local backend)
Initially, I left it as the “https://gatsby.ghost.io” default. Is this my issue?
Or have I not installed a package somewehere? Or is what I am trying to do just not possible
(to clarify, I want to host my ghost backend on my local server, have Netlify trigger a static static site rebuild to host content on github - for free! - and redirect to my domain. Seems like most of it work - just not the rebuilds to push the updates and replace the stock posts…)

Again, I’m not really sure how everything fits together/works, which is probably the root of my problem.

A comprehensive walkthrough for other newb penny-pinchers like myself would be great - the current blog post and scattered docs isn’t all that user-friendly for the uninitiated :frowning:

Thanks for any help!


#2

That’s exactly your issue. Line 87 of the logs you pointed to shows a 401 error, which is an authorization required error.

What you just did is create a content key for https://your.site/blog, and ask https://gatsby.ghost.io for content using the key from https://your.site/blog. For obvious reasons, Ghost isn’t designed to work like that :sweat_smile:

So you need to update the url to your installation - e.g https://your.site/blog where the apiUrl is requested. If you’re using Netlify, this means the installation needs to be publically accessible to the internet.


closed #3

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.