{"action":"opened","issue":{"url":"https://api.github.com/repos/joohoi/acme-dns/issues/45","repository_url":"https://api.github.com/repos/joohoi/acme-dns","labels_url":"https://api.github.com/repos/joohoi/acme-dns/issues/45/labels{/name}","comments_url":"https://api.github.com/repos/joohoi/acme-dns/issues/45/comments","events_url":"https://api.github.com/repos/joohoi/acme-dns/issues/45/events","html_url":"https://github.com/joohoi/acme-dns/issues/45","id":301415937,"number":45,"title":"Registration with allowfrom set does not work?","user":{"login":"MrBMT","id":6931281,"avatar_url":"https://avatars1.githubusercontent.com/u/6931281?v=4","gravatar_id":"","url":"https://api.github.com/users/MrBMT","html_url":"https://github.com/MrBMT","followers_url":"https://api.github.com/users/MrBMT/followers","following_url":"https://api.github.com/users/MrBMT/following{/other_user}","gists_url":"https://api.github.com/users/MrBMT/gists{/gist_id}","starred_url":"https://api.github.com/users/MrBMT/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MrBMT/subscriptions","organizations_url":"https://api.github.com/users/MrBMT/orgs","repos_url":"https://api.github.com/users/MrBMT/repos","events_url":"https://api.github.com/users/MrBMT/events{/privacy}","received_events_url":"https://api.github.com/users/MrBMT/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-03-01T14:05:17Z","updated_at":"2018-03-01T14:05:17Z","closed_at":null,"author_association":"NONE","body":"Unless I'm doing something really stupid here, I don't seem to be able to be able to update domains when allowfrom has been set during registration.\r\n\r\nI use `ip addr` to retrieve all the CIDR ranges assigned to my server, then register as follows:\r\n\r\n```\r\nroot@london ~ curl -s -X POST http://auth.mydnsdomain.co.uk:8080/register \\\r\n--data '{\"allowfrom\": [\"127.0.0.1/8\", \"::1/128\", \"139.XXX.XXX.153/24\", \"192.XXX.XXX.197/17\", \"2a01:XXXX::XXXX:XXXX:XXXX:923d/64\", \"fe80::XXXX:XXXX:XXXX:923d/64\"]}' | python -m json.tool\r\n{\r\n    \"allowfrom\": [\r\n        \"127.0.0.1/8\",\r\n        \"::1/128\",\r\n        \"139.XXX.XXX.153/24\",\r\n        \"192.XXX.XXX.197/17\",\r\n        \"2a01:XXXX::XXXX:XXXX:XXXX:923d/64\",\r\n        \"fe80::XXXX:XXXX:XXXX:923d/64\"\r\n    ],\r\n    \"fulldomain\": \"1937e870-d239-4cb2-99b2-d1979c2608e3.auth.mydnsdomain.co.uk\",\r\n    \"password\": \"54mt4yLIRJZIXiK161jZghvuIxFz09Tj1sZY_vpZ\",\r\n    \"subdomain\": \"1937d870-d239-4cb2-99b2-d1979q2608a3\",\r\n    \"username\": \"p0624f07-b4a7-4d61-8d28-4f7e63621952\"\r\n}\r\n```\r\n\r\n*Note: IP addresses have been partially replaced with XXX/XXXX, the real values however are used for the commands.*\r\n\r\nI then attempt to update that sub-domain:\r\n\r\n```\r\nroot@london ~ curl -s -X POST http://auth.mydnsdomain.co.uk:8080/update \\\r\n-H \"X-Api-User: p0624f07-b4a7-4d61-8d28-4f7e63621952\" \\\r\n-H \"X-Api-Key: 54mt4yLIRJZIXiK161jZghvuIxFz09Tj1sZY_vpZ\" \\\r\n--data '{\"subdomain\": \"1937d870-d239-4cb2-99b2-d1979q2608a3\", \"txt\": \"___validation_token_recieved_from_the_ca___\"}' | python -m json.tool\r\n{\r\n    \"error\": \"forbidden\"\r\n}\r\n```\r\n\r\nHowever the update fails. acme-dns displays the following:\r\n```\r\nDEBU[1269] Created new user                              user=p0624f07-b4a7-4d61-8d28-4f7e63621952\r\nERRO[1542] Update not allowed from IP                    error=ip_unauthorized\r\n```\r\n\r\nIf I register without seting allowfrom, everything works fine:\r\n\r\n```\r\ncurl -s -X POST http://auth.mydnsdomain.co.uk:8080/register | python -m json.tool\r\n{\r\n    \"allowfrom\": [],\r\n    \"fulldomain\": \"ad53ddb7-38ad-42fd-9d65-854769764df0.auth.mydnsdomain.co.uk\",\r\n    \"password\": \"rqSI-YHVf12jfw-FgkQzJrhyUJ_rU9E4_37WP_6h\",\r\n    \"subdomain\": \"ab53ddb7-38ad-42fd-9d65-854769764da0\",\r\n    \"username\": \"945b3pf0-cc24-4008-9c99-270b13534d4q\"\r\n}\r\n\r\ncurl -s -X POST http://auth.mydnsdomain.co.uk:8080/update \\\r\n-H \"X-Api-User: 945b3pf0-cc24-4008-9c99-270b13534d4q\" \\\r\n-H \"X-Api-Key: rqSI-YHVf12jfw-FgkQzJrhyUJ_rU9E4_37WP_6h\" \\\r\n--data '{\"subdomain\": \"ab53ddb7-38ad-42fd-9d65-854769764da0\", \"txt\": \"___validation_token_recieved_from_the_ca___\"}' | python -m json.tool\r\n{\r\n    \"txt\": \"___validation_token_recieved_from_the_ca___\"\r\n}\r\n```\r\n\r\nAm I missing something here, or is it broken?"}}
{"actor":{"display_login":"MrBMT"}}