Skip to content

Commit

Permalink
Merge pull request #27 from RuiSiang/proxy-bug-patch
Browse files Browse the repository at this point in the history
Proxy bug patch
  • Loading branch information
RuiSiang committed Apr 9, 2021
2 parents 517439c + a36d53b commit 0ef7547
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 23 deletions.
3 changes: 2 additions & 1 deletion USAGE.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ npm start
Run without db (mock redis)

```
npm run start-standalone
npm run start:standalone # linux
npm run start:standalone-win # windows
```

Test functionalities(optional)
Expand Down
49 changes: 28 additions & 21 deletions docker-compose.example.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,30 +2,37 @@ version: '3.4'

services:
pow-shield:
container_name: pow-shield
image: ruisiang/pow-shield
environment:
- PORT=3000
- SESSION_KEY="abcdefghijklmnop"
- POW=on
- NONCE_VALIDITY=60000
- INITIAL_DIFFICULTY=13
- BACKEND_URL="http://example.com"
- DATABASE_HOST=redis
- DATABASE_PORT=6379
- DATABASE_PASSWORD=
- RATE_LIMIT=on
- RATE_LIMIT_SAMPLE_MINUTES=60
- RATE_LIMIT_SESSION_THRESHOLD=100
- RATE_LIMIT_BAN_IP=on
- RATE_LIMIT_IP_THRESHOLD=500
- RATE_LIMIT_BAN_MINUTES=15
- WAF=on
- WAF_URL_EXCLUDE_RULES=
- WAF_HEADER_EXCLUDE_RULES=14,33,80,96,100
- WAF_BODY_EXCLUDE_RULES=
expose:
- '3000'
- 'PORT=3000'
- 'SESSION_KEY=abcdefghijklmnop'
- 'POW=on'
- 'NONCE_VALIDITY=60000'
- 'INITIAL_DIFFICULTY=13'
- 'BACKEND_URL=http://webapp:3000'
- 'DATABASE_HOST=redis'
- 'DATABASE_PORT=6379'
- 'DATABASE_PASSWORD='
- 'RATE_LIMIT=on'
- 'RATE_LIMIT_SAMPLE_MINUTES=60'
- 'RATE_LIMIT_SESSION_THRESHOLD=100'
- 'RATE_LIMIT_BAN_IP=on'
- 'RATE_LIMIT_IP_THRESHOLD=500'
- 'RATE_LIMIT_BAN_MINUTES=15'
- 'WAF=on'
- 'WAF_URL_EXCLUDE_RULES='
- 'WAF_HEADER_EXCLUDE_RULES=14,33,80,96,100'
- 'WAF_BODY_EXCLUDE_RULES='
ports:
- '3000:3000'
redis:
container_name: redis
image: redis:alpine

#####################################
# Test hello-world webapp container #
#####################################
webapp:
container_name: webapp
image: heroku/nodejs-hello-world
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
"private": true,
"scripts": {
"start": "node dist/bin/server.js",
"start-standalone": "set NODE_ENV=standalone&& node dist/bin/server.js",
"start:standalone": "NODE_ENV=standalone node dist/bin/server.js",
"start:standalone-win": "set NODE_ENV=standalone&& node dist/bin/server.js",
"test": "jest --runInBand --forceExit --detectOpenHandles",
"build": "bash scripts/build.sh",
"update-static": "bash scripts/update-static.sh"
Expand Down

0 comments on commit 0ef7547

Please sign in to comment.