@PitaJ OR it can read from environment variables?
(Which is what is discussed in the link I gave above)
For v0.7.0, NodeBB now accepts configuration via environment variables. Thanks to @ahwayakchih for his work that prompted this change
Since v0.6.0, We've also significantly relaxed the amount of data you need to set up NodeBB, with sensible defaults assumed if not provided:
urlis defined, NodeBB will default to
databasevalue is required (
Prior to this change, automated setup was achieved via passing an escaped JSON string in the
setup argument. I personally found this cumbersome and hard to work with, so it will be deprecated prior to v1.0.0 (this is open to discussion).
# Minimum setup options $ database=redis node app --setup`
# Setup NodeBB on Redis database 4 $ database=redis redis__database=4 node app --setup`
# MongoDB setup with username and password $ database=mongo mongo__username=foobar mongo__password=mypassword node app --setup
# Admin user defined $ database=redis admin__password=foobar node app --setup
@julian Is it for developers or users?
If for developers, It would be more helpful to have predefined configuration file, for fast and easy setup. I have found myself in situation when from time to time I should reinstall NodeBB from the scratch (rm -rf NodeBB, git clone, npm install, ./nodebb setup, ./nodebb dev)
So it would be great to have configuration file with answers for setup wizard, seems it should look like:
./nodebb setup /usr/local/some/path/config.default.json
@Nicolas I think you can copy your
default.json file into the directory after
git cloneing as
config.json, and it will use those settings.
Nope, you still need go through Wizard, but it will be a bit faster
@Nicolas If everything is the same, you shouldn't even have to run
./nodebb setup, you should be able to just start it.
Still no because you will not have necessary node packages - for example mongo_db
Also from scratch, there is probability that you don't have populated database, as a result you need dummy data from setup script - like categories, admin user, etc.
@Nicolas Seems like we need a better CLI. Maybe a Node-based one possibly called NBBVM?
adds to long list of plugins/utilities to build
@Nicolas You could just
npm install? That's what I did while development multiple times,
cp ~/config.json ./,
Thanks for the comments guys
The automated setup via environment variables is to aid with setup on cloud services and our SaaS platform. The interactive prompt will still continue to be in use, but we're looking to change the default installation steps to utilise the web installation interface Andrew has implemented.
From there, we can reduce the steps to:
npm install --production
A cloud hosting provider can automate all four steps, so nobody has to mess with a shell again
A cloud hosting provider
read: The NodeBB Saas platform
@julian Objection! When setting settings through env variables, they are always strings. Currently NodeBB doesn't seem to take this into account. i.e. running
./nodebb start (or
npm start) with the env variables
silent both set to
false, NodeBB still starts both daemonized and silent.
false does not equal
Also, slightly unrelated, but when doing the setup thingy with a redis password provided, i.e. like
$ database=redis redis__password=CorrectHorseBatteryStaple node app --setup`
the password provided is used during the install but not actually saved to config.json.
Maybe you should add that to the docs was really hared for me to find out it was possible and it is really interesting if setting it up with docker-compose. You guys might just add it to the docker read me page. https://hub.docker.com/r/nodebb/docker/
Hi @axel12 -- add what to the readme?
@julian A docker-compose.yml file example for Docker. Basically how to setup NodeBB-Docker.