Using DigitalOcean Spaces or Amazon S3 for file storage in XF 2.x

Using DigitalOcean Spaces or Amazon S3 for file storage in XF 2.x

No permission to download

Chris D

XenForo developer
Staff member
You should remove or comment out the code you added to the config file to ensure it is properly disabled.

You can comment it out by adding two forward slashes // at the start of each line of code you do not want to run.
 

ShinLim

Member
You should remove or comment out the code you added to the config file to ensure it is properly disabled.

You can comment it out by adding two forward slashes // at the start of each line of code you do not want to run.
Oh I see, I thought just Enable/Disable with one click like other add-ons, so this isn't a bug? So should you write a simple note in Overview add-on's page for everyone knows how to Enable/Disable properly ?
 

FinHeaven

Member
Any idea about how to get the images from posts to go to S3? When uploading image it stays local, adding an image by attach files it correctly goes to S3.
 

Sperber

Well-known member
Chris, thanks for this piece of awesomness.

Has anyone an ideo, how to use DigitalOcean with a subdomain , while using cloudflare and Lets encrypt ? My setting is Host (Lets encrypt) <--> Cloudflare (Cloudflare wildcard certificate) <--> DigitalOcean, DNS is handled via Cloudflare. DigitalOcean of course is refusing the connection to cloudflare, since I can´t add the cloudflare certificate to Digitaloceans settings and so it´s complaining about an invalid certificate.
 

ShinLim

Member
Chris, thanks for this piece of awesomness.

Has anyone an ideo, how to use DigitalOcean with a subdomain , while using cloudflare and Lets encrypt ? My setting is Host (Lets encrypt) <--> Cloudflare (Cloudflare wildcard certificate) <--> DigitalOcean, DNS is handled via Cloudflare. DigitalOcean of course is refusing the connection to cloudflare, since I can´t add the cloudflare certificate to Digitaloceans settings and so it´s complaining about an invalid certificate.
I'm using subdomain through DigitalOcean
You need to run CLI command to create SSL wildcard for domain, and you need to verify TXT record while doing that, after that you'll get a fullchain.pem and prikey.pem, open that 2 files and and copy it, go into DO space and go to CDN setting, edit it and add new subdomain certificate, paste 2 files you were copied, and then you're done
Don't forget to create CNAME Record in your cloudflare to point it to DO space (Example: abc.ams3cdn.digitaloceanspaces.com)
 

Sperber

Well-known member
I'm using subdomain through DigitalOcean
You need to run CLI command to create SSL wildcard for domain, and you need to verify TXT record while doing that, after that you'll get a fullchain.pem and prikey.pem, open that 2 files and and copy it, go into DO space and go to CDN setting, edit it and add new subdomain certificate, paste 2 files you were copied, and then you're done
Don't forget to create CNAME Record in your cloudflare to point it to DO space (Example: abc.ams3cdn.digitaloceanspaces.com)
Thanks for your reply. Are you proxying your subdomain through cloudflare with a cloudflare wildcard cert or are you only pointing the subdomain in the cloudflare CNAME entry to DO, without proxying?
 

Chris D

XenForo developer
Staff member
Of course it does.

The whole point of this is that XF 2.x has an abstracted file system. As long as developers use the abstracted file system (which, of course, we do in all of our products) then any file storage adapter that you enable, such as DO Spaces / S3, will work with almost all file storage operations the forum uses.
 

ShinLim

Member
Thanks for your reply. Are you proxying your subdomain through cloudflare with a cloudflare wildcard cert or are you only pointing the subdomain in the cloudflare CNAME entry to DO, without proxying?
I'm using with proxying through cloudflare
 

mcatze

Well-known member
@Chris D i use XFMG 2.1.4, but all files within www.domain.com/media/xxx doesn't provide via S3. Just the videos and the thumbnails.
 

Chris D

XenForo developer
Staff member
Full size image media will be hosted on S3 but streamed via an internal URL (this is how all attachment URLs in XF work as it allows us to take care of permissions).
 

RastaLulz

Well-known member
Has anyone successfully used this on XF 2.0, and then upgraded to XF 2.1?

I merged the XF 2.1 files into my install, updated to the XF 2.1 version of this add-on, removed autoloading for AWS SDK from config.php, and then went to install/index.php?upgrade/, but get a fatal error:
Code:
Error: Class 'League\Flysystem\AwsS3v3\AwsS3Adapter' not found in src/config.php at line 27
 
Top