GitBook: [master] 86 pages and 110 assets modified
This commit is contained in:
9
docs/english-documentation/introduction/README.md
Normal file
9
docs/english-documentation/introduction/README.md
Normal file
@@ -0,0 +1,9 @@
|
||||
# Installation
|
||||
|
||||
These are our recommendations for the different environments and purposes:
|
||||
|
||||
* To setup CONSUL for a production environment we recommend using the [installer](https://github.com/consul/installer).
|
||||
* For developers working on a CONSUL fork we recommend using a UNIX based system \(Linux or Mac\) and installing CONSUL [locally system wide](local_installation/).
|
||||
* If you run into problems configuring CONSUL locally system wide and would like to show CONSUL for demo purposes we recommend using [Docker](servers/docker.md) in a local machine.
|
||||
* We also have a [Heroku guide](../../spanish-documentation/introduction/servers/deploying-on-heroku.md) which can be used for demo purposes in a remote server.
|
||||
|
||||
@@ -0,0 +1,81 @@
|
||||
# Basic configuration
|
||||
|
||||
Once you have CONSUL running on the server, there are some basic configuration options that you probably want to define in order to start using it. To do this you will need to open your CONSUL installation through any internet browser and log in with the administration user \(initially it is the `admin@consul.dev` user with the password `12345678`\).
|
||||
|
||||
Once you have logged in you will see on the top right of the screen the "Admin" link that will take you to the administration interface. From this interface you can configure the following basic options:
|
||||
|
||||
## Global configuration parameters
|
||||
|
||||
In the side menu you will find the option "Settings" and then the submenu "Global Settings". Here you will find many interesting parameters, but at the moment we recommend you to define some of the most basic ones. Later, when you are more familiar with the tool, you will be able to reconfigure other parameters:
|
||||
|
||||
* Site name. This name will appear in the subject of emails, help pages...
|
||||
* Sender email name. This name will appear as the name of the sender in the emails sent from the application. As for example the email that the users receive to confirm that they have created their account.
|
||||
* Sender email address. This email address will appear in the emails sent from the application.
|
||||
* Main URL. Main URL of your website
|
||||
* Minimum age needed to participate. If you use a user verification system this will be the minimum age that users will be required to be. The user verification system will be discussed in more detail later.
|
||||
* Number of supports necessary for approval of a Proposal. If you use the citizen proposals section, you can define a minimum number of supports that the proposals need in order to be considered. Any user will be able to create proposals but only those that reach that value will be taken into account.
|
||||
* Level x public official . CONSUL allows some user accounts to be marked as "official accounts" and their interventions on the platform are highlighted. This for example is used in a city if you want to define accounts for the Mayor, Councillors, etc. This public official option will allow you to define the official label that appears next to the user names of these accounts from most important \(level 1\) to least \(level 5\).
|
||||
|
||||
## Categories of proposals
|
||||
|
||||
When users create proposals on the platform, a few general categories are suggested to help organize the proposals. To define these categories you can go to the "Global Settings" menu and then to the "Proposal Topics" submenu. At the top you can write topics and create them with the button below.
|
||||
|
||||
## Definition of Geozones
|
||||
|
||||
Geozones are smaller territorial areas than the area in which you use CONSUL \(e.g. districts in a city in which CONSUL is used\). If the geozones are activated, it will allow for example that the citizen proposals are assigned to a specific area, or that the votings are restricted to people living in some area.
|
||||
|
||||
In the side menu you will find the option "Settings" and then the submenu "Manage geozones". To the right the button "Create geozone" will allow you to create new geozones. Only the name is necessary to define them, but you can add other data that are useful in certain sections. Initially we recommend that you start by defining only the names of the zones.
|
||||
|
||||
Once defined if you create a citizen proposal you will see how one of the options in the proposal creation form allows you to choose if your proposal refers to a specific geozone.
|
||||
|
||||
If you activate the geozones you can also display an image that represents the area with the zones. You can change this image in the "Global settings" menu in the "Customize images" submenu. The default image you can change is the one titled "map".
|
||||
|
||||
## Map to geolocate proposals
|
||||
|
||||
You can allow users to place proposals on a map when creating proposals. To do this you have to define which map you want to show.
|
||||
First go to the "Settings" menu and to the "Global Settings" submenu. There you will find three parameters that you will have to fill in:
|
||||
|
||||
* Latitude. Latitude to show the map position
|
||||
* Length. Length to show the map position
|
||||
* Zoom. Zoom to show the position of the map. You can try an initial value and then change it later.
|
||||
|
||||
At the top of this page you will find three tabs: "Configuration settings", "Features", "Map configuration". Now go to the second tab "Features".
|
||||
|
||||
On this page you will find one of the functionalities titled "Proposals and budget investments geolocation ". The message "Functionality enabled" should appear on your right. If not, click on the "Enable" button.
|
||||
|
||||
Then, at the top of this page, go to the "Map configuration" tab. If everything has been configured correctly you will see here the map centered on the latitude and longitude you entered before. You can correctly center the map and change the zoom level directly on the map by clicking on the "Update" button below it.
|
||||
|
||||
## Emails to users
|
||||
|
||||
CONSUL sends a series of emails to users by default. For example when creating a user account, trying to recover a password, receiving a message from another user, etc.
|
||||
|
||||
All emails sent can be viewed in the menu "Messages to users" in the submenu "System Emails". There you will be able to preview each email and see the file where the content of the email is in case you want to change it.
|
||||
|
||||
## Basic information pages
|
||||
|
||||
CONSUL has a number of basic information pages that will be shown to users, e.g. "Privacy Policy", "Frequently Asked Questions", "Congratulations you have just created your user account", etc.
|
||||
|
||||
You can see the pages that exist by default and modify them in the menu "Site Content" in the submenu "Custom Pages".
|
||||
|
||||
## Main page of the site
|
||||
|
||||
When users open your CONSUL installation they will see the home page of the platform. This page is fully configurable, so that you can show the content that seems most relevant to you. You can modify it from the menu "Site content" in the submenu "Homepage".
|
||||
|
||||
Try creating "Headers" and "Cards" and activating the different functionalities you will find below to see the effect they have on your homepage.
|
||||
|
||||
## Platform texts
|
||||
|
||||
If you access the menu "Site content" and the submenu "Custom information texts" you will see different tabs with a series of texts. These are all the texts displayed on the platform. By default you can use the existing ones, but at any time you can access this section to modify any of the texts.
|
||||
|
||||
For more information on how to add new translations to your version of CONSUL access the "Texts and translations" section of this documentation.
|
||||
|
||||
## Channels of participation
|
||||
|
||||
By default you will find in CONSUL different ways of participation for users. To begin with and familiarise yourself with the tool, we recommend that you have all of them activated, but you can deactivate the ones that do not seem necessary to you. To do this, go to the "Settings" menu and then to the "Global Settings" submenu. At the top of this page you will find three tabs: "Configuration settings", "Features", "Map configuration". Go to the second tab "Features".
|
||||
|
||||
You will find different functionalities with the names of the different participation channels "Debates", "Proposals", "Voting", "Collaborative Legislation" and "Participatory Budgets". You can deactivate any of the functionalities and it will no longer be shown in your CONSUL installation.
|
||||
|
||||
### More information and detailed documentation
|
||||
|
||||
These options above will allow you to have a basic version of CONSUL to start using. We recommend that you access the [CONSUL Documentation and Guides](documentation_and_guides.md) section where you can find more detailed documentation.
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
# CONSUL Documentation and guides
|
||||
|
||||
There are several guides where you can read very detailed information about CONSUL and its possibilities. You can find them all at: [http://consulproject.org/en/\#documentation](http://consulproject.org/en/#documentation)
|
||||
|
||||
* **CONSUL Use Guide**. In this guide you can see different ways to use CONSUL and examples of participation processes.
|
||||
* **CONSUL Administration Guide**. This guide contains detailed information on the administration and management of CONSUL.
|
||||
* **CONSUL Communication Guide**. This guide can give you an initial idea of how to plan communication campaigns to invite people to use your CONSUL platform. Communication is a key issue in getting relevant participation and engagement.
|
||||
|
||||
In addition to these guides you can access the [CONSUL Community](http://community.consulproject.org/), a discussion space to share more documentation, questions, learning, etc.
|
||||
|
||||
@@ -0,0 +1,74 @@
|
||||
# Local installation
|
||||
|
||||
Before installing Consul and having it up and running make sure you all [prerequisites](prerequisites.md) installed.
|
||||
|
||||
1. First, clone the [Consul Github repository](https://github.com/consul/consul/) and enter the project folder:
|
||||
|
||||
```bash
|
||||
git clone https://github.com/consul/consul.git
|
||||
cd consul
|
||||
```
|
||||
|
||||
1. Install the Ruby version we need with your Ruby version manager. Here are some examples:
|
||||
|
||||
```bash
|
||||
rvm install `cat .ruby-version` # If you're using RVM
|
||||
rbenv install `cat .ruby-version` # If you're using rbenv
|
||||
asdf install ruby `cat .ruby-version` # If you're using asdf
|
||||
```
|
||||
|
||||
1. Check we're using the Ruby version we've just installed:
|
||||
|
||||
```bash
|
||||
ruby -v
|
||||
=> # (it should be the same as the version in the .ruby-version file)
|
||||
```
|
||||
|
||||
1. Install [Bundler](http://bundler.io/):
|
||||
|
||||
```bash
|
||||
gem install bundler --version 1.17.1
|
||||
```
|
||||
|
||||
1. Install the required gems using Bundler:
|
||||
|
||||
```bash
|
||||
bundle
|
||||
```
|
||||
|
||||
1. Copy the environment example configuration files inside new readable ones:
|
||||
|
||||
```bash
|
||||
cp config/database.yml.example config/database.yml
|
||||
cp config/secrets.yml.example config/secrets.yml
|
||||
```
|
||||
|
||||
And setup database credentials with your `consul` user in your new `database.yml` file.
|
||||
|
||||
1. Run the following [Rake tasks](https://github.com/ruby/rake) to create and fill your local database with the minimum data needed to run the application:
|
||||
|
||||
```bash
|
||||
rake db:create
|
||||
rake db:setup
|
||||
rake db:dev_seed
|
||||
rake db:test:prepare
|
||||
```
|
||||
|
||||
1. Check everything is fine by running the test suite \(beware it might take more than an hour\):
|
||||
|
||||
```bash
|
||||
bin/rspec
|
||||
```
|
||||
|
||||
1. Now you have all set, run the application:
|
||||
|
||||
```bash
|
||||
bin/rails s
|
||||
```
|
||||
|
||||
Congratulations! Your local Consul application will be running now at `http://localhost:3000`.
|
||||
|
||||
In case you want to access the local application as admin, a default user verified and with admin permissions was created by the seed files with **username** `admin@consul.dev` and **password** `12345678`.
|
||||
|
||||
If you need an specific user to perform actions such as voting without admin permissions, a default verified user is also available with **username** `verified@consul.dev` and **password** `12345678`.
|
||||
|
||||
@@ -0,0 +1,167 @@
|
||||
# Debian Linux
|
||||
|
||||
## Configuration for development and test environments \(Debian GNU/Linux 9.8\)
|
||||
|
||||
## Superuser
|
||||
|
||||
Note that 'sudo' is not installed by default in Debian. It's possible to install and configure it, you can find information [here](https://wiki.debian.org/sudo). But we don't recommend it cause you may have other problems. We recommend running the following commands as a superuser, so make sure the very first command you run is:
|
||||
|
||||
```text
|
||||
su
|
||||
```
|
||||
|
||||
> For [Vagrant](vagrant.md) run:
|
||||
>
|
||||
> ```text
|
||||
> sudo su -
|
||||
> ```
|
||||
|
||||
## System update
|
||||
|
||||
Run a general system update:
|
||||
|
||||
```bash
|
||||
apt-get update
|
||||
```
|
||||
|
||||
## Git
|
||||
|
||||
Git is officially maintained in Debian:
|
||||
|
||||
```text
|
||||
apt-get install git
|
||||
```
|
||||
|
||||
## Curl
|
||||
|
||||
Curl is officially maintained in Debian:
|
||||
|
||||
```text
|
||||
apt-get install curl
|
||||
```
|
||||
|
||||
## Ruby version manager
|
||||
|
||||
Ruby versions packaged in official repositories are not suitable to work with consul, so we'll have to install it manually.
|
||||
|
||||
One possible tool is rvm:
|
||||
|
||||
### As a local user
|
||||
|
||||
```text
|
||||
command curl -sSL https://rvm.io/mpapis.asc | gpg --import -
|
||||
command curl -sSL https://rvm.io/pkuczynski.asc | gpg --import -
|
||||
curl -L https://get.rvm.io | bash -s stable
|
||||
```
|
||||
|
||||
then add rvm script source to user's bash \(~/.bashrc\) \(this step is only necessary if you can't execute the rvm command\)
|
||||
|
||||
```text
|
||||
[[ -s /usr/local/rvm/scripts/rvm ]] && source /usr/local/rvm/scripts/rvm
|
||||
```
|
||||
|
||||
and finally, reload .bashrc to be able to run RVM
|
||||
|
||||
```text
|
||||
source ~/.bashrc
|
||||
```
|
||||
|
||||
## Node.js
|
||||
|
||||
To compile the assets, you'll need a JavaScript runtime. Node.js is the preferred option. As with Ruby, we don't recommend installing Node from your distro's repositories.
|
||||
|
||||
To install it, you can use [n](https://github.com/tj/n)
|
||||
|
||||
Run the following command on your terminal:
|
||||
|
||||
```text
|
||||
curl -L https://git.io/n-install | bash -s -- -y lts
|
||||
```
|
||||
|
||||
And it will install the latest LTS \(Long Term Support\) Node version on your `$HOME` folder automatically \(This makes use of [n-install](https://github.com/mklement0/n-install)\)
|
||||
|
||||
Reload .bashrc to be able to run node
|
||||
|
||||
```text
|
||||
source /root/.bashrc
|
||||
```
|
||||
|
||||
Check it's correctly installed by running:
|
||||
|
||||
```text
|
||||
node -v
|
||||
```
|
||||
|
||||
## PostgreSQL \(>=9.4\)
|
||||
|
||||
PostgreSQL version 9.4 is not official in debian 9.
|
||||
|
||||
So you have to add a repository, the official postgresql works fine.
|
||||
|
||||
Add the repository to apt, for example creating file _/etc/apt/sources.list.d/pgdg.list_ with:
|
||||
|
||||
```text
|
||||
deb http://security.debian.org/debian-security jessie/updates main
|
||||
```
|
||||
|
||||
afterwards you'll have to download the key, and install it, by:
|
||||
|
||||
```text
|
||||
wget https://www.postgresql.org/media/keys/ACCC4CF8.asc
|
||||
apt-key add ACCC4CF8.asc
|
||||
```
|
||||
|
||||
and install postgresql
|
||||
|
||||
```text
|
||||
apt-get update
|
||||
apt-get install postgresql-9.4 postgresql-server-dev-9.4 postgresql-contrib-9.4
|
||||
```
|
||||
|
||||
You also need to configure a user for your database. As an example, we'll choose the username "consul":
|
||||
|
||||
```text
|
||||
su - postgres
|
||||
|
||||
createuser consul --createdb --superuser --pwprompt
|
||||
|
||||
exit
|
||||
```
|
||||
|
||||
## Imagemagick
|
||||
|
||||
Install Imagemagick:
|
||||
|
||||
```bash
|
||||
apt-get install imagemagick
|
||||
```
|
||||
|
||||
## ChromeDriver
|
||||
|
||||
To run E2E integration tests, we use Selenium along with Headless Chrome.
|
||||
|
||||
To get it working, install the chromedriver package:
|
||||
|
||||
```bash
|
||||
apt-get install chromedriver
|
||||
ln -s /usr/lib/chromedriver /usr/local/bin/
|
||||
```
|
||||
|
||||
Make sure it's working as expected by running the following command:
|
||||
|
||||
```bash
|
||||
chromedriver --version
|
||||
```
|
||||
|
||||
You should receive an output with the latest version of ChromeDriver. If that's the case, you're good to go!
|
||||
|
||||
If you are using an Arch-based distro, installing `chromium` from the `extra` repository should be sufficient.
|
||||
|
||||
You also have the option of just installing ChromeDriver from AUR. If you use `pacaur`, run the following command:
|
||||
|
||||
```bash
|
||||
pacaur -S chromedriver
|
||||
```
|
||||
|
||||
Now you're ready to go get Consul [installed](./)!!
|
||||
|
||||
@@ -0,0 +1,104 @@
|
||||
# MacOS
|
||||
|
||||
## Homebrew
|
||||
|
||||
Homebrew is a very popular package manager for OS X. It's advised to use it since it makes the installation of some of the dependencies much easier.
|
||||
|
||||
You can find the installation instructions at: [brew.sh](http://brew.sh)
|
||||
|
||||
## XCode and XCode Command Line Tools
|
||||
|
||||
To install _git_ you'll first need to install _Xcode_ \(download it from the Mac App Store\) and its _Xcode Command Line Tools_ \(you can install them from the Xcode's app menu\)
|
||||
|
||||
## Git and Github
|
||||
|
||||
You can download git from: [git-scm.com/download/mac](https://git-scm.com/download/mac)
|
||||
|
||||
## Ruby version manager
|
||||
|
||||
OS X already comes with a preinstalled Ruby version, but it's quite old and we need a newer one. One of the multiple ways of installing Ruby in OS X is through _rbenv_. The installation instructions are in its GitHub repository and are pretty straight-forward:
|
||||
|
||||
[github.com/rbenv/rbenv](https://github.com/rbenv/rbenv)
|
||||
|
||||
## Node.js
|
||||
|
||||
To compile the assets, you'll need a JavaScript runtime. OS X comes with an integrated runtime called `Apple JavaScriptCore` but Node.js is the preferred option.
|
||||
|
||||
To install it, you can use [n](https://github.com/tj/n)
|
||||
|
||||
Run the following command on your terminal:
|
||||
|
||||
```text
|
||||
curl -L https://git.io/n-install | bash -s -- -y lts
|
||||
```
|
||||
|
||||
And it will install the latest LTS \(Long Term Support\) Node version on your `$HOME` folder automatically \(This makes use of [n-install](https://github.com/mklement0/n-install)\)
|
||||
|
||||
## PostgreSQL \(>=9.4\)
|
||||
|
||||
```text
|
||||
brew install postgres
|
||||
```
|
||||
|
||||
Once installed, we need to _initialize_ it:
|
||||
|
||||
```text
|
||||
initdb /usr/local/var/postgres
|
||||
```
|
||||
|
||||
Now we're going to configure some things related to the _default user_. First we start postgres server with:
|
||||
|
||||
```text
|
||||
postgres -D /usr/local/var/postgres
|
||||
```
|
||||
|
||||
At this point we're supposed to have postgres correctly installed and a default user will automatically be created \(whose name will match our username\). This user hasn't got a password yet.
|
||||
|
||||
If we run `psql` we'll login into the postgres console with the default user. Probably it will fail since its required that a default database exists for that user. We can create it by typing:
|
||||
|
||||
```text
|
||||
createdb 'your_username'
|
||||
```
|
||||
|
||||
If we run `psql` again we should now get access to postgres console. With `\du` you can see the current users list.
|
||||
|
||||
In case you want to set a password for your user you can make it throught postgres console by:
|
||||
|
||||
```text
|
||||
ALTER USER your_username WITH PASSWORD 'your_password';
|
||||
```
|
||||
|
||||
Now we'll create the _consul_ user, the one the application is using. Run in postgres console:
|
||||
|
||||
```text
|
||||
CREATE ROLE consul WITH PASSWORD '000';
|
||||
ALTER ROLE consul WITH SUPERUSER;
|
||||
ALTER ROLE consul WITH login;
|
||||
```
|
||||
|
||||
If at any point during PostgreSQL installation you feel you have messed things up, you can uninstall it and start again by running:
|
||||
|
||||
```text
|
||||
brew uninstall postgres
|
||||
```
|
||||
|
||||
You'll have to delete also this directory \(otherwise the new installation will generate conflicts, source: [gist.github.com/lxneng/741932](https://gist.github.com/lxneng/741932)\):
|
||||
|
||||
```text
|
||||
rm -rf /usr/local/var/postgres
|
||||
```
|
||||
|
||||
## ChromeDriver
|
||||
|
||||
```text
|
||||
brew install chromedriver
|
||||
```
|
||||
|
||||
## Imagemagick
|
||||
|
||||
```text
|
||||
brew install imagemagick
|
||||
```
|
||||
|
||||
Now that we have all the dependencies installed we can go ahead and [install Consul](./).
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
# Prerequisites
|
||||
|
||||
* [Ubuntu Linux](ubuntu.md)
|
||||
* [Debian Linux](debian.md)
|
||||
* [MacOS](macos.md)
|
||||
* [Windows](windows.md)
|
||||
|
||||
@@ -0,0 +1,114 @@
|
||||
# Ubuntu Linux
|
||||
|
||||
## Configuration for development and test environments \(Ubuntu 18.04\)
|
||||
|
||||
## System update
|
||||
|
||||
Run a general system update:
|
||||
|
||||
```bash
|
||||
sudo apt update
|
||||
```
|
||||
|
||||
## Git
|
||||
|
||||
Git is officially maintained in Ubuntu:
|
||||
|
||||
```bash
|
||||
sudo apt install git
|
||||
```
|
||||
|
||||
## Ruby version manager
|
||||
|
||||
Ruby versions packaged in official repositories are not suitable to work with CONSUL, so we'll have to install it manually.
|
||||
|
||||
First, we need to install Ruby's development dependencies:
|
||||
|
||||
```bash
|
||||
sudo apt install libssl-dev autoconf bison build-essential libyaml-dev libreadline6-dev zlib1g-dev libncurses5-dev libffi-dev libgdbm5 libgdbm-dev
|
||||
```
|
||||
|
||||
The next step is installing a Ruby version manager, like rbenv:
|
||||
|
||||
```bash
|
||||
wget -q https://github.com/rbenv/rbenv-installer/raw/master/bin/rbenv-installer -O- | bash
|
||||
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc
|
||||
echo 'eval "$(rbenv init -)"' >> ~/.bashrc
|
||||
source ~/.bashrc
|
||||
```
|
||||
|
||||
## Node.js
|
||||
|
||||
To compile the assets, you'll need a JavaScript runtime. Node.js is the preferred option.
|
||||
|
||||
Run the following command on your terminal:
|
||||
|
||||
```bash
|
||||
sudo apt install nodejs
|
||||
```
|
||||
|
||||
## PostgreSQL
|
||||
|
||||
Install postgresql and its development dependencies with:
|
||||
|
||||
```bash
|
||||
sudo apt install postgresql libpq-dev
|
||||
```
|
||||
|
||||
You also need to configure a user for your database. As an example, we'll choose the username "consul":
|
||||
|
||||
```bash
|
||||
sudo -u postgres createuser consul --createdb --superuser --pwprompt
|
||||
```
|
||||
|
||||
To make sure the UTF-8 enconding is used, create a file:
|
||||
|
||||
```text
|
||||
sudo nano /etc/profile.d/lang.sh
|
||||
```
|
||||
|
||||
Add the following:
|
||||
|
||||
```text
|
||||
export LANGUAGE="en_US.UTF-8"
|
||||
export LANG="en_US.UTF-8"
|
||||
export LC_ALL="en_US.UTF-8"
|
||||
```
|
||||
|
||||
Reconfigure Postgres to use the UTF-8 encoding:
|
||||
|
||||
```text
|
||||
sudo su - postgres
|
||||
psql
|
||||
|
||||
update pg_database set datistemplate=false where datname='template1';
|
||||
drop database Template1;
|
||||
create database template1 with owner=postgres encoding='UTF-8'
|
||||
lc_collate='en_US.utf8' lc_ctype='en_US.utf8' template template0;
|
||||
update pg_database set datistemplate=true where datname='template1';
|
||||
|
||||
\q
|
||||
exit
|
||||
```
|
||||
|
||||
## Imagemagick
|
||||
|
||||
Install Imagemagick:
|
||||
|
||||
```bash
|
||||
sudo apt install imagemagick
|
||||
```
|
||||
|
||||
## ChromeDriver
|
||||
|
||||
To run E2E integration tests, we use Selenium along with Headless Chrome.
|
||||
|
||||
To get it working, install the chromium-chromedriver package and make sure it's available on your shell's PATH:
|
||||
|
||||
```bash
|
||||
sudo apt install chromium-chromedriver
|
||||
sudo ln -s /usr/lib/chromium-browser/chromedriver /usr/local/bin/
|
||||
```
|
||||
|
||||
Now you're ready to go [get CONSUL installed](./)!
|
||||
|
||||
@@ -0,0 +1,48 @@
|
||||
# Vagrant
|
||||
|
||||
## Vagrant
|
||||
|
||||
Install [Vagrant](https://www.vagrantup.com/) and setup a virtual machine with [Linux](prerequisites.md)
|
||||
|
||||
Vagrant is compatible for [Debian](debian.md) and [Ubuntu](ubuntu.md).
|
||||
|
||||
### Browser configuration
|
||||
|
||||
To access the application through the brower at `localhost:3000` we must forward a port and run the rails server with a binding option:
|
||||
|
||||
### Port forwarding
|
||||
|
||||
Open the Vagrant configuration file:
|
||||
|
||||
```text
|
||||
nano Vagranfile
|
||||
```
|
||||
|
||||
Find this line:
|
||||
|
||||
```text
|
||||
# config.vm.network "forwarded_port", guest: 80, host: 8080
|
||||
```
|
||||
|
||||
And change it for this configuration:
|
||||
|
||||
```text
|
||||
config.vm.network "forwarded_port", guest: 3000, host: 3000
|
||||
```
|
||||
|
||||
Reload your virtual machine:
|
||||
|
||||
```text
|
||||
vagrant reload
|
||||
```
|
||||
|
||||
## Running the rails server
|
||||
|
||||
In your virtual machine, run the application server, binding to your local ip address:
|
||||
|
||||
```text
|
||||
bin/rails s -b 0.0.0.0
|
||||
```
|
||||
|
||||
Now you should be able to see the application running in your browser at url `localhost:3000`! :tada:
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
# Windows
|
||||
|
||||
Windows is not yet officially supported. Please install [Virtual Box](https://www.virtualbox.org/) to setup a virtual machine in [Linux](prerequisites.md).
|
||||
|
||||
22
docs/english-documentation/introduction/servers/README.md
Normal file
22
docs/english-documentation/introduction/servers/README.md
Normal file
@@ -0,0 +1,22 @@
|
||||
# Production and Staging servers
|
||||
|
||||
## Recommended Minimum System Requirements:
|
||||
|
||||
### 1. Production Server:
|
||||
|
||||
* Distribution: Ubuntu 16.04.X
|
||||
* RAM: 32GB
|
||||
* Processor: Quad core
|
||||
* Hard Drive: 20 GB
|
||||
* Database: Postgres
|
||||
|
||||
### 2. Staging Server:
|
||||
|
||||
* Distribution: Ubuntu 16.04.X
|
||||
* RAM: 16GB
|
||||
* Processor: Dual core
|
||||
* Hard Drive: 20 GB
|
||||
* Database: Postgres
|
||||
|
||||
If your city has a population of over 1.000.000, consider balancing your load using 2-3 production servers and a separate server for the database.
|
||||
|
||||
@@ -0,0 +1,81 @@
|
||||
# Create a deploy user
|
||||
|
||||
[The installer](https://github.com/consul/installer) by default connects as the `root` user only to create a `deploy` user. This `deploy` user is the one who installs all libraries. If you do not have `root` access, please ask your system administrator to follow these instructions to create a user manually.
|
||||
|
||||
You could create a user called `deploy` or any other name. As as example, we are going to create a user named `jupiter`.
|
||||
|
||||
```text
|
||||
adduser jupiter
|
||||
```
|
||||
|
||||
I'm using jupiter as the user name, you should change that for whatever makes sense to you. Input a password when prompted, and just leave empty the rest of the options.
|
||||
|
||||
Let's create a `wheel` group and add the user `jupiter` to this group.
|
||||
|
||||
```text
|
||||
sudo groupadd wheel
|
||||
sudo usermod -a -G wheel jupiter
|
||||
```
|
||||
|
||||
Now let's give sudo privileges to the `wheel` group and allow it to not use a password, this is important so that the installer doesn't get stalled waiting for a password.
|
||||
|
||||
First we open the sudoers file:
|
||||
|
||||
```text
|
||||
sudo visudo -f /etc/sudoers
|
||||
```
|
||||
|
||||
And we add this line at the end:
|
||||
|
||||
```text
|
||||
%wheel ALL=(ALL) NOPASSWD: ALL
|
||||
```
|
||||
|
||||
Now we need to give the keys of the server to the new user. Don’t close the server terminal window, because you can lock yourself out of your server if there is a mistake.
|
||||
|
||||
Let's create the necessary directory in the server to upload the public key:
|
||||
|
||||
```text
|
||||
su jupiter
|
||||
cd ~
|
||||
mkdir .ssh
|
||||
cd .ssh
|
||||
nano authorized_keys
|
||||
```
|
||||
|
||||
Make sure you have [generated a public key](generating_ssh_key.md) in your local terminal.
|
||||
|
||||
Open another local terminal window \(not in the server\) and type:
|
||||
|
||||
```text
|
||||
cat ~/.ssh/id_rsa.pub
|
||||
```
|
||||
|
||||
Copy the content of your public key to the file authorized\_keys that should still be open in the server.
|
||||
|
||||
Test that your user can log in by typing:
|
||||
|
||||
```text
|
||||
ssh jupiter@your-copied-ip-address
|
||||
```
|
||||
|
||||
You should see the server welcome page and a prompt like this:
|
||||
|
||||
```text
|
||||
jupiter@consulserver:~$
|
||||
```
|
||||
|
||||
Note the username at the prompt is not "root", but your username. So everything is fine and we can now block the root account from outside access and also stop allowing password access so only people with SSH keys can log in.
|
||||
|
||||
Type the following command to edit the SSH config file of the server:
|
||||
|
||||
```text
|
||||
sudo nano /etc/ssh/sshd_config
|
||||
```
|
||||
|
||||
Look for the "PasswordAuthentication yes" line and change it to "PasswordAuthentication no". Type Control-K to close the nano editor and type:
|
||||
|
||||
```text
|
||||
sudo service ssh restart
|
||||
```
|
||||
|
||||
@@ -0,0 +1,53 @@
|
||||
# Development Mail Server
|
||||
|
||||
This is a example to how integrate a mailing service with a development environment of Consul.
|
||||
|
||||
In this example we used [Mailgun](https://www.mailgun.com/).
|
||||
|
||||
## Create an account in Mailgun
|
||||
|
||||

|
||||
|
||||
* Skip the credit card form
|
||||
* And activate your account with the link sent by email
|
||||
|
||||
## Domain configuration
|
||||
|
||||
* Go to the Domains section: 
|
||||
* Since you don't have a domain yet, you should click in the sandbox that is already created;
|
||||
* Remember the next credentials:
|
||||
|
||||

|
||||
|
||||
## Consul mailing configuration for development environment
|
||||
|
||||
* Go to `config/environments/development.rb` file;
|
||||
* Add the lines on the file to configure the mail server:
|
||||
|
||||
```ruby
|
||||
config.action_mailer.delivery_method = :smtp
|
||||
config.action_mailer.perform_deliveries = true
|
||||
config.action_mailer.smtp_settings = {
|
||||
:address => '',
|
||||
:port => 2525,
|
||||
:domain => '',
|
||||
:user_name => '',
|
||||
:password => '',
|
||||
:authentication => :plain,
|
||||
:enable_starttls_auto => true,
|
||||
:ssl => false
|
||||
}
|
||||
```
|
||||
|
||||
* Fill, `address`, `domain`, `user_name`, `password` with your information. The file would look like:
|
||||
|
||||

|
||||
|
||||
## Consul mailing configuration for production environment
|
||||
|
||||
* Go to `config/environments/production.rb` file.
|
||||
* Add the same **action mailer settings** configuration, but now with your production mail server information.
|
||||
* Pay attention because you will need to change the **port** number to **587**.
|
||||
|
||||
You can also use Mailgun to production, adding your custom domain. Mailgun’s logs sent and delivered emails.
|
||||
|
||||
@@ -0,0 +1,60 @@
|
||||
# Digital Ocean
|
||||
|
||||
These instructions will help you register and buy a server in Digital Ocean to install CONSUL.
|
||||
|
||||
First you need to [sign up](https://cloud.digitalocean.com/registrations/new) and provide your personal information.
|
||||
|
||||
Once you are logged in, you need to create a Droplet \(that’s the name that Digital Ocean uses for a Virtual Server\). Click on the “Create” green button at the top of the page and select "Droplets":
|
||||
|
||||

|
||||
|
||||
In the next page, you need to select Ubuntu \(it should be pre-selected\) and change the version **from 18.04 x64 to 16.04 x64**.
|
||||
|
||||

|
||||
|
||||
In the "Choose a size" section select the **$80/mo 16GB/6CPUs** option if this is going to be a production server. If you are just setting up a test system with a few users the cheapest $5/mo option can be enough.
|
||||
|
||||

|
||||
|
||||
Leave the rest of the options with their defaults until “Choose a datacenter”. Select the one that will be geographically closer to your users. If you are in the EU, select either Frankfurt or Amsterdam data centers.
|
||||
|
||||

|
||||
|
||||
In the "Add you SSH keys" section click "New SSH Key" button.
|
||||
|
||||

|
||||
|
||||
In the pop up window that appears you need to copy and paste the public key that we [generated in the previous step](generating_ssh_key.md). To see the content of this key in the terminal window type:
|
||||
|
||||
```text
|
||||
cat ~/.ssh/id_rsa.pub
|
||||
```
|
||||
|
||||
You should see a text like this:
|
||||
|
||||
```text
|
||||
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDy/BXU0OsK8KLLXpd7tVnqDU+d4ZS2RHQmH+hv0BFFdP6PmUbKdBDigRqG6W3QBexB2DpVcb/bmHlfhzDlIHJn/oki+SmUYLSWWTWuSeF/1N7kWf9Ebisk6hiBkh5+i0oIJYvAUsNm9wCayQ+i3U3NjuB25HbgtyjR3jDPIhmg1xv0KZ8yeVcU+WJth0pIvwq+t4vlZbwhm/t2ah8O7hWnbaGV/MZUcj0/wFuiad98yk2MLGciV6XIIq+MMIEWjrrt933wAgzEB8vgn9acrDloJNvqx25uNMpDbmoNXJ8+/P3UDkp465jmejVd/6bRaObXplu2zTv9wDO48ZpsaACP your_username@your_computer_name
|
||||
```
|
||||
|
||||
Select and copy all the text and paste it in the pop-up window like this:
|
||||
|
||||

|
||||
|
||||
Please note that there will be two little green checks. If they are not there, retry copying the text because you probably left something out. Give your key a meaningful name, like **CONSUL\_key** and click "Add SSH Key" button.
|
||||
|
||||
By using an SSH key instead of a user/password combination to access your server, it will be much more secure, as only someone with the private SSH key can access the server.
|
||||
|
||||
Now in the "Choose a hostname" section change the default for something more meaningful, like **consulserver** for example.
|
||||
|
||||

|
||||
|
||||
At the bottom of the page you’ll see a summary of your options. Check that everything is OK and click the big green "Create" button.
|
||||
|
||||

|
||||
|
||||
It will take a few minutes, and at the end you will have a shiny new server. It will look like this in the Digital Ocean page:
|
||||
|
||||

|
||||
|
||||
Next to setup CONSUL in the server check the [installer's README](https://github.com/consul/installer)
|
||||
|
||||
152
docs/english-documentation/introduction/servers/docker.md
Normal file
152
docs/english-documentation/introduction/servers/docker.md
Normal file
@@ -0,0 +1,152 @@
|
||||
# Docker
|
||||
|
||||
You can use Docker to have a local CONSUL installation for development if:
|
||||
|
||||
* You're having troubles having [prerequisites](../local_installation/prerequisites.md) installed.
|
||||
* You want to do a quick local installation just to try CONSUL or make a demo.
|
||||
* You prefer not to interfer with other rails installations.
|
||||
|
||||
## Prerequisites
|
||||
|
||||
You should have installed Docker and Docker Compose in your machine:
|
||||
|
||||
### macOS
|
||||
|
||||
You can follow the [official docker install](https://docs.docker.com/docker-for-mac/install/)
|
||||
|
||||
Or if you have [homebrew](http://brew.sh) and [cask](https://caskroom.github.io/) installed you can just:
|
||||
|
||||
```bash
|
||||
brew install docker
|
||||
brew install docker-compose
|
||||
brew cask install docker
|
||||
open -a docker
|
||||
```
|
||||
|
||||
You'll be asked to give Docker app permissions and type your password, then you're set.
|
||||
|
||||
### Linux
|
||||
|
||||
1. Install Docker:
|
||||
|
||||
```bash
|
||||
sudo apt-get update
|
||||
sudo apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D
|
||||
sudo apt-add-repository 'deb https://apt.dockerproject.org/repo ubuntu-xenial main'
|
||||
sudo apt-get update
|
||||
apt-cache policy docker-engine
|
||||
sudo apt-get install -y docker-engine
|
||||
```
|
||||
|
||||
2. Install Docker Compose
|
||||
|
||||
```bash
|
||||
sudo curl -o /usr/local/bin/docker-compose -L "https://github.com/docker/compose/releases/download/1.15.0/docker-compose-$(uname -s)-$(uname -m)"
|
||||
sudo chmod +x /usr/local/bin/docker-compose
|
||||
```
|
||||
|
||||
### Windows
|
||||
|
||||
Pending to be completed... Contributions Welcome!
|
||||
|
||||
## Installation
|
||||
|
||||
Clone the repo on your computer and enter the folder:
|
||||
|
||||
```bash
|
||||
git clone git@github.com:consul/consul.git
|
||||
cd consul
|
||||
```
|
||||
|
||||
### macOS & Linux
|
||||
|
||||
Then lets create our secrets and database config files based on examples:
|
||||
|
||||
```bash
|
||||
cp config/secrets.yml.example config/secrets.yml
|
||||
cp config/database-docker.yml.example config/database.yml
|
||||
```
|
||||
|
||||
Then you'll have to build the container with:
|
||||
|
||||
```bash
|
||||
docker build -t consul .
|
||||
```
|
||||
|
||||
Create your app database images:
|
||||
|
||||
```bash
|
||||
docker-compose up -d database
|
||||
```
|
||||
|
||||
Once built you can initialize your development DB and populate it with:
|
||||
|
||||
```text
|
||||
docker-compose run app rake db:create
|
||||
docker-compose run app rake db:migrate
|
||||
docker-compose run app rake db:seed
|
||||
docker-compose run app rake db:dev_seed
|
||||
```
|
||||
|
||||
### Windows
|
||||
|
||||
Pending to be completed... Contributions Welcome!
|
||||
|
||||
## Running local CONSUL with Docker
|
||||
|
||||
### macOS & Linux
|
||||
|
||||
Now we can finally run the application with:
|
||||
|
||||
```bash
|
||||
docker-compose up
|
||||
```
|
||||
|
||||
And you'll be able to access it at your browser visiting [http://localhost:3000](http://localhost:3000)
|
||||
|
||||
Additionally, if you want to run the rails console just run in another terminal:
|
||||
|
||||
```bash
|
||||
docker-compose run app rails console
|
||||
```
|
||||
|
||||
To verify the containers are up execute:
|
||||
|
||||
```bash
|
||||
docker ps .
|
||||
```
|
||||
|
||||
You should see output similar to this: 
|
||||
|
||||
### Windows
|
||||
|
||||
Pending to be completed... Contributions Welcome!
|
||||
|
||||
## Having trouble?
|
||||
|
||||
Run these commands at **Consul's directory**, to erase all your previous Consul's Docker images and containers. Then restart the Docker [installation process](docker.md#installation):
|
||||
|
||||
1. Remove all CONSUL images:
|
||||
|
||||
```bash
|
||||
docker-compose down --rmi all -v --remove-orphans
|
||||
```
|
||||
|
||||
2. Remove all CONSUL containers
|
||||
|
||||
```bash
|
||||
docker-compose rm -f -s -v
|
||||
```
|
||||
|
||||
3. Verify if there is some container yet:
|
||||
|
||||
```bash
|
||||
docker ps -a
|
||||
```
|
||||
|
||||
Case positive, remove each one manually:
|
||||
|
||||
```bash
|
||||
docker container rm <container_id>
|
||||
```
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
# Generating SSH Key
|
||||
|
||||
These instructions will help you generate a public key with which you can connect to the server without using a password.
|
||||
|
||||
In the terminal window, type:
|
||||
|
||||
```text
|
||||
ssh-keygen
|
||||
```
|
||||
|
||||
When prompted for the file in which to save the key just press ENTER to leave the default. When prompted for a passphrase, just press ENTER again to leave this empty. At the end you should see a message like this:
|
||||
|
||||
```text
|
||||
Your identification has been saved in /your_home/.ssh/id_rsa.
|
||||
Your public key has been saved in /your_home/.ssh/id_rsa.pub.
|
||||
```
|
||||
|
||||
Take note of the **id\_rsa.pub** file location, because you’ll need the content of this file later.
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
# Installer
|
||||
|
||||
## Installation notes for Production and Staging servers
|
||||
|
||||
Check out the [installer's README](https://github.com/consul/installer)
|
||||
|
||||
Reference in New Issue
Block a user