From 67922b0c13428734ae46d39bc8ef43ccef346c23 Mon Sep 17 00:00:00 2001 From: Denis 'GNUtoo' Carikli Date: Wed, 13 Sep 2023 05:27:40 +0200 Subject: [PATCH] Make the VM SSH public key configurable Signed-off-by: Denis 'GNUtoo' Carikli --- Makefile.am | 3 ++- configure.ac | 12 ++++++++++++ mumble-vm-machine.scm.tmpl | 5 +---- 3 files changed, 15 insertions(+), 5 deletions(-) diff --git a/Makefile.am b/Makefile.am index a77beb6..312e3b6 100644 --- a/Makefile.am +++ b/Makefile.am @@ -36,7 +36,8 @@ guix-commit.txt: Makefile %.scm: %.scm.tmpl guix-commit.txt Makefile sed \ "s#DOMAIN#$(DOMAIN)#g ; \ - s#LETSENCRYPT_EMAIL#$(LETSENCRYPT_EMAIL)#g" $< > $@ + s#LETSENCRYPT_EMAIL#$(LETSENCRYPT_EMAIL)#g ; \ + s#VM_SSH_PUB_KEY#$(VM_SSH_PUB_KEY)#g" $< > $@ IMAGE_SOURCE = \ guix-commit.txt \ diff --git a/configure.ac b/configure.ac index d57ceab..c285d77 100644 --- a/configure.ac +++ b/configure.ac @@ -25,6 +25,7 @@ AC_CHECK_PROG([SED], [sed], [sed]) AC_SUBST([DOMAIN], []) AC_SUBST([LETSENCRYPT_EMAIL], []) +AC_SUBST([VM_SSH_PUB_KEY], []) AC_ARG_WITH([domain], [AS_HELP_STRING([--with-domain=DOMAIN], @@ -39,6 +40,16 @@ AC_ARG_WITH([letsencrypt-email], [LETSENCRYPT_EMAIL=$withval], [LETSENCRYPT_EMAIL=cominfra@a-lec.org]) +AC_ARG_WITH([vm-ssh-public-key], + [AS_HELP_STRING([--with-ssh-vm-public-key=VM_SSH_PUB_KEY], [Use custom VM + SSH public key for use with 'guix deploy'. (default=\ +ssh-ed25519\ + AAAAC3NzaC1lZDI1NTE5AAAAIEjLYbJ+47MTte960IbOUTRzOD012ewt1IZgOOc+NqDa)])], + [VM_SSH_PUB_KEY=$withval], + [VM_SSH_PUB_KEY="\ +ssh-ed25519\ + AAAAC3NzaC1lZDI1NTE5AAAAIEjLYbJ+47MTte960IbOUTRzOD012ewt1IZgOOc+NqDa"]) + AC_CONFIG_FILES([Makefile]) AC_OUTPUT @@ -47,3 +58,4 @@ echo "Configuration options:" echo "======================" echo "- Domain: $DOMAIN" echo "- Let's Encrypt email: $LETSENCRYPT_EMAIL" +echo "- VM SSH public key: $VM_SSH_PUB_KEY" diff --git a/mumble-vm-machine.scm.tmpl b/mumble-vm-machine.scm.tmpl index 5b94711..acf1066 100644 --- a/mumble-vm-machine.scm.tmpl +++ b/mumble-vm-machine.scm.tmpl @@ -27,10 +27,7 @@ (authorize? #t) (build-locally? #f) (host-key - (string-append - "ssh-ed25519" - " " - "AAAABBBBCCCCDDDDEEEEFFFFF1111222233334444555566667777888899990000ABC")) + "VM_SSH_PUB_KEY") (host-name "DOMAIN") (identity "./id_ed25519") (port 222)