The defaults are all right, but you might also want to do the following:
-
in
/etc/mongodb.conf
, setbind_ip = 127.0.0.1
andnohttpinterface = true
; -
restart MongoDB:
$ sudo service mongodb restart
(for sysvinit, openrc and others), or
$ sudo systemctl restart mongodb.service
(for systemd);
-
drop some databases that were created by default:
$ mongo test --eval 'db.dropDatabase()' $ mongo local --eval 'db.dropDatabase()'
BnW does require an XMPP server, but not Prosody specifically - any one that supports XEP-0114: Jabber Component Protocol will do. We do recommend Prosody, though, as it's easy to install and configure.
There are two possible setups: a local one, suitable for developing things locally, and a public one, intended for those who want to host their own instance.
-
In the global section (i.e. before the line saying "----------- Virtual hosts -----------") of
/etc/prosody/prosody.cfg.lua
set the following:c2s_interface = "127.0.0.1" s2s_interface = "127.0.0.1" legacy_ssl_interface = "127.0.0.1"
-
edit local virtual host's config,
/etc/prosody/conf.avail/localhost.cfg.lua
, appending these lines at the end of it:Component "bnw.localhost" component_secret = "here goes your component's authorization password"
(You can use anything in place of "bnw", it's only ".localhost" postfix that is required);
-
restart Prosody:
$ sudo service prosody restart
Assuming that the server you're hosting BnW on has a domain name example.com
,
and you want BnW to be available at bnw.example.com
:
-
create a file named
/etc/prosody/conf.avail/example.com.cfg.lua
and put the following lines in there:VirtualHost "example.com" Component "bnw.example.com" component_secret = "here goes your component's authorization password"
Or vice versa: the service is at
example.com
, but XMPP server is atxmpp.example.com
:VirtualHost "xmpp.example.com" Component "example.com" component_secret = "here goes your component's authorization password"
-
activate the config you've just created and deactivate the default local one:
$ sudo ln -s /etc/prosody/conf.avail/example.com.cfg.lua \ /etc/prosody/conf.d/example.com.cfg.lua $ sudo unlink /etc/prosody/conf.d/localhost.cfg.lua
-
restart Prosody:
$ sudo service prosody restart
Registration using a client is disabled by default, but you can create an account from the command line:
$ sudo prosodyctl adduser user@localhost
(substitute "localhost" with the name of your public service if you've set it up that way). When using public setup, you can also use an account on any other XMPP server.
BnW starts a web interface at localhost:7808 by default. No further configuration is required.
We advise not to expose default HTTP interface to the Internet. Set up an Nginx proxy or something.
-
In the directory with the BnW source code, run the following:
$ virtualenv --system-site-packages .venv
This will create a directory called
.venv
containing Python virtual environment; -
copy the default config:
$ cp config.py.example config.py
and adjust
srvc_pwd
to match the password you've set for your component in Prosody's config; -
deploy BnW:
$ .venv/bin/python setup.py install
When run for the first time, this command will download and install all the dependencies. Afterwards, it will only re-deploy the project into virtual environment.
Note that you need to re-run this command every time you change the source code;
-
at long last, start BnW:
$ PYTHONPATH=. .venv/bin/bnw -n
(we need to set
PYTHONPATH
to current directory, i.e..
, so that it picks up the configuration file).
You should now be able to see BnW's default home page at localhost:7808.