The VPS is fairly beefy at 4GB/4 Core … but it’s my daily driver so I don’t really want to economise here, but you could to lower costs.
I use rbenv to maintain the current version of Ruby
I git pull at start of each session to make sure I’m developing on the current master of Discourse.
I maintain a DNS entry to it and manually recertify to keep the https link working (so I don’t need to use other tools for developing with https)
I’ve made edits to the nginx discourse config to route the 443 calls. I symlink the sites-enabled so I can switch to running other configs for eg other apps
I symlink the plugins from a larger code directory.
VSCode lives on the client (my home work PC) and connects with an ssh tunnel. Standard stuff.
I also interact with it via Windows Terminal app. Optional.
I’ve also installed the cloud based VSCode so you can also dev entirely from a browser (for example, on an iPad), but that’s got some annoying limitation so don’t use it that way often.
Everything seemed to work fine until the setup guide stated I could see my discourse forum on the localhost – how do I do that? I skipped this step and successfully created an admin account. Then, once I ran mailcatcher, this is what I was told:
Starting MailCatcher
==> smtp://127.0.0.1:1025
/root/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/thin-1.5.1/lib/thin/server.rb:104: warning: constant ::Fixnum is deprecated
==> http://0.0.0.0:1080/
*** MailCatcher runs as a daemon by default. Go to the web interface to quit.
Does this look alright? The guide stated that I run mail catcher like this:
mailcatcher --http-ip 0.0.0.0
Should I have replaced the zeros with my droplets numbers?
You should be running that command on your server in the ssh terminal session: afterall you trying to catch the emails sent by the server, not your client machine.
I believe the option simply prompts mailcatcher to share its interface over the internet so you can see the emails in a client browser on that port (1080 in this case). Try leaving it out and you should find you can’t see emails on your remote client browser.
Note that is insecure, so don’t send anything private over test emails, and only use mailcatcher when you need to (it’s only needed when you need to test emails for some reason!)
There’s a post about making mailcatcher secure here:
Thanks! Now that my discourse instance appears to be setup with an admin user, how can I see it from the front end? The meta post I followed for setup stated I could access via the local host – how do I do that? I’m very sorry for my ignorance here.
When I run the discourse server ( UNICORN_BIND_ALL=true bundle exec rails server) it runs for close to 30mins before the terminal appears to freeze. If during that time I place the IP in my (firefox) browser, I get this:
Now, if I add :3000 after the IP, I don’t get that error message, but rather it appears to try to open the discourse site, but it never does. It even sometimes shows “discourse” on the browser tab.
It shows an insecure connection icon – is this why I can’t get frontend access, or does it have something to do with the terminal running forever and then appearing to freeze up?