summaryrefslogtreecommitdiff
path: root/data/templates/system
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2022-04-27 21:44:39 +0200
committerChristian Poessinger <christian@poessinger.com>2022-04-28 15:03:36 +0200
commitb1772a82e5609051d1960c9aa12a8a1674c9dc03 (patch)
treea379b290f27338c3069ee21e444ad05f7e854854 /data/templates/system
parentb0aeb2a9c196ea7048545e38e6f3c5759ff4a5ac (diff)
downloadvyos-1x-b1772a82e5609051d1960c9aa12a8a1674c9dc03.tar.gz
vyos-1x-b1772a82e5609051d1960c9aa12a8a1674c9dc03.zip
system-proxy: T1741: migrate to get_config_dict()
Diffstat (limited to 'data/templates/system')
-rw-r--r--data/templates/system/proxy.j27
1 files changed, 7 insertions, 0 deletions
diff --git a/data/templates/system/proxy.j2 b/data/templates/system/proxy.j2
new file mode 100644
index 000000000..215c4c5c2
--- /dev/null
+++ b/data/templates/system/proxy.j2
@@ -0,0 +1,7 @@
+# generated by system-proxy.py
+{% if url is vyos_defined and port is vyos_defined %}
+{# remove http:// prefix so we can inject a username/password if present #}
+export http_proxy=http://{{ username ~ ':' ~ password ~ '@' if username is vyos_defined and password is vyos_defined }}{{ url | replace('http://', '') }}:{{ port }}
+export https_proxy=$http_proxy
+export ftp_proxy=$http_proxy
+{% endif %}