All of our traffic goes through CloudFront, and static content is fetched by CloudFront from one of several S3 buckets.
With uploads being sent to S3, Discourse embeds the content with a generic bucket URL despite our having s3 cdn url set. Once submitted, posts appear to use the correct URL set in s3 cdn url, although this may also be because we have DISCOURSE_CDN_URL set as well (both are set to the same URL).
The post preview window references the standard S3 URL seen in the unbaked post, though. This is a problem because we use a private ACL on files uploaded to our Discourse uploads bucket, as content on this bucket should never be accessed outside of CloudFront. The result is a broken image in the preview window.
Pour moi, il semble « cassé » qu’il utilise l’URL CDN dans un cas et pas dans l’autre, et cela impose une configuration S3 que AWS recommande en fait d’éviter (ACL publique pour un bucket S3).
Je suis nouveau dans le projet Discourse en général, mais je peux certainement travailler sur une PR.
Cela pourrait valoir la peine d’être corrigé dès maintenant : AWS prend de plus en plus au sérieux l’information des utilisateurs concernant les ACL de lecture publique.
Conformément au récent changement, nous récupérons désormais l’URL du fichier téléchargé directement à partir de la requête de téléchargement initiale. Auparavant, nous la recevions via le point de terminaison /uploads/lookup-urls.json. Ce commit devrait résoudre le problème.
Cela concerne également les pièces jointes manquantes, telles que les exports de données ou tout autre fichier joint. Ceux-ci proviennent toujours de S3.