-
Notifications
You must be signed in to change notification settings - Fork 616
[DEPRECATED] Installation
This is a quick reference to get DemocracyOS up and running.
- Requirements
- Install
-
Running
- [Running in a production environment](#running in a production environment)
- [OS specifics](#os specifics)
- Load data either through the admin module or by loading fixtures
- Troubleshooting
- Let us know
To get started with DemocracyOS, you will need to have installed:
- MongoDB open-source document database.
- NodeJS & NPM platform.
-
Git distributed version control system. If you're on github and don't have
git
, you're doing it wrong. - Make build automation utility.
- OpenSSL in case you want to generate SSL certificates.
DemocracyOS uses ComponentJS, a frontend package manager and build tool that grabs its dependencies from GitHub repositories. Due a GitHub quota limitation with anonymous requests, you may get a build error when running the initial make
. If you run into this issue, just follow the instructions from Component - Required Authentication, as instructed in the error logs). YOUR CODE WILL NOT BUILD IF YOU DON'T CONFIGURE THIS
Running on Windows environment is not currently supported. If you happen to be familiar with Docker or Vagrant, please lend us a hand and submit a PR so we can collaborate on a solution for this.
Finally, check your environment variables and read Environments and config files if something is not working properly.
When building node-gyp, make will fail throwing an error about python >= 3.0.0 not being supported. If you run python3 on your system, please pass the following command in your shell: $ npm config set python /path/to/executable/python2.7
- Fork or download this repository.
-
cd
to the project's location - Based on the
defaults.json
create your own configuration with the values you need to everride (e.g. config/development.json
) - Make sure MongoDB is running and reachable as configured in
config/development.json
. - Set the environment variable
NODE_PATH
with value:.
. - Make sure to set
GITHUB_USERNAME
&GITHUB_PASSWORD
according to the following guide - Install, Config and run the Notifier Server.
- From the root path, run
make
. (where is the Makefile) - For users behind corporate proxy, its recommended to redirect git clone to https (git config --global url."https://".insteadOf git://) and set properly http and https proxy env
Once DemocracyOS components and dependencies are installed, you can start the application like this:
make run
Take a look at the Makefile for more information about the possible tasks you can run.
You can check the current Democracy OS version running on http://localhost:3000/api
In case you want to use SSL in your dev environment (it's disabled by default), you'll need to have proper certificate files. We ship a script that generates the needed files. Just run the following command in the source path:
NODE_PATH=. node bin/dos-ssl
Then modify your configuration file by changing the protocol
property to https
and run it normally.
The default configuration file make the app listens to port 443 to handle SSL connections. In some OSs, a normal user cannot perform this operation, and you are likely to get this error:
events.js:72
throw er; // Unhandled 'error' event
^
Error: bind EACCES
at errnoException (net.js:904:11)
at net.js:1072:30
at Object.37:1 (cluster.js:594:5)
[...]
To solve it without being root (that is always a bad idea), you can change the ssl.port
value in your configuration file to another port, say 4443
.
- Configure your environment variables for production; specifically, set
NODE_ENV
toproduction
- Set your MongoDB instance to run as a service.
- Install and Config the Notifier Server.
- From the project's root path, you need to run
make
or: -
npm install
to install node dependencies. -
node ./bin/dos-install && node ./bin/dos-build && node index.js
to build and run the app. Don't run assudo
.
If something goes wrong you can always go back to a clean slate running make clean
. If you're running other node services in the same server and you can't compromise NODE_PATH
as an env variable, just prepend NODE_PATH=.
to the build & run command.
- Check this very detailed guide if you're on Ubuntu 10 LTS.
- On Ubuntu 14/13/lower, install the package
node-legacy
for NodeJS. - Check this guide on how to run DemocracyOS as a service.
In order for you to see a fully working deployment, you will need some sample data. This can be achieved by either of these approaches:
- Manually load sample fixtures bundled with DemocracyOS.
- Setup and access the administration module.
Symptom: You did make
and randomly got this error while downloading components:
fatal : no remote found for dependency "<dependency name>". Visit http://component.github.io/troubleshooting for help.
or a timeout error.
Solution: Refer to this page or do the following:
-
Generate a personal access token here.
-
Edit or create
~/.netrc
and append the following:
machine api.github.org
login yourgithublogin
password agianthashthatgithubgenerates
-
Append the following to
~/.bashrc
and~/.zshrc
(if exists):
export GITHUB_USERNAME="yourgithublogin" export GITHUB_PASSWORD="agianthashthatgithubgenerates"
4. Restart your computer.
## Let us know!
Don't forget to email Mair Williams (mair [at] democracyos.org) or Pia Mancini (pia [at] democracyos.org) if you are launching live instances of DemocracyOS so we can help you with communication from our networks. It's also easier for us to let you know about new features and progress if we know who's running the instances.
Visit our official website - Developed by Democracia en Red and contributors from the world over!