Verified Commit f392f0a3 authored by les's avatar les
Browse files

Merge branch 'dev'

parents 01e474d3 44cfe4a7
# Created by .ignore support plugin (hsz.mobi)
### Gancio dev configuration
releases
wp-plugin/wpgancio
config/development.json
gancio_config.json
config.json
......
......@@ -72,7 +72,7 @@ li {
overflow: hidden;
margin: 0.5rem 1rem 0.5rem 1rem;
font-size: 1.1em !important;
line-height: 1em !important;
line-height: 1.1em !important;
}
.body {
......
......@@ -7,5 +7,8 @@ nav_order: 9
## Contacts
### :elephant: Mastodon ⇒ [@gancio@mastodon.cisti.org](https://mastodon.cisti.org/@gancio)
- :elephant: Mastodon ⇒ [@gancio@mastodon.cisti.org](https://mastodon.cisti.org/@gancio)
- :email: Email ⇒ [info@cisti.org](mailto:info@cisti.org)
- IRC ⇒ #gancio @ irc.autistici.org (sometimes...)
......@@ -19,7 +19,7 @@ apt-get update && apt-get install yarn
1. Install Gancio
```bash
yarn global add --silent {{site.url}}{% link /latest.tgz %} 2> /dev/null
yarn global add --silent {{site.url}}/latest.tgz 2> /dev/null
```
1. Setup with postgreSQL __(optional as you can choose sqlite)__
......@@ -64,6 +64,6 @@ sudo pm2 startup -u gancio
## Upgrade
```bash
sudo yarn global add --silent {{site.url}}{% link /latest.tgz %} 2> /dev/null
sudo yarn global add --silent {{site.url}}/latest.tgz 2> /dev/null
sudo service pm2 restart
```
......@@ -79,7 +79,7 @@ cd ~
cd /etc/nginx/sites-available
```
1. [Setup nginx as a proxy]({% link install/nginx.md %}
1. [Setup nginx as a proxy]({% link install/nginx.md %})
1. Point your web browser to [http://localhost:13120](http://localhost:13120) or where you specified during setup and enjoy :tada:
......
---
t---
layout: default
title: Nginx setup
permalink: /install/nginx
......
<template lang='pug'>
v-app
v-app(app)
Snackbar
Confirm
Nav
v-main
v-main(app)
v-fade-transition(hide-on-leave)
nuxt
......
......@@ -131,7 +131,6 @@
"resize-img": "2.0.0",
"underscore": "1.13.1",
"@nuxtjs/vuetify/**/sass": "1.32.12",
"css-what": "5.0.1",
"postcss": "7.0.36",
"glob-parent": "5.1.2",
"core-js": "3.14.0"
......
<template lang='pug'>
v-row.mt-5(align='center' justify='center')
v-col(cols='12' md="6" lg="5" xl="4")
v-card(light)
v-card-title {{settings.title}} - {{$t('common.authorize')}}
v-card-text
u {{$auth.user.email}}
div
p(v-html="$t('oauth.authorization_request', { app: client.name, instance_name: settings.title })")
ul
li(v-for="s in scope.split(' ')") {{$t(`oauth.scopes.${scope}`)}}
span(v-html="$t('oauth.redirected_to', {url: $route.query.redirect_uri})")
v-card-actions
v-spacer
v-btn(color='error' to='/') {{$t('common.cancel')}}
v-btn(:href='authorizeURL' color='success') {{$t('common.authorize')}}
.d-flex.justify-space-around
v-card.mt-5(max-width='600px')
v-card-title {{settings.title}} - {{$t('common.authorize')}}
v-card-text
u {{$auth.user.email}}
div
p(v-html="$t('oauth.authorization_request', { app: client.name, instance_name: settings.title })")
ul.mb-2
li(v-for="s in scope.split(' ')") {{$t(`oauth.scopes.${scope}`)}}
span(v-html="$t('oauth.redirected_to', {url: $route.query.redirect_uri})")
v-card-actions
v-spacer
v-btn(color='error' to='/') {{$t('common.cancel')}}
v-btn(:href='authorizeURL' color='success') {{$t('common.authorize')}}
</template>
<script>
......
......@@ -118,7 +118,7 @@ const eventController = {
order: [[Resource, 'id', 'DESC']]
})
} catch (e) {
log.error(e)
log.error('[EVENT]', e)
return res.sendStatus(400)
}
......@@ -194,7 +194,7 @@ const eventController = {
const notifier = require('../../notifier')
notifier.notifyEvent('Create', event.id)
} catch (e) {
log.error(e)
log.error('[EVENT]', e)
res.sendStatus(404)
}
},
......@@ -264,7 +264,7 @@ const eventController = {
async add (req, res) {
// req.err comes from multer streaming error
if (req.err) {
log.info(req.err)
log.warn(req.err)
return res.status(400).json(req.err.toString())
}
......@@ -272,6 +272,11 @@ const eventController = {
const body = req.body
const recurrent = body.recurrent ? JSON.parse(body.recurrent) : null
if (!body.place_name) {
log.warn('Place is required')
return res.status(400).send('Place is required')
}
const eventDetails = {
title: body.title,
// remove html tags
......@@ -329,7 +334,7 @@ const eventController = {
notifier.notifyEvent('Create', event.id)
}
} catch (e) {
log.error(e)
log.error('[EVENT ADD]', e)
res.sendStatus(400)
}
},
......@@ -414,6 +419,7 @@ const eventController = {
}
const notifier = require('../../notifier')
await notifier.notifyEvent('Delete', event.id)
log.debug('[EVENT REMOVED]', event.title)
await event.destroy()
res.sendStatus(200)
} else {
......@@ -469,7 +475,8 @@ const eventController = {
{ model: Place, required: true, attributes: ['id', 'name', 'address'] }
]
}).catch(e => {
log.error(e)
log.error('[EVENT]', e)
return []
})
return events.map(e => {
......
......@@ -42,7 +42,7 @@ const oauthController = {
delete client.id
res.json(client)
} catch (e) {
log.error(e)
log.error('[OAUTH CLIENT]', e)
res.status(400).json(e)
}
},
......
......@@ -103,7 +103,7 @@ const settingsController = {
settingsController[is_secret ? 'secretSettings' : 'settings'][key] = value
return true
} catch (e) {
log.error(e)
log.error('[SETTING SET]', e)
return false
}
},
......@@ -129,7 +129,7 @@ const settingsController = {
.png({ quality: 90 })
.toFile(baseImgPath + '.png', async (err, info) => {
if (err) {
log.error(err)
log.error('[LOGO]', err)
}
const image = await readFile(baseImgPath + '.png')
const favicon = await toIco([image], { sizes: [64], resize: true })
......
......@@ -103,7 +103,7 @@ const userController = {
mail.send(config.admin_email, 'admin_register', { user, config })
res.sendStatus(200)
} catch (e) {
log.error('Registration error: "%s"', e)
log.error('Registration error:', e)
res.status(404).json(e)
}
},
......@@ -116,7 +116,7 @@ const userController = {
mail.send(user.email, 'user_confirm', { user, config }, req.settings.locale)
res.json(user)
} catch (e) {
log.error('User creation error: %s', e)
log.error('User creation error:', e)
res.status(404).json(e)
}
},
......@@ -127,7 +127,7 @@ const userController = {
user.destroy()
res.sendStatus(200)
} catch (e) {
log.error('User removal error: "%s"', e)
log.error('User removal error:"', e)
res.status(404).json(e)
}
}
......
......@@ -145,7 +145,7 @@ api.use((req, res) => res.sendStatus(404))
// Handle 500
api.use((error, req, res, next) => {
log.error(error)
log.error('[API ERROR]', error)
res.status(500).send('500: Internal Server Error')
})
......
......@@ -61,7 +61,7 @@ const mail = {
}
return email.send(msg)
.catch(e => {
log.error('Error sending email => %s', e)
log.error('[MAIL]', e)
})
}
}
......
......@@ -34,7 +34,7 @@ oauth.use((req, res) => res.sendStatus(404))
oauth.use((err, req, res, next) => {
const error_msg = err.toString()
log.error(error_msg)
log.error('[OAUTH USE]', error_msg)
res.status(500).send(error_msg)
})
......
......@@ -8,9 +8,7 @@ const config = require('config')
try {
mkdirp.sync(config.upload_path + '/thumb')
} catch (e) {
log.error(e)
}
} catch (e) {}
const DiskStorage = {
_handleFile (req, file, cb) {
......@@ -25,11 +23,11 @@ const DiskStorage = {
let onError = false
const err = e => {
if (onError) {
log.error(err)
log.error('[UPLOAD]', err)
return
}
onError = true
log.error(e)
log.error('[UPLOAD]', e)
req.err = e
cb(null)
}
......
......@@ -126,7 +126,7 @@ const Helpers = {
return res.data
})
.catch(e => {
log.error(`${URL}: ${e}`)
log.error(`get Actor ${URL}`, e)
return false
})
......@@ -195,7 +195,7 @@ const Helpers = {
// .update(req.body)
// .digest('base64')
// if (`SHA-256=${digest}` !== req.headers.signature) {
// log.warning(`Signature mismatch ${req.headers.signature} - ${digest}`)
// log.warn(`Signature mismatch ${req.headers.signature} - ${digest}`)
// return res.status(401).send('Signature mismatch')
// }
......
......@@ -140,7 +140,7 @@ router.use((req, res) => {
// Handle 500
router.use((error, req, res, next) => {
log.error(error)
log.error('[WEBFINGER]', error)
res.status(500).send('500: Internal Server Error')
})
......
......@@ -163,8 +163,8 @@ module.exports = {
}))
}
} catch (e) {
log.error(e)
res.status(400).json(e.toString)
log.error('[Import URL]', e)
res.status(400).json(e.toString())
}
},
......
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