Separate production and dev instructions

This commit is contained in:
John Furrow
2016-08-16 20:50:54 -07:00
parent f0977f170f
commit fe9cd9860c
+16 -8
View File
@@ -20,28 +20,36 @@ If you have a specific issue or bug, please file a Github issue. If you want to
#### Configuring
1. Copy `config.template.js` to `config.js`. This is required.
2. Set your rTorrent SCGI hostname and port in `config.js`. Defaults are `localhost` and `5000`.
* If you want to use a socket, change `socket` to true and set `socketPath` to the absolute file path of your rTorrent socket. Make sure Flood has read/write access.
* If you want to use a socket, change `socket` to true and set `socketPath` to the absolute file path of your rTorrent socket. Make sure Flood has read/write access. Specify the socket path in `.rtorrent.rc`. Example: `scgi_local = /Users/flood/rtorrent.sock`
* If you wish to access an rTorrent instance running on a separate host from Flood (or in a Docker container), allow for incoming connections from external IPs by setting the host in `scgi_port` to `0.0.0.0` in `.rtorrent.rc`. Example: `scgi_port = 0.0.0.0:5000`
3. Create a long, unique secret (used to sign [JWT auth tokens](https://github.com/auth0/node-jsonwebtoken)) in `config.js`.
#### Starting the Server
1. Run `npm start` in your terminal at this repo's root.
* On first run, this may take a few minutes while it installs dependencies and transpiles JavaScript & CSS assets.
2. Access the UI in your browser. Defaults to `localhost:3000`.
1. Run `npm install --production`.
2. Run `npm start:production`.
3. Access the UI in your browser. Defaults to `localhost:3000`.
* You may change the default port in `config.js`.
3. Upon loading the UI the first time, you will be prompted to create a user account.
4. Upon loading the UI the first time, you will be prompted to create a user account.
#### Updating
1. To update, run `git pull` in this repository's directory.
2. Check `config.template.js` for configuration changes that you may wish to incoporate in your `config.js`.
3. Kill the running Node server.
4. Run `npm install` to update dependencies.
5. Restart it with `npm start`.
* Static frontend assets are transpiled and compressed before starting the server.
4. Run `npm install --production` to update dependencies.
5. Restart it with `npm start:production`.
* Static client-side assets are transpiled and compressed before starting the server.
#### Tips
* I run the web server with `screen` to keep the web server running independently of the terminal session.
* Ubuntu users will need to install `nodejs-legacy` (`sudo apt-get install nodejs-legacy`) for dependencies to install successfully. You can read more on [this Stack Overflow post](http://stackoverflow.com/questions/21168141/cannot-install-packages-using-node-package-manager-in-ubuntu).
#### Local Development
1. Run `npm install`.
2. Run `npm start` and `npm start:watch` in separate terminal instances.
3. Access the UI through the [browser-sync](https://www.browsersync.io/) proxy at [localhost:4200](http://localhost:4200).
* `npm start` uses [nodemon](https://github.com/remy/nodemon) to watch for changes to the server-side JavaScript.
* `npm start:watch` watches for changes in the client-side source..
# Screenshots
![](https://s3.amazonaws.com/johnfurrow.com/share/flood-screenshot-a-0606.png)
![](https://s3.amazonaws.com/johnfurrow.com/share/flood-screenshot-b-0606.png)