Skip to content

Commit

Permalink
Merge pull request #164 from endlessm/T35420-metrics-urls
Browse files Browse the repository at this point in the history
image: Add hook to customize metrics server URLs
  • Loading branch information
wjt committed May 30, 2024
2 parents 70a0de6 + c73da41 commit 27ff146
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
7 changes: 7 additions & 0 deletions config/defaults.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
15 changes: 15 additions & 0 deletions hooks/image/50-metrics-urls
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 27ff146

Please sign in to comment.