mirror of
https://github.com/hyperknot/openfreemap.git
synced 2026-05-21 14:02:15 +00:00
certs
This commit is contained in:
@@ -81,6 +81,8 @@ def lego(c):
|
||||
f'wget -q "{url}" -O /tmp/lego/out.tar.gz',
|
||||
)
|
||||
c.run('tar xzvf /tmp/lego/out.tar.gz -C /tmp/lego')
|
||||
c.run('mv /tmp/lego/lego /usr/bin')
|
||||
c.run('chmod +x /usr/bin/lego')
|
||||
c.run('chmod +x /tmp/lego/lego')
|
||||
c.run('mv /tmp/lego/lego /usr/local/bin')
|
||||
c.run('rm -rf /tmp/lego*')
|
||||
|
||||
c.run('mkdir -p /data/nginx/acme-challenges/')
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
import os
|
||||
import secrets
|
||||
import string
|
||||
import sys
|
||||
from pathlib import Path
|
||||
|
||||
import requests
|
||||
from invoke import UnexpectedExit
|
||||
|
||||
|
||||
def put(
|
||||
@@ -76,7 +78,22 @@ def append_str(c, remote_path, str_):
|
||||
|
||||
def sudo_cmd(c, cmd, *, user=None):
|
||||
cmd = cmd.replace('"', '\\"')
|
||||
c.sudo(f'bash -c "{cmd}"', user=user)
|
||||
|
||||
try:
|
||||
c.sudo(f'bash -c "{cmd}"', user=user)
|
||||
except UnexpectedExit as e:
|
||||
print(f'Command failed: {e.result.command}')
|
||||
print(f'Error: {e.result.stderr}')
|
||||
sys.exit(1)
|
||||
|
||||
|
||||
def run_nice(c, cmd):
|
||||
try:
|
||||
c.run(cmd)
|
||||
except UnexpectedExit as e:
|
||||
print(f'Command failed: {e.result.command}')
|
||||
print(f'Error: {e.result.stderr}')
|
||||
sys.exit(1)
|
||||
|
||||
|
||||
def set_permission(c, path, *, permissions=None, user=None, group=None):
|
||||
|
||||
Reference in New Issue
Block a user