diff --git a/config/defaults.ini b/config/defaults.ini index ad02abb9..fd018213 100644 --- a/config/defaults.ini +++ b/config/defaults.ini @@ -116,6 +116,7 @@ hooks_add = 50-flatpak.chroot 50-language 50-locales + 50-metrics-urls 50-timezone 50-update-done-stamp 50-reclaim-swap-stamp @@ -221,6 +222,12 @@ icon_grid_add = # Brand-specific configuration for the First Boot Experience branding_fbe_config = +# Metrics server URLs. metrics_server_url sets the URL for the OS +# metrics server (azafea-metrics-proxy) while activation_server_url sets +# the URL for the activation server (eos-activation-server). +metrics_server_url = +activation_server_url = + [kolibri] app_version = 0.15.12 app_desktop_xdg_plugin_version = 1.2.0 diff --git a/hooks/image/50-metrics-urls b/hooks/image/50-metrics-urls new file mode 100644 index 00000000..72f1a4e7 --- /dev/null +++ b/hooks/image/50-metrics-urls @@ -0,0 +1,15 @@ +# Set custom metrics server URLs. + +if [ -n "${EIB_IMAGE_METRICS_SERVER_URL}" ]; then + conf_file="${OSTREE_DEPLOYMENT}"/etc/metrics/eos-metrics-permissions.conf + [ -f "${conf_file}" ] || echo "[global]" > "${conf_file}" + sed -i '/^server_url *=/d' "${conf_file}" + echo "server_url=${EIB_IMAGE_METRICS_SERVER_URL}" >> "${conf_file}" +fi + +if [ -n "${EIB_IMAGE_ACTIVATION_SERVER_URL}" ]; then + conf_file="${OSTREE_DEPLOYMENT}"/etc/eos-phone-home.conf + [ -f "${conf_file}" ] || echo "[global]" > "${conf_file}" + sed -i '/^host *=/d' "${conf_file}" + echo "host=${EIB_IMAGE_ACTIVATION_SERVER_URL}" >> "${conf_file}" +fi