From 4f1b24ae4ff2f3ff498f12a9b0dbcf63143c6f17 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Pie=C5=84kowski?= <8525083+Jakski@users.noreply.github.com> Date: Sun, 14 Jan 2024 16:31:24 +0100 Subject: [PATCH] Fix DHCP communication --- conf/post_iptable_rules | 5 +++++ scripts/install | 9 +++++++++ scripts/remove | 7 +++++++ scripts/restore | 9 +++++++++ 4 files changed, 30 insertions(+) create mode 100644 conf/post_iptable_rules diff --git a/conf/post_iptable_rules b/conf/post_iptable_rules new file mode 100644 index 0000000..b0a3f04 --- /dev/null +++ b/conf/post_iptable_rules @@ -0,0 +1,5 @@ +#!/bin/bash + +source /usr/share/yunohost/helpers + +iptables -t filter -A INPUT -i lxdbr0 -p udp -d 255.255.255.255 --dport 67 -j ACCEPT diff --git a/scripts/install b/scripts/install index 5445d22..94dd986 100644 --- a/scripts/install +++ b/scripts/install @@ -188,6 +188,15 @@ ynh_script_progression --message="Reloading NGINX web server..." ynh_systemd_action --service_name=nginx --action=reload +#================================================= +# ADD FIREWALL RULES +#================================================= +ynh_script_progression --message="Adding firewall rules..." + +mkdir -p "/etc/yunohost/hooks.d/post_iptable_rules" +ynh_add_config --template="post_iptable_rules" --destination="/etc/yunohost/hooks.d/post_iptable_rules/50-${app}" +yunohost firewall reload + #================================================= # END OF SCRIPT #================================================= diff --git a/scripts/remove b/scripts/remove index 524c878..142ee5f 100644 --- a/scripts/remove +++ b/scripts/remove @@ -85,6 +85,13 @@ ynh_script_progression --message="Removing the dedicated system user..." # Delete a system user ynh_system_user_delete --username=$app +#================================================= +# REMOVE FIREWALL RULES +#================================================= +ynh_script_progression --message="Removing firewall rules..." + +yunohost firewall reload + #================================================= # END OF SCRIPT #================================================= diff --git a/scripts/restore b/scripts/restore index a51a6ae..1fa8640 100644 --- a/scripts/restore +++ b/scripts/restore @@ -130,6 +130,15 @@ ynh_script_progression --message="Reloading NGINX web server..." ynh_systemd_action --service_name=nginx --action=reload +#================================================= +# ADD FIREWALL RULES +#================================================= +ynh_script_progression --message="Adding firewall rules..." + +mkdir -p "/etc/yunohost/hooks.d/post_iptable_rules" +ynh_add_config --template="post_iptable_rules" --destination="/etc/yunohost/hooks.d/post_iptable_rules/50-${app}" +yunohost firewall reload + #================================================= # END OF SCRIPT #=================================================