Files
ignacionelson 8f12c83d21 Tell a clone-and-build install to rebuild, not to pull
ProjectSend prints the update instructions for the way this server was
installed, and it knew two answers where it needed three: anything inside
a container was handed `docker compose pull && docker compose up -d`. On
the Compose stack that builds from a checkout there is no image behind
those containers, so `pull` skips every ProjectSend service and `up -d`
then finds them all current — the update reports success, changes
nothing, and the dashboard goes on offering the same release. Reported by
@mueller7382, who stayed on 2.0.0 that way while 2.1.0 was out (#1661).

Those installations are now their own kind, told to `git pull` and
rebuild, with the two steps a checkout needs that an image does not: its
dependencies and its compiled frontend live outside git, so a release
that moved either leaves them stale.

Two signals decide it, in that order. The published image now declares
itself with PROJECTSEND_IMAGE, which is the only evidence an operator
bind-mounting over /var/www/html can neither hide nor forge; failing that
— images published before this — a working tree in the install directory,
which the image never has and the repository's own stack always does.
getenv() rather than env(), because a cached configuration makes env()
outside a config file return null, and the answer would flip silently on
exactly the installs most likely to have cached it.

The stale-code banner keeps treating both container kinds alike: what
clears it is recreating the container, whichever way its image was built.

The changelog also credits the reporter of #1663, which was missed when
that entry was written.
2026-08-21 14:35:49 -03:00

28 lines
871 B
PHP

<?php
declare(strict_types=1);
namespace App\Modules\Platform\Installation;
/**
* How this copy of ProjectSend was put on the server, which is the only
* thing that decides what "upgrade" means for the person reading the
* screen. See Installation for how it is established.
*/
enum InstallationKind: string
{
/** Runs from the published image: upgrading is pulling a new one. */
case Container = 'container';
/**
* Runs from a container the operator builds themselves, out of a
* checkout of the repository: upgrading is new code first, then a
* rebuild. Pulling does nothing here — there is no published image
* behind these containers to pull.
*/
case ContainerSource = 'container-source';
/** Runs from files on a server someone administers: upgrading is INSTALL.md's sequence. */
case Manual = 'manual';
}