From c90dcc29caa011ec7877b85925ee0f0513ff6b5d Mon Sep 17 00:00:00 2001 From: blat Date: Thu, 1 Oct 2020 12:14:25 +0200 Subject: [PATCH] first commit --- README.md | 66 ++++++++++++++++++++++++++++++++++++++++++++++ config.json | 26 ++++++++++++++++++ docker-compose.yml | 66 ++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 158 insertions(+) create mode 100644 README.md create mode 100644 config.json create mode 100644 docker-compose.yml diff --git a/README.md b/README.md new file mode 100644 index 0000000..79cf22f --- /dev/null +++ b/README.md @@ -0,0 +1,66 @@ +# Gancio +https://gancio.org + + +## Initial setup +https://gancio.org/install/docker + +**You do not need to clone the full repo as we distribute gancio via npm.** +A Dockerfile and a docker-compose.yml are the only files needed. + +- **Create a directory where everything related to gancio is stored (db, images, config)** + + mkdir /opt/gancio + cd /opt/gancio + +note that you can choose a different directory. + + +## Use postgreSQL +1. **Download docker-compose.yml and Dockerfile** + + wget https://gancio.org/docker/Dockerfile + wget https://git.lattuga.net/blat/gancio_campiinrete/src/master/docker-compose.yml + +2. Create an empty configuration (**this is needed**) + + touch config.json + mkdir user_locale + + +## Gandi +La risposta di gandi su come generare certificati SSL con Let's Encrypt +> It is not possible to perform a DNS check via the Certbot client, you +> have to go through a check via your web server (apache or nginx). +> +> The other solution is to use the acme.sh client which allows you to +> create Let's Encrypt SSL certificates using our API and LiveDNS : +> https://github.com/Neilpang/acme.sh +> https://github.com/Neilpang/acme.sh/wiki/dnsapi#18-use-gandi-livedns-api + + +## Letsproxy +https://github.com/Neilpang/letsproxy + +aggiunti nel docker.compose.yml +- l'APIkey di gandi nell'environment di letsproxy + GANDI_LIVEDNS_KEY= +- le conf nell'environment di gancio + VIRTUAL_HOST=www.campiinrete.org + ENABLE_ACME=true + + +# Start gancio +1. Create network + docker network create gancio_network + +2. Run your container + docker-compose up -d + +3. Look at logs with + docker-compose logs -f + + +## Test ssl +questo non serve l'abbiamo usato per testare che riuscisse a creare i certificati con l'APIkey di gandi + docker exec -ti gancio_letsproxy_1 /bin/bash /acme.sh/acme.sh --issue --dns dns_gandi_livedns -d campiinrete.org -d www.campiinrete.org diff --git a/config.json b/config.json new file mode 100644 index 0000000..25be3e4 --- /dev/null +++ b/config.json @@ -0,0 +1,26 @@ +{ + "title": "Gancio", + "description": "A shared agenda for local communities", + "baseurl": "https://www.campiinrete.org/", + "server": { + "host": "0.0.0.0", + "port": 13120 + }, + "db": { + "dialect": "sqlite", + "storage": "/tmp/db.sqlite" + }, + "upload_path": "/opt/gancio/uploads", + "favicon": "../dist/favicon.ico", + "smtp": { + "auth": { + "user": "smtp@campiinrete.org", + "pass": + }, + "secure": true, + "host": "https://www.campiinrete.org" + }, + "admin_email": "gancio@campiinrete.org", + "secret": +} + diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..ff77c4f --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,66 @@ +version: '3' + +services: + + letsproxy: + image: neilpang/letsproxy + environment: + - GANDI_LIVEDNS_KEY= + ports: + - "80:80" + - "443:443" + volumes: + - /var/run/docker.sock:/tmp/docker.sock:ro + - ./proxy/certs:/etc/nginx/certs + - ./proxy/acme:/acmecerts:rw + - ./proxy/conf.d:/etc/nginx/conf.d + - ./proxy/vhost.d:/etc/nginx/vhost.d \ + - ./proxy/stream.d:/etc/nginx/stream.d \ + - ./proxy/dhparam:/etc/nginx/dhparam \ + network_mode: "host" + + db: + image: postgres + container_name: postgres + volumes: + - db:/var/lib/postgres + - /etc/localtime:/etc/localtime:ro + environment: + - POSTGRES_USER=gancio + - POSTGRES_DB=gancio + - POSTGRES_PASSWORD= + restart: always + ports: + - 5432:5432 + networks: + - gancio_network + + gancio: + build: . + image: node:latest + environment: + - DEBUG=*,-babel,-follow-redirects,-send,-body-parser:*,-express:*,-connect:*,-sequelize:* + container_name: gancio + restart: always + command: gancio start --docker --db=postgres + volumes: + - ./config.json:/opt/gancio/config.json + - ./uploads:/opt/gancio/uploads + depends_on: + - db + - letsproxy + environment: + - VIRTUAL_HOST=www.campiinrete.org + - ENABLE_ACME=true + ports: + - "0.0.0.0:13120:13120" + networks: + - gancio_network + +volumes: + db: + +networks: + gancio_network: + external: true +