mirror of
https://github.com/matrix-org/pantalaimon.git
synced 2025-01-26 07:15:58 -05:00
config: Add the ability to disable device verification.
This commit is contained in:
parent
1ad5cf6e66
commit
48da1b6b14
@ -8,3 +8,4 @@ ListenAddress = localhost
|
|||||||
ListenPort = 8009
|
ListenPort = 8009
|
||||||
Proxy = http://localhost:8080
|
Proxy = http://localhost:8080
|
||||||
SSL = False
|
SSL = False
|
||||||
|
IgnoreVerification = False
|
||||||
|
@ -41,6 +41,11 @@ homeserver.
|
|||||||
.It Cm SSL
|
.It Cm SSL
|
||||||
A boolean that decides if SSL verification should be enabled for outgoing
|
A boolean that decides if SSL verification should be enabled for outgoing
|
||||||
connections to the homeserver. Defaults to "True".
|
connections to the homeserver. Defaults to "True".
|
||||||
|
.It Cm IgnoreVerification
|
||||||
|
A boolean that decides if device verification should be enabled. If this is True
|
||||||
|
devices will be marked as ignored automatically and encryption keys will be
|
||||||
|
shared with them, if this is False the user needs to verify, blacklist or ignore
|
||||||
|
devices manually before messages can be sent to a room. Defaults to "False".
|
||||||
.El
|
.El
|
||||||
.Pp
|
.Pp
|
||||||
Aditional to the homeserver section a special section with the name
|
Aditional to the homeserver section a special section with the name
|
||||||
@ -50,6 +55,7 @@ can be used to configure the following values for all homeservers:
|
|||||||
.Cm ListenPort ,
|
.Cm ListenPort ,
|
||||||
.Cm Proxy ,
|
.Cm Proxy ,
|
||||||
.Cm SSL
|
.Cm SSL
|
||||||
|
.Cm IgnoreVerification
|
||||||
.Pp
|
.Pp
|
||||||
The
|
The
|
||||||
.Cm Default
|
.Cm Default
|
||||||
|
@ -14,6 +14,7 @@ class PanConfigParser(configparser.ConfigParser):
|
|||||||
default_section="Default",
|
default_section="Default",
|
||||||
defaults={
|
defaults={
|
||||||
"SSL": "True",
|
"SSL": "True",
|
||||||
|
"IgnoreVerification": "False",
|
||||||
"ListenAddress": "localhost",
|
"ListenAddress": "localhost",
|
||||||
"ListenPort": "8009",
|
"ListenPort": "8009",
|
||||||
"LogLevel": "warnig",
|
"LogLevel": "warnig",
|
||||||
@ -93,6 +94,7 @@ class ServerConfig:
|
|||||||
listen_port = attr.ib(type=int)
|
listen_port = attr.ib(type=int)
|
||||||
proxy = attr.ib(type=str)
|
proxy = attr.ib(type=str)
|
||||||
ssl = attr.ib(type=bool, default=True)
|
ssl = attr.ib(type=bool, default=True)
|
||||||
|
ignore_verification = attr.ib(type=bool, default=False)
|
||||||
|
|
||||||
|
|
||||||
@attr.s
|
@attr.s
|
||||||
@ -142,6 +144,7 @@ class PanConfig:
|
|||||||
listen_address = section.getaddress("ListenAddress")
|
listen_address = section.getaddress("ListenAddress")
|
||||||
listen_port = section.getint("ListenPort")
|
listen_port = section.getint("ListenPort")
|
||||||
ssl = section.getboolean("SSL")
|
ssl = section.getboolean("SSL")
|
||||||
|
ignore_verification = section.getboolean("IgnoreVerification")
|
||||||
proxy = section.geturl("Proxy")
|
proxy = section.geturl("Proxy")
|
||||||
|
|
||||||
listen_tuple = (listen_address, listen_port)
|
listen_tuple = (listen_address, listen_port)
|
||||||
@ -158,7 +161,8 @@ class PanConfig:
|
|||||||
listen_address,
|
listen_address,
|
||||||
listen_port,
|
listen_port,
|
||||||
proxy,
|
proxy,
|
||||||
ssl
|
ssl,
|
||||||
|
ignore_verification
|
||||||
)
|
)
|
||||||
|
|
||||||
self.servers[section_name] = server_conf
|
self.servers[section_name] = server_conf
|
||||||
|
@ -724,7 +724,7 @@ class ProxyDaemon:
|
|||||||
|
|
||||||
async with sem:
|
async with sem:
|
||||||
try:
|
try:
|
||||||
return await _send()
|
return await _send(self.conf.ignore_verification)
|
||||||
except OlmTrustError as e:
|
except OlmTrustError as e:
|
||||||
# There are unverified/unblocked devices in the room, notify
|
# There are unverified/unblocked devices in the room, notify
|
||||||
# the UI thread about this and wait for a response.
|
# the UI thread about this and wait for a response.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user