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>
This commit is contained in:
parent
e48e0644ba
commit
22106dcd7d
1 changed files with 106 additions and 28 deletions
|
|
@ -1,6 +1,6 @@
|
|||
# Builds the files for the home directory of the shell server's root user in ../resources: README, README.en,
|
||||
# CODE_OF_CONDUCT and CODE_OF_CONDUCT.en as the website's pages in terminal text with escape sequences, and the
|
||||
# shell configuration from ../shell.
|
||||
# files of ../home, which are copied as they are.
|
||||
# Usage: python3 server/scripts/make_files.py
|
||||
import pathlib
|
||||
import shutil
|
||||
|
|
@ -336,6 +336,12 @@ out.mkdir(exist_ok=True)
|
|||
for name, text in [('README', readme(DE)), ('README.en', readme(EN)),
|
||||
('CODE_OF_CONDUCT', code_of_conduct(COC_DE)), ('CODE_OF_CONDUCT.en', code_of_conduct(COC_EN))]:
|
||||
(out / name).write_text(text, encoding='utf-8')
|
||||
# The shell configuration is not generated, it is copied from ../shell, where it is edited.
|
||||
for name in '.zshrc', '.zshenv':
|
||||
shutil.copyfile(pathlib.Path(__file__).parent.parent / 'shell' / name, out / name)
|
||||
# The files for the home directory are not generated, they are copied from ../home, where they are edited.
|
||||
home = pathlib.Path(__file__).parent.parent / 'home'
|
||||
for path in home.rglob('*'):
|
||||
target = out / path.relative_to(home)
|
||||
if path.is_dir():
|
||||
target.mkdir(parents=True, exist_ok=True)
|
||||
else:
|
||||
target.parent.mkdir(parents=True, exist_ok=True)
|
||||
shutil.copyfile(path, target)
|
||||
|
|
|
|||
Loading…
Reference in a new issue