Skip to content

Commit 34fd181

Browse files
committed
Auto-update: Sun Feb 2 16:12:46 PST 2025
1 parent 2b0ce1d commit 34fd181

File tree

1 file changed

+17
-33
lines changed

1 file changed

+17
-33
lines changed

README.md

Lines changed: 17 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,22 @@ Add favicon.ico to `static/favicon.ico`
4646

4747
5. Generate initial registration token:
4848
```bash
49-
openssl rand -base64 32 | tr -d '/+=' | head -c 32 > .registration_token
49+
openssl rand -hex 16 > .registration_token
50+
```
51+
52+
6. Set up token rotation:
53+
```bash
54+
# Copy and configure the token refresh script
55+
cp example-refresh_token.sh refresh_token.sh
56+
nano refresh_token.sh # configure paths for your environment
57+
58+
# Make it executable
59+
chmod +x refresh_token.sh
60+
61+
# Add to crontab (runs at midnight UTC)
62+
crontab -e
63+
# Add this line:
64+
0 0 * * * /path/to/your/hand_of_morpheus/refresh_token.sh 2>&1
5065
```
5166

5267
## Configuration
@@ -71,15 +86,6 @@ smtp:
7186
7287
You can also customize the subject and body of the email that is sent.
7388
74-
## Token Rotation
75-
76-
Add this to your crontab to rotate the registration token daily at 00:00 UTC:
77-
78-
```bash
79-
# Edit crontab with: crontab -e
80-
0 0 * * * openssl rand -base64 32 | tr -d '/+=' | head -c 32 > /path/to/hand_of_morpheus/.registration_token
81-
```
82-
8389
## Running the Server
8490
8591
```bash
@@ -102,26 +108,4 @@ Consider running in a `tmux` session, or creating a system service for it.
102108
- Regularly backup `registrations.json`
103109
- Monitor logs for abuse patterns
104110

105-
## Example Conduwuit docker run command
106-
107-
```bash
108-
docker run -d \
109-
-p 127.0.0.1:8448:6167 \
110-
-v db:/var/lib/conduwuit/ \
111-
-v /path/to/hand_of_morpheus/.registration_token:/registration_token:ro \
112-
-e CONDUWUIT_SERVER_NAME="your.domain" \
113-
-e CONDUWUIT_DATABASE_PATH="/var/lib/conduwuit/conduwuit.db" \
114-
-e CONDUWUIT_DATABASE_BACKUP_PATH="/var/lib/conduwuit/backup" \
115-
-e CONDUWUIT_ALLOW_REGISTRATION=true \
116-
-e CONDUWUIT_REGISTRATION_TOKEN_FILE="/registration_token" \
117-
-e CONDUWUIT_PORT=6167 \
118-
-e CONDUWUIT_ADDRESS="0.0.0.0" \
119-
-e CONDUWUIT_NEW_USER_DISPLAYNAME_SUFFIX="" \
120-
-e CONDUWUIT_ALLOW_PUBLIC_ROOM_DIRECTORY_OVER_FEDERATION=true \
121-
-e CONDUWUIT_ALLOW_PUBLIC_ROOM_DIRECTORY_WITHOUT_AUTH=true \
122-
-e CONDUWUIT_ALLOW_FEDERATION=true \
123-
-e CONDUWUIT_AUTO_JOIN_ROOMS='["#community:your.domain","#welcome:your.domain"]' \
124-
--name conduwuit \
125-
--restart unless-stopped \
126-
ghcr.io/girlbossceo/conduwuit:v0.5.0-rc2-e5049cae4a3890dc5f61ead53281f23b36bf4c97
127-
```
111+
The included `refresh_token.sh` script handles both token rotation and conduwuit container management. Review and adjust its settings before use.

0 commit comments

Comments
 (0)