@@ -46,7 +46,22 @@ Add favicon.ico to `static/favicon.ico`
46
46
47
47
5 . Generate initial registration token:
48
48
``` 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
50
65
```
51
66
52
67
## Configuration
71
86
72
87
You can also customize the subject and body of the email that is sent.
73
88
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
-
83
89
## Running the Server
84
90
85
91
` ` ` bash
@@ -102,26 +108,4 @@ Consider running in a `tmux` session, or creating a system service for it.
102
108
- Regularly backup ` registrations.json `
103
109
- Monitor logs for abuse patterns
104
110
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