cleaning documentation

This commit is contained in:
les
2019-09-24 11:46:11 +02:00
parent f5a2c788ac
commit 803a217122
20 changed files with 191 additions and 108 deletions

View File

@@ -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)
}

View File

@@ -22,7 +22,7 @@ const mail = {
}
},
message: {
from: `${config.title} <${config.admin}>`
from: `${config.title} <${config.admin_email}>`
},
send: true,
i18n: {

View File

@@ -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
})

View File

@@ -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
}