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

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