mirror of
https://github.com/aljazceru/cyphernode.git
synced 2026-01-09 07:56:03 +01:00
More TOR configurations
This commit is contained in:
@@ -249,7 +249,7 @@ curl_callback() {
|
||||
|
||||
local returncode
|
||||
|
||||
notify_web "${1}" "${2}"
|
||||
notify_web "${1}" "${2}" ${TOR_ADDR_WATCH_WEBHOOKS}
|
||||
returncode=$?
|
||||
trace_rc ${returncode}
|
||||
|
||||
|
||||
@@ -115,7 +115,7 @@ curl_callback_txid() {
|
||||
|
||||
local returncode
|
||||
|
||||
notify_web "${1}" "${2}"
|
||||
notify_web "${1}" "${2}" ${TOR_TXID_WATCH_WEBHOOKS}
|
||||
returncode=$?
|
||||
trace_rc ${returncode}
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@ notify_web() {
|
||||
trace "Entering notify_web()..."
|
||||
|
||||
local url=${1}
|
||||
local torbypass=${3}
|
||||
|
||||
# Let's encode the body to base64 so we won't have to escape the special chars...
|
||||
local body=$(echo "${2}" | base64 | tr -d '\n')
|
||||
@@ -14,10 +15,17 @@ notify_web() {
|
||||
local response
|
||||
local http_code
|
||||
local curl_code
|
||||
local msg
|
||||
|
||||
if [ -n "${torbypass}" ]; then
|
||||
msg="{\"response-topic\":\"response/$$\",\"cmd\":\"web\",\"url\":\"${url}\",\"body\":\"${body}\",\"torbypass\":${torbypass}}"
|
||||
else
|
||||
msg="{\"response-topic\":\"response/$$\",\"cmd\":\"web\",\"url\":\"${url}\",\"body\":\"${body}\"}"
|
||||
fi
|
||||
|
||||
# We use the pid as the response-topic, so there's no conflict in responses.
|
||||
trace "[notify_web] mosquitto_rr -h broker -W 21 -t notifier -e \"response/$$\" -m \"{\"response-topic\":\"response/$$\",\"cmd\":\"web\",\"url\":\"${url}\",\"body\":\"${body}\"}\""
|
||||
response=$(mosquitto_rr -h broker -W 21 -t notifier -e "response/$$" -m "{\"response-topic\":\"response/$$\",\"cmd\":\"web\",\"url\":\"${url}\",\"body\":\"${body}\"}")
|
||||
trace "[notify_web] mosquitto_rr -h broker -W 21 -t notifier -e \"response/$$\" -m \"${msg}\""
|
||||
response=$(mosquitto_rr -h broker -W 21 -t notifier -e "response/$$" -m ${msg})
|
||||
returncode=$?
|
||||
trace_rc ${returncode}
|
||||
|
||||
|
||||
@@ -213,7 +213,7 @@ serve_ots_backoffice() {
|
||||
if [ -n ${url} ]; then
|
||||
trace "[serve_ots_backoffice] url is not empty, now trying to call it!"
|
||||
|
||||
notify_web "${url}"
|
||||
notify_web "${url}" ${TOR_OTS_WEBHOOKS}
|
||||
returncode=$?
|
||||
trace_rc ${returncode}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user