Skip to content

Commit 0ef7547

Browse files
authored
Merge pull request #27 from RuiSiang/proxy-bug-patch
Proxy bug patch
2 parents 517439c + a36d53b commit 0ef7547

File tree

3 files changed

+32
-23
lines changed

3 files changed

+32
-23
lines changed

USAGE.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@ npm start
3838
Run without db (mock redis)
3939

4040
```
41-
npm run start-standalone
41+
npm run start:standalone # linux
42+
npm run start:standalone-win # windows
4243
```
4344

4445
Test functionalities(optional)

docker-compose.example.yaml

Lines changed: 28 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -2,30 +2,37 @@ version: '3.4'
22

33
services:
44
pow-shield:
5+
container_name: pow-shield
56
image: ruisiang/pow-shield
67
environment:
7-
- PORT=3000
8-
- SESSION_KEY="abcdefghijklmnop"
9-
- POW=on
10-
- NONCE_VALIDITY=60000
11-
- INITIAL_DIFFICULTY=13
12-
- BACKEND_URL="http://example.com"
13-
- DATABASE_HOST=redis
14-
- DATABASE_PORT=6379
15-
- DATABASE_PASSWORD=
16-
- RATE_LIMIT=on
17-
- RATE_LIMIT_SAMPLE_MINUTES=60
18-
- RATE_LIMIT_SESSION_THRESHOLD=100
19-
- RATE_LIMIT_BAN_IP=on
20-
- RATE_LIMIT_IP_THRESHOLD=500
21-
- RATE_LIMIT_BAN_MINUTES=15
22-
- WAF=on
23-
- WAF_URL_EXCLUDE_RULES=
24-
- WAF_HEADER_EXCLUDE_RULES=14,33,80,96,100
25-
- WAF_BODY_EXCLUDE_RULES=
26-
expose:
27-
- '3000'
8+
- 'PORT=3000'
9+
- 'SESSION_KEY=abcdefghijklmnop'
10+
- 'POW=on'
11+
- 'NONCE_VALIDITY=60000'
12+
- 'INITIAL_DIFFICULTY=13'
13+
- 'BACKEND_URL=http://webapp:3000'
14+
- 'DATABASE_HOST=redis'
15+
- 'DATABASE_PORT=6379'
16+
- 'DATABASE_PASSWORD='
17+
- 'RATE_LIMIT=on'
18+
- 'RATE_LIMIT_SAMPLE_MINUTES=60'
19+
- 'RATE_LIMIT_SESSION_THRESHOLD=100'
20+
- 'RATE_LIMIT_BAN_IP=on'
21+
- 'RATE_LIMIT_IP_THRESHOLD=500'
22+
- 'RATE_LIMIT_BAN_MINUTES=15'
23+
- 'WAF=on'
24+
- 'WAF_URL_EXCLUDE_RULES='
25+
- 'WAF_HEADER_EXCLUDE_RULES=14,33,80,96,100'
26+
- 'WAF_BODY_EXCLUDE_RULES='
2827
ports:
2928
- '3000:3000'
3029
redis:
30+
container_name: redis
3131
image: redis:alpine
32+
33+
#####################################
34+
# Test hello-world webapp container #
35+
#####################################
36+
webapp:
37+
container_name: webapp
38+
image: heroku/nodejs-hello-world

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44
"private": true,
55
"scripts": {
66
"start": "node dist/bin/server.js",
7-
"start-standalone": "set NODE_ENV=standalone&& node dist/bin/server.js",
7+
"start:standalone": "NODE_ENV=standalone node dist/bin/server.js",
8+
"start:standalone-win": "set NODE_ENV=standalone&& node dist/bin/server.js",
89
"test": "jest --runInBand --forceExit --detectOpenHandles",
910
"build": "bash scripts/build.sh",
1011
"update-static": "bash scripts/update-static.sh"

0 commit comments

Comments
 (0)