coreos-home-server/config/service/git/systemd/git-ssh-ed25519@.service
Alex Palaistras aafa8d9f12 Move systemd files to separate folders
This will help make subsequent synchronization with hosts easier, as
systemd files and potential dropins are guarnateed to exist under a
certain hierarchy that can be dropped as-is into host configuration
directories.
2021-03-26 20:47:08 +00:00

20 lines
917 B
Desktop File

[Unit]
Description=Git SSH authentication via ed25519 key %I
[Service]
Type=oneshot
RemainAfterExit=true
PrivateTmp=true
Environment=GIT_HOME=/var/lib/container-service/git
ExecStartPre=/bin/install --owner 10000 --group 10000 -m 0700 -d ${GIT_HOME}/.ssh
ExecStartPre=/bin/install -d ${GIT_HOME}/.ssh/authorized_keys.d
ExecStart=/bin/sh -c "echo 'ssh-ed25519 %I' > ${GIT_HOME}/.ssh/authorized_keys.d/%i"
ExecStartPost=/bin/sh -c "cat ${GIT_HOME}/.ssh/authorized_keys.d/* > /tmp/authorized_keys"
ExecStartPost=/bin/install --owner 10000 --group 10000 -m 0600 /tmp/authorized_keys ${GIT_HOME}/.ssh/authorized_keys
ExecStop=/bin/rm -f ${GIT_HOME}/.ssh/authorized_keys.d/%i
ExecStartPost=/bin/sh -c "cat ${GIT_HOME}/.ssh/authorized_keys.d/* > /tmp/authorized_keys"
ExecStartPost=/bin/install --owner 10000 --group 10000 -m 0600 /tmp/authorized_keys ${GIT_HOME}/.ssh/authorized_keys
[Install]
WantedBy=multi-user.target