mirror of
https://github.com/chatmail/relay.git
synced 2026-05-20 21:08:03 +00:00
fix: simplify resolver fix
This commit is contained in:
@@ -550,22 +550,11 @@ def deploy_chatmail(config_path: Path, disable_mail: bool, website_only: bool) -
|
|||||||
return
|
return
|
||||||
|
|
||||||
if host.get_fact(Port, port=53) != "unbound":
|
if host.get_fact(Port, port=53) != "unbound":
|
||||||
server.shell(
|
|
||||||
name="Ensure resolv.conf ends with newline",
|
|
||||||
commands=[
|
|
||||||
"python3 - <<'PY'\n"
|
|
||||||
"from pathlib import Path\n"
|
|
||||||
"path = Path('/etc/resolv.conf')\n"
|
|
||||||
"data = path.read_bytes() if path.exists() else b''\n"
|
|
||||||
"if data and not data.endswith(b'\\n'):\n"
|
|
||||||
" path.write_bytes(data + b'\\n')\n"
|
|
||||||
"PY"
|
|
||||||
],
|
|
||||||
)
|
|
||||||
files.line(
|
files.line(
|
||||||
name="Add 9.9.9.9 to resolv.conf",
|
name="Add 9.9.9.9 to resolv.conf",
|
||||||
path="/etc/resolv.conf",
|
path="/etc/resolv.conf",
|
||||||
line="nameserver 9.9.9.9",
|
# Guard against resolv.conf missing a trailing newline (SolusVM bug).
|
||||||
|
line="\nnameserver 9.9.9.9",
|
||||||
)
|
)
|
||||||
|
|
||||||
port_services = [
|
port_services = [
|
||||||
|
|||||||
Reference in New Issue
Block a user