]> jfr.im git - irc/quakenet/qwebirc.git/blobdiff - run.py
Fix several login bugs, add bouncer auth mode.
[irc/quakenet/qwebirc.git] / run.py
diff --git a/run.py b/run.py
index 11095fb766cf8899e0748c2703fa166b497c58eb..57037a13a4703d0d8a6f5e2d1120ce63e57eeca5 100755 (executable)
--- a/run.py
+++ b/run.py
@@ -1,10 +1,13 @@
 #!/usr/bin/env python
 # this entire thing is a hack and badly needs reimplementing
+import bin.compile
+bin.compile.vcheck()
+
 DEFAULT_PORT = 9090
 
 from twisted.scripts.twistd import run
 from optparse import OptionParser
-import sys, os
+import sys, os, config
 
 def run_twistd(args1=None, args2=None):
   args = [sys.argv[0]]
@@ -31,7 +34,15 @@ parser.add_option("-r", "--reactor", help="Which reactor to use (see --help-reac
 parser.add_option("-p", "--port", help="Port to start the server on.", type="int", dest="port", default=DEFAULT_PORT)
 parser.add_option("-l", "--logfile", help="Path to twisted log file.", dest="logfile")
 parser.add_option("-c", "--clf", help="Path to web CLF (Combined Log Format) log file.", dest="clogfile")
-(options, args) = parser.parse_args()
+parser.add_option("-C", "--certificate", help="Path to SSL certificate.", dest="sslcertificate")
+parser.add_option("-k", "--key", help="Path to SSL key.", dest="sslkey")
+
+sargs = sys.argv[1:]
+if "ARGS" in dir(config):
+  import shlex
+  sargs = shlex.split(config.ARGS) + sargs
+
+(options, args) = parser.parse_args(args=sargs)
 
 args1, args2 = [], []
 
@@ -45,10 +56,14 @@ if options.reactor != DEFAULT_REACTOR:
 if options.logfile:
   args+=["--logfile", options.logfile]
 
-args2+=["--port", options.port]
 if not options.tracebacks:
   args2.append("-n")
 if options.clogfile:
   args2+=["--logfile", options.clogfile]
 
+if options.sslcertificate and options.sslkey:
+  args2+=["--certificate", options.sslcertificate, "--privkey", options.sslkey, "--https", options.port]
+else:
+  args2+=["--port", options.port]
+
 run_twistd(args1, args2)