This commit is contained in:
Getlles
2026-11-16 17:38:53 +03:00
parent 3571422836
commit d475bf29ed
29 changed files with 620 additions and 228 deletions
-1
View File
@@ -1 +0,0 @@
PASS: anonymous GET -> 403
-7
View File
@@ -1,7 +0,0 @@
NAME IMAGE COMMAND SERVICE CREATED STATUS PORTS
mtusi2026lab4-api-1-1 mtusi2026lab4-api-1 "uvicorn app:app --h…" api-1 15 minutes ago Up 12 minutes (healthy) 8080/tcp
mtusi2026lab4-api-2-1 mtusi2026lab4-api-2 "uvicorn app:app --h…" api-2 15 minutes ago Up 23 seconds (healthy) 8080/tcp
mtusi2026lab4-nginx-1 nginx:1.25.4-alpine "/docker-entrypoint.…" nginx 15 minutes ago Up 12 minutes (healthy) 0.0.0.0:8080->8080/tcp, [::]:8080->8080/tcp
mtusi2026lab4-postgres-1 postgres:15.5-alpine3.19 "docker-entrypoint.s…" postgres 15 minutes ago Up 12 minutes (healthy) 5432/tcp
mtusi2026lab4-redis-1 redis:7.2.4-alpine "docker-entrypoint.s…" redis 15 minutes ago Up 12 minutes (healthy) 6379/tcp
mtusi2026lab4-s3-1 chrislusf/seaweedfs:latest "/entrypoint.sh mini…" s3 15 minutes ago Up 12 minutes (healthy) 7333/tcp, 8080/tcp, 8333/tcp, 8888/tcp, 9333/tcp, 18080/tcp, 18888/tcp, 19333/tcp
+6
View File
@@ -0,0 +1,6 @@
{
"id": "fdeb71d4-ee4f-47a6-8968-ffc7740e5242",
"username": "demo_75866",
"display_name": "Demo User",
"created_at": "2026-11-16T13:43:38.059472Z"
}
+11
View File
@@ -0,0 +1,11 @@
{
"token": "grSsHp1gJpFLckF14UT44obEonSGQRvP878JhLyCaNzM6PGBH1LwrdgZIFF8Zu8U",
"token_type": "Bearer",
"expires_at": "2026-11-16T14:43:38.850596Z",
"user": {
"id": "fdeb71d4-ee4f-47a6-8968-ffc7740e5242",
"username": "demo_75866",
"display_name": "Demo User",
"created_at": "2026-11-16T13:43:38.059472Z"
}
}
+8
View File
@@ -0,0 +1,8 @@
{
"id": "5db90ff5-9604-4853-b002-db4144868bcb",
"title": "Demo chat",
"member_ids": [
"fdeb71d4-ee4f-47a6-8968-ffc7740e5242"
],
"created_at": "2026-11-16T13:43:39.240968Z"
}
+10
View File
@@ -0,0 +1,10 @@
NAME IMAGE COMMAND SERVICE CREATED STATUS PORTS
mtusi2026lab5-api-1-1 mtusi2026lab5-api-1 "uvicorn app:app --hтАж" api-1 30 minutes ago Up 6 minutes (healthy) 8080/tcp
mtusi2026lab5-api-2-1 mtusi2026lab5-api-2 "uvicorn app:app --hтАж" api-2 30 minutes ago Up 6 minutes (healthy) 8080/tcp
mtusi2026lab5-migrate-1 postgres:15.5-alpine3.19 "docker-entrypoint.sтАж" migrate 30 minutes ago Exited (0) 5 minutes ago
mtusi2026lab5-nginx-1 nginx:1.25.4-alpine "/docker-entrypoint.тАж" nginx 30 minutes ago Up 25 minutes (healthy) 0.0.0.0:8080->8080/tcp, [::]:8080->8080/tcp
mtusi2026lab5-postgres-1 postgres:15.5-alpine3.19 "docker-entrypoint.sтАж" postgres 30 minutes ago Up 30 minutes (healthy) 5432/tcp
mtusi2026lab5-redis-1 redis:7.2.4-alpine "docker-entrypoint.sтАж" redis 30 minutes ago Up 4 minutes (healthy) 6379/tcp
mtusi2026lab5-s3-1 chrislusf/seaweedfs:latest "/entrypoint.sh servтАж" s3 30 minutes ago Up 30 minutes (healthy) 7333/tcp, 8080/tcp, 8333/tcp, 8888/tcp, 9333/tcp, 18080/tcp, 18888/tcp, 19333/tcp
mtusi2026lab5-s3-init-1 python:3.11.7-slim-bookworm "sh -c 'pip install тАж" s3-init 30 minutes ago Exited (0) 5 minutes ago
mtusi2026lab5-worker-1 mtusi2026lab5-worker "python worker.py" worker 30 minutes ago Exited (0) Less than a second ago
+1
View File
@@ -0,0 +1 @@
{"id":"9becbd32-e413-417a-8762-79bcc195e296","chat_id":"5db90ff5-9604-4853-b002-db4144868bcb","owner_id":"fdeb71d4-ee4f-47a6-8968-ffc7740e5242","filename":"sample.png","content_type":"image/png","size_bytes":111817,"sha256":"99ea7533c441f79cd630d15ce4d58d1ec4e06f6f0efb3b77a5c088305cd1bd75","status":"queued","variants":[],"error_code":null,"created_at":"2026-11-16T13:43:41.734766Z","updated_at":"2026-11-16T13:43:41.734766Z"}
+10
View File
@@ -0,0 +1,10 @@
{
"id": "74dc2e91-a901-4067-8993-da9d2cc4ca55",
"chat_id": "5db90ff5-9604-4853-b002-db4144868bcb",
"sender_id": "fdeb71d4-ee4f-47a6-8968-ffc7740e5242",
"text": "",
"created_at": "2026-11-16T13:43:42.100558Z",
"attachment_ids": [
"9becbd32-e413-417a-8762-79bcc195e296"
]
}
+7
View File
@@ -0,0 +1,7 @@
NAME IMAGE COMMAND SERVICE CREATED STATUS PORTS
mtusi2026lab5-api-1-1 mtusi2026lab5-api-1 "uvicorn app:app --hтАж" api-1 30 minutes ago Up Less than a second (health: starting) 8080/tcp
mtusi2026lab5-api-2-1 mtusi2026lab5-api-2 "uvicorn app:app --hтАж" api-2 30 minutes ago Up Less than a second (health: starting) 8080/tcp
mtusi2026lab5-nginx-1 nginx:1.25.4-alpine "/docker-entrypoint.тАж" nginx 30 minutes ago Up 25 minutes (healthy) 0.0.0.0:8080->8080/tcp, [::]:8080->8080/tcp
mtusi2026lab5-postgres-1 postgres:15.5-alpine3.19 "docker-entrypoint.sтАж" postgres 30 minutes ago Up 30 minutes (healthy) 5432/tcp
mtusi2026lab5-redis-1 redis:7.2.4-alpine "docker-entrypoint.sтАж" redis 30 minutes ago Up 4 minutes (healthy) 6379/tcp
mtusi2026lab5-s3-1 chrislusf/seaweedfs:latest "/entrypoint.sh servтАж" s3 30 minutes ago Up 30 minutes (healthy) 7333/tcp, 8080/tcp, 8333/tcp, 8888/tcp, 9333/tcp, 18080/tcp, 18888/tcp, 19333/tcp
+10
View File
@@ -0,0 +1,10 @@
NAME IMAGE COMMAND SERVICE CREATED STATUS PORTS
mtusi2026lab5-api-1-1 mtusi2026lab5-api-1 "uvicorn app:app --hтАж" api-1 30 minutes ago Up 10 seconds (healthy) 8080/tcp
mtusi2026lab5-api-2-1 mtusi2026lab5-api-2 "uvicorn app:app --hтАж" api-2 30 minutes ago Up 9 seconds (healthy) 8080/tcp
mtusi2026lab5-migrate-1 postgres:15.5-alpine3.19 "docker-entrypoint.sтАж" migrate 30 minutes ago Exited (0) 7 seconds ago
mtusi2026lab5-nginx-1 nginx:1.25.4-alpine "/docker-entrypoint.тАж" nginx 30 minutes ago Up 26 minutes (healthy) 0.0.0.0:8080->8080/tcp, [::]:8080->8080/tcp
mtusi2026lab5-postgres-1 postgres:15.5-alpine3.19 "docker-entrypoint.sтАж" postgres 30 minutes ago Up 30 minutes (healthy) 5432/tcp
mtusi2026lab5-redis-1 redis:7.2.4-alpine "docker-entrypoint.sтАж" redis 30 minutes ago Up 4 minutes (healthy) 6379/tcp
mtusi2026lab5-s3-1 chrislusf/seaweedfs:latest "/entrypoint.sh servтАж" s3 30 minutes ago Up 30 minutes (healthy) 7333/tcp, 8080/tcp, 8333/tcp, 8888/tcp, 9333/tcp, 18080/tcp, 18888/tcp, 19333/tcp
mtusi2026lab5-s3-init-1 python:3.11.7-slim-bookworm "sh -c 'pip install тАж" s3-init 30 minutes ago Exited (0) Less than a second ago
mtusi2026lab5-worker-1 mtusi2026lab5-worker "python worker.py" worker 30 minutes ago Up Less than a second (health: starting) 8080/tcp
+23
View File
@@ -0,0 +1,23 @@
{
"id": "9becbd32-e413-417a-8762-79bcc195e296",
"chat_id": "5db90ff5-9604-4853-b002-db4144868bcb",
"owner_id": "fdeb71d4-ee4f-47a6-8968-ffc7740e5242",
"filename": "sample.png",
"content_type": "image/png",
"size_bytes": 111817,
"sha256": "99ea7533c441f79cd630d15ce4d58d1ec4e06f6f0efb3b77a5c088305cd1bd75",
"status": "ready",
"variants": [
{
"name": "thumbnail",
"width": 256,
"height": 160,
"sha256": "7bc40bf315c8e18e907889b23514d978be213a44223d64b737290188ee808594",
"size_bytes": 4679,
"content_type": "image/jpeg"
}
],
"error_code": null,
"created_at": "2026-11-16T13:43:41.734766Z",
"updated_at": "2026-11-16T13:43:55.375481Z"
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

@@ -0,0 +1,23 @@
{
"id": "9becbd32-e413-417a-8762-79bcc195e296",
"chat_id": "5db90ff5-9604-4853-b002-db4144868bcb",
"owner_id": "fdeb71d4-ee4f-47a6-8968-ffc7740e5242",
"filename": "sample.png",
"content_type": "image/png",
"size_bytes": 111817,
"sha256": "99ea7533c441f79cd630d15ce4d58d1ec4e06f6f0efb3b77a5c088305cd1bd75",
"status": "ready",
"variants": [
{
"name": "thumbnail",
"width": 256,
"height": 160,
"sha256": "7bc40bf315c8e18e907889b23514d978be213a44223d64b737290188ee808594",
"size_bytes": 4679,
"content_type": "image/jpeg"
}
],
"error_code": null,
"created_at": "2026-11-16T13:43:41.734766Z",
"updated_at": "2026-11-16T13:43:55.375481Z"
}
-4
View File
@@ -1,4 +0,0 @@
python3 tests/resilience.py --mode failover --action-script "scripts/stop-one.sh" --base-url "http://localhost:8080"
Executing explicit failover hook; hook output suppressed to avoid leaking secrets.
{"observed_instances_before": 2, "successful_writes": 82, "failed_attempts": 2, "first_recovery_seconds": 1.312}
PASS: failover preserved confirmed data and existing session. Hook scope needs operator evidence.
-17
View File
@@ -1,17 +0,0 @@
test_corrupted_image_signature (__main__.TestMessengerLevel4Complete.test_corrupted_image_signature)
Ïðîâåðêà 415: áèòàÿ ñòðóêòóðà / íåâåðíûå ðàçìåðû PNG. ... ok
test_cross_chat_attachment_isolation (__main__.TestMessengerLevel4Complete.test_cross_chat_attachment_isolation)
Ïðîâåðêà 404: ïîïûòêà ïðèêðåïèòü âëîæåíèå èç ÷óæîãî ÷àòà. ... ok
test_invalid_filename_characters (__main__.TestMessengerLevel4Complete.test_invalid_filename_characters)
Ïðîâåðêà 400: íåäîïóñòèìûå ñèìâîëû (path traversal) â èìåíè ôàéëà. ... ok
test_nonexistent_attachment_id (__main__.TestMessengerLevel4Complete.test_nonexistent_attachment_id)
Ïðîâåðêà 404: ïåðåäà÷à íåñóùåñòâóþùåãî ID âëîæåíèÿ ïðè îòïðàâêå ñîîáùåíèÿ. ... ok
test_payload_too_large (__main__.TestMessengerLevel4Complete.test_payload_too_large)
Ïðîâåðêà 413: ôàéë ðàçìåðîì áîëüøå 10 MiB. ... ok
test_unsupported_media_type (__main__.TestMessengerLevel4Complete.test_unsupported_media_type)
Ïðîâåðêà 415: ïåðåäà÷à òåêñòîâîãî ôàéëà ïîä âèäîì êàðòèíêè. ... ok
----------------------------------------------------------------------
Ran 6 tests in 19.521s
OK
-3
View File
@@ -1,3 +0,0 @@
python3 tests/resilience.py --mode persistence --action-script "scripts/restart.sh" --base-url "http://localhost:8080"
Executing explicit persistence hook; hook output suppressed to avoid leaking secrets.
PASS: persistence preserved confirmed data and existing session. Hook scope needs operator evidence.
-4
View File
@@ -1,4 +0,0 @@
Container mtusi2026lab4-api-1-run-9e5b0d92d11b Creating
Container mtusi2026lab4-api-1-run-9e5b0d92d11b Created
Starting reconciliation (dry_run=True)...
Reconciliation completed successfully.
-2
View File
@@ -1,2 +0,0 @@
python3 tests/smoke.py --base-url "http://localhost:8080"
PASS: lab4 public API scenario; infrastructure and grading evidence remain separate.
-7
View File
@@ -1,7 +0,0 @@
CONTAINER ID NAME CPU % MEM USAGE / LIMIT MEM % NET I/O BLOCK I/O PIDS
de2d9b4cdf10 mtusi2026lab4-nginx-1 2.71% 2.355MiB / 128MiB 1.84% 389kB / 408kB 0B / 12.3kB 2
bd85245e25be mtusi2026lab4-api-1-1 14.75% 74.22MiB / 256MiB 28.99% 518kB / 647kB 0B / 53.2kB 2
dd34824ed0c5 mtusi2026lab4-api-2-1 13.03% 74.76MiB / 256MiB 29.20% 750kB / 879kB 0B / 53.2kB 2
650e2ec7ac6a mtusi2026lab4-s3-1 1.02% 68.62MiB / 512MiB 13.40% 559kB / 248kB 0B / 1.09MB 8
1938313cd5da mtusi2026lab4-redis-1 0.24% 3.16MiB / 256MiB 1.23% 99.6kB / 46.7kB 24.6kB / 12.3kB 5
9348c37fb0f0 mtusi2026lab4-postgres-1 0.01% 34.39MiB / 512MiB 6.72% 679kB / 765kB 0B / 55.1MB 6
-40
View File
@@ -1,40 +0,0 @@
mtusi2026lab4-api-1-1 63.46MiB / 256MiB 0.20%
mtusi2026lab4-api-2-1 0B / 0B 0.00%
mtusi2026lab4-api-1-1 63.46MiB / 256MiB 0.20%
mtusi2026lab4-api-2-1 0B / 0B 0.00%
mtusi2026lab4-api-1-1 63.49MiB / 256MiB 0.39%
mtusi2026lab4-api-2-1 0B / 0B 0.00%
mtusi2026lab4-api-1-1 63.49MiB / 256MiB 0.24%
mtusi2026lab4-api-2-1 0B / 0B 0.00%
mtusi2026lab4-api-1-1 72.76MiB / 256MiB 7.76%
mtusi2026lab4-api-2-1 0B / 0B 0.00%
mtusi2026lab4-api-1-1 63.53MiB / 256MiB 0.22%
mtusi2026lab4-api-2-1 0B / 0B 0.00%
mtusi2026lab4-api-1-1 63.53MiB / 256MiB 0.20%
mtusi2026lab4-api-2-1 0B / 0B 0.00%
mtusi2026lab4-api-1-1 63.61MiB / 256MiB 22.90%
mtusi2026lab4-api-2-1 0B / 0B 0.00%
mtusi2026lab4-api-1-1 63.56MiB / 256MiB 0.20%
mtusi2026lab4-api-2-1 0B / 0B 0.00%
mtusi2026lab4-api-1-1 63.57MiB / 256MiB 50.53%
mtusi2026lab4-api-2-1 0B / 0B 0.00%
mtusi2026lab4-api-1-1 63.65MiB / 256MiB 14.81%
mtusi2026lab4-api-2-1 0B / 0B 0.00%
mtusi2026lab4-api-1-1 63.68MiB / 256MiB 0.22%
mtusi2026lab4-api-2-1 0B / 0B 0.00%
mtusi2026lab4-api-1-1 63.68MiB / 256MiB 0.30%
mtusi2026lab4-api-2-1 0B / 0B 0.00%
mtusi2026lab4-api-1-1 63.71MiB / 256MiB 0.21%
mtusi2026lab4-api-2-1 0B / 0B 0.00%
mtusi2026lab4-api-1-1 63.71MiB / 256MiB 0.20%
mtusi2026lab4-api-2-1 0B / 0B 0.00%
mtusi2026lab4-api-1-1 73.85MiB / 256MiB 14.64%
mtusi2026lab4-api-2-1 0B / 0B 0.00%
mtusi2026lab4-api-1-1 63.75MiB / 256MiB 0.22%
mtusi2026lab4-api-2-1 0B / 0B 0.00%
mtusi2026lab4-api-1-1 63.75MiB / 256MiB 0.24%
mtusi2026lab4-api-2-1 0B / 0B 0.00%
mtusi2026lab4-api-1-1 63.8MiB / 256MiB 27.08%
mtusi2026lab4-api-2-1 0B / 0B 0.00%
mtusi2026lab4-api-1-1 63.78MiB / 256MiB 0.24%
mtusi2026lab4-api-2-1 0B / 0B 0.00%