From 7e6f4f5a84d3b784382ba852009e5766aae69e1c Mon Sep 17 00:00:00 2001 From: casjay Date: Fri, 5 Jun 2026 17:38:17 -0400 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Fix=20chmod=20error=20on=20empty?= =?UTF-8?q?=20ssh=20directory=20at=20first=20run=20=F0=9F=90=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- rootfs/usr/local/etc/docker/init.d/08-gitea.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rootfs/usr/local/etc/docker/init.d/08-gitea.sh b/rootfs/usr/local/etc/docker/init.d/08-gitea.sh index b9e9cb0..57a83b8 100755 --- a/rootfs/usr/local/etc/docker/init.d/08-gitea.sh +++ b/rootfs/usr/local/etc/docker/init.d/08-gitea.sh @@ -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