lab7: топология RabbitMQ у оператора (import_definitions), relay — только publish; диагностика ротации, логи приложений в доказательствах

This commit is contained in:
2026-11-12 16:51:45 +03:00
parent 1c453e9f0a
commit 627b7ee42f
6 changed files with 46 additions and 10 deletions
+5 -4
View File
@@ -191,10 +191,11 @@ def rabbit_users(worker_cn='worker-g1', relay_cn='relay-g1', drop=()):
names = {u['user'] for u in json.loads(users or '[]')}
if 'guest' in names:
ctl('delete_user', 'guest')
perms = {relay_cn: (r'^(attachments|attachments\.dlx|attachment\.process|attachment\.dead)$',
r'^(attachments|attachments\.dlx|attachment\.process|attachment\.dead)$',
r'^(attachments|attachments\.dlx)$'),
worker_cn: ('^$', '^$', r'^attachment\.process$')}
# Топологию (exchange, quorum-очереди, DLX, bindings) создаёт оператор импортом
# infra/rabbitmq/definitions.json; сервисам configure не нужен вовсе.
ctl('import_definitions', '/etc/rabbitmq/lab7-definitions.json')
perms = {relay_cn: ('^$', r'^attachments$', '^$'), # только publish в exchange attachments
worker_cn: ('^$', '^$', r'^attachment\.process$')} # только чтение своей очереди
for u, (conf, write, read) in perms.items():
if u not in names:
# Пароль случайный и сразу удаляется: вход только SASL EXTERNAL (сертификат).