Email domain check for admin user causes problem with automated installs
Currently, an email address is validated by the system during registration (by validating the domain portion).
If DNS is not available, is alternative implementation, or firewalled - the call fails and we consider the domain invalid. Admin user cannot be created.
This is also complicated by a regex bug #2841 that exists within the current release 0.26.0
It is possible to turn off this option. But it currently defaults to ON - which makes it impossible to create an admin under some situations.
Recommended to make validation default to OFF.
This affects both manual registrations and automated install (admin email set via ENV VARs).
Set admin email set via ENV VARs is not affected anymore.
You can set this Accounts_UseDNSDomainCheck config to false via ENV VARs on your initial setup if you are sure your server is blocked from outside world.
It is possible to define the Env-VAR in the docker-compose file or it is only for manual installations without docker?
AFAIK you can set ANY config of Rocket.Chat with ENV VAR. Juts use the same name as their _id on the settings collection. Also, it will only work on the initial setup, they will be ignored if they already have a value in the settings collection.
@engelgabriel how to do it correct on first setup? Tried it like this:
mongo:
image: mongo
# volumes:
# - ./data/runtime/db:/data/db
# - ./data/dump:/dump
command: mongod --smallfiles --oplogSize 128
rocketchat:
image: rocketchat/rocket.chat:latest
# volumes:
# - ./uploads:/app/uploads
environment:
- PORT=3000
- ROOT_URL=http://yourhost:3000
- MONGO_URL=mongodb://mongo:27017/rocketchat
- Accounts_UseDNSDomainCheck=false
links:
- mongo:mongo
ports:
- 3000:3000
After recreating the docker containers it seems that this is not working. Or did i need a new mongodb container, too?
That should work, but only on a fresh install.
Fresh install means delete all docker container with
docker stop rocketchat_rocketchat_1
docker stop rocketchat_mongo_1
docker rm rocketchat_rocketchat_1
docker rm rocketchat_mongo_1
.. and recreate with docker-compose up -d ?
I guess, since you are not using volumes, yes.
You can change it directly on the DB using the following:
db.rocketchat_settings.update({'_id':'Accounts_UseDNSDomainCheck'}, {$set: { 'value':false }})
Hi @engelgabriel . i'm quite new in this development. where could i find the code that you have mentioned above? db.rocketchat_settings.update({'_id':'Accounts_UseDNSDomainCheck'}, {$set: { 'value':false }}) thanks in advance.
ohh nevermind. found it, its actually for mongo. silly me. thanks for the help!
Sorry for the delay @salmonblade I am happy you found it :)
Hello, changing the option directly in the database doesn't work for me. Also, it wasn't clear how exactly to run the command, so here are the steps (when running rockchat via docker):
docker psto list running docker containers$ docker exec -it rocketchat_mongo_1 /bin/bash(replacerocketchat_mongo_1with the name of your mongo docker instance) to get a bash terminal within the container# ./usr/bin/mongoget into the mongo command lineshow dbsto list databases,dbto show current database,use rocketchatto switch to rocketchat db (not sure if this is a required step)db.rocketchat_settings.update({'_id':'Accounts_UseDNSDomainCheck'}, {$set: { 'value':false }})to update the setting as described above... the response I get isWriteResult({ "nMatched" : 1, "nUpserted" : 0, "nModified" : 0 })
So, hopefully I'm doing something incorrectly with executing the command, but whatever the case, I'm still getting "Invalid Domain" errors when trying to add users, making it impossible to add users. Does anyone have any suggestions?
I have changed everything, I have disabled dns and domain check, disabled blacklist, took all measures without success to solve this problem !