mirror of https://gitlab.com/bashrc2/epicyon
Snake case
parent
8a0855af4c
commit
3100bce6c3
|
@ -1705,7 +1705,7 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
|
|
||||||
if not registerAccount(base_dir, http_prefix, domain, port,
|
if not registerAccount(base_dir, http_prefix, domain, port,
|
||||||
loginNickname, loginPassword,
|
loginNickname, loginPassword,
|
||||||
self.server.manualFollowerApproval):
|
self.server.manual_follower_approval):
|
||||||
self.server.POSTbusy = False
|
self.server.POSTbusy = False
|
||||||
if callingDomain.endswith('.onion') and onion_domain:
|
if callingDomain.endswith('.onion') and onion_domain:
|
||||||
self._redirect_headers('http://' + onion_domain +
|
self._redirect_headers('http://' + onion_domain +
|
||||||
|
@ -18483,7 +18483,7 @@ def runDaemon(content_license_url: str,
|
||||||
debug: bool = False, unit_test: bool = False,
|
debug: bool = False, unit_test: bool = False,
|
||||||
instance_only_skills_search: bool = False,
|
instance_only_skills_search: bool = False,
|
||||||
send_threads: [] = [],
|
send_threads: [] = [],
|
||||||
manualFollowerApproval: bool = True) -> None:
|
manual_follower_approval: bool = True) -> None:
|
||||||
if len(domain) == 0:
|
if len(domain) == 0:
|
||||||
domain = 'localhost'
|
domain = 'localhost'
|
||||||
if '.' not in domain:
|
if '.' not in domain:
|
||||||
|
@ -18615,7 +18615,7 @@ def runDaemon(content_license_url: str,
|
||||||
httpd.blocklistUpdateInterval = 100
|
httpd.blocklistUpdateInterval = 100
|
||||||
httpd.domainBlocklist = getDomainBlocklist(base_dir)
|
httpd.domainBlocklist = getDomainBlocklist(base_dir)
|
||||||
|
|
||||||
httpd.manualFollowerApproval = manualFollowerApproval
|
httpd.manual_follower_approval = manual_follower_approval
|
||||||
httpd.onion_domain = onion_domain
|
httpd.onion_domain = onion_domain
|
||||||
httpd.i2p_domain = i2p_domain
|
httpd.i2p_domain = i2p_domain
|
||||||
httpd.media_instance = media_instance
|
httpd.media_instance = media_instance
|
||||||
|
|
16
person.py
16
person.py
|
@ -350,7 +350,7 @@ def getDefaultPersonContext() -> str:
|
||||||
|
|
||||||
def _createPersonBase(base_dir: str, nickname: str, domain: str, port: int,
|
def _createPersonBase(base_dir: str, nickname: str, domain: str, port: int,
|
||||||
http_prefix: str, saveToFile: bool,
|
http_prefix: str, saveToFile: bool,
|
||||||
manualFollowerApproval: bool,
|
manual_follower_approval: bool,
|
||||||
groupAccount: bool,
|
groupAccount: bool,
|
||||||
password: str) -> (str, str, {}, {}):
|
password: str) -> (str, str, {}, {}):
|
||||||
"""Returns the private key, public key, actor and webfinger endpoint
|
"""Returns the private key, public key, actor and webfinger endpoint
|
||||||
|
@ -372,7 +372,7 @@ def _createPersonBase(base_dir: str, nickname: str, domain: str, port: int,
|
||||||
if groupAccount:
|
if groupAccount:
|
||||||
personType = 'Group'
|
personType = 'Group'
|
||||||
# Enable follower approval by default
|
# Enable follower approval by default
|
||||||
approveFollowers = manualFollowerApproval
|
approveFollowers = manual_follower_approval
|
||||||
personName = nickname
|
personName = nickname
|
||||||
personId = localActorUrl(http_prefix, nickname, domain)
|
personId = localActorUrl(http_prefix, nickname, domain)
|
||||||
inboxStr = personId + '/inbox'
|
inboxStr = personId + '/inbox'
|
||||||
|
@ -541,7 +541,7 @@ def _createPersonBase(base_dir: str, nickname: str, domain: str, port: int,
|
||||||
|
|
||||||
def registerAccount(base_dir: str, http_prefix: str, domain: str, port: int,
|
def registerAccount(base_dir: str, http_prefix: str, domain: str, port: int,
|
||||||
nickname: str, password: str,
|
nickname: str, password: str,
|
||||||
manualFollowerApproval: bool) -> bool:
|
manual_follower_approval: bool) -> bool:
|
||||||
"""Registers a new account from the web interface
|
"""Registers a new account from the web interface
|
||||||
"""
|
"""
|
||||||
if _accountExists(base_dir, nickname, domain):
|
if _accountExists(base_dir, nickname, domain):
|
||||||
|
@ -556,7 +556,7 @@ def registerAccount(base_dir: str, http_prefix: str, domain: str, port: int,
|
||||||
newPerson, webfingerEndpoint) = createPerson(base_dir, nickname,
|
newPerson, webfingerEndpoint) = createPerson(base_dir, nickname,
|
||||||
domain, port,
|
domain, port,
|
||||||
http_prefix, True,
|
http_prefix, True,
|
||||||
manualFollowerApproval,
|
manual_follower_approval,
|
||||||
password)
|
password)
|
||||||
if privateKeyPem:
|
if privateKeyPem:
|
||||||
return True
|
return True
|
||||||
|
@ -593,7 +593,7 @@ def savePersonQrcode(base_dir: str,
|
||||||
|
|
||||||
def createPerson(base_dir: str, nickname: str, domain: str, port: int,
|
def createPerson(base_dir: str, nickname: str, domain: str, port: int,
|
||||||
http_prefix: str, saveToFile: bool,
|
http_prefix: str, saveToFile: bool,
|
||||||
manualFollowerApproval: bool,
|
manual_follower_approval: bool,
|
||||||
password: str,
|
password: str,
|
||||||
groupAccount: bool = False) -> (str, str, {}, {}):
|
groupAccount: bool = False) -> (str, str, {}, {}):
|
||||||
"""Returns the private key, public key, actor and webfinger endpoint
|
"""Returns the private key, public key, actor and webfinger endpoint
|
||||||
|
@ -615,12 +615,14 @@ def createPerson(base_dir: str, nickname: str, domain: str, port: int,
|
||||||
# news account already exists
|
# news account already exists
|
||||||
return None, None, None, None
|
return None, None, None, None
|
||||||
|
|
||||||
|
manual_follower = manual_follower_approval
|
||||||
|
|
||||||
(privateKeyPem, publicKeyPem,
|
(privateKeyPem, publicKeyPem,
|
||||||
newPerson, webfingerEndpoint) = _createPersonBase(base_dir, nickname,
|
newPerson, webfingerEndpoint) = _createPersonBase(base_dir, nickname,
|
||||||
domain, port,
|
domain, port,
|
||||||
http_prefix,
|
http_prefix,
|
||||||
saveToFile,
|
saveToFile,
|
||||||
manualFollowerApproval,
|
manual_follower,
|
||||||
groupAccount,
|
groupAccount,
|
||||||
password)
|
password)
|
||||||
if not getConfigParam(base_dir, 'admin'):
|
if not getConfigParam(base_dir, 'admin'):
|
||||||
|
@ -637,7 +639,7 @@ def createPerson(base_dir: str, nickname: str, domain: str, port: int,
|
||||||
if not os.path.isdir(accountDir):
|
if not os.path.isdir(accountDir):
|
||||||
os.mkdir(accountDir)
|
os.mkdir(accountDir)
|
||||||
|
|
||||||
if manualFollowerApproval:
|
if manual_follower_approval:
|
||||||
followDMsFilename = acctDir(base_dir, nickname, domain) + '/.followDMs'
|
followDMsFilename = acctDir(base_dir, nickname, domain) + '/.followDMs'
|
||||||
try:
|
try:
|
||||||
with open(followDMsFilename, 'w+') as fFile:
|
with open(followDMsFilename, 'w+') as fFile:
|
||||||
|
|
Loading…
Reference in New Issue