forked from tee-he-he/err_err_ttyl
-
Notifications
You must be signed in to change notification settings - Fork 0
/
run.sh
52 lines (40 loc) · 1.32 KB
/
run.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#set -x
set -e
export TWEET_PROMPT_TEMPLATE=$(curl $TWEET_PROMPT_TEMPLATE_URL)
# Encumber the account by resetting the password
export PROTONMAIL_PASSWORD=$(python3 scripts/protonmail.py)
export TWITTER_PASSWORD=$(python3 scripts/twitter.py)
# pushd client
# RUST_LOG=info cargo run --release --bin encumber
# . temp.env
# export X_PASSWORD EMAIL_PASSWORD X_AUTH_TOKENS
# echo X_PASSWORD $X_PASSWORD
# echo EMAIL_PASSWORD $EMAIL_PASSWORD
# echo X_AUTH_TOKENS $X_AUTH_TOKENS
# popd
# The argument report_data accepts binary data encoding in hex string.
# The actual report_data passing the to the underlying TDX driver is sha2_256(report_data).
PAYLOAD="{\"report_data\": \"$(echo -n $TWITTER_ACCOUNT | od -A n -t x1 | tr -d ' \n')\"}"
curl -X POST --unix-socket /var/run/tappd.sock -d "$PAYLOAD" http://localhost/prpc/Tappd.TdxQuote?json | jq .
# Start the oauth client to receive the callback
pushd client
RUST_LOG=info cargo run --release --bin helper &
SERVER=$!
popd
# Do the twitter login
python3 scripts/tee.py
. cookies.env
export X_AUTH_TOKENS
wait $SERVER
# Start the time release server
bash timerelease.sh &
# Update the environment variables
. client/updated.env
export X_ACCESS_TOKEN X_ACCESS_TOKEN_SECRET
pushd client
RUST_LOG=info cargo run --release --bin helper &
popd
# Run the nous
pushd agent
python3 run_pipeline.py
popd