CI/CD and more sensible authentication limiting
This commit is contained in:
19
.github/workflows/deploy.yml
vendored
Normal file
19
.github/workflows/deploy.yml
vendored
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
name: Deploy
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [main]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
deploy:
|
||||||
|
runs-on: self-hosted
|
||||||
|
steps:
|
||||||
|
- name: Pull latest
|
||||||
|
run: git -C /home/adipu/LabWise pull
|
||||||
|
|
||||||
|
- name: Install dependencies
|
||||||
|
run: |
|
||||||
|
cd /home/adipu/LabWise
|
||||||
|
PATH="/home/adipu/.local/node20/bin:$PATH" npm install --prefix server
|
||||||
|
|
||||||
|
- name: Restart app
|
||||||
|
run: systemctl --user restart labwise-app
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
import rateLimit from 'express-rate-limit';
|
import rateLimit from 'express-rate-limit';
|
||||||
|
|
||||||
export const authRateLimiter = rateLimit({
|
export const authRateLimiter = rateLimit({
|
||||||
windowMs: 15 * 60 * 1000, // 15 minutes
|
windowMs: 60 * 1000, // 1 minute
|
||||||
max: 20,
|
max: 20,
|
||||||
standardHeaders: true,
|
standardHeaders: true,
|
||||||
legacyHeaders: false,
|
legacyHeaders: false,
|
||||||
|
|||||||
Reference in New Issue
Block a user