diff --git a/deploy/panel_installer/engine.py b/deploy/panel_installer/engine.py index 335d6ea..aad6bd5 100644 --- a/deploy/panel_installer/engine.py +++ b/deploy/panel_installer/engine.py @@ -940,6 +940,13 @@ class Installer: ASSETS, *features, label="Configure local hosting tools", + failure=lambda _code, stderr: ( + stderr.decode("utf-8", errors="replace") + .strip() + .splitlines()[-1][:400] + if stderr.strip() + else "Check the local hosting tools and retry." + ), ).splitlines() workers.extend(local_workers) self.folder_sftp_supported = ( diff --git a/src/coulobre/local_feature_setup.py b/src/coulobre/local_feature_setup.py index 60810ff..31fa460 100644 --- a/src/coulobre/local_feature_setup.py +++ b/src/coulobre/local_feature_setup.py @@ -201,7 +201,13 @@ def prepare_sftp(assets, command): if not SSHD.is_file(): raise ValueError("Install OpenSSH Server before enabling SFTP.") - command(str(SSHD), "-t") + require_root_directory(Path("/run/sshd"), create_mode=0o755) + try: + command(str(SSHD), "-t") + except ValueError: + raise ValueError( + "The existing OpenSSH configuration failed sshd -t." + ) from None require_root_directory(AUTHORIZED_KEYS, create_mode=0o755) create_service_identity(SFTP_GROUP, "", command) created = not os.path.lexists(SFTP_SSHD_CONFIG) @@ -219,10 +225,12 @@ def prepare_sftp(assets, command): command(str(SSHD), "-t") if active("ssh.service"): command(SYSTEMCTL, "reload", "ssh.service") - except (OSError, ValueError): + except (OSError, ValueError) as error: if created: SFTP_SSHD_CONFIG.unlink() - raise + raise ValueError( + "Could not validate or reload the Coulobre OpenSSH configuration." + ) from error def check_folder_sftp_filesystem(): diff --git a/src/coulobre/managed_tools.py b/src/coulobre/managed_tools.py index 53fb362..0982a40 100644 --- a/src/coulobre/managed_tools.py +++ b/src/coulobre/managed_tools.py @@ -331,6 +331,9 @@ def unpack_roundcube(command): ): raise ValueError("Roundcube has an unexpected archive layout.") source.extractall(staging, members=files, filter="data") + for member in files: + if member.isdir(): + (staging / member.name).chmod(0o755) app = staging / root write_new_file( app / ".coulobre-release", ROUNDCUBE_VERSION, mode=0o644