Skip to content

Commit

Permalink
Merge pull request #3294 from donoghuc/disable-analytics
Browse files Browse the repository at this point in the history
(maint) Turn off analytics submissions
  • Loading branch information
donoghuc authored Apr 8, 2024
2 parents 4b30c39 + fbb2c52 commit 8266293
Show file tree
Hide file tree
Showing 8 changed files with 22 additions and 18 deletions.
1 change: 1 addition & 0 deletions .github/actions/docker_setup/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,6 @@ runs:
- name: Bring up containers
shell: bash
run: |
sudo apt install docker-compose
docker-compose -f spec/docker-compose.yml build --parallel
docker-compose -f spec/docker-compose.yml up -d
1 change: 1 addition & 0 deletions .github/actions/sudo_setup/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ runs:
- name: Bring up containers
shell: bash
run: |
sudo apt install docker-compose
docker-compose -f spec/docker-compose.yml build --parallel
docker-compose -f spec/docker-compose.yml up -d
- name: Create non-sudo user
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,5 @@ jobs:
- name: Run DITA
uses: dita-ot/dita-ot-action@master
with:
dita-ot-version: 4.1.2
build: dita -i documentation/bolt.ditamap -o out -f html5 --processing-mode=strict
5 changes: 3 additions & 2 deletions documentation/analytics.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
# Analytics

Bolt collects data about how you use it to help the Bolt team make decisions
about how to improve it. You can opt out of providing this data.
about how to improve it. You can opt out of providing this data. Analytics is
disabled by default.

## Opt out of data collection

Expand All @@ -12,7 +13,7 @@ or by setting an environment variable.

To disable data collection, set `analytics: false` in your [configuration
file](configuring_bolt.md). This option is supported in the system-wide,
user-level, and project configuration files.
user-level, and project configuration files. `false` is the default value.

```yaml
# bolt-defaults.yaml
Expand Down
4 changes: 0 additions & 4 deletions documentation/bolt_installing.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
# Installing Bolt

> Bolt automatically collects data about how you use it. If you want to opt
> out of providing this data, you can do so. For more information, see
> [Opt out of data collection](analytics.md#opt-out-of-data-collection).
Packaged versions of Bolt are available for several Linux distributions, macOS,
and Microsoft Windows.

Expand Down
2 changes: 1 addition & 1 deletion lib/bolt/config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ def initialize(project, config_data, overrides = {})
@config_files = []

default_data = {
'analytics' => true,
'analytics' => false,
'apply-settings' => {},
'color' => true,
'compile-concurrency' => Etc.nprocessors,
Expand Down
22 changes: 13 additions & 9 deletions lib/bolt/shell/powershell/snippets.rb
Original file line number Diff line number Diff line change
Expand Up @@ -55,21 +55,25 @@ def run_script(arguments, script_path)
}
#{build_arg_list}
switch -regex ( Get-ExecutionPolicy )
try
{
'^AllSigned'
switch -regex ( Get-ExecutionPolicy )
{
if ((Get-AuthenticodeSignature -File "#{script_path}").Status -ne 'Valid') {
$Host.UI.WriteErrorLine("Error: Target host Powershell ExecutionPolicy is set to ${_} and script '#{script_path}' does not contain a valid signature.")
'^AllSigned'
{
if ((Get-AuthenticodeSignature -File "#{script_path}").Status -ne 'Valid') {
$Host.UI.WriteErrorLine("Error: Target host Powershell ExecutionPolicy is set to ${_} and script '#{script_path}' does not contain a valid signature.")
exit 1;
}
}
'^Restricted'
{
$Host.UI.WriteErrorLine("Error: Target host Powershell ExecutionPolicy is set to ${_} which denies running any scripts on the target.")
exit 1;
}
}
'^Restricted'
{
$Host.UI.WriteErrorLine("Error: Target host Powershell ExecutionPolicy is set to ${_} which denies running any scripts on the target.")
exit 1;
}
}
catch {}
if([string]::IsNullOrEmpty($invokeArgs.ScriptBlock)){
$Host.UI.WriteErrorLine("Error: Failed to obtain scriptblock from '#{script_path}'. Running scripts might be disabled on this system. For more information, see about_Execution_Policies at https:/go.microsoft.com/fwlink/?LinkID=135170");
Expand Down
4 changes: 2 additions & 2 deletions spec/unit/config_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -377,8 +377,8 @@
end

context 'analytics' do
it 'defaults to enabled' do
expect(config.analytics).to eq(true)
it 'defaults to disabled' do
expect(config.analytics).to eq(false)
end

it 'overrides a true value with false' do
Expand Down

0 comments on commit 8266293

Please sign in to comment.