first commit

This commit is contained in:
blat 2020-10-01 12:14:25 +02:00
commit c90dcc29ca
3 changed files with 158 additions and 0 deletions

66
README.md Normal file
View file

@ -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

26
config.json Normal file
View file

@ -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":
}

66
docker-compose.yml Normal file
View file

@ -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