* [gentoo-portage-dev] [PATCH] enable user settable gpg keyservers @ 2019-02-25 20:34 Matthew Thode 2019-02-25 20:59 ` Michał Górny 2019-02-25 21:41 ` Matthew Thode 0 siblings, 2 replies; 11+ messages in thread From: Matthew Thode @ 2019-02-25 20:34 UTC (permalink / raw To: gentoo-portage-dev [-- Attachment #1.1: Type: text/plain, Size: 329 bytes --] Allowing users to define which keyservers they update from allows them to work around buggy keyservers. It is also useful for local mirrors and / or private keyservers. It's likely that I'm setting the default incorrectly and not alphabetizing right, but the code works at least... -- Matthew Thode (prometheanfire) [-- Attachment #1.2: 0001-enable-user-settable-gpg-keyservers.patch --] [-- Type: text/x-diff, Size: 3534 bytes --] From fa649aac34f7478685c1999857de00c91a1d76cc Mon Sep 17 00:00:00 2001 From: Matthew Thode <mthode@mthode.org> Date: Mon, 25 Feb 2019 14:14:20 -0600 Subject: [PATCH] enable user settable gpg keyservers Allowing users to define which keyservers they update from allows them to work around buggy keyservers. It is also useful for local mirrors and / or private keyservers. Signed-off-by: Matthew Thode <mthode@mthode.org> --- lib/portage/repository/config.py | 12 ++++++++++-- lib/portage/sync/syncbase.py | 6 +++--- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/lib/portage/repository/config.py b/lib/portage/repository/config.py index 482711c4b..47adbaf03 100644 --- a/lib/portage/repository/config.py +++ b/lib/portage/repository/config.py @@ -115,6 +115,7 @@ class RepoConfig(object): 'sync_openpgp_key_refresh_retry_delay_max', 'sync_openpgp_key_refresh_retry_delay_mult', 'sync_openpgp_key_refresh_retry_overall_timeout', + 'sync_openpgp_keyserver', 'sync_rcu', 'sync_rcu_spare_snapshots', 'sync_rcu_store_dir', @@ -224,8 +225,13 @@ class RepoConfig(object): self.sync_allow_hardlinks = repo_opts.get( 'sync-allow-hardlinks', 'true').lower() in ('true', 'yes') - self.sync_openpgp_key_path = repo_opts.get( - 'sync-openpgp-key-path', None) + sync_openpgp_keyserver = repo_opts.get( + 'sync-openpgp-keyserver') + if sync_openpgp_keyserver is not None: + sync_openpgp_keyserver = sync_openpgp_keyserver.strip().lower() + else: + sync_openpgp_keyserver = 'hkps.pool.sks-keyservers.net' + self.sync_openpgp_keyserver = sync_openpgp_keyserver for k in ('sync_openpgp_key_refresh_retry_count', 'sync_openpgp_key_refresh_retry_delay_exp_base', @@ -602,6 +608,7 @@ class RepoConfigLoader(object): 'sync_depth', 'sync_hooks_only_on_change', 'sync_openpgp_key_path', + 'sync_openpgp_keyserver', 'sync_openpgp_key_refresh_retry_count', 'sync_openpgp_key_refresh_retry_delay_exp_base', 'sync_openpgp_key_refresh_retry_delay_max', @@ -1048,6 +1055,7 @@ class RepoConfigLoader(object): "priority", "sync_depth", "sync_openpgp_key_path", + "sync_openpgp_keyserver", "sync_openpgp_key_refresh_retry_count", "sync_openpgp_key_refresh_retry_delay_exp_base", "sync_openpgp_key_refresh_retry_delay_max", diff --git a/lib/portage/sync/syncbase.py b/lib/portage/sync/syncbase.py index 83b35c667..ae9ec938e 100644 --- a/lib/portage/sync/syncbase.py +++ b/lib/portage/sync/syncbase.py @@ -252,10 +252,10 @@ class SyncBase(object): @type openpgp_env: gemato.openpgp.OpenPGPEnvironment """ out = portage.output.EOutput(quiet=('--quiet' in self.options['emerge_config'].opts)) - out.ebegin('Refreshing keys from keyserver') + out.ebegin('Refreshing keys from keyserver {s}'.format(s=self.repo.sync_openpgp_keyserver)) retry_decorator = self._key_refresh_retry_decorator() if retry_decorator is None: - openpgp_env.refresh_keys() + openpgp_env.refresh_keys(keyserver=self.repo.sync_openpgp_keyserver) else: def noisy_refresh_keys(): """ @@ -263,7 +263,7 @@ class SyncBase(object): errors, display errors as soon as they occur. """ try: - openpgp_env.refresh_keys() + openpgp_env.refresh_keys(keyserver=self.repo.sync_openpgp_keyserver) except Exception as e: writemsg_level("%s\n" % (e,), level=logging.ERROR, noiselevel=-1) -- 2.19.2 [-- Attachment #2: signature.asc --] [-- Type: application/pgp-signature, Size: 833 bytes --] ^ permalink raw reply related [flat|nested] 11+ messages in thread
* Re: [gentoo-portage-dev] [PATCH] enable user settable gpg keyservers 2019-02-25 20:34 [gentoo-portage-dev] [PATCH] enable user settable gpg keyservers Matthew Thode @ 2019-02-25 20:59 ` Michał Górny 2019-02-25 21:27 ` Matthew Thode 2019-02-25 21:41 ` Matthew Thode 1 sibling, 1 reply; 11+ messages in thread From: Michał Górny @ 2019-02-25 20:59 UTC (permalink / raw To: gentoo-portage-dev [-- Attachment #1: Type: text/plain, Size: 502 bytes --] On Mon, 2019-02-25 at 14:34 -0600, Matthew Thode wrote: > Allowing users to define which keyservers they update from allows them > to work around buggy keyservers. It is also useful for local mirrors > and / or private keyservers. > > It's likely that I'm setting the default incorrectly and not > alphabetizing right, but the code works at least... > I'm still wondering why you need to use keyservers instead of WKD which is much more reliable. -- Best regards, Michał Górny [-- Attachment #2: This is a digitally signed message part --] [-- Type: application/pgp-signature, Size: 963 bytes --] ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [gentoo-portage-dev] [PATCH] enable user settable gpg keyservers 2019-02-25 20:59 ` Michał Górny @ 2019-02-25 21:27 ` Matthew Thode 0 siblings, 0 replies; 11+ messages in thread From: Matthew Thode @ 2019-02-25 21:27 UTC (permalink / raw To: gentoo-portage-dev [-- Attachment #1: Type: text/plain, Size: 767 bytes --] On 19-02-25 21:59:01, Michał Górny wrote: > On Mon, 2019-02-25 at 14:34 -0600, Matthew Thode wrote: > > Allowing users to define which keyservers they update from allows them > > to work around buggy keyservers. It is also useful for local mirrors > > and / or private keyservers. > > > > It's likely that I'm setting the default incorrectly and not > > alphabetizing right, but the code works at least... > > > > I'm still wondering why you need to use keyservers instead of WKD which > is much more reliable. > That I do not know. The only thing I see it doing is using the keyservers. Give me some way of generating debug output and I will do so. using webrsync if that maters (portage tarballs). -- Matthew Thode (prometheanfire) [-- Attachment #2: signature.asc --] [-- Type: application/pgp-signature, Size: 833 bytes --] ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [gentoo-portage-dev] [PATCH] enable user settable gpg keyservers 2019-02-25 20:34 [gentoo-portage-dev] [PATCH] enable user settable gpg keyservers Matthew Thode 2019-02-25 20:59 ` Michał Górny @ 2019-02-25 21:41 ` Matthew Thode 2019-02-25 21:44 ` [gentoo-portage-dev] [PATCH][v3] " Matthew Thode 2019-02-25 21:45 ` [gentoo-portage-dev] [PATCH][v3] enable user settable gpg keyservers (attached) Matthew Thode 1 sibling, 2 replies; 11+ messages in thread From: Matthew Thode @ 2019-02-25 21:41 UTC (permalink / raw To: gentoo-portage-dev [-- Attachment #1.1: Type: text/plain, Size: 447 bytes --] On 19-02-25 14:34:46, Matthew Thode wrote: > Allowing users to define which keyservers they update from allows them > to work around buggy keyservers. It is also useful for local mirrors > and / or private keyservers. > > It's likely that I'm setting the default incorrectly and not > alphabetizing right, but the code works at least... > Ok, let's try that again, should be cleaner/better/etc -- Matthew Thode (prometheanfire) [-- Attachment #1.2: 0001-enable-user-settable-gpg-keyservers.patch --] [-- Type: text/x-diff, Size: 3308 bytes --] From 1a44eea8a592e58c8c94b134b5d87bd5d4d26425 Mon Sep 17 00:00:00 2001 From: Matthew Thode <mthode@mthode.org> Date: Mon, 25 Feb 2019 14:14:20 -0600 Subject: [PATCH] enable user settable gpg keyservers Allowing users to define which keyservers they update from allows them to work around buggy keyservers. It is also useful for local mirrors and / or private keyservers. Signed-off-by: Matthew Thode <mthode@mthode.org> --- lib/portage/repository/config.py | 8 +++++++- lib/portage/sync/syncbase.py | 6 +++--- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/lib/portage/repository/config.py b/lib/portage/repository/config.py index 482711c4b..4acb36678 100644 --- a/lib/portage/repository/config.py +++ b/lib/portage/repository/config.py @@ -109,6 +109,7 @@ class RepoConfig(object): 'sync_allow_hardlinks', 'sync_depth', 'sync_hooks_only_on_change', + 'sync_openpgp_keyserver', 'sync_openpgp_key_path', 'sync_openpgp_key_refresh_retry_count', 'sync_openpgp_key_refresh_retry_delay_exp_base', @@ -224,8 +225,11 @@ class RepoConfig(object): self.sync_allow_hardlinks = repo_opts.get( 'sync-allow-hardlinks', 'true').lower() in ('true', 'yes') + self.sync_openpgp_keyserver = repo_opts.get( + 'sync-openpgp-keyserver', 'hkps.pool.sks-keyservers.net').strip.lower() + self.sync_openpgp_key_path = repo_opts.get( - 'sync-openpgp-key-path', None) + 'sync-openpgp-key-path', None) for k in ('sync_openpgp_key_refresh_retry_count', 'sync_openpgp_key_refresh_retry_delay_exp_base', @@ -601,6 +605,7 @@ class RepoConfigLoader(object): 'sync_allow_hardlinks', 'sync_depth', 'sync_hooks_only_on_change', + 'sync_openpgp_keyserver', 'sync_openpgp_key_path', 'sync_openpgp_key_refresh_retry_count', 'sync_openpgp_key_refresh_retry_delay_exp_base', @@ -1047,6 +1052,7 @@ class RepoConfigLoader(object): "main_repo", "priority", "sync_depth", + "sync_openpgp_keyserver", "sync_openpgp_key_path", "sync_openpgp_key_refresh_retry_count", "sync_openpgp_key_refresh_retry_delay_exp_base", diff --git a/lib/portage/sync/syncbase.py b/lib/portage/sync/syncbase.py index 83b35c667..ae9ec938e 100644 --- a/lib/portage/sync/syncbase.py +++ b/lib/portage/sync/syncbase.py @@ -252,10 +252,10 @@ class SyncBase(object): @type openpgp_env: gemato.openpgp.OpenPGPEnvironment """ out = portage.output.EOutput(quiet=('--quiet' in self.options['emerge_config'].opts)) - out.ebegin('Refreshing keys from keyserver') + out.ebegin('Refreshing keys from keyserver {s}'.format(s=self.repo.sync_openpgp_keyserver)) retry_decorator = self._key_refresh_retry_decorator() if retry_decorator is None: - openpgp_env.refresh_keys() + openpgp_env.refresh_keys(keyserver=self.repo.sync_openpgp_keyserver) else: def noisy_refresh_keys(): """ @@ -263,7 +263,7 @@ class SyncBase(object): errors, display errors as soon as they occur. """ try: - openpgp_env.refresh_keys() + openpgp_env.refresh_keys(keyserver=self.repo.sync_openpgp_keyserver) except Exception as e: writemsg_level("%s\n" % (e,), level=logging.ERROR, noiselevel=-1) -- 2.19.2 [-- Attachment #2: signature.asc --] [-- Type: application/pgp-signature, Size: 833 bytes --] ^ permalink raw reply related [flat|nested] 11+ messages in thread
* Re: [gentoo-portage-dev] [PATCH][v3] enable user settable gpg keyservers 2019-02-25 21:41 ` Matthew Thode @ 2019-02-25 21:44 ` Matthew Thode 2019-02-25 21:45 ` [gentoo-portage-dev] [PATCH][v3] enable user settable gpg keyservers (attached) Matthew Thode 1 sibling, 0 replies; 11+ messages in thread From: Matthew Thode @ 2019-02-25 21:44 UTC (permalink / raw To: gentoo-portage-dev [-- Attachment #1: Type: text/plain, Size: 521 bytes --] On 19-02-25 15:41:03, Matthew Thode wrote: > On 19-02-25 14:34:46, Matthew Thode wrote: > > Allowing users to define which keyservers they update from allows them > > to work around buggy keyservers. It is also useful for local mirrors > > and / or private keyservers. > > > > It's likely that I'm setting the default incorrectly and not > > alphabetizing right, but the code works at least... > > > > Ok, let's try that again, should be cleaner/better/etc > v3 -- Matthew Thode (prometheanfire) [-- Attachment #2: signature.asc --] [-- Type: application/pgp-signature, Size: 833 bytes --] ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [gentoo-portage-dev] [PATCH][v3] enable user settable gpg keyservers (attached) 2019-02-25 21:41 ` Matthew Thode 2019-02-25 21:44 ` [gentoo-portage-dev] [PATCH][v3] " Matthew Thode @ 2019-02-25 21:45 ` Matthew Thode 2019-02-26 18:48 ` Zac Medico 1 sibling, 1 reply; 11+ messages in thread From: Matthew Thode @ 2019-02-25 21:45 UTC (permalink / raw To: gentoo-portage-dev [-- Attachment #1.1: Type: text/plain, Size: 531 bytes --] On 19-02-25 15:41:03, Matthew Thode wrote: > On 19-02-25 14:34:46, Matthew Thode wrote: > > Allowing users to define which keyservers they update from allows them > > to work around buggy keyservers. It is also useful for local mirrors > > and / or private keyservers. > > > > It's likely that I'm setting the default incorrectly and not > > alphabetizing right, but the code works at least... > > > > Ok, let's try that again, should be cleaner/better/etc > v3, attached -- Matthew Thode (prometheanfire) [-- Attachment #1.2: 0001-enable-user-settable-gpg-keyservers.patch --] [-- Type: text/x-diff, Size: 3159 bytes --] From f85c1b823c4b15cf3164fa5b7b1bd2a4128c8fdd Mon Sep 17 00:00:00 2001 From: Matthew Thode <mthode@mthode.org> Date: Mon, 25 Feb 2019 14:14:20 -0600 Subject: [PATCH] enable user settable gpg keyservers Allowing users to define which keyservers they update from allows them to work around buggy keyservers. It is also useful for local mirrors and / or private keyservers. Signed-off-by: Matthew Thode <mthode@mthode.org> --- lib/portage/repository/config.py | 6 ++++++ lib/portage/sync/syncbase.py | 6 +++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/lib/portage/repository/config.py b/lib/portage/repository/config.py index 482711c4b..235371ce5 100644 --- a/lib/portage/repository/config.py +++ b/lib/portage/repository/config.py @@ -109,6 +109,7 @@ class RepoConfig(object): 'sync_allow_hardlinks', 'sync_depth', 'sync_hooks_only_on_change', + 'sync_openpgp_keyserver', 'sync_openpgp_key_path', 'sync_openpgp_key_refresh_retry_count', 'sync_openpgp_key_refresh_retry_delay_exp_base', @@ -224,6 +225,9 @@ class RepoConfig(object): self.sync_allow_hardlinks = repo_opts.get( 'sync-allow-hardlinks', 'true').lower() in ('true', 'yes') + self.sync_openpgp_keyserver = repo_opts.get( + 'sync-openpgp-keyserver', 'hkps.pool.sks-keyservers.net').strip.lower() + self.sync_openpgp_key_path = repo_opts.get( 'sync-openpgp-key-path', None) @@ -601,6 +605,7 @@ class RepoConfigLoader(object): 'sync_allow_hardlinks', 'sync_depth', 'sync_hooks_only_on_change', + 'sync_openpgp_keyserver', 'sync_openpgp_key_path', 'sync_openpgp_key_refresh_retry_count', 'sync_openpgp_key_refresh_retry_delay_exp_base', @@ -1047,6 +1052,7 @@ class RepoConfigLoader(object): "main_repo", "priority", "sync_depth", + "sync_openpgp_keyserver", "sync_openpgp_key_path", "sync_openpgp_key_refresh_retry_count", "sync_openpgp_key_refresh_retry_delay_exp_base", diff --git a/lib/portage/sync/syncbase.py b/lib/portage/sync/syncbase.py index 83b35c667..ae9ec938e 100644 --- a/lib/portage/sync/syncbase.py +++ b/lib/portage/sync/syncbase.py @@ -252,10 +252,10 @@ class SyncBase(object): @type openpgp_env: gemato.openpgp.OpenPGPEnvironment """ out = portage.output.EOutput(quiet=('--quiet' in self.options['emerge_config'].opts)) - out.ebegin('Refreshing keys from keyserver') + out.ebegin('Refreshing keys from keyserver {s}'.format(s=self.repo.sync_openpgp_keyserver)) retry_decorator = self._key_refresh_retry_decorator() if retry_decorator is None: - openpgp_env.refresh_keys() + openpgp_env.refresh_keys(keyserver=self.repo.sync_openpgp_keyserver) else: def noisy_refresh_keys(): """ @@ -263,7 +263,7 @@ class SyncBase(object): errors, display errors as soon as they occur. """ try: - openpgp_env.refresh_keys() + openpgp_env.refresh_keys(keyserver=self.repo.sync_openpgp_keyserver) except Exception as e: writemsg_level("%s\n" % (e,), level=logging.ERROR, noiselevel=-1) -- 2.19.2 [-- Attachment #2: signature.asc --] [-- Type: application/pgp-signature, Size: 833 bytes --] ^ permalink raw reply related [flat|nested] 11+ messages in thread
* Re: [gentoo-portage-dev] [PATCH][v3] enable user settable gpg keyservers (attached) 2019-02-25 21:45 ` [gentoo-portage-dev] [PATCH][v3] enable user settable gpg keyservers (attached) Matthew Thode @ 2019-02-26 18:48 ` Zac Medico 2019-02-26 18:52 ` Zac Medico 0 siblings, 1 reply; 11+ messages in thread From: Zac Medico @ 2019-02-26 18:48 UTC (permalink / raw To: gentoo-portage-dev, Matthew Thode [-- Attachment #1.1: Type: text/plain, Size: 1749 bytes --] On 2/25/19 1:45 PM, Matthew Thode wrote: > On 19-02-25 15:41:03, Matthew Thode wrote: >> On 19-02-25 14:34:46, Matthew Thode wrote: >>> Allowing users to define which keyservers they update from allows them >>> to work around buggy keyservers. It is also useful for local mirrors >>> and / or private keyservers. >>> >>> It's likely that I'm setting the default incorrectly and not >>> alphabetizing right, but the code works at least... >>> >> >> Ok, let's try that again, should be cleaner/better/etc >> > > v3, attached > > --- > lib/portage/repository/config.py | 6 ++++++ > lib/portage/sync/syncbase.py | 6 +++--- > 2 files changed, 9 insertions(+), 3 deletions(-) > > diff --git a/lib/portage/repository/config.py b/lib/portage/repository/config.py > index 482711c4b..235371ce5 100644 > --- a/lib/portage/repository/config.py > +++ b/lib/portage/repository/config.py > @@ -109,6 +109,7 @@ class RepoConfig(object): > 'sync_allow_hardlinks', > 'sync_depth', > 'sync_hooks_only_on_change', > + 'sync_openpgp_keyserver', > 'sync_openpgp_key_path', > 'sync_openpgp_key_refresh_retry_count', > 'sync_openpgp_key_refresh_retry_delay_exp_base', > @@ -224,6 +225,9 @@ class RepoConfig(object): > self.sync_allow_hardlinks = repo_opts.get( > 'sync-allow-hardlinks', 'true').lower() in ('true', 'yes') > > + self.sync_openpgp_keyserver = repo_opts.get( > + 'sync-openpgp-keyserver', 'hkps.pool.sks-keyservers.net').strip.lower() It needs to be like this: + 'sync-openpgp-keyserver', 'hkps.pool.sks-keyservers.net').strip().lower() or None because gemato handles None but not empty strings. -- Thanks, Zac [-- Attachment #2: OpenPGP digital signature --] [-- Type: application/pgp-signature, Size: 981 bytes --] ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [gentoo-portage-dev] [PATCH][v3] enable user settable gpg keyservers (attached) 2019-02-26 18:48 ` Zac Medico @ 2019-02-26 18:52 ` Zac Medico 2019-02-26 21:33 ` Matthew Thode 0 siblings, 1 reply; 11+ messages in thread From: Zac Medico @ 2019-02-26 18:52 UTC (permalink / raw To: Zac Medico, gentoo-portage-dev, Matthew Thode [-- Attachment #1.1: Type: text/plain, Size: 1902 bytes --] On 2/26/19 10:48 AM, Zac Medico wrote: > On 2/25/19 1:45 PM, Matthew Thode wrote: >> On 19-02-25 15:41:03, Matthew Thode wrote: >>> On 19-02-25 14:34:46, Matthew Thode wrote: >>>> Allowing users to define which keyservers they update from allows them >>>> to work around buggy keyservers. It is also useful for local mirrors >>>> and / or private keyservers. >>>> >>>> It's likely that I'm setting the default incorrectly and not >>>> alphabetizing right, but the code works at least... >>>> >>> >>> Ok, let's try that again, should be cleaner/better/etc >>> >> >> v3, attached >> >> --- > >> lib/portage/repository/config.py | 6 ++++++ >> lib/portage/sync/syncbase.py | 6 +++--- >> 2 files changed, 9 insertions(+), 3 deletions(-) >> >> diff --git a/lib/portage/repository/config.py b/lib/portage/repository/config.py >> index 482711c4b..235371ce5 100644 >> --- a/lib/portage/repository/config.py >> +++ b/lib/portage/repository/config.py >> @@ -109,6 +109,7 @@ class RepoConfig(object): >> 'sync_allow_hardlinks', >> 'sync_depth', >> 'sync_hooks_only_on_change', >> + 'sync_openpgp_keyserver', >> 'sync_openpgp_key_path', >> 'sync_openpgp_key_refresh_retry_count', >> 'sync_openpgp_key_refresh_retry_delay_exp_base', >> @@ -224,6 +225,9 @@ class RepoConfig(object): >> self.sync_allow_hardlinks = repo_opts.get( >> 'sync-allow-hardlinks', 'true').lower() in ('true', 'yes') >> >> + self.sync_openpgp_keyserver = repo_opts.get( >> + 'sync-openpgp-keyserver', 'hkps.pool.sks-keyservers.net').strip.lower() > > It needs to be like this: > > + 'sync-openpgp-keyserver', 'hkps.pool.sks-keyservers.net').strip().lower() or None > > because gemato handles None but not empty strings. Also let's not provide a default keyserver, let gemato handle that. Also please update man/portage.5. -- Thanks, Zac [-- Attachment #2: OpenPGP digital signature --] [-- Type: application/pgp-signature, Size: 981 bytes --] ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [gentoo-portage-dev] [PATCH][v3] enable user settable gpg keyservers (attached) 2019-02-26 18:52 ` Zac Medico @ 2019-02-26 21:33 ` Matthew Thode 2019-03-03 21:43 ` [gentoo-portage-dev] [PATCH][v4] enable user settable gpg keyservers Matthew Thode 0 siblings, 1 reply; 11+ messages in thread From: Matthew Thode @ 2019-02-26 21:33 UTC (permalink / raw To: gentoo-portage-dev [-- Attachment #1: Type: text/plain, Size: 2329 bytes --] On 19-02-26 10:52:52, Zac Medico wrote: > On 2/26/19 10:48 AM, Zac Medico wrote: > > On 2/25/19 1:45 PM, Matthew Thode wrote: > >> On 19-02-25 15:41:03, Matthew Thode wrote: > >>> On 19-02-25 14:34:46, Matthew Thode wrote: > >>>> Allowing users to define which keyservers they update from allows them > >>>> to work around buggy keyservers. It is also useful for local mirrors > >>>> and / or private keyservers. > >>>> > >>>> It's likely that I'm setting the default incorrectly and not > >>>> alphabetizing right, but the code works at least... > >>>> > >>> > >>> Ok, let's try that again, should be cleaner/better/etc > >>> > >> > >> v3, attached > >> > >> --- > > > >> lib/portage/repository/config.py | 6 ++++++ > >> lib/portage/sync/syncbase.py | 6 +++--- > >> 2 files changed, 9 insertions(+), 3 deletions(-) > >> > >> diff --git a/lib/portage/repository/config.py b/lib/portage/repository/config.py > >> index 482711c4b..235371ce5 100644 > >> --- a/lib/portage/repository/config.py > >> +++ b/lib/portage/repository/config.py > >> @@ -109,6 +109,7 @@ class RepoConfig(object): > >> 'sync_allow_hardlinks', > >> 'sync_depth', > >> 'sync_hooks_only_on_change', > >> + 'sync_openpgp_keyserver', > >> 'sync_openpgp_key_path', > >> 'sync_openpgp_key_refresh_retry_count', > >> 'sync_openpgp_key_refresh_retry_delay_exp_base', > >> @@ -224,6 +225,9 @@ class RepoConfig(object): > >> self.sync_allow_hardlinks = repo_opts.get( > >> 'sync-allow-hardlinks', 'true').lower() in ('true', 'yes') > >> > >> + self.sync_openpgp_keyserver = repo_opts.get( > >> + 'sync-openpgp-keyserver', 'hkps.pool.sks-keyservers.net').strip.lower() > > > > It needs to be like this: > > > > + 'sync-openpgp-keyserver', 'hkps.pool.sks-keyservers.net').strip().lower() or None > > > > because gemato handles None but not empty strings. > > Also let's not provide a default keyserver, let gemato handle that. > > Also please update man/portage.5. > Ok, that stanza no reads: self.sync_openpgp_keyserver = repo_opts.get( 'sync-openpgp-keyserver').strip.lower() or None I didn't see a section for the sync-openpgp options though, let me know anything else or I'll send the updated patch tonight. -- Matthew Thode (prometheanfire) [-- Attachment #2: signature.asc --] [-- Type: application/pgp-signature, Size: 833 bytes --] ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [gentoo-portage-dev] [PATCH][v4] enable user settable gpg keyservers 2019-02-26 21:33 ` Matthew Thode @ 2019-03-03 21:43 ` Matthew Thode 2019-03-31 19:47 ` Zac Medico 0 siblings, 1 reply; 11+ messages in thread From: Matthew Thode @ 2019-03-03 21:43 UTC (permalink / raw To: gentoo-portage-dev [-- Attachment #1.1: Type: text/plain, Size: 2611 bytes --] On 19-02-26 15:33:53, Matthew Thode wrote: > On 19-02-26 10:52:52, Zac Medico wrote: > > On 2/26/19 10:48 AM, Zac Medico wrote: > > > On 2/25/19 1:45 PM, Matthew Thode wrote: > > >> On 19-02-25 15:41:03, Matthew Thode wrote: > > >>> On 19-02-25 14:34:46, Matthew Thode wrote: > > >>>> Allowing users to define which keyservers they update from allows them > > >>>> to work around buggy keyservers. It is also useful for local mirrors > > >>>> and / or private keyservers. > > >>>> > > >>>> It's likely that I'm setting the default incorrectly and not > > >>>> alphabetizing right, but the code works at least... > > >>>> > > >>> > > >>> Ok, let's try that again, should be cleaner/better/etc > > >>> > > >> > > >> v3, attached > > >> > > >> --- > > > > > >> lib/portage/repository/config.py | 6 ++++++ > > >> lib/portage/sync/syncbase.py | 6 +++--- > > >> 2 files changed, 9 insertions(+), 3 deletions(-) > > >> > > >> diff --git a/lib/portage/repository/config.py b/lib/portage/repository/config.py > > >> index 482711c4b..235371ce5 100644 > > >> --- a/lib/portage/repository/config.py > > >> +++ b/lib/portage/repository/config.py > > >> @@ -109,6 +109,7 @@ class RepoConfig(object): > > >> 'sync_allow_hardlinks', > > >> 'sync_depth', > > >> 'sync_hooks_only_on_change', > > >> + 'sync_openpgp_keyserver', > > >> 'sync_openpgp_key_path', > > >> 'sync_openpgp_key_refresh_retry_count', > > >> 'sync_openpgp_key_refresh_retry_delay_exp_base', > > >> @@ -224,6 +225,9 @@ class RepoConfig(object): > > >> self.sync_allow_hardlinks = repo_opts.get( > > >> 'sync-allow-hardlinks', 'true').lower() in ('true', 'yes') > > >> > > >> + self.sync_openpgp_keyserver = repo_opts.get( > > >> + 'sync-openpgp-keyserver', 'hkps.pool.sks-keyservers.net').strip.lower() > > > > > > It needs to be like this: > > > > > > + 'sync-openpgp-keyserver', 'hkps.pool.sks-keyservers.net').strip().lower() or None > > > > > > because gemato handles None but not empty strings. > > > > Also let's not provide a default keyserver, let gemato handle that. > > > > Also please update man/portage.5. > > > > Ok, that stanza no reads: > > self.sync_openpgp_keyserver = repo_opts.get( > 'sync-openpgp-keyserver').strip.lower() or None > > I didn't see a section for the sync-openpgp options though, let me know > anything else or I'll send the updated patch tonight. > v4 patch attached (as said previously, no section in man page for sync-openpgp options so not added there). -- Matthew Thode (prometheanfire) [-- Attachment #1.2: 0001-enable-user-settable-gpg-keyservers.patch --] [-- Type: text/x-diff, Size: 3135 bytes --] From f87a788f58b4efab07d09947be0920bffa01c66b Mon Sep 17 00:00:00 2001 From: Matthew Thode <mthode@mthode.org> Date: Mon, 25 Feb 2019 14:14:20 -0600 Subject: [PATCH] enable user settable gpg keyservers Allowing users to define which keyservers they update from allows them to work around buggy keyservers. It is also useful for local mirrors and / or private keyservers. Signed-off-by: Matthew Thode <mthode@mthode.org> --- lib/portage/repository/config.py | 6 ++++++ lib/portage/sync/syncbase.py | 6 +++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/lib/portage/repository/config.py b/lib/portage/repository/config.py index 482711c4b..e9d5e0a9a 100644 --- a/lib/portage/repository/config.py +++ b/lib/portage/repository/config.py @@ -109,6 +109,7 @@ class RepoConfig(object): 'sync_allow_hardlinks', 'sync_depth', 'sync_hooks_only_on_change', + 'sync_openpgp_keyserver', 'sync_openpgp_key_path', 'sync_openpgp_key_refresh_retry_count', 'sync_openpgp_key_refresh_retry_delay_exp_base', @@ -224,6 +225,9 @@ class RepoConfig(object): self.sync_allow_hardlinks = repo_opts.get( 'sync-allow-hardlinks', 'true').lower() in ('true', 'yes') + self.sync_openpgp_keyserver = repo_opts.get( + 'sync-openpgp-keyserver').strip.lower() or None + self.sync_openpgp_key_path = repo_opts.get( 'sync-openpgp-key-path', None) @@ -601,6 +605,7 @@ class RepoConfigLoader(object): 'sync_allow_hardlinks', 'sync_depth', 'sync_hooks_only_on_change', + 'sync_openpgp_keyserver', 'sync_openpgp_key_path', 'sync_openpgp_key_refresh_retry_count', 'sync_openpgp_key_refresh_retry_delay_exp_base', @@ -1047,6 +1052,7 @@ class RepoConfigLoader(object): "main_repo", "priority", "sync_depth", + "sync_openpgp_keyserver", "sync_openpgp_key_path", "sync_openpgp_key_refresh_retry_count", "sync_openpgp_key_refresh_retry_delay_exp_base", diff --git a/lib/portage/sync/syncbase.py b/lib/portage/sync/syncbase.py index 83b35c667..ae9ec938e 100644 --- a/lib/portage/sync/syncbase.py +++ b/lib/portage/sync/syncbase.py @@ -252,10 +252,10 @@ class SyncBase(object): @type openpgp_env: gemato.openpgp.OpenPGPEnvironment """ out = portage.output.EOutput(quiet=('--quiet' in self.options['emerge_config'].opts)) - out.ebegin('Refreshing keys from keyserver') + out.ebegin('Refreshing keys from keyserver {s}'.format(s=self.repo.sync_openpgp_keyserver)) retry_decorator = self._key_refresh_retry_decorator() if retry_decorator is None: - openpgp_env.refresh_keys() + openpgp_env.refresh_keys(keyserver=self.repo.sync_openpgp_keyserver) else: def noisy_refresh_keys(): """ @@ -263,7 +263,7 @@ class SyncBase(object): errors, display errors as soon as they occur. """ try: - openpgp_env.refresh_keys() + openpgp_env.refresh_keys(keyserver=self.repo.sync_openpgp_keyserver) except Exception as e: writemsg_level("%s\n" % (e,), level=logging.ERROR, noiselevel=-1) -- 2.19.2 [-- Attachment #2: signature.asc --] [-- Type: application/pgp-signature, Size: 833 bytes --] ^ permalink raw reply related [flat|nested] 11+ messages in thread
* Re: [gentoo-portage-dev] [PATCH][v4] enable user settable gpg keyservers 2019-03-03 21:43 ` [gentoo-portage-dev] [PATCH][v4] enable user settable gpg keyservers Matthew Thode @ 2019-03-31 19:47 ` Zac Medico 0 siblings, 0 replies; 11+ messages in thread From: Zac Medico @ 2019-03-31 19:47 UTC (permalink / raw To: gentoo-portage-dev, Matthew Thode [-- Attachment #1.1: Type: text/plain, Size: 2712 bytes --] On 3/3/19 1:43 PM, Matthew Thode wrote: > On 19-02-26 15:33:53, Matthew Thode wrote: >> On 19-02-26 10:52:52, Zac Medico wrote: >>> On 2/26/19 10:48 AM, Zac Medico wrote: >>>> On 2/25/19 1:45 PM, Matthew Thode wrote: >>>>> On 19-02-25 15:41:03, Matthew Thode wrote: >>>>>> On 19-02-25 14:34:46, Matthew Thode wrote: >>>>>>> Allowing users to define which keyservers they update from allows them >>>>>>> to work around buggy keyservers. It is also useful for local mirrors >>>>>>> and / or private keyservers. >>>>>>> >>>>>>> It's likely that I'm setting the default incorrectly and not >>>>>>> alphabetizing right, but the code works at least... >>>>>>> >>>>>> >>>>>> Ok, let's try that again, should be cleaner/better/etc >>>>>> >>>>> >>>>> v3, attached >>>>> >>>>> --- >>>> >>>>> lib/portage/repository/config.py | 6 ++++++ >>>>> lib/portage/sync/syncbase.py | 6 +++--- >>>>> 2 files changed, 9 insertions(+), 3 deletions(-) >>>>> >>>>> diff --git a/lib/portage/repository/config.py b/lib/portage/repository/config.py >>>>> index 482711c4b..235371ce5 100644 >>>>> --- a/lib/portage/repository/config.py >>>>> +++ b/lib/portage/repository/config.py >>>>> @@ -109,6 +109,7 @@ class RepoConfig(object): >>>>> 'sync_allow_hardlinks', >>>>> 'sync_depth', >>>>> 'sync_hooks_only_on_change', >>>>> + 'sync_openpgp_keyserver', >>>>> 'sync_openpgp_key_path', >>>>> 'sync_openpgp_key_refresh_retry_count', >>>>> 'sync_openpgp_key_refresh_retry_delay_exp_base', >>>>> @@ -224,6 +225,9 @@ class RepoConfig(object): >>>>> self.sync_allow_hardlinks = repo_opts.get( >>>>> 'sync-allow-hardlinks', 'true').lower() in ('true', 'yes') >>>>> >>>>> + self.sync_openpgp_keyserver = repo_opts.get( >>>>> + 'sync-openpgp-keyserver', 'hkps.pool.sks-keyservers.net').strip.lower() >>>> >>>> It needs to be like this: >>>> >>>> + 'sync-openpgp-keyserver', 'hkps.pool.sks-keyservers.net').strip().lower() or None >>>> >>>> because gemato handles None but not empty strings. >>> >>> Also let's not provide a default keyserver, let gemato handle that. >>> >>> Also please update man/portage.5. >>> >> >> Ok, that stanza no reads: >> >> self.sync_openpgp_keyserver = repo_opts.get( >> 'sync-openpgp-keyserver').strip.lower() or None >> >> I didn't see a section for the sync-openpgp options though, let me know >> anything else or I'll send the updated patch tonight. >> > > v4 patch attached (as said previously, no section in man page for > sync-openpgp options so not added there). Thanks, merged: https://gitweb.gentoo.org/proj/portage.git/commit/?id=244a4021ce58268336fd7b120ab7b9eb09acb26e -- Thanks, Zac [-- Attachment #2: OpenPGP digital signature --] [-- Type: application/pgp-signature, Size: 981 bytes --] ^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2019-03-31 19:47 UTC | newest] Thread overview: 11+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2019-02-25 20:34 [gentoo-portage-dev] [PATCH] enable user settable gpg keyservers Matthew Thode 2019-02-25 20:59 ` Michał Górny 2019-02-25 21:27 ` Matthew Thode 2019-02-25 21:41 ` Matthew Thode 2019-02-25 21:44 ` [gentoo-portage-dev] [PATCH][v3] " Matthew Thode 2019-02-25 21:45 ` [gentoo-portage-dev] [PATCH][v3] enable user settable gpg keyservers (attached) Matthew Thode 2019-02-26 18:48 ` Zac Medico 2019-02-26 18:52 ` Zac Medico 2019-02-26 21:33 ` Matthew Thode 2019-03-03 21:43 ` [gentoo-portage-dev] [PATCH][v4] enable user settable gpg keyservers Matthew Thode 2019-03-31 19:47 ` Zac Medico
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox