2024-07-16 15:23:17 +03:00
|
|
|
{#- prologue -#}
|
2024-07-20 16:35:39 +03:00
|
|
|
{%- set preserve_env = ( j2cfg.core_preserve_environment or [] )|env_any_to_str_list -%}
|
|
|
|
{%- set have_tz = preserve_env|is_str_list_re_match('TZ(=|$)') -%}
|
|
|
|
{%- set have_malloc_arena = preserve_env|is_str_list_re_match('MALLOC_ARENA_MAX(=|$)') -%}
|
2024-07-16 15:23:17 +03:00
|
|
|
{#- main part -#}
|
2024-07-20 16:35:39 +03:00
|
|
|
{%- if not have_tz -%}
|
2024-07-16 15:23:17 +03:00
|
|
|
env TZ;
|
|
|
|
{% endif %}
|
2024-07-20 16:35:39 +03:00
|
|
|
{%- if not have_malloc_arena -%}
|
2024-07-16 15:23:17 +03:00
|
|
|
env MALLOC_ARENA_MAX;
|
|
|
|
{% endif %}
|
2024-07-20 16:35:39 +03:00
|
|
|
{%- for v in preserve_env -%}
|
|
|
|
{%- if re.search("(\"|'|\\s)", v) %}
|
|
|
|
{#- TODO: investigate corrent escape behavior for Angie/nginx -#}
|
|
|
|
env {{ v.__repr__() }};
|
2024-07-16 15:23:17 +03:00
|
|
|
{%- else %}
|
2024-07-11 13:37:35 +03:00
|
|
|
env {{ v }};
|
2024-07-16 15:23:17 +03:00
|
|
|
{%- endif %}
|
|
|
|
{%- endfor -%}
|