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 في المستقبل؟ بصفتي مطورًا، فإن المسارات المطلقة عادةً ما تثير في نفسي القلق. كما أن هناك مسألة الانتقال من http: إلى https:، وهو ما قمنا به أيضًا (أو على الأقل فرضناه بشكل أكثر صرامة) كجزء من الهجرة المذكورة أعلاه. يبدو أن هذا يشبه إلى حد كبير حالة الاستخدام التي أشار إليها @mreach.
كما هو معتاد، جزيل الشكر لفريق Discourse على هذا المنتج الرائع. ر.