Compare commits

...

2 Commits

Author SHA1 Message Date
3a2271ebb6 Add .asciicontainer adaptivity fix 2025-08-20 02:59:00 +03:00
ba0e6f92fe Add new article and specific for notes stylization 2025-08-20 02:33:57 +03:00
13 changed files with 159 additions and 22 deletions

File diff suppressed because one or more lines are too long

View File

@@ -11,7 +11,7 @@
<link rel="icon" href="/nothingrun-favicon-whiteonblack.png" type="image/png">
<title>Беларусский или белорусский</title>
<link rel="stylesheet" href="/_astro/contact.030c0792.css" /></head>
<link rel="stylesheet" href="/_astro/contact.f16fd268.css" /></head>
<body>
<div class="header astro-HPNW4VWY">
<a href="/" class="astro-HPNW4VWY">~/</a>
@@ -24,15 +24,7 @@
<h1>Беларусский или белорусский</h1>
<h2 id="введение">Введение</h2>
<p>Вопрос “Беларусь или Белоруссия” здесь затронут не будет. Как беларус, могу сказать, что нам просто приятно, когда нас называют Беларусью, и мы считаем использование первого варианта минимальным уважением к нашему народу.</p>
<p>Но отдельная тема - писать белорусский или беларусский. Этот вопрос спорный, но я постараюсь ответить на него с точки зрения русского языка.</p>
<h2 id="морфологический-принцип">Морфологический принцип</h2>
<p>В отличие от беларусского языка, русская орфография имеет в своей основе морфологический принцип, то есть по идее вне зависимости от своей позиции морфема всегда пишется одинаково. Например, са<strong>д</strong> - са<strong>д</strong>ы (на конце всегда <code>д</code>).<br/>Исключения в виде <code>без-</code> - <code>без-</code> не учитываются, так как они редки.</p>
<h2 id="как-писать">Как писать?</h2>
<p>Для начала, в литературном стандарте закреплена форма с буквой <code>о</code>. Но в таком случае слово Беларусь должно было бы писаться с <code>о</code>, так как соеденительной морфемой в русском <code>а</code> быть не может.</p>
<p>Вот только слово Беларусь пишется с <code>а</code>. Что же пошло не так? Это заимствование из беларусского, и сейчас представляет из себя один цельный корень. Это значит, что при добавлении других морфем, в том числе суффикса -ск-, а в корне должно сохраняться. То есть самый логичный вариант - писать <code>беларусский</code>.<br/>Ну либо переходить на <code>Белорусь</code>, но…</p>
<p>P.s. естественно, всё это не касается официальных докемнтов, потому что там, как это ни странно, необходимо использовать литератный стандарт.</p>
<div class="article"><h2 id="введение">Введение</h2><p>Вопрос “Беларусь или Белоруссия” здесь затронут не будет. Как беларус, могу сказать, что нам просто приятно, когда нас называют Беларусью, и мы считаем использование первого варианта минимальным уважением к нашему народу.</p><p>Но отдельная тема - писать белорусский или беларусский. Этот вопрос спорный, но я постараюсь ответить на него с точки зрения русского языка.</p><h2 id="морфологический-принцип">Морфологический принцип</h2><p>В отличие от беларусского языка, русская орфография имеет в своей основе морфологический принцип, то есть по идее вне зависимости от своей позиции морфема всегда пишется одинаково. Например, са<strong>д</strong> - са<strong>д</strong>ы (на конце всегда <code>д</code>).<br/>Исключения в виде <code>без-</code> - <code>без-</code> не учитываются, так как они редки.</p><h2 id="как-писать">Как писать?</h2><p>Для начала, в литературном стандарте закреплена форма с буквой <code>о</code>. Но в таком случае слово Беларусь должно было бы писаться с <code>о</code>, так как соеденительной морфемой в русском <code>а</code> быть не может.</p><p>Вот только слово Беларусь пишется с <code>а</code>. Что же пошло не так? Это заимствование из беларусского, и сейчас представляет из себя один цельный корень. Это значит, что при добавлении других морфем, в том числе суффикса -ск-, а в корне должно сохраняться. То есть самый логичный вариант - писать <code>беларусский</code>.<br/>Ну либо переходить на <code>Белорусь</code>, но…</p><p>P.s. естественно, всё это не касается официальных докемнтов, потому что там, как это ни странно, необходимо использовать литератный стандарт.</p></div>
<div id="footer">
<main>
<pre> .--.

View File

@@ -0,0 +1,78 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width">
<!--<link rel="icon" type="image/svg+xml" href="/favicon.svg" />-->
<meta name="generator" content="Astro v2.10.7">
<meta name="description" content="{frontmatter.description}">
<meta name="keywords" content="nothing crypto free software libre self host {frontmatter.keys}">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="icon" href="/nothingrun-favicon-whiteonblack.png" type="image/png">
<title>Restoration of Synapse after disappearing 1 year of database history</title>
<link rel="stylesheet" href="/_astro/contact.f16fd268.css" /></head>
<body>
<div class="header astro-HPNW4VWY">
<a href="/" class="astro-HPNW4VWY">~/</a>
<a href="/contact" class="astro-HPNW4VWY">Contact</a>
<a href="https://uptime.nothing.run" class="astro-HPNW4VWY">Uptime</a>
<a href="/news" class="astro-HPNW4VWY">News</a>
<a href="/notes" class="astro-HPNW4VWY">Notes</a>
<a href="/donate" class="astro-HPNW4VWY">Donate :3</a>
</div>
<h1>Restoration of Synapse after disappearing 1 year of database history</h1>
<div class="article"><h2 id="introduction">Introduction</h2><p>In July 2025, my PostgreSQL had broken, so I needed to restore it from my 1-y.o. backup. I was thinking about what to do, and my friend sent me <a href="https://blog.erethon.com/blog/2023/06/21/what-happens-when-a-matrix-server-disappears/">this</a> article, so we understood what to do!</p><p>For example, there is a room called #example:example.org (roomid !example:example.org), whose member was @user:example.net.
The problem is that every server knows @user:example.net is in the room #example:example.org. But our server doesnt! So that is what we should aim at solving the problem.</p><h2 id="architecture">Architecture</h2><p>We get 2 types of error messages:</p><ul>
<li><code>synapse.handlers.receipts: [PUT-...] Ignoring receipt for room &#39;!example:example.org&#39; from server example.org as we&#39;re not in the room</code> (there is the same error message, but when you get a typing event from an unknown room)</li>
<li><code>synapse.federation.federation_server: [PUT-...] Ignoring PDU for unknown room_id: !example:example.org</code></li>
</ul><p>We can read the journal and parse the error message (I use a bash script to do that).
Okay, we have a room id! In the given article, the author is the only user of their server, so they can just send <a href="https://spec.matrix.org/v1.15/client-server-api/#post_matrixclientv3joinroomidoralias">POST /_matrix/client/v3/join/!example:example.org</a> request, and everything will be good.
But my server has multiple users, so I cant use the easiest way. We need to get information about membership (so we need to get state).</p><p>As we are admins of our servers, we have their signing keys.
We will need them because we are going to get state via Federation API requests.
How? There are different ways to do that.
However, all of them require at least 1 event id, so firstly we need to do <a href="https://spec.matrix.org/v1.15/server-server-api/#get_matrixfederationv1timestamp_to_eventroomid">GET /_matrix/federation/v1/timestamp_to_event</a>.
Determining request parameters (?dir as direction (b[ackward] or f[orward]) and &amp;ts as timestamp in Unix time format in milliseconds), we have just got either the last or the first event id! In my case, I chose the way of getting the last event, so then Ill have to make <a href="https://spec.matrix.org/v1.15/server-server-api/#get_matrixfederationv1stateroomid">GET /_matrix/federation/v1/state/!example:example.org?event_id=$event_id</a>, and I will get the actual state.
Of course, both of the requests, as I said, should be signed using your servers key (<a href="https://spec.matrix.org/v1.15/server-server-api/#signing-events">how to sign events</a>).</p><br/><p>(There is no support of timestamp_to_event in Conduit, so it would be a good idea to make support of requesting different servers)</p><p>After we receive the state, we need to parse it, but I think this cant make a difficulty.
As a result, we have a list of our users that were in the given room, like [“@user:example.net”, “@anotheruser:example.net”, “@exampleuser:example.net”].
Then, the simplest way is to get temporary users auth token via <a href="https://github.com/matrix-org/synapse/blob/develop/docs/admin_api/user_admin_api.md#login-as-a-user">POST /_synapse/admin/v1/users/user_id/login</a> and make <a href="https://spec.matrix.org/v1.15/client-server-api/#post_matrixclientv3joinroomidoralias">POST /_matrix/client/v3/join/!example:example.org</a> from the name of the user using their token.
The problem is solved!</p><h2 id="external-links">External links</h2><ul>
<li><a href="https://blog.erethon.com/blog/2023/06/21/what-happens-when-a-matrix-server-disappears/">Article that gave me the idea</a></li>
<li><a href="https://spec.matrix.org/v1.15/server-server-api/">Matrix Federation API docs</a>
<ul>
<li><a href="https://spec.matrix.org/v1.15/server-server-api/#signing-events">How to sign Federation API requests</a></li>
<li><a href="https://spec.matrix.org/v1.15/server-server-api/#get_matrixfederationv1stateroomid">GET /_matrix/federation/v1/state/!example:example.org?event_id=$event_id</a></li>
<li><a href="https://spec.matrix.org/v1.15/server-server-api/#get_matrixfederationv1timestamp_to_eventroomid">GET /_matrix/federation/v1/timestamp_to_event</a></li>
</ul>
</li>
<li><a href="https://spec.matrix.org/v1.15/server-server-api/">Matrix Client API docs</a>
<ul>
<li><a href="https://spec.matrix.org/v1.15/client-server-api/#post_matrixclientv3joinroomidoralias">POST /_matrix/client/v3/join/!example:example.org</a></li>
</ul>
</li>
<li><a href="https://github.com/matrix-org/synapse/blob/develop/docs/admin_api/user_admin_api.md#login-as-a-user">Admin API POST /_synapse/admin/v1/users/user_id/login</a></li>
</ul></div>
<div id="footer">
<main>
<pre> .--.
." o \__
_.-" ,( `
_.-" ,;;|
_.-=" _," ,,;;;'
.-"`_.-"``-..,,;;;;:'
`"'` `\`\
/^\\\
</pre>
</main>
<aside>
<b>Made with ♥</b> by Thary<br>
<!-- Website sources are available on <a href="https://git.vector1.dev/thary/website">Gitea</a>!<br> -->
<!-- All content is in Public domain and licensed under <a href="https://creativecommons.org/publicdomain/zero/1.0/">CC0</a><br> -->
Logo is created by <a href="https://houl.floof.company/">Houl</a><br>
ASCII arts are taken from <a href="https://web.archive.org/web/20010420182629/http://www.geocities.com/spunk1111/indexjava.htm">this website</a>
</aside>
</div>
</body></html>

View File

@@ -11,7 +11,7 @@
<link rel="icon" href="/nothingrun-favicon-whiteonblack.png" type="image/png">
<title>Contact</title>
<link rel="stylesheet" href="/_astro/contact.030c0792.css" /></head>
<link rel="stylesheet" href="/_astro/contact.f16fd268.css" /></head>
<body>
<div class="header astro-HPNW4VWY">
<a href="/" class="astro-HPNW4VWY">~/</a>

View File

@@ -11,7 +11,7 @@
<link rel="icon" href="/nothingrun-favicon-whiteonblack.png" type="image/png">
<title>Donate :3</title>
<link rel="stylesheet" href="/_astro/contact.030c0792.css" /></head>
<link rel="stylesheet" href="/_astro/contact.f16fd268.css" /></head>
<body>
<div class="header astro-HPNW4VWY">
<a href="/" class="astro-HPNW4VWY">~/</a>

2
dist/index.html vendored
View File

@@ -11,7 +11,7 @@
<link rel="icon" href="/nothingrun-favicon-whiteonblack.png" type="image/png">
<title>nothing.run</title>
<link rel="stylesheet" href="/_astro/contact.030c0792.css" /></head>
<link rel="stylesheet" href="/_astro/contact.f16fd268.css" /></head>
<body>
<div class="header astro-HPNW4VWY">
<a href="/" class="astro-HPNW4VWY">~/</a>

View File

@@ -11,7 +11,7 @@
<link rel="icon" href="/nothingrun-favicon-whiteonblack.png" type="image/png">
<title>Matrix</title>
<link rel="stylesheet" href="/_astro/contact.030c0792.css" /></head>
<link rel="stylesheet" href="/_astro/contact.f16fd268.css" /></head>
<body>
<div class="header astro-HPNW4VWY">
<a href="/" class="astro-HPNW4VWY">~/</a>

View File

@@ -11,7 +11,7 @@
<link rel="icon" href="/nothingrun-favicon-whiteonblack.png" type="image/png">
<title>nothing.run</title>
<link rel="stylesheet" href="/_astro/contact.030c0792.css" /></head>
<link rel="stylesheet" href="/_astro/contact.f16fd268.css" /></head>
<body>
<div class="header astro-HPNW4VWY">
<a href="/" class="astro-HPNW4VWY">~/</a>

View File

@@ -11,7 +11,7 @@
<link rel="icon" href="/nothingrun-favicon-whiteonblack.png" type="image/png">
<title>nothing.run</title>
<link rel="stylesheet" href="/_astro/contact.030c0792.css" /></head>
<link rel="stylesheet" href="/_astro/contact.f16fd268.css" /></head>
<body>
<div class="header astro-HPNW4VWY">
<a href="/" class="astro-HPNW4VWY">~/</a>
@@ -27,6 +27,10 @@
<h2 id="linguistics">Linguistics</h2>
<ul>
<li><a href="/articles/belarusian">Беларусский или белорусский</a></li>
</ul>
<h2 id="computers">Computers</h2>
<ul>
<li><a href="/articles/synapse-revitalization-script">Restoration of Synapse after disappearing 1 year of database history</a></li>
</ul>
<div id="footer">
<main>

View File

@@ -2,10 +2,11 @@
layout: '../../layouts/index.astro'
title: 'Беларусский или белорусский'
description: 'Беларусский или белорусский - как писать?'
keys: 'nothing crypto free software libre self host'
keys: 'Беларусь или Белоруссия белорусский беларусский'
le: '19 Aug. 2025'
---
<div class="article">
## Введение
Вопрос "Беларусь или Белоруссия" здесь затронут не будет. Как беларус, могу сказать, что нам просто приятно, когда нас называют Беларусью, и мы считаем использование первого варианта минимальным уважением к нашему народу.
@@ -23,3 +24,4 @@ le: '19 Aug. 2025'
Вот только слово Беларусь пишется с `а`. Что же пошло не так? Это заимствование из беларусского, и сейчас представляет из себя один цельный корень. Это значит, что при добавлении других морфем, в том числе суффикса -ск-, а в корне должно сохраняться. То есть самый логичный вариант - писать `беларусский`.<br/>Ну либо переходить на `Белорусь`, но...
P.s. естественно, всё это не касается официальных докемнтов, потому что там, как это ни странно, необходимо использовать литератный стандарт.
</div>

View File

@@ -0,0 +1,48 @@
---
layout: '../../layouts/index.astro'
title: 'Restoration of Synapse after disappearing 1 year of database history'
description: '?'
keys: 'matrix synapse conduit'
le: '19 Aug. 2025'
---
<div class="article">
## Introduction
In July 2025, my PostgreSQL had broken, so I needed to restore it from my 1-y.o. backup. I was thinking about what to do, and my friend sent me [this](https://blog.erethon.com/blog/2023/06/21/what-happens-when-a-matrix-server-disappears/) article, so we understood what to do!
For example, there is a room called #example:example.org (roomid !example:example.org), whose member was @user:example.net.
The problem is that every server knows @user:example.net is in the room #example:example.org. But our server doesn't! So that is what we should aim at solving the problem.
## Architecture
We get 2 types of error messages:
- `synapse.handlers.receipts: [PUT-...] Ignoring receipt for room '!example:example.org' from server example.org as we're not in the room` (there is the same error message, but when you get a typing event from an unknown room)
- `synapse.federation.federation_server: [PUT-...] Ignoring PDU for unknown room_id: !example:example.org`
We can read the journal and parse the error message (I use a bash script to do that).
Okay, we have a room id! In the given article, the author is the only user of their server, so they can just send [POST /_matrix/client/v3/join/!example:example.org](https://spec.matrix.org/v1.15/client-server-api/#post_matrixclientv3joinroomidoralias) request, and everything will be good.
But my server has multiple users, so I can't use the easiest way. We need to get information about membership (so we need to get state).
As we are admins of our servers, we have their signing keys.
We will need them because we are going to get state via Federation API requests.
How? There are different ways to do that.
However, all of them require at least 1 event id, so firstly we need to do [GET /_matrix/federation/v1/timestamp_to_event](https://spec.matrix.org/v1.15/server-server-api/#get_matrixfederationv1timestamp_to_eventroomid).
Determining request parameters (?dir as direction (b[ackward] or f[orward]) and &ts as timestamp in Unix time format in milliseconds), we have just got either the last or the first event id! In my case, I chose the way of getting the last event, so then I'll have to make [GET /_matrix/federation/v1/state/!example:example.org?event_id=$event_id](https://spec.matrix.org/v1.15/server-server-api/#get_matrixfederationv1stateroomid), and I will get the actual state.
Of course, both of the requests, as I said, should be signed using your server's key ([how to sign events](https://spec.matrix.org/v1.15/server-server-api/#signing-events)).
<br />
(There is no support of timestamp_to_event in Conduit, so it would be a good idea to make support of requesting different servers)
After we receive the state, we need to parse it, but I think this can't make a difficulty.
As a result, we have a list of our users that were in the given room, like ["@user:example.net", "@anotheruser:example.net", "@exampleuser:example.net"].
Then, the simplest way is to get temporary user's auth token via [POST /_synapse/admin/v1/users/user_id/login](https://github.com/matrix-org/synapse/blob/develop/docs/admin_api/user_admin_api.md#login-as-a-user) and make [POST /_matrix/client/v3/join/!example:example.org](https://spec.matrix.org/v1.15/client-server-api/#post_matrixclientv3joinroomidoralias) from the name of the user using their token.
The problem is solved!
## External links
- [Article that gave me the idea](https://blog.erethon.com/blog/2023/06/21/what-happens-when-a-matrix-server-disappears/)
- [Matrix Federation API docs](https://spec.matrix.org/v1.15/server-server-api/)
- [How to sign Federation API requests](https://spec.matrix.org/v1.15/server-server-api/#signing-events)
- [GET /_matrix/federation/v1/state/!example:example.org?event_id=$event_id](https://spec.matrix.org/v1.15/server-server-api/#get_matrixfederationv1stateroomid)
- [GET /_matrix/federation/v1/timestamp_to_event](https://spec.matrix.org/v1.15/server-server-api/#get_matrixfederationv1timestamp_to_eventroomid)
- [Matrix Client API docs](https://spec.matrix.org/v1.15/server-server-api/)
- [POST /_matrix/client/v3/join/!example:example.org](https://spec.matrix.org/v1.15/client-server-api/#post_matrixclientv3joinroomidoralias)
- [Admin API POST /_synapse/admin/v1/users/user_id/login](https://github.com/matrix-org/synapse/blob/develop/docs/admin_api/user_admin_api.md#login-as-a-user)
</div>

View File

@@ -7,3 +7,6 @@ keys: 'nothing crypto free software libre self host'
## Linguistics
- [Беларусский или белорусский](/articles/belarusian)
## Computers
- [Restoration of Synapse after disappearing 1 year of database history](/articles/synapse-revitalization-script)

View File

@@ -38,6 +38,7 @@ body {
font-optical-sizing: auto;
font-style: normal;
height: 100vh;
}
ul, li {
@@ -216,10 +217,14 @@ pre.smaller {
grid-template-columns: 250px repeat(auto-fit, minmax(250px, 1fr));
max-width: 1300px;
}
@media (min-width: 1570px) {
.bigcontainer {
display: flex;
gap: 50px;
@media (min-width: 1000px) {
.asciicontainer {
grid-template-columns: 250px repeat(auto-fit, minmax(250px, 1fr));
}
}
@media (max-width: 1000px) {
.asciicontainer {
grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}
}
@@ -240,3 +245,8 @@ pre.smaller {
height: auth;
}
}
.article {
padding-left: 18%;
padding-right: 18%;
}