How can I get Discourse to generate relative URLs for uploaded images?
I have a site that is available over HTTPS and a TOR .onion and I need a way to get images working for both.
How can I configure Discourse so that upload:// URLs are converted to relative URLs in the <img> tag? Where (which source file) does this URL generation take place?
Uploading works correctly both from the HTTPS domain and the TOR hidden service .onion but the actual HTML generated for a post uses a full URL which is a problem.
I’m assuming somewhere there is some code that does something like
This would require some internal changes, I am somewhat sympathetic cause it makes life a bit easier when changing domain names for sites that do not use A CDN.
Would have to be something like, IF no CDN configured then cook a relative url.
그리고 저희의 새로운 호스팅 제공업체 Communiteq(구 DiscourseHosting)은 이 변경 사항을 반영하기 위해 저희 데이터베이스를 sed 명령으로 처리해 주셨습니다.
현재 상태에 대해 기술적인 이유가 있을까요? 미래에 %{THIS}/t/000과 같은 것을 사용할 수 있을까요? 개발자로서 절대 경로(absolute paths)는 보통 저를 긴장하게 만듭니다. 또한, aforementioned 마이그레이션의 일부로 저희가 수행한(또는 적어도 더 엄격하게 적용한) http:에서 https:로의 전환 문제도 있습니다. 이는 @mreach의 사례와 매우 유사해 보입니다.