-
Notifications
You must be signed in to change notification settings - Fork 820
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
Store protected assets outside of webroot #7710
Comments
Ideally we could allow for this in the 4.x release line by introducing separate config settings for public-asset-path, and protected-asset-path. By default, protected-asset-path = I would recommend allowing the use of environment variables to specify these, so that a hosting environment can specify its set-up. |
We do have You can also inject it this way. SilverStripe\Core\Injector\Injector:
SilverStripe\Assets\Flysystem\ProtectedAdapter:
class: SilverStripe\Assets\Flysystem\ProtectedAssetAdapter
constructor:
root: './assets' # note: path relative to base path, not public or assets. Could be anything really. Probably needs to have better docs, migration tools (i.e. for moving paths around), and could be set as the default at some point in the near future. |
Cool, so this might simply be a matter of fully testing this use-case. |
Note that it's currently unclear whether Silverstripe Cloud or CWP support this, but it shouldn't block us from recommend this in the open source project. It's documented in the "server requirements", which should make it pretty clear that this requires you to have control over server configuration (or check with those that have). See silverstripe#7710
name: my-project
recipe: lamp
config:
webroot: public
proxy:
appserver:
- my-project.lndo.site
There are no mechanisms for migrating from one configuration to another, although that should be pretty obvious to anyone who deals with files, right? It would only become our problem if we did this automatically for existing projects. I've created a docs PR: #9736, and would say this closes this issue. While Lando is running nginx only, I can't see how this behaviour would be webserver dependant. Beyond requiring read access to that new folder location of course. Any further validation required? |
Merged the docs PR, closing this issue. |
Overview
Split out from 4.1-level change to
public
webroot in #7419Acceptance Criteria
public/
webrootpublic/
folder ("legacy mode")public/assets/.protected
toassets/
)Notes
assets
vs.public/assets
might be too confusing?)The text was updated successfully, but these errors were encountered: