92 Commits

Author SHA1 Message Date
sebres
c9e1a1b087 silence warning "Unknown distribution option: 'test_suite'", seems not work anymore (2.x only?) - test suite shall be invoked using bin/fail2ban-testcases 2025-08-23 22:22:20 +02:00
sebres
0185e1c7d5 setup.py: no distutils anymore 2024-05-07 13:06:50 +02:00
sebres
77b052fdea amend to df9584505aea0e8570fb53dd5a8e43f8b3af994a (for gh-3487): setup must install fail2ban.compat 2024-03-18 14:22:39 +01:00
sebres
99ff701678 remove support of python 2.x 2023-06-16 16:29:08 +02:00
sebres
03d7c92ae8 2to3 2023-06-16 15:23:41 +02:00
Sergey G. Brester
ea7bbb4757 Merge pull request #2182 from orlitzky/openrc-improvements
OpenRC service script improvements
2022-01-10 14:39:11 +01:00
sebres
5ac303df8a fix gh-3098: build fails with error in fail2ban setup command: use_2to3 is invalid (setuptools 58+) 2021-09-19 18:49:18 +02:00
Sergey G. Brester
7f22c4873a remove 2to3 in setup (should be called outside before setup) 2021-09-19 18:36:02 +02:00
Michael Orlitzky
dd0f348757 files/fail2ban-openrc.init: replace @BINDIR@ at build-time.
This commit renames fail2ban-openrc.init to fail2ban-openrc.init.in,
and replaces the hard-coded value "/usr/bin" with "@BINDIR@"
therein. At build-time, setup.py will replace that string with the
correct value, and rename the file (without the ".in" suffix).

This mimics the procedure done for "fail2ban-service.in" entirely.
2021-05-14 07:50:34 -04:00
sebres
a107a8e7d2 setup.py: cherry-pick from 0.11 (option --without-tests) 2020-11-23 14:59:45 +01:00
sebres
7bf5980def no root option if testing within virtualenv (fixed now). 2017-11-24 13:20:19 +01:00
sebres
eac80966c5 Fix scripts-root within fail2ban.service (relative install root-base directory).
This is amend for e3b061e94b.
Closes gh-1964
2017-11-24 12:54:45 +01:00
sebres
e3b061e94b - files/fail2ban.service renamed as template to files/fail2ban.service.in;
- setup process generates `build/fail2ban.service` from `files/fail2ban.service.in` using distribution related bin-path;
- bug-fixing by running setup with option `--dry-run` (note: specify option `--dry-run` before `install`, like `python setup.py --dry-run install`);
- test cases extended to cover dry-run.
2017-08-23 13:01:29 +02:00
sebres
0ae932ba5e setup fix for python3, bypass directories (__pycache__) created after ignore command was tested 2016-10-05 15:29:56 +02:00
sebres
83029b89b9 amend to 2e530fcf72: setuptools compatibility fix - just to be sure if install_scripts will be incompatible tomorrow 2016-08-12 21:48:40 +02:00
sebres
2e530fcf72 setuptools compatibility fix 2016-08-12 21:26:57 +02:00
sebres
461e9bab56 better handling of setup in test-cases (prevent execution of 2to3 twice, full logging in heavydebug, etc.) 2016-08-12 21:26:51 +02:00
sebres
d71a525a85 Merge branch 'master' into 0.10 (resolve conflicts and cleaning tree points after back-porting gh-1508 0.10 -> 0.9) 2016-08-12 18:51:56 +02:00
sebres
db30b7ce06 BF: prefer sys.argv[0] by retrieving of root resp. bin path: __file__ seems to be overwritten sometimes on some python versions (e.g. bug of 2.6 by running under cProfile, etc.) 2016-08-12 17:59:27 +02:00
sebres
6cdc1ce685 compatibility fix (virtualenv, running test cases in py3)
# Conflicts:
#	MANIFEST
2016-08-12 17:59:24 +02:00
sebres
38d53a72fd introduces new command "fail2ban-python", as automatically created symlink to python executable, where fail2ban currently installed (resp. its modules are located);
fixed pythonic filters and test scripts (running via "fail2ban-python" now);
fixed test case "testSetupInstallRoot" not for default python (also using direct call, out of virtualenv);

# Conflicts:
#	config/filter.d/ignorecommands/apache-fakegooglebot
#	fail2ban/tests/files/config/apache-auth/digest.py
#	fail2ban/tests/files/ignorecommand.py
#	fail2ban/tests/misctestcase.py
2016-08-12 17:58:37 +02:00
sebres
c8e7c1f7f4 BF: prefer sys.argv[0] by retrieving of root resp. bin path: __file__ seems to be overwritten sometimes on some python versions (e.g. bug of 2.6 by running under cProfile, etc.) 2016-08-12 16:48:11 +02:00
sebres
08af8de981 compatibility fix (virtualenv, running test cases in py3) 2016-08-11 21:35:13 +02:00
sebres
77f451c4a3 introduces new command "fail2ban-python", as automatically created symlink to python executable, where fail2ban currently installed (resp. its modules are located);
fixed pythonic filters and test scripts (running via "fail2ban-python" now);
fixed test case "testSetupInstallRoot" not for default python (also using direct call, out of virtualenv);
2016-08-11 18:34:18 +02:00
Yaroslav Halchenko
9d70c49ea8 BF: install doc files only under Linuxes and other GNU systems (Closes #1233) (#1503) 2016-08-09 12:49:40 +02:00
Alexander Koeppe
975608dfb6 no hardcoded python interpreter path 2016-05-15 21:08:32 +02:00
Yaroslav Halchenko
776322cea3 BF: realpath for /var/run/fail2ban Closes #1142 2015-07-31 10:12:14 -04:00
Lee Clemens
1ebea39ec5 Merge pull request #1068 from yarikoptic/enh/var-run-fail2ban
BF: 'create' /var/run/fail2ban on systems with /var/run
2015-07-07 21:55:49 -04:00
Lee Clemens
7667712909 Fix pep8 E401 multiple imports on one line 2015-06-26 12:51:19 -04:00
Yaroslav Halchenko
2d9ece2d04 BF: 'create' /var/run/fail2ban on systems with /var/run
Should overcome problems of some users installing using setup.py install
2015-06-11 19:43:42 -10:00
Lee Clemens
38415d2cf1 Add trailing comma back to list 2015-02-02 11:29:27 -05:00
Lee Clemens
af078532ac New jail: apache-fakegooglebot
Detects fake googlebot user agents in apache access log
2015-02-02 00:42:01 -05:00
Deyuan Deng
5e9619d4a4 Clean up setup.py 2014-04-04 02:54:53 +00:00
Steven Hiscocks
41cbbbc248 BF: Remove unused imports and variables.
All highlighted by using pyflakes.
2014-03-16 14:31:34 +00:00
Steven Hiscocks
3990a19fc7 BF: Remove "/var/run/fail2ban" from setup.py
As the contents of /var/run are lost on reboot, it doesn't make sense to
install it. This is already patched out in some distros (gentoo, arch,
debian, gentoo, …) as causes a headache with package managment tracking
installed files.
2014-03-16 10:47:40 +00:00
Daniel Black
4b2d8a8e51 BF: include test data 2014-03-15 10:28:04 +11:00
Daniel Black
ce586b6e16 PKG: Documentation files 2014-03-14 23:58:55 +11:00
Steven Hiscocks
5630c56c75 ENH: Change logging levels and make info more verbose 2014-02-20 23:01:40 +00:00
Steven Hiscocks
8221c7ca71 TST+BF: Add tests for python actions, including test for smtp.py
Also fix bug when specifying multiple recipients for smtp.py action
2014-01-20 23:10:43 +00:00
Steven Hiscocks
80d6f74ee8 RF: Refactor actions further, include removing server proxy interface
This allows direct setting of action properties and calling of methods
from the fail2ban-client if so required.
2014-01-03 17:04:49 +00:00
Steven Hiscocks
f37c90cdba ENH: Python based actions
Python actions are imported from action.d config folder, which have .py
file extension. This imports and creates an instance of the Action class
(Action can be a variable that points to a class of another name).
fail2ban.server.action.ActionBase is a base class which can be inherited
from or as a minimum has a subclass hook which is used to ensure any
imported actions implements the methods required.
All calls to the execAction are also wrapped in a try except such that
any errors won't cripple the jail.
Action is renamed CommandAction, to clearly distinguish it from other
actions.

Include is an example smtp.py python action for sending emails via smtp.
This is work in progress, as looking to add the <matches> and whois
elements, and also SSL/TLS support.
2013-12-31 18:54:34 +00:00
Steven Hiscocks
bbadef847b ENH: Add fail2ban persistent data storage 2013-12-07 23:23:28 +00:00
Daniel Black
1f1a56174f MRG: merge from master 2013-09-08 21:02:35 +10:00
Orion Poplawski
71317332ec Install empty /etc/fail2ban/fail2ban.d directory 2013-08-28 11:33:05 -06:00
Orion Poplawski
d3ce9e860f Install empty /etc/fail2ban/jail.d directory 2013-08-09 14:39:06 -06:00
Daniel Black
04ff9450b5 BF: testcases is a package that needs to be installed. Thanks to Michael Danko on irc 2013-07-29 10:45:15 +10:00
Steven Hiscocks
774c9ce4fd BF: setup.py build now includes sample log files for tests 2013-07-16 23:37:44 +01:00
Yaroslav Halchenko
b65205d4ad Merge branch 'master' into 0.9
* master:
  ENH: "is None" instead of "== None" + tune ups in headers
  BF: log error only if there were missed config files that couldn't be read
  DOC: missing cinfo tags are ok. Log error for self referencing definitions
  DOC: s/defination/definition/g learn to spell
  Changelog entry for the previous commit and some untabify
  BF: pyinotify backend should also handle IN_MOVED_TO events
  ENH: remove stats of config files and use results of SafeConfigParserWithIncludes.read to facilitate meaningful error messages
  DOC: credits for gh-70 fix
  BF: ensure dates in email are in the C locale. Thanks iGeorgeX
  DOC: ChangeLog for recursive tag substition
  ENH: allow recursive tag substitution in action files.
  DOC: document <br> tag
  DOC: ChangeLog for named-refused entry
  ENH: Account for views in named filter. By Romain Riviere in gentoo bug #259458
  DOC: release documentation and distributor contacts
  DOC: changelog entry for enhanced ssh filter
  BF: Rename mentioning of README to README.md (Fixes #187)
  updated README.md to hyperlink, add travis and coversall
  Moving README into a markup README.md for github's goodnesses

Conflicts:
	DEVELOP
	README.md
	fail2ban/client/configreader.py
	fail2ban/server/datedetector.py
2013-05-02 23:55:26 -04:00
Yaroslav Halchenko
c5287e3d9c BF: Rename mentioning of README to README.md (Fixes #187) 2013-04-26 22:51:59 -04:00
Steven Hiscocks
6f3c66f466 ENH: Reimplement warning suppression of setup.py test --quiet 2013-04-21 13:23:08 +01:00