Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Mimetype Dectection #105

Closed
wants to merge 1 commit into from
Closed

Conversation

gotmax23
Copy link

@gotmax23 gotmax23 commented Jun 3, 2019

The directions for setting the mimetype is the readme.md is incorrect and does not work on Nextcloud 16. I have edited.

The directions for setting the mimetype is the readme.md is incorrect and does not work on Nextcloud 16. I have edited.
Copy link

@funwhilelost funwhilelost left a comment

Choose a reason for hiding this comment

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

Thank you! I found this super helpful for my NC16 install.

@lil5
Copy link

lil5 commented Jul 27, 2019

👎 This should not work see the schema differences between /resources/config/mimetypemapping.json and /resources/config/mimetypealiases.json.

The example is of the same scema as /resources/config/mimetypemapping.json

{
  "kdbx": ["application/x-kdbx"]
}


To proceed, create the file `/config/mimetypemapping.json` (in the `config/` folder at
Nextcloud’s root directory; the file should be stored next to the `config.php`
To proceed, create the file 'mimetypealiases.json' (in the `config/` folder at
Copy link

Choose a reason for hiding this comment

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

Change to mimetypemapping.json

@maurerle
Copy link
Contributor

To summerize a little bit:
I agree to lil5's suggestion.
I can report that it works both ways but based on the usage in nextcloud mimetypemapping.json would be the right place for this. (reference: relevant server code, Default Mappings, Default Aliases)

So to get everything to work there are two options:

  1. setting mimetypealiases
  2. setting mimetypemapping (preferred)

When setting up option 1 one needs to run the following two commands:

  1. sudo -u www-data php occ maintenance:mimetype:update-js (needed to recreate the mimetypealiases located at core/js/mimetypelist.js)
  2. sudo -u www-data php occ maintenance:mimetype:update-db --repair-filecache (to update the filetype mapping and database.

When setting up option 2 you only need to run
sudo -u www-data php occ maintenance:mimetype:update-db --repair-filecache (to update the filetype mapping and database.

(The command sudo -u www-data php occ files:scan --all does this too, but does a lot of unneeded stuff more.)

Source: Nextcloud Server docs and manual testing

This would close #92 , #116 and other mimetype related issues.
Afterwards we could activate the app for general usage with Nextcloud 17.

@@ -20,10 +20,10 @@ To update to a new version, simply repeat these steps.
Unfortunately, apps can't declare new mimetypes on the fly. To make
Keeweb work properly, you need to add a new mimetype in the
`mimetypemapping.json` file (also see the Nextcloud manual at
https://docs.nextcloud.com/server/14/admin_manual/configuration_mimetypes/index.html).
https://docs.nextcloud.com/server/16/admin_manual/configuration_mimetypes/index.html).
Copy link
Contributor

Choose a reason for hiding this comment

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

should be stable to point always to the latest documentation

also refer to
https://docs.nextcloud.com/server/stable/admin_manual/configuration_server/occ_command.html#maintenance-commands

(if needed, replace `www-data` with the actual user which is used by the webserver):

sudo -u www-data php occ maintenance:mimetype:update-js
Copy link
Contributor

Choose a reason for hiding this comment

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

remove update-js and files:scan in favor of sudo -u www-data php occ maintenance:mimetype:update-db --repair-filecache as stated in my comment

@kesselb
Copy link
Contributor

kesselb commented Dec 7, 2019

Could you help me testing #124? Hopefully that will make the manual change to mimetypemapping.json superfluous. Thanks 👍

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.

5 participants