From 07b42d219a9231eccc608952063d6b4f24c32ca8 Mon Sep 17 00:00:00 2001 From: Jimmy Monin Date: Thu, 18 Jan 2018 20:19:47 +0100 Subject: [PATCH] Set the instance as its own registry (closes #11 and #14) --- scripts/_common.sh | 6 ++++++ scripts/change_url | 4 ++++ 2 files changed, 10 insertions(+) diff --git a/scripts/_common.sh b/scripts/_common.sh index d174f01..45249eb 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -8,6 +8,12 @@ pkg_dependencies="zlib1g-dev uuid-dev libmnl-dev gcc make git autoconf autoconf- # Configure NetData configure_netdata() { + # Set server as registry serveur + sed -i "/^\[registry\]$/,/^\[/ { + s/# enabled = no/enabled = yes/ + s@# registry to announce = https://registry.my-netdata.io@registry to announce = https://$domain$path_url@ + }" /opt/netdata/etc/netdata/netdata.conf + # Add a web_log entry for every YunoHost domain netdata_add_yunohost_web_logs diff --git a/scripts/change_url b/scripts/change_url index 70d6e0a..8efef37 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -83,6 +83,10 @@ then fi # Calculate and store the nginx config file checksum ynh_store_file_checksum "$nginx_conf_path" + + # Change registry link + ynh_replace_string "registry to announce = https://$old_domain$old_path" "registry to announce = https://$new_domain$new_path" /opt/netdata/etc/netdata/netdata.conf + systemctl restart netdata fi # Change the domain for nginx