CloudStorage Setup - solved


#1

Hi,

This is my first post, so let me first say that I so far love Cockpit, love the clean and simple UI.

I am currently trying to add S3 support to my Cockpit installation. I followed the CloudStorage addon instruction and should have set everything up correctly. However when I upload files they are still uploaded to the server cockpit is hosted on instead of S3…

Now there might be some stupid little thing I am missing, therefore my question: How do I get this uploading to the S3 Bucket? :slight_smile: I hope someone can help me with this, as S3 Support would be an awesome feature to use.

Thank you very much in advance!


#2

do you get any errors where are the files uploaded then if not?


#3

Hmm no I can’t find any error messages…

I have set up config/config.yaml as follows:

# AWS S3

cloudstorage:
    assets:
        type: s3
        key: ...key...
        secret: ...secretKey...
        region: eu-central-1
        bucket: cc-cp

        # optional
        prefix: uploads
        url: https://s3.eu-central-1.amazonaws.com

And when uploading in a collection via “image” the image url is set to ‘/image.jpeg’ and the file is uploaded to the root directory of the website… Also when checking the img url in the API-response there is no link to the s3 bucket.


#4

maybe you’re missing the right permissions on s3 :thinking:


#5

I redid the whole installation with a new IAM user with s3 permissions. Unsurprisingly no difference there sadly.

But I have however found that it does upload to s3 when uploading the image as an asset instead of a thumbnail. Maybe I am missing something there.

None the less it is uploading to s3 now and that is exactly what I wanted :smiley: I’ll just have to remember to upload images as assets, and then they should be uploaded to s3 :slight_smile:

Thank you very much for the quick response and the awesome CMS!


#6

Hey there, I’m having a similar problem to this. I have it set up, but when I upload as an asset, it appears to run into a problem. I triple-checked the setup and have tried multiple keys and buckets, but keep running into an error that states “Something went wrong.” The files go into the tmp folder but don’t actually upload.

My file looks like this, by the way:

cloudstorage:
    assets:
        type: s3
        key: …key…
        secret: …secretKey…
        region: us-east-1
        bucket: tedium-cdn
        prefix: uploads

(If it helps, I’m running an AMPPS install on localhost.)

Any help would be appreciated of course. :slight_smile:


#7

@ernie do you have access to the php error log files?


#8

I do, but the file is blank (trying to figure out what the problem is there). The Apache error logs show errors related to other plugins. (I also was trying the Hugo add-on, and that’s showing errors, but not this. Ironically, that plugin mostly works.)


#9

Update: I tried running this on a Docker install and that seemed to do the trick; not sure what about AMPPS made it go nuts. In case it helps anyone—this plugin also works with imgix.