How to edit app.yml file?

(van) #1

I’m pretty new with this whole terminal and using putty.

I have my discourse set up and closed putty since I finished with the set up. Now, I have to open putty again and reconfigure something. How do I enter that session again?

Do I enter ssh root@ then type out my password?

what’s next after that?
nano containers/app.yml?

Whenever I type nano containers/app.yml there is no file to edit.


500 "Oops" Error Caused By Unofficial Plugin, Safe-Mode Doesn't Work
Installing plugins without Docker? (Windows 8 and Vagrant Setup)
(Arpit Jalan) #2

After that enter into discourse folder, type out:

cd /var/discourse


nano containers/app.yml

That’s it. Just make your changes, then run:

git pull
./launcher rebuild app

You’re good to go!

I entered the wrong admin email address during initial setup
(van) #3

First, you specify which directory to edit then you open up the file. After that, you update the file by using git pull. Then, you rebuild again.

There’s always a rebuild after every configuration?

(van) #4

BTW, how do you reboot?

(Jens Maier) #5

Depends on the system, but reboot or shutdown -r now should get you there. If it complains that you must be the superuser or that it can’t find the command, run sudo reboot or sudo shutdown -r now instead.

By the way, a few quick tips:

  • When you start a SSH session, you always get a new, freshly started shell. (Shells are programs that read and parse your commands.)
  • Each process, including the shell, has its own current working directory. You can type pwd in the shell to see the full name of the directory the shell is currently in, and you can type cd followed by a name to change the shell’s current directory.
  • Names that begin with a slash are absolute. /tmp always refers to the same directory, no matter what the current working directory is. / is called the root directory. Any name that doesn’t start with a slash, including for example ./, is relative to the current working directory. . alone is synonymous for the current directory; .. is the current directory’s parent.
    Interestingly, /.. exists, but is always identical to /.
  • Linux allows you to run a process in a “container” by changing its root directory. For example, Discourse runs inside such a container: its files are actually stored somewhere in /var/lib/docker/, and the Docker program tricks Discourse into believing otherwise.
    Discourse cannot actually read your app.yml, it simply has no way to refer to the file. Instead the launcher script goes through the configuration file, injects your settings into Discourse’s container and then restarts Discourse.

So yes – you need to rebuild the container after every “major” configuration change; if you only change the expose or env sections, a simple restart instead of a rebuild will do.

Changing the hostname