This commit is contained in:
lesion 2019-06-26 14:49:19 +02:00
parent bf3677c136
commit 665939a883
2 changed files with 3 additions and 72 deletions

5
.gitignore vendored
View file

@ -1,6 +1,7 @@
# Created by .ignore support plugin (hsz.mobi)
### Gancio production configuration
/config.js
### Gancio dev configuration
config/development.json
### Node template
# Logs

View file

@ -1,70 +0,0 @@
/**
* -[ GANCIO CONFIGURATION ]-
*
* search and replace 'CHANGE ME'
*
* -[ Database configuration ]-
* `development` configuration is enabled running `yarn dev`
* while `production` with `yarn start`
* ref: http://docs.sequelizejs.com/class/lib/sequelize.js~Sequelize.html#instance-constructor-constructor
*
*/
const path = require('path')
const DB_CONF = {
development: {
storage: path.join(__dirname, 'db.sqlite'),
dialect: 'sqlite'
},
production: {
username: 'CHANGE ME',
password: 'CHANGE ME',
database: 'gancio',
host: 'localhost',
dialect: 'postgres',
logging: false
}
}
const env = process.env.NODE_ENV || 'development'
const isDev = env === 'development'
/**
* -[ Main configuration ]-
*
*/
const config = {
server: {
port: '3000',
host: 'localhost', // use 0.0.0.0 to bind to all interface
// uncomment to use unix socket to serve gancio
// path: '/tmp/gancio_socket',
},
locale: 'it',
title: isDev ? 'GANCIO' : 'CHANGE ME',
description: isDev ? 'A shared agenda for radical communities' : 'CHANGE ME',
baseurl: isDev ? 'http://localhost:3000' : 'https://CHANGE_ME',
upload_path: isDev ? '/tmp/gancio_upload' : '/var/gancio/upload/',
// where events/users confirmation email are sent
admin: 'CHANGE ME',
// jwt salt secret, generate it randomly with
// < /dev/urandom tr -dc _A-Z-a-z-0-9 | head -c${1:-32};echo;
secret: isDev ? 'notreallyrandom' : 'CHANGE ME',
// smtp account to send email
smtp: {
host: 'CHANGE ME', // mail.example.com
auth: {
user: 'CHANGE ME',
pass: 'CHANGE ME'
},
secure: true
},
db: DB_CONF[env]
}
module.exports = { ...config, ...config.db }