Automatically generate provisioning shared secret if it has the default value
This commit is contained in:
+1
-1
@@ -41,7 +41,7 @@ appservice:
|
||||
# The prefix to use in the provisioning API endpoints.
|
||||
prefix: /_matrix/provision
|
||||
# The shared secret to authorize users of the API.
|
||||
# You can generate a decent secret with `pwgen -snc 32 1`
|
||||
# If you leave the default token, a random token will be generated and saved at startup.
|
||||
shared_secret: "Very secret shared secret"
|
||||
|
||||
# The unique ID of this appservice.
|
||||
|
||||
@@ -162,6 +162,8 @@ class Config(DictWithRecursion):
|
||||
copy("appservice.provisioning.enabled")
|
||||
copy("appservice.provisioning.prefix")
|
||||
copy("appservice.provisioning.shared_secret")
|
||||
if base["appservice.provisioning.shared_secret"] == "Very secret shared secret":
|
||||
base["appservice.provisioning.shared_secret"] = self._new_token()
|
||||
|
||||
copy("appservice.id")
|
||||
copy("appservice.bot_username")
|
||||
|
||||
Reference in New Issue
Block a user