From 195d38a15088371335c3b3929b8f2469711f1169 Mon Sep 17 00:00:00 2001 From: lesion Date: Tue, 16 Jul 2019 23:32:45 +0200 Subject: [PATCH 1/4] v0.10.0 --- Dockerfile | 7 +++++++ docker-compose.yml | 34 ++++++++++++++++++++++++++++++++++ docker/Dockerfile | 7 +++++++ docker/db.sqlite | Bin 0 -> 98304 bytes docker/docker-compose.yml | 33 +++++++++++++++++++++++++++++++++ docker/init.db | 0 package.json | 2 +- 7 files changed, 82 insertions(+), 1 deletion(-) create mode 100644 Dockerfile create mode 100644 docker-compose.yml create mode 100644 docker/Dockerfile create mode 100644 docker/db.sqlite create mode 100644 docker/docker-compose.yml create mode 100644 docker/init.db diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 00000000..006ecd05 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,7 @@ +FROM node:latest +EXPOSE 13120 +WORKDIR / +#COPY config/default.json /data/gancio/config/gancio_config.json +RUN yarn global add gancio +ENTRYPOINT ["gancio", "start", "--config", "/data/gancio/gancio_config.json"] +#CMD ["gancio", "start", "--config", "/data/gancio/gancio_config.json"] diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 00000000..c0fd472c --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,34 @@ +version: '3' + +services: + db: + image: postgres + container_name: postgres + volumes: + # - ./db.sql:docker-entrypoint-initdb.d/db.sql + - db:/var/lib/postgres + - /etc/localtime:/etc/localtime:ro + environment: + - POSTGRES_USER=gancio + - POSTGRES_DB=gancio + - POSTGRES_PASSWORD=gancio + restart: always + ports: + - 5432:5432 + app: + image: node:latest + container_name: gancio + build: . + volumes: + - ./db.sqlite:/data/gancio/db.sqlite + - ./gancio_config.json:/data/gancio/gancio_config.json:ro + - ./uploads:/data/gancio/uploads + depends_on: + - db + ports: + - 13120:13120 +volumes: + db: + gancio: + + diff --git a/docker/Dockerfile b/docker/Dockerfile new file mode 100644 index 00000000..fa0b483c --- /dev/null +++ b/docker/Dockerfile @@ -0,0 +1,7 @@ +FROM node:latest +EXPOSE 13120 +WORKDIR / +#COPY config/default.json /data/gancio/config/gancio_config.json +RUN yarn global add gancio +#ENTRYPOINT ["gancio", "--config", "/gancio/config.json"] +#CMD ["gancio", "start", "--config", "/data/gancio/gancio_config.json"] diff --git a/docker/db.sqlite b/docker/db.sqlite new file mode 100644 index 0000000000000000000000000000000000000000..ad63406acfe734da81e166eed29f876139728ed6 GIT binary patch literal 98304 zcmeI5Yit|Yb%2MYM2UKE{8&e;b$7$1cjHxTk@J3VA6Y+STV6|k$*)~I^pG4;W04%1 zGnB1eY*ITLwEj~x+x{t1ApMsHNKh1Qwpe)rCqJNJ41>?y<6Gs|YHuGtx$+Cjx))a#iHMa8~K zQPk7$-~UX&k0Jj6{>B2oH~0xUazbVjq`PBZqS8O3|2qBU$%XWt*q0{QaWVDA*nf^* zNIf%Rj~*QU*O5;Qi^E?|d}jkyANJt)K9(Grnx2mR`hHt0)pUJLZ`hXmJ#ysS+@Ynp z%+jI5r{*%(-N5Uam#!O?>zVn*rMcsC=Q3x`%`Y4}cO~=2+?C9s3rnZx7vZdhxy7Y} znd`P;*YxX|i-*n~IdSOROPnaqK&Vw~S9=00x>ar&P1`UV*E36Vm&xh%cFi^_nhh$J z<`=KP6<=Z<1-90*i$q`>br5={z!`d@(l^|wYgN72)a;d>3maB(&9DqedgLlv**4Y; zd%f8%6-k2qRIm!Mq1@8p`jtcW^~_OVv^2jkmsvc$lv%uR>J*6EO=8}L;$}@N>+=DM z=jM*hots-cGIu_6-4R+I=b6mu#mv#UQ*)3H=jUAgBoST@QU$v3BbghHO~Q-DGd zNFtrnHnKca=7KD|g!e@eG-@No!8rZU4AO7en%#zzNHK-HId_5b*jm-~AVu

2^ucbUo}%O5ftld_bYEo%3|!J8ZmJ70sNPQs{Jp-#5*qZG-5UT3k9XCX z8Gc7{>iF{;Wl5J|k?sE8c}JWancA}_c6Y(a3}P7hpAKgL2_op>??z=LU>_KDOE;>- zarz#=1KBV7%mWtt{psY?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AR_EU;xPdrO5u^yh}-bAjm4>fuLs&DuW{zZ8(OBInB^iZY4#d^aL2?8f*J zeGZv;I0n;+0n3P$bui|mvH0 Date: Tue, 16 Jul 2019 23:37:54 +0200 Subject: [PATCH 2/4] docker setup --- Dockerfile | 7 ------- docker-compose.yml | 34 ---------------------------------- docker/docker-compose.yml | 2 +- 3 files changed, 1 insertion(+), 42 deletions(-) delete mode 100644 Dockerfile delete mode 100644 docker-compose.yml diff --git a/Dockerfile b/Dockerfile deleted file mode 100644 index 006ecd05..00000000 --- a/Dockerfile +++ /dev/null @@ -1,7 +0,0 @@ -FROM node:latest -EXPOSE 13120 -WORKDIR / -#COPY config/default.json /data/gancio/config/gancio_config.json -RUN yarn global add gancio -ENTRYPOINT ["gancio", "start", "--config", "/data/gancio/gancio_config.json"] -#CMD ["gancio", "start", "--config", "/data/gancio/gancio_config.json"] diff --git a/docker-compose.yml b/docker-compose.yml deleted file mode 100644 index c0fd472c..00000000 --- a/docker-compose.yml +++ /dev/null @@ -1,34 +0,0 @@ -version: '3' - -services: - db: - image: postgres - container_name: postgres - volumes: - # - ./db.sql:docker-entrypoint-initdb.d/db.sql - - db:/var/lib/postgres - - /etc/localtime:/etc/localtime:ro - environment: - - POSTGRES_USER=gancio - - POSTGRES_DB=gancio - - POSTGRES_PASSWORD=gancio - restart: always - ports: - - 5432:5432 - app: - image: node:latest - container_name: gancio - build: . - volumes: - - ./db.sqlite:/data/gancio/db.sqlite - - ./gancio_config.json:/data/gancio/gancio_config.json:ro - - ./uploads:/data/gancio/uploads - depends_on: - - db - ports: - - 13120:13120 -volumes: - db: - gancio: - - diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml index 987c03f0..efddd8e6 100644 --- a/docker/docker-compose.yml +++ b/docker/docker-compose.yml @@ -30,4 +30,4 @@ services: - 13120:13120 volumes: db: - gancio: \ No newline at end of file + gancio: From 94ce7fe09b43d3a1f92e20e47b11dd36884a12bc Mon Sep 17 00:00:00 2001 From: lesion Date: Wed, 17 Jul 2019 00:41:08 +0200 Subject: [PATCH 3/4] docker documentation --- docs/setup/classic.md | 35 ++++++++++++++++----- docs/setup/dev.md | 55 +++++++++++++++++++++++++++++++++ docs/setup/docker.md | 34 +++++++++++++++++++++ docs/setup/nginx.md | 71 +++++++++++++++++++++++++++++++++++++++++++ docs/setup/setup.md | 8 +++-- server/cli.js | 2 +- 6 files changed, 195 insertions(+), 10 deletions(-) create mode 100644 docs/setup/dev.md create mode 100644 docs/setup/nginx.md diff --git a/docs/setup/classic.md b/docs/setup/classic.md index ff07913a..3033dfb4 100644 --- a/docs/setup/classic.md +++ b/docs/setup/classic.md @@ -7,28 +7,49 @@ parent: Setup ## Classic setup -1. Install Node.js +1. Install Node.js and postgreSQL ```bash curl -sL https://deb.nodesource.com/setup_12.x | bash - -apt-get install -y nodejs +apt-get install -y nodejs postgresql ``` [source](https://github.com/nodesource/distributions/blob/master/README.md) -2. Install Gancio +1. Install Gancio ```bash npm install --global gancio ``` -3. Setup +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 ``` -4. Start +1. Start ```bash gancio start ``` -5. Enjoy :tada: -Point your web browser to [http://localhost:3000](http://localhost:3000) +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 +``` diff --git a/docs/setup/dev.md b/docs/setup/dev.md new file mode 100644 index 00000000..3033dfb4 --- /dev/null +++ b/docs/setup/dev.md @@ -0,0 +1,55 @@ +--- +layout: default +title: Classic +permalink: /setup/classic +parent: Setup +--- + +## Classic setup + +1. Install Node.js and postgreSQL +```bash +curl -sL https://deb.nodesource.com/setup_12.x | bash - +apt-get install -y nodejs postgresql +``` +[source](https://github.com/nodesource/distributions/blob/master/README.md) +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 +``` + +1. Start +```bash +gancio start +``` +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 +``` diff --git a/docs/setup/docker.md b/docs/setup/docker.md index ff6036b3..ed009e19 100644 --- a/docs/setup/docker.md +++ b/docs/setup/docker.md @@ -7,4 +7,38 @@ parent: Setup ## 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 +``` +After first setup, you can modify this file and restart the container on your needs. + +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: \ No newline at end of file diff --git a/docs/setup/nginx.md b/docs/setup/nginx.md new file mode 100644 index 00000000..6c529f53 --- /dev/null +++ b/docs/setup/nginx.md @@ -0,0 +1,71 @@ +--- +layout: default +title: Nginx +permalink: /setup/nginx +parent: Setup +--- + +## Nginx proxy configuration +This is the default nginx configuration for gancio, please modify at least the **server_name** and **ssl_certificate**'s path + +```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; + } +} + +``` \ No newline at end of file diff --git a/docs/setup/setup.md b/docs/setup/setup.md index ea91f09b..161fd097 100644 --- a/docs/setup/setup.md +++ b/docs/setup/setup.md @@ -4,9 +4,13 @@ title: Setup permalink: /setup has_children: true nav_order: 2 +has_toc: false --- # Setup -You would setup **Gancio** for different scenario -{: .fs-6 } \ No newline at end of file + +- ## [Setup with docker](/setup/docker) +- ## [Classic setup](/setup/classic) +- ## [Nginx as a proxy](/setup/nginx) +- ## [Hacking & contribute](/dev) \ No newline at end of file diff --git a/server/cli.js b/server/cli.js index 1d8f4991..1655c9ac 100755 --- a/server/cli.js +++ b/server/cli.js @@ -188,7 +188,7 @@ require('yargs') .option('config', { alias: 'c', describe: 'Configuration file', - default: './gancio_config.json', + default: '/gancio/config.json', }) .coerce('config', config_path => { const absolute_config_path = path.resolve(cwd, config_path) From 1ed0ff3917f9ef67ba1507e5171cc1c7eda36b6c Mon Sep 17 00:00:00 2001 From: lesion Date: Wed, 17 Jul 2019 11:04:08 +0200 Subject: [PATCH 4/4] minor with documentation --- docs/_config.yml | 4 ++-- docs/index.md | 2 +- package.json | 1 + 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/docs/_config.yml b/docs/_config.yml index 206fe112..0066e4db 100644 --- a/docs/_config.yml +++ b/docs/_config.yml @@ -17,8 +17,8 @@ title: Gancio email: gancio@cisti.org description: >- # this means to ignore newlines until "baseurl:" A shared agenda for local communities -baseurl: "" # the subpath of your site, e.g. /blog -url: "" # the base hostname & protocol for your site, e.g. http://example.com +baseurl: "/gancio" # the subpath of your site, e.g. /blog +url: "https://prove.fugadalcontrollo.org" # the base hostname & protocol for your site, e.g. http://example.com #twitter_username: jekyllrb #github_username: jekyll diff --git a/docs/index.md b/docs/index.md index e44177ef..b239ee75 100644 --- a/docs/index.md +++ b/docs/index.md @@ -12,7 +12,7 @@ permalink: / A shared agenda for local communities. {: .fs-6 } -[Get started now](/setup){: .btn .btn-primary .fs-5 .mb-4 .mb-md-0 .mr-2 } [Demo](https://gancio.cisti.org){: .btn .btn-green .fs-5 .mb-4 .mb-md-0 } +[Get started now](/setup){: .btn .btn-primary .fs-5 .mb-4 .mb-md-0 .mr-2 } [Demo](https://demo.fugadalcontrollo.org){: .btn .btn-green .fs-5 .mb-4 .mb-md-0 } [Source](https://git.lattuga.net/cisti/gancio){: .btn .fs-5 } diff --git a/package.json b/package.json index 101b7b5a..fe91b959 100644 --- a/package.json +++ b/package.json @@ -8,6 +8,7 @@ "build": "nuxt build", "start": "cross-env NODE_ENV=production node server/cli.js", "lint": "eslint --ext .js,.vue --ignore-path .gitignore .", + "doc": "cd docs && bundle exec jekyll b", "precommit": "npm run lint", "migrate:dev": "sequelize db:migrate", "migrate": "NODE_ENV=production sequelize db:migrate"