Skip to content

Commit

Permalink
added transition_port to cumulus.endpoint template & transition nginx…
Browse files Browse the repository at this point in the history
… settings to install_nginx
  • Loading branch information
Catopish committed Nov 4, 2024
1 parent 74215d2 commit f1cad68
Show file tree
Hide file tree
Showing 8 changed files with 35 additions and 1 deletion.
1 change: 1 addition & 0 deletions host_vars/rpc-asset-hub-polkadot-01.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ zabbix_ext_port: 10611
default_bootnode_domain: "{{ default_network }}.boot.rotko.net"
transition_bootnode_domain: "mint14.rotko.net"
transition_bootnode_p2p_port: "33613"
transition_bootnode_p2p_port_ws: "34613"
transition_bootnode_p2p_port_wss: "35613"

default_p2p_port: 31011
Expand Down
1 change: 1 addition & 0 deletions host_vars/rpc-asset-hub-westend-01.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ default_node_type: "endpoint"
default_bootnode_domain: "{{ default_network }}.boot.rotko.net"
transition_bootnode_domain: "wmint14.rotko.net"
transition_bootnode_p2p_port: "33623"
transition_bootnode_p2p_port_ws: "34623"
transition_bootnode_p2p_port_wss: "35623"

default_p2p_port: 33011
Expand Down
1 change: 1 addition & 0 deletions host_vars/rpc-bridge-hub-polkadot-01.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ zabbix_ext_port: 10641
default_bootnode_domain: "{{ default_network }}.boot.rotko.net"
transition_bootnode_domain: "pbr13.rotko.net"
transition_bootnode_p2p_port: "33643"
transition_bootnode_p2p_port_ws: "34643"
transition_bootnode_p2p_port_wss: "35643"

default_p2p_port: 31021
Expand Down
1 change: 1 addition & 0 deletions host_vars/rpc-bridge-hub-westend-01.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ zabbix_ext_port: 10661
default_bootnode_domain: "{{ default_network }}.boot.rotko.net"
transition_bootnode_domain: "wbr13.rotko.net"
transition_bootnode_p2p_port: "33663"
transition_bootnode_p2p_port_ws: "34663"
transition_bootnode_p2p_port_wss: "35663"

default_p2p_port: 33021
Expand Down
1 change: 1 addition & 0 deletions host_vars/rpc-collectives-polkadot-01.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ zabbix_ext_port: 10671
default_bootnode_domain: "{{ default_network }}.boot.rotko.net"
transition_bootnode_domain: "pch16.rotko.net"
transition_bootnode_p2p_port: "33673"
transition_bootnode_p2p_port_ws: "34673"
transition_bootnode_p2p_port_wss: "35673"

default_p2p_port: 31031
Expand Down
1 change: 1 addition & 0 deletions host_vars/rpc-collectives-westend-01.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ zabbix_ext_port: 10691
default_bootnode_domain: "{{ default_network }}.boot.rotko.net"
transition_bootnode_domain: "wch13.rotko.net"
transition_bootnode_p2p_port: "33693"
transition_bootnode_p2p_port_ws: "34693"
transition_bootnode_p2p_port_wss: "35693"

default_p2p_port: 33031
Expand Down
4 changes: 3 additions & 1 deletion roles/setup_install_cumulus/templates/endpoint.service.j2
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ ExecStart={{ default_base_path }}/cumulus \
--sync full \
--listen-addr /ip4/0.0.0.0/tcp/{{ default_p2p_port }} \
--listen-addr /ip4/0.0.0.0/tcp/{{ default_p2p_port_ws }}/ws \
--public-addr /dns/{{ default_domain }}/tcp/{{ default_p2p_port }} \
{% if transition_bootnode_domain is defined %}--listen-addr /ip4/0.0.0.0/tcp/{{ transition_bootnode_p2p_port }} \
--listen-addr /ip4/0.0.0.0/tcp/{{ transition_bootnode_p2p_port_ws }}/ws \
{% endif %}--public-addr /dns/{{ default_domain }}/tcp/{{ default_p2p_port }} \
--public-addr /dns/{{ default_domain }}/tcp/{{ default_p2p_port_wss }}/wss \
{% if transition_bootnode_domain is defined %}--public-addr /dns/{{ transition_bootnode_domain }}/tcp/{{ transition_bootnode_p2p_port }} \
--public-addr /dns/{{ transition_bootnode_domain }}/tcp/{{ transition_bootnode_p2p_port_wss }}/wss \
Expand Down
26 changes: 26 additions & 0 deletions roles/setup_install_nginx/templates/https-endpoint.conf.j2
Original file line number Diff line number Diff line change
Expand Up @@ -85,3 +85,29 @@ server {
}
}
{% endif %}

{% if transition_bootnode_domain is defined %}
# Server 3: Bootnode Server
server {
listen {{ transition_bootnode_p2p_port_wss }} ssl http2;
listen [::]:{{ transition_bootnode_p2p_port_wss }} ssl http2;
server_name {{ transition_bootnode_domain }};

# SSL/TLS settings
ssl_certificate {{ letsencrypt_cert_path }};
ssl_certificate_key {{ letsencrypt_key_path }};

# SSL settings are inherited from the first server block
location / {
proxy_buffers 16 4k;
proxy_buffer_size 2k;
proxy_pass http://127.0.0.1:{{ transition_bootnode_p2p_port_ws }};
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}
{% endif %}

0 comments on commit f1cad68

Please sign in to comment.