summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarel Kočí <cynerd@email.cz>2020-12-01 07:50:24 +0100
committerKarel Kočí <cynerd@email.cz>2020-12-01 07:50:24 +0100
commitaa49a7bd8f3e230ce81798e9b94ad83c60265c96 (patch)
tree536ad6768929b80fb4fcd8a8531d5f5bd8b63bc0
parent4b7abc62aa0a78eb94f0fb4a2a8210b25f6f136e (diff)
downloadopenwrt-personal-pkgs-aa49a7bd8f3e230ce81798e9b94ad83c60265c96.tar.gz
openwrt-personal-pkgs-aa49a7bd8f3e230ce81798e9b94ad83c60265c96.tar.bz2
openwrt-personal-pkgs-aa49a7bd8f3e230ce81798e9b94ad83c60265c96.zip
personal-enabler: add enabler for public services
-rw-r--r--personal-enabler/Makefile1
-rw-r--r--personal-enabler/files/public-ssh.sh12
-rw-r--r--updater.lua12
3 files changed, 19 insertions, 6 deletions
diff --git a/personal-enabler/Makefile b/personal-enabler/Makefile
index 09cd127..9a6b588 100644
--- a/personal-enabler/Makefile
+++ b/personal-enabler/Makefile
@@ -35,3 +35,4 @@ Build/Compile:=:
$(eval $(call PKG,common,+updater-ng +user-notify))
$(eval $(call PKG,sentinel,+pkglists +sentinel-proxy))
+$(eval $(call PKG,public-ssh,+uci +firewall))
diff --git a/personal-enabler/files/public-ssh.sh b/personal-enabler/files/public-ssh.sh
new file mode 100644
index 0000000..6e36eb8
--- /dev/null
+++ b/personal-enabler/files/public-ssh.sh
@@ -0,0 +1,12 @@
+#!/bin/sh
+uci -q batch <<EOF
+ set firewall.public_ssh=redirect
+ set firewall.public_ssh.name=SSH access on public
+ set firewall.public_ssh.dest_port=22
+ set firewall.public_ssh.src_dport=222
+ set firewall.public_ssh.proto=tcp
+ set firewall.public_ssh.src=wan
+ set firewall.public_ssh.target=DNAT
+ commit firewall.public_ssh
+EOF
+/etc/init.d/firewall reload
diff --git a/updater.lua b/updater.lua
index 011abab..7308ab3 100644
--- a/updater.lua
+++ b/updater.lua
@@ -32,27 +32,27 @@ Package("personal-pkgs-repo", { replan = "finished" })
local tools = false
local vpn = false
local bigclown = false
-local sentinel = false
+local public = false
uci_cursor:foreach("system", "system", function(s) hostname = s['hostname'] end)
if hostname == "turris-prague" then
tools = true
vpn = true
bigclown = true
- sentinel = true
+ public = true
Install("6to4")
Install("etherwake")
elseif hostname == "turris-home" then
tools = true
vpn = true
- sentinel = true
+ public = true
Install("transmission-daemon")
elseif hostname:match("-home$") then
tools = true
elseif hostname == "turris-adamkovi" then
tools = true
vpn = true
- sentinel = true
+ public = true
Install("etherwake")
elseif hostname:match("^work-") then
tools = true
@@ -77,6 +77,6 @@ if bigclown then
Install("mosquitto", "mosquitto-client")
Install("bigclown-leds")
end
-if sentinel then
- Install("personal-enabler-sentinel")
+if public then
+ Install("personal-enabler-sentinel", "personal-enabler-public-ssh")
end