fix: make the dokku data directory writable on source installs

debian/postinst creates /var/lib/dokku/data and gives it to the dokku
user, but make install never did. When data ends up root-owned, every
deploy fails because the build hook creates data/builds/<app> as the
dokku user. Mirror the postinst setup and repair root-owned entries
below data as well.
This commit is contained in:
apple
2026-11-14 14:57:08 +08:00
parent 424232c5af
commit dff6e2fd1e

View File

@@ -31,7 +31,7 @@ else
BUILD_STACK_TARGETS = build-in-docker
endif
.PHONY: all apt-update install version copyfiles copyplugin man-db plugins dependencies docker-image-labeler lambda-builder netrc sshcommand procfile-util plugn docker aufs stack count vagrant-acl-add vagrant-dokku go-build wget
.PHONY: all apt-update install version copyfiles copyplugin dokku-lib-dirs man-db plugins dependencies docker-image-labeler lambda-builder netrc sshcommand procfile-util plugn docker aufs stack count vagrant-acl-add vagrant-dokku go-build wget
include docs.mk
include tests.mk
@@ -42,7 +42,14 @@ include arch.mk
all:
# Type "make install" to install.
install: dependencies version copyfiles plugin-dependencies plugins
install: dependencies version copyfiles dokku-lib-dirs plugin-dependencies plugins
# mirrors setup-storage from debian/postinst so source installs leave the
# data directory writable by the dokku user, which owns every deploy hook
dokku-lib-dirs:
mkdir -p ${DOKKU_LIB_ROOT}/data ${DOKKU_LIB_ROOT}/data/storage
chown dokku:dokku ${DOKKU_LIB_ROOT}/data
find ${DOKKU_LIB_ROOT}/data -user root -exec chown dokku:dokku {} +
packer: