-
Notifications
You must be signed in to change notification settings - Fork 11
Home
You need:
- nodejs 0.6.4
- redis 2.2.x
There might be packages for your operating system/distribution.
You must keyword nodejs: Edit file /etc/portage/package.keywords (create directory and file if they do not exist) and append:
For 64-bit system:
>=net-libs/nodejs-0.6.4 ~amd64
or
For 32-bit system:
>=net-libs/nodejs-0.6.4 ~x86
$ emerge -va net-libs/nodejs dev-db/redis
Note: If you're currently configured to use python-3.1 or later, you'll need to select python-2.6, like this:
$ eselect python list
Available Python interpreters:
[1] python2.7
[2] python3.1 *
[3] python3.2
$ eselect python set 1
$ eselect python list
Available Python interpreters:
[1] python2.7 *
[2] python3.1
[3] python3.2
After you've compiled nodejs using python2.x you may switch back to python3.1 for your default python environment.
Next, you'll need to start the redis service, otherwise running the dashboard (later on this page) will receive a connection refused. It is also beneficial to add the redis init script to the default runlevel of init.
$ /etc/init.d/redis start
$ rc-update add redis default
On Ubuntu Oneiric you may install them using sudo apt-get install redis-server nodejs npm
.
Recent versions of redis-server, and packages for node.js/npm may be obtained from Chris Lea's PPAs:
sudo apt-add-repository ppa:chris-lea/redis-server
sudo apt-add-repository ppa:chris-lea/node.js
sudo apt-get update
sudo apt-get install redis-server nodejs npm
Edit /etc/apt/sources.list and add sources:
deb http://backports.debian.org/debian-backports squeeze-backports main
deb http://ftp.us.debian.org/debian unstable main
and edit pin preferences /etc/apt/preferences:
Package: *
Pin: release a=stable
Pin-Priority: 700
Package: *
Pin: release a=testing
Pin-Priority: 650
Package: *
Pin: release a=unstable
Pin-Priority: 600
Then run
$ apt-get update
$ apt-get install build-essential
$ apt-get -t squeeze-backports install redis-server
$ apt-get -t unstable install nodejs
Until debian will have node 0.6.3 and newer, you need to install NPM manually:
$ curl http://npmjs.org/install.sh | sh
Now fetch the dashboard code and change into this directory:
$ git clone https://github.com/hbons/SparkleShare-Dashboard.git
$ cd SparkleShare-Dashboard
Now initialize npm packages as normal user in SparkleShare Dashboard directory:
$ npm install -d
For notification backend (replacement for IRC communication channel of desktop SparkleShare client) you need to pull also fanout module:
$ git submodule init
$ git submodule update
Now you can enable fanout in your config.js
Edit config.js to match your needs. You mostly need to configure the exports.folders, but some other tweaks may be necessary.
- Change name to whatever you would like it to show up as on the dashboard (and on linked android devices). Use single quotes around the names.
- Change path to the filesystem location of your git repository's root, such as '/home/git/Backup' or similar. Make sure to use single quotes again, here.
- Choose whether or not each export.folder is public or private with pub: true or pub: false.
If you are interested in linking Android devices, it may be necessary to bind the nodejs server to your physical server's local IP address, instead of 127.0.0.1 (which represents the loopback interface). If you are having trouble connecting with exports.listen[host]=127.0.0.1, try doing this. For example:
exports.listen = {
port: 3000,
host: '192.168.1.100'
};
Once this change is made, requests from your router will be acknowledged by the nodejs server, so long as you have also forwarded port 3000 of your router to the 'host' you just configured. Be aware that if your server uses DHCP, its local IP may easily change, so setting up a reserved IP address in your router for your server and/or configuring the network interface manually may be necessary.
This variable is the text that will appear in actual href tags on the dashboard web site. In other words, it controls what is displayed above the QR code when linking a device, and is placed within all anchor tags linking to the dashboard web site. It doesn't really matter what you put here, the server will still work; however, clicking links on the page will not take you to the right URL. If configured properly, you should be able to make this value the value of your DNS hostname.
exports.basepath = '';
exports.externalUrl = 'http://site.host.com:3000';
exports.basepath can be ignored unless you are hosting the dashboard under Apache or nginx. See Config for more information.
Original config.js: [https://github.com/hbons/SparkleShare-Dashboard/blob/master/config.js]
You're now ready to launch SparkleShare-Dashboard with
$ make run
or if you do not have GNU Make
$ NODE_ENV=production node app.js
If you want more verbose error pages
$ make rundev
Note: Make sure the redis service is started, if applicable for your distribution. Otherwise, make run will offer an error: connection refused.
See ProxyServer for more information on setting running a genuine webserver like nginx or apache.
Please read How-to-report-issues
The folders you want to use must be specified in config.js under exports.folders. Note that these must be bare repositories. It's common practice to have the directory name end in .git, which 'git clone' does for you.
$ git clone --bare <url>
The repository should be fully initialized, e.g. have at least one commit. And should obviously be readable by the user running the dashboard.