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

Volumes with private filesystem don't appear in "Available Volumes" field setting #256

Open
yoannisj opened this issue Sep 18, 2023 · 2 comments

Comments

@yoannisj
Copy link
Contributor

yoannisj commented Sep 18, 2023

Describe the bug

When setting up a Local Folder pointing to a path outside the public web folder (e.g. storage/private-files in the example folder structure below), it does not appear in Vizy fields’ "Advanced Settings > Available Volumes" setting. Surprisingly, it does appear as an option in the "Default Upload Location" setting, so Vizy does find the volume.

Example Folder Structure:

config/
storage/
- runtime/
- ...
- private-files/
templates/
translations/
web/
- public-files/
- cpresources/
- index.php

Steps to reproduce

  1. Create the storage/private-files and web/public-files directories from the example folder structure above
  2. Create a "Local Folder" Filesystem named "Private Files" with the "Base Path" setting pointing to storage/private-files
  3. Create a "Local Folder" Filesystem named "Public Files" with the "Base Path" setting pointing to web/public-files
  4. Create a Volume named "Private Assets" and select the "Private Files" filesystem in its "Asset Filesystem" setting
  5. Create a Volume named "Public Assets" and select the "Public Files" filesystem in its "Asset Filesystem" setting
  6. Create a new Vizy field and open the "Advanced Settings" panel
  7. The "Public Assets" volume appears in the Vizy field's "Available Volumes" setting, but the "Private Assets" volume is missing
  8. Notice that both the "Public Assets" and the "Private Assets" volumes appear in the Vizy field's "Default Upload Location" setting

Craft CMS version

Craft Pro 4.4.17

Plugin version

2.1.9

Multi-site?

Yes

Additional context

The reason we need a "Private Assets" volume with a private filesystem is to allow content editors to upload images which are not publicly available until they are effectively used by the front-end. To make this work, we select the "Public Files" filesystem in the volume's "Transform Filesystem" setting, and the images become public when a transform is applied by the front-end code.

I tried switching the "Transform Filesystem" setting from "Public Files" to "Private Files" and that does not influence the issue described here. I did upload an image to the "Private Assets" Volume and confirm that Craft can read and write in the underlying storage/private-files directory.

I have Craft's "allowAdminChanges" setting turned off, so I only tested this in local development environment:

  • DDEV v1.22.1
  • PHP v8.2
@engram-design
Copy link
Member

I will say that by default, Vizy will require volumes (and their filesystem) to have publicly accessible files in order to work. I see from your context explanation your unique way of handling your requirements. I'll need to look at how we can address this.

@yoannisj
Copy link
Contributor Author

yoannisj commented Sep 29, 2023

@engram-design great, thanks! I'd like to add that the use-case described above has been a requirement for more than one of my company's projects already, so it'd be great if Vizy ends up handling this somehow. Let me know if I can help in any way :) !

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

No branches or pull requests

2 participants