Skip to content

Commit

Permalink
docs: extend parameter documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
sebthom committed Jan 31, 2025
1 parent fe9d9e3 commit 1b6bb5f
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 16 deletions.
20 changes: 12 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ jobs:
parallel: 2 # Number of parallel speed tests
sample-size: 1024 # Number of kilobytes to download during the speed from each mirror
sample-time: 3 # Maximum number of seconds within the sample download from a mirror must finish
country: "" # The country code for selecting Ubuntu mirrors. If not set, defaults to http://mirrors.ubuntu.com/mirrors.txt
exclude-current: false # If set to "true", don't include the current APT mirror in the speed tests
```
The action output will look like this:
Expand Down Expand Up @@ -117,14 +119,16 @@ Usage:
fast-apt-mirror.sh find [OPTION]...
Options:
--apply - Replaces the current APT mirror in /etc/apt/(sources.list|sources.list.d/system.sources) with a fast mirror and runs 'sudo apt-get update'
--exclude-current - If specified, don't include the current APT mirror in the speed tests.
--healthchecks N - Number of mirrors from the mirrors list to check for availability and up-to-dateness - default is 20
--speedtests N - Maximum number of healthy mirrors to test for speed - default is 5
-p, --parallel N - Number of parallel speed tests. May result in incorrect results because of competing connections but finds a suitable mirror faster.
--sample-size KB - Number of kilobytes to download during the speed from each mirror - default is 200KB
--sample-time SECS - Maximum number of seconds within the sample download from a mirror must finish - default is 3
-v, --verbose - More output. Specify multiple times to increase verbosity.
--apply - Replaces the current APT mirror in /etc/apt/(sources.list|sources.list.d/system.sources) with a fast mirror and runs 'sudo apt-get update'
--country CODE - The country code to use for selecting mirrors. NOTE: Only applies to Ubuntu based distros. Defaults to http://mirrors.ubuntu.com/mirrors.txt
--exclude-current - If specified, don't include the current APT mirror in the speed tests.
--healthchecks N - Number of mirrors from the mirrors list to check for availability and up-to-dateness - default is 20
--ignore-sync-state - Don't check up-to-dateness of mirrors as part of healthchecks
--speedtests N - Maximum number of healthy mirrors to test for speed - default is 5
-p, --parallel N - Number of parallel speed tests. May result in incorrect results because of competing connections but finds a suitable mirror faster.
--sample-size KB - Number of kilobytes to download during the speed from each mirror - default is 200KB
--sample-time SECS - Maximum number of seconds within the sample download from a mirror must finish - default is 3
-v, --verbose - More output. Specify multiple times to increase verbosity.
```

Finding a fast mirror:
Expand Down
16 changes: 8 additions & 8 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ branding:
icon: settings

inputs:
healthchecks: { default: "20", description: "Number of mirrors from the mirrors list to check for availability and up-to-dateness." }
speedtests: { default: "10", description: "Maximum number of healthy mirrors to test for speed." }
parallel: { default: "2", description: "Number of parallel speed tests. May result in incorrect results because of competing connections but finds a suitable mirror faster." }
sample-size: { default: "1024", description: "Number of kilobytes to download during the speed from each mirror." }
sample-time: { default: "3", description: "Maximum number of seconds within the sample download from a mirror must finish." }
exclude-current: { default: "false", description: "Don't include the current APT mirror in the speed tests." }
country: { default: "", description: "The country code to use for selecting mirrors. NOTE: Only applies to Ubuntu based distros. Defaults to http://mirrors.ubuntu.com/mirrors.txt" }
healthchecks: { default: "20", description: "Number of mirrors from the mirrors list to check for availability and up-to-dateness." }
speedtests: { default: "10", description: "Maximum number of healthy mirrors to test for speed." }
parallel: { default: "2", description: "Number of parallel speed tests. May result in incorrect results because of competing connections but finds a suitable mirror faster." }
sample-size: { default: "1024", description: "Number of kilobytes to download during the speed from each mirror." }
sample-time: { default: "3", description: "Maximum number of seconds within the sample download from a mirror must finish." }
exclude-current: { default: "false", description: "Don't include the current APT mirror in the speed tests." }
country: { default: "", description: "The country code to use for selecting mirrors. NOTE: Only applies to Ubuntu based distros. Defaults to http://mirrors.ubuntu.com/mirrors.txt" }

repo-name: { default: "vegardit/fast-apt-mirror.sh", description: "Repository containing the fast-apt-mirror.sh script" }
repo-branch: { default: "v1", description: "Version (i.e. github branch) of the fast-apt-mirror.sh script to use" }
Expand Down Expand Up @@ -57,7 +57,7 @@ runs:
--sample-size ${{ inputs.sample-size }} \
--sample-time ${{ inputs.sample-time }} \
--country "$COUNTRY_CODE" \
${{ inputs.exclude-current && '--exclude-current' || '' }}
${{ inputs.exclude-current == 'true' && '--exclude-current' || '' }}
fi || exit 0 # don't fail action if APT mirror detection failed for whatever reason
fi
Expand Down

0 comments on commit 1b6bb5f

Please sign in to comment.