Varying-Vagrant-Vagrants / VVV

An open source Vagrant configuration for developing with WordPress
https://varyingvagrantvagrants.org
MIT License
4.55k stars 849 forks source link

Bug: Craft Instructions on VVV produces directory issues #2703

Open ubuntupunk opened 4 months ago

ubuntupunk commented 4 months ago

Are you using the latest stable or develop branch version of VVV?

Yes (develop)

Is it a new VVV, or an existing VVV that used to work?

New fresh install

Did you use a CustomFile?

No (default)

Whats the problem?

The nginx conf created by the craft provisioner produces:

server_name  craft.test;
    root         "/srv/www/craft/public_html/";

But this is needed to work:

server_name  craft.test;
    root         "/srv/www/craft/public_html/web";

Also the provisioner will attempt to reinstall via composer inside the craft directory if vagrant reload --provision is actioned. The result will be an error, and and absent nginx config.

How do we reproduce it?

install craft according to instruction here

What is the output of vagrant status

__ __ __ __
\ V\ V\ V / v3.12 Ruby:2.7.0, Path:"/media/afrodeity/Neptune/vagrant/vvv-local"
 \_/\_/\_/  git::stable(aee9a695)

Platform: linux-gnu shell:/bin/bash systemd  vagrant-hostsupdater vagrant-goodhosts CaseSensitiveFS shared_db_folder_disabled
Vagrant: v2.2.6, virtualbox: v6.1.50

Docs:       https://varyingvagrantvagrants.org/
Contribute: https://github.com/varying-vagrant-vagrants/vvv
Dashboard:  http://vvv.test

Which Operating System are you using?

Linux

Which provider are you using?

VirtualBox 7

welcome[bot] commented 4 months ago

Thanks for opening your first issue here! Be sure to follow the issue template and include your OS/Vagrant/VVV versions! Don't forget you can get support in the VVV slack at https://varyingvagrantvagrants.org/docs/en-US/slack/

VVV
VVV Slack Workspace
Join the VVV Slack Workspace
tomjn commented 4 months ago

Still reading this but some notes:

Vagrant: v2.2.6, virtualbox: v6.1.50

vagrant-hostsupdater vagrant-goodhosts

You only need goodhosts installed for VVV, hostsupdater was abandoned many years ago

The public_html directory is configurable, you can change it via the public_dir parameter e.g. something that looks like this public_dir: public_html/web.

you could add an nginx custom config in that provision folder but it's easier to do it via config.yml

tomjn commented 4 months ago

@ubuntupunk I've made some tweaks to the CraftCMS and Drupal examples at https://github.com/Varying-Vagrant-Vagrants/varyingvagrantvagrants.org/pull/217 can you confirm if these are good for you?

ubuntupunk commented 4 months ago

Yes, adding public_dir: public_html/web

solves that issue.

The provisioner still needs some logic to check if there is already an installation in the dir when reprovisioning?

On Sun, 18 Feb 2024 at 17:16, Tom J Nowell @.***> wrote:

@ubuntupunk https://github.com/ubuntupunk I've made some tweaks to the CraftCMS and Drupal examples at Varying-Vagrant-Vagrants/varyingvagrantvagrants.org#217 https://github.com/Varying-Vagrant-Vagrants/varyingvagrantvagrants.org/pull/217 can you confirm if these are good for you?

— Reply to this email directly, view it on GitHub https://github.com/Varying-Vagrant-Vagrants/VVV/issues/2703#issuecomment-1951355185, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAB4HBUPRLLSC4SP3RJYGFLYUILLLAVCNFSM6AAAAABDN6PGBGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSNJRGM2TKMJYGU . You are receiving this because you were mentioned.Message ID: @.***>

tomjn commented 4 months ago

The provisioner still needs some logic to check if there is already an installation in the dir when reprovisioning?

I don't know! The Drupal and Craft examples are speculative, nothing stops you using Drupal/Craft and you can install them manually but I thought composer create-project would be smart enough to see there's already something there and not try to mess things up, and that anybody trying to do that would be a developer who'd handle things once they're setup. My understanding of Drupal is that nobody just installs and configures it, they use it as a starting point for something bespoke, like Laravel but more put together.

Note that nothing in VVV is specifically written to support Craft other than the example in the page. The intention was to make it clear VVV isn't strictly for WordPress, and that you can manually install any PHP application, and via composer you can create projects. Hence the Craft and Drupal examples.