Skip to content

Latest commit

 

History

History
97 lines (55 loc) · 3.05 KB

HOWTO.md

File metadata and controls

97 lines (55 loc) · 3.05 KB

How to install Stylo

Depending on your needs, you may want to install Stylo in different ways :

Ansible playbooks enable you to deploy Stylo on a remote machine, accessible with the SSH protocol.

You can find various pointers in our GitHub Actions automations, and in the ./infrastructure folder.

Clone git project

First step is to clone the project, you can use either the HTTPS or SSH version of the repository URL:

$ git clone [email protected]:EcrituresNumeriques/stylo.git

Stylo uses submodules to pull templates (and those templates are hosted on framagit). If you have an account with ssh enabled on framagit, you can pull all submodules using the following commands:

$ git submodule init
$ git submodule update

Run with Docker

Useful to run a fully fledged Stylo in no time.

Run the following command:

$ cp stylo-example.env stylo.env
$ docker-compose up

NOTE: The first time, this command can take a few dozen minutes depending on your network speed and machine capabilities. Subsequent calls will be faster.

This gives your access to:

Run without Docker

Note: this section can be improved.

We recommend you to host Stylo behind a reverse proxy. We provide a working configuration example below for the Nginx server.

Install the pre-requisite

$ curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.0/install.sh | bash
$ nvm install v16
$ sudo apt install mongodb-org pandoc

Prepare the server

After cloning the repo, build the service and its dependencies:

$ cp stylo-example.env stylo.env
$ npm clean-install
$ npm start

After the image is built, you should have a Stylo instance running on your server. Now, we need to expose it to the outside world with a reverse proxy.

Expose online

Obtain a working sample file with the following command:

$ wget -O /etc/nginx/sites-available/stylo.conf \
    https://github.com/EcrituresNumeriques/stylo/raw/dev/infrastructure/stylo.huma-num.fr.conf

Replace the service domain name:

$ sed -i s/stylo.huma-num.fr/STYLO_SUBDOMAIN.MYDOMAIN.TLD/g' /etc/nginx/sites-available/stylo.conf

Alternatively, alter the various ports, and domains on your own.

When you are done, enable the website and reload the configuration:

$ ln -s /etc/nginx/sites-available/stylo.conf /etc/nginx/sites-enable/stylo.conf
$ nginx reload

Deploy with Ansible

Note: this section can be improved.

$ pip install ansible===2.9.7 requests
$ cd infrastructure
$ ansible-playbook -i inventories/prod playbook.yml

Next steps

Once you have an up and running Stylo instance, read the SERVER.md file to run daily and maintenance operations, such as database migrations and such.