From bba5649d4367e4b41042cab5bd3d3ee7dc5ce0c1 Mon Sep 17 00:00:00 2001 From: Midov Date: Sat, 20 Aug 2022 12:48:02 +0200 Subject: [PATCH] more variables --- do-register.sh | 18 ++++++++++++------ registerform.sh | 4 +++- 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/do-register.sh b/do-register.sh index 5b2c25c..0dbe198 100755 --- a/do-register.sh +++ b/do-register.sh @@ -1,4 +1,9 @@ #!/bin/bash +captchouliurl=http://mugi.midov.pl +elementurl=https://matrix.midov.pl +registrationurl=https://midov.pl +synapse_admin_api=http://yoshika.midov.pl:8008 + registered() { echo "Content-type: text/html" @@ -14,9 +19,9 @@ registered() { echo "
" if [[ $regstatus == 0 ]] then - echo "Go to Login" + echo "Go to Login" else - echo "Go back" + echo "Go back" fi echo "" @@ -34,7 +39,7 @@ registerfailed() { echo "
" echo "You need to know the animu girls better." echo "
" - echo "Go back" + echo "Go back" echo "
" echo "" echo "" @@ -51,7 +56,7 @@ passwordsdonotmatch() { echo "
" echo "Passwords do not match." echo "
" - echo "Go back" + echo "Go back" echo "
" echo "" echo "" @@ -65,19 +70,20 @@ rawurldecode() { } checkcaptchouli() { - curl --silent -XPOST --data "captchouli-id=$1" http://mugi.midov.pl/status + curl --silent -XPOST --data "captchouli-id=$1" "$captchouliurl/status" } registerscript() { # contains the secret variable with the shared secret thing for synapse source ~/.secret # script from synapse.. should have curled the api but i did not want to deal with the nonces - ~/register_new_matrix_user.py -u "$login" -p "$password" --no-admin -k "$secret" http://yoshika.midov.pl:8008 + ~/register_new_matrix_user.py -u "$login" -p "$password" --no-admin -k "$secret" "$synapse_admin_api" regstatus=$? unset secret } +# receive post data data=$(cat) id=$(rawurldecode "$(echo "$data" | cut -d '=' -f 5)") login=$(rawurldecode "$(echo "$data" | cut -d '=' -f 2 | cut -d '&' -f 1)") diff --git a/registerform.sh b/registerform.sh index dba26c8..8074165 100755 --- a/registerform.sh +++ b/registerform.sh @@ -1,7 +1,8 @@ #!/bin/bash +captchouliurl=http://mugi.midov.pl sendcaptchashort() { - curl --silent -XPOST http://mugi.midov.pl -H "$HTTP_CONTENT_TYPE" -d "$1" > /dev/null + curl --silent -XPOST "$captchouliurl" -H "$HTTP_CONTENT_TYPE" -d "$1" > /dev/null } @@ -38,6 +39,7 @@ data=$(cat) id=$(echo "$data" | cut -d '=' -f 2 | cut -d '&' -f 1) registrationpage +# sends the captcha id to capthouli so it knows it was solved sendcaptchashort "$data"