fission-codes / heroku-ipfs-ghost

The Ghost blog system upgraded with Heroku deploys & IPFS support.
MIT License
15 stars 17 forks source link

WIP:Fission addon #11

Closed MCTaylor17 closed 4 years ago

MCTaylor17 commented 4 years ago

Adds the Fission Heroku addon:

Resolves #8

WIP:

Currently failing to add images with a 401 response:

app[web.1]: [2019-12-11 08:00:51] ERROR "POST /ghost/api/v3/admin/images/upload/" 500 364ms
app[web.1]: Request failed with status code 401

Will need to troubleshoot by logging from the ghost adapter (consider adding a "logging mode" to the adapter)

MCTaylor17 commented 4 years ago

Found a more verbose error that occurs on storage adapter init which attempts fissionUser.cids() in a try/catch block:

{
  "message": "Request failed with status code 401",
  "name": "Error",
  "stack": "Error: Request failed with status code 401\n    at createError (/app/node_modules/@fission-suite/client/node_modules/axios/lib/core/createError.js:16:15)\n    at settle (/app/node_modules/@fission-suite/client/node_modules/axios/lib/core/settle.js:17:12)\n    at IncomingMessage.handleStreamEnd (/app/node_modules/@fission-suite/client/node_modules/axios/lib/adapters/http.js:237:11)\n    at IncomingMessage.emit (events.js:215:7)\n    at IncomingMessage.EventEmitter.emit (domain.js:475:20)\n    at endReadableNT (_stream_readable.js:1184:12)\n    at processTicksAndRejections (internal/process/task_queues.js:80:21)",
  "config": {
    "url": "https://runfission.com/ipfs/cids",
    "method": "get",
    "headers": {
      "Accept": "application/json, text/plain, */*",
      "User-Agent": "axios/0.19.0"
    },
  "auth": {
    "username": "f607890b6feb94e4e5e5",
    "password": "GubsARTBTUj-PXPoshdN9sntA.1TK,+6jnYG)0cpUmp5R8EXMi7CKr9RWOk"
  },
  "transformRequest": [
    null
  ],
  "transformResponse": [
    null
  ],
  "timeout": 0,
  "xsrfCookieName": "XSRF-TOKEN",
  "xsrfHeaderName": "X-XSRF-TOKEN",
  "maxContentLength": -1
  }
}

[Woops... Leaked user/pass... I guess we'll need to burn this account now 🤦‍♂]

Edit: I tried manually logging-in through the CLI and got an authentication failure...

bmann commented 4 years ago

It’s almost certainly because it’s “quoted” and the generated password has characters that are interpreted.

I have to troubleshoot this with curl today, I’ve seen the same thing before.

Please generate some credentials with the CLI that work locally and edit the config vars in The Heroku dashboard to test.

bmann commented 4 years ago

I'm merging this so I can test this with known good credentials.