Merge branch 'main' of ssh://code.freedombone.net:2222/bashrc/epicyon

merge-requests/30/head
Bob Mottram 2021-01-26 10:16:43 +00:00
commit ed3497c5aa
94 changed files with 246 additions and 112 deletions

View File

@ -1,7 +1,7 @@
__filename__ = "acceptreject.py"
__author__ = "Bob Mottram"
__license__ = "AGPL3+"
__version__ = "1.1.0"
__version__ = "1.2.0"
__maintainer__ = "Bob Mottram"
__email__ = "bob@freedombone.net"
__status__ = "Production"

View File

@ -1,7 +1,7 @@
__filename__ = "announce.py"
__author__ = "Bob Mottram"
__license__ = "AGPL3+"
__version__ = "1.1.0"
__version__ = "1.2.0"
__maintainer__ = "Bob Mottram"
__email__ = "bob@freedombone.net"
__status__ = "Production"

View File

@ -1,7 +1,7 @@
__filename__ = "auth.py"
__author__ = "Bob Mottram"
__license__ = "AGPL3+"
__version__ = "1.1.0"
__version__ = "1.2.0"
__maintainer__ = "Bob Mottram"
__email__ = "bob@freedombone.net"
__status__ = "Production"

View File

@ -1,7 +1,7 @@
__filename__ = "availability.py"
__author__ = "Bob Mottram"
__license__ = "AGPL3+"
__version__ = "1.1.0"
__version__ = "1.2.0"
__maintainer__ = "Bob Mottram"
__email__ = "bob@freedombone.net"
__status__ = "Production"

View File

@ -1,7 +1,7 @@
__filename__ = "blocking.py"
__author__ = "Bob Mottram"
__license__ = "AGPL3+"
__version__ = "1.1.0"
__version__ = "1.2.0"
__maintainer__ = "Bob Mottram"
__email__ = "bob@freedombone.net"
__status__ = "Production"

View File

@ -1,7 +1,7 @@
__filename__ = "blog.py"
__author__ = "Bob Mottram"
__license__ = "AGPL3+"
__version__ = "1.1.0"
__version__ = "1.2.0"
__maintainer__ = "Bob Mottram"
__email__ = "bob@freedombone.net"
__status__ = "Production"

View File

@ -1,7 +1,7 @@
__filename__ = "bookmarks.py"
__author__ = "Bob Mottram"
__license__ = "AGPL3+"
__version__ = "1.1.0"
__version__ = "1.2.0"
__maintainer__ = "Bob Mottram"
__email__ = "bob@freedombone.net"
__status__ = "Production"

View File

@ -1,7 +1,7 @@
__filename__ = "briar.py"
__author__ = "Bob Mottram"
__license__ = "AGPL3+"
__version__ = "1.1.0"
__version__ = "1.2.0"
__maintainer__ = "Bob Mottram"
__email__ = "bob@freedombone.net"
__status__ = "Production"

View File

@ -1,7 +1,7 @@
__filename__ = "cache.py"
__author__ = "Bob Mottram"
__license__ = "AGPL3+"
__version__ = "1.1.0"
__version__ = "1.2.0"
__maintainer__ = "Bob Mottram"
__email__ = "bob@freedombone.net"
__status__ = "Production"

View File

@ -1,7 +1,7 @@
__filename__ = "categories.py"
__author__ = "Bob Mottram"
__license__ = "AGPL3+"
__version__ = "1.1.0"
__version__ = "1.2.0"
__maintainer__ = "Bob Mottram"
__email__ = "bob@freedombone.net"
__status__ = "Production"

View File

@ -1,7 +1,7 @@
__filename__ = "content.py"
__author__ = "Bob Mottram"
__license__ = "AGPL3+"
__version__ = "1.1.0"
__version__ = "1.2.0"
__maintainer__ = "Bob Mottram"
__email__ = "bob@freedombone.net"
__status__ = "Production"

View File

@ -1,7 +1,7 @@
__filename__ = "inbox.py"
__author__ = "Bob Mottram"
__license__ = "AGPL3+"
__version__ = "1.1.0"
__version__ = "1.2.0"
__maintainer__ = "Bob Mottram"
__email__ = "bob@freedombone.net"
__status__ = "Production"

View File

@ -1,7 +1,7 @@
__filename__ = "daemon.py"
__author__ = "Bob Mottram"
__license__ = "AGPL3+"
__version__ = "1.1.0"
__version__ = "1.2.0"
__maintainer__ = "Bob Mottram"
__email__ = "bob@freedombone.net"
__status__ = "Production"
@ -68,6 +68,8 @@ from person import removeAccount
from person import canRemovePost
from person import personSnooze
from person import personUnsnooze
from posts import outboxMessageCreateWrap
from posts import getPinnedPostAsJson
from posts import pinPost
from posts import jsonPinPost
from posts import undoPinnedPost
@ -183,6 +185,7 @@ from shares import addShare
from shares import removeShare
from shares import expireShares
from categories import setHashtagCategory
from utils import decodedHost
from utils import isPublicPost
from utils import getLockedAccount
from utils import hasUsersPath
@ -9875,7 +9878,7 @@ class PubServer(BaseHTTPRequestHandler):
def do_GET(self):
callingDomain = self.server.domainFull
if self.headers.get('Host'):
callingDomain = self.headers['Host']
callingDomain = decodedHost(self.headers['Host'])
if self.server.onionDomain:
if callingDomain != self.server.domain and \
callingDomain != self.server.domainFull and \
@ -10149,7 +10152,39 @@ class PubServer(BaseHTTPRequestHandler):
if '/users/' in self.path:
usersInPath = True
if usersInPath and self.path.endswith('/collections/featured'):
if not htmlGET and \
usersInPath and self.path.endswith('/pinned'):
nickname = self.path.split('/users/')[1]
if '/' in nickname:
nickname = nickname.split('/')[0]
pinnedPostJson = \
getPinnedPostAsJson(self.server.baseDir,
self.server.httpPrefix,
nickname, self.server.domain,
self.server.domainFull)
messageJson = {}
if pinnedPostJson:
postId = pinnedPostJson['id']
messageJson = \
outboxMessageCreateWrap(self.server.httpPrefix,
nickname,
self.server.domain,
self.server.port,
pinnedPostJson)
messageJson['id'] = postId + '/activity'
messageJson['object']['id'] = postId
messageJson['object']['url'] = postId.replace('/users/', '/@')
messageJson['object']['atomUri'] = postId
msg = json.dumps(messageJson,
ensure_ascii=False).encode('utf-8')
msglen = len(msg)
self._set_headers('application/json',
msglen, None, callingDomain)
self._write(msg)
return
if not htmlGET and \
usersInPath and self.path.endswith('/collections/featured'):
nickname = self.path.split('/users/')[1]
if '/' in nickname:
nickname = nickname.split('/')[0]
@ -10161,7 +10196,8 @@ class PubServer(BaseHTTPRequestHandler):
self.server.domainFull)
return
if usersInPath and self.path.endswith('/collections/featuredTags'):
if not htmlGET and \
usersInPath and self.path.endswith('/collections/featuredTags'):
self._getFeaturedTagsCollection(callingDomain,
self.path,
self.server.httpPrefix,
@ -10404,20 +10440,21 @@ class PubServer(BaseHTTPRequestHandler):
htmlAbout(self.server.cssCache,
self.server.baseDir, 'http',
self.server.onionDomain,
None)
None, self.server.translate)
elif callingDomain.endswith('.i2p'):
msg = \
htmlAbout(self.server.cssCache,
self.server.baseDir, 'http',
self.server.i2pDomain,
None)
None, self.server.translate)
else:
msg = \
htmlAbout(self.server.cssCache,
self.server.baseDir,
self.server.httpPrefix,
self.server.domainFull,
self.server.onionDomain)
self.server.onionDomain,
self.server.translate)
msg = msg.encode('utf-8')
msglen = len(msg)
self._login_headers('text/html', msglen, callingDomain)
@ -12034,7 +12071,7 @@ class PubServer(BaseHTTPRequestHandler):
def do_HEAD(self):
callingDomain = self.server.domainFull
if self.headers.get('Host'):
callingDomain = self.headers['Host']
callingDomain = decodedHost(self.headers['Host'])
if self.server.onionDomain:
if callingDomain != self.server.domain and \
callingDomain != self.server.domainFull and \
@ -12985,7 +13022,7 @@ class PubServer(BaseHTTPRequestHandler):
callingDomain = self.server.domainFull
if self.headers.get('Host'):
callingDomain = self.headers['Host']
callingDomain = decodedHost(self.headers['Host'])
if self.server.onionDomain:
if callingDomain != self.server.domain and \
callingDomain != self.server.domainFull and \

View File

@ -1,7 +1,7 @@
__filename__ = "delete.py"
__author__ = "Bob Mottram"
__license__ = "AGPL3+"
__version__ = "1.1.0"
__version__ = "1.2.0"
__maintainer__ = "Bob Mottram"
__email__ = "bob@freedombone.net"
__status__ = "Production"

View File

@ -1,7 +1,7 @@
__filename__ = "devices.py"
__author__ = "Bob Mottram"
__license__ = "AGPL3+"
__version__ = "1.1.0"
__version__ = "1.2.0"
__maintainer__ = "Bob Mottram"
__email__ = "bob@freedombone.net"
__status__ = "Production"

View File

@ -1,7 +1,7 @@
__filename__ = "donate.py"
__author__ = "Bob Mottram"
__license__ = "AGPL3+"
__version__ = "1.1.0"
__version__ = "1.2.0"
__maintainer__ = "Bob Mottram"
__email__ = "bob@freedombone.net"
__status__ = "Production"

View File

@ -538,6 +538,16 @@ a:focus {
border-radius: 0px;
}
.emoji {
float: none;
width: 50px;
margin-left: 0px;
margin-right: 0px;
padding-right: 0px;
border-radius: 0px;
vertical-align: middle;
}
.container img.emoji {
float: none;
width: 50px;

View File

@ -1,7 +1,7 @@
__filename__ = "epicyon.py"
__author__ = "Bob Mottram"
__license__ = "AGPL3+"
__version__ = "1.1.0"
__version__ = "1.2.0"
__maintainer__ = "Bob Mottram"
__email__ = "bob@freedombone.net"
__status__ = "Production"

View File

@ -1,7 +1,7 @@
__filename__ = "feeds.py"
__author__ = "Bob Mottram"
__license__ = "AGPL3+"
__version__ = "1.1.0"
__version__ = "1.2.0"
__maintainer__ = "Bob Mottram"
__email__ = "bob@freedombone.net"
__status__ = "Production"

View File

@ -1,7 +1,7 @@
__filename__ = "filters.py"
__author__ = "Bob Mottram"
__license__ = "AGPL3+"
__version__ = "1.1.0"
__version__ = "1.2.0"
__maintainer__ = "Bob Mottram"
__email__ = "bob@freedombone.net"
__status__ = "Production"

View File

@ -1,7 +1,7 @@
__filename__ = "follow.py"
__author__ = "Bob Mottram"
__license__ = "AGPL3+"
__version__ = "1.1.0"
__version__ = "1.2.0"
__maintainer__ = "Bob Mottram"
__email__ = "bob@freedombone.net"
__status__ = "Production"

View File

@ -1,7 +1,7 @@
__filename__ = "followingCalendar.py"
__author__ = "Bob Mottram"
__license__ = "AGPL3+"
__version__ = "1.1.0"
__version__ = "1.2.0"
__maintainer__ = "Bob Mottram"
__email__ = "bob@freedombone.net"
__status__ = "Production"

2
git.py
View File

@ -1,7 +1,7 @@
__filename__ = "git.py"
__author__ = "Bob Mottram"
__license__ = "AGPL3+"
__version__ = "1.1.0"
__version__ = "1.2.0"
__maintainer__ = "Bob Mottram"
__email__ = "bob@freedombone.net"
__status__ = "Production"

View File

@ -1,7 +1,7 @@
__filename__ = "happening.py"
__author__ = "Bob Mottram"
__license__ = "AGPL3+"
__version__ = "1.1.0"
__version__ = "1.2.0"
__maintainer__ = "Bob Mottram"
__email__ = "bob@freedombone.net"
__status__ = "Production"

View File

@ -2,7 +2,7 @@ __filename__ = "posts.py"
__author__ = "Bob Mottram"
__credits__ = ['lamia']
__license__ = "AGPL3+"
__version__ = "1.1.0"
__version__ = "1.2.0"
__maintainer__ = "Bob Mottram"
__email__ = "bob@freedombone.net"
__status__ = "Production"

View File

@ -1,7 +1,7 @@
__filename__ = "inbox.py"
__author__ = "Bob Mottram"
__license__ = "AGPL3+"
__version__ = "1.1.0"
__version__ = "1.2.0"
__maintainer__ = "Bob Mottram"
__email__ = "bob@freedombone.net"
__status__ = "Production"

View File

@ -1,7 +1,7 @@
__filename__ = "jami.py"
__author__ = "Bob Mottram"
__license__ = "AGPL3+"
__version__ = "1.1.0"
__version__ = "1.2.0"
__maintainer__ = "Bob Mottram"
__email__ = "bob@freedombone.net"
__status__ = "Production"

View File

@ -1,7 +1,7 @@
__filename__ = "like.py"
__author__ = "Bob Mottram"
__license__ = "AGPL3+"
__version__ = "1.1.0"
__version__ = "1.2.0"
__maintainer__ = "Bob Mottram"
__email__ = "bob@freedombone.net"
__status__ = "Production"

View File

@ -3,7 +3,7 @@ __author__ = "Bob Mottram"
__credits__ = ['Based on ' +
'https://github.com/tsileo/little-boxes']
__license__ = "AGPL3+"
__version__ = "1.1.0"
__version__ = "1.2.0"
__maintainer__ = "Bob Mottram"
__email__ = "bob@freedombone.net"
__status__ = "Production"

View File

@ -1,7 +1,7 @@
__filename__ = "manualapprove.py"
__author__ = "Bob Mottram"
__license__ = "AGPL3+"
__version__ = "1.1.0"
__version__ = "1.2.0"
__maintainer__ = "Bob Mottram"
__email__ = "bob@freedombone.net"
__status__ = "Production"

View File

@ -1,7 +1,7 @@
__filename__ = "mastoapiv1.py"
__author__ = "Bob Mottram"
__license__ = "AGPL3+"
__version__ = "1.1.0"
__version__ = "1.2.0"
__maintainer__ = "Bob Mottram"
__email__ = "bob@freedombone.net"
__status__ = "Production"

View File

@ -1,7 +1,7 @@
__filename__ = "matrix.py"
__author__ = "Bob Mottram"
__license__ = "AGPL3+"
__version__ = "1.1.0"
__version__ = "1.2.0"
__maintainer__ = "Bob Mottram"
__email__ = "bob@freedombone.net"
__status__ = "Production"

View File

@ -1,7 +1,7 @@
__filename__ = "media.py"
__author__ = "Bob Mottram"
__license__ = "AGPL3+"
__version__ = "1.1.0"
__version__ = "1.2.0"
__maintainer__ = "Bob Mottram"
__email__ = "bob@freedombone.net"
__status__ = "Production"

View File

@ -1,7 +1,7 @@
__filename__ = "metadata.py"
__author__ = "Bob Mottram"
__license__ = "AGPL3+"
__version__ = "1.1.0"
__version__ = "1.2.0"
__maintainer__ = "Bob Mottram"
__email__ = "bob@freedombone.net"
__status__ = "Production"

View File

@ -1,7 +1,7 @@
__filename__ = "migrate.py"
__author__ = "Bob Mottram"
__license__ = "AGPL3+"
__version__ = "1.1.0"
__version__ = "1.2.0"
__maintainer__ = "Bob Mottram"
__email__ = "bob@freedombone.net"
__status__ = "Production"

View File

@ -1,7 +1,7 @@
__filename__ = "newsdaemon.py"
__author__ = "Bob Mottram"
__license__ = "AGPL3+"
__version__ = "1.1.0"
__version__ = "1.2.0"
__maintainer__ = "Bob Mottram"
__email__ = "bob@freedombone.net"
__status__ = "Production"

View File

@ -1,7 +1,7 @@
__filename__ = "newswire.py"
__author__ = "Bob Mottram"
__license__ = "AGPL3+"
__version__ = "1.1.0"
__version__ = "1.2.0"
__maintainer__ = "Bob Mottram"
__email__ = "bob@freedombone.net"
__status__ = "Production"

View File

@ -1,7 +1,7 @@
__filename__ = "outbox.py"
__author__ = "Bob Mottram"
__license__ = "AGPL3+"
__version__ = "1.1.0"
__version__ = "1.2.0"
__maintainer__ = "Bob Mottram"
__email__ = "bob@freedombone.net"
__status__ = "Production"

View File

@ -1,7 +1,7 @@
__filename__ = "person.py"
__author__ = "Bob Mottram"
__license__ = "AGPL3+"
__version__ = "1.1.0"
__version__ = "1.2.0"
__maintainer__ = "Bob Mottram"
__email__ = "bob@freedombone.net"
__status__ = "Production"

View File

@ -1,7 +1,7 @@
__filename__ = "petnames.py"
__author__ = "Bob Mottram"
__license__ = "AGPL3+"
__version__ = "1.1.0"
__version__ = "1.2.0"
__maintainer__ = "Bob Mottram"
__email__ = "bob@freedombone.net"
__status__ = "Production"

2
pgp.py
View File

@ -1,7 +1,7 @@
__filename__ = "pgp.py"
__author__ = "Bob Mottram"
__license__ = "AGPL3+"
__version__ = "1.1.0"
__version__ = "1.2.0"
__maintainer__ = "Bob Mottram"
__email__ = "bob@freedombone.net"
__status__ = "Production"

View File

@ -1,7 +1,7 @@
__filename__ = "posts.py"
__author__ = "Bob Mottram"
__license__ = "AGPL3+"
__version__ = "1.1.0"
__version__ = "1.2.0"
__maintainer__ = "Bob Mottram"
__email__ = "bob@freedombone.net"
__status__ = "Production"
@ -1298,14 +1298,13 @@ def undoPinnedPost(baseDir: str, nickname: str, domain: str) -> None:
os.remove(pinnedFilename)
def jsonPinPost(baseDir: str, httpPrefix: str,
nickname: str, domain: str,
domainFull: str) -> {}:
"""Returns a pinned post as json
def getPinnedPostAsJson(baseDir: str, httpPrefix: str,
nickname: str, domain: str,
domainFull: str) -> {}:
"""Returns the pinned profile post as json
"""
accountDir = baseDir + '/accounts/' + nickname + '@' + domain
pinnedFilename = accountDir + '/pinToProfile.txt'
itemsList = []
pinnedPostJson = {}
actor = httpPrefix + '://' + domainFull + '/users/' + nickname
if os.path.isfile(pinnedFilename):
@ -1338,7 +1337,23 @@ def jsonPinPost(baseDir: str, httpPrefix: str,
'type': 'Note',
'url': actor.replace('/users/', '/@') + '/pinned'
}
itemsList = [pinnedPostJson]
return pinnedPostJson
def jsonPinPost(baseDir: str, httpPrefix: str,
nickname: str, domain: str,
domainFull: str) -> {}:
"""Returns a pinned post as json
"""
pinnedPostJson = \
getPinnedPostAsJson(baseDir, httpPrefix,
nickname, domain,
domainFull)
itemsList = []
if pinnedPostJson:
itemsList = [pinnedPostJson]
actor = httpPrefix + '://' + domainFull + '/users/' + nickname
return {
'@context': [
'https://www.w3.org/ns/activitystreams',

View File

@ -1,7 +1,7 @@
__filename__ = "question.py"
__author__ = "Bob Mottram"
__license__ = "AGPL3+"
__version__ = "1.1.0"
__version__ = "1.2.0"
__maintainer__ = "Bob Mottram"
__email__ = "bob@freedombone.net"
__status__ = "Production"

View File

@ -1,7 +1,7 @@
__filename__ = "roles.py"
__author__ = "Bob Mottram"
__license__ = "AGPL3+"
__version__ = "1.1.0"
__version__ = "1.2.0"
__maintainer__ = "Bob Mottram"
__email__ = "bob@freedombone.net"
__status__ = "Production"

View File

@ -1,7 +1,7 @@
__filename__ = "schedule.py"
__author__ = "Bob Mottram"
__license__ = "AGPL3+"
__version__ = "1.1.0"
__version__ = "1.2.0"
__maintainer__ = "Bob Mottram"
__email__ = "bob@freedombone.net"
__status__ = "Production"

View File

@ -1,7 +1,7 @@
__filename__ = "session.py"
__author__ = "Bob Mottram"
__license__ = "AGPL3+"
__version__ = "1.1.0"
__version__ = "1.2.0"
__maintainer__ = "Bob Mottram"
__email__ = "bob@freedombone.net"
__status__ = "Production"
@ -54,7 +54,7 @@ def createSession(proxyType: str):
def getJson(session, url: str, headers: {}, params: {},
version='1.1.0', httpPrefix='https',
version='1.2.0', httpPrefix='https',
domain='testdomain') -> {}:
if not isinstance(url, str):
print('url: ' + str(url))

View File

@ -1,7 +1,7 @@
__filename__ = "shares.py"
__author__ = "Bob Mottram"
__license__ = "AGPL3+"
__version__ = "1.1.0"
__version__ = "1.2.0"
__maintainer__ = "Bob Mottram"
__email__ = "bob@freedombone.net"
__status__ = "Production"

View File

@ -1,7 +1,7 @@
__filename__ = "skills.py"
__author__ = "Bob Mottram"
__license__ = "AGPL3+"
__version__ = "1.1.0"
__version__ = "1.2.0"
__maintainer__ = "Bob Mottram"
__email__ = "bob@freedombone.net"
__status__ = "Production"

View File

@ -1,7 +1,7 @@
__filename__ = "socnet.py"
__author__ = "Bob Mottram"
__license__ = "AGPL3+"
__version__ = "1.1.0"
__version__ = "1.2.0"
__maintainer__ = "Bob Mottram"
__email__ = "bob@freedombone.net"
__status__ = "Production"

2
ssb.py
View File

@ -1,7 +1,7 @@
__filename__ = "ssb.py"
__author__ = "Bob Mottram"
__license__ = "AGPL3+"
__version__ = "1.1.0"
__version__ = "1.2.0"
__maintainer__ = "Bob Mottram"
__email__ = "bob@freedombone.net"
__status__ = "Production"

View File

@ -1,7 +1,7 @@
__filename__ = "tests.py"
__author__ = "Bob Mottram"
__license__ = "AGPL3+"
__version__ = "1.1.0"
__version__ = "1.2.0"
__maintainer__ = "Bob Mottram"
__email__ = "bob@freedombone.net"
__status__ = "Production"
@ -33,6 +33,7 @@ from follow import clearFollows
from follow import clearFollowers
from follow import sendFollowRequestViaServer
from follow import sendUnfollowRequestViaServer
from utils import decodedHost
from utils import getFullDomain
from utils import validNickname
from utils import firstParagraphFromString
@ -3059,9 +3060,22 @@ def testMastoApi():
assert nickname2 == nickname
def testDomainHandling():
print('testDomainHandling')
testDomain = 'localhost'
assert decodedHost(testDomain) == testDomain
testDomain = '127.0.0.1:60'
assert decodedHost(testDomain) == testDomain
testDomain = '192.168.5.153'
assert decodedHost(testDomain) == testDomain
testDomain = 'xn--espaa-rta.icom.museum'
assert decodedHost(testDomain) == "españa.icom.museum"
def runAllTests():
print('Running tests...')
testFunctions()
testDomainHandling()
testMastoApi()
testLinksWithinPost()
testReplyToPublicPost()

View File

@ -1,7 +1,7 @@
__filename__ = "theme.py"
__author__ = "Bob Mottram"
__license__ = "AGPL3+"
__version__ = "1.1.0"
__version__ = "1.2.0"
__maintainer__ = "Bob Mottram"
__email__ = "bob@freedombone.net"
__status__ = "Production"

View File

@ -1,4 +1,5 @@
{
"column-left-header-background": "#35244d",
"newswire-publish-icon": "True",
"full-width-timeline-buttons": "False",
"icons-as-buttons": "False",

View File

@ -1,7 +1,7 @@
__filename__ = "threads.py"
__author__ = "Bob Mottram"
__license__ = "AGPL3+"
__version__ = "1.1.0"
__version__ = "1.2.0"
__maintainer__ = "Bob Mottram"
__email__ = "bob@freedombone.net"
__status__ = "Production"

2
tox.py
View File

@ -1,7 +1,7 @@
__filename__ = "tox.py"
__author__ = "Bob Mottram"
__license__ = "AGPL3+"
__version__ = "1.1.0"
__version__ = "1.2.0"
__maintainer__ = "Bob Mottram"
__email__ = "bob@freedombone.net"
__status__ = "Production"

View File

@ -361,5 +361,7 @@
"Moved to new account address": "انتقل إلى عنوان الحساب الجديد",
"Yet another Epicyon Instance": "مثال آخر Epicyon",
"Other accounts": "حسابات أخرى",
"Pin this post to your profile.": "تثبيت هذه الوظيفة في ملف التعريف الخاص بك."
"Pin this post to your profile.": "تثبيت هذه الوظيفة في ملف التعريف الخاص بك.",
"Administered by": "تدار من قبل",
"Version": "الإصدار"
}

View File

@ -361,5 +361,7 @@
"Moved to new account address": "S'ha mogut a l'adreça del compte nova",
"Yet another Epicyon Instance": "Encara una altra instància Epicyon",
"Other accounts": "Altres comptes",
"Pin this post to your profile.": "Fixa aquesta publicació al teu perfil."
"Pin this post to your profile.": "Fixa aquesta publicació al teu perfil.",
"Administered by": "Administrat per",
"Version": "Versió"
}

View File

@ -361,5 +361,7 @@
"Moved to new account address": "Wedi'i symud i gyfeiriad cyfrif newydd",
"Yet another Epicyon Instance": "Digwyddiad Epicyon arall",
"Other accounts": "Cyfrifon eraill",
"Pin this post to your profile.": "Piniwch y post hwn i'ch proffil."
"Pin this post to your profile.": "Piniwch y post hwn i'ch proffil.",
"Administered by": "Gweinyddir gan",
"Version": "Fersiwn"
}

View File

@ -361,5 +361,7 @@
"Moved to new account address": "An neue Kontoadresse verschoben",
"Yet another Epicyon Instance": "Noch eine Epicyon-Instanz",
"Other accounts": "Andere Konten",
"Pin this post to your profile.": "Pin diesen Beitrag zu Ihrem Profil."
"Pin this post to your profile.": "Pin diesen Beitrag zu Ihrem Profil.",
"Administered by": "Verwaltet von",
"Version": "Ausführung"
}

View File

@ -361,5 +361,7 @@
"Moved to new account address": "Moved to new account address",
"Yet another Epicyon Instance": "Yet another Epicyon Instance",
"Other accounts": "Other accounts",
"Pin this post to your profile.": "Pin this post to your profile."
"Pin this post to your profile.": "Pin this post to your profile.",
"Administered by": "Administered by",
"Version": "Version"
}

View File

@ -361,5 +361,7 @@
"Moved to new account address": "Movido a la nueva dirección de la cuenta",
"Yet another Epicyon Instance": "Otra instancia más de Epicyon",
"Other accounts": "Otras cuentas",
"Pin this post to your profile.": "Fija esta publicación a tu perfil."
"Pin this post to your profile.": "Fija esta publicación a tu perfil.",
"Administered by": "Administrado por",
"Version": "Versión"
}

View File

@ -361,5 +361,7 @@
"Moved to new account address": "Déplacé vers une nouvelle adresse de compte",
"Yet another Epicyon Instance": "Encore une autre instance Epicyon",
"Other accounts": "Autres comptes",
"Pin this post to your profile.": "Épinglez ce message à votre profil."
"Pin this post to your profile.": "Épinglez ce message à votre profil.",
"Administered by": "Administré par",
"Version": "Version"
}

View File

@ -361,5 +361,7 @@
"Moved to new account address": "Ar athraíodh a ionad go seoladh cuntas nua",
"Yet another Epicyon Instance": "Institiúid Epicyon eile fós",
"Other accounts": "Cuntais eile",
"Pin this post to your profile.": "Bioráin an post seo le do phróifíl."
"Pin this post to your profile.": "Bioráin an post seo le do phróifíl.",
"Administered by": "Riartha ag",
"Version": "Leagan"
}

View File

@ -361,5 +361,7 @@
"Moved to new account address": "नए खाते के पते पर ले जाया गया",
"Yet another Epicyon Instance": "फिर भी एक और एपिकॉन उदाहरण",
"Other accounts": "अन्य खाते",
"Pin this post to your profile.": "इस पोस्ट को अपनी प्रोफाइल पर पिन करें।"
"Pin this post to your profile.": "इस पोस्ट को अपनी प्रोफाइल पर पिन करें।",
"Administered by": "द्वारा प्रशासित",
"Version": "संस्करण"
}

View File

@ -361,5 +361,7 @@
"Moved to new account address": "Spostato al nuovo indirizzo dell'account",
"Yet another Epicyon Instance": "Ancora un'altra istanza di Epicyon",
"Other accounts": "Altri account",
"Pin this post to your profile.": "Metti questo post sul tuo profilo."
"Pin this post to your profile.": "Metti questo post sul tuo profilo.",
"Administered by": "Amministrato da",
"Version": "Versione"
}

View File

@ -361,5 +361,7 @@
"Moved to new account address": "新しいアカウントアドレスに移動しました",
"Yet another Epicyon Instance": "さらに別のエピキオンインスタンス",
"Other accounts": "その他のアカウント",
"Pin this post to your profile.": "この投稿をプロフィールに固定します。"
"Pin this post to your profile.": "この投稿をプロフィールに固定します。",
"Administered by": "管理者",
"Version": "バージョン"
}

View File

@ -357,5 +357,7 @@
"Moved to new account address": "Moved to new account address",
"Yet another Epicyon Instance": "Yet another Epicyon Instance",
"Other accounts": "Other accounts",
"Pin this post to your profile.": "Pin this post to your profile."
"Pin this post to your profile.": "Pin this post to your profile.",
"Administered by": "Administered by",
"Version": "Version"
}

View File

@ -361,5 +361,7 @@
"Moved to new account address": "Movido para o novo endereço da conta",
"Yet another Epicyon Instance": "Mais uma instância do Epicyon",
"Other accounts": "Outras contas",
"Pin this post to your profile.": "Fixar esta postagem em seu perfil."
"Pin this post to your profile.": "Fixar esta postagem em seu perfil.",
"Administered by": "Administrado por",
"Version": "Versão"
}

View File

@ -361,5 +361,7 @@
"Moved to new account address": "Перемещен на новый адрес учетной записи",
"Yet another Epicyon Instance": "Еще один экземпляр Эпикиона",
"Other accounts": "Другие аккаунты",
"Pin this post to your profile.": "Закрепите это сообщение в своем профиле."
"Pin this post to your profile.": "Закрепите это сообщение в своем профиле.",
"Administered by": "Под управлением",
"Version": "Версия"
}

View File

@ -361,5 +361,7 @@
"Moved to new account address": "移至新帐户地址",
"Yet another Epicyon Instance": "另一个Epicyon实例",
"Other accounts": "其他账户",
"Pin this post to your profile.": "将此帖子固定到您的个人资料。"
"Pin this post to your profile.": "将此帖子固定到您的个人资料。",
"Administered by": "由...管理",
"Version": "版"
}

View File

@ -1,7 +1,7 @@
__filename__ = "utils.py"
__author__ = "Bob Mottram"
__license__ = "AGPL3+"
__version__ = "1.1.0"
__version__ = "1.2.0"
__maintainer__ = "Bob Mottram"
__email__ = "bob@freedombone.net"
__status__ = "Production"
@ -14,11 +14,36 @@ import json
from socket import error as SocketError
import errno
import urllib.request
import idna
from pprint import pprint
from calendar import monthrange
from followingCalendar import addPersonToCalendar
def _localNetworkHost(host: str) -> bool:
"""Returns true if the given host is on the local network
"""
if host.startswith('localhost') or \
host.startswith('192.') or \
host.startswith('127.') or \
host.startswith('10.'):
return True
return False
def decodedHost(host: str) -> str:
"""Convert hostname to internationalized domain
https://en.wikipedia.org/wiki/Internationalized_domain_name
"""
if ':' not in host:
# eg. mydomain:8000
if not _localNetworkHost(host):
if not host.endswith('.onion'):
if not host.endswith('.i2p'):
return idna.decode(host)
return host
def getLockedAccount(actorJson: {}) -> bool:
"""Returns whether the given account requires follower approval
"""
@ -1096,7 +1121,7 @@ def validNickname(domain: str, nickname: str) -> bool:
'tlreplies', 'tlmedia', 'tlblogs',
'tlevents', 'tlblogs', 'tlfeatures',
'moderation', 'moderationaction',
'activity', 'undo',
'activity', 'undo', 'pinned',
'reply', 'replies', 'question', 'like',
'likes', 'users', 'statuses', 'tags',
'accounts', 'channels', 'profile',

View File

@ -1,7 +1,7 @@
__filename__ = "webapp_about.py"
__author__ = "Bob Mottram"
__license__ = "AGPL3+"
__version__ = "1.1.0"
__version__ = "1.2.0"
__maintainer__ = "Bob Mottram"
__email__ = "bob@freedombone.net"
__status__ = "Production"
@ -14,7 +14,7 @@ from webapp_utils import htmlFooter
def htmlAbout(cssCache: {}, baseDir: str, httpPrefix: str,
domainFull: str, onionDomain: str) -> str:
domainFull: str, onionDomain: str, translate: {}) -> str:
"""Show the about screen
"""
adminNickname = getConfigParam(baseDir, 'admin')
@ -50,8 +50,10 @@ def htmlAbout(cssCache: {}, baseDir: str, httpPrefix: str,
adminActor = '/users/' + adminNickname
aboutForm += \
'<div class="container"><center>\n' + \
'<p class="administeredby">Administered by <a href="' + \
adminActor + '">' + adminNickname + '</a></p>\n' + \
'</center></div>\n'
'<p class="administeredby">' + \
translate['Administered by'] + ' <a href="' + \
adminActor + '">' + adminNickname + '</a>. ' + \
translate['Version'] + ' ' + __version__ + \
'</p>\n</center></div>\n'
aboutForm += htmlFooter()
return aboutForm

View File

@ -1,7 +1,7 @@
__filename__ = "webapp_calendar.py"
__author__ = "Bob Mottram"
__license__ = "AGPL3+"
__version__ = "1.1.0"
__version__ = "1.2.0"
__maintainer__ = "Bob Mottram"
__email__ = "bob@freedombone.net"
__status__ = "Production"

View File

@ -1,7 +1,7 @@
__filename__ = "webapp_column_left.py"
__author__ = "Bob Mottram"
__license__ = "AGPL3+"
__version__ = "1.1.0"
__version__ = "1.2.0"
__maintainer__ = "Bob Mottram"
__email__ = "bob@freedombone.net"
__status__ = "Production"

View File

@ -1,7 +1,7 @@
__filename__ = "webapp_column_right.py"
__author__ = "Bob Mottram"
__license__ = "AGPL3+"
__version__ = "1.1.0"
__version__ = "1.2.0"
__maintainer__ = "Bob Mottram"
__email__ = "bob@freedombone.net"
__status__ = "Production"

View File

@ -1,7 +1,7 @@
__filename__ = "webapp_confirm.py"
__author__ = "Bob Mottram"
__license__ = "AGPL3+"
__version__ = "1.1.0"
__version__ = "1.2.0"
__maintainer__ = "Bob Mottram"
__email__ = "bob@freedombone.net"
__status__ = "Production"

View File

@ -1,7 +1,7 @@
__filename__ = "webapp_create_post.py"
__author__ = "Bob Mottram"
__license__ = "AGPL3+"
__version__ = "1.1.0"
__version__ = "1.2.0"
__maintainer__ = "Bob Mottram"
__email__ = "bob@freedombone.net"
__status__ = "Production"

View File

@ -1,7 +1,7 @@
__filename__ = "webapp_frontscreen.py"
__author__ = "Bob Mottram"
__license__ = "AGPL3+"
__version__ = "1.1.0"
__version__ = "1.2.0"
__maintainer__ = "Bob Mottram"
__email__ = "bob@freedombone.net"
__status__ = "Production"

View File

@ -1,7 +1,7 @@
__filename__ = "webapp_hashtagswarm.py"
__author__ = "Bob Mottram"
__license__ = "AGPL3+"
__version__ = "1.1.0"
__version__ = "1.2.0"
__maintainer__ = "Bob Mottram"
__email__ = "bob@freedombone.net"
__status__ = "Production"

View File

@ -1,7 +1,7 @@
__filename__ = "webapp_headerbuttons.py"
__author__ = "Bob Mottram"
__license__ = "AGPL3+"
__version__ = "1.1.0"
__version__ = "1.2.0"
__maintainer__ = "Bob Mottram"
__email__ = "bob@freedombone.net"
__status__ = "Production"

View File

@ -1,7 +1,7 @@
__filename__ = "webapp_login.py"
__author__ = "Bob Mottram"
__license__ = "AGPL3+"
__version__ = "1.1.0"
__version__ = "1.2.0"
__maintainer__ = "Bob Mottram"
__email__ = "bob@freedombone.net"
__status__ = "Production"

View File

@ -1,7 +1,7 @@
__filename__ = "webapp_media.py"
__author__ = "Bob Mottram"
__license__ = "AGPL3+"
__version__ = "1.1.0"
__version__ = "1.2.0"
__maintainer__ = "Bob Mottram"
__email__ = "bob@freedombone.net"
__status__ = "Production"

View File

@ -1,7 +1,7 @@
__filename__ = "webapp_moderation.py"
__author__ = "Bob Mottram"
__license__ = "AGPL3+"
__version__ = "1.1.0"
__version__ = "1.2.0"
__maintainer__ = "Bob Mottram"
__email__ = "bob@freedombone.net"
__status__ = "Production"

View File

@ -1,7 +1,7 @@
__filename__ = "webapp_person_options.py"
__author__ = "Bob Mottram"
__license__ = "AGPL3+"
__version__ = "1.1.0"
__version__ = "1.2.0"
__maintainer__ = "Bob Mottram"
__email__ = "bob@freedombone.net"
__status__ = "Production"

View File

@ -1,7 +1,7 @@
__filename__ = "webapp_post.py"
__author__ = "Bob Mottram"
__license__ = "AGPL3+"
__version__ = "1.1.0"
__version__ = "1.2.0"
__maintainer__ = "Bob Mottram"
__email__ = "bob@freedombone.net"
__status__ = "Production"

View File

@ -1,7 +1,7 @@
__filename__ = "webapp_profile.py"
__author__ = "Bob Mottram"
__license__ = "AGPL3+"
__version__ = "1.1.0"
__version__ = "1.2.0"
__maintainer__ = "Bob Mottram"
__email__ = "bob@freedombone.net"
__status__ = "Production"

View File

@ -1,7 +1,7 @@
__filename__ = "webapp_question.py"
__author__ = "Bob Mottram"
__license__ = "AGPL3+"
__version__ = "1.1.0"
__version__ = "1.2.0"
__maintainer__ = "Bob Mottram"
__email__ = "bob@freedombone.net"
__status__ = "Production"

View File

@ -1,7 +1,7 @@
__filename__ = "webapp_search.py"
__author__ = "Bob Mottram"
__license__ = "AGPL3+"
__version__ = "1.1.0"
__version__ = "1.2.0"
__maintainer__ = "Bob Mottram"
__email__ = "bob@freedombone.net"
__status__ = "Production"

View File

@ -1,7 +1,7 @@
__filename__ = "webapp_suspended.py"
__author__ = "Bob Mottram"
__license__ = "AGPL3+"
__version__ = "1.1.0"
__version__ = "1.2.0"
__maintainer__ = "Bob Mottram"
__email__ = "bob@freedombone.net"
__status__ = "Production"

View File

@ -1,7 +1,7 @@
__filename__ = "webapp_timeline.py"
__author__ = "Bob Mottram"
__license__ = "AGPL3+"
__version__ = "1.1.0"
__version__ = "1.2.0"
__maintainer__ = "Bob Mottram"
__email__ = "bob@freedombone.net"
__status__ = "Production"

View File

@ -1,7 +1,7 @@
__filename__ = "webapp_tos.py"
__author__ = "Bob Mottram"
__license__ = "AGPL3+"
__version__ = "1.1.0"
__version__ = "1.2.0"
__maintainer__ = "Bob Mottram"
__email__ = "bob@freedombone.net"
__status__ = "Production"

View File

@ -1,7 +1,7 @@
__filename__ = "webapp_utils.py"
__author__ = "Bob Mottram"
__license__ = "AGPL3+"
__version__ = "1.1.0"
__version__ = "1.2.0"
__maintainer__ = "Bob Mottram"
__email__ = "bob@freedombone.net"
__status__ = "Production"

View File

@ -1,7 +1,7 @@
__filename__ = "webfinger.py"
__author__ = "Bob Mottram"
__license__ = "AGPL3+"
__version__ = "1.1.0"
__version__ = "1.2.0"
__maintainer__ = "Bob Mottram"
__email__ = "bob@freedombone.net"
__status__ = "Production"

View File

@ -1,7 +1,7 @@
__filename__ = "xmpp.py"
__author__ = "Bob Mottram"
__license__ = "AGPL3+"
__version__ = "1.1.0"
__version__ = "1.2.0"
__maintainer__ = "Bob Mottram"
__email__ = "bob@freedombone.net"
__status__ = "Production"