Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Email domain check for admin user causes problem with automated installs #2895

Closed
Sing-Li opened this issue Apr 14, 2016 · 14 comments
Closed
Milestone

Comments

@Sing-Li
Copy link
Member

Sing-Li commented Apr 14, 2016

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).

@Sing-Li Sing-Li changed the title Email domain check for admin user cause problem with automated install Email domain check for admin user causes problem with automated installs Apr 14, 2016
@engelgabriel
Copy link
Member

Set admin email set via ENV VARs is not affected anymore.

@engelgabriel
Copy link
Member

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.

@engelgabriel engelgabriel added this to the 0.27.0 milestone Apr 14, 2016
@TheReal1604
Copy link
Contributor

It is possible to define the Env-VAR in the docker-compose file or it is only for manual installations without docker?

@engelgabriel
Copy link
Member

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.

@TheReal1604
Copy link
Contributor

TheReal1604 commented Apr 15, 2016

@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?

@engelgabriel
Copy link
Member

That should work, but only on a fresh install.

@TheReal1604
Copy link
Contributor

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 ?

@engelgabriel
Copy link
Member

I guess, since you are not using volumes, yes.

@engelgabriel
Copy link
Member

You can change it directly on the DB using the following:

db.rocketchat_settings.update({'_id':'Accounts_UseDNSDomainCheck'}, {$set: { 'value':false }})

@salmonblade
Copy link

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.

@salmonblade
Copy link

ohh nevermind. found it, its actually for mongo. silly me. thanks for the help!

@engelgabriel
Copy link
Member

Sorry for the delay @salmonblade I am happy you found it :)

@sebastientaggart
Copy link

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):

  1. docker ps to list running docker containers
  2. $ docker exec -it rocketchat_mongo_1 /bin/bash (replace rocketchat_mongo_1 with the name of your mongo docker instance) to get a bash terminal within the container
  3. # ./usr/bin/mongo get into the mongo command line
  4. show dbs to list databases, db to show current database, use rocketchat to switch to rocketchat db (not sure if this is a required step)
  5. db.rocketchat_settings.update({'_id':'Accounts_UseDNSDomainCheck'}, {$set: { 'value':false }}) to update the setting as described above... the response I get is WriteResult({ "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?

@Elfanar
Copy link

Elfanar commented Mar 4, 2019

I have changed everything, I have disabled dns and domain check, disabled blacklist, took all measures without success to solve this problem !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants