coreos-home-server/config/service/git/git-ssh-ed25519@.service
Alex Palaistras d9f675817e First public release for CoreOS Home Server
This contains the culmination of work done privately for a few months,
and is intended to be a solid basis for other peoples' experimentations
with setting up single-node, home-server setups using Fedora CoreOS.
2021-03-20 16:32:42 +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