Changeset 93c2db9 in rattail-fabric2


Ignore:
Timestamp:
02/09/19 17:20:46 (13 months ago)
Author:
Lance Edgar <ledgar@…>
Branches:
master
Children:
05d6e09
Parents:
bd47688
git-author:
Lance Edgar <ledgar@…> (02/09/19 17:20:22)
git-committer:
Lance Edgar <ledgar@…> (02/09/19 17:20:46)
Message:

Add basic support for installing CORE Office (aka. Fannie)

plus various other things, to that end

Location:
rattail_fabric2
Files:
3 added
2 edited

Legend:

Unmodified
Added
Removed
  • rattail_fabric2/apache.py

    rbd47688 r93c2db9  
    33#
    44#  Rattail -- Retail Software Framework
    5 #  Copyright © 2010-2018 Lance Edgar
     5#  Copyright © 2010-2019 Lance Edgar
    66#
    77#  This file is part of Rattail.
     
    5858
    5959
     60def enable_port(c, port):
     61    """
     62    Tell Apache to listen on the given port.
     63    """
     64    if not isinstance(port, int) and not port.isdigit():
     65        raise ValueError("port must be an integer")
     66    if c.run("grep '^Listen {}' /etc/apache2/ports.conf".format(port), warn=True).failed:
     67        c.sudo("""bash -c 'echo "Listen {}" >> /etc/apache2/ports.conf'""".format(port))
     68
     69
    6070def enable_site(c, *names):
    6171    """
  • rattail_fabric2/core.py

    rbd47688 r93c2db9  
    33#
    44#  Rattail -- Retail Software Framework
    5 #  Copyright © 2010-2018 Lance Edgar
     5#  Copyright © 2010-2019 Lance Edgar
    66#
    77#  This file is part of Rattail.
     
    215215        deploy_backup_app(c, self, envname, *args, **kwargs)
    216216
     217    def certbot_account(self, c, uuid, localdir='certbot/account'):
     218        """
     219        Deploy files to establish a certbot account on target server
     220        """
     221        from .util import exists
     222
     223        localdir = localdir.rstrip('/')
     224        paths = [
     225            '/etc/letsencrypt/accounts',
     226            '/etc/letsencrypt/accounts/acme-v01.api.letsencrypt.org',
     227            '/etc/letsencrypt/accounts/acme-v01.api.letsencrypt.org/directory',
     228        ]
     229        final_path = '{}/{}'.format(paths[-1], uuid)
     230        paths.append(final_path)
     231        if not exists(c, final_path, use_sudo=True):
     232            mkdir(c, paths, mode='0700', use_sudo=True)
     233            self.deploy(c, '{}/private_key.json'.format(localdir), '{}/private_key.json'.format(final_path), mode='0600', use_sudo=True)
     234            self.deploy(c, '{}/meta.json'.format(localdir), '{}/meta.json'.format(final_path), use_sudo=True)
     235            self.deploy(c, '{}/regr.json'.format(localdir), '{}/regr.json'.format(final_path), use_sudo=True)
     236
    217237
    218238def make_deploy(deploy_path, last_segment='deploy'):
Note: See TracChangeset for help on using the changeset viewer.