Hidden Z
489f1c9f15
web/lib/utils.py: add workaround for django
...
It helps to avoid multiple root loggers.
2010-11-02 18:34:25 +00:00
Hidden Z
4fa014add4
web/lib/utils.py: remove unneeded check_logger_options()
2010-11-01 21:22:20 +00:00
Hidden Z
c9c4e189e4
web/lib/utils.py: add validate_config()
...
New function for handle config validation.
http://www.voidspace.org.uk/python/articles/configobj.shtml#validation
2010-11-01 21:21:14 +00:00
Hidden Z
891472cfac
web/lib/utils.py: add check_logger_options()
...
We need to check config options for logger in various scripts, and this
check is almost same, so move it to separate function.
2010-10-31 19:48:33 +00:00
Hidden Z
1cff3cedcb
web/lib/utils.py: bugfix: take WatchedFileHandler properly
2010-10-31 18:38:27 +00:00
Hidden Z
d9eb21932e
web/lib/validation.py: add validate_i2purl()
...
We need it for URL validation when adding external hosts sources.
2010-10-31 12:24:28 +00:00
Hidden Z
9f3773cebf
web/lib/validation.py: use plain ValidationError
2010-10-31 10:30:01 +00:00
Hidden Z
e1be09b22f
web/lib/utils.py: use WatchedFileHandler
...
Let admins safely rotate the logfiles with logrotate(8).
2010-10-30 21:31:30 +00:00
Hidden Z
85263b65cc
web/lib/utils.py: a set of various utils for project
...
And firstly write get_logger() function. It provides common mechanism
for creating logger instances inside scripts.
2010-10-29 20:45:10 +00:00
Hidden Z
893d84c08f
web/lib/validation.py: disallow localhost.*
2010-10-29 17:45:10 +00:00
Hidden Z
f34a78c9ab
web/lib/validation.py: disallow *b32.i2p and *b64.i2p
2010-10-29 17:44:21 +00:00
Hidden Z
700391d6e8
validation.py: check for pasting i2p router hash
2010-10-22 19:36:49 +00:00
Hidden Z
a287860619
validation.py: fail if hash contains .i2p= (full foo.i2p=key)
2010-10-22 19:34:49 +00:00
Hidden Z
ac349547f5
validation.py: check for passing b32 address instead of base64 hash
2010-10-22 19:33:31 +00:00
Hidden Z
0cd7556774
validation.py: strip leading and trailing whitespaces from hash before processing
2010-10-22 19:31:02 +00:00
Hidden Z
5803016ec3
validation.py: update docstring for validate_hostname()
2010-10-22 18:38:33 +00:00
Hidden Z
b5c5a4051c
validation.py: check for http:/ in hostname
...
This is a common error.
2010-10-22 18:37:38 +00:00
Hidden Z
5da0cc4b59
validation.py: check if only ".i2p" supplied as hostname
...
This is a common error.
2010-10-22 18:36:05 +00:00
Hidden Z
9ea9db109a
validation.py: fix typo in message
2010-10-22 18:31:46 +00:00
Hidden Z
2ab7b2de5f
validation.py: Allow only 4ld domains and below
2010-10-22 18:29:42 +00:00
Hidden Z
0c45032178
validation.py: enhance IDN-check
...
Previously olny IDN hostnames which starts with xn-- was allowed, now
subdomains like subdomains.xn--foobar.i2p are also allowed.
2010-10-22 18:02:47 +00:00
Hidden Z
ac3df58a3f
validation.py: hostname must not start with '.' or '-'
...
I just forgot to add this rule earlier.
2010-10-22 17:48:47 +00:00
Hidden Z
76e4ee94ce
validation.py: add hostname lenght check
...
That's not really needed, just added for avoiding
django.db.utils.DatabaseError exceptions when trying to add too long
hostname with py-i2phosts-injector
2010-10-22 17:47:27 +00:00
Hidden Z
01e01b98fa
validation.py: bugfix: look for '..' in a whole hostname, not in namepart only
2010-10-22 17:15:59 +00:00
Hidden Z
573efddf8b
validation.py: strip leading and trailing whitespaces from hostname
2010-10-22 17:14:30 +00:00
Hidden Z
6a50774e5f
web/lib/validation.py: add comment
2010-10-21 18:47:50 +00:00
Hidden Z
bb2582c62c
web/lib/validation.py: add base64-validity check
...
Base 64 hash shouldn't require more than 2 pad chars to be divided to 4
without leftover.
2010-10-21 18:44:02 +00:00
Hidden Z
2b535dbf2b
web/lib/validation.py: new b64 length check
...
b64 hash shouldn't be longer than 616 bytes. We already have length
limit in database model, but this way we can provide our custom error
message.
2010-10-21 18:40:02 +00:00
Hidden Z
bc3118ab44
web/lib/validation.py: call len() for "data" only once
...
Sort of optimisation.
2010-10-21 18:38:57 +00:00
Hidden Z
f3a79838e6
web/lib/validation.py: fix base64 validations according to zzz's explanation
2010-10-16 19:03:54 +00:00
Hidden Z
2769f0d4bc
Move validation functions to separate module
2010-10-16 18:30:08 +00:00