122 Commits

Author SHA1 Message Date
Thomas Waldmann
3caf2508f7 do not strip interface_id_ipv(4|6) if empty/None, fixes #355 2018-09-30 21:39:36 +02:00
Fabian Weisshaar
cbf7027287 already something for Django 2.0 2018-01-30 12:37:12 +01:00
Thomas Waldmann
253391053c api basic auth - ignore non-utf8 chars, fixes #282 2016-09-05 16:51:44 +02:00
Thomas Waldmann
24cd954671 fix #223 2015-12-28 13:58:10 +01:00
Thomas Waldmann
ceb016ab9b fix: always compute rh_fqdn 2015-04-25 17:58:10 +02:00
Thomas Waldmann
0c425e1411 fix format string 2015-04-25 17:55:12 +02:00
Thomas Waldmann
c8d87270b6 do not set A or AAAA record if IFID field is blank
in fact, even delete the A or AAAA record if the field is blank and an update is received.

sometimes it makes sense to have only ipv6 records in DNS if you only have 1 public ipv4.
then you can reach your devices without getting (maybe wrong or not port-forwarded) v4 addresses on lookup.
2015-04-25 17:33:02 +02:00
Thomas Waldmann
4906a28f31 catch IndexError when computing IP of related hosts, fixes #190 2014-12-28 18:33:11 +01:00
Thomas Waldmann
bfe2311b53 implement host IP blacklist, fixes #162 2014-11-18 00:14:23 +01:00
Thomas Waldmann
b8e37e904d register api auth errors/success in the host record, display auth success/failure in host view, partially fixes #176 2014-11-16 00:04:27 +01:00
Thomas Waldmann
6ba6628f60 api views: reduce code duplication - _update and _delete were almost identical 2014-11-15 19:10:47 +01:00
Thomas Waldmann
39eb5e992e support and require django 1.7 (and related changes)
drop python 2.6 (not supported by django any more)
switch from django-registration (dead and broken) to django-registration-redux, fix issue #116
remove south dependency (and south migrations)
create new initial migration with django's builtin migrations
update docs
2014-10-21 05:06:44 +02:00
Thomas Waldmann
8d50874e3a improve basic_auth tests so they work with same datatype as when practically running with a web server 2014-09-29 13:44:21 +02:00
Jonne Haß
5e637b14c9 Handle IPv4-mapped IPv6 addresses
Some reverse proxy configurations pass REMOTE_ADDR
as a IPv4-mapped IPv6 address when listening on a
IPv6 socket. This patch converts such a mapped
address into a IPv4 address at all usages of
REMOTE_ADDR. It handles both, the ::ffff:192.0.2.128
format as well as the deprecated ::192.0.2.128 format.
2014-09-29 06:21:24 +02:00
Thomas Waldmann
27fe20da18 make netmasks / prefix lengths configurable in host record 2014-09-25 23:40:52 +02:00
Thomas Waldmann
fa640706f5 add related hosts functionality, to update host records based on main host network address + interface id
this is esp. useful for v6 hosts, where your provider might give you a changing prefix (we assume /64), but your interface ids stay the same.

but same mechanism also principally works for v4 (we assume /29), except that you usually do not get a v4 network where the network address is changing.
and when it comes to dynamic addresses, many people only get 1 ipv4 address anyway. the related host could then be used for aliaseses with ifid == 0 for all aliases.
2014-09-23 00:48:54 +02:00
Thomas Waldmann
66cedf5425 use FQDN namedtuple for test hostnames 2014-09-22 23:41:35 +02:00
Thomas Waldmann
cf075aa1aa fix some places that relied on TEST_HOST being str
this prepares next commit
2014-09-22 23:39:23 +02:00
Thomas Waldmann
5fe8f13015 rename some model attributes, add migration
Domain.domain to Domain.name
Host.subdomain to Host.name
BlacklistedDomain.domain to BlacklistedDomain.name_re
2014-09-21 22:31:26 +02:00
Thomas Waldmann
a084110d4b give more feedback to user via web ui in case of abuse, host unavailable, bad ip addresses, good updates 2014-09-03 17:49:13 +02:00
Thomas Waldmann
556194ca3f save latest client/server result to model 2014-09-03 16:26:04 +02:00
Thomas Waldmann
1802b91f68 rename methods dealing with client/server "fault" to more general "result" 2014-09-03 15:34:31 +02:00
Thomas Waldmann
8738b135fc add tests for update/delete api with invalid IPs 2014-09-02 23:50:39 +02:00
Thomas Waldmann
9bd09b6008 on travis do not run tests that require sequential execution (can not run in parallel) 2014-09-02 00:14:24 +02:00
Thomas Waldmann
3d91f9bf81 found why other service test has issues on travis-ci, removed sleep again (didn't help anyway) 2014-08-31 18:31:03 +02:00
Thomas Waldmann
f1b8a76906 increase sleep time for other service test, last try ... 2014-08-31 18:03:45 +02:00
Thomas Waldmann
4ef30e4fb8 try to avoid race condition in other service updater test, increasing sleep time 2014-08-31 17:44:01 +02:00
Thomas Waldmann
26c48ea93b try to avoid race condition in other service updater test 2014-08-31 17:36:47 +02:00
Thomas Waldmann
cf2c46e612 use FQDN typed params in api, remove unused parse_name (which was problematic anyway) 2014-08-30 18:27:21 +02:00
Thomas Waldmann
dd3cd6139f sync code between _update and _delete 2014-08-27 17:35:10 +02:00
Thomas Waldmann
56bddb83b6 fix broken api test
as we first check for a nochg update, we couldn't always get the expected dnserr here as the dns update is tried after the  nochg check.
so, if the address did not change, the test failed. fixed by making sure it is not a nochg update.
2014-08-27 16:45:05 +02:00
Thomas Waldmann
8dbbd0cad0 catch UnicodeError exceptions caused by ip addr string that can't be decoded by ascii decoder 2014-08-16 21:58:19 +02:00
Thomas Waldmann
070a1445be s/ssl/secure/g
SSL is the old/outdated name. Since 1999, it's called TLS.

Changed some API params.
2014-05-30 01:28:34 +02:00
Thomas Waldmann
46008bf2cd s/SSL/TLS/g (almost)
SSL is the old/outdated name. Since 1999, it's called TLS.

In this changeset, I did the mostly harmless changes (UI, logs, docs).
2014-05-30 01:10:33 +02:00
Thomas Waldmann
9341df05bb optimize filter_by_fqdn(), rename to get_by_fqdn()
as we precisely expect 1 result (0 or more than 1 are error cases), use .get() instead of .filter().
avoid usage of len().
maybe this is a little more efficient than before.
2014-05-29 15:25:38 +02:00
Thomas Waldmann
93b54ab479 handle myip == '' (?myip= in url) - just get ip from REMOTE_ADDR 2014-04-28 01:08:00 +02:00
Thomas Waldmann
36c3c8d314 implement delete API
Very similar to /nic/update and /nic/update_authorized, /nic/delete and /nic/delete_authorized delete
 the A or AAAA record, depending in the kind of IP address given.

 As this is a delete, the specific ip address value is ignored.
2014-01-21 17:50:01 +01:00
Thomas Waldmann
5d2ee03e02 if we get an invalid ip address string with an update (e.g. via myip=... param), return result code 'dnserr'
note: I did not find a better matching result code, seems like dyndns2 api is rather incomplete. :-(
2014-01-21 14:21:35 +01:00
Thomas Waldmann
0203fdb856 make api tests also use a random hostname (but constant throughout the test session) 2013-12-25 04:42:40 +01:00
Thomas Waldmann
852e541778 make the tests use a test zone
for the dnstools tests, tests were already changed to use a random test host in the test zone,
so parallel tests runs should not use the same hostnames.

test_api tests still use same host names, though
2013-12-25 03:38:08 +01:00
Thomas Waldmann
bf2f5bbe7e fix py3 compatibility 2013-12-24 21:44:11 +01:00
Thomas Waldmann
ba977193ce Merge branch 'master' into py3-port
Conflicts:
	nsupdate/main/_tests/test_main.py
2013-12-24 21:31:40 +01:00
Thomas Waldmann
b317837f58 add a test for dnserr api response
and also fix dnserr api response - should not contain additional info, but just "dnserr"
2013-12-18 04:08:18 +01:00
Thomas Waldmann
14b9407ab5 remove unused imports 2013-12-15 18:27:59 +01:00
Thomas Waldmann
807fcaca5a _update: remove unused agent param 2013-12-15 18:12:10 +01:00
Thomas Waldmann
cf6629a0a8 add/fix more docstrings 2013-12-15 17:29:55 +01:00
Thomas Waldmann
0df4efce1c add/fix some module-level docstrings 2013-12-15 17:09:22 +01:00
Thomas Waldmann
711aba237f python 3.3 port
not much tested yet, be careful
2013-12-14 00:35:29 +01:00
Thomas Waldmann
866ddf3bea add available, abuse and abuse_blocked flags to Host, show on UI, script to reset flags
there is an issue with south and sqlite - it doesn't handle migrations that add BooleanField columns with defaults.
just use the faults script to set the flags to their correct default after migrating with south.
2013-11-30 12:32:03 +01:00
Thomas Waldmann
2aeb2a61f8 service updater (host configs): add (give|accept)_(ipv4|ipv6) fields 2013-11-29 02:11:55 +01:00