mirror of
https://github.com/deuill/coreos-home-server.git
synced 2024-09-21 21:50:46 +00:00
Alex Palaistras
aafa8d9f12
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.
20 lines
870 B
Desktop File
20 lines
870 B
Desktop File
[Unit]
|
|
Description=Git SSH authentication via public key file %I
|
|
ConditionPathExists=%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
|
|
ExecStart=/bin/install -m 0600 -D %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
|