#!/bin/sh # Machine-specific settings belong in the user's sourced configuration file, # not in this package. Resolve its path before an optional CHATGPT_HOME changes # HOME for the application. chatgpt_config_dir=${XDG_CONFIG_HOME:-${HOME}/.config} chatgpt_config_file=${CHATGPT_CONFIG_FILE:-${chatgpt_config_dir}/chatgpt/environment} if [ -r "${chatgpt_config_file}" ]; then . "${chatgpt_config_file}" fi if [ -n "${CHATGPT_HOME-}" ]; then export HOME=${CHATGPT_HOME} export CODEX_HOME=${CHATGPT_CODEX_HOME:-${CHATGPT_HOME}/.codex} mkdir -p "${HOME}" "${CODEX_HOME}" || exit 1 fi # Chromium/Electron does not consistently honor the conventional proxy # environment variables. When CHATGPT_PROXY_SERVER is explicitly configured, # use Chromium's command-line setting and prevent conflicting environment # proxy values from leaking into the application. if [ "${CHATGPT_PROXY_SERVER+x}" = x ]; then unset http_proxy https_proxy HTTP_PROXY HTTPS_PROXY all_proxy ALL_PROXY if [ -n "${CHATGPT_PROXY_SERVER}" ]; then set -- "--proxy-server=${CHATGPT_PROXY_SERVER}" "$@" fi fi exec /opt/chatgpt/codex-launcher "$@"