Self-hosted Mender - Config for Amazon CloudFront?

Has anybody got self-hosted Mender working with Amazon CloudFront?

I have S3 setup OK with
DEPLOYMENTS_AWS_URI: https://s3.eu-central-1.amazonaws.com
I can upload artifacts via the UI no problem.

However I would like deployments to download from a CloudFront URL like
https://d2cj8bq76uwdq0.cloudfront.net

I could not find a config variable for setting the download url.

Is there any way to do this?

thanks
–Will

The Mender server utilizes S3 API to generate a presigned Object URL, and this URL is provided to the client.

As far as I know there is no configuration option to tell the client to use a cloudfrount URL, but it is also unclear to me if it even would work with presigned Object URLs if there was.

It seems that it would be possible (quick internet search :slight_smile: ),

Hi @will ,

Have you got it to work?

In my case, Mender prefixed the bucket name to the external URL. Do you know how to get rid of it by any chance?

Unfortunately, Mender will always try to inject the bucket name in the URL, either in the hostname or the path segment of the URL depending on the value of the DEPLOYMENTS_AWS_FORCE_PATH_STYLE config option.
Although I haven’t tried it myself, you could try to use path-style URL and setup a redirect rule for your bucket that strips the bucket name from the key prefix. I’m not sure how Cloudfront will deal with the redirect though.