Skip to content

feat: add drawio mimetypes to prevent code signing errors#46729

Draft
tnyeanderson wants to merge 1 commit intonextcloud:masterfrom
tnyeanderson:drawio-code-signing
Draft

feat: add drawio mimetypes to prevent code signing errors#46729
tnyeanderson wants to merge 1 commit intonextcloud:masterfrom
tnyeanderson:drawio-code-signing

Conversation

@tnyeanderson
Copy link

@tnyeanderson tnyeanderson commented Jul 25, 2024

Summary

Installing drawio on a nextcloud server causes a failed code signing check on mimetypelist.js as well as some "extra" SVG files for the MIME type.

This PR adds these to core so the files do not need to be changed/added during the install process, which will avoid the code signing failures.

TODO

Checklist

@kesselb
Copy link
Contributor

kesselb commented Jul 25, 2024

Thanks for your pull request 👍

Alternative: It's possible to overwrite/extend the mimetype mappings by placing a file "mimetypemapping.json" in the configuration folder. Other apps are using this approach, for example: https://github.com/jhass/nextcloud-keeweb/pull/135/files or https://github.com/ayselafsar/dicomviewer/blob/master/lib/Migration/RegisterMimeType.php

@kesselb
Copy link
Contributor

kesselb commented Jul 25, 2024

Adjust the code signing hashes for these files?

// When updating the mimetype list the test assets need to be updated as well
// 1. Update core/js/mimetypelist.js with the new generated js by running the test with the next line uncommented:
// file_put_contents(\OC::$SERVERROOT . '/tests/data/integritycheck/mimetypeListModified/core/js/mimetypelist.js', $newFile);
// 2. Update signature.json using the following occ command:
// occ integrity:sign-core --privateKey=./tests/data/integritycheck/core.key --certificate=./tests/data/integritycheck/core.crt --path=./tests/data/integritycheck/mimetypeListModified

@skjnldsv skjnldsv added the 2. developing Work in progress label Jul 27, 2024
@github-actions
Copy link
Contributor

github-actions bot commented Aug 9, 2024

Hello there,
Thank you so much for taking the time and effort to create a pull request to our Nextcloud project.

We hope that the review process is going smooth and is helpful for you. We want to ensure your pull request is reviewed to your satisfaction. If you have a moment, our community management team would very much appreciate your feedback on your experience with this PR review process.

Your feedback is valuable to us as we continuously strive to improve our community developer experience. Please take a moment to complete our short survey by clicking on the following link: https://cloud.nextcloud.com/apps/forms/s/i9Ago4EQRZ7TWxjfmeEpPkf6

Thank you for contributing to Nextcloud and we hope to hear from you soon!

(If you believe you should not receive this message, you can add yourself to the blocklist.)

@tnyeanderson
Copy link
Author

Hey @kesselb, finally getting back to this... sorry for my delay. I'm trying to work through the steps you provided, but I haven't developed with nextcloud yet so I'm having a little trouble running the tests following the docs here.

To try to accomplish step 1 in your link above, I'm running this:

$ USEDOCKER=1 ./autotest.sh mysql tests/lib/IntegrityCheck/CheckerTest.php
Using PHP executable /usr/bin/php
Using database oc_autotest
Setup environment for mysql testing on local storage ...
Updated 0 paths from the index
Fire up the mysql docker
Waiting for MySQL initialisation ...
...................
Installing ....
No database drivers (sqlite, mysql, or postgresql) installed.


PHP module zip not installed.
Please ask your server administrator to install the module.

PHP module GD not installed.
Please ask your server administrator to install the module.

PHP module cURL not installed.
Please ask your server administrator to install the module.

An unhandled exception has been thrown:
Exception: Environment not properly prepared. in /home/thomas/Desktop/github/nextcloud-server/lib/private/Console/Application.php:137
Stack trace:
#0 /home/thomas/Desktop/github/nextcloud-server/console.php(81): OC\Console\Application->loadCommands()
#1 /home/thomas/Desktop/github/nextcloud-server/occ(11): require_once('...')
#2 {main}Kill the docker 97ce4c726070e175b0585c2c3e889918fed53f6711fed611653303dd5528e385
97ce4c726070e175b0585c2c3e889918fed53f6711fed611653303dd5528e385
97ce4c726070e175b0585c2c3e889918fed53f6711fed611653303dd5528e385

My goal is to use docker for this (to avoid cluttering my machine), and I figured I don't need to run this for every db type so I just chose mysql. I also am trying to run only the integrity check tests to save time.

Could you give me some pointers on what I'm doing wrong here?

@skjnldsv skjnldsv added this to the Nextcloud 32 milestone Jan 30, 2025
@skjnldsv skjnldsv modified the milestones: Nextcloud 32, Nextcloud 33 Sep 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Core check fails after installing the app

3 participants