Skip to content

Commit 8cfa39c

Browse files
committed
Revert "Merge pull request #72 from ameir/patch-1"
This reverts commit ee022cc, reversing changes made to 46113df.
1 parent de45894 commit 8cfa39c

File tree

3 files changed

+16
-23
lines changed

3 files changed

+16
-23
lines changed

Dockerfile

+14-18
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@ FROM alpine:3.20.1
33
LABEL maintainer="Amin Vakil <[email protected]>, Dmitry Romashov <[email protected]>"
44

55
ENV OC_VERSION=1.3.0
6-
ENV OC_IPV4_NETWORK="192.168.99.0"
7-
ENV OC_IPV4_NETMASK="255.255.255.0"
86

97
RUN apk add --no-cache bash
108

@@ -47,28 +45,26 @@ RUN buildDeps=( \
4745
| sort -u \
4846
)" \
4947
&& readarray runDepsArr <<< "$runDeps" \
50-
&& apk add --virtual .run-deps "${runDepsArr[@]}" gnutls-utils iptables libnl3 readline libseccomp-dev lz4-dev gettext-envsubst \
48+
&& apk add --virtual .run-deps "${runDepsArr[@]}" gnutls-utils iptables libnl3 readline libseccomp-dev lz4-dev \
5149
&& apk del .build-deps \
5250
&& rm -rf /var/cache/apk/*
5351

5452
# Setup config
5553
COPY routes.txt /tmp/
56-
57-
# hadolint ignore=SC2016
5854
RUN set -x \
59-
&& sed -e 's/\.\/sample\.passwd/\/etc\/ocserv\/ocpasswd/' \
60-
-e 's/\(max-same-clients = \)2/\110/' \
61-
-e 's/\.\.\/tests/\/etc\/ocserv/' \
62-
-e 's/#\(compression.*\)/\1/' \
63-
-e '/^ipv4-network = /{s/192.168.1.0/${OC_IPV4_NETWORK}/}' \
64-
-e '/^ipv4-netmask = /{s/255.255.255.0/${OC_IPV4_NETMASK}/}' \
65-
-e 's/192.168.1.2/8.8.8.8/' \
66-
-e 's/^route/#route/' \
67-
-e 's/^no-route/#no-route/' \
68-
-e '/\[vhost:www.example.com\]/,$d' \
69-
-e '/^cookie-timeout = /{s/300/3600/}' \
70-
-e 's/^isolate-workers/#isolate-workers/' /etc/ocserv/ocserv.conf > /tmp/ocserv.conf \
71-
&& cat /tmp/routes.txt >> /tmp/ocserv.conf
55+
&& sed -i 's/\.\/sample\.passwd/\/etc\/ocserv\/ocpasswd/' /etc/ocserv/ocserv.conf \
56+
&& sed -i 's/\(max-same-clients = \)2/\110/' /etc/ocserv/ocserv.conf \
57+
&& sed -i 's/\.\.\/tests/\/etc\/ocserv/' /etc/ocserv/ocserv.conf \
58+
&& sed -i 's/#\(compression.*\)/\1/' /etc/ocserv/ocserv.conf \
59+
&& sed -i '/^ipv4-network = /{s/192.168.1.0/192.168.99.0/}' /etc/ocserv/ocserv.conf \
60+
&& sed -i 's/192.168.1.2/8.8.8.8/' /etc/ocserv/ocserv.conf \
61+
&& sed -i 's/^route/#route/' /etc/ocserv/ocserv.conf \
62+
&& sed -i 's/^no-route/#no-route/' /etc/ocserv/ocserv.conf \
63+
&& sed -i '/\[vhost:www.example.com\]/,$d' /etc/ocserv/ocserv.conf \
64+
&& sed -i '/^cookie-timeout = /{s/300/3600/}' /etc/ocserv/ocserv.conf \
65+
&& sed -i 's/^isolate-workers/#isolate-workers/' /etc/ocserv/ocserv.conf \
66+
&& cat /tmp/routes.txt >> /etc/ocserv/ocserv.conf \
67+
&& rm -rf /tmp/routes.txt
7268

7369
WORKDIR /etc/ocserv
7470

docker-entrypoint.sh

+1-4
Original file line numberDiff line numberDiff line change
@@ -63,16 +63,13 @@ fi
6363
sysctl -w net.ipv4.ip_forward=1
6464

6565
# Enable NAT forwarding
66-
iptables -t nat -A POSTROUTING -j MASQUERADE -s "${OC_IPV4_NETWORK}"/"${OC_IPV4_NETMASK}"
66+
iptables -t nat -A POSTROUTING -j MASQUERADE
6767
iptables -A FORWARD -p tcp --tcp-flags SYN,RST SYN -j TCPMSS --clamp-mss-to-pmtu
6868

6969
# Enable TUN device
7070
mkdir -p /dev/net
7171
mknod /dev/net/tun c 10 200
7272
chmod 600 /dev/net/tun
7373

74-
# Update config
75-
envsubst < /tmp/ocserv.conf > /etc/ocserv/ocserv.conf
76-
7774
# Run OpennConnect Server
7875
exec "$@"

routes.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
route=default
2-
route = ${OC_IPV4_NETWORK}/${OC_IPV4_NETMASK}
2+
route = 192.168.99.0/255.255.255.0
33
no-route = 192.168.0.0/255.255.0.0
44
no-route = 10.0.0.0/255.0.0.0
55
no-route = 172.16.0.0/255.240.0.0

0 commit comments

Comments
 (0)