Skip to content

Commit

Permalink
feat(ident): Enable ident in IRC bridge (#352)
Browse files Browse the repository at this point in the history
  • Loading branch information
merkata authored May 15, 2024
1 parent c74701b commit e43f56e
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 1 deletion.
9 changes: 8 additions & 1 deletion config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,14 @@ options:
default: false
description: |
Configures whether to enable IRC bridging for Matrix.
Reference: https://github.com/matrix-org/matrix-appservice-irc
Reference: https://github.com/matrix-org/matrix-appservice-irc
enable_irc_ident:
type: boolean
default: false
description: |
Configures whether to enable IRC ident server.
Reference: |
https://github.com/matrix-org/matrix-appservice-irc/blob/develop/config.sample.yaml#L437
enable_password_config:
type: boolean
default: true
Expand Down
2 changes: 2 additions & 0 deletions src/charm_state.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ class SynapseConfig(BaseModel): # pylint: disable=too-few-public-methods
allow_public_rooms_over_federation: allow_public_rooms_over_federation config.
enable_email_notifs: enable_email_notifs config.
enable_irc_bridge: creates a registration file in Synapse and starts an irc bridge app.
enable_irc_ident: starts an ident server for the IRC bridge.
irc_bridge_admins: a comma separated list of user IDs who are admins of the IRC bridge.
enable_mjolnir: enable_mjolnir config.
enable_password_config: enable_password_config config.
Expand All @@ -171,6 +172,7 @@ class SynapseConfig(BaseModel): # pylint: disable=too-few-public-methods
allow_public_rooms_over_federation: bool = False
enable_email_notifs: bool = False
enable_irc_bridge: bool = False
enable_irc_ident: bool = False
irc_bridge_admins: str | None = Field(None)
enable_mjolnir: bool = False
enable_password_config: bool = True
Expand Down
1 change: 1 addition & 0 deletions src/irc_bridge.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ def enable_irc_bridge(charm_state: CharmState, container: ops.model.Container) -
The required steps to enable the IRC bridge are:
- Create the IRC bridge configuration file.
- Generate a PEM file for the IRC bridge.
- Add the IRC bridge application in the homeserver config.
Args:
charm_state: Instance of CharmState.
Expand Down
Binary file added src/synapse/.workload.py.swp
Binary file not shown.
2 changes: 2 additions & 0 deletions src/synapse/workload.py
Original file line number Diff line number Diff line change
Expand Up @@ -520,6 +520,8 @@ def _get_irc_bridge_config(charm_state: CharmState, db_connect_string: str) -> t
config["ircService"]["permissions"] = {}
for admin in charm_state.synapse_config.irc_bridge_admins:
config["ircService"]["permissions"][admin] = "admin"
if charm_state.synapse_config.enable_irc_ident:
config["ircService"]["ident"]["enabled"] = charm_state.synapse_config.enable_irc_ident
return config


Expand Down

0 comments on commit e43f56e

Please sign in to comment.