Automattic / vip-cli

The VIP-CLI
https://docs.wpvip.com/vip-cli/
MIT License
59 stars 16 forks source link

feat(dev-env): make `domain` configurable #1859

Closed sjinks closed 5 months ago

sjinks commented 5 months ago

Description

It is possible to override the default domain (vipdev.lndo.site) by setting

domain: my.custom.domain

in ~/.local/share/vip/lando/config.yml.

However, the system is hardcoded to use vipdev.lndo.site, no matter what.

This PR fixes that.

Marking this PR as a "feature" because this is not documented: neither by us, nor by Lando.

Pull request checklist

New release checklist

Steps to Test

  1. mkdir -p ~/.local/share/vip/lando; echo "domain: localtest.me" > ~/.local/share/vip/lando/config.yml
  2. vip dev-env create < /dev/null
  3. The output should contain references to localtest.me, like this:
 SLUG              vip-local                                                                                           
 LOCATION          /home/volodymyr/.local/share/vip/dev-environment/vip-local                                          
 SERVICES          devtools, nginx, php, database, memcached, wordpress, vip-mu-plugins, demo-app-code                 
 NGINX URLS        http://vip-local.localtest.me:8000/                                                                 
                   https://vip-local.localtest.me/                                                                     
 STATUS            DOWN                                                                                                
 LOGIN URL         http://vip-local.localtest.me:8000/wp-admin/?vip-dev-autologin=e81ab483-12ff-41ba-a81c-d69175a61f3b 
 DEFAULT USERNAME  vipgo                                                                                               
 DEFAULT PASSWORD  password                                                                                            
 DOCUMENTATION     https://docs.wpvip.com/vip-local-development-environment/                                           
  1. vip dev-env start
  2. The output should contain something like this:
    setupca 09:20:43.79 INFO  ==> Looks like you do not have a Lando CA yet! Let's set one up!
    setupca 09:20:43.79 INFO  ==> Trying to setup root CA with...
    setupca 09:20:43.79 INFO  ==> LANDO_CA_CERT: /lando/certs/localtest.me.pem
    setupca 09:20:43.79 INFO  ==> LANDO_CA_KEY: /lando/certs/localtest.me.key
    setupca 09:20:43.79 INFO  ==> /lando/certs/localtest.me.key not found... generating one
    Generating RSA private key, 2048 bit long modulus (2 primes)
    ......+++++
    ................................................................+++++
    e is 65537 (0x010001)
    setupca 09:20:43.83 INFO  ==> /lando/certs/localtest.me.pem not found... generating one
    setupca 09:20:43.84 INFO  ==> CA generated at /lando/certs/localtest.me.pem

and this:

 SLUG              vip-local                                                                                      
 LOCATION          /home/volodymyr/.local/share/vip/dev-environment/vip-local                                     
 SERVICES          devtools, nginx, php, database, memcached, wordpress, vip-mu-plugins, demo-app-code            
 NGINX URLS        http://vip-local.localtest.me/                                                                 
                   https://vip-local.localtest.me/                                                                
 DATABASE          127.0.0.1:32769                                                                                
 STATUS            UP                                                                                             
 LOGIN URL         http://vip-local.localtest.me/wp-admin/?vip-dev-autologin=e81ab483-12ff-41ba-a81c-d69175a61f3b 
 DEFAULT USERNAME  vipgo                                                                                          
 DEFAULT PASSWORD  password                                                                                       
 DOCUMENTATION     https://docs.wpvip.com/vip-local-development-environment/                                      
  1. http://vip-local.localtest.me/ should work.

Caveat: pre-existing environments may cease to work because they were configured with a diffeent domain. This is Lando's limitation. Only one domain is allowed.

github-actions[bot] commented 5 months ago

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

OpenSSF Scorecard

PackageVersionScoreDetails

Scanned Manifest Files

sonarcloud[bot] commented 5 months ago

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

rinatkhaziev commented 5 months ago

Haven't tested but looks fine.