Opt-out of dotnet telemetry for btcpay #599

Merged
greg merged 5 commits from feature/441-optout_dotnet_telemetry into master 2025-06-25 10:01:59 +00:00
Showing only changes of commit efb032fffa - Show all commits

View File

@ -74,6 +74,8 @@ if node["nbxplorer"]["postgres"]
nbxpg_connect = "User ID=#{nbxpg_user};Password=#{nbxplorer_credentials['postgresql_password']};Database=#{nbxpg_database};Host=pg.kosmos.local;Port=5432;Application Name=btcpayserver;MaxPoolSize=80"
end
systemd_unit_env = "'DOTNET_CLI_TELEMETRY_OPTOUT=1'"
systemd_unit_env << " 'BTCPAY_EXPLORERPOSTGRES=#{nbxpg_connect}'" if defined?(nbxpg_connect)
greg marked this conversation as resolved Outdated

This should fail if it's not defined, since you need the explorer to run the service. (I.e. just remove the if.)

This should fail if it's not defined, since you need the explorer to run the service. (I.e. just remove the `if`.)
systemd_unit 'btcpayserver.service' do
content({
Unit: {
@ -87,7 +89,7 @@ systemd_unit 'btcpayserver.service' do
Group: node['bitcoin']['usergroup'],
Type: 'simple',
WorkingDirectory: node['btcpay']['source_dir'],
Environment: defined?(nbxpg_connect) ? "'BTCPAY_EXPLORERPOSTGRES=#{nbxpg_connect}'" : '',
Environment: systemd_unit_env,
ExecStart: "#{node['btcpay']['source_dir']}/run.sh --conf=#{node['btcpay']['config_path']}",
PIDFile: '/run/btcpayserver/btcpayserver.pid',
Restart: 'on-failure',
@ -103,6 +105,7 @@ systemd_unit 'btcpayserver.service' do
verify false
triggers_reload true
action [:create]
notifies :reload, "systemd_unit[btcpayserver.service]", :delayed
end
service "btcpayserver" do