mirror of
https://github.com/aljazceru/cyphernode.git
synced 2026-02-10 06:44:38 +01:00
First draft of the pub/sub notifier
This commit is contained in:
@@ -13,6 +13,9 @@ WORKDIR ${HOME}
|
||||
COPY app/data/* ./
|
||||
COPY app/script/* ./
|
||||
COPY --from=cyphernode/clightning:v0.7.0-test /usr/local/bin/lightning-cli ./
|
||||
# COPY --from=eclipse-mosquitto:1.6 /usr/bin/mosquitto_sub ./
|
||||
# COPY --from=eclipse-mosquitto:1.6 /usr/bin/mosquitto_pub ./
|
||||
COPY --from=eclipse-mosquitto:1.6 /usr/bin/mosquitto_rr ./
|
||||
|
||||
RUN chmod +x startproxy.sh requesthandler.sh lightning-cli sqlmigrate*.sh waitanyinvoice.sh \
|
||||
&& chmod o+w . \
|
||||
|
||||
@@ -237,9 +237,12 @@ curl_callback() {
|
||||
local data=${2}
|
||||
local returncode
|
||||
|
||||
trace "[curl_callback] curl -w \"%{http_code}\" -H \"Content-Type: application/json\" -H \"X-Forwarded-Proto: https\" -d \"${data}\" ${url}"
|
||||
rc=$(curl -w "%{http_code}" -H "Content-Type: application/json" -H "X-Forwarded-Proto: https" -d "${data}" ${url})
|
||||
returncode=$?
|
||||
#trace "[curl_callback] curl -w \"%{http_code}\" -H \"Content-Type: application/json\" -H \"X-Forwarded-Proto: https\" -d \"${data}\" ${url}"
|
||||
#rc=$(curl -w "%{http_code}" -H "Content-Type: application/json" -H "X-Forwarded-Proto: https" -d "${data}" ${url})
|
||||
#returncode=$?
|
||||
trace "[curl_callback] mosquitto_rr -h broker -t notifier -e jefsio -m \"{\"response-topic\":\"jefsio\",\"cmd\":\"web\",\"url\":\"${url}\",\"body\":\"${data}\"}\""
|
||||
rc=$(./mosquitto_rr -h broker -t notifier -e jefsio -m "{\"response-topic\":\"jefsio\",\"cmd\":\"web\",\"url\":\"${url}\",\"body\":\"${data}\"}")
|
||||
rc=$(echo "${rc}" | jq ".http_code")
|
||||
trace "[curl_callback] HTTP return code=${rc}"
|
||||
trace_rc ${returncode}
|
||||
|
||||
|
||||
@@ -202,9 +202,12 @@ serve_ots_backoffice() {
|
||||
trace "[serve_ots_backoffice] url=${url}"
|
||||
|
||||
# Call back newly upgraded stamps
|
||||
trace "[serve_ots_backoffice] curl -s -o /dev/null -w \"%{http_code}\" -H \"X-Forwarded-Proto: https\" ${url}"
|
||||
rc=$(curl -s -o /dev/null -w "%{http_code}" -H "X-Forwarded-Proto: https" ${url})
|
||||
returncode=$?
|
||||
#trace "[serve_ots_backoffice] curl -s -o /dev/null -w \"%{http_code}\" -H \"X-Forwarded-Proto: https\" ${url}"
|
||||
#rc=$(curl -s -o /dev/null -w "%{http_code}" -H "X-Forwarded-Proto: https" ${url})
|
||||
#returncode=$?
|
||||
trace "[serve_ots_backoffice] mosquitto_rr -h broker -t notifier -e dhtsggs -m \"{\"response-topic\":\"dhtsggs\",\"cmd\":\"web\",\"url\":\"${url}\"}\""
|
||||
rc=$(./mosquitto_rr -h broker -t notifier -e dhtsggs -m "{\"response-topic\":\"dhtsggs\",\"cmd\":\"web\",\"url\":\"${url}\"}")
|
||||
rc=$(echo "${rc}" | jq ".http_code")
|
||||
trace_rc ${returncode}
|
||||
|
||||
# Even if curl executed ok, we need to make sure the http return code is also ok
|
||||
|
||||
Reference in New Issue
Block a user