better documentation
This commit is contained in:
@@ -18,12 +18,11 @@ services:
|
|||||||
build: .
|
build: .
|
||||||
image: node:latest
|
image: node:latest
|
||||||
container_name: gancio
|
container_name: gancio
|
||||||
command: gancio start --docker
|
command: gancio start --docker --db=postgresql
|
||||||
volumes:
|
volumes:
|
||||||
- ./db.sqlite:/opt/gancio/db.sqlite
|
|
||||||
- ./config.json:/opt/gancio/config.json
|
- ./config.json:/opt/gancio/config.json
|
||||||
- ./uploads:/opt/gancio/uploads
|
- ./uploads:/opt/gancio/uploads
|
||||||
depends_on:
|
depends_on:
|
||||||
- db
|
- db
|
||||||
ports:
|
ports:
|
||||||
- 13120:13120
|
- 13120:13120
|
||||||
17
docker/docker-compose.sqlite.yml
Normal file
17
docker/docker-compose.sqlite.yml
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
version: '3'
|
||||||
|
|
||||||
|
services:
|
||||||
|
gancio:
|
||||||
|
build: .
|
||||||
|
image: node:latest
|
||||||
|
container_name: gancio
|
||||||
|
command: gancio start --docker --db=sqlite
|
||||||
|
volumes:
|
||||||
|
- ./db.sqlite:/opt/gancio/db.sqlite
|
||||||
|
- ./config.json:/opt/gancio/config.json
|
||||||
|
- ./uploads:/opt/gancio/uploads
|
||||||
|
ports:
|
||||||
|
- 13120:13120
|
||||||
|
volumes:
|
||||||
|
db:
|
||||||
|
gancio:
|
||||||
@@ -105,7 +105,7 @@
|
|||||||
|
|
||||||
<li class="navigation-list-item ">
|
<li class="navigation-list-item ">
|
||||||
|
|
||||||
<a href="https://gancio.org/install/classic" class="navigation-list-link">Classic</a>
|
<a href="https://gancio.org/install/debian" class="navigation-list-link">Debian</a>
|
||||||
|
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
|
|||||||
@@ -105,7 +105,7 @@
|
|||||||
|
|
||||||
<li class="navigation-list-item ">
|
<li class="navigation-list-item ">
|
||||||
|
|
||||||
<a href="https://gancio.org/install/classic" class="navigation-list-link">Classic</a>
|
<a href="https://gancio.org/install/debian" class="navigation-list-link">Debian</a>
|
||||||
|
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
|
|||||||
@@ -15,25 +15,25 @@
|
|||||||
},
|
},
|
||||||
"2": {
|
"2": {
|
||||||
"id": "2",
|
"id": "2",
|
||||||
"title": "Classic",
|
|
||||||
"content": "Install Install Node.js and postgreSQL curl -sL https://deb.nodesource.com/setup_12.x | bash - apt-get install -y nodejs postgresql source Install Gancio npm install --global gancio Create a database (optional as you can use sqlite, but recommended) 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; Create a user to run gancio from adduser gancio su gancio Test & launch interactive setup gancio --help gancio setup --config config.json Start gancio --help gancio start --config config.json Point your web browser to http://localhost:13120 or where you selected during setup. Setup nginx as a proxy Deploy in production If you don’t use the docker way, in production you should use something like pm2: sudo npm install --global pm2 pm2 gancio start --config config.json",
|
|
||||||
"url": "https://gancio.org/install/classic",
|
|
||||||
"relUrl": "/install/classic"
|
|
||||||
},
|
|
||||||
"3": {
|
|
||||||
"id": "3",
|
|
||||||
"title": "Configuration",
|
"title": "Configuration",
|
||||||
"content": "Configuration Main gancio configuration is done with a configuration file. This shoud be a .json or a .js file and could be specified using the --config flag. eg. gancio start --config ./config.json eg. pm2 start gancio start -- --config ~/config.json Title Description BaseURL Server Database Upload path SMTP Admin Favicon User locale Secret Default settings Title The title will be in rss feed, in html head and in emails: "title": "Gancio" Description "description": "a shared agenda for local communities" BaseURL URL where your site will be accessible (include http or https): "baseurl": "https://gancio.cisti.org" Server This probably support unix socket too :D "server": { "host": "localhost", "port": 13120 } Database "db": { "dialect": "sqlite", "storage": "/tmp/db.sqlite" } Upload path Where to save images "upload_path": "./uploads" SMTP Admin Favicon You could specify another favicon. This is also used as logo (top-left corner): "favicon": "./favicon.ico" User locale Probably you want to modify some text for your specific community, that’s why we thought the user_locale configuration: you can specify your version of each string of gancio making a directory with your locales inside. For example, let’s say you want to modify the text inside the /about page: mkdir /opt/gancio/user_locale put something like this in /opt/gancio/user_locale/en.js to override the about in english: export default { about: 'A new about' } and then point the user_locale configuration to that directory: "user_locale": "/opt/gancio/user_locale" Watch here for a list of strings you can override. :warning: Note that a restart is needed when you change user_locale’s content. Secret Default settings { "title": "Gancio", "description": "A shared agenda for local communities", "baseurl": "http://localhost:13120", "server": { "host": "0.0.0.0", "port": 13120 }, "db": { "dialect": "sqlite", "storage": "/tmp/db.sqlite" }, "upload_path": "./", "favicon": "../dist/favicon.ico", "smtp": { "auth": { "user": "", "pass": "" }, "secure": true, "host": "" }, "admin": "", "secret": "notsosecret" }",
|
"content": "Configuration Main gancio configuration is done with a configuration file. This shoud be a .json or a .js file and could be specified using the --config flag. eg. gancio start --config ./config.json eg. pm2 start gancio start -- --config ~/config.json Title Description BaseURL Server Database Upload path SMTP Admin Favicon User locale Secret Default settings Title The title will be in rss feed, in html head and in emails: "title": "Gancio" Description "description": "a shared agenda for local communities" BaseURL URL where your site will be accessible (include http or https): "baseurl": "https://gancio.cisti.org" Server This probably support unix socket too :D "server": { "host": "localhost", "port": 13120 } Database "db": { "dialect": "sqlite", "storage": "/tmp/db.sqlite" } Upload path Where to save images "upload_path": "./uploads" SMTP Admin Favicon You could specify another favicon. This is also used as logo (top-left corner): "favicon": "./favicon.ico" User locale Probably you want to modify some text for your specific community, that’s why we thought the user_locale configuration: you can specify your version of each string of gancio making a directory with your locales inside. For example, let’s say you want to modify the text inside the /about page: mkdir /opt/gancio/user_locale put something like this in /opt/gancio/user_locale/en.js to override the about in english: export default { about: 'A new about' } and then point the user_locale configuration to that directory: "user_locale": "/opt/gancio/user_locale" Watch here for a list of strings you can override. :warning: Note that a restart is needed when you change user_locale’s content. Secret Default settings { "title": "Gancio", "description": "A shared agenda for local communities", "baseurl": "http://localhost:13120", "server": { "host": "0.0.0.0", "port": 13120 }, "db": { "dialect": "sqlite", "storage": "/tmp/db.sqlite" }, "upload_path": "./", "favicon": "../dist/favicon.ico", "smtp": { "auth": { "user": "", "pass": "" }, "secure": true, "host": "" }, "admin": "", "secret": "notsosecret" }",
|
||||||
"url": "https://gancio.org/config",
|
"url": "https://gancio.org/config",
|
||||||
"relUrl": "/config"
|
"relUrl": "/config"
|
||||||
},
|
},
|
||||||
"4": {
|
"3": {
|
||||||
"id": "4",
|
"id": "3",
|
||||||
"title": "Contribute",
|
"title": "Contribute",
|
||||||
"content": "Contribute If you want to contribute, take a look at the issues Code Translate Design Documentation Share Code Translate Design Documentation Share",
|
"content": "Contribute If you want to contribute, take a look at the issues Code Translate Design Documentation Share Code Translate Design Documentation Share",
|
||||||
"url": "https://gancio.org/contribute",
|
"url": "https://gancio.org/contribute",
|
||||||
"relUrl": "/contribute"
|
"relUrl": "/contribute"
|
||||||
},
|
},
|
||||||
|
"4": {
|
||||||
|
"id": "4",
|
||||||
|
"title": "Debian",
|
||||||
|
"content": "Debian installation Install Node.js & yarn (from root) curl -sL https://deb.nodesource.com/setup_12.x | bash - apt-get install -y nodejs curl -sL https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - echo "deb https://dl.yarnpkg.com/debian/ stable main" > /etc/apt/sources.list.d/yarn.list apt-get update && apt-get install yarn source Install Gancio yarn add gancio --prod Setup with postgreSQL (optional as you can choose sqlite) apt-get install postgresql # Create the database su postgres -c psql postgres=# create database gancio; postgres=# create user gancio with encrypted password 'gancio'; postgres=# grant all privileges on database gancio to gancio; Create a user to run gancio from adduser gancio su gancio Test & launch interactive setup gancio --help gancio setup --config config.json Start gancio --help gancio start --config config.json Point your web browser to http://localhost:13120 or where you selected during setup. Setup nginx as a proxy Deploy in production If you don’t use the docker way, in production you should use something like pm2: sudo yarn global add pm2 pm2 gancio start --config config.json",
|
||||||
|
"url": "https://gancio.org/install/debian",
|
||||||
|
"relUrl": "/install/debian"
|
||||||
|
},
|
||||||
"5": {
|
"5": {
|
||||||
"id": "5",
|
"id": "5",
|
||||||
"title": "Hacking",
|
"title": "Hacking",
|
||||||
@@ -44,7 +44,7 @@
|
|||||||
"6": {
|
"6": {
|
||||||
"id": "6",
|
"id": "6",
|
||||||
"title": "Docker",
|
"title": "Docker",
|
||||||
"content": "Install with docker You do not need to clone the full repo as we distribute gancio via npm. Dockerfile and docker-compose.yml are the only needed files. Create a directory where everything related to gancio is stored (db, images, config) mkdir /opt/gancio cd /opt/gancio :information_source: you can choose a different directory of course Download docker-compose.yml and Dockerfile wget https://git.lattuga.net/cisti/gancio/raw/master/docker/Dockerfile wget https://git.lattuga.net/cisti/gancio/raw/master/docker/docker-compose.yml Create an empty configuration file (db.sqlite only needed for sqlite setup) touch config.json db.sqlite After first setup, you can edit config.json file and restart the container on your needs. Build docker image and launch interactive setup in one step docker-compose run --rm gancio gancio setup --docker Run your container docker-compose up -d Setup nginx as a proxy Point your web browser to http://localhost:13120 or where you specified during setup and enjoy :tada:",
|
"content": "Install with 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 :information_source: you can choose a different directory. Using postgreSQL Download docker-compose.yml and Dockerfile wget https://git.lattuga.net/cisti/gancio/raw/master/docker/Dockerfile wget https://git.lattuga.net/cisti/gancio/raw/master/docker/docker-compose.postgresql.yml -O docker.compose.yml Create an empty configiguration (this is needed) touch config.json Using sqlite Download docker-compose.yml and Dockerfile wget https://git.lattuga.net/cisti/gancio/raw/master/docker/Dockerfile wget https://git.lattuga.net/cisti/gancio/raw/master/docker/docker-compose.sqlite.yml -O docker-compose.yml Create an empty db and config (this is needed) touch config.json db.sqlite Finish Build docker image and launch interactive setup in one step docker-compose run --rm gancio gancio setup --docker Run your container docker-compose up -d Setup nginx as a proxy Point your web browser to http://localhost:13120 or where you specified during setup and enjoy :tada: You can edit config.json file and restart the container on your needs, see Configuration for more details.",
|
||||||
"url": "https://gancio.org/install/docker",
|
"url": "https://gancio.org/install/docker",
|
||||||
"relUrl": "/install/docker"
|
"relUrl": "/install/docker"
|
||||||
},
|
},
|
||||||
@@ -58,7 +58,7 @@
|
|||||||
"8": {
|
"8": {
|
||||||
"id": "8",
|
"id": "8",
|
||||||
"title": "Install",
|
"title": "Install",
|
||||||
"content": "Install Classic install Using docker Nginx as a proxy Hacking & contribute",
|
"content": "Install (production) Install on Debian Install using docker Post installation Nginx as a proxy If you wanna hack or run the current develop release take a look at Hacking & contribute",
|
||||||
"url": "https://gancio.org/install",
|
"url": "https://gancio.org/install",
|
||||||
"relUrl": "/install"
|
"relUrl": "/install"
|
||||||
},
|
},
|
||||||
@@ -86,7 +86,7 @@
|
|||||||
"12": {
|
"12": {
|
||||||
"id": "12",
|
"id": "12",
|
||||||
"title": "Project Structure",
|
"title": "Project Structure",
|
||||||
"content": "Structure API / backend Source code inside server/api/. index.js is basically a routing table pointing each PATH with specified HTTP VERB to a method of a controller. jwt is used to authenticate api request. Express is based on middleware, passing each request to a chain of methods. If you come from a PHP background, note that the main difference with Node.js is that the server process is always running and able to manage multiple requests and tasks together (asyncronically) while each php process is tied to a single request. Sequelize is used as ORM. Take a look in /server/api/models. Client / frontend Nuxt.js is used here! Nuxt is basically Vue plus SSR (Server Side Rendering). Client routing in nuxt is automatic (if you don’t need something special), just put your page inside pages and that’s it!",
|
"content": "Project structure API / backend Client / frontend Federation / ActivityPub API / backend Source code inside server/api/. index.js is basically a routing table pointing each PATH with specified HTTP VERB to a method of a controller. jwt is used to authenticate api request. Express.js is based on middleware, passing each request to a chain of methods. If you come from a PHP background, note that the main difference with Node.js is that the server process is always running and able to manage multiple requests and tasks together (asyncronically) while each php process is tied to a single request. Sequelize is used as ORM. Take a look in /server/api/models. Client / frontend Nuxt.js is used here! Nuxt is basically Vue plus SSR (Server Side Rendering). Client routing in nuxt is automatic (if you don’t need something special), just put your page inside pages and that’s it! Federation / ActivityPub Code inside server/federation.",
|
||||||
"url": "https://gancio.org/dev/structure",
|
"url": "https://gancio.org/dev/structure",
|
||||||
"relUrl": "/dev/structure"
|
"relUrl": "/dev/structure"
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -105,7 +105,7 @@
|
|||||||
|
|
||||||
<li class="navigation-list-item ">
|
<li class="navigation-list-item ">
|
||||||
|
|
||||||
<a href="https://gancio.org/install/classic" class="navigation-list-link">Classic</a>
|
<a href="https://gancio.org/install/debian" class="navigation-list-link">Debian</a>
|
||||||
|
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
|
|||||||
@@ -105,7 +105,7 @@
|
|||||||
|
|
||||||
<li class="navigation-list-item ">
|
<li class="navigation-list-item ">
|
||||||
|
|
||||||
<a href="https://gancio.org/install/classic" class="navigation-list-link">Classic</a>
|
<a href="https://gancio.org/install/debian" class="navigation-list-link">Debian</a>
|
||||||
|
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
|
|||||||
@@ -105,7 +105,7 @@
|
|||||||
|
|
||||||
<li class="navigation-list-item ">
|
<li class="navigation-list-item ">
|
||||||
|
|
||||||
<a href="https://gancio.org/install/classic" class="navigation-list-link">Classic</a>
|
<a href="https://gancio.org/install/debian" class="navigation-list-link">Debian</a>
|
||||||
|
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
@@ -297,10 +297,10 @@
|
|||||||
|
|
||||||
<ul>
|
<ul>
|
||||||
<li><a href="https://nuxtjs.org/">Nuxt.js</a></li>
|
<li><a href="https://nuxtjs.org/">Nuxt.js</a></li>
|
||||||
<li>Vue.js</li>
|
<li><a href="https://vuejs.org/">Vue.js</a></li>
|
||||||
<li>Express</li>
|
<li>Express</li>
|
||||||
<li>Node.js</li>
|
<li>Node.js</li>
|
||||||
<li>Sequelize</li>
|
<li><a href="https://sequelize.org/">Sequelize</a></li>
|
||||||
<li>Element.ui</li>
|
<li>Element.ui</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
|
|||||||
@@ -105,7 +105,7 @@
|
|||||||
|
|
||||||
<li class="navigation-list-item ">
|
<li class="navigation-list-item ">
|
||||||
|
|
||||||
<a href="https://gancio.org/install/classic" class="navigation-list-link">Classic</a>
|
<a href="https://gancio.org/install/debian" class="navigation-list-link">Debian</a>
|
||||||
|
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
|
|||||||
@@ -105,7 +105,7 @@
|
|||||||
|
|
||||||
<li class="navigation-list-item ">
|
<li class="navigation-list-item ">
|
||||||
|
|
||||||
<a href="https://gancio.org/install/classic" class="navigation-list-link">Classic</a>
|
<a href="https://gancio.org/install/debian" class="navigation-list-link">Debian</a>
|
||||||
|
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
@@ -300,24 +300,29 @@
|
|||||||
|
|
||||||
|
|
||||||
<div id="main-content" class="page-content" role="main">
|
<div id="main-content" class="page-content" role="main">
|
||||||
<h3 id="structure">Structure</h3>
|
<h3 class="no_toc" id="project-structure">Project structure</h3>
|
||||||
|
<ol id="markdown-toc">
|
||||||
|
<li><a href="#api--backend" id="markdown-toc-api--backend">API / backend</a></li>
|
||||||
|
<li><a href="#client--frontend" id="markdown-toc-client--frontend">Client / frontend</a></li>
|
||||||
|
<li><a href="#federation--activitypub" id="markdown-toc-federation--activitypub">Federation / ActivityPub</a></li>
|
||||||
|
</ol>
|
||||||
|
|
||||||
<h3 id="api--backend">API / backend</h3>
|
<h3 id="api--backend">API / backend</h3>
|
||||||
|
|
||||||
<p>Source code inside <code class="highlighter-rouge">server/api/</code>.
|
<p>Source code inside <code class="highlighter-rouge">server/api/</code>.<br />
|
||||||
<code class="highlighter-rouge">index.js</code> is basically a routing table pointing each PATH with specified
|
<code class="highlighter-rouge">index.js</code> is basically a routing table pointing each PATH with specified
|
||||||
HTTP VERB to a method of a controller.</p>
|
HTTP VERB to a method of a controller.</p>
|
||||||
|
|
||||||
<p>jwt is used to authenticate api request.</p>
|
<p>jwt is used to authenticate api request.</p>
|
||||||
|
|
||||||
<p>Express is based on middleware, passing each request to a chain of methods.</p>
|
<p><a href="https://expressjs.com/">Express.js</a> is based on middleware, passing each request to a chain of methods.</p>
|
||||||
|
|
||||||
<p>If you come from a PHP background, note that the main difference with
|
<p>If you come from a PHP background, note that the main difference with
|
||||||
Node.js is that the server process is always running and able to manage
|
<a href="https://en.wikipedia.org/wiki/Node.js">Node.js</a> is that the server process is always running and able to manage
|
||||||
multiple requests and tasks together (asyncronically) while each php
|
multiple requests and tasks together (asyncronically) while each php
|
||||||
process is tied to a single request.</p>
|
process is tied to a single request.</p>
|
||||||
|
|
||||||
<p>Sequelize is used as ORM. Take a look in <code class="highlighter-rouge">/server/api/models</code>.</p>
|
<p><a href="https://sequelize.org/">Sequelize</a> is used as ORM. Take a look in <a href="https://git.lattuga.net/cisti/gancio/src/master/server/api/models"><code class="highlighter-rouge">/server/api/models</code></a>.</p>
|
||||||
|
|
||||||
<h3 id="client--frontend">Client / frontend</h3>
|
<h3 id="client--frontend">Client / frontend</h3>
|
||||||
<p>Nuxt.js is used here!<br />
|
<p>Nuxt.js is used here!<br />
|
||||||
@@ -325,6 +330,8 @@ Nuxt is basically Vue plus SSR (Server Side Rendering).
|
|||||||
Client routing in nuxt is automatic (if you don’t need something special),
|
Client routing in nuxt is automatic (if you don’t need something special),
|
||||||
just put your page inside <code class="highlighter-rouge">pages</code> and that’s it!</p>
|
just put your page inside <code class="highlighter-rouge">pages</code> and that’s it!</p>
|
||||||
|
|
||||||
|
<h3 id="federation--activitypub">Federation / ActivityPub</h3>
|
||||||
|
<p>Code inside <a href="https://git.lattuga.net/cisti/gancio/src/master/server/federation"><code class="highlighter-rouge">server/federation</code></a>.</p>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom" ><generator uri="https://jekyllrb.com/" version="3.8.6">Jekyll</generator><link href="https://gancio.org/feed.xml" rel="self" type="application/atom+xml" /><link href="https://gancio.org/" rel="alternate" type="text/html" /><updated>2019-08-05T01:50:43+02:00</updated><id>https://gancio.org/feed.xml</id><title type="html">Gancio</title><subtitle>A shared agenda for local communities</subtitle></feed>
|
<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom" ><generator uri="https://jekyllrb.com/" version="3.8.6">Jekyll</generator><link href="https://gancio.org/feed.xml" rel="self" type="application/atom+xml" /><link href="https://gancio.org/" rel="alternate" type="text/html" /><updated>2019-08-06T01:01:30+02:00</updated><id>https://gancio.org/feed.xml</id><title type="html">Gancio</title><subtitle>A shared agenda for local communities</subtitle></feed>
|
||||||
@@ -107,7 +107,7 @@
|
|||||||
|
|
||||||
<li class="navigation-list-item ">
|
<li class="navigation-list-item ">
|
||||||
|
|
||||||
<a href="https://gancio.org/install/classic" class="navigation-list-link">Classic</a>
|
<a href="https://gancio.org/install/debian" class="navigation-list-link">Debian</a>
|
||||||
|
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
|
|||||||
@@ -105,7 +105,7 @@
|
|||||||
|
|
||||||
<li class="navigation-list-item ">
|
<li class="navigation-list-item ">
|
||||||
|
|
||||||
<a href="https://gancio.org/install/classic" class="navigation-list-link">Classic</a>
|
<a href="https://gancio.org/install/debian" class="navigation-list-link">Debian</a>
|
||||||
|
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
@@ -291,15 +291,20 @@
|
|||||||
|
|
||||||
|
|
||||||
<div id="main-content" class="page-content" role="main">
|
<div id="main-content" class="page-content" role="main">
|
||||||
<h1 id="install">Install</h1>
|
<h1 id="install-production">Install (production)</h1>
|
||||||
|
|
||||||
<ul>
|
<ul>
|
||||||
<li><a href="/install/classic">Classic install</a></li>
|
<li><a href="/install/debian">Install on Debian</a></li>
|
||||||
<li><a href="/install/docker">Using docker</a></li>
|
<li><a href="/install/docker">Install using docker</a></li>
|
||||||
<li><a href="/install/nginx">Nginx as a proxy</a></li>
|
|
||||||
<li><a href="../dev">Hacking & contribute</a></li>
|
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
|
<h3 id="post-installation">Post installation</h3>
|
||||||
|
<ul>
|
||||||
|
<li><a href="/install/nginx">Nginx as a proxy</a></li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<p>If you wanna hack or run the current develop release take a look at <a href="../dev">Hacking & contribute</a></p>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
<meta http-equiv="X-UA-Compatible" content="IE=Edge">
|
<meta http-equiv="X-UA-Compatible" content="IE=Edge">
|
||||||
|
|
||||||
<title>Classic - Gancio</title>
|
<title>Debian - Gancio</title>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -25,17 +25,17 @@
|
|||||||
<script src="https://gancio.org/assets/js/jquery.fancybox.min.js"></script>
|
<script src="https://gancio.org/assets/js/jquery.fancybox.min.js"></script>
|
||||||
|
|
||||||
<!-- Begin Jekyll SEO tag v2.6.1 -->
|
<!-- Begin Jekyll SEO tag v2.6.1 -->
|
||||||
<title>Classic | Gancio</title>
|
<title>Debian | Gancio</title>
|
||||||
<meta name="generator" content="Jekyll v3.8.6" />
|
<meta name="generator" content="Jekyll v3.8.6" />
|
||||||
<meta property="og:title" content="Classic" />
|
<meta property="og:title" content="Debian" />
|
||||||
<meta property="og:locale" content="en_US" />
|
<meta property="og:locale" content="en_US" />
|
||||||
<meta name="description" content="A shared agenda for local communities" />
|
<meta name="description" content="A shared agenda for local communities" />
|
||||||
<meta property="og:description" content="A shared agenda for local communities" />
|
<meta property="og:description" content="A shared agenda for local communities" />
|
||||||
<link rel="canonical" href="https://gancio.org/install/classic" />
|
<link rel="canonical" href="https://gancio.org/install/debian" />
|
||||||
<meta property="og:url" content="https://gancio.org/install/classic" />
|
<meta property="og:url" content="https://gancio.org/install/debian" />
|
||||||
<meta property="og:site_name" content="Gancio" />
|
<meta property="og:site_name" content="Gancio" />
|
||||||
<script type="application/ld+json">
|
<script type="application/ld+json">
|
||||||
{"@type":"WebPage","url":"https://gancio.org/install/classic","headline":"Classic","description":"A shared agenda for local communities","@context":"https://schema.org"}</script>
|
{"@type":"WebPage","url":"https://gancio.org/install/debian","headline":"Debian","description":"A shared agenda for local communities","@context":"https://schema.org"}</script>
|
||||||
<!-- End Jekyll SEO tag -->
|
<!-- End Jekyll SEO tag -->
|
||||||
|
|
||||||
</head>
|
</head>
|
||||||
@@ -105,7 +105,7 @@
|
|||||||
|
|
||||||
<li class="navigation-list-item active">
|
<li class="navigation-list-item active">
|
||||||
|
|
||||||
<a href="https://gancio.org/install/classic" class="navigation-list-link active">Classic</a>
|
<a href="https://gancio.org/install/debian" class="navigation-list-link active">Debian</a>
|
||||||
|
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
@@ -294,27 +294,32 @@
|
|||||||
|
|
||||||
<li class="breadcrumb-nav-list-item"><a href="https://gancio.org/install">Install</a></li>
|
<li class="breadcrumb-nav-list-item"><a href="https://gancio.org/install">Install</a></li>
|
||||||
|
|
||||||
<li class="breadcrumb-nav-list-item"><span>Classic</span></li>
|
<li class="breadcrumb-nav-list-item"><span>Debian</span></li>
|
||||||
</ol>
|
</ol>
|
||||||
</nav>
|
</nav>
|
||||||
|
|
||||||
|
|
||||||
<div id="main-content" class="page-content" role="main">
|
<div id="main-content" class="page-content" role="main">
|
||||||
<h2 id="install">Install</h2>
|
<h2 id="debian-installation">Debian installation</h2>
|
||||||
|
|
||||||
<ol>
|
<ol>
|
||||||
<li>Install Node.js and postgreSQL
|
<li>Install Node.js & yarn (<strong>from root</strong>)
|
||||||
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>curl <span class="nt">-sL</span> https://deb.nodesource.com/setup_12.x | bash -
|
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>curl <span class="nt">-sL</span> https://deb.nodesource.com/setup_12.x | bash -
|
||||||
apt-get <span class="nb">install</span> <span class="nt">-y</span> nodejs postgresql
|
apt-get <span class="nb">install</span> <span class="nt">-y</span> nodejs
|
||||||
|
curl <span class="nt">-sL</span> https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add -
|
||||||
|
<span class="nb">echo</span> <span class="s2">"deb https://dl.yarnpkg.com/debian/ stable main"</span> <span class="o">></span> /etc/apt/sources.list.d/yarn.list
|
||||||
|
apt-get update <span class="o">&&</span> apt-get <span class="nb">install </span>yarn
|
||||||
</code></pre></div> </div>
|
</code></pre></div> </div>
|
||||||
<p><small><a href="https://github.com/nodesource/distributions/blob/master/README.md">source</a></small></p>
|
<p><small><a href="https://github.com/nodesource/distributions/blob/master/README.md">source</a></small></p>
|
||||||
</li>
|
</li>
|
||||||
<li>Install Gancio
|
<li>Install Gancio
|
||||||
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>npm <span class="nb">install</span> <span class="nt">--global</span> gancio
|
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>yarn add gancio <span class="nt">--prod</span>
|
||||||
</code></pre></div> </div>
|
</code></pre></div> </div>
|
||||||
</li>
|
</li>
|
||||||
<li>Create a database (optional as you can use sqlite, but recommended)
|
<li>Setup with postgreSQL (optional as you can choose sqlite)
|
||||||
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nb">sudo</span> <span class="nt">-u</span> postgres psql
|
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>apt-get <span class="nb">install </span>postgresql
|
||||||
|
<span class="c"># Create the database</span>
|
||||||
|
su postgres <span class="nt">-c</span> psql
|
||||||
<span class="nv">postgres</span><span class="o">=</span><span class="c"># create database gancio;</span>
|
<span class="nv">postgres</span><span class="o">=</span><span class="c"># create database gancio;</span>
|
||||||
<span class="nv">postgres</span><span class="o">=</span><span class="c"># create user gancio with encrypted password 'gancio';</span>
|
<span class="nv">postgres</span><span class="o">=</span><span class="c"># create user gancio with encrypted password 'gancio';</span>
|
||||||
<span class="nv">postgres</span><span class="o">=</span><span class="c"># grant all privileges on database gancio to gancio;</span>
|
<span class="nv">postgres</span><span class="o">=</span><span class="c"># grant all privileges on database gancio to gancio;</span>
|
||||||
@@ -339,13 +344,13 @@ gancio start <span class="nt">--config</span> config.json
|
|||||||
<p>Point your web browser to <a href="http://localhost:13120">http://localhost:13120</a> or where you selected during setup.</p>
|
<p>Point your web browser to <a href="http://localhost:13120">http://localhost:13120</a> or where you selected during setup.</p>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<p><a href="/setup/nginx">Setup nginx as a proxy</a></p>
|
<p><a href="/install/nginx">Setup nginx as a proxy</a></p>
|
||||||
</li>
|
</li>
|
||||||
<li>Deploy in production<br />
|
<li>Deploy in production<br />
|
||||||
If you don’t use the <a href="/setup/docker">docker way</a>, in production you should use something like <strong><a href="http://pm2.keymetrics.io/">pm2</a></strong>:</li>
|
If you don’t use the <a href="/install/docker">docker way</a>, in production you should use something like <strong><a href="http://pm2.keymetrics.io/">pm2</a></strong>:</li>
|
||||||
</ol>
|
</ol>
|
||||||
|
|
||||||
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nb">sudo </span>npm <span class="nb">install</span> <span class="nt">--global</span> pm2
|
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nb">sudo </span>yarn global add pm2
|
||||||
pm2 gancio start <span class="nt">--config</span> config.json
|
pm2 gancio start <span class="nt">--config</span> config.json
|
||||||
</code></pre></div></div>
|
</code></pre></div></div>
|
||||||
|
|
||||||
@@ -105,7 +105,7 @@
|
|||||||
|
|
||||||
<li class="navigation-list-item ">
|
<li class="navigation-list-item ">
|
||||||
|
|
||||||
<a href="https://gancio.org/install/classic" class="navigation-list-link">Classic</a>
|
<a href="https://gancio.org/install/debian" class="navigation-list-link">Debian</a>
|
||||||
|
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
@@ -302,9 +302,8 @@
|
|||||||
|
|
||||||
<div id="main-content" class="page-content" role="main">
|
<div id="main-content" class="page-content" role="main">
|
||||||
<h2 id="install-with-docker">Install with docker</h2>
|
<h2 id="install-with-docker">Install with docker</h2>
|
||||||
|
|
||||||
<p><strong>You do not need to clone the full repo as we distribute gancio via npm.</strong><br>
|
<p><strong>You do not need to clone the full repo as we distribute gancio via npm.</strong><br>
|
||||||
<a href="https://git.lattuga.net/cisti/gancio/raw/docker/docker/Dockerfile">Dockerfile</a> and <a href="https://git.lattuga.net/cisti/gancio/raw/docker/docker/docker-compose.yml">docker-compose.yml</a> are the only needed files.</p>
|
A <a href="https://git.lattuga.net/cisti/gancio/raw/docker/docker/Dockerfile">Dockerfile</a> and a docker-compose.yml are the only files needed.</p>
|
||||||
|
|
||||||
<ol>
|
<ol>
|
||||||
<li>Create a directory where everything related to gancio is stored (db, images, config)
|
<li>Create a directory where everything related to gancio is stored (db, images, config)
|
||||||
@@ -312,21 +311,43 @@
|
|||||||
<div class="highlight"><pre class="highlight"><code><span class="nb">mkdir</span> /opt/gancio
|
<div class="highlight"><pre class="highlight"><code><span class="nb">mkdir</span> /opt/gancio
|
||||||
<span class="nb">cd</span> /opt/gancio
|
<span class="nb">cd</span> /opt/gancio
|
||||||
</code></pre></div> </div>
|
</code></pre></div> </div>
|
||||||
<p><img class="emoji" title=":information_source:" alt=":information_source:" src="https://github.githubassets.com/images/icons/emoji/unicode/2139.png" height="20" width="20"> you can choose a different directory of course</p>
|
<p><img class="emoji" title=":information_source:" alt=":information_source:" src="https://github.githubassets.com/images/icons/emoji/unicode/2139.png" height="20" width="20"> <small>you can choose a different directory.</small></p>
|
||||||
</li>
|
</li>
|
||||||
|
</ol>
|
||||||
|
|
||||||
|
<h3 id="using-postgresql">Using postgreSQL</h3>
|
||||||
|
<ol>
|
||||||
<li>Download docker-compose.yml and Dockerfile
|
<li>Download docker-compose.yml and Dockerfile
|
||||||
<div class="language-bash highlighter-rouge">
|
<div class="language-bash highlighter-rouge">
|
||||||
<div class="highlight"><pre class="highlight"><code>wget https://git.lattuga.net/cisti/gancio/raw/master/docker/Dockerfile
|
<div class="highlight"><pre class="highlight"><code>wget https://git.lattuga.net/cisti/gancio/raw/master/docker/Dockerfile
|
||||||
wget https://git.lattuga.net/cisti/gancio/raw/master/docker/docker-compose.yml
|
wget https://git.lattuga.net/cisti/gancio/raw/master/docker/docker-compose.postgresql.yml <span class="nt">-O</span> docker.compose.yml
|
||||||
</code></pre></div> </div>
|
</code></pre></div> </div>
|
||||||
</li>
|
</li>
|
||||||
<li>Create an empty configuration file (db.sqlite only needed for sqlite
|
<li>Create an empty configiguration (<strong>this is needed</strong>)
|
||||||
setup)
|
<div class="highlighter-rouge">
|
||||||
|
<div class="highlight"><pre class="highlight"><code>touch config.json
|
||||||
|
</code></pre></div> </div>
|
||||||
|
</li>
|
||||||
|
</ol>
|
||||||
|
|
||||||
|
<h3 id="using-sqlite">Using sqlite</h3>
|
||||||
|
<ol>
|
||||||
|
<li>Download docker-compose.yml and Dockerfile
|
||||||
|
<div class="language-bash highlighter-rouge">
|
||||||
|
<div class="highlight"><pre class="highlight"><code>wget https://git.lattuga.net/cisti/gancio/raw/master/docker/Dockerfile
|
||||||
|
wget https://git.lattuga.net/cisti/gancio/raw/master/docker/docker-compose.sqlite.yml <span class="nt">-O</span> docker-compose.yml
|
||||||
|
</code></pre></div> </div>
|
||||||
|
</li>
|
||||||
|
<li>Create an empty db and config (<strong>this is needed</strong>)
|
||||||
<div class="highlighter-rouge">
|
<div class="highlighter-rouge">
|
||||||
<div class="highlight"><pre class="highlight"><code>touch config.json db.sqlite
|
<div class="highlight"><pre class="highlight"><code>touch config.json db.sqlite
|
||||||
</code></pre></div> </div>
|
</code></pre></div> </div>
|
||||||
<p><small>After first setup, you can edit <code class="highlighter-rouge">config.json</code> file and restart the container on your needs.</small></p>
|
|
||||||
</li>
|
</li>
|
||||||
|
</ol>
|
||||||
|
|
||||||
|
<h3 id="finish">Finish</h3>
|
||||||
|
|
||||||
|
<ol>
|
||||||
<li>Build docker image and launch interactive setup in one step
|
<li>Build docker image and launch interactive setup in one step
|
||||||
<div class="highlighter-rouge">
|
<div class="highlighter-rouge">
|
||||||
<div class="highlight"><pre class="highlight"><code>docker-compose run --rm gancio gancio setup --docker
|
<div class="highlight"><pre class="highlight"><code>docker-compose run --rm gancio gancio setup --docker
|
||||||
@@ -338,10 +359,12 @@ setup)
|
|||||||
</code></pre></div> </div>
|
</code></pre></div> </div>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<p><a href="/setup/nginx">Setup nginx as a proxy</a></p>
|
<p><a href="/install/nginx">Setup nginx as a proxy</a></p>
|
||||||
</li>
|
</li>
|
||||||
<li>Point your web browser to <a href="http://localhost:13120">http://localhost:13120</a> or where you specified during setup and enjoy <img class="emoji" title=":tada:" alt=":tada:" src="https://github.githubassets.com/images/icons/emoji/unicode/1f389.png" height="20" width="20">
|
<li>
|
||||||
</li>
|
<p>Point your web browser to <a href="http://localhost:13120">http://localhost:13120</a> or where you specified during setup and enjoy <img class="emoji" title=":tada:" alt=":tada:" src="https://github.githubassets.com/images/icons/emoji/unicode/1f389.png" height="20" width="20"></p>
|
||||||
|
</li>
|
||||||
|
<li>You can edit <code class="highlighter-rouge">config.json</code> file and restart the container on your needs, see <a href="/config">Configuration</a> for more details.</li>
|
||||||
</ol>
|
</ol>
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -105,7 +105,7 @@
|
|||||||
|
|
||||||
<li class="navigation-list-item ">
|
<li class="navigation-list-item ">
|
||||||
|
|
||||||
<a href="https://gancio.org/install/classic" class="navigation-list-link">Classic</a>
|
<a href="https://gancio.org/install/debian" class="navigation-list-link">Debian</a>
|
||||||
|
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
|
|||||||
@@ -105,7 +105,7 @@
|
|||||||
|
|
||||||
<li class="navigation-list-item ">
|
<li class="navigation-list-item ">
|
||||||
|
|
||||||
<a href="https://gancio.org/install/classic" class="navigation-list-link">Classic</a>
|
<a href="https://gancio.org/install/debian" class="navigation-list-link">Debian</a>
|
||||||
|
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
|
|||||||
@@ -105,7 +105,7 @@
|
|||||||
|
|
||||||
<li class="navigation-list-item ">
|
<li class="navigation-list-item ">
|
||||||
|
|
||||||
<a href="https://gancio.org/install/classic" class="navigation-list-link">Classic</a>
|
<a href="https://gancio.org/install/debian" class="navigation-list-link">Debian</a>
|
||||||
|
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
|
|||||||
@@ -11,10 +11,10 @@ has_children: true
|
|||||||
**Gancio** is built with following technologies:
|
**Gancio** is built with following technologies:
|
||||||
|
|
||||||
- [Nuxt.js](https://nuxtjs.org/)
|
- [Nuxt.js](https://nuxtjs.org/)
|
||||||
- Vue.js
|
- [Vue.js](https://vuejs.org/)
|
||||||
- Express
|
- Express
|
||||||
- Node.js
|
- Node.js
|
||||||
- Sequelize
|
- [Sequelize](https://sequelize.org/)
|
||||||
- Element.ui
|
- Element.ui
|
||||||
|
|
||||||
### Testing on your own machine
|
### Testing on your own machine
|
||||||
|
|||||||
@@ -5,25 +5,28 @@ permalink: /dev/structure
|
|||||||
parent: Hacking
|
parent: Hacking
|
||||||
---
|
---
|
||||||
|
|
||||||
### Structure
|
### Project structure
|
||||||
|
{: .no_toc }
|
||||||
|
1. TOC
|
||||||
|
{:toc}
|
||||||
|
|
||||||
|
|
||||||
### API / backend
|
### API / backend
|
||||||
|
|
||||||
Source code inside `server/api/`.
|
Source code inside `server/api/`.
|
||||||
`index.js` is basically a routing table pointing each PATH with specified
|
`index.js` is basically a routing table pointing each PATH with specified
|
||||||
HTTP VERB to a method of a controller.
|
HTTP VERB to a method of a controller.
|
||||||
|
|
||||||
jwt is used to authenticate api request.
|
jwt is used to authenticate api request.
|
||||||
|
|
||||||
Express is based on middleware, passing each request to a chain of methods.
|
[Express.js](https://expressjs.com/) is based on middleware, passing each request to a chain of methods.
|
||||||
|
|
||||||
If you come from a PHP background, note that the main difference with
|
If you come from a PHP background, note that the main difference with
|
||||||
Node.js is that the server process is always running and able to manage
|
[Node.js](https://en.wikipedia.org/wiki/Node.js) is that the server process is always running and able to manage
|
||||||
multiple requests and tasks together (asyncronically) while each php
|
multiple requests and tasks together (asyncronically) while each php
|
||||||
process is tied to a single request.
|
process is tied to a single request.
|
||||||
|
|
||||||
Sequelize is used as ORM. Take a look in `/server/api/models`.
|
[Sequelize](https://sequelize.org/) is used as ORM. Take a look in [`/server/api/models`](https://git.lattuga.net/cisti/gancio/src/master/server/api/models).
|
||||||
|
|
||||||
|
|
||||||
### Client / frontend
|
### Client / frontend
|
||||||
@@ -33,4 +36,5 @@ Client routing in nuxt is automatic (if you don't need something special),
|
|||||||
just put your page inside `pages` and that's it!
|
just put your page inside `pages` and that's it!
|
||||||
|
|
||||||
|
|
||||||
|
### Federation / ActivityPub
|
||||||
|
Code inside [`server/federation`](https://git.lattuga.net/cisti/gancio/src/master/server/federation).
|
||||||
@@ -1,25 +1,32 @@
|
|||||||
---
|
---
|
||||||
layout: default
|
layout: default
|
||||||
title: Classic
|
title: Debian
|
||||||
permalink: /install/classic
|
permalink: /install/debian
|
||||||
parent: Install
|
parent: Install
|
||||||
---
|
---
|
||||||
|
|
||||||
## Install
|
## Debian installation
|
||||||
|
|
||||||
1. Install Node.js and postgreSQL
|
1. Install Node.js & yarn (**from root**)
|
||||||
```bash
|
```bash
|
||||||
curl -sL https://deb.nodesource.com/setup_12.x | bash -
|
curl -sL https://deb.nodesource.com/setup_12.x | bash -
|
||||||
apt-get install -y nodejs postgresql
|
apt-get install -y nodejs
|
||||||
|
curl -sL https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add -
|
||||||
|
echo "deb https://dl.yarnpkg.com/debian/ stable main" > /etc/apt/sources.list.d/yarn.list
|
||||||
|
apt-get update && apt-get install yarn
|
||||||
```
|
```
|
||||||
<small>[source](https://github.com/nodesource/distributions/blob/master/README.md)</small>
|
<small>[source](https://github.com/nodesource/distributions/blob/master/README.md)</small>
|
||||||
|
|
||||||
1. Install Gancio
|
1. Install Gancio
|
||||||
```bash
|
```bash
|
||||||
npm install --global gancio
|
yarn add gancio --prod
|
||||||
```
|
```
|
||||||
1. Create a database (optional as you can use sqlite, but recommended)
|
|
||||||
|
1. Setup with postgreSQL (optional as you can choose sqlite)
|
||||||
```bash
|
```bash
|
||||||
sudo -u postgres psql
|
apt-get install postgresql
|
||||||
|
# Create the database
|
||||||
|
su postgres -c psql
|
||||||
postgres=# create database gancio;
|
postgres=# create database gancio;
|
||||||
postgres=# create user gancio with encrypted password 'gancio';
|
postgres=# create user gancio with encrypted password 'gancio';
|
||||||
postgres=# grant all privileges on database gancio to gancio;
|
postgres=# grant all privileges on database gancio to gancio;
|
||||||
@@ -44,12 +51,12 @@ gancio start --config config.json
|
|||||||
```
|
```
|
||||||
1. Point your web browser to [http://localhost:13120](http://localhost:13120) or where you selected during setup.
|
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. [Setup nginx as a proxy](/install/nginx)
|
||||||
|
|
||||||
1. Deploy in production
|
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/)**:
|
If you don't use the [docker way](/install/docker), in production you should use something like **[pm2](http://pm2.keymetrics.io/)**:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
sudo npm install --global pm2
|
sudo yarn global add pm2
|
||||||
pm2 gancio start --config config.json
|
pm2 gancio start --config config.json
|
||||||
```
|
```
|
||||||
@@ -6,29 +6,41 @@ parent: Install
|
|||||||
---
|
---
|
||||||
|
|
||||||
## Install with docker
|
## Install with docker
|
||||||
|
|
||||||
**You do not need to clone the full repo as we distribute gancio via npm.**
|
**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.
|
A [Dockerfile](https://git.lattuga.net/cisti/gancio/raw/docker/docker/Dockerfile) and a docker-compose.yml are the only files needed.
|
||||||
|
|
||||||
1. Create a directory where everything related to gancio is stored (db, images, config)
|
1. Create a directory where everything related to gancio is stored (db, images, config)
|
||||||
```bash
|
```bash
|
||||||
mkdir /opt/gancio
|
mkdir /opt/gancio
|
||||||
cd /opt/gancio
|
cd /opt/gancio
|
||||||
```
|
```
|
||||||
:information_source: you can choose a different directory of course
|
:information_source: <small>you can choose a different directory.</small>
|
||||||
|
|
||||||
|
### Using postgreSQL
|
||||||
1. Download docker-compose.yml and Dockerfile
|
1. Download docker-compose.yml and Dockerfile
|
||||||
```bash
|
```bash
|
||||||
wget https://git.lattuga.net/cisti/gancio/raw/master/docker/Dockerfile
|
wget https://git.lattuga.net/cisti/gancio/raw/master/docker/Dockerfile
|
||||||
wget https://git.lattuga.net/cisti/gancio/raw/master/docker/docker-compose.yml
|
wget https://git.lattuga.net/cisti/gancio/raw/master/docker/docker-compose.postgresql.yml -O docker.compose.yml
|
||||||
```
|
```
|
||||||
|
|
||||||
1. Create an empty configuration file (db.sqlite only needed for sqlite
|
1. Create an empty configiguration (**this is needed**)
|
||||||
setup)
|
```
|
||||||
|
touch config.json
|
||||||
|
```
|
||||||
|
|
||||||
|
### Using sqlite
|
||||||
|
1. Download docker-compose.yml and Dockerfile
|
||||||
|
```bash
|
||||||
|
wget https://git.lattuga.net/cisti/gancio/raw/master/docker/Dockerfile
|
||||||
|
wget https://git.lattuga.net/cisti/gancio/raw/master/docker/docker-compose.sqlite.yml -O docker-compose.yml
|
||||||
|
```
|
||||||
|
|
||||||
|
1. Create an empty db and config (**this is needed**)
|
||||||
```
|
```
|
||||||
touch config.json db.sqlite
|
touch config.json db.sqlite
|
||||||
```
|
```
|
||||||
<small>After first setup, you can edit `config.json` file and restart the container on your needs.</small>
|
|
||||||
|
### Finish
|
||||||
|
|
||||||
1. Build docker image and launch interactive setup in one step
|
1. Build docker image and launch interactive setup in one step
|
||||||
```
|
```
|
||||||
@@ -40,6 +52,8 @@ docker-compose run --rm gancio gancio setup --docker
|
|||||||
docker-compose up -d
|
docker-compose up -d
|
||||||
```
|
```
|
||||||
|
|
||||||
1. [Setup nginx as a proxy](/setup/nginx)
|
1. [Setup nginx as a proxy](/install/nginx)
|
||||||
|
|
||||||
1. Point your web browser to [http://localhost:13120](http://localhost:13120) or where you specified during setup and enjoy :tada:
|
1. Point your web browser to [http://localhost:13120](http://localhost:13120) or where you specified during setup and enjoy :tada:
|
||||||
|
|
||||||
|
1. You can edit `config.json` file and restart the container on your needs, see [Configuration](/config) for more details.
|
||||||
@@ -7,10 +7,13 @@ nav_order: 2
|
|||||||
has_toc: false
|
has_toc: false
|
||||||
---
|
---
|
||||||
|
|
||||||
# Install
|
# Install (production)
|
||||||
|
|
||||||
|
- [Install on Debian](/install/debian)
|
||||||
|
- [Install using docker](/install/docker)
|
||||||
|
|
||||||
- [Classic install](/install/classic)
|
### Post installation
|
||||||
- [Using docker](/install/docker)
|
|
||||||
- [Nginx as a proxy](/install/nginx)
|
- [Nginx as a proxy](/install/nginx)
|
||||||
- [Hacking & contribute](../dev)
|
|
||||||
|
|
||||||
|
If you wanna hack or run the current develop release take a look at [Hacking & contribute](../dev)
|
||||||
|
|||||||
10
package.json
10
package.json
@@ -44,7 +44,7 @@
|
|||||||
"body-parser": "^1.18.3",
|
"body-parser": "^1.18.3",
|
||||||
"bootstrap": "^4.3.1",
|
"bootstrap": "^4.3.1",
|
||||||
"config": "^3.2.0",
|
"config": "^3.2.0",
|
||||||
"consola": "^2.9.0",
|
"consola": "^2.10.1",
|
||||||
"cookie-parser": "^1.4.4",
|
"cookie-parser": "^1.4.4",
|
||||||
"cors": "^2.8.5",
|
"cors": "^2.8.5",
|
||||||
"cross-env": "^5.2.0",
|
"cross-env": "^5.2.0",
|
||||||
@@ -54,7 +54,7 @@
|
|||||||
"express": "^4.17.1",
|
"express": "^4.17.1",
|
||||||
"express-jwt": "^5.3.1",
|
"express-jwt": "^5.3.1",
|
||||||
"http-signature": "^1.2.0",
|
"http-signature": "^1.2.0",
|
||||||
"ics": "^2.15.1",
|
"ics": "^2.16.0",
|
||||||
"inquirer": "^6.5.0",
|
"inquirer": "^6.5.0",
|
||||||
"jsonwebtoken": "^8.5.1",
|
"jsonwebtoken": "^8.5.1",
|
||||||
"less": "^3.9.0",
|
"less": "^3.9.0",
|
||||||
@@ -66,9 +66,9 @@
|
|||||||
"nuxt": "^2.8.1",
|
"nuxt": "^2.8.1",
|
||||||
"pg": "^7.11.0",
|
"pg": "^7.11.0",
|
||||||
"sass-loader": "^7.1.0",
|
"sass-loader": "^7.1.0",
|
||||||
"sequelize": "^5.10.1",
|
"sequelize": "^5.12.3",
|
||||||
"sequelize-cli": "^5.4.0",
|
"sequelize-cli": "^5.4.0",
|
||||||
"sharp": "^0.22.0",
|
"sharp": "^0.23.0",
|
||||||
"sqlite3": "^4.0.8",
|
"sqlite3": "^4.0.8",
|
||||||
"v-calendar": "^1.0.0-beta.14",
|
"v-calendar": "^1.0.0-beta.14",
|
||||||
"vue-awesome": "^3.5.3",
|
"vue-awesome": "^3.5.3",
|
||||||
@@ -84,7 +84,7 @@
|
|||||||
"eslint-config-standard": ">=13.0.1",
|
"eslint-config-standard": ">=13.0.1",
|
||||||
"eslint-loader": "^2.2.1",
|
"eslint-loader": "^2.2.1",
|
||||||
"eslint-plugin-import": ">=2.17.3",
|
"eslint-plugin-import": ">=2.17.3",
|
||||||
"eslint-plugin-jest": ">=22.11.1",
|
"eslint-plugin-jest": ">=22.14.1",
|
||||||
"eslint-plugin-node": ">=9.1.0",
|
"eslint-plugin-node": ">=9.1.0",
|
||||||
"eslint-plugin-nuxt": ">=0.4.2",
|
"eslint-plugin-nuxt": ">=0.4.2",
|
||||||
"eslint-plugin-prettier": "^3.1.0",
|
"eslint-plugin-prettier": "^3.1.0",
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
'use strict'
|
'use strict'
|
||||||
module.exports = (sequelize, DataTypes) => {
|
module.exports = (sequelize, DataTypes) => {
|
||||||
const comment = sequelize.define('comment', {
|
const comment = sequelize.define('comment', {
|
||||||
activitypub_id: {
|
activitypub_id: {
|
||||||
type: DataTypes.STRING(18),
|
type: DataTypes.STRING(18),
|
||||||
@@ -10,8 +10,6 @@ module.exports = (sequelize, DataTypes) => {
|
|||||||
}, {})
|
}, {})
|
||||||
comment.associate = function (models) {
|
comment.associate = function (models) {
|
||||||
comment.belongsTo(models.event)
|
comment.belongsTo(models.event)
|
||||||
// Event.hasMany(Comment)
|
|
||||||
// associations can be defined here
|
|
||||||
}
|
}
|
||||||
return comment
|
return comment
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ function notEmpty (value) {
|
|||||||
return value.length>0
|
return value.length>0
|
||||||
}
|
}
|
||||||
|
|
||||||
async function setupQuestionnaire(is_docker) {
|
async function setupQuestionnaire(is_docker, db) {
|
||||||
|
|
||||||
const questions = []
|
const questions = []
|
||||||
questions.push({
|
questions.push({
|
||||||
@@ -53,6 +53,7 @@ async function setupQuestionnaire(is_docker) {
|
|||||||
name: 'db.dialect',
|
name: 'db.dialect',
|
||||||
message: 'DB dialect',
|
message: 'DB dialect',
|
||||||
type: 'list',
|
type: 'list',
|
||||||
|
when: answers => !db,
|
||||||
choices: ['sqlite', 'postgres']
|
choices: ['sqlite', 'postgres']
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -61,7 +62,7 @@ async function setupQuestionnaire(is_docker) {
|
|||||||
message: 'sqlite db path',
|
message: 'sqlite db path',
|
||||||
default: is_docker ? '/opt/gancio/db.sqlite' : './db.sqlite',
|
default: is_docker ? '/opt/gancio/db.sqlite' : './db.sqlite',
|
||||||
filter: p => path.resolve(cwd, p),
|
filter: p => path.resolve(cwd, p),
|
||||||
when: answers => answers.db.dialect === 'sqlite',
|
when: answers => (db && db==='sqlite') || (answers.db && answers.db.dialect === 'sqlite'),
|
||||||
validate: db_path => db_path.length>0 && fs.existsSync(path.dirname(db_path))
|
validate: db_path => db_path.length>0 && fs.existsSync(path.dirname(db_path))
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -69,7 +70,7 @@ async function setupQuestionnaire(is_docker) {
|
|||||||
name: 'db.host',
|
name: 'db.host',
|
||||||
message: 'Postgres host',
|
message: 'Postgres host',
|
||||||
default: is_docker ? 'db' : 'localhost',
|
default: is_docker ? 'db' : 'localhost',
|
||||||
when: answers => answers.db.dialect === 'postgres',
|
when: answers => (db && db==='postgresql') || (answers.db && answers.db.dialect === 'postgres'),
|
||||||
validate: notEmpty
|
validate: notEmpty
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -77,7 +78,7 @@ async function setupQuestionnaire(is_docker) {
|
|||||||
name: 'db.database',
|
name: 'db.database',
|
||||||
message: 'DB name',
|
message: 'DB name',
|
||||||
default: 'gancio',
|
default: 'gancio',
|
||||||
when: answers => answers.db.dialect === 'postgres',
|
when: answers => (db && db==='postgresql') || (answers.db && answers.db.dialect === 'postgres'),
|
||||||
validate: notEmpty
|
validate: notEmpty
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -85,7 +86,7 @@ async function setupQuestionnaire(is_docker) {
|
|||||||
name: 'db.username',
|
name: 'db.username',
|
||||||
message: 'DB user',
|
message: 'DB user',
|
||||||
default: 'gancio',
|
default: 'gancio',
|
||||||
when: answers => answers.db.dialect === 'postgres',
|
when: answers => (db && db==='postgresql') || (answers.db && answers.db.dialect === 'postgres'),
|
||||||
validate: notEmpty
|
validate: notEmpty
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -94,7 +95,7 @@ async function setupQuestionnaire(is_docker) {
|
|||||||
type: 'password',
|
type: 'password',
|
||||||
message: 'DB password',
|
message: 'DB password',
|
||||||
default: 'gancio',
|
default: 'gancio',
|
||||||
when: answers => answers.db.dialect === 'postgres',
|
when: answers => (db && db==='postgresql') || (answers.db && answers.db.dialect === 'postgres'),
|
||||||
validate: async (password, options) => {
|
validate: async (password, options) => {
|
||||||
try {
|
try {
|
||||||
const db = new sequelize({ ...options.db, dialect: 'postgres' , password, logging: false })
|
const db = new sequelize({ ...options.db, dialect: 'postgres' , password, logging: false })
|
||||||
@@ -112,7 +113,8 @@ async function setupQuestionnaire(is_docker) {
|
|||||||
questions.push({
|
questions.push({
|
||||||
name: 'upload_path',
|
name: 'upload_path',
|
||||||
message: 'Where gancio has to store media?',
|
message: 'Where gancio has to store media?',
|
||||||
default: '/opt/gancio/uploads',
|
default: is_docker ? '/opt/gancio/uploads' : './uploads',
|
||||||
|
when: answers => !is_docker,
|
||||||
filter: p => path.resolve(cwd, p),
|
filter: p => path.resolve(cwd, p),
|
||||||
validate: async p => {
|
validate: async p => {
|
||||||
let exists = fs.existsSync(p)
|
let exists = fs.existsSync(p)
|
||||||
@@ -182,9 +184,6 @@ async function upgrade (options) {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
const migrations = await umzug.up()
|
const migrations = await umzug.up()
|
||||||
if (migrations.length) {
|
|
||||||
consola.info('Migrations executed: ', migrations.map(m => m.file))
|
|
||||||
}
|
|
||||||
db.close()
|
db.close()
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -205,10 +204,10 @@ If this is your first run use 'gancio setup --config <CONFIG_FILE.json>' `)
|
|||||||
}
|
}
|
||||||
|
|
||||||
async function setup (options) {
|
async function setup (options) {
|
||||||
consola.info('DOCKER ', options.docker)
|
|
||||||
consola.info(`You're going to setup gancio on this machine.`)
|
consola.info(`You're going to setup gancio on this machine.`)
|
||||||
const config = await setupQuestionnaire(options.docker)
|
const config = await setupQuestionnaire(options.docker, options.db)
|
||||||
await firstrun.setup(config, options.config)
|
const ret = await firstrun.setup(config, options.config)
|
||||||
|
if (!ret) process.exit(-1)
|
||||||
if (options.docker) {
|
if (options.docker) {
|
||||||
consola.info(`You can edit ./config.json to modify your configuration.`)
|
consola.info(`You can edit ./config.json to modify your configuration.`)
|
||||||
consola.info(`Start the server with "docker-compose up"`)
|
consola.info(`Start the server with "docker-compose up"`)
|
||||||
@@ -229,6 +228,9 @@ require('yargs')
|
|||||||
default: false,
|
default: false,
|
||||||
type: 'boolean'
|
type: 'boolean'
|
||||||
})
|
})
|
||||||
|
.option('db', {
|
||||||
|
describe: 'Specify db type',
|
||||||
|
})
|
||||||
.option('config', {
|
.option('config', {
|
||||||
alias: 'c',
|
alias: 'c',
|
||||||
describe: 'Configuration file',
|
describe: 'Configuration file',
|
||||||
|
|||||||
@@ -26,14 +26,14 @@ module.exports = {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
await db.user.findAll()
|
await db.user.findAll()
|
||||||
consola.warn(`⚠️ Non empty db! Please move your current db elsewhere than retry.`)
|
consola.warn(`⚠️ Non empty db! Please move your current db elsewhere than retry.`)
|
||||||
return -1
|
return false
|
||||||
} catch(e) { }
|
} catch(e) { }
|
||||||
|
|
||||||
consola.info(`Create tables schema`)
|
consola.info(`Create tables schema`)
|
||||||
await db.sequelize.sync().catch(e => {
|
await db.sequelize.sync().catch(e => {
|
||||||
consola.error('Error creating tables', e)
|
consola.error('Error creating tables', e)
|
||||||
return -1
|
return false
|
||||||
})
|
})
|
||||||
|
|
||||||
// create admin user
|
// create admin user
|
||||||
|
|||||||
Reference in New Issue
Block a user