Commit graph kik-website/server/scripts/deploy.sh
Author SHA1 Message Date
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
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