Skip to content

Commit eeee311

Browse files
Gaetan TrelluGaetan Trellu
authored andcommitted
services: pass proxy and TLS env vars to launchd units
1 parent 95ecc37 commit eeee311

3 files changed

Lines changed: 18 additions & 0 deletions

File tree

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@ sudo env OVOS_VENV_PYTHON=3.12 sh -c "$(curl -fsSL https://raw.githubusercontent
3333

3434
# Speed up repeated runs by reusing cached artifacts (useful for debugging)
3535
sudo env REUSE_CACHED_ARTIFACTS=true sh -c "$(curl -fsSL https://raw.githubusercontent.com/OpenVoiceOS/ovos-installer/main/installer.sh)"
36+
37+
# Forward proxy variables into generated launchd/systemd services
38+
sudo env HTTPS_PROXY=http://proxy.example:3128 HTTP_PROXY=http://proxy.example:3128 NO_PROXY=localhost,127.0.0.1 sh -c "$(curl -fsSL https://raw.githubusercontent.com/OpenVoiceOS/ovos-installer/main/installer.sh)"
3639
```
3740

3841
👉 Guide: [Howto - Begin your Open Voice OS journey with the OVOS installer](https://community.openconversational.ai/t/howto-begin-your-open-voice-os-journey-with-the-ovos-installer/14900)

ansible/roles/ovos_services/defaults/main.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,15 @@ ovos_services_launchd_user_lookup_environment:
3737
HOME: "{{ ovos_installer_user_home }}"
3838
LOGNAME: "{{ ovos_installer_user }}"
3939
USER: "{{ ovos_installer_user }}"
40+
# Allow launchd jobs to inherit network/proxy/TLS settings from installer env.
41+
ovos_services_launchd_extra_environment:
42+
HTTP_PROXY: "{{ ansible_env.HTTP_PROXY | default(ansible_env.http_proxy | default('')) }}"
43+
HTTPS_PROXY: "{{ ansible_env.HTTPS_PROXY | default(ansible_env.https_proxy | default('')) }}"
44+
ALL_PROXY: "{{ ansible_env.ALL_PROXY | default(ansible_env.all_proxy | default('')) }}"
45+
NO_PROXY: "{{ ansible_env.NO_PROXY | default(ansible_env.no_proxy | default('')) }}"
46+
REQUESTS_CA_BUNDLE: "{{ ansible_env.REQUESTS_CA_BUNDLE | default('') }}"
47+
SSL_CERT_FILE: "{{ ansible_env.SSL_CERT_FILE | default('') }}"
48+
SSL_CERT_DIR: "{{ ansible_env.SSL_CERT_DIR | default('') }}"
4049
ovos_services_messagebus_target_arch: >-
4150
{{ 'aarch64' if ansible_facts.architecture in ['aarch64', 'arm64']
4251
else 'x86_64' if ansible_facts.architecture in ['x86_64', 'amd64']

ansible/roles/ovos_services/templates/launchd/service.plist.j2

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,12 @@
2929
<string>{{ '/var/root/.config' if item.scope == 'system' else ovos_installer_user_home + '/.config' }}</string>
3030
<key>XDG_CACHE_HOME</key>
3131
<string>{{ '/var/root/.cache' if item.scope == 'system' else ovos_installer_user_home + '/.cache' }}</string>
32+
{% for env_key, env_value in (ovos_services_launchd_extra_environment | default({})).items() %}
33+
{% if (env_value | string | length) > 0 %}
34+
<key>{{ env_key }}</key>
35+
<string>{{ env_value }}</string>
36+
{% endif %}
37+
{% endfor %}
3238
</dict>
3339

3440
<key>RunAtLoad</key>

0 commit comments

Comments
 (0)