Skip to content

Commit

Permalink
Changes necessary for noTLS
Browse files Browse the repository at this point in the history
  • Loading branch information
ineiti committed Oct 2, 2023
1 parent f2ac57a commit 72e2109
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 7 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module github.com/c4dt/d-voting
go 1.19

require (
github.com/c4dt/dela v0.0.0-20230928144925-791c0000a6ef
github.com/c4dt/dela v0.0.0-20230929152556-a801764677f2
github.com/c4dt/dela-apps v0.0.0-20230929051236-6d89286321f7
github.com/gorilla/mux v1.8.0
github.com/opentracing/opentracing-go v1.2.0
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM=
github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw=
github.com/c4dt/dela v0.0.0-20230928144925-791c0000a6ef h1:PQV091ZRql4R8JHMwAq+WCG8sSjCykSxK5qwHe24vEM=
github.com/c4dt/dela v0.0.0-20230928144925-791c0000a6ef/go.mod h1:rtOjXdQKOeIyByN4c+j698FqdKBhAk6C2u8cc/Wf3JY=
github.com/c4dt/dela v0.0.0-20230929152556-a801764677f2 h1:hXpyJw1UVpUOv43dJzDBXCxWOPdviXjhlNm5Fv2scfk=
github.com/c4dt/dela v0.0.0-20230929152556-a801764677f2/go.mod h1:rtOjXdQKOeIyByN4c+j698FqdKBhAk6C2u8cc/Wf3JY=
github.com/c4dt/dela-apps v0.0.0-20230929051236-6d89286321f7 h1:cnB6P4hA69xh/guriaKK6gufWvimA4CBkNSAbecDPyU=
github.com/c4dt/dela-apps v0.0.0-20230929051236-6d89286321f7/go.mod h1:hlRTMsRvi8hYWrxZehAmDcyulnH2IssPFY1a/u5xVzE=
github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
Expand Down
8 changes: 4 additions & 4 deletions scripts/local_proxies.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ SCRIPT_DIR=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &>/dev/null && pwd)

echo "adding proxies"

for node in $( seq 0 3 ); do
NodeAddr="localhost:$(( 2000 + node * 2))"
ProxyAddr="http://localhost:$(( 2001 + node * 2))"
echo -n "Adding proxy for node $(( node + 1)): "
for node in $(seq 0 3); do
NodeAddr="grpc://localhost:$((2000 + node * 2))"
ProxyAddr="http://localhost:$((2001 + node * 2))"
echo -n "Adding proxy for node $((node + 1)): "
curl -sk "$FRONTEND_URL/api/proxies/" -X POST -H 'Content-Type: application/json' -b cookies.txt \
--data-raw "{\"NodeAddr\":\"$NodeAddr\",\"Proxy\":\"$ProxyAddr\"}"
echo
Expand Down
5 changes: 3 additions & 2 deletions scripts/run_local.sh
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ function init_nodes() {
mkdir -p $NODEDIR
rm -f $NODEDIR/node.log
dvoting --config $NODEDIR start --postinstall --proxyaddr :$PROXYPORT --proxykey $PUBLIC_KEY \
--listen tcp://0.0.0.0:$NODEPORT --public http://localhost:$NODEPORT --routing tree |
--listen tcp://0.0.0.0:$NODEPORT --public grpc://localhost:$NODEPORT --routing tree --noTLS |
ts "Node-$n: " | tee $NODEDIR/node.log &
done

Expand All @@ -92,7 +92,7 @@ function init_dela() {
for n in $(seq 2 4); do
TOKEN_ARGS=$(dvoting --config ./nodes/node-1 minogrpc token)
NODEDIR=./nodes/node-$n
dvoting --config $NODEDIR minogrpc join --address //localhost:2000 $TOKEN_ARGS
dvoting --config $NODEDIR minogrpc join --address grpc://localhost:2000 $TOKEN_ARGS
done

echo " Create a new chain with the nodes"
Expand Down Expand Up @@ -177,6 +177,7 @@ clean)
kill_nodes
kill_backend
kill_db
rm -f bin/*
exit
;;

Expand Down
1 change: 1 addition & 0 deletions web/backend/src/controllers/authentication.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ authenticationRouter.get('/control_key', (req, res) => {
authenticationRouter.post('/logout', (req, res) => {
if (req.session.userId === undefined) {
res.status(400).send('not logged in');
return;
}

const { userId } = req.session;
Expand Down

0 comments on commit 72e2109

Please sign in to comment.