]> jfr.im git - irc/quakenet/qwebirc.git/blame - config.py.example
Fix XSS issue where external pages could alter DOM.
[irc/quakenet/qwebirc.git] / config.py.example
CommitLineData
b8357cf5
CP
1# qwebirc configuration file
2#
3# This a Python program that is imported, so feel free to use any
4# Python here!
5#
6# Note that some changes to this configuration file require re-running
7# compile.py and others require restarting qwebirc (and some require
8# both!)
9# If in doubt always re-compile and restart.
1435dd92 10
930be88a
CP
11# The following line is required, don't remove it!
12from qwebirc.config_options import *
13
b8357cf5
CP
14# IRC OPTIONS
15# ---------------------------------------------------------------------
16#
17# OPTION: IRCSERVER
18# Hostname (or IP address) of IRC server to connect to.
19# OPTION: IRCPORT
20# Port of IRC server to connect to.
21IRCSERVER, IRCPORT = "irc.myserver.com", 6667
22
bf568ed8
CP
23# OPTION: SSLPORT
24# SSL port of IRC server to connect to.
25# If this option is uncommented it will override IRCPORT.
26#SSLPORT = 6697
27
b8357cf5
CP
28# OPTION: REALNAME
29# The realname field of IRC clients will be set to this value.
4094890f 30REALNAME = "http://moo.com/"
9a2bf266 31
b8357cf5 32# OPTION: IDENT
930be88a
CP
33# ident to use on irc, possible values include:
34# - a string, e.g. IDENT = "webchat"
35# - the literal value IDENT_HEX, this will set the ident to the
36# a hexadecimal version of the users IP address, e.g
dd21c156 37# IDENT = IDENT_HEX
930be88a
CP
38# - the literal value IDENT_NICKNAME, this will use the users
39# supplied nickname as their ident.
b8357cf5
CP
40IDENT = "webchat"
41
dc8d270f
CP
42# OPTION: OUTGOING_IP
43# The IP address to bind to when connecting to the IRC server.
44#
45# This will not change the IP address that qwebirc listens on.
46# You will need to call run.py with the --ip/-i option if you
47# want that.
48#OUTGOING_IP = "127.0.0.1"
49
b8357cf5 50# OPTION: WEBIRC_MODE
de4380a1
CP
51# This option controls how the IP/hostname of the connecting
52# browser will be sent to IRC.
b8357cf5
CP
53#
54# Possible values include:
f5f8d5e0 55# - the string "webirc", i.e. WEBIRC_MODE = "webirc"
efd064c5
CP
56# Use WEBIRC type blocks, with a server configuration of
57# the following style:
58#
59# cgiirc {
60# type webirc;
61# hostname <qwebirc's ip address>;
62# password <password>;
63# };
64#
65# Remember to set the WEBIRC_PASSWORD value to be the
66# same as <password>.
f5f8d5e0 67# - the string "cgiirc", i.e. WEBIRC_MODE = "cgiirc"
b8357cf5
CP
68# old style CGIIRC command, set CGIIRC_STRING to be the
69# command used to set the ip/hostname, and set
70# WEBIRC_PASSWORD to be the password used in the server's
71# configuration file.
f5f8d5e0 72# - the literal value None, i.e. WEBIRC_MODE = None
b8357cf5
CP
73# Send the IP and hostname in the realname field, overrides
74# the REALNAME option.
75WEBIRC_MODE = None
76
77# OPTION: WEBIRC_PASSWORD
78# Used for WEBIRC_MODE webirc and cgiirc, see WEBIRC_MODE
79# option documentation.
80#WEBIRC_PASSWORD = "fish"
81
82# OPTION: CGIIRC_STRING
83# Command sent to IRC server in for cgiirc WEBIRC_MODE.
84# See WEBIRC_MODE option documentation.
85#CGIIRC_STRING = "CGIIRC"
86
87# UI OPTIONS
88# ---------------------------------------------------------------------
89#
90# OPTION: BASE_URL
de4380a1
CP
91# URL that this qwebirc instance will be available at, add the
92# port number if your instance runs on a port other than 80.
2dfab0e1
CP
93BASE_URL = "http://foo.foo.org/"
94
b8357cf5
CP
95# OPTION: NETWORK_NAME
96# The name of your IRC network, displayed throughout the
97# application.
98NETWORK_NAME = "FooNet"
99
13afa38f
CP
100# OPTION: LOGO_URL
101# URL to your logo (max height 68 pixels).
102# If not set the default network name will shown in text.
103#LOGO_URL="images/logo.png"
104
d47f88d9
CP
105# OPTION: ANALYTICS_HTML
106# If you have an analytics service, you can paste the HTML
107# between the triple quotes.
108#ANALYTICS_HTML = """
109#"""
110
b8357cf5
CP
111# OPTION: APP_TITLE
112# The title of the application in the web browser.
113APP_TITLE = NETWORK_NAME + " Web IRC"
114
cc608160
CP
115# NICKNAME VALIDATION OPTIONS
116# ---------------------------------------------------------------------
117#
118# OPTION: NICKNAME_VALIDATE
119# If True then user nicknames will be validated according to
120# the configuration below, otherwise they will be passed
121# directly to the ircd.
122NICKNAME_VALIDATE = True
123
124# OPTION: NICKNAME_VALID_FIRST_CHAR
125# A string containing valid characters for the first letter of
126# a nickname.
127# Default is as in RFC1459.
128import string
129NICKNAME_VALID_FIRST_CHAR = string.letters + "_[]{}`^\\|"
130
131# OPTION: NICKNAME_VALID_SUBSEQUENT_CHAR
132# A string containing valid characters for the rest of the
133# nickname.
134NICKNAME_VALID_SUBSEQUENT_CHARS = NICKNAME_VALID_FIRST_CHAR + string.digits + "-"
135
136# OPTION: NICKNAME_MINIMUM_LENGTH
137# Minimum characters permitted in a nickname on your network.
138NICKNAME_MINIMUM_LENGTH = 2
139
140# OPTION: NICKNAME_MAXIMUM_LENGTH
141# Maximum characters permitted in a nickname on your network.
142# Ideally we'd extract this from the ircd, but we need to know
143# before we connect.
144NICKNAME_MAXIMUM_LENGTH = 15
b8357cf5
CP
145
146# FEEDBACK OPTIONS
147# ---------------------------------------------------------------------
148#
149# These options control the feedback module, which allows users to
150# send feedback directly from qwebirc (via email).
151#
152# OPTION: FEEDBACK_FROM
153# E-mail address that feedback will originate from.
391f51ff 154FEEDBACK_FROM = "moo@moo.com"
b8357cf5
CP
155
156# OPTION: FEEDBACK_TO:
157# E-mail address that feedback will be sent to.
391f51ff 158FEEDBACK_TO = "moo@moo.com"
b8357cf5
CP
159
160# OPTION: FEEDBACK_SMTP_HOST
161# Hostname/IP address of SMTP server feedback will be sent
162# through.
163# OPTION: FEEDBACK_SMTP_PORT
164# Port of SMTP server feedback will be sent through.
165FEEDBACK_SMTP_HOST, FEEDBACK_SMTP_PORT = "127.0.0.1", 25
166
167# ADMIN ENGINE OPTIONS
168# ---------------------------------------------------------------------
169#
170# OPTION: ADMIN_ENGINE_HOSTS:
171# List of IP addresses to allow onto the admin engine at
172# http://instance/adminengine
85f01e3f 173ADMIN_ENGINE_HOSTS = ["127.0.0.1"]
9a2bf266 174
23f85e9b
CP
175# PROXY OPTIONS
176# ---------------------------------------------------------------------
177#
178# OPTION: FORWARDED_FOR_HEADER
179# If you're using a proxy that passes through a forwarded-for
180# header set this option to the header name, also set
181# FORWARDED_FOR_IPS.
182#FORWARDED_FOR_HEADER="x-forwarded-for"
183
184# OPTION: FORWARDED_FOR_IPS
185# This option specifies the IP addresses that forwarded-for
186# headers will be accepted from.
187#FORWARDED_FOR_IPS=["127.0.0.1"]
188
b8357cf5
CP
189# EXECUTION OPTIONS
190# ---------------------------------------------------------------------
191#
192# OPTION: ARGS (optional)
193# These arguments will be used as if qwebirc was run directly
194# with them, see run.py --help for a list of options.
195#ARGS = "-n -p 3989"
196
39cf79cc
CP
197# OPTION: SYSLOG_ADDR (optional)
198# Used in conjunction with util/syslog.py and -s option.
199# This option specifies the address and port that syslog
200# datagrams will be sent to.
201#SYSLOG_ADDR = "127.0.0.1", 514
202
b8357cf5
CP
203# TUNEABLE VALUES
204# ---------------------------------------------------------------------
205#
206# You probably don't want to fiddle with these unless you really know
207# what you're doing...
208
209# OPTION: UPDATE_FREQ
210# Maximum rate (in seconds) at which updates will be propagated
211# to clients
212UPDATE_FREQ = 0.5
213
214# OPTION: MAXBUFLEN
215# Maximum client AJAX recieve buffer size (in bytes), if this
216# buffer size is exceeded then the client will be disconnected.
de4380a1
CP
217# This value should match the client sendq size in your ircd's
218# configuration.
219MAXBUFLEN = 100000
b8357cf5
CP
220
221# OPTION: MAXSUBSCRIPTIONS
222# Maximum amount of 'subscriptions' to a specific AJAX channel,
223# i.e. an IRC connection.
224# In theory with a value greater than one you can connect more
225# than one web IRC client to the same IRC connection, ala
226# irssi-proxy.
227MAXSUBSCRIPTIONS = 1
228
229# OPTION: MAXLINELEN
230# If the client sends a line greater than MAXLINELEN (in bytes)
231# then they will be disconnected.
de4380a1 232# Note that IRC normally silently drops messages >=512 bytes.
b8357cf5 233MAXLINELEN = 600
348574ee 234
b8357cf5
CP
235# OPTION: DNS_TIMEOUT
236# DNS requests that do not respond within DNS_TIMEOUT seconds
00cc5cd5 237# will be cancelled.
28c4ad01 238DNS_TIMEOUT = 5
b5c84380 239
b8357cf5
CP
240# OPTION: HTTP_AJAX_REQUEST_TIMEOUT
241# Connections made to the AJAX engine are closed after this
242# this many seconds.
243# Note that this value is intimately linked with the client
244# AJAX code at this time, changing it will result in bad
245# things happening.
1bccb3e6 246HTTP_AJAX_REQUEST_TIMEOUT = 295
b8357cf5
CP
247
248# OPTION: HTTP_REQUEST_TIMEOUT
249# Connections made to everything but the AJAX engine will
250# be closed after this many seconds, including connections
251# that haven't started/completed an HTTP request.
252HTTP_REQUEST_TIMEOUT = 5
b5c84380 253
fbe5af77
CP
254# OPTION: STATIC_BASE_URL
255# This value is used to build the URL for all static HTTP
256# requests.
257# You'd find this useful if you're running multiple qwebirc
258# instances on the same host.
259STATIC_BASE_URL = ""
260
261# OPTION: DYNAMIC_BASE_URL
262# This value is used to build the URL for all dynamic HTTP
263# requests.
264# You'd find this useful if you're running multiple qwebirc
265# instances on the same host.
266DYNAMIC_BASE_URL = ""
267
b60ea11d 268# OPTION: CONNECTION_RESOLVER
f6c5443a
CP
269# A list of (ip, port) tuples of resolvers to use for looking
270# the SRV record(s) used for connecting to the name set in
271# IRC_SERVER.
272# The default value is None, and in this case qwebirc will use
273# the system's default resolver(s).
b60ea11d
CP
274CONNECTION_RESOLVER = None
275
355dbcb7
CP
276# OPTION: HELP_URL
277# Shown to the user if they type /HELP or click on the Help!
278# option in the user interface.
279HELP_URL = ""
280
13afa38f
CP
281# OPTION: ACCOUNT_WHOIS_COMMAND
282# Command sent when a username is clicked.
283#ACCOUNT_WHOIS_COMMAND = "/msg Q whois #"
284
b8357cf5
CP
285# QUAKENET SPECIFIC VALUES
286# ---------------------------------------------------------------------
287#
288# These values are of no interest if you're not QuakeNet.
289# At present they still need to be set, this will change soon.
290#
291# OPTION: HMACKEY
292# Shared key to use with hmac WEBIRC_MODE.
9a2bf266 293HMACKEY = "mrmoo"
b8357cf5
CP
294
295# OPTION: HMACTEMPORAL
296# Divisor used for modulo HMAC timestamp generation.
9a2bf266 297HMACTEMPORAL = 30
b5c84380 298
b8357cf5
CP
299# OPTION: AUTHGATEDOMAIN
300# Domain accepted inside authgate tickets.
9a2bf266 301AUTHGATEDOMAIN = "webchat_test"
b8357cf5
CP
302
303# OPTION: QTICKETKEY
304# Key shared with the authgate that is used to decrypt
305# qtickets.
9a2bf266 306QTICKETKEY = "boo"
b8357cf5
CP
307
308# OPTION: AUTH_SERVICE
309# Service that auth commands are sent to. Also used to check
310# responses from said service.
348574ee 311AUTH_SERVICE = "Q!TheQBot@CServe.quakenet.org"
b8357cf5
CP
312
313# OPTION: AUTH_OK_REGEX
314# JavaScript regular expression that should match when
315# AUTH_SERVICE has returned an acceptable response to
316# authentication.
348574ee 317AUTH_OK_REGEX = "^You are now logged in as [^ ]+\\.$"
b8357cf5
CP
318
319# OPTION: AUTHGATEPROVIDER
320# Authgate module to use, normally imported directly.
321# dummyauthgate does nothing.
322import dummyauthgate as AUTHGATEPROVIDER