mirror of
https://git.pleroma.social/pleroma/relay.git
synced 2024-11-12 18:58:00 +00:00
nodeinfo: add commit hash to version field to prevent scams
This commit is contained in:
parent
e44544d22e
commit
008f43db2c
|
@ -1,3 +1,4 @@
|
|||
import subprocess
|
||||
import urllib.parse
|
||||
|
||||
import aiohttp.web
|
||||
|
@ -6,6 +7,12 @@ from . import app
|
|||
from .database import DATABASE
|
||||
|
||||
|
||||
try:
|
||||
commit_label = subprocess.check_output(["git", "rev-parse", "HEAD"]).strip().decode('ascii')
|
||||
except:
|
||||
commit_label = '???'
|
||||
|
||||
|
||||
nodeinfo_template = {
|
||||
# XXX - is this valid for a relay?
|
||||
'openRegistrations': True,
|
||||
|
@ -16,7 +23,7 @@ nodeinfo_template = {
|
|||
},
|
||||
'software': {
|
||||
'name': 'activityrelay',
|
||||
'version': '0.1'
|
||||
'version': '0.1 {}'.format(commit_label)
|
||||
},
|
||||
'usage': {
|
||||
'localPosts': 0,
|
||||
|
|
Loading…
Reference in a new issue