From 89e66d6093f70f668fcc7649aea3a5632a31ddfe Mon Sep 17 00:00:00 2001 From: poignatov Date: Mon, 2 Feb 2026 19:16:49 +0300 Subject: [PATCH] =?UTF-8?q?4.7.1:=20=D0=A4=D0=B8=D0=BA=D1=81=20=D0=BE?= =?UTF-8?q?=D1=82=D0=BA=D1=80=D1=8B=D1=82=D0=B8=D1=8F=20=D0=B0=D0=B4=D0=BC?= =?UTF-8?q?=D0=B8=D0=BD-=D0=BF=D0=B0=D0=BD=D0=B5=D0=BB=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- VERSION | 2 +- nginx-unified.conf | 15 ++- play-life-backend/admin.html | 119 ++++++++++++++++-- play-life-backend/main.go | 74 ++++++++--- .../000009_add_is_admin_to_users.down.sql | 9 ++ .../000009_add_is_admin_to_users.up.sql | 12 ++ play-life-web/nginx.conf | 15 ++- play-life-web/package.json | 2 +- play-life-web/src/components/Profile.jsx | 32 +++++ play-life-web/vite.config.js | 30 +++++ 10 files changed, 282 insertions(+), 28 deletions(-) create mode 100644 play-life-backend/migrations/000009_add_is_admin_to_users.down.sql create mode 100644 play-life-backend/migrations/000009_add_is_admin_to_users.up.sql diff --git a/VERSION b/VERSION index f6cdf40..7c66fca 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -4.7.0 +4.7.1 diff --git a/nginx-unified.conf b/nginx-unified.conf index f39541a..cc09d7c 100644 --- a/nginx-unified.conf +++ b/nginx-unified.conf @@ -49,8 +49,21 @@ server { proxy_cache_bypass $http_upgrade; } + # Proxy admin panel to backend (must be before location /) + location ^~ /admin { + proxy_pass http://localhost:8080; + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection 'upgrade'; + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $scheme; + proxy_cache_bypass $http_upgrade; + } + # Proxy other API endpoints to backend - location ~ ^/(playlife-feed|d2dc349a-0d13-49b2-a8f0-1ab094bfba9b|projects|project/priority|project/move|project/delete|project/create|message/post|weekly_goals/setup|admin|admin\.html)$ { + location ~ ^/(playlife-feed|d2dc349a-0d13-49b2-a8f0-1ab094bfba9b|projects|project/priority|project/move|project/delete|project/create|message/post|weekly_goals/setup)$ { proxy_pass http://localhost:8080; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; diff --git a/play-life-backend/admin.html b/play-life-backend/admin.html index 0ad9e10..799c82e 100644 --- a/play-life-backend/admin.html +++ b/play-life-backend/admin.html @@ -161,10 +161,52 @@ color: white; } + .auth-error { + background: white; + padding: 30px; + border-radius: 10px; + text-align: center; + max-width: 500px; + margin: 50px auto; + box-shadow: 0 4px 6px rgba(0,0,0,0.1); + } + + .auth-error h2 { + color: #f44336; + margin-bottom: 15px; + } + + .auth-error p { + color: #666; + margin-bottom: 20px; + } + + .auth-error a { + display: inline-block; + padding: 10px 20px; + background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); + color: white; + text-decoration: none; + border-radius: 5px; + font-weight: 600; + } + + .auth-error a:hover { + opacity: 0.9; + } + -
+ + +

🎯 Play Life Backend - Admin Panel

@@ -214,12 +256,63 @@