Hardcode+middleware
This commit is contained in:
parent
ce4c6ab985
commit
74d0b5e7f2
|
|
@ -284,9 +284,9 @@ qr-master/
|
||||||
|
|
||||||
| Variable | Description | Required | Default |
|
| Variable | Description | Required | Default |
|
||||||
| ------------------------------------ | ----------------------------- | -------- | ---------------------------------------------------------------------- |
|
| ------------------------------------ | ----------------------------- | -------- | ---------------------------------------------------------------------- |
|
||||||
| `DATABASE_URL` | PostgreSQL connection string | Yes | `postgresql://postgres:postgres@localhost:5435/qrmaster?schema=public` |
|
| `DATABASE_URL` | PostgreSQL connection string | Yes | - |
|
||||||
| `NEXTAUTH_URL` | Application URL | Yes | `http://localhost:3050` |
|
| `NEXTAUTH_URL` | Application URL | Yes | `http://localhost:3050` |
|
||||||
| `NEXTAUTH_SECRET` | Secret for JWT encryption | Yes | Generate with `openssl rand -base64 32` |
|
| `NEXTAUTH_SECRET` | Secret for JWT encryption | Yes | - (Generate with `openssl rand -base64 32`) |
|
||||||
| `IP_SALT` | Salt for IP hashing (privacy) | Yes | Generate with `openssl rand -base64 32` |
|
| `IP_SALT` | Salt for IP hashing (privacy) | Yes | Generate with `openssl rand -base64 32` |
|
||||||
| `GOOGLE_CLIENT_ID` | Google OAuth client ID | No | - |
|
| `GOOGLE_CLIENT_ID` | Google OAuth client ID | No | - |
|
||||||
| `GOOGLE_CLIENT_SECRET` | Google OAuth client secret | No | - |
|
| `GOOGLE_CLIENT_SECRET` | Google OAuth client secret | No | - |
|
||||||
|
|
|
||||||
|
|
@ -5,9 +5,9 @@ services:
|
||||||
container_name: qrmaster-db-dev
|
container_name: qrmaster-db-dev
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
environment:
|
environment:
|
||||||
POSTGRES_USER: postgres
|
POSTGRES_USER: ${POSTGRES_USER}
|
||||||
POSTGRES_PASSWORD: postgres
|
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
|
||||||
POSTGRES_DB: qrmaster
|
POSTGRES_DB: ${POSTGRES_DB}
|
||||||
POSTGRES_INITDB_ARGS: "-E UTF8 --locale=en_US.utf8"
|
POSTGRES_INITDB_ARGS: "-E UTF8 --locale=en_US.utf8"
|
||||||
ports:
|
ports:
|
||||||
- "5435:5432"
|
- "5435:5432"
|
||||||
|
|
|
||||||
|
|
@ -5,9 +5,9 @@ services:
|
||||||
container_name: qrmaster-db
|
container_name: qrmaster-db
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
environment:
|
environment:
|
||||||
POSTGRES_USER: ${POSTGRES_USER:-postgres}
|
POSTGRES_USER: ${POSTGRES_USER}
|
||||||
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-postgres}
|
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
|
||||||
POSTGRES_DB: ${POSTGRES_DB:-qrmaster}
|
POSTGRES_DB: ${POSTGRES_DB}
|
||||||
POSTGRES_INITDB_ARGS: "-E UTF8 --locale=en_US.utf8"
|
POSTGRES_INITDB_ARGS: "-E UTF8 --locale=en_US.utf8"
|
||||||
ports:
|
ports:
|
||||||
- "5435:5432"
|
- "5435:5432"
|
||||||
|
|
@ -51,11 +51,11 @@ services:
|
||||||
- "3050:3000"
|
- "3050:3000"
|
||||||
environment:
|
environment:
|
||||||
NODE_ENV: production
|
NODE_ENV: production
|
||||||
DATABASE_URL: postgresql://${POSTGRES_USER:-postgres}:${POSTGRES_PASSWORD:-postgres}@db:5432/${POSTGRES_DB:-qrmaster}?schema=public
|
DATABASE_URL: postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@db:5432/${POSTGRES_DB}?schema=public
|
||||||
DIRECT_URL: postgresql://${POSTGRES_USER:-postgres}:${POSTGRES_PASSWORD:-postgres}@db:5432/${POSTGRES_DB:-qrmaster}?schema=public
|
DIRECT_URL: postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@db:5432/${POSTGRES_DB}?schema=public
|
||||||
REDIS_URL: redis://redis:6379
|
REDIS_URL: redis://redis:6379
|
||||||
NEXTAUTH_URL: ${NEXTAUTH_URL:-http://localhost:3050}
|
NEXTAUTH_URL: ${NEXTAUTH_URL}
|
||||||
NEXTAUTH_SECRET: ${NEXTAUTH_SECRET:-your-secret-key-change-in-production}
|
NEXTAUTH_SECRET: ${NEXTAUTH_SECRET}
|
||||||
NEXT_PUBLIC_APP_URL: ${NEXT_PUBLIC_APP_URL:-http://localhost:3050}
|
NEXT_PUBLIC_APP_URL: ${NEXT_PUBLIC_APP_URL:-http://localhost:3050}
|
||||||
IP_SALT: ${IP_SALT:-your-salt-change-in-production}
|
IP_SALT: ${IP_SALT:-your-salt-change-in-production}
|
||||||
ENABLE_DEMO: ${ENABLE_DEMO:-false}
|
ENABLE_DEMO: ${ENABLE_DEMO:-false}
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,10 @@ NODE_ENV=development
|
||||||
PORT=3000
|
PORT=3000
|
||||||
|
|
||||||
# Database Configuration (PostgreSQL)
|
# Database Configuration (PostgreSQL)
|
||||||
|
POSTGRES_USER=postgres
|
||||||
|
POSTGRES_PASSWORD=postgres
|
||||||
|
POSTGRES_DB=qrmaster
|
||||||
|
|
||||||
# For local development (without Docker):
|
# For local development (without Docker):
|
||||||
# DATABASE_URL=postgresql://postgres:postgres@localhost:5435/qrmaster?schema=public
|
# DATABASE_URL=postgresql://postgres:postgres@localhost:5435/qrmaster?schema=public
|
||||||
# For Docker Compose (internal Docker network):
|
# For Docker Compose (internal Docker network):
|
||||||
|
|
|
||||||
|
|
@ -87,7 +87,7 @@ switch ($choice) {
|
||||||
Write-Host "Access points:"
|
Write-Host "Access points:"
|
||||||
Write-Host " - App: http://localhost:3050"
|
Write-Host " - App: http://localhost:3050"
|
||||||
Write-Host " - Database UI: http://localhost:8080"
|
Write-Host " - Database UI: http://localhost:8080"
|
||||||
Write-Host " - Database: localhost:5432"
|
Write-Host " - Database: localhost:5435"
|
||||||
Write-Host " - Redis: localhost:6379"
|
Write-Host " - Redis: localhost:6379"
|
||||||
}
|
}
|
||||||
"2" {
|
"2" {
|
||||||
|
|
@ -115,7 +115,7 @@ switch ($choice) {
|
||||||
Write-Host ""
|
Write-Host ""
|
||||||
Write-Host "Access points:"
|
Write-Host "Access points:"
|
||||||
Write-Host " - App: http://localhost:3050"
|
Write-Host " - App: http://localhost:3050"
|
||||||
Write-Host " - Database: localhost:5432"
|
Write-Host " - Database: localhost:5435"
|
||||||
Write-Host " - Redis: localhost:6379"
|
Write-Host " - Redis: localhost:6379"
|
||||||
Write-Host ""
|
Write-Host ""
|
||||||
Write-Host "To view logs:"
|
Write-Host "To view logs:"
|
||||||
|
|
|
||||||
|
|
@ -98,7 +98,7 @@ case $choice in
|
||||||
echo "Access points:"
|
echo "Access points:"
|
||||||
echo " - App: http://localhost:3050"
|
echo " - App: http://localhost:3050"
|
||||||
echo " - Database UI: http://localhost:8080"
|
echo " - Database UI: http://localhost:8080"
|
||||||
echo " - Database: localhost:5432"
|
echo " - Database: localhost:5435"
|
||||||
echo " - Redis: localhost:6379"
|
echo " - Redis: localhost:6379"
|
||||||
;;
|
;;
|
||||||
2)
|
2)
|
||||||
|
|
@ -126,7 +126,7 @@ case $choice in
|
||||||
echo ""
|
echo ""
|
||||||
echo "Access points:"
|
echo "Access points:"
|
||||||
echo " - App: http://localhost:3050"
|
echo " - App: http://localhost:3050"
|
||||||
echo " - Database: localhost:5432"
|
echo " - Database: localhost:5435"
|
||||||
echo " - Redis: localhost:6379"
|
echo " - Redis: localhost:6379"
|
||||||
echo ""
|
echo ""
|
||||||
echo "To view logs:"
|
echo "To view logs:"
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@ import { z } from 'zod';
|
||||||
const envSchema = z.object({
|
const envSchema = z.object({
|
||||||
NODE_ENV: z.enum(['development', 'production', 'test']).default('development'),
|
NODE_ENV: z.enum(['development', 'production', 'test']).default('development'),
|
||||||
PORT: z.string().default('3000'),
|
PORT: z.string().default('3000'),
|
||||||
DATABASE_URL: z.string().default('postgresql://postgres:postgres@localhost:5432/qrmaster?schema=public'),
|
DATABASE_URL: z.string(),
|
||||||
NEXTAUTH_URL: z.string().default('http://localhost:3050'),
|
NEXTAUTH_URL: z.string().default('http://localhost:3050'),
|
||||||
NEXTAUTH_SECRET: z.string().default('development-secret-change-in-production'),
|
NEXTAUTH_SECRET: z.string().default('development-secret-change-in-production'),
|
||||||
GOOGLE_CLIENT_ID: z.string().optional(),
|
GOOGLE_CLIENT_ID: z.string().optional(),
|
||||||
|
|
|
||||||
|
|
@ -23,6 +23,10 @@ export function middleware(req: NextRequest) {
|
||||||
'/barcode-generator',
|
'/barcode-generator',
|
||||||
'/custom-qr-code-generator',
|
'/custom-qr-code-generator',
|
||||||
'/manage-qr-codes',
|
'/manage-qr-codes',
|
||||||
|
'/coupon',
|
||||||
|
'/feedback',
|
||||||
|
'/vcard',
|
||||||
|
'/display',
|
||||||
];
|
];
|
||||||
|
|
||||||
// Check if path is public
|
// Check if path is public
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue