Commit Graph

227 Commits

Author SHA1 Message Date
Daniel Roschka ff2f5abcb1 Remove tests for checking DNS resolution
The tests checking the DNS resolution aren't reliable as they rely on specific
behavior of the DNS resolution on the local system. As they are reliable it
makes no sense to keep them as they are currently.
2015-05-30 16:42:59 +02:00
jeffrey forman d625e0245b Merge branch 'revised-local-settings' of https://github.com/Dunedan/binder into Dunedan-revised-local-settings
fixed import of get_object_or_404 which was erroneously removed

Conflicts:
	binder/views.py
2015-05-27 20:14:50 -04:00
jeffrey forman 5effaf8c45 Merge branch 'template-cleanup' of https://github.com/Dunedan/binder into Dunedan-template-cleanup
resolve some conflicts with templates

Conflicts:
	binder/templates/bcommon/add_cname_record_form.html
	binder/templates/bcommon/delete_record_initial.html
2015-05-27 20:03:33 -04:00
Daniel Roschka 7882ee9121 Add global authentication
This commit adds global authentication to binder to ensure that only valid
users are able to use it. This should enable binder to be used in
environemts where it's webfrontend is reachable for unauthenticated users as
well.

For setups where such a global authentication isn't desired it can be disabled
by simply removing the LoginRequiredMiddleware from the list of active
middlewares.
2015-04-05 21:06:01 +02:00
Jeffrey Forman dc15440a98 Merge pull request #32 from Dunedan/fix-missing-cancel-buttons
Fixes missing cancel buttons
2015-04-05 14:09:07 -04:00
jeffrey forman 796cb06055 Merge branch 'ship-jquery' of https://github.com/Dunedan/binder into Dunedan-ship-jquery 2015-04-05 07:22:23 -04:00
jeffrey forman b62af7b64d fix UI tests that werent updated to match the new templates 2015-04-04 22:07:49 -04:00
jeffrey forman 5c35b2306e delete commented out HTML that was forgotten from before 2015-04-04 22:07:37 -04:00
jeffrey forman 880eee067d localhost wont always have an IPv6 address assigned to it 2015-04-04 20:33:53 -04:00
jeffrey forman 12654bd3a5 Merge branch 'fix-failing-tests' of https://github.com/Dunedan/binder into Dunedan-404-for-not-existing-servers 2015-04-04 20:28:31 -04:00
jeffrey forman a099a43250 Merge branch '404-for-not-existing-servers' of https://github.com/Dunedan/binder into Dunedan-404-for-not-existing-servers 2015-04-03 22:13:42 -04:00
Jeffrey Forman 2fef6d07af Merge pull request #23 from Dunedan/add-migrations
Added initial migrations for binders models.
2015-04-02 21:55:11 -04:00
Jeffrey Forman 074d62453f Merge pull request #22 from Dunedan/configurable-dns-port
Make the port for DNS queries per server configurable.
2015-04-02 21:54:23 -04:00
Daniel Roschka f6d95c2ac2 Fixes missing cancel buttons
The cancel buttons on the forms introduced with
1671bc4c2f vanished with
41f78b3eff.
This commit adds them back.
2015-04-02 19:21:33 +02:00
Daniel Roschka c885c823b5 Removes a broken label assignment from the form to add CNAMEs. 2015-04-02 13:41:28 +02:00
Daniel Roschka 8a67eeb8c5 Fixes label assignment to fields for radio button fields. 2015-04-02 13:39:18 +02:00
Daniel Roschka 581dc915fe Change in the behavior of local_settings.py
Up to now local_settings.py was used for binder specific configuration values.

This commit moves these values to settings.py, removes local_settings.py
from version control and adds logic to settings.py to allow settings in
local_settings.py to overwrite ones defined in settings.py, enabling
local_settings.py to be used as installation specific configuration file,
e.g. for custom database configuration.
2015-04-02 10:26:29 +02:00
Daniel Roschka d46ffd1abc Clean up of various parts of the templates
* Replaced tabs for indentation with proper spaces to have only spaces for
  indentation
* Added the btn-default class to all buttons where it was missing
* Added relations between labels and the elements they are labeling using the
  naming schema Django uses by default (might become handy in the future)
* Added additional meta tags required by Bootstrap 3
* Moved the button for adding records in list_zone.html out of the table to get
  cleaner markup
* Swapped out the used version of Bootstrap against the minified one.
* Removed the commented out old code from delete_record_initial.html, because
  that's why we have version control
2015-04-02 08:32:27 +02:00
jeffrey forman 41f78b3eff move to bootstrap 3 (3.3.4). fairly significant template update 2015-04-01 21:28:56 -04:00
Daniel Roschka a5ebc7bad7 Ship jQuery with binder
Up to now jQuery has been the only resource required by binder which users had
to load from the internet. To enable binder to work in environments where no
internet access is available this commit adds jQuery 2.1.3 to binders static
files so no internet access is necessary anymore for using binder.
2015-04-01 15:22:13 +02:00
jeffrey forman 6557f2c099 clean up how we parse multiple items in the selected list when deleting multiple records 2015-03-31 21:43:26 -04:00
Daniel Roschka a6747b4f25 Removed the checking for the exception message when trying to produce an
IntegrityError, because that message differs based on the environment.
2015-03-29 19:47:58 +02:00
Daniel Roschka 95b86434ff Fixes outstanding failing tests
Fixes three failing tests.
For test_ipinfo_ResolutionFail it fixes the following issues:
* failing when no network is available
* failing when Google changes the ip addresses of the service
* failing when the order of returned ip addresses is different
For test_DeleteRecordInitial_Empty and test_DeleteRecordInitial it fixes a not
existing BindServer object.
2015-03-29 19:03:53 +02:00
Daniel Roschka 6a769e4cbb Fixes the behavior for not existing BIND servers
When requesting one of binders BIND server specific URLs for a server not
present in binders database currently uncatched exceptions are thrown.

This commit fixes that for all URLs containing the server name, by instead of
throwing an uncatched exception, returning a proper HTTP 404 status code.
2015-03-29 14:04:43 +02:00
Daniel Roschka 30d812f838 Removed the initial migrations for binders models again as they are now part of
another pull request. The only migration left is the one for the newly added
field.
2015-03-28 18:48:25 +01:00
Daniel Roschka a3d97f97d2 Added initial migrations for binders models. 2015-03-28 18:46:55 +01:00
jeffrey forman e0768ae67a Merge branch 'htm-to-html' of https://github.com/Dunedan/binder into Dunedan-htm-to-html 2015-03-28 08:53:35 -04:00
Jeffrey Forman ef87c412b7 Merge pull request #19 from Dunedan/fix-cancel-buttons
Fixes some problems introduced with 448d18f
2015-03-27 22:15:12 -04:00
Daniel Roschka 77eda58f37 Make the port for DNS queries per server configurable.
While it might not be that common to have a DNS server listening on a
non-standard port for DNS queries, it's also useful for local testing.

I used the opportunity to add model migrations as well to enable smooth model
upgrades.
2015-03-27 19:30:03 +01:00
Daniel Roschka 8be9a4b2e3 Renaming all templates from *.htm to *.html
When using Djangos "makemessages" command to collect strings for i18n it only
considers templates with a file extenions of .txt and .html by default. For
more details see:
https://docs.djangoproject.com/en/dev/topics/i18n/translation/#message-files

Also when Django is refering to default template names (e.g. for error handling
or accounts) it always refers to file names with .html as file extension.

To avoid hassle in the future this commit aligns the file extension used for
templates to Djangos default of .html.
2015-03-26 22:13:42 +01:00
jeffrey forman cbd0716c8f Merge branch 'secret-secret-key' of https://github.com/Dunedan/binder into Dunedan-secret-secret-key 2015-03-25 22:02:36 -04:00
jeffrey forman 9d16c0554c Merge branch 'admin-form-validation' of https://github.com/Dunedan/binder into Dunedan-admin-form-validation 2015-03-25 21:37:33 -04:00
Jeffrey Forman 8679f1cc5f Merge pull request #16 from Dunedan/fix-form-data
Fixes missing form data when rendering the add record template after an error.
2015-03-25 21:24:58 -04:00
Daniel Roschka 270bb80921 Commit 448d18f8f9 introduced some problems, which
are fixed in this commit:
* Cancel links were converted to buttons, by simply wrapping them into a
  <button>-element, causing them to act as submit buttons, as submit is the
  default action for buttons, instead of cancel buttons. Instead the proper
  bootstrap code for showing links as buttons is used now.
* add_cname_record_form.htm hasn't been adjusted to show a button instead of a
  link for cancelling. I converted that to a button now as well.
2015-03-25 18:48:13 +01:00
jeffrey forman 5c90f80e8d Merge branch 'select-default-key' of https://github.com/Dunedan/binder into Dunedan-select-default-key
Conflicts:
	binder/templates/bcommon/list_zone.htm
2015-03-24 20:48:15 -04:00
jeffrey forman 448d18f8f9 make every cancel/delete action link a button 2015-03-24 20:19:30 -04:00
Daniel Roschka 9eb3726889 Makes SECRET_KEY secret
To quote from Djangos documentation:
"The secret key must be a large random value and it must be kept secret."
https://docs.djangoproject.com/en/1.7/howto/deployment/checklist/#secret-key

This commit achieves that by generating a file containing a random string
when running the first time and by using this string as SECRET_KEY from then
on.
2015-03-24 22:43:18 +01:00
jeffrey forman 7a83de8c84 Merge branch 'form-cancel-buttons' of https://github.com/Dunedan/binder into Dunedan-form-cancel-buttons 2015-03-23 22:07:00 -04:00
Daniel Roschka f509fd6dbf Added validation for the admin forms.
Especially the validation of the key should be helpful, as it prevents users to
store wrongly formatted keys.
2015-03-23 21:51:31 +01:00
Daniel Roschka 382cf4ae26 Fixes missing form data when rendering the add record template after an error. 2015-03-23 21:10:15 +01:00
Daniel Roschka 0b21800bae Fixed the name of the variable holding the key on the add CNAME page. 2015-03-23 18:39:08 +01:00
Daniel Roschka a449443340 Automatically select the default key for the current server when doing actions.
This commit introduces automatic selection of the default TSIG key for all
available actions (add, delete). For enabling that it has been necessary to
provide the whole BindServer object to the template, which caused some
additional changes.

I also took the opportunity to unify some styling (indentation, linebreaks) of
the HTML templates.
2015-03-22 21:20:12 +01:00
Daniel Roschka c3e454e88b Added the cancel link on the page for adding CNAME records as well. 2015-03-22 20:52:46 +01:00
jeffrey forman 19f891c27a fix the text associated with an hmac-md5 tsig key 2015-03-22 14:32:07 -04:00
Jeffrey Forman fb7d27da20 Merge pull request #13 from Dunedan/fix-tsig-algorithms
Fix binder to work with TSIG keys not using dnspythons default algorithm
2015-03-22 14:15:09 -04:00
Jeffrey Forman fb43a9aa5a Merge pull request #12 from Dunedan/fix-errorhandling-for-incorrect-keys
Fixes error handling for broken TSIG keys.
2015-03-22 14:10:32 -04:00
Daniel Roschka 1671bc4c2f Added buttons to cancel forms and fixed the styling of some buttons. 2015-03-22 18:34:40 +01:00
Daniel Roschka a19719a41b Fix binder to work with TSIG keys not using dnspythons default algorithm
binder has been broken to work with signatures created with anything but
dnspythons default TSIG algorithm, which currently is HMAC-MD5.
This commit fixes that by properly using the algorithm stored for the key.
2015-03-22 18:07:06 +01:00
Daniel Roschka 43fe909ec6 Fixes error handling for broken TSIG keys.
The error handling for broken TSIG keys wasn't working for two reasons:
* the import of binascii has been missing, producing a NameError once an
  exception occured
* The exception handler was refering to a non-existant variable key_name.

This commit fixes both issues.
2015-03-22 17:03:50 +01:00
Daniel Roschka 763d132b0f Some small improvements for the models.
* Added help texts to all fields to make adding servers and keys in the admin
  interface more convenient.
* Added a default ordering for servers and keys.
* Added unique constraints, so there can be only on key per name and one server
  per hostname as this has already already been an implicit constraint in the
  code.
2015-03-22 15:47:05 +01:00
Jeffrey Forman f0f897fad6 fix models test reason for test where no statistics port is specified 2014-12-24 17:15:06 -05:00
Jeffrey Forman da4bbed5d7 update tests for django >1.6, disable integration tests until I can figure out a good local solution 2014-12-24 17:14:33 -05:00
Jeffrey Forman e732cf3613 add TEST_RUNNER specification to be django >1.6 friendly 2014-12-21 19:24:35 -05:00
Jeffrey Forman 06c1b268b4 make template_dirs in settings a tuple to play nice with django 1.7 2014-10-06 21:58:09 -04:00
Jeffrey Forman f9f9309fe9 beautifulsoup is not a required module for binder itself, remove from models 2014-10-06 13:02:30 -04:00
Jeffrey Forman e48f4ad5b0 make server zone list table sortable by column 2014-01-05 17:53:13 -05:00
Jeffrey Forman d8900c4075 convert to using pybindxml for scraping zone/server information from bind in server zone list 2014-01-05 17:50:13 -05:00
Jeffrey Forman c2daf46358 update url template references to be django 1.5 friendly 2013-12-01 18:05:01 -05:00
Jeffrey Forman 5ec7fc02c9 Add sorttable.js to static, ability to sort zone list table 2013-03-21 21:18:03 -04:00
Jeffrey Forman 9e95181936 Add ability to directly create reverse PTR records. Not the best, but it works. 2012-12-25 19:57:00 -05:00
Jeffrey Forman b803923331 print error if encountered in deleting records form 2012-12-16 11:21:44 -05:00
Jeffrey Forman 26acc4f51c Convert unit tests to use reverse() instead of specifying URL's hard coded 2012-12-15 21:59:51 -05:00
Jeffrey Forman a7bc198c4d Convert template URL href references to use 'url' template syntax for reverse URLs 2012-12-15 20:25:06 -05:00
Jeffrey Forman 16a629f81a use a split method on the string, instead of a regex, to make getting the host and domain easier when deleting a record 2012-12-15 20:21:47 -05:00
Jeffrey Forman acd9ec596c Add unit tests for add cname form and add record form testing 2012-12-13 01:40:12 -05:00
Jeffrey Forman 3a9e9fe614 dont show the 'add reverse record' checkbox if on form for adding reverse record 2012-12-12 21:12:58 -05:00
Jeffrey Forman 308be6a025 Add integration test for denied zone transfer 2012-12-09 21:22:47 -05:00
Jeffrey Forman 0b048f46f8 Saving the model is important if you want to change statistics_ports midway through. 2012-12-07 07:46:18 -05:00
Jeffrey Forman 3b0b29664e clean up the keys, down to one key for testing 2012-12-07 07:44:29 -05:00
Jeffrey Forman 453cb4410b add test_Integration_ZoneList_ConnectionRefused 2012-12-06 21:46:10 -05:00
Jeffrey Forman 52a80a90f2 Add testdata to repo, named.conf and forward/reverse zones.
Clean up the main readme.md
2012-12-06 20:13:07 -05:00
Jeffrey Forman 7fc67cb542 Add integration tests for adding and deleting records. and add cname test
Also added fixtures for binder_test
2012-12-04 22:45:01 -05:00
Jeffrey Forman bd65e1b239 Add error reason to form validation for unicode->string list formfield 2012-12-04 06:18:40 -05:00
Jeffrey Forman 8937154b1d Fix broken invalid formadd test now that record type is from record_type_choices 2012-12-02 14:50:48 -05:00
Jeffrey Forman aa76d59a13 add choice selection to record type when adding record. works for A/AAAA records. 2012-12-02 09:13:22 -05:00
Jeffrey Forman e477a23ba4 fix invalid_formaddrecord test because field is now a choice not an integer 2012-12-02 08:58:04 -05:00
Jeffrey Forman 42db5cedee create local_settings, pass TTL_CHOICES around to be able to pick TTL when creating record. 2012-12-02 08:49:49 -05:00
Jeffrey Forman a3f0a643a1 Commit first round of unit tests (14), all pass! 2012-12-01 19:10:44 -05:00
Jeffrey Forman bb40ef2d6a add validating tests around models with incorrect/missing data 2012-12-01 16:20:50 -05:00
Jeffrey Forman 02caf7c983 Split up tests into own directory and separate files 2012-12-01 14:41:40 -05:00
Jeffrey Forman d5b2197571 Merge keyutils into a method inside the Key class. Delete keyutils.py 2012-11-30 22:40:58 -05:00
Jeffrey Forman 063d64d6c6 create feeder function to send dns updates. forward/reverse/cname call send_dns_update.
Collapse keyutils into helper. Create single create_keyring function that decides what to create.
2012-11-30 07:25:23 -05:00
Jeffrey Forman 46a91e2fdf Add error handling in delete_record function around unrecognized/malformed keys. 2012-11-29 21:52:27 -05:00
Jeffrey Forman d4d4afdaa1 Add ip info on server list page.
Also clean up imports, standardize on order
2012-11-28 22:09:25 -05:00
Jeffrey Forman 9dcb07e996 Display IP address along side server name in server list 2012-11-26 22:05:44 -05:00
Jeffrey Forman ba78f39670 collapse add forward and add reverse helper functions into update_record.
clean up some handling of cname creation.
2012-11-25 22:35:11 -05:00
Jeffrey Forman e1c0e9d256 remove unused import 2012-11-25 18:09:56 -05:00
Jeffrey Forman b28bfbacd5 remove errant print statements from views 2012-11-25 18:06:11 -05:00
Jeffrey Forman 0736eb3eb5 error handling around viewing unresponsive dns servers in zones. add try/except when adding cname 2012-11-25 18:02:33 -05:00
Jeffrey Forman 0c35125777 clean up some unused imports, also handle exceptions for adding cname 2012-11-25 18:02:01 -05:00
Jeffrey Forman 0c36d0f4a8 template update,List dns server when listing a particular zone 2012-11-25 18:01:13 -05:00
Jeffrey Forman 5f2414266a Handle exception when attempting a zone list (xfr) fails. 2012-11-25 18:00:48 -05:00
Jeffrey Forman b80719c7ea add zone class and view name to server zone list view 2012-11-25 14:59:05 -05:00
Jeffrey Forman 518f250036 make base template a bit more bootstrap friendly, stick in a container div 2012-11-25 14:17:42 -05:00
Jeffrey Forman 6b66c156b9 Some template cleanup, making tag hierarchy more correct. 2012-11-25 13:45:01 -05:00
Jeffrey Forman fdae61760c First found of 7 unit tests. Rudimentary page getting, form posting.
Need to figure out how to write good integration tests to hit the whole workflow.
2012-11-25 12:56:08 -05:00
Jeffrey Forman 412b75b8cb Make some of the html tag inheritance with tr, div, script and body more correct. 2012-11-25 09:26:19 -05:00
Jeffrey Forman a7b531cf9b add names to all url's 2012-11-24 22:57:08 -05:00
Jeffrey Forman c492fb508c clean up delete_record view using formdeletecord 2012-11-23 22:42:37 -05:00
Jeffrey Forman c42009f714 move delete_record to a more import friendly structure. clean up code 2012-11-23 22:28:33 -05:00