nextcloud / nextcloud/updater

Feature request: allow configuring download URL order/preference in config.php

Open
#721 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

0. Needs triage enhancement
Dominant language
PHP
Stars
51
Forks
40
Avg merge
2d 19h
Merged PRs (30d)
3

Description

Hello,

I would like to suggest a small but useful improvement to the updater.

Currently, when downloading a Nextcloud update, the updater tries download URLs in the order provided by the update server — GitHub releases first, then download.nextcloud.com as fallback. If the first URL is unreachable (e.g. GitHub is blocked or rate-limiting a server IP), the updater waits for the full curl timeout (~2 minutes) before failing entirely, without attempting the next URL.

Suggested improvement

Add a config.php option to either:

  • define a preferred download URL directly, or
  • reverse the URL priority order

Something like:

'updater.download.url' => 'https://download.nextcloud.com/server/releases/',

This would allow server administrators to force the use of a specific mirror without having to patch updater.phar or index.php manually after every update.

Context

The downloadUpdate() method already supports a $url parameter when called from CLI (--url flag), but this is not exposed as a config.php option, and it is not available at all when using the web updater (index.php).

Workaround currently used

Patching getDownloadURLs() in both updater.phar and index.php to call array_reverse() on the returned URL list — but this patch is lost after every Nextcloud update.

Thank you for considering this improvement.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing downloadUpdate() and getDownloadURLs(), including the --url CLI path and the web updater in index.php. Review how config.php is read, then define and implement the requested URL preference consistently in updater.phar and index.php. Done means administrators can configure the preference without patching generated files and the updater tries URLs in the configured behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
release
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.