# Radicle Environment Configuration
# Generated by provisioning system

RADICLE_VERSION={{ radicle.version }}
RADICLE_RUN_USER={{ radicle.run_user.name }}
RADICLE_RUN_GROUP={{ radicle.run_user.group }}
RADICLE_RUN_USER_HOME={{ radicle.run_user.home }}
RADICLE_WORK_PATH={{ radicle.work_path }}
RADICLE_CONFIG_PATH={{ radicle.config_path }}
RADICLE_RUN_PATH={{ radicle.run_path }}
RADICLE_STORAGE_PATH={{ radicle.storage_path }}

# Network Configuration
RADICLE_BIND_ADDR={{ radicle.bind_addr }}
RADICLE_BIND_PORT={{ radicle.bind_port }}
RADICLE_PEER_PORT={{ radicle.peer_port }}
RADICLE_WEB_UI_PORT={{ radicle.web_ui_port }}

# Node Configuration
RADICLE_CONNECT_TIMEOUT={{ radicle.connect_timeout }}
RADICLE_ANNOUNCE={{ radicle.announce | lower }}  
RADICLE_LOG_LEVEL={{ radicle.log_level }}

# Seeds and External Addresses
{% if radicle.seeds %}
RADICLE_SEEDS="{{ radicle.seeds | join(',') }}"
{% endif %}
{% if radicle.external_addresses %}
RADICLE_EXTERNAL_ADDRESSES="{{ radicle.external_addresses | join(',') }}"
{% endif %}

# HTTP Daemon Configuration
{% if radicle.httpd is defined %}
RADICLE_HTTPD_ENABLED={{ radicle.httpd.enabled | lower }}
RADICLE_HTTPD_BIND_ADDR={{ radicle.httpd.bind_addr }}
RADICLE_HTTPD_BIND_PORT={{ radicle.httpd.bind_port }}
{% if radicle.httpd.assets_path is defined %}
RADICLE_HTTPD_ASSETS_PATH={{ radicle.httpd.assets_path }}
{% endif %}
{% endif %}