| 1911 | |
| 1912 | |
| 1913 | def _read_env_file_values(env_path: Path) -> dict: |
| 1914 | values = {} |
| 1915 | if not env_path.exists(): |
| 1916 | return values |
| 1917 | try: |
| 1918 | for raw_line in env_path.read_text(encoding="utf-8").splitlines(): |
| 1919 | line = raw_line.strip() |
| 1920 | if not line or line.startswith("#") or "=" not in line: |
| 1921 | continue |
| 1922 | key, value = line.split("=", 1) |
| 1923 | key = key.strip() |
| 1924 | value = value.strip().strip('"').strip("'") |
| 1925 | if key: |
| 1926 | values[key] = value |
| 1927 | except Exception: |
| 1928 | print("[!] File .env presente ma non leggibile. Verifica permessi e formato.") |
| 1929 | return values |
| 1930 | |
| 1931 | |
| 1932 | def _is_valid_fernet_key(raw_value: str) -> bool: |