diff options
author | EuAndreh <eu@euandre.org> | 2023-03-20 09:46:20 -0300 |
---|---|---|
committer | EuAndreh <eu@euandre.org> | 2023-03-20 10:03:17 -0300 |
commit | 7ffcd694068d484842be0b87a9aeeda0a7720568 (patch) | |
tree | c2744d6661967f5a2c128528d6ed51739556d906 /Makefile | |
parent | Makefile: Also upload managed SSH known_hosts file (diff) | |
download | server-7ffcd694068d484842be0b87a9aeeda0a7720568.tar.gz server-7ffcd694068d484842be0b87a9aeeda0a7720568.tar.xz |
Manage public SSH files as "extra-etc-file" instead of like a secret
Notes
See CI logs with:
git notes --ref=refs/notes/ci-logs show 7ffcd694068d484842be0b87a9aeeda0a7720568
git notes --ref=refs/notes/ci-data show 7ffcd694068d484842be0b87a9aeeda0a7720568
Exit status: 0
Duration: 15
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 20 |
1 files changed, 7 insertions, 13 deletions
@@ -5,18 +5,21 @@ all: result -result: ALWAYS +result: ALWAYS src/infrastructure/keys/SSH/root@euandre.org.id_rsa.pub.stripped rm -f result-next guix system -v3 -r result-next build src/infrastructure/guix/system.scm rm -f result mv result-next result +src/infrastructure/keys/SSH/root@euandre.org.id_rsa.pub.stripped: \ + src/infrastructure/keys/SSH/root@euandre.org.id_rsa.pub.txt + cut -d' ' -f6- < $(@D)/`basename $@ .stripped`.txt > $@ + check: clean: rm -rf \ - src/secrets/*.txt src/infrastructure/keys/SSH/*.stripped \ result result-next \ @@ -43,22 +46,13 @@ $(repo-secrets): gpg -aer eu@euandre.org < $(@D)/`basename $@ .gpg` > $@ -public-ssh = src/infrastructure/keys/SSH/root@euandre.org.id_rsa.pub -$(public-ssh).stripped: $(public-ssh).txt - cut -d' ' -f6- < $(public-ssh).txt > $@ - - -upload-secrets: $(prod-secrets.txt) $(public-ssh).stripped \ - src/infrastructure/keys/known_hosts.txt +upload-secrets: $(prod-secrets.txt) ssh euandre.org sudo -u secrets-keeper 'rm -f /opt/secrets/*' rsync \ --rsync-path='sudo -u secrets-keeper rsync' \ --chmod=000 \ -avzP \ - $(prod-secrets.txt) \ - $(public-ssh).stripped \ - src/infrastructure/keys/known_hosts.txt \ - euandre.org:/opt/secrets/ + $(prod-secrets.txt) euandre.org:/opt/secrets/ ## Generate the ".ssh/authorized_keys" file and upload |