prod maint

This commit is contained in:
degradin 2025-03-16 13:35:56 +03:00
parent 5f06f9b373
commit 768693f859
3 changed files with 37 additions and 5 deletions

21
.env.production Normal file
View File

@ -0,0 +1,21 @@
# Настройки Next.js
NEXT_PUBLIC_URL=https://kubek.campfiregg.ru
NEXT_PUBLIC_API_URL=https://kubek.campfiregg.ru/api
# Настройки сервера
PORT=3000
NODE_ENV=production
# База данных
MONGODB_URI=mongodb://localhost:27017/campfire-id
# Безопасность
JWT_SECRET=your-super-secret-key-change-in-production
# Telegram WebApp
NEXT_PUBLIC_BOT_USERNAME=CampFireIDBot
NEXT_PUBLIC_BOT_TOKEN=7641998551:AAF_2-av1rUy_-icQ1fsfHOyYBGFt8cEmE4
NEXT_PUBLIC_WEBAPP_URL=https://t.me/CampFireIDBot/app
# Telegram Bot
TELEGRAM_BOT_TOKEN=7641998551:AAF_2-av1rUy_-icQ1fsfHOyYBGFt8cEmE4

View File

@ -5,7 +5,7 @@ const nextConfig = {
output: 'standalone',
experimental: {
serverActions: {
allowedOrigins: ['telegram.org', 't.me'],
allowedOrigins: ['telegram.org', 't.me', 'kubek.campfiregg.ru'],
},
},
webpack: (config) => {
@ -16,7 +16,7 @@ const nextConfig = {
return config;
},
images: {
domains: ['t.me', 'telegram.org'],
domains: ['t.me', 'telegram.org', 'kubek.campfiregg.ru'],
},
async headers() {
return [
@ -27,6 +27,10 @@ const nextConfig = {
key: 'Access-Control-Allow-Origin',
value: '*',
},
{
key: 'Content-Security-Policy',
value: "default-src 'self' telegram.org *.telegram.org t.me kubek.campfiregg.ru data: 'unsafe-inline' 'unsafe-eval';"
}
],
},
];
@ -34,6 +38,11 @@ const nextConfig = {
typescript: {
ignoreBuildErrors: true,
},
poweredByHeader: false,
compress: true,
productionBrowserSourceMaps: false,
basePath: '',
assetPrefix: process.env.NODE_ENV === 'production' ? 'https://kubek.campfiregg.ru' : ''
}
module.exports = nextConfig

View File

@ -7,7 +7,9 @@
"dev": "next dev",
"build": "next build",
"start": "next start",
"lint": "next lint"
"lint": "next lint",
"prod:build": "NODE_ENV=production next build",
"prod:start": "NODE_ENV=production next start -p 3000"
},
"dependencies": {
"@chakra-ui/next-js": "^2.2.0",
@ -25,7 +27,7 @@
"framer-motion": "^11.0.8",
"jsonwebtoken": "^9.0.2",
"mongoose": "^8.2.1",
"next": "15.2.2",
"next": "13.5.8",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"zod": "^3.22.4"
@ -36,7 +38,7 @@
"@types/react": "^18.2.61",
"@types/react-dom": "^18.2.19",
"eslint": "^8.57.0",
"eslint-config-next": "15.2.2",
"eslint-config-next": "13.5.8",
"prettier": "^3.0.3",
"typescript": "^5.3.3"
}