Skip to content

Commit

Permalink
put CHAIN_REGISTRY_INI_URL into env.sh (#339)
Browse files Browse the repository at this point in the history
  • Loading branch information
baabeetaa authored May 27, 2023
1 parent 1112d48 commit 93b9c2e
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 0 deletions.
1 change: 1 addition & 0 deletions load_balancer/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ pacman -S --noconfirm base-devel jq dnsutils python caddy screen wget cronie

# write env vars to bash file, so that cronjobs or other scripts could know
cat <<EOT >> $HOME/env.sh
CHAIN_REGISTRY_INI_URL="$CHAIN_REGISTRY_INI_URL"
CONFIG_FILE="/etc/caddy/Caddyfile"
TMP_CONFIG_FILE="/etc/caddy/Caddyfile.tmp"
rpc_service_name="$rpc_service_name"
Expand Down
5 changes: 5 additions & 0 deletions proxy/generate_upstream.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
if [[ -z "$CHAIN_REGISTRY_INI_URL" ]]; then
echo "no env var CHAIN_REGISTRY_INI_URL. Make sure put it into \$HOME/env.sh"
exit
fi

SERVICES=$(curl -s "$CHAIN_REGISTRY_INI_URL" |grep -E "\[.*\]" | sed 's/^\[\(.*\)\]$/\1/')


Expand Down
7 changes: 7 additions & 0 deletions proxy/run.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
pacman -Syu --noconfirm
pacman -S --noconfirm base-devel dnsutils nginx cronie

# write env vars to bash file, so that cronjobs or other scripts could know
cat <<EOT >> $HOME/env.sh
CHAIN_REGISTRY_INI_URL="$CHAIN_REGISTRY_INI_URL"
EOT

########################################################################################################################
# nginx

Expand Down Expand Up @@ -33,6 +38,7 @@ cat <<EOT > /usr/share/nginx/html/index.html
EOT

########################################################################################################################
source $HOME/env.sh

# generate config for the first time
curl -Ls "https://raw.githubusercontent.com/notional-labs/cosmosia/main/proxy/generate_upstream.sh" > $HOME/generate_upstream.sh
Expand All @@ -49,6 +55,7 @@ sleep 1
########################################################################################################################
# cron
cat <<'EOT' > $HOME/cron_update_upstream.sh
source $HOME/env.sh
source $HOME/generate_upstream.sh
sleep 1
Expand Down
8 changes: 8 additions & 0 deletions proxy_internal/run.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
pacman -Syu --noconfirm
pacman -S --noconfirm base-devel wget dnsutils nginx cronie screen logrotate

# write env vars to bash file, so that cronjobs or other scripts could know
cat <<EOT >> $HOME/env.sh
CHAIN_REGISTRY_INI_URL="$CHAIN_REGISTRY_INI_URL"
EOT

source $HOME/env.sh

########################################################################################################################
# SSL for notional.ventures (fullchain.pem and privkey.pem files)
wget "http://tasks.web_config/config/fullchain.pem" -O /etc/nginx/fullchain.pem
Expand Down Expand Up @@ -244,6 +251,7 @@ echo "0 0 * * * root logrotate /etc/logrotate.d/nginx" > /etc/cron.d/cron_logrot
########################################################################################################################
# cron
cat <<'EOT' > $HOME/cron_update_upstream.sh
source $HOME/env.sh
source $HOME/generate_upstream.sh
sleep 1
Expand Down
6 changes: 6 additions & 0 deletions proxy_public/run.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
pacman -Syu --noconfirm
pacman -S --noconfirm base-devel wget dnsutils nginx cronie screen

# write env vars to bash file, so that cronjobs or other scripts could know
cat <<EOT >> $HOME/env.sh
CHAIN_REGISTRY_INI_URL="$CHAIN_REGISTRY_INI_URL"
EOT

########################################################################################################################
# SSL for notional.ventures (fullchain.pem and privkey.pem files)
# tar -xvf "/run/secrets/ssl_notional.ventures.tar.gz" -C /etc/nginx/
Expand Down Expand Up @@ -56,6 +61,7 @@ screen -S nginx -dm /usr/sbin/nginx -g "daemon off;"
########################################################################################################################
# cron
cat <<'EOT' > $HOME/cron_update_upstream.sh
source $HOME/env.sh
source $HOME/generate_upstream.sh
sleep 1
Expand Down

0 comments on commit 93b9c2e

Please sign in to comment.