From 768693f859dbe03138c125311525a026ebc96193 Mon Sep 17 00:00:00 2001 From: degradin Date: Sun, 16 Mar 2025 13:35:56 +0300 Subject: [PATCH] prod maint --- .env.production | 21 +++++++++++++++++++++ next.config.js | 13 +++++++++++-- package.json | 8 +++++--- 3 files changed, 37 insertions(+), 5 deletions(-) create mode 100644 .env.production diff --git a/.env.production b/.env.production new file mode 100644 index 0000000..75dfe75 --- /dev/null +++ b/.env.production @@ -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 \ No newline at end of file diff --git a/next.config.js b/next.config.js index 0acf92d..9b388c8 100644 --- a/next.config.js +++ b/next.config.js @@ -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 \ No newline at end of file diff --git a/package.json b/package.json index 5757c2e..e4465bc 100644 --- a/package.json +++ b/package.json @@ -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" }