mirror of
https://github.com/maubot/maubot
synced 2025-08-29 12:10:38 +00:00
Fix config updating and make plugin dbs somewhat configurable
This commit is contained in:
parent
485040e687
commit
894c5df07b
6 changed files with 24 additions and 9 deletions
|
@ -16,7 +16,7 @@
|
|||
import random
|
||||
import string
|
||||
|
||||
from mautrix.util import BaseFileConfig
|
||||
from mautrix.util import BaseFileConfig, ConfigUpdateHelper
|
||||
|
||||
|
||||
class Config(BaseFileConfig):
|
||||
|
@ -24,10 +24,11 @@ class Config(BaseFileConfig):
|
|||
def _new_token() -> str:
|
||||
return "".join(random.choice(string.ascii_lowercase + string.digits) for _ in range(64))
|
||||
|
||||
def update(self):
|
||||
base, copy, copy_dict = self._pre_update()
|
||||
def do_update(self, helper: ConfigUpdateHelper) -> None:
|
||||
base, copy, _ = helper
|
||||
copy("database")
|
||||
copy("plugin_directories")
|
||||
copy("plugin_db_directory")
|
||||
copy("server.hostname")
|
||||
copy("server.port")
|
||||
copy("server.listen")
|
||||
|
@ -37,4 +38,5 @@ class Config(BaseFileConfig):
|
|||
base["server.shared_secret"] = self._new_token()
|
||||
else:
|
||||
base["server.shared_secret"] = shared_secret
|
||||
copy("admins")
|
||||
copy("logging")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue