From: Eric S. Raymond Date: Sun, 1 Jun 2014 01:28:43 +0000 (-0400) Subject: Host option, as contributed by wking. X-Git-Tag: 2.9~3 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=e93cdb2bd975437762814a4ddce00b68b302effa;p=irker.git Host option, as contributed by wking. --- diff --git a/NEWS b/NEWS index 472573d..580b362 100644 --- a/NEWS +++ b/NEWS @@ -2,6 +2,7 @@ Repository head: If irkerd is running in background, log to /dev/syslog (facility daemon). + New -H option tyo set host listening address. 2.8: 2014-05-30 Various minor improvements to irk. diff --git a/irkerd b/irkerd index b47ff01..72c01f5 100755 --- a/irkerd +++ b/irkerd @@ -954,6 +954,9 @@ if __name__ == '__main__': parser.add_argument( '-d', '--log-level', metavar='LEVEL', choices=LOG_LEVELS, help='how much to log to the log file (one of %(choices)s)') + parser.add_argument( + '-H', '--host', metavar='ADDRESS', default=HOST, + help='IP address to listen on') parser.add_argument( '-l', '--log-file', metavar='PATH', help='file for saving captured message traffic') @@ -1014,8 +1017,8 @@ if __name__ == '__main__': raise SystemExit(1) irker.thread_launch() try: - tcpserver = socketserver.TCPServer((HOST, PORT), IrkerTCPHandler) - udpserver = socketserver.UDPServer((HOST, PORT), IrkerUDPHandler) + tcpserver = socketserver.TCPServer((args.host, PORT), IrkerTCPHandler) + udpserver = socketserver.UDPServer((args.host, PORT), IrkerUDPHandler) for server in [tcpserver, udpserver]: server = threading.Thread(target=server.serve_forever) server.setDaemon(True) diff --git a/irkerd.xml b/irkerd.xml index f0676c5..fe60c87 100644 --- a/irkerd.xml +++ b/irkerd.xml @@ -22,6 +22,7 @@ -d debuglevel -e cert-file -l logfile + -H host -n nick -p password -i IRC-URL @@ -148,9 +149,10 @@ over SSL for this to function properly. This is commonly known as -e Takes a following filename in pem format and uses it -to authenticate to the IRC server. You must be connecting to the IRC server -over SSL for this to function properly. This is commonly known as CertFP. - +to authenticate to the IRC server. You must be connecting to the IRC +server over SSL for this to function properly. This is commonly known +as CertFP. + -l @@ -160,6 +162,15 @@ timestamp in Unix time, the FQDN of the sending server, and the message data. +-H +Takes a following hostname, and binds to that address +when listening for messages. irkerd binds +to localhost by default, but you may want to use your host's public +address to listen on a local network. Listening on a public interface +is not recommended, as it makes spamming IRC channels very +easy. + + -n Takes a following value, setting the nick to be used. If the nick contains a numeric format element