Compare commits

...

No commits in common. "master" and "dev" have entirely different histories.
master ... dev

3 changed files with 86 additions and 81 deletions

79
.gitignore vendored
View File

@ -1,79 +0,0 @@
# ---> JetBrains
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
# User-specific stuff
.idea/**/workspace.xml
.idea/**/tasks.xml
.idea/**/usage.statistics.xml
.idea/**/dictionaries
.idea/**/shelf
# AWS User-specific
.idea/**/aws.xml
# Generated files
.idea/**/contentModel.xml
# Sensitive or high-churn files
.idea/**/dataSources/
.idea/**/dataSources.ids
.idea/**/dataSources.local.xml
.idea/**/sqlDataSources.xml
.idea/**/dynamic.xml
.idea/**/uiDesigner.xml
.idea/**/dbnavigator.xml
# Gradle
.idea/**/gradle.xml
.idea/**/libraries
# Gradle and Maven with auto-import
# When using Gradle or Maven with auto-import, you should exclude module files,
# since they will be recreated, and may cause churn. Uncomment if using
# auto-import.
# .idea/artifacts
# .idea/compiler.xml
# .idea/jarRepositories.xml
# .idea/modules.xml
# .idea/*.iml
# .idea/modules
# *.iml
# *.ipr
# CMake
cmake-build-*/
# Mongo Explorer plugin
.idea/**/mongoSettings.xml
# File-based project format
*.iws
# IntelliJ
out/
# mpeltonen/sbt-idea plugin
.idea_modules/
# JIRA plugin
atlassian-ide-plugin.xml
# Cursive Clojure plugin
.idea/replstate.xml
# SonarLint plugin
.idea/sonarlint/
# Crashlytics plugin (for Android Studio and IntelliJ)
com_crashlytics_export_strings.xml
crashlytics.properties
crashlytics-build.properties
fabric.properties
# Editor-based Rest Client
.idea/httpRequests
# Android studio 3.1+ serialized cache file
.idea/caches/build_file_checksums.ser

View File

@ -1,2 +0,0 @@
# acme_dnsapi_admtools

86
dns_admtools.sh Normal file
View File

@ -0,0 +1,86 @@
#!/usr/bin/env sh
## DNSAPI for Acme.sh to work with Ukraine.com.ua (Adm.Tools) API.
## Author: Ivor 'lopar' Barhansky <me@lopar.space>
##
## API Authorization works using Bearer token.
## Required variable:
## AT_TOKEN="t8zpe56g8kj8qy8etx6vgo6hokycdrwgw34hufounf97uv4mvo5d8vpy5zpqnw73"
# https://github.com/acmesh-official/acme.sh/wiki/DNS-API-Dev-Guide
# https://github.com/acmesh-official/acme.sh/blob/master/dnsapi/dns_bunny.sh
# postman
######## Public functions #####################
## Create the text record for validation.
## Usage: add _acme-challenge.www.domain.com "XKrxpRBosdIKFzxW_CT3KLZNf6q0HG9i01zxXp5CPBs"
dns_ukrainecomua_add() {
fulldomain=$1
txtvalue=$2
AT_TOKEN="${AT_TOKEN:-$(_readaccountconf_mutable AT_TOKEN)}"
if [ -z "$AT_TOKEN" ]; then
AT_TOKEN=""
_err "You don't specify Adm.Tools API token yet."
_err "How to get Api Token: https://www.ukraine.com.ua/wiki/account/api/"
return 1
fi
_info "Adm.Tools (Ukraine.com.ua) dns validation - add txt record"
_debug fulldomain "$fulldomain"
_debug txtvalue "$txtvalue"
#save the credentials to the account conf file.
_saveaccountconf_mutable AT_TOKEN "$AT_TOKEN"
#Headers
export _H1="Accept: application/json"
export _H2="Authorization: Bearer $AT_TOKEN"
export _H3="Content-Type: application/json"
POSTURL="https://adm.tools/action/dns/record_add/"
POSTBODY='{"domain_id":'$_domain_id',"type":"'TXT'","record":"'_acme-challenge'","data":"'$txtvalue'"}'
_debug POSTURL "$POSTURL"
_debug POSTBODY "$POSTBODY"
response="$(_post "$POSTBODY" "$POSTURL")"
# $post = [
# 'domain_id' => 1348160,
# 'type' => 'TXT',
# 'record' => 'qwester',
# 'priority' => 0,
# 'data' => 'honkeyt-ponkeyt',
#
}
dns_ukrainecomua_rm() {
fulldomain=$1
txtvalue=$2
AT_TOKEN="${AT_TOKEN:-$(_readaccountconf_mutable AT_TOKEN)}"
if [ -z "$AT_TOKEN" ]; then
AT_TOKEN=""
_err "You don't specify Adm.Tools API token yet."
_err "How to get Api Token: https://www.ukraine.com.ua/wiki/account/api/"
return 1
fi
_info "Adm.Tools (Ukraine.com.ua) dns validation - remove txt record"
_debug fulldomain "$fulldomain"
_debug txtvalue "$txtvalue"
#Headers
export _H1="Accept: application/json"
export _H2="Authorization: Bearer $AT_TOKEN"
export _H3="Content-Type: application/json"
POSTURL="https://adm.tools/action/dns/record_delete/"
POSTBODY='{"subdomain_id":'$_subdomain_id'}'
_debug POSTURL "$POSTURL"
_debug POSTBODY "$POSTBODY"
}
#################### Private functions below ##################################