Repository navigation
Description
What is broken
No family can use the Petersburg diary through this project, whatever the app does. The St Petersburg city network that hosts dnevnik2.petersburgedu.ru answers nothing to an address outside Russia. The server runs on Vercel in Frankfurt (fra1), and every Petersburg call the server makes goes out from there.
The phone's own sign-in (#140) does not get around this. POST /api/v1/diary/session adopts the phone's session with one read from the server's own address (PetersburgProvider.adopt, server/app/providers/petersburg/provider.py:100). Every diary read after that, /students, the lessons, the marks and the bot's «Дневник», is also made from the server.
This answers the question section 5 of HANDOVER.md left open: «A diary that ties a session to its address, or refuses foreign ones…». It refuses foreign ones, and it does so below HTTP: there is no 409 or 403 to read, only silence.
Failure scenario, as measured on 2 October 2026
POST https://lessons-ruddy-zeta.vercel.app/api/v1/diary/loginwith a made-up login and"provider": "petersburg"answered503,X-Diary-Unavailable: upstream,{"detail":"Дневник не ответил вовремя"}, in 5.85 s. That is the 5-second connect timeout inpetersburg/client.py:77, not a judgement on the password.- From a cloud session outside Russia,
PetersburgClient.logingave up the same way after 7.1 s.curlshowed the tunnel opening and then no TLS answer at all until the timeout. - Same probe, same moment, 20-second ceiling:
| Host | Result |
|---|---|
dnevnik2.petersburgedu.ru (46.243.177.102/103) |
no answer |
petersburgedu.ru |
no answer |
www.spb.ru |
no answer |
www.gosuslugi.ru |
200, TLS in 3.5 s |
ya.ru |
302, TLS in 0.9 s |
github.com |
answered in 0.3 s |
The whole city government network is closed to the outside while federal and commercial Russian hosts are open. That is a geo-fence, not an outage of the diary.
What is ruled out
- The server's own handling. The timeout fires,
_guardturnsUpstreamUnavailableinto a503with its header, and the login limiter forgives it. - The production deployment itself.
/api/v1/health,/api/v1/warmup(schema: 0017) and/api/v1/diary/capabilities(Petersburg enabled) all answer in under 1.5 s.
What a fix has to be
No app change can make Frankfurt reach the city's network. The Petersburg traffic the server sends has to leave from a Russian address. The options, smallest first:
- A Russian egress for diary traffic only. Add an optional setting, for example
DIARY_PROXY_URL, that the Petersburg httpx client (and the NetSchool one, if their regions turn out to be fenced too) passes asproxy=. Point it at a password-protected HTTP proxy on a small Russian VPS. Optional, logged inSettings.disabled_featureswhen unset, and kept off the mandatory list inget_settings(). Renting and running the VPS is the owner's step. - Move the server to Russian hosting. A larger move, which would also settle the 152-ФЗ question section 5 already raises about personal data held in Frankfurt.
- Let the phone read the diary itself, since it is in Russia. A rewrite of the diary's server half; the corrections and the bot's diary both live there.
Not checked
- Whether the NetSchool regions in
capabilitiesare fenced the same way from Frankfurt. Walk the app on an emulator, fix what it found, and the owner's tab bar and pickers #186 reached Amur's server from an emulator, but on a machine in Russia. - Whether the fence is per country or per address range. A Russian VPS from a large provider is the case to test first.
Metadata
Metadata
Assignees
Type
Projects
- StatusShow more project fieldsDone
Activity
Say where the work stands after the developer mode, and that the serv…
Let a developer send any request to our server or a catalog diary fro…
Say where the work stands after the one-contract programme was agreed…
lumenpearson commentedon Oct 5, 2026
Research of 5 October 2026 on where a Russian egress could live. Prices were read from the providers' own pages that day; the sources are at the end.
The finding that shapes everything: Telegram is blocked in Russia, from Russian data centres too, since March 2026.
api.telegram.orgfrom Russian VPSs since mid-March, on Selectel and Timeweb among others.So moving the whole server into Russia breaks the bot, unless the server reaches Telegram through a proxy abroad. That also affects the answer to question 3 of #301 («a host inside Russia would also be the egress #235 waits for»): it would need a proxy for Telegram.
What fits #235 instead: keep Vercel and Neon, and send only the diary's calls through Russia.
CONNECT) proxy fordnevnik2.petersburgedu.ruonly. The cheapest found is RUVDS «Старт»: 1 vCPU, 0.5 GB and IPv4 included, 149 ₽ a month, with a St Petersburg location. TLS stays end to end, so the proxy never sees the credential. Later, the v2 host (3c) could run on RUVDS «Старт HIT SSD» (1 GB, 349 ₽) with long polling and a proxy abroad for Telegram, which aiogram supports.CONNECTproxy, and nobody has tested whether the diary accepts Yandex Cloud's addresses.Not verified: whether the diary accepts any of these addresses. One request from the box is the test.
Sources (read 5 October 2026):
lumenpearson commentedon Oct 5, 2026
Decided by the owner on 5 October 2026: the bot and the API stay on Vercel and Neon, and only the diary's requests go through Russia, by way of a small Russian VPS used as an HTTPS proxy.
Next:
dnevnik2.petersburgedu.ruis the test that closes this issue.lumenpearson commentedon Oct 5, 2026
Provider chosen by the owner on 5 October 2026: RUVDS. The cheapest plan that fits a proxy is «Старт» (1 vCPU, 0.5 GB, IPv4 included, 149 ₽ a month on 5 October), in the St Petersburg location.
Hand over the batch in which the owner approved the designs and decided
Hand over the batch that lets the Petersburg diary go through a Russi…
lumenpearson commentedon Oct 5, 2026
Verified in production on 5 October 2026: the server now reaches the Petersburg diary, through the Russian proxy.
The proxy is a RUVDS VPS (Rucloud, Korolyov) running Squid on port 23128, set up as
docs/deploy.md, «The electronic diary», asks. It accepts onlyCONNECTtodnevnik2.petersburgedu.ru:443, and only with the password.DIARY_PROXY_URL(#334, #335) is set in Vercel for Production, Preview and Development.The same request was sent to production twice:
POST /api/v1/diary/sessionfor Petersburg, with a JWT-shaped session token that is not a real one.503,X-Diary-Unavailable: upstream, «Дневник не ответил вовремя», as on 2 October409, «Дневник не принял эту сессию с нашего сервера — дело не в пароле.» The diary answered and refused the fake sessionAt 13:20 the VPS showed both legs open: one from Vercel's function (
18.185.49.10, AWS Frankfurt) into Squid, and one from Squid to46.243.177.102:443, the city's information and analytical centre, which is the address that answered nothing from abroad on 2 October.Checked before production:
CONNECT 200);407;403.PetersburgClientitself reached the diary through the proxy (TCP_TUNNEL/200).Not verified: a real family's sign-in and reads. That needs a Petersburg account, and nobody has used one with this server yet.
Hand over the batch that serves v2 beside v1
Send the Petersburg diary's requests through an optional Russian proxy