This repository was archived by the owner on Aug 25, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
112 lines (90 loc) · 3.34 KB
/
Makefile
File metadata and controls
112 lines (90 loc) · 3.34 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
#############################################
#
# mod_mshield Makefile V1.0 by MSHIELD
#
#############################################
# Change the pcre path to your real pcre path:
PCRE = /opt/applic/pcre-8.39/include
# mod_mshield shared memory space for sessions and cookies
SESSIONCOUNT = 100000
COOKIECOUNT = 300000
# Docker hub publishing parameters
BUILDTAG = 2.0
HUBPREFIX = markovshield
#############################################
#
# IMPORTANT: Do not change anything below
# here unless you excactly know what
# you are doing!
#
#############################################
APXSFLAGS = -I$(PCRE) -v -c
APXSFLAGSEND = -Wc,-O0 -Wc,-Wall -Wc,-DMOD_MSHIELD_SESSION_COUNT=100000 -Wc,-DMOD_MSHIELD_COOKIESTORE_COUNT=300000 -Wc,-Wno-unused-function
DEBUGFLAGS = -Wc,-g -Wc,-pg -Wc,-finstrument-functions -Wc,-fno-omit-frame-pointer
LIBS = -lrdkafka -lz -lpthread -lm -lhiredis
# Check if its Linux or Darwin (macOS)
UNAME = $(shell uname)
ifeq ($(UNAME), Linux)
LIBS += -lrt
endif
SRC = \
mod_mshield.c \
mod_mshield_regexp.c \
mod_mshield_redirect.c \
mod_mshield_cookie.c \
mod_mshield_access_control.c \
mod_mshield_request_filter.c \
mod_mshield_response_filter.c \
mod_mshield_config.c \
mod_mshield_session.c \
mod_mshield_shm.c \
mod_mshield_kafka.c \
mod_mshield_redis.c \
cJSON.c
dev: APXSCMD = apxs
dev: APXSFLAGS += $(APXSFLAGSEND)
dev: APXSFLAGS += $(DEBUGFLAGS)
deploy: APXSCMD = /opt/applic/httpd/bin/apxs
deploy: APXSFLAGS += -a -i $(APXSFLAGSEND)
docker-compile: APXSCMD = apxs
docker-compile: APXSFLAGS += -a -i $(APXSFLAGSEND)
compile:
docker run --rm \
-v `pwd`:/opt \
markovshield/apache_module_compiler \
/bin/bash -c 'make docker-compile && cp /usr/local/apache2/modules/mod_mshield.so /opt'
compile-librdkafka:
docker run --rm \
-v `pwd`:/opt \
markovshield/librdkafka_compiler \
/bin/bash -c 'cp /tmp/librdkafka/src/librdkafka.so.1 /opt/'
prepare-publish: compile compile-librdkafka
docker build -f examplesite/reverseproxy/Dockerfile -t $(HUBPREFIX)/mshield-demo-reverse-proxy .
docker build -f examplesite/backend/Dockerfile -t $(HUBPREFIX)/mshield-demo-backend .
docker tag markovshield/mshield-demo-reverse-proxy markovshield/mshield-demo-reverse-proxy:$(BUILDTAG)
docker tag markovshield/mshield-demo-backend markovshield/mshield-demo-backend:$(BUILDTAG)
docker push markovshield/mshield-demo-reverse-proxy:$(BUILDTAG)
docker push markovshield/mshield-demo-backend:$(BUILDTAG)
shutdown-demo:
docker-compose -p mshield-demo -f docker-compose.yml down
rm -rf zk-txt-logs
rm -rf kafka-data
rm -rf zk-data
rm -rf state-store
demo: compile compile-librdkafka
docker-compose -p mshield-demo -f docker-compose.yml up --build -d
@echo Finished! Please give MarkovShield a few seconds to start everything in the background. Visit https://localhost to try markovshield.
publish: prepare-publish clean
all: APXSCMD = apxs
all: APXSFLAGS += $(APXSFLAGSEND)
all dev deploy docker-compile: mod_mshield
mod_mshield: $(SRC)
$(APXSCMD) $(APXSFLAGS) $(SRC) $(LIBS)
docs:
doxygen Doxyfile
@echo "Documentation generated in docs"
clean-docs:
rm -rf docs
clean:
rm -rf *.la *.slo *.o *.lo .libs *.so *.so.1
.PHONY: mod_mshield dev deploy docker-compile compile compile-librdkafka prepare-publish shutdown-demo demo publish all docs clean-docs clean