1 ###############################################################################
3 # IPFire.org - A linux based firewall #
4 # Copyright (C) 2007-2013 IPFire Team <info@ipfire.org> #
6 # This program is free software: you can redistribute it and/or modify #
7 # it under the terms of the GNU General Public License as published by #
8 # the Free Software Foundation, either version 3 of the License, or #
9 # (at your option) any later version. #
11 # This program is distributed in the hope that it will be useful, #
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of #
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
14 # GNU General Public License for more details. #
16 # You should have received a copy of the GNU General Public License #
17 # along with this program. If not, see <http://www.gnu.org/licenses/>. #
19 ###############################################################################
21 ###############################################################################
23 ###############################################################################
30 DIR_APP = $(DIR_SRC)/$(THISAPP)
31 TARGET = $(DIR_INFO)/$(THISAPP)
33 ###############################################################################
35 ###############################################################################
45 ###############################################################################
46 # Installation Details
47 ###############################################################################
52 # Create all directories
53 for i in addon-lang auth backup ca certs connscheduler crls ddns dhcp dhcpc dns dnsforward \
54 ethernet extrahd/bin fwlogs fwhosts firewall isdn key langs logging mac main \
55 menu.d modem net-traffic net-traffic/templates nfs optionsfw \
56 ovpn patches pakfire portfw ppp private proxy/advanced/cre \
57 proxy/calamaris/bin qos/bin red remote sensors snort time tripwire/report \
58 updatexlrator/bin updatexlrator/autocheck urlfilter/autoupdate urlfilter/bin upnp vpn \
59 wakeonlan wireless ; do \
60 mkdir -p $(CONFIG_ROOT)/$$i; \
64 for i in auth/users backup/include.user backup/exclude.user \
65 certs/index.txt ddns/config ddns/noipsettings ddns/settings ddns/ipcache dhcp/settings \
66 dhcp/fixleases dhcp/advoptions dhcp/dhcpd.conf.local dns/settings dnsforward/config ethernet/aliases ethernet/settings ethernet/known_nics ethernet/scanned_nics \
67 ethernet/wireless extrahd/scan extrahd/devices extrahd/partitions extrahd/settings firewall/settings firewall/config firewall/geoipblock firewall/input firewall/outgoing \
68 fwhosts/customnetworks fwhosts/customhosts fwhosts/customgroups fwhosts/customservicegrp fwhosts/customgeoipgrp fwlogs/ipsettings fwlogs/portsettings \
69 isdn/settings mac/settings main/disable_nf_sip main/hosts main/routing main/settings net-traffic/settings optionsfw/settings \
70 ovpn/ccd.conf ovpn/ccdroute ovpn/ccdroute2 pakfire/settings portfw/config ppp/settings-1 ppp/settings-2 ppp/settings-3 ppp/settings-4 \
71 ppp/settings-5 ppp/settings proxy/settings proxy/squid.conf proxy/advanced/settings proxy/advanced/cre/enable remote/settings qos/settings qos/classes qos/subclasses qos/level7config qos/portconfig \
72 qos/tosconfig snort/settings tripwire/settings upnp/settings vpn/config vpn/settings vpn/ipsec.conf \
73 vpn/ipsec.secrets vpn/caconfig wakeonlan/clients.conf wireless/config wireless/settings; do \
74 touch $(CONFIG_ROOT)/$$i; \
77 # Copy initial configfiles
78 cp $(DIR_SRC)/config/cfgroot/header.pl $(CONFIG_ROOT)/
79 cp $(DIR_SRC)/config/cfgroot/general-functions.pl $(CONFIG_ROOT)/
80 cp $(DIR_SRC)/config/cfgroot/network-functions.pl $(CONFIG_ROOT)/
81 cp $(DIR_SRC)/config/cfgroot/geoip-functions.pl $(CONFIG_ROOT)/
82 cp $(DIR_SRC)/config/cfgroot/lang.pl $(CONFIG_ROOT)/
83 cp $(DIR_SRC)/config/cfgroot/countries.pl $(CONFIG_ROOT)/
84 cp $(DIR_SRC)/config/cfgroot/graphs.pl $(CONFIG_ROOT)/
85 cp $(DIR_SRC)/config/cfgroot/modem-lib.pl $(CONFIG_ROOT)/
86 cp $(DIR_SRC)/config/cfgroot/advoptions-list $(CONFIG_ROOT)/dhcp/advoptions-list
87 cp $(DIR_SRC)/config/cfgroot/connscheduler-lib.pl $(CONFIG_ROOT)/connscheduler/lib.pl
88 cp $(DIR_SRC)/config/cfgroot/connscheduler.conf $(CONFIG_ROOT)/connscheduler
89 cp $(DIR_SRC)/config/extrahd/* $(CONFIG_ROOT)/extrahd/bin/
90 cp $(DIR_SRC)/config/cfgroot/sensors-settings $(CONFIG_ROOT)/sensors/settings
91 cp $(DIR_SRC)/config/menu/* $(CONFIG_ROOT)/menu.d/
92 cp $(DIR_SRC)/config/cfgroot/modem-defaults $(CONFIG_ROOT)/modem/defaults
93 cp $(DIR_SRC)/config/cfgroot/modem-settings $(CONFIG_ROOT)/modem/settings
94 cp $(DIR_SRC)/config/cfgroot/net-traffic-lib.pl $(CONFIG_ROOT)/net-traffic/net-traffic-lib.pl
95 cp $(DIR_SRC)/config/cfgroot/net-traffic-admin.pl $(CONFIG_ROOT)/net-traffic/net-traffic-admin.pl
96 cp $(DIR_SRC)/config/cfgroot/nfs-server $(CONFIG_ROOT)/nfs/nfs-server
97 cp $(DIR_SRC)/config/cfgroot/proxy-acl $(CONFIG_ROOT)/proxy/acl-1.4
98 cp $(DIR_SRC)/config/qos/* $(CONFIG_ROOT)/qos/bin/
99 cp $(DIR_SRC)/config/cfgroot/ssh-settings $(CONFIG_ROOT)/remote/settings
100 cp $(DIR_SRC)/config/cfgroot/time-settings $(CONFIG_ROOT)/time/settings
101 cp $(DIR_SRC)/config/cfgroot/logging-settings $(CONFIG_ROOT)/logging/settings
102 cp $(DIR_SRC)/config/cfgroot/useragents $(CONFIG_ROOT)/proxy/advanced
103 cp $(DIR_SRC)/config/cfgroot/ethernet-vlans $(CONFIG_ROOT)/ethernet/vlans
104 cp $(DIR_SRC)/langs/list $(CONFIG_ROOT)/langs/
105 cp $(DIR_SRC)/config/firewall/convert-xtaccess /usr/sbin/convert-xtaccess
106 cp $(DIR_SRC)/config/firewall/convert-outgoingfw /usr/sbin/convert-outgoingfw
107 cp $(DIR_SRC)/config/firewall/convert-dmz /usr/sbin/convert-dmz
108 cp $(DIR_SRC)/config/firewall/convert-portfw /usr/sbin/convert-portfw
109 cp $(DIR_SRC)/config/firewall/p2protocols $(CONFIG_ROOT)/firewall/p2protocols
110 cp $(DIR_SRC)/config/firewall/firewall-policy /usr/sbin/firewall-policy
111 cp $(DIR_SRC)/config/fwhosts/icmp-types $(CONFIG_ROOT)/fwhosts/icmp-types
112 cp $(DIR_SRC)/config/fwhosts/customservices $(CONFIG_ROOT)/fwhosts/customservices
113 cp $(DIR_SRC)/config/fwhosts/customservices $(CONFIG_ROOT)/fwhosts/customservices.default
114 # Oneliner configfiles
115 echo "ENABLED=off" > $(CONFIG_ROOT)/vpn/settings
116 echo "VPN_DELAYED_START=0" >>$(CONFIG_ROOT)/vpn/settings
117 echo "01" > $(CONFIG_ROOT)/certs/serial
118 echo "nameserver 1.2.3.4" > $(CONFIG_ROOT)/ppp/fake-resolv.conf
119 echo "DROPNEWNOTSYN=on" >> $(CONFIG_ROOT)/optionsfw/settings
120 echo "DROPINPUT=on" >> $(CONFIG_ROOT)/optionsfw/settings
121 echo "DROPFORWARD=on" >> $(CONFIG_ROOT)/optionsfw/settings
122 echo "FWPOLICY=DROP" >> $(CONFIG_ROOT)/optionsfw/settings
123 echo "FWPOLICY1=DROP" >> $(CONFIG_ROOT)/optionsfw/settings
124 echo "FWPOLICY2=DROP" >> $(CONFIG_ROOT)/optionsfw/settings
125 echo "DROPPORTSCAN=on" >> $(CONFIG_ROOT)/optionsfw/settings
126 echo "DROPOUTGOING=on" >> $(CONFIG_ROOT)/optionsfw/settings
127 echo "DROPSAMBA=off" >> $(CONFIG_ROOT)/optionsfw/settings
128 echo "DROPPROXY=off" >> $(CONFIG_ROOT)/optionsfw/settings
129 echo "SHOWREMARK=on" >> $(CONFIG_ROOT)/optionsfw/settings
130 echo "SHOWCOLORS=on" >> $(CONFIG_ROOT)/optionsfw/settings
131 echo "SHOWTABLES=off" >> $(CONFIG_ROOT)/optionsfw/settings
132 echo "SHOWDROPDOWN=off" >> $(CONFIG_ROOT)/optionsfw/settings
133 echo "DROPWIRELESSINPUT=on" >> $(CONFIG_ROOT)/optionsfw/settings
134 echo "DROPWIRELESSFORWARD=on" >> $(CONFIG_ROOT)/optionsfw/settings
135 echo "POLICY=MODE2" >> $(CONFIG_ROOT)/firewall/settings
136 echo "POLICY1=MODE2" >> $(CONFIG_ROOT)/firewall/settings
138 # set converters executable
139 chmod 755 /usr/sbin/convert-*
141 # Modify variables in header.pl
142 sed -i -e "s+CONFIG_ROOT+$(CONFIG_ROOT)+g" \
143 -e "s+VERSION+$(VERSION)+g" \
144 $(CONFIG_ROOT)/header.pl
146 # Modify variables in general-functions.pl
147 sed -i -e "s+CONFIG_ROOT+$(CONFIG_ROOT)+g" \
148 -e "s+VERSION+$(VERSION)+g" \
149 $(CONFIG_ROOT)/general-functions.pl
151 # Modify CONFIG_ROOT in lang.pl
152 sed -i -e "s+CONFIG_ROOT+$(CONFIG_ROOT)+g" \
153 $(CONFIG_ROOT)/lang.pl
156 cp $(DIR_SRC)/langs/*/cgi-bin/*.pl $(CONFIG_ROOT)/langs/
158 # Configroot permissions
159 chown -R nobody:nobody $(CONFIG_ROOT)
160 chown root:root $(CONFIG_ROOT)
161 for i in backup/ header.pl general-functions.pl graphs.pl lang.pl addon-lang/ langs/ red/ ; do \
162 chown -R root:root $(CONFIG_ROOT)/$$i; \
164 chown -Rv root:root $(CONFIG_ROOT)/*/bin
165 chown root:nobody $(CONFIG_ROOT)/dhcpc