Using Object Storage for Uploads (S3 & Clones)

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

2 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!

You can have a look at the javascript console. My guess is they either the CDN is wrong or they you didn’t get the precompile assets part right.

https://community.itechguides.com/ is working now:

image

If it’s not working for you try a hard reload and/or an incognito window.

2 Likes

The site opened for you because as of when you opened it, I had commented out the following lines from the app.yml file:

DISCOURSE_USE_S3: true
DISCOURSE_S3_REGION: nyc3
DISCOURSE_S3_ENDPOINT: https://nyc3.digitaloceanspaces.com
DISCOURSE_S3_ACCESS_KEY_ID: accesskey
DISCOURSE_S3_SECRET_ACCESS_KEY: secretkey
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

I just re-enabled the lines and rebuilt the container. Now, the site is showing a blank page again!

The screenshot below shows where I placed the codes in my app.yml. As you can see, I placed the S3 configuration codes below DISCOURSE_NOTIFICATION_EMAIL


a

1 Like