Skip to content

Commit

Permalink
feat: ♻️ 🔀 Merge pull request AnotherStranger#68 from Spice-King/patch-1
Browse files Browse the repository at this point in the history
Improve security and handling around BORG_AUTHORIZED_KEYS
  • Loading branch information
AnotherStranger authored Dec 13, 2023
2 parents cf5ff48 + 430f90e commit 34a827a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ fi

# if BORG_AUTHORIZED_KEYS is set substitute authorized_keys file
if [ -n "${BORG_AUTHORIZED_KEYS+x}" ]; then
echo -e "${BORG_AUTHORIZED_KEYS}" | sed -e "s/^/command=\"borg serve ${BORG_SERVE_ADDITIONAL_ARGS} --restrict-to-path \/home\/borg\/backups\" /" >/home/borg/.ssh/authorized_keys
echo -e "${BORG_AUTHORIZED_KEYS}" | sed -re "/^\\s*(\$|#)/! s/^/restrict,command=\"borg serve ${BORG_SERVE_ADDITIONAL_ARGS} --restrict-to-path \/home\/borg\/backups\" /" >/home/borg/.ssh/authorized_keys
fi
chown borg:borg /home/borg/.ssh/authorized_keys
chmod og-rwx /home/borg/.ssh/authorized_keys
Expand Down

0 comments on commit 34a827a

Please sign in to comment.