8 Commits

Author SHA1 Message Date
fab
068c4c59b4
Update import_apache_waf.py 2025-02-28 11:20:17 +01:00
fabriziosalmi
e8da4c3d28 nginx snippets generation fix + others minor improvements. 2025-01-16 14:02:19 +01:00
fab
4655a25c4d
Update import_apache_waf.py
- Error Handling: Added try-except blocks to handle file operations, subprocess commands, and permission issues. Logs detailed error messages for debugging.
- Path Handling: Used pathlib.Path for better path manipulation and readability. Made paths configurable via environment variables.
- File Permissions: Ensured the target directory is created with parents=True to handle nested directories. Checked if files already exist in the target directory to avoid unnecessary overwrites.
- Logging: Added more detailed logging for better transparency and debugging.
- Subprocess Security: Added checks for apachectl and systemctl commands to ensure compatibility with supported systems.
- Input Validation: Validated the existence of .conf files before copying them.
- Code Structure: Encapsulated the main logic in a main() function for better organization.
- Added docstrings to functions for clarity.
2025-01-03 13:12:12 +01:00
Seb
c58a1b486f Added fixes to Caddy and Ngnix
Did the same fixes that have been done to Apache to Caddy and Nginx
2024-12-21 23:03:25 +08:00
Seb
6c267fbb63 Tidied the code a bit
Whoops, forgot to actually clean the code in my haste, apologies
2024-12-21 22:59:50 +08:00
Sebastian Gazey
d34ec3ecf5 seems to work 2024-12-21 22:51:02 +08:00
Seb
613f77c538 Fixed astrix not being passed to shell
Initially tried to add all files ending in .conf in correct dir to a
string in {a,b,c,d} form for cp, but ran into a char limit for cp so
sadly went with the slower for loop method
2024-12-21 22:43:34 +08:00
fab
1974e98a13
Create import_apache_waf.py 2024-12-21 09:05:54 +01:00