33from ee .core .shellexec import EEShellExec
44from ee .core .variables import EEVariables
55from ee .core .logging import Log
6+ from ee .core .git import EEGit
67import string
78import random
89import sys
@@ -55,8 +56,8 @@ def secure_auth(self):
5556 if username == "" :
5657 self .app .pargs .user_input = EEVariables .ee_user
5758 if not self .app .pargs .user_pass :
58- password = input ("Provide HTTP authentication "
59- "password [{0}] :" .format (passwd ))
59+ password = getpass . getpass ("Provide HTTP authentication "
60+ "password [{0}] :" .format (passwd ))
6061 self .app .pargs .user_pass = password
6162 if password == "" :
6263 self .app .pargs .user_pass = passwd
@@ -71,12 +72,8 @@ def secure_auth(self):
7172 .format (username = self .app .pargs .user_input ,
7273 password = self .app .pargs .user_pass ),
7374 log = False )
74- Log .info (self , "Successfully changed HTTP authentication"
75- " username to : {username}"
76- .format (username = self .app .pargs .user_input ), log = False )
77- Log .info (self , "Successfully changed HTTP authentication"
78- " password to : {password}"
79- .format (password = self .app .pargs .user_pass ), log = False )
75+ EEGit .add (self , ["/etc/nginx" ],
76+ msg = "Adding changed secure auth into Git" )
8077
8178 @expose (hide = True )
8279 def secure_port (self ):
@@ -104,6 +101,9 @@ def secure_port(self):
104101 "{port} default_server ssl;/\" "
105102 "/etc/nginx/sites-available/22222"
106103 .format (port = self .app .pargs .user_input ))
104+ EEGit .add (self , ["/etc/nginx" ],
105+ msg = "Adding changed secure port into Git" )
106+
107107 Log .info (self , "Successfully port changed {port}"
108108 .format (port = self .app .pargs .user_input ))
109109
@@ -127,6 +127,9 @@ def secure_ip(self):
127127 "\" /deny/i allow {whitelist_adre}\;\" "
128128 " /etc/nginx/common/acl.conf"
129129 .format (whitelist_adre = ip_addr ))
130+ EEGit .add (self , ["/etc/nginx" ],
131+ msg = "Adding changed secure ip into Git" )
132+
130133 Log .info (self , "Successfully added IP address in acl.conf file" )
131134
132135
0 commit comments