sitegeist/magicwand

使Flow/Neos开发更简单的工具

安装: 151 996

依赖: 3

建议者: 0

安全: 0

星标: 48

关注者: 8

分支: 13

开放问题: 10

类型:neos-package

v4.4.2 2023-05-30 15:30 UTC

README

使Flow/Neos开发更简单的工具

此包旨在在开发系统中使用,**决不应**在生产服务器上安装。**请在您的composer.json中添加此包到require-dev部分**。

作者与赞助商

此包的开发和公开发布得到了我们的雇主https://www.sitegeist.de的大力赞助。

快速且方便地克隆Flow和Neos安装

CLI命令clone:listclone:preset可帮助将远程Flow/Neos配置克隆到执行命令的本地Flow/Neos安装。

注意:这些命令将清空本地Flow安装的数据库和资源。数据将被远程主机的信息替换。在使用这些命令之前,请确保您理解这一点。

CLI示例

# show all available presets
./flow clone:list

# clone from remote host with the information stored in the master preset
./flow clone:preset master

Settings.yaml

在配置路径中定义的预设。 Sitegeist.MagicWand.clonePresets

Sitegeist:
  MagicWand:
    flowCommand: './flow'

    # preset which is used by the clone:default command
    defaultPreset: 'master'

    # available presets
    clonePresets:

       # the name of the preset for referencing on the clone:preset command
      master:
        # hostname or ip of the server to clone from
        host: ~
        # ssh username
        user: ~
        # ssh port
        port: ~
        # ssh options
        sshOptions: ~
        # path on the remote server
        path: ~
        # flow-context on the remote server
        context: Production

        # the flow cli command on the remote server
        # default is the main flowCommand-Setting
        flowCommand: ~

        # options to adjust the clone process
        clone: []

        # commands to execute after cloning like ./flow user:create ...
        postClone: []

        # informations to access the resources of the cloned setup via http
        # if this is configured the rsync of the persistent resources is skipped
        # and instead resources are fetched and imported on the fly once read
        resourceProxy:
          baseUri: http://vour.server.tld
          # define an optional subDirectory (defaults to: '_Resources/Persistent/', trailing slash is required!)
          subDirectory: '_Resources/Persistent/'
          # define wether or not the remote uses subdivideHashPathSegments
          subdivideHashPathSegment: false
          # curl options
          curlOptions:
            CURLOPT_USERPWD: very:secure

应将这些设置添加到项目的全局Settings.yaml中,以便每个具有远程服务器SSH访问权限的开发者都可以轻松地克隆设置。

持久数据的快速备份和恢复机制

有时,快速备份应用程序的完整持久状态很有用,然后在执行一些风险操作后,在失败的情况下恢复数据。此包的stash:createstash:restorestash:liststash:clear命令允许实现无瑕疵的备份-尝试-恢复工作流程。

注意:这些命令将清空本地Flow安装的数据库和资源。数据将被stash中的信息替换。在使用这些命令之前,请确保您理解这一点。

CLI示例

# Create a backup of the entire database and the directory `Data/Persistent` ("stash entry") under the given name
./flow stash:create --name=name

# Lists all named stash entries
./flow stash:list

# Restores a stash entry
./flow stash:restore --name=name

# Removes all stash entries
./flow stash:clear

注意:由于您的stash往往会变得非常大,因此请定期使用此命令。

资源代理

虽然将数据库克隆到本地开发系统对于大型项目来说是可以管理的,但下载所有资产通常不是一种选择。

为此,此包提供了资源代理的概念。一旦激活,只有在资源实际渲染时才会下载实际使用的资源。这是通过自定义实现WritableFileSystemStorageProxyAwareFileSystemSymlinkTarget来实现的,如果您在本地开发环境中使用此存储和目标,则它将自动工作。如果您使用其他本地存储,例如本地S3存储,您可以通过实现此包的ProxyAwareStorageInterfaceProxyAwareTargetInterface接口来轻松构建自己的代理感知版本。

安装

Sitegeist.Magicwand可通过packagist获取。只需将"sitegeist/magicwand" : "~1.0"添加到composer.json的require-dev部分,或运行composer require --dev sitegeist/magicwand。我们使用语义版本控制,因此每次重大更改都会增加主版本号。

贡献

我们将非常乐意接受贡献,特别是改进特定预设的rsync和ssh选项。请将pull请求发送给我们。

我们不会将以下功能添加到主存储库中

  • Windows支持:我们依赖于Unix外壳和能够进行硬链接的文件系统。
  • 使用用户名/密码的SSH:我们认为这不够安全,并建议使用公钥和私钥。