Kaynağa Gözat

append yunohost sso and icon after page

Solves https://codeberg.org/flohmarkt/flohmarkt_ynh/issues/71 by not including `conf.d/yunohost_panel.conf.inc` and instead copying the filter rule to flohmarkt.conf. The filter rule is changed to append yunohost sso and icon at the end of the page which is compatible to flohmarkts javascript code.
Chris Vogel 1 yıl önce
ebeveyn
işleme
e058f139e3
1 değiştirilmiş dosya ile 9 ekleme ve 3 silme
  1. 9 3
      conf/nginx.conf

+ 9 - 3
conf/nginx.conf

@@ -20,8 +20,14 @@ location __PATH__/ {
   proxy_read_timeout 300;
   proxy_connect_timeout 300;
 
-  # Include SSOWAT user panel.
-  include conf.d/yunohost_panel.conf.inc;
-  more_clear_input_headers 'Accept-Encoding';
+  # Don't include SSOWAT user panel - breaks flohmarkt pages
+  # include conf.d/yunohost_panel.conf.inc;
 
+  # Instead try to put yunohost button + portal overlay at the end of body
+  sub_filter </body> '</body><script type="text/javascript" src="/ynh_portal.js"></script><link type="text/css" rel="stylesheet" href="/ynh_overlay.css"><script type="text/javascript" src="/ynhtheme/custom_portal.js"></script><link type="text/css" rel="stylesheet" href="/ynhtheme/custom_overlay.css">';
+  sub_filter_once on;
+  # Apply to other mime types than text/html
+  sub_filter_types application/xhtml+xml;
+  # Prevent YunoHost panel files from being blocked by specific app rules
+  location ~ (ynh_portal.js|ynh_overlay.css|ynh_userinfo.json|ynhtheme/custom_portal.js|ynhtheme/custom_overlay.css) {
 }