🐛 Fix chmod error on empty ssh directory at first run 🐛

chmod 0600 $DATA_DIR/ssh/* fails with "cannot access" when the
directory is empty (first boot before keys are generated, or when
keys are symlinks in /config/ssh). Replace the glob with find -type f
which silently handles empty directories.
- rootfs/usr/local/etc/docker/init.d/08-gitea.sh: use find -exec chmod instead of glob for ssh key permissions

rootfs/usr/local/etc/docker/init.d/08-gitea.sh
This commit is contained in:
2026-06-05 17:38:17 -04:00
parent 94263dc03c
commit 7e6f4f5a84
@@ -371,7 +371,7 @@ __update_conf_files() {
ssh-keygen -t ecdsa -b 256 -f /config/ssh/ssh_host_ecdsa_key -N "" >/dev/null && __symlink "/config/ssh/ssh_host_ecdsa_key" "$DATA_DIR/ssh/ssh_host_ecdsa_key"
fi
chmod 0700 "$DATA_DIR/ssh" /config/ssh
chmod 0600 "$DATA_DIR/ssh"/* /config/ssh/*
find "$DATA_DIR/ssh" /config/ssh -maxdepth 1 -type f -exec chmod 0600 {} \;
[ -d "$DATA_DIR/ssh" ] || mkdir -p "$DATA_DIR/ssh"
[ -d "$CONF_DIR/custom" ] || mkdir -p "$CONF_DIR/custom"
if [ -n "$CONF_DIR" ] && [ -f "$CONF_DIR/app.ini" ]; then