File tree Expand file tree Collapse file tree
services/octobot_services
tentacles/Services/Services_bases/node_api_service Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11---
2+ - name : Ensure deploy user exists
3+ ansible.builtin.user :
4+ name : deploy
5+ system : true
6+ create_home : false
7+ shell : /usr/sbin/nologin
8+
29- name : Check if Docker iptables chains are present
310 ansible.builtin.command : iptables -L DOCKER-USER -n
411 register : docker_chains
Original file line number Diff line number Diff line change 1212 changed_when : false
1313 when : enable_replica_mode | default(false) | bool and is_master | default(false) | bool
1414
15- - name : Wait for OctoBot Node health
15+ - name : Wait for OctoBot Node API health
16+ ansible.builtin.uri :
17+ url : " http://127.0.0.1:{{ octobot_node_port }}/api/v1/openapi.json"
18+ return_content : true
19+ status_code : [200]
20+ register : octobot_health
21+ until : octobot_health.status == 200
22+ retries : 60
23+ delay : 5
24+
25+ - name : Wait for OctoBot Web UI health
1626 ansible.builtin.uri :
1727 url : " http://127.0.0.1:{{ octobot_web_port }}"
1828 return_content : true
1929 status_code : [200, 302]
20- register : octobot_health
21- until : octobot_health .status in [200, 302]
22- retries : 30
30+ register : web_health
31+ until : web_health .status in [200, 302]
32+ retries : 60
2333 delay : 5
34+ when : expose_web_ui | default(false) | bool
2435
2536- name : Wait for Nginx health (proxied)
2637 ansible.builtin.uri :
3142 until : nginx_health.status == 200
3243 retries : 10
3344 delay : 5
34- when : enable_nginx | default(false)
45+ when : enable_nginx | default(false) | bool
Original file line number Diff line number Diff line change 2727 group : deploy
2828 mode : " 0644"
2929 notify : restart nginx
30- when : enable_nginx | default(false)
30+ when : enable_nginx | default(false) | bool
3131
3232- name : Copy Tor proxy Dockerfile
3333 ansible.builtin.copy :
3737 group : deploy
3838 mode : " 0644"
3939 notify : restart tor
40- when : enable_tor | default(false)
40+ when : enable_tor | default(false) | bool
4141
4242- name : Generate self-signed TLS certificate
4343 ansible.builtin.command :
4848 -subj "/CN={{ inventory_hostname | regex_replace('[^a-zA-Z0-9.\\-]', '') }}"
4949 creates : " {{ stack_deploy_dir }}/origin.crt"
5050 notify : restart nginx
51- when : enable_nginx | default(false)
51+ when : enable_nginx | default(false) | bool
5252
5353- name : Pull Docker images
5454 ansible.builtin.command :
55- cmd : docker compose pull --ignore-buildable
55+ cmd : docker compose pull --ignore-buildable --ignore-pull-failures
5656 chdir : " {{ stack_deploy_dir }}"
5757 changed_when : false
5858
Original file line number Diff line number Diff line change 1+ # Node API (env var override for NodeApiService.get_is_enabled)
2+ ENABLE_NODE_API=true
3+
14NODE_ENVIRONMENT=production
25IS_MASTER_MODE={{ 'true' if (is_master | default(false) | bool) else 'false' }}
36CONSUMER_ONLY={{ 'true' if (is_consumer_only | default(false) | bool) else 'false' }}
Original file line number Diff line number Diff line change 7272CONFIG_NODE_API_PORT = "port"
7373ENV_NODE_API_PORT = "NODE_API_PORT"
7474ENV_NODE_API_ADDRESS = "NODE_API_ADDRESS"
75+ ENV_ENABLE_NODE_API = "ENABLE_NODE_API"
7576DEFAULT_NODE_API_IP = DEFAULT_SERVER_IP
7677DEFAULT_NODE_API_PORT = 8000
7778
Original file line number Diff line number Diff line change @@ -75,7 +75,10 @@ def is_setup_correctly(config):
7575
7676 @staticmethod
7777 def get_is_enabled (config ):
78- # allow to disable node api interface from config, enabled by default otherwise
78+ if os .getenv (services_constants .ENV_ENABLE_NODE_API ):
79+ return commons_constants .parse_boolean_environment_var (
80+ services_constants .ENV_ENABLE_NODE_API , "false"
81+ )
7982 return config .get (services_constants .CONFIG_CATEGORY_SERVICES , {}).get (services_constants .CONFIG_NODE_API , {}).get (
8083 commons_constants .CONFIG_ENABLED_OPTION , False
8184 )
You can’t perform that action at this time.
0 commit comments