Esempio n. 1
0
 def _add_gkey_defaults(self):
     self.defaults['gkeysdir'] = path(
         [self.root, EPREFIX, '/var/lib/gentoo/gkeys'])
     self.defaults['keyring'] = '%(gkeysdir)s/keyrings'
     self.defaults['sign-keydir'] = '%(gkeysdir)s/sign',
     self.defaults['logdir'] = '/var/log/gkeys'
     # local directory to scan for seed files installed via ebuild, layman
     # or manual install.
     self.defaults['seedsdir'] = '%(gkeysdir)s/seeds'
     self.defaults['seeds'] = {}
     self.defaults['keyserver'] = 'pool.sks-keyservers.net'
     # NOTE: files is umask mode in octal, directories is chmod mode in octal
     self.defaults['permissions'] = {
         'files': '0o002',
         'directories': '0o775',
     }
     self.defaults['seedurls'] = {}
     self.defaults['sign'] = {
         'key': 'fingerprint',
         'keydir': '~/.gkeys',
         'keyring': None,
         'type': 'clearsign',
     }
     self.defaults['verify-keyring'] = 'gentoo'
     self.defaults['verify-nick'] = 'gkeys'
     self.defaults['verify-seeds'] = {}
Esempio n. 2
0
 def _set_default_config(self):
         self.defaults['homedir'] = os.path.expanduser('~')
         self.defaults['configdir'] = os.path.join(
             self.defaults['homedir'], '.gkeys')
         self.defaults['config']= os.path.join(
             self.defaults['configdir'], 'gkeys.conf')
         if not os.path.exists(self.defaults['config']):
             self.defaults['configdir'] = path([self.root, EPREFIX, '/etc/gkeys'])
             self.defaults['config'] = '%(configdir)s/gkeys.conf'
Esempio n. 3
0
 def _set_default_config(self):
     self.defaults['homedir'] = os.path.expanduser('~')
     self.defaults['userconfigdir'] = os.path.join(self.defaults['homedir'],
                                                   '.config', 'gkeys')
     self.defaults['configdir'] = self.defaults['userconfigdir']
     self.defaults['config'] = os.path.join(self.defaults['userconfigdir'],
                                            'gkeys.conf')
     if not os.path.exists(self.defaults['config']):
         self.defaults['configdir'] = path(
             [self.root, EPREFIX, '/etc/gkeys'])
         self.defaults['config'] = '%(configdir)s/gkeys.conf'
Esempio n. 4
0
    def __init__ (self, config=None, root=None, read_configfile=False):
        """ Class initialiser """
        GPGConfig.__init__(self)

        self.root = root or ''
        if config:
            self.defaults['config'] = config
            self.defaults['configdir'] = os.path.dirname(config)
        else:
            self.defaults['configdir'] = path([self.root, EPREFIX, '/etc/gentoo-keys'])
            self.defaults['config'] = '%(configdir)s/gkeys.conf'
        self.configparser = None
        self._add_gkey_defaults()
        if read_configfile:
            self.read_config()
Esempio n. 5
0
 def _add_gkey_defaults(self):
     self.defaults['keysdir'] = path([self.root, EPREFIX, '/var/gentoo/gkeys'])
     self.defaults['dev-keydir'] = '%(keysdir)s/devs'
     self.defaults['release-keydir'] = '%(keysdir)s/release'
     self.defaults['overlays-keydir'] = '%(keysdir)s/overlays'
     self.defaults['logdir'] = '%(keysdir)s/logs'
     # local directory to scan for seed files installed via ebuild, layman
     # or manual install.
     self.defaults['seedsdir'] = '%(keysdir)s/seeds'
     self.defaults['release-seedfile'] = '%(seedsdir)s/release.seeds'
     self.defaults['dev-seedfile'] = '%(seedsdir)s/developer.seeds'
     self.defaults['keyserver'] = 'pool.sks-keyservers.net'
     self.defaults['seedurls'] = {
         'release.seeds': 'https://dev.gentoo.org/~dolsen/gkey-seeds/release.seeds',
         'developers.seeds': 'https://dev.gentoo.org/~dolsen/gkey-seeds/developer.seeds',
     }
Esempio n. 6
0
 def _add_gkey_defaults(self):
     self.defaults['gkeysdir'] = path([self.root, EPREFIX, '/var/lib/gentoo/gkeys'])
     self.defaults['keyring'] = '%(gkeysdir)s/keyring'
     self.defaults['sign-keydir'] = '%(gkeysdir)s/sign',
     self.defaults['logdir'] = '/var/log/gkeys'
     # local directory to scan for seed files installed via ebuild, layman
     # or manual install.
     self.defaults['seedsdir'] = '%(gkeysdir)s/seeds'
     self.defaults['seeds'] = {}
     self.defaults['keyserver'] = 'pool.sks-keyservers.net'
     # NOTE: files is umask mode in octal, directories is chmod mode in octal
     self.defaults['permissions'] = {'files': '0o002', 'directories': '0o775',}
     self.defaults['seedurls'] = {}
     self.defaults['sign'] = {
         'key': 'fingerprint',
         'keydir': '~/.gkeys',
         'keyring': None,
         'type': 'clearsign',
     }
     self.defaults['verify-keyring'] = ''
     self.defaults['verify-seeds'] = {}
Esempio n. 7
0
    def __init__(self, config=None, root=None, read_configfile=False):
        """ Class initialiser """
        GPGConfig.__init__(self)

        self.logger = None
        self.root = root or ''
        self.defaults = OrderedDict(self.defaults)
        if config:
            self.defaults['config'] = config
            self.defaults['configdir'] = os.path.dirname(config)
        else:
            homedir = os.path.expanduser('~')
            self.defaults['configdir'] = homedir
            self.defaults['config']= os.path.join(homedir, '.gkeys.conf')
            if not os.path.exists(self.defaults['config']):
                self.defaults['configdir'] = path([self.root, EPREFIX, '/etc/gkeys'])
                self.defaults['config'] = '%(configdir)s/gkeys.conf'
        self.configparser = None
        self._add_gkey_defaults()
        if read_configfile:
            self.read_config()