-
-
Notifications
You must be signed in to change notification settings - Fork 5.1k
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
All inkl kasserver dns script #1341
All inkl kasserver dns script #1341
Conversation
Is this api free? Thanks. |
There is a function |
please fix the CI errors. |
dnsapi/dns_kas.sh
Outdated
_info "Adding or Updating $_full_domain DNS TXT entry on All-inkl/Kasserver" | ||
|
||
_check_and_save | ||
_get_zone "$_full_domain" |
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.
check the return value of these function calls.
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.
@Neilpang you mean all of the functions need a return value (i.e. successful: return 0), or?
dnsapi/dns_kas.sh
Outdated
params="$params&var5=zone_host" | ||
params="$params&wert5=$_zone" | ||
else # Update the existing record | ||
_info "Updating existing TXT DNS record" |
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.
Never use updating, just adding.
#1261
dnsapi/dns_kas.sh
Outdated
response="$(_get "$KAS_Api$params")" | ||
_debug2 "response" "$response" | ||
|
||
_record_id="$(echo "$response" | grep -A 4 "$_record_name" | grep "record_id" | cut -f2 -d">" | xargs)" |
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.
do not use grep -A
and xargs
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.
@Neilpang I think without using grep -A
I can not do it actually. To me this seems to be the only most possible sane solution here, since what I get back is some HTML chunk with some plaintext array at the end, see example: https://gist.github.com/anonymous/eec9b149ab4b5ab8c30541a15e587d80
They also offer a WSDL
https://kasapi.kasserver.com/dokumentation/?open=quellcode endpoint that can be accessed via SOAP
and I think there I would get XML
back, but I have no clue how to do this without using curl
actually.
If you have an idea on how to solve this, let me know. thanks!
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.
no, we have removed a lot of grep -A
before.
show me your $response
, and what you want to grep.
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.
Hi @Neilpang see the example gist above. We need to grep for the record name
(in this case _acme-challenge.test51
and then get out the appropriate record_id
) I post the example here again:
....
<td align='right'>
10 <input name='var10' size='25' value=''>
</td>
<td>
<input name='wert10' size='25' value=''>
</td>
</tr>
<tr>
<th colspan="2">
<a target="_blank" href="/dokumentation/?open=quellcode">
Beispiel Quellcode ansehen
</a>
</th>
</tr>
<tr>
<th colspan="2" align="right">
Felder:
<input size="2" name="anz_var" value="10" />
<input type="submit" />
</th>
</tr>
</table>
</form>
</div>
<div style="float:left;">
<div class="erfolg">
<b>ReturnString: </b>TRUE</br>
<b>ReturnInfo: </b><pre>Array
(
[0] => Array
(
[record_zone] => example.com
[record_name] =>
[record_type] => NS
[record_data] => ns6.kasserver.com.
[record_aux] => 0
[record_id] => 0
[record_changeable] => N
)
[1] => Array
(
[record_zone] => example.com
[record_name] => *
[record_type] => A
[record_data] => 85.13.yyy.xx
[record_aux] => 0
[record_id] => 0
[record_changeable] => N
)
[2] => Array
(
[record_zone] => example.com
[record_name] => _acme-challenge.test51
[record_type] => TXT
[record_data] => jU6yvYv2Y4rHk2uFNwjxH1gcHmU7DRp4wvjoR6TEfgI
[record_aux] => 0
[record_id] => 36986630
[record_changeable] => Y
)
)
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.
@Neilpang have you had already a chance to have a look at it? thanks!
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.
@guptamp, @Neilpang has a few requirements that I should need to add to this as you can see in this Thread. I'm waiting for the suggestions he has for parsing this "HTML" file properly and according to the acme.sh rules.
However my implementation is already working and you could in the meanwhile just use my fork: https://github.com/phlegx/acme.sh I'm using it already in production and I will try to keep it up to date should it fail at some point.
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.
sorry, for the delay. I was totally missing this PR.
This can grep the correct record id:
echo "$response" | tr -d "\n\r" | sed "s/=> Array/\n=> Array/g" | tr -d " " | tr '[]' '<>' | grep "=>_acme-challenge.test51<" | grep '>TXT<' | tr '<' '\n' | grep record_id | cut -d '>' -f 3
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.
Thanks @Neilpang! Also bit busy these days and need to see if I can have a look at this again in the next days. @dojo90 fyi! If you like and have time feel free to send me pull request!
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.
Actually I'm confused. As you (@Neilpang) write here
do not use
grep -A
andxargs
#1341 (comment)
you give us a solution which uses grep
🤔
So I think we can use the actual implementation (https://github.com/phlegx/acme.sh/blob/all-inkl-kasserver-dns-script/dnsapi/dns_kas.sh#L153) ?
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.
@dojo90
I mean don't use -A
option with grep
.
you can use simple grep
command.
5e821ce
to
32d7bd5
Compare
push I'd like to see this script in the production version. Unfortunately I'm not able to help concerning the points @Neilpang stated in his previous comments. |
@phlegx Can you allow creating issues on your fork https://github.com/phlegx/acme.sh? |
@King3R done! |
I'm also open for fixes and pull requests btw, to finally get this merged in the original project :-) |
I also hope that the PR will be merged with the original project. I can't help you because of my insufficient programming knowledge. :-( |
@phlegx please resolve the conflicts first. |
support to delete multiple entries
please fix CI errors first. |
Hi Neilpang, |
dnsapi/dns_kas.sh
Outdated
# TODO Get a list of all possible root zones and compare (Currently not possible via provider) | ||
# See: https://github.com/Neilpang/acme.sh/wiki/DNS-API-Dev-Guide | ||
_get_zone() { | ||
_zone=$(echo "$1" | rev | cut -d . -f1-2 | rev). |
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.
can you please not use rev
?
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.
@Marco4223 was fixing a few more things (thank you very much Marco) and also he replaced the rev
. For some reason the build is still failing. Could you please have a look and tell us what the issues still is since with this error Travis throws it is not clear to us what is missing. Thanks!
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.
Maybe the empty lines with spaces?
remove "rev" command fix "Error removing txt for domain:_acme-challenge.foo"
only bash needed
sorry for this commit. ;) Fix NewBeMistakes
This reverts commit 99c47dd.
tested and works now
…-record-name Update dns_kas.sh
fixing 4 Travis style
…-record-name Update dns_kas.sh
Removing spaces in empty lines
…-record-name delete spaces in empty lines
Hi Neilpang, |
dnsapi/dns_kas.sh
Outdated
params="$params&var5=zone_host" | ||
params="$params&wert5=$_zone" | ||
_debug2 "Wait for 10 seconds by default before calling KAS API." | ||
sleep 10 |
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.
please use our _sleep()
function instead.
sorry, but we have a dev guide, please read and check it https://github.com/Neilpang/acme.sh/wiki/DNS-API-Dev-Guide We need you to update your usage to the wiki and create a issue for future bug reporting. |
Hi Nail,
Updated.
Cheers
Marco
… Am 22.01.2020 um 15:37 schrieb neil ***@***.***>:
sorry, but we have a dev guide, please read and check it https://github.com/Neilpang/acme.sh/wiki/DNS-API-Dev-Guide
We need you to update your usage to the wiki and create a issue for future bug reporting.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
sleep 10 to _sleep 10
…-record-name Update dns_kas.sh
Hi Nail, |
resolve the conflicts first, please. |
Sorry, may be I’m blind. |
Hi @Neilpang
Added my script for German provider All-inkl. It all works fine. However I cannot support yet the Domains with double endings like
co.uk
since my provider does not offer to get all root zones, as you suggested here: https://github.com/Neilpang/acme.sh/wiki/DNS-API-Dev-GuideIn case I just missed it, If anyone finds a way to get all root zones here: http://kasapi.kasserver.com/dokumentation/phpdoc/packages/API%20Funktionen.html just let me know and I add.
Let me know what you think Neil, and in best case lets just merge it right away! ;-)
thanks
Martin