Removed unnecessary os.path.realpath usage for sys.executable in
both manage_hetzner_servers.py and update_local_config.py. This
reduces complexity and potential for errors when resolving paths.
No significant changes to functionality. This change will make
scripts easier to maintain and execute.
Updated the script execution commands to use `sys.executable` instead
of a hard-coded "python" to ensure compatibility with different Python
environments. Additionally, refactored code for better readability
and consistency in formatting, particularly around argument parsing
and error handling in both manage_hetzner_servers.py and
update_local_config.py.
Improves deployment flexibility and code maintainability.
Removed `delete=False, mode='w'` from `TemporaryDirectory` to fix incorrect usage that caused potential errors. Ensures temporary directory is properly cleaned up and simplifies the tempfile creation process. This update improves file handling and stability.
Updated the saving mechanism for temporary configuration files by utilizing a temporary directory instead of a named temporary file. This change streamlines file handling and avoids potential issues related to file name collisions.
Improves reliability of configuration updates by ensuring a cleaner and more isolated temporary workspace, which enhances process safety and consistency.
Introduced a `--config_path` parameter to allow specifying a custom path for the Wireguard configuration file. Defaults to `/etc/wireguard/{interface}.conf` if not provided. This enhances flexibility for different deployment environments and use cases.
Introduce a new script to streamline the process of updating local
Wireguard configuration by automating the replacement of the [Peer]
section. This script executes a remote setup script, reads the existing
config file, replaces the [Peer] section, and applies the updated
configuration seamlessly.
Addresses the need for a more efficient and error-free method to keep
local Wireguard settings in sync with remote server setups, enhancing
reliability and maintainability.