1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/yunorunner_ynh.git synced 2024-09-03 20:36:13 +02:00

Fix DHCP communication

This commit is contained in:
Jakub Pieńkowski 2024-01-14 16:31:24 +01:00 committed by Félix Piédallu
parent cd94ef4eb3
commit 9f597ef3a5
7 changed files with 27 additions and 0 deletions

3
conf/firewall_rules.sh Normal file
View file

@ -0,0 +1,3 @@
#!/bin/bash
iptables -t filter -A INPUT -i lxdbr0 -p udp -d 255.255.255.255 --dport 67 -j ACCEPT

View file

@ -55,6 +55,19 @@ exposed_ports_if_cluster() {
fi
}
_ynh_firewall_add_tweak() {
mkdir -p "/etc/yunohost/hooks.d/post_iptable_rules"
ynh_add_config --template="firewall_rules.sh" --destination="/etc/yunohost/hooks.d/post_iptable_rules/50-${app}"
yunohost firewall reload
}
_ynh_firewall_remove_tweak() {
ynh_secure_remove --file="/etc/yunohost/hooks.d/post_iptable_rules/50-${app}"
yunohost firewall git remote add origin git@github.com:user/repository.git
}
#=================================================
# EXPERIMENTAL HELPERS
#=================================================

View file

@ -35,6 +35,8 @@ ynh_backup --src_path="/etc/systemd/system/$app.service"
ynh_backup --src_path="/etc/cron.d/$app"
ynh_backup --src_path="/etc/yunohost/hooks.d/post_iptable_rules/50-${app}"
#=================================================
# END OF SCRIPT
#=================================================

View file

@ -87,6 +87,8 @@ yunohost service add "$app" --description="$app daemon for YunoRunner" $(exposed
ynh_add_config --template="cron" --destination="/etc/cron.d/$app"
_ynh_firewall_add_tweak
#=================================================
# START SYSTEMD SERVICE
#=================================================

View file

@ -23,6 +23,8 @@ ynh_remove_systemd_config
# Remove the dedicated NGINX config
ynh_remove_nginx_config
_ynh_firewall_remove_tweak
#=================================================
# END OF SCRIPT
#=================================================

View file

@ -59,6 +59,9 @@ yunohost service add "$app" --description="$app daemon for YunoRunner" $(exposed
ynh_restore_file --origin_path="/etc/cron.d/$app"
ynh_restore_file --origin_path="/etc/yunohost/hooks.d/post_iptable_rules/50-${app}"
yunohost firewall reload
#=================================================
# RELOAD NGINX AND PHP-FPM OR THE APP SERVICE
#=================================================

View file

@ -141,6 +141,8 @@ yunohost service add "$app" --description="$app daemon for YunoRunner" $(exposed
ynh_add_config --template="cron" --destination="/etc/cron.d/$app"
_ynh_firewall_add_tweak
#=================================================
# START SYSTEMD SERVICE
#=================================================