Skip to content

Commit 4a8f10a

Browse files
authored
Add MacOS support, add verbose parameter to muffet as default (#29)
1 parent eaa262d commit 4a8f10a

2 files changed

Lines changed: 16 additions & 11 deletions

File tree

README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -66,13 +66,13 @@ Do you want to skip the docker build step? OK, the script mode is also available
6666

6767
Environment variables used by `./entrypoint.sh` script.
6868

69-
| Variable | Default | Description |
70-
| ------------------- | -------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
71-
| `INPUT_CMD_PARAMS` | `--buffer-size=8192 --max-connections=10 --color=always` | Command line parameters for URL checker [muffet](https://github.com/raviqqe/muffet) - details [here](https://github.com/raviqqe/muffet/blob/master/arguments.go#L16-L34) |
72-
| `INPUT_DEBUG` | false | Enable debug mode for the `./entrypoint.sh` script (`set -x`) |
73-
| `INPUT_PAGES_PATH` | | Relative path to the directory with local web pages |
74-
| `INPUT_RUN_TIMEOUT` | 300 | Maximum number of seconds that URL checker can be running |
75-
| `INPUT_URL` | (**Mandatory / Required**) | URL which will be checked |
69+
| Variable | Default | Description |
70+
| ------------------- | ------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
71+
| `INPUT_CMD_PARAMS` | `--buffer-size=8192 --max-connections=10 --color=always --verbose` | Command line parameters for URL checker [muffet](https://github.com/raviqqe/muffet) - details [here](https://github.com/raviqqe/muffet/blob/master/arguments.go#L16-L34) |
72+
| `INPUT_DEBUG` | false | Enable debug mode for the `./entrypoint.sh` script (`set -x`) |
73+
| `INPUT_PAGES_PATH` | | Relative path to the directory with local web pages |
74+
| `INPUT_RUN_TIMEOUT` | 300 | Maximum number of seconds that URL checker can be running |
75+
| `INPUT_URL` | (**Mandatory / Required**) | URL which will be checked |
7676

7777
## Full example
7878

entrypoint.sh

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ export MUFFET_VERSION="2.3.0"
66
export CADDY_VERSION="2.2.1"
77

88
# Command line parameters for muffet
9-
export CMD_PARAMS="${INPUT_CMD_PARAMS:- --buffer-size=8192 --max-connections=10 --color=always}"
9+
export CMD_PARAMS="${INPUT_CMD_PARAMS:- --buffer-size=8192 --max-connections=10 --color=always --verbose}"
1010
# Set path variable containing web pages
1111
export PAGES_PATH=${INPUT_PAGES_PATH:-}
1212
# URL to scan / check
@@ -71,9 +71,9 @@ trap error_trap ERR
7171
if ! hash muffet &> /dev/null ; then
7272

7373
if [ "${MUFFET_VERSION}" = "latest" ]; then
74-
MUFFET_URL=$(wget -qO- https://api.github.com/repos/raviqqe/muffet/releases/latest | grep "browser_download_url.*muffet_.*_Linux_x86_64.tar.gz" | cut -d \" -f 4)
74+
MUFFET_URL=$(wget -qO- https://api.github.com/repos/raviqqe/muffet/releases/latest | grep "browser_download_url.*muffet_.*_$(uname)_x86_64.tar.gz" | cut -d \" -f 4)
7575
else
76-
MUFFET_URL="https://github.com/raviqqe/muffet/releases/download/v${MUFFET_VERSION}/muffet_${MUFFET_VERSION}_Linux_x86_64.tar.gz"
76+
MUFFET_URL="https://github.com/raviqqe/muffet/releases/download/v${MUFFET_VERSION}/muffet_${MUFFET_VERSION}_$(uname)_x86_64.tar.gz"
7777
fi
7878

7979
wget -qO- "${MUFFET_URL}" | $sudo_cmd tar xzf - -C /usr/local/bin/ muffet
@@ -82,7 +82,12 @@ fi
8282
# Install caddy if needed
8383
if ! hash caddy &> /dev/null && [ -n "${PAGES_PATH}" ] ; then
8484

85-
PLATFORM=$(uname | tr '[:upper:]' '[:lower:]')
85+
if [[ $(uname) = "Darwin" ]]; then
86+
PLATFORM="mac"
87+
elif [[ $(uname) = "Linux" ]]; then
88+
PLATFORM="linux"
89+
fi
90+
8691
if [ "${CADDY_VERSION}" = "latest" ]; then
8792
CADDY_URL=$(wget --quiet https://api.github.com/repos/caddyserver/caddy/releases/latest -O - | grep "browser_download_url.*caddy_.*_${PLATFORM}_amd64.tar.gz" | cut -d \" -f 4)
8893
else

0 commit comments

Comments
 (0)