Nattiden 2 лет назад
Родитель
Сommit
dc4448da1c

+ 1 - 0
Project/configs/update.yml

@@ -0,0 +1 @@
+process.update.github: True

+ 1 - 1
Project/libraries/Homepage/addressCard.xaml

@@ -8,7 +8,7 @@
       <local:MyTextBox x:Name="jumpbox" Height="30" />
         <local:MyButton HorizontalAlignment="Center" Width="80"
             Grid.Column="1" Text="打开→" EventType="打开帮助" 
-            EventData="{Binding Path=Text,ElementName=jumpbox,StringFormat=https://news.bugjump.net/{0}.json}"/>
+            EventData="{Binding Path=Text,ElementName=jumpbox,StringFormat=https://${domain}/{0}.json}"/>
     </Grid>
     </StackPanel>
 </local:MyCard>

+ 1 - 1
Project/libraries/Homepage/goToVer.xaml

@@ -8,7 +8,7 @@
       <local:MyTextBox x:Name="toverbox" Height="30" />
         <local:MyButton HorizontalAlignment="Center" Width="80"
             Grid.Column="1" Text="打开→" EventType="打开帮助" 
-            EventData="{Binding Path=Text,ElementName=toverbox,StringFormat=https://news.bugjump.net/VersionDetail.json?ver={0}}"/>
+            EventData="{Binding Path=Text,ElementName=toverbox,StringFormat=https://${domain}/VersionDetail.json?ver={0}}"/>
     </Grid>
     </StackPanel>
 </local:MyCard>

+ 1 - 1
Project/libraries/Homepage/jumpCard.xaml

@@ -16,7 +16,7 @@
       </local:MyComboBox>
         <local:MyButton HorizontalAlignment="Center" Width="80"
             Grid.Column="1" Text="打开→" EventType="打开帮助" 
-            EventData="{Binding Path=Text,ElementName=jumpbox,StringFormat=https://news.bugjump.net/{0}.json}"/>
+            EventData="{Binding Path=Text,ElementName=jumpbox,StringFormat=https://${domain}/{0}.json}"/>
     </Grid>
     </StackPanel>
 </local:MyCard>

+ 2 - 1
Project/libraries/__LIBRARY__.yml

@@ -2,4 +2,5 @@ name: rootlibrary
 fill:
   canswap: true
   s: true
-  isswaped: ${s}
+  isswaped: ${s}
+  domain: ${@public_conf|domain|news.bugjump.net}

+ 8 - 0
Project/modules/CheckDomainSafety.py

@@ -0,0 +1,8 @@
+from homepagebuilder.interfaces import config
+from homepagebuilder.interfaces.Events import on, ResultOverride
+
+@on('page.generate.start')
+def script(_page,env):
+    if mod_domain := env.setter.override.get('domain'):
+        if mod_domain not in config('safe_domains',['news.bugjump.net']):
+            raise ResultOverride('')