Commit 803a2171 authored by les's avatar les
Browse files

cleaning documentation

parent f5a2c788
......@@ -9,35 +9,35 @@
"1": {
"id": "1",
"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 configuration, look here for options. "db": { "dialect": "sqlite", "storage": "/tmp/db.sqlite" } Upload path Where to save images "upload_path": "./uploads" SMTP Admin Email of administrator. Email from gancio comes from this email. 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_email": "", "secret": "notsosecret" }",
"url": "https://gancio.org/config",
"relUrl": "/config"
},
"2": {
"id": "2",
"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",
"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 Launch interactive setup gancio setup --config config.json Start gancio start --config config.json Point your web browser to http://localhost:13120 or where you selected during setup. Setup nginx as a proxy To deploy gancio in production you should use something like pm2: sudo yarn global add pm2 pm2 start gancio -- --config config.json # Run this command to run your application as a service: sudo env PATH=$PATH:/usr/local/bin pm2 startup -u gancio",
"url": "https://gancio.org/install/debian",
"relUrl": "/install/debian"
},
"3": {
"id": "3",
"title": "Hacking",
"content": "Development Stack Gancio is built with following technologies: Nuxt.js Vue.js Express Node.js Sequelize Element.ui Testing on your own machine Download source git clone https://framagit.org/les/gancio Install dependencies yarn Hacking yarn dev",
"content": "Development Stack Gancio is built with following technologies: Nuxt.js Vue.js Express Node.js Sequelize Element.ui Testing on your own machine Download source git clone https://framagit.org/les/gancio Install dependencies yarn Hacking yarn dev Please use the issue board and the forum to discuss any modification.",
"url": "https://gancio.org/dev",
"relUrl": "/dev"
},
"4": {
"id": "4",
"title": "Docker",
"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://framagit.org/les/gancio/raw/master/docker/Dockerfile wget https://framagit.org/les/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://framagit.org/les/gancio/raw/master/docker/Dockerfile wget https://framagit.org/les/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.",
"content": "Initial setup Use sqlite Use postgreSQL Start gancio Initial setup 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 sqlite Download docker-compose.yml and Dockerfile wget https://framagit.org/les/gancio/raw/master/docker/Dockerfile wget https://framagit.org/les/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 mkdir user_locale Build docker image and launch interactive setup in one step docker-compose run --rm gancio gancio setup --docker --db=sqlite Use postgreSQL Download docker-compose.yml and Dockerfile wget https://framagit.org/les/gancio/raw/master/docker/Dockerfile wget https://framagit.org/les/gancio/raw/master/docker/docker-compose.postgresql.yml -O docker.compose.yml Create an empty configuration (this is needed) touch config.json mkdir user_locale Build docker image and launch interactive setup in one step docker-compose run --rm gancio gancio setup --docker --db=postgresql Start gancio Run your container docker-compose up -d Look at logs with docker-compose logs 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",
"relUrl": "/install/docker"
},
"5": {
"id": "5",
"title": "Home",
"content": "Gancio A shared agenda for local communities. Get started now Demo Source About the project Gancio is made with :heart: by hacklab underscore License Gancio is distributed by an AGPL-3.0 Licence.",
"content": "Gancio A shared agenda for local communities. Get started now Demo Source Features Very easy UI User registration (you can follow them from fediverse personally or follow the whole instance with a special user) Support anonymous event (admin confirmation needed) Multidays events support (festival, conferences…) Recurrent events support (each monday, each two monday, each monday and friday, each first of month, each first monday of month, etc..) Filters events for tags or places RSS and ICS export (with filters) embeddable iframe (example) boost / bookmark / comment events from mastodon! Lot of configurations available (user registration open/close, enable AP federation, enable recurrent events) About the project Gancio is made with :heart: by hacklab underscore License Gancio is distributed by an AGPL-3.0 Licence.",
"url": "https://gancio.org/",
"relUrl": "/"
},
......@@ -58,14 +58,14 @@
"8": {
"id": "8",
"title": "Support a new language",
"content": "Add a new locale watch this commit https://framagit.org/les/gancio/commit/cd95c7eb3b9e4bc4832a7b33d8d79b4fd3cbda2d",
"content": "Add a new locale watch this commit",
"url": "https://gancio.org/dev/locales",
"relUrl": "/dev/locales"
},
"9": {
"id": "9",
"title": "Migration",
"content": "Migration If you need to modify the db’s structure while hacking, it’s super easy, just change server/api/models/. If you then decide that your changes are good for production, a sequelize migration is needed: Create a migration: ./node_modules/.bin/sequelize migration:generate --name your_migration",
"content": "If you need to modify the db’s structure while hacking, just change server/api/models/ and remember to create a migration, to understand how things works check the sequelize documentation",
"url": "https://gancio.org/dev/migration",
"relUrl": "/dev/migration"
},
......
......@@ -326,6 +326,7 @@ This shoud be a <code class="highlighter-rouge">.json</code> or a <code class="h
<ul>
<li>
<h3 id="database">Database</h3>
<p>DB configuration, look <a href="https://sequelize.org/master/class/lib/sequelize.js~Sequelize.html#instance-constructor-constructor">here</a> for options.</p>
<div class="language-json highlighter-rouge">
<div class="highlight"><pre class="highlight"><code><span class="s2">"db"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
</span><span class="s2">"dialect"</span><span class="p">:</span><span class="w"> </span><span class="s2">"sqlite"</span><span class="p">,</span><span class="w">
......@@ -343,6 +344,7 @@ This shoud be a <code class="highlighter-rouge">.json</code> or a <code class="h
</li>
<li>
<h3 id="admin">Admin</h3>
<p>Email of administrator. Email from gancio comes from this email.</p>
</li>
<li>
<h3 id="favicon">Favicon</h3>
......@@ -402,7 +404,7 @@ user_locale’s content.</small></p>
</span><span class="s2">"secure"</span><span class="p">:</span><span class="w"> </span><span class="kc">true</span><span class="p">,</span><span class="w">
</span><span class="s2">"host"</span><span class="p">:</span><span class="w"> </span><span class="s2">""</span><span class="w">
</span><span class="p">},</span><span class="w">
</span><span class="s2">"admin"</span><span class="p">:</span><span class="w"> </span><span class="s2">""</span><span class="p">,</span><span class="w">
</span><span class="s2">"admin_email"</span><span class="p">:</span><span class="w"> </span><span class="s2">""</span><span class="p">,</span><span class="w">
</span><span class="s2">"secret"</span><span class="p">:</span><span class="w"> </span><span class="s2">"notsosecret"</span><span class="w">
</span><span class="p">}</span><span class="w">
</span></code></pre></div></div>
......
......@@ -295,6 +295,8 @@
</li>
</ol>
<p>Please use the <a href="https://framagit.org/les/gancio/-/boards">issue board</a> and the <a href="https://framavox.org/g/hMXTDgtJ/gancio">forum</a> to discuss any modification.</p>
<hr>
......
......@@ -275,7 +275,7 @@
<div id="main-content" class="page-content" role="main">
<h3 id="add-a-new-locale">Add a new locale</h3>
<p>watch this commit https://framagit.org/les/gancio/commit/cd95c7eb3b9e4bc4832a7b33d8d79b4fd3cbda2d</p>
<p>watch <a href="https://framagit.org/les/gancio/commit/cd95c7eb3b9e4bc4832a7b33d8d79b4fd3cbda2d">this commit</a></p>
......
......@@ -274,15 +274,8 @@
<div id="main-content" class="page-content" role="main">
<h3 id="migration">Migration</h3>
<p>If you need to modify the db’s structure while hacking, it’s super easy,
just change <code class="highlighter-rouge">server/api/models/</code>.</p>
<p>If you then decide that your changes are good for production, a
sequelize migration is needed:</p>
<h4 id="create-a-migration">Create a migration:</h4>
<p><code class="highlighter-rouge">./node_modules/.bin/sequelize migration:generate --name your_migration</code></p>
<p>If you need to modify the db’s structure while hacking, just change <code class="highlighter-rouge">server/api/models/</code> and
remember to create a migration, to understand how things works <a href="https://sequelize.org/master/manual/migrations.html">check the sequelize documentation</a></p>
......
<?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-09-21T23:24:31+02:00</updated><id>https://gancio.org/feed.xml</id><title type="html">Gancio</title><subtitle>A shared agenda for local communities</subtitle></feed>
\ No newline at end of file
<?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-09-24T11:45:35+02:00</updated><id>https://gancio.org/feed.xml</id><title type="html">Gancio</title><subtitle>A shared agenda for local communities</subtitle></feed>
\ No newline at end of file
......@@ -279,6 +279,20 @@
<a href="assets/mobile2.png" data-fancybox="group" data-caption="Home mobile"><img src="assets/thumbs/mobile2.png" alt="assets/thumbs/mobile2.png"></a>
<a href="assets/admin_users.png" data-fancybox="group" data-caption="Admin interface"><img src="assets/thumbs/admin_users.png" alt="assets/thumbs/admin_users.png"></a></p>
<h2 id="features">Features</h2>
<ul>
<li>Very easy UI</li>
<li>User registration (you can follow them from fediverse personally or follow the whole instance with a special user)</li>
<li>Support anonymous event (admin confirmation needed)</li>
<li>Multidays events support (festival, conferences…)</li>
<li>Recurrent events support (each monday, each two monday, each monday and friday, each first of month, each first monday of month, etc..)</li>
<li>Filters events for tags or places</li>
<li>RSS and ICS export (with filters)</li>
<li>embeddable iframe (<a href="https://gancio.cisti.org/embed/list?title=Upcoming%20events">example</a>)</li>
<li>boost / bookmark / comment events from mastodon!</li>
<li>Lot of configurations available (user registration open/close, enable AP federation, enable recurrent events)</li>
</ul>
<h3 id="about-the-project">About the project</h3>
<p>Gancio is made with <img class="emoji" title=":heart:" alt=":heart:" src="https://github.githubassets.com/images/icons/emoji/unicode/2764.png" height="20" width="20"> by <a href="https://autistici.org/underscore">hacklab underscore</a></p>
......
......@@ -304,14 +304,12 @@ su postgres <span class="nt">-c</span> psql
su gancio
</code></pre></div> </div>
</li>
<li>Test &amp; launch interactive setup
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>gancio <span class="nt">--help</span>
gancio setup <span class="nt">--config</span> config.json
<li>Launch interactive setup
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>gancio setup <span class="nt">--config</span> config.json
</code></pre></div> </div>
</li>
<li>Start
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>gancio <span class="nt">--help</span>
gancio start <span class="nt">--config</span> config.json
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>gancio start <span class="nt">--config</span> config.json
</code></pre></div> </div>
</li>
<li>
......@@ -320,12 +318,14 @@ gancio start <span class="nt">--config</span> config.json
<li>
<p><a href="/install/nginx">Setup nginx as a proxy</a></p>
</li>
<li>Deploy in production<br />
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>
<li>To deploy gancio in production you should use something like <strong><a href="http://pm2.keymetrics.io/">pm2</a></strong>:</li>
</ol>
<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 start gancio <span class="nt">--</span> <span class="nt">--config</span> config.json
<span class="c"># Run this command to run your application as a service:</span>
<span class="nb">sudo env </span><span class="nv">PATH</span><span class="o">=</span><span class="nv">$PATH</span>:/usr/local/bin pm2 startup <span class="nt">-u</span> gancio
</code></pre></div></div>
......
......@@ -275,61 +275,92 @@
<div id="main-content" class="page-content" role="main">
<h2 id="install-with-docker">Install with docker</h2>
<h2 class="no_toc text-delta" id="table-of-contents">Table of contents</h2>
<ol id="markdown-toc">
<li><a href="#initial-setup" id="markdown-toc-initial-setup">Initial setup</a></li>
<li><a href="#use-sqlite" id="markdown-toc-use-sqlite">Use sqlite</a></li>
<li><a href="#use-postgresql" id="markdown-toc-use-postgresql">Use postgreSQL</a></li>
<li><a href="#start-gancio" id="markdown-toc-start-gancio">Start gancio</a></li>
</ol>
<h2 id="initial-setup">Initial setup</h2>
<p><strong>You do not need to clone the full repo as we distribute gancio via npm.</strong><br>
A <a href="https://framagit.org/les/gancio/raw/docker/docker/Dockerfile">Dockerfile</a> and a docker-compose.yml are the only files needed.</p>
<ol>
<li>Create a directory where everything related to gancio is stored (db, images, config)
<ul>
<li>
<strong>Create a directory where everything related to gancio is stored (db, images, config)</strong>
<div class="language-bash highlighter-rouge">
<div class="highlight"><pre class="highlight"><code><span class="nb">mkdir</span> /opt/gancio
<span class="nb">cd</span> /opt/gancio
</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"> <small>you can choose a different directory.</small></p>
<p><small>note that you can choose a different directory.</small></p>
</li>
</ol>
</ul>
<h3 id="using-postgresql">Using postgreSQL</h3>
<ol>
<li>Download docker-compose.yml and Dockerfile
<div class="language-bash highlighter-rouge">
<h2 id="use-sqlite">Use sqlite</h2>
<div class="code-example bg-grey-lt-100">
<ol>
<li>
<strong>Download docker-compose.yml and Dockerfile</strong>
<div class="language-bash highlighter-rouge">
<div class="highlight"><pre class="highlight"><code>wget https://framagit.org/les/gancio/raw/master/docker/Dockerfile
wget https://framagit.org/les/gancio/raw/master/docker/docker-compose.postgresql.yml <span class="nt">-O</span> docker.compose.yml
</code></pre></div> </div>
</li>
<li>Create an empty configiguration (<strong>this is needed</strong>)
<div class="highlighter-rouge">
<div class="highlight"><pre class="highlight"><code>touch config.json
</code></pre></div> </div>
</li>
</ol>
wget https://framagit.org/les/gancio/raw/master/docker/docker-compose.sqlite.yml <span class="se">\</span>
<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="highlight"><pre class="highlight"><code>touch config.json db.sqlite
mkdir user_locale
</code></pre></div> </div>
</li>
<li>Build docker image and launch interactive setup in one step
<div class="highlighter-rouge">
<div class="highlight"><pre class="highlight"><code>docker-compose run --rm gancio gancio setup --docker --db=sqlite
</code></pre></div> </div>
</li>
</ol>
</div>
<h3 id="using-sqlite">Using sqlite</h3>
<ol>
<li>Download docker-compose.yml and Dockerfile
<div class="language-bash highlighter-rouge">
<h2 id="use-postgresql">Use postgreSQL</h2>
<div class="code-example bg-grey-lt-100">
<ol>
<li>
<strong>Download docker-compose.yml and Dockerfile</strong>
<div class="language-bash highlighter-rouge">
<div class="highlight"><pre class="highlight"><code>wget https://framagit.org/les/gancio/raw/master/docker/Dockerfile
wget https://framagit.org/les/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="highlight"><pre class="highlight"><code>touch config.json db.sqlite
</code></pre></div> </div>
</li>
</ol>
wget https://framagit.org/les/gancio/raw/master/docker/docker-compose.postgresql.yml <span class="se">\ </span>
<span class="nt">-O</span> docker.compose.yml
</code></pre></div> </div>
</li>
<li>Create an empty configuration (<strong>this is needed</strong>)
<div class="highlighter-rouge">
<div class="highlight"><pre class="highlight"><code>touch config.json
mkdir user_locale
</code></pre></div> </div>
</li>
<li>Build docker image and launch interactive setup in one step
<div class="highlighter-rouge">
<div class="highlight"><pre class="highlight"><code>docker-compose run --rm gancio gancio setup --docker --db=postgresql
</code></pre></div> </div>
</li>
</ol>
</div>
<h3 id="finish">Finish</h3>
<h2 id="start-gancio">Start gancio</h2>
<ol>
<li>Build docker image and launch interactive setup in one step
<div class="highlighter-rouge">
<div class="highlight"><pre class="highlight"><code>docker-compose run --rm gancio gancio setup --docker
</code></pre></div> </div>
</li>
<li>Run your container
<div class="language-bash highlighter-rouge">
<div class="highlight"><pre class="highlight"><code>docker-compose up <span class="nt">-d</span>
</code></pre></div> </div>
</li>
<li>Look at logs with
<div class="language-bash highlighter-rouge">
<div class="highlight"><pre class="highlight"><code>docker-compose logs
</code></pre></div> </div>
</li>
<li>
......
......@@ -41,6 +41,7 @@ This probably support unix socket too :D
```
- ### Database
DB configuration, look [here](https://sequelize.org/master/class/lib/sequelize.js~Sequelize.html#instance-constructor-constructor) for options.
```json
"db": {
"dialect": "sqlite",
......@@ -53,6 +54,8 @@ Where to save images
- ### SMTP
- ### Admin
Email of administrator. Email from gancio comes from this email.
- ### Favicon
You could specify another favicon. This is also used as logo (top-left
corner):
......@@ -108,7 +111,7 @@ user_locale's content.</small>
"secure": true,
"host": ""
},
"admin": "",
"admin_email": "",
"secret": "notsosecret"
}
```
......@@ -33,3 +33,5 @@ yarn
```bash
yarn dev
```
Please use the [issue board](https://framagit.org/les/gancio/-/boards) and the [forum](https://framavox.org/g/hMXTDgtJ/gancio) to discuss any modification.
\ No newline at end of file
......@@ -6,4 +6,4 @@ parent: Hacking
---
### Add a new locale
watch this commit https://framagit.org/les/gancio/commit/cd95c7eb3b9e4bc4832a7b33d8d79b4fd3cbda2d
\ No newline at end of file
watch [this commit](https://framagit.org/les/gancio/commit/cd95c7eb3b9e4bc4832a7b33d8d79b4fd3cbda2d)
\ No newline at end of file
......@@ -5,14 +5,7 @@ permalink: /dev/migration
parent: Hacking
---
### Migration
If you need to modify the db's structure while hacking, it's super easy,
just change `server/api/models/`.
If you then decide that your changes are good for production, a
sequelize migration is needed:
#### Create a migration:
`./node_modules/.bin/sequelize migration:generate --name your_migration`
If you need to modify the db's structure while hacking, just change `server/api/models/` and
remember to create a migration, to understand how things works [check the sequelize documentation](https://sequelize.org/master/manual/migrations.html)
......@@ -21,6 +21,18 @@ A shared agenda for local communities.
[![assets/thumbs/admin_users.png](assets/thumbs/admin_users.png)](assets/admin_users.png){: data-fancybox="group" data-caption="Admin interface"}
## Features
- Very easy UI
- User registration (you can follow them from fediverse personally or follow the whole instance with a special user)
- Support anonymous event (admin confirmation needed)
- Multidays events support (festival, conferences...)
- Recurrent events support (each monday, each two monday, each monday and friday, each first of month, each first monday of month, etc..)
- Filters events for tags or places
- RSS and ICS export (with filters)
- embeddable iframe ([example](https://gancio.cisti.org/embed/list?title=Upcoming events))
- boost / bookmark / comment events from mastodon!
- Lot of configurations available (user registration open/close, enable AP federation, enable recurrent events)
### About the project
Gancio is made with :heart: by [hacklab underscore](https://autistici.org/underscore)
......
......@@ -38,25 +38,25 @@ adduser gancio
su gancio
```
1. Test & launch interactive setup
1. 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](/install/nginx)
1. Deploy in production
If you don't use the [docker way](/install/docker), in production you should use something like **[pm2](http://pm2.keymetrics.io/)**:
1. To deploy gancio in production you should use something like **[pm2](http://pm2.keymetrics.io/)**:
```bash
sudo yarn global add pm2
pm2 gancio start --config config.json
pm2 start gancio -- --config config.json
# Run this command to run your application as a service:
sudo env PATH=$PATH:/usr/local/bin pm2 startup -u gancio
```
......@@ -4,54 +4,79 @@ title: Docker
permalink: /install/docker
parent: Install
---
## Table of contents
{: .no_toc .text-delta }
## Install with docker
1. TOC
{:toc}
## Initial setup
**You do not need to clone the full repo as we distribute gancio via npm.**
A [Dockerfile](https://framagit.org/les/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)
- __Create a directory where everything related to gancio is stored (db, images, config)__
```bash
mkdir /opt/gancio
cd /opt/gancio
```
:information_source: <small>you can choose a different directory.</small>
<small>note that you can choose a different directory.</small>
### Using postgreSQL
1. Download docker-compose.yml and Dockerfile
## Use sqlite
<div class='code-example bg-grey-lt-100' markdown="1">
1. **Download docker-compose.yml and Dockerfile**
```bash
wget https://framagit.org/les/gancio/raw/master/docker/Dockerfile
wget https://framagit.org/les/gancio/raw/master/docker/docker-compose.postgresql.yml -O docker.compose.yml
wget https://framagit.org/les/gancio/raw/master/docker/docker-compose.sqlite.yml \
-O docker-compose.yml
```
1. Create an empty configiguration (**this is needed**)
1. Create an empty db and config (**this is needed**)
```
touch config.json
touch config.json db.sqlite
mkdir user_locale
```
### Using sqlite
1. Download docker-compose.yml and Dockerfile
1. Build docker image and launch interactive setup in one step
```
docker-compose run --rm gancio gancio setup --docker --db=sqlite
```
</div>
## Use postgreSQL
<div class='code-example bg-grey-lt-100' markdown="1">
1. **Download docker-compose.yml and Dockerfile**
```bash
wget https://framagit.org/les/gancio/raw/master/docker/Dockerfile
wget https://framagit.org/les/gancio/raw/master/docker/docker-compose.sqlite.yml -O docker-compose.yml
wget https://framagit.org/les/gancio/raw/master/docker/docker-compose.postgresql.yml \
-O docker.compose.yml
```
1. Create an empty db and config (**this is needed**)
1. Create an empty configuration (**this is needed**)
```
touch config.json db.sqlite
touch config.json
mkdir user_locale
```
### Finish
1. Build docker image and launch interactive setup in one step
```
docker-compose run --rm gancio gancio setup --docker
docker-compose run --rm gancio gancio setup --docker --db=postgresql
```
</div>
## Start gancio
1. Run your container
```bash
docker-compose up -d
```
1. Look at logs with
```bash
docker-compose logs
```
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:
......
......@@ -276,7 +276,7 @@ const userController = {
const user = await User.create(req.body)
try {
mail.send(user.email, 'register', { user, config })
mail.send(config.admin, 'admin_register', { user, config })
mail.send(config.admin_email, 'admin_register', { user, config })
} catch (e) {
return res.status(400).json(e)
}
......
......@@ -22,7 +22,7 @@ const mail = {
}
},
message: {
from: `${config.title} <${config.admin}>`
from: `${config.title} <${config.admin_email}>`
},
send: true,
i18n: {
......
......@@ -33,7 +33,10 @@ async function setupQuestionnaire(is_docker, db) {
message: 'Specify a baseurl for this gancio installation! (eg. http://gancio.cisti.org)',
name: 'baseurl',
default: 'http://localhost:13120',
validate: notEmpty
validate: value => {
if (!value) return false
return /^https?:\/\//.test(value)
}
})
questions.push({
......@@ -134,6 +137,9 @@ async function setupQuestionnaire(is_docker, db) {
questions.push({
name: 'admin.email',
message: `Admin email (a first user with this username will be created)`,
default: options => {
return options.title.replace(' ', '').toLowerCase() + '@' + options.baseurl
},
validate: notEmpty
})
......
......@@ -61,9 +61,9 @@ const Helpers = {
// event is sent by user that published it and by the admin instance
// collect followers from admin and user
const instanceAdmin = await User.findOne({ where: { email: config.admin }, include: { model: FedUsers, as: 'followers' } })
const instanceAdmin = await User.findOne({ where: { email: config.admin_email }, include: { model: FedUsers, as: 'followers' } })
if (!instanceAdmin || !instanceAdmin.username) {
debug('Instance admin not found (there is no user with email => %s)', config.admin)
debug('Instance admin not found (there is no user with email => %s)', config.admin_email)
return
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment