Adding a storage-adapter in ghost
-
I am using ghost to blog. I prefer the interface over working with Wordpress. The interface, including the templates is clean and easy to use.
Since the team over at ghost decided not to build a media-manager, I prefer to not upload my media to the ghost installation itself, but to something externally.
Luckily ghost offers storage adapters for that. Sadly enough, most of them are outdated. Not even sure, they work.
The ones I found to be recent are:
The last one has been released just recently. That's great as it is cheap (starts at 1 USD / month) and has a built-in cdn, to allow for even faster page-speeds.
According to the documentation one has to add the relevant code at
content/adapters/storage
to make the adapter available.Then, one has to add a snippet to the configuration, according to the documentation.
So, using the Cloudron file manager, it was quite easy to achieve:
- Add the folder
storage
underneath/content/adapters
- Upload the required files to said folder
- Update the config-file, according to the documentation
- Restart the app
Done.
My question to make that process a bit easier: Could we package up the storage-adapters to the ghost-base image to save the first two steps here?
Hope this helps as a guide, as well as a starting point for discussion
- Add the folder
-
-
As @robi said, Surfer might be a good option btw. All our screenshots are hosted on https://screenshots.cloudron.io, for example, which is just a surfer instance.
But to answer the original question, the danger (for us) of adding these modules to the base package is that users might start to rely on them and expect us (the packagers) to somehow maintain this. Like if we bundle some s3 adapter and that adpater becomes unmaintained, removing this will cause unnecessary heartache for all involved. It's best if users understand that they are using some 3rd party thing that is not "supported" directly by the upstream app Ghost.
-
If you are in the market, you can submit a PR to update the Ghost docs at https://docs.cloudron.io/apps/ghost/ . You have to add it to https://git.cloudron.io/cloudron/docs/-/blob/master/knowledgebase/docs/apps/ghost.md?ref_type=heads . Thanks!
-
I actually have a problem to get any storage adapter to work:
Dec 15 16:49:03==> Ensure permissions Dec 15 16:49:03==> Migrating database Dec 15 16:49:04=> Healtheck error: Error: connect ECONNREFUSED 172.18.17.69:2368 Dec 15 16:49:04[2023-12-15 22:49:04] INFO Finished database init! Dec 15 16:49:05[2023-12-15 22:49:05] INFO Finished database migration! Dec 15 16:49:05==> Starting Ghost Dec 15 16:49:05[2023-12-15 22:49:05] INFO Ghost is running in production... Dec 15 16:49:05[2023-12-15 22:49:05] INFO Your site is now available on https://whatever/ Dec 15 16:49:05[2023-12-15 22:49:05] INFO Ctrl+C to shut down Dec 15 16:49:05[2023-12-15 22:49:05] INFO Ghost server started in 0.423s Dec 15 16:49:06[2023-12-15 22:49:06] INFO Database is in a ready state. Dec 15 16:49:06[2023-12-15 22:49:06] INFO Ghost database ready in 0.705s Dec 15 16:49:07[2023-12-15 22:49:07] ERROR Unable to find storage adapter s3 in ,/app/data/content/adapters/,/home/cloudron/ghost/versions/5.75.2/core/server/adapters/. Dec 15 16:49:07 Dec 15 16:49:07Unable to find storage adapter s3 in ,/app/data/content/adapters/,/home/cloudron/ghost/versions/5.75.2/core/server/adapters/. Dec 15 16:49:07 Dec 15 16:49:07Error ID: Dec 15 16:49:0727753420-9b9c-11ee-acce-d91d06239c3f Dec 15 16:49:07 Dec 15 16:49:07---------------------------------------- Dec 15 16:49:07 Dec 15 16:49:07IncorrectUsageError: Unable to find storage adapter s3 in ,/app/data/content/adapters/,/home/cloudron/ghost/versions/5.75.2/core/server/adapters/. Dec 15 16:49:07at AdapterManager.getAdapter (/home/cloudron/ghost/versions/5.75.2/node_modules/@tryghost/adapter-manager/lib/AdapterManager.js:128:19) Dec 15 16:49:07at Object.getAdapter (/home/cloudron/ghost/versions/5.75.2/core/server/services/adapter-manager/index.js:31:31) Dec 15 16:49:07at Object.getStorage (/home/cloudron/ghost/versions/5.75.2/core/server/adapters/storage/index.js:14:27) Dec 15 16:49:07at setupSiteApp (/home/cloudron/ghost/versions/5.75.2/core/frontend/web/site.js:85:71) Dec 15 16:49:07at module.exports (/home/cloudron/ghost/versions/5.75.2/core/server/web/parent/frontend.js:22:58) Dec 15 16:49:07at initExpressApps (/home/cloudron/ghost/versions/5.75.2/core/boot.js:248:68) Dec 15 16:49:07at bootGhost (/home/cloudron/ghost/versions/5.75.2/core/boot.js:515:32) Dec 15 16:49:07 Dec 15 16:49:07[2023-12-15 22:49:07] WARN Ghost is shutting down Dec 15 16:49:07[2023-12-15 22:49:07] WARN Ghost has shut down Dec 15 16:49:07[2023-12-15 22:49:07] WARN Your site is now offline Dec 15 16:49:07[2023-12-15 22:49:07] WARN Ghost was running for a few seconds Dec 15 16:49:17=> Healtheck error: Error: Timeout of 7000ms exceeded Dec 15 16:49:27=> Healtheck error: Error: Timeout of 7000ms exceeded
The configuration is as per documentation on each adapter. Location of all adapters are:
content/adapters/storage/s3
. Tried different locations, though.Anyone has an idea?