iac/modules/netboot_server/files/sftp/sftp_init_keys.container

21 lines
511 B
Text
Raw Permalink Normal View History

2024-06-04 09:25:59 +00:00
[Unit]
Description = SFTP Key Initialisation
Wants=network-online.target
After=network-online.target
[Container]
ContainerName = sftp_init_keys
Image = localhost/sftp:latest
Volume = ssh_keys.volume:/data/ssh_keys:z
Entrypoint = /bin/sh
Exec = -c "[ -f /data/ssh_keys/ssh_host_ed25519_key ] || ssh-keygen -N '' -f /data/ssh_keys/ssh_host_ed25519_key -t ed25519"
[Service]
WorkingDirectory=/var/roothome/sftp
ExecStartPre=podman build -t sftp:latest .
Restart=on-failure
[Install]
WantedBy=multi-user.target