Hosts file edit feedback for Lightning

At least for the Lightning beta/trial timeframe, perhaps the hostsname parsing can be separated out so that both Lightning sites and previous version sites can run in conjunction.

Perhaps change: ## Local by Flywheel - Start ## to ## Local - Start ## and the end versions to match.

2 Likes

I dig it! I’ll see what we can do here.

In case you’re not already doing this, one way to make the two versions coexist a bit more harmoniously in the meantime is to move the host entries out of the ## Local [by Flywheel] block. Also be sure to remove the # Local Site comment that’s appended to each site.

Was this change turned on? I’m still having issue with my host file needing to be updated when I switch back and forth between Local by Flywheel and Local. How can I use both?

I tried to edit the host file but both locals keep overwriting it.

Local - Start

::1 test.local
127.0.0.1 test.local
::1 www.test.local
127.0.0.1 www.test.local

Local - End

Local by Flywheel - Start

192.168.94.100 kimbia.local #Local Site
192.168.94.100 www.kimbia.local #Local Site
192.168.94.100 jtd.local #Local Site
192.168.94.100 www.jtd.local #Local Site
192.168.94.100 ialr.local #Local Site
192.168.94.100 www.ialr.local #Local Site
192.168.94.100 434-base.local #Local Site
192.168.94.100 www.434-base.local #Local Site
192.168.94.100 boh.local #Local Site
192.168.94.100 www.boh.local #Local Site
192.168.94.100 humankind.local #Local Site
192.168.94.100 www.humankind.local #Local Site
192.168.94.100 nudyscafe.local #Local Site
192.168.94.100 www.nudyscafe.local #Local Site
192.168.94.100 glhh.local #Local Site
192.168.94.100 www.glhh.local #Local Site
192.168.94.100 hawaii-baptist.local #Local Site
192.168.94.100 www.hawaii-baptist.local #Local Site
192.168.94.100 sourdough-pizza.local #Local Site
192.168.94.100 www.sourdough-pizza.local #Local Site
192.168.94.100 provenmen.local #Local Site
192.168.94.100 www.provenmen.local #Local Site
192.168.94.100 lyh.local #Local Site
192.168.94.100 www.lyh.local #Local Site
192.168.94.100 bethel-church.local #Local Site
192.168.94.100 www.bethel-church.local #Local Site
192.168.94.100 eda-podcast.local #Local Site
192.168.94.100 www.eda-podcast.local #Local Site
192.168.94.100 infinite-hero.local #Local Site
192.168.94.100 www.infinite-hero.local #Local Site
192.168.94.100 johnson-health.local #Local Site
192.168.94.100 www.johnson-health.local #Local Site
192.168.94.100 interfaith-outreach.local #Local Site
192.168.94.100 www.interfaith-outreach.local #Local Site
192.168.94.100 becauseco.local #Local Site
192.168.94.100 www.becauseco.local #Local Site
192.168.94.100 accelerated.local #Local Site
192.168.94.100 www.accelerated.local #Local Site
192.168.94.100 movement-church.local #Local Site
192.168.94.100 www.movement-church.local #Local Site
192.168.94.100 nda.local #Local Site
192.168.94.100 www.nda.local #Local Site
192.168.94.100 gutenberg.local #Local Site
192.168.94.100 www.gutenberg.local #Local Site
192.168.94.100 dustin.local #Local Site
192.168.94.100 www.dustin.local #Local Site
192.168.94.100 deco.local #Local Site
192.168.94.100 www.deco.local #Local Site
192.168.94.100 phoenix-labor.local #Local Site
192.168.94.100 www.phoenix-labor.local #Local Site
192.168.94.100 chc.local #Local Site
192.168.94.100 www.chc.local #Local Site
192.168.94.100 create-lynchburg.local #Local Site
192.168.94.100 www.create-lynchburg.local #Local Site
192.168.94.100 osterbind-law.local #Local Site
192.168.94.100 www.osterbind-law.local #Local Site
192.168.94.100 rutan.local #Local Site
192.168.94.100 www.rutan.local #Local Site
192.168.94.100 apple-ridge.local #Local Site
192.168.94.100 www.apple-ridge.local #Local Site
192.168.94.100 community-access-network.local #Local Site
192.168.94.100 www.community-access-network.local #Local Site
192.168.94.100 cloudfit.local #Local Site
192.168.94.100 www.cloudfit.local #Local Site
192.168.94.100 pc-pipe.local #Local Site
192.168.94.100 www.pc-pipe.local #Local Site
192.168.94.100 emerson-creek.local #Local Site
192.168.94.100 www.emerson-creek.local #Local Site
192.168.94.100 reporting-fraud.local #Local Site
192.168.94.100 www.reporting-fraud.local #Local Site
192.168.94.100 fbc-park-street.local #Local Site
192.168.94.100 www.fbc-park-street.local #Local Site
192.168.94.100 first-roanoke.local #Local Site
192.168.94.100 www.first-roanoke.local #Local Site
192.168.94.100 dodson.local #Local Site
192.168.94.100 www.dodson.local #Local Site
192.168.94.100 mtm.local #Local Site
192.168.94.100 www.mtm.local #Local Site
192.168.94.100 sbcv.local #Local Site
192.168.94.100 www.sbcv.local #Local Site
192.168.94.100 spring-grove.local #Local Site
192.168.94.100 www.spring-grove.local #Local Site
192.168.94.100 sister-city.local #Local Site
192.168.94.100 www.sister-city.local #Local Site
192.168.94.100 forest-smiles.local #Local Site
192.168.94.100 www.forest-smiles.local #Local Site
192.168.94.100 sptc.local #Local Site
192.168.94.100 www.sptc.local #Local Site
192.168.94.100 434marketing.local #Local Site
192.168.94.100 www.434marketing.local #Local Site
192.168.94.100 jch.local #Local Site
192.168.94.100 www.jch.local #Local Site
192.168.94.100 cvfd.local #Local Site
192.168.94.100 www.cvfd.local #Local Site
192.168.94.100 cbridal.local #Local Site
192.168.94.100 www.cbridal.local #Local Site
192.168.94.100 va-vein.local #Local Site
192.168.94.100 www.va-vein.local #Local Site
192.168.94.100 bulb-photo.local #Local Site
192.168.94.100 www.bulb-photo.local #Local Site
192.168.94.100 glass-house.local #Local Site
192.168.94.100 www.glass-house.local #Local Site
192.168.94.100 bulb-media.local #Local Site
192.168.94.100 www.bulb-media.local #Local Site
192.168.94.100 eleven09.local #Local Site
192.168.94.100 www.eleven09.local #Local Site
192.168.94.100 hip-tulip.local #Local Site
192.168.94.100 www.hip-tulip.local #Local Site
192.168.94.100 river-stone-ranch.local #Local Site
192.168.94.100 www.river-stone-ranch.local #Local Site
192.168.94.100 opp-lynchburg.local #Local Site
192.168.94.100 www.opp-lynchburg.local #Local Site
192.168.94.100 gmp.local #Local Site
192.168.94.100 www.gmp.local #Local Site

Local by Flywheel - End

I have repeatedly given this (above) feedback (problem) and after receiving an update email regarding version 5.5 I decided to test this.

To all members of the Local team; Thank you for this version. Once again I have to say I absolutely LOVE local! And with the hot-swap apache/nginx and php-versions, it’s fantastic! except for this. (the topic at hand)

Local (Lightning) STILL overwrites the Local by Flywheel sites in the hosts file. I get it, I understand WHY you are doing this; if one would migrate to local, there would be a possibility a domain could be listed for use in both LBF and Lightning. This is a problem, I know, but it is fixable;

  • the user could delete the site in the “old” and the “old” would then cleanup the domain listing
  • the user could manually edit the hosts file to clean it up. We’re developers, we know how to do that! (or at least, we SHOULD :stuck_out_tongue: )

This is FAR LESS annoying than Local deleting all the LBF records and when switching back, LBF deleting the Local records.

So, I did this:

  1. in Terminal
    cd /Applications/Local.app/Contents/Resources
    mv app.asar app.asar.backup
    npx asar extract app.asar.backup app-dir
  2. in files main/dns/hostsFileService.js and main/dns/workers/updateHostsFileWorker.js
    manually replace all occurrences of
  • #Local with #Lightning
    to change the #Local site tag with #Lightning site
  • Local\\x20by\\x20Flywheel with Local
    to change the start and end tags
  • Local by Flywheel with Local
    for the same reason, but different writing style in the code
    and finally
  1. npx asar pack app-dir app.asar

And voila. No more problem.

Local Lighting and Local by Flywheel now purring happily at the same time, no conflicts, no worries.

If Local were to be open-source, preferably on GitHub, I would fork, change and PR this, but as far as I can tell by the wise words of the almighty Google, Local is not open-source, nor do there seem to be intentions of Local becoming open-source.