element-hq / element-hq/dendrite

Bulk User Creation

Open
#3,362 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
965
Forks
101
PR merge metrics
No merged PRs in 30d

Description

*This issue was originally created by [**@NassemKa**](https://github.com/NassemKa) at .*

### Background information

- **Dendrite version Dendrite 0.13.7+14a6c10**
- **Postgres**
- **Running in Docker**
- **Client used: element web for signing in**

### Description

- I have created a script for bulk user creation of 500 user the script reads 500 username and password from a csv file and created them using /usr/bin/create-account -config /etc/dendrite/dendrite.yaml -username $username -password
- The script is as follow:
```shell
#!/bin/bash

# Assuming your CSV file has two columns: username,password
# Adjust accordingly if your CSV format is different

CSV_FILE="usernames_passwords.csv"

# Check if CSV file exists
if [ ! -f "$CSV_FILE" ]; then
echo "CSV file $CSV_FILE not found."
exit 1
fi

# Loop through each line in the CSV file
while IFS=',' read -r username password; do
# Print the username and password
echo "Creating user: $username with password: $password"
# Execute the create-account command with the username and password
/usr/bin/create-account -config /etc/dendrite/dendrite.yaml -username "$username" -password "$password"
# Add a 1-second delay
sleep 1
done < "$CSV_FILE"
```
- Here is a sample of console i get after running the script:
```bash
Creating user: user_1001 with password: tsr0E4Mkha
INFO[0000] Created account: user_1001 (AccessToken: hmzXH1DODVbmHfTpqwT3zpg0LfrNRq53VvmX705cCBc)
Creating user: user_1002 with password: oCwwM12fHy
INFO[0000] Created account: user_1002 (AccessToken: xiGSiaOBe_FreHhOgDrRqoCC7HK7z5HAlQUL5uipCqs)
Creating user: user_1003 with password: ooCVDxYw9G
INFO[0000] Created account: user_1003 (AccessToken: qDQMH-lJYqU-KviUkJXh0wGaFrxs6fBWhlBDhQ2Bqu4)
Creating user: user_1004 with password: z8CsklxNte
INFO[0000] Created account: user_1004 (AccessToken: BdkLUF7OQ981GNKXNtzKQ88qiW0SvMlaj-tmGVPIl7A)
Creating user: user_1005 with password: caxpQYNkF9
INFO[0000] Created account: user_1005 (AccessToken: tZSzzX5wp4YX9z355CE2u7fv_8-9wr8b5_iyVP42O98)
```
- Those are the users created in this case (frome the csv file):

user_1001 | tsr0E4Mkha
-- | --
user_1002 | oCwwM12fHy
user_1003 | ooCVDxYw9G
user_1004 | z8CsklxNte
user_1005 | caxpQYNkF9

Contributor guide

Open the contributing guide

Research direction

The issue only identifies the /usr/bin/create-account command and its configuration path; no repository files or tests are named. Start by tracing the create-account entry point and its existing command-line options, then clarify the intended bulk-input format, error handling, and token behavior. Done should be a documented and tested way to create the requested batch without the per-user shell loop.

Written by the indexing model from the issue text.

Assessment

Tech stack
go, shell
Domain
authentication, cli
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.