简体   繁体   English

Symfony Flex 位于严格的企业防火墙/代理之后

[英]Symfony Flex behind strict corporate firewall / proxy

The company where I'm currently working has a very strict security policy and Composer is not allowed to access any host outside the company intranet.我目前工作的公司有非常严格的安全政策,不允许 Composer 访问公司内网以外的任何主机。 Each developer gets it's own VPS for development within the internal cloud that has php, composer and other dev stuff preinstalled, but there's no route to internet from VPS.每个开发人员都有自己的 VPS 用于在预装了 php、composer 和其他开发工具的内部云中进行开发,但是没有从 VPS 到互联网的路由。 Workstations have limited internet access only for email and browsing the internet.工作站的 Internet 访问权限有限,仅用于发送电子邮件和浏览 Internet。 We managed to make Symfony and composer play together with Satis available on an internal server.我们设法使 Symfony 和 Composer 与 Satis 一起在内部服务器上可用。 It's annoying to manage Satis static dependencies sometimes due to strict package white list standards but it generally worked... well, untill Symfony Flex came up and http://symfony.sh which is not available to our internal workstations and dev environment.由于严格的包白名单标准,有时管理 Satis 静态依赖项很烦人,但它通常有效......好吧,直到 Symfony Flex 出现并且http://symfony.sh对我们的内部工作站和开发环境不可用。

So is there a way to run a flex server on premises or to reuse a local Satis repository somehow to deliver flex recipes?那么有没有办法在本地运行弹性服务器或以某种方式重用本地 Satis 存储库来交付弹性配方?

Is you cannot reach symfony.sh, you are out of luck to use symfony flex.如果您无法访问 symfony.sh,那么使用 symfony flex 就不走运了。 There are no equivalent to satis for flex.没有与 flex 等效的 satis 。

Private repositories are available only if your repository is on github.com.仅当您的存储库位于 github.com 上时,私有存储库才可用。

But flex is completely not mandatory, you can still install bundles, and look for their configuration.但是 flex 完全不是强制性的,您仍然可以安装 bundles,并查找它们的配置。

At the time of writing this answer Symfony hasn't officially open sourced the symfony.sh source so the only way to reach Flex recipes by Flex composer plugin is to enable a firewall route to symfony.sh.在撰写此答案时,Symfony 尚未正式开源 symfony.sh 源代码,因此通过 Flex composer 插件访问 Flex recipes 的唯一方法是启用到 symfony.sh 的防火墙路由。

However, if that is not complaint with your security policy another option is to use and contribute to reverse engineered Flex server https://github.com/aurimasniekis/flex-server that could be hosted on a separated server that has limited access to GitHub.然而,如果这不是抱怨你的安全策略,另一种选择是使用,并有助于反向工程Flex服务器https://github.com/aurimasniekis/flex-server可能有到GitHub的有限访问的分离服务器上托管. One should then configure composer.json to use that specific flex server by doing this:然后应该通过执行以下操作来配置 composer.json 以使用该特定的 flex 服务器:

composer config extra.symfony.endpoint FLEX_SERVER_URL

Flex as a composer plugin is open sourced so protocol behind it can be mocked or recreated relatively easy. Flex 作为作曲家插件是开源的,因此可以相对容易地模拟或重新创建其背后的协议。

The third option is to not use Flex at all and continue installing bundles with lots of boilerplate steps of configuring, installing and enabling dependencies like we all used to do prior the Symfony4.第三个选项是根本不使用 Flex 并继续安装包含大量配置、安装和启用依赖项的样板步骤的包,就像我们在 Symfony4 之前所做的那样。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM