mirror of
https://github.com/deuill/coreos-home-server.git
synced 2024-09-21 13:40:45 +00:00
Alex Palaistras
d9f675817e
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.
20 lines
917 B
Desktop File
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
|