Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Host/Unhost for adding/removing to/from hosts file, solves "Can't access hosts offline". #41

Merged
merged 1 commit into from
Nov 2, 2011

Conversation

lindblom
Copy link

A problem that me and many with me has had with pow is that it uses resolver to map the domains. That is okay as long as you are connected to a network of some sort, but when you disconnect your pow domains dies with the connection. But adding the domains to the hosts file solves this problem, so I added it to the already wonderful powder :)

The solution may not be the most elegant there is, but it works great (at least on my machine). Please pull it and clean it up a bit so it gets baked in to the powder loveliness.

The pow issue ticket for the "Can't access hosts offline" is at: basecamp/pow#104

@lindblom
Copy link
Author

Thanks for the comment, I've been away there of the late response. The code works great here on my machine, but I have one concern. After the copy of the newly created hostsfile to replace the old /etc/hosts, the ACL of the new hostsfile sets you (the creator) to owner instad of root. I dont know if this really mathers, guess we could add a chmod after the mv to fix this.

@henrik
Copy link

henrik commented Sep 28, 2011

Great idea. Would be nice if you didn't have to remember to "powder host" and it did it automatically after every "powder link", but maybe it would be even more annoying to get password prompts all the time.

@lindblom
Copy link
Author

Yeah. But you don't really have to update the hosts file all the time anyway, as its only needed when a network connection is lacking.

@adamyonk
Copy link

+1

@kirs
Copy link

kirs commented Oct 13, 2011

Very useful

@lindblom
Copy link
Author

Thanks guys :)

@dedene
Copy link

dedene commented Oct 17, 2011

+1

@prognostikos
Copy link

+1 - working great for me

@rodreegez rodreegez merged commit 8b2f260 into powder-rb:master Nov 2, 2011
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants