Make the VM SSH public key configurable

Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
This commit is contained in:
Denis 'GNUtoo' Carikli 2023-09-13 05:27:40 +02:00
parent 669c708331
commit 67922b0c13
Signed by: GNUtoo
GPG Key ID: 5F5DFCC14177E263
3 changed files with 15 additions and 5 deletions

View File

@ -36,7 +36,8 @@ guix-commit.txt: Makefile
%.scm: %.scm.tmpl guix-commit.txt Makefile %.scm: %.scm.tmpl guix-commit.txt Makefile
sed \ sed \
"s#DOMAIN#$(DOMAIN)#g ; \ "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 = \ IMAGE_SOURCE = \
guix-commit.txt \ guix-commit.txt \

View File

@ -25,6 +25,7 @@ AC_CHECK_PROG([SED], [sed], [sed])
AC_SUBST([DOMAIN], []) AC_SUBST([DOMAIN], [])
AC_SUBST([LETSENCRYPT_EMAIL], []) AC_SUBST([LETSENCRYPT_EMAIL], [])
AC_SUBST([VM_SSH_PUB_KEY], [])
AC_ARG_WITH([domain], AC_ARG_WITH([domain],
[AS_HELP_STRING([--with-domain=DOMAIN], [AS_HELP_STRING([--with-domain=DOMAIN],
@ -39,6 +40,16 @@ AC_ARG_WITH([letsencrypt-email],
[LETSENCRYPT_EMAIL=$withval], [LETSENCRYPT_EMAIL=$withval],
[LETSENCRYPT_EMAIL=cominfra@a-lec.org]) [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_CONFIG_FILES([Makefile])
AC_OUTPUT AC_OUTPUT
@ -47,3 +58,4 @@ echo "Configuration options:"
echo "======================" echo "======================"
echo "- Domain: $DOMAIN" echo "- Domain: $DOMAIN"
echo "- Let's Encrypt email: $LETSENCRYPT_EMAIL" echo "- Let's Encrypt email: $LETSENCRYPT_EMAIL"
echo "- VM SSH public key: $VM_SSH_PUB_KEY"

View File

@ -27,10 +27,7 @@
(authorize? #t) (authorize? #t)
(build-locally? #f) (build-locally? #f)
(host-key (host-key
(string-append "VM_SSH_PUB_KEY")
"ssh-ed25519"
" "
"AAAABBBBCCCCDDDDEEEEFFFFF1111222233334444555566667777888899990000ABC"))
(host-name "DOMAIN") (host-name "DOMAIN")
(identity "./id_ed25519") (identity "./id_ed25519")
(port 222) (port 222)