Update app.py
Browse files
app.py
CHANGED
@@ -17,9 +17,14 @@ def fetch_github_file(github_url, ssh_private_key):
|
|
17 |
ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
|
18 |
|
19 |
# Clean and format the SSH key
|
20 |
-
ssh_private_key = '\n'.join(line.strip() for line in ssh_private_key.split('\n') if line.strip())
|
21 |
-
if not ssh_private_key.startswith("-----BEGIN"):
|
22 |
-
|
|
|
|
|
|
|
|
|
|
|
23 |
|
24 |
|
25 |
# Load the private key
|
|
|
17 |
ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
|
18 |
|
19 |
# Clean and format the SSH key
|
20 |
+
#ssh_private_key = '\n'.join(line.strip() for line in ssh_private_key.split('\n') if line.strip())
|
21 |
+
#if not ssh_private_key.startswith("-----BEGIN"):
|
22 |
+
# ssh_private_key = f"-----BEGIN OPENSSH PRIVATE KEY-----\n{ssh_private_key}\n-----END OPENSSH PRIVATE KEY-----"
|
23 |
+
|
24 |
+
# Format the SSH key
|
25 |
+
formatted_key = '\n'.join(line.strip() for line in formatted_key.split('\n') if line.strip())
|
26 |
+
if not formatted_key.startswith("-----BEGIN"):
|
27 |
+
formatted_key = f"-----BEGIN OPENSSH PRIVATE KEY-----\n{formatted_key}\n-----END OPENSSH PRIVATE KEY-----"
|
28 |
|
29 |
|
30 |
# Load the private key
|