95 Commits

Author SHA1 Message Date
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
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
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
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
Thomas Waldmann
60353a6429 implement / configure logging to stderr, reorder actions for update api, so that a lot of info can be logged 2013-09-28 21:42:04 +02:00
Thomas Waldmann
44770d9cbd small style change 2013-09-28 21:42:04 +02:00
Thomas Waldmann
add5e6a379 implemented update api (still without checking the DB), misc. cleanups 2013-09-28 20:39:33 +02:00
Fabian Faessler
a96c7b4608 imrpoved ipv4/ipv6 check. now always update ip, in case host changes IP. added a create_host() method for the HostForm. 2013-09-28 20:18:20 +02:00
Fabian Faessler
eb30914704 added comment field in host. added admin and forms. 2013-09-28 20:01:09 +02:00
Fabian Faessler
04602c53a6 get ipv4 and ipv6 adr from session 2013-09-28 19:01:40 +02:00
Fabian Faessler
366f809e7f moved the /myip call into the api module 2013-09-28 18:46:31 +02:00