PGP fingerprint in profile

main
Bob Mottram 2020-07-06 11:14:41 +01:00
parent 6817cc8329
commit c34aa81962
17 changed files with 54 additions and 4 deletions

View File

@ -30,7 +30,9 @@ from metadata import metaDataNodeInfo
from pgp import getEmailAddress
from pgp import setEmailAddress
from pgp import getPGPpubKey
from pgp import getPGPfingerprint
from pgp import setPGPpubKey
from pgp import setPGPfingerprint
from xmpp import getXmppAddress
from xmpp import setXmppAddress
from ssb import getSSBAddress
@ -1549,6 +1551,7 @@ class PubServer(BaseHTTPRequestHandler):
optionsLink = optionsList[3]
donateUrl = None
PGPpubKey = None
PGPfingerprint = None
xmppAddress = None
matrixAddress = None
blogAddress = None
@ -1567,6 +1570,7 @@ class PubServer(BaseHTTPRequestHandler):
toxAddress = getToxAddress(actorJson)
emailAddress = getEmailAddress(actorJson)
PGPpubKey = getPGPpubKey(actorJson)
PGPfingerprint = getPGPfingerprint(actorJson)
msg = htmlPersonOptions(self.server.translate,
self.server.baseDir,
self.server.domain,
@ -1577,7 +1581,8 @@ class PubServer(BaseHTTPRequestHandler):
pageNumber, donateUrl,
xmppAddress, matrixAddress,
ssbAddress, blogAddress,
toxAddress, PGPpubKey,
toxAddress,
PGPpubKey, PGPfingerprint,
emailAddress).encode('utf-8')
self._set_headers('text/html', len(msg),
cookie, callingDomain)
@ -6242,6 +6247,17 @@ class PubServer(BaseHTTPRequestHandler):
setPGPpubKey(actorJson, '')
actorChanged = True
currentPGPfingerprint = getPGPfingerprint(actorJson)
if fields.get('openpgp'):
if fields['openpgp'] != currentPGPfingerprint:
setPGPfingerprint(actorJson,
fields['openpgp'])
actorChanged = True
else:
if currentPGPfingerprint:
setPGPfingerprint(actorJson, '')
actorChanged = True
currentDonateUrl = getDonationUrl(actorJson)
if fields.get('donateUrl'):
if fields['donateUrl'] != currentDonateUrl:

View File

@ -206,6 +206,7 @@
"Matrix": "Matrix",
"Email": "البريد الإلكتروني",
"PGP": "PGP",
"PGP Fingerprint": "بصمة PGP",
"This is a scheduled post.": "هذا هو المقرر المقرر.",
"Remove scheduled posts": "إزالة المشاركات المجدولة",
"Remove Twitter posts": "إزالة مشاركات Twitter",

View File

@ -206,6 +206,7 @@
"Matrix": "Matrix",
"Email": "Correu electrònic",
"PGP": "PGP",
"PGP Fingerprint": "Empremta digital PGP",
"This is a scheduled post.": "Aquesta és una publicació programada.",
"Remove scheduled posts": "Elimineu les publicacions programades",
"Remove Twitter posts": "Elimina les publicacions de Twitter",

View File

@ -206,6 +206,7 @@
"Matrix": "Matrix",
"Email": "E-bost",
"PGP": "PGP",
"PGP Fingerprint": "Olion Bysedd PGP",
"This is a scheduled post.": "Mae hon yn swydd wedi'i hamserlennu.",
"Remove scheduled posts": "Tynnwch y swyddi a drefnwyd",
"Remove Twitter posts": "Dileu postiadau Twitter",

View File

@ -206,6 +206,7 @@
"Matrix": "Matrix",
"Email": "Email",
"PGP": "PGP",
"PGP Fingerprint": "PGP Fingerabdruck",
"This is a scheduled post.": "Dies ist ein geplanter Beitrag.",
"Remove scheduled posts": "Geplante Posts entfernen",
"Remove Twitter posts": "Entfernen Sie Twitter-Posts",

View File

@ -205,7 +205,8 @@
"XMPP": "XMPP",
"Matrix": "Matrix",
"Email": "Email",
"PGP": "PGP",
"PGP": "PGP Key",
"PGP Fingerprint": "PGP Fingerprint",
"This is a scheduled post.": "This is a scheduled post.",
"Remove scheduled posts": "Remove scheduled posts",
"Remove Twitter posts": "Remove Twitter posts",

View File

@ -206,6 +206,7 @@
"Matrix": "Matrix",
"Email": "Email",
"PGP": "PGP",
"PGP Fingerprint": "Huella digital PGP",
"This is a scheduled post.": "Esta es una publicación programada.",
"Remove scheduled posts": "Eliminar publicaciones programadas",
"Remove Twitter posts": "Eliminar publicaciones de Twitter",

View File

@ -206,6 +206,7 @@
"Matrix": "Matrix",
"Email": "Email",
"PGP": "PGP",
"PGP Fingerprint": "Empreinte digitale PGP",
"This is a scheduled post.": "Il s'agit d'un article programmé.",
"Remove scheduled posts": "Supprimer les messages planifiés",
"Remove Twitter posts": "Supprimer les messages Twitter",

View File

@ -206,6 +206,7 @@
"Matrix": "Matrix",
"Email": "Ríomhphost",
"PGP": "PGP",
"PGP Fingerprint": "Méarlorg PGP",
"This is a scheduled post.": "Is post sceidealta é seo.",
"Remove scheduled posts": "Bain na poist sceidealta",
"Remove Twitter posts": "Bain poist Twitter",

View File

@ -205,7 +205,8 @@
"XMPP": "XMPP",
"Matrix": "Matrix",
"Email": "ईमेल",
"PGP": "PGP",
"PGP": "पीजीपी",
"PGP Fingerprint": "पीजीपी फिंगरप्रिंट",
"This is a scheduled post.": "यह एक अनुसूचित पद है।",
"Remove scheduled posts": "अनुसूचित पदों को हटा दें",
"Remove Twitter posts": "ट्विटर पोस्ट हटाएं",

View File

@ -206,6 +206,7 @@
"Matrix": "Matrix",
"Email": "E-mail",
"PGP": "PGP",
"PGP Fingerprint": "Impronta digitale PGP",
"This is a scheduled post.": "Questo è un post programmato",
"Remove scheduled posts": "Rimuovi i post programmati",
"Remove Twitter posts": "Rimuovi i post di Twitter",

View File

@ -206,6 +206,7 @@
"Matrix": "Matrix",
"Email": "Eメール",
"PGP": "PGP",
"PGP Fingerprint": "PGPフィンガープリント",
"This is a scheduled post.": "これはスケジュールされた投稿です。",
"Remove scheduled posts": "スケジュールされた投稿を削除する",
"Remove Twitter posts": "Twitterの投稿を削除する",

View File

@ -202,6 +202,7 @@
"Matrix": "Matrix",
"Email": "Email",
"PGP": "PGP",
"PGP Fingerprint": "PGP Fingerprint",
"This is a scheduled post.": "This is a scheduled post.",
"Remove scheduled posts": "Remove scheduled posts",
"Remove Twitter posts": "Remove Twitter posts",

View File

@ -206,6 +206,7 @@
"Matrix": "Matrix",
"Email": "Email",
"PGP": "PGP",
"PGP Fingerprint": "Impressão digital PGP",
"This is a scheduled post.": "Esta é uma postagem agendada.",
"Remove scheduled posts": "Remover postagens agendadas",
"Remove Twitter posts": "Remover postagens do Twitter",

View File

@ -206,6 +206,7 @@
"Matrix": "Matrix",
"Email": "Эл. адрес",
"PGP": "PGP",
"PGP Fingerprint": "PGP Отпечаток пальца",
"This is a scheduled post.": "Это запланированный пост.",
"Remove scheduled posts": "Удалить запланированные сообщения",
"Remove Twitter posts": "Удалить сообщения из Твиттера",

View File

@ -205,6 +205,7 @@
"Matrix": "Matrix",
"Email": "电子邮件",
"PGP": "PGP",
"PGP Fingerprint": "PGP指纹",
"This is a scheduled post.": "这是预定的帖子。",
"Remove scheduled posts": "删除预定的帖子",
"Remove Twitter posts": "删除Twitter帖子",

View File

@ -19,6 +19,7 @@ from person import personBoxJson
from person import isPersonSnoozed
from pgp import getEmailAddress
from pgp import getPGPpubKey
from pgp import getPGPfingerprint
from xmpp import getXmppAddress
from ssb import getSSBAddress
from tox import getToxAddress
@ -1050,6 +1051,7 @@ def htmlEditProfile(translate: {}, baseDir: str, path: str,
donateUrl = ''
emailAddress = ''
PGPpubKey = ''
PGPfingerprint = ''
xmppAddress = ''
matrixAddress = ''
ssbAddress = ''
@ -1066,6 +1068,7 @@ def htmlEditProfile(translate: {}, baseDir: str, path: str,
toxAddress = getToxAddress(actorJson)
emailAddress = getEmailAddress(actorJson)
PGPpubKey = getPGPpubKey(actorJson)
PGPfingerprint = getPGPfingerprint(actorJson)
if actorJson.get('name'):
displayNickname = actorJson['name']
if actorJson.get('summary'):
@ -1331,6 +1334,12 @@ def htmlEditProfile(translate: {}, baseDir: str, path: str,
translate['Email'] + '</label><br>'
editProfileForm += \
' <input type="text" name="email" value="' + emailAddress + '">'
editProfileForm += \
'<label class="labels">' + \
translate['PGP Fingerprint'] + '</label><br>'
editProfileForm += \
' <input type="text" name="openpgp" value="' + \
PGPfingerprint + '">'
editProfileForm += \
'<label class="labels">' + translate['PGP'] + '</label><br>'
editProfileForm += \
@ -2550,13 +2559,15 @@ def htmlProfile(defaultTimeline: str,
donateSection = ''
donateUrl = getDonationUrl(profileJson)
PGPpubKey = getPGPpubKey(profileJson)
PGPfingerprint = getPGPfingerprint(profileJson)
emailAddress = getEmailAddress(profileJson)
xmppAddress = getXmppAddress(profileJson)
matrixAddress = getMatrixAddress(profileJson)
ssbAddress = getSSBAddress(profileJson)
toxAddress = getToxAddress(profileJson)
if donateUrl or xmppAddress or matrixAddress or \
ssbAddress or toxAddress or PGPpubKey or emailAddress:
ssbAddress or toxAddress or PGPpubKey or \
PGPfingerprint or emailAddress:
donateSection = '<div class="container">\n'
donateSection += ' <center>\n'
if donateUrl:
@ -2583,6 +2594,10 @@ def htmlProfile(defaultTimeline: str,
donateSection += \
'<p>Tox: <label class="ssbaddr">' + \
toxAddress + '</label></p>\n'
if PGPfingerprint:
donateSection += \
'<p class="pgp">PGP: ' + \
PGPfingerprint.replace('\n', '<br>') + '</p>\n'
if PGPpubKey:
donateSection += \
'<p class="pgp">' + PGPpubKey.replace('\n', '<br>') + '</p>\n'
@ -5314,6 +5329,7 @@ def htmlPersonOptions(translate: {}, baseDir: str,
blogAddress: str,
toxAddress: str,
PGPpubKey: str,
PGPfingerprint: str,
emailAddress) -> str:
"""Show options for a person: view/follow/block/report
"""
@ -5411,6 +5427,9 @@ def htmlPersonOptions(translate: {}, baseDir: str,
if toxAddress:
optionsStr += \
'<p class="imText">Tox: ' + toxAddress + '</p>'
if PGPfingerprint:
optionsStr += '<p class="pgp">PGP: ' + \
PGPfingerprint.replace('\n', '<br>') + '</p>'
if PGPpubKey:
optionsStr += '<p class="pgp">' + \
PGPpubKey.replace('\n', '<br>') + '</p>'