Why iDrive's S3 endpoint is being rejected by Discourse?

What format is needed by it?
Or the very first option in the screen shot only allows Amazon Aws S3??

Does it work if you just put in the hostname?

1 Like

You mean I just fill (https://)idrivee2-51.com in S3 CDN url?
No, it too gave same error.

Do you have trailing spaces?

2 Likes

Looking at the validator, it’s:

  s3_endpoint:
    default: ""
    regex: '^https?:\/\/.+[^\/]$'

so checking the value you put in shows it’s perfectly fine:

[1] pry(main)> 'https://b1v7.or.idrive2-51.com'.match /^https?:\/\/.+[^\/]$/
=> #<MatchData "https://b1v7.or.idrive2-51.com">

You evidently have something wrong in the field. As @pfaffman suggests, check for spaces.

If it still doesn’t work, does it work from the rails console?

I would expect this to fail:

[1] pry(main)> SiteSetting.s3_endpoint = 'gopher://b1v7.or.idrive2-51.com'
Discourse::InvalidParameters: s3_endpoint: Value doesn't match the required format.
from /home/michael/prog/Discourse/discourse/lib/site_settings/type_supervisor.rb:288:in `validate_value'

but this should work:

[1] pry(main)> SiteSetting.s3_endpoint = 'https://b1v7.or.idrive2-51.com'
=> "https://b1v7.or.idrive2-51.com"
2 Likes

No. Not at all.

But I’m surprised that today it took the same value, which it wasn’t taking till now (at all times, I was just copying with the ‘copy’ button from idrive site, and pasting here, and today also did the same).

And, now also, I think it sometimes refuses to accept a value, which it was a moment ago.
But all in all, I’m sorted on this point now.

Thanks, its sorted now.

But pls tell, what do I fill in (or make it blank) the S3 CDN url field?
It has this value from earlier/aws times filled already: https://bhdisco.s3.ap-south-1.amazonaws.com/uploads

You really want to put a cdn on the cdn field. You can put the bucket url, but it’ll cost more and be slower.

1 Like

Ok. I got it.
But it all feels so cumbersome, I better go with the recommended S3 bucket provider only, AWS !! So I again reinstated the Aws id and secret.

But in doing so, I faced a new hurdle. Even though I didn’t change even a small thing inside Aws interface, except making my login more stricter, now the media uploads done into it are visible in my website only if I turn on ‘Read’ access for all ‘Public’.
I don’t know how it was working earlier, and why only now I have to make my bucket contents ‘Permissions’ this way:

( Both showing in red color have been changed by me now, otherwise I’m not able to even preview my own uploads)

If you haven’t configured a CDN in front of your bucket store, leave it blank.

2 Likes