Первый комит
This commit is contained in:
commit
d184307981
3
.gitignore
vendored
Normal file
3
.gitignore
vendored
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
node_modules
|
||||||
|
# Keep environment variables out of version control
|
||||||
|
.env
|
8
.idea/.gitignore
generated
vendored
Normal file
8
.idea/.gitignore
generated
vendored
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
# Default ignored files
|
||||||
|
/shelf/
|
||||||
|
/workspace.xml
|
||||||
|
# Editor-based HTTP Client requests
|
||||||
|
/httpRequests/
|
||||||
|
# Datasource local storage ignored files
|
||||||
|
/dataSources/
|
||||||
|
/dataSources.local.xml
|
12
.idea/__server.iml
generated
Normal file
12
.idea/__server.iml
generated
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<module type="WEB_MODULE" version="4">
|
||||||
|
<component name="NewModuleRootManager">
|
||||||
|
<content url="file://$MODULE_DIR$">
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/.tmp" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/temp" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/tmp" />
|
||||||
|
</content>
|
||||||
|
<orderEntry type="inheritedJdk" />
|
||||||
|
<orderEntry type="sourceFolder" forTests="false" />
|
||||||
|
</component>
|
||||||
|
</module>
|
8
.idea/modules.xml
generated
Normal file
8
.idea/modules.xml
generated
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="ProjectModuleManager">
|
||||||
|
<modules>
|
||||||
|
<module fileurl="file://$PROJECT_DIR$/.idea/__server.iml" filepath="$PROJECT_DIR$/.idea/__server.iml" />
|
||||||
|
</modules>
|
||||||
|
</component>
|
||||||
|
</project>
|
6
.idea/vcs.xml
generated
Normal file
6
.idea/vcs.xml
generated
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="VcsDirectoryMappings">
|
||||||
|
<mapping directory="$PROJECT_DIR$" vcs="Git" />
|
||||||
|
</component>
|
||||||
|
</project>
|
2
gg.txt
Normal file
2
gg.txt
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
aws s3 ls s3://russcult --endpoint-url https://s3.regru.cloud
|
||||||
|
SSL validation failed for https://s3.regru.cloud/russcult?list-type=2&prefix=&delimiter=%2F&encoding-type=url [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self-signed certificate in certificate chain (_ssl.c:1000)
|
25
logs/.3963f25f71f55fe10bae9a77fb9dac3bfc6a0ff9-audit.json
Normal file
25
logs/.3963f25f71f55fe10bae9a77fb9dac3bfc6a0ff9-audit.json
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
{
|
||||||
|
"keep": {
|
||||||
|
"days": true,
|
||||||
|
"amount": 14
|
||||||
|
},
|
||||||
|
"auditLog": "logs\\.3963f25f71f55fe10bae9a77fb9dac3bfc6a0ff9-audit.json",
|
||||||
|
"files": [
|
||||||
|
{
|
||||||
|
"date": 1737491441425,
|
||||||
|
"name": "logs\\2025-01-21-server.log",
|
||||||
|
"hash": "54d6f0e9e1c9f3bef959db621c76d35b17b119dc818596408531d3328e7e81e7"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"date": 1737547484760,
|
||||||
|
"name": "logs\\2025-01-22-server.log",
|
||||||
|
"hash": "14d037430ed862ed87b7171fe0dde60a8e1899b44c09cf608219bd0599ef1123"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"date": 1737626379634,
|
||||||
|
"name": "logs\\2025-01-23-server.log",
|
||||||
|
"hash": "4a6e15f12493f7ed2997015c5040d0303131b6f6d54aa77e1e88530128ab1b26"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"hashType": "sha256"
|
||||||
|
}
|
45
logs/.fccedf8ec723689a9b3fe46c233201bef1488f72-audit.json
Normal file
45
logs/.fccedf8ec723689a9b3fe46c233201bef1488f72-audit.json
Normal file
@ -0,0 +1,45 @@
|
|||||||
|
{
|
||||||
|
"keep": {
|
||||||
|
"days": true,
|
||||||
|
"amount": 14
|
||||||
|
},
|
||||||
|
"auditLog": "logs\\.fccedf8ec723689a9b3fe46c233201bef1488f72-audit.json",
|
||||||
|
"files": [
|
||||||
|
{
|
||||||
|
"date": 1737627693892,
|
||||||
|
"name": "logs\\23-01-2025-server.log",
|
||||||
|
"hash": "d933c871ed8be22b70e69d6d60e76bfa36ea16491863e74d6a29bb95485a5911"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"date": 1737712760907,
|
||||||
|
"name": "logs\\24-01-2025-server.log",
|
||||||
|
"hash": "4e122ebce4fcefb2d51bb10d545620d67f4a2326adbe9e6b448185fa7983558d"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"date": 1737808151907,
|
||||||
|
"name": "logs\\25-01-2025-server.log",
|
||||||
|
"hash": "c516c143f0afba99de2d6c0ccc8d52fc0e056d8b67462a1a0fc52cb9973b0750"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"date": 1737839056658,
|
||||||
|
"name": "logs\\26-01-2025-server.log",
|
||||||
|
"hash": "ec8618694837659bf2e76d7584dd8f113807569d04b4d8066d816547ee9fb5f7"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"date": 1737973675956,
|
||||||
|
"name": "logs\\27-01-2025-server.log",
|
||||||
|
"hash": "fcf05c71fda401614248d536ddf14f1b8dcdabb6fc8b2b8784951528ad905593"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"date": 1738076171742,
|
||||||
|
"name": "logs\\28-01-2025-server.log",
|
||||||
|
"hash": "1219d8fa17a639245b81b09fd447fe3819a16c7b91cf0076c639e2e99573d4d6"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"date": 1738177920318,
|
||||||
|
"name": "logs\\29-01-2025-server.log",
|
||||||
|
"hash": "a130d01c6d7afa2d0e25bd08102deb22016d6d986b981c8ca5e7cc6332961148"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"hashType": "sha256"
|
||||||
|
}
|
37
logs/23-01-2025-server.log
Normal file
37
logs/23-01-2025-server.log
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
23-01-2025 13:53:16:5316 info: Server running on port 5000
|
||||||
|
23-01-2025 13:53:28:5328 info: Login attempt for user: supervisor@mail.ru
|
||||||
|
23-01-2025 13:53:28:5328 debug: Generated token for user: d7535049-d839-401f-a027-dcec13ebdf28
|
||||||
|
23-01-2025 13:53:28:5328 info: User logged in successfully: supervisor@mail.ru
|
||||||
|
23-01-2025 13:53:28:5328 info: POST /api/auth/login 200 159ms
|
||||||
|
23-01-2025 13:57:42:5742 [info] Server running on port 5000
|
||||||
|
[${info.timestamp}] [${paddedLevel}] ${info.message}
|
||||||
|
[23-01-2025 14:13:48:1348] [ info] Server running on port 5000
|
||||||
|
[23-01-2025 14:16:45:1645] [ info] Server running on port 5000
|
||||||
|
[23-01-2025 14:17:14:1714] [info ] Server running on port 5000
|
||||||
|
23-01-2025 14:18:13:1813 [info ] Server running on port 5000
|
||||||
|
23-01-2025 14:18:32:1832 [info ] Login attempt for user: supervisor@mail.ru
|
||||||
|
23-01-2025 14:18:32:1832 [debug] Generated token for user: d7535049-d839-401f-a027-dcec13ebdf28
|
||||||
|
23-01-2025 14:18:32:1832 [info ] User logged in successfully: supervisor@mail.ru
|
||||||
|
23-01-2025 14:18:32:1832 [info ] POST /api/auth/login 200 148ms
|
||||||
|
[23-01-2025 14:26:18:2618] info : Server running on port 5000
|
||||||
|
[23-01-2025 14:26:48:2648] info : Login attempt for user: supervisor@mail.ru
|
||||||
|
[23-01-2025 14:26:48:2648] debug: Generated token for user: d7535049-d839-401f-a027-dcec13ebdf28
|
||||||
|
[23-01-2025 14:26:48:2648] info : User logged in successfully: supervisor@mail.ru
|
||||||
|
[23-01-2025 14:26:48:2648] info : POST /api/auth/login 200 126ms
|
||||||
|
[23-01-2025 14:28:04:284] info : Server running on port 5000
|
||||||
|
[23-01-2025 14:28:11:2811] info : Login attempt for user: supervisor@mail.ru
|
||||||
|
[23-01-2025 14:28:11:2811] debug : Generated token for user: d7535049-d839-401f-a027-dcec13ebdf28
|
||||||
|
[23-01-2025 14:28:11:2811] info : User logged in successfully: supervisor@mail.ru
|
||||||
|
[23-01-2025 14:28:11:2811] info : POST /api/auth/login 200 128ms
|
||||||
|
[23-01-2025 23:10:35:1035] info : Server running on port 5000
|
||||||
|
[23-01-2025 23:11:14:1114] info : Login attempt for user: supervisor@mail.ru
|
||||||
|
[23-01-2025 23:11:15:1115] debug : Generated token for user: d7535049-d839-401f-a027-dcec13ebdf28
|
||||||
|
[23-01-2025 23:11:15:1115] info : User logged in successfully: supervisor@mail.ru
|
||||||
|
[23-01-2025 23:11:15:1115] http : ::ffff:127.0.0.1 - - [23/Jan/2025:20:11:15 +0000] "POST /api/auth/login HTTP/1.1" 200 325 "-" "PostmanRuntime/7.43.0"
|
||||||
|
[23-01-2025 23:11:15:1115] info : POST /api/auth/login 200 8484ms
|
||||||
|
[23-01-2025 23:13:27:1327] http : ::1 - - [23/Jan/2025:20:13:27 +0000] "OPTIONS /api/auth/login HTTP/1.1" 204 0 "http://127.0.0.1:5173/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
|
||||||
|
[23-01-2025 23:13:32:1332] info : Login attempt for user: supervisor@mail.ru
|
||||||
|
[23-01-2025 23:13:33:1333] debug : Generated token for user: d7535049-d839-401f-a027-dcec13ebdf28
|
||||||
|
[23-01-2025 23:13:33:1333] info : User logged in successfully: supervisor@mail.ru
|
||||||
|
[23-01-2025 23:13:33:1333] http : ::1 - - [23/Jan/2025:20:13:33 +0000] "POST /api/auth/login HTTP/1.1" 200 325 "http://127.0.0.1:5173/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
|
||||||
|
[23-01-2025 23:13:33:1333] info : POST /api/auth/login 200 5844ms
|
190
logs/24-01-2025-server.log
Normal file
190
logs/24-01-2025-server.log
Normal file
@ -0,0 +1,190 @@
|
|||||||
|
[24-01-2025 14:58:56:5856] info : Server running on port 5000
|
||||||
|
[24-01-2025 15:02:05:25] http : ::1 - - [24/Jan/2025:12:02:05 +0000] "OPTIONS /api/auth/login HTTP/1.1" 204 0 "http://127.0.0.1:5173/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
|
||||||
|
[24-01-2025 15:02:05:25] info : Login attempt for user: supervisor@mail.ru
|
||||||
|
[24-01-2025 15:02:05:25] debug : Generated token for user: d7535049-d839-401f-a027-dcec13ebdf28
|
||||||
|
[24-01-2025 15:02:05:25] info : User logged in successfully: supervisor@mail.ru
|
||||||
|
[24-01-2025 15:02:05:25] http : ::1 - - [24/Jan/2025:12:02:05 +0000] "POST /api/auth/login HTTP/1.1" 200 325 "http://127.0.0.1:5173/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
|
||||||
|
[24-01-2025 15:02:05:25] info : POST /api/auth/login 200 136ms
|
||||||
|
[24-01-2025 15:02:23:223] http : ::1 - - [24/Jan/2025:12:02:23 +0000] "OPTIONS /api/auth/me HTTP/1.1" 204 0 "http://127.0.0.1:5173/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
|
||||||
|
[24-01-2025 15:02:23:223] http : ::1 - - [24/Jan/2025:12:02:23 +0000] "OPTIONS /api/auth/me HTTP/1.1" 204 0 "http://127.0.0.1:5173/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
|
||||||
|
[24-01-2025 15:02:23:223] http : ::1 - - [24/Jan/2025:12:02:23 +0000] "GET /api/auth/me HTTP/1.1" 200 118 "http://127.0.0.1:5173/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
|
||||||
|
[24-01-2025 15:02:23:223] info : GET /api/auth/me 200 58ms
|
||||||
|
[24-01-2025 15:02:23:223] http : ::1 - - [24/Jan/2025:12:02:23 +0000] "GET /api/auth/me HTTP/1.1" 304 - "http://127.0.0.1:5173/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
|
||||||
|
[24-01-2025 15:02:23:223] info : GET /api/auth/me 304 11ms
|
||||||
|
[24-01-2025 15:02:27:227] http : ::1 - - [24/Jan/2025:12:02:27 +0000] "OPTIONS /api/auth/login HTTP/1.1" 204 0 "http://127.0.0.1:5173/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
|
||||||
|
[24-01-2025 15:02:27:227] info : Login attempt for user: supervisor@mail.ru
|
||||||
|
[24-01-2025 15:02:27:227] debug : Generated token for user: d7535049-d839-401f-a027-dcec13ebdf28
|
||||||
|
[24-01-2025 15:02:27:227] info : User logged in successfully: supervisor@mail.ru
|
||||||
|
[24-01-2025 15:02:27:227] http : ::1 - - [24/Jan/2025:12:02:27 +0000] "POST /api/auth/login HTTP/1.1" 200 325 "http://127.0.0.1:5173/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
|
||||||
|
[24-01-2025 15:02:27:227] info : POST /api/auth/login 200 73ms
|
||||||
|
[24-01-2025 15:02:27:227] http : ::1 - - [24/Jan/2025:12:02:27 +0000] "OPTIONS /api/users HTTP/1.1" 204 0 "http://127.0.0.1:5173/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
|
||||||
|
[24-01-2025 15:02:27:227] http : ::1 - - [24/Jan/2025:12:02:27 +0000] "OPTIONS /api/users HTTP/1.1" 204 0 "http://127.0.0.1:5173/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
|
||||||
|
[24-01-2025 15:02:27:227] http : ::1 - - [24/Jan/2025:12:02:27 +0000] "GET /api/users HTTP/1.1" 403 33 "http://127.0.0.1:5173/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
|
||||||
|
[24-01-2025 15:02:27:227] warn : GET /api/users 403 10ms
|
||||||
|
[24-01-2025 15:02:27:227] http : ::1 - - [24/Jan/2025:12:02:27 +0000] "GET /api/users HTTP/1.1" 403 33 "http://127.0.0.1:5173/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
|
||||||
|
[24-01-2025 15:02:27:227] warn : GET /api/users 403 9ms
|
||||||
|
[24-01-2025 15:03:51:351] http : ::1 - - [24/Jan/2025:12:03:51 +0000] "OPTIONS /api/users HTTP/1.1" 204 0 "http://127.0.0.1:5173/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
|
||||||
|
[24-01-2025 15:03:51:351] http : ::1 - - [24/Jan/2025:12:03:51 +0000] "GET /api/users HTTP/1.1" 403 33 "http://127.0.0.1:5173/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
|
||||||
|
[24-01-2025 15:03:51:351] warn : GET /api/users 403 16ms
|
||||||
|
[24-01-2025 15:04:45:445] http : ::1 - - [24/Jan/2025:12:04:45 +0000] "OPTIONS /api/users HTTP/1.1" 204 0 "http://127.0.0.1:5173/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
|
||||||
|
[24-01-2025 15:04:45:445] http : ::1 - - [24/Jan/2025:12:04:45 +0000] "GET /api/users HTTP/1.1" 403 33 "http://127.0.0.1:5173/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
|
||||||
|
[24-01-2025 15:04:45:445] warn : GET /api/users 403 19ms
|
||||||
|
[24-01-2025 15:58:00:580] info : Server running on port 5000
|
||||||
|
[24-01-2025 15:58:08:588] http : ::1 - - [24/Jan/2025:12:58:08 +0000] "OPTIONS /api/auth/me HTTP/1.1" 204 0 "http://127.0.0.1:5173/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
|
||||||
|
[24-01-2025 15:58:08:588] http : ::1 - - [24/Jan/2025:12:58:08 +0000] "OPTIONS /api/auth/me HTTP/1.1" 204 0 "http://127.0.0.1:5173/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
|
||||||
|
[24-01-2025 15:58:34:5834] http : ::1 - - [24/Jan/2025:12:58:34 +0000] "GET /api/auth/me HTTP/1.1" 304 - "http://127.0.0.1:5173/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
|
||||||
|
[24-01-2025 15:58:34:5834] info : GET /api/auth/me 304 25159ms
|
||||||
|
[24-01-2025 15:58:34:5834] http : ::1 - - [24/Jan/2025:12:58:34 +0000] "GET /api/auth/me HTTP/1.1" 200 118 "http://127.0.0.1:5173/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
|
||||||
|
[24-01-2025 15:58:34:5834] info : GET /api/auth/me 200 4185ms
|
||||||
|
[24-01-2025 15:58:41:5841] http : ::1 - - [24/Jan/2025:12:58:41 +0000] "OPTIONS /api/auth/login HTTP/1.1" 204 0 "http://127.0.0.1:5173/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
|
||||||
|
[24-01-2025 15:58:57:5857] info : Login attempt for user: supervisor@mail.ru
|
||||||
|
[24-01-2025 15:59:07:597] debug : Generated token for user: d7535049-d839-401f-a027-dcec13ebdf28
|
||||||
|
[24-01-2025 15:59:07:597] info : User logged in successfully: supervisor@mail.ru
|
||||||
|
[24-01-2025 15:59:07:597] http : ::1 - - [24/Jan/2025:12:59:07 +0000] "POST /api/auth/login HTTP/1.1" 200 325 "http://127.0.0.1:5173/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
|
||||||
|
[24-01-2025 15:59:07:597] info : POST /api/auth/login 200 25825ms
|
||||||
|
[24-01-2025 15:59:07:597] http : ::1 - - [24/Jan/2025:12:59:07 +0000] "OPTIONS /api/users HTTP/1.1" 204 0 "http://127.0.0.1:5173/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
|
||||||
|
[24-01-2025 15:59:07:597] http : ::1 - - [24/Jan/2025:12:59:07 +0000] "OPTIONS /api/users HTTP/1.1" 204 0 "http://127.0.0.1:5173/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
|
||||||
|
[24-01-2025 15:59:16:5916] http : ::1 - - [24/Jan/2025:12:59:16 +0000] "GET /api/users HTTP/1.1" 403 33 "http://127.0.0.1:5173/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
|
||||||
|
[24-01-2025 15:59:16:5916] warn : GET /api/users 403 9356ms
|
||||||
|
[24-01-2025 15:59:59:5959] http : ::1 - - [24/Jan/2025:12:59:59 +0000] "GET /api/users HTTP/1.1" 403 33 "http://127.0.0.1:5173/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
|
||||||
|
[24-01-2025 15:59:59:5959] warn : GET /api/users 403 42730ms
|
||||||
|
[24-01-2025 16:02:47:247] http : ::1 - - [24/Jan/2025:13:02:47 +0000] "OPTIONS /api/auth/me HTTP/1.1" 204 0 "http://127.0.0.1:5173/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
|
||||||
|
[24-01-2025 16:02:47:247] http : ::1 - - [24/Jan/2025:13:02:47 +0000] "OPTIONS /api/auth/me HTTP/1.1" 204 0 "http://127.0.0.1:5173/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
|
||||||
|
[24-01-2025 16:03:07:37] http : ::1 - - [24/Jan/2025:13:03:07 +0000] "GET /api/auth/me HTTP/1.1" 304 - "http://127.0.0.1:5173/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
|
||||||
|
[24-01-2025 16:03:07:37] info : GET /api/auth/me 304 20150ms
|
||||||
|
[24-01-2025 16:03:14:314] http : ::1 - - [24/Jan/2025:13:03:14 +0000] "GET /api/auth/me HTTP/1.1" 200 118 "http://127.0.0.1:5173/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
|
||||||
|
[24-01-2025 16:03:14:314] info : GET /api/auth/me 200 6597ms
|
||||||
|
[24-01-2025 16:03:32:332] http : ::1 - - [24/Jan/2025:13:03:32 +0000] "OPTIONS /api/auth/login HTTP/1.1" 204 0 "http://127.0.0.1:5173/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
|
||||||
|
[24-01-2025 16:03:32:332] info : Login attempt for user: supervisor@mail.ru
|
||||||
|
[24-01-2025 16:03:32:332] debug : Generated token for user: d7535049-d839-401f-a027-dcec13ebdf28
|
||||||
|
[24-01-2025 16:03:32:332] info : User logged in successfully: supervisor@mail.ru
|
||||||
|
[24-01-2025 16:03:32:332] http : ::1 - - [24/Jan/2025:13:03:32 +0000] "POST /api/auth/login HTTP/1.1" 200 325 "http://127.0.0.1:5173/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
|
||||||
|
[24-01-2025 16:03:32:332] info : POST /api/auth/login 200 73ms
|
||||||
|
[24-01-2025 16:03:32:332] http : ::1 - - [24/Jan/2025:13:03:32 +0000] "OPTIONS /api/users HTTP/1.1" 204 0 "http://127.0.0.1:5173/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
|
||||||
|
[24-01-2025 16:03:32:332] http : ::1 - - [24/Jan/2025:13:03:32 +0000] "OPTIONS /api/users HTTP/1.1" 204 0 "http://127.0.0.1:5173/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
|
||||||
|
[24-01-2025 16:04:10:410] http : ::1 - - [24/Jan/2025:13:04:10 +0000] "GET /api/users HTTP/1.1" 403 33 "http://127.0.0.1:5173/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
|
||||||
|
[24-01-2025 16:04:10:410] warn : GET /api/users 403 38267ms
|
||||||
|
[24-01-2025 16:04:15:415] http : ::1 - - [24/Jan/2025:13:04:15 +0000] "GET /api/users HTTP/1.1" 403 33 "http://127.0.0.1:5173/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
|
||||||
|
[24-01-2025 16:04:15:415] warn : GET /api/users 403 5127ms
|
||||||
|
[24-01-2025 16:05:18:518] http : ::1 - - [24/Jan/2025:13:05:18 +0000] "OPTIONS /api/auth/me HTTP/1.1" 204 0 "http://127.0.0.1:5173/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
|
||||||
|
[24-01-2025 16:05:18:518] http : ::1 - - [24/Jan/2025:13:05:18 +0000] "OPTIONS /api/auth/me HTTP/1.1" 204 0 "http://127.0.0.1:5173/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
|
||||||
|
[24-01-2025 16:05:21:521] http : ::1 - - [24/Jan/2025:13:05:21 +0000] "GET /api/auth/me HTTP/1.1" 200 160 "http://127.0.0.1:5173/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
|
||||||
|
[24-01-2025 16:05:21:521] info : GET /api/auth/me 200 2586ms
|
||||||
|
[24-01-2025 16:05:22:522] http : ::1 - - [24/Jan/2025:13:05:22 +0000] "GET /api/auth/me HTTP/1.1" 304 - "http://127.0.0.1:5173/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
|
||||||
|
[24-01-2025 16:05:22:522] info : GET /api/auth/me 304 924ms
|
||||||
|
[24-01-2025 16:05:33:533] http : ::1 - - [24/Jan/2025:13:05:33 +0000] "OPTIONS /api/auth/login HTTP/1.1" 204 0 "http://127.0.0.1:5173/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
|
||||||
|
[24-01-2025 16:05:33:533] info : Login attempt for user: supervisor@mail.ru
|
||||||
|
[24-01-2025 16:05:33:533] debug : Generated token for user: d7535049-d839-401f-a027-dcec13ebdf28
|
||||||
|
[24-01-2025 16:05:33:533] info : User logged in successfully: supervisor@mail.ru
|
||||||
|
[24-01-2025 16:05:33:533] http : ::1 - - [24/Jan/2025:13:05:33 +0000] "POST /api/auth/login HTTP/1.1" 200 367 "http://127.0.0.1:5173/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
|
||||||
|
[24-01-2025 16:05:33:533] info : POST /api/auth/login 200 110ms
|
||||||
|
[24-01-2025 16:05:33:533] http : ::1 - - [24/Jan/2025:13:05:33 +0000] "OPTIONS /api/users HTTP/1.1" 204 0 "http://127.0.0.1:5173/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
|
||||||
|
[24-01-2025 16:05:33:533] http : ::1 - - [24/Jan/2025:13:05:33 +0000] "OPTIONS /api/users HTTP/1.1" 204 0 "http://127.0.0.1:5173/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
|
||||||
|
[24-01-2025 16:05:46:546] http : ::1 - - [24/Jan/2025:13:05:46 +0000] "GET /api/users HTTP/1.1" 500 24 "http://127.0.0.1:5173/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
|
||||||
|
[24-01-2025 16:05:46:546] error : GET /api/users 500 12932ms
|
||||||
|
[24-01-2025 16:05:51:551] http : ::1 - - [24/Jan/2025:13:05:51 +0000] "GET /api/users HTTP/1.1" 500 24 "http://127.0.0.1:5173/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
|
||||||
|
[24-01-2025 16:05:51:551] error : GET /api/users 500 4790ms
|
||||||
|
[24-01-2025 16:07:51:751] http : ::1 - - [24/Jan/2025:13:07:51 +0000] "OPTIONS /api/auth/me HTTP/1.1" 204 0 "http://127.0.0.1:5173/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
|
||||||
|
[24-01-2025 16:07:51:751] http : ::1 - - [24/Jan/2025:13:07:51 +0000] "OPTIONS /api/auth/me HTTP/1.1" 204 0 "http://127.0.0.1:5173/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
|
||||||
|
[24-01-2025 16:07:51:751] http : ::1 - - [24/Jan/2025:13:07:51 +0000] "GET /api/auth/me HTTP/1.1" 304 - "http://127.0.0.1:5173/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
|
||||||
|
[24-01-2025 16:07:51:751] info : GET /api/auth/me 304 18ms
|
||||||
|
[24-01-2025 16:07:51:751] http : ::1 - - [24/Jan/2025:13:07:51 +0000] "GET /api/auth/me HTTP/1.1" 304 - "http://127.0.0.1:5173/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
|
||||||
|
[24-01-2025 16:07:51:751] info : GET /api/auth/me 304 11ms
|
||||||
|
[24-01-2025 16:07:52:752] http : ::1 - - [24/Jan/2025:13:07:52 +0000] "OPTIONS /api/auth/login HTTP/1.1" 204 0 "http://127.0.0.1:5173/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
|
||||||
|
[24-01-2025 16:07:52:752] info : Login attempt for user: supervisor@mail.ru
|
||||||
|
[24-01-2025 16:07:52:752] debug : Generated token for user: d7535049-d839-401f-a027-dcec13ebdf28
|
||||||
|
[24-01-2025 16:07:52:752] info : User logged in successfully: supervisor@mail.ru
|
||||||
|
[24-01-2025 16:07:52:752] http : ::1 - - [24/Jan/2025:13:07:52 +0000] "POST /api/auth/login HTTP/1.1" 200 367 "http://127.0.0.1:5173/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
|
||||||
|
[24-01-2025 16:07:52:752] info : POST /api/auth/login 200 74ms
|
||||||
|
[24-01-2025 16:07:52:752] http : ::1 - - [24/Jan/2025:13:07:52 +0000] "OPTIONS /api/users HTTP/1.1" 204 0 "http://127.0.0.1:5173/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
|
||||||
|
[24-01-2025 16:07:52:752] http : ::1 - - [24/Jan/2025:13:07:52 +0000] "OPTIONS /api/users HTTP/1.1" 204 0 "http://127.0.0.1:5173/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
|
||||||
|
[24-01-2025 16:08:09:89] http : ::1 - - [24/Jan/2025:13:08:09 +0000] "GET /api/users HTTP/1.1" 200 619 "http://127.0.0.1:5173/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
|
||||||
|
[24-01-2025 16:08:09:89] info : GET /api/users 200 16946ms
|
||||||
|
[24-01-2025 16:08:13:813] http : ::1 - - [24/Jan/2025:13:08:13 +0000] "GET /api/users HTTP/1.1" 304 - "http://127.0.0.1:5173/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
|
||||||
|
[24-01-2025 16:08:13:813] info : GET /api/users 304 4271ms
|
||||||
|
[24-01-2025 16:10:19:1019] http : ::1 - - [24/Jan/2025:13:10:19 +0000] "OPTIONS /api/users HTTP/1.1" 204 0 "http://127.0.0.1:5173/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
|
||||||
|
[24-01-2025 16:10:29:1029] http : ::1 - - [24/Jan/2025:13:10:29 +0000] "GET /api/users HTTP/1.1" 304 - "http://127.0.0.1:5173/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
|
||||||
|
[24-01-2025 16:10:29:1029] info : GET /api/users 304 10496ms
|
||||||
|
[24-01-2025 16:11:13:1113] http : ::1 - - [24/Jan/2025:13:11:13 +0000] "OPTIONS /api/users/3af07615-3a97-48cd-8c79-c9943709fa94/permissions HTTP/1.1" 204 0 "http://127.0.0.1:5173/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
|
||||||
|
[24-01-2025 16:11:13:1113] http : ::1 - - [24/Jan/2025:13:11:13 +0000] "PUT /api/users/3af07615-3a97-48cd-8c79-c9943709fa94/permissions HTTP/1.1" 200 175 "http://127.0.0.1:5173/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
|
||||||
|
[24-01-2025 16:11:13:1113] info : PUT /api/users/3af07615-3a97-48cd-8c79-c9943709fa94/permissions 200 141ms
|
||||||
|
[24-01-2025 16:11:15:1115] http : ::1 - - [24/Jan/2025:13:11:15 +0000] "PUT /api/users/3af07615-3a97-48cd-8c79-c9943709fa94/permissions HTTP/1.1" 200 187 "http://127.0.0.1:5173/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
|
||||||
|
[24-01-2025 16:11:15:1115] info : PUT /api/users/3af07615-3a97-48cd-8c79-c9943709fa94/permissions 200 525ms
|
||||||
|
[24-01-2025 16:11:16:1116] http : ::1 - - [24/Jan/2025:13:11:16 +0000] "PUT /api/users/3af07615-3a97-48cd-8c79-c9943709fa94/permissions HTTP/1.1" 200 201 "http://127.0.0.1:5173/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
|
||||||
|
[24-01-2025 16:11:16:1116] info : PUT /api/users/3af07615-3a97-48cd-8c79-c9943709fa94/permissions 200 83ms
|
||||||
|
[24-01-2025 16:12:33:1233] http : ::1 - - [24/Jan/2025:13:12:33 +0000] "OPTIONS /api/users HTTP/1.1" 204 0 "http://127.0.0.1:5173/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
|
||||||
|
[24-01-2025 16:12:35:1235] http : ::1 - - [24/Jan/2025:13:12:35 +0000] "GET /api/users HTTP/1.1" 200 667 "http://127.0.0.1:5173/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
|
||||||
|
[24-01-2025 16:12:35:1235] info : GET /api/users 200 2510ms
|
||||||
|
[24-01-2025 16:12:56:1256] http : ::1 - - [24/Jan/2025:13:12:56 +0000] "OPTIONS /api/users HTTP/1.1" 204 0 "http://127.0.0.1:5173/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
|
||||||
|
[24-01-2025 16:12:59:1259] http : ::1 - - [24/Jan/2025:13:12:59 +0000] "GET /api/users HTTP/1.1" 304 - "http://127.0.0.1:5173/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
|
||||||
|
[24-01-2025 16:12:59:1259] info : GET /api/users 304 3254ms
|
||||||
|
[24-01-2025 16:13:46:1346] http : ::1 - - [24/Jan/2025:13:13:46 +0000] "OPTIONS /api/users HTTP/1.1" 204 0 "http://127.0.0.1:5173/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
|
||||||
|
[24-01-2025 16:13:46:1346] http : ::1 - - [24/Jan/2025:13:13:46 +0000] "GET /api/users HTTP/1.1" 304 - "http://127.0.0.1:5173/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
|
||||||
|
[24-01-2025 16:13:46:1346] info : GET /api/users 304 28ms
|
||||||
|
[24-01-2025 16:14:55:1455] http : ::1 - - [24/Jan/2025:13:14:55 +0000] "OPTIONS /api/users HTTP/1.1" 204 0 "http://127.0.0.1:5173/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
|
||||||
|
[24-01-2025 16:14:55:1455] http : ::1 - - [24/Jan/2025:13:14:55 +0000] "GET /api/users HTTP/1.1" 304 - "http://127.0.0.1:5173/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
|
||||||
|
[24-01-2025 16:14:55:1455] info : GET /api/users 304 33ms
|
||||||
|
[24-01-2025 16:15:11:1511] http : ::1 - - [24/Jan/2025:13:15:11 +0000] "OPTIONS /api/users/3af07615-3a97-48cd-8c79-c9943709fa94/permissions HTTP/1.1" 204 0 "http://127.0.0.1:5173/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
|
||||||
|
[24-01-2025 16:15:11:1511] http : ::1 - - [24/Jan/2025:13:15:11 +0000] "PUT /api/users/3af07615-3a97-48cd-8c79-c9943709fa94/permissions HTTP/1.1" 200 211 "http://127.0.0.1:5173/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
|
||||||
|
[24-01-2025 16:15:11:1511] info : PUT /api/users/3af07615-3a97-48cd-8c79-c9943709fa94/permissions 200 108ms
|
||||||
|
[24-01-2025 16:15:59:1559] http : ::1 - - [24/Jan/2025:13:15:59 +0000] "OPTIONS /api/users/3af07615-3a97-48cd-8c79-c9943709fa94/permissions HTTP/1.1" 204 0 "http://127.0.0.1:5173/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
|
||||||
|
[24-01-2025 16:15:59:1559] http : ::1 - - [24/Jan/2025:13:15:59 +0000] "PUT /api/users/3af07615-3a97-48cd-8c79-c9943709fa94/permissions HTTP/1.1" 200 235 "http://127.0.0.1:5173/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
|
||||||
|
[24-01-2025 16:15:59:1559] info : PUT /api/users/3af07615-3a97-48cd-8c79-c9943709fa94/permissions 200 168ms
|
||||||
|
[24-01-2025 16:28:00:280] http : ::1 - - [24/Jan/2025:13:28:00 +0000] "OPTIONS /api/users HTTP/1.1" 204 0 "http://127.0.0.1:5173/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
|
||||||
|
[24-01-2025 16:28:00:280] http : ::1 - - [24/Jan/2025:13:28:00 +0000] "OPTIONS /api/users HTTP/1.1" 204 0 "http://127.0.0.1:5173/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
|
||||||
|
[24-01-2025 16:28:00:280] http : ::1 - - [24/Jan/2025:13:28:00 +0000] "GET /api/users HTTP/1.1" 200 701 "http://127.0.0.1:5173/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
|
||||||
|
[24-01-2025 16:28:00:280] info : GET /api/users 200 107ms
|
||||||
|
[24-01-2025 16:28:00:280] http : ::1 - - [24/Jan/2025:13:28:00 +0000] "GET /api/users HTTP/1.1" 304 - "http://127.0.0.1:5173/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
|
||||||
|
[24-01-2025 16:28:00:280] info : GET /api/users 304 15ms
|
||||||
|
[24-01-2025 16:28:08:288] http : ::1 - - [24/Jan/2025:13:28:08 +0000] "OPTIONS /api/auth/me HTTP/1.1" 204 0 "http://127.0.0.1:5173/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
|
||||||
|
[24-01-2025 16:28:08:288] http : ::1 - - [24/Jan/2025:13:28:08 +0000] "OPTIONS /api/auth/me HTTP/1.1" 204 0 "http://127.0.0.1:5173/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
|
||||||
|
[24-01-2025 16:28:08:288] http : ::1 - - [24/Jan/2025:13:28:08 +0000] "GET /api/auth/me HTTP/1.1" 304 - "http://127.0.0.1:5173/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
|
||||||
|
[24-01-2025 16:28:08:288] info : GET /api/auth/me 304 10ms
|
||||||
|
[24-01-2025 16:28:08:288] http : ::1 - - [24/Jan/2025:13:28:08 +0000] "GET /api/auth/me HTTP/1.1" 304 - "http://127.0.0.1:5173/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
|
||||||
|
[24-01-2025 16:28:08:288] info : GET /api/auth/me 304 10ms
|
||||||
|
[24-01-2025 16:28:09:289] http : ::1 - - [24/Jan/2025:13:28:09 +0000] "OPTIONS /api/auth/login HTTP/1.1" 204 0 "http://127.0.0.1:5173/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
|
||||||
|
[24-01-2025 16:28:09:289] info : Login attempt for user: supervisor@mail.ru
|
||||||
|
[24-01-2025 16:28:09:289] debug : Generated token for user: d7535049-d839-401f-a027-dcec13ebdf28
|
||||||
|
[24-01-2025 16:28:09:289] info : User logged in successfully: supervisor@mail.ru
|
||||||
|
[24-01-2025 16:28:09:289] http : ::1 - - [24/Jan/2025:13:28:09 +0000] "POST /api/auth/login HTTP/1.1" 200 367 "http://127.0.0.1:5173/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
|
||||||
|
[24-01-2025 16:28:09:289] info : POST /api/auth/login 200 113ms
|
||||||
|
[24-01-2025 16:47:56:4756] http : ::1 - - [24/Jan/2025:13:47:56 +0000] "OPTIONS /api/auth/me HTTP/1.1" 204 0 "http://127.0.0.1:5173/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
|
||||||
|
[24-01-2025 16:47:56:4756] http : ::1 - - [24/Jan/2025:13:47:56 +0000] "OPTIONS /api/auth/me HTTP/1.1" 204 0 "http://127.0.0.1:5173/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
|
||||||
|
[24-01-2025 16:47:58:4758] http : ::1 - - [24/Jan/2025:13:47:58 +0000] "OPTIONS /api/auth/login HTTP/1.1" 204 0 "http://127.0.0.1:5173/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
|
||||||
|
[24-01-2025 16:47:58:4758] info : Login attempt for user: supervisor@mail.ru
|
||||||
|
[24-01-2025 16:47:58:4758] debug : Generated token for user: d7535049-d839-401f-a027-dcec13ebdf28
|
||||||
|
[24-01-2025 16:47:58:4758] info : User logged in successfully: supervisor@mail.ru
|
||||||
|
[24-01-2025 16:47:58:4758] http : ::1 - - [24/Jan/2025:13:47:58 +0000] "POST /api/auth/login HTTP/1.1" 200 367 "http://127.0.0.1:5173/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
|
||||||
|
[24-01-2025 16:47:58:4758] info : POST /api/auth/login 200 109ms
|
||||||
|
[24-01-2025 23:15:17:1517] info : Server running on port 5000
|
||||||
|
[24-01-2025 23:15:23:1523] http : ::1 - - [24/Jan/2025:20:15:23 +0000] "OPTIONS /api/auth/login HTTP/1.1" 204 0 "http://127.0.0.1:5173/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
|
||||||
|
[24-01-2025 23:15:23:1523] info : Login attempt for user: supervisor@mail.ru
|
||||||
|
[24-01-2025 23:15:23:1523] debug : Generated token for user: d7535049-d839-401f-a027-dcec13ebdf28
|
||||||
|
[24-01-2025 23:15:23:1523] info : User logged in successfully: supervisor@mail.ru
|
||||||
|
[24-01-2025 23:15:23:1523] http : ::1 - - [24/Jan/2025:20:15:23 +0000] "POST /api/auth/login HTTP/1.1" 200 367 "http://127.0.0.1:5173/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
|
||||||
|
[24-01-2025 23:15:23:1523] info : POST /api/auth/login 200 183ms
|
||||||
|
[24-01-2025 23:49:59:4959] info : Server running on port 5000
|
||||||
|
[24-01-2025 23:50:10:5010] http : ::1 - - [24/Jan/2025:20:50:10 +0000] "OPTIONS /api/auth/me HTTP/1.1" 204 0 "http://127.0.0.1:5173/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
|
||||||
|
[24-01-2025 23:50:10:5010] http : ::1 - - [24/Jan/2025:20:50:10 +0000] "OPTIONS /api/auth/me HTTP/1.1" 204 0 "http://127.0.0.1:5173/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
|
||||||
|
[24-01-2025 23:50:10:5010] http : ::1 - - [24/Jan/2025:20:50:10 +0000] "GET /api/auth/me HTTP/1.1" 304 - "http://127.0.0.1:5173/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
|
||||||
|
[24-01-2025 23:50:10:5010] info : GET /api/auth/me 304 90ms
|
||||||
|
[24-01-2025 23:50:10:5010] http : ::1 - - [24/Jan/2025:20:50:10 +0000] "GET /api/auth/me HTTP/1.1" 304 - "http://127.0.0.1:5173/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
|
||||||
|
[24-01-2025 23:50:10:5010] info : GET /api/auth/me 304 9ms
|
||||||
|
[24-01-2025 23:50:12:5012] http : ::1 - - [24/Jan/2025:20:50:12 +0000] "OPTIONS /api/auth/login HTTP/1.1" 204 0 "http://127.0.0.1:5173/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
|
||||||
|
[24-01-2025 23:50:12:5012] info : Login attempt for user: supervisor@mail.ru
|
||||||
|
[24-01-2025 23:50:12:5012] debug : Generated token for user: d7535049-d839-401f-a027-dcec13ebdf28
|
||||||
|
[24-01-2025 23:50:12:5012] info : User logged in successfully: supervisor@mail.ru
|
||||||
|
[24-01-2025 23:50:12:5012] http : ::1 - - [24/Jan/2025:20:50:12 +0000] "POST /api/auth/login HTTP/1.1" 200 367 "http://127.0.0.1:5173/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
|
||||||
|
[24-01-2025 23:50:12:5012] info : POST /api/auth/login 200 117ms
|
||||||
|
[24-01-2025 23:55:24:5524] http : ::1 - - [24/Jan/2025:20:55:24 +0000] "OPTIONS /api/auth/me HTTP/1.1" 204 0 "http://127.0.0.1:5173/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
|
||||||
|
[24-01-2025 23:55:24:5524] http : ::1 - - [24/Jan/2025:20:55:24 +0000] "OPTIONS /api/auth/me HTTP/1.1" 204 0 "http://127.0.0.1:5173/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
|
||||||
|
[24-01-2025 23:55:24:5524] http : ::1 - - [24/Jan/2025:20:55:24 +0000] "GET /api/auth/me HTTP/1.1" 304 - "http://127.0.0.1:5173/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
|
||||||
|
[24-01-2025 23:55:24:5524] info : GET /api/auth/me 304 52ms
|
||||||
|
[24-01-2025 23:55:24:5524] http : ::1 - - [24/Jan/2025:20:55:24 +0000] "GET /api/auth/me HTTP/1.1" 304 - "http://127.0.0.1:5173/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
|
||||||
|
[24-01-2025 23:55:24:5524] info : GET /api/auth/me 304 9ms
|
||||||
|
[24-01-2025 23:55:46:5546] http : ::1 - - [24/Jan/2025:20:55:46 +0000] "OPTIONS /api/auth/login HTTP/1.1" 204 0 "http://127.0.0.1:5173/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
|
||||||
|
[24-01-2025 23:55:46:5546] info : Login attempt for user: supervisor@mail.ru
|
||||||
|
[24-01-2025 23:55:47:5547] debug : Generated token for user: d7535049-d839-401f-a027-dcec13ebdf28
|
||||||
|
[24-01-2025 23:55:47:5547] info : User logged in successfully: supervisor@mail.ru
|
||||||
|
[24-01-2025 23:55:47:5547] http : ::1 - - [24/Jan/2025:20:55:47 +0000] "POST /api/auth/login HTTP/1.1" 200 367 "http://127.0.0.1:5173/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
|
||||||
|
[24-01-2025 23:55:47:5547] info : POST /api/auth/login 200 114ms
|
150
logs/25-01-2025-server.log
Normal file
150
logs/25-01-2025-server.log
Normal file
@ -0,0 +1,150 @@
|
|||||||
|
[25-01-2025 15:29:12:2912] info : Server running on port 5000
|
||||||
|
[25-01-2025 15:31:42:3142] http : ::1 - - [25/Jan/2025:12:31:42 +0000] "OPTIONS /api/auth/login HTTP/1.1" 204 0 "http://127.0.0.1:5173/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
|
||||||
|
[25-01-2025 15:31:42:3142] info : Login attempt for user: supervisor@mail.ru
|
||||||
|
[25-01-2025 15:31:42:3142] debug : Generated token for user: d7535049-d839-401f-a027-dcec13ebdf28
|
||||||
|
[25-01-2025 15:31:42:3142] info : User logged in successfully: supervisor@mail.ru
|
||||||
|
[25-01-2025 15:31:42:3142] http : ::1 - - [25/Jan/2025:12:31:42 +0000] "POST /api/auth/login HTTP/1.1" 200 367 "http://127.0.0.1:5173/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
|
||||||
|
[25-01-2025 15:31:42:3142] info : POST /api/auth/login 200 280ms
|
||||||
|
[25-01-2025 15:32:05:325] http : ::1 - - [25/Jan/2025:12:32:05 +0000] "OPTIONS /api/images/upload-url HTTP/1.1" 204 0 "http://127.0.0.1:5173/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
|
||||||
|
[25-01-2025 15:32:05:325] http : ::1 - - [25/Jan/2025:12:32:05 +0000] "POST /api/images/upload-url HTTP/1.1" 404 161 "http://127.0.0.1:5173/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
|
||||||
|
[25-01-2025 15:32:05:325] warn : POST /api/images/upload-url 404 1ms
|
||||||
|
[25-01-2025 15:34:32:3432] info : Server running on port 5000
|
||||||
|
[25-01-2025 15:34:42:3442] http : ::1 - - [25/Jan/2025:12:34:42 +0000] "OPTIONS /api/auth/me HTTP/1.1" 204 0 "http://127.0.0.1:5173/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
|
||||||
|
[25-01-2025 15:34:42:3442] http : ::1 - - [25/Jan/2025:12:34:42 +0000] "OPTIONS /api/auth/me HTTP/1.1" 204 0 "http://127.0.0.1:5173/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
|
||||||
|
[25-01-2025 15:34:42:3442] http : ::1 - - [25/Jan/2025:12:34:42 +0000] "GET /api/auth/me HTTP/1.1" 304 - "http://127.0.0.1:5173/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
|
||||||
|
[25-01-2025 15:34:42:3442] info : GET /api/auth/me 304 73ms
|
||||||
|
[25-01-2025 15:34:42:3442] http : ::1 - - [25/Jan/2025:12:34:42 +0000] "GET /api/auth/me HTTP/1.1" 304 - "http://127.0.0.1:5173/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
|
||||||
|
[25-01-2025 15:34:42:3442] info : GET /api/auth/me 304 10ms
|
||||||
|
[25-01-2025 15:34:44:3444] http : ::1 - - [25/Jan/2025:12:34:44 +0000] "OPTIONS /api/auth/login HTTP/1.1" 204 0 "http://127.0.0.1:5173/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
|
||||||
|
[25-01-2025 15:34:44:3444] info : Login attempt for user: supervisor@mail.ru
|
||||||
|
[25-01-2025 15:34:44:3444] debug : Generated token for user: d7535049-d839-401f-a027-dcec13ebdf28
|
||||||
|
[25-01-2025 15:34:44:3444] info : User logged in successfully: supervisor@mail.ru
|
||||||
|
[25-01-2025 15:34:44:3444] http : ::1 - - [25/Jan/2025:12:34:44 +0000] "POST /api/auth/login HTTP/1.1" 200 367 "http://127.0.0.1:5173/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
|
||||||
|
[25-01-2025 15:34:44:3444] info : POST /api/auth/login 200 117ms
|
||||||
|
[25-01-2025 15:34:51:3451] http : ::1 - - [25/Jan/2025:12:34:51 +0000] "OPTIONS /api/images/upload-url HTTP/1.1" 204 0 "http://127.0.0.1:5173/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
|
||||||
|
[25-01-2025 15:34:51:3451] http : ::1 - - [25/Jan/2025:12:34:51 +0000] "POST /api/images/upload-url HTTP/1.1" 404 161 "http://127.0.0.1:5173/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
|
||||||
|
[25-01-2025 15:34:51:3451] warn : POST /api/images/upload-url 404 1ms
|
||||||
|
[25-01-2025 16:59:53:5953] info : Server running on port 5000
|
||||||
|
[25-01-2025 16:59:57:5957] http : ::1 - - [25/Jan/2025:13:59:57 +0000] "OPTIONS /api/auth/login HTTP/1.1" 204 0 "http://127.0.0.1:5173/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
|
||||||
|
[25-01-2025 16:59:57:5957] info : Login attempt for user: supervisor@mail.ru
|
||||||
|
[25-01-2025 16:59:57:5957] debug : Generated token for user: d7535049-d839-401f-a027-dcec13ebdf28
|
||||||
|
[25-01-2025 16:59:57:5957] info : User logged in successfully: supervisor@mail.ru
|
||||||
|
[25-01-2025 16:59:57:5957] http : ::1 - - [25/Jan/2025:13:59:57 +0000] "POST /api/auth/login HTTP/1.1" 200 367 "http://127.0.0.1:5173/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
|
||||||
|
[25-01-2025 16:59:57:5957] info : POST /api/auth/login 200 217ms
|
||||||
|
[25-01-2025 17:00:21:021] http : ::1 - - [25/Jan/2025:14:00:21 +0000] "OPTIONS /api/images/upload-url HTTP/1.1" 204 0 "http://127.0.0.1:5173/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
|
||||||
|
[25-01-2025 17:00:21:021] http : ::1 - - [25/Jan/2025:14:00:21 +0000] "POST /api/images/upload-url HTTP/1.1" 404 161 "http://127.0.0.1:5173/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
|
||||||
|
[25-01-2025 17:00:21:021] warn : POST /api/images/upload-url 404 1ms
|
||||||
|
[25-01-2025 17:01:16:116] info : Server running on port 5000
|
||||||
|
[25-01-2025 17:01:49:149] http : ::1 - - [25/Jan/2025:14:01:49 +0000] "OPTIONS /api/auth/me HTTP/1.1" 204 0 "http://127.0.0.1:5173/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
|
||||||
|
[25-01-2025 17:01:49:149] http : ::1 - - [25/Jan/2025:14:01:49 +0000] "OPTIONS /api/auth/me HTTP/1.1" 204 0 "http://127.0.0.1:5173/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
|
||||||
|
[25-01-2025 17:01:51:151] http : ::1 - - [25/Jan/2025:14:01:51 +0000] "OPTIONS /api/auth/login HTTP/1.1" 204 0 "http://127.0.0.1:5173/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
|
||||||
|
[25-01-2025 17:01:51:151] info : Login attempt for user: supervisor@mail.ru
|
||||||
|
[25-01-2025 17:01:51:151] debug : Generated token for user: d7535049-d839-401f-a027-dcec13ebdf28
|
||||||
|
[25-01-2025 17:01:51:151] info : User logged in successfully: supervisor@mail.ru
|
||||||
|
[25-01-2025 17:01:51:151] http : ::1 - - [25/Jan/2025:14:01:51 +0000] "POST /api/auth/login HTTP/1.1" 200 367 "http://127.0.0.1:5173/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
|
||||||
|
[25-01-2025 17:01:51:151] info : POST /api/auth/login 200 137ms
|
||||||
|
[25-01-2025 17:01:51:151] http : ::1 - - [25/Jan/2025:14:01:51 +0000] "OPTIONS /api/users HTTP/1.1" 204 0 "http://127.0.0.1:5173/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
|
||||||
|
[25-01-2025 17:01:51:151] http : ::1 - - [25/Jan/2025:14:01:51 +0000] "OPTIONS /api/users HTTP/1.1" 204 0 "http://127.0.0.1:5173/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
|
||||||
|
[25-01-2025 17:01:51:151] http : ::1 - - [25/Jan/2025:14:01:51 +0000] "GET /api/users HTTP/1.1" 304 - "http://127.0.0.1:5173/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
|
||||||
|
[25-01-2025 17:01:51:151] info : GET /api/users 304 143ms
|
||||||
|
[25-01-2025 17:01:51:151] http : ::1 - - [25/Jan/2025:14:01:51 +0000] "GET /api/users HTTP/1.1" 304 - "http://127.0.0.1:5173/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
|
||||||
|
[25-01-2025 17:01:51:151] info : GET /api/users 304 20ms
|
||||||
|
[25-01-2025 23:25:08:258] info : Server running on port 5000
|
||||||
|
[25-01-2025 23:25:34:2534] http : ::1 - - [25/Jan/2025:20:25:34 +0000] "OPTIONS /api/auth/me HTTP/1.1" 204 0 "http://127.0.0.1:5173/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
|
||||||
|
[25-01-2025 23:25:34:2534] http : ::1 - - [25/Jan/2025:20:25:34 +0000] "OPTIONS /api/auth/me HTTP/1.1" 204 0 "http://127.0.0.1:5173/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
|
||||||
|
[25-01-2025 23:25:34:2534] http : ::1 - - [25/Jan/2025:20:25:34 +0000] "GET /api/auth/me HTTP/1.1" 304 - "http://127.0.0.1:5173/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
|
||||||
|
[25-01-2025 23:25:34:2534] info : GET /api/auth/me 304 196ms
|
||||||
|
[25-01-2025 23:25:34:2534] http : ::1 - - [25/Jan/2025:20:25:34 +0000] "GET /api/auth/me HTTP/1.1" 304 - "http://127.0.0.1:5173/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
|
||||||
|
[25-01-2025 23:25:34:2534] info : GET /api/auth/me 304 16ms
|
||||||
|
[25-01-2025 23:25:35:2535] http : ::1 - - [25/Jan/2025:20:25:35 +0000] "OPTIONS /api/auth/login HTTP/1.1" 204 0 "http://127.0.0.1:5173/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
|
||||||
|
[25-01-2025 23:25:35:2535] info : Login attempt for user: supervisor@mail.ru
|
||||||
|
[25-01-2025 23:25:36:2536] debug : Generated token for user: d7535049-d839-401f-a027-dcec13ebdf28
|
||||||
|
[25-01-2025 23:25:36:2536] info : User logged in successfully: supervisor@mail.ru
|
||||||
|
[25-01-2025 23:25:36:2536] http : ::1 - - [25/Jan/2025:20:25:36 +0000] "POST /api/auth/login HTTP/1.1" 200 367 "http://127.0.0.1:5173/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
|
||||||
|
[25-01-2025 23:25:36:2536] info : POST /api/auth/login 200 239ms
|
||||||
|
[25-01-2025 23:25:44:2544] http : ::1 - - [25/Jan/2025:20:25:44 +0000] "OPTIONS /api/images/upload-url HTTP/1.1" 204 0 "http://127.0.0.1:5173/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
|
||||||
|
[25-01-2025 23:25:44:2544] http : ::1 - - [25/Jan/2025:20:25:44 +0000] "POST /api/images/upload-url HTTP/1.1" 404 161 "http://127.0.0.1:5173/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
|
||||||
|
[25-01-2025 23:25:44:2544] warn : POST /api/images/upload-url 404 2ms
|
||||||
|
[25-01-2025 23:26:39:2639] http : ::1 - - [25/Jan/2025:20:26:39 +0000] "OPTIONS /api/auth/me HTTP/1.1" 204 0 "http://127.0.0.1:5173/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
|
||||||
|
[25-01-2025 23:26:39:2639] http : ::1 - - [25/Jan/2025:20:26:39 +0000] "OPTIONS /api/auth/me HTTP/1.1" 204 0 "http://127.0.0.1:5173/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
|
||||||
|
[25-01-2025 23:26:39:2639] http : ::1 - - [25/Jan/2025:20:26:39 +0000] "GET /api/auth/me HTTP/1.1" 304 - "http://127.0.0.1:5173/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
|
||||||
|
[25-01-2025 23:26:39:2639] info : GET /api/auth/me 304 38ms
|
||||||
|
[25-01-2025 23:26:39:2639] http : ::1 - - [25/Jan/2025:20:26:39 +0000] "GET /api/auth/me HTTP/1.1" 304 - "http://127.0.0.1:5173/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
|
||||||
|
[25-01-2025 23:26:39:2639] info : GET /api/auth/me 304 16ms
|
||||||
|
[25-01-2025 23:26:53:2653] http : ::1 - - [25/Jan/2025:20:26:53 +0000] "OPTIONS /api/images/upload-url HTTP/1.1" 204 0 "http://127.0.0.1:5173/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
|
||||||
|
[25-01-2025 23:26:53:2653] http : ::1 - - [25/Jan/2025:20:26:53 +0000] "POST /api/images/upload-url HTTP/1.1" 404 161 "http://127.0.0.1:5173/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
|
||||||
|
[25-01-2025 23:26:53:2653] warn : POST /api/images/upload-url 404 1ms
|
||||||
|
[25-01-2025 23:27:57:2757] http : ::1 - - [25/Jan/2025:20:27:57 +0000] "OPTIONS /api/auth/me HTTP/1.1" 204 0 "http://127.0.0.1:5173/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
|
||||||
|
[25-01-2025 23:27:57:2757] http : ::1 - - [25/Jan/2025:20:27:57 +0000] "OPTIONS /api/auth/me HTTP/1.1" 204 0 "http://127.0.0.1:5173/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
|
||||||
|
[25-01-2025 23:27:57:2757] http : ::1 - - [25/Jan/2025:20:27:57 +0000] "GET /api/auth/me HTTP/1.1" 304 - "http://127.0.0.1:5173/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
|
||||||
|
[25-01-2025 23:27:57:2757] info : GET /api/auth/me 304 18ms
|
||||||
|
[25-01-2025 23:27:57:2757] http : ::1 - - [25/Jan/2025:20:27:57 +0000] "GET /api/auth/me HTTP/1.1" 304 - "http://127.0.0.1:5173/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
|
||||||
|
[25-01-2025 23:27:57:2757] info : GET /api/auth/me 304 10ms
|
||||||
|
[25-01-2025 23:28:06:286] http : ::1 - - [25/Jan/2025:20:28:06 +0000] "OPTIONS /api/auth/login HTTP/1.1" 204 0 "http://127.0.0.1:5173/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
|
||||||
|
[25-01-2025 23:28:06:286] info : Login attempt for user: supervisor@mail.ru
|
||||||
|
[25-01-2025 23:28:06:286] debug : Generated token for user: d7535049-d839-401f-a027-dcec13ebdf28
|
||||||
|
[25-01-2025 23:28:06:286] info : User logged in successfully: supervisor@mail.ru
|
||||||
|
[25-01-2025 23:28:06:286] http : ::1 - - [25/Jan/2025:20:28:06 +0000] "POST /api/auth/login HTTP/1.1" 200 367 "http://127.0.0.1:5173/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
|
||||||
|
[25-01-2025 23:28:06:286] info : POST /api/auth/login 200 79ms
|
||||||
|
[25-01-2025 23:28:17:2817] http : ::1 - - [25/Jan/2025:20:28:17 +0000] "OPTIONS /api/images/upload-url HTTP/1.1" 204 0 "http://127.0.0.1:5173/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
|
||||||
|
[25-01-2025 23:28:17:2817] http : ::1 - - [25/Jan/2025:20:28:17 +0000] "POST /api/images/upload-url HTTP/1.1" 404 161 "http://127.0.0.1:5173/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
|
||||||
|
[25-01-2025 23:28:17:2817] warn : POST /api/images/upload-url 404 1ms
|
||||||
|
[25-01-2025 23:29:03:293] http : ::1 - - [25/Jan/2025:20:29:03 +0000] "OPTIONS /api/images/upload-url HTTP/1.1" 204 0 "http://127.0.0.1:5173/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
|
||||||
|
[25-01-2025 23:29:03:293] http : ::1 - - [25/Jan/2025:20:29:03 +0000] "POST /api/images/upload-url HTTP/1.1" 404 161 "http://127.0.0.1:5173/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
|
||||||
|
[25-01-2025 23:29:03:293] warn : POST /api/images/upload-url 404 1ms
|
||||||
|
[25-01-2025 23:29:43:2943] http : ::1 - - [25/Jan/2025:20:29:43 +0000] "OPTIONS /api/auth/me HTTP/1.1" 204 0 "http://127.0.0.1:5173/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
|
||||||
|
[25-01-2025 23:29:43:2943] http : ::1 - - [25/Jan/2025:20:29:43 +0000] "OPTIONS /api/auth/me HTTP/1.1" 204 0 "http://127.0.0.1:5173/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
|
||||||
|
[25-01-2025 23:29:43:2943] http : ::1 - - [25/Jan/2025:20:29:43 +0000] "GET /api/auth/me HTTP/1.1" 304 - "http://127.0.0.1:5173/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
|
||||||
|
[25-01-2025 23:29:43:2943] info : GET /api/auth/me 304 20ms
|
||||||
|
[25-01-2025 23:29:43:2943] http : ::1 - - [25/Jan/2025:20:29:43 +0000] "GET /api/auth/me HTTP/1.1" 304 - "http://127.0.0.1:5173/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
|
||||||
|
[25-01-2025 23:29:43:2943] info : GET /api/auth/me 304 18ms
|
||||||
|
[25-01-2025 23:30:29:3029] http : ::1 - - [25/Jan/2025:20:30:29 +0000] "OPTIONS /api/auth/me HTTP/1.1" 204 0 "http://127.0.0.1:5173/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
|
||||||
|
[25-01-2025 23:30:29:3029] http : ::1 - - [25/Jan/2025:20:30:29 +0000] "OPTIONS /api/auth/me HTTP/1.1" 204 0 "http://127.0.0.1:5173/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
|
||||||
|
[25-01-2025 23:30:29:3029] http : ::1 - - [25/Jan/2025:20:30:29 +0000] "GET /api/auth/me HTTP/1.1" 304 - "http://127.0.0.1:5173/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
|
||||||
|
[25-01-2025 23:30:29:3029] info : GET /api/auth/me 304 14ms
|
||||||
|
[25-01-2025 23:30:29:3029] http : ::1 - - [25/Jan/2025:20:30:29 +0000] "GET /api/auth/me HTTP/1.1" 304 - "http://127.0.0.1:5173/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
|
||||||
|
[25-01-2025 23:30:29:3029] info : GET /api/auth/me 304 9ms
|
||||||
|
[25-01-2025 23:30:33:3033] http : ::1 - - [25/Jan/2025:20:30:33 +0000] "OPTIONS /api/auth/login HTTP/1.1" 204 0 "http://127.0.0.1:5173/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
|
||||||
|
[25-01-2025 23:30:33:3033] info : Login attempt for user: supervisor@mail.ru
|
||||||
|
[25-01-2025 23:30:34:3034] debug : Generated token for user: d7535049-d839-401f-a027-dcec13ebdf28
|
||||||
|
[25-01-2025 23:30:34:3034] info : User logged in successfully: supervisor@mail.ru
|
||||||
|
[25-01-2025 23:30:34:3034] http : ::1 - - [25/Jan/2025:20:30:34 +0000] "POST /api/auth/login HTTP/1.1" 200 367 "http://127.0.0.1:5173/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
|
||||||
|
[25-01-2025 23:30:34:3034] info : POST /api/auth/login 200 301ms
|
||||||
|
[25-01-2025 23:30:47:3047] http : ::1 - - [25/Jan/2025:20:30:47 +0000] "OPTIONS /api/images/upload-url HTTP/1.1" 204 0 "http://127.0.0.1:5173/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
|
||||||
|
[25-01-2025 23:30:47:3047] http : ::1 - - [25/Jan/2025:20:30:47 +0000] "POST /api/images/upload-url HTTP/1.1" 404 161 "http://127.0.0.1:5173/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
|
||||||
|
[25-01-2025 23:30:47:3047] warn : POST /api/images/upload-url 404 1ms
|
||||||
|
[25-01-2025 23:32:48:3248] http : ::1 - - [25/Jan/2025:20:32:48 +0000] "OPTIONS /api/images/upload-url HTTP/1.1" 204 0 "http://127.0.0.1:5173/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
|
||||||
|
[25-01-2025 23:32:48:3248] http : ::1 - - [25/Jan/2025:20:32:48 +0000] "POST /api/images/upload-url HTTP/1.1" 404 161 "http://127.0.0.1:5173/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
|
||||||
|
[25-01-2025 23:32:48:3248] warn : POST /api/images/upload-url 404 1ms
|
||||||
|
[25-01-2025 23:37:02:372] http : ::1 - - [25/Jan/2025:20:37:02 +0000] "OPTIONS /api/images/upload-url HTTP/1.1" 204 0 "http://127.0.0.1:5173/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
|
||||||
|
[25-01-2025 23:37:02:372] http : ::1 - - [25/Jan/2025:20:37:02 +0000] "POST /api/images/upload-url HTTP/1.1" 404 161 "http://127.0.0.1:5173/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
|
||||||
|
[25-01-2025 23:37:02:372] warn : POST /api/images/upload-url 404 1ms
|
||||||
|
[25-01-2025 23:41:34:4134] info : Server running on port 5000
|
||||||
|
[25-01-2025 23:41:38:4138] http : ::ffff:127.0.0.1 - - [25/Jan/2025:20:41:38 +0000] "POST /api/images/upload-url HTTP/1.1" 404 161 "-" "PostmanRuntime/7.43.0"
|
||||||
|
[25-01-2025 23:41:38:4138] warn : POST /api/images/upload-url 404 3ms
|
||||||
|
[25-01-2025 23:42:30:4230] http : ::ffff:127.0.0.1 - - [25/Jan/2025:20:42:30 +0000] "POST /images/upload-url HTTP/1.1" 404 157 "-" "PostmanRuntime/7.43.0"
|
||||||
|
[25-01-2025 23:42:30:4230] warn : POST /images/upload-url 404 2ms
|
||||||
|
[25-01-2025 23:51:04:514] info : Server running on port 5000
|
||||||
|
[25-01-2025 23:51:29:5129] http : ::1 - - [25/Jan/2025:20:51:29 +0000] "OPTIONS /api/auth/me HTTP/1.1" 204 0 "http://127.0.0.1:5173/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
|
||||||
|
[25-01-2025 23:51:29:5129] http : ::1 - - [25/Jan/2025:20:51:29 +0000] "OPTIONS /api/auth/me HTTP/1.1" 204 0 "http://127.0.0.1:5173/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
|
||||||
|
[25-01-2025 23:51:29:5129] http : ::1 - - [25/Jan/2025:20:51:29 +0000] "GET /api/auth/me HTTP/1.1" 304 - "http://127.0.0.1:5173/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
|
||||||
|
[25-01-2025 23:51:29:5129] info : GET /api/auth/me 304 63ms
|
||||||
|
[25-01-2025 23:51:29:5129] http : ::1 - - [25/Jan/2025:20:51:29 +0000] "GET /api/auth/me HTTP/1.1" 304 - "http://127.0.0.1:5173/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
|
||||||
|
[25-01-2025 23:51:29:5129] info : GET /api/auth/me 304 9ms
|
||||||
|
[25-01-2025 23:51:31:5131] http : ::1 - - [25/Jan/2025:20:51:31 +0000] "OPTIONS /api/auth/login HTTP/1.1" 204 0 "http://127.0.0.1:5173/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
|
||||||
|
[25-01-2025 23:51:31:5131] info : Login attempt for user: supervisor@mail.ru
|
||||||
|
[25-01-2025 23:51:31:5131] debug : Generated token for user: d7535049-d839-401f-a027-dcec13ebdf28
|
||||||
|
[25-01-2025 23:51:31:5131] info : User logged in successfully: supervisor@mail.ru
|
||||||
|
[25-01-2025 23:51:31:5131] http : ::1 - - [25/Jan/2025:20:51:31 +0000] "POST /api/auth/login HTTP/1.1" 200 367 "http://127.0.0.1:5173/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
|
||||||
|
[25-01-2025 23:51:31:5131] info : POST /api/auth/login 200 118ms
|
||||||
|
[25-01-2025 23:51:40:5140] http : ::1 - - [25/Jan/2025:20:51:40 +0000] "OPTIONS /api/images/upload-url HTTP/1.1" 204 0 "http://127.0.0.1:5173/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
|
||||||
|
[25-01-2025 23:51:40:5140] info : Generated pre-signed URL for upload: uploads/9007b15a-78de-4b64-a3e1-c5dd73fdbe8e-Screenshot 2025-01-24 145245.png
|
||||||
|
[25-01-2025 23:51:40:5140] info : Generated upload URL for image: Screenshot 2025-01-24 145245.png
|
||||||
|
[25-01-2025 23:51:40:5140] http : ::1 - - [25/Jan/2025:20:51:40 +0000] "POST /api/images/upload-url HTTP/1.1" 200 655 "http://127.0.0.1:5173/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
|
||||||
|
[25-01-2025 23:51:40:5140] info : POST /api/images/upload-url 200 23ms
|
||||||
|
[25-01-2025 23:52:18:5218] info : Server running on port 5000
|
||||||
|
[25-01-2025 23:52:42:5242] http : ::1 - - [25/Jan/2025:20:52:42 +0000] "OPTIONS /api/images/upload-url HTTP/1.1" 204 0 "http://127.0.0.1:5173/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
|
||||||
|
[25-01-2025 23:53:44:5344] info : Generated pre-signed URL for upload: uploads/a7f86705-7bcb-432b-8663-6b5432fa9599-Screenshot 2025-01-24 145245.png
|
||||||
|
[25-01-2025 23:54:31:5431] info : Generated upload URL for image: Screenshot 2025-01-24 145245.png
|
||||||
|
[25-01-2025 23:54:38:5438] http : ::1 - - [25/Jan/2025:20:54:38 +0000] "POST /api/images/upload-url HTTP/1.1" 200 655 "http://127.0.0.1:5173/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
|
||||||
|
[25-01-2025 23:54:38:5438] info : POST /api/images/upload-url 200 116204ms
|
0
logs/25-01-2025-server.log.gz
Normal file
0
logs/25-01-2025-server.log.gz
Normal file
26
logs/26-01-2025-server.log
Normal file
26
logs/26-01-2025-server.log
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
[26-01-2025 00:04:16:416] http : ::1 - - [25/Jan/2025:21:04:16 +0000] "OPTIONS /api/auth/me HTTP/1.1" 204 0 "http://127.0.0.1:5173/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
|
||||||
|
[26-01-2025 00:04:16:416] http : ::1 - - [25/Jan/2025:21:04:16 +0000] "GET /api/auth/me HTTP/1.1" - - "http://127.0.0.1:5173/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
|
||||||
|
[26-01-2025 00:33:36:3336] info : Server running on port 5000
|
||||||
|
[26-01-2025 00:33:49:3349] http : ::1 - - [25/Jan/2025:21:33:49 +0000] "OPTIONS /api/auth/me HTTP/1.1" 204 0 "http://127.0.0.1:5173/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
|
||||||
|
[26-01-2025 00:33:49:3349] http : ::1 - - [25/Jan/2025:21:33:49 +0000] "OPTIONS /api/auth/me HTTP/1.1" 204 0 "http://127.0.0.1:5173/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
|
||||||
|
[26-01-2025 00:33:49:3349] http : ::1 - - [25/Jan/2025:21:33:49 +0000] "GET /api/auth/me HTTP/1.1" 200 160 "http://127.0.0.1:5173/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
|
||||||
|
[26-01-2025 00:33:49:3349] info : GET /api/auth/me 200 141ms
|
||||||
|
[26-01-2025 00:33:49:3349] http : ::1 - - [25/Jan/2025:21:33:49 +0000] "GET /api/auth/me HTTP/1.1" 304 - "http://127.0.0.1:5173/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
|
||||||
|
[26-01-2025 00:33:49:3349] info : GET /api/auth/me 304 9ms
|
||||||
|
[26-01-2025 00:33:50:3350] http : ::1 - - [25/Jan/2025:21:33:50 +0000] "OPTIONS /api/auth/login HTTP/1.1" 204 0 "http://127.0.0.1:5173/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
|
||||||
|
[26-01-2025 00:33:50:3350] info : Login attempt for user: supervisor@mail.ru
|
||||||
|
[26-01-2025 00:33:51:3351] debug : Generated token for user: d7535049-d839-401f-a027-dcec13ebdf28
|
||||||
|
[26-01-2025 00:33:51:3351] info : User logged in successfully: supervisor@mail.ru
|
||||||
|
[26-01-2025 00:33:51:3351] http : ::1 - - [25/Jan/2025:21:33:51 +0000] "POST /api/auth/login HTTP/1.1" 200 367 "http://127.0.0.1:5173/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
|
||||||
|
[26-01-2025 00:33:51:3351] info : POST /api/auth/login 200 116ms
|
||||||
|
[26-01-2025 00:33:56:3356] http : ::1 - - [25/Jan/2025:21:33:56 +0000] "OPTIONS /api/images/upload-url HTTP/1.1" 204 0 "http://127.0.0.1:5173/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
|
||||||
|
[26-01-2025 00:33:56:3356] info : Generated pre-signed URL for upload: uploads/5925e347-c76f-46e9-95a1-d2846c711dab-Screenshot 2025-01-24 145245.png
|
||||||
|
[26-01-2025 00:33:56:3356] info : Generated upload URL for image: Screenshot 2025-01-24 145245.png
|
||||||
|
[26-01-2025 00:33:56:3356] http : ::1 - - [25/Jan/2025:21:33:56 +0000] "POST /api/images/upload-url HTTP/1.1" 200 655 "http://127.0.0.1:5173/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
|
||||||
|
[26-01-2025 00:33:56:3356] info : POST /api/images/upload-url 200 15ms
|
||||||
|
[26-01-2025 00:34:20:3420] http : ::1 - - [25/Jan/2025:21:34:20 +0000] "OPTIONS /api/images/upload-url HTTP/1.1" 204 0 "http://127.0.0.1:5173/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
|
||||||
|
[26-01-2025 00:34:20:3420] info : Generated pre-signed URL for upload: uploads/60c58cdc-2fa4-43d2-aa4f-102770cdae60-Screenshot 2025-01-24 145245.png
|
||||||
|
[26-01-2025 00:34:20:3420] info : Generated upload URL for image: Screenshot 2025-01-24 145245.png
|
||||||
|
[26-01-2025 00:34:20:3420] http : ::1 - - [25/Jan/2025:21:34:20 +0000] "POST /api/images/upload-url HTTP/1.1" 200 655 "http://127.0.0.1:5173/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
|
||||||
|
[26-01-2025 00:34:20:3420] info : POST /api/images/upload-url 200 18ms
|
||||||
|
[26-01-2025 00:38:51:3851] info : Server running on port 5000
|
57
logs/27-01-2025-server.log
Normal file
57
logs/27-01-2025-server.log
Normal file
@ -0,0 +1,57 @@
|
|||||||
|
[27-01-2025 13:27:58:2758] info : Server running on port 5000
|
||||||
|
[27-01-2025 13:28:06:286] http : ::1 - - [27/Jan/2025:10:28:06 +0000] "OPTIONS /api/auth/login HTTP/1.1" 204 0 "http://127.0.0.1:5173/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
|
||||||
|
[27-01-2025 13:28:06:286] info : Login attempt for user: supervisor@mail.ru
|
||||||
|
[27-01-2025 13:28:06:286] debug : Generated token for user: d7535049-d839-401f-a027-dcec13ebdf28
|
||||||
|
[27-01-2025 13:28:06:286] info : User logged in successfully: supervisor@mail.ru
|
||||||
|
[27-01-2025 13:28:06:286] http : ::1 - - [27/Jan/2025:10:28:06 +0000] "POST /api/auth/login HTTP/1.1" 200 367 "http://127.0.0.1:5173/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
|
||||||
|
[27-01-2025 13:28:06:286] info : POST /api/auth/login 200 160ms
|
||||||
|
[27-01-2025 13:28:14:2814] http : ::1 - - [27/Jan/2025:10:28:14 +0000] "OPTIONS /api/images/upload-url HTTP/1.1" 204 0 "http://127.0.0.1:5173/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
|
||||||
|
[27-01-2025 13:28:19:2819] info : Generated pre-signed URL for upload: uploads/259fe36c-ff35-4400-8c44-74ff2a2c458d-Screenshot 2025-01-24 145245.png
|
||||||
|
[27-01-2025 13:28:19:2819] info : Generated upload URL for image: Screenshot 2025-01-24 145245.png
|
||||||
|
[27-01-2025 13:28:19:2819] http : ::1 - - [27/Jan/2025:10:28:19 +0000] "POST /api/images/upload-url HTTP/1.1" 200 655 "http://127.0.0.1:5173/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
|
||||||
|
[27-01-2025 13:28:19:2819] info : POST /api/images/upload-url 200 4263ms
|
||||||
|
[27-01-2025 13:36:26:3626] http : ::1 - - [27/Jan/2025:10:36:26 +0000] "OPTIONS /api/images/upload-url HTTP/1.1" 204 0 "http://127.0.0.1:5173/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
|
||||||
|
[27-01-2025 13:36:29:3629] info : Generated pre-signed URL for upload: uploads/c348af3d-afeb-4777-a7a8-d0051f278290-Screenshot 2025-01-24 145245.png
|
||||||
|
[27-01-2025 13:36:29:3629] info : Generated upload URL for image: Screenshot 2025-01-24 145245.png
|
||||||
|
[27-01-2025 13:36:29:3629] http : ::1 - - [27/Jan/2025:10:36:29 +0000] "POST /api/images/upload-url HTTP/1.1" 200 655 "http://127.0.0.1:5173/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
|
||||||
|
[27-01-2025 13:36:29:3629] info : POST /api/images/upload-url 200 2621ms
|
||||||
|
[27-01-2025 16:12:16:1216] http : ::1 - - [27/Jan/2025:13:12:16 +0000] "OPTIONS /api/auth/me HTTP/1.1" 204 0 "http://127.0.0.1:5173/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
|
||||||
|
[27-01-2025 16:12:16:1216] http : ::1 - - [27/Jan/2025:13:12:16 +0000] "OPTIONS /api/auth/me HTTP/1.1" 204 0 "http://127.0.0.1:5173/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
|
||||||
|
[27-01-2025 16:12:16:1216] http : ::1 - - [27/Jan/2025:13:12:16 +0000] "GET /api/auth/me HTTP/1.1" 200 160 "http://127.0.0.1:5173/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
|
||||||
|
[27-01-2025 16:12:16:1216] info : GET /api/auth/me 200 59ms
|
||||||
|
[27-01-2025 16:12:16:1216] http : ::1 - - [27/Jan/2025:13:12:16 +0000] "GET /api/auth/me HTTP/1.1" 304 - "http://127.0.0.1:5173/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
|
||||||
|
[27-01-2025 16:12:16:1216] info : GET /api/auth/me 304 12ms
|
||||||
|
[27-01-2025 16:12:17:1217] http : ::1 - - [27/Jan/2025:13:12:17 +0000] "OPTIONS /api/auth/login HTTP/1.1" 204 0 "http://127.0.0.1:5173/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
|
||||||
|
[27-01-2025 16:12:17:1217] info : Login attempt for user: supervisor@mail.ru
|
||||||
|
[27-01-2025 16:12:18:1218] debug : Generated token for user: d7535049-d839-401f-a027-dcec13ebdf28
|
||||||
|
[27-01-2025 16:12:18:1218] info : User logged in successfully: supervisor@mail.ru
|
||||||
|
[27-01-2025 16:12:18:1218] http : ::1 - - [27/Jan/2025:13:12:18 +0000] "POST /api/auth/login HTTP/1.1" 200 367 "http://127.0.0.1:5173/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
|
||||||
|
[27-01-2025 16:12:18:1218] info : POST /api/auth/login 200 109ms
|
||||||
|
[27-01-2025 16:12:27:1227] http : ::1 - - [27/Jan/2025:13:12:27 +0000] "OPTIONS /api/images/upload-url HTTP/1.1" 204 0 "http://127.0.0.1:5173/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
|
||||||
|
[27-01-2025 16:12:33:1233] info : Generated pre-signed URL for upload: uploads/3fee0c33-5558-4306-a04b-99f296d60bf3-Screenshot 2025-01-24 145245.png
|
||||||
|
[27-01-2025 16:12:33:1233] info : Generated upload URL for image: Screenshot 2025-01-24 145245.png
|
||||||
|
[27-01-2025 16:12:33:1233] http : ::1 - - [27/Jan/2025:13:12:33 +0000] "POST /api/images/upload-url HTTP/1.1" 200 655 "http://127.0.0.1:5173/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
|
||||||
|
[27-01-2025 16:12:33:1233] info : POST /api/images/upload-url 200 5624ms
|
||||||
|
[27-01-2025 16:13:21:1321] http : ::1 - - [27/Jan/2025:13:13:21 +0000] "OPTIONS /api/images/upload-url HTTP/1.1" 204 0 "http://127.0.0.1:5173/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
|
||||||
|
[27-01-2025 16:13:21:1321] info : Generated pre-signed URL for upload: uploads/d0edc792-08e7-45b3-b46b-c5ba913a6fef-Screenshot 2025-01-24 145245.png
|
||||||
|
[27-01-2025 16:13:21:1321] info : Generated upload URL for image: Screenshot 2025-01-24 145245.png
|
||||||
|
[27-01-2025 16:13:21:1321] http : ::1 - - [27/Jan/2025:13:13:21 +0000] "POST /api/images/upload-url HTTP/1.1" 200 655 "http://127.0.0.1:5173/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
|
||||||
|
[27-01-2025 16:13:21:1321] info : POST /api/images/upload-url 200 20ms
|
||||||
|
[27-01-2025 16:22:21:2221] http : ::1 - - [27/Jan/2025:13:22:21 +0000] "OPTIONS /api/images/upload-url HTTP/1.1" 204 0 "http://127.0.0.1:5173/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
|
||||||
|
[27-01-2025 16:22:21:2221] info : Generated pre-signed URL for upload: uploads/73d02369-a7ed-4db8-802b-2e849d2625fa-Screenshot 2025-01-24 145245.png
|
||||||
|
[27-01-2025 16:22:21:2221] info : Generated upload URL for image: Screenshot 2025-01-24 145245.png
|
||||||
|
[27-01-2025 16:22:21:2221] http : ::1 - - [27/Jan/2025:13:22:21 +0000] "POST /api/images/upload-url HTTP/1.1" 200 655 "http://127.0.0.1:5173/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
|
||||||
|
[27-01-2025 16:22:21:2221] info : POST /api/images/upload-url 200 55ms
|
||||||
|
[27-01-2025 16:24:57:2457] http : ::1 - - [27/Jan/2025:13:24:57 +0000] "OPTIONS /api/images/upload-url HTTP/1.1" 204 0 "http://127.0.0.1:5173/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
|
||||||
|
[27-01-2025 16:24:57:2457] info : Generated pre-signed URL for upload: uploads/097841c3-ad9a-4776-a4e4-8fbc8f8c3f13-ok-11.svg
|
||||||
|
[27-01-2025 16:24:57:2457] info : Generated upload URL for image: ok-11.svg
|
||||||
|
[27-01-2025 16:24:57:2457] http : ::1 - - [27/Jan/2025:13:24:57 +0000] "POST /api/images/upload-url HTTP/1.1" 200 605 "http://127.0.0.1:5173/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
|
||||||
|
[27-01-2025 16:24:57:2457] info : POST /api/images/upload-url 200 20ms
|
||||||
|
[27-01-2025 16:26:40:2640] http : ::1 - - [27/Jan/2025:13:26:40 +0000] "OPTIONS /api/images/upload-url HTTP/1.1" 204 0 "http://127.0.0.1:5173/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
|
||||||
|
[27-01-2025 16:28:50:2850] info : Generated pre-signed URL for upload: uploads/2717ccb2-d409-4b4f-a690-e75c6cf2b391-ok-11.svg
|
||||||
|
[27-01-2025 16:29:00:290] info : Generated upload URL for image: ok-11.svg
|
||||||
|
[27-01-2025 16:29:13:2913] http : ::1 - - [27/Jan/2025:13:29:13 +0000] "POST /api/images/upload-url HTTP/1.1" 200 605 "http://127.0.0.1:5173/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
|
||||||
|
[27-01-2025 16:29:13:2913] info : POST /api/images/upload-url 200 153349ms
|
||||||
|
[27-01-2025 16:44:37:4437] info : Server running on port 5000
|
||||||
|
[27-01-2025 22:39:18:3918] http : ::1 - - [27/Jan/2025:19:39:18 +0000] "OPTIONS /api/auth/me HTTP/1.1" 204 0 "http://127.0.0.1:5173/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
|
||||||
|
[27-01-2025 22:39:18:3918] http : ::1 - - [27/Jan/2025:19:39:18 +0000] "OPTIONS /api/auth/me HTTP/1.1" 204 0 "http://127.0.0.1:5173/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
|
72
logs/29-01-2025-server.log
Normal file
72
logs/29-01-2025-server.log
Normal file
@ -0,0 +1,72 @@
|
|||||||
|
[29-01-2025 22:12:02:122] info : Server running on port 5000
|
||||||
|
[29-01-2025 22:12:10:1210] http : ::1 - - [29/Jan/2025:19:12:10 +0000] "OPTIONS /api/auth/login HTTP/1.1" 204 0 "http://127.0.0.1:5173/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/132.0.0.0 Safari/537.36"
|
||||||
|
[29-01-2025 22:12:10:1210] info : Login attempt for user: supervisor@mail.ru
|
||||||
|
[29-01-2025 22:12:10:1210] debug : Generated token for user: d7535049-d839-401f-a027-dcec13ebdf28
|
||||||
|
[29-01-2025 22:12:10:1210] info : User logged in successfully: supervisor@mail.ru
|
||||||
|
[29-01-2025 22:12:10:1210] http : ::1 - - [29/Jan/2025:19:12:10 +0000] "POST /api/auth/login HTTP/1.1" 200 367 "http://127.0.0.1:5173/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/132.0.0.0 Safari/537.36"
|
||||||
|
[29-01-2025 22:12:10:1210] info : POST /api/auth/login 200 250ms
|
||||||
|
[29-01-2025 22:12:25:1225] http : ::1 - - [29/Jan/2025:19:12:25 +0000] "OPTIONS /api/images/upload-url HTTP/1.1" 204 0 "http://127.0.0.1:5173/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/132.0.0.0 Safari/537.36"
|
||||||
|
[29-01-2025 22:12:25:1225] http : ::1 - - [29/Jan/2025:19:12:25 +0000] "POST /api/images/upload-url HTTP/1.1" 400 38 "http://127.0.0.1:5173/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/132.0.0.0 Safari/537.36"
|
||||||
|
[29-01-2025 22:12:25:1225] warn : POST /api/images/upload-url 400 62ms
|
||||||
|
[29-01-2025 22:13:30:1330] info : Server running on port 5000
|
||||||
|
[29-01-2025 22:13:43:1343] http : ::1 - - [29/Jan/2025:19:13:43 +0000] "OPTIONS /api/images/upload-url HTTP/1.1" 204 0 "http://127.0.0.1:5173/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/132.0.0.0 Safari/537.36"
|
||||||
|
[29-01-2025 22:22:08:228] info : Server running on port 5000
|
||||||
|
[29-01-2025 22:25:47:2547] info : Server running on port 5000
|
||||||
|
[29-01-2025 22:26:53:2653] http : ::1 - - [29/Jan/2025:19:26:53 +0000] "GET /api/check-env-key?provider=Groq HTTP/1.1" 404 156 "http://localhost:5173/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/132.0.0.0 Safari/537.36"
|
||||||
|
[29-01-2025 22:26:53:2653] warn : GET /api/check-env-key?provider=Groq 404 4ms
|
||||||
|
[29-01-2025 22:56:42:5642] info : Server running on port 5000
|
||||||
|
[29-01-2025 22:56:45:5645] http : ::1 - - [29/Jan/2025:19:56:45 +0000] "OPTIONS /api/auth/login HTTP/1.1" 204 0 "http://127.0.0.1:5173/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/132.0.0.0 Safari/537.36"
|
||||||
|
[29-01-2025 22:56:45:5645] info : Login attempt for user: supervisor@mail.ru
|
||||||
|
[29-01-2025 22:56:45:5645] debug : Generated token for user: d7535049-d839-401f-a027-dcec13ebdf28
|
||||||
|
[29-01-2025 22:56:45:5645] info : User logged in successfully: supervisor@mail.ru
|
||||||
|
[29-01-2025 22:56:45:5645] http : ::1 - - [29/Jan/2025:19:56:45 +0000] "POST /api/auth/login HTTP/1.1" 200 367 "http://127.0.0.1:5173/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/132.0.0.0 Safari/537.36"
|
||||||
|
[29-01-2025 22:56:45:5645] info : POST /api/auth/login 200 130ms
|
||||||
|
[29-01-2025 22:57:30:5730] info : Server running on port 5000
|
||||||
|
[29-01-2025 22:57:43:5743] http : ::1 - - [29/Jan/2025:19:57:43 +0000] "OPTIONS /api/auth/me HTTP/1.1" 204 0 "http://127.0.0.1:5173/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/132.0.0.0 Safari/537.36"
|
||||||
|
[29-01-2025 22:57:43:5743] http : ::1 - - [29/Jan/2025:19:57:43 +0000] "OPTIONS /api/auth/me HTTP/1.1" 204 0 "http://127.0.0.1:5173/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/132.0.0.0 Safari/537.36"
|
||||||
|
[29-01-2025 22:57:43:5743] http : ::1 - - [29/Jan/2025:19:57:43 +0000] "GET /api/auth/me HTTP/1.1" 200 160 "http://127.0.0.1:5173/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/132.0.0.0 Safari/537.36"
|
||||||
|
[29-01-2025 22:57:43:5743] info : GET /api/auth/me 200 75ms
|
||||||
|
[29-01-2025 22:57:43:5743] http : ::1 - - [29/Jan/2025:19:57:43 +0000] "GET /api/auth/me HTTP/1.1" 304 - "http://127.0.0.1:5173/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/132.0.0.0 Safari/537.36"
|
||||||
|
[29-01-2025 22:57:43:5743] info : GET /api/auth/me 304 12ms
|
||||||
|
[29-01-2025 22:57:44:5744] http : ::1 - - [29/Jan/2025:19:57:44 +0000] "OPTIONS /api/auth/login HTTP/1.1" 204 0 "http://127.0.0.1:5173/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/132.0.0.0 Safari/537.36"
|
||||||
|
[29-01-2025 22:57:44:5744] info : Login attempt for user: supervisor@mail.ru
|
||||||
|
[29-01-2025 22:57:44:5744] debug : Generated token for user: d7535049-d839-401f-a027-dcec13ebdf28
|
||||||
|
[29-01-2025 22:57:44:5744] info : User logged in successfully: supervisor@mail.ru
|
||||||
|
[29-01-2025 22:57:44:5744] http : ::1 - - [29/Jan/2025:19:57:44 +0000] "POST /api/auth/login HTTP/1.1" 200 367 "http://127.0.0.1:5173/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/132.0.0.0 Safari/537.36"
|
||||||
|
[29-01-2025 22:57:44:5744] info : POST /api/auth/login 200 121ms
|
||||||
|
[29-01-2025 23:00:32:032] http : ::1 - - [29/Jan/2025:20:00:32 +0000] "OPTIONS /api/auth/me HTTP/1.1" 204 0 "http://127.0.0.1:5173/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/132.0.0.0 Safari/537.36"
|
||||||
|
[29-01-2025 23:00:32:032] http : ::1 - - [29/Jan/2025:20:00:32 +0000] "OPTIONS /api/auth/me HTTP/1.1" 204 0 "http://127.0.0.1:5173/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/132.0.0.0 Safari/537.36"
|
||||||
|
[29-01-2025 23:00:32:032] http : ::1 - - [29/Jan/2025:20:00:32 +0000] "GET /api/auth/me HTTP/1.1" 304 - "http://127.0.0.1:5173/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/132.0.0.0 Safari/537.36"
|
||||||
|
[29-01-2025 23:00:32:032] info : GET /api/auth/me 304 20ms
|
||||||
|
[29-01-2025 23:00:32:032] http : ::1 - - [29/Jan/2025:20:00:32 +0000] "GET /api/auth/me HTTP/1.1" 304 - "http://127.0.0.1:5173/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/132.0.0.0 Safari/537.36"
|
||||||
|
[29-01-2025 23:00:32:032] info : GET /api/auth/me 304 12ms
|
||||||
|
[29-01-2025 23:00:34:034] http : ::1 - - [29/Jan/2025:20:00:34 +0000] "OPTIONS /api/auth/login HTTP/1.1" 204 0 "http://127.0.0.1:5173/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/132.0.0.0 Safari/537.36"
|
||||||
|
[29-01-2025 23:00:34:034] info : Login attempt for user: supervisor@mail.ru
|
||||||
|
[29-01-2025 23:00:34:034] debug : Generated token for user: d7535049-d839-401f-a027-dcec13ebdf28
|
||||||
|
[29-01-2025 23:00:34:034] info : User logged in successfully: supervisor@mail.ru
|
||||||
|
[29-01-2025 23:00:34:034] http : ::1 - - [29/Jan/2025:20:00:34 +0000] "POST /api/auth/login HTTP/1.1" 200 367 "http://127.0.0.1:5173/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/132.0.0.0 Safari/537.36"
|
||||||
|
[29-01-2025 23:00:34:034] info : POST /api/auth/login 200 76ms
|
||||||
|
[29-01-2025 23:02:01:21] http : ::1 - - [29/Jan/2025:20:02:01 +0000] "OPTIONS /api/auth/me HTTP/1.1" 204 0 "http://127.0.0.1:5173/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/132.0.0.0 Safari/537.36"
|
||||||
|
[29-01-2025 23:02:01:21] http : ::1 - - [29/Jan/2025:20:02:01 +0000] "OPTIONS /api/auth/me HTTP/1.1" 204 0 "http://127.0.0.1:5173/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/132.0.0.0 Safari/537.36"
|
||||||
|
[29-01-2025 23:02:01:21] http : ::1 - - [29/Jan/2025:20:02:01 +0000] "GET /api/auth/me HTTP/1.1" 304 - "http://127.0.0.1:5173/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/132.0.0.0 Safari/537.36"
|
||||||
|
[29-01-2025 23:02:01:21] info : GET /api/auth/me 304 22ms
|
||||||
|
[29-01-2025 23:02:01:21] http : ::1 - - [29/Jan/2025:20:02:01 +0000] "GET /api/auth/me HTTP/1.1" 304 - "http://127.0.0.1:5173/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/132.0.0.0 Safari/537.36"
|
||||||
|
[29-01-2025 23:02:01:21] info : GET /api/auth/me 304 233ms
|
||||||
|
[29-01-2025 23:02:05:25] http : ::1 - - [29/Jan/2025:20:02:05 +0000] "OPTIONS /api/auth/login HTTP/1.1" 204 0 "http://127.0.0.1:5173/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/132.0.0.0 Safari/537.36"
|
||||||
|
[29-01-2025 23:02:05:25] info : Login attempt for user: supervisor@mail.ru
|
||||||
|
[29-01-2025 23:02:05:25] debug : Generated token for user: d7535049-d839-401f-a027-dcec13ebdf28
|
||||||
|
[29-01-2025 23:02:05:25] info : User logged in successfully: supervisor@mail.ru
|
||||||
|
[29-01-2025 23:02:05:25] http : ::1 - - [29/Jan/2025:20:02:05 +0000] "POST /api/auth/login HTTP/1.1" 200 367 "http://127.0.0.1:5173/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/132.0.0.0 Safari/537.36"
|
||||||
|
[29-01-2025 23:02:05:25] info : POST /api/auth/login 200 74ms
|
||||||
|
[29-01-2025 23:03:03:33] http : ::1 - - [29/Jan/2025:20:03:03 +0000] "OPTIONS /api/auth/me HTTP/1.1" 204 0 "http://127.0.0.1:5173/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/132.0.0.0 Safari/537.36"
|
||||||
|
[29-01-2025 23:03:03:33] http : ::1 - - [29/Jan/2025:20:03:03 +0000] "OPTIONS /api/auth/me HTTP/1.1" 204 0 "http://127.0.0.1:5173/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/132.0.0.0 Safari/537.36"
|
||||||
|
[29-01-2025 23:03:03:33] http : ::1 - - [29/Jan/2025:20:03:03 +0000] "GET /api/auth/me HTTP/1.1" 304 - "http://127.0.0.1:5173/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/132.0.0.0 Safari/537.36"
|
||||||
|
[29-01-2025 23:03:03:33] info : GET /api/auth/me 304 67ms
|
||||||
|
[29-01-2025 23:03:03:33] http : ::1 - - [29/Jan/2025:20:03:03 +0000] "GET /api/auth/me HTTP/1.1" 304 - "http://127.0.0.1:5173/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/132.0.0.0 Safari/537.36"
|
||||||
|
[29-01-2025 23:03:03:33] info : GET /api/auth/me 304 10ms
|
||||||
|
[29-01-2025 23:03:27:327] http : ::1 - - [29/Jan/2025:20:03:27 +0000] "OPTIONS /api/auth/login HTTP/1.1" 204 0 "http://127.0.0.1:5173/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/132.0.0.0 Safari/537.36"
|
||||||
|
[29-01-2025 23:03:27:327] info : Login attempt for user: supervisor@mail.ru
|
||||||
|
[29-01-2025 23:03:29:329] debug : Generated token for user: d7535049-d839-401f-a027-dcec13ebdf28
|
||||||
|
[29-01-2025 23:03:29:329] info : User logged in successfully: supervisor@mail.ru
|
||||||
|
[29-01-2025 23:03:29:329] http : ::1 - - [29/Jan/2025:20:03:29 +0000] "POST /api/auth/login HTTP/1.1" 200 367 "http://127.0.0.1:5173/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/132.0.0.0 Safari/537.36"
|
||||||
|
[29-01-2025 23:03:29:329] info : POST /api/auth/login 200 1142ms
|
4307
package-lock.json
generated
Normal file
4307
package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
46
package.json
Normal file
46
package.json
Normal file
@ -0,0 +1,46 @@
|
|||||||
|
{
|
||||||
|
"name": "russcult_server",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"main": "index.js",
|
||||||
|
"scripts": {
|
||||||
|
"build": "tsc",
|
||||||
|
"start": "node dist/server.js",
|
||||||
|
"dev": "ts-node src/server.ts"
|
||||||
|
},
|
||||||
|
"keywords": [],
|
||||||
|
"author": "",
|
||||||
|
"license": "ISC",
|
||||||
|
"description": "",
|
||||||
|
"dependencies": {
|
||||||
|
"@aws-sdk/client-s3": "^3.734.0",
|
||||||
|
"@aws-sdk/s3-request-presigner": "^3.734.0",
|
||||||
|
"@prisma/client": "^6.2.1",
|
||||||
|
"bcryptjs": "^2.4.3",
|
||||||
|
"cors": "^2.8.5",
|
||||||
|
"dotenv": "^16.4.7",
|
||||||
|
"express": "^4.21.2",
|
||||||
|
"jsonwebtoken": "^9.0.2",
|
||||||
|
"morgan": "^1.10.0",
|
||||||
|
"multer": "^1.4.5-lts.1",
|
||||||
|
"multer-s3": "^3.0.1",
|
||||||
|
"sharp": "^0.33.5",
|
||||||
|
"uuid": "^11.0.5",
|
||||||
|
"winston": "^3.17.0",
|
||||||
|
"winston-daily-rotate-file": "^5.0.0",
|
||||||
|
"zod": "^3.24.1"
|
||||||
|
},
|
||||||
|
"devDependencies": {
|
||||||
|
"@types/bcryptjs": "^2.4.6",
|
||||||
|
"@types/cors": "^2.8.17",
|
||||||
|
"@types/express": "^5.0.0",
|
||||||
|
"@types/jsonwebtoken": "^9.0.7",
|
||||||
|
"@types/morgan": "^1.9.9",
|
||||||
|
"@types/multer": "^1.4.12",
|
||||||
|
"@types/multer-s3": "^3.0.3",
|
||||||
|
"@types/node": "^22.10.7",
|
||||||
|
"@types/winston": "^2.4.4",
|
||||||
|
"prisma": "^6.2.1",
|
||||||
|
"ts-node": "^10.9.2",
|
||||||
|
"typescript": "^5.7.3"
|
||||||
|
}
|
||||||
|
}
|
70
prisma/schema.prisma
Normal file
70
prisma/schema.prisma
Normal file
@ -0,0 +1,70 @@
|
|||||||
|
generator client {
|
||||||
|
provider = "prisma-client-js"
|
||||||
|
}
|
||||||
|
|
||||||
|
datasource db {
|
||||||
|
provider = "postgresql"
|
||||||
|
url = env("DATABASE_URL")
|
||||||
|
}
|
||||||
|
|
||||||
|
model User {
|
||||||
|
id String @id @default(uuid())
|
||||||
|
email String @unique
|
||||||
|
password String
|
||||||
|
displayName String
|
||||||
|
isAdmin Boolean @default(false)
|
||||||
|
createdAt DateTime @default(now())
|
||||||
|
updatedAt DateTime @updatedAt
|
||||||
|
permissions Json
|
||||||
|
articles Article[]
|
||||||
|
}
|
||||||
|
|
||||||
|
model Article {
|
||||||
|
id String @id @default(uuid())
|
||||||
|
title String
|
||||||
|
excerpt String
|
||||||
|
content String
|
||||||
|
category Category @relation(fields: [categoryId], references: [id])
|
||||||
|
categoryId Int
|
||||||
|
city String
|
||||||
|
coverImage String
|
||||||
|
readTime Int
|
||||||
|
likes Int @default(0)
|
||||||
|
dislikes Int @default(0)
|
||||||
|
publishedAt DateTime @default(now())
|
||||||
|
author User @relation(fields: [authorId], references: [id])
|
||||||
|
authorId String
|
||||||
|
gallery GalleryImage[]
|
||||||
|
}
|
||||||
|
|
||||||
|
model Category {
|
||||||
|
id Int @id
|
||||||
|
name String @unique
|
||||||
|
articles Article[]
|
||||||
|
}
|
||||||
|
|
||||||
|
model GalleryImage {
|
||||||
|
id String @id @default(uuid())
|
||||||
|
url String
|
||||||
|
caption String
|
||||||
|
alt String
|
||||||
|
width Int
|
||||||
|
height Int
|
||||||
|
size Int
|
||||||
|
format String
|
||||||
|
article Article @relation(fields: [articleId], references: [id], onDelete: Cascade)
|
||||||
|
articleId String
|
||||||
|
createdAt DateTime @default(now())
|
||||||
|
updatedAt DateTime @updatedAt
|
||||||
|
order Int @default(0)
|
||||||
|
}
|
||||||
|
|
||||||
|
model UserReaction {
|
||||||
|
id String @id @default(uuid())
|
||||||
|
userId String
|
||||||
|
articleId String
|
||||||
|
reaction String // 'like' or 'dislike'
|
||||||
|
createdAt DateTime @default(now())
|
||||||
|
|
||||||
|
@@unique([userId, articleId])
|
||||||
|
}
|
BIN
public/images/main-bg.webp
Normal file
BIN
public/images/main-bg.webp
Normal file
Binary file not shown.
After Width: | Height: | Size: 651 KiB |
28
src/config/imageResolutions.ts
Normal file
28
src/config/imageResolutions.ts
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
import { ImageResolution } from '../types/image';
|
||||||
|
|
||||||
|
export const imageResolutions: ImageResolution[] = [
|
||||||
|
{
|
||||||
|
id: 'thumbnail',
|
||||||
|
width: 300,
|
||||||
|
height: 300,
|
||||||
|
label: 'Thumbnail (300x300)'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 'medium',
|
||||||
|
width: 800,
|
||||||
|
height: 600,
|
||||||
|
label: 'Medium (800x600)'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 'large',
|
||||||
|
width: 1920,
|
||||||
|
height: 1080,
|
||||||
|
label: 'Large (1920x1080)'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 'original',
|
||||||
|
width: 0, // 0 means keep original dimensions
|
||||||
|
height: 0,
|
||||||
|
label: 'Original Size'
|
||||||
|
}
|
||||||
|
];
|
88
src/config/logger.ts
Normal file
88
src/config/logger.ts
Normal file
@ -0,0 +1,88 @@
|
|||||||
|
import winston from 'winston';
|
||||||
|
import 'winston-daily-rotate-file';
|
||||||
|
import path from 'path';
|
||||||
|
|
||||||
|
// Define log levels
|
||||||
|
const levels = {
|
||||||
|
error: 0,
|
||||||
|
warn: 1,
|
||||||
|
info: 2,
|
||||||
|
http: 3,
|
||||||
|
debug: 4,
|
||||||
|
};
|
||||||
|
|
||||||
|
// Define log level based on environment
|
||||||
|
const level = () => {
|
||||||
|
const env = process.env.NODE_ENV || 'development';
|
||||||
|
return env === 'development' ? 'debug' : 'warn';
|
||||||
|
};
|
||||||
|
|
||||||
|
// Define colors for each level
|
||||||
|
const colors = {
|
||||||
|
error: 'red',
|
||||||
|
warn: 'yellow',
|
||||||
|
info: 'green',
|
||||||
|
http: 'magenta',
|
||||||
|
debug: 'blue',
|
||||||
|
};
|
||||||
|
|
||||||
|
// Add colors to winston
|
||||||
|
winston.addColors(colors);
|
||||||
|
|
||||||
|
// Custom format for logging
|
||||||
|
const logSimpleFormat = winston.format.combine(
|
||||||
|
winston.format.timestamp({ format: 'DD-MM-YYYY HH:mm:ss:ms' }),
|
||||||
|
winston.format.printf(
|
||||||
|
({ timestamp, level, message }) => `${timestamp} [${level}] ${message}`
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
// Custom format for logging
|
||||||
|
const logFormat = winston.format.combine(
|
||||||
|
winston.format.timestamp({ format: 'DD-MM-YYYY HH:mm:ss:ms' }),
|
||||||
|
winston.format.printf((info) => {
|
||||||
|
const maxLevelLength = 5; // "error" — самый длинный уровень
|
||||||
|
const paddedLevel = info.level.padEnd(maxLevelLength, ' '); // Выровнять уровень
|
||||||
|
return `[${info.timestamp}] ${paddedLevel} : ${info.message}`;
|
||||||
|
})
|
||||||
|
);
|
||||||
|
|
||||||
|
// File transport options with uncolored plain text format
|
||||||
|
const fileRotateTransport = new winston.transports.DailyRotateFile({
|
||||||
|
filename: path.join('logs', '%DATE%-server.log'),
|
||||||
|
datePattern: 'DD-MM-YYYY',
|
||||||
|
zippedArchive: true,
|
||||||
|
maxSize: '20m',
|
||||||
|
maxFiles: '14d',
|
||||||
|
format: winston.format.combine(
|
||||||
|
winston.format.uncolorize(), // Убираем цвета для файлового формата
|
||||||
|
logFormat // Используем текстовый формат без JSON
|
||||||
|
),
|
||||||
|
});
|
||||||
|
|
||||||
|
// Create the logger
|
||||||
|
const logger = winston.createLogger({
|
||||||
|
level: level(),
|
||||||
|
levels,
|
||||||
|
transports: [
|
||||||
|
// Логи в файл
|
||||||
|
fileRotateTransport,
|
||||||
|
|
||||||
|
// Логи в консоль с цветами
|
||||||
|
new winston.transports.Console({
|
||||||
|
format: winston.format.combine(
|
||||||
|
winston.format.colorize({ all: true }),
|
||||||
|
logFormat
|
||||||
|
),
|
||||||
|
}),
|
||||||
|
],
|
||||||
|
});
|
||||||
|
|
||||||
|
// Create a stream object for Morgan middleware
|
||||||
|
const stream = {
|
||||||
|
write: (message: string) => {
|
||||||
|
logger.http(message.trim());
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
export { logger, stream };
|
12
src/lib/prisma.ts
Normal file
12
src/lib/prisma.ts
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
import { PrismaClient } from '@prisma/client';
|
||||||
|
|
||||||
|
// Prevent multiple instances of Prisma Client in development
|
||||||
|
declare global {
|
||||||
|
var prisma: PrismaClient | undefined;
|
||||||
|
}
|
||||||
|
|
||||||
|
export const prisma = global.prisma || new PrismaClient();
|
||||||
|
|
||||||
|
if (process.env.NODE_ENV !== 'production') {
|
||||||
|
global.prisma = prisma;
|
||||||
|
}
|
32
src/middleware/auth/auth.ts
Normal file
32
src/middleware/auth/auth.ts
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
import { Response, NextFunction } from 'express';
|
||||||
|
import { AuthRequest } from './types';
|
||||||
|
import { extractToken } from './extractToken';
|
||||||
|
import { validateToken } from './validateToken';
|
||||||
|
import { getUser } from './getUser';
|
||||||
|
|
||||||
|
export async function auth(req: AuthRequest, res: Response, next: NextFunction) {
|
||||||
|
try {
|
||||||
|
const token = extractToken(req);
|
||||||
|
if (!token) {
|
||||||
|
res.status(401).json({ error: 'No token provided' });
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
const payload = validateToken(token);
|
||||||
|
if (!payload) {
|
||||||
|
res.status(401).json({ error: 'Invalid token' });
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
const user = await getUser(payload.id);
|
||||||
|
if (!user) {
|
||||||
|
res.status(401).json({ error: 'User not found' });
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
req.user = user;
|
||||||
|
next();
|
||||||
|
} catch {
|
||||||
|
res.status(401).json({ error: 'Authentication failed' });
|
||||||
|
}
|
||||||
|
}
|
11
src/middleware/auth/extractToken.ts
Normal file
11
src/middleware/auth/extractToken.ts
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
import { Request } from 'express';
|
||||||
|
|
||||||
|
export function extractToken(req: Request): string | null {
|
||||||
|
const authHeader = req.header('Authorization');
|
||||||
|
if (!authHeader) return null;
|
||||||
|
|
||||||
|
const [bearer, token] = authHeader.split(' ');
|
||||||
|
if (bearer !== 'Bearer' || !token) return null;
|
||||||
|
|
||||||
|
return token;
|
||||||
|
}
|
22
src/middleware/auth/getUser.ts
Normal file
22
src/middleware/auth/getUser.ts
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
import { PrismaClient } from '@prisma/client';
|
||||||
|
import { User } from '../../types/auth';
|
||||||
|
|
||||||
|
const prisma = new PrismaClient();
|
||||||
|
|
||||||
|
export async function getUser(userId: string): Promise<User | null> {
|
||||||
|
try {
|
||||||
|
const user = await prisma.user.findUnique({
|
||||||
|
where: { id: userId },
|
||||||
|
select: {
|
||||||
|
id: true,
|
||||||
|
email: true,
|
||||||
|
displayName: true,
|
||||||
|
permissions: true
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
return user as User | null;
|
||||||
|
} catch {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
5
src/middleware/auth/index.ts
Normal file
5
src/middleware/auth/index.ts
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
export { auth } from './auth';
|
||||||
|
export { extractToken } from './extractToken';
|
||||||
|
export { validateToken } from './validateToken';
|
||||||
|
export { getUser } from './getUser';
|
||||||
|
export * from './types';
|
12
src/middleware/auth/types.ts
Normal file
12
src/middleware/auth/types.ts
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
import { Request } from 'express';
|
||||||
|
import { User } from '../../types/auth';
|
||||||
|
|
||||||
|
export interface AuthRequest extends Request {
|
||||||
|
user?: User;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface JwtPayload {
|
||||||
|
id: string;
|
||||||
|
iat?: number;
|
||||||
|
exp?: number;
|
||||||
|
}
|
32
src/middleware/auth/validateToken.ts
Normal file
32
src/middleware/auth/validateToken.ts
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
import jwt from 'jsonwebtoken';
|
||||||
|
import { JwtPayload } from './types.js';
|
||||||
|
|
||||||
|
export function validateToken(token: string): JwtPayload | null {
|
||||||
|
const secret = process.env.JWT_SECRET;
|
||||||
|
if (!secret) {
|
||||||
|
console.error('JWT_SECRET is not defined');
|
||||||
|
throw new Error('Missing JWT_SECRET environment variable');
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
const decoded = jwt.verify(token, secret);
|
||||||
|
|
||||||
|
// Проверяем, что полезная нагрузка соответствует интерфейсу JwtPayload
|
||||||
|
if (isJwtPayload(decoded)) {
|
||||||
|
return decoded;
|
||||||
|
} else {
|
||||||
|
console.error('Invalid token payload structure');
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
console.error('Token validation error:', error);
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Функция проверки структуры полезной нагрузки
|
||||||
|
function isJwtPayload(payload: unknown): payload is JwtPayload {
|
||||||
|
return (
|
||||||
|
typeof payload === 'object' && payload !== null && 'id' in payload && 'iat' in payload && 'exp' in payload
|
||||||
|
);
|
||||||
|
}
|
20
src/middleware/error/errorHandler.ts
Normal file
20
src/middleware/error/errorHandler.ts
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
import { Request, Response, NextFunction } from 'express';
|
||||||
|
|
||||||
|
export interface AppError extends Error {
|
||||||
|
statusCode?: number;
|
||||||
|
}
|
||||||
|
|
||||||
|
export function errorHandler(
|
||||||
|
err: AppError,
|
||||||
|
req: Request,
|
||||||
|
res: Response,
|
||||||
|
next: NextFunction
|
||||||
|
) {
|
||||||
|
const statusCode = err.statusCode || 500;
|
||||||
|
const message = err.message || 'Internal Server Error';
|
||||||
|
|
||||||
|
res.status(statusCode).json({
|
||||||
|
error: message,
|
||||||
|
stack: process.env.NODE_ENV === 'development' ? err.stack : undefined
|
||||||
|
});
|
||||||
|
}
|
27
src/middleware/error/errorLogger.ts
Normal file
27
src/middleware/error/errorLogger.ts
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
import { Request, Response, NextFunction } from 'express';
|
||||||
|
import { logger } from '../../config/logger';
|
||||||
|
|
||||||
|
export interface AppError extends Error {
|
||||||
|
statusCode?: number;
|
||||||
|
details?: never;
|
||||||
|
}
|
||||||
|
|
||||||
|
export const errorLogger = (
|
||||||
|
err: AppError,
|
||||||
|
req: Request,
|
||||||
|
res: Response,
|
||||||
|
next: NextFunction
|
||||||
|
) => {
|
||||||
|
const errorDetails = {
|
||||||
|
message: err.message,
|
||||||
|
stack: err.stack,
|
||||||
|
timestamp: new Date().toISOString(),
|
||||||
|
path: req.path,
|
||||||
|
method: req.method,
|
||||||
|
statusCode: err.statusCode || 500,
|
||||||
|
details: err.details,
|
||||||
|
};
|
||||||
|
|
||||||
|
logger.error('Application error:', errorDetails);
|
||||||
|
next(err);
|
||||||
|
};
|
21
src/middleware/logging/requestLogger.ts
Normal file
21
src/middleware/logging/requestLogger.ts
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
import { Request, Response, NextFunction } from 'express';
|
||||||
|
import { logger } from '../../config/logger';
|
||||||
|
|
||||||
|
export const requestLogger = (req: Request, res: Response, next: NextFunction) => {
|
||||||
|
const start = Date.now();
|
||||||
|
|
||||||
|
res.on('finish', () => {
|
||||||
|
const duration = Date.now() - start;
|
||||||
|
const message = `${req.method} ${req.originalUrl} ${res.statusCode} ${duration}ms`;
|
||||||
|
|
||||||
|
if (res.statusCode >= 500) {
|
||||||
|
logger.error(message);
|
||||||
|
} else if (res.statusCode >= 400) {
|
||||||
|
logger.warn(message);
|
||||||
|
} else {
|
||||||
|
logger.info(message);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
next();
|
||||||
|
};
|
17
src/middleware/validation/validateRequest.ts
Normal file
17
src/middleware/validation/validateRequest.ts
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
import { Request, Response, NextFunction } from 'express';
|
||||||
|
import { Schema } from 'zod';
|
||||||
|
|
||||||
|
export function validateRequest(schema: Schema) {
|
||||||
|
return async (req: Request, res: Response, next: NextFunction) => {
|
||||||
|
try {
|
||||||
|
await schema.parseAsync({
|
||||||
|
body: req.body,
|
||||||
|
query: req.query,
|
||||||
|
params: req.params
|
||||||
|
});
|
||||||
|
next();
|
||||||
|
} catch (error) {
|
||||||
|
res.status(400).json({ error: 'Invalid request data' });
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
187
src/routes/articles/controllers/crud.ts
Normal file
187
src/routes/articles/controllers/crud.ts
Normal file
@ -0,0 +1,187 @@
|
|||||||
|
import { Request, Response } from 'express';
|
||||||
|
import { prisma } from '../../../lib/prisma';
|
||||||
|
import { AuthRequest } from '../../../middleware/auth';
|
||||||
|
import { checkPermission } from '../../../utils/permissions';
|
||||||
|
import { logger } from '../../../config/logger';
|
||||||
|
|
||||||
|
export async function getArticle(req: Request, res: Response) : Promise<void> {
|
||||||
|
try {
|
||||||
|
const article = await prisma.article.findUnique({
|
||||||
|
where: { id: req.params.id },
|
||||||
|
include: {
|
||||||
|
category: true,
|
||||||
|
author: {
|
||||||
|
select: {
|
||||||
|
id: true,
|
||||||
|
displayName: true,
|
||||||
|
email: true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
if (!article) {
|
||||||
|
logger.warn(`Article not found: ${req.params.id}`);
|
||||||
|
res.status(404).json({ error: 'Article not found' });
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
res.json(article);
|
||||||
|
} catch (error) {
|
||||||
|
logger.error('Error fetching article:', error);
|
||||||
|
res.status(500).json({ error: 'Server error' });
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export async function createArticle(req: AuthRequest, res: Response) : Promise<void> {
|
||||||
|
try {
|
||||||
|
const { title, excerpt, content, categoryId, city, coverImage, readTime } = req.body;
|
||||||
|
|
||||||
|
if (!req.user) {
|
||||||
|
logger.warn('Unauthorized article creation attempt');
|
||||||
|
res.status(401).json({ error: 'Not authenticated' });
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
const category = await prisma.category.findUnique({
|
||||||
|
where: { id: parseInt(categoryId) }
|
||||||
|
});
|
||||||
|
|
||||||
|
if (!category) {
|
||||||
|
logger.warn(`Invalid category ID: ${categoryId}`);
|
||||||
|
res.status(400).json({ error: 'Invalid category' });
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!checkPermission(req.user, categoryId, 'create')) {
|
||||||
|
logger.warn(`Permission denied for user ${req.user.id} to create article in category ${category.name}`);
|
||||||
|
res.status(403).json({ error: 'Permission denied' });
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
const article = await prisma.article.create({
|
||||||
|
data: {
|
||||||
|
title,
|
||||||
|
excerpt,
|
||||||
|
content,
|
||||||
|
categoryId: parseInt(categoryId),
|
||||||
|
city,
|
||||||
|
coverImage,
|
||||||
|
readTime,
|
||||||
|
authorId: req.user.id
|
||||||
|
},
|
||||||
|
include: {
|
||||||
|
category: true,
|
||||||
|
author: {
|
||||||
|
select: {
|
||||||
|
id: true,
|
||||||
|
displayName: true,
|
||||||
|
email: true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
logger.info(`Article created: ${article.id} by user ${req.user.id}`);
|
||||||
|
res.status(201).json(article);
|
||||||
|
} catch (error) {
|
||||||
|
logger.error('Error creating article:', error);
|
||||||
|
res.status(500).json({ error: 'Server error' });
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export async function updateArticle(req: AuthRequest, res: Response) : Promise<void> {
|
||||||
|
try {
|
||||||
|
const { title, excerpt, content, categoryId, city, coverImage, readTime } = req.body;
|
||||||
|
|
||||||
|
if (!req.user) {
|
||||||
|
res.status(401).json({ error: 'Not authenticated' });
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
const article = await prisma.article.findUnique({
|
||||||
|
where: { id: req.params.id },
|
||||||
|
include: { category: true }
|
||||||
|
});
|
||||||
|
|
||||||
|
if (!article) {
|
||||||
|
res.status(404).json({ error: 'Article not found' });
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
const category = await prisma.category.findUnique({
|
||||||
|
where: { id: parseInt(categoryId) }
|
||||||
|
});
|
||||||
|
|
||||||
|
if (!category) {
|
||||||
|
res.status(400).json({ error: 'Invalid category' });
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!checkPermission(req.user, categoryId, 'edit')) {
|
||||||
|
res.status(403).json({ error: 'Permission denied' });
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
const updatedArticle = await prisma.article.update({
|
||||||
|
where: { id: req.params.id },
|
||||||
|
data: {
|
||||||
|
title,
|
||||||
|
excerpt,
|
||||||
|
content,
|
||||||
|
categoryId: parseInt(categoryId),
|
||||||
|
city,
|
||||||
|
coverImage,
|
||||||
|
readTime
|
||||||
|
},
|
||||||
|
include: {
|
||||||
|
category: true,
|
||||||
|
author: {
|
||||||
|
select: {
|
||||||
|
id: true,
|
||||||
|
displayName: true,
|
||||||
|
email: true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
res.json(updatedArticle);
|
||||||
|
} catch (error) {
|
||||||
|
logger.error('Error updating article:', error);
|
||||||
|
res.status(500).json({ error: 'Server error' });
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export async function deleteArticle(req: AuthRequest, res: Response) : Promise<void> {
|
||||||
|
try {
|
||||||
|
if (!req.user) {
|
||||||
|
res.status(401).json({ error: 'Not authenticated' });
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
const article = await prisma.article.findUnique({
|
||||||
|
where: { id: req.params.id },
|
||||||
|
include: { category: true }
|
||||||
|
});
|
||||||
|
|
||||||
|
if (!article) {
|
||||||
|
res.status(404).json({ error: 'Article not found' });
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// if (!checkPermission(req.user, article.category, 'delete')) {
|
||||||
|
// res.status(403).json({ error: 'Permission denied' });
|
||||||
|
// return
|
||||||
|
// }
|
||||||
|
|
||||||
|
await prisma.article.delete({
|
||||||
|
where: { id: req.params.id }
|
||||||
|
});
|
||||||
|
|
||||||
|
res.json({ message: 'Article deleted successfully' });
|
||||||
|
} catch (error) {
|
||||||
|
logger.error('Error deleting article:', error);
|
||||||
|
res.status(500).json({ error: 'Server error' });
|
||||||
|
}
|
||||||
|
}
|
50
src/routes/articles/controllers/list.ts
Normal file
50
src/routes/articles/controllers/list.ts
Normal file
@ -0,0 +1,50 @@
|
|||||||
|
import { Request, Response } from 'express';
|
||||||
|
import { prisma } from '../../../lib/prisma';
|
||||||
|
import { Prisma } from '@prisma/client';
|
||||||
|
|
||||||
|
export async function listArticles(req: Request, res: Response) {
|
||||||
|
try {
|
||||||
|
const { page = 1, category, city } = req.query;
|
||||||
|
const perPage = 6;
|
||||||
|
|
||||||
|
// Проверка и преобразование параметров в строковые значения
|
||||||
|
const where: Prisma.ArticleWhereInput = {
|
||||||
|
...(category && { category: { name: category as string } }),
|
||||||
|
...(city && { city: city as string }),
|
||||||
|
};
|
||||||
|
|
||||||
|
// Рассчитываем пропуск записей для пагинации
|
||||||
|
const skip = (Number(page) - 1) * perPage;
|
||||||
|
|
||||||
|
// Выполняем два параллельных запроса: получение статей и подсчёт общего количества
|
||||||
|
const [articles, total] = await Promise.all([
|
||||||
|
prisma.article.findMany({
|
||||||
|
where,
|
||||||
|
include: {
|
||||||
|
author: {
|
||||||
|
select: {
|
||||||
|
id: true,
|
||||||
|
displayName: true,
|
||||||
|
email: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
skip,
|
||||||
|
take: perPage,
|
||||||
|
orderBy: { publishedAt: 'desc' },
|
||||||
|
}),
|
||||||
|
prisma.article.count({ where }),
|
||||||
|
]);
|
||||||
|
|
||||||
|
// Формируем ответ
|
||||||
|
res.json({
|
||||||
|
articles,
|
||||||
|
totalPages: Math.ceil(total / perPage),
|
||||||
|
currentPage: Number(page),
|
||||||
|
});
|
||||||
|
} catch (error) {
|
||||||
|
// Логируем ошибку и отправляем ответ с кодом 500
|
||||||
|
console.error('Error during articles list:', error);
|
||||||
|
res.status(500).json({ error: 'Server error' });
|
||||||
|
}
|
||||||
|
}
|
52
src/routes/articles/controllers/search.ts
Normal file
52
src/routes/articles/controllers/search.ts
Normal file
@ -0,0 +1,52 @@
|
|||||||
|
import { Request, Response } from 'express';
|
||||||
|
import { prisma } from '../../../lib/prisma';
|
||||||
|
import { Prisma } from '@prisma/client';
|
||||||
|
|
||||||
|
export async function searchArticles(req: Request, res: Response) {
|
||||||
|
try {
|
||||||
|
const { q, page = 1, limit = 9 } = req.query;
|
||||||
|
const skip = ((Number(page) || 1) - 1) * (Number(limit) || 9);
|
||||||
|
|
||||||
|
// Определение where с явной обработкой q
|
||||||
|
const where : Prisma.ArticleWhereInput =
|
||||||
|
typeof q === 'string' && q.trim()
|
||||||
|
? {
|
||||||
|
OR: [
|
||||||
|
{ title: { contains: q, mode: 'insensitive' } },
|
||||||
|
{ excerpt: { contains: q, mode: 'insensitive' } },
|
||||||
|
{ content: { contains: q, mode: 'insensitive' } },
|
||||||
|
],
|
||||||
|
}
|
||||||
|
: {};
|
||||||
|
|
||||||
|
// Выполнение запросов
|
||||||
|
const [articles, total] = await Promise.all([
|
||||||
|
prisma.article.findMany({
|
||||||
|
where,
|
||||||
|
include: {
|
||||||
|
author: {
|
||||||
|
select: {
|
||||||
|
id: true,
|
||||||
|
displayName: true,
|
||||||
|
email: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
skip,
|
||||||
|
take: Number(limit) || 9,
|
||||||
|
orderBy: { publishedAt: 'desc' },
|
||||||
|
}),
|
||||||
|
prisma.article.count({ where }),
|
||||||
|
]);
|
||||||
|
|
||||||
|
// Формирование ответа
|
||||||
|
res.json({
|
||||||
|
articles,
|
||||||
|
totalPages: Math.ceil(total / (Number(limit) || 9)),
|
||||||
|
currentPage: Number(page) || 1,
|
||||||
|
});
|
||||||
|
} catch (error) {
|
||||||
|
console.error('Error during article search:', error);
|
||||||
|
res.status(500).json({ error: 'Server error' });
|
||||||
|
}
|
||||||
|
}
|
93
src/routes/articles/crud.ts
Normal file
93
src/routes/articles/crud.ts
Normal file
@ -0,0 +1,93 @@
|
|||||||
|
import { Request, Response } from 'express';
|
||||||
|
import { prisma } from '../../lib/prisma';
|
||||||
|
|
||||||
|
export async function getArticle(req: Request, res: Response) {
|
||||||
|
try {
|
||||||
|
const article = await prisma.article.findUnique({
|
||||||
|
where: { id: req.params.id },
|
||||||
|
include: {
|
||||||
|
author: {
|
||||||
|
select: {
|
||||||
|
id: true,
|
||||||
|
displayName: true,
|
||||||
|
email: true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
if (!article) {
|
||||||
|
return res.status(404).json({ error: 'Article not found' });
|
||||||
|
}
|
||||||
|
|
||||||
|
res.json(article);
|
||||||
|
} catch {
|
||||||
|
res.status(500).json({ error: 'Server error' });
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export async function createArticle(req: Request, res: Response) {
|
||||||
|
try {
|
||||||
|
const { title, excerpt, content, category, city, coverImage, readTime } = req.body;
|
||||||
|
|
||||||
|
const article = await prisma.article.create({
|
||||||
|
data: {
|
||||||
|
title,
|
||||||
|
excerpt,
|
||||||
|
content,
|
||||||
|
category,
|
||||||
|
city,
|
||||||
|
coverImage,
|
||||||
|
readTime,
|
||||||
|
authorId: req.user!.id
|
||||||
|
},
|
||||||
|
include: {
|
||||||
|
author: {
|
||||||
|
select: {
|
||||||
|
id: true,
|
||||||
|
displayName: true,
|
||||||
|
email: true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
res.status(201).json(article);
|
||||||
|
} catch {
|
||||||
|
res.status(500).json({ error: 'Server error' });
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export async function updateArticle(req: Request, res: Response) {
|
||||||
|
try {
|
||||||
|
const article = await prisma.article.update({
|
||||||
|
where: { id: req.params.id },
|
||||||
|
data: req.body,
|
||||||
|
include: {
|
||||||
|
author: {
|
||||||
|
select: {
|
||||||
|
id: true,
|
||||||
|
displayName: true,
|
||||||
|
email: true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
res.json(article);
|
||||||
|
} catch {
|
||||||
|
res.status(500).json({ error: 'Server error' });
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export async function deleteArticle(req: Request, res: Response) {
|
||||||
|
try {
|
||||||
|
await prisma.article.delete({
|
||||||
|
where: { id: req.params.id }
|
||||||
|
});
|
||||||
|
|
||||||
|
res.json({ message: 'Article deleted successfully' });
|
||||||
|
} catch {
|
||||||
|
res.status(500).json({ error: 'Server error' });
|
||||||
|
}
|
||||||
|
}
|
19
src/routes/articles/index.ts
Normal file
19
src/routes/articles/index.ts
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
import express from 'express';
|
||||||
|
import { auth } from '../../middleware/auth';
|
||||||
|
import { searchArticles } from './controllers/search';
|
||||||
|
import { listArticles } from './controllers/list';
|
||||||
|
import { getArticle, createArticle, updateArticle, deleteArticle } from './controllers/crud';
|
||||||
|
|
||||||
|
const router = express.Router();
|
||||||
|
|
||||||
|
// Search and list routes
|
||||||
|
router.get('/search', searchArticles);
|
||||||
|
router.get('/', listArticles);
|
||||||
|
|
||||||
|
// CRUD routes
|
||||||
|
router.get('/:id', getArticle);
|
||||||
|
router.post('/', auth, createArticle);
|
||||||
|
router.put('/:id', auth, updateArticle);
|
||||||
|
router.delete('/:id', auth, deleteArticle);
|
||||||
|
|
||||||
|
export default router;
|
41
src/routes/articles/list.ts
Normal file
41
src/routes/articles/list.ts
Normal file
@ -0,0 +1,41 @@
|
|||||||
|
import { Request, Response } from 'express';
|
||||||
|
import { prisma } from '../../lib/prisma';
|
||||||
|
|
||||||
|
export async function listArticles(req: Request, res: Response) {
|
||||||
|
try {
|
||||||
|
const { page = 1, category, city } = req.query;
|
||||||
|
const perPage = 6;
|
||||||
|
|
||||||
|
const where = {
|
||||||
|
...(category && { category: category as string }),
|
||||||
|
...(city && { city: city as string })
|
||||||
|
};
|
||||||
|
|
||||||
|
const [articles, total] = await Promise.all([
|
||||||
|
prisma.article.findMany({
|
||||||
|
where,
|
||||||
|
include: {
|
||||||
|
author: {
|
||||||
|
select: {
|
||||||
|
id: true,
|
||||||
|
displayName: true,
|
||||||
|
email: true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
skip: ((page as number) - 1) * perPage,
|
||||||
|
take: perPage,
|
||||||
|
orderBy: { publishedAt: 'desc' }
|
||||||
|
}),
|
||||||
|
prisma.article.count({ where })
|
||||||
|
]);
|
||||||
|
|
||||||
|
res.json({
|
||||||
|
articles,
|
||||||
|
totalPages: Math.ceil(total / perPage),
|
||||||
|
currentPage: parseInt(page as string)
|
||||||
|
});
|
||||||
|
} catch {
|
||||||
|
res.status(500).json({ error: 'Server error' });
|
||||||
|
}
|
||||||
|
}
|
44
src/routes/articles/search.ts
Normal file
44
src/routes/articles/search.ts
Normal file
@ -0,0 +1,44 @@
|
|||||||
|
import { Request, Response } from 'express';
|
||||||
|
import { prisma } from '../../lib/prisma';
|
||||||
|
|
||||||
|
export async function searchArticles(req: Request, res: Response) {
|
||||||
|
try {
|
||||||
|
const { q, page = 1, limit = 9 } = req.query;
|
||||||
|
const skip = ((page as number) - 1) * (limit as number);
|
||||||
|
|
||||||
|
const where = {
|
||||||
|
OR: [
|
||||||
|
{ title: { contains: q as string, mode: 'insensitive' } },
|
||||||
|
{ excerpt: { contains: q as string, mode: 'insensitive' } },
|
||||||
|
{ content: { contains: q as string, mode: 'insensitive' } },
|
||||||
|
]
|
||||||
|
};
|
||||||
|
|
||||||
|
const [articles, total] = await Promise.all([
|
||||||
|
prisma.article.findMany({
|
||||||
|
where,
|
||||||
|
include: {
|
||||||
|
author: {
|
||||||
|
select: {
|
||||||
|
id: true,
|
||||||
|
displayName: true,
|
||||||
|
email: true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
skip,
|
||||||
|
take: parseInt(limit as string),
|
||||||
|
orderBy: { publishedAt: 'desc' }
|
||||||
|
}),
|
||||||
|
prisma.article.count({ where })
|
||||||
|
]);
|
||||||
|
|
||||||
|
res.json({
|
||||||
|
articles,
|
||||||
|
totalPages: Math.ceil(total / (limit as number)),
|
||||||
|
currentPage: parseInt(page as string)
|
||||||
|
});
|
||||||
|
} catch {
|
||||||
|
res.status(500).json({ error: 'Server error' });
|
||||||
|
}
|
||||||
|
}
|
47
src/routes/auth/controllers/auth.ts
Normal file
47
src/routes/auth/controllers/auth.ts
Normal file
@ -0,0 +1,47 @@
|
|||||||
|
import { Request, Response } from 'express';
|
||||||
|
import { AuthRequest } from '../../../middleware/auth';
|
||||||
|
import { authService } from '../../../services/authService';
|
||||||
|
|
||||||
|
export async function login(req: Request, res: Response) {
|
||||||
|
try {
|
||||||
|
const { email, password } = req.body;
|
||||||
|
const { user, token } = await authService.login(email, password);
|
||||||
|
res.json({ user, token });
|
||||||
|
} catch {
|
||||||
|
res.status(401).json({ error: 'Invalid credentials' });
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export async function signIn(req: Request, res: Response) {
|
||||||
|
try {
|
||||||
|
const { email, password, displayName } = req.body;
|
||||||
|
const user = await authService.createUser({email : email, password : password, displayName : displayName, permissions : {}});
|
||||||
|
res.json({ user });
|
||||||
|
} catch {
|
||||||
|
res.status(401).json({ error: 'Invalid signIn credentials' });
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export async function getCurrentUser(req: AuthRequest, res: Response) {
|
||||||
|
try {
|
||||||
|
if (!req.user) {
|
||||||
|
res.status(401).json({ error: 'Not authenticated' });
|
||||||
|
return
|
||||||
|
}
|
||||||
|
res.json(req.user);
|
||||||
|
} catch {
|
||||||
|
res.status(500).json({ error: 'Server error' });
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export async function refreshToken(req: AuthRequest, res: Response) {
|
||||||
|
try {
|
||||||
|
if (!req.user) {
|
||||||
|
return res.status(401).json({ error: 'Not authenticated' });
|
||||||
|
}
|
||||||
|
const token = await authService.generateToken(req.user.id);
|
||||||
|
res.json({ token });
|
||||||
|
} catch {
|
||||||
|
res.status(500).json({ error: 'Failed to refresh token' });
|
||||||
|
}
|
||||||
|
}
|
13
src/routes/auth/index.ts
Normal file
13
src/routes/auth/index.ts
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
import express from 'express';
|
||||||
|
import { auth } from '../../middleware/auth';
|
||||||
|
import { login, signIn, getCurrentUser } from './controllers/auth';
|
||||||
|
import { validateRequest } from '../../middleware/validation/validateRequest';
|
||||||
|
import { loginSchema, signInSchema } from './validation/authSchemas';
|
||||||
|
|
||||||
|
const router = express.Router();
|
||||||
|
|
||||||
|
router.post('/signin', validateRequest(signInSchema), signIn);
|
||||||
|
router.post('/login', validateRequest(loginSchema), login);
|
||||||
|
router.get('/me', auth, getCurrentUser);
|
||||||
|
|
||||||
|
export default router;
|
16
src/routes/auth/validation/authSchemas.ts
Normal file
16
src/routes/auth/validation/authSchemas.ts
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
import { z } from 'zod';
|
||||||
|
|
||||||
|
export const loginSchema = z.object({
|
||||||
|
body: z.object({
|
||||||
|
email: z.string().email(),
|
||||||
|
password: z.string().min(6)
|
||||||
|
})
|
||||||
|
});
|
||||||
|
|
||||||
|
export const signInSchema = z.object({
|
||||||
|
body: z.object({
|
||||||
|
email: z.string().email(),
|
||||||
|
password: z.string().min(6),
|
||||||
|
displayName: z.string().min(5)
|
||||||
|
})
|
||||||
|
});
|
81
src/routes/gallery/controllers/crud.ts
Normal file
81
src/routes/gallery/controllers/crud.ts
Normal file
@ -0,0 +1,81 @@
|
|||||||
|
import { Request, Response } from 'express';
|
||||||
|
import { AuthRequest } from '../../../middleware/auth';
|
||||||
|
import { galleryService } from '../../../services/galleryService';
|
||||||
|
import { s3Service } from '../../../services/s3Service';
|
||||||
|
import { logger } from '../../../config/logger';
|
||||||
|
|
||||||
|
export async function createGalleryImage(req: AuthRequest, res: Response) {
|
||||||
|
try {
|
||||||
|
const { articleId } = req.params;
|
||||||
|
const { url, caption, alt, width, height, size, format } = req.body;
|
||||||
|
|
||||||
|
const image = await galleryService.createImage({
|
||||||
|
url,
|
||||||
|
caption,
|
||||||
|
alt,
|
||||||
|
width,
|
||||||
|
height,
|
||||||
|
size,
|
||||||
|
format,
|
||||||
|
articleId
|
||||||
|
});
|
||||||
|
|
||||||
|
res.status(201).json(image);
|
||||||
|
} catch (error) {
|
||||||
|
logger.error('Error creating gallery image:', error);
|
||||||
|
res.status(500).json({ error: 'Failed to create gallery image' });
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export async function updateGalleryImage(req: AuthRequest, res: Response) {
|
||||||
|
try {
|
||||||
|
const { id } = req.params;
|
||||||
|
const { caption, alt, order } = req.body;
|
||||||
|
|
||||||
|
const image = await galleryService.updateImage(id, {
|
||||||
|
caption,
|
||||||
|
alt,
|
||||||
|
order
|
||||||
|
});
|
||||||
|
|
||||||
|
res.json(image);
|
||||||
|
} catch (error) {
|
||||||
|
logger.error('Error updating gallery image:', error);
|
||||||
|
res.status(500).json({ error: 'Failed to update gallery image' });
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export async function deleteGalleryImage(req: AuthRequest, res: Response) {
|
||||||
|
try {
|
||||||
|
const { id } = req.params;
|
||||||
|
await galleryService.deleteImage(id);
|
||||||
|
res.json({ message: 'Gallery image deleted successfully' });
|
||||||
|
} catch (error) {
|
||||||
|
logger.error('Error deleting gallery image:', error);
|
||||||
|
res.status(500).json({ error: 'Failed to delete gallery image' });
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export async function reorderGalleryImages(req: AuthRequest, res: Response) {
|
||||||
|
try {
|
||||||
|
const { articleId } = req.params;
|
||||||
|
const { imageIds } = req.body;
|
||||||
|
|
||||||
|
await galleryService.reorderImages(articleId, imageIds);
|
||||||
|
res.json({ message: 'Gallery images reordered successfully' });
|
||||||
|
} catch (error) {
|
||||||
|
logger.error('Error reordering gallery images:', error);
|
||||||
|
res.status(500).json({ error: 'Failed to reorder gallery images' });
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export async function getArticleGallery(req: Request, res: Response) {
|
||||||
|
try {
|
||||||
|
const { articleId } = req.params;
|
||||||
|
const images = await galleryService.getArticleGallery(articleId);
|
||||||
|
res.json(images);
|
||||||
|
} catch (error) {
|
||||||
|
logger.error('Error fetching article gallery:', error);
|
||||||
|
res.status(500).json({ error: 'Failed to fetch gallery images' });
|
||||||
|
}
|
||||||
|
}
|
19
src/routes/gallery/index.ts
Normal file
19
src/routes/gallery/index.ts
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
import express from 'express';
|
||||||
|
import { auth } from '../../middleware/auth';
|
||||||
|
import {
|
||||||
|
createGalleryImage,
|
||||||
|
updateGalleryImage,
|
||||||
|
deleteGalleryImage,
|
||||||
|
reorderGalleryImages,
|
||||||
|
getArticleGallery
|
||||||
|
} from './controllers/crud';
|
||||||
|
|
||||||
|
const router = express.Router();
|
||||||
|
|
||||||
|
router.get('/article/:articleId', getArticleGallery);
|
||||||
|
router.post('/article/:articleId', auth, createGalleryImage);
|
||||||
|
router.put('/:id', auth, updateGalleryImage);
|
||||||
|
router.delete('/:id', auth, deleteGalleryImage);
|
||||||
|
router.post('/article/:articleId/reorder', auth, reorderGalleryImages);
|
||||||
|
|
||||||
|
export default router;
|
100
src/routes/images/index.ts
Normal file
100
src/routes/images/index.ts
Normal file
@ -0,0 +1,100 @@
|
|||||||
|
import express from 'express';
|
||||||
|
import multer from 'multer';
|
||||||
|
import multerS3 from 'multer-s3';
|
||||||
|
import { auth } from '../../middleware/auth';
|
||||||
|
import {createS3Client, s3Service} from '../../services/s3MulterService';
|
||||||
|
import { logger } from '../../config/logger';
|
||||||
|
import { imageResolutions } from '../../config/imageResolutions';
|
||||||
|
|
||||||
|
const router = express.Router();
|
||||||
|
//const upload = multer();
|
||||||
|
|
||||||
|
// Инициализация Multer-S3
|
||||||
|
const s3Client = createS3Client(); // Экспортируем клиент из s3Service
|
||||||
|
const upload = multer({
|
||||||
|
storage: multerS3({
|
||||||
|
s3: s3Client,
|
||||||
|
bucket: process.env.AWS_S3_BUCKET || '',
|
||||||
|
metadata: (req, file, cb) => {
|
||||||
|
cb(null, { fieldName: file.fieldname });
|
||||||
|
},
|
||||||
|
key: (req, file, cb) => {
|
||||||
|
const fileName = `${Date.now()}-${file.originalname}`;
|
||||||
|
cb(null, `uploads/${fileName}`);
|
||||||
|
},
|
||||||
|
contentType: multerS3.AUTO_CONTENT_TYPE,
|
||||||
|
}),
|
||||||
|
});
|
||||||
|
|
||||||
|
/*
|
||||||
|
router.post('/upload-url', auth, async (req, res) : Promise<void> => {
|
||||||
|
try {
|
||||||
|
const { fileName, fileType, resolution } = req.body;
|
||||||
|
|
||||||
|
if (!fileName || !fileType || !resolution) {
|
||||||
|
res.status(400).json({ error: 'Missing required fields' });
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
const selectedResolution = imageResolutions.find(r => r.id === resolution);
|
||||||
|
if (!selectedResolution) {
|
||||||
|
res.status(400).json({ error: 'Invalid resolution' });
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
const { uploadUrl, imageId, key } = await s3Service.getUploadUrl(fileName, fileType);
|
||||||
|
|
||||||
|
logger.info(`Generated upload URL for image: ${fileName}`);
|
||||||
|
res.json({ uploadUrl, imageId, key });
|
||||||
|
} catch (error) {
|
||||||
|
logger.error('Error generating upload URL:', error);
|
||||||
|
res.status(500).json({ error: 'Failed to generate upload URL' });
|
||||||
|
}
|
||||||
|
});
|
||||||
|
*/
|
||||||
|
|
||||||
|
// Маршрут для загрузки изображения
|
||||||
|
router.post('/upload-url', auth, upload.single('file'), async (req, res): Promise<void> => {
|
||||||
|
try {
|
||||||
|
const file = req.file as Express.MulterS3.File;
|
||||||
|
const { resolutionId } = req.body;
|
||||||
|
|
||||||
|
if (!file) {
|
||||||
|
res.status(400).json({ error: 'Файл не найден' });
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Сохраняем оригинал и обрабатываем изображение
|
||||||
|
const originalKey = await s3Service.uploadOriginalFile(file);
|
||||||
|
const optimizedResult = await s3Service.optimizeAndUpload(file.buffer, originalKey, resolutionId);
|
||||||
|
|
||||||
|
res.status(200).json({
|
||||||
|
message: 'Файл успешно загружен и оптимизирован',
|
||||||
|
originalKey,
|
||||||
|
optimizedKey: optimizedResult.key,
|
||||||
|
dimensions: {
|
||||||
|
width: optimizedResult.width,
|
||||||
|
height: optimizedResult.height,
|
||||||
|
},
|
||||||
|
format: optimizedResult.format,
|
||||||
|
size: optimizedResult.size,
|
||||||
|
});
|
||||||
|
} catch (error) {
|
||||||
|
logger.error('Ошибка загрузки изображения:', error);
|
||||||
|
res.status(500).json({ error: 'Ошибка загрузки изображения' });
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
/*
|
||||||
|
router.get('/:id', auth, async (req, res) => {
|
||||||
|
try {
|
||||||
|
const { id } = req.params;
|
||||||
|
const image = await s3Service.getImage(id);
|
||||||
|
res.json(image);
|
||||||
|
} catch (error) {
|
||||||
|
logger.error('Error fetching image:', error);
|
||||||
|
res.status(500).json({ error: 'Failed to fetch image' });
|
||||||
|
}
|
||||||
|
});
|
||||||
|
*/
|
||||||
|
export default router;
|
39
src/routes/users/controllers/users.ts
Normal file
39
src/routes/users/controllers/users.ts
Normal file
@ -0,0 +1,39 @@
|
|||||||
|
import { Response } from 'express';
|
||||||
|
import { AuthRequest } from '../../../middleware/auth';
|
||||||
|
import { userService } from '../../../services/userService';
|
||||||
|
|
||||||
|
export async function getUsers(req: AuthRequest, res: Response): Promise<void> {
|
||||||
|
try {
|
||||||
|
// Проверка прав администратора
|
||||||
|
if (!req.user?.permissions.isAdmin) {
|
||||||
|
res.status(403).json({ error: 'Admin access required' });
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// Получение списка пользователей
|
||||||
|
const users = await userService.getUsers();
|
||||||
|
res.json(users);
|
||||||
|
} catch {
|
||||||
|
res.status(500).json({ error: 'Server error' });
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export async function updateUserPermissions(req: AuthRequest, res: Response): Promise<void> {
|
||||||
|
try {
|
||||||
|
// Проверка прав администратора
|
||||||
|
if (!req.user?.permissions.isAdmin) {
|
||||||
|
res.status(403).json({ error: 'Admin access required' });
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// Извлечение параметров из запроса
|
||||||
|
const { id } = req.params;
|
||||||
|
const { permissions } = req.body;
|
||||||
|
|
||||||
|
// Обновление прав пользователя
|
||||||
|
const user = await userService.updateUserPermissions(id, permissions);
|
||||||
|
res.json(user);
|
||||||
|
} catch {
|
||||||
|
res.status(500).json({ error: 'Server error' });
|
||||||
|
}
|
||||||
|
}
|
10
src/routes/users/index.ts
Normal file
10
src/routes/users/index.ts
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
import express from 'express';
|
||||||
|
import { auth } from '../../middleware/auth';
|
||||||
|
import { getUsers, updateUserPermissions } from './controllers/users';
|
||||||
|
|
||||||
|
const router = express.Router();
|
||||||
|
|
||||||
|
router.get('/', auth, getUsers);
|
||||||
|
router.put('/:id/permissions', auth, updateUserPermissions);
|
||||||
|
|
||||||
|
export default router;
|
56
src/server.ts
Normal file
56
src/server.ts
Normal file
@ -0,0 +1,56 @@
|
|||||||
|
import express from 'express';
|
||||||
|
import cors from 'cors';
|
||||||
|
import dotenv from 'dotenv';
|
||||||
|
import morgan from 'morgan';
|
||||||
|
import { logger, stream } from './config/logger';
|
||||||
|
import { requestLogger } from './middleware/logging/requestLogger';
|
||||||
|
import { errorLogger } from './middleware/error/errorLogger';
|
||||||
|
import authRoutes from './routes/auth/index';
|
||||||
|
import userRoutes from './routes/users/index';
|
||||||
|
import articleRoutes from './routes/articles/index';
|
||||||
|
import galleryRoutes from './routes/gallery/index';
|
||||||
|
import imagesRoutes from './routes/images/index';
|
||||||
|
|
||||||
|
|
||||||
|
const app = express();
|
||||||
|
|
||||||
|
// Загрузка переменных окружения
|
||||||
|
dotenv.config();
|
||||||
|
|
||||||
|
const PORT = process.env.PORT || 5000;
|
||||||
|
|
||||||
|
// Используем Morgan с кастомным логированием через Winston
|
||||||
|
app.use(morgan('combined', { stream }));
|
||||||
|
|
||||||
|
// Middleware для обработки JSON
|
||||||
|
app.use(cors());
|
||||||
|
app.use(express.json());
|
||||||
|
app.use(requestLogger);
|
||||||
|
|
||||||
|
// Обработка ошибок
|
||||||
|
app.use(errorLogger);
|
||||||
|
|
||||||
|
// Маршруты
|
||||||
|
app.use('/api/auth', authRoutes);
|
||||||
|
app.use('/api/users', userRoutes);
|
||||||
|
app.use('/api/articles', articleRoutes);
|
||||||
|
app.use('/api/gallery', galleryRoutes);
|
||||||
|
app.use('/api/images', imagesRoutes);
|
||||||
|
|
||||||
|
// Запуск сервера
|
||||||
|
app.listen(PORT, () => {
|
||||||
|
console.log(`Server is running on http://localhost:${PORT}`);
|
||||||
|
logger.info(`Server running on port ${PORT}`);
|
||||||
|
});
|
||||||
|
|
||||||
|
// Обработка не перехваченных исключений
|
||||||
|
process.on('uncaughtException', (error) => {
|
||||||
|
logger.error('Uncaught Exception:', error);
|
||||||
|
process.exit(1);
|
||||||
|
});
|
||||||
|
|
||||||
|
// Обработка не обработанных promise rejections
|
||||||
|
process.on('unhandledRejection', (reason, promise) => {
|
||||||
|
logger.error('Unhandled Rejection at:', promise, 'reason:', reason);
|
||||||
|
process.exit(1);
|
||||||
|
});
|
114
src/services/authService.ts
Normal file
114
src/services/authService.ts
Normal file
@ -0,0 +1,114 @@
|
|||||||
|
import { PrismaClient } from '@prisma/client';
|
||||||
|
import bcrypt from 'bcryptjs';
|
||||||
|
import jwt from 'jsonwebtoken';
|
||||||
|
import {User, UserPermissions} from '../types/auth';
|
||||||
|
import { logger } from '../config/logger';
|
||||||
|
import {JsonValue} from "@prisma/client/runtime/library";
|
||||||
|
|
||||||
|
const prisma = new PrismaClient();
|
||||||
|
|
||||||
|
export const authService = {
|
||||||
|
login: async (email: string, password: string) => {
|
||||||
|
try {
|
||||||
|
logger.info(`Login attempt for user: ${email}`);
|
||||||
|
|
||||||
|
const user : {
|
||||||
|
email: string;
|
||||||
|
password: string;
|
||||||
|
id: string;
|
||||||
|
displayName: string;
|
||||||
|
permissions: JsonValue;
|
||||||
|
} | null = await prisma.user.findUnique({
|
||||||
|
where: { email },
|
||||||
|
select: {
|
||||||
|
id: true,
|
||||||
|
email: true,
|
||||||
|
displayName: true,
|
||||||
|
password: true,
|
||||||
|
permissions: true
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
if (!user) {
|
||||||
|
logger.warn(`Login failed: User not found - ${email}`);
|
||||||
|
throw new Error('Invalid credentials');
|
||||||
|
}
|
||||||
|
|
||||||
|
const isValidPassword = await bcrypt.compare(password, user.password);
|
||||||
|
if (!isValidPassword) {
|
||||||
|
logger.warn(`Login failed: Invalid password for user - ${email}`);
|
||||||
|
throw new Error('Invalid credentials');
|
||||||
|
}
|
||||||
|
|
||||||
|
const token = await authService.generateToken(user.id);
|
||||||
|
const { password: _, ...userWithoutPassword } = user;
|
||||||
|
|
||||||
|
const permissions = user.permissions as unknown;
|
||||||
|
|
||||||
|
logger.info(`User logged in successfully: ${email}`);
|
||||||
|
return {
|
||||||
|
user: {...userWithoutPassword,
|
||||||
|
permissions: permissions as UserPermissions } as User,
|
||||||
|
token
|
||||||
|
};
|
||||||
|
} catch (error) {
|
||||||
|
logger.error('Login error:', error);
|
||||||
|
throw error;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
generateToken: async (userId: string) => {
|
||||||
|
try {
|
||||||
|
const token = jwt.sign(
|
||||||
|
{ id: userId },
|
||||||
|
process.env.JWT_SECRET || '',
|
||||||
|
{ expiresIn: '24h' }
|
||||||
|
);
|
||||||
|
logger.debug(`Generated token for user: ${userId}`);
|
||||||
|
return token;
|
||||||
|
} catch (error) {
|
||||||
|
logger.error('Token generation error:', error);
|
||||||
|
throw error;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
createUser: async (userData: {
|
||||||
|
email: string;
|
||||||
|
password: string;
|
||||||
|
displayName: string;
|
||||||
|
permissions: any;
|
||||||
|
}) => {
|
||||||
|
try {
|
||||||
|
logger.info(`Creating new user: ${userData.email}`);
|
||||||
|
|
||||||
|
const hashedPassword = await bcrypt.hash(userData.password, 10);
|
||||||
|
const user : {
|
||||||
|
email: string;
|
||||||
|
id: string;
|
||||||
|
displayName: string;
|
||||||
|
permissions: JsonValue;
|
||||||
|
} = await prisma.user.create({
|
||||||
|
data: {
|
||||||
|
...userData,
|
||||||
|
password: hashedPassword
|
||||||
|
},
|
||||||
|
select: {
|
||||||
|
id: true,
|
||||||
|
email: true,
|
||||||
|
displayName: true,
|
||||||
|
permissions: true
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
logger.info(`User created successfully: ${userData.email}`);
|
||||||
|
|
||||||
|
const permissions = user.permissions as unknown;
|
||||||
|
|
||||||
|
return {...user,
|
||||||
|
permissions: permissions as UserPermissions } as User
|
||||||
|
} catch (error) {
|
||||||
|
logger.error('User creation error:', error);
|
||||||
|
throw error;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
91
src/services/galleryService.ts
Normal file
91
src/services/galleryService.ts
Normal file
@ -0,0 +1,91 @@
|
|||||||
|
import {PrismaClient} from '@prisma/client';
|
||||||
|
import {logger} from '../config/logger';
|
||||||
|
|
||||||
|
const prisma = new PrismaClient();
|
||||||
|
|
||||||
|
export const galleryService = {
|
||||||
|
createImage: async (data: {
|
||||||
|
url: string;
|
||||||
|
caption: string;
|
||||||
|
alt: string;
|
||||||
|
width: number;
|
||||||
|
height: number;
|
||||||
|
size: number;
|
||||||
|
format: string;
|
||||||
|
articleId: string;
|
||||||
|
order?: number;
|
||||||
|
}) => {
|
||||||
|
try {
|
||||||
|
const image = await prisma.galleryImage.create({
|
||||||
|
data
|
||||||
|
});
|
||||||
|
logger.info(`Created gallery image: ${image.id}`);
|
||||||
|
return image;
|
||||||
|
} catch (error) {
|
||||||
|
logger.error('Error creating gallery image:', error);
|
||||||
|
throw error;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
updateImage: async (
|
||||||
|
id: string,
|
||||||
|
data: {
|
||||||
|
caption?: string;
|
||||||
|
alt?: string;
|
||||||
|
order?: number;
|
||||||
|
}
|
||||||
|
) => {
|
||||||
|
try {
|
||||||
|
const image = await prisma.galleryImage.update({
|
||||||
|
where: { id },
|
||||||
|
data
|
||||||
|
});
|
||||||
|
logger.info(`Updated gallery image: ${id}`);
|
||||||
|
return image;
|
||||||
|
} catch (error) {
|
||||||
|
logger.error(`Error updating gallery image ${id}:`, error);
|
||||||
|
throw error;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
deleteImage: async (id: string) => {
|
||||||
|
try {
|
||||||
|
await prisma.galleryImage.delete({
|
||||||
|
where: { id }
|
||||||
|
});
|
||||||
|
logger.info(`Deleted gallery image: ${id}`);
|
||||||
|
} catch (error) {
|
||||||
|
logger.error(`Error deleting gallery image ${id}:`, error);
|
||||||
|
throw error;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
reorderImages: async (articleId: string, imageIds: string[]) => {
|
||||||
|
try {
|
||||||
|
await prisma.$transaction(
|
||||||
|
imageIds.map((id, index) =>
|
||||||
|
prisma.galleryImage.update({
|
||||||
|
where: { id },
|
||||||
|
data: { order: index }
|
||||||
|
})
|
||||||
|
)
|
||||||
|
);
|
||||||
|
logger.info(`Reordered gallery images for article: ${articleId}`);
|
||||||
|
} catch (error) {
|
||||||
|
logger.error(`Error reordering gallery images for article ${articleId}:`, error);
|
||||||
|
throw error;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
getArticleGallery: async (articleId: string) => {
|
||||||
|
try {
|
||||||
|
return await prisma.galleryImage.findMany({
|
||||||
|
where: {articleId},
|
||||||
|
orderBy: {order: 'asc'}
|
||||||
|
});
|
||||||
|
} catch (error) {
|
||||||
|
logger.error(`Error fetching gallery for article ${articleId}:`, error);
|
||||||
|
throw error;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
78
src/services/s3MulterService.ts
Normal file
78
src/services/s3MulterService.ts
Normal file
@ -0,0 +1,78 @@
|
|||||||
|
import { S3Client, PutObjectCommand } from '@aws-sdk/client-s3';
|
||||||
|
import sharp from 'sharp';
|
||||||
|
import { logger } from '../config/logger';
|
||||||
|
import { imageResolutions } from '../config/imageResolutions';
|
||||||
|
|
||||||
|
const s3Client = new S3Client({
|
||||||
|
region: process.env.AWS_REGION || 'ru-central1',
|
||||||
|
endpoint: process.env.AWS_ENDPOINT || '',
|
||||||
|
credentials: {
|
||||||
|
accessKeyId: process.env.AWS_ACCESS_KEY_ID || '',
|
||||||
|
secretAccessKey: process.env.AWS_SECRET_ACCESS_KEY || '',
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
// Создание клиента S3
|
||||||
|
export const createS3Client = () => {
|
||||||
|
return new S3Client({
|
||||||
|
region: process.env.AWS_REGION || 'ru-central1',
|
||||||
|
endpoint: process.env.AWS_ENDPOINT || '',
|
||||||
|
credentials: {
|
||||||
|
accessKeyId: process.env.AWS_ACCESS_KEY_ID || '',
|
||||||
|
secretAccessKey: process.env.AWS_SECRET_ACCESS_KEY || '',
|
||||||
|
},
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
const BUCKET_NAME = process.env.AWS_S3_BUCKET || '';
|
||||||
|
|
||||||
|
export const s3Service = {
|
||||||
|
uploadOriginalFile: async (file: Express.MulterS3.File) => {
|
||||||
|
logger.info(`Оригинальный файл загружен в S3: ${file.key}`);
|
||||||
|
return file.key;
|
||||||
|
},
|
||||||
|
|
||||||
|
optimizeAndUpload: async (fileBuffer: Buffer, originalKey: string, resolutionId: string) => {
|
||||||
|
const selectedResolution = imageResolutions.find(r => r.id === resolutionId);
|
||||||
|
if (!selectedResolution) {
|
||||||
|
throw new Error('Недопустимое разрешение');
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
// Оптимизация изображения
|
||||||
|
const optimizedBuffer = await sharp(fileBuffer)
|
||||||
|
.resize(selectedResolution.width, selectedResolution.height, {
|
||||||
|
fit: 'inside',
|
||||||
|
withoutEnlargement: true,
|
||||||
|
})
|
||||||
|
.webp({ quality: 80 })
|
||||||
|
.toBuffer();
|
||||||
|
|
||||||
|
// Генерация нового ключа для оптимизированного файла
|
||||||
|
const optimizedKey = originalKey.replace(/\.[^/.]+$/, '.webp');
|
||||||
|
|
||||||
|
// Загрузка оптимизированного файла
|
||||||
|
await s3Client.send(
|
||||||
|
new PutObjectCommand({
|
||||||
|
Bucket: BUCKET_NAME,
|
||||||
|
Key: optimizedKey,
|
||||||
|
Body: optimizedBuffer,
|
||||||
|
ContentType: 'image/webp',
|
||||||
|
})
|
||||||
|
);
|
||||||
|
|
||||||
|
logger.info(`Оптимизированное изображение загружено в S3: ${optimizedKey}`);
|
||||||
|
|
||||||
|
return {
|
||||||
|
key: optimizedKey,
|
||||||
|
width: selectedResolution.width,
|
||||||
|
height: selectedResolution.height,
|
||||||
|
format: 'webp',
|
||||||
|
size: optimizedBuffer.length,
|
||||||
|
};
|
||||||
|
} catch (error) {
|
||||||
|
logger.error('Ошибка при оптимизации и загрузке файла:', error);
|
||||||
|
throw error;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
};
|
128
src/services/s3Service.ts
Normal file
128
src/services/s3Service.ts
Normal file
@ -0,0 +1,128 @@
|
|||||||
|
import { S3Client, PutObjectCommand, GetObjectCommand, PutBucketCorsCommand } from '@aws-sdk/client-s3';
|
||||||
|
import { getSignedUrl } from '@aws-sdk/s3-request-presigner';
|
||||||
|
import { v4 as uuidv4 } from 'uuid';
|
||||||
|
import sharp from 'sharp';
|
||||||
|
import { logger } from '../config/logger';
|
||||||
|
|
||||||
|
// Инициализация клиента S3
|
||||||
|
const s3Client = new S3Client({
|
||||||
|
region: process.env.AWS_REGION || 'ru-central1',
|
||||||
|
endpoint: process.env.AWS_ENDPOINT || '',
|
||||||
|
credentials: {
|
||||||
|
accessKeyId: process.env.AWS_ACCESS_KEY_ID || '',
|
||||||
|
secretAccessKey: process.env.AWS_SECRET_ACCESS_KEY || ''
|
||||||
|
},
|
||||||
|
forcePathStyle: true
|
||||||
|
});
|
||||||
|
|
||||||
|
const BUCKET_NAME = process.env.AWS_S3_BUCKET || '';
|
||||||
|
|
||||||
|
// Конфигурация CORS
|
||||||
|
const corsConfig = {
|
||||||
|
Bucket: BUCKET_NAME,
|
||||||
|
CORSConfiguration: {
|
||||||
|
CORSRules: [
|
||||||
|
{
|
||||||
|
AllowedOrigins: ['http://127.0.0.1:5173'], // Домен фронтенда
|
||||||
|
AllowedMethods: ['GET', 'PUT', 'POST', 'DELETE'], // Разрешенные методы
|
||||||
|
AllowedHeaders: ['*'], // Разрешенные заголовки
|
||||||
|
ExposeHeaders: ['ETag', 'x-amz-meta-custom-header'], // Заголовки в ответе
|
||||||
|
MaxAgeSeconds: 3000, // Кеширование CORS
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
// Применение конфигурации
|
||||||
|
const applyCors = async () => {
|
||||||
|
try {
|
||||||
|
const command = new PutBucketCorsCommand(corsConfig);
|
||||||
|
await s3Client.send(command);
|
||||||
|
console.log('CORS успешно настроен.');
|
||||||
|
} catch (error) {
|
||||||
|
console.error('Ошибка при настройке CORS:', error);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
//applyCors();
|
||||||
|
|
||||||
|
export const s3Service = {
|
||||||
|
getUploadUrl: async (fileName: string, fileType: string) => {
|
||||||
|
const imageId = uuidv4();
|
||||||
|
const key = `uploads/${imageId}-${fileName}`;
|
||||||
|
|
||||||
|
const command = new PutObjectCommand({
|
||||||
|
Bucket: BUCKET_NAME,
|
||||||
|
Key: key,
|
||||||
|
ContentType: fileType
|
||||||
|
});
|
||||||
|
|
||||||
|
try {
|
||||||
|
const uploadUrl = await getSignedUrl(s3Client, command, { expiresIn: 3600 });
|
||||||
|
logger.info(`Generated pre-signed URL for upload: ${key}`);
|
||||||
|
return { uploadUrl, imageId, key };
|
||||||
|
} catch (error) {
|
||||||
|
logger.error('Error generating pre-signed URL:', error);
|
||||||
|
throw error;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
getImage: async (imageId: string) => {
|
||||||
|
try {
|
||||||
|
const command = new GetObjectCommand({
|
||||||
|
Bucket: BUCKET_NAME,
|
||||||
|
Key: `uploads/${imageId}`
|
||||||
|
});
|
||||||
|
|
||||||
|
const url = await getSignedUrl(s3Client, command, { expiresIn: 3600 });
|
||||||
|
return { url };
|
||||||
|
} catch (error) {
|
||||||
|
logger.error('Error getting image:', error);
|
||||||
|
throw error;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
optimizeAndUpload: async (buffer: Buffer, key: string, resolution: { width: number; height: number }) => {
|
||||||
|
try {
|
||||||
|
let sharpInstance = sharp(buffer);
|
||||||
|
|
||||||
|
// Get image metadata
|
||||||
|
const metadata = await sharpInstance.metadata();
|
||||||
|
|
||||||
|
// Resize if resolution is specified
|
||||||
|
if (resolution.width > 0 && resolution.height > 0) {
|
||||||
|
sharpInstance = sharpInstance.resize(resolution.width, resolution.height, {
|
||||||
|
fit: 'inside',
|
||||||
|
withoutEnlargement: true
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// Convert to WebP for better compression
|
||||||
|
const optimizedBuffer = await sharpInstance
|
||||||
|
.webp({ quality: 80 })
|
||||||
|
.toBuffer();
|
||||||
|
|
||||||
|
// Upload optimized image
|
||||||
|
const optimizedKey = key.replace(/\.[^/.]+$/, '.webp');
|
||||||
|
await s3Client.send(new PutObjectCommand({
|
||||||
|
Bucket: BUCKET_NAME,
|
||||||
|
Key: optimizedKey,
|
||||||
|
Body: optimizedBuffer,
|
||||||
|
ContentType: 'image/webp'
|
||||||
|
}));
|
||||||
|
|
||||||
|
logger.info(`Successfully optimized and uploaded image: ${optimizedKey}`);
|
||||||
|
|
||||||
|
return {
|
||||||
|
key: optimizedKey,
|
||||||
|
width: metadata.width,
|
||||||
|
height: metadata.height,
|
||||||
|
format: 'webp',
|
||||||
|
size: optimizedBuffer.length
|
||||||
|
};
|
||||||
|
} catch (error) {
|
||||||
|
logger.error('Error optimizing and uploading image:', error);
|
||||||
|
throw error;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
83
src/services/userService.ts
Normal file
83
src/services/userService.ts
Normal file
@ -0,0 +1,83 @@
|
|||||||
|
import { PrismaClient } from '@prisma/client';
|
||||||
|
import { User, UserPermissions } from '../types/auth';
|
||||||
|
import { JsonValue } from '@prisma/client/runtime/library';
|
||||||
|
|
||||||
|
const prisma = new PrismaClient();
|
||||||
|
|
||||||
|
export const userService = {
|
||||||
|
getUsers: async (): Promise<User[]> => {
|
||||||
|
try {
|
||||||
|
const users: Array<{
|
||||||
|
id: string;
|
||||||
|
email: string;
|
||||||
|
displayName: string;
|
||||||
|
permissions: JsonValue;
|
||||||
|
}> = await prisma.user.findMany({
|
||||||
|
select: {
|
||||||
|
id: true,
|
||||||
|
email: true,
|
||||||
|
displayName: true,
|
||||||
|
permissions: true,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
return users.map((user) => {
|
||||||
|
const permissions = user.permissions as unknown;
|
||||||
|
|
||||||
|
if (isValidUserPermissions(permissions)) {
|
||||||
|
return {
|
||||||
|
...user,
|
||||||
|
permissions: permissions as UserPermissions,
|
||||||
|
} as User;
|
||||||
|
} else {
|
||||||
|
throw new Error(`Invalid permissions format for user ${user.id}`);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} catch (error) {
|
||||||
|
console.error('Error fetching users:', error);
|
||||||
|
throw new Error('Failed to fetch users');
|
||||||
|
}
|
||||||
|
},
|
||||||
|
updateUserPermissions: async (
|
||||||
|
userId: string,
|
||||||
|
permissions: User['permissions']
|
||||||
|
): Promise<User> => {
|
||||||
|
try {
|
||||||
|
const updatedUser = await prisma.user.update({
|
||||||
|
where: { id: userId },
|
||||||
|
data: {
|
||||||
|
permissions: permissions as any, // Сохраняем в базу JSON-объект
|
||||||
|
},
|
||||||
|
select: {
|
||||||
|
id: true,
|
||||||
|
email: true,
|
||||||
|
displayName: true,
|
||||||
|
permissions: true,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
// Валидируем полученные данные
|
||||||
|
const updatedPermissions = updatedUser.permissions as unknown;
|
||||||
|
|
||||||
|
if (isValidUserPermissions(updatedPermissions)) {
|
||||||
|
return {
|
||||||
|
...updatedUser,
|
||||||
|
permissions: updatedPermissions as UserPermissions,
|
||||||
|
} as User;
|
||||||
|
} else {
|
||||||
|
throw new Error('Invalid permissions format for updated user ${userId}');
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
console.error('Error updating user permissions:', error);
|
||||||
|
throw new Error('Failed to update user permissions');
|
||||||
|
}
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
// Функция проверки структуры UserPermissions
|
||||||
|
function isValidUserPermissions(value: unknown): value is UserPermissions {
|
||||||
|
if (typeof value !== 'object' || value === null) return false;
|
||||||
|
|
||||||
|
const permissions = value as UserPermissions;
|
||||||
|
return (Array.isArray(permissions.cities) && typeof permissions.categories === 'object');
|
||||||
|
}
|
20
src/types/auth.ts
Normal file
20
src/types/auth.ts
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
import { CategoryName, City } from './index';
|
||||||
|
|
||||||
|
export interface UserPermissions {
|
||||||
|
categories: {
|
||||||
|
[key in CategoryName]?: {
|
||||||
|
create: boolean;
|
||||||
|
edit: boolean;
|
||||||
|
delete: boolean;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
cities: City[];
|
||||||
|
isAdmin: boolean;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface User {
|
||||||
|
id: string;
|
||||||
|
email: string;
|
||||||
|
displayName: string;
|
||||||
|
permissions: UserPermissions;
|
||||||
|
}
|
21
src/types/image.ts
Normal file
21
src/types/image.ts
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
export interface ImageResolution {
|
||||||
|
id: string;
|
||||||
|
width: number;
|
||||||
|
height: number;
|
||||||
|
label: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface UploadedImage {
|
||||||
|
id: string;
|
||||||
|
url: string;
|
||||||
|
width: number;
|
||||||
|
height: number;
|
||||||
|
size: number;
|
||||||
|
format: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface ImageUploadProgress {
|
||||||
|
progress: number;
|
||||||
|
status: 'uploading' | 'processing' | 'complete' | 'error';
|
||||||
|
error?: string;
|
||||||
|
}
|
39
src/types/index.ts
Normal file
39
src/types/index.ts
Normal file
@ -0,0 +1,39 @@
|
|||||||
|
export interface Article {
|
||||||
|
id: string;
|
||||||
|
title: string;
|
||||||
|
excerpt: string;
|
||||||
|
content: string;
|
||||||
|
category: Category;
|
||||||
|
categoryId: number;
|
||||||
|
city: City;
|
||||||
|
author: Author;
|
||||||
|
coverImage: string;
|
||||||
|
gallery?: GalleryImage[];
|
||||||
|
publishedAt: string;
|
||||||
|
readTime: number;
|
||||||
|
likes: number;
|
||||||
|
dislikes: number;
|
||||||
|
userReaction?: 'like' | 'dislike' | null;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface GalleryImage {
|
||||||
|
id: string;
|
||||||
|
url: string;
|
||||||
|
caption: string;
|
||||||
|
alt: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface Author {
|
||||||
|
id: string;
|
||||||
|
name: string;
|
||||||
|
avatar: string;
|
||||||
|
bio: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface Category {
|
||||||
|
id: number;
|
||||||
|
name: CategoryName;
|
||||||
|
}
|
||||||
|
|
||||||
|
export type CategoryName = 'Film' | 'Theater' | 'Music' | 'Sports' | 'Art' | 'Legends' | 'Anniversaries' | 'Memory';
|
||||||
|
export type City = 'New York' | 'London';
|
16
src/utils/permissions.ts
Normal file
16
src/utils/permissions.ts
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
import { Category, City } from '../types';
|
||||||
|
import { User } from '../types/auth';
|
||||||
|
|
||||||
|
export const checkPermission = (
|
||||||
|
user: User,
|
||||||
|
category: Category,
|
||||||
|
action: 'create' | 'edit' | 'delete'
|
||||||
|
): boolean => {
|
||||||
|
if (user.permissions.isAdmin) return true;
|
||||||
|
return !!user.permissions.categories[category.name]?.[action];
|
||||||
|
};
|
||||||
|
|
||||||
|
export const checkCityAccess = (user: User, city: City): boolean => {
|
||||||
|
if (user.permissions.isAdmin) return true;
|
||||||
|
return user.permissions.cities.includes(city);
|
||||||
|
};
|
14
tsconfig.json
Normal file
14
tsconfig.json
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
{
|
||||||
|
"compilerOptions": {
|
||||||
|
"target": "ES2020", // Уровень компиляции JavaScript
|
||||||
|
"module": "CommonJS", // Для совместимости с Node.js
|
||||||
|
"outDir": "./dist", // Папка для скомпилированных файлов
|
||||||
|
"rootDir": "./src", // Исходный код
|
||||||
|
"strict": true, // Включение строгой проверки типов
|
||||||
|
"esModuleInterop": true, // Для совместимости с модулями ES
|
||||||
|
"forceConsistentCasingInFileNames": true,
|
||||||
|
"skipLibCheck": true // Ускоряет компиляцию
|
||||||
|
},
|
||||||
|
"include": ["src/**/*"], // Файлы, которые обрабатывает TypeScript
|
||||||
|
"exclude": ["node_modules"] // Исключение для node_modules
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user