Change Email Domain from Subdomain to Root?


(Benji Smith) #1

I’m setting up a new discourse site, at the domain “community.shaxpir.com”, but I’d like the system to use "community@shaxpir.com" as the default email address for notifications. Right now, the site defaults to "noreply@community.shaxpir.com". How can I change it?


(cpradio) #2

Search for notification email in Admin > Settings?


(Benji Smith) #3

The trouble is that I can’t even see my Admin dashboard inside of Discourse without first receiving my confirmation email. And my SMTP provider won’t send mail from the “community.shaxpir.com” domain without going through a bunch of DNS and domain verification steps…

Can I change a value in a config file, or update a database record, instead of using the admin page?


(David Taylor) #4

This might be useful:


(Jeff Atwood) #5

This is covered at quite some length in the email troubleshooting #howto topic. Which is linked in the install guide you were following. Maybe read it?


(Benji Smith) #6

Okay, so I followed the email troubleshooting guide, and I uncommented the line of code for configuring a custom email, and then I re-ran ./launcher rebuild app, but I got an error message:

155:M 11 Apr 21:59:00.343 # SIGTERM received but errors trying to shut down the server, check the logs for more information
2017-04-11 21:59:00 UTC [46-2] LOG:  database system is shut down
2017-04-11 21:59:00 UTC [50-1] LOG:  could not write temporary statistics file "pg_stat/db_16384.tmp": No space left on device
2017-04-11 21:59:00 UTC [50-2] LOG:  could not close temporary statistics file "pg_stat/db_1.tmp": No space left on device
2017-04-11 21:59:00 UTC [50-3] LOG:  could not close temporary statistics file "pg_stat/db_12413.tmp": No space left on device
2017-04-11 21:59:00 UTC [50-4] LOG:  could not close temporary statistics file "pg_stat/db_0.tmp": No space left on device
2017-04-11 21:59:00 UTC [50-5] LOG:  could not close temporary statistics file "pg_stat/global.tmp": No space left on device
I, [2017-04-11T21:59:10.320773 #13]  INFO -- : exec chpst -u redis -U redis /usr/bin/redis-server /etc/redis/redis.conf pid:155 did not terminate cleanly, forcing termination!


FAILED
--------------------
Pups::ExecError: cd /var/www/discourse && su discourse -c 'bundle install --deployment --verbose --without test --without development' failed with return #<Process::Status: pid 270 exit 31>
Location of failure: /pups/lib/pups/exec_command.rb:108:in `spawn'
exec failed with the params {"cd"=>"$home", "hook"=>"bundle_exec", "cmd"=>["su discourse -c 'bundle install --deployment --verbose --without test --without development'", "su discourse -c 'bundle exec rake db:migrate'", "su discourse -c 'bundle exec rake assets:precompile'"]}
328be24cfcfd514026bb2db8416f681ad714ed5d90d69a479bea51e9518fa677
** FAILED TO BOOTSTRAP ** please scroll up and look for earlier error messages, there may be more than one

It looks like Discourse used all the disk space for previous installs but didn’t clean up after itself? How do I recover from this error?


(cpradio) #7

./launcher cleanup app


(Benji Smith) #8

Hmmmm… apparently the cleanup task doesn’t clean docker data. There are 2 gigs of swapfile and 2.6 gigs of stuff in /var/lib/docker and I’m not sure what I can safely delete.

I have an AWS instance with 8 gigs of disk space, so it’s surprising to run out of storage during the discourse installation…


(cpradio) #9

The following seems to disagree with you…


(Benji Smith) #10


(cpradio) #11

What is the output of docker images --all? And docker container ls

cpradio@sandbox:~$ sudo du -sh /var/lib/docker
5.7G    /var/lib/docker
cpradio@sandbox:~$ sudo docker images --all 
REPOSITORY             TAG                 IMAGE ID            CREATED             SIZE
local_discourse/app    latest              4f229421fc66        4 weeks ago         2.47 GB
discourse/discourse    1.3.10              1881a9bd3afd        3 months ago        1.54 GB
samsaffron/docker-gc   latest              54ca424ca8d6        17 months ago       57.7 MB
cpradio@sandbox:~$ sudo docker container ls
CONTAINER ID        IMAGE                 COMMAND             CREATED             STATUS              PORTS                                      NAMES
302529c7ea7f        local_discourse/app   "/sbin/boot"        4 weeks ago         Up 3 weeks          0.0.0.0:80->80/tcp, 0.0.0.0:443->443/tcp   app

(Benji Smith) #12
root@ip-172-31-71-109:/var/discourse# docker images --all
REPOSITORY             TAG                 IMAGE ID            CREATED             SIZE
local_discourse/app    latest              3688873e6985        23 hours ago        2.24GB
discourse/discourse    1.3.10              95332d4db04b        2 weeks ago         1.52GB
samsaffron/docker-gc   latest              54ca424ca8d6        17 months ago       57.7MB
root@ip-172-31-71-109:/var/discourse# docker container ls
CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS              PORTS               NAMES

(cpradio) #13

Seems you need to increase your disk space. I mean you size isn’t anywhere near mine, and mine has very little traffic. And when I dig deeper in the /var/lib/docker paths, it seems to be the aufs directory that is consuming up the majority of space and more specifically, the diff folder in that directory.


(Benji Smith) #14

Hmmm… I thought 8gb would be enough for a brand-new forum with no members or data.

What is the recommended amount of disk space on a new VM, before installing Discourse?


(cpradio) #15

I setup a 20 GB disk for mine. And I have zero members too (other than myself). As it is purely my own testing ground.

However, it seems the issue isn’t Discourse, but maybe Docker, as this github issue seems awfully relevant to what you and I are seeing on our own instances


(Benji Smith) #16

Okay, I think I should probably switch this installation from AWS to Digital Ocean, which has more generous SSD allocations…

Thank you for your help!


(Matt Palmer) #17

6GB of disk space (once you account for your 2GB swapfile) is really tight for Discourse. You might be able to get away with it, if you’re really good, but I wouldn’t recommend it.

For reference, the minimum spec DigitalOcean droplet we recommend has 30GB of disk. While you can get away with less than that (as @cpradio’s experience demonstrates), you’re running a configuration that we don’t have operational experience with ourselves, so we’re unlikely to notice if it causes problems, nor will we know exactly where the hard limit is.


(Benji Smith) #18

Just out of curiosity, what is all that data?

6GB is a pretty big chunk of space for a webapp with no user data yet…


(Matt Palmer) #19

Well, only 2.6GB (what’s in /var/lib/docker) is Discourse-related; the rest is your OS and whatever else you’ve got going on. What’s in /var/lib/docker is the Docker image of Discourse, which includes a copy of everything you need to run the webapp so you can put user data in it: PostgreSQL, Redis, Ruby, nginx, Discourse code, and the underlying OS and libraries to run same.


(Benji Smith) #20

Good to know. Thanks!