Fixes in apache
This commit is contained in:
parent
d9303437a9
commit
8231aa715c
2 changed files with 27 additions and 4 deletions
|
|
@ -131,7 +131,11 @@ if linux_distro=='rocky' or linux_distro=='almalinux' or linux_distro=='fedora':
|
||||||
|
|
||||||
# Copy file
|
# Copy file
|
||||||
|
|
||||||
linux.shell_command('sudo cp modules/apache/scripts/check_mod_md.py /usr/local/bin && sudo chmod 755 /usr/local/bin/check_mod_md.py')
|
#linux.shell_command('sudo cp modules/apache/scripts/check_mod_md.py /usr/local/bin && sudo chmod 755 /usr/local/bin/check_mod_md.py')
|
||||||
|
|
||||||
|
# echo "0 0,12 * * * root /opt/certbot/bin/python -c 'import random; import time; time.sleep(random.random() * 3600)' && sudo certbot renew -q" | sudo tee -a /etc/cron.d/certbot > /dev/null
|
||||||
|
|
||||||
|
#linux.shell_command('echo "* * * * * root python /usr/local/bin/check_mod_md.py" | sudo tee -a /etc/cron.d/mod_md > /dev/null')
|
||||||
|
|
||||||
#Restart apache
|
#Restart apache
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -181,7 +181,7 @@ def manage():
|
||||||
SSLEngine on
|
SSLEngine on
|
||||||
|
|
||||||
"""
|
"""
|
||||||
|
"""
|
||||||
vhost_ssl=vhost_ssl.replace('$port', args.ssl_port)
|
vhost_ssl=vhost_ssl.replace('$port', args.ssl_port)
|
||||||
vhost_ssl=vhost_ssl.replace('$ip', args.ip)
|
vhost_ssl=vhost_ssl.replace('$ip', args.ip)
|
||||||
vhost_ssl=vhost_ssl.replace('$email', args.email)
|
vhost_ssl=vhost_ssl.replace('$email', args.email)
|
||||||
|
|
@ -218,8 +218,8 @@ def manage():
|
||||||
|
|
||||||
json_return={'error':0, 'status': 0, 'progress': 100, 'no_progress':0, 'message': 'Creating SSL Cert with Letsencrypt using mod_md...'}
|
json_return={'error':0, 'status': 0, 'progress': 100, 'no_progress':0, 'message': 'Creating SSL Cert with Letsencrypt using mod_md...'}
|
||||||
print(json.dumps(json_return))
|
print(json.dumps(json_return))
|
||||||
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
ssl_debug=''
|
ssl_debug=''
|
||||||
|
|
||||||
if debug:
|
if debug:
|
||||||
|
|
@ -292,7 +292,7 @@ def manage():
|
||||||
vhost+="\n\n"+vhost_ssl
|
vhost+="\n\n"+vhost_ssl
|
||||||
|
|
||||||
pass
|
pass
|
||||||
"""
|
|
||||||
if type_ssl==2:
|
if type_ssl==2:
|
||||||
vhost_ssl=vhost_ssl.replace('$port', args.ssl_port)
|
vhost_ssl=vhost_ssl.replace('$port', args.ssl_port)
|
||||||
vhost_ssl=vhost_ssl.replace('$ip', args.ip)
|
vhost_ssl=vhost_ssl.replace('$ip', args.ip)
|
||||||
|
|
@ -589,6 +589,25 @@ def manage():
|
||||||
print(json.dumps(json_return))
|
print(json.dumps(json_return))
|
||||||
#time.sleep(1)
|
#time.sleep(1)
|
||||||
|
|
||||||
|
# Delete certbot certificate if exists
|
||||||
|
|
||||||
|
#sudo /opt/certbot/bin/certbot delete --cert-name server1.yotex.net -n
|
||||||
|
|
||||||
|
if call("sudo /opt/certbot/bin/certbot delete --cert-name {} -n".format(args.domain), shell=True) > 0:
|
||||||
|
json_return['error']=0
|
||||||
|
json_return['status']=0
|
||||||
|
json_return['progress']=100
|
||||||
|
json_return['message']='I cannot delete the certificate, please, if exists, clean manually'
|
||||||
|
|
||||||
|
print(json.dumps(json_return))
|
||||||
|
else:
|
||||||
|
json_return['error']=0
|
||||||
|
json_return['status']=0
|
||||||
|
json_return['progress']=100
|
||||||
|
json_return['message']='Cleaning certbot ssl certificate for the domain'
|
||||||
|
|
||||||
|
print(json.dumps(json_return))
|
||||||
|
|
||||||
# Delete root_dir if exists
|
# Delete root_dir if exists
|
||||||
# Change effective uid
|
# Change effective uid
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue