Commit graph kik-website/server/scripts
Author SHA1 Message Date
Zebreus
c498ce1d52 Copy MSYS2's default files into a recreated home
MSYS2 only copies /etc/skel into a home directory that does not exist yet
when the user logs in. The cleanup always creates the home first, so the
default files never arrived.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-25 14:38:35 +01:00
Zebreus
a86a3c7b47 Drop the one-time recovery script
The deployment restores the keys as well, so the script is not needed
anymore.

Co-Authored-By: Claude Code <noreply@anthropic.com>
2026-10-25 14:03:21 +01:00
Zebreus
fd1e379fcf Keep the files for the server in one directory
The resources were copied from home/ and admin/, which held the same
files a second time. Everything that goes to the server is in resources/
now, and the generator only writes the four text files.

Co-Authored-By: Claude Code <noreply@anthropic.com>
2026-10-25 14:01:27 +01:00
Zebreus
a17b2d76dc Check in the keys for both accounts
The keys of the people who deploy are in the repository now: in home/ for
the root user and in admin/ for the Administrator. The resources mirror
both home directories, and the deploy script no longer reads any private
key.

Co-Authored-By: Claude Code <noreply@anthropic.com>
2026-10-25 13:58:05 +01:00
Zebreus
44a2d83ae6 Install the key of the deployer for both accounts
The personal key of the deployer goes into the authorized_keys of the
root user together with the key of the website, and the deployment makes
sure it is in the authorized_keys of the Administrator.

Co-Authored-By: Claude Code <noreply@anthropic.com>
2026-10-25 13:52:32 +01:00
Zebreus
fc7b75b930 Keep the key of the website away from the Administrator account
The key that the website logs in with was written into the authorized_keys
of the Administrator, which would have given everyone who has the website
administrator rights on the box. It only gets access as the root user.

The deploy script logs in as Administrator with the personal key of the
deployer instead, from the agent or from -i.

Co-Authored-By: Claude Code <noreply@anthropic.com>
2026-10-25 13:50:40 +01:00
Zebreus
ac98212fa2 Fix the parentheses in the recovery script
Co-Authored-By: Claude Code <noreply@anthropic.com>
2026-10-25 13:42:21 +01:00
Zebreus
758fc0b828 Give the user their .ssh directory back in the recovery script
Co-Authored-By: Claude Code <noreply@anthropic.com>
2026-10-25 13:35:29 +01:00
Zebreus
22106dcd7d Restore the SSH access in the cleanup
The key that the website logs in with lives in the home directory of the
user, so a deleted home directory took it away and the site could not
connect any more. The key is now one of the copies the cleanup restores,
and it is merged into the authorized_keys of the user, so that keys they
added stay.

The installer writes the same key for the Administrator, and the deploy
script checks that it is the key the website uses.

Co-Authored-By: Claude Code <noreply@anthropic.com>
2026-10-25 13:35:05 +01:00
Zebreus
e48e0644ba Add a deploy script for the cleanup job
It logs in as Administrator, whose shell is a Windows one, copies the
scripts and the resources to the server and runs the installer there. It
uses the key the website uses and checks the host key against the one
the website pins.

Co-Authored-By: Claude Code <noreply@anthropic.com>
2026-10-25 13:17:13 +01:00
Zebreus
917e3d6089 Build the shell configuration into the resources
The shell configuration was copied from the server by hand. It now has
its own directory, which make_files.py copies into the resources, so
that the resources are the whole set of files the cleanup restores and
nothing has to be copied by hand.

Co-Authored-By: Claude Code <noreply@anthropic.com>
2026-10-25 13:05:22 +01:00
Zebreus
23896bced5 Keep the shell server's basic user journey working
The cleanup job now restores the whole home directory instead of only
the four text files: the directory itself, the shell configuration that
gives the prompt, and the files. Anything that is not a regular file is
replaced, so the files stay text files.

The README in server/ describes the security model: the box is a
disposable VPS that may be compromised, the root user may do whatever
they want, and only the prompt, the home directory and the four files
are kept working.

Co-Authored-By: Claude Code <noreply@anthropic.com>
2026-10-25 13:02:25 +01:00
Zebreus
54607982cf Sort the server directory and add the restore task installer
The README and Code of Conduct files move to server/resources, the
scripts that build and deploy them to server/scripts. The new
install_restore_task.ps1 installs a scheduled task as SYSTEM that puts
the files back every 30 minutes, so the shell server's root user can
neither stop it nor change the copies it restores from.

Co-Authored-By: Claude Code <noreply@anthropic.com>
2026-10-25 12:47:26 +01:00