Configure an S3 compatible object storage provider for uploads

Would love to say your post is the best.

1 Like

I found the problem, is that Oracle Object Storage, uses path style.

And Discourse doesn’t give me the option to use path style, it wants to force me to use virtual host style.

I wish I could choose that.

Even the minio has to be configured to suit the virtual host style.

1 Like

Considering that every major cloud provider supports virtual host style (even MinIO) we have no plans on adding support for the deprecated path style feature.

3 Likes

This isn’t the first time I remember your stating that. Maybe add that to the OP and explicitly say that Oracle Object Storage isn’t supported until they support virtual host style.

3 Likes

The above explanation is reasonable, but it should be made clearer that any provider that is not using the Virtual Host Style standard is not supported.

Despite having this in some points it is not very clear.

I had to do some testing to find out.

1 Like

Which service did you try that did not work? Then we can add it to the list in the start post.

3 Likes

I tried with Oracle Object Storage

They are still using “path style” and that’s why it didn’t work.

1 Like

I just configured S3 backup using DigitalOcean Space. When I finished adding the information my * app.yml file and successfully running ./launcher rebuild app when I tried the rebake command, rake posts:rebake, I receive an error message that rake cannot be found.

Please help! I am stuck!

1 Like

Before you enter the rake command you’d

 ./launcher enter app

You might do a rebuild html on a post from the UX first to make sure it’s working.

1 Like

Thanks @pfaffman. I did run the command:

./launcher enter app

before I ran the rebake command.

You also said “You might do a rebuild html on a post from the UX first to make sure it’s working.”

I don’t know how to do this as I am new to Discourse. Would you mind providing me the steps to do this?

1 Like

Since the guide here does not specify, after entering these details to app.yml, and running the necessary command, do I still need to configure the settings in Settings → File and Settings → Backup?

1 Like

Hi Victor,
on your site, clicking on the three dots (the ellipsis) you’ll find the wrench and there rebuild html

3 Likes

No. Putting the settings in env variables overrides the ability to see it change then in the ux

1 Like

Thanks, @Benjamin_D. I will do this shortly.

2 Likes

Thanks for your help.

I have successfully completed the S3 backup config (or so I think!). But when I run backup, it runs successfully.

However, my DigitalOcean Space bucket has no files in them!

1 Like

Here is my configuration. I did not include my access and secret keys for obvious reasons!

  after_assets_precompile:
    - exec:
        cd: $home
        cmd:
          - sudo -E -u discourse bundle exec rake s3:upload_assets
DISCOURSE_USE_S3: true
DISCOURSE_S3_REGION: NYC3
DISCOURSE_S3_ENDPOINT: nyc3.digitaloceanspaces.com
DISCOURSE_S3_ACCESS_KEY_ID: myaccesskey
DISCOURSE_S3_SECRET_ACCESS_KEY: mysecretkey
DISCOURSE_S3_CDN_URL: https://community-cdn.itechguides.com
DISCOURSE_S3_BUCKET: itg-community-files
DISCOURSE_S3_BACKUP_BUCKET: itg-community-files/backups
DISCOURSE_BACKUP_LOCATION: s3
1 Like

All of those DISCOURSE*: x lines go further up in the file in the section that starts with env:, like right under the SMTP stuff.

4 Likes

Wao! Let me move the files now and test.

Should I also move the script below?

after_assets_precompile:
- exec:
cd: $home
cmd:
- sudo -E -u discourse bundle exec rake s3:upload_assets

1 Like

That section is its own stanza so it doesn’t matter where it goes (except in the middle of another one).

1 Like

Thanks so much @pfaffman! I have just added those files in the relevant places and after rebuilding the container, my site is down displaying a blank page!