From e7e5dce778f2f3809f042dfeabf1fd915cf4e20c Mon Sep 17 00:00:00 2001 From: Spitap Date: Sun, 15 Oct 2023 12:22:57 +0200 Subject: [PATCH] Bug fix --- modoboa_installer/package.py | 5 ++++- modoboa_installer/scripts/rspamd.py | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/modoboa_installer/package.py b/modoboa_installer/package.py index b25392e..483e2e9 100644 --- a/modoboa_installer/package.py +++ b/modoboa_installer/package.py @@ -2,6 +2,8 @@ import re +from os.path import isfile as file_exists + from . import utils @@ -68,7 +70,8 @@ class DEBPackage(Package): f"{url} {codename} main" ) target_file = f"/etc/apt/source.list.d/{name}.list" - utils.exec_cmd(f'echo "{line} | sude tee {target_file}') + tee_option = "-a" if file_exists(target_file) else "" + utils.exec_cmd(f'echo "{line}" | sude tee {tee_option} {target_file}') self.index_updated = False def update(self): diff --git a/modoboa_installer/scripts/rspamd.py b/modoboa_installer/scripts/rspamd.py index 0ecbf48..6c03103 100644 --- a/modoboa_installer/scripts/rspamd.py +++ b/modoboa_installer/scripts/rspamd.py @@ -95,6 +95,7 @@ class Rspamd(base.Installer): "https://rspamd.com/doc/quickstart.html#setting-the-controller-password") _context["controller_password"] = self.app_config["password"] else: + controller_password = controller_password.decode().replace("\n", "") _context["controller_password"] = controller_password _context["greylisting_disabled"] = "" if not self.app_config["greylisting"].lower() == "true" else "#" _context["whitelist_auth_enabled"] = "" if self.app_config["whitelist_auth"].lower() == "true" else "#"