After installing Ghost on SparkBox. I'm trying to sign in to Admin page by visiting http://xxx.xxx.xx.xx:2368/ghost or https://www.example.com/ghost and I get an error page. Request made from incorrect origin. Expected 'http://localhost:2368' received 'http://xxx.xxx.xx.xx:2368'.
6 replies
Chris wrote:
Sorry this is getting in the way of setting up your blog. What is happening: on SparkBox, Ghost is set up to answer only at http://localhost:2368. Its admin page refuses any visit that arrives from a different address, which is why the error names the address you typed as the "incorrect origin". There is no SparkBox setting yet that changes this address, so on the install as it stands the admin page will not open from another device. One check to confirm the install itself is fine: on the SparkBox machine (or at its own screen), open http://localhost:2368/ghost. If the setup or sign-in page loads there, Ghost is working and only the address is the problem. Tell me which device you sign in from (Windows PC, Mac, or phone) and whether you can reach the SparkBox machine's screen or a terminal on it, and I will give you the exact steps for that.
ABOhiccups wrote:
http://localhost:2368/ghost does nothing. I'm using PC.
Chris wrote:
Thanks for trying that, ABOhiccups. The result makes sense: localhost means "this device", so http://localhost:2368/ghost only reaches Ghost on the machine where SparkBox is actually running. If SparkBox runs on another computer, a NAS or a mini PC, your PC cannot reach Ghost at localhost, and right now the Ghost admin page only opens from the SparkBox machine itself. There is no setting that changes this yet. So the next thing I need is where SparkBox lives. Is it running on this PC (inside WSL or Docker Desktop), or on a different machine? Reply with that and I will give you the exact next steps for your setup.
ABOhiccups wrote:
MS-A2 at Home as a server. There's no desktop. Just a terminal.
Chris wrote:
Thanks, ABOhiccups. A terminal is all we need for the next step. I owe you a correction. I said earlier that no SparkBox setting changes this address, and that was incomplete. I'm sorry for the back-and-forth it caused. There is an advanced option, and I will give you the exact steps once we confirm the address. What is happening: Ghost was set up to accept visits only at http://localhost:2368, which means "this machine". Your PC's localhost points at your PC, so that result was expected. Ghost refuses visits from any other address, which is why the page shows the error you saw. One check, on the MS-A2 terminal, run: hostname -I It prints one or more addresses. Note the one your PC is on the same network as, usually one starting with 192.168. or 10. Skip any that start with 172. Then, on your PC, open http://THAT-ADDRESS:2368/ghost, replacing THAT-ADDRESS with the one you noted. Expected: the same "incorrect origin" error. That means your PC reaches Ghost and only the address needs changing. If the page does not load at all, tell me that instead. Reply with the address and what the PC showed. What I know about Ghost addresses has been corrected, so the next person does not get the same answer.
Chris wrote:
Here are the exact steps, ABOhiccups. You don't need to send me the address first: the error already shows it. It is the address after "received", without /ghost on the end, for example http://192.168.1.50:2368. Use yours wherever you see that one below. On the MS-A2 terminal: 1. Tell Ghost its address. This adds a small settings file that SparkBox keeps across updates: sudo mkdir -p /opt/sparkbox/state/overrides printf 'services:\n ghost:\n environment:\n - url=http://192.168.1.50:2368\n' | sudo tee /opt/sparkbox/state/overrides/ghost.yml 2. Restart Ghost with it: sudo sparkbox up ghost 3. On your PC, open http://192.168.1.50:2368/ghost and sign in. Ghost accepts sign-ins from one address only. After this, the home-network address works for the admin page and the www domain does not. If you would rather use the domain, wait for the next SparkBox update. It adds a Ghost address setting, and sudo sparkbox doctor will print the address Ghost refused and the exact command to set it. On today's version a https domain address makes Ghost's health check fail, so I would not use it yet. One more thing. Ghost 6 sends a sign-in code by email when you sign in later from a new browser. SparkBox does not set up Ghost's email yet, so that code may never arrive. Once you are in, stay signed in on your PC rather than signing out. If Ghost says it could not send an email when you sign in at step 3, reply with that and I'll take it from there.