/
githubmirror
/
syncthing
Обзор
Документация
Войти
/
githubmirror
/
syncthing
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
v2.0.16
script/docker-entrypoint.sh
26 строк
737 B
Beat Reichenbach
docker: Add support for setting umask (#9429)
22 фев 2024, 11:47
Не верифицирован
22 фев 2024, 11:47
c4dfb66
Код
Авторство
О чём код?
#!/bin/sh set -eu [ -n "${UMASK:-}" ] && umask "$UMASK" if [ "$(id -u)" = '0' ]; then binary="$1" if [ -z "${PCAP:-}" ]; then # If Syncthing should have no extra capabilities, make sure to remove them # from the binary. This will fail with an error if there are no # capabilities to remove, hence the || true etc. setcap -r "$binary" 2>/dev/null || true else # Set capabilities on the Syncthing binary before launching it. setcap "$PCAP" "$binary" fi # Chown may fail, which may cause us to be unable to start; but maybe # it'll work anyway, so we let the error slide. chown "${PUID}:${PGID}" "${HOME}" || true exec su-exec "${PUID}:${PGID}" \ env HOME="$HOME" "$@" else exec "$@" fi