mirror of
https://git.pleroma.social/pleroma/relay.git
synced 2024-11-12 18:58:00 +00:00
Compare commits
5 commits
7d37ec8145
...
aa8090eebb
Author | SHA1 | Date | |
---|---|---|---|
aa8090eebb | |||
f287b84ea3 | |||
dc74bfb588 | |||
e281a06e7f | |||
8f16cab048 |
|
@ -26,6 +26,13 @@ class Application(web.Application):
|
||||||
if not self['config'].load():
|
if not self['config'].load():
|
||||||
self['config'].save()
|
self['config'].save()
|
||||||
|
|
||||||
|
if self.config.is_docker:
|
||||||
|
self.config.update({
|
||||||
|
'db': '/data/relay.jsonld',
|
||||||
|
'listen': '0.0.0.0',
|
||||||
|
'port': 8080
|
||||||
|
})
|
||||||
|
|
||||||
self['workers'] = []
|
self['workers'] = []
|
||||||
self['last_worker'] = 0
|
self['last_worker'] = 0
|
||||||
|
|
||||||
|
|
|
@ -76,7 +76,7 @@ class RelayDatabase(dict):
|
||||||
|
|
||||||
if not self['private-key']:
|
if not self['private-key']:
|
||||||
logging.info("No actor keys present, generating 4096-bit RSA keypair.")
|
logging.info("No actor keys present, generating 4096-bit RSA keypair.")
|
||||||
self.signer = aputils.Signer.new(self.config.keyid, 4096)
|
self.signer = aputils.Signer.new(self.config.keyid, size=4096)
|
||||||
self['private-key'] = self.signer.export()
|
self['private-key'] = self.signer.export()
|
||||||
|
|
||||||
else:
|
else:
|
||||||
|
|
|
@ -159,7 +159,7 @@ class HttpClient:
|
||||||
return logging.verbose(await resp.read()) # change this to debug
|
return logging.verbose(await resp.read()) # change this to debug
|
||||||
|
|
||||||
except (ClientConnectorError, ServerTimeoutError):
|
except (ClientConnectorError, ServerTimeoutError):
|
||||||
logging.verbose(f'Failed to connect to {url.netloc}')
|
logging.verbose(f'Failed to connect to {url}')
|
||||||
|
|
||||||
## prevent workers from being brought down
|
## prevent workers from being brought down
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
|
@ -174,6 +174,10 @@ class HttpClient:
|
||||||
loads = WellKnownNodeinfo.new_from_json
|
loads = WellKnownNodeinfo.new_from_json
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if not wk_nodeinfo:
|
||||||
|
logging.verbose(f'Failed to fetch well-known nodeinfo url for domain: {domain}')
|
||||||
|
return False
|
||||||
|
|
||||||
for version in ['20', '21']:
|
for version in ['20', '21']:
|
||||||
try:
|
try:
|
||||||
nodeinfo_url = wk_nodeinfo.get_url(version)
|
nodeinfo_url = wk_nodeinfo.get_url(version)
|
||||||
|
|
|
@ -43,11 +43,12 @@ def cli_setup():
|
||||||
|
|
||||||
click.echo('The domain must not be example.com')
|
click.echo('The domain must not be example.com')
|
||||||
|
|
||||||
app.config.listen = click.prompt('Which address should the relay listen on?', default=app.config.listen)
|
if not app.config.is_docker:
|
||||||
|
app.config.listen = click.prompt('Which address should the relay listen on?', default=app.config.listen)
|
||||||
|
|
||||||
while True:
|
while True:
|
||||||
app.config.port = click.prompt('What TCP port should the relay listen on?', default=app.config.port, type=int)
|
app.config.port = click.prompt('What TCP port should the relay listen on?', default=app.config.port, type=int)
|
||||||
break
|
break
|
||||||
|
|
||||||
app.config.save()
|
app.config.save()
|
||||||
|
|
||||||
|
|
|
@ -28,7 +28,7 @@ install_requires =
|
||||||
click >= 8.1.2
|
click >= 8.1.2
|
||||||
pycryptodome >= 3.14.1
|
pycryptodome >= 3.14.1
|
||||||
PyYAML >= 5.0.0
|
PyYAML >= 5.0.0
|
||||||
aputils @ https://git.barkshark.xyz/barkshark/aputils/archive/0.1.2.tar.gz
|
aputils @ git+https://git.barkshark.xyz/barkshark/aputils@2cd1776f12
|
||||||
python_requires = >=3.6
|
python_requires = >=3.6
|
||||||
|
|
||||||
[options.extras_require]
|
[options.extras_require]
|
||||||
|
|
Loading…
Reference in a new issue