-
Notifications
You must be signed in to change notification settings - Fork 303
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
central-develop into 0.17.x #5595
Changes from all commits
95ae21e
0615773
3daac46
30758b4
5d6a29d
6d7e510
0cef1b9
6c70ea7
8fea95e
318a01a
bf146dc
c6402d3
c1abb70
5105876
6e6c0f0
26592ee
61fb56b
5286833
af8d016
350a7f5
1c582c2
66a0248
c106ca1
8e5e8e5
bc21a36
3bffde5
5e0b016
d4c91a2
cfb423d
14c8701
b56a514
4ffdb35
7c9085b
b68aadf
618314d
2c5cce4
b3f28a0
c06bab5
dd65adb
0299599
e890a2d
b289d0f
54c23cb
1509abc
0597547
a6d62e5
6e8da48
6177f63
ee90bd5
a5a5b1b
3bbd98e
abb207c
e6f34b2
1f19654
2ebd3ed
097a747
073046f
105272d
e1d6c23
63824f6
f13286c
c29c18d
645c7f0
1648ace
3755b72
d24b7ab
05bf1cd
3aaeea8
5f82a77
99dbcdb
c12f0ce
a276b0c
8a4d4be
f0bd27c
34a27be
65330fb
eb670d5
8ffa4d2
ea857a6
3ae33e7
3510566
3d273f2
ab8bc62
263e52b
b0a9d48
83006de
a253c1b
c3cc5ef
626f915
9801731
452e19e
4d408f3
4771c3c
171f2f7
1c49921
de616c3
c682fa4
5942943
259d8ae
cabc30f
2a5fa54
590752e
1f87909
8adb6f3
68c6ffe
30f8bd1
6f62e04
41923fc
d6abcae
0c49a77
fbc2912
c01942e
719921a
361834b
1323db0
cd4cb41
e418511
4951c10
90d20c6
d7cdc84
dc56afc
c789b22
bf2cfa4
cb25c26
45cc3e4
a118a2d
bdf518c
635c5ea
a2b59b0
3555f82
9272dcf
3fccd47
a56efba
54bc417
650a95d
e554397
338fc49
f2ae87c
5161c9b
bc367a0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,9 +13,17 @@ | |
|
||
class BaseClient(object): | ||
|
||
def __init__(self, host="%s://%s/" % (settings.SECURESYNC_PROTOCOL, settings.CENTRAL_SERVER_HOST), require_trusted=True, verbose=True): | ||
self.parsed_url = urllib2.urlparse.urlparse(host) | ||
self.url = "%s://%s" % (self.parsed_url.scheme, self.parsed_url.netloc) | ||
def __init__(self, host=None, require_trusted=True, verbose=True): | ||
|
||
if not host: | ||
if settings.CENTRAL_SERVER_URL: | ||
self.url = settings.CENTRAL_SERVER_URL | ||
else: | ||
self.url = "%s://%s/" % (settings.SECURESYNC_PROTOCOL, settings.CENTRAL_SERVER_HOST) | ||
else: | ||
parsed_url = urllib2.urlparse.urlparse(host) | ||
self.url = "%s://%s" % (self.parsed_url.scheme, self.parsed_url.netloc) | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not sure why the latter used to call
|
||
self.require_trusted = require_trusted | ||
self.verbose = verbose | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -57,7 +57,7 @@ def register_device(request): | |
# that what should be proper exception namespacing in code being called isn't correctly catching this exception | ||
msg = "\n\n".join([request.body, client_device._hashable_representation(), "Exception: %s" % e, str(type(e)), client_device.signed_by_id, client_device.id, str(request)]) | ||
send_mail("Exception while verifying client device", msg, "[email protected]", ["[email protected]"]) | ||
return JsonResponseMessageError("Client device must be self-signed with a signature matching its own public key!", code=EC.CLIENT_DEVICE_INVALID_SIGNATURE) | ||
return JsonResponseMessageError("Client device must be self-signed with a signature matching its own public key.", code=EC.CLIENT_DEVICE_INVALID_SIGNATURE) | ||
|
||
try: | ||
zone = register_self_registered_device(client_device, models, data) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -61,7 +61,7 @@ def handle(self, *args, **options): | |
csrftoken = s.cookies['csrftoken_central'] | ||
login_data = dict(username=options["username"], password=options["password"], csrfmiddlewaretoken=csrftoken, next='/') | ||
r = s.post(login_url, data=login_data, headers={"Referer": login_url}) | ||
assert r.status_code == 200, "Error logging into central server: " + r.content | ||
assert r.status_code == 200 and "Incorrect user" not in r.content, "Error logging into central server: " + r.content | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The change looks like a desired precision from the commit msg: 34a27be |
||
|
||
# register on the central server | ||
reg_url = client.get_registration_url() | ||
|
@@ -80,5 +80,3 @@ def handle(self, *args, **options): | |
own_device = Device.get_own_device() | ||
assert own_device.is_registered(), "Device was not registered successfully..." | ||
sys.stdout.write("Device '%s' has been successfully registered to zone '%s'!\n" % (own_device.id, own_device.get_zone().id)) | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needs to be configurable and only switched on in the central server.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, this might actually be harmless to the rest of the KA Lite application, wouldn't you think so @rtibbles ?