Comments (4)
#!/usr/bin/python
from datetime import datetime, timedelta
import gnupg
gpg = gnupg.GPG(gnupghome='/etc/pacman.d/gnupg')
now = datetime.now()
for key in gpg.list_keys():
expires = key['expires']
# No expiry date
if expires == '':
continue
expired = datetime.fromtimestamp(int(expires))
if now > expired - timedelta(days=200):
for uid in key['uids']:
print(uid)
print("Expired: {}".format(expired))
from archweb.
Archweb already stores the expired date:
from datetime import timedelta
from django.utils import timezone
from devel.models import DeveloperKey
now = timezone.now()
for key in DeveloperKey.objects.all():
# No expiry
if key.expires is None:
continue
if now > key.expires - timedelta(days=200):
print(key.owner)
from archweb.
When a key is almost expired report an issue. The issues can be shown in archweb or mailed to a mailing list.
Since key issues (almost expired or key/UID revocation) can be related to issues with a specific email address, I think an external place where these are displayed (or may be easily checked by the packager) is indeed a good idea.
I suppose you could also have the packager leave a secondary email address to where such issues are mailed to, if such is reasonable to implement. (Besides the email address left in the flyspray profile, assuming by issues you mean bugs.archlinux.org issues)
from archweb.
There are two checks required:
One for Package packages with almost expired keys, this can be handled in archweb but won't be fast:
from main.models import Package
from devel.models import MasterKey, DeveloperKey, PGPSignature, StaffGroup, UserProfile
pkg = Package.objects.first()
sig = pkg.signature
matching_key = DeveloperKey.objects.select_related('owner').get(key=sig.key_id, owner_id__isnull=False)
Then check if any matching_key.expires
To check if a packager's keys are expired will be a more difficult task. Archweb does not know which key is used for signing since there can be multiple subkeys which might be expired. Archweb should therefore check if there is any valid signing subkey for this user with at least 3 signatures.
from archweb.
Related Issues (20)
- [feat] security HOT 2
- Git support HOT 5
- update_planet sometimes fails with http.client.* exceptions HOT 1
- Add pronouns field in the user profile HOT 5
- Notify existing maintainers when a new maintainer is added HOT 1
- Link to the Arch Linux Archive on package pages HOT 2
- Extend add todolist with prefill packages from packager HOT 1
- Add a Upstream and Tier values to the /mirrors/xyz/json/ endpoint
- smtpd is removed in 3.12
- TU's cannot adopt packages from extra in new packaging system
- simple json API endpoint to get a mapping of pkgbase to maintainers HOT 1
- todolists - information loss since git migration HOT 2
- [packages] "Bug Reports"/"Add New Bug" package actions use the wrong project id HOT 5
- KDE-Unstable appears on search
- Package "out of date" flag date is inaccurate for mixed major/minor releases HOT 3
- Simple API endpoints for pkgctl
- Links between Packages and Package Groups Overview HOT 4
- Keep devel navigation visible when logged out
- Dead links on https://archlinux.org/planet/ page HOT 1
- Missing timezone search feature on the AUR page
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from archweb.