Admin Documentation - gs2-2/paper.hub GitHub Wiki
Installation
On Ubuntu Trusty (14.04) the installation of all dependencies is handled via the bundled install script. Just run
sudo ./install_ubuntu-trusty.sh
in the projects root folder, and wait a while. The installation will be placed in the current folder.
SSL
For secure operation the use of SSL encryption is highly recommended. For testing purposes it may be disabled in the configuration file.
If you already have a certificate, place it in the projects root folder and name the files private.key
and certificate.pem
respectively.
Otherwise you may generate a selfsigned certificate using the following commands
openssl genrsa 1024 > private.key
openssl req -new -key private.key -out cert.csr
openssl x509 -req -in cert.csr -signkey private.key -out certificate.pem
Login provider registration
paper.hub relies on GitHub, LinkedIn and Google as OAuth2 providers for authentification.
You need to register a new app at these services, and store the recieved keys in the file ./oauth_keys.js
.
You will be required to enter a callback URL to your server, which will have the following format:
https://<your hostname here>/auth/<auth provider>/callback/
- GitHub auth registration
- LinkedIn auth registration
- Visit the Google developer console and add an auth application there.
Configuration
To configure the applications' ports and other options, modify the file ./config.js
to your needs.
The directory where publication data will be stored my be changed to any path where the executing user has write access. Entering the correct hostname is required for successful authentication.
Starting the server
The current working directory being the projects root folder, simply run npm start
.
If your installation is in a folder where your current user has no write permissions, run it with sudo
.
Starting the server as a service
Alternatively pm2
may be used to start the node server as a service.
This allows running in the background, starting on startup, and restarting node when files have changed.
To install, run
sudo npm install -g pm2
Then, you can start the server with pm2 start -n paper.hub <pathToInstallation>/index.js
.
Stopping the server is equally simple: pm2 stop paper.hub
.
Launching paper.hub at startup
If pm2 was installed, execute the following commands:
sudo -E pm2 start <pathToInstallation>/index.js \
--name paper.hub \
--log <pathToInstallation>/paperhub.log
sudo -E pm2 startup
sudo -E pm2 save