feat: x86 configuration

This commit is contained in:
wpetit 2023-03-02 21:24:18 +01:00
parent 0ce214195e
commit 230251703e
4 changed files with 47 additions and 4 deletions

View File

@ -1,3 +0,0 @@
install-x86-network-config:
mkdir -p files/etc/config
cp misc/x86/uci/network files/etc/config/network

7
install/x86.mk Normal file
View File

@ -0,0 +1,7 @@
install-x86-network-config:
mkdir -p files/etc/config
cp misc/x86/uci/network files/etc/config/network
install-x86-firewall-rules:
mkdir -p files/etc/uci-defaults
cp misc/x86/uci-defaults/99-x86-firewall-rules.sh files/etc/uci-defaults/99-x86-firewall-rules.sh

View File

@ -0,0 +1,39 @@
#/bin/sh
set -e
main() {
uci add firewall rule
uci set firewall.@rule[-1].name='Allow SSH on WAN'
uci set firewall.@rule[-1].src='wan'
uci set firewall.@rule[-1].proto='tcp'
uci set firewall.@rule[-1].dest_port='22'
uci set firewall.@rule[-1].target='ACCEPT'
uci add firewall rule
uci set firewall.@rule[-1].name='Allow HTTP on WAN'
uci set firewall.@rule[-1].src='wan'
uci set firewall.@rule[-1].proto='tcp'
uci set firewall.@rule[-1].dest_port='80'
uci set firewall.@rule[-1].target='ACCEPT'
uci add firewall rule
uci set firewall.@rule[-1].name='Allow HTTPS on WAN'
uci set firewall.@rule[-1].src='wan'
uci set firewall.@rule[-1].proto='tcp'
uci set firewall.@rule[-1].dest_port='443'
uci set firewall.@rule[-1].target='ACCEPT'
uci commit firewall
service firewall restart
# Forward DNS queries to public DNS
uci -q delete dhcp.@dnsmasq[0].server
uci add_list dhcp.@dnsmasq[0].server="8.8.8.8"
uci add_list dhcp.@dnsmasq[0].server="8.8.4.4"
uci commit dhcp
service dnsmasq restart
}
main

View File

@ -2,7 +2,7 @@ all: x86_generic
x86_generic: x86_generic:
$(MAKE) \ $(MAKE) \
ADDITIONAL_INSTALL="install-x86-network-config" \ ADDITIONAL_INSTALL="install-x86-network-config install-x86-firewall-rules" \
OPENWRT_TARGET="x86/generic" \ OPENWRT_TARGET="x86/generic" \
EMISSARY_ARCH="386" \ EMISSARY_ARCH="386" \
OPENWRT_PROFILE="generic" \ OPENWRT_PROFILE="generic" \