Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

put CHAIN_REGISTRY_INI_URL into env.sh #339

Merged
merged 1 commit into from
May 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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