This repository has been archived by the owner on Apr 26, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Allow tracking puppeted users for MAU #11561
Merged
Merged
Changes from 5 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
9e90cc1
Allow tracking puppeted users for MAU
jaywink 6f1a4e3
Apply suggestions from code review
jaywink fd5eedd
Merge branch 'develop' into jaywink/allow-tracking-puppets-mau
jaywink 9e6a74b
Use `track_puppeted_user_ips` instead
jaywink c8c3236
Remove whitespace causing linting issue
jaywink 0950d56
Add note about MAU tracking for puppeted users
jaywink File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Add `track_puppeted_user_ips` config flag to track puppeted user IP addresses. This also includes them in monthly active user counts. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,6 +29,7 @@ class ApiConfig(Config): | |
def read_config(self, config: JsonDict, **kwargs): | ||
validate_config(_MAIN_SCHEMA, config, ()) | ||
self.room_prejoin_state = list(self._get_prejoin_state_types(config)) | ||
self.track_puppeted_user_ips = config.get("track_puppeted_user_ips", False) | ||
|
||
def generate_config_section(cls, **kwargs) -> str: | ||
formatted_default_state_types = "\n".join( | ||
|
@@ -59,6 +60,11 @@ def generate_config_section(cls, **kwargs) -> str: | |
# | ||
#additional_event_types: | ||
# - org.example.custom.event.type | ||
|
||
# If enabled, puppeted user IP's can also be tracked. By default when | ||
# puppeting another user, the user who has created the access token | ||
# for puppeting is tracked. If this is enabled, both requests are tracked. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I thought I added that /o\ I was going to at least, I swear 😅 Added now! |
||
#track_puppeted_user_ips: false | ||
""" % { | ||
"formatted_default_state_types": formatted_default_state_types | ||
} | ||
|
@@ -136,5 +142,8 @@ def _get_prejoin_state_types(self, config: JsonDict) -> Iterable[str]: | |
"properties": { | ||
"room_prejoin_state": _ROOM_PREJOIN_STATE_CONFIG_SCHEMA, | ||
"room_invite_state_types": _ROOM_INVITE_STATE_TYPES_SCHEMA, | ||
"track_puppeted_user_ips": { | ||
"type": "boolean", | ||
}, | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#
linetrack_puppeted_user_ips: false
?)More details at https://matrix-org.github.io/synapse/develop/code_style.html#configuration-file-format