remove "force add"

This commit is contained in:
Chai Feng 2018-10-06 13:06:22 +08:00
parent 4ab8060b92
commit 36afb81244
No known key found for this signature in database
GPG Key ID: 2DCD9A24E523FFD2
2 changed files with 0 additions and 8 deletions

View File

@ -31,7 +31,6 @@ function run-ufw-docker() {
declare -a docker_opts=(run --rm -t --name "ufw-docker-agent-${RANDOM}-$(date '+%Y%m%d%H%M%S')"
--cap-add NET_ADMIN --network host
--env "DEBUG=${DEBUG}"
--env "UFW_DOCKER_FORCE_ADD=yes"
-v /var/run/docker.sock:/var/run/docker.sock
-v /etc/ufw:/etc/ufw "${ufw_docker_agent_image}" "$@")
docker "${docker_opts[@]}"

View File

@ -51,13 +51,6 @@ function ufw-docker--allow() {
mapfile -t PORT_PROTO_LIST < <(docker inspect --format='{{range $p, $conf := .NetworkSettings.Ports}}{{with $conf}}{{$p}}{{"\n"}}{{end}}{{end}}' "$INSTANCE_NAME" | remove_blank_lines)
if [[ "${UFW_DOCKER_FORCE_ADD:-}" = "yes" ]]; then
for IP in "${INSTANCE_IP_ADDRESSES[@]}"; do
ufw-docker--add-rule "$INSTANCE_NAME" "$IP" "${INSTANCE_PORT}" "${PROTO}"
done
return
fi
if [[ -z "${PORT_PROTO_LIST:-}" ]]; then
err "\"$INSTANCE_NAME\" doesn't have any published ports."
return 1