Thomas Waldmann
1f28cb3ed0
name api views, use reverse() in unit tests
2013-11-15 12:14:36 +01:00
Thomas Waldmann
f6fb8b67bd
try to not write into session unless there is really a change or a refresh needed, reduce code duplication
...
move code from HomeView to context processor
2013-11-14 02:11:44 +01:00
Thomas Waldmann
f1cdf2ec45
dnstools logging levels improved
2013-11-10 13:59:40 +01:00
Thomas Waldmann
9da1fe95b6
better logging for mismatching username/hostname
2013-11-10 08:12:22 +01:00
Thomas Waldmann
50bdf58398
fix typo
2013-11-10 08:03:36 +01:00
Thomas Waldmann
367bc70f56
security fix: authenticating is not enough, hostname qs param (if given) also needs to match the username
2013-11-10 07:57:40 +01:00
Thomas Waldmann
24b687960e
deal with "nameserver not available" and "peer bad signature" in same way as with dns update errors,
2013-11-10 07:04:46 +01:00
Thomas Waldmann
bd3e7c80f7
if a dns update give a rcode != NOERROR, we log it and raise a DnsUpdateError, dyndns2 result code: "dnserr REASON" (also shown on web ui)
2013-11-10 06:29:33 +01:00
Thomas Waldmann
f5c70b03b1
dnstools: use enhanced logger, gives remote addr and user agent automatically
2013-11-09 07:17:05 +01:00
Thomas Waldmann
9cdddbaa0d
catch exception that is raised for update usernames that are not fqdn
2013-11-06 13:17:23 +01:00
Thomas Waldmann
51e5efbe8f
transform some views from function- to class-based
...
fixes some pep8 issues. use lowercase function name for the stuff we keep as function.
2013-11-05 00:24:02 +01:00
Thomas Waldmann
4ba29fc3ff
detectip: it is not valid without a sessionid, remove the view
...
and as we currently use the sessionid, we should also name it like that.
2013-11-04 23:09:24 +01:00
Thomas Waldmann
bdb9fd4dab
fix KeyError if there is no ipv4/ipv6 key in the session
2013-11-03 17:32:56 +01:00
Thomas Waldmann
7a99935597
use json serializer for sessions, change timestamps' data type, more security docs
...
json serializer can't serialize datetime (but integers), but is more safe than the pickle serializer.
2013-11-03 09:52:11 +01:00
Thomas Waldmann
e194ac0e46
show whether we received last v4/v6 update via SSL
2013-11-03 08:32:43 +01:00
Thomas Waldmann
461da24b52
add useragent to api / authorized update logging
2013-11-02 02:39:25 +01:00
Thomas Waldmann
7f8e62cc30
use AJAX to update view with current IPs, cosmetic changes, deal with v4 and v6 js separately
2013-11-01 06:03:36 +01:00
Thomas Waldmann
60f03b0472
fix typo in CSRF setting, fix pep8 issues
2013-11-01 04:22:53 +01:00
Thomas Waldmann
2529263a48
remove stale IPs from session, so we don't show outdated information
...
could happen if there once was a IPv6 connection, but now is not any more.
it now kills infos older than 3 minutes from the session.
it also shows the age of the infos now on the hosts overview view (but not on home view due to cosmetic reasons).
optimization: only request the fake images for ipv4/v6 detection if we don't have a fresh IP already.
added example settings for using detectip on (ip6-)localhost
2013-11-01 04:03:34 +01:00
Thomas Waldmann
252a7e5d0b
fix some stuff the pycharm code checker found
...
it also thought the db param of init_db is not needed, but it is, added a comment there
2013-10-27 13:34:56 +01:00
Thomas Waldmann
979f2f8b3e
separate ipv4 and v6 update timestamps
2013-10-27 13:09:46 +01:00
Thomas Waldmann
89f743c1b0
removed test skips, all works now
2013-10-17 15:58:25 -07:00
Bastian Blank
09e31209f1
Create 204 response in detect ip view
2013-10-18 00:19:05 +02:00
Bastian Blank
d2eab62ac4
Move all stuff into own top-level package
2013-10-17 23:59:07 +02:00
Thomas Waldmann
9428ed7943
adding nic api tests
2013-10-03 21:58:33 +02:00
Thomas Waldmann
2982bd6e30
new check_ip() validates if a str is a ip addr and also determines address family, deduplicate code
2013-10-03 20:39:55 +02:00
Thomas Waldmann
824d77da89
remove example test module, see main/_tests/ for some real tests
2013-10-03 19:41:05 +02:00
Thomas Waldmann
377c0f3e18
api: use Response() more often
2013-10-03 19:38:07 +02:00
Thomas Waldmann
1924888b37
reorder imports: stdlib, other libs, django, nsupdate stuff (views, etc.)
2013-10-03 19:26:39 +02:00
Thomas Waldmann
15c01730b0
add dnspython issue URL and TODO
2013-10-03 17:25:10 +02:00
Thomas Waldmann
da2cf11f70
fix typo
2013-10-03 01:18:48 +02:00
Fabian Faessler
aad646c045
fixed dns api, so an empty myip get parameter is treated like no myip parameter used. made the update ip adr as ajax.
2013-09-29 23:34:07 +02:00
Fabian Faessler
beafe06852
added logic for last_api_update. field updated with Hosts.poke() method
2013-09-29 21:00:08 +02:00
Arne Schauf
13511a7982
fqdn fix
2013-09-29 18:15:15 +02:00
Thomas Waldmann
fb76785bb6
more docstrings fixes
2013-09-29 16:15:12 +02:00
Thomas Waldmann
d935979934
add docstrings
2013-09-29 15:59:16 +02:00
Fabian Faessler
6bcaf76263
fixed the ip detection :3
2013-09-29 15:15:34 +02:00
Fabian Faessler
1809737ae3
half broken commit to debug sth live. sorry
2013-09-29 15:09:53 +02:00
Fabian Faessler
fc2e088ba1
debug ip detection problem
2013-09-29 14:41:47 +02:00
Fabian Faessler
f25ed3cdee
removed proxy user, because solution was not working. Made id session based. please work now :'(
2013-09-29 14:33:24 +02:00
Fabian Faessler
09da9a4036
changed User to ProxyUser
2013-09-29 14:07:24 +02:00
Thomas Waldmann
adc6315a34
implemented authorized nic update view (via admin session)
2013-09-29 02:43:47 +02:00
Fabian Faessler
abe8ee41ff
Merge branch 'master' of github.com:asmaps/nsupdate.info
...
Conflicts:
nsupdate/main/urls.py
2013-09-29 02:08:39 +02:00
Fabian Faessler
374288d20a
changed updateIp to detectIP
2013-09-29 02:07:58 +02:00
Thomas Waldmann
0a297b04ee
style fix: use with with open, os.path.join for pathes
2013-09-29 01:59:47 +02:00
Thomas Waldmann
26a911824d
pep8 fixes
2013-09-29 01:29:01 +02:00
Fabian Faessler
a9cca9071b
Merge branch 'master' of github.com:asmaps/nsupdate.info
2013-09-29 01:12:35 +02:00
Fabian Faessler
aabc5d78d6
updadd Host fields. serve 1px image instead of OK text in /updateip/. favicon change.
2013-09-29 01:12:23 +02:00
Thomas Waldmann
d558e2ece2
store update_secret as salted sha1 (use crypto code from django), fix bug: we also need to catch NoAnswer, not just NXDOMAIN.
...
NoAnswer == there is a record, but not of the type (A or AAAA) we requested.
NXDOMAIN == there is no record at all.
2013-09-29 00:34:47 +02:00
Thomas Waldmann
ec3869c9d0
verify username (fqdn) and password (update secret) against the database, improve docstrings
2013-09-28 23:32:47 +02:00