use pydantic v2
This commit is contained in:
		@@ -31,7 +31,7 @@ def write_wg(config: Config):
 | 
			
		||||
 | 
			
		||||
def get_config() -> Optional[Config]:
 | 
			
		||||
    with open("/snacks/wireguard/wg.json", "r", encoding="utf-8") as f:
 | 
			
		||||
        config = Config.parse_raw(f.read())
 | 
			
		||||
        config = Config.model_validate_json(f.read())
 | 
			
		||||
        config.host = socket.gethostbyname(config.host)
 | 
			
		||||
        return config
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user