Put the realm in the configuration file (fix #37)

This commit is contained in:
Guillaume Ayoub 2013-06-28 16:39:09 +02:00
parent a819e4b2c8
commit de1e57081b
3 changed files with 5 additions and 2 deletions

2
config
View File

@ -29,6 +29,8 @@ key = /etc/apache2/ssl/server.key
dns_lookup = True dns_lookup = True
# Root URL of Radicale (starting and ending with a slash) # Root URL of Radicale (starting and ending with a slash)
base_prefix = / base_prefix = /
# Message displayed in the client when a password is needed
realm = Radicale - Password Required lol
[encoding] [encoding]

View File

@ -59,7 +59,7 @@ NOT_ALLOWED = (client.FORBIDDEN, {}, None)
# non-public information w/o submitting proper authentication credentials # non-public information w/o submitting proper authentication credentials
WRONG_CREDENTIALS = ( WRONG_CREDENTIALS = (
client.UNAUTHORIZED, client.UNAUTHORIZED,
{"WWW-Authenticate": "Basic realm=\"Radicale - Password Required\""}, {"WWW-Authenticate": "Basic realm=\"%s\"" % config.get("server", "realm")},
None) None)

View File

@ -46,7 +46,8 @@ INITIAL_CONFIG = {
"certificate": "/etc/apache2/ssl/server.crt", "certificate": "/etc/apache2/ssl/server.crt",
"key": "/etc/apache2/ssl/server.key", "key": "/etc/apache2/ssl/server.key",
"dns_lookup": "True", "dns_lookup": "True",
"base_prefix": "/"}, "base_prefix": "/",
"realm": "Radicale - Password Required"},
"encoding": { "encoding": {
"request": "utf-8", "request": "utf-8",
"stock": "utf-8"}, "stock": "utf-8"},