config option to set listen address #10

Open
infinity0 opened this Issue May 15, 2010 · 12 comments

Comments

Projects
None yet
7 participants
@infinity0

please add a config option to set the listen address - this would provide an easy way of setting up a private wiki over a lan or vpn

@dhouthoo

This comment has been minimized.

Show comment
Hide comment
@dhouthoo

dhouthoo Jul 6, 2010

... or your very own localhost wiki

dhouthoo commented Jul 6, 2010

... or your very own localhost wiki

@infinity0

This comment has been minimized.

Show comment
Hide comment
@infinity0

infinity0 Jul 6, 2010

i've implemented this very quickly here http://github.com/infinity0/gitit/commit/6b78a012789680985584427bee0ae89220a25514

I don't know ANY haskell; i did this with various online references. it's ugly but it compiles and works, if you need this functionality right now.

the interface address is hard-coded into the source code. also, i have no idea what line 84 (listen sock 10) does - i'm guessing accept a maximum of 10 concurrent incoming connections.

someone with a better knowledge of haskell might want to make this a setting you can edit in the config file.

i've implemented this very quickly here http://github.com/infinity0/gitit/commit/6b78a012789680985584427bee0ae89220a25514

I don't know ANY haskell; i did this with various online references. it's ugly but it compiles and works, if you need this functionality right now.

the interface address is hard-coded into the source code. also, i have no idea what line 84 (listen sock 10) does - i'm guessing accept a maximum of 10 concurrent incoming connections.

someone with a better knowledge of haskell might want to make this a setting you can edit in the config file.

@tbk303

This comment has been minimized.

Show comment
Hide comment
@tbk303

tbk303 Aug 9, 2010

Contributor

I have extended this a bit, the listen address is now configurable via command line option: http://github.com/tbh/gitit/commit/c3c7d6919b8c4d4a4c27b8825e4c2d151bd0c670

Contributor

tbk303 commented Aug 9, 2010

I have extended this a bit, the listen address is now configurable via command line option: http://github.com/tbh/gitit/commit/c3c7d6919b8c4d4a4c27b8825e4c2d151bd0c670

@sporksmith

This comment has been minimized.

Show comment
Hide comment
@sporksmith

sporksmith Sep 15, 2010

I needed this feature as well. tbh's patch works for me (thanks!)

I needed this feature as well. tbh's patch works for me (thanks!)

@dixie

This comment has been minimized.

Show comment
Hide comment
@dixie

dixie Jan 26, 2011

Yes. I need this also and I'm using the tbh's patch (thanks too!).

dixie commented Jan 26, 2011

Yes. I need this also and I'm using the tbh's patch (thanks too!).

@jgm

This comment has been minimized.

Show comment
Hide comment
@jgm

jgm Mar 30, 2011

Owner

Thanks, I've merged tbh's patch. I'll modify it later to allow setting the listen address in the config file, so I'm keeping this issue open to remind myself...

Owner

jgm commented Mar 30, 2011

Thanks, I've merged tbh's patch. I'll modify it later to allow setting the listen address in the config file, so I'm keeping this issue open to remind myself...

@infinity0

This comment has been minimized.

Show comment
Hide comment
@infinity0

infinity0 Jun 14, 2011

is the default supposed to be 127.0.0.1?

$ gitit & 
$ netstat -ltnp | grep gitit
tcp        0      0 127.0.0.1:5001          0.0.0.0:*               LISTEN      17495/gitit     
$ gitit -l 0.0.0.0 & 
$ netstat -ltnp | grep gitit
tcp        0      0 0.0.0.0:5001            0.0.0.0:*               LISTEN      17503/gitit     

also ipv6 doesn't seem to work:

$ gitit -l ::1
gitit: user error (inet_addr: Malformed address: ::1)

(also, this brings up the bug that atm there's no way to listen on both IPv4 and IPv6)

$ gitit --version
gitit version 0.8 -plugins
Copyright (C) 2008 John MacFarlane
This is free software; see the source for copying conditions.  There is no
warranty, not even for merchantability or fitness for a particular purpose.

is the default supposed to be 127.0.0.1?

$ gitit & 
$ netstat -ltnp | grep gitit
tcp        0      0 127.0.0.1:5001          0.0.0.0:*               LISTEN      17495/gitit     
$ gitit -l 0.0.0.0 & 
$ netstat -ltnp | grep gitit
tcp        0      0 0.0.0.0:5001            0.0.0.0:*               LISTEN      17503/gitit     

also ipv6 doesn't seem to work:

$ gitit -l ::1
gitit: user error (inet_addr: Malformed address: ::1)

(also, this brings up the bug that atm there's no way to listen on both IPv4 and IPv6)

$ gitit --version
gitit version 0.8 -plugins
Copyright (C) 2008 John MacFarlane
This is free software; see the source for copying conditions.  There is no
warranty, not even for merchantability or fitness for a particular purpose.
@jgm

This comment has been minimized.

Show comment
Hide comment
@jgm

jgm Jun 20, 2011

Owner

Yes, 127.0.0.1 is the default. Do you think the default should be something else? As for ipv6, I don't know enough about the low-level networking libraries to fix this at the moment, but I'd happily accept a patch to improve things.

Owner

jgm commented Jun 20, 2011

Yes, 127.0.0.1 is the default. Do you think the default should be something else? As for ipv6, I don't know enough about the low-level networking libraries to fix this at the moment, but I'd happily accept a patch to improve things.

@infinity0

This comment has been minimized.

Show comment
Hide comment
@infinity0

infinity0 Jul 2, 2011

iirc the previous behaviour was to listen on 0.0.0.0, so it should remain the same? i think network daemons generally listen on that by default, and serving a public wiki is probably the most common use-case.

iirc the previous behaviour was to listen on 0.0.0.0, so it should remain the same? i think network daemons generally listen on that by default, and serving a public wiki is probably the most common use-case.

@jgm

This comment has been minimized.

Show comment
Hide comment
@jgm

jgm Jul 5, 2011

Owner

Right, I'll change the default to 0.0.0.0.

I'd welcome a patch to fix ip6 and make it possible to listen on ip4 and ip6 simultaneously. tbh?

Owner

jgm commented Jul 5, 2011

Right, I'll change the default to 0.0.0.0.

I'd welcome a patch to fix ip6 and make it possible to listen on ip4 and ip6 simultaneously. tbh?

@focusaurus

This comment has been minimized.

Show comment
Hide comment
@focusaurus

focusaurus Apr 29, 2012

Did this make it to a config file option yet? I have "listen: 127.0.0.1" in the config file but gitit still bound to 0.0.0.0

Did this make it to a config file option yet? I have "listen: 127.0.0.1" in the config file but gitit still bound to 0.0.0.0

@jgm

This comment has been minimized.

Show comment
Hide comment
@jgm

jgm Apr 29, 2012

Owner

No, but it's available as a command line option.

+++ Peter Lyons [Apr 29 12 08:22 ]:

Did this make it to a config file option yet? I have "listen: 127.0.0.1" in the config file but gitit still bound to 0.0.0.0


Reply to this email directly or view it on GitHub:
#10 (comment)

Owner

jgm commented Apr 29, 2012

No, but it's available as a command line option.

+++ Peter Lyons [Apr 29 12 08:22 ]:

Did this make it to a config file option yet? I have "listen: 127.0.0.1" in the config file but gitit still bound to 0.0.0.0


Reply to this email directly or view it on GitHub:
#10 (comment)

segasai pushed a commit to segasai/gitit that referenced this issue Oct 4, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment