Default assets path for media (images, video, PDF)
planned
Sean Freeman
Default assets path for media (images, video, PDF)
## Use Case
End Users are prompted to use a default assets path in the root directory /assets which would store images /assets/images etc.
This prevents poor documentation management if users have read/write access to folders where they upload asset files created a messy documentation folder.
This also prevents poor user experience in restricting users to one read/write folder for assets without proper indication in the Upload File prompt box.
## Proposed solution:
Option to have default assets directory, where the Upload File prompt box removes directory structure selection and just requests the file/folder which are the assets to be uploaded to what ever the administrator has defined as default
Nicolas Giard
updated the status to
planned
Nicolas Giard
Merged in a post:
Default config for site assets
M
Matt P
New wiki.js installs seem to quickly run into the "where do I upload my logo/background assets for login page?"
Today: These assets get uploaded somewhere. Then eventually the admin figures out that he needs to grant guest user group read access to these assets in order to see then when not logged in.
The problem is that the admin should also probably restrict writing to this path for any non-admins so that wiki users don't unknowingly upload assets to a folder that is public (wiki users may not be aware of the permissions scheme setup by wiki admins and this is a big security liability for new users).
What would make sense is to setup the best practices out of the box to keep new wiki.js admins out of trouble. I guess something like:
/public-assets/
(so obvious to wiki users this is a public folder)- with world/guest read access but
- ONLY admin write access so normal wiki users are less likely to inadvertently upload something private into this asset prefix.
And this prefix should then be the default for logo/icon/background type uploads in the admin UI.
Joel DeTeves
We would really like to have the assets uploaded while working on a page default to the same location as the page if that makes sense. Aside from helping keep assets organized, this also helps keep permissions consistent so we don't accidentally end up creating assets in the root directory where users who have access to that page can't see them. Thank you,
Tak-MK
A simple idea that came to mind for this to be done:
Checkbox on Settings like "Restrict asset folders per page".
Then, each time you edit a page, it only has access to a folder which is the ID of the page (176, for example), so no matter how you reorganize and move everything here and there, assets will be inside that "176" folder.
I think I'll do that manually for now (I would try to do a PR but I have not much idea and v3 with new asset manager is around the corner...).
Thanks!
Edit: I just realized that I wrote the same idea months ago in a comment...
Deni Begaj
I find this very useful too. If I have a page with link
general/customer/profiles/customer-1
, I would love that when I open the asset manager modal, wiki has already created the folder structure inside the assets which corresponds to the link of the page where assets will be put. For sure, having this folder be updated dynamically upon page link update (like fellow commenters suggested) would be a cool follow-up feature.I find this very helpful because Wiki.JS authorization flow (for assets) takes into account the asset path. But if by default, all assets go to root path, then authorization flow is already faulty :/
Tak-MK
Something "automatic" for that, instead of having a folder set up by the administration, could be an option that makes every page to have an asset folder called like its page id, for example, and if you delete that page, it deletes that asset folder too.
That way if I move the page to another hierarchy place, I don't have to fix that asset folder hierarchy too (as I'm doing now manually on the database).
Nicolas Giard
Merged in a post:
Store assets on a "linked" folder to the page
Tak-MK
Hi there!
I didn't know how to explain that on the title, but the thing it's that I'd like an option to store all assets on a "automatic folder" that moves along with the page, so if I reorganize pages along the wiki, assets "move" with them and I don't have to reorganize also the hierarchy on the assets manager.
Thanks a lot!
Fabian
This would be great for me!
S
Sebastien
Maybe the media default path should be the same a the page path. eg for the page /wiki/foo/bar, when the user click the upload button, The interface is already in /wiki/foo/bar
Fabian
Sebastien: +1
Nicolas Giard
Yes this is being addressed in 3.0. Site assets such as logo will live in their own space, not visible to normal users and won't be affected by permissions.
Assets in general will now be "attached" to a page by default. So any upload will have the same permissions as the page. You'll still have the option to upload assets anywhere (not tied to a page) as well but it will be an option, which can be disabled by the admin.
Load More
→