GithubHelp home page GithubHelp logo

ghost's Issues

ghost clobbers multiple-hosts-per-line entries

if you have a line with multiple hosts: e.g.

127.0.0.1 project_a.local project_b.local project_c.local

and then run ghost add project_d.local, itll clobber all but the first host of that line:

127.0.0.1 project_d.local
127.0.0.1 project_a.local

"Cannot overwrite an existing entry" when trying to add a host as a non-root user

When you are trying to add a host as a non-root user (or the user does not have write access to /etc/hosts), you get the following error message:

Cannot overwrite an existing entry. Use the modify subcommand

Instead of something more meaningful like "/etc/hosts is not write-able, try to run this program as a super user" or something.

delete matches against substrings

I'm not sure whether this is desired or not, but calling Ghost.store.delete "foo" will remove all hosts with foo as a substring rather than just foo itself.

The effect of this, for example, is that if I have hosts node-1 to node-20, trying to delete node-1 will not only delete node-1 but also all of node-10 through node-19.

I'm guessing that as the argument to delete is called host rather than (say) pattern, this probably isn't desired behaviour?

NoMethodError in ghost-ssh list

I just installed ghost on Mac OS X 10.8.2. As the first thing, I wanted to check what ghost-ssh says with the list parameter. This is what I got:

$ ghost-ssh list
/Library/Ruby/Gems/1.8/gems/ghost-0.3.0/bin/ghost-ssh:80: undefined method `length' for nil:NilClass (NoMethodError)
    from /usr/bin/ghost-ssh:23:in `load'
    from /usr/bin/ghost-ssh:23

`ghost list` needs sudo when using linux adapter

♪ bin/ghost list
/Users/bjeanes/Code/OSS/mine/ghost/lib/ghost/linux-host.rb:101:in `initialize': Permission denied - /etc/hosts (Errno::EACCES)
        from /Users/bjeanes/Code/OSS/mine/ghost/lib/ghost/linux-host.rb:101:in `open'
        from /Users/bjeanes/Code/OSS/mine/ghost/lib/ghost/linux-host.rb:101:in `with_exclusive_file_access'
        from /Users/bjeanes/Code/OSS/mine/ghost/lib/ghost/linux-host.rb:26:in `list'
        from bin/ghost:81:in `<main>'

For reading, it shouldn't need exclusive access or anything except read permission...

rewrite gem

This old code is awful and messy. The parts that are tested are done so in a brittle and silly way.

Rewrite all the code.

Bust

Hey there,

I use ghost on a regular basis. Its a great library, but there's one small change that, if implemented, would bring a smile to my face every time I use it: instead of ghost empty to clear all ghost-managed hosts, how about making it ghost bust?

I know it's a little cheesy, but a good pun never hurt anyone!

I'm not a ruby dev (I'm a designer) so it's unlikely I can make this happen myself.

Cheers for taking the time to maintain this library!

— G

update gem

Hi, the current gem does not work on OS X 10.8.3, whereas the master does. Could we update the gem, too?

Thanks,
Robin

Subdomains?

Is it possible to configure a host with ghost to see the hosts' virtual hosts?

0.2.7 doesn't work under linux

trying to do a ghost add I get:
ghost:38: uninitialized constant SocketError (NameError)

(problem fixed in my fork: alkesh/ghost).

Safari in 10.7-10.8 Lion not resolving DS hosts

Not a ghost issue per-se, but I can't seem to get Safari 5.1 in Lion GM to resolve hosts configured with Ghost.

Firefox & Chrome load the local host without a problem.

Anyone else running into this issue?

Mind releasing?

Could you push a version with the latest changes, perhaps 0.3.x so we can get some of the latest updates/pulls in gem rather than git form?

Allow Disabling Host Entries

It would be useful to have a feature / command that disables a particular host entry (simply comments it out in /etc/hosts).

Usage would be ghost disable <hostname>.

This way, you can still see the disabled entry in the list (perhaps with *disabled at the end of the line) if you want to temporarily remove the mapping from the hosts database. I know that personally I have many commented lines in my /etc/hosts file when I manage it manually, because I may only need the host entry when I am working remotely or when I am testing a new website and need to "pretend" that it is the live site.

For instance, given:

## -- /etc/hosts -- ##
##
# Host Database
#
# localhost is used to configure the loopback interface
# when the system is booting.  Do not change this entry.
##
127.0.0.1   localhost

# ghost start
127.0.0.1       magento15.local www.magento15.local
#127.0.0.1      example.com
#127.0.0.1      www.example.com
# ghost end

The command ghost list would yield:

 Listing 4 host(s):
      magento15.local -> 127.0.0.1
  www.magento15.local -> 127.0.0.1
          example.com -> 127.0.0.1 (disabled)
      www.example.com -> 127.0.0.1 (disabled)

This is probably trivial to implement in /etc/hosts, but a bit more difficult on Mac dscl.

ghost-ssh doesn't recognize hosts not separated by a blank line.

For example, if you have the following .ssh/config:

Host foo
  Hostname 127.0.0.1
Host bar
  Hostname 127.0.0.2

Host baz
  Hostname 127.0.0.3

And use ghost-ssh list, you get:

Listing 2 configs(s):
  foo -> 127.0.0.2:22
  baz -> 127.0.0.3:22

I would expect to see three hosts, rather than two. It may be better style to end the declarations belonging to a particular Host with a blank line but the "Host" keyword should be sufficient to demarcate entries. What do you think?

missing dependency: "unindent"

When running, I get:

/usr/share/rubygems/rubygems/custom_require.rb:36:in `require': cannot load such file -- unindent (LoadError)
from lib/ghost/cli/task.rb:1:in `<top (required)>'
...

Hosts have an N:N relationship with IPs

But Ghost assumes that an IP can have many hosts, but a host belongs to a single IP. This isn't critical as most people probably use /etc/hosts with the same assumption, but still...

"Host" is a collision-prone class name

The toplevel constant Host is a collision-prone class name. For example, one collision happens when trying to use Ghost together with vagrant.

Would it be possible to change this to Ghost::Host or something similar?

`ghost-ssh list` produces "undefined method `length' for nil:NilClass"

I've just installed ghost (Ubuntu 12.10 with Ruby 1.9.3p194) and run ghost-ssh list:

ibc@myhost:~$ ghost-ssh list
/var/lib/gems/1.9.1/gems/ghost-0.3.0/bin/ghost-ssh:80:in `block in <top (required)>': undefined method `length' for nil:NilClass (NoMethodError)
        from /var/lib/gems/1.9.1/gems/ghost-0.3.0/bin/ghost-ssh:80:in `each'
        from /var/lib/gems/1.9.1/gems/ghost-0.3.0/bin/ghost-ssh:80:in `max'
        from /var/lib/gems/1.9.1/gems/ghost-0.3.0/bin/ghost-ssh:80:in `<top (required)>'
        from /usr/local/bin/ghost-ssh:23:in `load'
        from /usr/local/bin/ghost-ssh:23:in `<main>'

Multi line hosts entry fails in safari at 18 hosts

In Safari mac 10.8.5, if you have more than 18 hosts on a single line, all hosts will fail to resolve. Not an issue in chrome on same OS. This is an issue more with Safari and/or OSX.

Could ghost have an option to always use a new line for same host addresses?

For example none of these will resolve in Safari

127.0.0.1 first.domain second.domain third.domain forth.domain fifth.domain sixth.domain seventh.domain eighth.domain ninth.domain tenth.domain eleventh.domain twelfth.domain thirteenth.domain fourteenth.domain fifteenth.domain sixteenth.domain seventeenth.domain eighteenth.domain nineteenth.domain

However if you remove the last domain they will.

<top (required)> undefined method "name" error

OS X 10.6.8
Ruby 1.9.2-p290
Ghost 0.3.0

dking@desktop21 ~/Projects $ gem install ghost
Fetching: ghost-0.3.0.gem (100%)
Successfully installed ghost-0.3.0
1 gem installed
Installing ri documentation for ghost-0.3.0...
Installing RDoc documentation for ghost-0.3.0...
dking@desktop21 ~/Projects $ ghost
USAGE: ghost add <hostname> [<ip=127.0.1.1>]
       ghost modify <hostname> <ip> OR <hostname> (will lookup ip)
       ghost delete <hostname>
       ghost delete_matching <pattern>
       ghost list [<filter>]
       ghost empty
       ghost export
       ghost import <file>
dking@desktop21 ~/Projects $ ghost list
Listing 0 host(s):
dking@desktop21 ~/Projects $ ghost add local.test
/Users/dking/.rvm/gems/ruby-1.9.2-p290/gems/ghost-0.3.0/bin/ghost:33:in `<top (required)>': undefined method `name' for nil:NilClass (NoMethodError)
    from /Users/dking/.rvm/gems/ruby-1.9.2-p290/bin/ghost:19:in `load'
    from /Users/dking/.rvm/gems/ruby-1.9.2-p290/bin/ghost:19:in `<main>'

NameError: uninitialized constant Host

Just installed Ghost, so latest version of that. OSX 10.6.8, ruby 1.8.7p149, zshell/oh-my-zsh. Same error for any ghost command, empty, add, list

~/ $ ghost empty                                                                                                                                                [8:57:22]
zsh: correct 'ghost' to 'host' [nyae]? n
  [Emptying] NameError: uninitialized constant Host
  const_missing at org/jruby/RubyModule.java:2569
         (root) at /local/dev/jruby/lib/ruby/gems/1.8/gems/ghost-0.2.8/bin/ghost:94
           load at org/jruby/RubyKernel.java:1063
         (root) at /local/dev/jruby/bin/ghost:19

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.