title: Shopware 6 incompatible with our web dev setup (Apache & ACLs)
body: <p>Our web development setup on Ubuntu 20.04 looks as follows:</p>
  <ul>
  <li>We run Apache as www-data (pretty standard)</li>
  <li>The user logs in as &quot;dev&quot; (for example)</li>
  <li>So PHPStorm runs as dev</li>
  </ul>
  <p>This usually leeds to the problem, that CLI commands (such as building the Theme) and actions via the web interface (such as changing Theme colors in the Admin Panel) clash with file permissions when for example the CLI creates a file which Apache later tries to change.</p>
  <p>For years (i.e. with Magento 2, Contao, Laravel, ... before we started working with Shopware 6) we went well with the following command in the projects folder, using Linux ACLs:</p>
  <pre><code>export FOLDER=projects &amp;&amp; sudo setfacl -Rm u:$USER:rwx $FOLDER &amp;&amp; sudo setfacl -Rm u:www-data:rwx $FOLDER &amp;&amp; sudo setfacl -Rm d:u:$USER:rwx $FOLDER &amp;&amp; sudo setfacl -Rm d:u:www-data:rwx $FOLDER &amp;&amp; sudo chmod 600 config
  </code></pre>
  <p>So ACLs are set properly and access works for the webserver as well as CLI commands .</p>
  <p>And then came Shopware.</p>
  <p>When building or changing the theme, the underlying Flysystem tries to set the visibility of files (the permissions). And while you can read/write files properly with the setfacl trick above, chmod is only possible for the file owner (which is &quot;dev&quot;).</p>
  <p>So we are getting:</p>
  <pre><code>detail: &quot;Warning: chmod(): Operation not permitted&quot;
  meta: {trace: [,…], file: 
  &quot;/home/dev/projects/example.com/vendor/league/flysystem/src/Adapter/Local.php&quot;,
  </code></pre>
  <p>We are wondering what is an elegant solution for this? How are others solving this?</p>
  <p>Approaches we are considering:</p>
  <ul>
  <li>letting apache run under the same user as the logged in user</li>
  <li>doing CLI tasks as <code>www-data</code></li>
  <li>switching to docker and also use <code>www-data</code> scope for everything</li>
  </ul>