diff --git a/ispmanager-plugin-nginx_mod_rewrite_plugin.spec b/ispmanager-plugin-nginx_mod_rewrite_plugin.spec index 2c19d66..531cdbc 100644 --- a/ispmanager-plugin-nginx_mod_rewrite_plugin.spec +++ b/ispmanager-plugin-nginx_mod_rewrite_plugin.spec @@ -27,12 +27,23 @@ cp utils/build_mod_rewrite.py %{buildroot}/usr/local/ispmanager-mod_rewrite/util %triggerin -- nginx /usr/local/ispmanager-mod_rewrite/utils/build_mod_rewrite.py +%posttrans +killall core +if [ "$1" == "1" ]; then + rm -rf /usr/local/mgr5/var/.db.cache* + /usr/local/mgr5/sbin/mgrctl -m ispmgr exit +fi + %files /usr/local/mgr5/etc/xml/ispmgr_mod_nginx_mod_rewrite_plugin.xml /usr/local/mgr5/etc/plugins/ispmgr/nginx_mod_rewrite_plugin.xml %attr(700, root, root) /usr/local/mgr5/addon/nginx_mod_rewrite_plugin.py +%attr(700, root, root) /usr/local/mgr5/addon/nginx_form_rewrite_plugin.py %attr(600, root, root) /usr/local/ispmanager-mod_rewrite/mod_rewrite.zip %attr(700, root, root) /usr/local/ispmanager-mod_rewrite/utils/build_mod_rewrite.py +%attr(644, root, root) /usr/local/mgr5/skins/icons/mod_rewrite_menu.svg +%attr(644, root, root) /usr/local/mgr5/skins/icons/mod_rewrite_tool.svg +%attr(644, root, root) /usr/local/mgr5/etc/sql/webdomain.addon/nginx_mod_rewrite_plugin %changelog * Mon Jun 29 2026 Alexey BayRepo - 0.0.1-1 diff --git a/usr/local/mgr5/addon/nginx_form_rewrite_plugin.py b/usr/local/mgr5/addon/nginx_form_rewrite_plugin.py new file mode 100644 index 0000000..e5d41ba --- /dev/null +++ b/usr/local/mgr5/addon/nginx_form_rewrite_plugin.py @@ -0,0 +1,34 @@ +#!/usr/bin/env python3 + +import os +import xml.etree.ElementTree as etree +from sys import stdin + +import re + +def check_nginx_rewrite_module(): + config_path = "/usr/share/nginx/modules/ngx_http_apache_rewrite_module.conf" + if not os.path.exists(config_path): + return False + pattern = re.compile(r'^\s*load_module\s+"\/usr\/lib64\/nginx\/modules\/ngx_http_apache_rewrite_module.so";\s*$') + with open(config_path, 'r') as f: + for line in f: + stripped = line.lstrip() + if stripped.startswith('#'): + continue + if pattern.match(line): + return True + return False + +if __name__ == "__main__": + root = etree.parse(stdin).getroot() + + func = os.getenv('PARAM_func') + + if func == 'nginx_mod_rewrite_plugin_menu_settings': + nginx_mod_rewrite_plugin_menu_module_enable = os.getenv("PARAM_nginx_mod_rewrite_plugin_menu_module_enable") + + + + etree.dump(root) + quit(0) diff --git a/usr/local/mgr5/etc/sql/webdomain.addon/nginx_mod_rewrite_plugin_webdomain_edit_enable b/usr/local/mgr5/etc/sql/webdomain.addon/nginx_mod_rewrite_plugin_webdomain_edit_enable new file mode 100644 index 0000000..7364f7e --- /dev/null +++ b/usr/local/mgr5/etc/sql/webdomain.addon/nginx_mod_rewrite_plugin_webdomain_edit_enable @@ -0,0 +1,4 @@ +type=bool +access_read=user+ +access_write=user+ +default=false diff --git a/usr/local/mgr5/etc/xml/ispmgr_mod_nginx_mod_rewrite_plugin.xml b/usr/local/mgr5/etc/xml/ispmgr_mod_nginx_mod_rewrite_plugin.xml index 08a9551..2e9ce27 100644 --- a/usr/local/mgr5/etc/xml/ispmgr_mod_nginx_mod_rewrite_plugin.xml +++ b/usr/local/mgr5/etc/xml/ispmgr_mod_nginx_mod_rewrite_plugin.xml @@ -1,34 +1,87 @@ - - 1 - nginx_mod_rewrite_plugin.settings - - - - - - -
+ + 1 + nginx_mod_rewrite_plugin.settings + + + + + + + - - -