Test & activation emails are sent with port 4000 included


(AP) #1

Everthing is working, including e-mail delivery - but: the activation/test links in the emails are of the form:

http://discuss.mysite.com:4000/

I’ve checked my app.yml and there’s no port 4000 in there. Is the system somehow thinking it’s running in development mode?


(Jeff Atwood) #2

Do you have any of the WARNING: DEVELOPER ONLY settings set? Is this installed using our Docker guide?


(AP) #3

Installed via Docker, but imported a vBulletin database from inside the development environment (using git clone … -> vagrant up -> vagrant ssh -> ruby script/import_scripts/vbulletin.rb etc.). Inside vagrant I then took a database dump using:

pg_dump -xOf ./discourse-backup.sql -n public discourse_development

Then copied this dump to my production discourse install and did inside psql:

drop schema public cascade;
create schema public;

Then on the command line
sudo -u postgres psql -f /shared/discourse-backup.sql discourse

Noticed that the gravatar paths are all wrong as well. Since the vBulletin import took ~8 hours (200 000 posts), I’m reluctant to start over. Can the email-path be edited inside the database (couldn’t find anything doing a simply ‘grep’ on the dump)?


(Régis Hanol) #4

Why didn’t you use the backup/restore feature in Discourse?

The discourse remap script might help you here.


(AP) #5

Actually also noticed that the load times (in ms) show up on the left side of the screen. Does that mean my discourse is running in development mode and not in production?

How can I change this?

codinghorror: where do I find the “WARNING: DEVELOPER ONLY” settings?


(Régis Hanol) #6

It’s only displayed for administrators, even in production.

If you search for DEVELOPER ONLY in the site settings and you have results, then you’re definitely running in development mode (we hide them when running in production mode).


(AP) #7

No, nothing comes up when I do that - No results found.


(Jeff Atwood) #8

But if you imported a database from a development mode import, that setting might be present, I guess.


(Jens Maier) #9

The odd thing is that it’s port 4000. That’s used for Unicorn, not the dev-mode webserver (which defaults to 3000, as does SiteSetting.port)…

Anyway, try:

/var/discourse/launcher enter app
rails c 
SiteSetting.port = ""
SiteSetting.force_hostname = ""
SiteSetting.queue_jobs = true

(AP) #10

SiteSetting.port returned 4000, so setting this to “” fixed the email issue. Thank you!


(Régis Hanol) #11