Resource import and export and more tools for Flow
Flownative Resource Tools is a package which provides
- a simple command line tool which allows for exporting and importing of Flow resources, independently from the resource storage being used
- multiple resource targets and storages for special purposes
The Flownative Resource Tools package is installed as a regular Flow package via Composer. For your existing project, simply include `flownative/resource-tools into the dependencies of your Flow or Neos distribution:
$ composer require flownative/resource-tools
A special wrapper for another storage that prevents automatic publishing
of any resources imported to this storage. Note that you need to take
care of publishing resources in your application, they will not be
automatically published if you ask for the public URI. So never use
this as default storage, for example for NeosCMS as it will not be able
to work with unpublished resources.
Note that running
./flow resource:publish will publish resources added
to a collection with this storage so you should avoid that.
storageClass- Sets the class name for the actual storage that will store resources.
storageOptions- Configures the options for the storage class that actually stores resources.
Neos: Flow: resource: storages: specialNonPublishedStorage: storage: 'Flownative\ResourceTools\ResourceManagement\NonPublishingProxyStorage' storageOptions: storageClass: 'Neos\Flow\ResourceManagement\Storage\WritableFileSystemStorage' storageOptions: path: '%FLOW_PATH_DATA%Persistent/Resources/'
This target works just like the Flow
but it generates a salted hash that cannot be guessed by knowing the file.
This is useful if you let anonymous users upload resources to your system but don't want them
to be able to guess the public URI for security reasons.
All the options of the Flow FileSystemSymlinkTarget
salt- optional (will fallback to Flow system encryption key) - the salt to hash URIs with. If you run multiple servers make sure to set this to the same string on every server instead of relying on the encryption key. Ideally set this to a long randomly generated string.
Neos: Flow: resource: targets: localWebDirectoryPersistentResourcesTarget: target: 'Flownative\ResourceTools\ResourceManagement\SaltedFileSystemSymlinkTarget' targetOptions: subdivideHashPathSegment: true # Optional salt salt: 'foobar'
This target prevents any publication by simply doing nothing. For all intends and purposes it looks to Flow like a regular target, but it will not actually make resources public and requesting a URI for one will always return an empty string. There are no configuration options:
Neos: Flow: resource: targets: dummyTarget: target: '\Flownative\ResourceTools\ResourceManagement\DummyTarget' targetOptions: