Update Debian local installation instructions

So now we install a specific version of Node.js and use the packages
required for Debian Bookworm.

For consistency, we're also making them similar to the Ubuntu
instructions and installing rbenv instead of RVM. Since we now suggest
rbenv in both cases as well as in the macOS instructions, we're also
listing rbenv as the first option in the generic local installation
instructions.
This commit is contained in:
Javi Martín
2024-08-06 15:30:20 +02:00
parent 7845c7f78d
commit b686489652
4 changed files with 77 additions and 195 deletions

View File

@@ -1,24 +1,31 @@
# Configuration for development and test environments (Debian GNU/Linux 9.8) # Configuration for development and test environments (Debian GNU/Linux 12 - Bookworm)
## Superuser ## 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: By default, in Debian no user can use `sudo` if a password for the root user was provided during the installation.
So, in order to install the project dependencies, we've got two options. The first option is opening a root shell. Run:
```bash ```bash
su su
``` ```
> For [Vagrant](/en/installation/vagrant.md) run: You'll be asked to introduce the password for the root user.
> ```
> sudo su - The second option is adding a regular user to the `sudo` group. For that, after opening a root shell, run:
> ```
```bash
gpasswd -a <your_username> sudo
```
You'll have to log out and log in again for these changes to take effect.
## System update ## System update
Run a general system update: Run a general system update:
```bash ```bash
apt-get update sudo apt update
``` ```
## Git ## Git
@@ -26,103 +33,55 @@ apt-get update
Git is officially maintained in Debian: Git is officially maintained in Debian:
```bash ```bash
apt-get install git sudo apt install git
```
## Curl
Curl is officially maintained in Debian:
```bash
apt-get install curl
``` ```
## Ruby version manager ## Ruby version manager
Ruby versions packaged in official repositories are not suitable to work with Consul Democracy, so we'll have to install it manually. Ruby versions packaged in official repositories are not suitable to work with Consul Democracy, so we'll have to install it manually.
One possible tool is rvm: First, we need to install Ruby's development dependencies:
### As a local user
```bash ```bash
command curl -sSL https://rvm.io/mpapis.asc | gpg --import - sudo apt install libssl-dev autoconf bison build-essential libyaml-dev libreadline-dev zlib1g-dev libncurses-dev libffi-dev libgdbm-dev
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) The next step is installing a Ruby version manager, like rbenv:
```bash
[[ -s /usr/local/rvm/scripts/rvm ]] && source /usr/local/rvm/scripts/rvm
```
and finally, reload .bashrc to be able to run RVM
```bash ```bash
wget -qO- https://github.com/rbenv/rbenv-installer/raw/main/bin/rbenv-installer | bash
source ~/.bashrc source ~/.bashrc
``` ```
## Node.js ## CMake and pkg-config
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. In order to compile some of the project dependencies, we need CMake and pkg-config:
To install it, you can use [n](https://github.com/tj/n)
Run the following command on your terminal:
```bash ```bash
curl -L https://git.io/n-install | bash -s -- -y lts sudo apt install cmake pkg-config
``` ```
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)) ## Node.js version manager
Reload .bashrc to be able to run node To compile the assets, you'll need a JavaScript runtime. Node.js is the preferred option. To install Node.js, we will install a Node.js version manager, like NVM:
```bash ```bash
source /root/.bashrc wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.0/install.sh | bash
source ~/.bashrc
``` ```
Check it's correctly installed by running: ## PostgreSQL
Install postgresql and its development dependencies with:
```bash ```bash
node -v sudo apt install postgresql libpq-dev
```
## 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:
```bash
wget https://www.postgresql.org/media/keys/ACCC4CF8.asc
apt-key add ACCC4CF8.asc
```
and install postgresql
```bash
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": You also need to configure a user for your database. As an example, we'll choose the username "consul":
```bash ```bash
su - postgres sudo -u postgres createuser consul --createdb --superuser --pwprompt
createuser consul --createdb --superuser --pwprompt
exit
``` ```
## Imagemagick ## Imagemagick
@@ -130,34 +89,15 @@ exit
Install Imagemagick: Install Imagemagick:
```bash ```bash
apt-get install imagemagick sudo apt install imagemagick
``` ```
## ChromeDriver ## Chrome or Chromium
To run E2E integration tests, we use Selenium along with Headless Chrome. In order to run the system tests, we need to install Chrome or Chromium.
To get it working, install the chromedriver package:
```bash ```bash
apt-get install chromedriver sudo apt install chromium
ln -s /usr/lib/chromedriver /usr/local/bin/
``` ```
Make sure it's working as expected by running the following command: Now you're ready to go [get Consul Democracy installed](local_installation.md)!
```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 Democracy [installed](local_installation.md)!!

View File

@@ -12,8 +12,8 @@ cd consuldemocracy
2. Install the Ruby version we need with your Ruby version manager. Here are some examples: 2. Install the Ruby version we need with your Ruby version manager. Here are some examples:
```bash ```bash
rvm install `cat .ruby-version` # If you're using RVM
rbenv install `cat .ruby-version` # If you're using rbenv rbenv install `cat .ruby-version` # If you're using rbenv
rvm install `cat .ruby-version` # If you're using RVM
asdf install ruby `cat .ruby-version` # If you're using asdf asdf install ruby `cat .ruby-version` # If you're using asdf
``` ```

View File

@@ -1,24 +1,31 @@
# Configuración para los entornos de desarrollo y pruebas (Debian GNU/Linux 9.8) # Configuración para los entornos de desarrollo y pruebas (Debian GNU/Linux 12 - Bookworm)
## Superusuario ## Superusuario
El programa 'sudo' no viene instalado en Debian por defecto. Su instalación y configuración es posible, se puede encontrar información al respecto [aquí](https://wiki.debian.org/es/sudo). Pero no lo recomendamos porque puede causar otros problemas. Recomendamos que se ejecuten las siguientes instrucciones como un super usuario, así que asegúrate de que la primera instrucción que ejecutes sea: Por defecto, en Debian ningún usuario puede utilizar `sudo` si se ha proporcionado una contraseña para el usuario root durante la instalación.
Por tanto, para instalar las dependencias del proyecto, tendremos dos opciones. La primera opción es abrir un terminal de superusuario. En un terminal, ejecuta:
```bash ```bash
su su
``` ```
> Para [Vagrant](/es/installation/vagrant.md) ejecutar: Te pedirá introducir la contraseña del usuario root.
> ```
> sudo su - La segunda opción es añadir un usuario regular al grupo `sudo`. Para ello, tras abrir un terminal de superusuario, ejecuta:
> ```
```bash
gpasswd -a <your_username> sudo
```
Tendrás que cerrar sesión y volverla abrir para que los cambios tengan efecto.
## Actualización de sistema ## Actualización de sistema
Ejecuta una actualización general de las librerías de sistema: Ejecuta una actualización general de las librerías de sistema:
```bash ```bash
apt-get update sudo apt update
``` ```
## Git ## Git
@@ -26,101 +33,55 @@ apt-get update
Git es mantenido oficialmente en Debian: Git es mantenido oficialmente en Debian:
```bash ```bash
apt-get install git sudo apt install git
```
## Curl
Curl es mantenido oficialmente en Debian:
```bash
apt-get install curl
``` ```
## Gestor de versiones de Ruby ## Gestor de versiones de Ruby
Las versiones de Ruby empaquetadas en repositorios oficiales no son aptas para trabajar con Consul Democracy, así que debemos instalar manualmente. Las versiones de Ruby empaquetadas en repositorios oficiales no son aptas para trabajar con Consul Democracy, así que debemos instalarlo manualmente.
Una opción es utilizar rvm: En primer lugar, necesitamos los siguiente paquetes para poder instalar Ruby:
### Como usuario local
```bash ```bash
command curl -sSL https://rvm.io/mpapis.asc | gpg --import - sudo apt install libssl-dev autoconf bison build-essential libyaml-dev libreadline-dev zlib1g-dev libncurses-dev libffi-dev libgdbm-dev
command curl -sSL https://rvm.io/pkuczynski.asc | gpg --import -
curl -L https://get.rvm.io | bash -s stable
``` ```
después añadimos el script rvm a nuestro bash (~/.bashrc) (este paso sólo es necesario si no puedes ejecutar el comando rvm) A continuación instalaremos un gestor de versiones de Ruby, como rbenv:
```bash
[[ -s /usr/local/rvm/scripts/rvm ]] && source /usr/local/rvm/scripts/rvm
```
por úlitmo, volvemos a cargar el .bashrc para poder ejecutar RVM
```bash ```bash
wget -qO- https://github.com/rbenv/rbenv-installer/raw/main/bin/rbenv-installer | bash
source ~/.bashrc source ~/.bashrc
``` ```
## Node.js ## CMake y pkg-config
Para compilar los archivos estáticos (JS, CSS, imágenes, etc.), es necesario un _runtime_ de JavaScript. Node.js es la opción recomendada. Al igual que como ocurre con Ruby, no es recomendable instalar Node directamente de los repositorios de tu distribución Linux. Para compilar algunas de las dependencias del proyecto, necesitamos CMake y pkg-config:
Para instalar Node, puedes usar [n](https://github.com/tj/n)
Ejecuta el siguiente comando en tu terminal:
```bash ```bash
curl -L https://git.io/n-install | bash -s -- -y lts sudo apt install cmake pkg-config
``` ```
Y este instalará automáticamente la versión LTS (_Long Term Support_, inglés para "Soporte a largo plazo") más reciente de Node en tu directorio `$HOME` (Este comando hace uso de [n-install](https://github.com/mklement0/n-install)) ## Gestor de versiones de Node.js
vuelve a cargar el .bashrc para poder ejecutar node Para compilar los archivos estáticos (JS, CSS, imágenes, etc.), es necesario un _runtime_ de JavaScript. Node.js es la opción recomendada. Para instalar Node.js, instalaremos un gestor de versiones de Node.js, como NVM:
```bash ```bash
source /root/.bashrc wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.0/install.sh | bash
source ~/.bashrc
``` ```
Comprueba que está correctamente instalado ejecutando: ## PostgreSQL
Instala postgresql y sus dependencias de desarrollo con:
```bash ```bash
node -v sudo apt install postgresql libpq-dev
``` ```
## PostgreSQL (>=9.4) Para el correcto funcionamiento de Consul Democracy, necesitas configurar un usuario para tu base de datos. Como ejemplo, crearemos un usuario llamado "consul":
La versión 9.4 de PostgreSQL no es oficial en Debian 9.
Así que debemos añadir el respositorio oficial de postgresql a apt, por ejemplo creando el fichero */etc/apt/sources.list.d/pgdg.list* con:
```text
deb http://security.debian.org/debian-security jessie/updates main
```
después deberás descargar la key e instalarla:
```bash ```bash
wget https://www.postgresql.org/media/keys/ACCC4CF8.asc sudo -u postgres createuser consul --createdb --superuser --pwprompt
apt-key add ACCC4CF8.asc
```
y finalmente instalar postgresql
```bash
apt-get update
apt-get install postgresql-9.4 postgresql-server-dev-9.4 postgresql-contrib-9.4
```
Para el correcto funcionamiento de Consul Democracy, necesitas confgurar un usuario para tu base de datos. Como ejemplo, crearemos un usuario llamado "consul":
```bash
su - postgres
createuser consul --createdb --superuser --pwprompt
exit
``` ```
## Imagemagick ## Imagemagick
@@ -128,34 +89,15 @@ exit
Instala Imagemagick: Instala Imagemagick:
```bash ```bash
apt-get install imagemagick sudo apt install imagemagick
``` ```
## ChromeDriver ## Chrome o Chromium
Para realizar pruebas de integración, usamos Selenium junto a Headless Chrome. Para poder ejecutar los tests de sistema, necesitaremos tener instalado Chrome o Chromium.
Para ello, primero instala el siguiente paquete:
```bash ```bash
apt-get install chromedriver sudo apt install chromium
ln -s /usr/lib/chromedriver /usr/local/bin/
``` ```
Asegúrate de que todo funciona como es debido ejecutando el siguiente comando: ¡Ya estás listo para [instalar Consul Democracy](local_installation.md)!
```bash
chromedriver --version
```
Deberías recibir un mensaje indicando la última versión de ChromeDriver. Si ese es el caso, está todo listo
Si te encuentras usando una distro basada en Arch, instalando `chromium` desde el repositorio `extra` debería ser suficiente
También tienes la opción de solo instalar ChromeDriver desde AUR. Si usas `pacaur`, ejecuta el siguiente comando:
```bash
pacaur -S chromedriver
```
Ya estás listo para [instalar Consul Democracy](local_installation.md)!!

View File

@@ -12,8 +12,8 @@ cd consuldemocracy
2. Instala la versión de Ruby necesaria con el gestor de versiones de tu elección. Algunos ejemplos: 2. Instala la versión de Ruby necesaria con el gestor de versiones de tu elección. Algunos ejemplos:
```bash ```bash
rvm install `cat .ruby-version` # Si usas RVM
rbenv install `cat .ruby-version` # Si usas rbenv rbenv install `cat .ruby-version` # Si usas rbenv
rvm install `cat .ruby-version` # Si usas RVM
asdf install ruby `cat .ruby-version` # Si usas asdf asdf install ruby `cat .ruby-version` # Si usas asdf
``` ```