Is there a command line to update to specific versions of Nextcloud?

Which Nextcloud version do you actual use? You can copy it from Github e.g. here. Use here and change on the top left your release. Download raw.

Maybe you can set in config/config.php:
'integrity.check.disabled' => true,

I actually use version 28.0.3.

Can you clarify what you mean by: “… and change on the top left your release.” I don’t see the a button or drop down to change release.

However, I issued this commad:
sudo -u www-data php occ maintenance:mimetype:update-js, which put a copy of the file properly in place. However, Recan produced this error:

Technical information

The following list covers which files have failed the integrity check. Please read
the previous linked documentation to learn more about the errors and how to fix
them.

Results

  • core
    • INVALID_HASH
      • core/js/mimetypelist.js

Raw output

Array
(
[core] => Array
(
[INVALID_HASH] => Array
(
[core/js/mimetypelist.js] => Array
(
[expected] => 550ab566d30693bfa24ec4b15d9df87731ae8a3be8f79dabf94757e5b8b20eec6e4b678f17af1718297f2872f6b04519eeb024d1dff11947f29da431c7f11201
[current] => 24e6faa4a1361e51ff70027024f41c4b37fdb5f6f347ceb095450ddbde2d0a6b6dd1403be92a912d2889064a9736a9bed89d7dc62470035fc1299d4b977c5f46
)

            )

    )

)

I’ll leave ‘integrity.check.disabled’ => true.

Thanks @devnull. Also thanks to @Alex_Marano for his script.

Here are the steps to the solution:

  1. There is no need to set in config/config.php, ‘integrity.check.disabled’ => true,

  2. Download the correct mimetypelist.js for your specific version as specified by @Alex_Marano in his excellent script shown below:

HT_USER=www-data # change this if your ht user is different
NC_DIR=/var/www/nextcloud
nc_download_default() { local app_id=$1 file=$2 version_tag path=$2
case “$app_id” in
server) version_tag=“v$(awk -F' '/String/{gsub(/ /,”“);$2=tolower($2);print $2}’ “$NC_DIR/version.php”)” ;;
*) xml_f=“$NC_DIR/apps/$app_id/appinfo/info.xml”
version_tag=“v$(xmlstarlet sel -B -t -v “//info/version” “$xml_f”|sed ‘2,$d’)”
path=“apps/$app_id/$file”
esac
sudo -u $HT_USER curl -so $NC_DIR/$path https://raw.githubusercontent.com/nextcloud/$app_id/$version_tag/$file
}

nc_download_default server “core/js/mimetypelist.js”
sudo -u $HT_USER php $NC_DIR/occ integrity:check-core

a) Download the script outside of your nextcloud directory.
b) Adjust HT_USER and NC_DIR for your configuration
c) For example, I pasted the script into a vim file getcorrectMimetypelist.sh
d) saved getcorrectMimetypelist.sh outside my nextcloud directory and chown
    www-data:www-data
e) run the script: sh getcorrectimetypelist.sh
f) from **Security & setup warnings**, Click Recan.
g) Hopefully the problem is solved.

The problem comes from the draw.io app which adds mimetype icons: GitHub - jgraph/drawio-nextcloud: Fork from 2022 nextcloud repo then the integrity check obviously fails, because files were added and changed.

2 Likes

Yes! I appreciate your investigation into the cause. How do I mark this as solved?