Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

config option to set listen address #10

Open
infinity0 opened this Issue · 12 comments

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

... or your very own localhost wiki

@infinity0

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

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

@sporksmith

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

@dixie

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

@jgm
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...

@infinity0

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
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.

@infinity0

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
Owner
jgm commented

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

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
Owner
@segasai segasai referenced this issue from a commit in segasai/gitit
@jgm Don't allow files with ".page" extension to be uploaded.
Resolves Issue #10.
637e59f
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.