Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
envsetup
Manage
Activity
Members
Plan
Redmine
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mediaserver
envsetup
Commits
6775d7e9
Commit
6775d7e9
authored
8 years ago
by
Stéphane Diemer
Browse files
Options
Downloads
Patches
Plain Diff
Fixed iptables setup for apt cacher (refs
#19053
).
parent
2e09e693
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
51.Install_CM/0_setup.sh
+18
-13
18 additions, 13 deletions
51.Install_CM/0_setup.sh
with
18 additions
and
13 deletions
51.Install_CM/0_setup.sh
+
18
−
13
View file @
6775d7e9
...
...
@@ -5,24 +5,22 @@ source /root/envsetup/conf.sh
APT_CACHER_PWD
=
$(
pwgen 12
)
# installation cm
apt
itude
install
-y
campus-manager
apt
-get
install
-y
campus-manager
# installation cache local
apt
itude
install
-y
apt-cacher-ng
apt
-get
install
-y
apt-cacher-ng
# secure it
echo
"AdminAuth:
${
APT_CACHER_USER
}
:
${
APT_CACHER_PWD
}
"
>>
/etc/apt-cacher-ng/security.conf
service apt-cacher-ng restart
# proxy
if
[
${
PROXY
}
=
"1"
]
then
if
[
${
PROXY_AUTHENTICATION
}
=
"1"
]
then
# general settings
echo
"Proxy: http://
${
PROXY_USER
}
:
${
PROXY_PASSWD
}
@
${
PROXY_HTTP
}
:
${
PROXY_PORT
}
"
>>
/etc/apt-cacher-ng/acng.conf
if
[
${
PROXY
}
=
"1"
]
;
then
if
[
${
PROXY_AUTHENTICATION
}
=
"1"
]
;
then
# general settings
echo
"Proxy: http://
${
PROXY_USER
}
:
${
PROXY_PASSWD
}
@
${
PROXY_HTTP
}
:
${
PROXY_PORT
}
"
>>
/etc/apt-cacher-ng/acng.conf
else
# general settings
echo
"Proxy: http://
${
PROXY_HTTP
}
:
${
PROXY_PORT
}
"
>>
/etc/apt-cacher-ng/acng.conf
# general settings
echo
"Proxy: http://
${
PROXY_HTTP
}
:
${
PROXY_PORT
}
"
>>
/etc/apt-cacher-ng/acng.conf
fi
fi
...
...
@@ -35,11 +33,18 @@ sed -i "s@server_name skyreach;@server_name ${CM_SERVER_NAME};@" /etc/nginx/site
service nginx restart
# iptables rules for port 3142
DEBIAN_FRONTEND
=
noninteractive aptitude
install
-y
iptables-persistent
update-rc.d iptables-persistent
enable
DEBIAN_FRONTEND
=
noninteractive apt-get
install
-y
iptables-persistent
iptables
-A
INPUT
-p
tcp
-s
localhost
--destination-port
3142
-j
ACCEPT
iptables
-A
INPUT
-p
tcp
--destination-port
3142
-j
DROP
service iptables-persistent save
iptables-save
# the save using "service" command fails on VM
if
(
cat
/etc/lsb-release |
grep
'14.04'
)
;
then
update-rc.d iptables-persistent
enable
service iptables-persistent save
||
true
else
update-rc.d netfilter-persistent
enable
service netfilter-persistent save
||
true
fi
LIG
=
$(
grep
-n
"^iface lo inet loopback"
/etc/network/interfaces |
awk
-F
":"
'{print$1}'
)
LIG
=
$((
${
LIG
}
+
1
))
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment