Compare commits

..

No commits in common. "069d62b5d90cded15783a71162b5f19c47dd0332" and "9bdabd50e79ba567a503b43470070587d5ecf336" have entirely different histories.

View file

@ -139,24 +139,29 @@ in
}; };
script = '' script = ''
set -eu set -eu
# Copy the immutable store package into a writable app root.
# Symlinking would defeat Laravel's __DIR__ based path
# resolution: PHP's __DIR__ follows symlinks back to the
# read only store, breaking storage/ and bootstrap/cache/
# writes even when those subtrees are themselves symlinked
# into a writable state dir.
rm -rf ${appRoot} rm -rf ${appRoot}
mkdir -p ${appRoot} mkdir -p ${appRoot}
cp -rL ${cfg.backendPackage}/share/php/tide-backend/. ${appRoot}/ for entry in ${cfg.backendPackage}/share/php/tide-backend/*; do
chmod -R u+w ${appRoot} name="$(basename "$entry")"
case "$name" in
# Redirect the two mutable subtrees to /var/lib/tide/state storage|bootstrap)
# so they survive activations and don't accumulate inside ;;
# the disposable app root copy. *)
rm -rf ${appRoot}/storage ${appRoot}/bootstrap/cache ln -s "$entry" "${appRoot}/$name"
ln -sfn ${stateRoot}/storage ${appRoot}/storage ;;
esac
done
# bootstrap dir: symlink everything from the store
# except cache/ which must be writable.
mkdir -p ${appRoot}/bootstrap
for entry in ${cfg.backendPackage}/share/php/tide-backend/bootstrap/*; do
name="$(basename "$entry")"
if [ "$name" != "cache" ]; then
ln -sf "$entry" "${appRoot}/bootstrap/$name"
fi
done
ln -sfn ${stateRoot}/bootstrap-cache ${appRoot}/bootstrap/cache ln -sfn ${stateRoot}/bootstrap-cache ${appRoot}/bootstrap/cache
ln -sfn ${stateRoot}/storage ${appRoot}/storage
chown -R ${cfg.user}:${cfg.group} ${appRoot} ${stateRoot} chown -R ${cfg.user}:${cfg.group} ${appRoot} ${stateRoot}
''; '';