nextcloud / server

☁️ Nextcloud server, a safe home for all your data
https://nextcloud.com
GNU Affero General Public License v3.0
26.63k stars 3.99k forks source link

[Bug]: Links to documentation in "Security & setup warnings" are outdated #42317

Closed amlamarra closed 8 months ago

amlamarra commented 8 months ago

⚠️ This issue respects the following points: ⚠️

Bug description

This has been a (minor) issue for a while and I figured I'd report it. I just updated to v28.0.0. The links to the documentation in "Security & setup warnings" (under Administration Settings) are outdated. For instance, this warning:

Not only is it trying to link to version 9, but also "nextcloud.org" which hasn't worked in a while.

Steps to reproduce

  1. Click on your profile button in the top-right corner
  2. Go to "Administration settings"
  3. If there are any security & setup warnings, check the link to the documentation.

Expected behavior

Using the example I gave in the description, instead of linking to https://docs.nextcloud.org/server/9/go.php?to=admin-php-modules, it should probably link to https://docs.nextcloud.com/server/latest/go.php?to=admin-php-modules.

Installation method

Community Manual installation with Archive

Nextcloud Server version

28

Operating system

Debian/Ubuntu

PHP engine version

PHP 8.1

Web server

Apache (supported)

Database engine version

MariaDB

Is this bug present after an update or on a fresh install?

None

Are you using the Nextcloud Server Encryption module?

Encryption is Disabled

What user-backends are you using?

Configuration report

No response

List of activated Apps

No response

Nextcloud Signing status

No response

Nextcloud Logs

No response

Additional info

No response

amlamarra commented 8 months ago

Forgot to mention, when I was searching to see if this was already reported, I only found 1 similar (if not the same) issue: https://github.com/nextcloud/server/issues/15561

joshtrichards commented 8 months ago

Hmm. Works for me. :-)

What does the OC_Version line contain in the /version.php located in your installation directory?

amlamarra commented 8 months ago
$ grep OC_Version /var/www/nextcloud/version.php
$OC_Version = array(28,0,0,11);
$OC_VersionString = '28.0.0';
$OC_VersionCanBeUpgradedFrom = array (
joshtrichards commented 8 months ago

Do you by chance having a custom theme active?

Because we don't have any references to docs.nextcloud.org anywhere in the code and the only other place I can see you could pick this up from is via ~/themes in you installation directory if you have your own from a long time ago. Possibly under occ config:list theming too.

amlamarra commented 8 months ago

I was using the Breeze Dark theme before Nextcloud had a built-in dark theme. I just checked and it was still installed (though disabled since the update). I just uninstalled it and checked, but the links are still old. Any idea how I can fix this?

joshtrichards commented 8 months ago

The only two places I can think of are stale parameters that might appear under:

occ theming:config or occ config:list theming

Also, check /var/www/html/themes (or equivalent, based on your installation folder) for anything other than a README and example folder.

amlamarra commented 8 months ago

Those 2 commands did not show any stale values. However, I did see a defaults.php file and a core/ directory in my /var/www/nextcloud/themes directory. I removed those, refreshed the page and now the links are working correctly.

That defaults.php file has a class OC_Theme with a bunch of functions in there. These 2, in particular, are probably the culprits:

    /**
     * Returns the documentation URL
     * @return string URL
     */
    public function getDocBaseUrl() {
        return 'https://docs.nextcloud.org';
    }

    public function buildDocLinkToKey($key) {
        return $this->getDocBaseUrl() . '/server/9/go.php?to=' . $key;
    }