Commit graph

6 commits

Author SHA1 Message Date
bc9c9aeb75
refactor: simplify executable path handling
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.
2024-07-18 19:09:11 +02:00
5a64f31a1c
refactor: update script execution with sys.executable
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.
2024-07-18 19:07:02 +02:00
f075cc668b
fix(config): resolve tempfile mode error in config update
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.
2024-07-18 18:50:58 +02:00
c3c5f36ffc
refactor(config): replace temp file usage with temp dir
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.
2024-07-18 18:46:05 +02:00
b60efb3f96
feat: add optional config path argument to script
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.
2024-07-18 18:37:56 +02:00
5bfd82aa6b
feat: automate Wireguard config updates with new script
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.
2024-07-18 18:26:00 +02:00