aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEuAndreh <eu@euandre.org>2023-03-14 18:29:30 -0300
committerEuAndreh <eu@euandre.org>2023-03-14 18:30:37 -0300
commitb7e00c56b219aac4499139a8490671fb5a4bd200 (patch)
tree77216409f15ed05cfc91931a908f53e7da27c0ea
parentsystem.scm: Re-order dhcp-client-service-type (diff)
downloadserver-b7e00c56b219aac4499139a8490671fb5a4bd200.tar.gz
server-b7e00c56b219aac4499139a8490671fb5a4bd200.tar.xz
Makefile: Use correct SSH public key in server
-rw-r--r--.gitignore1
-rw-r--r--Makefile10
2 files changed, 8 insertions, 3 deletions
diff --git a/.gitignore b/.gitignore
index 269dba3..39a6447 100644
--- a/.gitignore
+++ b/.gitignore
@@ -3,3 +3,4 @@
/vendor/
/.sentinel/
/src/secrets/
+/src/infrastructure/keys/SSH/*.stripped
diff --git a/Makefile b/Makefile
index aa5da44..673247f 100644
--- a/Makefile
+++ b/Makefile
@@ -34,14 +34,18 @@ $(repo-secrets):
gpg -aer eu@euandre.org < $(@D)/`basename $@ .gpg` > $@
-public-ssh = src/infrastructure/keys/SSH/root@euandre.org.id_rsa.pub.txt
-upload-secrets: $(prod-secrets.txt) $(public-ssh)
+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
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) euandre.org:/opt/secrets/
+ $(prod-secrets.txt) $(public-ssh).stripped euandre.org:/opt/secrets/
## Generate the ".ssh/authorized_keys" file and upload