Ejemplo n.º 1
0
    def configure(self):
        self += Package('imapproxy')
        self += Patch('/etc/imapproxy.conf',
                      source='#listen_address 127.0.0.1',
                      target='listen_address 127.0.0.1',
                      check_source_removed=True)
        self += Service('imapproxy', action='restart', deps=self._)

        self += User('roundcube')

        self += Download(self.url.format(version=self.version),
                         checksum=self.checksum)
        self += Extract(self._.target,
                        target='/srv/roundcube',
                        strip=1,
                        owner='roundcube',
                        group='roundcube')
        self += Delete('/srv/roundcube/installer')

        self += File('/srv/roundcube/config/config.inc.php',
                     source='config.php',
                     owner='roundcube',
                     group='roundcube',
                     mode=0o640)

        self += Download(
            'https://github.com/marneu/login_info/archive/'
            'b4e8a299a3f10b5e81a753a84cc9fe51015b0035.zip',
            checksum=
            'sha256:3e90853e991dfb7e8ec1814f716ebf031633859a6c522e9281a1381b310b45e6'
        )
        self += Extract(self._.target, owner='roundcube', group='roundcube')
        # Poor man's strip for zip, idea taken from
        # <https://github.com/chef-cookbooks/ark/blob/e8c03f6/
        #   libraries/unzip_command_builder.rb#L34>
        self += SyncDirectory('/srv/roundcube/plugins/login_info',
                              source=self._.target + '/*',
                              sync_opts='-a')

        self += ServiceDatabase('roundcube',
                                password=self.db_password,
                                schema='/srv/roundcube/SQL/mysql.initial.sql')

        self += PHP('roundcube',
                    params={
                        'upload_max_filesize': '30M',
                        'post_max_size': '30M'
                    },
                    user='******')

        self += File('/etc/nginx/sites-available/mail.wosc.de',
                     source='nginx.conf',
                     is_template=False)
        self += VHost(self._, site_enable=True)
Ejemplo n.º 2
0
    def configure(self):
        self.db = self.require_one('pfa::database')
        self.postfix = self.require_one('postfix')
        self.provide('pfa', self)

        self.basedir = self.map('postfixadmin')

        download = Download(
            'http://downloads.sourceforge.net/project/postfixadmin/'
            'postfixadmin/postfixadmin-{}/postfixadmin-{}.tar.gz'.format(
                self.release, self.release),
            target='postfixadmin-{}.tar.gz'.format(self.release),
            checksum=self.checksum)
        self += download
        self += Extract(download.target, target='postfixadmin.orig')

        self += SyncDirectory(self.basedir,
                              source=self.map(
                                  'postfixadmin.orig/postfixadmin-{}'.format(
                                      self.release)))

        self += File(self.basedir + '/config.local.php', source=self.config)

        self.fpm = FPM('postfixadmin', adress=self.address)
        self += self.fpm
Ejemplo n.º 3
0
    def configure(self):
        self += User('peerjs')

        self += Download(
            self.url.format(version=self.version), checksum=self.checksum)
        self += Extract(
            self._.target, target='/srv/peerjs', strip=1,
            owner='peerjs', group='peerjs')

        self += Patch(
            '/srv/peerjs/lib/server.js',
            file='ws-3.0.patch', target='wosc patched')

        self += File('/srv/peerjs/package.json', is_template=False)
        self += File('/srv/peerjs/package-lock.json', is_template=False)
        self.packages = self._

        self += File('/srv/peerjs/serve.js', is_template=False,
                     owner='peerjs', group='peerjs')
        self += PHP(
            'peerjs',
            command='node serve.js',
            user='******',
            directory='/srv/peerjs',
            dependencies=[self])

        self += File('/srv/peerjs/nginx.conf', is_template=False)
        self += VHost(self._)
Ejemplo n.º 4
0
    def configure(self):
        for name in self.packages:
            self += Package(name)

        self += ServiceDatabase('wallabag', password=self.db_password)
        self += Schema()
        self += AdminUser(password=self.ui_password)

        self += User('wallabag')

        self += Download(self.url.format(version=self.version),
                         checksum=self.checksum)
        self += Extract(self._.target,
                        target='/srv/wallabag',
                        strip=1,
                        owner='wallabag',
                        group='wallabag')

        self += Patch('/srv/wallabag/app/config/routing.yml',
                      file='backup-api.patch',
                      target='backup')

        self += File('/srv/wallabag/app/config/parameters.yml',
                     owner='wallabag',
                     group='wallabag',
                     mode=0o640)

        self += PHP('wallabag', user='******', environ='SYMFONY_ENV=prod')

        self += File('/srv/wallabag/nginx.conf', is_template=False)
        self += VHost(self._)
Ejemplo n.º 5
0
 def configure(self):
     # This will manage central, version-specific virtualenv base
     # installations for multiple components to share.
     self.workdir = self.environment.workdir_base + '/.virtualenv'
     self += Download(
         self.expand(self.download_url),
         target=self.version + '.tar.gz',  # so Extract knows what to do
         checksum=self.checksum)
     download = self._
     extracted_dir = 'virtualenv-' + self.version
     self += Extract(download.target, target=extracted_dir, strip=1)
     self.venv_cmd = (self.workdir + '/' + extracted_dir + '/virtualenv.py')
Ejemplo n.º 6
0
    def configure(self):
        download = Download(
            self.uri, checksum=self.checksum)
        self += download

        extract = Extract(download.target, strip=1)
        self += extract

        self += Configure(extract.target,
                          args=self.configure_args, prefix=self.prefix,
                          build_environment=self.build_environment)
        self += Make(extract.target, build_environment=self.build_environment)
Ejemplo n.º 7
0
    def configure(self):
        for name in self.packages:
            self += Package(name)

        self += Download(self.url.format(version=self.version),
                         checksum=self.checksum)
        self += Extract(self._.target, strip=2, create_target_dir=False)
        self += Symlink('/usr/local/bin/soundjack',
                        source=self.map('SJC%s' % self.version))

        self += File('/lib/systemd/system/soundjack.service',
                     source='soundjack.conf',
                     is_template=False)
        self += SystemdConfig(self._)
Ejemplo n.º 8
0
    def configure(self):
        self += Package('php7.4-mysql')

        self += User('grshop')
        self += ServiceDatabase('grshop', password=self.db_password)

        self += File('/srv/grshop/tmp',
                     ensure='directory',
                     owner='grshop',
                     group='grshop')

        self += Download(self.url.format(version=self.version),
                         checksum=self.checksum)
        self += Extract(self._.target,
                        target='/srv/grshop/lib',
                        strip=1,
                        owner='grshop',
                        group='grshop')

        self += File('/srv/grshop/lib/wp-config.php',
                     owner='grshop',
                     group='grshop',
                     mode=0o640)

        self += File(
            '/srv/grshop/lib/wp-content/plugins'
            '/wc-free-checkout-fields/wc-free-checkout-fields.php',
            leading=True,
            owner='grshop',
            group='grshop',
            is_template=False)

        self += PHP('grshop',
                    params={
                        'upload_max_filesize': '200M',
                        'post_max_size': '200M',
                        'memory_limit': '64M',
                        'upload_tmp_dir': '/srv/grshop/tmp',
                        'open_basedir': '/srv/grshop/lib',
                        'allow_url_fopen': 'Off'
                    },
                    user='******')

        self += File('/srv/grshop/nginx.conf',
                     source='nginx.conf',
                     is_template=False)
        self += VHost(self._)

        self += AdminUser(password=self.ui_password)
Ejemplo n.º 9
0
    def configure(self):
        self += Package('libssl-dev')
        self += Package('libcurl4-gnutls-dev')

        self += Download(
            self.url.format(version=self.version), checksum=self.checksum)
        src = self._.target.replace('.zip', '')
        self += Extract(self._.target, create_target_dir=False)

        self += Patch(
            src + '/esniper.c',
            source='#define MIN_BIDTIME 5',
            target='#define MIN_BIDTIME 2')
        self += Configure(src, prefix='/usr/local')
        self += Make(src)
Ejemplo n.º 10
0
    def configure(self):
        # Allow reading accesslogs
        self += GroupMember('adm', user='******')
        self += Download(self.url.format(version=self.version),
                         checksum=self.checksum)
        self.download = self._
        self += Symlink('/srv/prometheus/bin/nginx_exporter',
                        source=self._.target)

        self.logfiles = glob('/var/log/nginx/*-access.log')
        self += File('/srv/prometheus/nginx.yml')
        self += Program('prometheus-nginx',
                        command='/srv/prometheus/bin/nginx_exporter '
                        '-config-file /srv/prometheus/nginx.yml',
                        user='******',
                        dependencies=[self._])
Ejemplo n.º 11
0
    def configure(self):
        for name in self.packages:
            self += Package(name)

        self += User('matomo')
        # Allow reading accesslogs
        self += GroupMember('adm', user='******')
        self += ServiceDatabase('matomo', password=self.db_password)

        self += File('/srv/matomo/setup/install.json',
                     owner='matomo', group='matomo', mode=0o640)
        self += Setup()

        self += Download(
            self.url.format(version=self.version), checksum=self.checksum,
            requests_kwargs={'headers': {'accept-encoding': '', 'accept': ''}})
        self += Extract(
            self._.target, target='/srv/matomo', strip=1,
            owner='matomo', group='matomo')

        self += PHP('matomo', user='******')

        self += File('/srv/matomo/nginx.conf', is_template=False)
        self += VHost(self._)

        self += CronJob(
            self.import_logs.format(id=1, domain='wosc.de'),
            user='******',
            timing='0 8 * * *')
        self += CronJob(
            self.import_logs.format(id=2, domain='grmusik.de'),
            user='******',
            timing='30 8 * * *')
        self += CronJob(
            'php /srv/matomo/console core:archive '
            '--url=https://pharos.wosc.de/logs/ > /dev/null',
            user='******',
            timing='0 9 * * *')

        self += File(
            '/etc/sudoers.d/matomo-geoip',
            content='matomo ALL=(root) NOPASSWD: /usr/sbin/update-geoip-database\n')
Ejemplo n.º 12
0
    def configure(self):
        self.db = self.require_one('roundcube::database')
        postfix = self.require_one('postfix')

        self.imap_host = postfix.connect.host
        self.smtp_server = postfix.connect.host
        self.smtp_port = postfix.connect.port

        self.basedir = self.map('roundcube')
        self.provide('roundcube', self)

        self += Directory('download')
        download = Download(
            'http://downloads.sourceforge.net/project/roundcubemail/'
            'roundcubemail/{}/roundcubemail-{}-complete.tar.gz'.format(
                self.release, self.release),
            target='download/roundcube-{}.tar.gz'.format(self.release),
            checksum=self.checksum)
        self += download

        self += Extract(download.target, target='roundcube.orig')
        self += SyncDirectory(
            self.basedir,
            source=self.map(
                'roundcube.orig/roundcubemail-{}'.format(self.release)))

        self.db_dsnw = '{}://{}:{}@{}/{}'.format(
            self.db.dbms,
            self.db.username,
            self.db.password,
            self.db.address.connect.host,
            self.db.database)

        self += File(
            self.basedir + '/config/config.inc.php',
            source=self.config)

        self.fpm = FPM('roundcube', address=self.address)
        self += self.fpm

        self += RoundcubeInit(self)
Ejemplo n.º 13
0
 def configure(self):
     self += Download(self.url, checksum=self.checksum)
     self += Extract(
         self._.target, target='/srv/matomo/setup', strip=1,
         owner='matomo', group='matomo')
Ejemplo n.º 14
0
    def configure(self):
        self.provide('elasticsearch', self)

        download = Download(self.uri, checksum=self.checksum)
        self += download
        self += Extract(download.target, create_target_dir=False, strip=1)
Ejemplo n.º 15
0
 def configure(self):
     self += Download(self.url, checksum=self.checksum)
     self += Extract(self._.target, strip=1, create_target_dir=False)
     for name in self.names:
         self += Symlink('/srv/prometheus/bin/%s' % name,
                         source=self.map(name))