diff --git a/daemon.py b/daemon.py index 0c23ee96f..cde615e7f 100644 --- a/daemon.py +++ b/daemon.py @@ -54,6 +54,7 @@ from person import registerAccount from person import personLookup from person import personBoxJson from person import createSharedInbox +from person import createNewsInbox from person import suspendAccount from person import unsuspendAccount from person import removeAccount @@ -1229,6 +1230,11 @@ class PubServer(BaseHTTPRequestHandler): loginNickname, loginPassword, register = \ htmlGetLoginCredentials(loginParams, self.server.lastLoginTime) if loginNickname: + if loginNickname == 'news' or loginNickname == 'inbox': + print('Invalid username login: ' + loginNickname) + self._clearLoginDetails(loginNickname, callingDomain) + self.server.POSTbusy = False + return self.server.lastLoginTime = int(time.time()) if register: if not registerAccount(baseDir, httpPrefix, domain, port, @@ -11455,6 +11461,10 @@ def runDaemon(newsInstance: bool, print('Creating shared inbox: inbox@' + domain) createSharedInbox(baseDir, 'inbox', domain, port, httpPrefix) + if not os.path.isdir(baseDir + '/accounts/news@' + domain): + print('Creating news inbox: news@' + domain) + createNewsInbox(baseDir, domain, port, httpPrefix) + if not os.path.isdir(baseDir + '/cache'): os.mkdir(baseDir + '/cache') if not os.path.isdir(baseDir + '/cache/actors'): diff --git a/person.py b/person.py index 6eb196708..bea86e265 100644 --- a/person.py +++ b/person.py @@ -504,6 +504,14 @@ def createSharedInbox(baseDir: str, nickname: str, domain: str, port: int, True, True, None) +def createNewsInbox(baseDir: str, domain: str, port: int, + httpPrefix: str) -> (str, str, {}, {}): + """Generates the news inbox + """ + return createPersonBase(baseDir, 'news', domain, port, httpPrefix, + True, True, None) + + def personUpgradeActor(baseDir: str, personJson: {}, handle: str, filename: str) -> None: """Alter the actor to add any new properties