From 359898b70ce0565444a54813758a5e71e8bbb169 Mon Sep 17 00:00:00 2001 From: Bruno Bottazzini Date: Thu, 17 Mar 2016 19:26:13 -0300 Subject: [PATCH] soletta-dev-app: Add iptables rules to allow access Signed-off-by: Bruno Bottazzini --- ...1-Add-firewall-rules-to-allow-access.patch | 32 +++++++++++++++++++ .../dev-app/soletta-dev-app_%.bbappend | 6 ++++ 2 files changed, 38 insertions(+) create mode 100644 meta-ostro/recipes-soletta/dev-app/files/0001-Add-firewall-rules-to-allow-access.patch diff --git a/meta-ostro/recipes-soletta/dev-app/files/0001-Add-firewall-rules-to-allow-access.patch b/meta-ostro/recipes-soletta/dev-app/files/0001-Add-firewall-rules-to-allow-access.patch new file mode 100644 index 0000000..a4e85cb --- /dev/null +++ b/meta-ostro/recipes-soletta/dev-app/files/0001-Add-firewall-rules-to-allow-access.patch @@ -0,0 +1,32 @@ +From 5747fcbf6cea42cf53bf4213d8caa40451e09cb6 Mon Sep 17 00:00:00 2001 +From: Bruno Bottazzini +Date: Fri, 18 Mar 2016 10:47:08 -0300 +Subject: [PATCH] Add firewall rules to allow access + +When running the nodejs server, it needs to allow Soletta Dev-App +to be accessed. + +Signed-off-by: Bruno Bottazzini +--- + scripts/units/soletta-dev-app-server.service.in | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/scripts/units/soletta-dev-app-server.service.in b/scripts/units/soletta-dev-app-server.service.in +index b18d1bb..412e618 100644 +--- a/scripts/units/soletta-dev-app-server.service.in ++++ b/scripts/units/soletta-dev-app-server.service.in +@@ -3,7 +3,11 @@ Description=Run Soletta Development Application server + + [Service] + StandardOutput=null ++ExecStartPre=/usr/sbin/iptables -w -A INPUT -p tcp --dport 80 -j ACCEPT ++ExecStartPre=/usr/sbin/ip6tables -w -A INPUT -p tcp --dport 80 -j ACCEPT + ExecStart=/usr/bin/NODE_BIN_NAME PATH/server/app.js 1> /dev/null 2>&1 ++ExecStopPost=/usr/sbin/iptables -w -D INPUT -p tcp --dport 80 -j ACCEPT ++ExecStopPost=/usr/sbin/ip6tables -w -D INPUT -p tcp --dport 80 -j ACCEPT + Environment="NODE_ENV=production" + + [Install] +-- +2.7.1 + diff --git a/meta-ostro/recipes-soletta/dev-app/soletta-dev-app_%.bbappend b/meta-ostro/recipes-soletta/dev-app/soletta-dev-app_%.bbappend index 87c84cf..38b1994 100644 --- a/meta-ostro/recipes-soletta/dev-app/soletta-dev-app_%.bbappend +++ b/meta-ostro/recipes-soletta/dev-app/soletta-dev-app_%.bbappend @@ -3,3 +3,9 @@ # soletta-dev-app-avahi-discover.service. SYSTEMD_AUTO_ENABLE_${PN} = "disable" + +FILESEXTRAPATHS_prepend := "${THISDIR}/files:" + +SRC_URI += " file://0001-Add-firewall-rules-to-allow-access.patch" + +RDEPENDS_${PN} += " iptables"