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

DigitalOcean Spaces Installation (+ Problem with installation) #16

Open
mciszczon opened this issue Mar 20, 2024 · 2 comments
Open

DigitalOcean Spaces Installation (+ Problem with installation) #16

mciszczon opened this issue Mar 20, 2024 · 2 comments

Comments

@mciszczon
Copy link

Hi there! Thanks for forking the original adapter and maintaining it.

I have a Ghost blog on DigitalOcean and wanted to connect it with its Spaces for storage. After some tinkering I finally adapted the installation instructions and wanted to share it for anyone (myself included) in the future. If you're interested in adding it to the README file, I can make a quick PR for that.

Here's what worked for me:

{
  "storage": {
    "active": "s3",
    "media": {
      "adapter": "s3"
    },
    "files": {
      "adapter": "s3"
    },
    "s3": {
      "accessKeyId": "...",
      "secretAccessKey": "...",
      "region": "<REGION_NAME like fra1>",
      "bucket": "<BUCKET_NAME>",
      "assetHost": "<CDN_ENDPOINT>",
      "pathPrefix": "<ANYTHING_YOU_LIKE>",
      "endpoint": "https://<REGION>.digitaloceanspaces.com"
    }
  }
}

Not sure if the region param is required though, so I added it for the sake of explicitness. One tricky part is that the endpoint param has to have the bucket name omited, as it is added automatically from the bucket param. I did not check if it would work by adding the bucket name straight into the endpoint URL and just removing the bucket param from the config.

Also, when I tried to install the adapter into the /content/adapters/storage/s3 as instructed, it wouldn't get picked up by Ghost on startup. It worked, hovewer, when I installed it into /current/core/server/adapters/storage/s3—not sure why.

Node: v18.19.0
Ghost-CLI: 1.25.3
Ghost: 5.76.0 (at /var/www/ghost)

@laosb
Copy link
Owner

laosb commented Mar 22, 2024

region is only supposed to be present when using AWS endpoint I think.

Also, when I tried to install the adapter into the /content/adapters/storage/s3 as instructed, it wouldn't get picked up by Ghost on startup. It worked, hovewer, when I installed it into /current/core/server/adapters/storage/s3—not sure why.

I don't recognize /current/core/server/ part of the path though. Where did you get the idea of this?

@mciszczon
Copy link
Author

I don't recognize /current/core/server/ part of the path though. Where did you get the idea of this?

current is just a symlink to the currently installed version of Ghost.

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

2 participants