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
Add script for getting info about recently registered users #10290
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
bcafe77
Add script for getting info about recently registered users
erikjohnston 2602bd3
Newsfile
erikjohnston b0cb40f
Review comments. Update format. Add option to only print users
erikjohnston 5156197
Add manpage
erikjohnston 964fbd0
Add synapse_review_recent_signups to debian links
erikjohnston 2f88646
Add debian changelog
erikjohnston 992423b
Fix `--exclude-emails`
erikjohnston 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 script to print information about recently registered users. |
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 |
---|---|---|
@@ -1,3 +1,9 @@ | ||
matrix-synapse-py3 (1.37.1ubuntu1) UNRELEASED; urgency=medium | ||
|
||
* Add synapse_review_recent_signups script | ||
|
||
-- Erik Johnston <[email protected]> Thu, 01 Jul 2021 15:55:03 +0100 | ||
|
||
matrix-synapse-py3 (1.37.1) stable; urgency=medium | ||
|
||
* New synapse release 1.37.1. | ||
|
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 |
---|---|---|
@@ -1,90 +1,58 @@ | ||
.\" generated with Ronn/v0.7.3 | ||
.\" http://github.com/rtomayko/ronn/tree/0.7.3 | ||
. | ||
.TH "HASH_PASSWORD" "1" "February 2017" "" "" | ||
. | ||
.\" generated with Ronn-NG/v0.8.0 | ||
.\" http://github.com/apjanke/ronn-ng/tree/0.8.0 | ||
.TH "HASH_PASSWORD" "1" "July 2021" "" "" | ||
.SH "NAME" | ||
\fBhash_password\fR \- Calculate the hash of a new password, so that passwords can be reset | ||
. | ||
.SH "SYNOPSIS" | ||
\fBhash_password\fR [\fB\-p\fR|\fB\-\-password\fR [password]] [\fB\-c\fR|\fB\-\-config\fR \fIfile\fR] | ||
. | ||
.SH "DESCRIPTION" | ||
\fBhash_password\fR calculates the hash of a supplied password using bcrypt\. | ||
. | ||
.P | ||
\fBhash_password\fR takes a password as an parameter either on the command line or the \fBSTDIN\fR if not supplied\. | ||
. | ||
.P | ||
It accepts an YAML file which can be used to specify parameters like the number of rounds for bcrypt and password_config section having the pepper value used for the hashing\. By default \fBbcrypt_rounds\fR is set to \fB10\fR\. | ||
. | ||
.P | ||
The hashed password is written on the \fBSTDOUT\fR\. | ||
. | ||
.SH "FILES" | ||
A sample YAML file accepted by \fBhash_password\fR is described below: | ||
. | ||
.P | ||
bcrypt_rounds: 17 password_config: pepper: "random hashing pepper" | ||
. | ||
.SH "OPTIONS" | ||
. | ||
.TP | ||
\fB\-p\fR, \fB\-\-password\fR | ||
Read the password form the command line if [password] is supplied\. If not, prompt the user and read the password form the \fBSTDIN\fR\. It is not recommended to type the password on the command line directly\. Use the STDIN instead\. | ||
. | ||
.TP | ||
\fB\-c\fR, \fB\-\-config\fR | ||
Read the supplied YAML \fIfile\fR containing the options \fBbcrypt_rounds\fR and the \fBpassword_config\fR section containing the \fBpepper\fR value\. | ||
. | ||
.SH "EXAMPLES" | ||
Hash from the command line: | ||
. | ||
.IP "" 4 | ||
. | ||
.nf | ||
|
||
$ hash_password \-p "p@ssw0rd" | ||
$2b$12$VJNqWQYfsWTEwcELfoSi4Oa8eA17movHqqi8\.X8fWFpum7SxZ9MFe | ||
. | ||
.fi | ||
. | ||
.IP "" 0 | ||
. | ||
.P | ||
Hash from the STDIN: | ||
. | ||
.IP "" 4 | ||
. | ||
.nf | ||
|
||
$ hash_password | ||
Password: | ||
Confirm password: | ||
$2b$12$AszlvfmJl2esnyhmn8m/kuR2tdXgROWtWxnX\.rcuAbM8ErLoUhybG | ||
. | ||
.fi | ||
. | ||
.IP "" 0 | ||
. | ||
.P | ||
Using a config file: | ||
. | ||
.IP "" 4 | ||
. | ||
.nf | ||
|
||
$ hash_password \-c config\.yml | ||
Password: | ||
Confirm password: | ||
$2b$12$CwI\.wBNr\.w3kmiUlV3T5s\.GT2wH7uebDCovDrCOh18dFedlANK99O | ||
. | ||
.fi | ||
. | ||
.IP "" 0 | ||
. | ||
.SH "COPYRIGHT" | ||
This man page was written by Rahul De <\fIrahulde@swecha\.net\fR> for Debian GNU/Linux distribution\. | ||
. | ||
This man page was written by Rahul De <\fI\%mailto:rahulde@swecha\.net\fR> for Debian GNU/Linux distribution\. | ||
.SH "SEE ALSO" | ||
synctl(1), synapse_port_db(1), register_new_matrix_user(1) | ||
synctl(1), synapse_port_db(1), register_new_matrix_user(1), synapse_review_recent_signups(1) |
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 |
---|---|---|
@@ -1,4 +1,5 @@ | ||
debian/hash_password.1 | ||
debian/register_new_matrix_user.1 | ||
debian/synapse_port_db.1 | ||
debian/synapse_review_recent_signups.1 | ||
debian/synctl.1 |
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 |
---|---|---|
@@ -1,4 +1,5 @@ | ||
opt/venvs/matrix-synapse/bin/hash_password usr/bin/hash_password | ||
opt/venvs/matrix-synapse/bin/register_new_matrix_user usr/bin/register_new_matrix_user | ||
opt/venvs/matrix-synapse/bin/synapse_port_db usr/bin/synapse_port_db | ||
opt/venvs/matrix-synapse/bin/synapse_review_recent_signups usr/bin/synapse_review_recent_signups | ||
opt/venvs/matrix-synapse/bin/synctl usr/bin/synctl |
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 |
---|---|---|
@@ -1,72 +1,47 @@ | ||
.\" generated with Ronn/v0.7.3 | ||
.\" http://github.com/rtomayko/ronn/tree/0.7.3 | ||
. | ||
.TH "REGISTER_NEW_MATRIX_USER" "1" "February 2017" "" "" | ||
. | ||
.\" generated with Ronn-NG/v0.8.0 | ||
.\" http://github.com/apjanke/ronn-ng/tree/0.8.0 | ||
.TH "REGISTER_NEW_MATRIX_USER" "1" "July 2021" "" "" | ||
.SH "NAME" | ||
\fBregister_new_matrix_user\fR \- Used to register new users with a given home server when registration has been disabled | ||
. | ||
.SH "SYNOPSIS" | ||
\fBregister_new_matrix_user\fR options\.\.\. | ||
. | ||
\fBregister_new_matrix_user\fR options\|\.\|\.\|\. | ||
.SH "DESCRIPTION" | ||
\fBregister_new_matrix_user\fR registers new users with a given home server when registration has been disabled\. For this to work, the home server must be configured with the \'registration_shared_secret\' option set\. | ||
. | ||
.P | ||
This accepts the user credentials like the username, password, is user an admin or not and registers the user onto the homeserver database\. Also, a YAML file containing the shared secret can be provided\. If not, the shared secret can be provided via the command line\. | ||
. | ||
.P | ||
By default it assumes the home server URL to be \fBhttps://localhost:8448\fR\. This can be changed via the \fBserver_url\fR command line option\. | ||
. | ||
.SH "FILES" | ||
A sample YAML file accepted by \fBregister_new_matrix_user\fR is described below: | ||
. | ||
.IP "" 4 | ||
. | ||
.nf | ||
|
||
registration_shared_secret: "s3cr3t" | ||
. | ||
.fi | ||
. | ||
.IP "" 0 | ||
. | ||
.SH "OPTIONS" | ||
. | ||
.TP | ||
\fB\-u\fR, \fB\-\-user\fR | ||
Local part of the new user\. Will prompt if omitted\. | ||
. | ||
.TP | ||
\fB\-p\fR, \fB\-\-password\fR | ||
New password for user\. Will prompt if omitted\. Supplying the password on the command line is not recommended\. Use the STDIN instead\. | ||
. | ||
.TP | ||
\fB\-a\fR, \fB\-\-admin\fR | ||
Register new user as an admin\. Will prompt if omitted\. | ||
. | ||
.TP | ||
\fB\-c\fR, \fB\-\-config\fR | ||
Path to server config file containing the shared secret\. | ||
. | ||
.TP | ||
\fB\-k\fR, \fB\-\-shared\-secret\fR | ||
Shared secret as defined in server config file\. This is an optional parameter as it can be also supplied via the YAML file\. | ||
. | ||
.TP | ||
\fBserver_url\fR | ||
URL of the home server\. Defaults to \'https://localhost:8448\'\. | ||
. | ||
.SH "EXAMPLES" | ||
. | ||
.nf | ||
|
||
$ register_new_matrix_user \-u user1 \-p p@ssword \-a \-c config\.yaml | ||
. | ||
.fi | ||
. | ||
.SH "COPYRIGHT" | ||
This man page was written by Rahul De <\fIrahulde@swecha\.net\fR> for Debian GNU/Linux distribution\. | ||
. | ||
This man page was written by Rahul De <\fI\%mailto:rahulde@swecha\.net\fR> for Debian GNU/Linux distribution\. | ||
.SH "SEE ALSO" | ||
synctl(1), synapse_port_db(1), hash_password(1) | ||
synctl(1), synapse_port_db(1), hash_password(1), synapse_review_recent_signups(1) |
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 |
---|---|---|
|
@@ -47,7 +47,7 @@ following options. | |
* `args`: | ||
DB API 2.0 compatible arguments to send to the `psycopg2` module. | ||
|
||
* `dbname` - the database name | ||
* `dbname` - the database name | ||
|
||
* `user` - user name used to authenticate | ||
|
||
|
@@ -58,7 +58,7 @@ following options. | |
|
||
* `port` - connection port number (defaults to 5432 if not | ||
provided) | ||
|
||
|
||
* `synchronous_commit`: | ||
Optional. Default is True. If the value is `False`, enable | ||
|
@@ -76,12 +76,12 @@ Following example illustrates the configuration file format. | |
password: ORohmi9Eet=ohphi | ||
host: localhost | ||
synchronous_commit: false | ||
|
||
## COPYRIGHT | ||
|
||
This man page was written by Sunil Mohan Adapa <<[email protected]>> for | ||
Debian GNU/Linux distribution. | ||
|
||
## SEE ALSO | ||
|
||
synctl(1), hash_password(1), register_new_matrix_user(1) | ||
synctl(1), hash_password(1), register_new_matrix_user(1), synapse_review_recent_signups(1) |
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,26 @@ | ||
.\" generated with Ronn-NG/v0.8.0 | ||
.\" http://github.com/apjanke/ronn-ng/tree/0.8.0 | ||
.TH "SYNAPSE_REVIEW_RECENT_SIGNUPS" "1" "July 2021" "" "" | ||
.SH "NAME" | ||
\fBsynapse_review_recent_signups\fR \- Print users that have recently registered on Synapse | ||
.SH "SYNOPSIS" | ||
\fBsynapse_review_recent_signups\fR \fB\-c\fR|\fB\-\-config\fR \fIfile\fR [\fB\-s\fR|\fB\-\-since\fR \fIperiod\fR] [\fB\-e\fR|\fB\-\-exclude\-emails\fR] [\fB\-u\fR|\fB\-\-only\-users\fR] | ||
.SH "DESCRIPTION" | ||
\fBsynapse_review_recent_signups\fR prints out recently registered users on a Synapse server, as well as some basic information about the user\. | ||
.P | ||
\fBsynapse_review_recent_signups\fR must be supplied with the config of the Synapse server, so that it can fetch the database config and connect to the database\. | ||
.SH "OPTIONS" | ||
.TP | ||
\fB\-c\fR, \fB\-\-config\fR | ||
The config file(s) used by the Synapse server\. | ||
.TP | ||
\fB\-s\fR, \fB\-\-since\fR | ||
How far back to search for newly registered users\. Defaults to 7d, i\.e\. up to seven days in the past\. Valid units are \'s\', \'m\', \'h\', \'d\', \'w\', or \'y\'\. | ||
.TP | ||
\fB\-e\fR, \fB\-\-exclude\-emails\fR | ||
Do not print out users that have validated emails associated with their account\. | ||
.TP | ||
\fB\-u\fR, \fB\-\-only\-users\fR | ||
Only print out the user IDs of recently registered users, without any additional information | ||
.SH "SEE ALSO" | ||
synctl(1), synapse_port_db(1), register_new_matrix_user(1), hash_password(1) |
Oops, something went wrong.
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.
random thought: I wonder if we should generate these at build time rather than checking them in...
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.
That probably makes sense