Skip to content

Commit 4ea6dcb

Browse files
author
Andrea Sessa
committed
openresty+redis
1 parent ea0f279 commit 4ea6dcb

25 files changed

+689
-67
lines changed

docker/debian-nginx-ssl-ja3/Dockerfile renamed to Dockerfile

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -50,12 +50,10 @@ RUN DEBIAN_FRONTEND=noninteractive apt-get install -y --fix-missing \
5050
zlib1g-dev
5151

5252
# Create build directory
53-
RUN mkdir -p /build
53+
RUN mkdir -p /build/nginx-ssl-ja3
5454

5555
WORKDIR /build
5656

57-
VOLUME ["/build/nginx-ssl-ja3"]
58-
5957
# Get test framework
6058
RUN git clone https://github.com/nginx/nginx-tests
6159

@@ -66,7 +64,7 @@ RUN git clone https://github.com/openssl/openssl
6664
WORKDIR /build/openssl
6765

6866
RUN git checkout OpenSSL_1_1_1 -b patched
69-
COPY patches/openssl.extensions.patch /build/openssl
67+
COPY nginx-ja3/patches/openssl.extensions.patch /build/openssl
7068
RUN patch -p1 < openssl.extensions.patch
7169
RUN ./config -d
7270
RUN make
@@ -78,28 +76,38 @@ RUN hg clone http://hg.nginx.org/nginx
7876

7977
# Patch nginx for fetching ssl client extensions
8078
WORKDIR /build/nginx
81-
COPY patches/nginx.latest.patch /build/nginx
79+
COPY nginx-ja3/patches/nginx.latest.patch /build/nginx
8280
RUN patch -p1 < nginx.latest.patch
8381

8482
# Install files
8583
RUN mkdir -p /usr/local/nginx/conf/
86-
COPY docker/debian-nginx-ssl-ja3/nginx.conf /usr/local/nginx/conf/nginx.conf
8784

8885
# Install self-signed certificate
8986
RUN LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib /usr/local/bin/openssl req -new -x509 -days 365 -nodes -out /usr/local/nginx/conf/cert.pem -keyout /usr/local/nginx/conf/rsa.key -subj "/C=PT/ST=Lisbon/L=Lisbon/O=Development/CN=foo.local"
9087

9188
# vim config
92-
COPY docker/debian-nginx-ssl-ja3/vimrc /etc/vim/vimrc
89+
COPY ./nginx/vimrc /etc/vim/vimrc
9390

9491
RUN echo 'export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib' | tee -a /root/.bashrc
9592
RUN echo 'export PATH=$PATH:/usr/local/bin:/usr/local/nginx/sbin' | tee -a /root/.bashrc
9693
RUN echo '' | tee -a /root/.bashrc
9794
RUN echo 'export ASAN_OPTIONS=symbolize=1' | tee -a /root/.bashrc
98-
RUN echo 'export export ASAN_SYMBOLIZER_PATH=/usr/bin/llvm-symbolizer' | tee -a /root/.bashrc
95+
RUN echo 'export ASAN_SYMBOLIZER_PATH=/usr/bin/llvm-symbolizer' | tee -a /root/.bashrc
9996
RUN echo '' | tee -a /root/.bashrc
10097

101-
WORKDIR /build
102-
COPY docker/debian-nginx-ssl-ja3/compile.sh /build/compile.sh
103-
RUN echo 'TO COMPILE RUN:\n cd nginx\n ASAN_OPTIONS=symbolize=1 ./auto/configure --add-module=/build/nginx-ssl-ja3 --with-http_ssl_module --with-stream_ssl_module --with-debug --with-stream --with-cc-opt="-fsanitize=address -O -fno-omit-frame-pointer" --with-ld-opt="-L/usr/local/lib -Wl,-E -lasan"\n make install' | tee -a /build/COMPILE.ASAN.README
104-
RUN echo 'TO TEST RUN:\n nginx &\n openssl s_client -connect 127.0.0.1:12345 -cipher "AES128-SHA" -curves secp521r1' | tee -a /build/TEST.README
98+
COPY nginx-ja3/ /build/nginx-ssl-ja3
10599

100+
WORKDIR /build/nginx
101+
RUN ASAN_OPTIONS=detect_leaks=0:symbolize=1 ./auto/configure \
102+
--add-module=/build/nginx-ssl-ja3 \
103+
--with-http_ssl_module \
104+
--with-stream_ssl_module \
105+
--with-debug \
106+
--with-stream \
107+
--with-http_auth_request_module \
108+
--with-cc-opt="-fsanitize=address -O -fno-omit-frame-pointer" \
109+
--with-ld-opt="-L/usr/local/lib -Wl,-E -lasan"
110+
RUN make install
111+
112+
EXPOSE 443
113+
CMD ["/usr/local/nginx/sbin/nginx"]

docker-compose.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
version: '3.7'
2+
3+
services:
4+
nginx:
5+
image: 'nginx-ja3'
6+
build: .
7+
ports:
8+
- '443:443'
9+
volumes:
10+
- ./nginx/nginx.conf:/usr/local/nginx/conf/nginx.conf
11+
openresty:
12+
image: openresty/openresty
13+
volumes:
14+
- ./openresty/lua:/lua
15+
- ./openresty/nginx.conf:/usr/local/openresty/nginx/conf/nginx.conf
16+
ports:
17+
- 8080:80
18+
redis:
19+
image: redis
20+
ports:
21+
- 6379:6379
22+
redis-browser:
23+
image: marian/rebrow
24+
ports:
25+
- 5001:5001

docker/debian-nginx-ssl-ja3/compile.sh

Lines changed: 0 additions & 6 deletions
This file was deleted.

docker/debian-nginx-ssl-ja3/nginx.conf

Lines changed: 0 additions & 27 deletions
This file was deleted.

docker/docker-compose.yml

Lines changed: 0 additions & 22 deletions
This file was deleted.

config renamed to nginx-ja3/config

File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)