update docs

This commit is contained in:
lesion
2019-07-27 13:04:06 +02:00
parent 10921a072f
commit 03d95a4ced
26 changed files with 137 additions and 128 deletions

55
docs/install/classic.md Normal file
View File

@@ -0,0 +1,55 @@
---
layout: default
title: Classic
permalink: /install/classic
parent: Install
---
## Install
1. Install Node.js and postgreSQL
```bash
curl -sL https://deb.nodesource.com/setup_12.x | bash -
apt-get install -y nodejs postgresql
```
<small>[source](https://github.com/nodesource/distributions/blob/master/README.md)</small>
1. Install Gancio
```bash
npm install --global gancio
```
1. Create a database (optional as you can use sqlite, but recommended)
```bash
sudo -u postgres psql
postgres=# create database gancio;
postgres=# create user gancio with encrypted password 'gancio';
postgres=# grant all privileges on database gancio to gancio;
```
1. Create a user to run gancio from
```bash
adduser gancio
su gancio
```
1. Test & launch interactive setup
```bash
gancio --help
gancio setup --config config.json
```
1. Start
```bash
gancio --help
gancio start --config config.json
```
1. Point your web browser to [http://localhost:13120](http://localhost:13120) or where you selected during setup.
1. [Setup nginx as a proxy](/setup/nginx)
1. Deploy in production
If you don't use the [docker way](/setup/docker), in production you should use something like **[pm2](http://pm2.keymetrics.io/)**:
```bash
sudo npm install --global pm2
pm2 gancio start --config config.json
```

44
docs/install/docker.md Normal file
View File

@@ -0,0 +1,44 @@
---
layout: default
title: Docker
permalink: /install/docker
parent: Install
---
## Install with docker
**You do not need to clone the full repo as we distribute gancio via npm.**
[Dockerfile](https://git.lattuga.net/cisti/gancio/raw/docker/docker/Dockerfile) and [docker-compose.yml](https://git.lattuga.net/cisti/gancio/raw/docker/docker/docker-compose.yml) are the only needed files.
1. Create a directory where everything related to gancio is stored (db, images, config)
```bash
mkdir /opt/gancio
cd /opt/gancio
```
:information_source: you can choose a different directory of course
1. Download docker-compose.yml and Dockerfile
```bash
wget https://git.lattuga.net/cisti/gancio/raw/docker/docker/Dockerfile
wget https://git.lattuga.net/cisti/gancio/raw/docker/docker/docker-compose.yml
```
1. Create an empty configuration file
```
touch config.json
```
<small>After first setup, you can modify this file and restart the container on your needs.</small>
1. Build docker image and launch interactive setup in one step
```
docker-compose run --rm gancio gancio setup
```
1. Run your container
```bash
docker-compose up -d
```
1. [Setup nginx as a proxy](/setup/nginx)
1. Point your web browser to [http://localhost:13120](http://localhost:13120) or where you specified during setup and enjoy :tada:

16
docs/install/install.md Normal file
View File

@@ -0,0 +1,16 @@
---
layout: default
title: Install
permalink: /install
has_children: true
nav_order: 2
has_toc: false
---
# Install
- [Classic install](classic)
- [Using docker](docker)
- [Nginx as a proxy](nginx)
- [Hacking & contribute](../dev)

76
docs/install/nginx.md Normal file
View File

@@ -0,0 +1,76 @@
---
layout: default
title: Nginx
permalink: /install/nginx
parent: Install
---
## Nginx proxy configuration
This is the default nginx configuration for gancio, please modify at least the **server_name** and **ssl_certificate**'s path.
Note that this does not include a cache configuration and that gancio does
not use a cache control at all, if you can help with this task you're
welcome.
```nginx
server {
listen 80;
listen [::]:80;
server_name gancio.cisti.org;
root /var/www/letsencrypt;
location /.well-known/acme-challenge/ { allow all; }
location / { return 301 https://$host$request_uri; }
}
server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
server_name gancio.cisti.org;
ssl_protocols TLSv1.2;
ssl_ciphers HIGH:!MEDIUM:!LOW:!aNULL:!NULL:!SHA;
ssl_prefer_server_ciphers on;
ssl_session_cache shared:SSL:10m;
# Uncomment these lines once you acquire a certificate:
# ssl_certificate /etc/letsencrypt/live/gancio.cisti.org/fullchain.pem;
# ssl_certificate_key /etc/letsencrypt/live/gancio.cisti.org/privkey.pem;
keepalive_timeout 70;
sendfile on;
client_max_body_size 80m;
gzip on;
gzip_disable "msie6";
gzip_vary on;
gzip_proxied any;
gzip_comp_level 6;
gzip_buffers 16 8k;
gzip_http_version 1.1;
gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;
add_header Strict-Transport-Security "max-age=31536000";
location / {
try_files $uri @proxy;
}
location @proxy {
proxy_set_header Host $host;
proxy_set_header X-Forwarded-Proto https;
proxy_set_header Proxy "";
proxy_pass_header Server;
proxy_pass http://127.0.0.1:13120;
proxy_buffering on;
proxy_redirect off;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
tcp_nodelay on;
}
}
```