mirror of
https://github.com/BradNut/TofuStack
synced 2025-09-08 17:40:26 +00:00
added redis config to deployment
This commit is contained in:
parent
8fb7a0ea9d
commit
6514c99e05
3 changed files with 9 additions and 3 deletions
|
|
@ -2,3 +2,4 @@ ORIGIN=http://localhost:5173
|
|||
|
||||
# Database
|
||||
DATABASE_URL=postgresql://postgres:postgres@localhost:5432/postgres
|
||||
REDIS_URL=redis://localhost:6379
|
||||
|
|
@ -11,7 +11,11 @@ services:
|
|||
envVars:
|
||||
- key: DATABASE_URL
|
||||
fromDatabase:
|
||||
name: postgres
|
||||
name: db
|
||||
property: connectionString
|
||||
- key: REDIS_URL
|
||||
fromDatabase:
|
||||
name: redis
|
||||
property: connectionString
|
||||
- key: PUBLIC_ORIGIN
|
||||
fromDatabase:
|
||||
|
|
@ -22,6 +26,6 @@ services:
|
|||
ipAllowList: [] # Only allow internal connections
|
||||
|
||||
databases:
|
||||
- name: postgres
|
||||
- name: db
|
||||
databaseName: postgres
|
||||
ipAllowList: []
|
||||
|
|
|
|||
|
|
@ -2,8 +2,9 @@ import { rateLimiter } from "hono-rate-limiter";
|
|||
import { RedisStore } from 'rate-limit-redis'
|
||||
import RedisClient from 'ioredis'
|
||||
import type { HonoTypes } from "../types";
|
||||
import { config } from "../common/config";
|
||||
|
||||
const client = new RedisClient()
|
||||
const client = new RedisClient(config.REDIS_URL)
|
||||
|
||||
export function limiter({ limit, minutes, key = "" }: {
|
||||
limit: number;
|
||||
|
|
|
|||
Loading…
Reference in a new issue