By using this site, you agree to have cookies stored on your device, strictly for functional purposes, such as storing your session and preferences.

Dismiss

Encode commit ID to prevent harvesters from getting it

roundabout,
created on Friday, 26 April 2024, 05:46:26 (1714110386), received on Wednesday, 31 July 2024, 06:54:46 (1722408886)
Author identity: vlad <vlad.muntoiu@gmail.com>

9db3f77a3b1117188ebad0620ceb123482ef8420

jinja_utils.py

@@ -50,6 +50,11 @@ def parse_diff_location(value: str):

                                
                                
                                
                            
                                
                                    
                                        
                                            
                                                return [tuple(int(j) for j in i.lstrip("-+").split(",")) for i in header.split(" ")]
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                            
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                            
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                        @app.template_filter("harvester_protection")
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                        def harvester_protection(value):
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            return "".join(f"&#x{ord(char):x};" for char in value)
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                        
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                        
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                            @app.template_filter("sort")
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                            def sort(value):
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                                return sorted(value)
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                            
                                

templates/repository/repo-commit.html

@@ -23,7 +23,7 @@

                                
                                
                                
                            
                                
                                    
                                        
                                            
                                                                received on {{ receive_date }} ({{ receive_unix }})
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                                            {% endtrans %}
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                                            <br>
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                                        {% trans %}Author identity:{% endtrans %} <code>{{ data.owner_identity }}</code>
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                                        {% trans %}Author identity:{% endtrans %} <code>{{ data.owner_identity | harvester_protection | safe }}</code>
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                                        </p>
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                            
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                                        <code>{{ data.sha }}</code>