Skip to content

Commit

Permalink
fix: adapt tunnel usage to new ngrok version
Browse files Browse the repository at this point in the history
Ngrok now requires an account to create and use a tunnel. This change
accounts for this by adding some instructions and making it possible to
pass an authtoken to the ngrok container.

Signed-off-by: Daniel Bluhm <dbluhm@pm.me>
  • Loading branch information
dbluhm committed Apr 26, 2024
1 parent e6e754e commit afc9111
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
4 changes: 4 additions & 0 deletions oid4vci/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,16 @@ This repository showcases a simplified demonstration of the OID4VCI (OpenID for

- Sphereon Wallet App on your mobile device
- Docker + Docker Compose
- Ngrok Account (free tier is okay)

### Steps to Run the Demo

First, you'll have to get your authtoken from ngrok. Note this value down.

```shell
cd oid4vci/demo
docker compose build
echo "NGROK_AUTHTOKEN=<PASTE YOUR AUTHTOKEN HERE>" > .env
docker compose up
docker compose down -v # Clean up
```
Expand Down
2 changes: 2 additions & 0 deletions oid4vci/demo/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ services:
hostname: ngrok
ports:
- "4040:4040"
environment:
- NGROK_AUTHTOKEN=${NGROK_AUTHTOKEN}
command: ["http", "issuer:8081"]
healthcheck:
test: /bin/bash -c "</dev/tcp/ngrok/4040"
Expand Down
2 changes: 1 addition & 1 deletion oid4vci/docker/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ WAIT_ATTEMPTS=${WAIT_ATTEMPTS:-10}

liveliness_check () {
for CURRENT_ATTEMPT in $(seq 1 "$WAIT_ATTEMPTS"); do
if ! curl -s -o /dev/null -w '%{http_code}' "${1}/status" | grep "200" > /dev/null; then
if ! curl -s -o /dev/null -w '%{http_code}' "${1}/api/tunnels/command_line" | grep "200" > /dev/null; then
if [[ $CURRENT_ATTEMPT -gt $WAIT_ATTEMPTS ]]
then
echo "Failed while waiting for 200 status from ${1}"
Expand Down

0 comments on commit afc9111

Please sign in to comment.