Skip to content

Commit 2b0ce1d

Browse files
committed
Auto-update: Sun Feb 2 16:00:31 PST 2025
1 parent 7882e14 commit 2b0ce1d

File tree

3 files changed

+59
-1
lines changed

3 files changed

+59
-1
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ config.yaml
3434
registrations.json
3535
banned_emails.txt
3636
banned_ips.txt
37-
banned_usernames.txt
37+
refresh_token.shbanned_usernames.txt
3838

3939
# Backup directories
4040
backup/

banned_usernames.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
.*admin.*
2+
.*loli.*
3+
.*shota.*
4+
.*pedo.*
5+
.*pthc.*

example-refresh_token.sh

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
#!/bin/bash
2+
3+
# Path configuration
4+
TOKEN_FILE="/path/to/hand_of_morpheus/.registration_token"
5+
LOG_FILE="/path/to/hand_of_morpheus/token_refresh.log"
6+
7+
# Function to log with timestamp
8+
log() {
9+
echo "$(date --iso-8601=seconds) $1" >> "$LOG_FILE"
10+
}
11+
12+
# Generate new token (32 random hex characters)
13+
NEW_TOKEN=$(openssl rand -hex 16)
14+
15+
# Write new token to file
16+
echo "$NEW_TOKEN" > "$TOKEN_FILE"
17+
if [ $? -ne 0 ]; then
18+
log "ERROR: Failed to write new token to $TOKEN_FILE"
19+
exit 1
20+
fi
21+
22+
log "Generated new registration token"
23+
24+
# Recreate conduwuit container
25+
docker stop conduwuit
26+
docker rm conduwuit
27+
28+
docker run -d \
29+
-p 127.0.0.1:8448:6167 \
30+
-v db:/var/lib/conduwuit/ \
31+
-v /path/to/hand_of_morpheus/.registration_token:/registration_token:ro \
32+
-e CONDUWUIT_SERVER_NAME="your.domain" \
33+
-e CONDUWUIT_DATABASE_PATH="/var/lib/conduwuit/conduwuit.db" \
34+
-e CONDUWUIT_DATABASE_BACKUP_PATH="/var/lib/conduwuit/backup" \
35+
-e CONDUWUIT_ALLOW_REGISTRATION=true \
36+
-e CONDUWUIT_REGISTRATION_TOKEN_FILE="/registration_token" \
37+
-e CONDUWUIT_PORT=6167 \
38+
-e CONDUWUIT_ADDRESS="0.0.0.0" \
39+
-e CONDUWUIT_NEW_USER_DISPLAYNAME_SUFFIX="" \
40+
-e CONDUWUIT_ALLOW_PUBLIC_ROOM_DIRECTORY_OVER_FEDERATION=true \
41+
-e CONDUWUIT_ALLOW_PUBLIC_ROOM_DIRECTORY_WITHOUT_AUTH=true \
42+
-e CONDUWUIT_ALLOW_FEDERATION=true \
43+
-e CONDUWUIT_AUTO_JOIN_ROOMS='["#community:your.domain","#welcome:your.domain"]' \
44+
--name conduwuit \
45+
--restart unless-stopped \
46+
ghcr.io/girlbossceo/conduwuit:v0.5.0-rc2-e5049cae4a3890dc5f61ead53281f23b36bf4c97
47+
48+
if [ $? -ne 0 ]; then
49+
log "ERROR: Failed to create new conduwuit container"
50+
exit 1
51+
fi
52+
53+
log "Successfully recreated conduwuit container with new token"

0 commit comments

Comments
 (0)