Skip to content

Commit

Permalink
Merge pull request #60 from skalenetwork/remove-network-ui
Browse files Browse the repository at this point in the history
Remove server_name variable from the proxy
  • Loading branch information
dmytrotkk authored Feb 5, 2024
2 parents 1a5b1c9 + d94137e commit 5c9c392
Show file tree
Hide file tree
Showing 6 changed files with 5 additions and 12 deletions.
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ JSON-RPC endpoints for SKALE chains. It is based on NGINX.
#### Required environment variables

- `ENDPOINT` - endpoint of the Ethereum network where `skale-manager` contracts are deployed
- `SERVER_NAME` - domain name of the server

## License

Expand Down
1 change: 0 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ version: '3'
services:
skale-proxy:
environment:
SERVER_NAME: ${SERVER_NAME}
ETH_ENDPOINT: ${ETH_ENDPOINT}
image: skale-proxy:latest
container_name: proxy_admin
Expand Down
2 changes: 0 additions & 2 deletions proxy/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,6 @@
TMP_CHAINS_FOLDER = os.path.join(PROJECT_PATH, 'conf', 'tmp_chains')
TMP_UPSTREAMS_FOLDER = os.path.join(PROJECT_PATH, 'conf', 'tmp_upstreams')

SERVER_NAME = os.environ['SERVER_NAME']

PROXY_LOG_FORMAT = '[%(asctime)s] %(process)d %(levelname)s %(module)s: %(message)s'
LONG_LINE = '=' * 100

Expand Down
5 changes: 2 additions & 3 deletions proxy/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
from proxy.helper import init_default_logger, write_json
from proxy.str_formatters import arguments_list_string
from proxy.config import (
CHAINS_INFO_FILEPATH, MONITOR_INTERVAL, ENDPOINT, SM_ABI_FILEPATH, SERVER_NAME,
CHAINS_INFO_FILEPATH, MONITOR_INTERVAL, ENDPOINT, SM_ABI_FILEPATH,
TMP_CHAINS_FOLDER, TMP_UPSTREAMS_FOLDER
)

Expand All @@ -37,8 +37,7 @@
def main():
init_default_logger()
logger.info(arguments_list_string({
'Endpoint': ENDPOINT,
'Server name': SERVER_NAME
'Endpoint': ENDPOINT
}, 'Starting SKALE Proxy server'))

Path(TMP_CHAINS_FOLDER).mkdir(parents=True, exist_ok=True)
Expand Down
7 changes: 3 additions & 4 deletions proxy/nginx.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

from proxy.helper import process_template
from proxy.config import (
SCHAIN_NGINX_TEMPLATE, UPSTREAM_NGINX_TEMPLATE, CHAINS_FOLDER, UPSTREAMS_FOLDER, SERVER_NAME,
SCHAIN_NGINX_TEMPLATE, UPSTREAM_NGINX_TEMPLATE, CHAINS_FOLDER, UPSTREAMS_FOLDER,
NGINX_CONTAINER_NAME, CONTAINER_RUNNING_STATUS, TMP_CHAINS_FOLDER, TMP_UPSTREAMS_FOLDER
)

Expand Down Expand Up @@ -84,13 +84,12 @@ def generate_nginx_configs(schains_endpoints: list) -> None:
if not schain_endpoints:
continue
logger.info(f'Processing template for {schain_endpoints["chain_info"]["schain_name"]}...')
process_nginx_config_template(schain_endpoints['chain_info'], SERVER_NAME)
process_nginx_config_template(schain_endpoints['chain_info'])


def process_nginx_config_template(chain_info: dict, server_name: str) -> None:
def process_nginx_config_template(chain_info: dict) -> None:
chain_dest = os.path.join(TMP_CHAINS_FOLDER, f'{chain_info["schain_name"]}.conf')
upstream_dest = os.path.join(TMP_UPSTREAMS_FOLDER, f'{chain_info["schain_name"]}.conf')
chain_info['server_name'] = server_name
process_template(SCHAIN_NGINX_TEMPLATE, chain_dest, chain_info)
process_template(UPSTREAM_NGINX_TEMPLATE, upstream_dest, chain_info)

Expand Down
1 change: 0 additions & 1 deletion scripts/run_proxy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ set -e
export DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"

: "${ENDPOINT?Need to set ENDPOINT}"
: "${SERVER_NAME?Need to set SERVER_NAME}"

cd $DIR/..
docker-compose up --build -d

0 comments on commit 5c9c392

Please sign in to comment.