Skip to content

Conversation

@printminion-co
Copy link

@printminion-co printminion-co commented Apr 10, 2025

in case you dont want to display upgrade button to users
you can redirect them to other location (e.g. dedicated maintenance page)

set desired location via
./occ config:system:set  --type string --value /maintenance -- upgrade.redirect_upgradepage_to_location

TEST

  • ensure maitenece mode is off ./occ maintenance:mode --off
  • Emulate upgrade is needed by setting \OCP\Util::needUpgrade to return true
    • or start clean server with git checkout ionos-dev-v30.0.5 and then switch to git checkout ionos-dev-v30.0.7 branch
  • set config ./occ config:system:set  --type string --value /maintenance -- upgrade.redirect_upgradepage_to_location
  • curl location curl -i http://localhost:8080/index.php
    • observe Location header and status code
  • open in browser. Observe you are redirected to /maitenence#<timestamp>

@printminion-co printminion-co force-pushed the mk/dev/redirect_upgradepage branch from ab5c202 to c9a4519 Compare April 10, 2025 15:11
Copy link

@bromiesTM bromiesTM left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please fixup the fixup-commit

lib/base.php Outdated
if ($redirectUpgradePage !== null) {
http_response_code(307);
header('X-Nextcloud-needsDbUpgrade: 1');
header("Location: ${redirectUpgradePage}#" . time());

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I imagine it would be a good idea to check if redirect_upgradepage_to_location is a valid string

@printminion-co printminion-co force-pushed the mk/dev/redirect_upgradepage branch from 7f38259 to 7291a6c Compare April 14, 2025 07:37
@printminion-co printminion-co marked this pull request as draft April 14, 2025 10:18
@printminion-co printminion-co force-pushed the mk/dev/redirect_upgradepage branch from 7291a6c to ca4fce4 Compare April 15, 2025 09:14
in case you dont want to display upgrade button to users
you can redirect them to other location (e.g. dedicated maintenance page)

set desired location via
./occ config:system:set  --type string --value /maintenance -- upgrade.redirect_upgradepage_to_location

Signed-off-by: Misha M.-Kupriyanov <[email protected]>
@printminion-co printminion-co force-pushed the mk/dev/redirect_upgradepage branch from ca4fce4 to ae5864e Compare April 15, 2025 09:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants