diff --git a/docs/docker/postgres/docker-compose.yml b/docs/docker/postgres/docker-compose.yml index 8c53cd6e..ad86a9f4 100644 --- a/docs/docker/postgres/docker-compose.yml +++ b/docs/docker/postgres/docker-compose.yml @@ -5,12 +5,13 @@ services: image: postgres container_name: postgres volumes: - - db:/var/lib/postgres + - ./postgres:/var/lib/postgresql/data - /etc/localtime:/etc/localtime:ro environment: - POSTGRES_USER=gancio - POSTGRES_DB=gancio - POSTGRES_PASSWORD=gancio + - PGDATA=/var/lib/postgresql/data restart: always ports: - 5432:5432 @@ -28,4 +29,8 @@ services: depends_on: - db ports: +<<<<<<< HEAD - "127.0.0.1:13120:13120" +======= + - 127.0.0.1:13120:13120 +>>>>>>> master diff --git a/package.json b/package.json index 31c35991..23700ecf 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "gancio", - "version": "0.24.1", + "version": "0.24.2", "description": "A shared agenda for local communities", "author": "lesion", "scripts": { diff --git a/server/firstrun.js b/server/firstrun.js index 70fc183f..8e1220da 100644 --- a/server/firstrun.js +++ b/server/firstrun.js @@ -62,13 +62,15 @@ module.exports = { // announcement: 'TODO: HTML First presentation post' // }) - // send confirmed events to mastodon - await Notification.create({ action: 'Create', type: 'ap', filters: { is_visible: true } }) - await Notification.create({ action: 'Update', type: 'ap', filters: { is_visible: true } }) - await Notification.create({ action: 'Delete', type: 'ap', filters: { is_visible: true } }) + // try { - // send anon events to admin - await Notification.create({ action: 'Create', type: 'admin_email', filters: { is_visible: false } }) + // // send confirmed events to mastodon + await Notification.create({ action: 'Create', type: 'ap', filters: '{ "is_visible": true }' }) + await Notification.create({ action: 'Update', type: 'ap', filters: '{ "is_visible": true }' }) + await Notification.create({ action: 'Delete', type: 'ap', filters: '{ "is_visible": true }' }) + // // send anon events to admin + await Notification.create({ action: 'Create', type: 'admin_email', filters: '{ "is_visible": false }' }) + // } // TODO email's notifications // await db.notification.create({ action: 'Create', type: 'email', filters: { is_visible: true } }) diff --git a/server/migrations/20201103161446-notification_queue.js b/server/migrations/20201103161446-notification_queue.js new file mode 100644 index 00000000..b03db5eb --- /dev/null +++ b/server/migrations/20201103161446-notification_queue.js @@ -0,0 +1,20 @@ +'use strict' + +module.exports = { + up: (queryInterface, Sequelize) => { + return queryInterface.bulkInsert('notifications', [ + + // send AP message + { action: 'Create', type: 'ap', filters: '{ "is_visible": true }', createdAt: new Date(), updatedAt: new Date() }, + { action: 'Update', type: 'ap', filters: '{ "is_visible": true }', createdAt: new Date(), updatedAt: new Date() }, + { action: 'Delete', type: 'ap', filters: '{ "is_visible": true }', createdAt: new Date(), updatedAt: new Date() }, + + // send anon event to admin + { action: 'Create', type: 'admin_email', filters: '{ "is_visible": false }', createdAt: new Date(), updatedAt: new Date() } + ]).catch(e => { }) + }, + + down: (queryInterface, Sequelize) => { + return queryInterface.bulkDelete('notification') + } +}