gancio --help
-gancio setup --config config.json
+ Launch interactive setup
+ gancio setup --config config.json
Start
- gancio --help
-gancio start --config config.json
+ gancio start --config config.json
@@ -320,12 +318,14 @@ gancio start --config config.json
Setup nginx as a proxy
- Deploy in production
-If you don’t use the docker way, in production you should use something like pm2:
+ To deploy gancio in production you should use something like pm2:
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
diff --git a/docs/_site/install/docker.html b/docs/_site/install/docker.html
index 885fb68b..e66af5a9 100644
--- a/docs/_site/install/docker.html
+++ b/docs/_site/install/docker.html
@@ -275,61 +275,92 @@
-
Install with docker
+
Table of contents
+
+
+ - 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)
+
+
-
Using postgreSQL
-
- - Download docker-compose.yml and Dockerfile
-
+
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.postgresql.yml -O docker.compose.yml
-
-
- - Create an empty configiguration (this is needed)
-
-
-
-
-
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)
-
+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
+
+
+
+
-
Finish
+
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
- - Build docker image and launch interactive setup in one step
-
-
docker-compose run --rm gancio gancio setup --docker
-
-
- Run your container
+
+ - Look at logs with
+
-
diff --git a/docs/configuration.md b/docs/configuration.md
index d097aeb3..4c710fb5 100644
--- a/docs/configuration.md
+++ b/docs/configuration.md
@@ -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.
"secure": true,
"host": ""
},
- "admin": "",
+ "admin_email": "",
"secret": "notsosecret"
}
```
diff --git a/docs/dev/dev.md b/docs/dev/dev.md
index 06d84bd3..eb3e32df 100644
--- a/docs/dev/dev.md
+++ b/docs/dev/dev.md
@@ -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
diff --git a/docs/dev/locales.md b/docs/dev/locales.md
index 7110c02a..302f23c2 100644
--- a/docs/dev/locales.md
+++ b/docs/dev/locales.md
@@ -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
diff --git a/docs/dev/migration.md b/docs/dev/migration.md
index f0e65547..4376568c 100644
--- a/docs/dev/migration.md
+++ b/docs/dev/migration.md
@@ -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)
diff --git a/docs/index.md b/docs/index.md
index 166ba8d9..9a567f36 100644
--- a/docs/index.md
+++ b/docs/index.md
@@ -21,6 +21,18 @@ A shared agenda for local communities.
[](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)
diff --git a/docs/install/debian.md b/docs/install/debian.md
index 03fa8027..28609d76 100644
--- a/docs/install/debian.md
+++ b/docs/install/debian.md
@@ -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
```
diff --git a/docs/install/docker.md b/docs/install/docker.md
index 5054e0eb..f66dc0ca 100644
--- a/docs/install/docker.md
+++ b/docs/install/docker.md
@@ -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: you can choose a different directory.
+note that you can choose a different directory.
-### Using postgreSQL
-1. Download docker-compose.yml and Dockerfile
+## Use sqlite
+
+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
-```
-
-1. Create an empty configiguration (**this is needed**)
-```
-touch config.json
-```
-
-### Using sqlite
-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.sqlite.yml \
+ -O docker-compose.yml
```
1. Create an empty db and config (**this is needed**)
```
touch config.json db.sqlite
+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=sqlite
```
+
+
+## Use postgreSQL
+
+
+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
+```
+
+1. Create an empty configuration (**this is needed**)
+```
+touch config.json
+mkdir user_locale
+```
+
+1. Build docker image and launch interactive setup in one step
+```
+docker-compose run --rm gancio gancio setup --docker --db=postgresql
+```
+
+
+
+## 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:
diff --git a/server/api/controller/user.js b/server/api/controller/user.js
index 969046c4..d6277e5d 100644
--- a/server/api/controller/user.js
+++ b/server/api/controller/user.js
@@ -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)
}
diff --git a/server/api/mail.js b/server/api/mail.js
index 5ce85f54..e5bf5056 100644
--- a/server/api/mail.js
+++ b/server/api/mail.js
@@ -22,7 +22,7 @@ const mail = {
}
},
message: {
- from: `${config.title} <${config.admin}>`
+ from: `${config.title} <${config.admin_email}>`
},
send: true,
i18n: {
diff --git a/server/cli.js b/server/cli.js
index 9a8908c0..2bc2fe75 100755
--- a/server/cli.js
+++ b/server/cli.js
@@ -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
})
diff --git a/server/federation/helpers.js b/server/federation/helpers.js
index 5442413d..b5973d29 100644
--- a/server/federation/helpers.js
+++ b/server/federation/helpers.js
@@ -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
}