3
0

support custom location for database persistent statefile (defaults to "capport.state" in cwd)

This commit is contained in:
2023-08-08 13:35:43 +02:00
parent 4f08ff796b
commit c4a75dd7a7
3 changed files with 7 additions and 5 deletions

View File

@ -299,11 +299,11 @@ class Hub:
self._hostname = socket.getfqdn()
self._app = app
self._is_controller = is_controller
state_filename: typing.Optional[str]
state_filename: str
if is_controller:
state_filename = 'capport.state'
state_filename = config.database_file
else:
state_filename = None
state_filename = ''
self.database = capport.database.Database(state_filename=state_filename)
self._anon_context = ssl.SSLContext()
# python ssl doesn't support setting tls1.3 ciphers yet, so make sure we stay on 1.2 for now to enable anon