Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
ruanhaishen
Acme.Sh
Commits
5e465a29
Commit
5e465a29
authored
Apr 15, 2022
by
DerVerruckteFuchs
Browse files
Update 1984 Hosting's URL
parent
c8c1c091
Changes
1
Show whitespace changes
Inline
Side-by-side
dnsapi/dns_1984hosting.sh
View file @
5e465a29
...
@@ -42,7 +42,7 @@ dns_1984hosting_add() {
...
@@ -42,7 +42,7 @@ dns_1984hosting_add() {
_debug
"Add TXT record
$fulldomain
with value '
$txtvalue
'"
_debug
"Add TXT record
$fulldomain
with value '
$txtvalue
'"
value
=
"
$(
printf
'%s'
"
$txtvalue
"
| _url_encode
)
"
value
=
"
$(
printf
'%s'
"
$txtvalue
"
| _url_encode
)
"
url
=
"https://
management.
1984hosting
.com
/domains/entry/"
url
=
"https://1984
.
hosting/domains/entry/"
postdata
=
"entry=new"
postdata
=
"entry=new"
postdata
=
"
$postdata
&type=TXT"
postdata
=
"
$postdata
&type=TXT"
...
@@ -95,7 +95,7 @@ dns_1984hosting_rm() {
...
@@ -95,7 +95,7 @@ dns_1984hosting_rm() {
_debug _domain
"
$_domain
"
_debug _domain
"
$_domain
"
_debug
"Delete
$fulldomain
TXT record"
_debug
"Delete
$fulldomain
TXT record"
url
=
"https://
management.
1984hosting
.com
/domains"
url
=
"https://1984
.
hosting/domains"
if
!
_get_zone_id
"
$url
"
"
$_domain
"
;
then
if
!
_get_zone_id
"
$url
"
"
$_domain
"
;
then
_err
"invalid zone"
"
$_domain
"
_err
"invalid zone"
"
$_domain
"
return
1
return
1
...
@@ -138,7 +138,7 @@ _1984hosting_login() {
...
@@ -138,7 +138,7 @@ _1984hosting_login() {
_debug
"Login to 1984Hosting as user
$One984HOSTING_Username
"
_debug
"Login to 1984Hosting as user
$One984HOSTING_Username
"
username
=
$(
printf
'%s'
"
$One984HOSTING_Username
"
| _url_encode
)
username
=
$(
printf
'%s'
"
$One984HOSTING_Username
"
| _url_encode
)
password
=
$(
printf
'%s'
"
$One984HOSTING_Password
"
| _url_encode
)
password
=
$(
printf
'%s'
"
$One984HOSTING_Password
"
| _url_encode
)
url
=
"https://
management.
1984hosting
.com
/accounts/checkuserauth/"
url
=
"https://1984
.
hosting/accounts/checkuserauth/"
response
=
"
$(
_post
"username=
$username
&password=
$password
&otpkey="
$url
)
"
response
=
"
$(
_post
"username=
$username
&password=
$password
&otpkey="
$url
)
"
response
=
"
$(
echo
"
$response
"
| _normalizeJson
)
"
response
=
"
$(
echo
"
$response
"
| _normalizeJson
)
"
...
@@ -175,7 +175,7 @@ _check_cookies() {
...
@@ -175,7 +175,7 @@ _check_cookies() {
return
1
return
1
fi
fi
_authget
"https://
management.
1984hosting
.com
/accounts/loginstatus/"
_authget
"https://1984
.
hosting/accounts/loginstatus/"
if
_contains
"
$response
"
'"ok": true'
;
then
if
_contains
"
$response
"
'"ok": true'
;
then
_debug
"Cached cookies still valid"
_debug
"Cached cookies still valid"
return
0
return
0
...
@@ -204,7 +204,7 @@ _get_root() {
...
@@ -204,7 +204,7 @@ _get_root() {
return
1
return
1
fi
fi
_authget
"https://
management.
1984hosting
.com
/domains/soacheck/?zone=
$h
&nameserver=ns0.1984.is."
_authget
"https://1984
.
hosting/domains/soacheck/?zone=
$h
&nameserver=ns0.1984.is."
if
_contains
"
$_response
"
"serial"
&&
!
_contains
"
$_response
"
"null"
;
then
if
_contains
"
$_response
"
"serial"
&&
!
_contains
"
$_response
"
"null"
;
then
_sub_domain
=
$(
printf
"%s"
"
$domain
"
|
cut
-d
.
-f
1-
$p
)
_sub_domain
=
$(
printf
"%s"
"
$domain
"
|
cut
-d
.
-f
1-
$p
)
_domain
=
"
$h
"
_domain
=
"
$h
"
...
@@ -251,11 +251,11 @@ _htmlget() {
...
@@ -251,11 +251,11 @@ _htmlget() {
# add extra headers to request
# add extra headers to request
_authpost
()
{
_authpost
()
{
url
=
"https://
management.
1984hosting
.com
/domains"
url
=
"https://1984
.
hosting/domains"
_get_zone_id
"
$url
"
"
$_domain
"
_get_zone_id
"
$url
"
"
$_domain
"
csrf_header
=
"
$(
echo
"
$One984HOSTING_CSRFTOKEN_COOKIE
"
| _egrep_o
"=[^=][0-9a-zA-Z]*"
|
tr
-d
"="
)
"
csrf_header
=
"
$(
echo
"
$One984HOSTING_CSRFTOKEN_COOKIE
"
| _egrep_o
"=[^=][0-9a-zA-Z]*"
|
tr
-d
"="
)
"
export
_H1
=
"Cookie:
$One984HOSTING_CSRFTOKEN_COOKIE
;
$One984HOSTING_SESSIONID_COOKIE
"
export
_H1
=
"Cookie:
$One984HOSTING_CSRFTOKEN_COOKIE
;
$One984HOSTING_SESSIONID_COOKIE
"
export
_H2
=
"Referer: https://
management.
1984hosting
.com
/domains/
$_zone_id
"
export
_H2
=
"Referer: https://1984
.
hosting/domains/
$_zone_id
"
export
_H3
=
"X-CSRFToken:
$csrf_header
"
export
_H3
=
"X-CSRFToken:
$csrf_header
"
_response
=
$(
_post
"
$1
"
"
$2
"
)
_response
=
$(
_post
"
$1
"
"
$2
"
)
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment