Introduced a step in the CI test workflow to wait for the SSH server to start before proceeding with subsequent actions. This ensures that the server is fully operational and can accept connections before any attempts are made to copy the public key into the Docker container, avoiding potential race conditions where the server might not be ready in time, leading to failed CI runs. The addition of a simple loop with a timeout mechanism improves the reliability of the CI pipeline by making sure tests only run when all services are up and running.
Ensured the SSH server Docker container is always rebuilt from a clean state by forcefully removing any pre-existing container before creation. Additionally, updated the SSH connection user to 'replication' to align with new security protocols.
- The force removal of the existing 'ssh-server' container avoids potential conflicts or inconsistencies due to leftover state from previous test runs, ensuring a more reliable integration testing environment.
- Switching the SSH connection to use the 'replication' user account instead of 'root' enhances security and adheres to best practices by minimizing the use of elevated privileges.
These changes contribute to a more stable and secure CI pipeline by reducing flakiness in tests and aligning with security best practices.
Preemptively creating the `~/.ssh` directory before attempting to add the SSH server's host key to `known_hosts`. This change prevents potential failures in CI workflows where the `.ssh` directory might not exist on a fresh runner environment, ensuring a smoother and more reliable setup for SSH connections.
This adjustment enhances the resilience of the testing workflow by avoiding errors related to missing directories, thereby improving automated testing reliability and efficiency.
The Docker build command for the SSH server container was incorrectly pointing to the Dockerfile instead of the directory containing it. This change corrects the build context to the correct directory, ensuring that all necessary files in `./ci-tests/` are included during the build process. This fix addresses issues with missing dependencies during the container build phase.
Optimized the Docker installation commands in the CI workflow by removing `sudo` when calling `apt-get`. This adjustment caters to environments where the CI runner executes as root or has adequate permissions, streamlining command execution and avoiding potential issues related to `sudo` availability or configuration. This change harmonizes with CI practices that favor minimalist, permission-aware setups.
To facilitate the execution of tests within a controlled environment, Docker is now installed as part of the CI testing workflow. This addition ensures that any Docker-dependent steps, specifically the building and running of an SSH Server Docker container, execute seamlessly. Previously, the assumption was that Docker would be pre-installed on the runner, which could lead to inconsistencies or failures in environments where this was not the case. By explicitly including the Docker installation step, the workflow becomes more portable and resilient across different CI execution environments.
Implemented a new CI pipeline configured to automatically test SSH connectivity as part of the project's testing phase. This involves creating and configuring a Docker container to serve as an SSH server, generating an SSH key pair for secure connection, and ensuring the build environment can establish an SSH connection to the container without manual intervention. The setup aims to automate and streamline testing of SSH-related functionalities, enhancing the reliability of code changes affecting remote server interactions.
- A Dockerfile was added to set up an SSH server in a container.
- The CI pipeline (`test.yml`) was configured to build this container, generate SSH keys, copy the public key to the container, and attempt an SSH connection.
This enhancement supports more robust testing processes, particularly for features that interact with remote servers via SSH.
- Extended copyright to reflect the current year.
- Incremented project version to indicate new features and fixes.
- Added a new script entry for easier execution, increasing utility and accessibility.
- Updated project URLs for better alignment with current infrastructure.
- Refactored settings path for simplicity and consistency across deployments.
- Improved code readability and maintenance across several modules by cleaning up redundant code, adding missing type annotations, and ensuring consistent code formatting.
- Enhanced logging capabilities and error handling to improve diagnostics and troubleshooting, supporting more robust error recovery mechanisms.
- Implemented more graceful handling of termination signals to ensure clean shutdown and resource cleanup, enhancing the robustness of the application in production environments.
- Introduced command-line argument parsing for configuration file path customization, improving flexibility in different runtime environments.
These changes collectively improve the project's maintainability, reliability, and user experience, laying a stronger foundation for future development.