feat(syslog): devices through Swarm's ingress told apart by name; the send-to address is a setting (#6096)
Through ingress every device arrives from Docker's own address, so a source there is keyed by the hostname its lines carry (new column sender, unique with address). The set-up help no longer guesses the address from the web hostname: it shows the plugin's send_to setting, covers ingress and host mode, ASUSTOR ADM, and both syslog formats. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
"""Syslog: devices that reach Steward through Docker's one address, told apart
|
||||
by the name in their lines
|
||||
|
||||
Revision ID: syslog_003_sender
|
||||
Revises: syslog_002_patterns
|
||||
Create Date: 2026-10-19
|
||||
"""
|
||||
from typing import Sequence, Union
|
||||
|
||||
import sqlalchemy as sa
|
||||
from alembic import op
|
||||
|
||||
revision: str = "syslog_003_sender"
|
||||
down_revision: Union[str, None] = "syslog_002_patterns"
|
||||
branch_labels: Union[str, Sequence[str], None] = None
|
||||
depends_on: Union[str, Sequence[str], None] = None
|
||||
|
||||
|
||||
def upgrade() -> None:
|
||||
op.add_column("syslog_sources",
|
||||
sa.Column("sender", sa.String(255), nullable=False, server_default=""))
|
||||
op.drop_constraint("syslog_sources_address_key", "syslog_sources", type_="unique")
|
||||
op.create_unique_constraint("uq_syslog_sources_address_sender", "syslog_sources", ["address", "sender"])
|
||||
|
||||
|
||||
def downgrade() -> None:
|
||||
op.drop_constraint("uq_syslog_sources_address_sender", "syslog_sources", type_="unique")
|
||||
op.execute("DELETE FROM syslog_sources WHERE sender <> ''")
|
||||
op.create_unique_constraint("syslog_sources_address_key", "syslog_sources", ["address"])
|
||||
op.drop_column("syslog_sources", "sender")
|
||||
Reference in New Issue
Block a user