-
-
Notifications
You must be signed in to change notification settings - Fork 251
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #526 from linuxserver/3.21
- Loading branch information
Showing
15 changed files
with
83 additions
and
67 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,40 @@ | ||
#!/usr/bin/with-contenv bash | ||
# shellcheck shell=bash | ||
|
||
if ! iptables -L &> /dev/null; then | ||
ln -sf /sbin/xtables-legacy-multi /sbin/iptables | ||
ln -sf /sbin/xtables-legacy-multi /sbin/iptables-save | ||
ln -sf /sbin/xtables-legacy-multi /sbin/iptables-restore | ||
ln -sf /sbin/xtables-legacy-multi /sbin/ip6tables | ||
ln -sf /sbin/xtables-legacy-multi /sbin/ip6tables-save | ||
ln -sf /sbin/xtables-legacy-multi /sbin/ip6tables-restore | ||
fi | ||
if [[ -z ${LSIO_READ_ONLY_FS} ]] && [[ -z ${LSIO_NON_ROOT_USER} ]] && [[ "${DISABLE_F2B,,}" != "true" ]]; then | ||
if ! iptables -L &> /dev/null; then | ||
ln -sf /usr/sbin/xtables-legacy-multi /usr/sbin/iptables | ||
ln -sf /usr/sbin/xtables-legacy-multi /usr/sbin/iptables-save | ||
ln -sf /usr/sbin/xtables-legacy-multi /usr/sbin/iptables-restore | ||
ln -sf /usr/sbin/xtables-legacy-multi /usr/sbin/ip6tables | ||
ln -sf /usr/sbin/xtables-legacy-multi /usr/sbin/ip6tables-save | ||
ln -sf /usr/sbin/xtables-legacy-multi /usr/sbin/ip6tables-restore | ||
fi | ||
|
||
# copy/update the fail2ban config defaults to/in /config | ||
cp -R /defaults/fail2ban/filter.d /config/fail2ban/ | ||
cp -R /defaults/fail2ban/action.d /config/fail2ban/ | ||
# if jail.local is missing in /config, copy default | ||
if [[ ! -f /config/fail2ban/jail.local ]]; then | ||
cp /defaults/fail2ban/jail.local /config/fail2ban/jail.local | ||
fi | ||
# Replace fail2ban config with user config | ||
if [[ -d /etc/fail2ban/filter.d ]]; then | ||
rm -rf /etc/fail2ban/filter.d | ||
fi | ||
if [[ -d /etc/fail2ban/action.d ]]; then | ||
rm -rf /etc/fail2ban/action.d | ||
fi | ||
cp -R /config/fail2ban/filter.d /etc/fail2ban/ | ||
cp -R /config/fail2ban/action.d /etc/fail2ban/ | ||
cp /defaults/fail2ban/fail2ban.local /etc/fail2ban/ | ||
cp /config/fail2ban/jail.local /etc/fail2ban/jail.local | ||
# copy/update the fail2ban config defaults to/in /config | ||
cp -R /defaults/fail2ban/filter.d /config/fail2ban/ | ||
cp -R /defaults/fail2ban/action.d /config/fail2ban/ | ||
# if jail.local is missing in /config, copy default | ||
if [[ ! -f /config/fail2ban/jail.local ]]; then | ||
cp /defaults/fail2ban/jail.local /config/fail2ban/jail.local | ||
fi | ||
# Replace fail2ban config with user config | ||
if [[ -d /etc/fail2ban/filter.d ]]; then | ||
rm -rf /etc/fail2ban/filter.d | ||
fi | ||
if [[ -d /etc/fail2ban/action.d ]]; then | ||
rm -rf /etc/fail2ban/action.d | ||
fi | ||
cp -R /config/fail2ban/filter.d /etc/fail2ban/ | ||
cp -R /config/fail2ban/action.d /etc/fail2ban/ | ||
cp /defaults/fail2ban/fail2ban.local /etc/fail2ban/ | ||
cp /config/fail2ban/jail.local /etc/fail2ban/jail.local | ||
|
||
# logfiles needed by fail2ban | ||
if [[ ! -f /config/log/nginx/error.log ]]; then | ||
touch /config/log/nginx/error.log | ||
fi | ||
if [[ ! -f /config/log/nginx/access.log ]]; then | ||
touch /config/log/nginx/access.log | ||
# logfiles needed by fail2ban | ||
if [[ ! -f /config/log/nginx/error.log ]]; then | ||
touch /config/log/nginx/error.log | ||
fi | ||
if [[ ! -f /config/log/nginx/access.log ]]; then | ||
touch /config/log/nginx/access.log | ||
fi | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,9 @@ | ||
#!/usr/bin/with-contenv bash | ||
# shellcheck shell=bash | ||
|
||
exec \ | ||
fail2ban-client -x -f start | ||
if [[ -z ${LSIO_READ_ONLY_FS} ]] && [[ -z ${LSIO_NON_ROOT_USER} ]] && [[ "${DISABLE_F2B,,}" != "true" ]]; then | ||
exec \ | ||
fail2ban-client -x -f start | ||
else | ||
sleep infinity | ||
fi |