mirror of
https://github.com/hyperknot/openfreemap.git
synced 2026-05-21 14:02:15 +00:00
work
This commit is contained in:
@@ -37,7 +37,6 @@ if input(f'run {sys.argv[0]} on {HOSTNAME}? [y/N]: ') != 'y':
|
|||||||
|
|
||||||
c = Connection(
|
c = Connection(
|
||||||
host=HOSTNAME,
|
host=HOSTNAME,
|
||||||
user='ofm',
|
|
||||||
config=Config(overrides={'sudo': {'password': OFM_USER_PASSWD}}),
|
config=Config(overrides={'sudo': {'password': OFM_USER_PASSWD}}),
|
||||||
)
|
)
|
||||||
prepare_server(c)
|
prepare_server(c)
|
||||||
|
|||||||
@@ -51,12 +51,13 @@ def nginx(c):
|
|||||||
|
|
||||||
|
|
||||||
def certbot(c):
|
def certbot(c):
|
||||||
# https://certbot.eff.org/lets-encrypt/ubuntubionic-nginx
|
|
||||||
apt_get_install(c, 'snapd')
|
apt_get_install(c, 'snapd')
|
||||||
c.sudo('snap install core', warn=True)
|
|
||||||
|
# this is silly, but needs to be run twice
|
||||||
|
c.sudo('snap install core', warn=True, echo=True)
|
||||||
|
c.sudo('snap install core', warn=True, echo=True)
|
||||||
|
|
||||||
c.sudo('snap refresh core', warn=True)
|
c.sudo('snap refresh core', warn=True)
|
||||||
|
|
||||||
apt_get_purge(c, 'certbot')
|
apt_get_purge(c, 'certbot')
|
||||||
c.sudo('snap install --classic certbot', warn=True)
|
c.sudo('snap install --classic certbot', warn=True)
|
||||||
c.sudo('snap set certbot trust-plugin-with-root=ok')
|
|
||||||
c.sudo('snap install certbot-dns-cloudflare')
|
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ def pkg_upgrade(c):
|
|||||||
|
|
||||||
|
|
||||||
def pkg_clean(c):
|
def pkg_clean(c):
|
||||||
clean_list = [
|
pkg_list = [
|
||||||
# firewalls
|
# firewalls
|
||||||
'ufw',
|
'ufw',
|
||||||
'nftables',
|
'nftables',
|
||||||
@@ -28,11 +28,21 @@ def pkg_clean(c):
|
|||||||
'ubuntu-advantage-tools',
|
'ubuntu-advantage-tools',
|
||||||
]
|
]
|
||||||
|
|
||||||
apt_get_purge(c, ' '.join(clean_list))
|
apt_get_purge(c, ' '.join(pkg_list))
|
||||||
apt_get_autoremove(c)
|
apt_get_autoremove(c)
|
||||||
sudo_cmd(c, 'dpkg --list | grep "^rc" | cut -d " " -f 3 | xargs -r dpkg --purge')
|
sudo_cmd(c, 'dpkg --list | grep "^rc" | cut -d " " -f 3 | xargs -r dpkg --purge')
|
||||||
c.sudo('iptables -L')
|
c.sudo('iptables -L', warn=True)
|
||||||
|
|
||||||
|
|
||||||
def pkg_base(c):
|
def pkg_base(c):
|
||||||
apt_get_install(c, 'python3 nload iftop')
|
pkg_list = [
|
||||||
|
'wget',
|
||||||
|
'gpg',
|
||||||
|
'gnupg-agent',
|
||||||
|
'python3',
|
||||||
|
'nload',
|
||||||
|
'iftop',
|
||||||
|
'snapd',
|
||||||
|
]
|
||||||
|
|
||||||
|
apt_get_install(c, ' '.join(pkg_list))
|
||||||
|
|||||||
@@ -88,6 +88,7 @@ def apt_get_install(c, pkgs, warn=False):
|
|||||||
c.sudo(
|
c.sudo(
|
||||||
f'DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends {pkgs}',
|
f'DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends {pkgs}',
|
||||||
warn=warn,
|
warn=warn,
|
||||||
|
echo=True,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user