janitor
janitor copied to clipboard
Installing on Debian 8
I tried to install it on Debian 8, but I failed.
First I had to symlink /usr/bin/node
to /usr/bin/nodejs
Then I started a ubuntu container, leading to the same result.
I noticed in the error messages, service not found
so I am running a container with ubuntu:16.10
now.
However, am I assuming correctly the readme should state Debian 7 or Ubuntu 16.10?
Hi @dns2utf8, thanks for reporting these problems!
The node: command not found
error we can easily fix by detecting node
vs nodejs
.
The service not found
error is less easy. Service scripts are a bit messy nowadays, with the transition to systemd
across all distros, so I don't actually use these anymore for now (i.e. the stuff in init.d/
or make daemon
). Maybe I should remove them.
Also, you're right, make install
makes a few Debian 7 / Ubuntu 15 assumptions, notably for the Docker configuration step.
As a workaround, you can just use node app
(or nodejs app
) to start the server, or make start
to make it run in the background (make stop
to kill it). You might need to do a few things manually, e.g. npm install
, make https
to generate self-signed HTTPS certs (this is currently being replaced by Let's Encrypt), and make client.crt docker.crt
to generate TLS certs for Docker (and then you need to configure Docker by manually doing make docker for your platform).
TL;DR workaround:
npm install
make https
make client.crt docker.crt
# TODO: configure docker daemon to use ca.crt, docker.key and docker.crt
node app # start the server in the foreground to test it
^C
make start # start the server in the background
tailf janitor.log # to watch the server logs
Note to self, to fix this the following needs to happen:
- [ ] Detect
nodejs
vsnode
- [x] Remove deprecated platform-specific service stuff (EDIT: fixed by fa9aa7b76f71c810c04eba8a90dae3c526ed14af)
- [x] Replace self-signed HTTPS certificate generation with Let's Encrypt (#33)
- [x] ~~Mention in Readme that
make install
only works on Debian 7 / Ubuntu 15~~ (Edit:make install
was deprecated in favor ofnpm install
) - [ ] Provide more cross-platform install instructions
Have you already been able to test it on Ubuntu 16.10?
I believe Ubuntu 16.10 uses systemd, so the make daemon
probably won't work, but apart from that I believe make install
should work. Please report any specific problems so we can fix or work around them. Thanks!
I had to install nodejs 6 for janitor:
curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash -
but now it is just showing me a aborted page and logs:
dropping request for localhost:1443
@dns2utf8 I am happy to see things are coming along. Looks like @jankeromnes's new security features are getting in your way, try commenting out this security middleware: https://github.com/jankeromnes/janitor/blob/master/app.js#L65-L86
@dns2utf8 Feel free to ping me in IRC for more questions. :)
Ah, I solved it with a entry in ./db.json
:
{ "hostname": "localhost:1443" }
which IRC?
#janitor on freenode
I had to install nodejs 6 for janitor
Yes, I believe we need node < 6
, but I'd advise using 7
or 8
(or whichever version is the latest stable) because while we try to keep our web app front-end largely compatible with older browsers, our server code often uses brand-new Node.js features.
dropping request for localhost:1443
This log now looks like this:
[2017-07-25T22:32:50.419Z] [warning] dropped 1 request for invalid hostname: localhost:1443
It can be fixed by disabling all security policies (for development only!) like so:
In db.json
:
"security": {
"forceInsecure": true
}
You might also want to add "forceHttp": true
in order to disable Let's Encrypt certificate requests (which usually don't work in a development setup anyway).
#janitor on freenode
There is a quick link to join our IRC channel at the bottom of the website: #janitor (IRC)
So 1e15ab3a513a86ed26a40cafd5ef9888902d503d refactored the make docker
configuration to systemd.
Now we just need to detect nodejs
vs node
, and update README.md's install instructions to something like:
- install
node
(anddocker
if you're planning to host containers) - do
sudo make ports
- add the correct
"hostname": "myhostname.com"
and"letsencrypt": { "email": "[email protected]" }
todb.json
(well actually you might need Janitor OAuth2 credentials as well... we should add a "Add new host" flow to the website that generates a workingdb.json
you can install) - then
npm start
(choose "app" to run a new Janitor web app + cluster, or "join" to join the existing Janitor cluster, and thentailf -n100 janitor.log
to see if everything works) - and finally, if you want to host containers,
sudo make docker
to configure Docker to use the auto-generated TLS certificates to expose the Docker Remote API
FWIW, installing latest node can be done using nodeenv, which in turn may be usede inside a Python virtualenv. Something along these lines worked for me:
$ virtualenv --system-site-packages venv
$ . ./venv/bin/activate
(venv) $ pip install nodeenv
(venv) $ nodeenv -p
(venv) $ deactivate
$ git clone ...
$ git submodule init
$ git submodule update
$ . ./venv/bin/activate
(venv) $ cd janitor
(venv) $ npm install
....
Hope this helps.