* Add device ID to the configuration
Signed-off-by: Nikos Filippakis <me@nfil.dev>
* Basic e2ee support for some commands
Signed-off-by: Nikos Filippakis <me@nfil.dev>
* Move some of the client and crypto logic to a new BotClient type
Signed-off-by: Nikos Filippakis <me@nfil.dev>
* Use the state store to retrieve room joined users
Signed-off-by: Nikos Filippakis <me@nfil.dev>
* Start creating the database APIs for the crypto store
Signed-off-by: Nikos Filippakis <me@nfil.dev>
* Replace mautrix.Client usage with BotClient for all services to use the
e2ee-enabled client
Signed-off-by: Nikos Filippakis <me@nfil.dev>
* Use SQL backend for storing crypto material
Signed-off-by: Nikos Filippakis <me@nfil.dev>
* Perform a sync request with full state when starting
Signed-off-by: Nikos Filippakis <me@nfil.dev>
* Consider case where device ID is empty and log a warning
Signed-off-by: Nikos Filippakis <me@nfil.dev>
* Define project as a Go module and update dependency versions
Signed-off-by: Nikos Filippakis <me@nfil.dev>
* Update docs, configs and dockerfile to use latest Go version
Signed-off-by: Nikos Filippakis <me@nfil.dev>
* Add postgres database driver
Signed-off-by: Nikos Filippakis <me@nfil.dev>
By default logrus uses these keys. If we also define one, logrus detects this
and then works around by adding 'fields.whatever' as the key name. However,
in the process of adding the key to the `Fields` it causes a race condition
which can crash the process with concurrent map r/w errors.
The example from the docs was very clearly with spaces after hours and minutes:
```
"committed_at": "2011-11-11T11: 11: 11Z",
```
But in fact those spaces do not exist in the wild. Great.
We can't just use a public field because the caller may clobber it. If they
do clobber it, we've then lost the ability to set it back to what it was because
we don't store another copy anywhere. This patch fixes it by keeping a private
ref and always clobbering on Register().
This is horrible. We need to separate internal-storage and external-fields
better.