update my blog post on matrix room de-ciphering

This commit is contained in:
Quentin 2023-02-02 12:19:10 +01:00
parent 8c70e2bec2
commit f8f29c280d
Signed by: quentin
GPG Key ID: E9602264D639FF68
3 changed files with 49 additions and 20 deletions

View File

@ -1,10 +1,8 @@
# My Blog
```bash
nix-shell -p jekyll rubyPackages.sass
jekyll build
source ~/.awsrc
aws s3 sync _site/ s3://quentin.dufour.io/
```
echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p
RUBYOPT=--disable-did_you_mean bundle install
bundle exec jekyll serve
mc mirror --overwrite _site garage/quentin.dufour.io
```
test

View File

@ -42,16 +42,8 @@ First, you should inform your users with a message, something like:
You will not be able to post new messages here, please follow the provided redirection to join the new room.
Sorry for the inconvenience.
Now, open the developper tools in your old room by typing in the message box:
```
/devtools
```
*You can also open it by going in "Room Settings" -> "Advanced" -> "Open Devtools"*
A window must appear. Click on "Send Custom Event". Then click on the red button "Event" to create a "State Event".
Put `m.room.tombstone` as the Event Type, keep the State Key field empty, and finally enter the following content (replace the example room ID by the one of your new room):
Now we will prepare a **state event** that point to the **new** room, create a file named `migration.json`
based on the following template:
```json
{
@ -60,6 +52,34 @@ Put `m.room.tombstone` as the Event Type, keep the State Key field empty, and fi
}
```
This event must be sent in the **old** room. Let's say its identifier is `!MFnHRRrCTMeHvfnNUD:deuxfleurs.fr`.
The URL template is thus:
```
https://im.deuxfleurs.fr/_matrix/client/v3/rooms/!MFnHRRrCTMeHvfnNUD:deuxfleurs.fr/state/m.room.tombstone
```
The last thing we need is to build an header file containing the required information for authentication onto the API.
Create a file named `hdrs.txt` based on the following template.
```text
Authorization: Bearer see_below_how_you_can_find_me
Content-Type: application/json
```
*The authorization header can be extracted from an Element Web instance by opening the developer panel (F12) and going to the Network tab.
Then select a request going to your matrix backend, on the right part of your screen search the "Authorization" line and copy/paste its value.*
Finally you can send the request to the API by again adapting the following command template:
```bash
curl \
-H @hdrs.txt \
-X PUT \
-d @migration.json \
'https://im.deuxfleurs.fr/_matrix/client/v3/rooms/!MFnHRRrCTMeHvfnNUD:deuxfleurs.fr/state/m.room.tombstone'
```
And that's all, you have migrated your old encrypted room to a new clear text one!
If you want to explore all the possibilities offered by the developer tools, you can read [Matrix specification](https://spec.matrix.org/).

View File

@ -12,8 +12,9 @@ layout: default
<p>
Je suis ingénieur en informatique et libriste.
J'ai travaillé sur <a href="https://www.torproject.org/">Tor</a> pendant <a href="https://theses.fr/s204646">ma thèse</a>.
Depuis, j'ai cofondé <a href="https://deuxfleurs.fr">Deuxfleurs</a>, un hébergeur associatif expérimental pour lequel je travaille.
Nous développons des logiciels pour faciliter l'auto-hébergement comme <a href="https://garagehq.deuxfleurs.fr/">Garage</a>, une solution de stockage de données distribuée.
Je suis membre de <a href="https://deuxfleurs.fr">Deuxfleurs</a>, un hébergeur associatif expérimental.
Nous développons des logiciels libres comme <a href="https://garagehq.deuxfleurs.fr/">Garage</a> pour un monde plus résilient et souverain.
Le reste du temps, je suis disponible pour vous accompagner sur vos projet informatiques en <em>freelance</em>, écrivez-moi !
</p>
<nav class="list">
@ -40,7 +41,7 @@ layout: default
<section id="posts">
<h2>J'écris sur</h2>
<section>
<h3>concevoir des systèmes informatiques</h3>
<h3>comment concevoir des systèmes informatiques</h3>
<div class="list">
<ul>
{% for post in site.categories.developpement %}
@ -177,6 +178,16 @@ layout: default
<p>Un logiciel de stockage de données géo-distribué écrit en Rust. C'est une alternative à AWS S3 et Minio.</p>
</div>
<div class="card">
<h4><a href="https://git.deuxfleurs.fr/Deuxfleurs/diplonat">Diplonat</a></h4>
<p>À partir de déclarations dans Consul, diplonat se charge de configurer le réseau pour vous (upnp, pare-feu, etc.).</p>
</div>
<div class="card">
<h4><a href="https://git.deuxfleurs.fr/Deuxfleurs/tricot">Tricot</a></h4>
<p>Tricot est un reverse proxy HTTP(S) inspiré de Traefik, fortement simplifié, et avec une approche <em>cluster-first</em>.</p>
</div>
</section>
</section>
{% include footer.html %}