Skip to content

Commit

Permalink
feat: improve namadillo docker image to include masp indexer url as e…
Browse files Browse the repository at this point in the history
…nv. var (#1158)
  • Loading branch information
Fraccaman authored Oct 3, 2024
1 parent e72d0f1 commit 48b7a49
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 4 deletions.
1 change: 1 addition & 0 deletions apps/namadillo/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ Example:
```toml
indexer_url = "http://localhost:5000"
rpc_url = "http://localhost:27657"
masp_indexer_url = "http://localhost:5001"
```

For more details on setting up your local environment for integration between the interface and the extension, see the [README.md](../../README.md) at the root of this repo.
Expand Down
2 changes: 1 addition & 1 deletion apps/namadillo/public/config.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Uncomment the following lines to define your default indexer and rpc urls
#indexer_url = ""
#rpc_url = ""

#masp_indexer_url = ""
1 change: 1 addition & 0 deletions docker/namadillo/.config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
# Rename this file to namadillo.config.toml (removing the initial dot) in order to copy it into the Docker container
#indexer_url = ""
#rpc_url = ""
#masp_indexer_url = ""
2 changes: 1 addition & 1 deletion docker/namadillo/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ WORKDIR /app

COPY --from=builder /app/apps/namadillo/dist /usr/share/nginx/html
COPY ./docker/namadillo/nginx.conf /etc/nginx/conf.d/default.conf
# COPY ./docker/namadillo/config.tom[l] /usr/share/nginx/html/config.toml

COPY --chmod=0755 ./docker/namadillo/bootstrap_config.sh /docker-entrypoint.d/bootstrap_config.sh

RUN chown nginx:nginx /docker-entrypoint.d/bootstrap_config.sh
10 changes: 8 additions & 2 deletions docker/namadillo/bootstrap_config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ if [ ! -f $CONFIG_PATH ]; then
if [[ -n $RPC_URL ]]; then
echo "rpc_url = \"${RPC_URL}\"" >> $CONFIG_PATH
fi
if [[ -n $MASP_INDEXER_URL ]]; then
echo "masp_indexer_url = \"${MASP_INDEXER_URL}\"" >> $CONFIG_PATH
fi
else
echo "Using configuration file at $CONFIG_PATH"
if [[ -n $INDEXER_URL ]]; then
Expand All @@ -21,5 +24,8 @@ else
if [[ -n $RPC_URL ]]; then
sed -r -i "s~#?rpc_url = .*~rpc_url = \"${RPC_URL}\"~g" $CONFIG_PATH
fi
cat $CONFIG_PATH
fi
if [[ -n $MASP_INDEXER_URL ]]; then
sed -r -i "s~#?masp_indexer_url = .*~masp_indexer_url = \"${MASP_INDEXER_URL}\"~g" $CONFIG_PATH
fi
fi
cat $CONFIG_PATH

1 comment on commit 48b7a49

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.