Forward FIrewall: fixed typo
[people/teissler/ipfire-2.x.git] / lfs / configroot
CommitLineData
cd1a2927 1###############################################################################
cd1a2927 2# #
70df8302 3# IPFire.org - A linux based firewall #
30335673 4# Copyright (C) 2007-2013 IPFire Team <info@ipfire.org> #
70df8302
MT
5# #
6# This program is free software: you can redistribute it and/or modify #
cd1a2927 7# it under the terms of the GNU General Public License as published by #
70df8302 8# the Free Software Foundation, either version 3 of the License, or #
cd1a2927
MT
9# (at your option) any later version. #
10# #
70df8302 11# This program is distributed in the hope that it will be useful, #
cd1a2927
MT
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. #
15# #
16# You should have received a copy of the GNU General Public License #
70df8302 17# along with this program. If not, see <http://www.gnu.org/licenses/>. #
cd1a2927 18# #
cd1a2927
MT
19###############################################################################
20
21###############################################################################
22# Definitions
23###############################################################################
24
25include Config
26
15679d9f
MT
27VER = ipfire
28
cd1a2927
MT
29THISAPP = configroot
30DIR_APP = $(DIR_SRC)/$(THISAPP)
31TARGET = $(DIR_INFO)/$(THISAPP)
32
33###############################################################################
34# Top-level Rules
35###############################################################################
36
37install : $(TARGET)
38
39check :
40
41download :
42
43md5 :
44
45###############################################################################
46# Installation Details
47###############################################################################
48
49$(TARGET) :
50 @$(PREBUILD)
51
52 # Create all directories
111c99dd
MT
53 for i in addon-lang auth backup ca certs connscheduler crls ddns dhcp dhcpc dns dnsforward \
54 ethernet extrahd/bin fwlogs isdn key langs logging mac main menu.d modem net-traffic \
55 ethernet extrahd/bin fwlogs fwhosts forward forward/bin isdn key langs logging mac main menu.d modem net-traffic \
9dafa928
AM
56 net-traffic/templates nfs optionsfw \
57 ovpn patches pakfire portfw ppp private proxy/advanced/cre \
d9716b06
CS
58 proxy/calamaris/bin qos/bin red remote sensors snort time tripwire/report \
59 updatexlrator/bin updatexlrator/autocheck urlfilter/autoupdate urlfilter/bin upnp vpn \
111c99dd 60 wakeonlan wireless ; do \
cd1a2927
MT
61 mkdir -p $(CONFIG_ROOT)/$$i; \
62 done
63
64 # Touch empty files
65 for i in auth/users backup/include.user backup/exclude.user \
1fde937c 66 certs/index.txt ddns/config ddns/noipsettings ddns/settings ddns/ipcache dhcp/settings \
111c99dd 67 dhcp/fixleases dhcp/advoptions dhcp/dhcpd.conf.local dns/settings dnsforward/config ethernet/aliases ethernet/settings ethernet/known_nics ethernet/scanned_nics \
5aa8edf6 68 extrahd/scan extrahd/devices extrahd/partitions extrahd/settings forward/settings forward/config forward/input forward/outgoing forward/dmz \
af8bc0d0 69 fwhosts/customnetworks fwhosts/customhosts fwhosts/customgroups fwhosts/customservicegrp fwlogs/ipsettings fwlogs/portsettings \
231499fc 70 isdn/settings mac/settings main/disable_nf_sip main/hosts main/routing main/settings net-traffic/settings optionsfw/settings \
51379603 71 ovpn/ccd.conf ovpn/ccdroute ovpn/ccdroute2 pakfire/settings portfw/config ppp/settings-1 ppp/settings-2 ppp/settings-3 ppp/settings-4 \
111c99dd 72 ppp/settings-5 ppp/settings proxy/settings proxy/advanced/settings proxy/advanced/cre/enable remote/settings qos/settings qos/classes qos/subclasses qos/level7config qos/portconfig \
e645448e 73 qos/tosconfig snort/settings tripwire/settings upnp/settings vpn/config vpn/settings vpn/ipsec.conf \
4e565351 74 vpn/ipsec.secrets vpn/caconfig wakeonlan/clients.conf wireless/config wireless/settings; do \
111c99dd 75 touch $(CONFIG_ROOT)/$$i; \
cd1a2927
MT
76 done
77
78 # Copy initial configfiles
79 cp $(DIR_SRC)/config/cfgroot/header.pl $(CONFIG_ROOT)/
80 cp $(DIR_SRC)/config/cfgroot/general-functions.pl $(CONFIG_ROOT)/
81 cp $(DIR_SRC)/config/cfgroot/lang.pl $(CONFIG_ROOT)/
111c99dd 82 cp $(DIR_SRC)/config/cfgroot/countries.pl $(CONFIG_ROOT)/
341ff36c 83 cp $(DIR_SRC)/config/cfgroot/graphs.pl $(CONFIG_ROOT)/
4e565351 84 cp $(DIR_SRC)/config/cfgroot/advoptions-list $(CONFIG_ROOT)/dhcp/advoptions-list
4e565351 85 cp $(DIR_SRC)/config/cfgroot/connscheduler-lib.pl $(CONFIG_ROOT)/connscheduler/lib.pl
1fde937c 86 cp $(DIR_SRC)/config/cfgroot/connscheduler.conf $(CONFIG_ROOT)/connscheduler
aa2870e6 87 cp $(DIR_SRC)/config/extrahd/* $(CONFIG_ROOT)/extrahd/bin/
958d26ac 88 cp $(DIR_SRC)/config/cfgroot/sensors-settings $(CONFIG_ROOT)/sensors/settings
111c99dd 89 cp $(DIR_SRC)/config/menu/* $(CONFIG_ROOT)/menu.d/
cd1a2927
MT
90 cp $(DIR_SRC)/config/cfgroot/modem-defaults $(CONFIG_ROOT)/modem/defaults
91 cp $(DIR_SRC)/config/cfgroot/modem-settings $(CONFIG_ROOT)/modem/settings
10a04d70 92 cp $(DIR_SRC)/config/cfgroot/net-traffic-lib.pl $(CONFIG_ROOT)/net-traffic/net-traffic-lib.pl
111c99dd 93 cp $(DIR_SRC)/config/cfgroot/net-traffic-admin.pl $(CONFIG_ROOT)/net-traffic/net-traffic-admin.pl
60cbd6e7 94 cp $(DIR_SRC)/config/cfgroot/nfs-server $(CONFIG_ROOT)/nfs/nfs-server
cd1a2927 95 cp $(DIR_SRC)/config/cfgroot/proxy-acl $(CONFIG_ROOT)/proxy/acl-1.4
111c99dd
MT
96 cp $(DIR_SRC)/config/qos/* $(CONFIG_ROOT)/qos/bin/
97 cp $(DIR_SRC)/config/cfgroot/ssh-settings $(CONFIG_ROOT)/remote/settings
cd1a2927 98 cp $(DIR_SRC)/config/cfgroot/time-settings $(CONFIG_ROOT)/time/settings
111c99dd 99 cp $(DIR_SRC)/config/cfgroot/logging-settings $(CONFIG_ROOT)/logging/settings
ed38f89d 100 cp $(DIR_SRC)/config/cfgroot/useragents $(CONFIG_ROOT)/proxy/advanced
d23fc912 101 cp $(DIR_SRC)/config/cfgroot/ethernet-vlans $(CONFIG_ROOT)/ethernet/vlans
111c99dd
MT
102 cp $(DIR_SRC)/langs/list $(CONFIG_ROOT)/langs/
103 cp $(DIR_SRC)/config/forwardfw/rules.pl $(CONFIG_ROOT)/forward/bin/rules.pl
27f4a6b1
AM
104 cp $(DIR_SRC)/config/forwardfw/convert-xtaccess /usr/sbin/convert-xtaccess
105 cp $(DIR_SRC)/config/forwardfw/convert-outgoingfw /usr/sbin/convert-outgoingfw
7f9d1c39 106 cp $(DIR_SRC)/config/forwardfw/p2protocols $(CONFIG_ROOT)/forward/p2protocols
111c99dd 107 cp $(DIR_SRC)/config/forwardfw/firewall-lib.pl $(CONFIG_ROOT)/forward/bin/firewall-lib.pl
5d7faa45 108 cp $(DIR_SRC)/config/forwardfw/firewall-policy /usr/sbin/firewall-policy
111c99dd 109 cp $(DIR_SRC)/config/fwhosts/icmp-types $(CONFIG_ROOT)/fwhosts/icmp-types
af8bc0d0 110 cp $(DIR_SRC)/config/fwhosts/customservices $(CONFIG_ROOT)/fwhosts/customservices
cd1a2927
MT
111 # Oneliner configfiles
112 echo "ENABLED=off" > $(CONFIG_ROOT)/vpn/settings
113 echo "VPN_DELAYED_START=0" >>$(CONFIG_ROOT)/vpn/settings
114 echo "01" > $(CONFIG_ROOT)/certs/serial
115 echo "nameserver 1.2.3.4" > $(CONFIG_ROOT)/ppp/fake-resolv.conf
5595bc03
CS
116 echo "DROPNEWNOTSYN=on" >> $(CONFIG_ROOT)/optionsfw/settings
117 echo "DROPINPUT=on" >> $(CONFIG_ROOT)/optionsfw/settings
c0ec1996 118 echo "DROPFORWARD=on" >> $(CONFIG_ROOT)/optionsfw/settings
9dafa928 119 echo "FWPOLICY=DROP" >> $(CONFIG_ROOT)/optionsfw/settings
4e62b47f 120 echo "FWPOLICY1=DROP" >> $(CONFIG_ROOT)/optionsfw/settings
5595bc03 121 echo "DROPPORTSCAN=on" >> $(CONFIG_ROOT)/optionsfw/settings
4e62b47f 122 echo "DROPOUTGOING=on" >> $(CONFIG_ROOT)/optionsfw/settings
5aa8edf6
AM
123 echo "SHOWREMARK=on" >> $(CONFIG_ROOT)/optionsfw/settings
124 echo "SHOWCOLORS=off" >> $(CONFIG_ROOT)/optionsfw/settings
125 echo "SHOWTABLES=on" >> $(CONFIG_ROOT)/optionsfw/settings
ec329c06 126 echo "SHOWDROPDOWN=off" >> $(CONFIG_ROOT)/optionsfw/settings
7bd9d462 127 echo "POLICY=MODE2" >> $(CONFIG_ROOT)/forward/settings
4e62b47f 128 echo "POLICY1=MODE2" >> $(CONFIG_ROOT)/forward/settings
bc329725 129
111c99dd
MT
130 # set rules.pl executable
131 chmod 755 $(CONFIG_ROOT)/forward/bin/rules.pl
27f4a6b1 132
99e698d0
AM
133 # set converters executable
134 chmod 755 /usr/sbin/convert-*
135
cd1a2927
MT
136 # Modify variables in header.pl
137 sed -i -e "s+CONFIG_ROOT+$(CONFIG_ROOT)+g" \
138 -e "s+VERSION+$(VERSION)+g" \
139 $(CONFIG_ROOT)/header.pl
140
141 # Modify variables in general-functions.pl
142 sed -i -e "s+CONFIG_ROOT+$(CONFIG_ROOT)+g" \
143 -e "s+VERSION+$(VERSION)+g" \
144 $(CONFIG_ROOT)/general-functions.pl
145
146 # Modify CONFIG_ROOT in lang.pl
147 sed -i -e "s+CONFIG_ROOT+$(CONFIG_ROOT)+g" \
148 $(CONFIG_ROOT)/lang.pl
149
150 # Language files
462515e4 151 cp $(DIR_SRC)/langs/*/cgi-bin/*.pl $(CONFIG_ROOT)/langs/
231499fc 152
cd1a2927
MT
153 # Configroot permissions
154 chown -R nobody:nobody $(CONFIG_ROOT)
155 chown root:root $(CONFIG_ROOT)
156 for i in backup/ header.pl general-functions.pl lang.pl addon-lang/ langs/ red/ ; do \
157 chown -R root:root $(CONFIG_ROOT)/$$i; \
158 done
cd1a2927
MT
159 chown root:nobody $(CONFIG_ROOT)/dhcpc
160
111c99dd 161
cd1a2927 162 @$(POSTBUILD)