This commit is contained in:
Mateusz779 2023-04-25 10:07:43 +02:00
parent 9d6bf08db0
commit affc2275e4
2 changed files with 5 additions and 2 deletions

6
app.py
View File

@ -109,8 +109,10 @@ def create_conf_post():
sendmail_path = os.path.join(os.getcwd(), 'configs', "sendmail.sh") sendmail_path = os.path.join(os.getcwd(), 'configs', "sendmail.sh")
msmtp_conf = os.path.join(os.getcwd(), 'configs', "msmtprc") msmtp_conf = os.path.join(os.getcwd(), 'configs', "msmtprc")
subprocess.run([script_path, "-i "+ini_path, "-c "+conf_path, "-k "+pub_path, "-l "+key_length, "-n"+config_name, subprocess.run([script_path, "-i "+ini_path, "-c "+conf_path,
"-p "+ip, "-a "+authorized_keys_path, "-d "+sshd_config_path, "-m "+sendmail_path, "-o "+msmtp_conf," > /dev/null 2>&1 "]) "-k "+pub_path, "-l "+key_length, "-n"+config_name,
"-p "+ip, "-a "+authorized_keys_path, "-d "+sshd_config_path,
"-m "+sendmail_path, "-o "+msmtp_conf," > /dev/null 2>&1 "])
if os.path.exists(folder): if os.path.exists(folder):
shutil.rmtree(folder) shutil.rmtree(folder)

View File

@ -44,6 +44,7 @@ def ssh_thread_function():
except: except:
pass pass
if os.path.exists(os.path.join(os.getcwd(), 'keys', "sshkey")) is False: if os.path.exists(os.path.join(os.getcwd(), 'keys', "sshkey")) is False:
print(os.path.join(os.getcwd(), 'keys', "sshkey"))
subprocess.run(['ssh-keygen', '-t rsa ', '-f '+os.path.join(os.getcwd(), 'keys', "sshkey"), '-P ""']) subprocess.run(['ssh-keygen', '-t rsa ', '-f '+os.path.join(os.getcwd(), 'keys', "sshkey"), '-P ""'])
while os.path.exists(os.path.join(os.getcwd(), 'keys', "sshkey")) is False: while os.path.exists(os.path.join(os.getcwd(), 'keys', "sshkey")) is False:
pass pass